/* Septuagint reading trainer — local UI.

   One theme: a high-contrast light "page". The palette is parchment and iron
   ink, with a deep blue for interactive things and a muted gold for ornament.
   Meaning colours (known / learning / not studied) never double as UI colours,
   so a green button can never be mistaken for a green word. */

:root {
  color-scheme: light;

  /* paper and ink */
  --paper:       #f3f0e9;
  --surface:     #ffffff;
  --surface-2:   #f7f4ed;
  --surface-3:   #ece7db;
  --ink:         #17140f;   /* 17:1 on white */
  --ink-soft:    #3c3730;   /* 11:1 */
  --ink-faint:   #675f53;   /*  6:1 — still passes for small text */
  --line:        #ded7c7;
  --line-soft:   #ece7dc;
  --line-strong: #c6bca7;

  /* interactive */
  --accent:      #1b3c62;   /* 10:1 on white */
  --accent-deep: #12293f;
  --accent-lift: #2b5586;
  --accent-tint: #e8eff7;
  --accent-line: #b6c9e0;

  /* ornament */
  --gold:      #85641c;
  --gold-tint: #f7efd9;

  /* word states */
  --known:        #0f6039;
  --known-bg:     #dff0e6;
  --known-line:   #96c8ae;
  --learning:     #86530a;
  --learning-bg:  #faedd4;
  --learning-line:#e2c187;
  --unknown:      #9b2723;
  --unknown-bg:   #fbe6e3;
  --unknown-line: #e5aca7;

  --radius:    12px;
  --radius-sm:  8px;
  --radius-lg: 18px;

  --shadow-1: 0 1px 2px rgba(23, 20, 15, .05), 0 1px 3px rgba(23, 20, 15, .04);
  --shadow-2: 0 2px 4px rgba(23, 20, 15, .05), 0 10px 22px -12px rgba(23, 20, 15, .25);
  --shadow-3: 0 12px 28px -8px rgba(23, 20, 15, .28), 0 2px 6px rgba(23, 20, 15, .10);

  --greek: "GFS Didot", "New Athena Unicode", "Gentium Plus", "Palatino Linotype",
           Palatino, "Book Antiqua", "DejaVu Serif", Georgia, serif;
  --ui: system-ui, -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "DejaVu Sans Mono", monospace;
}

* { box-sizing: border-box; }

/* The `hidden` attribute must beat any author display rule below
   (.overlay sets display:flex, which would otherwise win). */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(70rem 26rem at 50% -14rem, #ffffff 0%, rgba(255, 255, 255, 0) 72%),
    var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { letter-spacing: -0.012em; }

::selection { background: var(--gold-tint); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
:focus:not(:focus-visible) { outline: none; }

* { scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong); border-radius: 999px;
  border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); background-clip: content-box; }

/* ── request indicator ───────────────────────────────── */
#loadbar {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 200;
  opacity: 0; transition: opacity .25s ease; pointer-events: none; overflow: hidden;
}
#loadbar.is-on { opacity: 1; }
#loadbar::after {
  content: ""; display: block; height: 100%; width: 34%;
  background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--gold));
  animation: loadslide 1.1s cubic-bezier(.6, .05, .3, .95) infinite;
}
@keyframes loadslide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(360%); }
}

/* ── sticky chrome ───────────────────────────────────── */
.chrome {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s ease;
}
.chrome.is-stuck { box-shadow: 0 10px 22px -14px rgba(23, 20, 15, .45); }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem 1.5rem; flex-wrap: wrap;
  padding: 0.7rem 1.4rem;
  max-width: 74rem; margin: 0 auto;
}

.brand { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.brand-mark {
  flex: none; width: 2.35rem; height: 2.35rem; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(155deg, var(--accent-lift), var(--accent-deep));
  color: #fff; font-family: var(--greek); font-size: 1.3rem; line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), var(--shadow-1);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-greek { font-family: var(--greek); font-size: 1.32rem; color: var(--ink); }
.brand-sub {
  color: var(--ink-faint); font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.12em;
}

/* tabs as a segmented control */
.tabs {
  display: flex; gap: 0.15rem; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.22rem;
}
.tab {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: none; border: 1px solid transparent; color: var(--ink-soft);
  padding: 0.36rem 0.95rem; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 0.9rem; font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.tab:hover { color: var(--ink); background: rgba(255, 255, 255, .7); }
.tab.is-active {
  background: var(--surface); color: var(--accent);
  border-color: var(--accent-line); font-weight: 650;
  box-shadow: var(--shadow-1);
}
.badge {
  display: inline-block; min-width: 1.5em; padding: 0 0.4em;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 0.7rem; font-weight: 650; line-height: 1.55; text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ── status strip ────────────────────────────────────── */
.statusbar {
  display: flex; gap: 0 1.6rem; flex-wrap: wrap;
  padding: 0.55rem 1.4rem 0.6rem;
  max-width: 74rem; margin: 0 auto;
  border-top: 1px solid var(--line-soft);
}
.stat { display: flex; flex-direction: column; padding: 0.1rem 0; }
.stat + .stat { padding-left: 1.6rem; border-left: 1px solid var(--line-soft); }
.stat-label {
  color: var(--ink-faint); font-size: 0.66rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.09em;
}
.stat-value {
  font-weight: 650; font-size: 1.02rem; color: var(--ink);
  font-variant-numeric: tabular-nums;
}

main { max-width: 66rem; margin: 0 auto; padding: 1.6rem 1.4rem 3rem; }

.view { display: none; }
.view.is-active { display: block; animation: viewin .22s ease both; }
@keyframes viewin { from { opacity: 0; transform: translateY(4px); } }

/* ── controls ────────────────────────────────────────── */
.toolbar {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  margin-bottom: 1rem; padding: 0.6rem 0.75rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
  font-size: 0.9rem; color: var(--ink-soft);
}
.toolbar label { display: inline-flex; align-items: center; gap: 0.4rem; }
.spacer { flex: 1; }

.switch {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.6rem 0.3rem 0.45rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface-2); cursor: pointer; user-select: none;
  font-size: 0.84rem; color: var(--ink-soft);
}
.switch:hover { border-color: var(--line-strong); color: var(--ink); }
.switch input { accent-color: var(--accent); width: 0.95rem; height: 0.95rem; margin: 0; }

.btn {
  font: inherit; font-size: 0.88rem; font-weight: 550; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.48rem 0.95rem; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-1);
  transition: background .15s ease, border-color .15s ease,
              box-shadow .15s ease, transform .08s ease;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-faint); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent-lift), var(--accent));
  border-color: var(--accent-deep); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), var(--shadow-1);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #35639a, #21497a);
  border-color: var(--accent-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), var(--shadow-2);
}
.btn-ghost { background: none; border-color: transparent; box-shadow: none; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.btn-wide { width: 100%; padding: 0.8rem; font-size: 1rem; }
.btn:disabled {
  opacity: 0.45; cursor: not-allowed; transform: none;
  box-shadow: none; background: var(--surface-2);
}

select, input[type="text"], input[type="number"] {
  font: inherit; font-size: 0.88rem; padding: 0.36rem 0.5rem;
  border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
}
select {
  appearance: none; padding-right: 1.7rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23675f53' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.45rem center;
  background-size: 0.7rem;
}
select:hover { border-color: var(--ink-faint); }

.bible-toolbar #bible-book { max-width: 18rem; min-width: 12rem; }
.bible-toolbar #bible-chapter,
.bible-toolbar #bible-verse { min-width: 5rem; }

.passage-nav {
  display: grid; grid-template-columns: auto minmax(10rem, 1fr) auto;
  align-items: center; gap: 0.7rem; margin: 0.9rem 0;
}
.passage-nav-bottom { margin-top: 1.2rem; }
.bible-range {
  color: var(--ink-soft); font-weight: 650; text-align: center;
  font-variant-numeric: tabular-nums;
}

kbd {
  font-family: var(--mono); font-size: 0.68rem; font-weight: 600;
  border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 5px; padding: 0.05em 0.35em; margin-left: 0.45em;
  color: var(--ink-faint); background: var(--surface);
}

/* ── legend ──────────────────────────────────────────── */
.legend {
  display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center;
  font-size: 0.79rem; color: var(--ink-faint);
  margin: 0 0.25rem 0.9rem;
}
.legend span { display: inline-flex; align-items: center; }
.sw {
  display: inline-block; width: 1.15rem; height: 0.85rem;
  border-radius: 4px 4px 2px 2px; margin-right: 0.4rem;
}
.sw-unknown  { background: var(--unknown-bg);  border-bottom: 2px solid var(--unknown); }
.sw-learning { background: var(--learning-bg); border-bottom: 2px solid var(--learning); }
.sw-known    { background: var(--known-bg);    border-bottom: 2px solid var(--known); }
.legend-hint { margin-left: auto; font-style: italic; }

/* ── the text ────────────────────────────────────────── */
.verses { display: flex; flex-direction: column; gap: 0.9rem; }

.verse {
  display: grid; grid-template-columns: 6.5rem 1fr; gap: 0 1.3rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.05rem 1.3rem;
  box-shadow: var(--shadow-1);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.verse-brenton {
  grid-column: 2;
  margin: 0.15rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line-soft);
  font-family: var(--ui); font-size: 0.92rem; line-height: 1.45;
  color: var(--ink-soft); font-style: italic;
}
.verse:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); }

.verse-head {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem;
  align-self: stretch; padding: 0.35rem 1.1rem 0.2rem 0; margin: 0;
  border-right: 1px solid var(--line);
}
.verse-ref {
  display: flex; flex-direction: column; align-items: flex-end;
  line-height: 1.25; text-align: right; margin-bottom: 0;
}
.ref-book {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--ink-faint);
}
.ref-num {
  font-size: 0.95rem; font-weight: 650; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.verse-text {
  font-family: var(--greek); font-size: 1.55rem; line-height: 2.15;
  color: var(--ink);
}

.w {
  display: inline-block; padding: 0 0.16em; border-radius: 5px;
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: background .12s ease, color .12s ease;
}
.w-unknown  { border-bottom-color: var(--unknown); }
.w-learning { border-bottom-color: var(--learning); }
.w-review   { border-bottom-color: var(--known); }
.w-none     { border-bottom-color: transparent; cursor: default; }

/* inline gloss under each word */
.w-wrap {
  display: inline-flex; flex-direction: column; align-items: center;
  vertical-align: top; margin: 0 0.12em; border-radius: 7px;
}
.w-wrap:hover .w { background: var(--accent-tint); }
.w-wrap:hover .w-gloss { color: var(--ink-soft); }
.w-gloss {
  font-family: var(--ui); font-size: 0.6rem; color: var(--ink-faint);
  line-height: 1.15; max-width: 9.5em; text-align: center;
  letter-spacing: 0.005em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color .12s ease;
}

/* ── audio ───────────────────────────────────────────── */
.audio-ctl { display: inline-flex; align-items: center; gap: 0.4rem;
             font-size: 0.9rem; color: var(--ink-soft); }

/* Speaker button that sits beside a verse reference. */
.btn-play {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--accent);
  border-radius: 999px; width: 1.75rem; height: 1.75rem; padding: 0 0 0 0.12em;
  cursor: pointer; font-size: 0.62rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; box-shadow: var(--shadow-1);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn-play:hover { background: var(--accent-tint); border-color: var(--accent-line); }
.btn-play.is-playing {
  background: var(--accent); border-color: var(--accent-deep); color: #fff;
}
.btn-play.is-loading { opacity: 0.5; }

/* Word being spoken lights up as the clip plays. */
.w.is-speaking { background: var(--accent); color: #fff; }

.card-say {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 0.6rem; margin: -0.4rem 0 1.3rem;
}
.btn-say { color: var(--accent); border-color: var(--accent-line); background: var(--accent-tint); }
.btn-say:hover { background: #dde8f4; border-color: var(--accent); }
.btn-say .ico { font-size: 0.62rem; }
.respell {
  font-family: var(--mono); font-size: 0.8rem; color: var(--ink-faint);
}
.respell::before { content: "/"; }
.respell::after  { content: "/"; }
.respell:empty { display: none; }

.modal-say { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }

/* ── panels & chips ──────────────────────────────────── */
.panel {
  margin-top: 1.6rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem; box-shadow: var(--shadow-1);
}
.panel-head { display: flex; align-items: center; justify-content: space-between;
              gap: 1rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.panel h2 { margin: 0; font-size: 1.02rem; font-weight: 650; }
.panel-actions { display: flex; gap: 0.5rem; }
.keep-note { margin: 0; font-size: 0.86rem; max-width: 40rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  display: inline-flex; align-items: baseline; gap: 0.45rem;
  padding: 0.32rem 0.7rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 0.82rem; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.chip:hover {
  border-color: var(--accent-line); background: var(--accent-tint);
  transform: translateY(-1px);
}
.chip-greek { font-family: var(--greek); font-size: 1.08rem; color: var(--ink); }
.chip-gloss { color: var(--ink-soft); }
.chip-freq  { color: var(--ink-faint); font-size: 0.71rem; font-variant-numeric: tabular-nums; }

/* ── flashcard ───────────────────────────────────────── */
.card {
  position: relative; overflow: hidden;
  max-width: 36rem; margin: 1.4rem auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 1.9rem 1.9rem 1.6rem; text-align: center;
  box-shadow: var(--shadow-2);
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-lift) 55%, var(--gold));
}
.card-meta { display: flex; justify-content: space-between; align-items: center;
             gap: 0.6rem; font-size: 0.74rem; margin-bottom: 0.8rem; }
.pill {
  padding: 0.2rem 0.65rem; border-radius: 999px;
  background: var(--accent-tint); border: 1px solid var(--accent-line);
  color: var(--accent); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.07em; font-size: 0.68rem;
}
.muted { color: var(--ink-faint); }

.card-front {
  font-family: var(--greek); font-size: 3.2rem; line-height: 1.2;
  margin: 1.5rem 0 1.3rem; word-break: break-word; letter-spacing: -0.01em;
}
.card-back { margin-bottom: 1.4rem; }
.gloss { font-size: 1.3rem; font-weight: 650; margin-bottom: 0.4rem; }
.gloss-long { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 1.1rem; }
.example {
  background: var(--surface-2); border: 1px solid var(--line-soft);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius); padding: 0.75rem 0.95rem; text-align: left;
}
.example-ref { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em;
               font-weight: 650; color: var(--ink-faint); margin-bottom: 0.35rem; }
.example-text { font-family: var(--greek); font-size: 1.1rem; line-height: 1.85; }
.example-text b { color: var(--accent); font-weight: 700; }

.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.grade {
  flex-direction: column; gap: 0.15rem;
  padding: 0.6rem 0.3rem; font-size: 0.85rem; font-weight: 650;
}
.grade kbd { margin-left: 0; }
.grade-again { border-color: var(--unknown-line);   color: var(--unknown);  background: var(--unknown-bg); }
.grade-hard  { border-color: var(--learning-line);  color: var(--learning); background: var(--learning-bg); }
.grade-good  { border-color: var(--known-line);     color: var(--known);    background: var(--known-bg); }
.grade-easy  { border-color: var(--accent-line);    color: var(--accent);   background: var(--accent-tint); }
.grade-again:hover { background: var(--unknown);  color: #fff; border-color: var(--unknown); }
.grade-hard:hover  { background: var(--learning); color: #fff; border-color: var(--learning); }
.grade-good:hover  { background: var(--known);    color: #fff; border-color: var(--known); }
.grade-easy:hover  { background: var(--accent);   color: #fff; border-color: var(--accent); }
.grade:hover kbd { color: inherit; border-color: currentColor; background: transparent; }

.queue-line {
  margin-top: 1.3rem; padding-top: 0.9rem; border-top: 1px solid var(--line-soft);
  font-size: 0.78rem; color: var(--ink-faint); font-variant-numeric: tabular-nums;
}

.empty {
  max-width: 36rem; margin: 2.2rem auto; text-align: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 2rem 1.6rem;
  box-shadow: var(--shadow-1);
}
.empty::before {
  content: "Ω"; display: grid; place-items: center;
  width: 3rem; height: 3rem; margin: 0 auto 0.9rem;
  border-radius: 50%; background: var(--gold-tint); color: var(--gold);
  font-family: var(--greek); font-size: 1.7rem; line-height: 1;
}
.empty h2 { margin: 0 0 0.5rem; font-size: 1.25rem; }
.empty p { color: var(--ink-soft); margin: 0 auto; max-width: 30rem; }
.core-actions { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1.3rem;
                flex-wrap: wrap; }

/* ── tables ──────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
th, td { text-align: left; padding: 0.55rem 0.9rem; border-bottom: 1px solid var(--line-soft); }
th {
  background: var(--surface-2); color: var(--ink-faint);
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; border-bottom: 1px solid var(--line);
}
tbody tr { transition: background .12s ease; }
tbody tr:nth-child(even) { background: #fbfaf6; }
tbody tr:hover { background: var(--accent-tint); }
tr:last-child td { border-bottom: none; }
td.greek { font-family: var(--greek); font-size: 1.18rem; }
td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-soft); }

/* ── progress view ───────────────────────────────────── */
.cards-grid { display: grid; gap: 0.9rem; margin-bottom: 1.5rem;
              grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.metric {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow-1);
}
.metric-value {
  font-size: 2.1rem; font-weight: 680; line-height: 1.05;
  letter-spacing: -0.025em; font-variant-numeric: tabular-nums;
}
.metric-label { color: var(--ink-faint); font-size: 0.78rem; margin-top: 0.25rem; }

.bar { height: 0.5rem; background: var(--surface-3); border-radius: 999px;
       overflow: hidden; margin-top: 0.7rem; }
.bar span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-lift));
  transition: width .7s cubic-bezier(.2, .7, .3, 1);
}

.spark { display: flex; align-items: flex-end; gap: 3px; height: 4.5rem;
         margin-top: 0.9rem; justify-content: flex-start; }
/* max-width keeps a single day's bar from stretching across the whole panel */
.spark i {
  flex: 1 1 auto; max-width: 2.5rem; min-height: 3px;
  background: linear-gradient(180deg, var(--accent-lift), var(--accent));
  border-radius: 3px 3px 1px 1px; transition: background .15s ease;
}
.spark i:hover { background: var(--gold); }

/* ── modal ───────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; background: rgba(23, 20, 15, .5);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  z-index: 50; animation: fadein .18s ease both;
}
@keyframes fadein { from { opacity: 0; } }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-3);
  max-width: 40rem; width: 100%; max-height: 85vh; overflow-y: auto;
  padding: 1.7rem 1.8rem; position: relative;
  animation: popin .2s cubic-bezier(.2, .8, .3, 1) both;
}
@keyframes popin { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal-close {
  position: absolute; top: 0.7rem; right: 0.8rem;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: none; border: 1px solid transparent; font-size: 1.4rem; line-height: 1;
  color: var(--ink-faint); cursor: pointer;
}
.modal-close:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.modal-greek {
  font-family: var(--greek); font-size: 2.3rem; line-height: 1.2;
  color: var(--accent-deep);
}
.modal-sub { color: var(--ink-soft); font-size: 1.02rem; margin-bottom: 1rem; }
.modal h3 { color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.08em; }
.kv {
  display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1.2rem;
  font-size: 0.88rem; margin: 1.1rem 0;
  padding: 0.9rem 1rem; background: var(--surface-2);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
}
.kv dt { color: var(--ink-faint); font-weight: 600; }
.kv dd { margin: 0; }
.occ { border-top: 1px solid var(--line-soft); padding: 0.7rem 0; }
.occ-ref { font-size: 0.7rem; color: var(--ink-faint); text-transform: uppercase;
           letter-spacing: 0.06em; font-weight: 600; }
.occ-text { font-family: var(--greek); font-size: 1.1rem; line-height: 1.8; }

/* ── footer hints ────────────────────────────────────── */
.pagefoot {
  max-width: 66rem; margin: 0 auto; padding: 0 1.4rem 2.5rem;
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem;
  font-size: 0.76rem; color: var(--ink-faint);
  border-top: 1px solid var(--line); padding-top: 1rem;
}
.pagefoot b { color: var(--ink-soft); font-weight: 600; }

/* ── toast ───────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.6rem; left: 50%;
  transform: translate(-50%, 0.6rem);
  background: var(--ink); color: #f8f6f1;
  padding: 0.6rem 1.2rem; border-radius: 999px;
  font-size: 0.86rem; font-weight: 500; z-index: 100;
  box-shadow: var(--shadow-3);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── narrow screens ──────────────────────────────────── */
@media (max-width: 52rem) {
  .verse { grid-template-columns: 1fr; gap: 0.5rem; }
  .verse-brenton { grid-column: 1; }
  .verse-head {
    flex-direction: row; align-items: center; justify-content: flex-start;
    gap: 0.7rem;
    border-right: none; border-bottom: 1px solid var(--line-soft);
    padding: 0 0 0.5rem; margin: 0;
  }
  .verse-ref { flex-direction: row; align-items: baseline; gap: 0.4rem; }
  .stat + .stat { padding-left: 1.2rem; }
}
@media (max-width: 40rem) {
  body { font-size: 14.5px; }
  .topbar { padding: 0.6rem 1rem; gap: 0.7rem; }
  main { padding: 1.1rem 1rem 2rem; }
  .verse-text { font-size: 1.35rem; line-height: 2; }
  .card { padding: 1.4rem 1.1rem; }
  .card-front { font-size: 2.3rem; }
  .grades { grid-template-columns: repeat(2, 1fr); }
  .pagefoot { padding-left: 1rem; padding-right: 1rem; }

  /* One line each, swiped sideways: wrapping breaks the pill and the
     dividers into rows that read as unrelated groups. */
  .tabs, .statusbar {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar, .statusbar::-webkit-scrollbar { display: none; }
  .tabs { width: 100%; }
  .tab { padding: 0.34rem 0.7rem; font-size: 0.85rem; white-space: nowrap; }
  .statusbar { padding: 0.5rem 1rem; gap: 0 1rem; }
  .bible-toolbar label { flex: 1 1 8rem; }
  .bible-toolbar select,
  .bible-toolbar #bible-book { max-width: none; min-width: 0; width: 100%; }
  .bible-toolbar .spacer { display: none; }
  .passage-nav { grid-template-columns: 1fr 1fr; }
  .bible-range { grid-column: 1 / -1; grid-row: 1; }
  .stat { flex: none; }
  .stat + .stat { padding-left: 1rem; }
  .stat-label, .stat-value { white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ── print: the text alone ───────────────────────────── */
@media print {
  .chrome, .toolbar, .legend, .panel, .pagefoot, .overlay, .passage-nav, .toast, #loadbar { display: none !important; }
  body { background: #fff; }
  .verse { break-inside: avoid; box-shadow: none; border-color: #ccc; }
  .w { border-bottom-color: transparent !important; }
}
