:root {
  color-scheme: light;
  --paper: #f7f6f2;
  --surface: #ffffff;
  --ink: #20231f;
  --muted: #686d67;
  --line: #d8dad3;
  --green: #173c31;
  --green-2: #285b49;
  --green-soft: #e5ede7;
  --danger: #87443c;
  --font-ui: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  --font-editorial: Charter, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --header-height: 72px;
  --shadow: 0 24px 70px rgba(15, 28, 22, .15);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #e8e9e4;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -15%, rgba(255, 255, 255, .72), transparent 42rem),
    #e8e9e4;
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
.pdf-page:focus-visible {
  outline: 3px solid rgba(40, 91, 73, .36);
  outline-offset: 3px;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 80;
  padding: .7rem 1rem;
  border-radius: 999px;
  background: var(--surface);
  color: var(--green);
  font-weight: 750;
  transform: translateY(-170%);
  transition: transform .2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.viewer-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: max(.7rem, env(safe-area-inset-top)) max(24px, calc((100vw - 1440px) / 2));
  border-bottom: 1px solid rgba(216, 218, 211, .9);
  background: rgba(247, 246, 242, .94);
  box-shadow: 0 8px 25px rgba(25, 36, 30, .035);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
}

.viewer-identity,
.header-actions,
.quiet-action,
.download-action,
.page-controls,
.zoom-controls {
  display: flex;
  align-items: center;
}

.viewer-identity {
  min-width: 0;
  gap: 1rem;
}

.brand {
  flex: none;
  padding-block: 5px;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 118px;
  height: auto;
}

.header-rule {
  width: 1px;
  height: 30px;
  background: var(--line);
}

.report-identity {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.report-identity strong {
  overflow: hidden;
  font-size: .78rem;
  letter-spacing: -.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-identity span {
  overflow: hidden;
  color: var(--muted);
  font-size: .68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions {
  flex: none;
  gap: .45rem;
}

.quiet-action,
.download-action {
  min-height: 42px;
  justify-content: center;
  gap: .45rem;
  padding: .62rem .85rem;
  border-radius: 12px;
  color: var(--green);
  font-size: .76rem;
  font-weight: 750;
  text-decoration: none;
}

.quiet-action:hover {
  background: rgba(23, 60, 49, .06);
}

.download-action {
  border: 1px solid var(--green);
  background: var(--green);
  box-shadow: 0 8px 22px rgba(23, 60, 49, .14);
  color: #fff;
}

.download-action:hover {
  background: #214c3e;
}

.viewer-main {
  min-height: calc(100dvh - var(--header-height));
  padding-bottom: 168px;
}

.viewer-toolbar {
  position: sticky;
  top: var(--header-height);
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  min-height: 58px;
  padding: .5rem max(24px, calc((100vw - 1440px) / 2));
  border-bottom: 1px solid rgba(197, 201, 194, .9);
  background: rgba(236, 237, 232, .94);
  box-shadow: 0 9px 28px rgba(19, 31, 25, .04);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}

.edition-switcher {
  display: inline-grid;
  width: max-content;
  grid-template-columns: repeat(2, auto);
  gap: 2px;
  padding: 3px;
  border: 1px solid #cfd2cc;
  border-radius: 11px;
  background: rgba(255, 255, 255, .58);
}

.edition-switcher button {
  min-height: 32px;
  padding: .4rem .7rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #626761;
  cursor: pointer;
  font-size: .68rem;
  font-weight: 720;
}

.edition-switcher button[aria-pressed="true"] {
  background: var(--surface);
  box-shadow: 0 2px 7px rgba(25, 39, 31, .09);
  color: var(--green);
}

.page-controls {
  justify-self: center;
  gap: .35rem;
}

.zoom-controls {
  justify-self: end;
  gap: .25rem;
}

.tool-button,
.zoom-value {
  display: inline-grid;
  min-width: 36px;
  min-height: 36px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #4f554f;
  cursor: pointer;
}

.tool-button:hover:not(:disabled),
.zoom-value:hover:not(:disabled) {
  background: rgba(255, 255, 255, .78);
  color: var(--green);
}

.tool-button:disabled,
.zoom-value:disabled {
  cursor: default;
  opacity: .34;
}

.zoom-value {
  min-width: 52px;
  font-family: var(--font-mono);
  font-size: .66rem;
  font-weight: 720;
}

.page-position {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: .3rem;
  padding: 0 .55rem;
  border: 1px solid #cfd2cc;
  border-radius: 10px;
  background: rgba(255, 255, 255, .72);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .68rem;
}

.page-position input {
  width: 2.1rem;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  text-align: right;
  appearance: textfield;
}

.page-position input::-webkit-inner-spin-button,
.page-position input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.document-stage {
  position: relative;
  min-height: calc(100dvh - var(--header-height) - 58px - 168px);
  overflow-x: auto;
  padding: clamp(1.25rem, 3.5vw, 3.4rem) clamp(1rem, 3.5vw, 3.4rem) 2rem;
  overscroll-behavior-x: contain;
  scrollbar-color: #aeb4ad transparent;
}

.page-shell {
  width: max-content;
  min-width: 100%;
}

.pdf-page {
  position: relative;
  width: 760px;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid rgba(181, 185, 178, .72);
  background: #fff;
  box-shadow: var(--shadow), 0 1px 0 rgba(255, 255, 255, .8);
}

.pdf-page canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

.annotation-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.annotation-layer a {
  position: absolute;
  display: block;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px transparent;
  cursor: pointer;
  pointer-events: auto;
  transition: background-color .16s ease, box-shadow .16s ease;
}

.annotation-layer a:hover,
.annotation-layer a:focus-visible {
  background: rgba(40, 91, 73, .10);
  box-shadow: inset 0 0 0 1px rgba(40, 91, 73, .24);
}

.viewer-status,
.viewer-error {
  display: grid;
  min-height: 52vh;
  place-content: center;
  justify-items: center;
  gap: .45rem;
  color: var(--muted);
  text-align: center;
}

.viewer-status strong,
.viewer-error strong {
  margin-top: .5rem;
  color: var(--ink);
  font-family: var(--font-editorial);
  font-size: 1.35rem;
  letter-spacing: -.02em;
}

.viewer-status > span:last-child,
.viewer-error p {
  margin: 0;
  font-size: .8rem;
}

.status-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid #c7cbc5;
  border-top-color: var(--green-2);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.viewer-status[hidden],
.viewer-error[hidden],
.page-shell[hidden] {
  display: none;
}

.pdf-page.is-rendering {
  opacity: .72;
}

.error-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(135, 68, 60, .22);
  border-radius: 50%;
  background: rgba(135, 68, 60, .08);
  color: var(--danger);
  font-family: var(--font-editorial);
  font-weight: 700;
}

.viewer-error a {
  margin-top: .9rem;
  color: var(--green);
  font-size: .8rem;
  font-weight: 750;
}

.request-dock {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  left: max(18px, env(safe-area-inset-left));
  z-index: 60;
  display: grid;
  width: min(1040px, calc(100vw - 36px));
  min-height: 92px;
  grid-template-columns: minmax(230px, .8fr) minmax(420px, 1.2fr);
  align-items: center;
  gap: 1rem 1.5rem;
  margin-inline: auto;
  padding: .9rem 1rem .9rem 1.3rem;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 22px;
  background: rgba(20, 49, 40, .96);
  box-shadow: 0 24px 65px rgba(10, 27, 21, .28), inset 0 1px 0 rgba(255, 255, 255, .1);
  color: #fff;
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
}

.request-copy {
  display: grid;
  gap: .12rem;
}

.request-copy span {
  color: #a9c7b9;
  font-family: var(--font-mono);
  font-size: .6rem;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.request-copy strong {
  font-family: var(--font-editorial);
  font-size: clamp(1.05rem, 2vw, 1.42rem);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.2;
}

.request-dock form {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: .5rem;
}

.email-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 .95rem;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 13px;
  outline: 0;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: .82rem;
  transition: border-color .2s ease, background-color .2s ease;
}

.email-field input::placeholder {
  color: rgba(255, 255, 255, .63);
}

.email-field input:focus {
  border-color: rgba(255, 255, 255, .62);
  background: rgba(255, 255, 255, .14);
}

.email-field input[aria-invalid="true"] {
  border-color: #e8a59d;
}

.request-dock form button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 0 1.05rem;
  border: 0;
  border-radius: 13px;
  background: #f6f5f0;
  box-shadow: 0 9px 22px rgba(4, 17, 12, .2);
  color: var(--green);
  cursor: pointer;
  font-size: .76rem;
  font-weight: 780;
  white-space: nowrap;
}

.request-dock form button:hover:not(:disabled) {
  background: #fff;
}

.request-dock form button:disabled {
  cursor: wait;
  opacity: .7;
}

.request-dock form button[aria-busy="true"] svg {
  animation: pulse-arrow .8s ease-in-out infinite alternate;
}

@keyframes pulse-arrow {
  to { transform: translateX(3px); }
}

.form-message {
  display: none;
  grid-column: 1 / -1;
  margin: -.55rem 0 0;
  color: #f4d4cf;
  font-size: .7rem;
}

.form-message[data-visible="true"] {
  display: block;
}

.form-message[data-state="success"] {
  margin: 0;
  color: #e9f4ec;
  font-size: .8rem;
  font-weight: 650;
}

.form-message a {
  color: inherit;
  font-weight: 750;
}

.request-dock.is-success {
  grid-template-columns: minmax(230px, .8fr) minmax(320px, 1.2fr);
}

.request-dock.is-success form {
  display: none;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 780px) {
  :root {
    --header-height: 64px;
  }

  .viewer-header {
    min-height: var(--header-height);
    padding-inline: 16px;
  }

  .brand {
    width: 105px;
  }

  .header-rule,
  .quiet-action span,
  .download-action span {
    display: none;
  }

  .quiet-action,
  .download-action {
    width: 40px;
    min-height: 40px;
    padding: 0;
  }

  .viewer-toolbar {
    grid-template-columns: 1fr auto 1fr;
    gap: .35rem;
    min-height: 56px;
    padding: .45rem 12px;
  }

  .edition-switcher button {
    min-height: 30px;
    padding-inline: .52rem;
    font-size: .62rem;
  }

  .page-controls {
    gap: .18rem;
  }

  .tool-button {
    min-width: 32px;
    min-height: 34px;
  }

  .page-position {
    min-height: 34px;
    padding-inline: .38rem;
    font-size: .62rem;
  }

  .zoom-controls .tool-button {
    display: none;
  }

  .zoom-value {
    min-width: 46px;
    min-height: 34px;
    font-size: .6rem;
  }

  .viewer-main {
    padding-bottom: 196px;
  }

  .document-stage {
    min-height: calc(100dvh - var(--header-height) - 56px - 196px);
    padding: 16px 12px 1.25rem;
  }

  .request-dock,
  .request-dock.is-success {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    min-height: 166px;
    grid-template-columns: 1fr;
    align-content: center;
    gap: .65rem;
    padding: .9rem max(16px, env(safe-area-inset-right)) max(.9rem, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    border-width: 1px 0 0;
    border-radius: 22px 22px 0 0;
  }

  .request-copy {
    gap: 0;
  }

  .request-copy strong {
    font-size: 1.08rem;
  }

  .form-message {
    margin-top: -.25rem;
  }
}

@media (max-width: 430px) {
  .viewer-identity {
    gap: .6rem;
  }

  .report-identity strong {
    font-size: .7rem;
  }

  .report-identity span {
    display: none;
  }

  .header-actions {
    gap: .15rem;
  }

  .viewer-toolbar {
    grid-template-columns: auto 1fr auto;
  }

  .edition-switcher button {
    padding-inline: .42rem;
  }

  .edition-switcher button[data-edition="sans"] {
    font-size: 0;
  }

  .edition-switcher button[data-edition="sans"]::after {
    font-size: .62rem;
    content: "Sans";
  }

  .page-position input {
    width: 1.55rem;
  }

  .request-dock form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .request-dock form button {
    min-width: 54px;
    padding-inline: .85rem;
  }

  .request-dock form button span {
    font-size: 0;
  }

  .request-dock form button span::after {
    font-size: .74rem;
    content: "Request";
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
