/* Daily Bread Studies — reader styles (based on John's Oct 11 sample layout) */

/* SBL Hebrew & SBL Greek (Tiro Typeworks / SBL), self-hosted unmodified for this
   non-commercial site; see assets/fonts/LICENSE-SBL-fonts.txt */
@font-face {
  font-family: 'SBL Hebrew';
  src: url('fonts/SBL_Hbrw.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'SBL Greek';
  src: url('fonts/SBL_grk.ttf') format('truetype');
  font-display: swap;
}

/* ── Dark mode: follows the device unless the reader picks Light or Dark ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="sepia"]) {
  --paper: #17130f;
    --ink: #e8e0d5;
    --ink-soft: #c8bdb0;
    --muted: #9b9083;
    --accent: #c2a385;
    --accent-deep: #dfc8b0;
    --accent-soft: #ab8d72;
    --accent-faint: #94806e;
    --accent-line: #5f4f42;
    --line-strong: #54463a;
    --tint: #25201b;
    --rule: #2f2720;
    --pop: #2f2720;
    --pop-ink: #efe6da;
  --pop-edge: #4a3e34;
  --faint-text: #7a6f65;
    --surface: #211b16;
    --surface-glass: rgba(33, 27, 22, 0.92);
    --on-accent: #1a140f;
  --done: #9fbad0;
  --done-bg: #1e2a34;
  --done-line: #3b5266;
    --verse: #d6cdc1;
    --heading: #efe7dc;
    --track: #4a4037;
    --shadow: rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #17130f;
  --ink: #e8e0d5;
  --ink-soft: #c8bdb0;
  --muted: #9b9083;
  --accent: #c2a385;
  --accent-deep: #dfc8b0;
  --accent-soft: #ab8d72;
  --accent-faint: #94806e;
  --accent-line: #5f4f42;
  --line-strong: #54463a;
  --tint: #25201b;
  --rule: #2f2720;
  --pop: #2f2720;
  --pop-ink: #efe6da;
  --pop-edge: #4a3e34;
  --faint-text: #7a6f65;
  --surface: #211b16;
  --surface-glass: rgba(33, 27, 22, 0.92);
  --on-accent: #1a140f;
  --done: #9fbad0;
  --done-bg: #1e2a34;
  --done-line: #3b5266;
  --verse: #d6cdc1;
  --heading: #efe7dc;
  --track: #4a4037;
  --shadow: rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

:root[data-theme="sepia"] {
  --paper: #f5ecd7;
  --ink: #3b2f22;
  --ink-soft: #5a4a38;
  --muted: #7d6b57;
  --accent: #7a5634;
  --accent-deep: #4f3720;
  --accent-soft: #93724f;
  --accent-faint: #a98d6d;
  --accent-line: #d9c7a6;
  --line-strong: #d2bf9d;
  --tint: #ede1c6;
  --rule: #e3d5b8;
  --pop: #3f3022;
  --pop-ink: #f7efdf;
  --pop-edge: #5a4633;
  --faint-text: #9a8670;
  --surface: #f8f0dd;
  --surface-glass: rgba(248, 240, 221, 0.94);
  --on-accent: #fbf5e8;
  --done: #4f6f86;
  --done-bg: #e3e6dc;
  --done-line: #b9c6c9;
  --verse: #3b2f22;
  --heading: #2e2419;
  --track: #d6c6a8;
  --shadow: rgba(80, 58, 30, 0.16);
  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 112.5%; }   /* 18px base: every size scales up together */

:root {
  --paper: #ffffff;
  --ink: #1e1e1e;
  --ink-soft: #4a4a4a;
  --muted: #6b6b6b;
  /* Earth-brown accent */
  --accent: #7a5c43;        /* labels, links, active controls */
  --accent-deep: #4e3a2a;   /* hover / pressed */
  --accent-soft: #977a62;   /* verse numbers, note markers */
  --accent-faint: #b19b86;  /* division labels */
  --accent-line: #ddd1c4;   /* light brown lines, Hebrew labels */
  --line-strong: #d5c8ba;   /* button borders */
  --tint: #f6f2ec;          /* hover backgrounds */
  --rule: #ece6df;
  --pop: #372c23;           /* footnote popup */
  --pop-ink: #f5f0eb;
  --pop-edge: transparent;
  --faint-text: #a39a91;
  --surface: #ffffff;       /* menu, buttons */
  --surface-glass: rgba(255, 255, 255, 0.92);
  --on-accent: #ffffff;
  --done: #4f7491;
  --done-bg: #eaf1f7;
  --done-line: #bcd0e0;     /* text on brown buttons */
  --verse: #222222;         /* verse numbers */
  --heading: #1f1f1f;
  --track: #d9d2ca;         /* switch (off) */
  --shadow: rgba(55, 44, 35, 0.14);
  color-scheme: light;
  --topbar-h: 72px;
  --serif: 'Source Serif 4', 'Merriweather', Georgia, serif;
  --display: 'Merriweather', Georgia, serif;
  --sans: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --hebrew: 'SBL Hebrew', 'Noto Serif Hebrew', 'Times New Roman', serif;
  --greek: 'SBL Greek', 'Times New Roman', serif;
}

body {
  background: var(--paper);
  transition: background-color 0.2s, color 0.2s;
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.75;
  padding: calc(var(--topbar-h) + 2.5rem) 1rem 5rem;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.reader {
  max-width: 32rem;   /* ≈ 66 characters per line of scripture text */
  width: 100%;
  padding: 1.5rem 0 3.75rem;
  position: relative;
}

h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: 0.005em; }

.he { font-family: var(--hebrew); direction: rtl; unicode-bidi: embed; font-style: normal; }

/* ── Page header ── */
.page-title {
  font-size: 1.9rem; font-weight: 300; text-align: center;
  margin-bottom: 0.5rem; color: var(--heading); letter-spacing: -0.015em;
}
.page-date {
  text-align: center; font-family: var(--display); font-size: 1.9rem; font-weight: 300; line-height: 1.25;
  color: var(--heading); letter-spacing: -0.015em; margin-bottom: 0.45rem;
}
.page-parsha.page-weekday { margin-bottom: 0.3rem; font: 600 0.76rem/1.6 var(--sans); text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--accent); }
.page-date .nw { white-space: nowrap; }
.page-date.is-holy { font-weight: 700; letter-spacing: -0.01em; color: var(--accent); }
.page-weekday.is-holy, .page-weekday.is-holy .day-event { font-weight: 700; color: var(--accent); }
.day-event { background: none; border: none; padding: 0; font: inherit; text-transform: inherit; letter-spacing: inherit; color: var(--accent); cursor: pointer;
  text-decoration: underline dotted; text-decoration-color: var(--accent-soft); text-underline-offset: 3px; }
.day-event:hover { color: var(--accent-deep); }
.day-event:disabled { cursor: default; text-decoration: none; color: var(--accent); opacity: 1; }
.ev-text { font-family: var(--serif); }
.page-parsha {
  text-align: center; font-family: var(--display); font-size: 0.92rem;
  color: var(--muted); margin-bottom: 0.6rem;
}
.day-plan { list-style: none; margin: 2.1rem 0 2.3rem; padding: 0 0 1.4rem; border-bottom: 1px solid var(--rule);
  display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; row-gap: 0.32rem; }
/* rows share one grid, so every reference starts at the same place (one em after the longest section name) */
.dp-item, .dp-row { display: contents; }
.dp-row { text-decoration: none; color: inherit; }
.dp-row:hover .dp-ref { color: var(--accent-deep); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
.dp-row:focus-visible .dp-ref { outline: 2px solid var(--accent-soft); outline-offset: 2px; border-radius: 3px; }
.dp-label { margin-left: 12px; margin-right: 1.6em; cursor: pointer; }
.dp-ref { cursor: pointer; }
.dp-label { font: 600 0.72rem/1.2 var(--sans); letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.dp-ref { font-family: var(--serif); font-size: 1.1rem; line-height: 1.35; color: var(--ink); }
.dp-check { flex: none; align-self: center; width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 1.5px solid var(--line-strong); background: none;
  display: inline-flex; align-items: center; justify-content: center; color: transparent; cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s; }
.dp-check:hover { border-color: var(--done); color: var(--done-line); }
.dp-check:focus-visible { outline: 2px solid var(--done-line); outline-offset: 2px; }
.dp-item.is-read .dp-check { background: var(--done); border-color: var(--done); color: var(--paper); }
.dp-item.is-read .dp-ref { color: var(--muted); }
.dp-item.is-current .dp-ref { color: var(--heading); font-weight: 600; }
.dp-item.is-current .dp-check { border-color: var(--accent-soft); }
.dp-item.is-read.is-current .dp-check { border-color: var(--done); }
@media (max-width: 700px) {
  .dp-label { letter-spacing: 0.1em; font-size: 0.68rem; }
  .dp-ref { font-size: 1rem; }
}
.page-refs {
  text-align: center; font-size: 0.9rem; font-style: italic; color: var(--muted);
  margin-bottom: 2.25rem; padding-bottom: 1.75rem; border-bottom: 1px solid var(--rule);
}
.page-refs a { color: inherit; text-decoration: none; white-space: nowrap; }
.page-refs a:hover { color: var(--accent-deep); text-decoration: underline; text-decoration-color: var(--accent-line); }

/* ── Reading progress ── */
.page-progress { text-align: center; font: 400 0.74rem/1.6 var(--sans); letter-spacing: 0.02em; color: var(--accent-faint);
  margin: -0.25rem 0 0.6rem; }
.page-progress:empty { display: none; }
.page-progress .catch-up { display: block; color: var(--muted); }
.link-btn { background: none; border: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 2px; }
.link-btn:hover { color: var(--accent-deep); }
.done-row { margin: 0; padding: 0; text-align: center; }
.nav-center { position: relative; display: flex; justify-content: center; }
.nav-center .nav-indicator { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 7px;
  font-size: 0.64rem; color: var(--accent-faint); white-space: nowrap; }
/* Same shape, type and height as Previous / Next */
.done-btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font: 500 0.8rem/1.2 var(--sans); letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
  color: var(--accent); background: transparent; border: 1px solid var(--line-strong);
  padding: 0.65rem 1.25rem; border-radius: 4px; cursor: pointer; transition: all 0.2s;
}
.done-btn svg { width: 14px; height: 14px; opacity: 0.4; margin-left: -0.15rem; }
.done-btn:hover { background: var(--tint); border-color: var(--accent-soft); color: var(--accent-deep); }
.done-btn[aria-pressed="true"] { background: var(--done-bg); border-color: var(--done-line); color: var(--done); }
.done-btn[aria-pressed="true"] svg { opacity: 1; }
.done-btn[aria-pressed="true"]:hover { border-color: var(--done); }
.done-btn:focus-visible { outline: 2px solid var(--done-line); outline-offset: 2px; }
.done-next { margin: 1.6rem 0 0; font: 400 0.8rem/1.6 var(--sans); color: var(--muted); }
.done-next:empty { display: none; }
.journal-line { margin: 1.4rem auto 0; max-width: 30rem; font: 400 0.74rem/1.7 var(--sans); color: var(--faint-text); }
.journal-line a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 2px; }
.journal-line a:hover { color: var(--accent); }

/* Readings already marked, ticked in the header */

.link-btn.quiet { color: inherit; text-decoration-color: var(--rule); }
.link-btn.quiet:hover, .link-btn.quiet[aria-expanded="true"] { color: var(--accent); }

/* Progress review (opens from "… readings read") */
.progress-review { margin: -1rem 0 2.25rem; padding: 18px 20px 20px; border: 1px solid var(--rule); border-radius: 10px;
  font-family: var(--sans); font-size: 0.82rem; line-height: 1.5; color: var(--ink-soft); }
.progress-review[hidden] { display: none; }
.pr-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
  font-weight: 600; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.pr-sections { display: grid; gap: 9px; margin-bottom: 4px; }
.pr-sec { display: grid; grid-template-columns: 8.5em 4.5em 1fr; align-items: center; gap: 10px; }
.pr-sec-name { color: var(--ink); }
.pr-sec-num { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.pr-bar { height: 4px; border-radius: 2px; background: var(--rule); overflow: hidden; }
.pr-bar span { display: block; height: 100%; background: var(--accent-soft); border-radius: 2px; }
.pr-sub { margin: 18px 0 8px; font-weight: 600; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-faint); }
.pr-missed, .pr-days { list-style: none; margin: 0; padding: 0; }
.pr-missed li { display: grid; grid-template-columns: 7em 1fr auto; align-items: baseline; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--rule); }
.pr-missed .link-btn { text-align: left; justify-self: start; }
.pr-missed li:last-child { border-bottom: none; }
.pr-m-label { color: var(--muted); }
.pr-m-date { color: var(--muted); white-space: nowrap; }
.pr-skip { margin: 8px 0 0; color: var(--muted); font-size: 0.78rem; }
.pr-empty { margin: 0; color: var(--muted); }
.pr-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 14px; max-height: 260px; overflow-y: auto; }
.pr-day { text-decoration: none; display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 4px 6px; border: none; border-radius: 6px;
  background: none; font: inherit; color: var(--ink-soft); cursor: pointer; text-align: left; }
.pr-day:hover { background: var(--tint); }
.pr-dots { display: inline-flex; gap: 4px; }
.pr-dot { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--line-strong); }
.pr-dot.on { background: var(--accent); border-color: var(--accent); }
.pr-dot.miss { border-color: var(--accent-faint); border-style: dashed; }

/* ── Calendar intro ── */
.calendar-intro { margin: 0 0 2.5rem; font-size: 1rem; line-height: 1.8; color: var(--ink-soft); }
.calendar-intro p { margin-bottom: 1rem; }
.calendar-intro p:last-child { margin-bottom: 0; }
.lead {
  font-family: var(--sans); font-weight: 700; font-size: 1.02rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin-right: 0.2em;
}
.history-link {
  color: var(--ink-soft); text-decoration: underline; text-decoration-color: var(--accent-line);
  text-underline-offset: 2px; text-decoration-thickness: 1px; white-space: nowrap;
}
.history-link:hover { color: var(--accent-deep); text-decoration-color: var(--accent-deep); }

/* ── Blessings ── */
.blessings-section { margin: 0 0 2.75rem; }
.blessings-title {
  text-align: center; font-family: var(--display); font-size: 1.02rem; font-style: italic;
  color: var(--muted); letter-spacing: 0.02em; margin-bottom: 1.5rem;
}
.blessing { margin-bottom: 1.55rem; font-size: 1rem; line-height: 1.75; color: var(--ink-soft); }
.blessing .hebrew-blessing {
  display: block; font-family: var(--hebrew); font-size: 1.38rem; line-height: 2;
  direction: rtl; text-align: right; margin: 0.65rem 0 0.55rem;
}
.blessing .lead-he { font-size: 1.7rem; color: var(--accent); margin-left: 0.15em; }
.blessing .scripture-quote { font-style: italic; color: var(--ink-soft); }
.pray-intro { margin: 0 0 0.5rem; font-size: 1rem; line-height: 1.8; color: var(--ink-soft); text-align: left; }
.apparatus.bless-apparatus { border-top: none; padding-top: 0; margin-top: 1.4rem; padding-bottom: 1.15rem; border-bottom: 1px solid var(--rule); margin-bottom: 2.6rem; }
.bless-apparatus > summary.apparatus-title { margin-bottom: 0; }
.bless-apparatus[open] > summary.apparatus-title { margin-bottom: 1.3rem; }
.bless-apparatus .blessings-title, .bless-apparatus .blessings-divider { display: none; }
.bless-apparatus .blessings-section { margin-bottom: 0; }
.info-btn { display: inline-flex; vertical-align: -2px; padding: 2px; margin-left: 2px; border: none; background: none;
  color: var(--accent-soft); cursor: pointer; border-radius: 50%; }
.info-btn:hover, .info-btn[aria-expanded="true"] { color: var(--accent); }
.info-btn:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 1px; }
.fn-pop .info-text { display: block; font: 400 0.86rem/1.6 var(--sans); color: var(--pop-ink); }
html.orig-off .blessing .hebrew-blessing { display: none; }
.blessing-jewish { margin-left: 1.6rem; padding-left: 1rem; border-left: 2px solid var(--rule); }
.blessing-who { margin: 0 0 0.4rem; font: 600 0.72rem/1.4 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-soft); }
.blessing-who .info-btn { vertical-align: -3px; }
.blessings-divider { border: none; border-top: 1px solid var(--rule); margin: 2.5rem auto; max-width: 180px; }

/* ── Portion heading ── */
.division-label {
  text-align: center; font-family: var(--sans); font-size: 0.86rem; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); margin-bottom: 1.1rem;
}
.division-label .he {
  font-size: 1.25rem; font-weight: 400; letter-spacing: 0; color: var(--accent-soft);
  margin-left: 0.4em; text-transform: none;
}
.chapter-head { font-size: 1.5rem; text-align: center; margin-bottom: 0.3rem; color: var(--heading); }
.chapter-sub {
  text-align: center; font-size: 1.02rem; font-style: italic; color: var(--muted);
  margin-bottom: 2rem; font-weight: 300;
}
.chapter-head + .scripture { margin-top: 1.7rem; }

/* ── Scripture (BSB) ── */
.scripture { font-size: 1.1rem; line-height: 1.85; color: var(--ink); }
.scripture p { margin-bottom: 1.05rem; }
.scripture .m { text-indent: 0; }
.scripture .pmo, .scripture .pi1 { padding-left: 1.4em; }
.scripture .pc { text-align: center; }

/* Poetry: hanging lines, second level indented */
.scripture .q1, .scripture .q2, .scripture .qr, .scripture .li1, .scripture .li2 {
  margin: 0; padding-left: 2.2em; text-indent: -1.4em;
}
.scripture .q2 { padding-left: 3.6em; }
.scripture .li2 { padding-left: 3.6em; }
.scripture .qr { text-align: right; font-style: italic; padding-left: 0; text-indent: 0; }
.scripture .poetry-end { margin-bottom: 1.05rem; }
.scripture .stanza { height: 0.8rem; }
.scripture .qa {
  font-family: var(--sans); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent-faint); margin: 1.2rem 0 0.3rem;
}
.scripture .d { margin-bottom: 0.5rem; }   /* psalm superscription: same type as the verses */

/* BSB section headings within the reading */
.scripture .s1 {
  font-family: var(--display); font-size: 1.02rem; font-weight: 700; color: var(--pop);
  margin: 1.8rem 0 0.15rem; line-height: 1.4; letter-spacing: 0.005em;
}
.scripture .s2 {
  font-family: var(--display); font-size: 0.95rem; font-style: italic; color: var(--accent-deep);
  margin: 1.4rem 0 0.4rem;
}
.scripture .r {
  font-size: 0.86rem; font-style: italic; color: var(--accent); margin-bottom: 0.6rem;
}
.scripture .ms {
  text-align: center; font-family: var(--sans); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin: 1.6rem 0 0.2rem;
}
.scripture .mr { text-align: center; font-style: italic; font-size: 0.86rem; color: var(--accent); margin-bottom: 1rem; }
.scripture > :first-child { margin-top: 0; }

.verse-num {
  font-size: 0.7em; vertical-align: super; line-height: 0; color: var(--verse);
  font-weight: 500; margin-right: 0.3em; font-family: var(--sans); text-indent: 0;
}
.chapter-num {
  font-family: var(--display); font-size: 1.6em; line-height: 1; color: var(--verse);
  margin-right: 0.25em; vertical-align: -0.12em;
}
.lord { text-transform: uppercase; }   /* the divine name: full capitals (LORD, ADONAI, HASHEM) */
.xt { font-style: normal; }

/* ── BSB footnote markers & popover ── */
.fn-ref {
  font: 500 0.66em/1 var(--sans); vertical-align: baseline; position: relative; top: -0.6em;
  color: var(--accent-soft);
  background: none; border: none; cursor: pointer; padding: 0 0.12em; margin: 0 0.05em;
  border-radius: 2px; text-indent: 0; font-style: italic;
}
.fn-ref:hover, .fn-ref[aria-expanded="true"] { color: var(--accent-deep); background: var(--tint); }
.fn-ref:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; }

.fn-pop {
  position: absolute; z-index: 100; width: min(300px, calc(100% - 2rem));
  background: var(--pop); color: var(--pop-ink); border-radius: 6px; border: 1px solid var(--pop-edge); padding: 0.75rem 0.95rem;
  font: 400 0.86rem/1.55 var(--serif); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}
.fn-pop[hidden] { display: none; }
.fn-pop .fn-pop-ref {
  display: block; font: 600 0.68rem/1.4 var(--sans); letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent-faint); margin-bottom: 0.25rem;
}
.fn-pop .fn-pop-label {
  font: italic 600 0.72em/0 var(--sans); color: var(--accent-faint); margin-right: 0.35em; vertical-align: super;
}
.fn-pop i { color: var(--pop-ink); }
.fn-pop::after {
  content: ''; position: absolute; left: var(--arrow-x, 50%); margin-left: -6px;
  border: 6px solid transparent;
}
.fn-pop.below::after { bottom: 100%; border-bottom-color: var(--pop); }
.fn-pop.above::after { top: 100%; border-top-color: var(--pop); }

/* ── Footnote apparatus ── */
.apparatus { margin-top: 2.25rem; padding-top: 1.15rem; border-top: 1px solid var(--rule); }
.apparatus-title {
  font: 600 0.76rem/1.4 var(--sans); text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); margin-bottom: 0.85rem;
}
.footnote-list p {
  font-size: 0.88rem; line-height: 1.6; color: var(--ink-soft); margin-bottom: 0.5rem;
  padding-left: 1.6rem; text-indent: -1.6rem; scroll-margin-top: 1.5rem; border-radius: 4px;
  transition: background 0.6s;
}
.footnote-list p.flash { background: var(--tint); }
.footnote-list .fn-label {
  display: inline-block; width: 1.6rem; text-indent: 0; font: italic 600 0.85em var(--sans);
  color: var(--accent-soft); text-decoration: none;
}
.footnote-list .fn-label:hover { color: var(--accent-deep); }
.footnote-list .fn-verse { font-weight: 600; color: var(--accent); margin-right: 0.35em; font-family: var(--sans); font-size: 0.85em; }
.footnote-list .empty { font-style: italic; color: var(--muted); }

/* ── Portions & navigation ── */
.portion { display: none; }
.portion.active { display: block; animation: fadeIn 0.3s ease-in; }
@media (prefers-reduced-motion: reduce) { .portion.active { animation: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.nav-bar {
  margin-top: 3.25rem; padding-top: 1.7rem; border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center; gap: 0.9rem;
}
.nav-btn {
  font: 500 0.8rem/1.2 var(--sans); letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--accent); background: transparent; border: 1px solid var(--line-strong);
  padding: 0.65rem 1.25rem; border-radius: 4px; cursor: pointer; transition: all 0.2s;
}
.nav-btn:hover:not(:disabled) { background: var(--tint); border-color: var(--accent-soft); color: var(--accent-deep); }
.nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.nav-btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.nav-btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--on-accent); }
.nav-indicator {
  font: 500 0.7rem/1.4 var(--sans); letter-spacing: 0.12em; color: var(--accent-soft);
  text-transform: uppercase; text-align: center;
}
.nav-indicator .division-name { display: block; font-size: 0.66rem; letter-spacing: 0.18em; color: var(--accent-faint); margin-top: 0.15em; font-weight: 400; }

.reader-footer { margin-top: 3.5rem; padding-top: 1.3rem; border-top: 1px solid var(--rule);
  font: 400 0.7rem/1.9 var(--sans); color: var(--faint-text); text-align: left; letter-spacing: 0.015em; }
.reader-footer p { margin: 0 0 0.55rem; }
.status { text-align: center; color: var(--muted); font-style: italic; padding: 3rem 0; }

/* ── Settings button [ A / א ] and panel ── */
html.font-sans { --serif: 'Inter', 'Helvetica Neue', Arial, sans-serif; }
html.font-sans .scripture { line-height: 1.8; }

.tools { position: fixed; top: calc(var(--tb-off, var(--topbar-h)) + 12px); right: 20px; z-index: 200; display: flex; gap: 8px; }
.tool-btn {
  display: inline-flex; align-items: center; gap: 0.3em;
  height: 38px; padding: 0 0.85rem; border-radius: 19px;
  background: var(--surface-glass); border: 1px solid var(--line-strong);
  color: var(--accent); cursor: pointer; font-size: 16px; line-height: 1;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.tool-btn:hover, .tool-btn[aria-expanded="true"] { border-color: var(--accent-soft); background: var(--tint); color: var(--accent-deep); }
.tool-btn:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
.sb-en { font-family: 'Source Serif 4', Georgia, serif; font-size: 17px; }
.sb-sep { color: var(--accent-line); font-family: var(--sans); font-size: 14px; }
.sb-he { font-family: var(--hebrew); font-size: 19px; position: relative; top: 1px; }

.settings-panel {
  position: fixed; top: calc(var(--tb-off, var(--topbar-h)) + 58px); right: 20px; z-index: 199; width: 364px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - var(--tb-off, var(--topbar-h)) - 74px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 12px 36px var(--shadow), 0 2px 6px rgba(59, 39, 22, 0.06);
  padding: 14px 20px 12px; font-family: var(--sans); font-size: 14px; color: var(--ink);
}
.settings-panel[hidden] { display: none; }
.sp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.sp-title { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.sp-close { background: none; border: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 4px; border-radius: 4px; }
.sp-close:hover { color: var(--accent-deep); background: var(--tint); }
.sp-row { display: flex; justify-content: space-between; align-items: center; min-height: 44px; gap: 12px; }
.sp-group { margin: 14px 0 2px; padding-top: 12px; border-top: 1px solid var(--rule);
  font: 600 10.5px/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-faint); }
.sp-head + .sp-group { border-top: none; padding-top: 0; margin-top: 14px; }
.sp-switch.sp-switch-row { min-height: 44px; padding: 0; }
.sp-switch.sp-switch-row + .sp-row, .sp-row + .sp-switch.sp-switch-row { border-top: none; }
.sp-label { color: var(--ink-soft); white-space: nowrap; }
.sp-static { color: var(--muted); font-size: 13px; }
.sp-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.sp-stepper button { width: 40px; height: 34px; background: var(--surface); border: none; cursor: pointer; color: var(--accent); font-family: 'Source Serif 4', Georgia, serif; }
.sp-stepper button:hover:not(:disabled) { background: var(--tint); }
.sp-stepper button:disabled { color: var(--accent-line); cursor: default; }
.sp-a-small { font-size: 13px; }
.sp-a-large { font-size: 19px; }
.sp-value { min-width: 52px; text-align: center; font-size: 12px; color: var(--muted); border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); line-height: 34px; }
.sp-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.sp-seg button { height: 34px; padding: 0 14px; background: var(--surface); border: none; cursor: pointer; color: var(--ink-soft); font-size: 14px; }
.sp-seg button + button { border-left: 1px solid var(--line-strong); }
.sp-seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.sp-seg button:hover:not([aria-pressed="true"]) { background: var(--tint); }
.sp-seg-name button { padding: 0 9px; font-size: 12.5px; }
.sp-seg-theme button { padding: 0 10px; font-size: 13.5px; }
.dn-sample { text-transform: uppercase; letter-spacing: 0.02em; }
.sp-smallcaps { font-variant: small-caps; }
.sp-serif { font-family: 'Source Serif 4', Georgia, serif; }
.sp-sans { font-family: var(--sans); }
.sp-divider { height: 1px; background: var(--rule); margin: 6px 0 2px; }
.sp-switch {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 14px;
  background: none; border: none; text-align: left; cursor: pointer; padding: 10px 0; font: inherit; color: inherit;
}
.sp-switch:not(.sp-switch-row) + .sp-switch:not(.sp-switch-row) { border-top: 1px solid var(--rule); }
.sp-switch-text { display: flex; flex-direction: column; gap: 2px; }
.sp-switch-title { font-size: 14px; color: var(--ink); }
.sp-switch-sub { font-size: 12px; color: var(--muted); }
.sp-track { flex: none; width: 40px; height: 24px; border-radius: 12px; background: var(--track); position: relative; transition: background 0.2s; }
.sp-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform 0.2s; }
.sp-switch[aria-checked="true"] .sp-track { background: var(--accent); }
.sp-switch[aria-checked="true"] .sp-thumb { transform: translateX(16px); }
.sp-switch:focus-visible, .sp-seg button:focus-visible, .sp-stepper button:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }

/* Calendar button & month view */
.cal-btn { width: 38px; padding: 0; justify-content: center; }
.cal-panel { padding: 12px 14px 12px; }
.cal-head { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.cal-title { flex: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.25; }
.cal-month { font-family: var(--display); font-size: 15px; color: var(--ink); }
.cal-hmonth { font-size: 11px; color: var(--accent); letter-spacing: 0.04em; min-height: 14px; }
.cal-nav { width: 34px; height: 34px; border-radius: 8px; border: 1px solid transparent; background: none;
  color: var(--accent); font-size: 22px; line-height: 1; cursor: pointer; }
.cal-nav:hover { background: var(--tint); border-color: var(--line-strong); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-wd { text-align: center; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); padding: 4px 0 6px; }
.cal-wd.cal-sat { color: var(--accent); }
.cal-day { position: relative; aspect-ratio: 1 / 1; min-height: 40px; border-radius: 8px; border: 1px solid transparent;
  background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; color: var(--ink); font-family: var(--sans); padding: 0; }
.cal-day .cal-g { font-size: 14px; line-height: 1; }
.cal-day .cal-h { font-family: var(--hebrew); font-size: 11px; line-height: 1; color: var(--muted); min-height: 11px; direction: rtl; }
.cal-day.cal-sat:not(.is-selected) { background: var(--tint); }
.cal-day:hover:not(:disabled) { border-color: var(--accent-soft); }
.cal-day:disabled { cursor: default; color: var(--muted); opacity: 0.45; }
.cal-day.is-today { border-color: var(--accent); }
.cal-day.is-selected { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.cal-day.is-selected .cal-h { color: var(--on-accent); opacity: 0.85; }
.cal-dot { position: absolute; top: 4px; right: 5px; width: 5px; height: 5px; border-radius: 50%; }
.cal-dot.on { background: var(--accent-soft); }
.cal-day.is-selected .cal-dot.on { background: var(--on-accent); }
.cal-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; }
.cal-today { height: 32px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--accent); cursor: pointer; font: 500 13px var(--sans); }
.cal-today:hover { background: var(--tint); }
.cal-legend { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.cal-legend .cal-dot { position: static; display: inline-block; }
.cal-legend { gap: 10px; }
.cal-legend-item { display: inline-flex; align-items: center; gap: 5px; }
/* Reading progress in the calendar: a small check on days read, a faint ring on days to catch up */
.cal-mark { position: absolute; top: 4px; left: 5px; width: 11px; height: 11px; display: none; }
.cal-day.is-read .cal-mark, .cal-mark.read { display: block; background: currentColor; color: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.4l2.6 2.6L10 3.4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.4l2.6 2.6L10 3.4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.cal-legend .cal-mark.read { position: static; display: inline-block; }
.cal-day.is-missed .cal-mark { display: block; top: 5px; left: 5px; width: 5px; height: 5px; border-radius: 50%; border: 1px solid var(--accent-faint); }
.cal-day.is-partial .cal-mark { display: block; background: currentColor; color: var(--accent-faint); opacity: 0.7;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.4l2.6 2.6L10 3.4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.4l2.6 2.6L10 3.4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.cal-day.is-selected .cal-mark { color: var(--on-accent); }
.cal-day.is-selected.is-missed .cal-mark { border-color: var(--on-accent); }
.cal-nav:focus-visible, .cal-day:focus-visible, .cal-today:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 1px; }

/* Original languages */
.vp { margin-bottom: 1.15rem; }
.vp-en { margin: 0 !important; }
.vp-orig { margin: 0.25rem 0 0 !important; color: var(--ink); }
.vp-orig.he { font-family: var(--hebrew); direction: rtl; text-align: right; font-size: 1.3em; line-height: 1.95; }
.vp-orig.grc { font-family: var(--greek); font-size: 1.18em; line-height: 1.75; }
.vp .vp-orig.grc { padding-left: 1.6rem; }   /* indented from the English for easier eye movement */
.vp .pe, .vp .se { display: none; }
.orig-only .vo-para { margin-bottom: 1.05rem !important; }
.orig-only .vo-line { margin: 0 !important; }
.orig-only .pe { display: none; }
.orig-only .se { display: inline-block; width: 1.5em; color: transparent; }
.orig-only .verse-num { font-size: 0.55em; }
.vp-orig.he .verse-num { margin: 0 0 0 0.3em; }
.kt { font-size: 0.78em; color: var(--muted); }
.kt::before { content: '('; } .kt::after { content: ') '; }
.qr::before { content: '['; color: var(--muted); } .qr::after { content: ']'; color: var(--muted); }
.sp-cant-row[hidden] { display: none; }

/* Greek textual notes */
.tc-apparatus > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 0.4rem; user-select: none; }
.tc-apparatus > summary::-webkit-details-marker { display: none; }
.tc-apparatus > summary::after { content: '▸'; font-size: 0.9em; color: var(--accent-soft); transition: transform 0.2s; }
.tc-apparatus[open] > summary::after { transform: rotate(90deg); }
.tc-apparatus:not([open]) > summary { margin-bottom: 0; }
.ap-count { font-weight: 400; letter-spacing: 0.04em; color: var(--accent-faint); }
.tcm { font-size: 0.62em; color: var(--accent-soft); vertical-align: 0.45em; margin: 0 0.05em; font-family: var(--sans); }
.vp-en .tcm { display: none; }
.tc-note { font-family: var(--greek), var(--serif); font-size: 1.04em; }
.tc-run { font-size: 0.9rem; line-height: 1.75; color: var(--ink-soft); }
.tc-item .fn-verse { font: 600 0.8em var(--sans); color: var(--accent); margin-right: 0.3em; }
.tc-sep { color: var(--accent-faint); margin-right: 0.3em; }
.tc-item { scroll-margin-top: 1.5rem; border-radius: 3px; transition: background 0.6s; }
.tcm-ref { font-family: var(--greek), serif; font-style: normal; font-size: 0.62em; color: var(--accent-soft); top: -0.45em; padding: 0 0.1em; }
.tcm-key { font-family: var(--greek), serif; font-size: 1.3em; color: var(--accent-soft); letter-spacing: 0.12em; }
.tc-key { font: 400 0.72rem/1.7 var(--sans); color: var(--faint-text); margin-top: 0.7rem; }

/* Quick "Go to" field */
.quick-go { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 4px 0 2px; color: var(--accent-faint);
  border-bottom: 1px solid var(--accent-line); margin-right: 6px; transition: border-color 0.2s, color 0.2s; }
.quick-go:focus-within { border-bottom-color: var(--accent-soft); color: var(--accent); }
.quick-go input { width: 118px; border: none; background: transparent; outline: none; color: var(--ink);
  font: 14px var(--sans); padding: 0; }
.quick-go input::placeholder { color: var(--accent-faint); opacity: 0.85; }
.quick-go input:not(:focus)::placeholder { color: transparent; }
.quick-go.qg-miss { border-bottom-color: #b5533c; animation: qgShake 0.35s; }
@keyframes qgShake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* Word study bubbles */
.vp-orig .w, .orig-only .w { cursor: pointer; border-radius: 3px; transition: background 0.15s; }
.vp-orig .w:hover, .orig-only .w:hover { background: var(--tint); }
.w.w-on { background: var(--accent-line); }
.fn-pop.wd-pop { width: min(330px, calc(100% - 2rem)); }
.wd-head { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.15rem; }
.wd-lemma { font-size: 1.45em; line-height: 1.3; color: var(--pop-ink); }
.wd-lemma.he { font-family: var(--hebrew); }
.wd-lemma.grc { font-family: var(--greek); font-size: 1.3em; }
.wd-tr { font-style: italic; color: var(--accent-faint); }
.wd-gloss { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.wd-row { display: block; font-size: 0.92em; line-height: 1.5; }
.wd-k { font: 600 0.68rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-faint); margin-right: 0.35em; }
.wd-tr2 { color: var(--accent-faint); font-style: italic; }
.wd-def { display: block; font-size: 0.85em; line-height: 1.5; opacity: 0.85; margin-top: 0.4rem; max-height: 7.5em; overflow-y: auto; }
.wd-more { display: inline-block; margin-top: 0.45rem; font: 500 0.74rem var(--sans); color: var(--accent-faint); text-decoration: none; }
.wd-more:hover { color: var(--pop-ink); text-decoration: underline; }

/* Bible picker */
.bible-panel { max-height: min(78vh, 640px); overflow-y: auto; overscroll-behavior: contain; }
.bp-go { display: flex; gap: 6px; margin: 4px 0 6px; }
.bp-input { flex: 1; min-width: 0; height: 38px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px;
  font: 15px var(--sans); color: var(--ink); background: var(--surface); }
.bp-input:focus { outline: 2px solid var(--accent-soft); outline-offset: 0; border-color: var(--accent-soft); }
.bp-go-btn { height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent);
  color: var(--on-accent); font: 500 14px var(--sans); cursor: pointer; }
.bp-msg { font-size: 12px; color: var(--muted); margin: 2px 0 4px; }
.bp-group { font: 600 11px/1.4 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 14px 0 6px; }
.bp-group .he { font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--accent-faint); margin-left: 0.3em; }
.bp-books { display: flex; flex-wrap: wrap; gap: 5px; }
.bp-book { padding: 5px 9px; border-radius: 7px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink);
  font: 13px var(--sans); cursor: pointer; }
.bp-book:hover { background: var(--tint); border-color: var(--line-strong); }
.bp-back { background: none; border: none; color: var(--accent); font: 500 14px var(--sans); cursor: pointer; padding: 4px 2px; }
.bp-bookname { flex: 1; text-align: center; font-family: var(--display); font-size: 15px; color: var(--ink); }
.bp-chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 5px; margin-top: 6px; }
.bp-ch { height: 40px; border-radius: 8px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink);
  font: 14px var(--sans); cursor: pointer; }
.bp-ch:hover { background: var(--tint); border-color: var(--line-strong); }
.bp-ch.is-selected { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.bp-book:focus-visible, .bp-ch:focus-visible, .bp-back:focus-visible, .bp-go-btn:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 1px; }

/* Bible reading mode */
.bible-back { text-align: center; margin: 0 0 2rem; padding-bottom: 1.6rem; border-bottom: 1px solid var(--rule); }
.back-today { background: none; border: 1px solid var(--line-strong); border-radius: 18px; padding: 0.35rem 1rem;
  color: var(--accent); font: 500 0.82rem var(--sans); cursor: pointer; }
.back-today:hover { background: var(--tint); }
.chapter-nav { display: flex; align-items: center; justify-content: center; gap: 0.6rem; }
/* The verse a link points to: its number white on black (inverted in Dark mode), shown even when verse numbers are off */
.scripture .verse-num.verse-target, html.no-verses .scripture .verse-num.verse-target { background: var(--heading); color: var(--paper); font-size: 0.7em;
  font-weight: 600; padding: 0.12em 0.42em; margin-right: 0.35em; border-radius: 3px; }

/* Scripture references and their preview */
a.sref { color: inherit; text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 2px; }
a.sref:hover { color: var(--accent-deep); text-decoration-color: var(--accent-soft); }
.fn-pop a.sref { color: var(--pop-ink); text-decoration-color: rgba(255,255,255,0.35); }
.pv-ref { display: block; font: 600 0.68rem/1.4 var(--sans); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-faint); margin-bottom: 0.3rem; }
.fn-pop .pv-text { display: block; font-size: 0.92rem; line-height: 1.6; color: var(--pop-ink); max-height: 40vh; overflow-y: auto; }
.pv-v { font: 500 0.65em/0 var(--sans); color: var(--accent-faint); margin-right: 0.15em; }
.pv-open { display: inline-block; margin-top: 0.5rem; font: 500 0.78rem var(--sans); color: var(--accent-faint); text-decoration: none; }
.pv-open:hover { color: var(--pop-ink); text-decoration: underline; }

/* Day arrows beside the date */
.page-date { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.day-step { width: 30px; height: 30px; border-radius: 50%; border: 1px solid transparent; background: none;
  color: var(--accent); font-size: 1.35rem; line-height: 1; cursor: pointer; padding: 0 0 3px; }
.day-step:hover:not(:disabled) { background: var(--tint); border-color: var(--line-strong); }
.day-step:disabled { visibility: hidden; }
.day-step:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 1px; }

/* Today information (Hebcal) — set in the same style as the day's introduction */
.today-box { margin: 0 0 2rem; font-size: 1rem; line-height: 1.8; color: var(--ink-soft); }
.today-box p { margin-bottom: 0.5rem; }
.today-box p:last-child { margin-bottom: 0; }
.today-title { color: var(--ink); }
.today-he { font-size: 1.05em; color: var(--accent); margin-left: 0.15em; }
.shabbat-line strong { font-weight: 600; color: var(--ink); }
.loc-btn { background: none; border: none; padding: 0; margin-left: 0.4em; color: var(--accent); cursor: pointer;
  font: inherit; text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 2px; }
.loc-btn:hover { color: var(--accent-deep); }
.loc-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 0.5rem; }
.loc-picker[hidden] { display: none; }
.loc-auto, .loc-select { height: 34px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font: 13px var(--sans); padding: 0 10px; cursor: pointer; }
.loc-auto:hover { background: var(--paper); }
.reader-footer a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 2px; }

/* Phones: button bottom-right within thumb reach; panel becomes a bottom sheet */
@media (max-width: 700px) {
  .tools { top: auto; bottom: 18px; right: 16px; gap: 10px; align-items: center; }
  .tool-btn { height: 44px; padding: 0 1rem; border-radius: 22px; box-shadow: 0 4px 14px var(--shadow); }
  .cal-btn { width: 44px; padding: 0; }
  .settings-panel { top: auto; bottom: 0; right: 0; left: 0; width: 100%; max-width: none;
    border-radius: 14px 14px 0 0; padding: 14px 20px calc(16px + env(safe-area-inset-bottom)); max-height: 86vh; }
  .settings-panel:not([hidden]) { animation: sheetUp 0.22s ease-out; }
  body.panel-open .tools { display: none; }   /* sheets have their own close button */
  body { padding-bottom: 5.5rem; }
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .settings-panel:not([hidden]) { animation: none; } }
@media print { .tools, .settings-panel { display: none !important; } }

@media (max-width: 700px) {
  body { padding: calc(var(--topbar-h) + 1.25rem) 16px 5.5rem; }
  .reader { padding: 0.5rem 0 2.5rem; }
  .page-title, .page-date { font-size: 1.5rem; }
  .chapter-head { font-size: 1.25rem; }
  .scripture { font-size: 1.04rem; }
  .lead { font-size: 0.92rem; }
  .blessing .hebrew-blessing { font-size: 1.25rem; }
  .blessing .lead-he { font-size: 1.5rem; }
  .scripture .q1, .scripture .li1 { padding-left: 1.8em; text-indent: -1.2em; }
  .scripture .q2, .scripture .li2 { padding-left: 2.8em; }
  .nav-bar { flex-direction: column; align-items: stretch; }
  .nav-indicator { order: -1; margin-bottom: 0.5rem; }
  .nav-center { order: -1; flex-direction: column; align-items: stretch; margin-bottom: 0.4rem; }
  .nav-center .done-btn { justify-content: center; }
  .nav-center .nav-indicator { position: static; transform: none; order: 0; margin: 0.5rem 0 0; text-align: center; }
}

@media print {
  body { background: #fff; padding: 0; }
  .reader { box-shadow: none; padding: 0; }
  .portion { display: block !important; page-break-before: always; }
  .portion:first-of-type { page-break-before: auto; }
  .nav-bar, .fn-pop { display: none !important; }
}


/* ── Top bar: DAILY BREAD · TODAY PROGRESS ABOUT (scrolls away with the page) ── */
.topbar { position: absolute; top: 0; left: 0; right: 0; height: var(--topbar-h); z-index: 210;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 clamp(16px, 3.2vw, 40px);
  border-bottom: 1px solid var(--rule); background: var(--paper); }
.tb-logo { justify-self: start; display: flex; align-items: center; padding: 4px 0; color: var(--heading); text-decoration: none; }
.tb-logo-img { display: block; height: 15px; width: auto; fill: currentColor; }   /* assets/img/logo-dark.svg, drawn in the theme's heading colour */
.tb-logo:hover { color: var(--accent-deep); }
.tb-nav { display: flex; gap: clamp(18px, 3vw, 36px); }
.tb-nav a { font: 600 13px/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-soft);
  text-decoration: none; padding: 8px 0 6px; border-bottom: 1px solid transparent; transition: color 0.15s, border-color 0.15s; }
.tb-nav a:hover { color: var(--accent-deep); }
.tb-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent-soft); }
.tb-nav a:focus-visible, .tb-logo:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 3px; border-radius: 2px; }
.tb-end { justify-self: end; display: flex; align-items: center; }   /* passage search (desktop); sign-in may join it one day */
.tb-end .quick-go { margin-right: 0; }
/* GIVE: the last item on the bar (desktop); on phones it joins the menu row */
.tb-give, .tb-give-m { font: 600 13px/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
  text-decoration: none; padding: 8px 0 6px; border-bottom: 1px solid transparent; transition: color 0.15s, border-color 0.15s; }
.tb-give { margin-left: clamp(18px, 2.4vw, 32px); }
.topbar .tb-give, .tb-nav .tb-give-m { color: var(--heading); }   /* GIVE in the charcoal of the logo, set apart from the brown menu */
.topbar .tb-give:hover, .tb-nav .tb-give-m:hover { color: var(--accent-deep); }
.tb-give:hover, .tb-give-m:hover { color: var(--accent-deep); }
.tb-give[aria-current="page"], .tb-give-m[aria-current="page"] { border-bottom-color: var(--accent-soft); }
.tb-nav .tb-give-m { display: none; }
.tb-br { display: none; }   /* phones: the menu breaks into two rows here (tools/set_menu.py) */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 700px) {   /* phones: logo centred, the menu centred on the row below */
  :root { --topbar-h: 122px; }
  .topbar { grid-template-columns: 1fr; justify-items: center; align-content: center; row-gap: 12px; }
  .tb-logo, .tb-nav { justify-self: center; }
  .tb-nav { gap: 26px; }
  .tb-nav a { font-size: 12px; letter-spacing: 0.14em; padding: 4px 0 5px; }
  .tb-end { display: none; }
  .tb-nav { gap: 10px 22px; flex-wrap: wrap; justify-content: center; }
  .tb-br { display: block; flex-basis: 100%; height: 0; }
  .tb-nav .tb-give-m { display: inline-block; font-size: 12px; letter-spacing: 0.14em; padding: 4px 0 5px; color: var(--heading); }
}
@media (max-width: 360px) { .tb-nav { column-gap: 16px; } .tb-nav a, .tb-nav .tb-give-m { letter-spacing: 0.1em; } }
@media (min-width: 701px) and (max-width: 1000px) {   /* narrow desktops: a tighter menu */
  .tb-nav { gap: 20px; }
  .tb-nav a { font-size: 12px; letter-spacing: 0.12em; }
}
@media (min-width: 701px) and (max-width: 880px) {   /* tablets: no room for passage search beside the menu */
  .tb-end .quick-go { display: none; }
  .tb-nav { gap: 16px; }
}
@media print { .topbar { display: none; } }

/* ── Progress page ── */
.pg-title { margin-bottom: 0.4rem; }
.pg-year { text-align: center; font: 500 0.76rem var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-faint); margin: 0 0 0.7rem; }
.pg-yearbar { height: 3px; background: var(--rule); border-radius: 2px; overflow: hidden; margin: 0 0 2.4rem; }
.pg-yearbar span { display: block; height: 100%; background: var(--accent-soft); }
.pg-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 2.6rem; text-align: center; }
.pg-stats div { padding: 16px 8px 14px; border: 1px solid var(--rule); border-radius: 10px; }
.pg-stats b { display: block; font-family: var(--display); font-weight: 300; font-size: 2rem; line-height: 1.1; color: var(--heading); }
.pg-stats span { display: block; line-height: 1.4; font: 500 0.68rem/1.4 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.pg-h { font: 600 0.74rem var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 2.4rem 0 1rem; }
.pg-h span { font-weight: 400; letter-spacing: 0.04em; text-transform: none; color: var(--muted); margin-left: 0.4em; }
#progress-page .pr-sections, #progress-page .pr-missed, #progress-page .pr-days, #progress-page .pr-skip { font-family: var(--sans); font-size: 0.86rem; }
#progress-page .pr-days { max-height: none; }
.pg-note { font: 400 0.86rem/1.6 var(--sans); color: var(--muted); margin: 0; }
.pg-privacy { margin-top: 2.8rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); font-size: 0.78rem; }
.pg-clear { margin: 0.6rem 0 0; font: 400 0.78rem var(--sans); }
.pg-empty { text-align: center; color: var(--ink-soft); line-height: 1.7; }
.pg-empty p { margin: 0 0 1rem; }
.pg-btn { display: inline-flex; align-items: center; height: 44px; padding: 0 22px; border-radius: 22px; background: var(--accent);
  color: var(--on-accent); font: 600 0.78rem var(--sans); letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; }
.pg-btn:hover { background: var(--accent-deep); }

/* Justified Bible text (setting): prose paragraphs only; poetry, lists and centred lines keep their shape */
html.justify .scripture p.p, html.justify .scripture p.m, html.justify .scripture p.pmo, html.justify .scripture p.pi1,
html.justify .scripture .vp-en, html.justify .scripture .vo-para {
  text-align: justify; -webkit-hyphens: auto; hyphens: auto;
}
html.justify .scripture .vo-para[lang="he"], html.justify .scripture .vo-para[lang="grc"] { -webkit-hyphens: manual; hyphens: manual; }

/* Show Verse Numbers: off hides the numbers but keeps them in the text, so maps, notes and links still find their verses */
html.no-verses .scripture .verse-num { font-size: 0; margin: 0; }

/* "This day" notes and "Today in History" (data/history.csv) */
.today-box .own-note { color: var(--ink-soft); }
.history-box { margin: -1rem 0 2rem; font-size: 1rem; line-height: 1.8; color: var(--ink-soft); }
.today-box[hidden] + .history-box { margin-top: 0; }
.hist-text { margin: 0 0 0.5rem; }
.hist-text:last-child { margin-bottom: 0; }

/* ── Progress: the whole Bible (circle, sections, books) ──
   Section colours checked for colour-blind separation (Light/Sepia and Dark sets); every colour also has its name beside it. */
:root { --bb0: #a8452e; --bb1: #0f8670; --bb2: #b48a12; --bb3: #5d5fb3; }
:root[data-theme="dark"] { --bb0: #c74b52; --bb1: #169b81; --bb2: #b58f1f; --bb3: #7a7ed8; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="sepia"]) { --bb0: #c74b52; --bb1: #169b81; --bb2: #b58f1f; --bb3: #7a7ed8; }
}
.bb-s0 { --bb: var(--bb0); } .bb-s1 { --bb: var(--bb1); } .bb-s2 { --bb: var(--bb2); } .bb-s3 { --bb: var(--bb3); }
.bb-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: center; }
.bb-ring { width: 100%; max-width: 240px; height: auto; display: block; margin: 0 auto; overflow: visible; }
.bb-track { stroke: color-mix(in srgb, var(--bb) 20%, var(--paper)); }
.bb-read { stroke: var(--bb); }
.bb-hit { stroke: transparent; cursor: pointer; pointer-events: stroke; }
.bb-hit.is-on { stroke: color-mix(in srgb, var(--heading) 9%, transparent); }
.bb-c-pct { font-family: var(--display); font-weight: 300; font-size: 34px; fill: var(--heading); }
.bb-c-lbl { font: 600 9.5px var(--sans); letter-spacing: 0.12em; text-transform: uppercase; fill: var(--accent); }
.bb-c-sub { font: 400 10px var(--sans); fill: var(--muted); }
.bb-secs { display: grid; gap: 14px; font-family: var(--sans); }
.bb-sec { display: grid; grid-template-columns: 12px 1fr auto; column-gap: 10px; row-gap: 5px; align-items: center; }
.bb-key { width: 10px; height: 10px; border-radius: 3px; background: var(--bb); }
.bb-name { color: var(--ink); font-size: 0.92rem; }
.bb-pct { color: var(--heading); font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.bb-bar { grid-column: 2 / 4; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--bb) 20%, var(--paper)); overflow: hidden; }
.bb-bar span { display: block; height: 100%; background: var(--bb); border-radius: 3px; }
.bb-sub { grid-column: 2 / 4; font-size: 0.74rem; color: var(--muted); }
.bb-books { font-family: var(--sans); font-size: 0.84rem; }
.bb-all { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.bb-all > summary { display: flex; align-items: center; gap: 10px; padding: 12px 2px; cursor: pointer; list-style: none;
  font: 600 0.74rem var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.bb-all > summary::-webkit-details-marker { display: none; }
.bb-all > summary::before { content: '›'; font-size: 1.15rem; line-height: 1; transition: transform 0.15s; }
.bb-all[open] > summary::before { transform: rotate(90deg); }
.bb-all > summary:hover { color: var(--accent-deep); }
.bb-all-close, .bb-all[open] .bb-all-open { display: none; }
.bb-all[open] .bb-all-close { display: inline; }
.bb-all-n { margin-left: auto; font-weight: 400; letter-spacing: 0.04em; text-transform: none; color: var(--muted); }
.bb-books { padding: 4px 0 14px; }
.bb-ghead { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; }
.bb-ghead::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--bb); flex: none; }
.bb-ghead .bb-name { flex: 1; }
.bb-ghead .he { color: var(--accent-soft); font-size: 0.95em; margin-left: 0.35em; }
.bb-book { display: grid; grid-template-columns: 8.2em 1fr 3em; gap: 10px; align-items: center; padding: 2px 2px 2px 20px; }
.bb-bname { color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-lane { display: block; }
.bb-bbar { display: block; height: 6px; min-width: 3px; border-radius: 3px; background: color-mix(in srgb, var(--bb) 20%, var(--paper)); overflow: hidden; }
.bb-bbar span { display: block; height: 100%; background: var(--bb); }
.bb-bpct { text-align: right; color: var(--ink-soft); font-variant-numeric: tabular-nums; font-size: 0.8rem; }
.bb-bpct.is-zero { color: var(--muted); opacity: 0.7; }
@media (max-width: 700px) {
  .bb-wrap { grid-template-columns: 1fr; gap: 22px; }
  .bb-ring { max-width: 230px; }
  .bb-book { grid-template-columns: 7.2em 1fr 2.8em; padding-left: 20px; }
}

.pg-blurb { font-family: var(--serif); font-size: 1rem; line-height: 1.7; color: var(--ink-soft); margin: -0.2rem 0 1.4rem; }
/* The Bible on four shelves (Progress page) */
.bs-box { width: min(760px, calc(100vw - 32px)); margin: 0.6rem 0 2.4rem calc(50% - min(380px, 50vw - 16px)); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bs-shelves { display: block; width: 100%; min-width: 600px; height: auto; }
.bs-label { font: 600 17px var(--sans); letter-spacing: 0.2em; fill: var(--accent); }
.bs-he { font: 400 19px var(--hebrew); fill: var(--muted); }
.bs-count, .bs-bundle { font: 400 12px var(--sans); fill: var(--muted); }
.bs-bundle { font-size: 9.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.bs-board { fill: var(--line-strong); }
.bs-bk { cursor: pointer; }
.bs-bk .bs-body { fill: var(--paper); stroke: var(--heading); stroke-width: 1.2; transition: stroke-width 0.15s; }
.bs-bk .bs-fill { fill: var(--c); opacity: 0.32; }
.bs-bk .bs-band { stroke: var(--heading); stroke-width: 1; opacity: 0.55; }
.bs-bk text { font: 600 9.5px var(--sans); letter-spacing: 0.1em; fill: var(--c); }
.bs-bk.done .bs-fill { opacity: 1; }
.bs-bk.done text { fill: var(--paper); }
.bs-bk.done .bs-band { stroke: var(--paper); opacity: 0.8; }
.bs-bk.dim { opacity: 0.35; }
/* lift the whole spine: the CSS transform goes on a wrapper, never on the text (that would replace its rotation) */
.bs-lift { transition: transform 0.18s ease; }
.bs-bk:hover .bs-lift, .bs-bk:focus-visible .bs-lift { transform: translateY(-4px); }
.bs-bk:hover .bs-body, .bs-bk:focus-visible .bs-body { stroke-width: 1.8; }
.bs-bk:focus { outline: none; }
@media (prefers-reduced-motion: reduce) { .bs-lift { transition: none; } .bs-bk:hover .bs-lift, .bs-bk:focus-visible .bs-lift { transform: none; } }

.bb-past { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: 0.86rem; }
.bb-past li { display: grid; grid-template-columns: 4em 1fr auto; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--rule); color: var(--ink-soft); }
.bb-past-y { color: var(--heading); font-variant-numeric: tabular-nums; }
.bb-past-n { color: var(--muted); }
/* Bible reader: mark a chapter read */
.chapter-done { text-align: center; margin: 2.2rem 0 0.4rem; }
.chapter-done .done-btn { margin: 0 auto; }
.chapter-done .done-btn:disabled { cursor: default; }
.chapter-done-note { margin: 0.5rem 0 0; min-height: 1.2em; font: 400 0.8rem var(--sans); color: var(--muted); }
.chapter-done-note a { color: inherit; text-decoration-color: var(--accent-line); text-underline-offset: 2px; }
.part-ref { margin: 1.6rem 0 0.8rem; text-align: center; font: 600 0.74rem var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-soft); }

/* Credits: one paragraph, three lines showing, the rest faded behind "more" (all of it is in the page) */
.reader-footer .credits { position: relative; max-height: calc(3 * 1.9em); overflow: hidden; margin: 0; }
.reader-footer .credits::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1.9em;
  background: linear-gradient(to bottom, transparent, var(--paper)); pointer-events: none; }
.reader-footer.is-open .credits { max-height: none; }
.reader-footer.is-open .credits::after { display: none; }
.credits-more { background: none; border: none; padding: 0; margin-top: 0.3rem; font: inherit; color: var(--accent); cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 2px; }
.credits-more:hover { color: var(--accent-deep); }

/* Hebrew New Testament (Delitzsch) under the Apostles readings */
.orig-only .vo-label { font: 600 0.68rem/1.4 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-faint);
  margin: 1.6rem 0 0.6rem; direction: ltr; text-align: left; }
.orig-only .vo-label:first-child { margin-top: 0; }

.pg-give { margin: 2.8rem 0 0; text-align: center; font: 400 0.9rem/1.7 var(--sans); color: var(--ink-soft); }
.pg-give a { color: var(--accent); font-weight: 600; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
