/* Proverbs study: shared styles for the home page and chapter pages */
:root {
  --bg: #f7f2e8; --surface: #fffdf7; --surface-2: #f1e9d8; --ink: #1f1b16; --muted: #6f6657; --line: #e4dac6;
  --accent: #a8641a; --accent-ink: #fffaf0; --good: #2f7d38;
  --hero-a: #33230f; --hero-b: #7a4b1e; --hero-c: #c08a35; --hero-ink: #fff6e2;
  --c-wisdom: #fbe3a1; --c-person: #f6c9c4; --c-choice: #c9e6c6; --c-image: #cadef6; --c-harm: #e0d0ee;
  --e-wisdom: #b98900; --e-person: #b5443a; --e-choice: #2f7d38; --e-image: #2c64ad; --e-harm: #7446a3;
  --shadow: 0 1px 2px rgba(60, 40, 10, .06), 0 8px 24px rgba(60, 40, 10, .07);
  --scripture: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --ui: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --hebrew: "Frank Ruhl Libre", "SBL Hebrew", "Times New Roman", David, serif;
  --radius: 16px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #12100c; --surface: #1c1913; --surface-2: #272219; --ink: #efe7d6; --muted: #a79d89; --line: #352f23;
  --accent: #e7b667; --accent-ink: #1a1408; --good: #7fcf87;
  --hero-a: #241a0c; --hero-b: #5b3a17; --hero-c: #a87a30; --hero-ink: #fff3da;
  --c-wisdom: #5c4a12; --c-person: #5e2b27; --c-choice: #24492a; --c-image: #213f63; --c-harm: #43305a;
  --e-wisdom: #e6bd45; --e-person: #ef8d83; --e-choice: #7fcf87; --e-image: #86b6f2; --e-harm: #c19cea;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; scroll-padding-top: 150px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--ui); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--accent); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right)); }

/* ---------- shared controls ---------- */
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: transform .12s, border-color .15s, background .15s; }
.pill:hover { border-color: var(--accent); }
.pill:active { transform: scale(.96); }
.pill.icon { width: 40px; padding: 0; font-size: 17px; }
.pill.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { border: 0; background: none; min-height: 36px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted); transition: background .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.eyebrow { font: 600 11px/1.2 var(--ui); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- home ---------- */
.home-top { display: flex; align-items: center; gap: 8px; padding-top: max(18px, env(safe-area-inset-top)); }
.brand { margin-right: auto; font: 600 22px var(--scripture); letter-spacing: -.01em; }
.brand small { display: block; font: 400 13px var(--ui); color: var(--muted); letter-spacing: 0; }
.greet { font: 500 clamp(26px, 5vw, 38px)/1.15 var(--scripture); letter-spacing: -.015em; margin: 26px 0 16px; }
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: clamp(22px, 4vw, 36px); color: var(--hero-ink);
  background: radial-gradient(120% 140% at 100% 0%, var(--hero-c) 0%, transparent 55%), linear-gradient(135deg, var(--hero-a), var(--hero-b)); box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 80% at 15% 110%, rgba(255, 220, 150, .18), transparent 70%); pointer-events: none; }
.hero .eyebrow { color: rgba(255, 240, 210, .75); }
.hero-row { display: flex; gap: 20px; align-items: flex-start; position: relative; z-index: 1; }
.hero-main { flex: 1; min-width: 0; }
.hero h2 { font: 500 clamp(34px, 7vw, 54px)/1.05 var(--scripture); letter-spacing: -.02em; margin: 6px 0 4px; }
.hero h3 { font: italic 400 clamp(18px, 3vw, 22px)/1.3 var(--scripture); margin: 0 0 10px; opacity: .92; }
.hero p { margin: 0 0 18px; max-width: 58ch; font-size: 15.5px; opacity: .88; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero .pill { border-color: rgba(255, 240, 210, .35); background: rgba(255, 245, 225, .1); color: var(--hero-ink); min-height: 46px; padding: 0 20px; font-size: 15px; backdrop-filter: blur(4px); }
.hero .pill.primary { background: #fff3da; border-color: #fff3da; color: #2a1c08; }
.ring { flex: none; width: 76px; height: 76px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring .track { stroke: rgba(255, 240, 210, .2); }
.ring .bar { stroke: #ffe2a6; stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(.2, .7, .2, 1); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 600 15px var(--ui); }
.second-chapter { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255, 240, 210, .2); position: relative; z-index: 1; }
.second-chapter h4 { font: 500 22px var(--scripture); margin: 0 0 8px; }

.daily { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: block; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.daily:hover { border-color: var(--accent); transform: translateY(-1px); }
.daily q { display: block; quotes: none; font: 400 clamp(19px, 3.2vw, 23px)/1.45 var(--scripture); margin: 6px 0 8px; }
.daily cite { font: 500 13px var(--ui); font-style: normal; color: var(--accent); }

.home h3.sec { display: flex; align-items: baseline; gap: 10px; margin: 34px 0 12px; }
.home h3.sec span { margin-left: auto; font: 500 13px var(--ui); letter-spacing: 0; text-transform: none; color: var(--muted); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { font: 600 10.5px var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: center; padding-bottom: 2px; }
.day { position: relative; aspect-ratio: 1 / .82; min-height: 48px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 5px 8px; text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform .12s, border-color .15s; }
a.day:hover { border-color: var(--accent); transform: translateY(-1px); }
.day .d { font-size: 11px; color: var(--muted); }
.day .c { font: 600 clamp(14px, 2.6vw, 19px) var(--scripture); margin-top: auto; }
.day .c small { font: 600 10.5px var(--ui); color: var(--accent); }
.day.now { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.day.read { background: color-mix(in srgb, var(--good) 13%, var(--surface)); border-color: color-mix(in srgb, var(--good) 40%, var(--line)); }
.day.read::after { content: "✓"; position: absolute; top: 3px; right: 7px; color: var(--good); font-weight: 700; font-size: 13px; }
.day.double { border-style: dashed; }
.why { color: var(--muted); font-size: 13.5px; margin: 10px 2px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.card { display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; transition: transform .15s, border-color .15s, box-shadow .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.card.is-today { border-color: var(--accent); }
.card .n { font: 600 12px var(--ui); color: var(--accent); letter-spacing: .04em; }
.card b { font: 500 19px/1.25 var(--scripture); margin: 2px 0 4px; }
.card span { font-size: 13.5px; line-height: 1.45; color: var(--muted); flex: 1; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meter { height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--good), color-mix(in srgb, var(--good) 60%, var(--accent))); }
.card em { font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.card.done .n::after { content: "  ✓"; color: var(--good); }
.foot { color: var(--muted); font-size: 12.5px; margin: 40px 0 0; padding-bottom: max(40px, env(safe-area-inset-bottom)); }

/* ---------- chapter: app bar ---------- */
.scrollbar { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 60; background: linear-gradient(90deg, var(--accent), #e9c46a); }
.appbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.appbar .row1 { display: flex; align-items: center; gap: 6px; padding-top: 8px; padding-bottom: 8px; }
.appbar h1 { font: 600 19px var(--scripture); margin: 0 4px; white-space: nowrap; }
.appbar .grow { flex: 1; }
.appbar .row2 { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; }
.threads { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); padding-right: 24px; }
.threads::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; min-height: 34px; padding: 0 12px; font-size: 13px; white-space: nowrap; color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* ---------- chapter: content ---------- */
main.chapter { max-width: 1080px; margin: 0 auto; padding: 22px max(16px, env(safe-area-inset-left)) 140px max(16px, env(safe-area-inset-right)); }
.chero { padding: 10px 2px 6px; }
.chero .big { font: 500 clamp(40px, 9vw, 68px)/1 var(--scripture); letter-spacing: -.025em; margin: 6px 0 6px; }
.chero .title { font: italic 400 clamp(20px, 3.6vw, 26px)/1.3 var(--scripture); color: var(--accent); margin: 0 0 10px; }
.chero .sum { font: 400 clamp(17px, 2.6vw, 20px)/1.55 var(--scripture); max-width: 64ch; margin: 0 0 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--sw); border-bottom: 2px solid var(--ed); }
.thread-banner { display: none; background: var(--surface-2); border-left: 4px solid var(--accent); border-radius: 10px; padding: 12px 16px; margin: 14px 0; }
.thread-banner.show { display: block; }
.thread-banner b { font: 600 17px var(--scripture); }
.thread-banner a { margin-right: 10px; white-space: nowrap; }

.section { margin: 34px 2px 12px; }
.section h2 { font: 500 clamp(22px, 3.6vw, 27px)/1.2 var(--scripture); letter-spacing: -.01em; margin: 2px 0 0; }
.section p { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }

.verse { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px 14px; margin-bottom: 12px; position: relative; transition: border-color .3s, box-shadow .3s; }
.verse.done { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.verse:target { box-shadow: 0 0 0 2px var(--accent); }
.vhead { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.vnum { font: 700 12px var(--ui); color: var(--accent); letter-spacing: .08em; text-transform: uppercase; }
.vver { font: 500 11px var(--ui); color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.check { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); background: none; display: grid; place-items: center; color: transparent; font-size: 17px; font-weight: 700; transition: background .2s, border-color .2s, color .2s, transform .25s cubic-bezier(.3, 1.8, .5, 1); }
.check:hover { border-color: var(--good); }
.check[aria-pressed="true"] { background: var(--good); border-color: var(--good); color: var(--surface); }
.check.pop { transform: scale(1.28); }
.vtext { font: 400 clamp(20px, 3.2vw, 23px)/1.55 var(--scripture); margin: 2px 0 10px; }
.rows { border-top: 1px solid var(--line); }
.verse.no-vtext .rows { border-top: 0; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 4px 28px; padding: 11px 0; border-top: 1px dashed var(--line); }
.row:first-child { border-top: 0; }
.text { font: 400 20px/1.5 var(--scripture); }
.sc { font-variant: small-caps; letter-spacing: .02em; }
.plain { display: block; font: italic 400 15.5px/1.45 var(--scripture); color: var(--muted); margin-top: 3px; }
.text.only-plain .plain { font-size: 18.5px; color: var(--ink); margin-top: 0; }
.lbl { display: block; font: 600 10.5px var(--ui); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-style: normal; margin-bottom: 1px; }
.meaning { font-size: 15.5px; line-height: 1.6; }

.hl { all: unset; cursor: pointer; background: var(--c); border-bottom: 2px solid var(--e); border-radius: 4px; padding: 0 3px; transition: background .2s, box-shadow .15s; }
.hl:hover, .hl:focus-visible, .hl.sel { box-shadow: 0 0 0 2px var(--e); }
[data-c="wisdom"] { --c: var(--c-wisdom); --e: var(--e-wisdom); }
[data-c="person"] { --c: var(--c-person); --e: var(--e-person); }
[data-c="choice"] { --c: var(--c-choice); --e: var(--e-choice); }
[data-c="image"]  { --c: var(--c-image);  --e: var(--e-image); }
[data-c="harm"]   { --c: var(--c-harm);   --e: var(--e-harm); }
body.no-hl .hl { background: none; border-bottom-color: transparent; padding: 0; }
body.threading .hl:not(.in-thread) { background: none; border-bottom-color: transparent; }
body.threading .verse:not(.has-thread) { opacity: .4; }
body.threading .hl.in-thread { box-shadow: 0 0 0 2px var(--e); }
body.no-plain .text:not(.only-plain) .plain, body.no-meaning .meaning, body.no-words .words, body.no-words .aside { display: none; }
body.no-meaning .row { grid-template-columns: 1fr; }

.aside { font-size: 14.5px; margin: 10px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); }
.words { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.w { all: unset; cursor: pointer; font-size: 13.5px; line-height: 1.4; border: 1px solid var(--line); border-left: 4px solid var(--e); border-radius: 8px; padding: 6px 10px; background: var(--bg); transition: border-color .15s, transform .12s; }
.w:hover, .w:focus-visible { border-color: var(--e); }
.w:active { transform: scale(.97); }
.w b { font-weight: 600; }
.w i { color: var(--muted); }
.w .heb { font: 500 16px var(--hebrew); margin: 0 5px; }
.w .note { display: none; }
body.full-notes .words { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
body.full-notes .w .note { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.vfoot { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; }
.cmp-btn { all: unset; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--accent); min-height: 34px; display: inline-flex; align-items: center; white-space: nowrap; }
.cmp-btn:hover { text-decoration: underline; }
.compare { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 8px; }
.compare div { font: 400 16.5px/1.5 var(--scripture); }
.compare b { display: block; font: 600 10.5px var(--ui); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.mynotes { flex: 1; }
.mynotes textarea { width: 100%; min-height: 36px; resize: vertical; border: 1px dashed var(--line); border-radius: 10px; background: transparent; color: var(--ink); font: 15px/1.45 var(--ui); padding: 7px 10px; }
.mynotes textarea:focus { outline: 2px solid var(--accent); border-style: solid; }
.print-note { display: none; }

.reflect { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-top: 28px; }
.reflect h2 { font: 500 22px var(--scripture); margin: 0 0 6px; }
.reflect li { margin-bottom: 6px; }
.finish { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 24px; }
.finish .big { min-height: 52px; padding: 0 26px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 16px; font-weight: 600; box-shadow: var(--shadow); transition: transform .15s, background .25s; }
.finish .big:active { transform: scale(.96); }
.finish .big.is-read { background: var(--good); color: var(--surface); }
.credit { color: var(--muted); font-size: 12.5px; margin-top: 26px; max-width: 80ch; }

/* ---------- simple (kid-level) mode ---------- */
.kid { display: none; }
body.simple .kid { display: block; font: 400 clamp(21px, 3.6vw, 24px)/1.6 var(--scripture); margin: 0; }
.kid sup { font: 700 11px var(--ui); color: var(--accent); margin-right: 6px; }
.kid .deeper { all: unset; cursor: pointer; font: 500 12.5px var(--ui); color: var(--accent); margin-left: 8px; white-space: nowrap; opacity: .8; }
.kid .deeper:hover, .kid .deeper:focus-visible { opacity: 1; text-decoration: underline; }
body.simple .vhead, body.simple .vtext, body.simple .rows, body.simple .words, body.simple .aside, body.simple .vfoot,
body.simple .threads, body.simple .legend, body.simple .thread-banner, body.simple .section p, body.simple .section .eyebrow,
body.simple .sum.deep, body.simple .progress, body.simple .deep-only { display: none; }
body:not(.simple) .sum.kid-sum { display: none; }
body.simple .verse { background: none; border: 0; padding: 8px 2px; margin: 0; border-radius: 0; }
body.simple main.chapter { max-width: 760px; }
body.simple .section { margin-top: 26px; }
body.simple .section h2 { font-size: 19px; color: var(--accent); font-style: italic; }

/* ---------- word drawer and settings sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 70; background: rgba(15, 10, 0, .38); opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; z-index: 80; background: var(--surface); box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); overflow-y: auto; overscroll-behavior: contain; transition: transform .32s cubic-bezier(.2, .8, .2, 1); }
.sheet { top: 0; right: 0; bottom: 0; width: min(400px, 100vw); border-left: 1px solid var(--line); padding: 22px 24px max(24px, env(safe-area-inset-bottom)); transform: translateX(105%); }
.sheet.open { transform: none; }
.sheet .close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--surface-2); font-size: 20px; line-height: 1; color: var(--muted); }
.sheet .grab { display: none; }
.sheet .cat { font: 600 11px var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--e); }
.sheet h3 { font: 500 27px var(--scripture); margin: 2px 40px 10px 0; }
.sheet .bigheb { font: 500 50px/1.2 var(--hebrew); direction: rtl; text-align: left; }
.sheet .tr { font: italic 400 18px var(--scripture); color: var(--muted); }
.sheet .gloss { font: 500 19px var(--scripture); margin: 14px 0 8px; padding-left: 12px; border-left: 4px solid var(--e); }
.sheet h4 { font: 600 11px var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 20px 0 8px; }
.sheet .occ { margin-bottom: 4px; }
.sheet .occ a { display: inline-block; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; margin: 0 6px 6px 0; text-decoration: none; font-size: 14px; }
.sheet .occ span { color: var(--muted); font-size: 12.5px; margin-right: 6px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; border-bottom: 1px solid var(--line); font-size: 15px; }
.set-row select { font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; max-width: 60%; }
.set-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }

/* ---------- progress pill, toast, celebration ---------- */
.progress { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 30; display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px 0 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); font-size: 14px; font-weight: 600; }
.progress svg { width: 32px; height: 32px; transform: rotate(-90deg); }
.progress circle { fill: none; stroke-width: 4; }
.progress .track { stroke: var(--surface-2); }
.progress .bar { stroke: var(--good); stroke-linecap: round; transition: stroke-dashoffset .5s cubic-bezier(.2, .7, .2, 1); }
.toast { position: fixed; left: 50%; bottom: max(76px, calc(env(safe-area-inset-bottom) + 76px)); z-index: 90; transform: translate(-50%, 30px); opacity: 0; background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-size: 14.5px; font-weight: 500; pointer-events: none; transition: opacity .3s, transform .35s cubic-bezier(.2, .8, .2, 1); white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
#burst { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 95; pointer-events: none; }
.cheer { position: fixed; inset: 0; z-index: 96; display: grid; place-items: center; padding: 20px; background: rgba(15, 10, 0, .45); opacity: 0; pointer-events: none; transition: opacity .3s; }
.cheer.open { opacity: 1; pointer-events: auto; }
.cheer .box { width: min(440px, 100%); text-align: center; border-radius: 24px; padding: 30px 26px 24px; color: var(--hero-ink); background: radial-gradient(120% 140% at 100% 0%, var(--hero-c) 0%, transparent 55%), linear-gradient(135deg, var(--hero-a), var(--hero-b)); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); transform: scale(.9) translateY(14px); transition: transform .45s cubic-bezier(.2, 1.4, .3, 1); }
.cheer.open .box { transform: none; }
.cheer .tick { width: 66px; height: 66px; margin: 0 auto 12px; border-radius: 50%; background: #fff3da; color: #2a1c08; display: grid; place-items: center; font-size: 32px; font-weight: 700; }
.cheer h2 { font: 500 30px/1.15 var(--scripture); margin: 0 0 8px; }
.cheer p { font: italic 400 18px/1.45 var(--scripture); margin: 0 0 20px; opacity: .92; }
.cheer .acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.cheer .pill { border-color: rgba(255, 240, 210, .35); background: rgba(255, 245, 225, .1); color: var(--hero-ink); min-height: 46px; padding: 0 20px; }
.cheer .pill.primary { background: #fff3da; border-color: #fff3da; color: #2a1c08; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  html { scroll-padding-top: 130px; }
  .row { grid-template-columns: 1fr; gap: 6px; }
  .verse { padding: 14px 16px 12px; }
  .sheet { top: auto; left: 0; width: 100%; max-height: 82vh; border-left: 0; border-radius: 22px 22px 0 0; padding-top: 26px; transform: translateY(105%); }
  .sheet .grab { display: block; position: absolute; top: 9px; left: 50%; width: 42px; height: 5px; margin-left: -21px; border-radius: 3px; background: var(--line); }
  body.full-notes .words { grid-template-columns: 1fr; }
  .appbar h1 { font-size: 17px; }
  .hide-sm { display: none; }
  .ring { width: 62px; height: 62px; }
  .vfoot { flex-direction: column; gap: 4px; }
  .mynotes { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- print / PDF ---------- */
@media print {
  @page { size: Letter; margin: 13mm 12mm; }
  :root, :root[data-theme="dark"] {
    --bg: #fff; --surface: #fff; --surface-2: #f4ede0; --ink: #111; --muted: #555; --line: #d8d2c4; --accent: #7a4b1e;
    --c-wisdom: #fbe3a1; --c-person: #f6c9c4; --c-choice: #c9e6c6; --c-image: #cadef6; --c-harm: #e0d0ee;
    --e-wisdom: #b98900; --e-person: #b5443a; --e-choice: #2f7d38; --e-image: #2c64ad; --e-harm: #7446a3;
  }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { font-size: 10.5pt; }
  .appbar, .scrollbar, .sheet, .scrim, .progress, .toast, .cheer, #burst, .check, .finish, .cmp-btn, .kid .deeper, .thread-banner { display: none !important; }
  .chero .big { font-size: 34pt; }
  .vhead { margin-left: 0; }
  main.chapter { padding: 0; max-width: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .verse { break-inside: avoid; border-radius: 0; border-width: 0 0 1px; padding: 8px 0; margin: 0; }
  .row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) !important; }
  .text, .vtext { font-size: 13pt; }
  .plain { font-size: 9.5pt; }
  .text.only-plain .plain { font-size: 11.5pt; }
  .meaning { font-size: 10pt; }
  .section { break-after: avoid; margin-top: 18px; }
  .words { display: grid !important; grid-template-columns: 1fr 1fr; gap: 5px 14px; align-items: start; }
  .w { background: none; border-width: 0 0 0 3px; border-radius: 0; padding: 0 0 0 7px; font-size: 9pt; }
  .w .note { display: block !important; color: #444; font-size: 9pt; }
  .aside { font-size: 9.5pt; }
  .mynotes textarea { display: none; }
  .print-note:not(:empty) { display: block; font-size: 10pt; border: 1px dashed var(--line); padding: 5px 8px; white-space: pre-wrap; }
  .reflect { border-radius: 0; break-inside: avoid; }
}

/* ---------- small-screen refinements ---------- */
.home h3.sec { flex-wrap: wrap; }
@media (max-width: 560px) {
  .hero-row { display: block; }
  .hero .ring { position: absolute; top: 0; right: 0; }
  .hero h2, .hero .eyebrow { padding-right: 70px; }
  .hero-actions .pill { flex: 1 1 auto; }
  .home h3.sec span { margin-left: 0; width: 100%; }
  .cal { gap: 4px; }
  .day { border-radius: 9px; padding: 3px 5px; }
  .day .d { font-size: 10px; }
}
