/* ExactSky — celestial-atlas design system (front-end round, 2026-08).
   Two schemes: deep-night navy + starlight gold (dark, default) and white + navy + bronze
   (light). Display serif for headings/editorial, system sans for UI. Class contracts are shared
   with the admin pages (.panel/.tbl/.btn/.admin-nav/.stack) — restyle, never rename.

   THEME MODEL (owner ask 2026-08-12): default follows the system scheme; the header toggle sets
   an explicit choice as html[data-theme="light"|"dark"] (persisted in localStorage by the tiny
   inline scripts in base.html). CSS therefore needs the light tokens TWICE — once under the
   system media query (guarded so explicit dark wins) and once under [data-theme="light"].
   KEEP THOSE TWO BLOCKS IDENTICAL; same for the scheme-dependent rules further down
   (starfield). An unsupported-JS visitor simply never sees the toggle (it's JS-revealed). */

:root {
  --bg: #0a0e1a;
  --bg-raise: #141c33;
  --panel: #111627;
  --panel-2: #182036;
  --ink: #e9ecf5;
  --muted: #98a1b8;
  --accent: #d8ac5e;            /* starlight gold */
  --accent-soft: rgba(216, 172, 94, 0.14);
  --accent-2: #8fb8de;          /* pale sky blue */
  --cta-bg: #d8ac5e;
  --cta-ink: #14182a;
  --danger: #e07575;
  --warn: #dfb964;
  --line: #252d45;
  --radius: 12px;
  --maxw: 720px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia,
    "Times New Roman", serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #ffffff;
    --bg-raise: #fdfbf4;
    --panel: #fdfcf9;
    --panel-2: #f4f1e8;
    --ink: #20263a;
    --muted: #5c6375;
    --accent: #8e6a20;          /* bronze — AA on white */
    --accent-soft: rgba(142, 106, 32, 0.10);
    --accent-2: #33608d;
    --cta-bg: #232b47;          /* deep navy CTA on white, candlelight text */
    --cta-ink: #f3e7c8;
    --danger: #c04747;
    --warn: #8a6d1d;
    --line: #e8e4d8;
    --shadow: 0 1px 3px rgba(40, 36, 20, 0.07);
  }
}
:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-raise: #fdfbf4;
  --panel: #fdfcf9;
  --panel-2: #f4f1e8;
  --ink: #20263a;
  --muted: #5c6375;
  --accent: #8e6a20;          /* bronze — AA on white */
  --accent-soft: rgba(142, 106, 32, 0.10);
  --accent-2: #33608d;
  --cta-bg: #232b47;          /* deep navy CTA on white, candlelight text */
  --cta-ink: #f3e7c8;
  --danger: #c04747;
  --warn: #8a6d1d;
  --line: #e8e4d8;
  --shadow: 0 1px 3px rgba(40, 36, 20, 0.07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(1100px 520px at 50% -160px, var(--bg-raise), var(--bg) 70%);
  background-repeat: no-repeat;
  font: 16.5px/1.65 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
/* Faint fixed starfield — dark scheme only, three coprime tiles so no visible repeat. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 43px 57px, rgba(233, 236, 245, 0.55), transparent 100%),
    radial-gradient(1px 1px at 341px 203px, rgba(233, 236, 245, 0.4), transparent 100%),
    radial-gradient(1.5px 1.5px at 522px 411px, rgba(216, 172, 94, 0.4), transparent 100%),
    radial-gradient(1px 1px at 137px 337px, rgba(143, 184, 222, 0.4), transparent 100%),
    radial-gradient(1px 1px at 611px 119px, rgba(233, 236, 245, 0.35), transparent 100%);
  background-size: 690px 690px, 690px 690px, 890px 890px, 890px 890px, 1070px 1070px;
  opacity: 0.5;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) body::before { display: none; }
}
:root[data-theme="light"] body::before { display: none; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 4px; }
code {
  background: var(--panel-2);
  padding: 0.1em 0.35em;
  border-radius: 6px;
  font-size: 0.9em;
  font-family: var(--font-mono);
}
::selection { background: var(--accent-soft); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  z-index: 10;
}
.skip-link:focus { left: 8px; }

/* ---- chrome ------------------------------------------------------------------------------- */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.mark { color: var(--accent); text-shadow: 0 0 12px rgba(216, 172, 94, 0.55); }
.brand span { font-weight: 400; }
/* Identity mark (motifs round, 2026-09): the strata mark before the wordmark — 22px in the
   header, 16px in the footer, accent gold with the soft glow the sparkle had. Markup lives in
   _zi_mark.html; this is the kit's §11 lockup as classes instead of inline styles. */
.brand-mark {
  display: inline-block;
  vertical-align: -4px;
  margin-right: 9px;
  color: var(--accent);
  line-height: 0;
}
.brand-mark svg {
  display: block;
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 0 5px rgba(216, 172, 94, 0.35));
}
.foot-brand .brand-mark { vertical-align: -3px; margin-right: 7px; }
.foot-brand .brand-mark svg { width: 16px; height: 16px; }
.site-header nav { display: flex; align-items: center; gap: 18px; }
.site-header nav a { color: var(--muted); font-size: 0.92em; }
.site-header nav a:hover { color: var(--ink); text-decoration: none; }
.nav-cta {
  color: var(--accent) !important;
  border: 1px solid var(--accent);
  padding: 6px 13px;
  border-radius: 999px;
  font-weight: 600;
}
.nav-cta:hover { background: var(--accent-soft); }
/* Light/dark switch — [hidden] until the base.html script reveals it (no-JS = no dead control).
   The icon glyph is set by that script too: sun in dark (what you'll switch to), moon in light. */
.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 30px;
  height: 30px;
  padding: 0;
  line-height: 1;
  font-size: 0.95rem;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--accent); }
.theme-toggle[hidden] { display: none; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 36px 20px 72px; }
.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 20px 56px;
  color: var(--muted);
  font-size: 0.84em;
  border-top: 1px solid var(--line);
}
.foot-brand { font-family: var(--font-display); font-size: 1rem; color: var(--ink); margin: 0 0 6px; }
.foot-nav { margin: 0 0 10px; }
.foot-nav a { color: var(--muted); }
.foot-nav a:hover { color: var(--ink); }

/* ---- type --------------------------------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.18;
}
h1 { font-size: clamp(1.9rem, 4.5vw, 2.45rem); margin: 0 0 14px; }
h2 { font-size: 1.35rem; margin: 34px 0 10px; }
h3 { font-size: 1.08rem; margin: 22px 0 8px; }
.lede {
  font-family: var(--font-display);
  color: var(--muted);
  font-size: 1.16rem;
  line-height: 1.55;
  margin: 0 0 26px;
}
.fine { color: var(--muted); font-size: 0.86rem; margin-top: 12px; }
.hint { color: var(--muted); font-weight: 400; font-size: 0.82em; }
.kicker {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 600;
  margin: 0 0 10px;
}
.muted { color: var(--muted); }
.problem { color: var(--danger); font-size: 0.9rem; margin: 8px 0; }

/* Editorial body (about/method/policy prose) */
.prose { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.72; }
.prose p { margin: 0 0 1.05em; }
.prose strong { color: var(--ink); }

/* ---- buttons ------------------------------------------------------------------------------ */
.cta {
  display: inline-block;
  background: var(--cta-bg);
  color: var(--cta-ink);
  font-weight: 650;
  font-family: var(--font-ui);
  padding: 13px 22px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  font-size: 1rem;
  letter-spacing: 0.01em;
  transition: box-shadow 0.15s ease, filter 0.15s ease;
}
.cta:hover {
  text-decoration: none;
  filter: brightness(1.06);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.cta:disabled { background: var(--panel-2); color: var(--muted); cursor: not-allowed; box-shadow: none; }
.btn {
  display: inline-block;
  background: var(--cta-bg);
  color: var(--cta-ink);
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  font-size: 0.9rem;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn-quiet { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); }

/* ---- landing ------------------------------------------------------------------------------ */
.hero { padding: 30px 0 14px; }
.hero .kicker { margin-bottom: 14px; }
.hero-actions { margin-top: 24px; }
.steps { padding-left: 20px; }
.steps li { margin: 10px 0; }
.steps li::marker { color: var(--accent); font-weight: 700; }

.section { margin-top: 46px; }
.systems { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.sys {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow);
}
.sys .glyph { font-size: 1.3rem; color: var(--accent); display: block; margin-bottom: 6px; }
.sys h3 { margin: 0 0 4px; font-size: 1rem; }
.sys p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }

.faq details {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 10px 0;
  background: var(--panel);
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 1.02rem;
}
.faq details[open] summary { margin-bottom: 6px; }
.faq p { margin: 6px 0 2px; color: var(--muted); }

.cta-final {
  text-align: center;
  border-top: 1px solid var(--line);
  margin-top: 52px;
  padding-top: 40px;
}
.cta-final h2 { margin-top: 0; }

/* signup landing (front-end round 2) + ZI beta page */
.signup .learn-more { margin-top: 30px; }
.waitlist-cta { margin-top: 20px; }
.waitlist-cta .fine { margin: 0 0 8px; }
.zi-purpose { padding-left: 22px; }
.zi-purpose li { margin: 7px 0; }
.zi-purpose li::marker { color: var(--accent); }
/* ZI beta page hero (motifs round, owner spec 2026-09-09): [h1 + intro + purpose] | astrolabe.
   The row may overhang the --maxw column by up to 200px on wide viewports (negative right
   margin scaled to the available margin, never nearer than 40px to the viewport edge); under
   640px it stacks with the graphic at 320px. Glyph size (+15%) and weight (600) are CSS over
   the kit's presentation attributes (zi-motifs.js sets font-size as an attribute; CSS wins). */
.zi-hero {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  margin: 0.6rem 0 0.2rem;
  margin-right: calc(-1 * clamp(0px, (100vw - var(--maxw)) / 2 - 40px, 200px));
}
.zi-hero-text { flex: 1; min-width: 0; }
.zi-hero-graphic {
  flex-shrink: 0;
  width: clamp(220px, 28vw, 400px);
  height: auto;
  aspect-ratio: 1;
}
.zi-hero .zim-astro text { font-weight: 600; }
.zi-hero .zim-astro .zim-rg-w text { font-size: 16.5px; }
.zi-hero .zim-astro .zim-rg-v text { font-size: 13.5px; }
.zi-hero .zim-astro .zim-rg-c text { font-size: 14.5px; }
.participate { padding-left: 0; list-style: none; counter-reset: step; }
.participate > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 4px 44px;
  margin: 22px 0;
}
.participate > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}
.participate h3 { margin: 0 0 6px; }
.participate p { margin: 0; color: var(--muted); }
.participate p strong { color: var(--ink); }

/* beta gate (0b): landing invite entry + waiting-list page */
.beta-gate {
  margin-top: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.beta-gate .invite-inline, .waitlist-join, .invite-entry form { max-width: 420px; }
.beta-gate .invite-inline button, .waitlist-join button, .invite-entry button { margin-top: 12px; }
.invite-entry { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---- forms -------------------------------------------------------------------------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 10px;
  box-shadow: var(--shadow);
}
form label { display: block; margin: 15px 0; font-weight: 600; font-size: 0.95rem; }
form input, form select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  font-size: 1rem;
  font-family: var(--font-ui);
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
}
form input:focus, form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
/* An uppercasing input (invite/promo codes) must not shout its placeholder too. */
form input::placeholder { text-transform: none; color: var(--muted); opacity: 0.75; }
form .row { display: flex; gap: 16px; flex-wrap: wrap; }
form .row > label, form .row > .field { flex: 1 1 180px; }
form .field > label { margin-bottom: 6px; }

/* "Don't know exact birth time" (front-end round 2) */
.check-row { display: flex; gap: 7px; align-items: center; margin-top: 8px; font-size: 0.86rem; }
.check-row input[type="checkbox"] {
  display: inline-block; width: auto; margin: 0; accent-color: var(--accent);
}
.check-row label { display: inline; margin: 0; font-weight: 400; color: var(--muted); cursor: pointer; }
/* A checkbox beside a label that wraps (the team-reading line, owner 2026-10-20): the box sits on
   the first line, and the row keeps clear of the button below it. */
.check-row.check-wrap { align-items: flex-start; margin-bottom: 18px; }
.check-row.check-wrap input[type="checkbox"] { margin-top: 0.3em; flex: none; }
/* The cohort notify-me choices: each checkbox beside its label (the generic `form input` rule
   would stretch it into a full-width block above the text). */
.cohort-notify fieldset { border: 0; margin: 15px 0 18px; padding: 0; }
.cohort-notify legend { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; padding: 0; }
form label.check { display: flex; gap: 10px; align-items: center; margin: 10px 0; font-weight: 400; cursor: pointer; }
form label.check input[type="checkbox"] {
  display: inline-block; width: auto; margin: 0; padding: 0; accent-color: var(--accent);
}
.info-tip {
  position: relative;
  display: inline-block;
  color: var(--accent-2);
  cursor: help;
  line-height: 1;
}
.info-tip .tip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 140%;
  left: 50%;
  transform: translateX(-50%);
  width: 230px;
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.8rem;
  font-weight: 400;
  font-style: normal;
  line-height: 1.45;
  z-index: 5;
  box-shadow: var(--shadow);
  transition: opacity 0.15s ease;
}
.info-tip:hover .tip, .info-tip:focus .tip, .info-tip:focus-within .tip {
  visibility: visible;
  opacity: 1;
}
.bt-confirm h2 { margin-top: 0; }
/* The birth-city typeahead (place-lookup.js) and the "which one?" list (pre-share fix 1). */
.place-field { position: relative; margin: 15px 0; }
.place-field > label { margin: 0 0 6px; }
.place-field .hint { display: block; margin-top: 6px; }
.place-suggest {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 10;
  margin: 2px 0 0;
  padding: 4px 0;
  list-style: none;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: 18rem;
  overflow-y: auto;
}
.place-suggest[hidden] { display: none; }
.place-suggest li { padding: 8px 12px; cursor: pointer; overflow-wrap: anywhere; }
.place-suggest li[aria-selected="true"], .place-suggest li:hover { background: var(--accent-soft); }
fieldset.place-choices { border: 0; margin: 4px 0 12px; padding: 0; }
fieldset.place-choices[hidden] { display: none; }
fieldset.place-choices legend { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; padding: 0; }
fieldset.place-choices .check-row label { color: var(--ink); }
.manual { margin: 12px 0; border: 1px dashed var(--line); border-radius: 8px; padding: 8px 12px; }
.manual summary { cursor: pointer; color: var(--muted); }
.errors {
  background: color-mix(in srgb, var(--danger) 12%, var(--panel));
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 16px 0;
}
.errors ul { margin: 6px 0 0; }
.chart-pick {
  display: block;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 10px 0;
  font-weight: 500;
  cursor: pointer;
}
.chart-pick input { display: inline-block; width: auto; margin: 0 8px 0 0; accent-color: var(--accent); }

/* ---- progress ----------------------------------------------------------------------------- */
.progress-page { text-align: center; }
.progress-page .reading-actions { justify-content: center; }   /* the film replay's two links */
.status { text-align: center; }
.state-copy { font-size: 1.15rem; font-weight: 600; font-family: var(--font-display); margin: 22px 0 14px; }
.bar {
  height: 12px;
  background: var(--panel-2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.5s ease;
}
.bar-fill.indeterminate { width: 30% !important; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
.bar-label { color: var(--muted); font-size: 0.85rem; margin-top: 8px; }
/* The free reading's stage checklist (app.READING_STAGES). */
.stages {
  list-style: none;
  padding: 0;
  margin: 22px auto 0;
  max-width: 420px;
  text-align: left;
  font-size: 0.92rem;
}
.stages .stage { display: flex; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.stages .mark { width: 1.1em; flex: none; text-align: center; }
.stages .stage-done { color: var(--muted); }
.stages .stage-done .mark { color: var(--accent); }
.stages .stage-current { color: var(--ink); font-weight: 600; }
.stages .stage-current .mark { color: var(--accent); animation: stage-pulse 1.4s ease-in-out infinite; }
.stages .stage-pending { color: var(--muted); opacity: 0.6; }
@keyframes stage-pulse { 50% { opacity: 0.4; } }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.stall {
  background: var(--panel);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px 0;
  text-align: left;
}
.stall.parked { border-color: var(--warn); }
.stall .reason { color: var(--muted); font-size: 0.85rem; margin-top: 8px; }

/* ---- teaser + reading --------------------------------------------------------------------- */
.teaser .reading {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 30px;
  margin: 20px 0;
  box-shadow: var(--shadow);
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.72;
}
.reading h2 { color: var(--accent); margin-top: 26px; font-size: 1.25rem; }
.reading h2:first-child { margin-top: 0; }
/* Provenance line (edition · chart/run ids · template tag): honest, but quiet — it's for
   support conversations, not the reader's eye. */
.reading .teaser-meta { color: var(--muted); font-style: italic; font-size: 0.72rem; opacity: 0.8; }
.reading blockquote {
  margin: 1em 0;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}
/* Definitions on tap (owner 2026-10-10, the terms-v3.1 adoption): web/teaser_defs.py marks the first
   use of each named term per section with the paid viewer's code and opens its glossary entry in a
   side drawer. The class names are the viewer's (web/viewer_nav.py); the colors are the site's.
   Every rule is keyed on html.zirdefs-on, which the script sets only once the registry has loaded,
   so no JS (or no registry) is the plain page. */
html.zirdefs-on .reading .zir-def {
  appearance: none; background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer; text-align: inherit; line-height: inherit;
  border-bottom: 1px dotted var(--muted);
}
html.zirdefs-on .reading .zir-def:hover,
html.zirdefs-on .reading .zir-def:focus-visible { color: var(--accent); border-bottom-style: solid; }
html.zirdefs-on .zirnav-def {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); box-sizing: border-box;
  background: var(--panel); color: var(--ink); border-left: 1px solid var(--line);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.35); z-index: 90; overflow: auto;
  padding: 14px 20px 28px; transform: translateX(102%); transition: transform 0.18s ease;
  font: 15px/1.55 var(--font-ui);
}
html.zirdefs-on .zirnav-def.zn-open { transform: none; }
.zirnav-def .zn-dhead { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 6px; }
.zirnav-def .zn-dhead button,
.zirnav-def .zir-def {
  background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 6px;
  padding: 3px 8px; font: 12px var(--font-ui); cursor: pointer;
}
.zirnav-def .zn-dhead button:disabled { opacity: 0.4; cursor: default; }
.zirnav-def .zir-def:hover, .zirnav-def .zn-dhead button:hover:not(:disabled) {
  color: var(--ink); border-color: var(--accent);
}
.zirnav-def .zn-deyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); }
.zirnav-def .zn-dorig { text-transform: none; letter-spacing: 0; font-size: 16px; color: var(--ink); }
.zirnav-def .zn-dtr { text-transform: none; letter-spacing: 0; font-style: italic; }
.zirnav-def h3 { margin: 4px 0 6px; font-size: 20px; line-height: 1.2; color: var(--ink); }
.zirnav-def .zn-dgloss { font-weight: 600; margin: 0 0 8px; }
.zirnav-def .zn-ddetail, .zirnav-def .zn-ddepth { margin: 0 0 8px; }
.zirnav-def .zn-facts { border-collapse: collapse; margin: 0 0 8px; font-size: 13px; }
.zirnav-def .zn-facts td { padding: 2px 10px 2px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.zirnav-def .zn-dsee { margin: 8px 0; font-size: 13px; }
.zirnav-def .zn-dsee span { color: var(--muted); margin-right: 6px; }
.zirnav-def .zn-dmore { margin-top: 14px; }
.zirnav-def .zn-dmore summary {
  cursor: pointer; list-style: none; padding: 10px 13px; border: 1px solid var(--accent);
  border-radius: 9px; background: var(--accent-soft); color: var(--accent); font: 600 13.5px/1.2 var(--font-ui);
}
.zirnav-def .zn-dmore summary::-webkit-details-marker { display: none; }
.zirnav-def .zn-dmore[open] summary {
  background: none; border-color: transparent; border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 0 0 6px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.09em;
}
.zirnav-def .zn-dcoin { font-style: italic; color: var(--accent); margin: 8px 0 2px; }
.zirnav-def .zn-doct { margin: 6px 0; }
.zirnav-def .zn-doct b, .zirnav-def .zn-dsig b {
  text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.07em; color: var(--muted); margin-right: 4px;
}
.zirnav-def .zn-dsig { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
@media print { .zirnav-def { display: none !important; } }
.upsell {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-top: 22px;
}
.upsell h2 { margin-top: 0; }
.upsell s { color: var(--muted); }

.error-page { text-align: center; padding: 40px 0; }
.error-page h1 { font-size: 4rem; color: var(--muted); }
/* The 500 page's heading is a sentence, not a code (server_error.html). */
.error-page h1.error-title { font-size: 2rem; color: var(--ink); }

/* ---- about -------------------------------------------------------------------------------- */
.letter {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin: 26px 0;
  box-shadow: var(--shadow);
}
.letter .prose p:last-of-type { margin-bottom: 0; }
.sig { font-family: var(--font-display); font-style: italic; margin-top: 18px; }

/* ---- P4: account + admin ------------------------------------------------------------------ */
.flashes { margin: 12px 0; }
.flash { border-radius: 8px; padding: 10px 14px; margin: 6px 0; border: 1px solid var(--line); }
.flash-ok { background: color-mix(in srgb, var(--accent) 12%, var(--panel)); border-color: var(--accent); }
.flash-error { background: color-mix(in srgb, var(--danger) 14%, var(--panel)); border-color: var(--danger); }
.account-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 12px 0;
  box-shadow: var(--shadow);
}
.panel h2, .panel h3 { margin-top: 4px; }
/* Reading journeys (2026-10-11): the intake's "includes a full reading" banner and the first
   reading page's full-reading banner (live section count, then "Open your full reading →"). */
.journey-banner { border-left: 3px solid var(--accent); }
.journey-banner p:last-child { margin-bottom: 0; }
.journey-banner .state-copy { margin: 10px 0 0; font-size: 1rem; }
/* Reading journeys, part 2 (gifts): the gift form's delivery choice and note (C1), the send form
   on the gift's first reading page (C6), the recipient's note (D2) and the access choice
   (decision 4: the opening page's question and the account page's switch). */
fieldset.gift-delivery { border: 0; margin: 15px 0 6px; padding: 0; }
fieldset.gift-delivery legend { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; padding: 0; }
.check-row input[type="radio"] {
  display: inline-block; width: auto; margin: 0; accent-color: var(--accent);
}
fieldset.gift-delivery input[type="email"] { margin: 6px 0 4px 22px; width: calc(100% - 22px); }
form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  font-size: 1rem;
  font-family: var(--font-ui);
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  resize: vertical;
}
form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gift-send label { margin: 10px 0; }
.gift-note {
  margin: 14px 0;
  padding: 8px 16px;
  border-left: 3px solid var(--accent);
  white-space: pre-line;
  font-style: italic;
}
/* The account page's groups (owner 2026-10-13): one card per reading with its buttons in a row,
   and a gift's send form under its one-line explanation. */
.account-who { overflow-wrap: anywhere; }   /* a long email never widens a phone screen */
.reading-card h3 { margin: 2px 0 4px; }
.reading-card p { margin: 6px 0; }
.reading-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.share-block { margin-top: 12px; padding-top: 4px; border-top: 1px solid var(--line); }
.share-form label { margin: 10px 0; }
.share-form textarea { margin-top: 6px; }
.share-again summary { cursor: pointer; color: var(--muted); margin: 6px 0; }
.gift-access { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.gift-access .btn.is-current { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.tbl { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.9rem; }
.tbl th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  padding: 7px 8px;
}
.tbl td { border-bottom: 1px solid var(--line); padding: 7px 8px; vertical-align: top; }
.tbl form { display: inline; margin: 0; }
.tbl input { margin: 0; display: inline-block; width: auto; }
.code { font-family: var(--font-mono); letter-spacing: 0.03em; }
.stack label { display: block; margin: 10px 0; }
.stack input, .stack select { max-width: 420px; }
.stack fieldset { border: 1px dashed var(--line); border-radius: 8px; margin: 12px 0; padding: 8px 14px; }
.stack-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 12px 0; }
.stack-row label { margin: 0; }
input.narrow { width: 90px; }
.admin-nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: baseline;
  padding: 10px 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.admin-nav .muted { margin-left: auto; }

/* ---- questions for a member (A5, /questions/<id>) ----------------------------------------- */
/* The generic `form label` / `form input` rules above make every control a full-width block;
   this form lays radios, date parts and ticks out inline, so it resets them here. */
.questions-form { display: flex; flex-direction: column; gap: 30px; margin-top: 20px; }
.questions-form label { margin: 0; font-size: 0.95rem; }
.questions-form input, .questions-form select {
  display: inline-block; width: auto; max-width: 100%; margin: 0; padding: 7px 9px;
  font-size: 0.95rem;
}
.questions-form textarea {
  display: block; width: 100%; margin: 0; padding: 10px 12px; resize: vertical;
  font: inherit; font-size: 0.97rem; color: var(--ink); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px;
}
.questions-form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.q-section { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
/* Save returns to #s-<section>: leave a little air above the heading it lands on. */
.q-section > h2 { margin: 0; scroll-margin-top: 16px; }
.q-part {
  display: block; margin-bottom: 2px; font-family: var(--font-ui); font-size: 0.78rem;
  font-weight: 600; letter-spacing: 0.04em; color: var(--muted);
}
.q-themes .themes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.q-themes .theme { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.q-themes .theme-more { display: flex; flex-direction: column; gap: 4px; padding-left: 24px; }
.q-saved { font-size: 0.9rem; color: var(--muted); }
.questions-form input.q-when { width: 14em; }
.q details.more > summary { cursor: pointer; width: fit-content; }
.q details.more > textarea { margin-top: 6px; }
.q-intro { margin: 0; color: var(--muted); }
.q {
  display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.q .q-prompt { margin: 0; font-weight: 600; }
.q .hint { margin: 0; }
.q .choices { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.q label.choice { display: inline-flex; align-items: center; gap: 7px; font-weight: 400; cursor: pointer; }
.q label.choice input, .q label.tick input { padding: 0; accent-color: var(--accent); }
.q-themes label.choice input { width: 17px; height: 17px; flex: none; }
.q .more-lab { font-weight: 400; font-size: 0.88rem; color: var(--muted); }
.ev-rows { display: flex; flex-direction: column; }
.ev-row { display: flex; flex-direction: column; gap: 7px; padding: 12px 0; border-top: 1px dashed var(--line); }
.ev-row:first-child { border-top: 0; padding-top: 4px; }
.ev-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ev-lab { min-width: 8.4em; font-weight: 600; font-size: 0.9rem; }
.questions-form input.ev-year { width: 5.4em; font-variant-numeric: tabular-nums; }
.ev-what input { flex: 1 1 240px; }
.q label.tick { display: inline-flex; align-items: center; gap: 5px; font-weight: 400; font-size: 0.88rem; color: var(--muted); cursor: pointer; }
.ev-more { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
/* `.btn { display: inline-block }` would beat the browser's [hidden] rule, and "Add a row" only
   works with JavaScript (which un-hides it). */
.questions-form [hidden] { display: none !important; }
.ev-num { margin: 0; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }
.q-actions {
  position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 10px;
  align-items: center; padding: 12px 0; background: var(--bg); border-top: 1px solid var(--line);
}
.q-actions .cta, .q-actions .btn { margin: 0; }

/* ---- responsive + motion ------------------------------------------------------------------ */
@media (max-width: 640px) {
  .wrap { padding: 26px 16px 56px; }
  .ev-lab { min-width: 100%; }
  .q-actions { gap: 8px; padding: 8px 0; }
  .q-actions .cta { padding: 9px 14px; font-size: 0.95rem; }
  .q-actions .btn { padding: 8px 12px; }
  /* The header must fit a 360px viewport without forcing horizontal overflow: tighter
     padding/gaps, smaller nav type, and the whole row may wrap onto two lines. */
  .site-header { padding: 10px 14px; gap: 8px; }
  .site-header nav { gap: 10px; flex-wrap: wrap; }
  .site-header nav a { font-size: 0.84em; }
  .nav-cta { padding: 5px 10px; }
  .brand { font-size: 1.02rem; }
  .systems { grid-template-columns: 1fr; }
  .teaser .reading { padding: 22px 18px; }
  .account-head { flex-wrap: wrap; }
  /* ZI hero: stack, graphic centred at up to 320px, no overhang. */
  .zi-hero { flex-direction: column; margin-right: 0; }
  .zi-hero-graphic { width: min(78vw, 320px); align-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bar-fill, .cta { transition: none; }
  .bar-fill.indeterminate { animation: none; width: 100% !important; opacity: 0.45; }
  .stages .stage-current .mark { animation: none; }
  html.zirdefs-on .zirnav-def { transition: none; }
}
