:root {
  --bg: #f6f1e6; --card: #fffdf8; --ink: #23201a; --dim: #6f6858; --line: #ddd4c1;
  --brand: #274b3f; --brand-ink: #f4ead2; --gold: #a9741a; --ok: #2e7d57; --miss: #c0392b;
  --new: #d9d1bf; --learning: #d9a13a; --growing: #6fa77f; --known: #274b3f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #171a18; --card: #1f2421; --ink: #ece6d8; --dim: #a39c8b; --line: #353c37;
    --brand: #7fb89f; --brand-ink: #13201b; --gold: #e0ad4f; --ok: #5cc493; --miss: #f0786a; --new: #3a413c; --learning: #c9963a; --growing: #5f9a72; --known: #a6dcc4; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--sans); }
a { color: var(--brand); }
img { max-width: 100%; }
[hidden] { display: none !important; }
.dim { color: var(--dim); } .small { font-size: 14px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; letter-spacing: .01em; }
.mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--brand); color: var(--brand-ink); font: 700 17px var(--serif); }
.top nav { display: flex; gap: 4px; }
.top nav a { text-decoration: none; color: var(--dim); font-weight: 600; font-size: 15px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.top nav a.on { color: var(--ink); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
#due-badge { background: var(--gold); color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 12px; margin-left: 2px; }
main { max-width: 860px; margin: 0 auto; padding: 24px 16px 48px; min-height: 60vh; }
.loading { text-align: center; color: var(--dim); padding: 60px 0; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin: 0 0 8px; display: block; }
.eyebrow a { color: inherit; }
h1 { font: 700 34px/1.2 var(--serif); margin: 0 0 14px; text-wrap: balance; }
h2 { font: 700 21px/1.3 var(--serif); margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; align-items: center; }
.row.center { justify-content: center; }
.btn { display: inline-block; font: 600 15px var(--sans); padding: 10px 16px; border-radius: 10px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); cursor: pointer; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; }
.link { background: none; border: 0; color: var(--brand); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.hero { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin-bottom: 26px; }
.hero h1 { max-width: 16em; }
.stats { display: flex; flex-wrap: wrap; gap: 18px; color: var(--dim); }
.stats b { font: 700 24px var(--serif); color: var(--ink); margin-right: 4px; }
.series { margin: 0 0 26px; }
.series-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 8px; }
.letter { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font: 700 15px var(--sans); margin-right: 10px; vertical-align: 2px; }
.topic { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.topic-name { font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.chip { display: inline-block; font: 600 13px var(--sans); padding: 4px 10px; border-radius: 20px; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--new); white-space: nowrap; }
.chip.learning { border-left-color: var(--learning); } .chip.growing { border-left-color: var(--growing); } .chip.known { border-left-color: var(--known); }
.chip.due { box-shadow: 0 0 0 2px var(--gold); }
.legend { text-align: center; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 4px 0 12px; background: var(--new); }
.dot.learning { background: var(--learning); } .dot.growing { background: var(--growing); } .dot.known { background: var(--known); }

.verse-page, .review { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.verse-page.narrow { max-width: 460px; margin: 0 auto; }
.review { text-align: center; }
.status { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { font: 600 15px var(--sans); background: none; border: 0; border-bottom: 3px solid transparent; color: var(--dim); padding: 9px 12px; cursor: pointer; white-space: nowrap; }
.tab.on { color: var(--ink); border-bottom-color: var(--brand); }
.mode-body { padding: 18px 0 6px; text-align: center; min-height: 180px; }
.verse { font: 23px/1.6 var(--serif); margin: 8px auto; max-width: 30em; text-align: center; }
.verse.lines div { margin: 2px 0; }
.pop { animation: pop .25s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .pop { animation: none; } }
.letters { font: 20px/1.7 ui-monospace, Menlo, monospace; letter-spacing: .05em; margin: 10px auto; max-width: 34em; }
.scene { margin: 22px auto 0; max-width: 560px; text-align: left; }
.scene img { border-radius: 12px; display: block; width: 100%; }
.scene figcaption { font: italic 18px/1.5 var(--serif); margin-top: 10px; }
.scene .eyebrow { font-style: normal; font-family: var(--sans); }
.ask { font-size: 16px; color: var(--dim); }
.typebox { max-width: 600px; margin: 10px auto; }
textarea, input { width: 100%; font: 19px/1.5 var(--serif); padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
input { font: 17px var(--sans); margin-bottom: 10px; }
.typebox .row { justify-content: center; }
.hintline { min-height: 1.6em; color: var(--gold); font-size: 17px; margin-top: 6px; }
.hintline.good { color: var(--ok); font-weight: 700; } .hintline.bad { color: var(--gold); }
.tip { font-size: 12px; color: var(--dim); }
.pct { font: 700 46px/1.2 var(--sans); } .pct.a { color: var(--ok); } .pct.b { color: var(--gold); } .pct.c { color: var(--miss); }
.count { color: var(--dim); font-size: 14px; } .used { color: var(--gold); font-weight: 600; font-size: 14px; margin-top: 4px; }
.ok { color: var(--ok); } .miss { color: var(--miss); font-weight: 700; text-decoration: underline; }
.extra { font-size: 14px; color: var(--dim); margin-top: 8px; }
.retype { margin-top: 14px; }
.folds { text-align: left; margin-top: 18px; }
.fold { border-top: 1px solid var(--line); padding: 10px 0; }
.fold summary { cursor: pointer; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.fold > div { margin-top: 8px; }
.fold img { border-radius: 10px; }
.fold ol { padding-left: 1.3em; margin: 8px 0 0; } .fold li { margin-bottom: 10px; }
.fold li.here { font-weight: 700; }
.fold p { margin: 6px 0; }
.phrase { font: italic 17px var(--serif); color: var(--ok); }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 15px; }
.rates { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 520px; margin: 10px auto 0; }
.rate { font: inherit; padding: 10px 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.rate b { display: block; } .rate span { font-size: 12px; color: var(--dim); }
.rate.suggest { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.rate.r0 b { color: var(--miss); } .rate.r2 b, .rate.r3 b { color: var(--ok); }
img.wide { border-radius: 12px; margin: 10px 0; }
.stops li { margin-bottom: 12px; } .stops details { margin-top: 2px; } .stops summary { cursor: pointer; color: var(--brand); font-size: 15px; }
.auth { margin: 16px 0 10px; } .auth .btn { width: 100%; }
.msg { color: var(--miss); min-height: 1.4em; margin: 8px 0 0; font-size: 15px; }
.foot { max-width: 860px; margin: 0 auto; padding: 0 16px 40px; color: var(--dim); font-size: 12px; line-height: 1.5; }
@media (max-width: 560px) {
  h1 { font-size: 27px; } .verse { font-size: 20px; }
  .brand span:last-child { display: none; }
  .topic { grid-template-columns: 1fr; } .chips { justify-content: flex-start; }
  .verse-page, .review, .hero { padding: 16px; border-radius: 12px; }
}
