/* ---------------------------------------------------------------------------
   Todah

   Built for comfortable reading first: white page, high contrast, large type,
   generous spacing, and controls big enough to hit without aiming. Every
   interactive target is at least 44x44px. No framework.

   The look is first light: a white page with a faint dawn sky behind the top
   of it, hairline rules, soft corners. The sky is decoration only. It sits on
   a fixed layer behind the page, so the page colour itself stays white and
   the text keeps its full contrast.
   --------------------------------------------------------------------------- */

:root {
  /* light: plain white page, near-black ink */
  --paper: #ffffff;
  --paper-2: #f7f8fc;
  --paper-3: #eceef6;
  --ink: #161a26;        /* 17.3:1 on white */
  --ink-2: #353b4c;      /* 11.0:1 on white */
  --muted: #5b6275;      /*  6.2:1 on white */
  --rule: #dcdfe9;
  --rule-strong: #9aa1b4;
  --accent: #2c4a80;     /*  8.9:1 on white */
  --accent-soft: #46669f;
  --gold: #7a5c12;       /*  6.3:1 on white */
  --focus: #0b5fa5;

  /* the dawn sky behind the page, and the glass of the bars over it */
  --sky-1: #e6eefb;
  --sky-2: #fdefe2;
  --sky-3: #f6f0fb;
  --glass: rgba(255, 255, 255, .78);
  --veil: rgba(22, 26, 38, .32);

  /* one hue per card theme; --wash-* turn a hue into a tint for this mode */
  --h-gratitude: 40;  --h-peace: 195;       --h-fear: 255;      --h-provision: 145;
  --h-hope: 22;       --h-strength: 355;    --h-identity: 218;  --h-guidance: 228;
  --h-love: 332;      --h-perseverance: 56; --h-purpose: 172;
  --wash-s: 78%;
  --wash-l: 95%;
  --wash-edge: 62%;      /* lightness of the rule beside a reflection */
  --plate-r: 0;          /* paintings: bare on white, mounted on dark */
  --plate-dim: none;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    Georgia, "Noto Serif", "Source Serif Pro", serif;
  --sans: ui-sans-serif, -apple-system, "Segoe UI", Inter, Roboto,
    "Helvetica Neue", Arial, sans-serif;

  --measure: 36rem;
  --bar-h: 4.25rem;
  --tap: 2.75rem;                    /* 44px minimum target */
  --r: .625rem;
  --r-lg: 1rem;
  --r-xl: 1.5rem;
  --shadow: 0 1px 2px rgba(22, 26, 38, .05), 0 18px 44px -22px rgba(44, 74, 128, .28);
  --lift: 0 1px 1px rgba(22, 26, 38, .04), 0 30px 70px -36px rgba(44, 74, 128, .34);
}

/* dark: true dark, not washed grey, with contrast held above AA */
:root[data-theme="dark"] {
  --paper: #0f1113;
  --paper-2: #171a1f;
  --paper-3: #22262d;
  --ink: #f2f4f6;        /* 16.9:1 on --paper */
  --ink-2: #d2d7dc;      /* 12.1:1 */
  --muted: #a0a8b0;      /*  7.2:1 */
  --rule: #2f343c;
  --rule-strong: #5d666e;
  --accent: #a9c4f5;     /* 10.6:1 */
  --accent-soft: #c6d8f9;
  --gold: #e0b964;       /* 10.7:1 */
  --focus: #7cc0ff;
  --sky-1: #141b29;
  --sky-2: #1c1714;
  --sky-3: #18151f;
  --glass: rgba(15, 17, 19, .8);
  --veil: rgba(0, 0, 0, .6);
  --wash-s: 32%;
  --wash-l: 15%;
  --wash-edge: 46%;
  --plate-r: var(--r-lg);
  --plate-dim: brightness(.9);
  --shadow: 0 1px 2px rgba(0, 0, 0, .6), 0 12px 32px -16px rgba(0, 0, 0, .9);
  --lift: 0 1px 2px rgba(0, 0, 0, .6), 0 24px 60px -30px rgba(0, 0, 0, .9);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1113;
    --paper-2: #171a1f;
    --paper-3: #22262d;
    --ink: #f2f4f6;
    --ink-2: #d2d7dc;
    --muted: #a0a8b0;
    --rule: #2f343c;
    --rule-strong: #5d666e;
    --accent: #a9c4f5;
    --accent-soft: #c6d8f9;
    --gold: #e0b964;
    --focus: #7cc0ff;
    --sky-1: #141b29;
    --sky-2: #1c1714;
    --sky-3: #18151f;
    --glass: rgba(15, 17, 19, .8);
    --veil: rgba(0, 0, 0, .6);
    --wash-s: 32%;
    --wash-l: 15%;
    --wash-edge: 46%;
    --plate-r: var(--r-lg);
    --plate-dim: brightness(.9);
    --shadow: 0 1px 2px rgba(0, 0, 0, .6), 0 12px 32px -16px rgba(0, 0, 0, .9);
    --lift: 0 1px 2px rgba(0, 0, 0, .6), 0 24px 60px -30px rgba(0, 0, 0, .9);
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

/* --scale is driven by the A- / A+ control and persisted per reader.
   Starting from 100% keeps the browser's own font-size setting intact. */
html {
  font-size: calc(100% * var(--scale, 1));
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.06rem + .4vw, 1.4rem);
  line-height: 1.78;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: ""; position: fixed; inset: 0 0 auto 0; height: 34rem; z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 22rem at 12% -6rem, var(--sky-1), transparent 70%),
    radial-gradient(48rem 20rem at 88% -4rem, var(--sky-2), transparent 70%),
    radial-gradient(40rem 16rem at 52% -8rem, var(--sky-3), transparent 72%);
  opacity: .55;
}
body.home::before { height: 46rem; opacity: 1; }

a { color: inherit; text-decoration-color: var(--rule-strong); text-underline-offset: .2em; }
a:hover { text-decoration-color: var(--accent); color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

h1, h2, h3 {
  font-weight: 500; line-height: 1.16; letter-spacing: -.015em; margin: 0;
  text-wrap: balance;
}

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute; left: .5rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--paper); font-family: var(--sans);
  padding: .8rem 1.1rem; border-radius: 4px; text-decoration: none;
  font-size: 1rem; font-weight: 600;
}
.skip:focus { top: .5rem; color: var(--paper); }

/* --- top bar ------------------------------------------------------------ */

.bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: .5rem;
  min-height: var(--bar-h);
  padding: .4rem clamp(.6rem, 2vw, 1.5rem);
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--rule);
}
.bar > * { min-width: 0; }

.wordmark {
  font-family: var(--serif); font-size: 1.4rem; font-weight: 500;
  letter-spacing: .01em; text-decoration: none; white-space: nowrap;
  display: flex; align-items: center; flex: 0 1 auto;
  overflow: hidden; text-overflow: ellipsis;
  min-height: var(--tap); padding: 0 .3rem;
}
.wordmark:hover { color: var(--accent); }

.bar-spacer { flex: 1; }

/* every control is a real target: 44px tall, readable label */
.btn {
  appearance: none; border: 1px solid var(--rule); background: var(--paper);
  color: var(--ink); font: inherit; font-size: .95rem; font-family: var(--sans);
  font-weight: 500;
  min-height: var(--tap); padding: .4rem 1rem; border-radius: 999px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem; white-space: nowrap; text-decoration: none;
  transition: border-color .18s, background .18s, color .18s, box-shadow .18s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--shadow); }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.btn[aria-pressed="true"], .btn.on {
  background: var(--ink); border-color: var(--ink); color: var(--paper);
}
.btn[aria-pressed="true"]:hover, .btn.on:hover {
  background: var(--accent); border-color: var(--accent); color: var(--paper);
}
.btn-quiet { border-color: transparent; }
.btn-quiet:hover { border-color: var(--rule); }

select.btn { padding-right: .6rem; }

.sizer { display: inline-flex; gap: 0; }
.sizer .btn {
  min-width: var(--tap); padding: .4rem .55rem;
  font-family: var(--serif); font-weight: 600;
}
.sizer .btn:first-child { border-radius: 999px 0 0 999px; border-right-width: 0; }
.sizer .btn:last-child { border-radius: 0 999px 999px 0; border-left-width: 1px; }
.sizer .btn:nth-child(1) { font-size: .9rem; }
.sizer .btn:nth-child(2) { font-size: 1.2rem; }

.ref-picker {
  font-family: var(--serif); font-size: 1.1rem; font-weight: 600;
  border: 1px solid var(--rule); background: var(--paper); color: var(--ink);
  cursor: pointer; padding: .4rem 1rem; border-radius: 999px;
  display: inline-flex; align-items: center; gap: .45rem;
  min-height: var(--tap);
}
.ref-picker:hover { border-color: var(--accent); color: var(--accent); }
.ref-picker svg { opacity: .75; flex: none; }

/* --- page shell -------------------------------------------------------- */

.shell { display: flex; align-items: flex-start; }

main {
  flex: 1 1 auto; min-width: 0;
  padding: clamp(1.75rem, 4vw, 3.5rem) clamp(1.1rem, 4vw, 2.5rem) 7rem;
}
.col { max-width: var(--measure); margin: 0 auto; }
.col-wide { max-width: 64rem; margin: 0 auto; }

.eyebrow {
  font-family: var(--sans); font-size: .85rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 .9rem;
}

/* --- chapter ----------------------------------------------------------- */

.chapter-head { margin-bottom: 2.4rem; }
.chapter-head h1 {
  font-size: clamp(2.1rem, 1.6rem + 2.4vw, 3.2rem);
  margin: 0 0 .6rem;
}
.chapter-head .meta {
  font-family: var(--sans); font-size: .95rem; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; align-items: center;
  line-height: 1.5;
}

.chapter-head .src-note {
  font-family: var(--sans); font-size: .95rem; color: var(--muted);
  margin: .6rem 0 0; line-height: 1.5;
}

.verses { margin: 0; }

/* paragraph flow, like a printed Bible */
.verses.flow p { margin: 0 0 1.3em; }
.verses.flow .v { display: inline; }
.verses.flow .v + .v::before { content: " "; }

/* one verse per line, easiest to track with the eye */
.verses.lines .v {
  display: block; padding: .5rem 0 .5rem 3rem;
  text-indent: -3rem; margin-bottom: .2em;
  border-bottom: 1px solid transparent;
}
.verses.lines .v:hover { border-bottom-color: var(--rule); }

.v { scroll-margin-top: calc(var(--bar-h) + 2rem); }

/* verse numbers are buttons, so they get a real target and real contrast */
.vn {
  font-family: var(--sans); font-size: .72em; font-weight: 700;
  color: var(--accent); vertical-align: .34em;
  margin-right: .32em; cursor: pointer; letter-spacing: .01em;
  border: 0; background: none; padding: .35em .3em; border-radius: 4px;
  font-variant-numeric: tabular-nums; line-height: 1;
  position: relative;
}
.vn::before {                     /* invisible 44px hit area */
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 2.75rem; height: 2.75rem; transform: translate(-50%, -50%);
}
.vn:hover { background: var(--paper-3); }
.verses.lines .vn { vertical-align: baseline; font-size: .8em; }

.v[data-xc]:not([data-xc="0"]) .vn::after {
  content: ""; display: inline-block;
  width: .32em; height: .32em; border-radius: 50%;
  background: var(--gold); margin-left: .22em; vertical-align: .28em;
}

.v.sel { background: color-mix(in srgb, var(--gold) 22%, transparent); border-radius: 4px; }
.v.sel .vn { background: var(--accent); color: var(--paper); }
.v.mark { background: color-mix(in srgb, var(--gold) 32%, transparent); border-radius: 4px; }

/* --- chapter nav: the big obvious buttons ------------------------------ */

.chapter-nav {
  /* minmax(0,...) so a long book name cannot blow the track past the container */
  display: grid; gap: .8rem; grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--rule);
}
.chapter-nav a, .chapter-nav span {
  display: flex; align-items: center; gap: .7rem; min-width: 0;
  min-height: 4.25rem; padding: .9rem 1.1rem;
  border: 1px solid var(--rule); border-radius: var(--r-lg);
  text-decoration: none; font-family: var(--sans);
  background: var(--paper);
  transition: border-color .18s, box-shadow .18s;
}
.chapter-nav a:hover {
  border-color: var(--accent); box-shadow: var(--shadow); color: var(--ink);
}
.chapter-nav span { border-style: dashed; opacity: .4; }
.chapter-nav .nx { flex-direction: row-reverse; text-align: right; }
.chapter-nav .arrow {
  font-size: 1.5rem; line-height: 1; color: var(--accent); flex: none;
  font-family: var(--sans); width: 1.2em; text-align: center;
}
.chapter-nav .dir {
  display: block; font-size: .85rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: .15rem;
}
.chapter-nav .ref {
  font-size: 1.1rem; font-weight: 600; color: var(--ink);
  display: block; overflow-wrap: anywhere;
}

/* fixed bottom nav on phones, thumb-reachable */
.quicknav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: none; gap: .5rem; padding: .5rem .6rem calc(.5rem + env(safe-area-inset-bottom));
  background: var(--glass); border-top: 1px solid var(--rule);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}
.quicknav a, .quicknav button {
  flex: 1; min-height: 3.25rem; border: 1px solid var(--rule); border-radius: 999px;
  background: var(--paper); color: var(--ink); font-family: var(--sans);
  font-size: 1rem; font-weight: 600; display: flex; align-items: center;
  justify-content: center; gap: .4rem; text-decoration: none; cursor: pointer;
}
.quicknav a:hover, .quicknav button:hover { border-color: var(--accent); color: var(--accent); }
.quicknav .off { opacity: .35; pointer-events: none; }

/* --- explore panel ----------------------------------------------------- */

.explore {
  flex: 0 0 25rem; width: 25rem;
  position: sticky; top: var(--bar-h);
  max-height: calc(100vh - var(--bar-h));
  overflow: hidden auto; overscroll-behavior: contain;
  border-left: 1px solid var(--rule);
  background: var(--paper-2);
  font-family: var(--sans); font-size: 1rem; line-height: 1.6;
}
.explore-inner { padding: 1.4rem 1.4rem 4rem; }

.tabs {
  display: flex; flex-wrap: wrap; gap: .3rem;
  border-bottom: 1px solid var(--rule); margin: 0 0 1.3rem;
}
.tab {
  appearance: none; border: 0; background: none; cursor: pointer;
  font: inherit; font-family: var(--sans); font-size: .95rem; font-weight: 500;
  color: var(--ink-2); padding: .6rem .7rem; border-bottom: 2px solid transparent;
  margin-bottom: -1px; min-height: var(--tap);
}
.tab:hover { color: var(--accent); }
.tab[aria-selected="true"] {
  color: var(--accent); border-bottom-color: var(--accent); font-weight: 700;
}
.tab .n { font-variant-numeric: tabular-nums; opacity: .75; margin-left: .25em; }

.panel h3 {
  font-family: var(--sans); font-size: .88rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  margin: 1.8rem 0 .7rem;
}
.panel h3:first-child { margin-top: 0; }
.panel .empty { color: var(--muted); }

.scope {
  display: flex; align-items: center; justify-content: space-between;
  gap: .6rem; flex-wrap: wrap;
  margin-bottom: 1.1rem; padding-bottom: .8rem;
  border-bottom: 1px dashed var(--rule);
}
.scope strong { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; }
.scope .hint { color: var(--muted); font-size: .9rem; }

.rank-note { color: var(--muted); font-size: .9rem; margin: 0 0 1rem; }
.xgroup { margin-bottom: 1.5rem; }
.xgroup > .vlabel {
  font-weight: 700; font-size: .98rem; color: var(--accent);
  margin-bottom: .5rem; cursor: pointer; min-height: var(--tap);
  background: none; border: 0; padding: .3rem .1rem; font-family: var(--sans);
  display: flex; align-items: center; gap: .4rem;
}
.xgroup > .vlabel:hover { text-decoration: underline; }
.xrefs { display: flex; flex-wrap: wrap; gap: .45rem; }
.xref {
  font-size: .95rem; color: var(--ink); text-decoration: none;
  border: 1px solid var(--rule); border-radius: var(--r);
  padding: .4rem .6rem; min-height: var(--tap);
  display: inline-flex; align-items: center; background: var(--paper);
}
.xref:hover { color: var(--accent); border-color: var(--accent); }

.preview {
  margin-top: .8rem; padding: .9rem 1rem;
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r);
  font-family: var(--serif); font-size: 1.05rem; line-height: 1.6;
}
.preview .cite {
  display: block; font-family: var(--sans); font-size: .85rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--accent);
  margin-bottom: .35rem;
}

.rows { list-style: none; margin: 0; padding: 0; }
.rows li { border-bottom: 1px solid var(--rule); padding-bottom: .4rem; }
.rows li:last-child { border-bottom: 0; }
.row {
  display: flex; align-items: baseline; gap: .7rem; width: 100%;
  padding: .7rem .2rem .4rem; background: none; border: 0; font: inherit;
  text-align: left; cursor: pointer; color: inherit; text-decoration: none;
  min-height: var(--tap);
}
.row:hover .nm { color: var(--accent); text-decoration: underline; }
.row .nm { font-family: var(--serif); font-size: 1.12rem; flex: 1 1 auto; }
.row .sub { color: var(--muted); font-size: .88rem; }
.row .ct { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; }

.vchips { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 0 .5rem .2rem; }
.vchip {
  font-size: .9rem; color: var(--ink-2); text-decoration: none;
  font-variant-numeric: tabular-nums; padding: .3rem .45rem;
  border: 1px solid var(--rule); border-radius: var(--r); min-height: 2rem;
  display: inline-flex; align-items: center;
}
.vchip:hover { color: var(--accent); border-color: var(--accent); }

/* --- map --------------------------------------------------------------- */

.map {
  width: 100%; display: block; background: var(--paper);
  border: 1px solid var(--rule); border-radius: var(--r);
}
.map .land { fill: var(--paper-3); stroke: var(--rule-strong); stroke-width: .6; }
.map .water { fill: none; stroke: var(--focus); stroke-opacity: .5; stroke-width: .9; }
.map .pin { fill: var(--accent); stroke: var(--paper); stroke-width: 1.4; cursor: pointer; }
.map .pin:hover, .map .pin.on { fill: var(--gold); }
.map .plabel {
  font-family: var(--sans); font-size: 9px; font-weight: 600; fill: var(--ink);
  paint-order: stroke; stroke: var(--paper); stroke-width: 3px;
  pointer-events: none;
}

/* --- graph ------------------------------------------------------------- */

.graph { width: 100%; display: block; }
.graph .link { stroke: var(--rule-strong); stroke-width: 1.2; }
.graph .node { fill: var(--accent); cursor: pointer; }
.graph .node:hover { fill: var(--gold); }
.graph .nlabel {
  font-family: var(--sans); font-size: 10px; font-weight: 600; fill: var(--ink);
  paint-order: stroke; stroke: var(--paper-2); stroke-width: 3px;
  pointer-events: none;
}

/* --- timeline ---------------------------------------------------------- */

.tl { list-style: none; margin: 0; padding: 0 0 0 1.4rem; border-left: 3px solid var(--rule); }
.tl li { position: relative; padding: 0 0 1.5rem; }
.tl li::before {
  content: ""; position: absolute; left: -1.82rem; top: .5rem;
  width: .6rem; height: .6rem; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--paper);
}
.tl .yr {
  font-family: var(--sans); font-size: .88rem; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
}
.tl .ti { font-family: var(--serif); font-size: 1.15rem; margin-bottom: .3rem; }

/* --- modal ------------------------------------------------------------- */

dialog.modal {
  border: 1px solid var(--rule); border-radius: var(--r-xl); padding: 0;
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow);
  width: min(50rem, calc(100vw - 1.5rem)); max-height: min(85vh, 50rem);
}
dialog.modal::backdrop {
  background: var(--veil);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.modal-head {
  display: flex; align-items: center; gap: .7rem;
  padding: .8rem 1rem; border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; background: var(--paper); z-index: 2;
}
.modal-body { padding: 1.3rem 1rem 2rem; overflow: auto; }
.field {
  flex: 1; font: inherit; font-family: var(--sans); font-size: 1.1rem;
  border: 0; background: transparent; color: var(--ink); padding: .5rem .2rem;
  min-height: var(--tap);
}
.field::placeholder { color: var(--muted); }

.bookgrid {
  display: grid; gap: .4rem .8rem;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
}
.bookgrid a {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  padding: .6rem .7rem; border-radius: var(--r); text-decoration: none;
  font-size: 1.08rem; min-height: var(--tap); border: 1px solid transparent;
}
.bookgrid a:hover { background: var(--paper-3); border-color: var(--accent); color: var(--accent); }
.bookgrid a .c { font-family: var(--sans); font-size: .85rem; color: var(--muted); }

.chapgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.25rem, 1fr)); gap: .45rem; }
.chapgrid a {
  display: grid; place-items: center; min-height: 3.25rem;
  border: 1px solid var(--rule); border-radius: var(--r); text-decoration: none;
  font-family: var(--sans); font-size: 1.05rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.chapgrid a:hover { border-color: var(--accent); color: var(--accent); }
.chapgrid a[aria-current] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.hits { list-style: none; margin: 0; padding: 0; }
.hits li { padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.hits .cite {
  font-family: var(--sans); font-size: .95rem; font-weight: 700;
  letter-spacing: .04em; color: var(--accent); text-decoration: none;
  display: inline-flex; align-items: center; min-height: 2.25rem;
}
.hits .cite:hover { text-decoration: underline; }
.hits p { margin: .2rem 0 0; font-size: 1.15rem; line-height: 1.65; }
.hits mark {
  background: color-mix(in srgb, var(--gold) 38%, transparent);
  color: var(--ink); padding: 0 .1em; border-radius: 2px;
}

/* --- home: today's card ------------------------------------------------ */

.strap {
  max-width: 46rem; margin: 0 auto 1.1rem; font-family: var(--sans); font-size: .95rem;
  color: var(--muted); letter-spacing: .02em;
}
.strap strong {
  font-family: var(--serif); font-weight: 500; font-size: 1.15rem; color: var(--ink);
  margin-right: .5rem; letter-spacing: .01em;
}

.today {
  --h: var(--h-peace);
  margin: 0 auto clamp(2.5rem, 6vw, 4rem); max-width: 46rem;
  padding: clamp(1.6rem, 5vw, 3.2rem);
  border: 1px solid var(--rule); border-radius: var(--r-xl);
  background:
    linear-gradient(165deg, hsl(var(--h) var(--wash-s) var(--wash-l)), transparent 62%),
    var(--paper);
  box-shadow: var(--lift);
  transition: opacity .35s ease;
}
.today[data-pending] { opacity: 0; }
.today[data-mood="gratitude"] { --h: var(--h-gratitude); }
.today[data-mood="peace"] { --h: var(--h-peace); }
.today[data-mood="fear"] { --h: var(--h-fear); }
.today[data-mood="provision"] { --h: var(--h-provision); }
.today[data-mood="hope"] { --h: var(--h-hope); }
.today[data-mood="strength"] { --h: var(--h-strength); }
.today[data-mood="identity"] { --h: var(--h-identity); }
.today[data-mood="guidance"] { --h: var(--h-guidance); }
.today[data-mood="love"] { --h: var(--h-love); }
.today[data-mood="perseverance"] { --h: var(--h-perseverance); }
.today[data-mood="purpose"] { --h: var(--h-purpose); }

.today .eyebrow { display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
.today .eyebrow .mood { color: var(--accent); }
.hero h1 {
  font-size: clamp(1.75rem, 1.35rem + 2vw, 2.7rem);
  line-height: 1.28; letter-spacing: -.012em; margin: 0 0 1.1rem;
  text-wrap: pretty;
}
.today-ref {
  font-family: var(--sans); font-size: 1rem; color: var(--muted);
  margin: 0 0 1.6rem; display: flex; flex-wrap: wrap; gap: .1rem .9rem; align-items: center;
}
.today-ref a {
  font-weight: 700; color: var(--accent); text-decoration: none;
  min-height: var(--tap); display: inline-flex; align-items: center;
}
.today-ref a:hover { text-decoration: underline; }
.today-note {
  font-size: clamp(1.15rem, 1.08rem + .35vw, 1.35rem); color: var(--ink-2);
  margin: 0 0 2rem; max-width: 34rem; line-height: 1.68;
  padding-left: 1.1rem; border-left: 2px solid hsl(var(--h) 45% var(--wash-edge));
}
.hero .cta, .begin .cta { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }
.cta-main {
  font-family: var(--sans); font-size: 1.05rem; font-weight: 600;
  background: var(--ink); color: var(--paper); text-decoration: none;
  padding: .8rem 1.6rem; border-radius: 999px; border: 1px solid var(--ink);
  min-height: 3.25rem; display: inline-flex; align-items: center;
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.cta-main:hover {
  background: var(--accent); border-color: var(--accent); color: var(--paper);
  box-shadow: var(--shadow);
}
.today-nav {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--rule);
  font-family: var(--sans); font-size: .95rem; color: var(--muted);
}
.today-nav .count { text-align: center; line-height: 1.4; min-width: 0; }

.home-h { font-size: clamp(1.5rem, 1.3rem + 1vw, 2rem); margin: 0 0 .5rem; }
.home-lede { color: var(--ink-2); max-width: 34rem; margin: 0 0 1.4rem; line-height: 1.6; }
.begin, .saved { max-width: 46rem; margin: 0 auto; }
.saved { margin-top: 3rem; font-family: var(--sans); }

.canon { display: grid; gap: clamp(2rem, 4vw, 3.5rem); grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.canon section h2 {
  font-size: 1rem; font-family: var(--sans); font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  padding-bottom: .6rem; border-bottom: 1px solid var(--rule); margin-bottom: .8rem;
}
.canon ul { list-style: none; margin: 0 0 1.6rem; padding: 0; columns: 2; column-gap: 1.6rem; }
.canon li { break-inside: avoid; }
.canon a {
  display: flex; align-items: center; padding: .45rem .4rem;
  text-decoration: none; font-size: 1.08rem; min-height: var(--tap);
  border-radius: var(--r);
}
.canon a:hover { color: var(--accent); background: var(--paper-2); }
.canon .div {
  font-family: var(--sans); font-size: .85rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin: 1.2rem 0 .3rem;
  column-span: all;
}

.cards { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin: 3rem 0; }
.card {
  display: block; text-decoration: none; padding: 1.3rem 1.4rem 1.5rem;
  border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--paper);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.card:hover {
  border-color: var(--accent); box-shadow: var(--shadow); color: var(--ink);
  transform: translateY(-2px);
}
.card h3 { font-size: 1.3rem; margin-bottom: .4rem; }
.card p { margin: 0; font-size: 1rem; color: var(--ink-2); font-family: var(--sans); line-height: 1.55; }

/* --- illustrations ------------------------------------------------------
   The paintings fade to white paper at their edges, so on the white page they
   need no frame at all. On a dark page that white would be a glaring
   rectangle, so there they sit in a rounded mount and are dimmed a little. */

.plate { margin: 0 0 2.2rem; }
.plate img, .plate-tile img {
  display: block; width: 100%; height: auto; border-radius: var(--plate-r);
  filter: var(--plate-dim);
}
.plate figcaption {
  font-family: var(--sans); font-size: .9rem; color: var(--muted);
  text-align: center; margin-top: .4rem;
}

.illustrated { margin: clamp(3rem, 7vw, 5rem) 0 0; }
.illustrated > p:last-child { margin: 1.6rem 0 0; }
.plates {
  display: grid; gap: 1.6rem 1.4rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
}
.plate-tile {
  display: block; text-decoration: none; border-radius: var(--r-lg);
  transition: transform .18s;
}
.plate-tile:hover { transform: translateY(-3px); color: var(--ink); }
.plate-tile .t {
  display: block; font-size: 1.2rem; line-height: 1.3; margin-top: .5rem;
}
.plate-tile .r {
  display: block; font-family: var(--sans); font-size: .9rem; color: var(--muted);
}
.plate-tile:hover .t { color: var(--accent); }

/* --- index pages ------------------------------------------------------- */

.toolbar {
  display: flex; flex-wrap: wrap; gap: .7rem; align-items: center;
  margin: 0 0 1.6rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--rule);
}
.toolbar .field { border: 1px solid var(--rule); border-radius: var(--r); padding: .5rem .7rem; }
.entity-list { list-style: none; margin: 0; padding: 0; columns: 3; column-gap: 2.2rem; }
.entity-list li { break-inside: avoid; }
.entity-list a {
  display: flex; align-items: center; gap: .5rem; padding: .4rem .4rem;
  text-decoration: none; font-size: 1.08rem; min-height: var(--tap);
  border-radius: var(--r);
}
.entity-list a:hover { color: var(--accent); background: var(--paper-2); }
.entity-list .ct { font-family: var(--sans); font-size: .85rem; color: var(--muted); }
@media (max-width: 56rem) { .entity-list { columns: 2; } }
@media (max-width: 36rem) { .entity-list { columns: 1; } }

.dict { font-size: 1.12rem; line-height: 1.75; color: var(--ink-2); }
.dict p { margin: 0 0 1.1em; }
.dict ul { padding-left: 1.3rem; }
.dict li { margin-bottom: .6em; }

.section-h {
  font-family: var(--sans); font-size: .95rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  margin: 2.6rem 0 .8rem;
}

.kin { display: flex; flex-wrap: wrap; gap: 2rem; margin: 1.8rem 0; font-family: var(--sans); }
.kin h3 {
  font-size: .88rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: .4rem;
}
.kin ul { list-style: none; margin: 0; padding: 0; }
.kin a {
  text-decoration: none; font-family: var(--serif); font-size: 1.1rem;
  display: flex; align-items: center; min-height: 2.5rem;
}
.kin a:hover { color: var(--accent); text-decoration: underline; }

.reflist { display: flex; flex-wrap: wrap; gap: .5rem; font-family: var(--sans); }
.reflist a {
  text-decoration: none; color: var(--ink); font-size: .98rem;
  border: 1px solid var(--rule); border-radius: var(--r); padding: .4rem .65rem;
  min-height: var(--tap); display: inline-flex; align-items: center;
  background: var(--paper);
}
.reflist a:hover { color: var(--accent); border-color: var(--accent); }

/* --- footer ------------------------------------------------------------ */

.foot {
  border-top: 1px solid var(--rule); margin-top: 5rem;
  padding: 2rem clamp(1.1rem, 4vw, 2.5rem) 4rem;
  font-family: var(--sans); font-size: 1rem; color: var(--ink-2);
}
.foot .col-wide { display: flex; flex-wrap: wrap; gap: .6rem 2rem; align-items: center; }
.foot a {
  color: var(--ink-2); min-height: var(--tap);
  display: inline-flex; align-items: center;
}
.foot a:hover { color: var(--accent); }

/* --- toast ------------------------------------------------------------- */

.toast {
  position: fixed; left: 50%; bottom: 1.6rem; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); font-family: var(--sans);
  font-size: 1rem; padding: .8rem 1.3rem; border-radius: 999px;
  box-shadow: var(--shadow); z-index: 90; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; max-width: calc(100vw - 2rem);
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(-.2rem); }

/* --- responsive -------------------------------------------------------- */

@media (max-width: 68rem) {
  .explore {
    position: fixed; inset: auto 0 0 0; width: 100%; flex: none;
    max-height: 72vh; border-left: 0; border-top: 1px solid var(--rule-strong);
    box-shadow: var(--shadow); z-index: 50;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
  }
  .explore-inner { padding-top: .8rem; }
  .explore::before {
    content: ""; display: block; width: 3rem; height: .3rem;
    background: var(--rule-strong); border-radius: 3px; margin: .6rem auto .2rem;
  }
  .quicknav { display: flex; }
  main { padding-bottom: 6rem; }
  body { padding-bottom: 4.5rem; }
}

@media (max-width: 48rem) {
  .bar {
    flex-wrap: wrap; row-gap: .4rem; gap: .4rem;
    padding: .5rem .7rem; min-height: 0;
  }
  .bar-spacer { display: none; }
  .wordmark { flex: 1 0 auto; font-size: 1.1rem; }
  .ref-picker { font-size: 1rem; }
  #theme { margin-left: auto; }
  #layout { display: none; }
  .chapter-nav { grid-template-columns: minmax(0, 1fr); }
  .verses.lines .v { padding-left: 2.4rem; text-indent: -2.4rem; }
}

@media print {
  .bar, .explore, .chapter-nav, .quicknav, .foot, .toast, .skip, body::before { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; padding: 0; }
  main { padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

@media (prefers-contrast: more) {
  :root { --rule: var(--rule-strong); --muted: var(--ink-2); }
}
