@font-face { font-family: "EB Garamond"; src: url(/fonts/EBGaramond-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url(/fonts/EBGaramond-400Italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url(/fonts/EBGaramond-600.woff2) format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url(/fonts/CormorantGaramond-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url(/fonts/CormorantGaramond-600.woff2) format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url(/fonts/CormorantGaramond-500Italic.woff2) format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Cinzel"; src: url(/fonts/Cinzel-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --paper: #f6f0e2;
  --paper-2: #efe7d4;
  --card: #fbf8f0;
  --ink: #23252f;
  --ink-2: #4a4c58;
  --ink-3: #7a7b84;
  --rule: #d9cfb9;
  --sepia: #7a4f2c;
  --saffron: #c7792e;
  --good: #2f6b45;
  --mid: #8a6a1f;
  --weak: #9a3b2e;
  --focus: #1f5fd1;
  --display: "Cormorant Garamond", Georgia, serif;
  --body: "EB Garamond", Georgia, serif;
  --caps: "Cinzel", Georgia, serif;
  --tab-h: 62px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 18px/1.55 var(--body);
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 8px);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sepia); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
main:focus, main:focus-visible { outline: none; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--card); padding: 6px 10px; z-index: 10; }

/* ---------- chrome */
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule);
}
.brand { font: 600 19px/1 var(--display); color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.brand em { font-weight: 500; }
.pill { font: 600 10px/1 var(--caps); letter-spacing: .12em; padding: 6px 9px; border-radius: 999px; background: var(--paper-2); color: var(--sepia); }
.pill.on { background: #e3eee5; color: var(--good); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 1px solid var(--rule);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font: 600 9.5px/1 var(--caps); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); text-decoration: none; }
.tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.active { color: var(--ink); }

main { max-width: 680px; margin: 0 auto; padding: 18px 16px 28px; outline: none; scroll-padding-bottom: calc(var(--tab-h) + 24px); }
html { scroll-padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px); }

/* ---------- common blocks */
.kicker { font: 600 11px/1.2 var(--caps); letter-spacing: .2em; text-transform: uppercase; color: var(--sepia); margin: 0 0 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; margin: .2em 0 .4em; }
h1 { font-size: 32px; }
h2 { font-size: 23px; margin-top: 1.3em; }
h3 { font-size: 20px; }
.lead { font-size: 19.5px; color: var(--ink-2); }
.muted { color: var(--ink-3); }
.note { font-size: 14.5px; color: var(--ink-3); border-top: 1px solid var(--rule); padding-top: 10px; margin-top: 24px; }
.sign { font: italic 20px var(--display); text-align: right; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 20px;
  border-radius: 12px; border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper);
  font: 600 13px/1 var(--caps); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--ink); }
.btn.small { min-height: 38px; padding: 8px 14px; font-size: 11px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }

.card {
  display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--rule); border-radius: 14px;
  background: var(--card); color: var(--ink); text-decoration: none; margin-bottom: 10px;
}
.card .num { font: 600 26px/1 var(--display); width: 30px; text-align: center; color: var(--sepia); }
.card img { width: 44px; height: 44px; }
.card b { display: block; font: 600 19px/1.2 var(--display); }
.card span { font-size: 15px; color: var(--ink-2); }
.card .tag { margin-left: auto; font: 600 9.5px/1 var(--caps); letter-spacing: .12em; padding: 5px 8px; border-radius: 999px; white-space: nowrap; }
.tag.free { background: #e3eee5; color: var(--good); }
.tag.lock { background: var(--paper-2); color: var(--sepia); }
.section-title { font: 600 11px/1.2 var(--caps); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); margin: 26px 0 10px; }

/* ---------- home */
.hero { margin: -18px -16px 0; position: relative; }
.hero img { width: 100%; aspect-ratio: 4 / 3.3; object-fit: cover; object-position: center 62%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(var(--paper) 0%, transparent 30%, transparent 70%, var(--paper) 100%); }
.title-block { text-align: center; margin-top: -40px; position: relative; z-index: 1; }
.title-block .author { font: 600 12px/1 var(--caps); letter-spacing: .35em; color: var(--ink-2); }
.title-block h1 { font-size: 42px; margin: 10px 0 6px; }
.title-block h1 em { font-weight: 500; }
.title-block p { font: italic 20px/1.3 var(--display); color: var(--sepia); margin: 0 auto; max-width: 30ch; }
.free-banner { margin: 22px 0 8px; padding: 14px 16px; border-radius: 14px; background: var(--paper-2); font-size: 16px; }

/* ---------- reading */
.prose p { margin: 0 0 .85em; }
.prose figure { margin: 18px 0; }
.prose figcaption { font: italic 15px var(--body); color: var(--ink-3); text-align: center; margin-top: 6px; }
.prose .opener img { border-radius: 4px; }
.chapter-head { text-align: center; margin: 22px 0 18px; }
.chapter-head .act { font: 600 11px var(--caps); letter-spacing: .2em; text-transform: uppercase; color: var(--sepia); }
.chapter-head .num { font: 500 54px/1 var(--display); margin-top: 8px; }
.chapter-head h1 { font-size: 34px; }
.chapter-head .setu { display: inline-flex; align-items: center; gap: 8px; font: 600 11px var(--caps); letter-spacing: .1em; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 4px 12px; }
.chapter-head .setu img { width: 28px; height: 28px; }
.epigraph { font: italic 19px/1.35 var(--display); color: var(--ink-2); margin: 18px auto 0; }
p.first::first-letter { font: 600 3.3em/.8 var(--display); float: left; padding: .06em .08em 0 0; }
.aside { margin: 16px 0; padding: 10px 14px; border-left: 3px solid var(--rule); font-style: italic; color: var(--ink-2); }
.mirror, .lens, .evidence, .yourturn { margin: 22px 0; padding: 16px; border-radius: 14px; }
.mirror { background: var(--paper-2); }
.lens { background: var(--card); border: 1px solid var(--rule); }
.evidence { border: 1px solid var(--rule); font-size: 16.5px; }
.yourturn { border: 1.5px solid var(--ink); }
.mirror-label, .lens-label, .evidence-label, .yt-label { font: 600 10.5px var(--caps); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }
.mirror .source { font-size: 14px; font-style: italic; color: var(--ink-3); text-align: right; }
.lens-head { display: flex; gap: 10px; align-items: center; }
.lens-head img { width: 40px; height: 40px; }
.lens ol, .yourturn ol { padding-left: 1.2em; margin: 8px 0; }
.lens li, .yourturn li { margin-bottom: 6px; }
.ai-human { font-size: 15.5px; border-top: 1px solid var(--rule); padding-top: 8px; }
.ledger { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.35; }
.ledger th { font: 600 10px var(--caps); letter-spacing: .12em; text-align: left; border-bottom: 1.5px solid var(--ink); padding: 6px 4px; }
.ledger td { border-bottom: 1px solid var(--rule); padding: 8px 4px; vertical-align: top; }
.ledger td:first-child { font-weight: 600; }
.carry { text-align: center; font: italic 21px/1.35 var(--display); margin: 26px 0 8px; }
.canvas-cta { display: block; margin: 22px 0; padding: 16px; border-radius: 14px; background: var(--ink); color: var(--paper); text-decoration: none; }
.canvas-cta span { font: 600 10.5px var(--caps); letter-spacing: .18em; text-transform: uppercase; opacity: .75; }
.canvas-cta b { display: block; font: 600 22px var(--display); margin: 4px 0; }
.canvas-cta i { font-size: 15px; opacity: .8; }
.pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 28px; border-top: 1px solid var(--rule); padding-top: 16px; }
.archetype-list { list-style: none; padding: 0; margin: 14px 0; }
.archetype-list li { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.archetype-list img { width: 44px; height: 44px; flex: none; }
.setu-card { display: flex; gap: 14px; padding: 16px; margin: 14px 0; border-radius: 14px; background: var(--card); border: 1px solid var(--rule); }
.setu-card img { width: 56px; height: 56px; flex: none; }
.setu-card h2 { margin-top: 0; }
.setu-letter { font: 600 11px var(--caps); letter-spacing: .14em; color: var(--sepia); margin: 0 0 2px !important; }
.split { font-size: 15.5px; color: var(--ink-2); }
.verse { margin: 26px 0; padding: 18px; border-left: 3px solid var(--saffron); background: var(--paper-2); font: italic 20px/1.4 var(--display); }
.verse cite { display: block; margin-top: 8px; font: normal 13.5px var(--body); color: var(--ink-3); }

/* ---------- lock and access */
.locked { text-align: center; padding: 26px 18px; border: 1px dashed var(--rule); border-radius: 16px; background: var(--card); }
.locked svg { width: 40px; height: 40px; stroke: var(--sepia); fill: none; stroke-width: 1.5; }
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding: 4px; border-radius: 12px; background: var(--paper-2); margin: 14px 0 18px; }
.tabs button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; font: 600 10.5px var(--caps); letter-spacing: .08em; color: var(--ink-2); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
form label { display: block; font: 600 11px var(--caps); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=search], input[type=password], textarea {
  width: 100%; font: 17px/1.4 var(--body); color: var(--ink); background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 11px 12px;
}
textarea { min-height: 96px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15.5px; margin: 14px 0; text-transform: none; letter-spacing: 0; font-family: var(--body); font-weight: 400; }
.check input { width: 20px; height: 20px; margin-top: 3px; }
.msg { padding: 12px 14px; border-radius: 10px; margin: 14px 0; font-size: 16px; }
.msg.ok { background: #e3eee5; color: #1f4b30; }
.msg.err { background: #f6e1dc; color: #6e2a20; }
.ref { font: 600 26px/1.2 var(--display); letter-spacing: .06em; text-align: center; padding: 12px; border: 1.5px dashed var(--ink); border-radius: 12px; margin: 10px 0; user-select: all; }
.small-print { font-size: 14px; color: var(--ink-3); }

/* ---------- simulator */
.progress { height: 6px; border-radius: 3px; background: var(--paper-2); overflow: hidden; margin: 8px 0 14px; }
.progress i { display: block; height: 100%; background: var(--ink); }
.role { font: italic 18px var(--display); color: var(--sepia); }
.situation { font-size: 18px; }
.question { font: 600 22px/1.25 var(--display); margin: 18px 0 12px; }
.option {
  display: block; width: 100%; text-align: left; margin-bottom: 10px; padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--rule);
  background: var(--card); font: 17px/1.4 var(--body); color: var(--ink); cursor: pointer;
}
.option b { font: 600 13px var(--caps); margin-right: 8px; color: var(--sepia); }
.option.chosen { border-color: var(--ink); }
.option[disabled] { cursor: default; }
.outcome { padding: 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--rule); margin: 12px 0; }
.verdict { display: inline-block; font: 600 10.5px var(--caps); letter-spacing: .14em; text-transform: uppercase; padding: 5px 9px; border-radius: 999px; margin-bottom: 8px; }
.verdict.strong { background: #e3eee5; color: var(--good); }
.verdict.mixed { background: #f3ead2; color: var(--mid); }
.verdict.weak { background: #f6e1dc; color: var(--weak); }
.lesson { font: italic 19px/1.4 var(--display); }
.dlist a { display: flex; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; }
.dlist .n { font: 600 20px var(--display); width: 26px; color: var(--sepia); }
.dlist .t { flex: 1; }
.dlist .s { font: 600 10px var(--caps); letter-spacing: .1em; color: var(--ink-3); }
.dlist .done::after { content: "\2713"; color: var(--good); margin-left: 6px; }

/* ---------- bars (simulator summary, health check) */
.bars { margin: 16px 0; }
.bar { margin-bottom: 14px; }
.bar-head { display: flex; justify-content: space-between; font: 600 12px var(--caps); letter-spacing: .08em; }
.bar-track { height: 12px; border-radius: 6px; background: var(--paper-2); overflow: hidden; margin-top: 6px; }
.bar-fill { height: 100%; background: var(--ink); }
.band { padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--rule); margin: 8px 0 18px; font-size: 16px; }

/* ---------- health check */
.q { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.q p { margin: 0 0 10px; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scale label { margin: 0; }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 4px; border: 1px solid var(--rule); border-radius: 10px;
  font: 600 9.5px/1.15 var(--caps); letter-spacing: .04em; color: var(--ink-2); background: var(--card); cursor: pointer; text-transform: none; }
.scale input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.scale input:focus-visible + span { outline: 2px solid var(--focus); }

/* ---------- canvases */
.cfield { margin: 16px 0; }
.cfield .help { font-size: 14.5px; color: var(--ink-3); margin: 0 0 6px; }
.ctable { border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; background: var(--card); }
.ctable .crow { padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.ctable .crow:last-child { border-bottom: 0; }
.ctable .crow-n { font: 600 10px var(--caps); letter-spacing: .14em; color: var(--ink-3); margin-bottom: 4px; }
.ctable input { margin-bottom: 6px; font-size: 15.5px; padding: 8px 10px; }
.ctable small { display: block; font: 600 9.5px var(--caps); letter-spacing: .08em; color: var(--ink-3); margin: 2px 0 2px; }
.example { font-size: 15.5px; padding: 12px 14px; border-left: 3px solid var(--saffron); background: var(--paper-2); border-radius: 0 10px 10px 0; }
.saved { font-size: 13.5px; color: var(--good); min-height: 1.2em; }

@media (min-width: 720px) {
  body { font-size: 19px; }
  .hero img { aspect-ratio: 16 / 9; }
}

@media print {
  .topbar, .tabbar, .no-print, .btn { display: none !important; }
  body { background: #fff; padding: 0; font-size: 11pt; }
  main { max-width: none; padding: 0; }
  input, textarea { border: 0; border-bottom: 1px solid #999; border-radius: 0; background: #fff; }
  .ctable { border-color: #999; }
}

/* =====================================================================================
   Immersive theme: night-to-dawn, frosted glass, gold foil. Scoped to the reader app
   (body.app) so the author console keeps its light paper look.
   ===================================================================================== */
body.app {
  --paper: #07080f;
  --paper-2: rgba(255, 255, 255, .06);
  --card: rgba(255, 255, 255, .055);
  --ink: #f4ecdb;
  --ink-2: #cfc6b4;
  --ink-3: #958fa3;
  --rule: rgba(255, 255, 255, .12);
  --sepia: #e9bb78;
  --saffron: #f2a65a;
  --good: #8fdcae;
  --mid: #f0cd7a;
  --weak: #f39a88;
  --gold-1: #fff3d6; --gold-2: #f1cd86; --gold-3: #b9823a; --gold-4: #7a4f1f;
  --glass-blur: 18px;
  color-scheme: dark;
  background:
    radial-gradient(120% 60% at 70% 0%, rgba(122, 64, 120, .35), transparent 60%),
    radial-gradient(90% 50% at 10% 100%, rgba(242, 166, 90, .14), transparent 60%),
    linear-gradient(#090a14, #07080f 60%, #0b0812);
  background-attachment: fixed;
}
body.app::before {                                    /* a slow aurora behind everything */
  content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background: conic-gradient(from 200deg at 60% 40%, rgba(242,166,90,.10), rgba(120,80,170,.12), rgba(40,60,140,.10), rgba(242,166,90,.10));
  filter: blur(60px); animation: aurora 28s linear infinite;
}
@keyframes aurora { to { transform: rotate(1turn); } }

/* glass + metal */
.glass {
  position: relative; isolation: isolate;
  background: linear-gradient(150deg, rgba(255,255,255,.11), rgba(255,255,255,.03) 45%, rgba(255,255,255,.06));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%); backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 -1px 0 rgba(0,0,0,.25), 0 18px 50px rgba(0,0,0,.45);
}
.glass::before {                                       /* brushed-metal gold edge */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; z-index: -1; pointer-events: none;
  background: conic-gradient(from var(--edge-angle, 120deg), rgba(255,243,214,.55), rgba(185,130,58,.25), rgba(255,255,255,.08), rgba(241,205,134,.55), rgba(122,79,31,.2), rgba(255,243,214,.55));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.glass.sheen::after {                                  /* a light sweep across the glass */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; overflow: hidden;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.14) 50%, transparent 65%) -150% 0 / 250% 100% no-repeat;
  transition: background-position 1.1s ease;
}
.glass.sheen:hover::after, .glass.sheen.in::after { background-position: 150% 0; }
@property --edge-angle { syntax: "<angle>"; inherits: false; initial-value: 120deg; }
.glass.spin::before { animation: edge 8s linear infinite; }
@keyframes edge { to { --edge-angle: 480deg; } }

.foil {
  background: linear-gradient(100deg, var(--gold-1) 0%, var(--gold-2) 22%, var(--gold-3) 42%, var(--gold-1) 55%, var(--gold-2) 70%, var(--gold-4) 90%, var(--gold-2) 100%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: foil 9s ease-in-out infinite alternate;
  filter: drop-shadow(0 2px 10px rgba(242,166,90,.25));
}
@keyframes foil { from { background-position: 0% 0; } to { background-position: 100% 0; } }

/* chrome becomes glass */
body.app .topbar { background: rgba(8, 9, 16, .45); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); border-bottom: 1px solid rgba(255,255,255,.08); transition: background .4s; }
body.app.on-hero .topbar { background: transparent; border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
body.app .brand { color: var(--ink); }
body.app .pill { background: rgba(255,255,255,.08); color: var(--gold-2); border: 1px solid rgba(241,205,134,.3); }
body.app .pill.on { background: rgba(143,220,174,.12); color: var(--good); border-color: rgba(143,220,174,.35); }
body.app .tabbar {
  left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); height: var(--tab-h); padding: 0; border-radius: 22px;
  background: rgba(14, 14, 24, .55); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255,255,255,.10); box-shadow: 0 12px 40px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.12);
  max-width: 520px; margin: 0 auto;
}
body.app .tabbar a { color: var(--ink-3); position: relative; }
body.app .tabbar a.active { color: var(--gold-1); }
body.app .tabbar a.active::after { content: ""; position: absolute; bottom: 7px; width: 18px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--gold-2), var(--saffron)); box-shadow: 0 0 12px var(--saffron); }
body.app { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 26px); }

/* buttons */
body.app .btn { border: 0; color: #1a1208; background: linear-gradient(135deg, var(--gold-1), var(--gold-2) 35%, var(--gold-3) 75%, var(--gold-2)); box-shadow: 0 8px 26px rgba(242,166,90,.28), inset 0 1px 0 rgba(255,255,255,.6); }
body.app .btn:hover { filter: brightness(1.06); }
body.app .btn.ghost { color: var(--ink); background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(241,205,134,.35); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
body.app input[type=text], body.app input[type=email], body.app textarea, body.app input[type=search] {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); color: var(--ink);
}
body.app input:focus, body.app textarea:focus { border-color: rgba(241,205,134,.6); box-shadow: 0 0 0 3px rgba(241,205,134,.15); outline: none; }

/* cards and lists become glass */
body.app .card { background: linear-gradient(150deg, rgba(255,255,255,.09), rgba(255,255,255,.03)); border: 1px solid rgba(255,255,255,.10);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 10px 30px rgba(0,0,0,.3);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s; }
body.app .card:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 16px 40px rgba(0,0,0,.4), 0 0 0 1px rgba(241,205,134,.25); }
body.app .card .num { color: var(--gold-2); }
body.app .card img { filter: drop-shadow(0 0 6px rgba(242,166,90,.45)); }
body.app .tag.free { background: rgba(143,220,174,.14); color: var(--good); }
body.app .tag.lock { background: rgba(241,205,134,.12); color: var(--gold-2); }
body.app .section-title { color: var(--gold-2); opacity: .85; }
body.app .muted, body.app .small-print, body.app .note { color: var(--ink-3); }
body.app .note { border-color: var(--rule); }

/* ---------- the 3D opening */
.hero3d { position: relative; height: 330svh; margin: calc(-18px - 56px - env(safe-area-inset-top)) -16px 0; }
.hero-sticky { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.hero-sticky canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-fallback { position: absolute; inset: 0; background: url(/img/cover-art.webp) center 65% / cover; filter: brightness(.55) sepia(.3); display: none; }
.hero3d.no-gl .hero-fallback { display: block; }
.hero-sticky::after { content: ""; position: absolute; inset: auto 0 0; height: 30%; background: linear-gradient(transparent, #07080f); pointer-events: none; }
.beats { position: absolute; inset: 0; display: grid; place-items: center; padding: 0 22px; pointer-events: none; z-index: 1; }
.beat { grid-area: 1 / 1; text-align: center; max-width: 20ch; margin: 0; font: italic 500 clamp(28px, 7.4vw, 46px)/1.15 var(--display); color: #fff6e4;
  text-shadow: 0 2px 24px rgba(0,0,0,.6); opacity: 0; transform: translateY(16px); filter: blur(6px); transition: opacity .6s, transform .6s, filter .6s; align-self: start; margin-top: 18svh; }
.beat.show { opacity: 1; transform: none; filter: none; }
.beat.final { max-width: 560px; width: calc(100% - 8px); font-style: normal; pointer-events: auto; margin-top: 9svh; padding: 22px 18px 24px; background: linear-gradient(160deg, rgba(10,10,20,.62), rgba(10,10,20,.38)); }
.beat.final .author { font: 600 12px/1 var(--caps); letter-spacing: .42em; color: var(--gold-2); text-shadow: none; }
.beat.final h1 { font: 600 clamp(46px, 13vw, 76px)/.98 var(--display); margin: 14px 0 10px; }
.beat.final h1 em { font-weight: 500; }
.beat.final .sub { font: italic 500 clamp(19px, 5vw, 24px)/1.3 var(--display); color: #f6e3c4; margin: 0 auto 22px; max-width: 26ch; }
.beat.final .row { justify-content: center; }
.scroll-hint { position: absolute; left: 50%; bottom: calc(var(--tab-h) + 34px); transform: translateX(-50%); z-index: 1; text-align: center;
  font: 600 10.5px var(--caps); letter-spacing: .3em; color: rgba(255,246,228,.75); transition: opacity .5s; }
.scroll-hint i { display: block; width: 1px; height: 34px; margin: 10px auto 0; background: linear-gradient(var(--gold-2), transparent); animation: drip 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); opacity: 0; } 40% { opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
.milestone { position: absolute; top: calc(env(safe-area-inset-top) + 64px); right: 16px; z-index: 1; font: 600 10px var(--caps); letter-spacing: .22em; color: rgba(255,246,228,.7); text-align: right; }
.milestone b { display: block; font: 600 22px/1 var(--display); letter-spacing: .02em; color: var(--gold-1); }

/* ---------- home sections */
.home-section { margin: 46px 0 0; }
.home-section > h2 { font-size: 30px; margin: 4px 0 6px; }
.home-section > .lead { margin-top: 0; }
.setu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; perspective: 1200px; }
.flip { position: relative; aspect-ratio: 3 / 4; border: 0; padding: 0; background: none; cursor: pointer; color: var(--ink); text-align: left; font: inherit; }
.flip-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.2,.8,.2,1); }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; padding: 16px 14px; display: flex; flex-direction: column; }
.flip .back { transform: rotateY(180deg); justify-content: center; }
.flip .letter { font: 600 64px/1 var(--display); margin-top: auto; }
.flip .icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, rgba(242,166,90,.35), transparent 70%); }
.flip .icon img { width: 46px; height: 46px; filter: drop-shadow(0 0 8px rgba(242,166,90,.55)); }
.flip b { font: 600 18px/1.15 var(--display); }
.flip span { font-size: 14px; color: var(--ink-2); }
.flip .back p { font-size: 14.5px; line-height: 1.4; margin: 0 0 8px; }
.flip .back .split { font-size: 13px; }
.flip .hint { position: absolute; right: 12px; top: 12px; font: 600 9px var(--caps); letter-spacing: .14em; color: var(--ink-3); }
.verse-big { margin: 46px 0 10px; text-align: center; font: italic 500 clamp(24px, 6.4vw, 34px)/1.3 var(--display); }
.verse-big cite { display: block; margin-top: 12px; font: 13.5px var(--body); font-style: normal; color: var(--ink-3); }

/* ---------- reading on paper */
.sheet {
  --paper: #f6f0e2; --paper-2: #efe7d4; --card: #fbf8f0; --ink: #23252f; --ink-2: #4a4c58; --ink-3: #7a7b84; --rule: #d9cfb9; --sepia: #7a4f2c; --saffron: #c7792e;
  --good: #2f6b45; --mid: #8a6a1f; --weak: #9a3b2e;
  color: var(--ink); background: var(--paper); margin: 0 -16px; padding: 26px 20px 22px; border-radius: 22px 22px 0 0;
  box-shadow: 0 -20px 60px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.06);
  background-image: radial-gradient(rgba(122,79,44,.05) 1px, transparent 1px); background-size: 3px 3px;
}
.sheet .btn { color: var(--paper); background: var(--ink); box-shadow: none; }
.sheet .btn.ghost { color: var(--ink); background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); }
.sheet .card img, .sheet img { filter: none; }
.sheet .mirror { background: var(--paper-2); }
.sheet .canvas-cta { background: linear-gradient(135deg, #1a1422, #2b2033); color: #f4ecdb; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.sheet .canvas-cta b { background: linear-gradient(100deg, #fff3d6, #f1cd86, #b9823a, #f1cd86); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (min-width: 720px) { .sheet { margin: 0; border-radius: 22px; padding: 40px 48px; } }
.read-progress { position: fixed; left: 0; top: 0; height: 3px; z-index: 20; width: 0; background: linear-gradient(90deg, var(--gold-3), var(--gold-2), var(--saffron)); box-shadow: 0 0 12px var(--saffron); }

/* pencil plates draw themselves in */
.sketch-in img { -webkit-mask-image: linear-gradient(110deg, #000 45%, transparent 55%); mask-image: linear-gradient(110deg, #000 45%, transparent 55%);
  -webkit-mask-size: 260% 100%; mask-size: 260% 100%; -webkit-mask-position: 100% 0; mask-position: 100% 0; transition: -webkit-mask-position 2.2s ease, mask-position 2.2s ease; }
.sketch-in.in img { -webkit-mask-position: 0 0; mask-position: 0 0; }

/* reveal on scroll */
[data-reveal] { opacity: 0; transform: translateY(26px); filter: blur(6px); transition: opacity .9s cubic-bezier(.2,.8,.2,1), transform .9s cubic-bezier(.2,.8,.2,1), filter .9s; }
[data-reveal].in { opacity: 1; transform: none; filter: none; }

/* ---------- tools in glass */
body.app .locked { border: 0; }
body.app .locked svg { stroke: var(--gold-2); filter: drop-shadow(0 0 12px rgba(242,166,90,.5)); animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.08); } }
body.app .tabs { background: rgba(255,255,255,.06); }
body.app .tabs button { color: var(--ink-3); }
body.app .tabs button[aria-selected="true"] { background: rgba(241,205,134,.16); color: var(--gold-1); box-shadow: inset 0 0 0 1px rgba(241,205,134,.35); }
body.app .ref { border-color: var(--gold-2); color: var(--gold-1); background: rgba(241,205,134,.06); }
body.app .msg.ok { background: rgba(143,220,174,.12); color: #c9f0d7; }
body.app .msg.err { background: rgba(243,154,136,.12); color: #ffd3c9; }
body.app .msg { background: rgba(255,255,255,.06); }
body.app .progress { background: rgba(255,255,255,.08); }
body.app .progress i { background: linear-gradient(90deg, var(--gold-3), var(--gold-2), var(--saffron)); box-shadow: 0 0 10px rgba(242,166,90,.6); transition: width .6s; }
.decision { padding: 18px 16px; margin-top: 8px; }
body.app .role { color: var(--gold-2); }
body.app .option { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); color: var(--ink); transition: transform .2s, border-color .3s, box-shadow .3s, background .3s; }
body.app .option:hover:not([disabled]) { border-color: rgba(241,205,134,.5); transform: translateY(-1px); }
body.app .option b { color: var(--gold-2); }
body.app .option.chosen { border-color: var(--gold-2); background: rgba(241,205,134,.10); box-shadow: 0 0 0 3px rgba(241,205,134,.12), 0 0 30px rgba(242,166,90,.18); }
body.app .option[disabled]:not(.chosen) { opacity: .5; }
body.app .outcome { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); animation: rise .7s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(4px); } }
body.app .verdict.strong { background: rgba(143,220,174,.15); color: var(--good); }
body.app .verdict.mixed { background: rgba(240,205,122,.15); color: var(--mid); }
body.app .verdict.weak { background: rgba(243,154,136,.15); color: var(--weak); }
body.app .mirror { background: linear-gradient(135deg, rgba(122,64,120,.25), rgba(242,166,90,.10)); border: 1px solid rgba(255,255,255,.08); }
body.app details summary { cursor: pointer; color: var(--gold-2); margin: 6px 0; }
body.app .dlist a { color: var(--ink); border-color: var(--rule); }
body.app .dlist .n { color: var(--gold-2); }
body.app .scale span { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.12); color: var(--ink-2); transition: all .2s; }
body.app .scale input:checked + span { background: linear-gradient(135deg, var(--gold-1), var(--gold-2) 45%, var(--gold-3)); color: #1a1208; border-color: transparent; box-shadow: 0 0 18px rgba(242,166,90,.35); }
body.app .q { border-color: var(--rule); }
body.app .band { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.1); }
body.app .bar-track { background: rgba(255,255,255,.08); }
body.app .bar-fill { background: linear-gradient(90deg, var(--gold-3), var(--gold-2)); }
body.app .ctable { background: rgba(255,255,255,.04); border-color: var(--rule); }
body.app .ctable .crow { border-color: var(--rule); }
body.app .example { background: rgba(242,166,90,.08); border-left-color: var(--saffron); }
body.app .saved { color: var(--good); }

/* radar chart */
.radar { display: block; width: min(100%, 360px); margin: 10px auto 4px; overflow: visible; }
.radar .ring { fill: none; stroke: rgba(255,255,255,.10); }
.radar .axis { stroke: rgba(255,255,255,.12); }
.radar .shape { fill: url(#radarFill); stroke: var(--gold-2); stroke-width: 2; filter: drop-shadow(0 0 10px rgba(242,166,90,.55));
  transform-origin: 50% 50%; animation: grow 1.4s cubic-bezier(.2,.8,.2,1) both; }
@keyframes grow { from { transform: scale(0); opacity: 0; } }
.radar text { fill: var(--ink-2); font: 600 10px var(--caps); letter-spacing: .1em; }
.radar .pct { fill: var(--gold-1); font: 600 14px var(--body); letter-spacing: 0; }

/* page transitions */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: vt-out .28s ease both; }
  ::view-transition-new(root) { animation: vt-in .45s cubic-bezier(.2,.8,.2,1) both; }
}
@keyframes vt-out { to { opacity: 0; filter: blur(6px); transform: scale(.985); } }
@keyframes vt-in { from { opacity: 0; filter: blur(6px); transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  body.app::before, .foil, .glass.spin::before, body.app .locked svg, .scroll-hint i { animation: none; }
  [data-reveal] { opacity: 1; transform: none; filter: none; transition: none; }
  .sketch-in img { -webkit-mask-image: none; mask-image: none; }
}
@media print { body.app { background: #fff; color: #000; } body.app::before { display: none; } }

/* the "completely free" note */
.free-note { margin: 16px 0; padding: 16px; }
.free-note p { margin: 8px 0 12px; font-size: 16.5px; }
.free-note a:not(.btn) { color: var(--gold-1); text-decoration-color: rgba(241,205,134,.5); text-underline-offset: 3px; }
.free-badge { display: inline-block; font: 600 10px/1 var(--caps); letter-spacing: .2em; padding: 6px 10px; border-radius: 999px;
  color: #10261a; background: linear-gradient(135deg, #c8f2d8, #8fdcae); box-shadow: 0 0 18px rgba(143,220,174,.35); }
.btn.li svg { flex: none; }
body.app .locked a:not(.btn) { color: var(--gold-1); }
.sheet .free-note { background: var(--paper-2); }

/* ---------- Madhubani diorama under glass */
.diorama { position: relative; width: 100%; margin: 0 auto 8px; border-radius: 20px; perspective: 900px; isolation: isolate;
  box-shadow: 0 30px 60px rgba(0,0,0,.45), 0 0 0 1px rgba(241,205,134,.35), inset 0 0 0 1px rgba(255,255,255,.08); overflow: hidden;
  --gx: 50%; --gy: 40%; touch-action: pan-y; user-select: none; }
.diorama::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 3px; z-index: 6; pointer-events: none;
  background: conic-gradient(from 140deg, #fff3d6, #b9823a, #f1cd86, #7a4f1f, #fff3d6, #b9823a, #fff3d6);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.dio-stage { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .05s linear; }
.dio-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; will-change: transform; filter: none !important; }
.dio-stage img.found { filter: drop-shadow(0 0 10px rgba(255,214,140,.95)) drop-shadow(0 0 22px rgba(242,166,90,.7)) !important; }
/* the glass pane in front of the painting, with a gliding reflection */
.dio-glass { position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: inherit;
  background:
    linear-gradient(115deg, transparent 30%, rgba(255,255,255,.20) 42%, rgba(255,255,255,.05) 47%, transparent 55%) calc(var(--gx) * 1.4 - 40%) 0 / 260% 100% no-repeat,
    radial-gradient(120% 70% at var(--gx) var(--gy), rgba(255,255,255,.10), transparent 60%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), inset 0 -30px 60px rgba(20,10,30,.18), inset 0 0 0 10px rgba(255,255,255,.03); }
.dio-glint { position: absolute; inset: 0; z-index: 5; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(18% 12% at var(--gx) var(--gy), rgba(255,240,210,.45), transparent 70%); }
/* the moon as a floating glass orb */
.dio-orb { position: absolute; z-index: auto; aspect-ratio: 1; border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%);
  -webkit-backdrop-filter: blur(3px) saturate(160%) brightness(1.12); backdrop-filter: blur(3px) saturate(160%) brightness(1.12);
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.75), rgba(255,255,255,.12) 22%, transparent 45%),
              radial-gradient(circle at 70% 78%, rgba(242,166,90,.35), transparent 50%);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.6), inset -10px -14px 26px rgba(122,79,31,.35), 0 14px 30px rgba(0,0,0,.25), 0 0 40px rgba(255,214,140,.35);
  animation: orb 6s ease-in-out infinite; }
@keyframes orb { 50% { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.7), inset -10px -14px 26px rgba(122,79,31,.35), 0 18px 36px rgba(0,0,0,.25), 0 0 60px rgba(255,214,140,.55); } }
/* the glass lens that slides over the hidden figure when it is found */
.dio-lens { position: absolute; z-index: 3; aspect-ratio: 1; border-radius: 50%; pointer-events: none; opacity: 0; transform: translate(-50%, -50%) scale(.6);
  -webkit-backdrop-filter: blur(.5px) saturate(170%) brightness(1.15) contrast(1.1); backdrop-filter: blur(.5px) saturate(170%) brightness(1.15) contrast(1.1);
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.55), transparent 35%);
  box-shadow: 0 0 0 4px rgba(241,205,134,.95), 0 0 0 7px rgba(122,79,31,.6), 0 12px 30px rgba(0,0,0,.35), inset 0 0 30px rgba(255,255,255,.25);
  transition: opacity .5s, scale .5s; }
.diorama.revealed .dio-lens { opacity: 1; scale: 1.67; }
/* the frosted hint plate */
.dio-hint { position: absolute; left: 50%; bottom: 7%; z-index: 7; transform: translateX(-50%); max-width: 84%; display: flex; align-items: center; gap: 9px;
  padding: 9px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.45); cursor: pointer;
  background: rgba(255,248,232,.38); -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 8px 24px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.7);
  font: italic 500 15px/1.25 var(--display); color: #1b1410; text-align: left; transition: background .4s; }
.diorama.revealed .dio-hint { background: rgba(255,226,170,.6); }
.dio-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #b8322a; box-shadow: 0 0 0 0 rgba(184,50,42,.6); animation: ping 1.8s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(184,50,42,0); } 100% { box-shadow: 0 0 0 0 rgba(184,50,42,0); } }
.sheet .opener.dio-wrap { margin: -6px -6px 18px; }
@media (prefers-reduced-motion: reduce) { .dio-orb, .dio-dot { animation: none; } }

/* ---------- feedback */
.feedback { margin: 28px 0 8px; padding: 18px 16px; }
.feedback h3 { margin: 2px 0 10px; font-size: 21px; }
.stars { display: flex; gap: 6px; margin: 6px 0 12px; }
.stars button { font-size: 30px; line-height: 1; padding: 2px 4px; border: 0; background: none; cursor: pointer; color: rgba(255,255,255,.25); transition: transform .15s, color .2s; }
.stars button.on { color: var(--gold-2); text-shadow: 0 0 12px rgba(242,166,90,.6); }
.stars button:active { transform: scale(1.2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--rule); background: rgba(255,255,255,.05); color: var(--ink-2); font: 15px var(--body); cursor: pointer; }
.chip[aria-pressed="true"] { background: rgba(241,205,134,.18); border-color: var(--gold-2); color: var(--gold-1); }
.feedback textarea { min-height: 90px; margin-bottom: 8px; }
.feedback details { margin: 6px 0 12px; }
.feedback details input { margin-top: 8px; }
.fb-out { min-height: 1em; font-size: 15px; }
/* inside the paper sheet */
.sheet .feedback { background: var(--paper-2); box-shadow: none; }
.sheet .feedback::before { display: none; }
.sheet .stars button { color: #cbbd9f; }
.sheet .stars button.on { color: #c7792e; text-shadow: none; }
.sheet .chip { background: #fbf8f0; color: var(--ink-2); }
.sheet .chip[aria-pressed="true"] { background: #23252f; color: #f6f0e2; border-color: #23252f; }
.sheet .feedback textarea, .sheet .feedback input { background: #fbf8f0; color: var(--ink); border-color: var(--rule); }
.sheet .feedback .btn { background: #23252f; color: #f6f0e2; }

/* =====================================================================================
   Readability pass: minimum 11px for spaced capitals, stronger greys on paper (WCAG AA 4.5:1)
   ===================================================================================== */
body.app .tabbar a { font-size: 11px; letter-spacing: .08em; gap: 4px; }
.tag, .card .tag { font-size: 10.5px; letter-spacing: .1em; padding: 6px 9px; }
.pill, body.app .pill { font-size: 11px; }
.kicker, .section-title { font-size: 12px; }
.chapter-head .act, .act { font-size: 12px; }
.mirror-label, .lens-label, .evidence-label, .yt-label, .canvas-cta span { font-size: 11.5px; letter-spacing: .14em; }
.ledger th { font-size: 11px; }
.milestone, .scroll-hint { font-size: 11.5px; }
.free-badge { font-size: 11px; }
.btn.small { font-size: 12px; }
form label { font-size: 12px; }
.tabs button { font-size: 11.5px; }
.ctable small { font-size: 11px; }
.bar-head { font-size: 12.5px; }
.scale span { font-size: 10.5px; letter-spacing: 0; padding: 4px 2px; }
.radar text { font-size: 11px; }
.setu-letter { font-size: 12px !important; }
.flip .hint { font-size: 10.5px; }
/* paper pages: darker secondary greys and a readable link colour */
.sheet { --ink-3: #5c5d66; --ink-2: #3f414b; }
.sheet .mirror .source, .sheet .note, .sheet figcaption, .sheet .small-print { color: #55565f; }
.sheet details summary { color: #7a4f2c !important; text-decoration: underline; text-underline-offset: 3px; }
.sheet .stars button { color: #b9a988; }
/* dark pages: lift the faintest grey a touch */
body.app { --ink-3: #a7a1b5; }
/* the floating tab bar stays legible over light paper pages too */
body.app .tabbar { background: rgba(14, 13, 24, .88); }
body.app .tabbar a { color: #c3bdcf; }

/* ---------- chapter rating (stars only) */
.rate { text-align: center; margin: 34px 0 6px; padding: 22px 12px 14px; border-top: 1px solid var(--rule); }
.rate-q { margin: 0 0 6px; font: 600 12px var(--caps); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }
.rate .stars { justify-content: center; gap: 10px; margin: 6px 0 8px; }
.rate .stars button { font-size: 36px; padding: 4px; }
.rate-note { margin: 0; font-size: 15px; color: var(--ink-3); }
.sheet .rate-note a { color: #7a4f2c; }
.read-tick { margin-left: auto; font-size: 18px; color: var(--good); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(143,220,174,.14); flex: none; }
.progress-wrap { margin: 4px 0 20px; }
.progress-text { margin: 6px 0 0; font-size: 15px; color: var(--ink-2); }

/* ---------- breathing room between panels, forms and buttons */
.free-note { margin: 22px 0 24px; padding: 20px 18px; }
.free-note p { margin: 12px 0 16px; line-height: 1.55; }
.free-badge + p, .free-badge + h2 { margin-top: 14px; }
.locked { padding: 32px 22px; margin-top: 10px; }
.locked h2 { margin: 14px 0 12px; }
.locked p { margin: 0 0 22px; }
.locked .row { gap: 12px; }
#panel { margin-top: 6px; padding: 14px 18px 22px !important; }
.tabs { margin: 22px 0 16px; }
form label { margin-top: 18px; }
form .check { margin: 18px 0; line-height: 1.45; }
form .btn.block { margin-top: 8px; }
.small-print { margin-top: 14px; line-height: 1.5; }
#out .msg, #out .row { margin-top: 16px; }
#out .row { gap: 12px; }
.feedback { margin: 26px 0 16px; padding: 22px 18px; }
.feedback .chips { margin: 4px 0 16px; }
.feedback textarea { margin: 4px 0 12px; }
.card { margin-bottom: 14px; }
.home-section > .btn, .home-section > .free-note + .btn { margin-top: 6px; }
.btn.block + .btn.block, .btn + .btn.ghost.block { margin-top: 12px; }
main > .btn.block, main > .btn.ghost.block { margin-top: 14px; }
.lead { margin-bottom: 18px; }

/* ---------- notifications */
.notify { margin: 26px 0 18px; padding: 22px 18px; }
.notify h3 { margin: 4px 0 10px; font-size: 21px; }
.notify-text { margin: 0 0 16px; color: var(--ink-2); line-height: 1.5; }
.notify-on { margin: 0 0 12px; color: var(--good); font-weight: 600; }
.notify-tip { margin: 0; font-size: 15.5px; line-height: 1.5; color: var(--ink-2); padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.05); }
.ios-share { display: inline-block; padding: 0 5px; border: 1px solid var(--rule); border-radius: 6px; font-size: 14px; }

.notify-wait { margin: 12px 0 0; font-size: 14.5px; color: var(--ink-3); line-height: 1.45; }
