:root {
  color: #171717;
  background: #f4f4f4;
  color-scheme: light;
  font-family: system-ui, sans-serif;
}

body { margin: 0; }
[hidden] { display: none !important; }

main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.toolbar {
  display: grid;
  justify-items: center;
  padding: clamp(0.625rem, 2vw, 0.875rem) 1rem;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  text-align: center;
}

.toolbar h1 {
  margin: 0;
  font-size: clamp(1.125rem, 3.6vw, 1.5rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.title-separator {
  margin-inline: 0.15em;
  color: #737373;
  font-weight: 400;
}

@media (max-width: 47.99rem), (hover: none) and (pointer: coarse) {
  .toolbar { display: none; }
}

.download-bar {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid #e5e5e5;
}

.download-bar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  box-sizing: border-box;
  padding: 0.375rem clamp(0.5rem, 2.5vw, 1rem);
  border-radius: 0.5rem;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}

.download { background: #f3c111; }
.download:hover { background: #ffd12f; }

.whatsapp {
  gap: 0.375rem;
  background: #25d366;
}
.whatsapp:hover { background: #31dc76; }
.whatsapp img { flex: none; }
.download-bar a:focus-visible { outline: 2px solid #202020; outline-offset: 3px; }

.reader {
  position: relative;
  flex: 1;
  min-height: 0;
}

.pdf-scroll {
  position: absolute;
  inset: 0;
  max-width: 64rem;
  margin-inline: auto;
  overflow: auto;
}

.loading {
  position: absolute;
  inset: 1rem 0 auto;
  width: fit-content;
  max-width: calc(100% - 2rem);
  margin-inline: auto;
  padding: 0.75rem 1rem;
  box-sizing: border-box;
  text-align: center;
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 6px rgb(0 0 0 / 15%);
}

.loading p { margin: 0; }
.loading progress { margin-top: 0.5rem; max-width: 100%; }
.loading button {
  min-height: 2.75rem;
  margin-top: 0.5rem;
  padding-inline: 0.875rem;
  border: 1px solid #bbb;
  border-radius: 0.375rem;
  background: #fff;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
