/* Holy Bible Words — app stylesheet */
:root {
  --blue: #1b5e8f; --green: #1f9a5a;
  --brand: linear-gradient(135deg, #1d5aa0 0%, #1f9a5a 100%);
  --bg: #f4f7f5; --surface: #ffffff; --surface-2: #eaf0ec; --text: #1c2622; --muted: #5d6b65;
  --line: #d8e1dc; --accent: #1b6aa3; --accent-ink: #ffffff; --mark: #fff1a8;
  --hl-yellow: #fff2a8; --hl-green: #cdeccf; --hl-blue: #cfe3fb; --hl-pink: #f9d3e1;
  --reader-size: 19px; --reader-lh: 1.75;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,40,30,.06), 0 6px 20px rgba(16,40,30,.06);
  --top: 60px; --tab: 64px;
  color-scheme: light;
}
:root[data-theme="sepia"] {
  --bg: #f3ead8; --surface: #fbf5e9; --surface-2: #efe3cb; --text: #3b2f22; --muted: #7a6a55;
  --line: #e2d4b8; --accent: #8a5a1f; --mark: #f6dd8f;
  --hl-yellow: #f6e3a1; --hl-green: #d9e5bd; --hl-blue: #d6dfe6; --hl-pink: #efcfc8;
}
:root[data-theme="dark"] {
  --bg: #0f1418; --surface: #161d22; --surface-2: #1e272e; --text: #e3e9e6; --muted: #98a6a0;
  --line: #2a353c; --accent: #6db4e8; --accent-ink: #0b1116; --mark: #5c5216;
  --hl-yellow: #5a5119; --hl-green: #1f4a2c; --hl-blue: #1d3a5a; --hl-pink: #5a2639;
  --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0f1418; --surface: #161d22; --surface-2: #1e272e; --text: #e3e9e6; --muted: #98a6a0;
    --line: #2a353c; --accent: #6db4e8; --accent-ink: #0b1116; --mark: #5c5216;
    --hl-yellow: #5a5119; --hl-green: #1f4a2c; --hl-blue: #1d3a5a; --hl-pink: #5a2639;
    --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 64px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans); min-height: 100vh;
  padding-bottom: calc(var(--tab) + env(safe-area-inset-bottom)); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h2 { font-size: 1.25rem; }
.ic { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 100; top: 8px; left: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 62ch; }
[hidden] { display: none !important; }

/* ---- top bar ---- */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 12px;
  padding: 0 12px; padding-top: env(safe-area-inset-top); height: calc(var(--top) + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; min-height: 44px; min-width: 40px; color: var(--text); font-weight: 650; font-size: 1.02rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand b { background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ver-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); margin-left: auto; }
.ver-switch a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 13px; border-radius: 999px; font-weight: 650; font-size: .86rem; color: var(--muted); letter-spacing: .02em; }
.ver-switch a:hover { text-decoration: none; color: var(--text); }
.ver-switch a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.mainnav { display: none; }
.theme-btn .i-sun { display: none; }
.topbar .theme-btn[aria-pressed="true"] { background: transparent; color: var(--text); }
.topbar .theme-btn[aria-pressed="true"]:hover { background: var(--surface-2); }
:root[data-theme="dark"] .theme-btn .i-sun { display: inline; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .theme-btn .i-sun { display: inline; }
  :root[data-theme="auto"] .theme-btn .i-moon { display: none; }
}
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent;
  color: var(--text); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-2); text-decoration: none; }
.icon-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
#progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--brand); z-index: 50; transition: width .2s, opacity .3s; opacity: 0; }
#progress.on { opacity: 1; width: 70%; transition: width 2s cubic-bezier(.1,.6,.2,1); }
#progress.done { opacity: 0; width: 100%; }
/* phones: icon-only brand, nothing may shrink or push the buttons off screen */
.brand, .brand img, .ver-switch, .topbar > .icon-btn { flex: none; }
@media (max-width: 599px) {
  .topbar { gap: 6px; padding: 0 8px; }
  .brand span { display: none; }
  .ver-switch { margin: 0 auto; }
  .topbar > .icon-btn { width: 44px; height: 44px; }
  /* reader bar: let the book/chapter button use all spare width */
  .topbar ~ main .reader-bar { gap: 0; padding: 6px 4px; }
  .reader-bar .picker-btn { padding: 8px 8px 8px 10px; gap: 2px; flex: 1 1 auto; justify-content: center; }
  .reader-bar .reader-tools { margin-left: 0; }
  .reader-bar .reader-tools .icon-btn, .reader-bar > .icon-btn { width: 38px; }
}
@media (max-width: 360px) {
  .ver-switch a { padding: 0 10px; font-size: .82rem; }
  .topbar > .icon-btn { width: 40px; }
  .reader-bar .picker-btn { font-size: .92rem; }
}

/* ---- bottom tab bar (mobile) ---- */
.tabbar { position: fixed; z-index: 30; bottom: 0; left: 0; right: 0; display: flex; height: calc(var(--tab) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .72rem; color: var(--muted); }
.tabbar a:hover { text-decoration: none; }
.tabbar a.on { color: var(--accent); }
.tabbar .ic { width: 22px; height: 22px; }
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .mainnav { display: flex; gap: 2px; }
  .mainnav a { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 10px; color: var(--muted); font-weight: 550; font-size: .93rem; }
  .mainnav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
  .mainnav a.on { color: var(--text); background: var(--surface-2); }
  .mainnav .ic { width: 18px; height: 18px; }
  .ver-switch { margin-left: 18px; order: 1; }
  .mainnav { margin-left: auto; order: 2; }
  .topbar > .icon-btn { order: 3; }
  .topbar > .icon-btn + .icon-btn { margin-left: -6px; }
}

/* ---- buttons, chips ---- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink); font: 600 .95rem var(--sans); cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn .ic { width: 18px; height: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chip { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: .9rem; }
.chip:hover { text-decoration: none; border-color: var(--accent); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.badge { display: inline-block; font: 700 .68rem/1 var(--sans); padding: 3px 6px; border-radius: 6px; background: var(--surface-2); color: var(--muted); vertical-align: middle; letter-spacing: .04em; }
.notice { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  padding: 10px 14px; border-radius: 12px; font-size: .93rem; }

/* ---- search / jump box ---- */
.jump { display: flex; max-width: 640px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); margin: 16px 0; }
.jump input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 14px 16px; font: 1rem var(--sans); color: var(--text); outline: none; }
.jump button { border: 0; background: transparent; color: var(--accent); padding: 0 16px; cursor: pointer; }
.jump:focus-within { border-color: var(--accent); }

/* ---- home ---- */
.hero { background: var(--brand); color: #fff; padding: 40px 0 28px; margin-bottom: 24px; }
.hero h1 { color: #fff; }
.hero .lead { color: rgba(255,255,255,.88); }
.hero .chip { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; }
.hero .jump { border: 0; }
.home-grid { display: grid; gap: 20px; margin-bottom: 28px; align-items: start; }
@media (min-width: 900px) { .home-grid { grid-template-columns: 1.4fr 1fr; } .home-grid .votd { grid-row: span 2; } }
section { margin-bottom: 28px; }
.ver-cards { display: grid; gap: 10px; }
.ver-card { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); }
.ver-card:hover { text-decoration: none; border-color: var(--accent); }
.ver-card span { grid-column: 1; color: var(--muted); font-size: .9rem; }
.ver-card .ic { grid-row: 1 / span 2; grid-column: 2; color: var(--muted); }
.continue { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0; }
.continue h2 { font-size: 1rem; color: var(--muted); margin-bottom: 4px; }
.continue-link { font-size: 1.2rem; font-weight: 650; }
.features ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.features li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 4px; }
.features li .ic { color: var(--green); width: 24px; height: 24px; }
.features li span { color: var(--muted); font-size: .92rem; }
.article-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.article-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--text); display: grid; }
.article-card:hover { text-decoration: none; border-color: var(--accent); }
.article-card img { aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.article-card strong { padding: 12px 14px 4px; }
.article-card span { padding: 0 14px 14px; color: var(--muted); font-size: .9rem; }
.shop-items { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.shop-items a { flex: 0 0 150px; color: var(--text); font-size: .88rem; display: grid; gap: 6px; }
.shop-items img { border-radius: 10px; height: 190px; width: auto; object-fit: contain; background: #fff; }

/* ---- verse of the day ---- */
.votd { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); overflow: hidden; margin: 0; }
.votd::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--brand); }
.votd-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px; }
.votd-head h1, .votd-head h2 { font-size: 1.05rem; color: var(--green); display: flex; gap: 6px; align-items: center; margin: 0; }
.votd-head time { color: var(--muted); font-size: .88rem; }
.votd-text { font: 1.45rem/1.5 var(--serif); margin: 16px 0 10px; }
.votd-ref { font-weight: 650; margin: 0 0 12px; }
.votd .note { color: var(--muted); font-size: .85rem; margin: -6px 0 12px; }
.votd-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- grids ---- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 16px 0 8px; font-size: .86rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 4px; }
.crumbs a { color: var(--muted); }
.page-head { margin: 18px 0 8px; }
.book-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.book-grid a { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 11px 13px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 550; }
.book-grid a:hover { text-decoration: none; border-color: var(--accent); }
.book-grid small { color: var(--muted); font-weight: 400; }
.book-grid a.na, .num-grid a.na { opacity: .55; }
.num-grid { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); }
.num-grid.small { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.num-grid a { display: grid; place-items: center; aspect-ratio: 1; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 600; }
.num-grid a:hover, .num-grid a[aria-current] { text-decoration: none; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.grid-title { margin-top: 24px; font-size: 1.05rem; }
.book-open { font: 1.2rem/1.6 var(--serif); border-left: 4px solid var(--green); margin: 16px 0; padding: 6px 16px; }
.book-open cite { display: block; font: .85rem var(--sans); color: var(--muted); margin-top: 6px; }

/* ---- reader ---- */
.reader-bar { position: sticky; top: calc(var(--top) + env(safe-area-inset-top)); z-index: 20; display: flex; align-items: center; gap: 4px; padding: 6px 10px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.picker-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 12px; padding: 8px 14px; font: 650 1rem var(--sans); cursor: pointer; min-width: 0; }
.picker-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-btn:hover { border-color: var(--accent); }
.reader-tools { margin-left: auto; display: flex; gap: 2px; }
.reader-wrap { max-width: 760px; }
@media (min-width: 900px) { .reader-bar { padding-inline: max(16px, calc(50% - 372px)); } }
.chapter h1 { font: 600 clamp(1.6rem, 4vw, 2.2rem)/1.2 var(--serif); text-align: center; margin: 18px 0 22px; }
.chapter h1 .ch-num { display: block; font-size: 2.6em; line-height: 1; background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.verses { font-size: var(--reader-size); line-height: var(--reader-lh); font-family: var(--serif); }
:root[data-font="sans"] .verses, :root[data-font="sans"] .votd-text, :root[data-font="sans"] .verse-card { font-family: var(--sans); }
.v { border-radius: 4px; cursor: pointer; transition: background .2s; -webkit-tap-highlight-color: transparent; }
:root[data-layout="verses"] .v { display: block; margin-bottom: .45em; }
.vn { font: 700 .62em var(--sans); color: var(--green); vertical-align: super; margin-right: 2px; padding: 0 2px; }
:root[data-nums="off"] .vn { display: none; }
.v i { font-style: italic; opacity: .85; }
.v.marked, .v.flash { background: var(--mark); }
.v.sel { text-decoration: underline dotted var(--accent) 2px; text-underline-offset: 5px; }
.v[data-hl="yellow"] { background: var(--hl-yellow); }
.v[data-hl="green"] { background: var(--hl-green); }
.v[data-hl="blue"] { background: var(--hl-blue); }
.v[data-hl="pink"] { background: var(--hl-pink); }
.v.has-note::after { content: "✎"; font: .7em var(--sans); color: var(--accent); margin-left: 4px; }
.v.bm .vn::before { content: "★"; color: #e0a100; margin-right: 1px; }
.v.fb { color: var(--muted); }
.fb-tag { font: 700 .55em var(--sans); color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 3px; vertical-align: middle; }
.v.speaking { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.par { display: block; font-size: .92em; color: var(--muted); margin: -.1em 0 .8em 1.2em; padding-left: .7em; border-left: 3px solid var(--line); }
.par b { font: 700 .62em var(--sans); color: var(--accent); margin-right: 6px; letter-spacing: .04em; }
@media (min-width: 900px) {
  .parallel .verses { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .parallel .verses .v { display: block; margin: 0 0 .6em; }
  .parallel .verses .par { margin: 0 0 .6em; border: 0; padding: 0; font-size: 1em; color: var(--text); }
  .reader-wrap.wide { max-width: 1100px; }
}
.chapter-foot, .verse-nav { display: flex; justify-content: space-between; gap: 10px; margin: 28px 0; flex-wrap: wrap; }
.ver-credit { color: var(--muted); font-size: .8rem; text-align: center; margin-bottom: 30px; }

/* verse page */
.verse-page h1 { font-family: var(--serif); }
.verse-card { margin: 18px 0; padding: 26px 24px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.verse-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--brand); }
.verse-card p { font: 1.55rem/1.55 var(--serif); margin: 0 0 12px; }
.verse-card footer { color: var(--muted); font-weight: 600; }
.verse-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.compare { margin-top: 24px; display: grid; gap: 12px; }
.compare-item { background: var(--surface-2); border-radius: 14px; padding: 14px 16px; }
.compare-item h2 { font-size: .95rem; margin-bottom: 6px; }
.compare-item p { font: 1.12rem/1.6 var(--serif); margin: 0; }

/* search results */
.results { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.results a { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.results a:hover { text-decoration: none; border-color: var(--accent); }
.results strong { color: var(--accent); font-size: .92rem; }
.results span { font: 1.05rem/1.55 var(--serif); }
.results time { color: var(--muted); font-size: .8rem; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 24px 0; }

/* plan / saved */
.plan-progress { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 8px 0 18px; }
.plan-progress > div { height: 100%; background: var(--brand); }
.plan-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.plan-day h2 { display: flex; justify-content: space-between; align-items: baseline; }
.plan-day ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.plan-day li { display: flex; align-items: center; gap: 10px; }
.plan-day input { width: 22px; height: 22px; accent-color: var(--green); }
.plan-nav { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.tabs { display: flex; gap: 6px; margin: 12px 0 16px; overflow-x: auto; }
.tabs button { border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 999px; font: 600 .9rem var(--sans); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.saved-item { display: flex; gap: 10px; align-items: flex-start; }
.saved-item a { flex: 1; }
.saved-item .icon-btn { margin-top: 6px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* install / offline */
.install-box, .offline-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.install-help h2 { font-size: 1rem; margin: 16px 0 4px; }
.install-help p { margin: 0; color: var(--muted); }
.offline-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* blog */
.post h1 { margin-top: 10px; }
.post-hero { border-radius: var(--radius); margin: 8px 0 18px; aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.prose { font-size: 1.06rem; line-height: 1.7; }
.prose h2 { margin-top: 1.6em; }

/* ---- sheets (picker, verse actions, settings) ---- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(8,14,12,.45); opacity: 0; transition: opacity .2s; }
.sheet-backdrop.open { opacity: 1; }
.sheet { position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; max-height: 86vh; display: flex; flex-direction: column;
  background: var(--surface); color: var(--text); border-radius: 20px 20px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.2);
  transform: translateY(100%); transition: transform .25s cubic-bezier(.2,.8,.2,1); padding-bottom: env(safe-area-inset-bottom); }
.sheet.open { transform: none; }
@media (min-width: 700px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: min(640px, 94vw); max-height: 80vh; border-radius: 20px;
    transform: translate(-50%, -46%) scale(.98); opacity: 0; transition: transform .2s, opacity .2s; }
  .sheet.open { transform: translate(-50%, -50%); opacity: 1; }
}
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px 18px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 1.08rem; flex: 1; }
.sheet-body { overflow-y: auto; padding: 14px 18px 20px; overscroll-behavior: contain; }
.sheet .tabs { margin: 0 0 12px; }
.sheet .book-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.sheet .book-grid a { padding: 9px 11px; font-size: .94rem; }
.sheet .book-grid a.cur { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.picker-filter { width: 100%; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 12px; padding: 10px 12px; font: 1rem var(--sans); margin-bottom: 12px; }
.picker-crumb { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; font-weight: 650; }
.picker-crumb button { border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.actions-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.actions-grid button { display: grid; justify-items: center; gap: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--text);
  border-radius: 14px; padding: 12px 4px; font: 600 .78rem var(--sans); cursor: pointer; }
.actions-grid button:hover { border-color: var(--accent); }
.actions-grid button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.hl-row { display: flex; gap: 12px; align-items: center; margin: 4px 0 16px; }
.hl-row button { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
.hl-row button.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }
.hl-row .clear { background: var(--surface); color: var(--muted); display: grid; place-items: center; }
.sheet-verse { font: 1.08rem/1.6 var(--serif); margin: 0 0 14px; max-height: 30vh; overflow: auto; }
.sheet textarea { width: 100%; min-height: 110px; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 12px; padding: 10px; font: 1rem var(--sans); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 7px 12px; border-radius: 10px; font: 600 .88rem var(--sans); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.set-row input[type=range] { width: 160px; accent-color: var(--accent); }
.img-preview { width: 100%; border-radius: 14px; display: block; margin-bottom: 12px; }

#toast { position: fixed; left: 50%; bottom: calc(var(--tab) + 18px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 70;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: .92rem; opacity: 0; pointer-events: none; transition: .25s; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { #toast { bottom: 24px; } }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 26px 0 30px; margin-top: 40px; font-size: .9rem; color: var(--muted); }
.foot-brand { display: flex; align-items: center; gap: 8px; font-weight: 650; color: var(--text); margin-bottom: 10px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.foot-links a { color: var(--muted); }
.copy { font-size: .8rem; margin: 0; }

/* page transitions */
main { animation: fade .18s ease-out; }
main.leaving { opacity: .55; transition: opacity .12s; }
@keyframes fade { from { opacity: .4; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .topbar, .tabbar, .reader-bar, .site-footer, .verse-actions, .chapter-foot { display: none !important; } }
.copy .ver-credit { text-align: left; margin: 0 0 6px; }
.copyright-page .ver-credit { text-align: left; font-size: .85rem; }
.v-anchor { display: inline; }
.steps { padding-left: 1.2em; margin: 8px 0 14px; color: var(--muted); }
.steps li { margin-bottom: 6px; }
.steps strong { color: var(--text); }
