/* =====================================================================
   Pause: a calm, modern reading app.
   Neutral surfaces, one sage accent, Inter for the interface and
   Newsreader for scripture. Frosted glass for the floating chrome.
   ===================================================================== */

@font-face { font-family: "Inter"; src: url("../fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }

:root {
  /* Night (default) */
  --bg: #0d0e0f;
  --surface: rgba(255, 255, 255, .05);
  --surface-2: rgba(255, 255, 255, .08);
  --surface-solid: #17191a;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .14);
  --ink: #f2f1ee;
  --ink-2: #a5a5a1;
  --ink-3: #6f706c;
  --scripture-ink: #e9e7e1;
  --accent: #9ccfb8;
  --accent-ink: #0c1a14;
  --accent-soft: rgba(156, 207, 184, .13);
  --accent-line: rgba(156, 207, 184, .35);
  --accent-glow: rgba(156, 207, 184, .40);
  --danger: #f09a8c;
  --hl: #3b3626;            /* solid sand, so neighbouring chunks never double up */
  --wj: #f0877c;            /* words of Jesus */
  --journal: rgba(255, 255, 255, .095);
  --journal-line: rgba(255, 255, 255, .15);
  --journal-ink: var(--ink-2);
  --mesh-1: rgba(110, 170, 145, .20);
  --mesh-2: rgba(200, 168, 118, .13);
  --mesh-3: rgba(120, 128, 140, .12);
  --glass: rgba(22, 24, 25, .66);
  --glass-edge: rgba(255, 255, 255, .12);
  --glass-shine: rgba(255, 255, 255, .22);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .28);
  --scripture-size: 19px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --radius: 24px;
  --tabbar-h: 66px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f3f0;
  --surface: rgba(255, 255, 255, .72);
  --surface-2: rgba(255, 255, 255, .92);
  --surface-solid: #ffffff;
  --line: rgba(20, 20, 20, .07);
  --line-strong: rgba(20, 20, 20, .13);
  --ink: #151515;
  --ink-2: #5d5d59;
  --ink-3: #93938e;
  --scripture-ink: #1d1d1b;
  --accent: #2f7a60;
  --accent-ink: #ffffff;
  --accent-soft: rgba(47, 122, 96, .1);
  --accent-line: rgba(47, 122, 96, .3);
  --accent-glow: rgba(47, 122, 96, .26);
  --danger: #b2483a;
  --hl: #f1e3bd;
  --wj: #b3261e;
  --journal: rgba(30, 32, 34, .055);
  --journal-line: rgba(30, 32, 34, .10);
  --journal-ink: var(--ink-2);
  --mesh-1: rgba(130, 190, 165, .30);
  --mesh-2: rgba(235, 205, 150, .30);
  --mesh-3: rgba(190, 196, 206, .30);
  --glass: rgba(250, 250, 248, .72);
  --glass-edge: rgba(255, 255, 255, .7);
  --glass-shine: rgba(255, 255, 255, .9);
  --shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 10px 28px rgba(20, 20, 20, .07);
  color-scheme: light;
}

/* ---------- base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--sans); letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 34px);
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: calc(env(safe-area-inset-top, 0px) + 100px); background: var(--surface-solid); padding: 8px 12px; border-radius: 10px; z-index: 50; }
.skip-link:focus { left: 12px; }

/* ---------- soft background mesh ---------- */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; transition: opacity 3s var(--ease); will-change: transform; }
.orb.o1 { width: 75vmax; height: 75vmax; left: -30vmax; top: -35vmax; background: radial-gradient(circle, var(--mesh-1), transparent 65%); animation: drift1 60s ease-in-out infinite alternate; }
.orb.o2 { width: 60vmax; height: 60vmax; right: -28vmax; top: 30vh; background: radial-gradient(circle, var(--mesh-2), transparent 65%); animation: drift2 75s ease-in-out infinite alternate; }
.orb.o3 { width: 55vmax; height: 55vmax; left: 0; bottom: -35vmax; background: radial-gradient(circle, var(--mesh-3), transparent 65%); animation: drift3 68s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(14vw, 16vh) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-16vw, 12vh) scale(.92); } }
@keyframes drift3 { to { transform: translate(10vw, -12vh) scale(1.12); } }
#motes, .rays, .aurora { display: none; }

/* ---------- glass material (header, tabs, panels, floating buttons) ---------- */
.topbar, .tabbar, .popover, .fab {
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  /* its own compositing layer, so scrolling text behind it doesn't shimmer */
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-shine), 0 8px 30px -8px rgba(0, 0, 0, .35);
}
:root[data-theme="light"] .topbar, :root[data-theme="light"] .tabbar, :root[data-theme="light"] .popover, :root[data-theme="light"] .fab {
  box-shadow: inset 0 1px 0 var(--glass-shine), 0 8px 28px -10px rgba(20, 20, 20, .18);
}

/* ---------- header ---------- */
.topbar {
  position: fixed; z-index: 20; top: calc(8px + env(safe-area-inset-top, 0px)); left: 0; right: 0;
  margin: 0 max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
  max-width: 720px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 10px; border-radius: 26px;
}
@media (min-width: 744px) { .topbar { margin-left: auto; margin-right: auto; } }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; overflow: hidden; text-decoration: none; color: inherit; }
.brand-mark { width: 34px; height: 34px; border-radius: 50%; flex: none; position: relative; background: var(--ink); }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; top: 10px; bottom: 10px; width: 3.5px; border-radius: 2px; background: var(--bg); }
.brand-mark::before { left: 12px; }
.brand-mark::after { right: 12px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-name { font-size: 20px; font-weight: 650; letter-spacing: -.03em; }
.brand-sub { font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; letter-spacing: 0; transition: opacity .4s var(--ease); }
/* on narrow phones the running countdown needs the room: the subtitle steps aside */
@media (max-width: 400px) { body.is-pausing .brand-sub { opacity: 0; } }
.topbar-actions { display: flex; align-items: center; gap: 6px; flex: none; }

.icon-btn {
  display: inline-grid; place-items: center; position: relative;
  min-width: 42px; height: 42px; padding: 0 9px; border-radius: 999px;
  border: 1px solid transparent; background: var(--surface-2); color: var(--ink); font-weight: 600;
  transition: background-color .3s var(--ease), color .3s var(--ease), transform .2s var(--ease), border-color .3s var(--ease);
}
.icon-btn:active { transform: scale(.94); }
.icon-btn.ghost { background: transparent; color: var(--ink-2); }
.icon-btn.ghost:hover { color: var(--ink); background: var(--surface); }
.icon-btn:disabled { opacity: .25; cursor: default; }
#music-btn[aria-expanded="true"], #timer-btn[aria-expanded="true"] { border-color: var(--accent-line); }
#music-btn.on { color: var(--accent); background: var(--accent-soft); }
#music-btn.on svg { display: none; }
.eq { display: none; gap: 3px; align-items: center; height: 16px; }
#music-btn.on .eq { display: flex; }
.eq i { width: 3px; height: 14px; border-radius: 2px; background: currentColor; animation: eq 2.4s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.8s; }
.eq i:nth-child(3) { animation-delay: -1.6s; }
@keyframes eq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

.timer-btn .mini-time { display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 15px; }
.timer-btn.active { padding: 0 14px; color: var(--accent); background: var(--accent-soft); }
.mini-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.timer-btn.held .mini-dot { opacity: .35; }

/* ---------- panels ---------- */
.popover {
  position: fixed; z-index: 30; top: calc(env(safe-area-inset-top, 0px) + 82px); right: max(12px, env(safe-area-inset-right, 0px));
  width: min(330px, calc(100vw - 24px)); padding: 12px; border-radius: 24px;
  display: flex; flex-direction: column; gap: 10px;
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  animation: pop-in .35s var(--ease);
  transform-origin: top right;
}
@media (min-width: 744px) { .popover { right: calc((100vw - 720px) / 2); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.genres { display: flex; flex-direction: column; gap: 6px; }
.genre {
  display: flex; flex-direction: column; gap: 1px; text-align: left; padding: 12px 14px 12px 42px; border-radius: 16px;
  border: 1px solid transparent; background: var(--surface); color: var(--ink); position: relative;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), transform .2s var(--ease);
}
.genre:active { transform: scale(.98); }
.genre::before {
  content: ""; position: absolute; left: 16px; top: 50%; margin-top: -6px;
  border-left: 10px solid var(--ink-3); border-top: 6px solid transparent; border-bottom: 6px solid transparent;
}
.genre strong { font-size: 15px; font-weight: 600; }
.genre span { font-size: 13px; color: var(--ink-2); }
.genre[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); }
.genre[aria-pressed="true"]::before { width: 10px; height: 10px; margin-top: -5px; border: 0; border-radius: 50%; background: var(--accent); }
.genre.loading::before { animation: pulse 1.2s ease-in-out infinite; }
.genre.loading span::after { content: " · loading…"; color: var(--accent); }
@keyframes pulse { 50% { opacity: .3; } }
.volume { display: flex; align-items: center; gap: 12px; padding: 6px 6px 2px; color: var(--ink-2); }
.volume svg { width: 20px; height: 20px; }
.volume input { flex: 1; min-width: 0; accent-color: var(--accent); }
.timer-pop { padding: 18px 14px 16px; }

/* ---------- layout ---------- */
/* --header-bottom is measured from the real header (js/app.js), so the gap is the same on every phone */
main { max-width: 720px; margin: 0 auto; padding: calc(var(--header-bottom, calc(env(safe-area-inset-top, 0px) + 68px)) + 10px) 16px 16px; outline: none; }
.view { animation: view-in .5s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }
.view-title { font-size: 32px; font-weight: 700; letter-spacing: -.035em; margin: 2px 4px 12px; }
.view-sub { margin: -8px 4px 18px; color: var(--ink-2); font-size: 15px; }

.glass, .stats, .setting-group, .month, .entry, .scripture, .finish {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
:root[data-theme="light"] .glass { box-shadow: var(--shadow); }

/* ---------- day card ---------- */
.day-card { padding: 18px 16px 20px; text-align: center; transition: border-color 1.5s var(--ease); }
.day-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.day-meta { min-width: 0; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: 0; }
#day-heading { margin: 2px 0 0; font-size: 40px; font-weight: 700; letter-spacing: -.045em; line-height: 1.05; }
#day-heading .of { font-size: .4em; font-weight: 500; color: var(--ink-3); letter-spacing: -.01em; }
.day-date { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; }
.day-title { margin: 12px 0 0; font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--ink-2); }
.passages { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.passages a {
  display: inline-block; padding: 9px 16px; border-radius: 999px; text-decoration: none; position: relative;
  background: var(--surface-2); color: var(--ink); font-size: 15px; font-weight: 600; letter-spacing: -.01em;
  transition: background-color .3s var(--ease), transform .2s var(--ease);
}
.passages a:active { transform: scale(.96); }
.day-note { margin: 14px auto 0; max-width: 46ch; padding: 10px 14px; background: var(--surface); border-radius: 14px; text-align: left; color: var(--ink-2); font-size: 15px; }
.link-btn { margin-top: 12px; border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 14px; }

.pray { margin: 22px 8px 0; text-align: center; font-family: var(--serif); font-style: italic; color: var(--ink-2); font-size: 18px; line-height: 1.55; }
.pray strong { display: block; font-family: var(--sans); font-style: normal; font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; position: relative;
  min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 15px; letter-spacing: -.01em;
  text-decoration: none; user-select: none;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease), transform .2s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn svg { width: 19px; height: 19px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.big { min-height: 52px; font-size: 16px; padding: 0 26px; }
.btn.check .tick { stroke-dasharray: 22; stroke-dashoffset: 0; }
.btn.check[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.btn.check.celebrate .tick { animation: draw .6s var(--ease) both; }
@keyframes draw { from { stroke-dashoffset: 22; } }
.btn.danger { color: var(--danger); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn, .chip, .genre, .passages a, .segmented button, .icon-btn { overflow: hidden; isolation: isolate; }
.ripple { position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; width: 10px; height: 10px; margin: -5px 0 0 -5px; background: currentColor; opacity: .14; transform: scale(0); animation: ripple .7s var(--ease) forwards; }
@keyframes ripple { to { transform: scale(var(--ripple-scale, 40)); opacity: 0; } }

/* ---------- the dial ---------- */
.pause-zone { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.dial { position: relative; width: min(220px, 62vw); aspect-ratio: 1; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.dial.active { cursor: default; }
.dial svg { width: 100%; height: 100%; overflow: visible; }
.dial::before { content: ""; position: absolute; inset: 16%; border-radius: 50%; background: radial-gradient(circle, var(--accent-soft), transparent 70%); opacity: 0; transition: opacity 1.5s var(--ease); }
.dial.active::before { opacity: 1; }
.tick { stroke: var(--ink-3); stroke-width: 1; opacity: .35; transition: stroke .3s, opacity .3s; }
.tick.major { stroke-width: 1.6; opacity: .6; }
.tick.lit { stroke: var(--accent); opacity: .9; }
.dial-track { fill: none; stroke: var(--surface-2); stroke-width: 8; }
.dial-arc { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 120px 120px; }
#dial-grad stop { stop-color: var(--accent); }
.dial-knob { fill: var(--ink); stroke: var(--bg); stroke-width: 3; transition: r .25s var(--ease), opacity .6s var(--ease); }
.dial.dragging .dial-knob { r: 14; }
.dial.active .dial-knob { opacity: 0; }
.dial-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.dial-value { font-size: clamp(40px, 12vw, 52px); font-weight: 600; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.dial-unit { font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.dial-hint { margin: 0; font-size: 13px; color: var(--ink-3); }
.pause-controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
#pause-toggle, #pause-end { min-width: 110px; }
.dial .bloom { position: absolute; inset: 20%; border-radius: 50%; pointer-events: none; border: 2px solid var(--accent); animation: bloom-out 1.6s var(--ease) forwards; }
@keyframes bloom-out { from { transform: scale(.7); opacity: .8; } to { transform: scale(1.8); opacity: 0; } }

/* ---------- a pause in progress: the background quietly comes alive ---------- */
body.is-pausing .orb { opacity: 1; }
body.is-pausing .day-card { border-color: var(--accent-line); }
body.is-pausing .scripture { border-color: color-mix(in srgb, var(--accent) 26%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent), 0 0 60px -22px var(--accent-glow); }
body.is-pausing .day-card { box-shadow: 0 0 0 1px var(--accent-soft), 0 0 70px -10px var(--accent-glow), 0 0 22px -8px var(--accent-glow); }
body.is-pausing .topbar, :root[data-theme="light"] body.is-pausing .topbar { box-shadow: inset 0 1px 0 var(--glass-shine), 0 0 48px -8px var(--accent-glow), 0 8px 30px -8px rgba(0, 0, 0, .35); }
body.is-pausing .tabbar, :root[data-theme="light"] body.is-pausing .tabbar { box-shadow: inset 0 1px 0 var(--glass-shine), 0 0 48px -10px var(--accent-glow), 0 10px 30px -10px rgba(0, 0, 0, .4); }
body.is-pausing .fab, :root[data-theme="light"] body.is-pausing .fab { box-shadow: inset 0 1px 0 var(--glass-shine), 0 0 26px -6px var(--accent-glow); }
body.is-pausing .timer-btn.active { box-shadow: 0 0 24px -2px var(--accent-glow); color: var(--accent); animation: timer-breathe 6s ease-in-out infinite; }
body.is-pausing .view-title, body.is-pausing .day-card h1 { text-shadow: 0 0 28px var(--accent-glow); }
@keyframes timer-breathe { 50% { box-shadow: 0 0 34px 2px var(--accent-glow); } }
.day-card, .topbar, .tabbar, .fab, .scripture { transition: border-color 1.5s var(--ease), box-shadow 1.5s var(--ease); }
/* a soft light that breathes slowly behind everything while the timer runs */
.halo { position: absolute; left: 50%; top: 38%; width: 120vmax; height: 120vmax; margin: -60vmax 0 0 -60vmax; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, color-mix(in srgb, var(--accent) 7%, transparent) 30%, transparent 62%);
  opacity: 0; transform: scale(.85); transition: opacity 3s var(--ease), transform 3s var(--ease); }
body.is-pausing .halo { opacity: 1; transform: scale(1); animation: halo-breathe 10s ease-in-out infinite; }
@keyframes halo-breathe { 0%, 100% { opacity: .75; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.06); } }

/* ---------- scripture ---------- */
.reading { display: flex; flex-direction: column; margin-top: 18px; }
.scripture {
  padding: 26px 22px 18px;
  font-family: var(--serif); font-size: var(--scripture-size); line-height: 1.75; color: var(--scripture-ink);
  font-optical-sizing: auto;
}
.scripture h2 { font-family: var(--sans); font-weight: 700; font-size: 24px; letter-spacing: -.03em; line-height: 1.2; margin: 0 0 4px; color: var(--ink); }
.scripture h3 { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--ink-3); margin: 1.8em 0 .6em; letter-spacing: 0; }
.scripture .passage > h2 + h3, .scripture .passage > h2 + p, .scripture .passage > h2 + .poetry { margin-top: 1em; }
.scripture .superscription { font-style: italic; color: var(--ink-2); font-size: .9em; margin: 0 0 .8em; }
.scripture .acrostic { font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--ink-3); margin: 1.4em 0 .4em; }
.scripture p { margin: 0 0 1em; text-wrap: pretty; }
.scripture .poetry { margin: 0 0 1.1em; }
.scripture .line { display: block; padding-left: 1.6em; text-indent: -1.6em; }
.scripture .line.cont { padding-left: 2.6em; }
.scripture sup { font-family: var(--sans); font-size: .55em; font-weight: 600; color: var(--ink-3); vertical-align: .6em; line-height: 0; margin-right: .2em; user-select: none; }
.scripture.no-verses sup { display: none; }
.scripture .dropcap { float: left; font-family: var(--sans); font-size: 2.6em; line-height: .95; margin: .08em .18em 0 0; color: var(--accent); font-weight: 300; letter-spacing: -.04em; }
.scripture .speaking { background: var(--accent-soft); border-radius: 10px; box-shadow: 0 0 0 6px var(--accent-soft); transition: background-color .5s var(--ease), box-shadow .5s var(--ease); }
.loading { font-family: var(--sans); font-size: 15px; color: var(--ink-2); text-align: center; padding: 30px 12px; animation: pulse 2s ease-in-out infinite; }
.error { font-family: var(--sans); font-size: 15px; color: var(--ink-2); text-align: center; padding: 26px 12px; }

/* words of Jesus in red */
.scripture .wj { color: var(--wj); }

/* tap a verse to highlight it: one soft rounded chunk per line */
.scripture .v { cursor: pointer; }
.scripture .v.hl:not(.line), .scripture .line.v.hl .lt {
  background-color: var(--hl); border-radius: .35em; padding: .05em .16em; margin: 0 -.16em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-color .4s var(--ease);
}
.scripture .v.hl-in:not(.line), .scripture .line.v.hl-in .lt { animation: hl-in .5s var(--ease); }
@keyframes hl-in { from { background-color: transparent; } }

/* ---------- reflect & respond (after each passage) ---------- */
.journal-card {
  margin: 10px 8px 30px; padding: 16px; border-radius: 20px;
  background: var(--journal); border: 1px solid var(--journal-line);
  display: flex; flex-direction: column; gap: 14px;
}
.journal-card:last-child { margin-bottom: 18px; }
.journal-for { margin: 0; font-size: 13px; font-weight: 600; color: var(--journal-ink); }
.journal-card .reflect textarea:focus { border-color: var(--journal-line); }
.reflect { display: flex; flex-direction: column; gap: 2px; }
.reflect-label { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.reflect-hint { font-size: 14px; color: var(--ink-2); }
.reflect textarea {
  margin-top: 8px; width: 100%; resize: vertical; min-height: 84px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  font-family: var(--serif); font-size: 17px; line-height: 1.55; color: var(--ink);
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.reflect textarea::placeholder { color: var(--ink-3); }
.reflect textarea:focus { outline: none; border-color: var(--accent-line); background: var(--surface-2); }
.journal-saved { margin: -6px 0 0; min-height: 1em; font-size: 12px; color: var(--ink-3); text-align: right; }
.finish { margin-top: 6px; padding: 18px; display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.finish .saved-note { display: none; }
.translation-note { margin: 0; text-align: center; font-size: 12px; color: var(--ink-3); }

/* ---------- journal tab ---------- */
.journal-month { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin: 18px 4px 8px; }
.journal-month:first-child { margin-top: 4px; }
/* condensed: small cards; long notes show three lines until tapped */
.entry { padding: 12px 14px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.entry-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; text-decoration: none; color: inherit; }
.entry-date { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.entry-day { font-size: 12px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.entry-body { display: flex; flex-direction: column; gap: 8px; }
.entry-passage { display: flex; flex-direction: column; gap: 3px; }
.entry-passage + .entry-passage { padding-top: 8px; border-top: 1px solid var(--line); }
.entry-reading { margin: 0; font-size: 12px; font-weight: 600; color: var(--accent); }
.entry-label { font-family: var(--sans); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-right: 6px; }
.entry-part { margin: 0; font-family: var(--serif); font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.entry.open .entry-part, .entry.open .entry-hl .hl-clip { -webkit-line-clamp: unset; line-clamp: none; display: block; }
.empty { text-align: center; color: var(--ink-2); padding: 28px 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty p { margin: 0; }

/* ---------- progress ---------- */
.stats { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 20px; }
.ring-wrap { position: relative; width: 118px; height: 118px; flex: none; }
.ring { width: 118px; height: 118px; transform: rotate(-90deg); }
.ring circle { stroke-width: 9; fill: none; }
.ring-track { stroke: var(--surface-2); }
.ring-fill { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: 326.73; transition: stroke-dashoffset 1.2s var(--ease); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ring-label strong { font-size: 28px; font-weight: 700; letter-spacing: -.04em; }
.ring-label span { font-size: 12px; color: var(--ink-2); }
.stat-list { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; flex: 1; min-width: 220px; }
.stat-list div { background: var(--surface); border-radius: 16px; padding: 12px; }
.stat-list dt { font-size: 12px; color: var(--ink-2); }
.stat-list dd { margin: 4px 0 0; font-size: 24px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-list dd small { font-size: .55em; color: var(--ink-3); font-weight: 500; }
.filter-row { display: flex; gap: 8px; margin: 18px 0 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 14px; position: relative; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: transparent; }
.month { margin-top: 10px; overflow: hidden; border-radius: 20px; }
.month summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; cursor: pointer; }
.month summary::-webkit-details-marker { display: none; }
.m-name { font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
.m-count { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.m-bar { flex: 1; max-width: 120px; height: 4px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.m-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width 1s var(--ease); }
.month summary::after { content: ""; width: 8px; height: 8px; border-right: 1.6px solid var(--ink-3); border-bottom: 1.6px solid var(--ink-3); transform: rotate(45deg); margin: -4px 4px 0 0; transition: transform .35s var(--ease); }
.month[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.day-list { list-style: none; margin: 0; padding: 0 8px 10px; }
.day-row { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-radius: 14px; }
.day-row.is-today { background: var(--accent-soft); }
.day-row.is-future .dr-reading { color: var(--ink-3); }
.day-row input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none; width: 26px; height: 26px; margin: 0; border-radius: 50%;
  border: 1.6px solid var(--ink-3); background: transparent; display: grid; place-content: center; cursor: pointer;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), transform .2s var(--ease);
}
.day-row input[type="checkbox"]:active { transform: scale(.88); }
.day-row input[type="checkbox"]::after { content: ""; width: 10px; height: 5px; border-left: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink); transform: rotate(-45deg) translate(1px, -1px) scale(.5); opacity: 0; transition: transform .3s var(--ease), opacity .2s; }
.day-row input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.day-row input[type="checkbox"]:checked::after { opacity: 1; transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.dr-link { flex: 1; min-width: 0; display: flex; flex-direction: column; text-decoration: none; color: inherit; padding: 4px 0; }
.dr-day { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dr-reading { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-tag { font-size: 12px; font-weight: 600; color: var(--accent); margin-left: 4px; }

/* ---------- settings ---------- */
.setting-group { padding: 4px 18px 14px; margin-bottom: 14px; }
.setting-group h2 { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 14px 0 2px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting.stack { flex-direction: column; align-items: stretch; gap: 8px; }
.setting-label { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.setting-label small { color: var(--ink-2); font-size: 13px; line-height: 1.4; }
.muted { color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper output { min-width: 2.2em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.segmented { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.segmented button { border: 0; background: transparent; padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); position: relative; transition: background-color .3s var(--ease), color .3s var(--ease); }
.segmented button[aria-pressed="true"] { background: var(--surface-solid); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.voice-status { margin: 6px 0 0; }
.voice-status button { margin-top: 8px; }
.switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 50px; height: 30px; margin: 0; border-radius: 999px; background: var(--surface-2); cursor: pointer; transition: background-color .3s var(--ease); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .3s var(--ease); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }
.confirm-row { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; z-index: 20; left: max(14px, env(safe-area-inset-left, 0px)); right: max(14px, env(safe-area-inset-right, 0px));
  bottom: calc(10px + env(safe-area-inset-bottom, 0px)); margin: 0 auto; max-width: 520px;
  display: flex; justify-content: center; gap: 2px; padding: 5px; border-radius: 30px;
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; border-radius: 24px;
  color: var(--ink-2); text-decoration: none; font-size: 11px; font-weight: 600; position: relative;
  transition: color .3s var(--ease), background-color .3s var(--ease);
}
.tabbar a[aria-current="page"] { color: var(--accent); background: var(--surface-2); }

/* ---------- floating buttons ---------- */
.fabs { position: fixed; z-index: 25; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px); display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.fab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 46px; height: 46px; padding: 0 16px; border-radius: 999px; color: var(--ink); font-weight: 600; font-size: 14px; position: relative; animation: pop-in .35s var(--ease); transition: opacity .5s var(--ease), transform .5s var(--ease), color .3s; }
#to-top { width: 46px; padding: 0; }
.fab svg { width: 20px; height: 20px; }
.fab.listen[aria-pressed="true"] { color: var(--accent); }
.fab.listen.offstage { opacity: 0; transform: translateY(10px) scale(.95); pointer-events: none; }
.waves { display: none; gap: 2px; align-items: center; height: 16px; }
.waves i { width: 2.5px; height: 14px; border-radius: 2px; background: currentColor; animation: eq 1.3s ease-in-out infinite; }
.waves i:nth-child(2) { animation-delay: -.3s; } .waves i:nth-child(3) { animation-delay: -.6s; } .waves i:nth-child(4) { animation-delay: -.9s; }
.fab.listen[aria-pressed="true"] .waves { display: flex; }
.fab.listen[aria-pressed="true"] .i-play { display: none; }
/* while reading: a ring around Listen. Bright = how far it has read; soft = how far the
   voice has made the speech ahead. When bright catches up with soft, it pauses to load. */
.fab .lring { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); overflow: visible; pointer-events: none; fill: none; stroke-linecap: butt; }
.fab .lring[hidden] { display: none; }
.lring path { stroke-width: 2.5; }
.lring .lring-track { stroke: color-mix(in srgb, var(--ink) 10%, transparent); }
.lring .lring-ready { stroke: color-mix(in srgb, var(--accent) 45%, transparent); stroke-dasharray: 0 1; transition: stroke-dasharray .6s var(--ease), stroke-dashoffset .25s linear; }
.lring.idle .lring-track { stroke: transparent; }
/* pre-made audio never has to wait: just the bright line for how far it has read */
.lring.premade .lring-ready { stroke: transparent; }
.lring .lring-read { stroke: var(--accent); stroke-dasharray: 0 1; transition: stroke-dasharray .25s linear; }

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 60; left: 16px; right: 16px; margin: 0 auto; width: fit-content; max-width: calc(100vw - 32px);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 86px);
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 18px;
  background: var(--surface-solid); color: var(--ink); border: 1px solid var(--line-strong);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .35); font-size: 15px; animation: pop-in .35s var(--ease);
}
.toast button { border: 0; border-radius: 12px; padding: 8px 14px; background: var(--accent-soft); color: var(--accent); font-weight: 700; white-space: nowrap; }

@media (max-width: 420px) {
  #day-heading { font-size: 36px; }
  .stats { flex-direction: column; }
  .stat-list { min-width: 0; width: 100%; }
  .scripture { padding: 22px 18px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Night <-> Dawn: a gentle crossfade ---------- */
/* Night <-> Dawn: a slow 3-second fade of every color in the app.
   The theme's colors are registered so the browser can blend them; everything drawn with
   them (text, panels, glass, glows, highlights, icons, the background light) fades together.
   The app stays usable while it fades. */
@property --bg { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --surface { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --surface-2 { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --surface-solid { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --line { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --line-strong { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --ink { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --ink-2 { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --ink-3 { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --scripture-ink { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --accent { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --accent-ink { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --accent-soft { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --accent-line { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --accent-glow { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --danger { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --hl { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --wj { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --journal { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --journal-line { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --journal-ink { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --mesh-1 { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --mesh-2 { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --mesh-3 { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --glass { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --glass-edge { syntax: '<color>'; inherits: true; initial-value: transparent; }
@property --glass-shine { syntax: '<color>'; inherits: true; initial-value: transparent; }
:root.theme-fading { transition: --bg 3s ease, --surface 3s ease, --surface-2 3s ease, --surface-solid 3s ease, --line 3s ease, --line-strong 3s ease, --ink 3s ease, --ink-2 3s ease, --ink-3 3s ease, --scripture-ink 3s ease, --accent 3s ease, --accent-ink 3s ease, --accent-soft 3s ease, --accent-line 3s ease, --accent-glow 3s ease, --danger 3s ease, --hl 3s ease, --wj 3s ease, --journal 3s ease, --journal-line 3s ease, --journal-ink 3s ease, --mesh-1 3s ease, --mesh-2 3s ease, --mesh-3 3s ease, --glass 3s ease, --glass-edge 3s ease, --glass-shine 3s ease; }
/* the few things that differ by more than a color (e.g. panel shadows in Dawn) */
.theme-fading *, .theme-fading *::before, .theme-fading *::after { transition: box-shadow 3s ease !important; }

/* ---------- about ---------- */
.tabbar a span { white-space: nowrap; }
.letter { padding: 24px 22px; font-family: var(--serif); font-size: 18px; line-height: 1.65; color: var(--scripture-ink); }
.letter p { margin: 0 0 1em; }
.letter-hello { font-family: var(--sans); font-weight: 600; font-size: 16px; color: var(--ink); }
.letter-key { font-family: var(--sans); font-weight: 700; font-size: 17px; line-height: 1.4; color: var(--ink); letter-spacing: -.01em; }
.letter-sign { font-family: var(--sans); font-weight: 600; font-size: 16px; color: var(--ink); margin-top: 1.4em !important; }
.letter-sign span { display: block; font-weight: 400; font-size: 14px; color: var(--ink-2); }
.letter-verse { margin: 1.6em 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); text-align: center; }
.letter-verse p { font-style: italic; color: var(--ink-2); font-size: 16px; margin: 0 0 .5em; }
.letter-verse cite { font-family: var(--sans); font-style: normal; font-size: 13px; color: var(--ink-3); }
.about-heading { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin: 28px 4px 12px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; gap: 14px; padding: 16px 18px; align-items: flex-start; }
.step-n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; }
.step h3 { margin: 3px 0 4px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.step p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.church { margin-top: 28px; padding: 24px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
/* the church logo, drawn in the text colour so it suits both Night and Dawn */
.church-logo { width: 68px; height: 68px; margin-bottom: 8px; background: var(--ink);
  -webkit-mask: url(../icons/wsfc-logo.png) center / contain no-repeat; mask: url(../icons/wsfc-logo.png) center / contain no-repeat; }
.church h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.church-address { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.church-links { justify-content: center; margin-top: 10px; }
.about-small { margin: 18px 6px 0; text-align: center; font-size: 13px; }

/* ---------- haptics: invisible native switches under your finger (see js/app.js) ---------- */
.hap-host { position: relative; }
.hap { position: absolute; inset: 0; z-index: 3; border-radius: inherit; cursor: inherit; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
.hap-input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
:disabled > .hap, [aria-disabled="true"] > .hap:not(#dial > .hap) { display: none; }
.scripture { position: relative; display: block; cursor: auto; }



/* loading: a small spinner instead of the sound bars until the sound actually starts */
.spin { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
#music-btn.loading .spin { display: block; }
#music-btn.loading .eq, #music-btn.loading svg { display: none !important; }
.fab.listen.loading .spin { display: block; }
.fab.listen.loading .waves, .fab.listen.loading .i-play { display: none !important; }

/* Long readings: skip drawing (and restyling) scripture that's off screen. Keeps theme
   fades and pause glows smooth, and scrolling light. */
.scripture { content-visibility: auto; contain-intrinsic-size: auto 1400px; }
/* while the theme fades, hold the drifting background light still (less work, no stutter) */
.theme-fading .orb, .theme-fading .halo { animation-play-state: paused !important; }

/* an invisible layer behind an open menu: tapping it just closes the menu */
.pop-backdrop { position: fixed; inset: 0; z-index: 19; background: transparent; -webkit-tap-highlight-color: transparent; }

/* "Pause interrupted": a lighter grey card that stands out from the page behind it */
.toast.banner { background: #4a4d50; color: #f4f4f2; border-color: rgba(255, 255, 255, .22); box-shadow: 0 16px 44px rgba(0, 0, 0, .5); }
.toast.banner button { background: rgba(255, 255, 255, .16); color: #fff; }
.toast.banner button:first-of-type { background: var(--accent); color: var(--accent-ink); }
:root[data-theme="light"] .toast.banner { background: #e3e3e0; color: #1a1a1a; border-color: rgba(0, 0, 0, .12); box-shadow: 0 16px 40px rgba(0, 0, 0, .18); }
:root[data-theme="light"] .toast.banner button { background: rgba(0, 0, 0, .07); color: #1a1a1a; }
:root[data-theme="light"] .toast.banner button:first-of-type { background: var(--accent); color: var(--accent-ink); }

/* Progress: closed months are small tiles, three across; the open month spans the row */
#months { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
#months .month { margin-top: 0; border-radius: 16px; }
#months .month[open] { grid-column: 1 / -1; border-radius: 20px; }
#months .month:not([open]) summary { flex-wrap: wrap; gap: 6px 8px; padding: 11px 12px 12px; }
#months .month:not([open]) .m-name { flex: 1 0 100%; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#months .month:not([open]) .m-count { font-size: 12px; }
#months .month:not([open]) .m-bar { order: 3; flex: 1 0 100%; max-width: none; height: 3px; }
#months .month:not([open]) summary::after { display: none; }

/* ---------- accent colors (Settings > Accent color) ---------- */
:root[data-accent="ocean"] {
  --accent: #8fc3e8; --accent-ink: #0f1114;
  --accent-soft: rgba(143, 195, 232, .13); --accent-line: rgba(143, 195, 232, .35); --accent-glow: rgba(143, 195, 232, .40);
  --mesh-1: rgba(143, 195, 232, .18);
}
:root[data-theme="light"][data-accent="ocean"] {
  --accent: #276e9e; --accent-ink: #ffffff;
  --accent-soft: rgba(39, 110, 158, .1); --accent-line: rgba(39, 110, 158, .3); --accent-glow: rgba(39, 110, 158, .26);
  --mesh-1: rgba(143, 195, 232, .28);
}
:root[data-accent="lavender"] {
  --accent: #bba9ea; --accent-ink: #0f1114;
  --accent-soft: rgba(187, 169, 234, .13); --accent-line: rgba(187, 169, 234, .35); --accent-glow: rgba(187, 169, 234, .40);
  --mesh-1: rgba(187, 169, 234, .18);
}
:root[data-theme="light"][data-accent="lavender"] {
  --accent: #6650a8; --accent-ink: #ffffff;
  --accent-soft: rgba(102, 80, 168, .1); --accent-line: rgba(102, 80, 168, .3); --accent-glow: rgba(102, 80, 168, .26);
  --mesh-1: rgba(187, 169, 234, .28);
}
:root[data-accent="rose"] {
  --accent: #eaa5b6; --accent-ink: #0f1114;
  --accent-soft: rgba(234, 165, 182, .13); --accent-line: rgba(234, 165, 182, .35); --accent-glow: rgba(234, 165, 182, .40);
  --mesh-1: rgba(234, 165, 182, .18);
}
:root[data-theme="light"][data-accent="rose"] {
  --accent: #a8435c; --accent-ink: #ffffff;
  --accent-soft: rgba(168, 67, 92, .1); --accent-line: rgba(168, 67, 92, .3); --accent-glow: rgba(168, 67, 92, .26);
  --mesh-1: rgba(234, 165, 182, .28);
}
:root[data-accent="amber"] {
  --accent: #e7c27f; --accent-ink: #0f1114;
  --accent-soft: rgba(231, 194, 127, .13); --accent-line: rgba(231, 194, 127, .35); --accent-glow: rgba(231, 194, 127, .40);
  --mesh-1: rgba(231, 194, 127, .18);
}
:root[data-theme="light"][data-accent="amber"] {
  --accent: #94631a; --accent-ink: #ffffff;
  --accent-soft: rgba(148, 99, 26, .1); --accent-line: rgba(148, 99, 26, .3); --accent-glow: rgba(148, 99, 26, .26);
  --mesh-1: rgba(231, 194, 127, .28);
}

.swatches { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; padding: 0; background: var(--sw); box-shadow: inset 0 0 0 2px var(--surface-solid); position: relative; }
.swatch[aria-pressed="true"] { border-color: var(--sw); box-shadow: inset 0 0 0 3px var(--surface-solid); }
.swatch:active { transform: scale(.92); }

/* Journal: highlighted verses under each day */
.entry-hl ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.entry-hl li { padding: 5px 10px; border-radius: 9px; background: var(--hl); font-family: var(--serif); font-size: 14px; line-height: 1.4; color: var(--scripture-ink); }
.entry-hl .hl-clip { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.entry-hl .hl-ref { font-family: var(--sans); font-size: 11px; font-weight: 650; color: var(--ink-2); margin-right: 6px; }

/* ---------- passage summaries ---------- */
.scripture h2 { padding-right: 104px; }
.sum-btn {
  position: absolute; top: 22px; right: 16px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 11px 0 9px;
  border-radius: 999px; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent);
  font: 600 13px/1 var(--sans); letter-spacing: 0;
}
.sum-btn svg { width: 15px; height: 15px; stroke-width: 1.6; }
.sum-btn:active { transform: scale(.95); }
.sum-modal {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px;
  background: rgba(0, 0, 0, .28); -webkit-backdrop-filter: blur(12px) saturate(120%); backdrop-filter: blur(12px) saturate(120%);
  opacity: 0; transition: opacity .25s var(--ease);
}
.sum-modal.open { opacity: 1; }
:root[data-theme="light"] .sum-modal { background: rgba(240, 239, 235, .35); }
.sum-sheet {
  width: min(460px, 100%); max-height: 80vh; overflow: auto; padding: 18px 20px 20px; border-radius: 26px;
  background: var(--surface-solid); border: 1px solid var(--line-strong); box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .5);
  transform: translateY(12px) scale(.98); transition: transform .3s var(--ease);
}
.sum-modal.open .sum-sheet { transform: none; }
.sum-head { display: flex; align-items: center; justify-content: space-between; margin: -4px -8px 0 0; }
.sum-kicker { margin: 0; font-size: 13px; font-weight: 650; color: var(--accent); }
.sum-sheet h2 { margin: 2px 0 12px; font-size: 24px; letter-spacing: -.02em; }
#sum-text { margin: 0; font-family: var(--serif); font-size: 18px; line-height: 1.6; color: var(--scripture-ink); }
#sum-text.loading { color: var(--ink-3); animation: pulse 1.6s ease-in-out infinite; }
.sum-note { margin: 14px 0 0; font-size: 12px; color: var(--ink-3); }

/* ---------- opening screen ---------- */
.intro {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg); color: var(--ink); overflow: hidden; cursor: pointer;
  transition: opacity .8s var(--ease), transform .9s var(--ease), filter .8s var(--ease);
}
.intro.leaving { opacity: 0; transform: scale(1.06); filter: blur(6px); pointer-events: none; }
.intro-light {
  position: absolute; width: 140vmax; height: 140vmax; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, color-mix(in srgb, var(--accent) 8%, transparent) 28%, transparent 60%);
  opacity: 0; transform: scale(.6); animation: intro-light 3.2s var(--ease) forwards;
}
@keyframes intro-light { 40% { opacity: 1; } to { opacity: .8; transform: scale(1); } }
.intro-mark { position: relative; width: 96px; height: 96px; opacity: 0; transform: scale(.7); animation: intro-mark 1s var(--ease) .15s forwards; }
.intro-mark svg { width: 96px; height: 96px; display: block; }
.intro-mark circle { fill: var(--ink); stroke: none; }
.intro-mark rect { fill: var(--bg); stroke: none; transform-origin: 48px 48px; animation: intro-bars 2.4s ease-in-out .9s; }
@keyframes intro-mark { to { opacity: 1; transform: none; } }
@keyframes intro-bars { 50% { transform: scaleY(.82); } }
.intro-name {
  position: relative; margin: 12px 0 0; font-size: 40px; line-height: 1; font-weight: 650; letter-spacing: .28em; text-indent: .28em;
  opacity: 0; animation: intro-name 1.2s var(--ease) .55s forwards;
}
@keyframes intro-name { to { opacity: 1; letter-spacing: -.03em; text-indent: 0; } }
.intro-words { position: relative; display: flex; gap: 10px; margin: 8px 0 0; font-size: 16px; color: var(--ink-2); }
.intro-words span, .intro-words i { opacity: 0; transform: translateY(8px); animation: intro-word .8s var(--ease) forwards; font-style: normal; }
.intro-words i { color: var(--accent); }
.intro-words :nth-child(1) { animation-delay: 1.15s; }
.intro-words :nth-child(2) { animation-delay: 1.4s; }
.intro-words :nth-child(3) { animation-delay: 1.55s; }
.intro-words :nth-child(4) { animation-delay: 1.8s; }
.intro-words :nth-child(5) { animation-delay: 1.95s; }
@keyframes intro-word { to { opacity: 1; transform: none; } }
/* the app eases in behind it as it lifts away */
body.intro-open main, body.intro-open .topbar, body.intro-open .tabbar, body.intro-open .fabs { opacity: 0; transform: scale(.985); }
main, .fabs { transition: opacity .9s var(--ease) .1s, transform 1s var(--ease) .1s; }
.topbar, .tabbar { transition: opacity .9s var(--ease) .1s, transform 1s var(--ease) .1s, border-color 1.5s var(--ease), box-shadow 1.5s var(--ease); }
@media (prefers-reduced-motion: reduce) {
  .intro *, .intro { animation-duration: .01ms !important; animation-delay: 0s !important; }
  .intro-mark, .intro-name, .intro-words span, .intro-words i { opacity: 1 !important; transform: none !important; letter-spacing: -.03em; text-indent: 0; }
}
