/* ============================================================
   TT Siddur — one-screen edition ("quiet text, one sheet")
   Torah Tech program palette (same tokens as tt-brand.css,
   copied here so the page is self-contained under /siddur/
   and the service worker can keep it whole offline).
   Layout: the davening text is one scroll that never navigates.
   Everything else lives in ONE sheet: bottom sheet on phones,
   a left side pane from 900px up.
   ============================================================ */

:root {
  --navy: #1C47A5;
  --blue: #5E90E3;
  --ink: #26303f;
  --ink-soft: #4a5565;
  --muted: #636B77;
  --bg: #fff;
  --surface: #f7f9fc;
  --sheet: #fff;
  --line: #e3eaf5;
  --line-strong: #cfdcf0;
  --hl: #e4eefc;
  --hl-ink: #1C47A5;
  --pray-bg: #faf7f0;
  --blue-ink: #2F62C0;   /* --blue is too light for small text on white (3.2:1); this is 5.8:1 */
  --cyan: #00C8DC;
  --ice: #7BE0EC;
  --grad-header: linear-gradient(135deg, #3B69C1, #1C47A5);   /* the site header, started darker so white text passes */
  --grad-hero: linear-gradient(135deg, #091836 0%, #123071 45%, #1C47A5 100%);
  --grad-deep: linear-gradient(135deg, #0C2350 0%, #1C47A5 100%);
  --shadow-card: 0 6px 24px rgba(28,71,165,.10);
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-hebrew: 'Frank Ruhl Libre', 'Times New Roman', serif;
  --he-size: clamp(2rem, 8.6vw, 2.9rem);
  --pane: 400px;
}
:root[data-theme="dark"] {
  --navy: #9cc0f5;
  --blue: #7BB3F0;
  --ink: #e8eefa;
  --ink-soft: #c3cde0;
  --muted: #94a1b8;
  --bg: #0b1322;
  --surface: #121d33;
  --sheet: #141f38;
  --line: #22304f;
  --line-strong: #31436b;
  --hl: #1d3564;
  --hl-ink: #cfe1ff;
  --pray-bg: #080d18;
  --blue-ink: #7BB3F0;
  --grad-header: linear-gradient(135deg, #1C47A5, #0C2350);
  --grad-deep: linear-gradient(135deg, #0C2350 0%, #1a3f92 100%);
  --shadow-card: 0 6px 24px rgba(0,0,0,.35);
}
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-size="s"] { --he-size: clamp(1.7rem, 7vw, 2.4rem); }
:root[data-size="l"] { --he-size: clamp(2.4rem, 10.2vw, 3.5rem); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); -webkit-font-smoothing: antialiased;
  transition: background .3s;
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ── Top bar: the site header gradient ───────────────────── */
.on-bar {
  --bar-ink: #fff; --bar-btn: rgba(255,255,255,.14); --bar-btn-h: rgba(255,255,255,.26); --bar-line: rgba(255,255,255,.38);
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 6px;
  padding: 10px max(clamp(12px, 4vw, 22px), env(safe-area-inset-right)) 10px max(clamp(12px, 4vw, 22px), env(safe-area-inset-left));
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--grad-header); color: var(--bar-ink);
  box-shadow: 0 4px 18px rgba(12, 35, 80, .18);
}
.on-brand { display: flex; align-items: center; gap: 10px; text-align: start; border: 0; background: transparent; padding: 4px 6px 4px 0; border-radius: 10px; color: var(--bar-ink); margin-right: auto; min-width: 0; transition: opacity .15s; }
.on-brand:hover { opacity: .85; }
.on-logo { width: 30px; height: 30px; flex: none; object-fit: contain; }
.on-brand-t { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; overflow: hidden; }
.on-bar :focus-visible { outline-color: #fff; }
body.is-pray .on-bar :focus-visible { outline-color: var(--navy); }
.on-kicker { font: 700 .58rem/1.4 var(--font-body); letter-spacing: .18em; text-transform: uppercase; color: var(--bar-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.on-where { font: 600 .98rem/1.25 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.on-ic {
  min-width: 42px; height: 42px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--bar-line); background: var(--bar-btn);
  font: 600 .82rem/1 var(--font-display); color: var(--bar-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; flex: none;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.on-ic:hover { background: var(--bar-btn-h); border-color: var(--bar-ink); }
.on-ic:active { transform: scale(.96); }
.on-ic svg { width: 18px; height: 18px; flex: none; }
.on-ic[aria-pressed="true"] { background: #fff; border-color: #fff; color: #1C47A5; }
#on-lock { background: var(--cyan); border-color: var(--cyan); color: #08233f; font-weight: 700; }
#on-lock:hover { background: #00D2D4; }
/* Narrow phones: the theme follows the device, so its switch gives way; the kicker goes too. */
@media (max-width: 480px) { .on-ic { padding: 0 9px; min-width: 40px; height: 40px; } .on-bar { gap: 6px; } .on-kicker { font-size: .52rem; letter-spacing: .14em; } }
@media (max-width: 359px) { .on-kicker { display: none; } }
.on-devbar { background: #b42318; color: #fff; text-align: center; font: 700 .78rem/1.4 var(--font-body); padding: 8px 12px; }
.on-ic small { font-size: .8em; }
.on-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── Section hero: the home page hero, scaled for a phone ── */
.on-page { animation: on-fade .4s ease both; }
@keyframes on-fade { from { opacity: 0; } to { opacity: 1; } }
.on-hero { position: relative; overflow: hidden; background: var(--grad-hero); color: #fff; text-align: center; padding: 30px 20px 34px; }
.on-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle at 18% 22%, rgba(94,144,227,.34), transparent 46%), radial-gradient(circle at 84% 74%, rgba(0,200,220,.20), transparent 48%);
}
.on-hero-in { position: relative; max-width: 640px; margin: 0 auto; }
.on-eyebrow { display: inline-flex; align-items: center; gap: 12px; font: 700 .7rem/1.4 var(--font-body); letter-spacing: .2em; text-transform: uppercase; color: var(--ice); }
.on-eyebrow::before, .on-eyebrow::after { content: ''; width: 26px; height: 1px; background: rgba(123,224,236,.5); }
.on-hero-he { font-family: var(--font-hebrew); font-weight: 700; font-size: clamp(2.7rem, 12vw, 4.2rem); line-height: 1.2; margin: 8px 0 2px; direction: rtl; }
.on-hero-en { font: 600 .9rem/1.4 var(--font-display); letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.88); }
.on-hero-meta { margin: 12px auto 0; max-width: 34ch; color: rgba(255,255,255,.82); font-size: .92rem; line-height: 1.5; }

/* ── The text ────────────────────────────────────────────── */
.on-text { max-width: 640px; margin: 0 auto; padding: 22px max(clamp(14px, 5vw, 28px), env(safe-area-inset-right)) 8px max(clamp(14px, 5vw, 28px), env(safe-area-inset-left)); }
/* A prayer: a compact title, then its lines. The navy hero is kept for section starts. */
.on-unit { padding: 22px 0 18px; scroll-margin-top: 80px; }
.on-text + .on-text > .on-unit { border-top: 1px solid var(--line); }
.on-uh { text-align: center; margin-bottom: 6px; }
.on-uh-he { margin: 0; font-family: var(--font-hebrew); font-weight: 700; font-size: clamp(1.7rem, 7vw, 2.2rem); line-height: 1.3; color: var(--navy); direction: rtl; }
.on-uh-en { font: 700 .66rem/1.5 var(--font-body); letter-spacing: .2em; text-transform: uppercase; color: var(--blue-ink); margin-top: 2px; }
.on-uh-meta { margin: 8px auto 0; max-width: 40ch; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.on-rubric { text-align: center; margin: 22px auto 0; max-width: 42ch; color: var(--muted); font: italic 400 .88rem/1.5 var(--font-body); }
/* Today: the day strip at the top, and passages that are not said today folded down to one line. */
.on-daybar { background: var(--surface); border-bottom: 1px solid var(--line); text-align: center; padding: 6px 12px; }
.on-day { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 4px 8px; min-height: 36px; padding: 4px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft); font: 600 .82rem/1.3 var(--font-display); transition: background .15s, color .15s; }
.on-day:hover { background: var(--hl); color: var(--hl-ink); }
.on-day:active { transform: scale(.98); }
.on-day em { font: italic 400 .78rem/1.3 var(--font-body); color: var(--muted); }
.on-day-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); flex: none; }
.on-todaytag { display: inline-block; margin-right: 4px; padding: 2px 8px; border-radius: 999px; background: var(--hl); color: var(--hl-ink); font: 700 .6rem/1.5 var(--font-body); font-style: normal; letter-spacing: .14em; text-transform: uppercase; vertical-align: 1px; }
.on-skip { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; margin: 20px 0 6px; padding: 12px 16px; border: 1px dashed var(--line-strong); border-radius: 14px; background: transparent; text-align: left; color: var(--muted); transition: background .15s, border-color .15s; }
.on-skip:hover { background: var(--surface); border-color: var(--blue); }
.on-skip:active { transform: scale(.99); }
.on-skip-t b { display: block; font: 600 .86rem/1.4 var(--font-display); color: var(--ink-soft); }
.on-skip-t i { display: block; margin-top: 2px; font: italic 400 .8rem/1.45 var(--font-body); }
.on-skip-t .on-skip-he { font: 500 1.05rem/1.5 var(--font-hebrew); direction: rtl; text-align: left; }
.on-skip-go { flex: none; font: 700 .64rem/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--blue-ink); }
.on-skipped { margin: 20px 0 6px; padding: 0 0 4px 14px; border-left: 2px dashed var(--line-strong); animation: on-fade .25s ease both; }
.on-skipped-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font: 600 .82rem/1.4 var(--font-display); color: var(--muted); }
.on-skipped .on-line, .on-skipped .on-rubric { opacity: .72; }
.on-skipped .on-rubric { margin-top: 12px; }
@keyframes on-fade { from { opacity: 0; } to { opacity: 1; } }
.on-date { flex: none; min-height: 40px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink); font: 600 .86rem/1 var(--font-display); color-scheme: inherit; }
.on-date:hover { border-color: var(--blue); }
body.is-pray .on-daybar { display: none; }
body.is-pray .on-skip { border-style: dotted; }
@media (prefers-reduced-motion: reduce) { .on-skipped { animation: none; } }
.on-soon { margin: 26px 0; padding: 16px 18px; border: 1px dashed var(--line-strong); border-radius: 16px; text-align: center; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.on-soon .on-lbl { display: block; margin-bottom: 4px; }
.on-continue {
  display: block; margin: 0 auto 6px; min-height: 42px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--navy);
  font: 600 .84rem/1 var(--font-display); transition: background .15s, border-color .15s, transform .1s;
}
.on-continue:hover { background: var(--hl); border-color: var(--blue); }
.on-continue:active { transform: scale(.97); }
.on-credit { margin: 14px auto 0; max-width: 44ch; font-size: .72rem; line-height: 1.6; color: var(--muted); }
.on-line { margin: 14px 0 0; }
.on-ph { text-align: center; margin: 0 0 .5em; font-size: var(--he-size); }
.on-ph-he { direction: rtl; font-family: var(--font-hebrew); line-height: 1.55; }
.on-ph-en { font: 400 clamp(.95rem, .4em, 1.15rem)/1.4 var(--font-body); color: var(--muted); margin-top: .05em; padding: 0 6px; }
:root[data-en="off"] .on-ph-en { display: none; }
:root[data-en="off"] .on-ph { margin-bottom: .1em; }
:root[data-en="off"] .on-ph-he { line-height: 1.9; }
.on-w {
  font: inherit; color: var(--ink); background: transparent; border: 0;
  padding: .06em .16em; margin: 0 .02em; border-radius: .22em;
  transition: background .15s, color .15s;
}
.on-w:hover { background: var(--surface); }
.on-w.is-on { background: var(--hl); color: var(--hl-ink); }
.on-w.is-flash { animation: on-flash 2s ease; }
@keyframes on-flash { 0%, 55% { background: var(--hl); } 100% { background: transparent; } }
.on-p { color: var(--muted); margin-inline-start: -.12em; }

.on-linerow { display: flex; justify-content: center; margin: 14px 0 0; }
.on-linebtn {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 46px; padding: 0 22px; border-radius: 999px; border: 0;
  background: var(--cyan); color: #08233f; box-shadow: 0 10px 26px rgba(0,200,220,.34);
  font: 700 .9rem/1 var(--font-display); letter-spacing: .02em;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.on-linebtn:hover { background: #00D2D4; transform: translateY(-2px); box-shadow: 0 16px 34px rgba(0,200,220,.44); }
.on-linebtn:active { transform: scale(.97); }
.on-linebtn svg { width: 17px; height: 17px; }
.on-dot { width: 7px; height: 7px; border-radius: 50%; background: #08233f; display: none; }
.on-linebtn.has-note .on-dot { display: block; }

.on-hint { text-align: center; color: var(--muted); font-size: .86rem; margin: 18px auto 0; max-width: 34ch; line-height: 1.55; transition: opacity .3s; }
.on-hint.is-gone { opacity: 0; pointer-events: none; }

.on-foot { margin: 40px auto 0; padding-bottom: 40px; padding-top: 22px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .84rem; line-height: 1.6; }
.on-next { font: 600 .95rem/1.3 var(--font-display); color: var(--ink-soft); }
.on-draft { display: inline-block; margin-top: 16px; padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .74rem; }
.on-link { background: none; border: 0; padding: 4px 2px; color: var(--navy); font: 600 .84rem/1.4 var(--font-body); text-decoration: underline; text-underline-offset: 3px; }
.on-link:hover { color: var(--blue); }

/* ── Just pray: two strong cues (tint + label), taps off ─── */
.on-praytag { display: none; font: 700 .6rem/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--navy); padding: 7px 11px; border-radius: 999px; background: var(--hl); white-space: nowrap; }
body.is-pray { background: var(--pray-bg); }
body.is-pray .on-bar { --bar-ink: var(--ink); --bar-btn: transparent; --bar-btn-h: var(--hl); --bar-line: var(--line-strong); background: var(--pray-bg); box-shadow: none; }
body.is-pray #on-lock { background: var(--navy); border-color: var(--navy); color: var(--bg); }
body.is-pray .on-praytag { display: inline-block; }
body.is-pray .on-w { pointer-events: none; }
body.is-pray .on-linerow, body.is-pray .on-hint, body.is-pray .on-foot, body.is-pray .on-hero, body.is-pray .on-uh-meta, body.is-pray .on-soon, body.is-pray .on-continue { display: none; }
body.is-pray .on-uh-he { font-size: 1.25rem; color: var(--muted); font-weight: 500; }
body.is-pray .on-uh-en { display: none; }
body.is-pray .on-brand { pointer-events: none; }
body.is-pray .on-text { padding-top: 34px; }
/* On a narrow phone the tint and the "Praying" button already say it; the tag would squeeze the title. */
@media (max-width: 480px) { body.is-pray .on-praytag { display: none; } }

/* ── The one sheet ───────────────────────────────────────── */
.on-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--sheet); border-top: 1px solid var(--line-strong);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 34px rgba(12, 35, 80, .13);
  display: flex; flex-direction: column; overflow: hidden;
  max-height: 36vh;
  transform: translateY(105%); visibility: hidden;
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), max-height .28s cubic-bezier(.2, .8, .2, 1), visibility 0s .28s;
  padding-bottom: env(safe-area-inset-bottom);
}
.on-sheet.is-open { transform: none; visibility: visible; transition-delay: 0s; }
.on-sheet[data-level="half"] { max-height: 62vh; }
.on-sheet[data-level="full"] { max-height: 100vh; max-height: 100dvh; height: 100dvh; border-radius: 0; }
.on-sheet-top { display: flex; align-items: center; gap: 6px; padding: 8px max(10px, env(safe-area-inset-right)) 4px max(14px, env(safe-area-inset-left)); flex: none; touch-action: none; }
.on-grab { flex: 1; display: flex; justify-content: center; }
.on-grab i { width: 38px; height: 4px; border-radius: 2px; background: var(--line-strong); }
.on-sheet[data-level="full"] .on-grab i { visibility: hidden; }
.on-back { visibility: hidden; }
.on-sheet[data-view="essay"] .on-back { visibility: visible; }
.on-x, .on-back {
  height: 40px; min-width: 40px; padding: 0 10px; border-radius: 10px; border: 0; background: transparent;
  color: var(--ink-soft); display: inline-flex; align-items: center; gap: 4px; font: 600 .82rem/1 var(--font-display);
  transition: background .15s;
}
.on-x:hover, .on-back:hover { background: var(--surface); }
.on-x svg, .on-back svg { width: 20px; height: 20px; }
.on-sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px max(18px, env(safe-area-inset-right)) 20px max(18px, env(safe-area-inset-left)); animation: on-fade .22s ease both; }
.on-sheet-body [tabindex="-1"]:focus { outline: none; }


/* shimmer while a prayer's depth loads */
.on-skel { display: grid; gap: 10px; padding: 12px 0; }
.on-skel i { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--surface) 25%, var(--line) 50%, var(--surface) 75%); background-size: 200% 100%; animation: on-shimmer 1.2s linear infinite; }
@keyframes on-shimmer { to { background-position: -200% 0; } }
.on-err { padding: 14px 0; color: var(--ink-soft); font-size: .95rem; line-height: 1.6; }
.on-sheet-title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; }
.on-sheet-title span { font-family: var(--font-hebrew); font-weight: 700; font-size: 1.35rem; color: var(--navy); direction: rtl; }
.on-sheet-title b { font: 700 .62rem/1.4 var(--font-body); letter-spacing: .18em; text-transform: uppercase; color: var(--blue-ink); }
.on-sheet-h { margin: 0 0 6px; font: 600 1.25rem/1.3 var(--font-display); color: var(--ink); }

/* contents */
.on-toc-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  min-height: 48px; padding: 8px 12px; margin: 2px 0; border-radius: 12px; border: 1px solid transparent; background: transparent;
  font: 600 .98rem/1.3 var(--font-display); color: var(--ink); text-align: start;
  transition: background .15s, border-color .15s;
}
.on-toc-item:hover { background: var(--surface); border-color: var(--line); }
.on-toc-item.is-here { background: var(--hl); border-color: var(--blue); color: var(--hl-ink); }
.on-toc-he { font-family: var(--font-hebrew); font-weight: 500; font-size: 1.15rem; color: var(--navy); direction: rtl; white-space: nowrap; }
.on-tocdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); margin-inline-start: 8px; vertical-align: middle; }
.on-toc-soon { margin: 10px 0; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.on-toc-all { margin: 18px 0 0; text-align: center; }

/* settings */
.on-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.on-row.is-stack { flex-direction: column; align-items: stretch; gap: 10px; }
.on-row b { display: block; font: 600 .98rem/1.3 var(--font-display); color: var(--ink); }
.on-row span { display: block; margin-top: 3px; color: var(--muted); font-size: .84rem; line-height: 1.45; }
.on-switch { flex: none; width: 52px; height: 32px; padding: 0; border-radius: 999px; border: 0; background: var(--line-strong); position: relative; transition: background .2s; }
.on-switch i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(12,35,80,.25); transition: transform .2s; }
.on-switch[aria-checked="true"] { background: var(--cyan); }
.on-switch[aria-checked="true"] i { transform: translateX(20px); }
.on-seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.on-seg button { flex: 1; min-height: 40px; padding: 0 10px; border-radius: 999px; border: 0; background: transparent; font: 600 .82rem/1.15 var(--font-display); color: var(--muted); transition: background .15s, color .15s; }
.on-seg button:hover:not(:disabled) { color: var(--ink); }
.on-seg button[aria-pressed="true"] { background: var(--grad-header); color: #fff; box-shadow: 0 4px 14px rgba(28,71,165,.25); }
.on-seg button:disabled { opacity: .6; cursor: default; }
.on-seg.is-chips { flex-wrap: wrap; border-radius: 18px; }

/* word view */
.on-wd { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
.on-wd-he { font-family: var(--font-hebrew); font-size: 2.1rem; line-height: 1.3; direction: rtl; color: var(--ink); }
.on-wd-en { font: 600 1.15rem/1.3 var(--font-display); color: var(--ink); }
.on-wd-say { width: 100%; color: var(--muted); font-size: .84rem; letter-spacing: .02em; }
.on-wd-more { margin: 10px 0 0; color: var(--ink-soft); font-size: .95rem; line-height: 1.6; }
.on-root { margin-top: 14px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.on-lbl { font: 700 .62rem/1.4 var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--blue-ink); }
.on-sec { margin: 22px 0 10px; }
.on-wspark { margin-top: 14px; padding: 14px 16px; border-radius: 16px; background: var(--grad-deep); color: #fff; box-shadow: 0 12px 30px rgba(12,35,80,.22); }
.on-wspark .on-lbl { color: var(--ice); }
.on-wspark p { margin: 6px 0 0; font-size: .96rem; line-height: 1.6; color: rgba(255,255,255,.94); }
.on-wspark .on-src { color: rgba(255,255,255,.7); }
.on-root-he { display: inline-block; font-family: var(--font-hebrew); font-size: 1.35rem; direction: rtl; margin-right: 12px; }
.on-root-en { color: var(--ink-soft); font-size: .92rem; }
.on-also { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.on-also-he { font-family: var(--font-hebrew); font-size: 1.2rem; direction: rtl; unicode-bidi: isolate; display: block; text-align: right; color: var(--ink); }
.on-also-en { color: var(--muted); font-size: .84rem; line-height: 1.5; }
.on-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.on-chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: transparent;
  font: 600 .82rem/1 var(--font-display); color: var(--ink-soft);
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.on-chip:hover { background: var(--surface); border-color: var(--blue); color: var(--ink); }
.on-chip:active { transform: scale(.97); }
.on-chip svg { width: 16px; height: 16px; }
.on-chip[aria-pressed="true"] { background: var(--hl); border-color: var(--blue); color: var(--hl-ink); }
.on-chip.is-main { background: var(--cyan); border-color: var(--cyan); color: #08233f; font-weight: 700; }
.on-chip.is-main:hover { background: #00D2D4; border-color: #00D2D4; color: #08233f; }

/* line view */
.on-tabs { display: flex; gap: 4px; position: sticky; top: 0; z-index: 1; margin: 0 -18px 14px; padding: 7px 23px; background: var(--sheet); box-shadow: 0 -4px 0 var(--sheet); }
.on-tabs::before { content: ''; position: absolute; inset: 2px 18px; z-index: -1; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.on-tab {
  flex: 1; min-height: 40px; padding: 0 6px; border-radius: 999px; border: 0;
  background: transparent; font: 600 .82rem/1.15 var(--font-display); color: var(--muted);
  transition: background .15s, color .15s;
}
.on-tab:hover { color: var(--ink); }
.on-tab[aria-selected="true"] { background: var(--grad-header); color: #fff; box-shadow: 0 4px 14px rgba(28,71,165,.25); }
.on-says { font-size: 1.14rem; line-height: 1.65; color: var(--ink); margin: 0; }
.on-tip { margin-top: 16px; padding: 12px 14px; border-inline-start: 3px solid var(--cyan); background: var(--surface); color: var(--ink-soft); font-size: .95rem; line-height: 1.55; }
.on-tip .on-lbl { margin-bottom: 4px; }
.on-src { display: block; margin-top: 6px; color: var(--muted); font-size: .76rem; letter-spacing: .01em; }
.on-srcintro { margin: 0 0 14px; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.on-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.on-facts > div { padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.on-facts dt { font: 700 .58rem/1.4 var(--font-body); letter-spacing: .15em; text-transform: uppercase; color: var(--blue-ink); }
.on-facts dd { margin: 4px 0 0; font: 600 .92rem/1.35 var(--font-display); color: var(--ink); }
.on-card { padding: 14px 0; border-bottom: 1px solid var(--line); }
.on-card h3 { margin: 0 0 6px; font: 600 1.02rem/1.35 var(--font-display); color: var(--ink); }
.on-card p { margin: 0; color: var(--ink-soft); font-size: .95rem; line-height: 1.6; }
/* A pin under a line that names a place in the Temple, and the map it opens. */
.on-pinrow { text-align: center; margin: 2px 0 10px; }
.on-pin { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--blue-ink); font: 600 .76rem/1 var(--font-display); transition: background .15s, border-color .15s, transform .15s; }
.on-pin:hover { background: var(--hl); border-color: var(--blue); transform: translateY(-1px); }
.on-pin:active { transform: scale(.97); }
.on-pin svg { width: 15px; height: 15px; }
body.is-pray .on-pinrow { display: none; }
.on-toc-item.is-map span:first-child { display: inline-flex; align-items: center; gap: 8px; color: var(--blue-ink); }
.on-toc-item.is-map svg { width: 16px; height: 16px; }
.on-map-line { margin: 2px 0 12px; font: 500 1.25rem/1.6 var(--font-hebrew); direction: rtl; text-align: right; color: var(--navy); }
.on-map-chips { flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.on-map-chips .on-chip { min-height: 36px; padding: 4px 12px; font-size: .82rem; }
.on-map-chips .on-chip.is-on { background: var(--navy); border-color: var(--navy); color: var(--bg); }
.on-map-chips.is-all .on-chip { font-size: .78rem; min-height: 32px; padding: 4px 10px; }
.on-map-wrap { margin: 0 auto; max-width: 430px; padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.on-map-svg { display: block; width: 100%; height: auto; touch-action: manipulation; }
.on-map-svg .tm-court { fill: var(--bg); stroke: var(--line-strong); stroke-width: calc(.9px * var(--k, 1)); }
.on-map-svg .tm-side { font: 700 3.6px/1 var(--font-body); letter-spacing: .5px; fill: var(--muted); }
.on-map-svg .tm-name { font: 600 calc(3.7px * var(--k, 1))/1 var(--font-display); fill: var(--muted); pointer-events: none; }
.on-map-svg g[data-place] { cursor: pointer; outline: none; }
.on-map-svg .tm-area rect { fill: var(--blue); fill-opacity: .06; stroke: var(--blue); stroke-opacity: .5; stroke-width: calc(.4px * var(--k, 1)); transition: fill-opacity .2s; }
.on-map-svg .tm-area:hover rect, .on-map-svg .tm-area:focus-visible rect { fill-opacity: .2; stroke-opacity: 1; }
.on-map-svg .tm-area.is-lit rect { fill: var(--cyan); fill-opacity: .4; stroke: var(--cyan); stroke-opacity: 1; stroke-width: calc(.8px * var(--k, 1)); }
.on-map-svg .tm-area.is-sel rect { stroke: var(--navy); stroke-opacity: 1; stroke-width: calc(1.3px * var(--k, 1)); fill-opacity: .5; }
.on-map-svg .tm-area.is-tiny.is-lit rect, .on-map-svg .tm-area.is-tiny.is-sel rect { fill-opacity: 1; }
.on-map-svg .tm-area.is-lit .tm-name, .on-map-svg .tm-area.is-sel .tm-name { fill: var(--ink); }
.on-map-svg .tm-hit { fill: transparent; }
.on-map-svg .tm-ring { fill: none; stroke: none; }
.on-map-svg .tm-dot { fill: var(--blue); fill-opacity: .65; }
.on-map-svg .tm-pt:hover .tm-dot, .on-map-svg .tm-pt:focus-visible .tm-dot { fill-opacity: 1; }
.on-map-svg .tm-pt.is-lit .tm-dot { fill: var(--cyan); fill-opacity: 1; stroke: #08233f; stroke-width: calc(.45px * var(--k, 1)); }
.on-map-svg .is-lit .tm-ring { stroke: var(--cyan); stroke-width: calc(.7px * var(--k, 1)); animation: tm-pulse 1.8s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.on-map-svg .is-sel .tm-ring { stroke: var(--navy); stroke-width: calc(.9px * var(--k, 1)); animation: none; }
.on-map-svg .tm-pt.is-sel .tm-dot { fill: var(--navy); fill-opacity: 1; stroke: var(--bg); stroke-width: calc(.5px * var(--k, 1)); }
.on-map-wrap { position: relative; }
.on-map-svg .tm-area.is-zone rect { fill: none; stroke: none; }
.on-map-svg .tm-area.is-zone.is-lit rect, .on-map-svg .tm-area.is-zone.is-sel rect { fill: var(--cyan); fill-opacity: .16; stroke: var(--cyan); stroke-opacity: 1; stroke-dasharray: calc(2px * var(--k, 1)) calc(1.4px * var(--k, 1)); stroke-width: calc(.7px * var(--k, 1)); }
.on-map-svg .tm-area.has-kids.is-lit rect { fill-opacity: .14; }
.on-map-svg .tm-area.has-kids.is-sel rect { fill-opacity: .2; }
.on-map-svg .tm-badge circle { fill: var(--navy); stroke: var(--bg); stroke-width: calc(.5px * var(--k, 1)); }
.on-map-svg .tm-badge text { font: 700 calc(3.5px * var(--k, 1))/1 var(--font-display); fill: var(--bg); pointer-events: none; }
.on-map-svg .tm-badge { pointer-events: none; }
.on-map-chips .on-chip i { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 50%; background: var(--navy); color: var(--bg); font: 700 .7rem/1 var(--font-display); font-style: normal; }
.on-map-chips .on-chip.is-on i { background: var(--bg); color: var(--navy); }
.on-map-zoom { display: block; width: 100%; margin-top: 6px; min-height: 38px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--blue-ink); font: 700 .78rem/1 var(--font-display); transition: background .15s; border-radius: 0 0 10px 10px; }
.on-map-zoom:hover { background: var(--hl); }
.on-map-zoom:active { transform: scale(.99); }
.on-map-compass { position: absolute; top: 10px; left: 12px; padding: 3px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); font: 600 .66rem/1.4 var(--font-body); }
@keyframes tm-pulse { from { opacity: .9; transform: scale(.6); } to { opacity: 0; transform: scale(1.7); } }
.on-map-card { margin: 14px 0 4px; padding: 14px 16px; border: 1px solid var(--line-strong); border-inline-start: 4px solid var(--cyan); border-radius: 14px; background: var(--surface); min-height: 96px; }
.on-map-name { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.on-map-name b { font: 600 1.06rem/1.3 var(--font-display); color: var(--ink); order: -1; }
.on-map-name span { font: 500 1.3rem/1.3 var(--font-hebrew); color: var(--navy); direction: rtl; }
.on-map-card p { margin: 0; color: var(--ink-soft); font-size: .95rem; line-height: 1.6; }
.on-map-card .on-map-basis { margin-top: 8px; font-size: .8rem; font-style: italic; color: var(--muted); }
.on-map-foot { margin: 18px 0 8px; color: var(--muted); font-size: .8rem; line-height: 1.5; }
@media (prefers-reduced-motion: reduce) { .on-map-svg .is-lit .tm-ring { animation: none; opacity: .8; } }
/* The editor's pick leads each tab; repeats and background wait behind "Show more". */
.on-card.is-lead { margin: 0 0 6px; padding: 16px; border: 1px solid var(--line-strong); border-inline-start: 4px solid var(--cyan); border-radius: 14px; background: var(--surface); }
.on-card.is-lead h3 { font-size: 1.1rem; }
.on-card.is-lead p { color: var(--ink); }
.on-card.is-hal.is-lead:first-of-type { padding-top: 16px; }
.on-spark.is-lead { border-color: var(--blue); box-shadow: 0 10px 30px rgba(28,71,165,.16); }
.on-more { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; margin: 14px 0 4px; padding: 12px 16px; border: 1px dashed var(--line-strong); border-radius: 14px; background: transparent; text-align: center; transition: background .15s, border-color .15s; }
.on-more:hover { background: var(--surface); border-color: var(--blue); }
.on-more:active { transform: scale(.99); }
.on-more b { font: 700 .82rem/1.3 var(--font-display); color: var(--blue-ink); }
.on-more span { font: 400 .78rem/1.4 var(--font-body); color: var(--muted); }
.on-morebox { animation: on-fade .25s ease both; }
.on-morebox > :focus { outline: none; }
@media (prefers-reduced-motion: reduce) { .on-morebox { animation: none; } }
.on-hq {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: start;
  margin-top: 8px; padding: 15px 16px; border-radius: 16px; border: 0;
  background: var(--grad-deep); color: #fff; box-shadow: 0 10px 26px rgba(12,35,80,.2);
  transition: transform .15s, box-shadow .15s;
}
.on-hq:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(12,35,80,.28); }
.on-hq:active { transform: scale(.99); }
.on-hq b { font: 600 1rem/1.4 var(--font-display); color: #fff; }
.on-hq-go { flex: none; font: 700 .62rem/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--ice); white-space: nowrap; }
.on-hq.is-plain { margin-top: 18px; background: var(--surface); box-shadow: none; border: 1px solid var(--line-strong); }
.on-hq.is-plain b { color: var(--ink); }
.on-hq.is-plain .on-hq-go { color: var(--blue-ink); }
.on-hq.is-plain:hover { border-color: var(--blue); box-shadow: var(--shadow-card); }

/* meaning: the whole prayer in plain English, line by line */
.on-mline { padding: 12px 0; border-bottom: 1px solid var(--line); }
.on-mline:only-of-type, .on-mline:last-of-type { border-bottom: 0; }
.on-mline.is-focus { margin: 0 -10px; padding: 12px 10px; border-radius: 14px; background: var(--hl); border-bottom-color: transparent; }
.on-mhe { font-family: var(--font-hebrew); font-size: 1.05rem; color: var(--navy); direction: rtl; text-align: right; margin-bottom: 4px; }
.on-mnote { margin: 8px 0 0; padding-inline-start: 12px; border-inline-start: 3px solid var(--blue); color: var(--ink-soft); font-size: .9rem; line-height: 1.55; }
.on-halintro { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); font-size: .86rem; line-height: 1.5; }
.on-card.is-hal:first-of-type { padding-top: 0; }
.on-tabs.is-5 .on-tab { font-size: .76rem; padding: 0 2px; }

/* sparks */
.on-spark { margin: 0 0 12px; padding: 16px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.on-spark-kind { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--grad-deep); color: var(--ice); font: 700 .58rem/1.4 var(--font-body); letter-spacing: .14em; text-transform: uppercase; }
.on-spark h3 { margin: 10px 0 6px; font: 600 1.08rem/1.35 var(--font-display); color: var(--ink); }
.on-spark p { margin: 0; color: var(--ink-soft); font-size: .96rem; line-height: 1.62; }
.on-spark-he { margin: 12px 0 0; padding: 10px 14px; border-inline-start: 3px solid var(--blue); background: var(--surface); direction: rtl; text-align: right; font-family: var(--font-hebrew); font-size: 1.12rem; line-height: 1.8; color: var(--ink); }

/* sources: the /adam source block */
.on-source { margin: 0 0 16px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--bg); box-shadow: var(--shadow-card); }
.on-source-he { margin: 0; padding: 16px 18px 6px; direction: rtl; text-align: right; font-family: var(--font-hebrew); font-size: 1.2rem; line-height: 1.9; color: var(--ink); }
.on-source-en { margin: 0; padding: 4px 18px 6px; font-family: var(--font-serif); font-size: 1.14rem; line-height: 1.55; color: var(--ink-soft); }
.on-essay .on-source-en { font-size: 1.14rem; line-height: 1.55; margin: 0; }
.on-source-ref { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 10px 18px; background: var(--surface); border-top: 1px solid var(--line); font: 700 .6rem/1.4 var(--font-body); letter-spacing: .13em; text-transform: uppercase; color: var(--navy); }
.on-source-ref em { font-style: normal; font-weight: 600; letter-spacing: .04em; text-transform: none; font-size: .74rem; color: var(--muted); text-align: right; }
.on-source.is-deep { background: var(--grad-deep); border-color: transparent; text-align: center; box-shadow: 0 14px 36px rgba(12,35,80,.22); }
.on-source.is-deep .on-source-he { color: #fff; text-align: center; font-size: 1.5rem; }
.on-source.is-deep .on-source-en { color: rgba(255,255,255,.92); }
.on-source.is-deep .on-source-ref { background: rgba(255,255,255,.07); border-top-color: rgba(255,255,255,.12); color: var(--ice); }
.on-source.is-deep .on-source-ref em { color: rgba(255,255,255,.75); }

.on-ask { font: 600 1.12rem/1.5 var(--font-display); color: var(--ink); margin: 0 0 12px; }
.on-note {
  width: 100%; min-height: 104px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink);
  font: 400 1rem/1.55 var(--font-body); resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}
.on-note:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--hl); }
.on-note::placeholder { color: var(--muted); opacity: .75; }
.on-priv { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.on-priv svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.on-saved { color: var(--navy); font-weight: 600; opacity: 0; transition: opacity .2s; }
.on-saved.is-on { opacity: 1; }

/* essay view */
.on-essay { max-width: 62ch; margin: 0 auto; padding-bottom: 30px; }
.on-essay-head { margin: 0 -18px 20px; padding: 24px 20px 26px; background: var(--grad-hero); text-align: center; border-radius: 0 0 22px 22px; }
.on-essay-head h2 { font: 600 1.4rem/1.3 var(--font-display); color: #fff; margin: 10px 0 0; }
.on-essay p { font-size: 1.04rem; line-height: 1.75; color: var(--ink-soft); margin: 0 0 14px; }
.on-essay-src { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; line-height: 1.7; }

/* ── Tablet and up: the sheet becomes a left side pane ───── */
@media (min-width: 900px) {
  body.has-sheet { padding-left: var(--pane); }
  .on-sheet, .on-sheet[data-level] {
    top: 0; right: auto; bottom: 0; width: var(--pane); height: auto; max-height: none;
    transform: none; visibility: visible; border-radius: 0;
    border-top: 0; border-right: 1px solid var(--line); box-shadow: none;
    background: var(--surface);
  }
  .on-grab i { visibility: hidden; }
  .on-tabs { margin: 0 -24px 14px; padding: 7px 29px; background: var(--surface); box-shadow: 0 -4px 0 var(--surface); }
  .on-tabs::before { inset: 2px 24px; background: var(--bg); }
  .on-facts > div, .on-spark-he, .on-halintro, .on-seg { background: var(--bg); }
  .on-toc-item:hover { background: var(--bg); }
  .on-essay-head { margin: 0 -24px 20px; }
  .on-sheet:not(.is-open) .on-sheet-top { visibility: hidden; }
  .on-sheet:not(.is-open) .on-sheet-body { display: none; }
  /* The prayer on screen is the pane's resting state, so there is nothing to close. */
  .on-sheet[data-view="unit"] .on-x { visibility: hidden; }
  .on-sheet-body { padding: 4px 24px 30px max(24px, env(safe-area-inset-left)); }
  .on-sheet-top { touch-action: auto; }
  .on-note, .on-root, .on-hq.is-plain { background: var(--bg); }
  .on-tip { background: var(--bg); }
  /* Pray hides the pane, but Contents and Settings still have to open somewhere. */
  body.is-pray { padding-left: 0; }
  body.is-pray .on-sheet:not(.is-open) { display: none; }
  body.is-pray:has(.on-sheet.is-open) { padding-left: var(--pane); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media print {
  :root, :root[data-theme="dark"] { --navy: #1C47A5; --blue-ink: #2F62C0; --ink: #26303f; --ink-soft: #4a5565; --muted: #636B77; --bg: #fff; --surface: #f7f9fc; --line: #e3eaf5; color-scheme: light; }
  .on-bar, .on-sheet, .on-linerow, .on-hint, .on-foot, .on-hero, .on-soon, .on-continue { display: none !important; }
  body { padding: 0 !important; }
}
