/* Panoplia - one stylesheet.
   Look: "Midnight". Deep navy (or warm paper in light mode), lighter navy cards, ivory text with strong contrast,
   a cream verse card, and a soft color tile for every tool so each one is easy to spot.
   Gold is kept for one job: what is active or tappable. The AI keeps its iridescent "orb". */

/* ---------- Tokens ---------- */
:root {
  --bg: #f7f4ee; --surface: #ffffff; --surface2: #ece8e0; --text: #1c201d; --muted: #62675f; --line: rgba(28, 32, 29, .1);
  --accent: #3b6fb3; --accent-ink: #ffffff; --link: #2b5687; --chip: rgba(28, 32, 29, .06);
  --reading: rgba(59, 111, 179, .14); --glass: rgba(255, 253, 249, .86); --shadow-float: 0 10px 34px rgba(28, 32, 29, .14);
  --ai: #6d4bd0; --ask-ring: #8b7cf0;
  --votd-bg: #dce7f5; --votd-ink: #1c201d; --votd-sub: #2b5687; --votd-k: #2b5687; --votd-btn: rgba(255, 255, 255, .65);
  /* Daybreak home: translucent cards over the mountain scene, sand play button, lilac Ask card, weekly check-in. */
  --hero-glass: rgba(255, 255, 255, .62); --sand: #f0e5d2; --lilac: #ece5fa; --lilac-ink: #6d4bd0; --track: #eeeae2; --done-ink: #ffffff;
  --sc-s1: #cfe0f2; --sc-s2: #e6ddeb; --sc-s3: #f7d2b6; --sc-s4: #fbe1c4; --sc-sun: #ffe0a6; --sc-m1: #c3b6d6; --sc-m2: #a7b1d3; --sc-m3: #8ea2c6;
  /* Tool tiles: background / symbol color */
  --t-violet: #e6e4f7; --t-violet-i: #4b3fb5; --t-amber: #fbe8d2; --t-amber-i: #a4560c; --t-green: #dcefe1; --t-green-i: #1f7a3d;
  --t-rose: #f8dde3; --t-rose-i: #b3264a; --t-teal: #d8eef1; --t-teal-i: #0c6b78; --t-blue: #dde8f7; --t-blue-i: #1f4f99;
  --t-purple: #eee0f6; --t-purple-i: #7a33a6; --t-brown: #efe5d6; --t-brown-i: #7a5a2e; --t-slate: #e4e7ee; --t-slate-i: #3f4a66;
  --hl-y: #fde047; --hl-g: #86efac; --hl-b: #93c5fd; --hl-p: #f9a8d4; --hl-o: #fdba74; --hl-u: #c4b5fd;
  --wj: #b3261e;
  --iri: conic-gradient(from 210deg, #ff8a65, #ff5fa2, #b26bff, #5b8cff, #36d6c6, #ffb84d, #ff8a65);
  --hair: 1px;
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.32, .72, 0, 1);
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  --fs: 19px; --tabh: 62px; --tabgap: max(10px, env(safe-area-inset-bottom, 0px));
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #15181f; --surface2: #1f232c; --text: #f1eee7; --muted: #a7aebe; --line: rgba(167, 174, 190, .16);
  --accent: #7faee8; --accent-ink: #0d1b2e; --link: #a3c6ef; --chip: rgba(167, 174, 190, .12);
  --reading: rgba(127, 174, 232, .16); --glass: rgba(21, 24, 31, .88); --shadow-float: 0 10px 40px rgba(0, 0, 0, .5); --ai: #c3a8ff; --ask-ring: #6c6fe0;
  --votd-bg: #1b2a3f; --votd-ink: #f1eee7; --votd-sub: #a3c6ef; --votd-k: #a3c6ef; --votd-btn: rgba(255, 255, 255, .1);
  --hero-glass: rgba(16, 22, 38, .58); --sand: #2e2719; --lilac: #252036; --lilac-ink: #7a62d0; --track: #262a33; --done-ink: #0d1b2e;
  --sc-s1: #101a2e; --sc-s2: #1a2b48; --sc-s3: #28426a; --sc-s4: #3d5c88; --sc-sun: #dce6f5; --sc-m1: #22355a; --sc-m2: #192845; --sc-m3: #121d33;
  --t-violet: #2f2a6b; --t-violet-i: #b8b2ff; --t-amber: #4a3214; --t-amber-i: #ffc27a; --t-green: #173f2a; --t-green-i: #7fe0a2;
  --t-rose: #4a1a2b; --t-rose-i: #ff9fb8; --t-teal: #123f47; --t-teal-i: #7fdbe8; --t-blue: #16305e; --t-blue-i: #93bbff;
  --t-purple: #3b1f55; --t-purple-i: #d7a6ff; --t-brown: #3d2f1f; --t-brown-i: #e6c39a; --t-slate: #2a3450; --t-slate-i: #c3cbe0;
  --hl-y: rgba(250, 204, 21, .82); --hl-g: rgba(74, 222, 128, .78); --hl-b: rgba(96, 165, 250, .82); --hl-p: rgba(244, 114, 182, .82); --hl-o: rgba(251, 146, 60, .82); --hl-u: rgba(167, 139, 250, .85); --hl-ink: #10131c;
  --wj: #ff8a80;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] {
  --bg: #000000; --surface: #15181f; --surface2: #1f232c; --text: #f1eee7; --muted: #a7aebe; --line: rgba(167, 174, 190, .16);
  --accent: #7faee8; --accent-ink: #0d1b2e; --link: #a3c6ef; --chip: rgba(167, 174, 190, .12);
  --reading: rgba(127, 174, 232, .16); --glass: rgba(21, 24, 31, .88); --shadow-float: 0 10px 40px rgba(0, 0, 0, .5); --ai: #c3a8ff; --ask-ring: #6c6fe0;
  --votd-bg: #1b2a3f; --votd-ink: #f1eee7; --votd-sub: #a3c6ef; --votd-k: #a3c6ef; --votd-btn: rgba(255, 255, 255, .1);
  --hero-glass: rgba(16, 22, 38, .58); --sand: #2e2719; --lilac: #252036; --lilac-ink: #7a62d0; --track: #262a33; --done-ink: #0d1b2e;
  --sc-s1: #101a2e; --sc-s2: #1a2b48; --sc-s3: #28426a; --sc-s4: #3d5c88; --sc-sun: #dce6f5; --sc-m1: #22355a; --sc-m2: #192845; --sc-m3: #121d33;
  --t-violet: #2f2a6b; --t-violet-i: #b8b2ff; --t-amber: #4a3214; --t-amber-i: #ffc27a; --t-green: #173f2a; --t-green-i: #7fe0a2;
  --t-rose: #4a1a2b; --t-rose-i: #ff9fb8; --t-teal: #123f47; --t-teal-i: #7fdbe8; --t-blue: #16305e; --t-blue-i: #93bbff;
  --t-purple: #3b1f55; --t-purple-i: #d7a6ff; --t-brown: #3d2f1f; --t-brown-i: #e6c39a; --t-slate: #2a3450; --t-slate-i: #c3cbe0;
  --hl-y: rgba(250, 204, 21, .82); --hl-g: rgba(74, 222, 128, .78); --hl-b: rgba(96, 165, 250, .82); --hl-p: rgba(244, 114, 182, .82); --hl-o: rgba(251, 146, 60, .82); --hl-u: rgba(167, 139, 250, .85); --hl-ink: #10131c;
  --wj: #ff8a80;
  color-scheme: dark;
} }
/* Tool tile colors */
.tint-violet { --tb: var(--t-violet); --ti: var(--t-violet-i); } .tint-amber { --tb: var(--t-amber); --ti: var(--t-amber-i); }
.tint-green { --tb: var(--t-green); --ti: var(--t-green-i); } .tint-rose { --tb: var(--t-rose); --ti: var(--t-rose-i); }
.tint-teal { --tb: var(--t-teal); --ti: var(--t-teal-i); } .tint-blue { --tb: var(--t-blue); --ti: var(--t-blue-i); }
.tint-purple { --tb: var(--t-purple); --ti: var(--t-purple-i); } .tint-brown { --tb: var(--t-brown); --ti: var(--t-brown-i); }
.tint-slate { --tb: var(--t-slate); --ti: var(--t-slate-i); }

/* ---------- Base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body { overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--text); background: var(--surface); border: var(--hair) solid var(--line); border-radius: 12px; padding: 11px 13px; width: 100%; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--muted); }
textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
a { color: var(--link); }
[hidden] { display: none !important; }
svg:not(.leaflet-zoom-animated) { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.spacer { flex: 1; }

/* ---------- Shell: top bar, content, tab bar ---------- */
#app { display: flex; flex-direction: column; height: 100dvh; max-width: 760px; margin: 0 auto; position: relative; }
#topbar { padding: calc(var(--safe-t) + 10px) 16px 8px; display: flex; align-items: center; gap: 8px; background: var(--bg); min-height: 60px; }
#topbar h1 { font-family: var(--display); font-size: 22px; font-weight: 650; letter-spacing: -.022em; margin: 0; flex: 1; }
.tb-btn { padding: 8px 13px; border-radius: 999px; background: var(--surface); border: var(--hair) solid var(--line); font-weight: 600; font-size: 15px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tb-btn.ref { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
.tb-btn.places-pill { padding: 8px 11px; gap: 5px; font-size: 14px; color: var(--t-rose-i, var(--text)); }
.tb-btn.places-pill svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.tb-icon { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 50%; position: relative; }
.tb-icon:active, .tb-btn:active { opacity: .55; }
.badge { position: absolute; top: 2px; right: 0; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 700; border-radius: 9px; min-width: 16px; padding: 0 4px; text-align: center; }
#excursion { background: var(--surface2); color: var(--text); border-bottom: var(--hair) solid var(--line); padding: 8px 12px; display: flex; gap: 8px; align-items: center; font-size: 14px; }
#excursion b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#excursion button { background: var(--text); color: var(--bg); padding: 6px 11px; border-radius: 999px; font-weight: 600; white-space: nowrap; }

#view { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 16px calc(var(--tabh) + var(--tabgap) + 90px); }
#view.has-composer { padding-bottom: calc(var(--tabh) + var(--tabgap) + 96px); }

#tabs { position: absolute; bottom: var(--tabgap); left: 12px; right: 12px; height: var(--tabh); display: flex; align-items: center; padding: 0 4px; z-index: 20;
  background: var(--glass); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8);
  border: var(--hair) solid var(--line); border-radius: 26px; box-shadow: var(--shadow-float); }
#tabs button { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); transition: color .2s; }
#tabs button > svg { margin: 5px 0; }
#tabs button.on, #tabs button.on svg { color: var(--accent); }
#tabs button.on svg { stroke-width: 2; }
#tabs .ask-tab .orb { width: 34px; height: 34px; border-radius: 50%; margin-bottom: -1px; background: var(--surface2) !important; color: var(--text); box-shadow: none; }
#tabs .ask-tab .orb svg { width: 19px; height: 19px; }
#tabs .ask-tab.on .orb { background: var(--iri) !important; color: #fff; }

/* ---------- Motion ---------- */
@keyframes pushIn { from { opacity: 0; transform: translateX(26px); } }
@keyframes popIn { from { opacity: 0; transform: translateX(-18px); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } }
@keyframes up { from { transform: translateY(100%); } }
@keyframes dim { from { opacity: 0; } }
#view.anim-push { animation: pushIn .34s var(--ease); }
#view.anim-pop { animation: popIn .3s var(--ease); }
#view.anim-fade { animation: fadeIn .26s var(--ease); }
.row, .btn, .cont, .dk-i, .votd-a button, .sug, .chip, .topic-card, .tile, .heb-tile, .play-dot, #hymnbar button, .np-ctrl button { transition: transform .14s var(--ease), opacity .14s, background-color .2s; }
.btn:active, .cont:active, .votd-a button:active, .sug:active, .chip:active, .topic-card:active, .tile:active, .heb-tile:active, .np-ctrl button:active, #hymnbar button:active { transform: scale(.96); }
.dk:active .dk-i { transform: scale(.92); }
.row:active { background: var(--chip); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Generic UI ---------- */
.page-h { font-family: var(--display); font-size: 28px; font-weight: 650; letter-spacing: -.022em; margin: 18px 0 10px; }
.sec-h { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 26px 2px 10px; font-weight: 600; }
.card { background: var(--surface); border: var(--hair) solid var(--line); border-radius: 18px; }
.card.pad { padding: 16px; }
.list { background: var(--surface); border: var(--hair) solid var(--line); border-radius: 16px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: var(--hair) solid var(--line); width: 100%; text-align: left; }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 560; }
.row .s { font-size: 13px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row.on { background: var(--chip); }
.row > .chev, .row > svg:last-child:not(.ic-check) { width: 18px; height: 18px; color: var(--muted); flex: none; }
.ic-check { color: var(--accent); width: 20px; height: 20px; stroke-width: 2.2; flex: none; }
.chev { color: var(--muted); }
.grid { display: grid; gap: 8px; }
.grid.books { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.grid.nums { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); }
.grid.topics { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.cell { background: var(--surface); border: var(--hair) solid var(--line); border-radius: 12px; padding: 11px 6px; text-align: center; font-weight: 600; font-size: 14px; }
.cell.on { background: var(--text); color: var(--bg); border-color: transparent; }
.topic-card { background: var(--surface); border: var(--hair) solid var(--line); border-radius: 14px; padding: 15px 12px 15px 15px; text-align: left; display: flex; gap: 8px; align-items: center; font-weight: 560; font-size: 15px; }
.topic-card .tc-n { flex: 1; min-width: 0; }
.topic-card .tc-i { width: 34px; height: 34px; border-radius: 10px; background: var(--chip); display: grid; place-items: center; font-size: 18px; flex: none; }
.topic-card svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.btn svg { width: 18px; height: 18px; }
.btn.ghost { background: var(--chip); color: var(--text); }
.btn.small { padding: 8px 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.on-btn { background: var(--text) !important; color: var(--bg) !important; }
.seg { display: flex; background: var(--surface2); border-radius: 10px; padding: 2px; gap: 2px; margin: 10px 0; }
.seg button { flex: 1; padding: 8px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.seg.scroll { overflow-x: auto; scrollbar-width: none; }
.seg.scroll button { flex: 1 0 auto; padding: 8px 12px; white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 11px; border-radius: 999px; background: var(--chip); color: var(--text); font-weight: 500; font-size: 14px; margin: 2px; }
.chip.on { background: var(--text); color: var(--bg); }
.chip.x { padding-right: 6px; }
.chip .xx { opacity: .6; font-size: 16px; line-height: 1; padding-left: 2px; }
.chips-scroll { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 6px; scrollbar-width: none; }
.chips-scroll .chip { flex: none; white-space: nowrap; margin: 0; }
.field { margin: 12px 0; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.searchbar { position: sticky; top: 0; background: var(--bg); padding: 12px 0 4px; z-index: 2; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; line-height: 1.5; }
.empty-ic svg { width: 40px; height: 40px; stroke-width: 1.2; color: var(--muted); }
.notice { font-family: var(--sans); font-size: 14px; color: var(--muted); background: var(--surface); border: var(--hair) solid var(--line); padding: 12px 14px; border-radius: 14px; margin: 16px 0; line-height: 1.5; }
.vref { color: var(--link); font-family: var(--sans); font-size: .8em; font-weight: 600; background: var(--chip); padding: 1px 7px; border-radius: 6px; white-space: nowrap; }
mark { background: var(--hl-y); color: inherit; border-radius: 3px; padding: 0 1px; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabh) + var(--tabgap) + 24px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 60; box-shadow: var(--shadow-float); max-width: 90%; text-align: center; animation: fadeIn .2s var(--ease); }

/* ---------- Sheets ---------- */
#sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 40; animation: dim .25s ease-out; }
#sheet { position: fixed; left: 0; right: 0; bottom: 0; max-width: 760px; margin: 0 auto; max-height: 86dvh; background: var(--surface); border-radius: 26px 26px 0 0; border-top: var(--hair) solid var(--line);
  z-index: 41; display: flex; flex-direction: column; box-shadow: 0 -10px 40px rgba(0, 0, 0, .3); animation: up .42s var(--spring); }
.grip { width: 36px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; flex: none; }
#sheet-body { overflow-y: auto; padding: 8px 16px calc(var(--safe-b) + 20px); }
.sheet-h { display: flex; align-items: center; gap: 8px; margin: 6px 0 12px; }
.sheet-h h2 { flex: 1; margin: 0; font-family: var(--display); font-size: 19px; font-weight: 650; letter-spacing: -.015em; }
.close { width: 32px; height: 32px; border-radius: 50%; background: var(--chip); display: grid; place-items: center; }
.close svg { width: 16px; height: 16px; }

/* ---------- Reader ---------- */
.reader { font-family: var(--serif); font-size: var(--fs); line-height: 1.75; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.chapter-title { text-align: center; margin: 22px 0 6px; font-family: var(--serif); font-weight: 600; font-size: 1.5em; }
.chapter-sub { text-align: center; color: var(--muted); font-family: var(--sans); font-size: 13px; margin-bottom: 14px; }
.verse { margin: 0 0 .35em; padding: 2px 4px; border-radius: 6px; transition: background .2s; }
.verse.reading { background: var(--reading); }
.verse.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 40% { background: var(--reading); } 100% { background: transparent; } }
.vn { font-family: var(--sans); font-size: .58em; color: var(--muted); font-weight: 600; vertical-align: super; margin-right: 3px; }
.w, .sp { border-radius: 3px; }
.w.sel { background: var(--reading); box-shadow: inset 0 -2px 0 var(--accent); }
.hl-y { background: var(--hl-y); } .hl-g { background: var(--hl-g); } .hl-b { background: var(--hl-b); }
.w.wj { color: var(--wj); }
.w[class*="hl-"] { color: var(--hl-ink, inherit); }
.hl-p { background: var(--hl-p); } .hl-o { background: var(--hl-o); } .hl-u { background: var(--hl-u); }
.has-note { vertical-align: super; margin-left: 2px; color: var(--accent); }
.has-note svg { width: 14px; height: 14px; }
.plink { display: inline-flex; align-items: center; gap: 3px; font-family: var(--sans); font-size: 12px; line-height: 1; font-weight: 600; color: var(--link); background: var(--chip); border-radius: 999px; padding: 4px 8px; margin-left: 4px; vertical-align: 2px; }
.plink svg { width: 12px; height: 12px; }
.chapter-nav { display: flex; justify-content: space-between; gap: 10px; margin: 26px 0 10px; font-family: var(--sans); }
.chapter-nav button { flex: 1; padding: 12px; border-radius: 999px; background: var(--chip); font-weight: 600; }
.book-ctx { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; font-family: var(--sans); background: var(--surface); border: var(--hair) solid var(--line); border-radius: 14px; padding: 11px 14px; margin: 4px 0 16px; font-size: 13px; color: var(--muted); }
.book-ctx b { color: var(--text); font-size: 15px; }
.book-ctx .more { color: var(--link); font-weight: 600; }
[data-font="sans"] .reader, [data-font="sans"] .vcard .txt, [data-font="sans"] .note-verse, [data-font="sans"] .vcard .ctx, [data-font="sans"] .lyric { font-family: var(--sans); letter-spacing: -.005em; }
[data-font="sans"] .reader { line-height: 1.72; }
[data-font="sans"] .chapter-title { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; }

/* Selection toolbar */
#seltool { position: absolute; left: 8px; right: 8px; bottom: calc(var(--tabh) + var(--tabgap) + 8px); background: var(--glass); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8);
  border: var(--hair) solid var(--line); border-radius: 20px; box-shadow: var(--shadow-float); padding: 10px; z-index: 25; animation: fadeIn .2s var(--ease); }
.sel-label { font-size: 13px; color: var(--muted); margin: 0 2px 8px; display: flex; justify-content: space-between; gap: 8px; }
.sel-label button { color: var(--text); font-weight: 600; }
.colors { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.dot { width: 30px; height: 30px; border-radius: 50%; border: var(--hair) solid var(--line); }
.dot.erase { display: grid; place-items: center; background: var(--chip); }
.dot.erase svg { width: 16px; height: 16px; }
.actions { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.act { flex: 1 0 auto; min-width: 58px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; padding: 6px 4px; border-radius: 12px; color: var(--text); }
.act:active { background: var(--chip); }
.act.ask { color: var(--ai); font-weight: 600; }

/* Bible audio mini player */
#player { position: absolute; left: 8px; right: 8px; bottom: calc(var(--tabh) + var(--tabgap) + 8px); background: var(--glass); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8);
  color: var(--text); border: var(--hair) solid var(--line); border-radius: 20px; padding: 8px; display: flex; align-items: center; gap: 6px; z-index: 24; box-shadow: var(--shadow-float); }
#player .pl-info { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#player .pl-sub { font-size: 11px; font-weight: 500; color: var(--muted); }
#player button { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--chip); }
#player button svg { width: 18px; height: 18px; }
#player #pl-pp { background: var(--text); color: var(--bg); }
#player .rate { width: auto; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.pl-track { height: 2px; background: var(--line); border-radius: 2px; margin-top: 5px; overflow: hidden; }
#pl-bar { height: 100%; width: 0; background: var(--text); }

/* ---------- Cards, articles, notes ---------- */
.vcard { background: var(--surface); border: var(--hair) solid var(--line); border-radius: 16px; padding: 13px 15px; margin: 8px 0; }
.vcard .ref { font-weight: 600; font-size: 14px; color: var(--link); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.vcard .ref button { color: var(--muted); font-size: 13px; font-weight: 600; }
.vcard .txt { font-family: var(--serif); font-size: 17px; line-height: 1.55; margin-top: 4px; }
.vcard .ctx { font-family: var(--serif); font-size: 15px; color: var(--muted); line-height: 1.5; margin-top: 6px; }
.vcard .ctx .cur { color: var(--text); }
.article { font-family: var(--serif); font-size: 18px; line-height: 1.65; }
.article h3 { font-family: var(--display); font-size: 18px; font-weight: 650; letter-spacing: -.015em; margin: 26px 0 6px; }
.article .page-h { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }
.article .view { background: var(--surface); border: var(--hair) solid var(--line); border-left: 2px solid var(--accent); border-radius: 12px; padding: 11px 15px; margin: 12px 0; }
.article .view b { font-family: var(--sans); font-size: 14px; font-weight: 600; display: block; margin-bottom: 3px; }
.cat { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); }
.note-body { font-family: var(--serif); font-size: 17px; }
.note-verse { font-family: var(--serif); font-size: 16px; line-height: 1.5; border-left: 2px solid var(--accent); padding: 4px 0 4px 12px; margin: 8px 0; }
.note-verse .r { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--link); display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.note-verse.dragging { opacity: .6; background: var(--chip); border-radius: 8px; }
.nv-text { margin-top: 4px; }
.handle { cursor: grab; touch-action: none; font-size: 20px; color: var(--muted); padding: 0 8px 0 0; user-select: none; }
.mv { width: 30px; height: 28px; border-radius: 8px; background: var(--chip); color: var(--muted); display: inline-grid; place-items: center; }
.mv svg { width: 15px; height: 15px; }
.mv:disabled { opacity: .3; }

/* ---------- Study tools ---------- */
.lex { background: var(--surface); border: var(--hair) solid var(--line); border-radius: 16px; padding: 13px 15px; margin: 8px 0; font-size: 15px; line-height: 1.5; }
.lex p { margin: 6px 0; }
.lex-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.lex .lemma { font-size: 28px; font-family: "SBL Greek", "Times New Roman", serif; line-height: 1.2; }
.lex .lemma[lang="he"] { font-family: "SBL Hebrew", "Times New Roman", serif; }
.lex .tr { font-style: italic; font-weight: 600; font-size: 18px; color: var(--accent); }
.lex .num { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--chip); padding: 2px 8px; border-radius: 999px; }
.lex .view { background: var(--chip); border-left: 2px solid var(--accent); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.lex .view b { display: block; font-size: 13px; }
.lex-slot { padding: 0 8px 4px; }
.lex-l { font-family: "SBL Greek", "SBL Hebrew", "Times New Roman", serif; font-size: 24px; min-width: 64px; text-align: center; color: var(--accent); }
#lx-q { margin-top: 10px; }
.info-grid { display: grid; gap: 8px; }
.info-grid div { background: var(--surface); border: var(--hair) solid var(--line); border-radius: 12px; padding: 9px 13px; font-size: 15px; }
.info-grid span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.timeline { margin-top: 8px; }
.era { border-left: 2px solid var(--era); padding: 2px 0 8px 14px; margin: 0 0 14px 6px; }
.era-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.era-h b { font-family: var(--display); font-weight: 650; font-size: 19px; letter-spacing: -.015em; color: var(--era); }
.era-h span { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.era-books { font-size: 13px; color: var(--muted); margin-bottom: 8px; line-height: 2; }
.ev { display: flex; gap: 10px; padding: 6px 0; position: relative; }
.dot-t { width: 10px; height: 10px; border-radius: 50%; background: var(--era); margin: 5px 0 0 -20px; flex: none; border: 2px solid var(--bg); }
.ev-date { font-size: 12px; color: var(--muted); font-weight: 600; }
.ev-t { font-weight: 600; margin: 1px 0 3px; }
#map { height: 52dvh; min-height: 300px; border-radius: 16px; overflow: hidden; background: var(--surface2); margin: 8px 0; border: var(--hair) solid var(--line); }
.pin span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font: 700 11px var(--sans); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.pop { font-family: var(--sans); font-size: 13px; line-height: 1.45; }
.pop .today { margin: 4px 0; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.pop .today svg { width: 14px; height: 14px; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.heb-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 6px; }
.heb-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 8px; border-radius: 14px; background: var(--surface); border: var(--hair) solid var(--line); color: var(--text); }
.heb-tile .hl { font-family: "SBL Hebrew", "Times New Roman", serif; font-size: 32px; line-height: 1.15; color: var(--accent); }
.heb-tile .hn { font-size: 12px; font-weight: 600; }
.heb-tile .hv { font-size: 11px; color: var(--muted); }
.heb-big { font-family: "SBL Hebrew", "Times New Roman", serif; font-size: 72px; line-height: 1.1; text-align: center; color: var(--accent); margin: 2px 0 6px; }
.heb-big .muted { font-size: 48px; }
.heb-inline { font-family: "SBL Hebrew", "Times New Roman", serif; font-size: 1.25em; }
.aram { background: var(--surface); border: var(--hair) solid var(--line); border-radius: 16px; padding: 13px 15px; margin: 8px 0; }
.aram-s { font-family: "Estrangelo Edessa", "Noto Sans Syriac", "Noto Sans Syriac Western", "Segoe UI Historic", serif; font-size: 28px; line-height: 1.5; color: var(--accent); text-align: right; }
.aram-t { font-style: italic; font-weight: 600; font-size: 18px; margin-top: 4px; }
.aram-m { font-size: 16px; margin-top: 2px; }
.aram-n { font-size: 14px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.aram-full { font-style: italic; line-height: 1.7; }

/* ---------- Create: verse art, drawing, scripture song ---------- */
.canvas-wrap { display: flex; justify-content: center; margin: 8px 0; }
.canvas-wrap canvas { width: 100%; max-width: 360px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.swatches { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.swatch { flex: none; width: 48px; height: 48px; border-radius: 12px; border: 2px solid transparent; }
.swatch.on { border-color: var(--text); }
.lyric { font-family: var(--serif); font-size: 24px; text-align: center; min-height: 3.2em; display: grid; place-items: center; line-height: 1.4; padding: 18px 8px; }
.lyric .now { color: var(--accent); }
.draw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.draw-thumb { aspect-ratio: 3/4; border-radius: 12px; overflow: hidden; border: var(--hair) solid var(--line); background: #fffdf8; }
.draw-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.draw-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.draw-tools .dot.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--text); }
#pad { display: block; border-radius: 12px; border: var(--hair) solid var(--line); touch-action: none; margin: 0 auto; }

/* ---------- Home ---------- */
/* Daybreak: a mountain scene behind the top (sunset in light mode, moonlit blue hour in dark), glassy verse card,
   a weekly "time with God" check-in, full-width Continue and Ask cards, then shortcut chips. */
#view.is-home { position: relative; padding-top: calc(var(--safe-t) + 14px); }
.home-scene { position: absolute; top: 0; left: 0; right: 0; height: calc(400px + var(--safe-t)); z-index: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 62%, transparent 96%); mask-image: linear-gradient(#000 62%, transparent 96%); }
.home-scene svg { width: 100%; height: 100%; display: block; stroke: none; }
#view.is-home > :not(.home-scene) { position: relative; z-index: 1; }
.home-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }
.home-h .hello { font-size: 14px; color: var(--muted); }
.home-title { font-family: var(--serif); font-size: 30px; font-weight: 600; letter-spacing: -.01em; line-height: 1.15; margin: 0 0 14px; }
.votd-l { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.home-hb { display: flex; gap: 6px; flex: none; }
.hb { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--hero-glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.hb svg { width: 20px; height: 20px; }
.hb:active { opacity: .6; }
.votd { border-radius: 28px; padding: 18px 20px 14px; color: var(--text); background: var(--hero-glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.votd-l { color: var(--votd-k); font-size: 13px; font-weight: 600; }
.votd-t { font-family: var(--serif); font-size: 20px; font-weight: 500; line-height: 1.38; margin: 10px 0 0; }
.votd-a { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.votd-r { color: var(--votd-k); font-weight: 600; font-size: 14px; white-space: nowrap; }
.votd-a .ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--votd-btn); }
.votd-a .ic svg { width: 18px; height: 18px; }
#votd-ask svg { color: var(--ai); }
.votd-a .rd { height: 40px; padding: 0 18px; border-radius: 20px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 15px; }
.votd-a button { transition: transform .14s var(--ease); }
.votd-a button:active { transform: scale(.94); }
.wk { background: var(--surface); border-radius: 24px; padding: 16px 18px; margin-top: 12px; display: flex; flex-direction: column; gap: 14px; }
.wk-top { display: flex; align-items: center; gap: 14px; }
.wk-ring { position: relative; width: 68px; height: 68px; flex: none; }
.wk-ring svg { width: 68px; height: 68px; }
.wk-track { stroke: var(--track); stroke-width: 8; }
.wk-fill { stroke: var(--accent); stroke-width: 8; transition: stroke-dasharray .4s var(--ease); }
.wk-ring span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; white-space: nowrap; }
.wk-t { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.wk-s { font-size: 14px; line-height: 1.4; color: var(--muted); margin-top: 2px; }
.wk-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.wk-d { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.wk-b { width: 32px; height: 32px; border-radius: 50%; background: var(--track); color: var(--muted); display: grid; place-items: center; font-weight: 700; font-size: 14px; transition: transform .14s var(--ease), background-color .2s; }
.wk-b:disabled { cursor: default; }
.wk-b.on { background: var(--accent); color: var(--done-ink); }
.wk-b.today:not(.on) { border: 2px dashed var(--accent); }
.wk-b.today:active { transform: scale(.9); }
.cont { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 18px; margin: 12px 0; text-align: left; background: var(--surface); border-radius: 22px; }
.cont .grow { flex: 1; min-width: 0; }
.cont .k { font-size: 13px; color: var(--muted); }
.cont .t { font-weight: 700; font-size: 18px; }
.cont-play { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--sand); color: var(--text); flex: none; }
.cont-play svg { width: 15px; height: 15px; fill: currentColor; }
.ask-card { background: var(--lilac); border-radius: 22px; padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 6px; }
.ask-f { height: 44px; border-radius: 22px; background: var(--surface); display: flex; align-items: center; gap: 10px; padding: 0 5px 0 14px; }
.ask-sp { display: grid; color: var(--lilac-ink); }
.ask-sp svg { width: 18px; height: 18px; }
.ask-f input { flex: 1; min-width: 0; border: 0; border-radius: 0; background: transparent; padding: 0; font-size: 16px; }
.ask-go { width: 34px; height: 34px; border-radius: 50%; background: var(--lilac-ink); color: #fff; display: grid; place-items: center; flex: none; }
.ask-go svg { width: 16px; height: 16px; stroke-width: 2.4; }
.ask-try { text-align: left; font-size: 13px; color: var(--muted); padding: 0 6px; }
.ask-try b { color: var(--text); font-weight: 600; }
.home-chips { display: flex; gap: 8px; overflow-x: auto; margin: 12px -16px 0; padding: 0 16px 4px; scrollbar-width: none; }
.home-chips::-webkit-scrollbar { display: none; }
.hchip { flex: none; height: 40px; padding: 0 14px; border-radius: 20px; background: var(--surface); font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.hchip svg { width: 16px; height: 16px; stroke: var(--ti, var(--muted)); stroke-width: 2.2; }
.hchip:active { transform: scale(.96); }
.cont-play:not(:has(svg)) { font-weight: 700; color: var(--accent); }
.cont-play svg[viewBox] { width: 18px; height: 18px; }

/* ---------- Study groups ---------- */
.grp-pass { background: var(--surface); border-radius: 22px; padding: 16px 18px; margin-top: 6px; }
.gp-k { font-size: 13px; font-weight: 600; color: var(--accent); }
.gp-t { font-family: var(--serif); font-size: 22px; font-weight: 600; margin-top: 2px; }
.gp-n { margin: 8px 0 0; line-height: 1.45; }
.gposts { display: flex; flex-direction: column; gap: 10px; }
.gpost { background: var(--surface); border-radius: 18px; padding: 10px 14px 12px; }
.gpost.mine { background: var(--chip); }
.gh { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.gh span { color: var(--muted); font-size: 13px; }
.gx { margin-left: auto; width: 30px; height: 30px; display: grid; place-items: center; color: var(--muted); }
.gx svg { width: 18px; height: 18px; }
.gb { margin-top: 4px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.gref { margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--link); }
.gcomp { margin-top: 16px; }

/* ---------- Reading plans ---------- */
.plan-hero { background: var(--surface); border-radius: 22px; padding: 18px; margin-top: 6px; }
.plan-hero .ph-k { font-size: 13px; font-weight: 600; color: var(--accent); }
.plan-hero h2 { font-family: var(--serif); font-size: 26px; margin: 4px 0 8px; }
.plan-hero h2 span { font-size: 17px; color: var(--muted); font-weight: 500; }
.plan-hero p { line-height: 1.5; margin: 0 0 10px; }
.ph-bar { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; margin: 4px 0 8px; }
.ph-bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.plan-day.on { background: var(--chip); }
.pd-n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--track); color: var(--muted); font-weight: 700; font-size: 13px; flex: none; }
.pd-n.ok { background: var(--accent); color: var(--done-ink); }
.home-sec { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 2px 14px; }
.home-sec h2 { margin: 0; font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.home-sec button { color: var(--link); font-weight: 650; font-size: 15px; }
.dock { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 6px; }
.dk { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.dk-i { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; background: var(--tb, var(--surface2)); }
.dk-i svg { width: 26px; height: 26px; color: var(--ti, var(--text)); stroke-width: 1.9; }
.dk-l { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.25; min-height: 2.5em; }
.home-foot { text-align: center; color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 15px; line-height: 1.5; margin: 38px 24px 0; }
.home-foot span { display: block; font-style: normal; font-family: var(--sans); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; margin-top: 6px; }
/* Older tile grid (kept for any page that still uses it) */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 2px 11px; border-radius: 18px; background: var(--surface); border: var(--hair) solid var(--line); font-size: 12px; font-weight: 500; text-align: center; line-height: 1.2; }
.tile .ti svg { width: 24px; height: 24px; color: var(--text); stroke-width: 1.5; }

/* ---------- Explore ---------- */
.grp-h { display: flex; align-items: center; gap: 10px; margin: 30px 2px 10px; }
.grp-h b { display: block; font-family: var(--display); font-size: 20px; font-weight: 650; letter-spacing: -.022em; color: var(--text); }
.grp-h span { display: block; font-size: 12.5px; color: var(--muted); }
.grp-dot { display: none !important; }
.tool-row .tr-i { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--tb, var(--surface2)); }
.tool-row .tr-i svg { width: 22px; height: 22px; color: var(--ti, var(--text)); stroke-width: 1.9; }
.tool-row .t { font-size: 16px; font-weight: 650; }
.tool-row .s { -webkit-line-clamp: 1; }
.ai-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-top: 6px; text-align: left; background: var(--surface); border: var(--hair) solid var(--line); border-radius: 18px; }
.ai-row .orb { width: 40px; height: 40px; border-radius: 50%; }
.ai-row b { font-size: 16px; font-weight: 650; }

/* ---------- AI (the only colorful thing) ---------- */
.orb { display: inline-grid; place-items: center; background: var(--iri); color: #fff; border-radius: 50%; flex: none; }
.orb svg { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }
.orb.big { width: 68px; height: 68px; box-shadow: 0 0 44px -8px rgba(178, 107, 255, .6); }
.orb.big svg { width: 32px; height: 32px; }
.ai-badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--ai); border: var(--hair) solid currentColor; border-radius: 6px; padding: 1px 5px; vertical-align: 2px; margin-left: 4px; }
.ai-btn { background: var(--chip); color: var(--text); }
.ai-btn svg { color: var(--ai); }
.ai-hero { text-align: center; padding: 30px 10px 8px; }
.ai-hero h2 { font-family: var(--display); font-size: 24px; font-weight: 650; letter-spacing: -.025em; margin: 18px 0 6px; }
.ai-hero p { margin: 0 auto; max-width: 340px; line-height: 1.5; font-size: 15px; }
.sugs { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; }
.sug { text-align: left; padding: 13px 16px; border-radius: 14px; background: var(--surface); border: var(--hair) solid var(--line); font-weight: 500; font-size: 15px; }
.sug::before { content: "✦"; color: var(--ai); margin-right: 9px; font-size: 13px; }
.code-card { margin: 10px 0 4px; }
.step { display: flex; gap: 12px; margin: 4px 0 14px; line-height: 1.45; font-size: 15px; }
.step b { width: 26px; height: 26px; border-radius: 50%; background: var(--chip); color: var(--text); display: grid; place-items: center; flex: none; font-size: 13px; }
.chat { padding-top: 6px; }
.msg { margin: 14px 0; display: flex; gap: 10px; animation: fadeIn .25s var(--ease); }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { max-width: 84%; background: var(--surface2); color: var(--text); padding: 10px 14px; border-radius: 20px 20px 6px 20px; font-size: 16px; line-height: 1.45; white-space: pre-wrap; }
.ai-av { width: 28px; height: 28px; border-radius: 50%; background: var(--iri); color: #fff; display: grid; place-items: center; flex: none; margin-top: 2px; }
.ai-av svg { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.ai-col { flex: 1; min-width: 0; }
.md { font-size: 16.5px; line-height: 1.6; overflow-wrap: anywhere; }
.md p { margin: 0 0 10px; }
.md h4 { font-size: 17px; margin: 16px 0 6px; }
.md ul, .md ol { margin: 4px 0 10px; padding-left: 22px; }
.md li { margin: 4px 0; }
.md blockquote { margin: 8px 0; padding: 6px 12px; border-left: 2px solid var(--accent); font-family: var(--serif); color: var(--muted); }
.md code { background: var(--chip); border-radius: 5px; padding: 0 4px; font-size: .9em; }
.md hr { border: 0; border-top: var(--hair) solid var(--line); margin: 14px 0; }
.md .vref { font-size: 14px; padding: 2px 7px; }
.caret { display: inline-block; width: 8px; height: 16px; background: var(--ai); border-radius: 2px; vertical-align: -2px; margin-left: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.typing { display: flex; align-items: center; gap: 5px; color: var(--muted); padding: 6px 0; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--ai); animation: bob 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
.typing em { font-size: 13px; margin-left: 6px; }
@keyframes bob { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-5px); opacity: 1; } }
.ai-note { font-size: 13px; color: var(--muted); font-style: italic; margin: 2px 0 6px; }
.msg-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.msg-acts button { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; color: var(--muted); padding: 6px 11px; border-radius: 999px; background: var(--chip); }
.msg-acts svg { width: 15px; height: 15px; }
#composer { position: absolute; left: 12px; right: 12px; bottom: calc(var(--tabh) + var(--tabgap) + 8px); z-index: 22; display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 16px;
  background: var(--glass); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8); border: var(--hair) solid var(--line); border-radius: 24px; box-shadow: var(--shadow-float); }
#composer textarea { flex: 1; min-height: 0; border: 0; background: transparent; padding: 9px 0; resize: none; line-height: 1.35; max-height: 140px; outline: none; font-size: 16px; }
#ai-go { width: 40px; height: 40px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center; flex: none; }
#ai-go svg { width: 20px; height: 20px; stroke-width: 2.2; }
#ai-go.stop svg { width: 14px; height: 14px; }
body[data-tab="ask"] #player, body[data-tab="ask"] #hymnbar { display: none !important; }

/* ---------- Worship: YouTube player, hymns ---------- */
.wseg { margin: 14px 0 12px; }
.yt-card { margin-top: 12px; border: var(--hair) solid var(--line); border-radius: 20px; overflow: hidden; background: var(--surface); animation: fadeIn .3s var(--ease); }
.yt-frame { position: relative; aspect-ratio: 16 / 9; min-height: 200px; background: #000; }
.yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.np-meta { padding: 14px 16px 4px; }
.np-meta .t { font-family: var(--display); font-weight: 650; font-size: 19px; letter-spacing: -.015em; }
.np-meta .s { color: var(--muted); font-size: 14px; margin-top: 2px; }
.np-ctrl { display: flex; justify-content: center; align-items: center; gap: 36px; padding: 8px 0 14px; }
.np-ctrl button { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--text); }
.np-ctrl button svg { width: 24px; height: 24px; fill: currentColor; stroke-width: 1; }
.np-ctrl .np-stop { background: var(--text); color: var(--bg); width: 54px; height: 54px; }
.np-ctrl .np-stop svg { width: 18px; height: 18px; }
.np-ctrl button:disabled { opacity: .25; }
.play-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: var(--hair) solid var(--line); color: var(--text); flex: none; }
.play-dot svg { width: 14px; height: 14px; }
.row.song.on .play-dot { background: var(--text); color: var(--bg); border-color: transparent; }
.row.song.on .t { font-weight: 650; }
#hymnbar { position: absolute; left: 12px; right: 12px; bottom: calc(var(--tabh) + var(--tabgap) + 8px); z-index: 23; display: flex; align-items: center; gap: 10px; padding: 8px;
  background: var(--glass); -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8); border: var(--hair) solid var(--line); border-radius: 20px; box-shadow: var(--shadow-float); animation: fadeIn .25s var(--ease); }
#hymnbar button { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; flex: none; }
#hymnbar button svg { width: 18px; height: 18px; }
#hb-pp { background: var(--text); color: var(--bg); }
#hb-next svg { fill: currentColor; }
.hb-info { flex: 1; min-width: 0; }
.hb-t { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-track { height: 2px; background: var(--line); border-radius: 2px; margin-top: 5px; overflow: hidden; }
#hb-bar { height: 100%; width: 0; background: var(--text); }
