/* BibleScan — design system
   Editorial and typographic: warm paper, bookish serif display,
   one deep liturgical red used sparingly, hairline structure.
   No gradients, no glows, no emoji chrome. */

:root {
  --bg: #eef3f7;
  --card: #ffffff;
  --ink: #0c1a24;
  --ink-2: #46606f;
  --ink-3: #6d8697;
  --line: #d8e4ec;
  --line-2: #bacddb;
  --accent: #0a6f9e;
  --accent-ink: #ffffff;
  --accent-soft: #dcecf5;
  --ot: #8a5a12;
  --ot-soft: #f4ead6;
  --nt: #14705c;
  --nt-soft: #d9efe8;
  --r: 12px;
  --r-s: 8px;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #060a0f;
    --card: #0e1620;
    --ink: #e6f1f8;
    --ink-2: #9db2c2;
    --ink-3: #6b8496;
    --line: #182634;
    --line-2: #27394b;
    --accent: #5cc8f5;
    --accent-ink: #04121b;
    --accent-soft: #12293a;
    --ot: #e8b169;
    --ot-soft: #2a2214;
    --nt: #6fd8b4;
    --nt-soft: #10261f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #060a0f;
  --card: #0e1620;
  --ink: #e6f1f8;
  --ink-2: #9db2c2;
  --ink-3: #6b8496;
  --line: #182634;
  --line-2: #27394b;
  --accent: #5cc8f5;
  --accent-ink: #04121b;
  --accent-soft: #12293a;
  --ot: #e8b169;
  --ot-soft: #2a2214;
  --nt: #6fd8b4;
  --nt-soft: #10261f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  padding-bottom: env(safe-area-inset-bottom);
  touch-action: manipulation;
}
a { color: var(--accent); text-underline-offset: 3px; }
::selection { background: var(--accent-soft); }
button { touch-action: manipulation; font-family: var(--sans); }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(11px + env(safe-area-inset-top)) 20px 11px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--ink); }
.brand-mark {
  font-family: var(--serif); font-size: 15px; color: var(--accent); line-height: 1;
}
.brand-name { font-family: var(--serif); font-size: 21px; font-weight: 700; letter-spacing: -.2px; }
.brand-name span { color: inherit; }
.lang-select {
  font: 600 13px var(--sans);
  color: var(--ink-2); background: transparent;
  border: 1px solid var(--line-2); border-radius: var(--r-s);
  padding: 6px 10px; max-width: 44vw;
}

/* ---------- breadcrumbs ---------- */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  max-width: 720px; margin: 0 auto;
  padding: 14px 20px 0; font-size: 13px; color: var(--ink-3);
}
.crumbs:empty { display: none; }
.crumbs a { text-decoration: none; font-weight: 600; color: var(--ink-2); }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs .sep { color: var(--ink-3); }
.crumbs .here { font-weight: 600; color: var(--ink); }

/* ---------- layout ---------- */
main { max-width: 720px; margin: 0 auto; padding: 20px; }
.loading { text-align: center; color: var(--ink-2); padding: 56px 0; }

.hero { margin: 20px 0 28px; }
.home-hero { margin-top: 9vh; }
.hero h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(34px, 8.5vw, 50px);
  line-height: 1.06; letter-spacing: -.5px; margin: 0 0 12px;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p { margin: 0; color: var(--ink-2); font-size: 15.5px; max-width: 46ch; }

.section-label {
  display: flex; align-items: baseline; gap: 10px;
  margin: 30px 0 12px;
  font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .18em; color: var(--ink-3);
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-label .count { font-weight: 500; letter-spacing: .02em; text-transform: none; font-size: 12px; }

/* ---------- home search ---------- */
.search-wrap { position: relative; margin-top: 4px; }
.refbox {
  width: 100%; font: 500 18px var(--sans); letter-spacing: -.1px;
  padding: 16px 18px; border-radius: var(--r);
  border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink);
  transition: border-color .12s ease;
}
.refbox::placeholder { color: var(--ink-3); }
.refbox:focus { outline: none; border-color: var(--accent); }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20;
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: var(--r); overflow: hidden;
  box-shadow: 0 12px 32px rgb(32 28 21 / .10);
}
.suggest:empty { display: none; }
.sug {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  width: 100%; padding: 13px 17px; cursor: pointer; text-align: left;
  border: 0; background: none; color: var(--ink); font: inherit;
}
.sug + .sug { border-top: 1px solid var(--line); }
.sug.active, .sug:hover { background: var(--accent-soft); }
.sug-name { font-family: var(--serif); font-weight: 700; font-size: 16.5px; }
.sug-meta { font-size: 12.5px; color: var(--ink-3); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px;
  border: 1px solid var(--line-2); background: var(--card); border-radius: 999px;
  padding: 8px 15px; transition: border-color .12s ease;
}
.chip:hover { border-color: var(--accent); }
.chip-sub { color: var(--ink-3); font-weight: 500; }
.browse-link { margin-top: 36px; font-size: 14px; }
.browse-link a { color: var(--ink-3); font-weight: 500; }
.browse-link a:hover { color: var(--accent); }

/* ---------- book / chapter grids ---------- */
.book-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
}
.book-btn {
  appearance: none; border: 1px solid var(--line); background: var(--card);
  border-radius: var(--r-s);
  padding: 11px 12px 9px; text-align: left; cursor: pointer;
  color: var(--ink); font: inherit; text-decoration: none; display: block;
  transition: border-color .12s ease;
}
.book-btn:hover { border-color: var(--accent); }
.book-btn .bname { display: block; font-family: var(--serif); font-weight: 700; font-size: 15px; }
.book-btn .bmeta { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

.title-block h1 {
  font-family: var(--serif); margin: 8px 0 4px; font-weight: 700;
  font-size: clamp(28px, 6.5vw, 36px); letter-spacing: -.4px;
}
.title-block p { margin: 0 0 18px; color: var(--ink-2); font-size: 14px; }
.chapter-grid {
  display: grid; gap: 7px;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
}
.ch-btn {
  appearance: none; border: 1px solid var(--line); background: var(--card);
  border-radius: var(--r-s);
  padding: 9px 4px 7px; text-align: center; cursor: pointer;
  color: var(--ink); font: inherit; text-decoration: none; display: block;
  font-variant-numeric: tabular-nums;
  transition: border-color .12s ease;
}
.ch-btn:hover { border-color: var(--accent); }
.ch-btn .n { display: block; font-family: var(--serif); font-size: 18px; font-weight: 700; }
.ch-btn .vv { display: block; font-size: 10.5px; color: var(--ink-3); }

/* ---------- badges ---------- */
.badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .14em;
  padding: 3px 9px 2px; border-radius: 4px;
}
.badge.ot { color: var(--ot); background: var(--ot-soft); }
.badge.nt { color: var(--nt); background: var(--nt-soft); }
.badge.soft { color: var(--accent); background: var(--accent-soft); }

/* ---------- synopsis ---------- */
.syn-card {
  border-top: 2px solid var(--ink);
  padding: 14px 0 6px; margin: 8px 0 18px;
}
.syn-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
.syn-body p { margin: 0 0 11px; font-size: 15.5px; line-height: 1.68; }
.syn-body > p:first-of-type::first-letter {
  font-family: var(--serif); font-size: 40px; line-height: .85;
  float: left; padding: 4px 8px 0 0; color: var(--accent);
}
.syn-themes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ---------- walkthrough CTA ---------- */
.walk-cta {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  color: var(--accent-ink); background: var(--ink);
  border-radius: var(--r); padding: 15px 18px; margin-bottom: 10px;
  transition: opacity .12s ease, transform .1s ease;
}
.walk-cta:hover { opacity: .92; }
.walk-cta:active { transform: scale(.99); }
.walk-avatars { display: flex; flex: none; }
.av {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  font-family: var(--serif); font-weight: 700; font-size: 14px;
}
.av-sam  { background: var(--accent); color: var(--accent-ink); }
.av-alma { background: var(--bg); color: var(--ink); border: 1px solid var(--line-2); }
.walk-avatars .av + .av { margin-left: -8px; }
.walk-main { flex: 1; min-width: 0; }
.walk-title { display: block; font-family: var(--serif); font-weight: 700; font-size: 16.5px; }
.walk-sub { display: block; font-size: 12.5px; opacity: .75; margin-top: 1px; }
.walk-cta .go { flex: none; font-size: 16px; opacity: .8; }

/* ---------- collapsible sections ---------- */
.src-details { border-top: 1px solid var(--line); }
.src-details:last-of-type { border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.src-details summary {
  cursor: pointer; font-weight: 600; font-size: 14.5px; padding: 14px 2px;
  color: var(--ink); list-style: none; display: flex; align-items: baseline; gap: 10px;
}
.src-details summary::-webkit-details-marker { display: none; }
.src-details summary::before {
  content: "+"; font-family: var(--serif); color: var(--ink-3);
  width: 14px; flex: none; text-align: center;
}
.src-details[open] summary::before { content: "−"; }
.src-details summary .count { font-weight: 500; font-size: 12.5px; color: var(--ink-3); }
.src-details .comm-list { margin: 2px 0 16px; }

/* ---------- commentary list ---------- */
.comm-list { list-style: none; margin: 0; padding: 0; }
.comm-card {
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 11px 2px; text-decoration: none; color: var(--ink);
}
.comm-list li:last-child .comm-card { border-bottom: 0; }
.comm-card:hover .comm-title { color: var(--accent); }
.comm-main { flex: 1; min-width: 0; }
.comm-title { font-family: var(--serif); font-weight: 700; font-size: 15.5px; transition: color .12s ease; }
.comm-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.comm-card .go { color: var(--ink-3); flex: none; font-size: 14px; }
.empty { text-align: center; color: var(--ink-2); padding: 36px 0; }
.note {
  font-size: 13px; color: var(--ink-2);
  border-left: 2px solid var(--line-2);
  padding: 2px 0 2px 14px; margin-top: 16px;
}

/* ---------- toolkit ---------- */
.tool-grid {
  display: grid; gap: 8px; margin: 4px 0 16px;
  grid-template-columns: repeat(2, 1fr);
}
.tool-card {
  display: flex; flex-direction: column; gap: 2px;
  text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); background: var(--card);
  border-radius: var(--r-s); padding: 13px 14px 11px;
  transition: border-color .12s ease;
}
.tool-card:hover { border-color: var(--accent); }
.tool-title { font-family: var(--serif); font-weight: 700; font-size: 15px; }
.tool-sub { font-size: 12px; color: var(--ink-3); line-height: 1.4; margin-top: 2px; }

.days-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 2px 0 16px; }
.days-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); margin-right: 2px; }
.day-chip {
  font: 600 13.5px var(--sans); color: var(--ink); cursor: pointer;
  border: 1px solid var(--line-2); background: var(--card);
  border-radius: 999px; padding: 6px 13px;
  transition: all .12s ease;
}
.day-chip:hover { border-color: var(--accent); }
.day-chip.on { background: var(--ink); color: var(--accent-ink); border-color: var(--ink); }
.days-input {
  width: 54px; font: 600 13.5px var(--sans); text-align: center;
  color: var(--ink); background: var(--card);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 8px;
}
.days-input:focus { outline: none; border-color: var(--accent); }

.doc-card {
  border-top: 2px solid var(--ink);
  padding: 16px 0 4px; margin-bottom: 10px; min-height: 80px;
}
.doc-body p { margin: 0 0 13px; font-size: 15.5px; line-height: 1.7; }
.doc-body h4 {
  font-family: var(--serif); margin: 20px 0 8px; font-size: 17px; letter-spacing: -.2px;
}
.doc-body h4:first-child { margin-top: 0; }
.doc-body .day-head { color: var(--accent); }
.doc-body .role {
  font-family: var(--sans); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em; color: var(--accent);
  margin-right: 2px;
}

.tool-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-bottom: 8px; }
.pill-btn {
  font: 600 14px var(--sans); cursor: pointer;
  color: var(--ink); background: var(--card);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 9px 18px;
  transition: border-color .12s ease;
}
.pill-btn:hover { border-color: var(--accent); }
.pill-btn.accent { color: var(--accent-ink); background: var(--ink); border-color: var(--ink); }
.pill-btn.accent:disabled { opacity: .55; cursor: default; }
.vpills { display: inline-flex; gap: 5px; margin-left: 2px; }
.vpill {
  font: 600 12px var(--sans); cursor: pointer; color: var(--ink-2);
  border: 1px solid var(--line); background: none;
  border-radius: 999px; padding: 6px 11px;
}
.vpill.on { color: var(--accent); border-color: var(--accent); }

/* ---------- walkthrough chat ---------- */
.walk-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.walk-head h1 {
  font-family: var(--serif); margin: 8px 0 12px; font-weight: 700;
  font-size: clamp(24px, 6vw, 30px); letter-spacing: -.3px;
}
.walk-progress { font-size: 12.5px; font-weight: 600; color: var(--ink-3); flex: none; font-variant-numeric: tabular-nums; }
.chat { display: flex; flex-direction: column; gap: 12px; padding-bottom: 8px; }
.vdivider {
  display: flex; align-items: center; gap: 12px; margin: 20px 0 6px;
  position: sticky; top: calc(52px + env(safe-area-inset-top)); z-index: 5;
}
.vdivider::before, .vdivider::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.vdivider span {
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-2); background: var(--bg);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 12px 3px;
}
.vbody { display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; gap: 9px; align-items: flex-start; }
.msg .av { width: 26px; height: 26px; font-size: 12px; flex: none; margin-top: 2px; }
.bubble {
  border-radius: var(--r); padding: 10px 14px; font-size: 15px; line-height: 1.62;
  max-width: 88%;
}
.m-alma .bubble { background: var(--card); border: 1px solid var(--line); }
.m-sam .bubble { background: var(--accent-soft); border: 1px solid transparent; }
.cite {
  display: inline; font: 600 13px var(--sans); color: var(--accent);
  background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  text-decoration: underline; text-decoration-style: dotted;
  text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.cite:hover { text-decoration-style: solid; }
.thinking { display: inline-flex; gap: 4px; padding: 3px 2px; }
.thinking i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3);
  animation: blink 1.2s infinite ease-in-out;
}
.thinking i:nth-child(2) { animation-delay: .18s; }
.thinking i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 70%, 100% { opacity: .25; } 35% { opacity: 1; } }

.walk-foot { padding: 14px 0 6px; }
.cta {
  display: block; width: 100%; text-align: center;
  font: 600 15px var(--sans); letter-spacing: .01em;
  color: var(--accent-ink); background: var(--ink); border: 0; border-radius: var(--r);
  padding: 14px; cursor: pointer; text-decoration: none;
  transition: opacity .12s ease, transform .1s ease;
}
.cta:hover { opacity: .92; }
.cta:active { transform: scale(.99); }
.walk-done { text-align: center; padding: 10px 0; }
.walk-done p { margin: 4px 0; }

/* ---------- pager / misc ---------- */
.pager { display: flex; gap: 9px; margin: 22px 0 4px; }
.pager a, .pager .spacer { flex: 1; }
.pager a {
  display: block; text-align: center; text-decoration: none;
  font-weight: 600; font-size: 13.5px;
  padding: 10px; border-radius: var(--r-s); border: 1px solid var(--line);
  background: var(--card); color: var(--ink-2);
  transition: border-color .12s ease, color .12s ease;
}
.pager a:hover { border-color: var(--accent); color: var(--ink); }

.dim { color: var(--ink-2); font-size: 14px; }
.center { text-align: center; }
.linkish {
  background: none; border: 0; color: var(--accent); font: 600 14px var(--sans);
  cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px;
}
.ai-off {
  border-left: 2px solid var(--line-2);
  padding: 2px 0 2px 14px; font-size: 14px; color: var(--ink-2);
}
.ai-off p { margin: 0 0 6px; }

.foot { max-width: 720px; margin: 30px auto 0; padding: 0 20px 32px; }
.foot p { font-size: 12.5px; color: var(--ink-3); border-top: 1px solid var(--line); padding-top: 16px; margin: 0; }
.foot a { color: var(--ink-2); }

/* ---------- citation sheet ---------- */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgb(4 10 16 / .55);
}
.sheet {
  width: 100%; max-width: 560px; background: var(--card);
  border-radius: var(--r) var(--r) 0 0; border: 1px solid var(--line-2); border-bottom: 0;
  padding: 10px 22px calc(22px + env(safe-area-inset-bottom));
  animation: sheetup .22s ease-out;
}
@keyframes sheetup { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-bar { width: 36px; height: 3px; border-radius: 999px; background: var(--line-2); margin: 6px auto 16px; }
.sheet h3 { font-family: var(--serif); margin: 0 0 2px; font-size: 19px; letter-spacing: -.2px; }
.sheet blockquote {
  margin: 12px 0; padding: 2px 0 2px 14px; border-left: 2px solid var(--accent);
  font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--ink-2);
}
.sheet .cta { margin: 12px 0; }
.sheet .sheet-close { display: block; margin: 0 auto; }

/* ---------- motion ---------- */
.view { animation: rise .2s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .view { animation: none; }
  * { transition: none !important; animation: none !important; }
}

@media (min-width: 560px) {
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(122px, 1fr)); }
  .tool-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ========== v4: cache, audio, batch ========== */
.cta:disabled { opacity: .55; cursor: default; }
.prep-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0 0 14px; }
.prep-row .day-chip:disabled { opacity: .6; cursor: default; }
.syn-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.vlisten {
  font: 600 12px var(--sans); color: var(--accent); cursor: pointer;
  background: none; border: 1px solid var(--line-2); border-radius: 999px;
  padding: 3px 11px; flex: none;
  transition: border-color .12s ease;
}
.vlisten:hover { border-color: var(--accent); }

/* ========== v7: scale UX — scrubber, collapse, studies, prepared ========== */

/* verse scrubber */
.scrub {
  display: flex; gap: 5px; overflow-x: auto; padding: 2px 0 12px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.scrub::-webkit-scrollbar { display: none; }
.scell {
  flex: none; min-width: 34px; padding: 6px 5px 5px; text-align: center;
  font: 600 12.5px var(--sans); font-variant-numeric: tabular-nums;
  color: var(--ink-3); background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-s); cursor: pointer;
  transition: border-color .12s ease;
}
.scell:hover { border-color: var(--accent); }
.scell.read { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.scell.ready { border-color: var(--accent); color: var(--ink-2); }
.scell.gen { border-style: dashed; color: var(--ink-2); }
.scell.cur { background: var(--ink); color: var(--accent-ink); border-color: var(--ink); }

/* collapsible verse sections */
.vsec .vdivider {
  position: static; display: flex; align-items: center; gap: 10px;
  margin: 0; padding: 4px 0;
}
.vsec { border-top: 1px solid var(--line); }
.vsec:first-child { border-top: 0; }
.vsec .vdivider::before, .vsec .vdivider::after { content: none; }
.vref {
  display: flex; align-items: baseline; gap: 10px; flex: 1; min-width: 0;
  background: none; border: 0; cursor: pointer; padding: 7px 0; text-align: left;
}
.vnum {
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-2); background: var(--bg);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 12px 3px;
  white-space: nowrap;
}
.vsec.open .vnum { border-color: var(--ink); color: var(--ink); }
.vstate {
  font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3);
}
.vsec .vbody { padding: 6px 0 14px; }

/* my studies */
.home-studies { margin-top: 26px; }
.study-list { list-style: none; margin: 2px 0 16px; padding: 0; }
.study-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 2px; text-decoration: none; color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.study-list li:last-child .study-row { border-bottom: 0; }
.study-name { font-family: var(--serif); font-weight: 700; font-size: 15px; flex: none; min-width: 9ch; }
.study-bar {
  flex: 1; height: 4px; border-radius: 999px; background: var(--line);
  overflow: hidden;
}
.study-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.study-meta { font-size: 12px; color: var(--ink-3); flex: none; font-variant-numeric: tabular-nums; }
.study-row:hover .study-name { color: var(--accent); }

/* community-prepared markers */
.ch-btn { position: relative; }
.ch-btn.prepared::after, .ch-btn.partial::after {
  content: ""; position: absolute; top: 6px; right: 6px;
  width: 5px; height: 5px; border-radius: 50%;
}
.ch-btn.prepared::after { background: var(--accent); }
.ch-btn.partial::after { background: var(--line-2); }
.legend[hidden] { display: none; }

.lang-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 2px 0 14px; }
.lang-chip.on { background: var(--ink); color: var(--accent-ink); border-color: var(--ink); }

/* ========== v10: document typography ========== */
.doc-body .doc-h {
  font-family: var(--sans); font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .16em; color: var(--accent);
  display: flex; align-items: baseline; gap: 10px;
  margin: 24px 0 10px;
}
.doc-body .doc-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.doc-body h4.doc-h:first-child { margin-top: 2px; }
.doc-body .doc-h.day-head {
  font-family: var(--serif); font-size: 16.5px; font-weight: 700;
  text-transform: none; letter-spacing: -.2px; color: var(--ink);
}
.doc-list { margin: 0 0 14px; padding: 0 0 0 4px; list-style: none; counter-reset: docq; }
.doc-list li {
  position: relative; padding: 0 0 0 30px; margin: 0 0 12px;
  font-size: 15.5px; line-height: 1.62;
}
ol.doc-list li { counter-increment: docq; }
ol.doc-list li::before {
  content: counter(docq); position: absolute; left: 0; top: 1px;
  font-family: var(--serif); font-weight: 700; font-size: 14px;
  color: var(--accent); width: 20px; text-align: right;
}
ul.doc-list li::before {
  content: "❧"; position: absolute; left: 2px; top: 0;
  font-size: 12px; color: var(--line-2);
}
.role {
  display: block; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .14em; color: var(--accent);
  margin-bottom: 2px;
}
.role-text { display: block; }
.doc-body p .role { margin-top: 10px; }
.vq { font-family: var(--serif); font-style: italic; quotes: "“" "”"; }
.vq::before { content: open-quote; }
.vq::after { content: close-quote; }
.vref { font-size: .84em; color: var(--ink-3); white-space: nowrap; }
.bubble .vq { color: inherit; }

/* ========== v11: annotations, motifs, theme toggle ========== */
.hl {
  background: var(--accent-soft); color: inherit;
  padding: 0 3px; border-radius: 3px;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.pop { font-weight: 800; letter-spacing: -.1px; }
.ul-mark {
  text-decoration: underline; text-decoration-color: var(--accent);
  text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.annotated .hl, .annotated .pop, .annotated .ul-mark { animation: annofade .6s ease-out both; }
@keyframes annofade { from { opacity: .3; } to { opacity: 1; } }
.doc-motif {
  float: right; width: 30px; height: 30px; margin: 2px 0 8px 12px;
  color: var(--accent); opacity: .55;
}
.syn-motif { float: none; width: 20px; height: 20px; margin: 0; opacity: .6; }
.theme-btn {
  font: 600 14px var(--sans); line-height: 1; cursor: pointer;
  color: var(--ink-2); background: transparent;
  border: 1px solid var(--line-2); border-radius: var(--r-s);
  padding: 6px 9px; margin-right: 6px;
}
.theme-btn:hover { border-color: var(--accent); color: var(--ink); }
.topbar-right { display: flex; align-items: center; }

/* ========== v12: illustrations & diagrams ========== */
.kw-input { width: 100%; max-width: 340px; text-align: left; padding: 8px 14px; }
.mmd { overflow-x: auto; padding: 6px 0; }
.mmd svg { max-width: 100%; height: auto; }
.mmd-src {
  font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-s); padding: 12px 14px; overflow-x: auto;
  white-space: pre-wrap;
}

/* ========== v13: share & vendor ========== */
.share-top { vertical-align: 4px; margin-left: 10px; }
.walk-head-right { display: flex; align-items: baseline; gap: 10px; flex: none; }
.share-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 12px;
}
.share-grid .pill-btn { text-align: center; text-decoration: none; display: block; }

.doc-h .sec-copy { margin-left: 4px; flex: none; }

/* focus visibility */
:where(a, button, input, select, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1:focus { outline: none; }

/* ========== v16: iteration 2 — flow & delight ========== */
.chip-accent { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.today-row { margin-bottom: 4px; }
.fav-btn {
  background: none; border: 0; cursor: pointer; padding: 0 2px;
  font-size: 20px; color: var(--line-2); vertical-align: 2px;
  transition: color .15s ease, transform .1s ease;
}
.fav-btn.on { color: var(--accent); }
.fav-btn:active { transform: scale(1.25); }
.syn-tools { display: flex; gap: 6px; }
.walk-bar { height: 3px; background: var(--line); border-radius: 999px; margin: 0 0 12px; overflow: hidden; }
.walk-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .3s ease; }
.book-btn, .ch-btn { animation: rise .3s ease-out both; animation-delay: calc(var(--i, 0) * 12ms); }
@media (prefers-reduced-motion: reduce) { .book-btn, .ch-btn { animation: none; } }

/* view transitions */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

/* print: clean handouts */
@media print {
  .topbar, .crumbs, .tool-actions, .prep-row, .days-row, .lang-row, .walk-foot,
  .scrub, .walk-bar, .vlisten, .share-top, .fav-btn, .syn-tools, .pager,
  .walk-cta, .src-details, .browse-link, .search-wrap { display: none !important; }
  body { background: #fff; color: #000; }
  .bubble, .doc-card, .syn-card { border: none; background: none; padding-left: 0; }
  .msg .av { display: none; }
  a { color: #000; text-decoration: none; }
}

/* ========== v17: iteration 3 — marketing & wow ========== */
.streak-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); border-color: var(--accent-soft); }
.chip-motif { width: 14px; height: 14px; color: var(--accent); }
.done-motif { width: 36px; height: 36px; color: var(--accent); opacity: .7; margin-bottom: 4px; }
.walk-done .pill-btn { margin-top: 4px; }

/* ========== v18: iteration 4 — a11y & robustness ========== */
.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--ink); color: var(--accent-ink); padding: 10px 16px;
  border-radius: var(--r-s); text-decoration: none; font-weight: 600;
}
.skip-link:focus { left: 8px; }
.study-name, .comm-title, .tool-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comm-title { white-space: normal; }
.dim-badge { color: var(--ink-3); background: var(--line); }

.vref-link { color: var(--ink-3); text-decoration: underline dotted; text-underline-offset: 3px; }
.vref-link:hover { color: var(--accent); }

/* ========== v23: formatting it1 — structure & skim ========== */
.pull-vq {
  margin: 18px 0; padding: 4px 0 4px 18px;
  border-left: 3px solid var(--accent);
  font-family: var(--serif); font-size: 19px; line-height: 1.55; font-style: italic;
}
.pull-vq .vq { font-size: inherit; }
.litany { margin: 0 0 14px; border-radius: var(--r-s); overflow: hidden; }
.litany .lit-row { margin: 0; padding: 9px 14px; font-size: 15.5px; }
.litany .lit-row:nth-child(even) { background: var(--card); }
.litany .lit-row:nth-child(odd) { background: var(--accent-soft); }
.doc-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.toc-chip { font-size: 12.5px; padding: 5px 12px; }
.takeaway {
  display: flex; gap: 14px; align-items: flex-start;
  margin: 22px 0 8px; padding: 14px 16px;
  background: var(--accent-soft); border-radius: var(--r);
}
.takeaway-motif { width: 26px; height: 26px; color: var(--accent); flex: none; margin-top: 2px; }
.takeaway-label {
  display: block; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .16em; color: var(--accent); margin-bottom: 3px;
}
.takeaway p { margin: 0; font-family: var(--serif); font-size: 16px; line-height: 1.5; }
.term {
  background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer;
  border-bottom: 1.5px dashed var(--accent); 
}
.gloss-text { font-size: 15px; line-height: 1.6; color: var(--ink-2); margin: 8px 0 14px; }
.chk {
  width: 19px; height: 19px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--line-2); background: var(--card);
  cursor: pointer; margin-right: 10px; vertical-align: -3px; padding: 0;
  position: absolute; left: -28px; top: 2px;
}
.doc-list li { overflow: visible; }
ol.doc-list li .chk, ul.doc-list li .chk { left: auto; position: static; display: inline-block; margin-right: 8px; }
.chk[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
li.done { color: var(--ink-3); }
li.done .role { color: var(--ink-3); }

/* ========== v24: formatting it2 — multimodal ========== */
:root[data-fs="1"] { --content-fs: 17px; }
:root[data-fs="2"] { --content-fs: 19px; --content-lh: 1.7; }
:root[data-fs="3"] { --content-fs: 17.5px; --content-lh: 2.05; --content-ls: .045em; --content-ws: .12em; }
.bubble, .doc-body p, .doc-body li, .syn-body p, .lit-row {
  font-size: var(--content-fs, 15.5px);
  line-height: var(--content-lh, 1.62);
  letter-spacing: var(--content-ls, normal);
  word-spacing: var(--content-ws, normal);
}
/* conversation scanning: the two voices sit on opposite sides */
.m-sam { flex-direction: row-reverse; }
.m-sam .bubble { border-bottom-left-radius: var(--r); border-bottom-right-radius: 5px; }
.msg.speaking .bubble {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  transition: box-shadow .3s ease, border-color .3s ease;
}
.pic-link { margin: 0 0 12px; font-size: 13.5px; }
.pic-link a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.pic-link a:hover { color: var(--accent); text-decoration: underline; }
.doc-body[data-kind="story"] > p:first-of-type::first-letter {
  font-family: var(--serif); font-size: 46px; line-height: .85;
  float: left; padding: 5px 8px 0 0; color: var(--accent);
}
.doc-h .sec-listen { margin-left: 4px; flex: none; }

/* ========== v25: formatting it3 — typographic cognition ========== */
html[lang="fr"] .vq { quotes: "«\202F" "\202F»"; }
html[lang="de"] .vq { quotes: "„" "“"; }
html[lang="ru"] .vq { quotes: "«" "»"; }
.doc-body[data-kind="story"] > p { margin: 0 0 2px; text-indent: 1.6em; }
.doc-body[data-kind="story"] > p:first-of-type { text-indent: 0; }
.doc-body[data-kind="story"] > p:last-of-type { margin-top: 14px; text-indent: 0; font-style: italic; color: var(--ink-2); }
.vref { word-break: keep-all; }

/* ========== v26: easy-read, TLDR-first, comic ========== */
.ez-btn.on { background: var(--ink); color: var(--accent-ink); border-color: var(--ink); }
.takeaway { margin: 4px 0 20px; }
.comic { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .comic { grid-template-columns: 1fr 1fr; } }
.panel {
  position: relative; border: 2.5px solid var(--ink); border-radius: 6px;
  background: var(--card); padding: 14px 14px 12px; overflow: hidden;
}
.panel-num {
  position: absolute; top: 0; left: 0;
  font: 700 12px var(--sans); color: var(--accent-ink); background: var(--ink);
  padding: 3px 9px; border-bottom-right-radius: 6px;
}
.panel-scene {
  margin: 10px 0 8px; font-style: italic; font-size: 13.5px; color: var(--ink-3);
}
.panel-caption {
  margin: 0 0 8px; padding: 8px 12px; font-size: 14px;
  background: var(--ot-soft); border-left: 3px solid var(--ot);
}
.balloon {
  margin: 0 0 8px; padding: 9px 14px; font-size: 14.5px;
  background: var(--bg); border: 1.5px solid var(--line-2); border-radius: 16px;
}
.balloon-who {
  display: block; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin-bottom: 2px;
}

/* ========== v27: hand-annotated visual language + accordions ========== */
:root { --marker: rgba(10, 111, 158, .17); }
:root[data-theme="dark"] { --marker: rgba(92, 200, 245, .20); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --marker: rgba(92, 200, 245, .20); } }
/* highlighter sweep */
.hl {
  background: linear-gradient(102deg, transparent 1%, var(--marker) 4%, var(--marker) 95%, transparent 99%);
  border-radius: 6px 14px 8px 12px / 12px 6px 14px 8px;
  padding: .08em .35em; margin: 0 -.12em;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
/* hand-drawn wavy underline */
.ul-mark {
  text-decoration: underline wavy var(--accent) 1.5px;
  text-underline-offset: 5px;
}
/* circled word */
.circled { position: relative; display: inline-block; padding: 0 .28em; }
.circled::before {
  content: ""; position: absolute; inset: -.2em -.4em -.24em -.38em;
  border: 1.8px solid var(--accent);
  border-radius: 52% 48% 55% 45% / 46% 54% 44% 56%;
  transform: rotate(-2.5deg);
  pointer-events: none;
}
/* boxed callouts */
.enbox {
  position: relative; margin: 18px 0 8px; padding: 16px 16px 12px;
  border: 2px solid var(--ink); border-radius: 4px 14px 6px 12px / 12px 5px 14px 6px;
  background: var(--card);
}
.enbox-label {
  position: absolute; top: -11px; left: 14px;
  font: 700 10.5px var(--sans); text-transform: uppercase; letter-spacing: .14em;
  background: var(--accent); color: var(--accent-ink);
  padding: 3px 10px 2px; border-radius: 4px; transform: rotate(-1.2deg);
}
.enbox p { margin: 2px 0 0; font-size: 15px; }
/* accordion sections */
.doc-sec { border-top: 1px solid var(--line); }
.doc-sec:last-of-type { border-bottom: 1px solid var(--line); }
.doc-sec summary { cursor: pointer; list-style: none; padding: 4px 0; }
.doc-sec summary::-webkit-details-marker { display: none; }
.doc-sec summary .doc-h { margin: 8px 0; }
.doc-sec summary .doc-h::before {
  content: "▸"; margin-right: 8px; color: var(--ink-3);
  display: inline-block; transition: transform .15s ease;
}
.doc-sec[open] summary .doc-h::before { transform: rotate(90deg); }
.doc-sec-body { padding: 2px 0 14px; }

/* ========== v27b: frames, fades, hand-marks ========== */
:root { --marker: rgba(10, 111, 158, .17); }
:root[data-theme="dark"] { --marker: rgba(92, 200, 245, .20); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --marker: rgba(92, 200, 245, .20); } }
.hl {
  background: linear-gradient(102deg, transparent 1%, var(--marker) 4%, var(--marker) 95%, transparent 99%);
  border-radius: 6px 14px 8px 12px / 12px 6px 14px 8px;
  padding: .08em .35em; margin: 0 -.12em;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.ul-mark { text-decoration: underline wavy var(--accent) 1.5px; text-underline-offset: 5px; }
.circled { position: relative; display: inline-block; padding: 0 .28em; }
.circled::before {
  content: ""; position: absolute; inset: -.2em -.4em -.24em -.38em;
  border: 1.8px solid var(--accent);
  border-radius: 52% 48% 55% 45% / 46% 54% 44% 56%;
  transform: rotate(-2.5deg); pointer-events: none;
}
.enbox {
  position: relative; margin: 20px 0 10px; padding: 16px 16px 12px;
  border: 2px solid var(--ink);
  border-radius: 4px 14px 6px 12px / 12px 5px 14px 6px;
  background: var(--card);
}
.enbox-label {
  position: absolute; top: -11px; left: 14px;
  font: 700 10.5px var(--sans); text-transform: uppercase; letter-spacing: .14em;
  background: var(--accent); color: var(--accent-ink);
  padding: 3px 10px 2px; border-radius: 4px; transform: rotate(-1.2deg);
}
.enbox p { margin: 2px 0 0; font-size: 15px; }
/* framed documents: borders as design, not hairlines */
.doc-card {
  border: 1.5px solid var(--line-2); border-top: 3px solid var(--ink);
  border-radius: var(--r-s); padding: 18px 18px 10px;
}
.syn-card {
  border: 1.5px solid var(--line-2); border-top: 3px solid var(--ink);
  border-radius: var(--r-s); padding: 14px 18px 10px;
}
/* accordion panels with fading collapsed previews */
.doc-sec {
  border: 1.5px solid var(--line); border-radius: var(--r-s);
  margin: 0 0 10px; padding: 0 14px; background: var(--bg);
}
.doc-sec[open] { border-color: var(--line-2); }
.doc-sec summary { cursor: pointer; list-style: none; padding: 2px 0 6px; }
.doc-sec summary::-webkit-details-marker { display: none; }
.doc-sec summary .doc-h { margin: 10px 0 2px; }
.doc-sec summary .doc-h::before {
  content: "▸"; margin-right: 8px; color: var(--ink-3);
  display: inline-block; transition: transform .15s ease;
}
.doc-sec[open] summary .doc-h::before { transform: rotate(90deg); }
.sec-preview {
  display: none; font-size: 13px; color: var(--ink-3); line-height: 1.5;
  margin: 2px 0 8px; position: relative; overflow: hidden; max-height: 20px;
  -webkit-mask-image: linear-gradient(90deg, #000 60%, transparent 98%);
  mask-image: linear-gradient(90deg, #000 60%, transparent 98%);
}
.doc-sec:not([open]) .sec-preview { display: block; }
.doc-sec-body { padding: 4px 0 14px; }
/* content entrance fades */
.doc-body > p, .doc-body .doc-list li, .doc-body .enbox, .doc-sec, .panel {
  animation: contentfade .45s ease-out both;
}
.doc-body > p:nth-child(2), .doc-sec:nth-of-type(2) { animation-delay: 60ms; }
.doc-body > p:nth-child(3), .doc-sec:nth-of-type(3) { animation-delay: 120ms; }
.doc-body > p:nth-child(n+4), .doc-sec:nth-of-type(n+4) { animation-delay: 180ms; }
@keyframes contentfade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .doc-body > p, .doc-body .doc-list li, .doc-body .enbox, .doc-sec, .panel { animation: none; }
}

/* ========== v28: iterations 5-9 polish ========== */
.hub-stats { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.balloon { position: relative; }
.balloon::after {
  content: ""; position: absolute; left: 22px; bottom: -7px;
  width: 12px; height: 12px; background: inherit;
  border-right: 1.5px solid var(--line-2); border-bottom: 1.5px solid var(--line-2);
  transform: rotate(45deg) skew(8deg, 8deg);
}
.vbody.annotated .hl, .vbody.annotated .circled, .vbody.annotated .ul-mark { animation: annofade .6s ease-out both; }

/* ========== v29: panel art, mime, spread formatting ========== */
.panel-art {
  margin: 8px -14px 10px; aspect-ratio: 1 / 1; overflow: hidden;
  background: var(--accent-soft); display: flex; align-items: center; justify-content: center;
  border-bottom: 2px solid var(--ink);
}
.panel-art img { width: 100%; height: 100%; object-fit: cover; display: block; animation: contentfade .5s ease-out both; }
.syn-body .enbox { margin-top: 14px; }

/* ========== v31: mime illustrations ========== */
li.mime-item { display: grid; grid-template-columns: 104px 1fr; gap: 14px; align-items: start; padding-left: 0 !important; }
li.mime-item::before { content: none !important; }
.mime-art {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1; width: 104px; overflow: hidden;
  background: var(--accent-soft); border: 2px solid var(--ink); border-radius: 6px;
}
.mime-art img { width: 100%; height: 100%; object-fit: cover; display: block; animation: contentfade .5s ease-out both; }
@media (max-width: 420px) { li.mime-item { grid-template-columns: 84px 1fr; gap: 10px; } .mime-art { width: 84px; } }

/* callout paragraphs never inherit drop caps */
.enbox p::first-letter, .takeaway p::first-letter {
  float: none; font-size: inherit; padding: 0; color: inherit; font-family: inherit; line-height: inherit;
}

/* ========== v35: community, gallery, contribution ========== */
.cmap { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 8px; }
.cmap-book { display: block; text-decoration: none; color: var(--ink-3); padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.cmap-book.lit { color: var(--ink); border-color: var(--line-2); }
.cmap-name { display: block; font-family: var(--serif); font-size: 13px; margin-bottom: 4px; }
.cmap-bar { display: block; height: 3px; background: var(--line); border-radius: 999px; overflow: hidden; }
.cmap-bar i { display: block; height: 100%; background: var(--accent); }
.cstats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); margin-bottom: 10px; }
.stat { border: 1px solid var(--line); border-radius: var(--r-s); padding: 12px; text-align: center; }
.stat-n { display: block; font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--accent); }
.stat-l { display: block; font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .1em; margin-top: 2px; }
.stat-note { grid-column: 1 / -1; font-size: 12px; margin: 0; }
.econ p { font-size: 15px; }
.cgal { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.gal-item { display: block; text-decoration: none; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; background: var(--card); }
.gal-item img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }
.gal-ref { display: block; font: 700 11px var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); padding: 6px 8px; }
.gift-note { display: flex; gap: 12px; align-items: center; background: var(--accent-soft); border-radius: var(--r); padding: 12px 14px; margin: 0 0 14px; }

/* ========== v37: x-ray visual identity ========== */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    linear-gradient(transparent 96%, color-mix(in srgb, var(--accent) 12%, transparent) 100%) 0 0 / 100% 44px,
    linear-gradient(90deg, transparent 96%, color-mix(in srgb, var(--accent) 9%, transparent) 100%) 0 0 / 44px 100%,
    radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 62%);
  opacity: .55;
}
main, .topbar, .crumbs, .foot { position: relative; z-index: 1; }
.hl { box-shadow: 0 0 12px -4px color-mix(in srgb, var(--accent) 55%, transparent); }
.circled::before { box-shadow: 0 0 10px -3px color-mix(in srgb, var(--accent) 70%, transparent); }
.doc-card, .syn-card, .panel, .enbox {
  box-shadow: inset 0 0 26px -18px color-mix(in srgb, var(--accent) 80%, transparent);
}
.panel-art { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.thinking i { background: var(--accent); box-shadow: 0 0 8px -1px var(--accent); }
.syn-body:has(.thinking), .doc-body:has(.thinking), .vbody:has(.thinking) { position: relative; overflow: hidden; }
.syn-body:has(.thinking)::after, .doc-body:has(.thinking)::after, .vbody:has(.thinking)::after {
  content: ""; position: absolute; left: -30%; top: 0; width: 30%; height: 100%;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 22%, transparent), transparent);
  animation: scansweep 1.9s ease-in-out infinite;
}
@keyframes scansweep { to { left: 110%; } }
@media (prefers-reduced-motion: reduce) {
  .syn-body:has(.thinking)::after, .doc-body:has(.thinking)::after, .vbody:has(.thinking)::after { display: none; }
}
.brand-mark { color: var(--accent); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 55%, transparent)); display: inline-flex; }
.scell.read { background: var(--accent-soft); }
.scell.ready { box-shadow: inset 0 0 10px -6px var(--accent); }

/* ========== v38: printing (page & section) ========== */
#print-area { display: none; }
.print-head {
  display: none; justify-content: space-between; align-items: baseline;
  border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 16px;
  font-family: var(--serif); font-size: 15px;
}
.print-head span { font-family: var(--sans); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.sec-print { margin-left: 4px; flex: none; }
@media print {
  /* section print: show only the cloned region */
  body.print-one > *:not(#print-area) { display: none !important; }
  body.print-one #print-area { display: block !important; padding: 0; }
  body.print-one .print-head { display: flex !important; }
  #print-area .vbody, #print-area .doc-sec-body { display: block !important; }
  /* collapsed accordions must print open */
  .doc-sec:not([open]) .doc-sec-body { display: block !important; }
  .sec-preview, .sec-print, .doc-toc { display: none !important; }
  .panel, .enbox, .doc-card, .syn-card { box-shadow: none !important; }
  .panel-art img, .mime-art img { max-width: 320px; }
  body::before { display: none !important; }
}

/* ========== v38: printing (page & section) ========== */
#print-area { display: none; }
.print-head {
  display: none; justify-content: space-between; align-items: baseline;
  border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 16px;
  font-family: var(--serif); font-size: 15px;
}
.print-head span { font-family: var(--sans); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.sec-print { margin-left: 4px; flex: none; }
@media print {
  body.print-one > *:not(#print-area) { display: none !important; }
  body.print-one #print-area { display: block !important; }
  body.print-one .print-head { display: flex !important; }
  #print-area .vbody, #print-area .doc-sec-body { display: block !important; }
  .doc-sec:not([open]) .doc-sec-body { display: block !important; }
  .sec-preview, .sec-print, .doc-toc { display: none !important; }
  .panel, .enbox, .doc-card, .syn-card { box-shadow: none !important; }
  .panel-art img, .mime-art img { max-width: 320px; }
  body::before { display: none !important; }
}
