/* The Life-Giver — app styles
   Reading first: one quiet column of scripture, chrome kept to the edges,
   and the word-study sheet as the single bold moment. */

@font-face { font-family: 'Literata'; src: url('../fonts/Literata.woff2') format('woff2'); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Literata'; src: url('../fonts/Literata-Italic.woff2') format('woff2'); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Noto Serif Hebrew'; src: url('../fonts/NotoSerifHebrew.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Noto Sans Syriac'; src: url('../fonts/NotoSansSyriac.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --surface-2: #F0EFEA;
  --ink: #1E2128;
  --ink-2: #4A5060;
  --muted: #7B8191;
  --line: #E3E1DA;
  --line-strong: #CFCCC3;
  --accent: #146B6E;
  --accent-strong: #0F5658;
  --accent-ink: #FFFFFF;
  --accent-soft: #E1F0EF;
  --accent-soft-2: #C9E4E2;
  --gold: #B48A2F;
  --danger: #B3412F;
  --sel: #FFF4C2;
  --hl-yellow: #FFF0A3; --hl-green: #D6F2D0; --hl-blue: #D4E8FA; --hl-pink: #FBDCE6; --hl-purple: #E6DDF8;
  --shadow: 0 10px 30px rgba(20, 24, 30, .14), 0 2px 8px rgba(20, 24, 30, .08);
  --radius: 14px;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: 'Literata', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --font-hebrew: 'Noto Serif Hebrew', 'SBL Hebrew', 'Ezra SIL', 'Times New Roman', serif;
  --font-greek: 'Literata', 'SBL Greek', 'Gentium Plus', 'Times New Roman', serif;
  --font-syriac: 'Noto Sans Syriac', 'Estrangelo Edessa', 'East Syriac Adiabene', serif;
  --read-size: 18px;
  --read-lh: 1.62;
  --read-font: var(--font-serif);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
:root[data-theme="sepia"] {
  --bg: #F3EBDB; --surface: #FAF4E6; --surface-2: #EEE4D0; --ink: #2D2820; --ink-2: #574E40; --muted: #867B68;
  --line: #E1D6BE; --line-strong: #CDBF9F; --accent: #176B66; --accent-strong: #0F5651; --accent-soft: #DDEBE2; --accent-soft-2: #C6DDD0;
  --sel: #F6E6B4; --hl-yellow: #F7E59A; --hl-green: #D3EBC7; --hl-blue: #CFE1F0; --hl-pink: #F4D5DB; --hl-purple: #E2D8EE;
}
:root[data-theme="dark"] {
  --bg: #121417; --surface: #1A1D22; --surface-2: #22262C; --ink: #E8E4DC; --ink-2: #B8B3A9; --muted: #868277;
  --line: #2B3038; --line-strong: #3A4049; --accent: #5BC1BE; --accent-strong: #7AD3D0; --accent-ink: #0E1A1A; --accent-soft: #173331; --accent-soft-2: #1F4442;
  --gold: #D4AA4F; --danger: #E07A68; --sel: #3A3520;
  --hl-yellow: #4A4320; --hl-green: #22402A; --hl-blue: #1F3448; --hl-pink: #4A2733; --hl-purple: #352B4A;
  --shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .3);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #121417; --surface: #1A1D22; --surface-2: #22262C; --ink: #E8E4DC; --ink-2: #B8B3A9; --muted: #868277;
    --line: #2B3038; --line-strong: #3A4049; --accent: #5BC1BE; --accent-strong: #7AD3D0; --accent-ink: #0E1A1A; --accent-soft: #173331; --accent-soft-2: #1F4442;
    --gold: #D4AA4F; --danger: #E07A68; --sel: #3A3520;
    --hl-yellow: #4A4320; --hl-green: #22402A; --hl-blue: #1F3448; --hl-pink: #4A2733; --hl-purple: #352B4A;
    --shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%; background: var(--bg); color: var(--ink);
  font-family: var(--font-ui); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}
body.sheet-open { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
input, select { font: inherit; color: inherit; }
::selection { background: var(--accent-soft-2); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ------------------------------------------------------------ App bar */
.appbar {
  position: sticky; top: 0; z-index: 40; background: var(--bg); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line); padding-top: var(--safe-top);
}
.appbar-row { display: flex; align-items: center; gap: 4px; height: 52px; padding: 0 10px; max-width: 1100px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 9px; margin-right: auto; padding: 6px 6px 6px 2px; border-radius: 10px; color: var(--ink); }
.brand img { width: 30px; height: 30px; display: block; }
.brand span { font-family: var(--font-serif); font-weight: 600; font-size: 18px; letter-spacing: -.01em; white-space: nowrap; }
.iconbtn { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; color: var(--ink-2); position: relative; }
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.iconbtn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.iconbtn .glyphs { font-family: var(--font-hebrew), var(--font-serif); font-size: 17px; font-weight: 600; letter-spacing: .02em; line-height: 1; }
.iconbtn .badge { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.toolbar { display: flex; align-items: center; gap: 6px; height: 50px; padding: 0 10px 8px; max-width: 48rem; margin: 0 auto; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); font-weight: 600; font-size: 15px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.pill:hover { border-color: var(--accent); }
.pill svg.icon { width: 16px; height: 16px; opacity: .6; }
.pill.ref { flex: 1 1 auto; justify-content: center; min-width: 0; }
.pill.ref span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.trans { flex: 0 0 auto; letter-spacing: .03em; font-size: 14px; }
.chapnav { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); border: 1px solid transparent; }
.chapnav:hover { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.chapnav[disabled] { opacity: .25; pointer-events: none; }

/* Word-study status strip (under the toolbar) */
.wordsbar { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 6px 12px 9px; font-size: 13px; color: var(--ink-2); max-width: 48rem; margin: 0 auto; }
.wordsbar b { color: var(--accent); font-weight: 600; }
.wordsbar button { height: 28px; padding: 0 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13px; flex: none; }
.wordsbar button:hover { background: var(--accent-soft-2); }

/* Inline word-study panel: a block that drops in right under the verse */
.text .wordpanel { display: block; margin: .55em 0 1em; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); max-height: 52vh; max-height: 52dvh; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; text-indent: 0; font-family: var(--font-ui); font-size: 15px; line-height: 1.45; color: var(--ink); cursor: default; text-align: left; }
.text .wordpanel .wp-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.text .wordpanel .wp-title { flex: 1; font-size: 13.5px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text .wordpanel .wp-title b { color: var(--ink); font-family: var(--font-serif); font-size: 15px; }
.text .wordpanel .wp-head .iconbtn { width: 36px; height: 36px; }
.text .wordpanel .wp-body { display: block; padding: 8px 16px 14px; }
.text .wordpanel .word-hero .orig { font-size: 36px; }
.text .wordpanel .wp-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.text .wordpanel .hint { margin-bottom: 0; }
.text .wordpanel .study-cta { margin-top: 14px; }
.text[data-layout="lines"] .wordpanel { margin-left: 0; }
.text .wordpanel * { text-indent: 0; }

/* ------------------------------------------------------------ Reader */
main { max-width: 100%; }
.reader { max-width: 44rem; margin: 0 auto; padding: 18px 20px calc(120px + var(--safe-bottom)); }
@media (min-width: 720px) { .reader { padding: 28px 32px 160px; } }
.chapter-title { font-family: var(--font-serif); font-weight: 500; font-size: 30px; letter-spacing: -.015em; margin: 6px 0 18px; color: var(--ink); }
.chapter-title small { display: block; font-family: var(--font-ui); font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: .02em; margin-top: 4px; }
.scope { font-family: var(--font-ui); font-size: 13px; color: var(--muted); text-transform: none; margin: 0 0 12px; }

.text { font-family: var(--read-font); font-size: var(--read-size); line-height: var(--read-lh); color: var(--ink); }
.text[data-font="sans"] { --read-font: var(--font-ui); }
.text h2 { font-family: var(--font-serif); font-size: calc(var(--read-size) * 1.05); font-weight: 650; margin: 1.5em 0 .5em; letter-spacing: -.005em; line-height: 1.3; color: var(--ink); }
.text h2:first-child { margin-top: .2em; }
.text .ref { font-family: var(--font-ui); font-size: calc(var(--read-size) * .74); color: var(--muted); margin: -0.3em 0 .9em; line-height: 1.5; }
.text .ref a { color: var(--accent); }
.text .ac { font-family: var(--font-ui); font-size: calc(var(--read-size) * .72); letter-spacing: .12em; color: var(--gold); margin: 1.4em 0 .4em; font-weight: 600; }
.text p { margin: 0 0 1em; }
.text p.pt { font-style: italic; color: var(--ink-2); margin-bottom: 1.1em; }
.text p.ctr { text-align: center; }
.text .poem { margin: 0 0 1em; }
.text .poem .l1 { padding-left: 1.6em; text-indent: -1.6em; margin: 0; }
.text .poem .l2 { padding-left: 3.2em; text-indent: -1.6em; margin: 0; }
.text .poem .lr { text-align: right; margin: 0; }
.text .list { margin: 0 0 1em; }
.text .list .li1 { padding-left: 1.6em; text-indent: -1.6em; margin: 0; }
.text .list .li2 { padding-left: 3.2em; text-indent: -1.6em; margin: 0; }
.text .sc { font-variant: small-caps; letter-spacing: .04em; }
.text .vn { font-family: var(--font-ui); font-size: .62em; font-weight: 600; color: var(--accent); vertical-align: super; line-height: 0; margin: 0 .25em 0 .05em; letter-spacing: 0; opacity: .9; user-select: none; text-indent: 0; }
.text .vn:first-child { margin-left: 0; }
.text[data-vn="off"] .vn { display: none; }
.text .v { cursor: pointer; border-radius: 4px; transition: background .12s; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.text .v.sel { background: var(--sel); }
.text .v[data-hl="yellow"] { background: var(--hl-yellow); }
.text .v[data-hl="green"] { background: var(--hl-green); }
.text .v[data-hl="blue"] { background: var(--hl-blue); }
.text .v[data-hl="pink"] { background: var(--hl-pink); }
.text .v[data-hl="purple"] { background: var(--hl-purple); }
.text .v.sel[data-hl] { box-shadow: inset 0 -2px 0 var(--accent); }
.text .v.flash { animation: flash 1.6s ease-out 1; }
@keyframes flash { 0% { background: var(--accent-soft-2); } 100% { background: transparent; } }
.text .fn { font-family: var(--font-ui); font-size: .6em; vertical-align: super; line-height: 0; color: var(--accent); padding: 0 .2em; font-weight: 600; cursor: pointer; }
.text[data-fn="off"] .fn { display: none; }
.text .nm { color: var(--gold); font-size: .85em; font-weight: 600; font-style: normal; display: inline-block; margin-right: .3em; }
.text .bm { display: inline-block; width: .55em; height: .55em; margin-left: .35em; vertical-align: middle; color: var(--gold); }
.text .bm svg { width: 100%; height: 100%; display: block; }
.text .note-ind { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -0.15em; margin-left: .25em; color: var(--accent); opacity: .85; }
.text .note-ind svg { width: 100%; height: 100%; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Verse-per-line layout */
.text[data-layout="lines"] p, .text[data-layout="lines"] .poem, .text[data-layout="lines"] .list { margin: 0; }
.text[data-layout="lines"] .v { display: block; padding: .35em 0 .35em 2.1em; text-indent: -2.1em; border-radius: 6px; }
.text[data-layout="lines"] .poem .l1, .text[data-layout="lines"] .poem .l2, .text[data-layout="lines"] .list .li1, .text[data-layout="lines"] .list .li2 { padding: 0; text-indent: 0; }
.text[data-layout="lines"] .vn { display: inline-block; width: 1.8em; text-align: right; margin: 0 .3em 0 0; vertical-align: baseline; font-size: .68em; line-height: 1; }
.text[data-layout="lines"] .vn.cont { visibility: hidden; }

/* Original-language layer beneath each verse */
.layer { display: block; margin: .3em 0 .2em; padding: .4em .7em .5em; border-left: 3px solid var(--accent-soft-2); border-radius: 0 8px 8px 0; background: var(--surface); background: color-mix(in srgb, var(--surface) 55%, transparent); text-indent: 0; cursor: default; }
.text[data-layout="lines"] .v .layer { margin-left: 0; }
.layer.he { font-family: var(--font-hebrew); direction: rtl; text-align: right; font-size: 1.12em; line-height: 1.9; }
.layer.grc { font-family: var(--font-greek); font-size: .98em; line-height: 1.7; }
.layer.syc { font-family: var(--font-syriac); direction: rtl; text-align: right; font-size: 1.15em; line-height: 1.9; }
.layer .tag { font-family: var(--font-ui); font-size: .62em; color: var(--muted); display: inline-block; margin: 0 0 .25em; direction: ltr; letter-spacing: .05em; float: left; }
.layer.grc .tag { float: none; display: block; }

/* Word study mode */
.text[data-words="on"] .w { cursor: pointer; border-bottom: 1px dotted var(--accent-soft-2); border-bottom-color: color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 2px; }
.text[data-words="on"] .w:hover, .text[data-words="on"] .w:active, .text[data-words="on"] .w.on { background: var(--accent-soft); border-bottom-color: var(--accent); }
.text .w.untr { display: none; }

.chapter-end { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 36px 0 20px; }
.chapter-end a, .chapter-end span.gap { flex: 1 1 0; }
.chapter-end a { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-weight: 600; min-height: 56px; }
.chapter-end a.next { justify-content: flex-end; text-align: right; }
.chapter-end a:hover { border-color: var(--accent); }
.chapter-end a small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.attribution { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0 0 20px; }

.welcome { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 22px; display: flex; gap: 12px; align-items: flex-start; }
.welcome img { width: 34px; height: 34px; flex: none; margin-top: 2px; }
@media (max-width: 420px) { .welcome img { display: none; } }
.welcome h3 { margin: 0 0 4px; font-family: var(--font-serif); font-size: 18px; font-weight: 600; }
.welcome p { margin: 0 0 10px; color: var(--ink-2); font-size: 15px; }
.welcome .row { display: flex; gap: 8px; flex-wrap: wrap; }
.welcome .btn { height: 36px; padding: 0 14px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.welcome .btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line-strong); }

.loading { padding: 60px 0; text-align: center; color: var(--muted); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.err { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; color: var(--ink-2); }
.err b { color: var(--ink); }

/* ------------------------------------------------------------ Verse action bar */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; padding: 10px 10px calc(10px + var(--safe-bottom));
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(0,0,0,.08);
  transform: translateY(110%); transition: transform .22s ease;
}
.actionbar.show { transform: translateY(0); }
.actionbar .inner { max-width: 44rem; margin: 0 auto; }
.actionbar .ref { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 14px; color: var(--ink-2); padding: 0 6px 8px; }
.actionbar .ref button { color: var(--muted); font-size: 13px; font-weight: 500; }
.actionbar .acts { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.actionbar .acts::-webkit-scrollbar { display: none; }
.act { flex: 1 0 54px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border-radius: 10px; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.act:hover { background: var(--surface-2); color: var(--ink); }
.act svg.icon { width: 22px; height: 22px; }
.act .sw { width: 22px; height: 22px; border-radius: 50%; display: flex; }
.act.hl .sw { background: var(--hl-yellow); }
.colors { display: flex; gap: 8px; padding: 6px 6px 2px; }
.colors button { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; }
.colors button.on { border-color: var(--ink); }
.colors .c-yellow { background: var(--hl-yellow); } .colors .c-green { background: var(--hl-green); } .colors .c-blue { background: var(--hl-blue); } .colors .c-pink { background: var(--hl-pink); } .colors .c-purple { background: var(--hl-purple); }
.colors .c-none { background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; width: auto; padding: 0 12px; border-radius: 999px; }

/* ------------------------------------------------------------ Sheets & dialogs */
.scrim { position: fixed; inset: 0; background: rgba(10, 12, 16, .42); z-index: 50; opacity: 0; transition: opacity .2s; }
.scrim.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--surface); color: var(--ink);
  border-radius: 20px 20px 0 0; box-shadow: var(--shadow); max-height: calc(100vh - 40px - var(--safe-top)); max-height: calc(100dvh - 40px - var(--safe-top));
  display: flex; flex-direction: column; transform: translateY(100%); transition: transform .26s cubic-bezier(.2,.8,.2,1);
  padding-bottom: var(--safe-bottom);
}
.sheet.show { transform: translateY(0); }
.sheet .grip { width: 38px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 8px auto 0; flex: none; }
.sheet header { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 20px; flex: none; }
.sheet header h2 { margin: 0; font-size: 17px; font-weight: 700; flex: 1; font-family: var(--font-ui); }
.sheet header .iconbtn { width: 38px; height: 38px; }
.sheet .body { overflow-y: auto; overscroll-behavior: contain; padding: 0 20px 20px; -webkit-overflow-scrolling: touch; }
.sheet.full { max-height: calc(100vh - var(--safe-top)); height: calc(100vh - var(--safe-top)); max-height: calc(100dvh - var(--safe-top)); height: calc(100dvh - var(--safe-top)); border-radius: 0; }
@media (min-width: 760px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: min(560px, calc(100vw - 40px)); transform: translate(-50%, -46%) scale(.98); opacity: 0; border-radius: 18px; max-height: min(82vh, 760px); transition: transform .2s ease, opacity .2s ease; }
  .sheet.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  .sheet .grip { display: none; }
  .sheet.full { height: min(86vh, 860px); max-height: min(86vh, 860px); width: min(720px, calc(100vw - 40px)); border-radius: 18px; }
  .sheet.wide { width: min(760px, calc(100vw - 40px)); }
}

/* Generic sheet content */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { height: 34px; padding: 0 12px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--ink-2); flex: 1; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg.wide { display: flex; width: 100%; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .lbl { font-weight: 600; font-size: 15px; }
.row .lbl small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }
.stepper { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.stepper button { width: 38px; height: 34px; border-radius: 8px; font-weight: 700; font-size: 18px; color: var(--ink-2); }
.stepper button:hover { background: var(--surface); color: var(--ink); }
.stepper span { min-width: 44px; text-align: center; font-weight: 600; font-size: 14px; }
.switch { position: relative; width: 50px; height: 30px; border-radius: 15px; background: var(--line-strong); transition: background .15s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch[disabled] { opacity: .4; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 14px; line-height: 1.45; }
.section-h { font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 18px 0 6px; letter-spacing: .02em; }

/* Navigator */
.nav-tabs { display: flex; gap: 6px; padding: 0 20px 10px; }
.nav-tabs .seg { flex: 1; }
.goto { display: flex; gap: 8px; margin: 0 0 14px; }
.goto input { flex: 1; height: 44px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg); padding: 0 14px; font-size: 16px; }
.goto input:focus { border-color: var(--accent); outline: none; }
.goto button { height: 44px; padding: 0 16px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.books button { min-height: 42px; border-radius: 10px; background: var(--surface-2); font-weight: 600; font-size: 13.5px; line-height: 1.15; color: var(--ink); padding: 4px 6px; }
.books button:hover { background: var(--accent-soft); color: var(--accent); }
.books button.on { background: var(--accent); color: var(--accent-ink); }
.chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 6px; }
.chapters button { height: 46px; border-radius: 10px; background: var(--surface-2); font-weight: 600; font-size: 15px; color: var(--ink); }
.chapters button:hover { background: var(--accent-soft); color: var(--accent); }
.chapters button.on { background: var(--accent); color: var(--accent-ink); }
.nav-book-head { display: flex; align-items: center; gap: 8px; margin: 2px 0 12px; }
.nav-book-head h3 { margin: 0; font-family: var(--font-serif); font-size: 20px; font-weight: 600; flex: 1; }
.nav-book-head button { color: var(--accent); font-weight: 600; font-size: 14px; padding: 6px 8px; border-radius: 8px; }

/* Option lists (translations) */
.opt { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.opt:last-child { border-bottom: 0; }
.opt .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; position: relative; }
.opt[aria-checked="true"] .radio { border-color: var(--accent); }
.opt[aria-checked="true"] .radio::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--accent); }
.opt .t { flex: 1; min-width: 0; }
.opt .t b { display: block; font-size: 15px; }
.opt .t small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; line-height: 1.4; }
.opt .abbr { letter-spacing: .04em; font-weight: 700; color: var(--accent); font-size: 13px; min-width: 44px; text-align: right; }
.opt.soon { opacity: .55; }
.opt .tagline { font-size: 11px; font-weight: 700; color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }

/* Search */
.searchbar { display: flex; gap: 8px; padding: 0 20px 10px; flex: none; }
.searchbar input { flex: 1; min-width: 0; height: 46px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg); padding: 0 14px; font-size: 16px; }
.searchbar input:focus { border-color: var(--accent); outline: none; }
.search-filters { display: flex; gap: 8px; align-items: center; padding: 0 20px 10px; flex: none; }
.search-status { font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
.progress { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; margin: 0 0 10px; }
.progress div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.result { display: block; width: 100%; text-align: left; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.result:hover { background: var(--surface-2); }
.result .r { font-weight: 700; font-size: 13.5px; color: var(--accent); margin-bottom: 3px; }
.result .x { font-family: var(--font-serif); font-size: 16px; line-height: 1.5; color: var(--ink); }
.result mark { background: var(--sel); color: inherit; padding: 0 1px; border-radius: 2px; }
.result .x.he { font-family: var(--font-hebrew); direction: rtl; text-align: right; font-size: 18px; }
.result .x.grc { font-family: var(--font-greek); }
.result .x.syc { font-family: var(--font-syriac); direction: rtl; text-align: right; font-size: 19px; }
.more { display: block; width: 100%; padding: 14px; text-align: center; color: var(--accent); font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; font-size: 15px; line-height: 1.5; }
.empty b { color: var(--ink); display: block; margin-bottom: 4px; }

/* Word study sheet — the one bold moment */
.word-hero { padding: 6px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.word-hero .orig { font-size: 44px; line-height: 1.25; font-weight: 500; color: var(--ink); margin: 0; }
.word-hero .orig.he { font-family: var(--font-hebrew); direction: rtl; text-align: right; }
.word-hero .orig.grc { font-family: var(--font-greek); }
.word-hero .orig.syc { font-family: var(--font-syriac); direction: rtl; text-align: right; }
.word-hero .xlit { font-family: var(--font-serif); font-style: italic; font-size: 19px; color: var(--ink-2); margin: 2px 0 0; }
.word-hero .gloss { font-size: 16px; color: var(--ink); margin: 8px 0 0; }
.word-hero .gloss b { color: var(--accent); }
.word-hero .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.link { cursor: pointer; }
.chip.link:hover { background: var(--accent-soft-2); color: var(--accent); }
.word-phrase { font-size: 14px; color: var(--muted); margin: 0 0 4px; }
.word-phrase b { color: var(--ink); font-family: var(--font-serif); font-size: 16px; font-weight: 600; }
.word-nav { display: flex; gap: 6px; margin: 0 0 8px; flex-wrap: wrap; }
.word-nav button { height: 30px; padding: 0 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.word-nav button.on { background: var(--accent); color: var(--accent-ink); }
.def { font-size: 15.5px; line-height: 1.55; color: var(--ink); margin: 0 0 6px; }
.def i { color: var(--ink-2); }
.def.lex { font-size: 14.5px; color: var(--ink-2); }
.def.lex b { color: var(--ink); }
.def ref, .def a.r { color: var(--accent); cursor: pointer; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 14.5px; margin: 8px 0; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; }
.occ-list .result .x { font-size: 15px; }
.study-cta { margin: 18px 0 4px; padding: 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); font-size: 13.5px; line-height: 1.5; }
.study-cta b { display: block; margin-bottom: 2px; }

/* Compare */
.cmp { padding: 12px 0; border-bottom: 1px solid var(--line); }
.cmp:last-child { border-bottom: 0; }
.cmp .abbr { letter-spacing: .04em; font-weight: 700; color: var(--accent); font-size: 12.5px; margin-bottom: 4px; }
.cmp .x { font-family: var(--font-serif); font-size: 17px; line-height: 1.55; }
.cmp .x .vn, .result .x .vn { font-family: var(--font-ui); font-size: .62em; font-weight: 600; color: var(--accent); vertical-align: super; margin-right: .2em; }
.cmp .x.he { font-family: var(--font-hebrew); direction: rtl; text-align: right; font-size: 20px; line-height: 1.8; }
.cmp .x.grc { font-family: var(--font-greek); }
.cmp .x.syc { font-family: var(--font-syriac); direction: rtl; text-align: right; font-size: 21px; line-height: 1.8; }

/* Notes */
.note-area { width: 100%; min-height: 140px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg); padding: 12px 14px; font: inherit; font-size: 16px; line-height: 1.5; resize: vertical; }
.note-area:focus { border-color: var(--accent); outline: none; }
.btnrow { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.btn { height: 42px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: var(--surface-2); color: var(--ink); }
.btn.danger { color: var(--danger); }

/* Menu */
.menu a, .menu button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 4px; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: 15.5px; text-align: left; }
.menu a:last-child, .menu button:last-child { border-bottom: 0; }
.menu svg.icon { color: var(--accent); }
.menu small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }

/* Bookmarks list */
.bk { display: block; width: 100%; text-align: left; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.bk .r { font-weight: 700; color: var(--accent); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.bk .r .sw { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.bk .x { font-family: var(--font-serif); font-size: 15.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bk .n { font-size: 14px; color: var(--ink); margin-top: 4px; white-space: pre-wrap; }

/* About */
.about h3 { font-family: var(--font-serif); font-size: 18px; margin: 18px 0 6px; }
.about p, .about li { font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.about ul { padding-left: 18px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; z-index: 70; opacity: 0; transition: all .2s; pointer-events: none; box-shadow: var(--shadow); max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Footnote popover (uses the sheet) */
.fn-body { font-family: var(--font-serif); font-size: 17px; line-height: 1.55; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media print {
  .appbar, .actionbar, .chapter-end, .welcome { display: none !important; }
  .reader { padding: 0; max-width: none; }
}
