/* Living Word Study — quiet, spacious Scripture workspace. */
:root {
  --bg: #f7f7f2;
  --surface: #ffffff;
  --surface-2: #eef2ea;
  --text: #293c34;
  --muted: #68746c;
  --border: #e2e6df;
  --accent: #294c40;
  --accent-strong: #1e3a31;
  --accent-soft: #edf2ea;
  --on-accent: #ffffff;
  --gold: #b78535;
  --good: #2f6b45;
  --warn: #8a5a12;
  --warn-soft: #fbf1df;
  --bad: #843b31;
  --bad-soft: #f8e9e6;
  --hl-yellow: #fff0bc;
  --hl-green: #dcefd6;
  --hl-blue: #dce9f7;
  --hl-pink: #f7dde6;
  --sel: #e4ede0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(30, 50, 40, .05), 0 6px 18px rgba(30, 50, 40, .05);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --scripture-size: 20px;
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171f1b; --surface: #202b25; --surface-2: #2b3d30; --text: #e4ece3; --muted: #adbbaf; --border: #3b4a3f;
    --accent: #90b99d; --accent-strong: #a9cdb4; --accent-soft: #2b3d30; --on-accent: #10201a; --gold: #d6a85a;
    --good: #8fcf9e; --warn: #e7b763; --warn-soft: #3a3020; --bad: #e79a8f; --bad-soft: #3b2420;
    --hl-yellow: #544622; --hl-green: #2f4a32; --hl-blue: #2a3b52; --hl-pink: #4d2c38; --sel: #33463a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #171f1b; --surface: #202b25; --surface-2: #2b3d30; --text: #e4ece3; --muted: #adbbaf; --border: #3b4a3f;
  --accent: #90b99d; --accent-strong: #a9cdb4; --accent-soft: #2b3d30; --on-accent: #10201a; --gold: #d6a85a;
  --good: #8fcf9e; --warn: #e7b763; --warn-soft: #3a3020; --bad: #e79a8f; --bad-soft: #3b2420;
  --hl-yellow: #544622; --hl-green: #2f4a32; --hl-blue: #2a3b52; --hl-pink: #4d2c38; --sel: #33463a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans); }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: normal; line-height: 1.2; margin: 0 0 .4em; text-wrap: balance; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; }
.pre { white-space: pre-wrap; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; font-weight: 700; color: var(--gold); margin: 0 0 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: .9rem; }
.btn.block { width: 100%; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 44px; padding: 0; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
label.field > small { display: block; color: var(--muted); font-size: .8rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 16px;
}
textarea { min-height: 90px; resize: vertical; line-height: 1.55; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--bad); }
.field .err { color: var(--bad); font-size: .85rem; margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; font-weight: 600; }
.check input, .check-lg { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.form-error { background: var(--bad-soft); color: var(--bad); padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; }
.form-note { background: var(--accent-soft); padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; }
.toggle { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.toggle input { width: 20px; height: 20px; accent-color: var(--accent); }

/* Public */
.public { max-width: 1060px; margin: 0 auto; padding: 0 16px 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--serif); font-size: 1.15rem; }
.brand img { width: 36px; height: 36px; }
.brand small { display: block; font-family: var(--sans); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 36px; align-items: center; padding: 44px 0 20px; }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.4rem); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 36em; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 12px; }
.hero-verse { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 30px 28px; box-shadow: var(--shadow); position: relative; }
.hero-verse::before { content: ""; position: absolute; left: 0; top: 28px; bottom: 28px; width: 3px; background: var(--gold); border-radius: 3px; }
.hero-verse blockquote { margin: 0 0 12px; font-family: var(--serif); font-size: 1.45rem; line-height: 1.5; }
.hero-verse figcaption { color: var(--muted); font-size: .9rem; }
.section { padding: 34px 0 6px; }
.section > h2 { font-size: 1.6rem; margin-bottom: 18px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.feature .ico { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 10px; }
.feature p { color: var(--muted); margin: 0; font-size: .95rem; }
.pricing { display: grid; grid-template-columns: repeat(2, minmax(0, 320px)); gap: 14px; }
.price { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.price.best { border: 2px solid var(--accent); }
.price .amt { font-size: 2rem; font-family: var(--serif); }
.price ul { padding-left: 20px; margin: 10px 0 0; }
.footer { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; }
.auth-wrap { max-width: 440px; margin: 0 auto; padding: 0 16px 48px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 26px; box-shadow: var(--shadow); }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Shell */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.side-brand { padding: 0 8px 16px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 550; }
.side nav a:hover { background: var(--surface-2); }
.side nav a.active { background: var(--accent-soft); color: var(--accent); }
.side .sep { height: 1px; background: var(--border); margin: 10px 8px; }
.side-foot { margin-top: auto; padding: 16px 10px 0; font-family: var(--serif); font-style: italic; color: var(--muted); font-size: .85rem; }
.main { min-width: 0; }
.content { padding: 24px 28px 48px; max-width: 1140px; }
.content:focus { outline: none; }
.bottomnav { display: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { margin: 0; }

/* Cards & lists */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-h h2, .card-h h3 { margin: 0; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 16px; align-items: start; }
.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.item:last-child { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .name { font-weight: 600; overflow-wrap: anywhere; }
.item.clickable { cursor: pointer; border-radius: 8px; }
.item.clickable:hover { background: var(--surface-2); }
.meta { color: var(--muted); font-size: .84rem; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.pill { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 999px; font-size: .74rem; font-weight: 650; background: var(--surface-2); color: var(--muted); margin-left: 4px; }
.pill.good { background: var(--accent-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.plus { background: var(--gold); color: #fff; }
.empty { text-align: center; padding: 24px 10px; color: var(--muted); }
.empty .btn, .empty a.btn { margin-top: 12px; }
.bar { height: 7px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.bar.big { height: 12px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.tabs, .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chips { margin: 10px 0 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 14px; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; }
.chip.small { padding: 2px 10px; font-size: .78rem; cursor: default; }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.chip-x { border: 0; background: none; color: inherit; cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 0 0 4px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); background: var(--bg); }
.tile:hover { border-color: var(--accent); }
.tile svg { color: var(--accent); margin-bottom: 4px; }
.tile span { color: var(--muted); font-size: .85rem; }
.reflink { font-weight: 600; }
.note-list { display: grid; gap: 12px; }
.note-card .card-h { align-items: flex-start; }
.prayer.answered { border-left: 3px solid var(--good); }
.answered { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.dots i.on { background: var(--accent); }
.more-item svg:first-child { color: var(--accent); }

/* Scripture */
.scripture { font-family: var(--serif); font-size: var(--scripture-size); line-height: 1.75; }
.scripture sup { font-family: var(--sans); font-size: .58em; font-weight: 700; color: var(--gold); margin-right: 2px; }
.scripture-sm { font-family: var(--serif); font-size: 1.02rem; line-height: 1.6; margin: 4px 0 0; }
.scripture-sm mark, .scripture mark { background: var(--hl-yellow); color: inherit; padding: 0 2px; border-radius: 3px; }
.passage .verse { margin: 0 0 .35em; }
.attrib { font-family: var(--sans); font-size: .78rem; color: var(--muted); margin-top: 10px; }
.reader-page { max-width: 820px; margin: 0 auto; padding-bottom: 160px; }
.reader-bar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.nav-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.nav-row select { width: auto; min-width: 0; }
#book_sel { flex: 1 1 160px; }
#chapter_sel { flex: 0 1 130px; }
.tr-select { width: auto; flex: 0 0 auto; }
.goref { display: flex; gap: 8px; }
.goref input { flex: 1; }
.chapter-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0 6px; }
.chapter-head h1 { margin: 0; text-align: center; flex: 1; font-size: 2rem; }
.chapter-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: center; margin-bottom: 16px; }
.chapter-tools .hint { flex-basis: 100%; text-align: center; }
.reader .v { padding: 2px 8px; margin: 0 -8px; border-radius: 6px; cursor: pointer; }
.reader .v:hover { background: var(--surface-2); }
.reader .v.sel { background: var(--sel); box-shadow: inset 3px 0 0 var(--accent); }
.reader .v.hl-yellow { background: var(--hl-yellow); }
.reader .v.hl-green { background: var(--hl-green); }
.reader .v.hl-blue { background: var(--hl-blue); }
.reader .v.hl-pink { background: var(--hl-pink); }
.reader .v.sel.hl-yellow, .reader .v.sel.hl-green, .reader .v.sel.hl-blue, .reader .v.sel.hl-pink { box-shadow: inset 3px 0 0 var(--accent); }
.reader .v.flash { animation: flash 2s ease-out; }
@keyframes flash { 0% { background: var(--hl-yellow); } 100% { background: transparent; } }
.reader.no-nums sup { display: none; }
.reader .vt { display: inline; }
.reader.parallel .v { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 6px; }
.reader.parallel .vt { display: block; }
.reader.parallel .vt.alt { color: var(--muted); }
.par-head { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; font-family: var(--sans); font-size: .8rem; font-weight: 700; color: var(--muted); letter-spacing: .08em; padding: 0 0 6px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.note-dot { border: 0; background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 2px 4px; margin-left: 4px; cursor: pointer; vertical-align: middle; display: inline-flex; }
.chapter-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 24px; }
.actionbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; width: min(640px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); padding: 12px 14px; z-index: 30; display: flex; flex-direction: column; gap: 10px; }
.ab-head { display: flex; justify-content: space-between; align-items: center; }
.ab-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; font-size: 1.2rem; color: var(--muted); background: var(--surface); }
.sw-yellow { background: var(--hl-yellow); } .sw-green { background: var(--hl-green); } .sw-blue { background: var(--hl-blue); } .sw-pink { background: var(--hl-pink); }
.note-view { border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 12px; }

/* Search */
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; }
.search-opts { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.search-opts label { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; }
.search-opts select { width: auto; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }

/* Study */
.steps-list { margin: 0 0 8px; padding-left: 22px; columns: 2; }
.study-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.title-input { flex: 1 1 260px; font-family: var(--serif); font-size: 1.3rem !important; }
.save-status { color: var(--muted); font-size: .85rem; min-width: 110px; }
.study-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 18px; align-items: start; }
.study-main { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.passage-pane { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.pane-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.passage-pane .scripture { font-size: calc(var(--scripture-size) * .9); }
.related details { border-top: 1px solid var(--border); padding: 8px 0; }
.related summary { cursor: pointer; font-weight: 600; }
.step-nav { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 16px; }
.step-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--muted); font: inherit; font-size: .72rem; cursor: pointer; text-align: center; line-height: 1.2; }
.step-btn .n { font-weight: 800; font-size: 1rem; color: var(--text); }
.step-btn.done .n { color: var(--good); }
.step-btn.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.questions { padding-left: 20px; color: var(--muted); }
.questions li { margin-bottom: 4px; }
.step-foot { display: flex; justify-content: space-between; margin-top: 14px; }
.related-edit { margin-bottom: 12px; }
.mobile-tabs { display: none; }
.lesson-form textarea { min-height: 110px; }

/* Plans */
.tpl-list { display: grid; gap: 8px; margin-bottom: 14px; }
.tpl { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer; }
.tpl input { margin-top: 4px; width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.tpl span { display: flex; flex-direction: column; }
.tpl:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.plan-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 16px; margin-bottom: 12px; }
.plan-group summary { cursor: pointer; font-weight: 700; padding: 10px 0; }
.date-sm { width: 150px !important; min-height: 38px !important; font-size: .85rem !important; }

/* Memory review */
.review-text { min-height: 120px; background: var(--bg); border-radius: 12px; padding: 16px; }

/* Sheet */
.overlay { position: fixed; inset: 0; background: rgba(10, 20, 15, .45); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; }
.sheet { background: var(--surface); border-radius: 18px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.sheet-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.sheet-h h2 { margin: 0; }
.sheet-b { padding: 18px; }
.sheet-f { display: flex; gap: 10px; padding: 0 18px 18px; flex-wrap: wrap; }
.sheet-f .spacer { flex: 1; }
.x { width: 40px; height: 40px; border: 0; background: var(--surface-2); color: var(--text); border-radius: 10px; cursor: pointer; font-size: 1.2rem; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
#toast .t { background: #1e2b25; color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; max-width: 90vw; }
#toast .t.err { background: #843b31; }

.print-only { display: none; }
@media print {
  .side, .bottomnav, .no-print, #toast, .actionbar { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  .print-only { display: block; font-family: var(--serif); color: #000; }
  .print-only h2 { margin-top: 18px; }
  .lesson-print .card { box-shadow: none; border: 0; padding: 0; }
  body { background: #fff; }
}

@media (max-width: 1100px) {
  .features { grid-template-columns: 1fr 1fr; }
  .study-grid { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); }
}
@media (max-width: 900px) {
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: 1fr; padding-top: 16px; }
  .step-btn .l { display: none; }
}
@media (max-width: 800px) {
  .shell { display: block; }
  .side { display: none; }
  .content { padding: 16px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; height: var(--nav-h); color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 650; gap: 2px; }
  .bottomnav a.active { color: var(--accent); }
  .actionbar { bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom)); }
  .study-grid { grid-template-columns: minmax(0, 1fr); }
  .study-grid .passage-pane { display: none; position: static; max-height: none; }
  .study-grid.show-passage .passage-pane { display: block; }
  .study-grid.show-passage .study-main { display: none; }
  .mobile-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
  .reader.parallel .v { grid-template-columns: 1fr; gap: 2px; }
  .reader.parallel .vt.alt { padding-left: 12px; border-left: 2px solid var(--border); font-size: .92em; }
  .par-head { display: none; }
  .overlay { align-items: flex-end; padding: 0; }
  .sheet { border-radius: 18px 18px 0 0; max-height: 92vh; }
  .sheet-f { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
  .features, .pricing { grid-template-columns: 1fr; }
  .steps-list { columns: 1; }
  .chapter-head h1 { font-size: 1.6rem; }
  #toast { bottom: calc(var(--nav-h) + 16px); }
  h1 { font-size: 1.6rem; }
}
@media (max-width: 420px) {
  .tiles { grid-template-columns: 1fr; }
  .search-row { flex-direction: column; }
  .step-nav { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
