:root {
  --bg: #faf7f0; --surface: #fffdf8; --ink: #2d2520; --muted: #6a6058; --line: #e6d9c2;
  --accent: #62182c; --accent-2: #8a2a44; --accent-ink: #fff; --gold: #b98b3e; --gold-soft: #f3e6c8;
  --hero: linear-gradient(160deg, #40121d, #62182c 60%, #7b2a3c);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 16px; --shadow: 0 1px 2px #2d25200f, 0 8px 24px #2d252012;
  --tabbar-h: 64px;
  color-scheme: light;
}
body[data-tradition="orthodox"] { --accent: #1d2f5e; --accent-2: #2c4a8a; --gold: #b8913a; --gold-soft: #efe5c9; --hero: linear-gradient(160deg, #111b3a, #1d2f5e 60%, #2c4a8a); }
body[data-tradition="protestant"] { --accent: #1f4d45; --accent-2: #2b6b5f; --gold: #a88443; --gold-soft: #eee5cf; --hero: linear-gradient(160deg, #12302b, #1f4d45 60%, #2b6b5f); }
body[data-tradition="both"] { --accent: #4a1d3f; --accent-2: #62182c; --hero: linear-gradient(120deg, #62182c 0%, #40121d 45%, #111b3a 55%, #1d2f5e 100%); }

/* Night: a candlelit church. Soot-dark walls, walnut panels, gold leaf and parchment. */
html[data-theme="night"] { --bg: #0e0a07; --surface: #1a130e; --surface-2: #231a12; --ink: #f1e4cb; --muted: #b5a283; --line: #35281c; --gold: #d8ac5a; --gold-soft: #2a2015; --shadow: 0 1px 2px #0009, 0 14px 34px #0008; --ink-dark: #0e0a07; --glow: #ffae42; color-scheme: dark; }
html[data-theme="night"] body[data-tradition] { --gold: #d8ac5a; --gold-soft: #2a2015; --ink-dark: #0e0a07; }
html[data-theme="night"] body[data-tradition="orthodox"] { --accent: #7d9be0; --accent-2: #a9bff0; --accent-ink: #0b1230; }
html[data-theme="night"] body[data-tradition="protestant"] { --accent: #73b8a6; --accent-2: #9fd4c6; --accent-ink: #0b221d; }
html[data-theme="night"] body[data-tradition="catholic"], html[data-theme="night"] body[data-tradition="none"] { --accent: #d9788f; --accent-2: #edaabb; --accent-ink: #2a0910; }
html[data-theme="night"] body[data-tradition="both"] { --accent: #cf93bd; --accent-2: #e6b9d9; --accent-ink: #2a0a24; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); font: 1rem/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 50; padding: .6rem .9rem; border-radius: 8px; background: var(--surface); color: var(--accent); }
.skip:focus { top: 1rem; }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 46px; padding: .6rem 1.1rem; border: 1px solid transparent; border-radius: 999px; font-weight: 650; cursor: pointer; text-decoration: none; transition: transform .12s ease, background .15s ease; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--gold); }
.btn-danger { background: transparent; border-color: #b4484a; color: #b4484a; }
.btn-wide { width: 100%; }
.text-link { display: inline-block; margin-top: .8rem; color: var(--accent); font-weight: 650; text-decoration: none; }
a:hover .text-link, .text-link:hover { text-decoration: underline; }

/* ---------- Onboarding ---------- */
.onboarding { min-height: 100dvh; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); background: var(--hero); transition: background .4s ease; }
.ob-card { width: min(560px, 100%); padding: clamp(1.25rem, 5vw, 2.25rem); border-radius: 24px; background: var(--surface); box-shadow: 0 30px 80px #0000004d; }
.ob-top { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.4rem; }
.back { min-height: 40px; padding: 0 .4rem; border: 0; background: none; color: var(--muted); font-weight: 600; cursor: pointer; }
.progress { flex: 1; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress-bar { display: block; height: 100%; background: var(--gold); border-radius: inherit; transition: width .3s ease; }
.p-1 { width: 17%; } .p-2 { width: 33%; } .p-3 { width: 50%; } .p-4 { width: 67%; } .p-5 { width: 83%; } .p-6 { width: 100%; }
.ob-body h1 { font-size: clamp(1.6rem, 6vw, 2.1rem); }
.help { margin: .5rem 0 1.3rem; color: var(--muted); }
.options { display: grid; gap: .65rem; }
.option { display: flex; align-items: center; gap: .9rem; width: 100%; min-height: 60px; padding: .85rem 1rem; text-align: left; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.option:hover { border-color: var(--gold); }
.option.is-selected { border-color: var(--accent); background: var(--gold-soft); }
.option-mark { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--gold-soft); color: var(--accent); font-size: 1.35rem; }
.option-text { flex: 1; display: grid; gap: .1rem; }
.option-text small { color: var(--muted); font-size: .88rem; line-height: 1.35; }
.option-check { flex: none; width: 22px; height: 22px; border: 2px solid var(--line); border-radius: 50%; }
.option.is-selected .option-check { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 45%, transparent 50%); }
.welcome, .ready { text-align: center; }
.welcome-logo { width: 120px; height: 120px; margin: 0 auto 1rem; border-radius: 28px; box-shadow: var(--shadow); }
.kicker, .card-kicker { color: var(--gold); font-size: .74rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.welcome h1 { margin: .4rem 0 .8rem; font-size: clamp(1.7rem, 6.5vw, 2.3rem); }
.lede { margin-bottom: 1.5rem; color: var(--muted); font-size: 1.06rem; }
.fine { margin-top: .9rem; color: var(--muted); font-size: .85rem; }
.name-form { display: grid; gap: 1.2rem; }
.field { display: grid; gap: .4rem; margin: 0; padding: 0; border: 0; }
.field > span, .field legend { padding: 0; font-weight: 650; font-size: .92rem; }
.field input, .field select { width: 100%; min-height: 48px; padding: .6rem .85rem; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); }
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .4rem; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; min-height: 42px; padding: .4rem .95rem; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; }
.chip input:checked + span { border-color: var(--accent); background: var(--gold-soft); font-weight: 650; }
.chip input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.ready-mark { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 1rem; border-radius: 50%; background: var(--hero); color: #f3d998; font-size: 2rem; }
.ready h1 { margin-bottom: .3rem; }
.summary { display: grid; gap: .1rem; margin-bottom: 1.4rem; text-align: left; }
.summary div { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.summary dt { color: var(--muted); }
.summary dd { font-weight: 650; text-align: right; }

/* ---------- App shell ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: calc(env(safe-area-inset-top) + .55rem) 16px .55rem; background: var(--hero); color: #fff; }
.brand { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; font: 600 1.08rem var(--serif); }
.site-link { color: #f1dfb6; font-size: .8rem; text-decoration: none; }
.site-link:hover { text-decoration: underline; }
.dash { width: min(1080px, 100%); margin: 0 auto; padding: 0 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px); }
.hello { position: relative; margin: 0 -16px 1rem; padding: 1.4rem 16px 2.2rem; background: var(--hero); color: #fff; }
.hello .date { color: #f1dfb6; font-size: .82rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.hello h1 { margin: .25rem 0 .35rem; font-size: clamp(1.7rem, 6vw, 2.4rem); }
.salutation { color: #f4ebde; font-family: var(--serif); font-style: italic; font-size: 1.05rem; }
.badge { display: inline-flex; align-items: center; gap: .35rem; margin-top: .9rem; padding: .3rem .75rem; border: 1px solid #ffffff40; border-radius: 999px; font-size: .82rem; font-weight: 650; }
.grid { display: grid; gap: 14px; margin-top: -1.6rem; position: relative; }
.card { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--gold); }
.card-pad { padding: 1.15rem 1.2rem 1.25rem; }
.card h2 { margin: .3rem 0 .35rem; font-size: 1.4rem; }
.card h3 { font-family: var(--sans); font-size: .82rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.twin { display: grid; gap: 14px; }

/* Season */
.season { padding: 1.15rem 1.2rem 1.2rem; border-top: 5px solid var(--sc, var(--accent)); }
.season-violet { --sc: #6b3fa0; } .season-rose { --sc: #d98aa6; } .season-white { --sc: #d6b25e; } .season-green { --sc: #3e7d4f; } .season-red { --sc: #b3261e; } .season-east { --sc: var(--gold); }
.season-detail { color: var(--muted); font-weight: 500; font-size: .85em; }
.season-color { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .92rem; }
.swatch { width: 14px; height: 14px; border-radius: 50%; background: var(--sc); border: 1px solid #0002; }
.fast-note { margin-top: .5rem; padding: .55rem .75rem; border-radius: 10px; background: var(--gold-soft); font-size: .92rem; }

/* Prayer */
.prayer { margin-top: .8rem; padding-left: .9rem; border-left: 3px solid var(--gold); }
.prayer h3 { margin-bottom: .2rem; }
.prayer p { font-family: var(--serif); font-size: 1.08rem; line-height: 1.55; }
.card-pad > .muted { margin-top: .9rem; font-size: .92rem; }
.rosary img { width: 100%; height: 170px; object-fit: cover; }
.mysteries { padding-left: 1.3rem; display: grid; gap: .2rem; margin: .2rem 0 .4rem; }

/* Path */
.path-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.ring { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; border: 3px solid var(--gold); font-weight: 750; font-size: .9rem; color: var(--accent); }
.steps { list-style: none; padding: 0; margin-top: .6rem; display: grid; }
.steps li { display: flex; align-items: center; gap: .75rem; min-height: 50px; border-bottom: 1px solid var(--line); }
.steps li:last-child { border-bottom: 0; }
.steps a { flex: 1; padding: .55rem 0; text-decoration: none; font-weight: 550; }
.steps a:hover { color: var(--accent); text-decoration: underline; }
.steps .is-done a { color: var(--muted); text-decoration: line-through; }
.tick { flex: none; position: relative; width: 28px; height: 28px; border: 2px solid var(--line); border-radius: 50%; background: var(--surface); cursor: pointer; }
.tick::after { content: ''; position: absolute; left: 8px; top: 3px; width: 7px; height: 13px; border: solid var(--accent-ink); border-width: 0 3px 3px 0; transform: rotate(45deg); opacity: 0; }
.is-done .tick { background: var(--accent); border-color: var(--accent); }
.is-done .tick::after { opacity: 1; }
.is-next .tick { border-color: var(--gold); }
.next-tag { flex: none; padding: .15rem .55rem; border-radius: 999px; background: var(--gold-soft); color: var(--accent); font-size: .75rem; font-weight: 750; }

/* Fact */
.fact { border-left: 5px solid var(--gold); }
.fact-catholic .card-kicker { color: #9a2b45; }
.fact-orthodox .card-kicker { color: #2c4a8a; }
html[data-theme="night"] .fact-catholic .card-kicker { color: #e79bb0; }
html[data-theme="night"] .fact-orthodox .card-kicker { color: #a9bff0; }
.fact-text { margin: .55rem 0 .9rem; font-family: var(--serif); font-size: 1.15rem; line-height: 1.5; }
.fact-nav { display: flex; gap: .5rem; flex-wrap: wrap; }
.fact-nav .btn { min-height: 40px; padding: .4rem .9rem; font-size: .9rem; }

/* Saint */
.saint { display: grid; grid-template-columns: 112px 1fr; }
.saint img { width: 112px; height: 100%; min-height: 150px; object-fit: cover; }
.saint-feast { margin-top: .3rem; font-size: .88rem; font-weight: 600; }

/* Feasts */
.feast-cols { display: grid; gap: 1rem; margin-top: .4rem; }
.feasts ul { list-style: none; padding: 0; }
.feasts li { display: grid; gap: .05rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.feasts li:last-child { border-bottom: 0; }
.feast-name { font-weight: 650; }
.feast-date { color: var(--muted); font-size: .88rem; }
.feasts li.is-today .feast-date { color: var(--accent); font-weight: 700; }

/* Install, Bible, Library */
.install { display: grid; gap: .9rem; background: var(--gold-soft); border-color: var(--gold); }
.install-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.share-icon { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sub { margin-top: 1.1rem; }
.plain { list-style: none; padding: 0; }
.plain li { display: grid; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.tiles .tile img { width: 100%; height: 150px; object-fit: cover; }
.settings { display: grid; gap: 1rem; }
.settings h2 { margin-bottom: 0; }

/* Tab bar */
.tabbar { position: fixed; left: 50%; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); width: min(560px, 100%); transform: translateX(-50%); padding: 0 8px env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 92%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.tab { display: grid; justify-items: center; align-content: center; gap: .15rem; min-height: var(--tabbar-h); color: var(--muted); text-decoration: none; font-size: .74rem; font-weight: 650; }
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.is-active { color: var(--accent); }

@media (min-width: 720px) {
  .tabbar { bottom: 16px; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding-bottom: 0; }
  .hello { margin-inline: 0; padding: 2rem 2rem 3rem; border-radius: 0 0 28px 28px; }
  .grid { grid-template-columns: 1fr 1fr; align-items: start; padding-inline: 1rem; }
  .grid > .install, .grid > .twin { grid-column: 1 / -1; }
  .twin { grid-template-columns: 1fr 1fr; }
  .feast-cols { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .install { grid-template-columns: 1fr auto; align-items: center; }
}
@media (min-width: 1024px) { .grid:not(.tiles) { grid-template-columns: repeat(3, 1fr); } .tiles { grid-template-columns: repeat(4, 1fr); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Bible ---------- */
.loading { padding: 3rem 0; text-align: center; color: var(--muted); }
.hello .date a { color: inherit; text-decoration: none; }
.bible-wrap { display: grid; gap: 14px; margin-top: -1.6rem; position: relative; }
.bible-chips { display: flex; gap: .5rem; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; }
.bible-chips::-webkit-scrollbar { display: none; }
.bchip { flex: none; display: grid; gap: 0; min-width: 104px; padding: .55rem .8rem; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); text-decoration: none; box-shadow: var(--shadow); }
.bchip strong { color: var(--accent); font-size: .95rem; }
.bchip span { color: var(--muted); font-size: .76rem; line-height: 1.25; }
.bchip.is-active { border-color: var(--accent); background: var(--gold-soft); }
.resume { border-left: 5px solid var(--gold); }
.books h2 { font-size: 1.15rem; margin-bottom: .7rem; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .45rem; }
.book { display: grid; align-content: center; min-height: 48px; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; font-weight: 600; font-size: .93rem; line-height: 1.2; }
.book small { color: var(--muted); font-weight: 500; font-size: .74rem; }
.book:hover { border-color: var(--accent); }
.book.is-deutero { border-color: var(--gold); background: var(--gold-soft); }
.chapter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: .45rem; }
.chap { display: grid; place-items: center; height: 52px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; font-weight: 650; }
.chap:hover { border-color: var(--accent); background: var(--gold-soft); }
.bible-credit { padding: .4rem .2rem 0; color: var(--muted); font-size: .8rem; }
.bible-credit a { color: inherit; }
.deutero-key { padding: 0 .35rem; border-radius: 4px; background: var(--gold-soft); border: 1px solid var(--gold); }

.reader { width: min(720px, 100%); margin: 0 auto; padding-top: .4rem; }
.reader-head { position: sticky; top: calc(env(safe-area-inset-top) + 48px); z-index: 10; display: flex; align-items: center; gap: .6rem; margin: 0 -16px; padding: .6rem 16px; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.reader-back { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-size: 1.6rem; text-decoration: none; color: var(--accent); }
.reader-title { flex: 1; min-width: 0; }
.reader-title h1 { font-size: 1.35rem; }
.reader-title p { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-tools { display: flex; gap: .3rem; }
.tool { width: 42px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 700; cursor: pointer; }
.compare-bar { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem 1rem; margin: 1rem 0 .4rem; }
.compare-bar label { display: grid; gap: .2rem; flex: 1 1 150px; font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.compare-bar select { min-height: 42px; padding: .4rem .6rem; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--ink); font-size: .92rem; }
.compare-note { margin: .4rem 0; padding: .6rem .8rem; border-radius: 10px; background: var(--gold-soft); font-size: .88rem; }
.scripture { padding: .6rem 0 1rem; font-family: var(--serif); }
.verse { margin: 0 0 .55rem; line-height: 1.7; }
.verse sup { margin-right: .3rem; color: var(--gold); font-family: var(--sans); font-size: .66em; font-weight: 750; }
.scripture.is-compare .verse { padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.parallel { display: block; margin-top: .35rem; padding-left: .75rem; border-left: 3px solid var(--gold); color: var(--muted); font-size: .92em; }
.parallel b { font-family: var(--sans); font-size: .68em; letter-spacing: .06em; color: var(--accent); }
.leftover { margin-top: 1rem; }
.fs-0 .scripture { font-size: .95rem; } .fs-1 .scripture { font-size: 1.05rem; } .fs-2 .scripture { font-size: 1.15rem; } .fs-3 .scripture { font-size: 1.3rem; } .fs-4 .scripture { font-size: 1.48rem; }
.chapter-nav { display: flex; justify-content: space-between; gap: .6rem; margin: .5rem 0 1rem; }
.chapter-nav .btn { flex: 0 1 auto; }
@media (min-width: 720px) { .bible-wrap { padding-inline: 1rem; } }

/* =========================================================
   App v2: photo-led, immersive, animated
   ========================================================= */
:root { --topbar-h: 56px; --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1); --ink-dark: #1a0d12; }
body[data-tradition="orthodox"] { --ink-dark: #0b1128; }
body[data-tradition="protestant"] { --ink-dark: #0b1f1b; }
body:not(.is-onboarding) { background: var(--bg); }

/* Top bar floats over the photo, then frosts as you scroll */
.topbar { position: fixed; inset: 0 0 auto; z-index: 40; height: calc(var(--topbar-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; background: transparent; color: #fff; transition: background .3s ease, box-shadow .3s ease, color .3s ease; view-transition-name: topbar; }
.is-scrolled .topbar { background: color-mix(in srgb, var(--ink-dark) 82%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); box-shadow: 0 1px 0 #ffffff14; }
.is-immersive .topbar, .is-immersive .tabbar { display: none; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(145deg, #e9cf8f, #b98b3e); color: #2a1410; font: 700 1rem var(--serif); text-decoration: none; box-shadow: 0 0 0 2px #ffffff40, 0 4px 14px #0005; transition: transform .2s var(--spring); }
.avatar:active { transform: scale(.92); }
.wordmark { justify-self: center; display: inline-flex; align-items: center; gap: .45rem; font: 600 .95rem var(--serif); letter-spacing: .14em; text-transform: uppercase; text-shadow: 0 1px 8px #0008; }
.streak-pill { justify-self: end; display: inline-flex; align-items: center; gap: .15rem; height: 30px; padding: 0 .6rem; border-radius: 999px; background: #ffffff1f; border: 1px solid #ffffff33; color: #fff; text-decoration: none; font-weight: 700; font-size: .82rem; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

.view { display: block; min-height: 100dvh; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 34px); outline: none; }
.view > .hello { margin: 0 0 1rem; padding: calc(var(--topbar-h) + env(safe-area-inset-top) + 1rem) 16px 2.6rem; }
.view > .bible-wrap, .view > .reader { padding-inline: 16px; }
.view-bible .reader { padding-top: calc(var(--topbar-h) + env(safe-area-inset-top)); }
.reader-head { top: calc(var(--topbar-h) + env(safe-area-inset-top)); margin: 0 -16px; }

/* ---------- Today hero ---------- */
.hero { position: relative; isolation: isolate; min-height: min(86svh, 720px); display: flex; overflow: hidden; color: #fff; background: var(--ink-dark); }
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; animation: kenburns 28s ease-in-out infinite alternate; transform-origin: 60% 40%; }
.hero-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, #000c 0%, #0008 20%, #0000 42%, color-mix(in srgb, var(--ink-dark) 70%, transparent) 70%, var(--ink-dark) 100%); }
.hero-inner { width: min(760px, 100%); margin: 0 auto; padding: calc(var(--topbar-h) + env(safe-area-inset-top) + 1.2rem) 20px 1.4rem; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; }
.hero-date { color: #f1dfb6; font-size: .74rem; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.hero-greet { margin: .3rem 0 .2rem; font-size: clamp(1.9rem, 7.5vw, 2.8rem); text-shadow: 0 2px 18px #0007; }
.hero-salute { font: italic 1.05rem var(--serif); color: #f6ecdc; text-shadow: 0 1px 10px #0009; }
.verse { margin-top: auto; }
.chip-glass { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .75rem; border-radius: 999px; background: #ffffff1c; border: 1px solid #ffffff30; font-size: .7rem; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; color: #f3dfae; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.verse-text { margin: 1rem 0 .7rem; font: 500 clamp(1.55rem, 6.4vw, 2.3rem)/1.28 var(--serif); letter-spacing: -.005em; text-wrap: pretty; text-shadow: 0 2px 20px #0008; }
.verse-text i { font-style: italic; }
.verse-ref { font: italic 1rem var(--serif); color: #f1dfb6; }
.verse-ref span { margin-left: .35rem; padding: .05rem .4rem; border-radius: 6px; background: #ffffff1f; font: 700 .66rem var(--sans); letter-spacing: .08em; font-style: normal; vertical-align: .15em; }
.verse.is-ready .verse-text, .verse.is-ready .verse-ref, .verse.is-ready .verse-actions { animation: rise .7s var(--ease) both; }
.verse.is-ready .verse-ref { animation-delay: .12s; }
.verse.is-ready .verse-actions { animation-delay: .22s; }
.verse-actions { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-top: 1.1rem; }
.glass-btn { display: inline-flex; align-items: center; gap: .45rem; height: 42px; padding: 0 1rem; border-radius: 999px; background: #ffffff24; border: 1px solid #ffffff38; color: #fff; text-decoration: none; font-weight: 650; font-size: .9rem; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: transform .2s var(--spring), background .2s; }
.glass-btn svg, .glass-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.glass-btn:active, .glass-icon:active { transform: scale(.94); }
.verse-icons { display: flex; gap: .5rem; }
.glass-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid #ffffff38; background: #ffffff1c; color: #fff; cursor: pointer; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: transform .2s var(--spring), background .2s; }
.glass-icon.is-on { background: #e3b35a; border-color: #e3b35a; color: #2a1410; }
.glass-icon.is-on svg { fill: currentColor; }
.glass-icon.pop { animation: pop .45s var(--spring); }
.photo-credit { align-self: flex-end; font-size: .68rem; color: #ffffffa6; letter-spacing: .02em; }
.sk-glass { height: 1.6rem; margin-top: .8rem; border-radius: 8px; background: linear-gradient(90deg, #ffffff14, #ffffff2e, #ffffff14); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }

/* Quick actions overlap the hero */
.quick { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: min(760px, calc(100% - 32px)); margin: -1.6rem auto 1.2rem; padding: 12px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 18px 40px #00000026; animation: rise .6s var(--ease) .1s both; }
.quick-btn { display: grid; justify-items: center; gap: .35rem; padding: .3rem 0; color: var(--ink); text-decoration: none; font-size: .76rem; font-weight: 650; -webkit-tap-highlight-color: transparent; }
.quick-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 17px; background: linear-gradient(150deg, var(--accent-2), var(--accent)); color: #f6deaa; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 40%, transparent); transition: transform .25s var(--spring); }
.quick-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.quick-btn:hover .quick-icon { transform: translateY(-2px); }
.quick-btn:active .quick-icon { transform: scale(.9); }

.view-today .grid { width: min(1080px, 100%); margin: 0 auto; padding-inline: 16px; }
.view .grid { margin-top: 0; }

/* Cards come in one after another */
.grid > *, .stack > *, .pgrid > *, .saint-grid > *, .hscroll > * { animation: rise .55s var(--ease) both; }
.grid > :nth-child(2), .stack > :nth-child(2), .pgrid > :nth-child(2), .saint-grid > :nth-child(2) { animation-delay: .05s; }
.grid > :nth-child(3), .stack > :nth-child(3), .pgrid > :nth-child(3), .saint-grid > :nth-child(3) { animation-delay: .1s; }
.grid > :nth-child(4), .stack > :nth-child(4), .pgrid > :nth-child(4), .saint-grid > :nth-child(4) { animation-delay: .15s; }
.grid > :nth-child(5), .stack > :nth-child(5), .pgrid > :nth-child(5), .saint-grid > :nth-child(5) { animation-delay: .2s; }
.grid > :nth-child(n+6), .stack > :nth-child(n+6), .pgrid > :nth-child(n+6), .saint-grid > :nth-child(n+6) { animation-delay: .25s; }
.slot:empty { display: none; }
.slot.is-ready > * { animation: rise .5s var(--ease) both; }
.card { transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s; }
a.card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px #2d25201f; }
a.card:active { transform: scale(.985); }

/* Media card (today's prayer) */
.media-card { display: grid; grid-template-columns: 1fr; }
.media-img { display: block; height: 170px; overflow: hidden; }
.media-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.media-card:hover .media-img img { transform: scale(1.05); }
.media-card .card-pad { display: grid; gap: .3rem; }
.media-title { font: 600 1.45rem/1.15 var(--serif); }
.media-list { font-size: .9rem; }
.pill-btn { justify-self: start; margin-top: .5rem; padding: .5rem 1rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .88rem; }

/* ---------- Page heroes (Pray, Saints, Explore, Profile) ---------- */
.page-hero { position: relative; isolation: isolate; display: flex; align-items: flex-end; min-height: 300px; padding: calc(var(--topbar-h) + env(safe-area-inset-top) + 1rem) 20px 1.6rem; color: #fff; overflow: hidden; background: var(--ink-dark); }
.page-hero.is-short { min-height: 230px; }
.page-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; animation: kenburns 30s ease-in-out infinite alternate; }
.page-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, #0008, #0000 35%, color-mix(in srgb, var(--ink-dark) 88%, transparent)); }
.page-hero-copy { width: min(1080px, 100%); margin: 0 auto; animation: rise .6s var(--ease) both; }
.page-hero h1 { font-size: clamp(2.2rem, 9vw, 3.2rem); text-shadow: 0 2px 16px #0007; }
.eyebrow-sm { color: #f1dfb6; font-size: .72rem; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.hero-sub { margin-top: .3rem; color: #f3e9da; font: italic 1rem var(--serif); }
.stack { display: grid; gap: 14px; width: min(1080px, 100%); margin: 0 auto; padding: 1.2rem 16px 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: .8rem 0 0; font: 750 .78rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.see-all { color: var(--accent); text-decoration: none; letter-spacing: .04em; text-transform: none; font-size: .85rem; }

/* Photo cards */
.pgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pcard, .feature-card, .chapter-card { position: relative; isolation: isolate; display: flex; align-items: flex-end; min-height: 170px; overflow: hidden; border-radius: 18px; color: #fff; text-decoration: none; background: var(--ink-dark); box-shadow: var(--shadow); transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.pcard-wide { grid-column: span 2; min-height: 190px; }
.feature-card { min-height: 230px; }
.pcard > img, .feature-card > img, .chapter-card > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .9s var(--ease); }
.pcard:hover > img, .feature-card:hover > img, .chapter-card:hover > img { transform: scale(1.06); }
.pcard:active, .feature-card:active, .chapter-card:active { transform: scale(.97); }
.pcard-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, #0000 30%, #000c); }
.pcard-copy { display: grid; gap: .1rem; padding: 1rem; }
.pcard-copy small { color: #f1dfb6; font-size: .7rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.pcard-copy strong { font: 600 1.22rem/1.15 var(--serif); }
.pcard-copy em { color: #ffffffc4; font-size: .84rem; font-style: normal; }
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: min(62%, 240px); gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.chapter-card { min-height: 260px; scroll-snap-align: start; }
.list-card { display: grid; padding: .3rem 0; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 54px; padding: .5rem 1.1rem; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; transition: background .2s; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--gold-soft); }
.list-row > span:last-child { color: var(--gold); font-size: 1.3rem; }
.credit-row { justify-content: flex-start; }
.credit-row img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.credit-row span { display: grid; gap: .15rem; }
.credit-row strong { color: var(--ink); font-family: var(--serif, Georgia, serif); font-size: 1rem; font-weight: 600; line-height: 1.25; }
.credit-row small { color: var(--muted); font-size: .8rem; font-weight: 500; line-height: 1.35; }

/* Suggested session */
.suggest { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 1rem; padding: .7rem; }
.suggest img { width: 96px; height: 96px; border-radius: 14px; object-fit: cover; }
.suggest-copy { display: grid; gap: .1rem; }
.suggest-copy small { color: var(--gold); font-size: .72rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.suggest-copy strong { font: 600 1.3rem var(--serif); }
.suggest-copy em { color: var(--muted); font-style: normal; font-size: .88rem; }
.play-dot { display: grid; place-items: center; width: 46px; height: 46px; margin-right: .4rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: .9rem; animation: breathe 2.6s ease-in-out infinite; }

/* ---------- Guided prayer player ---------- */
.player, .rope-page { position: relative; isolation: isolate; min-height: 100dvh; display: grid; grid-template-rows: auto auto 1fr auto; color: #fff; background: var(--ink-dark); overflow: hidden; }
.player-bg { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; filter: blur(2px) saturate(1.1); transform: scale(1.06); animation: kenburns 40s ease-in-out infinite alternate; }
.player-shade { position: fixed; inset: 0; z-index: -1; background: radial-gradient(120% 80% at 50% 40%, color-mix(in srgb, var(--accent) 55%, #0000), #0000 70%), linear-gradient(180deg, #000a, color-mix(in srgb, var(--ink-dark) 82%, transparent) 30%, var(--ink-dark)); }
.player-top { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: .5rem; padding: calc(env(safe-area-inset-top) + .7rem) 14px .4rem; }
.player-name { display: grid; text-align: center; }
.player-name strong { font: 600 .82rem var(--sans); letter-spacing: .18em; text-transform: uppercase; color: #f1dfb6; }
.player-name span { font-size: .78rem; color: #ffffffa8; }
.player-count { justify-self: end; font-size: .78rem; color: #ffffffa8; font-variant-numeric: tabular-nums; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid #ffffff30; background: #ffffff14; color: #fff; text-decoration: none; font-size: 1.3rem; cursor: pointer; transition: transform .2s var(--spring), background .2s; }
.icon-btn:hover { background: #ffffff26; }
.icon-btn:active { transform: scale(.9); }
.pbar { height: 3px; margin: .3rem 20px 0; border-radius: 3px; background: #ffffff22; overflow: hidden; }
.pbar span { display: block; height: 100%; background: linear-gradient(90deg, #e9cf8f, #b98b3e); transform-origin: left; transform: scaleX(0); transition: transform .5s var(--ease); }
.beads { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; padding: .5rem 18px 0; }
.bead-group { display: flex; gap: 4px; }
.beads i { width: 8px; height: 8px; border-radius: 50%; background: #ffffff2b; transition: background .3s, transform .3s var(--spring), box-shadow .3s; }
.beads i.done { background: #d8b46a; }
.beads i.now { background: #fff; transform: scale(1.5); box-shadow: 0 0 12px #f3d998; }
.player-stage { display: grid; align-items: center; padding: 1rem 24px; outline: none; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.step { width: min(640px, 100%); margin: 0 auto; text-align: center; }
.step.in { animation: stepIn .55s var(--ease) both; }
.step.in-right { animation: stepRight .45s var(--ease) both; }
.step.in-left { animation: stepLeft .45s var(--ease) both; }
.step-label { margin-bottom: 1rem; font: italic .95rem var(--serif); color: #e7c983; letter-spacing: .02em; }
.step-title { margin-bottom: 1rem; font-size: clamp(1.6rem, 6vw, 2.2rem); }
.step-text { font: 400 clamp(1.4rem, 5.6vw, 2rem)/1.5 var(--serif); text-wrap: pretty; text-shadow: 0 2px 16px #0008; }
.step-text.is-scripture { font-size: clamp(1.15rem, 4.4vw, 1.5rem); text-align: left; }
.step-text.is-silence { font-style: italic; color: #ffffffd0; }
.step-note { margin-top: 1.1rem; font-size: .82rem; letter-spacing: .06em; color: #ffffffa8; }
.player-controls { display: flex; align-items: center; justify-content: center; gap: 1.6rem; padding: .8rem 0 calc(env(safe-area-inset-bottom) + 1.4rem); transition: opacity .3s, transform .3s; }
.player-controls.is-hidden { opacity: 0; transform: translateY(20px); pointer-events: none; }
.play-btn { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; border: 0; background: linear-gradient(150deg, #f0d79c, #c39243); color: #2a1410; font-size: 1.2rem; cursor: pointer; box-shadow: 0 10px 30px #c3924366; transition: transform .25s var(--spring); }
.play-btn:active { transform: scale(.92); }
.play-btn .i-pause, .play-btn.is-on .i-play { display: none; }
.play-btn.is-on .i-pause { display: inline; }
.play-btn.is-on { animation: breathe 2.4s ease-in-out infinite; }
.amen-mark svg { width: 76px; height: 76px; margin: 0 auto 1rem; fill: none; stroke: #e9cf8f; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.amen-mark circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw 1s var(--ease) forwards; }
.amen-mark path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .6s var(--ease) .6s forwards; }
.finish .btn { margin-top: 1.4rem; }
.btn-light { background: #fff; color: #2a1410; }
.btn-sm { min-height: 36px; padding: .3rem .8rem; font-size: .85rem; }

/* ---------- Prayer rope ---------- */
.rope-page { grid-template-rows: auto auto 1fr auto auto; text-align: center; }
.rope-prayer { width: min(520px, 100%); margin: .6rem auto 0; padding: 0 24px; font: italic clamp(1.2rem, 5vw, 1.6rem)/1.4 var(--serif); color: #f6ecdc; }
.rope-wrap { position: relative; display: grid; place-items: center; width: min(86vw, 380px); aspect-ratio: 1; margin: 1rem auto; }
.rope-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rope-cord { fill: none; stroke: #ffffff26; stroke-width: 1.5; }
.knot { fill: #ffffff33; transition: fill .3s ease, transform .35s var(--spring); transform-box: fill-box; transform-origin: center; }
.knot.on { fill: #e3c27a; transform: scale(1.25); }
.rope-cross { stroke: #e3c27a; stroke-width: 2.4; stroke-linecap: round; fill: none; }
.rope-tap { position: relative; display: grid; place-content: center; width: 62%; aspect-ratio: 1; border-radius: 50%; border: 1px solid #ffffff2e; background: radial-gradient(circle at 35% 30%, #ffffff2a, #ffffff0a 60%); color: #fff; cursor: pointer; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform .2s var(--spring); -webkit-tap-highlight-color: transparent; }
.rope-tap:active { transform: scale(.95); }
.rope-tap.pulse::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #e3c27a; animation: ripple .7s ease-out; }
.rope-num { font: 600 clamp(3.2rem, 15vw, 4.6rem)/1 var(--serif); font-variant-numeric: tabular-nums; }
.rope-tap small { color: #ffffffa8; letter-spacing: .1em; }
.is-complete .rope-tap { box-shadow: 0 0 0 0 #e3c27a88; animation: glow 1.6s ease-out 2; }
.rope-sizes { justify-content: center; }
.chip-btn { min-height: 38px; padding: .3rem 1rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; cursor: pointer; transition: background .2s, color .2s, transform .2s var(--spring); }
.chip-btn:active { transform: scale(.94); }
.chip-btn.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.rope-page .chip-btn { border-color: #ffffff30; background: #ffffff12; color: #fff; }
.rope-page .chip-btn.is-on { background: #e3c27a; color: #2a1410; border-color: #e3c27a; }
.rope-hint { padding: .8rem 24px calc(env(safe-area-inset-bottom) + 1.2rem); color: #ffffff8c; font-size: .82rem; }

/* ---------- Saints ---------- */
.search-row { position: relative; }
.search { width: 100%; height: 50px; padding: 0 1rem 0 2.8rem; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.search-icon { position: absolute; left: 1rem; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search:focus { outline: none; border-color: var(--accent); }
.filter-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.saint-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.saint-card { position: relative; isolation: isolate; display: flex; align-items: flex-end; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 16px; color: #fff; text-decoration: none; background: var(--ink-dark); box-shadow: var(--shadow); transition: transform .3s var(--ease); }
.saint-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .8s var(--ease); }
.saint-card::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, #0000 45%, #000d); }
.saint-card:hover img { transform: scale(1.06); }
.saint-card:active { transform: scale(.97); }
.saint-copy { display: grid; padding: .8rem; }
.saint-copy strong { font: 600 1rem/1.2 var(--serif); }
.saint-copy small { color: #ffffffb8; font-size: .74rem; }
.saint-ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3rem; color: #ffffff40; z-index: -2; }
.saint-feature .saint-card { aspect-ratio: auto; min-height: 220px; margin-top: .6rem; }

/* ---------- In-app articles ---------- */
.r-article { padding-bottom: 1rem; }
.r-hero { position: relative; isolation: isolate; display: flex; align-items: flex-end; min-height: 340px; padding: calc(var(--topbar-h) + env(safe-area-inset-top) + 1rem) 20px 1.6rem; color: #fff; background: var(--hero); overflow: hidden; }
.r-hero.no-photo { min-height: 240px; }
.r-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; animation: settle 1.2s var(--ease) both; }
.r-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, #0007, #0000 35%, #000c); }
.r-hero-copy { width: min(720px, 100%); margin: 0 auto; animation: rise .6s var(--ease) .1s both; }
.r-hero h1 { font-size: clamp(1.9rem, 7.5vw, 2.8rem); text-shadow: 0 2px 16px #0008; text-wrap: balance; }
.r-back { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: .9rem; border-radius: 50%; border: 1px solid #ffffff40; background: #ffffff1f; color: #fff; font-size: 1.5rem; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.practice { display: flex; align-items: center; gap: .9rem; width: min(720px, calc(100% - 32px)); margin: -1.4rem auto 0; position: relative; z-index: 2; text-decoration: none; border-color: var(--gold); animation: rise .6s var(--ease) .2s both; }
.practice > span:nth-child(2) { flex: 1; display: grid; }
.practice small { color: var(--muted); }
.practice-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent); color: #f3d998; }
.r-body { width: min(720px, 100%); margin: 0 auto; padding: 1.4rem 20px 0; font: 1.08rem/1.75 var(--serif); animation: rise .6s var(--ease) .15s both; }
.r-body > * + * { margin-top: 1rem; }
.r-body h2 { margin-top: 2.2rem; font-size: 1.65rem; }
.r-body h3 { margin-top: 1.6rem; font: 600 1.25rem var(--serif); color: var(--accent); text-transform: none; letter-spacing: 0; }
.r-body h4 { margin-top: 1.2rem; font: 700 .9rem var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.r-body p, .r-body li { text-wrap: pretty; }
.r-body ul, .r-body ol { padding-left: 1.3rem; }
.r-body li + li { margin-top: .4rem; }
.r-body a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.r-body img { width: 100%; height: auto; border-radius: 14px; margin-block: .6rem; box-shadow: var(--shadow); }
.r-body figure { margin: 1.4rem 0; }
.r-body figcaption { font: .78rem/1.45 var(--sans); color: var(--muted); }
.r-body blockquote { margin: 1.4rem 0; padding: .4rem 0 .4rem 1.1rem; border-left: 3px solid var(--gold); font-style: italic; font-size: 1.15rem; }
.r-body table { width: 100%; border-collapse: collapse; font: .88rem/1.45 var(--sans); display: block; overflow-x: auto; }
.r-body th, .r-body td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.r-body th { background: var(--gold-soft); }
.r-body details { padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.r-body summary { cursor: pointer; font-weight: 700; font-family: var(--sans); }
.r-body dl { display: grid; gap: .3rem; }
.r-body dt { font: 700 .8rem var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.r-eyebrow { font: 750 .74rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.r-box { padding: 1rem 1.1rem; border-radius: 16px; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); font-size: .98rem; }
.r-box > :first-child { margin-top: 0; }
.anchor-link { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.anchor-target { display: block; scroll-margin-top: calc(var(--topbar-h) + 20px); }
.r-body h2, .r-body h3 { scroll-margin-top: calc(var(--topbar-h) + 20px); }
.empty-state { display: grid; justify-items: center; gap: 1rem; padding: calc(var(--topbar-h) + 4rem) 24px 2rem; text-align: center; }

/* Skeletons and toast */
.article-skeleton { padding-bottom: 2rem; }
.sk { border-radius: 10px; background: linear-gradient(90deg, var(--line), color-mix(in srgb, var(--line) 40%, var(--surface)), var(--line)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.sk-hero { height: 340px; border-radius: 0; margin-bottom: 1.5rem; }
.sk-line { height: 1rem; width: min(720px, calc(100% - 40px)); margin: .8rem auto; }
.sk-line.w80 { width: min(560px, calc(80% - 40px)); } .sk-line.w60, .sk-glass.w60 { width: 60%; }
.sk-card { aspect-ratio: 3 / 4; border-radius: 16px; }
.loading-spin { width: 34px; height: 34px; margin: calc(var(--topbar-h) + 6rem) auto; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px); z-index: 60; padding: .7rem 1.1rem; border-radius: 999px; background: #1d1714; color: #fff; font-weight: 600; font-size: .9rem; box-shadow: 0 10px 30px #0005; opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: opacity .25s, transform .35s var(--spring); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Profile */
.profile-head { display: flex; align-items: center; gap: 1rem; }
.avatar-lg { display: grid; place-items: center; flex: none; width: 68px; height: 68px; border-radius: 50%; background: linear-gradient(145deg, #e9cf8f, #b98b3e); color: #2a1410; font: 700 1.8rem var(--serif); box-shadow: 0 0 0 3px #ffffff40; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 1rem .5rem; text-align: center; }
.stats div { display: grid; }
.stats div + div { border-left: 1px solid var(--line); }
.stats strong { font: 600 1.8rem var(--serif); color: var(--accent); }
.stats span { color: var(--muted); font-size: .76rem; }
.saved-list { display: grid; gap: 12px; }
.saved blockquote { margin: 0 0 .5rem; font: 1.12rem/1.5 var(--serif); }
.saved .verse-ref { color: var(--muted); }
.saved .verse-ref span { background: var(--gold-soft); }
.saved-actions { display: flex; align-items: center; justify-content: space-between; margin-top: .3rem; }
.saved-actions .text-link { margin-top: 0; }

/* ---------- Tab bar (5 tabs, sliding ink) ---------- */
.tabbar { grid-template-columns: repeat(5, 1fr); view-transition-name: tabbar; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); }
.tab { position: relative; z-index: 1; transition: color .25s; -webkit-tap-highlight-color: transparent; }
.tab.is-active svg { animation: pop .45s var(--spring); }
.tab-ink { position: absolute; top: 8px; left: 0; width: 44px; height: 30px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); transition: transform .45s var(--spring), opacity .25s; pointer-events: none; }

/* ---------- Onboarding with photography ---------- */
.onboarding { position: relative; isolation: isolate; background: var(--ink-dark) url("/app/photos/little-hagia-sophia.webp") center / cover no-repeat; }
.onboarding::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, #0006, color-mix(in srgb, var(--ink-dark) 85%, transparent)); }
body[data-tradition="catholic"] .onboarding { background-image: url("/app/photos/wells-nave.webp"); }
body[data-tradition="orthodox"] .onboarding { background-image: url("/app/photos/iconostasis.webp"); }
body[data-tradition="protestant"] .onboarding { background-image: url("/app/photos/sainte-chapelle.webp"); }
body[data-tradition="both"] .onboarding { background-image: url("/app/photos/sepulchre-dome.webp"); }
.ob-card { animation: rise .6s var(--ease) both; backdrop-filter: blur(4px); }
.ob-body { animation: fadeSlide .45s var(--ease) both; }
.option { transition: border-color .15s ease, background .15s ease, transform .2s var(--spring); }
.option:active { transform: scale(.98); }
.option.is-selected .option-check { animation: pop .35s var(--spring); }

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fadeSlide { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes kenburns { from { transform: scale(1.02); } to { transform: scale(1.14) translate(-1.5%, -1%); } }
@keyframes settle { from { transform: scale(1.12); opacity: .4; } to { transform: scale(1); opacity: 1; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 50% { box-shadow: 0 0 0 10px #0000; } }
@keyframes ripple { from { transform: scale(1); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
@keyframes glow { from { box-shadow: 0 0 0 0 #e3c27a99; } to { box-shadow: 0 0 0 40px #e3c27a00; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes stepIn { from { opacity: 0; transform: translateY(14px) scale(.98); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes stepRight { from { opacity: 0; transform: translateX(40px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes stepLeft { from { opacity: 0; transform: translateX(-40px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }

::view-transition-old(root) { animation: vtOut .22s ease both; }
::view-transition-new(root) { animation: vtIn .38s var(--ease) both; }
::view-transition-old(topbar), ::view-transition-new(topbar), ::view-transition-old(tabbar), ::view-transition-new(tabbar) { animation: none; }
@keyframes vtOut { to { opacity: 0; transform: scale(.985); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(12px); } }

@media (min-width: 720px) {
  .pgrid { grid-template-columns: repeat(3, 1fr); }
  .pcard-wide { grid-column: span 3; min-height: 240px; }
  .media-card { grid-template-columns: 280px 1fr; }
  .media-img { height: 100%; min-height: 200px; }
  .hero-inner { padding-inline: 32px; }
  .view-today .grid { padding-inline: 1rem; }
  .stack { padding-inline: 1.5rem; }
}
@media (min-width: 1024px) { .pgrid { grid-template-columns: repeat(4, 1fr); } .pcard-wide { grid-column: span 2; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}

/* ============ iOS polish ============ */
:root { --ios: cubic-bezier(.32, .72, 0, 1); }
html { -webkit-tap-highlight-color: transparent; }
/* Follow the iPhone's text size setting (Settings › Display & Brightness › Text Size). */
@supports (font: -apple-system-body) { html { font: -apple-system-body; } }
.tabbar, .topbar, .quick, .chip-btn, .icon-btn, .play-btn, .rope-tap, .sheet-grab, .sheet-head { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* Press: everything tappable gives under the finger and springs back. */
:is(a.card, .pcard, .saint-card, .chapter-card, .feature-card, .quick a, .btn, .glass-btn, .glass-icon, .chip-btn, .book, .chap, .pick-btn, .icon-btn, .play-btn, .sheet-action, .sheet-big, .avatar, .streak-pill, .bchip, .option, .nav-btn) {
  transition: scale .45s var(--spring), transform .35s var(--spring), background-color .2s, color .2s, border-color .2s, box-shadow .25s;
}
:is(a.card, .pcard, .saint-card, .chapter-card, .feature-card, .quick a, .btn, .glass-btn, .glass-icon, .chip-btn, .book, .chap, .pick-btn, .icon-btn, .play-btn, .sheet-action, .sheet-big, .avatar, .streak-pill, .bchip, .option, .nav-btn):active {
  scale: .96; transition: scale .08s ease-out, background-color .1s;
}
:is(.pcard, .saint-card, .chapter-card, .feature-card, a.card):active { scale: .975; }
:is(a.list-row, button.list-row, .sheet-option, .sheet-row-link):active { background: color-mix(in srgb, var(--ink) 8%, transparent); transition: none; }

/* Large title folds into the top bar. */
.bar-center { justify-self: center; display: grid; place-items: center; min-width: 0; max-width: 100%; }
.bar-center > * { grid-area: 1 / 1; transition: opacity .25s ease, transform .4s var(--ios); }
.bar-title { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 600 1.05rem var(--serif); letter-spacing: .01em; opacity: 0; transform: translateY(10px); }
.is-titled .bar-title { opacity: 1; transform: none; }
.is-titled .wordmark { opacity: 0; transform: translateY(-10px); }

/* Grouped lists, as in Settings. */
.list-card.group { padding: 0; overflow: hidden; }
button.list-row { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
button.list-row:last-child { border-bottom: 0; }
.list-row > span.row-value { display: inline-flex; align-items: center; gap: .45rem; min-width: 0; color: var(--muted); font-size: .95rem; font-weight: 500; text-align: right; }
.row-value i { font-style: normal; color: var(--gold); font-size: 1.3rem; line-height: 1; }
.info-row:hover { background: none; }
.list-row.is-accent > span:first-child { color: var(--accent); }
.list-row.is-danger { justify-content: center; color: #c0392b; }
.list-row.is-danger > span { color: inherit; font-size: inherit; }
.input-row input { flex: 1; min-width: 0; padding: .4rem 0; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 500; text-align: right; outline: none; }
.input-row input:focus { color: var(--ink); }
.input-row:hover { background: none; }
html[data-theme="night"] .list-row.is-danger { color: #ff8a73; }

/* Bottom sheets. */
body.has-sheet { overflow: hidden; }
.sheet-layer { position: fixed; inset: 0; z-index: 100; }
.sheet-backdrop { position: absolute; inset: 0; background: #0008; opacity: 0; transition: opacity .4s ease; }
.sheet-layer.is-open .sheet-backdrop { opacity: var(--sheet-dim, 1); }
.sheet { position: absolute; inset: auto 0 0; display: flex; flex-direction: column; width: min(640px, 100%); max-height: calc(100dvh - env(safe-area-inset-top) - 44px); margin: 0 auto; padding-bottom: env(safe-area-inset-bottom); border-radius: 24px 24px 0 0; background: var(--surface); color: var(--ink); box-shadow: 0 -12px 40px #0004; outline: none; transform: translateY(105%); transition: transform .5s var(--ios); touch-action: pan-y; }
.sheet-layer.is-open .sheet { transform: translateY(0); }
.sheet.is-dragging { transition: none; }
.sheet-grab { flex: none; width: 38px; height: 5px; margin: 8px auto 4px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 22%, transparent); }
.sheet-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .4rem 1.2rem .8rem; }
.sheet-head h2 { font-size: 1.3rem; }
.sheet-done { padding: .4rem 0 .4rem .8rem; border: 0; background: none; color: var(--accent); font: 700 1rem var(--sans); cursor: pointer; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 0 1rem 1.2rem; }
.sheet-list { display: grid; overflow: hidden; border-radius: 16px; background: var(--bg); }
.sheet-option { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.sheet-option:last-child { border-bottom: 0; }
.sheet-option span { display: grid; gap: .15rem; }
.sheet-option strong { font-weight: 650; }
.sheet-option small { color: var(--muted); font-size: .84rem; line-height: 1.35; }
.sheet-option svg { flex: none; width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.5); transition: opacity .2s, transform .4s var(--spring); }
.sheet-option.is-on svg { opacity: 1; transform: none; }
.sheet-chapter-grid { margin-bottom: 1rem; }
.chap.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sheet-row-link { display: flex; align-items: center; justify-content: space-between; padding: .95rem 1rem; border-radius: 16px; background: var(--bg); color: var(--ink); font-weight: 650; text-decoration: none; }
.sheet-row-link span { color: var(--gold); font-size: 1.3rem; line-height: 1; }
.sheet-verse .sheet-body { padding-top: .7rem; }
.sheet-kicker { color: var(--gold); font: 750 .74rem var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.sheet-quote { max-height: 38vh; overflow-y: auto; margin: .5rem 0 1.2rem; font: 1.18rem/1.55 var(--serif); }
.sheet-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .6rem; }
.sheet-action { position: relative; display: grid; justify-items: center; gap: .35rem; padding: .85rem .5rem; border: 0; border-radius: 16px; background: var(--bg); color: var(--ink); font: 650 .86rem var(--sans); cursor: pointer; }
.sheet-action svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.save-heart.is-on { color: var(--accent); }
.save-heart.is-on svg { fill: currentColor; }
.save-heart.pop svg { animation: pop .45s var(--spring); }
.sheet-alert .sheet-body { display: grid; gap: .6rem; padding-top: .8rem; text-align: center; }
.sheet-alert-title { font: 600 1.3rem var(--serif); }
.sheet-alert-text { margin-bottom: .4rem; padding: 0 .5rem; color: var(--muted); }
.sheet-big { min-height: 54px; border: 0; border-radius: 16px; background: var(--bg); color: var(--accent); font: 700 1.02rem var(--sans); cursor: pointer; }
.sheet-big.is-danger { background: #c0392b; color: #fff; }

/* Reader: tap a title or verse. */
button.reader-title { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.reader-title h1 { display: inline-flex; align-items: center; gap: .15rem; max-width: 100%; }
.caret { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--gold); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.compare-bar { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.pick-btn { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 .4rem; min-width: 0; padding: .55rem .85rem; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.pick-btn small { grid-column: 1; color: var(--muted); font: 750 .66rem var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.pick-btn strong { grid-column: 1; overflow: hidden; font-size: .92rem; white-space: nowrap; text-overflow: ellipsis; }
.pick-btn svg { grid-column: 2; grid-row: 1 / 3; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.scripture .verse[id] { margin-inline: -.4rem; padding-inline: .4rem; border-radius: 8px; cursor: pointer; transition: background-color .25s; }
.scripture .verse.is-selected { background: color-mix(in srgb, var(--gold) 24%, transparent); }

/* Saving a verse: the heart bursts. */
.glass-icon, .save-heart { position: relative; }
:is(.glass-icon, .save-heart).pop::after { content: ''; position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; pointer-events: none; animation: burst .7s ease-out both; }
.glass-icon.pop::before { content: ''; position: absolute; inset: -2px; border: 2px solid #e3b35a; border-radius: 50%; pointer-events: none; animation: ring .55s ease-out both; }
@keyframes burst {
  0% { opacity: 1; box-shadow: 0 0 0 -3px #e3b35a, 0 0 0 -3px #f0d79c, 0 0 0 -3px #e3b35a, 0 0 0 -3px #f0d79c, 0 0 0 -3px #e3b35a, 0 0 0 -3px #f0d79c, 0 0 0 -3px #e3b35a, 0 0 0 -3px #f0d79c; }
  60% { opacity: 1; }
  100% { opacity: 0; box-shadow: 0 -30px 0 -1px #e3b35a, 21px -21px 0 -1px #f0d79c, 30px 0 0 -1px #e3b35a, 21px 21px 0 -1px #f0d79c, 0 30px 0 -1px #e3b35a, -21px 21px 0 -1px #f0d79c, -30px 0 0 -1px #e3b35a, -21px -21px 0 -1px #f0d79c; }
}
@keyframes ring { from { opacity: 1; transform: scale(.7); } to { opacity: 0; transform: scale(1.7); } }

/* The streak flame dances when it goes up. */
.streak-pill > span { display: inline-block; }
.streak-pill.bump { animation: pillGlow 1.3s ease-out .5s both; }
.streak-pill.bump > span { animation: flame 1s var(--spring) .5s both; }
@keyframes flame { 0% { transform: none; } 30% { transform: scale(1.7) rotate(-12deg); } 55% { transform: scale(1.3) rotate(10deg); } 100% { transform: none; } }
@keyframes pillGlow { from { box-shadow: 0 0 0 0 #ffb347aa; } to { box-shadow: 0 0 0 16px #ffb34700; } }

/* Photos fade in from a soft blur. */
img[data-fade] { transition: opacity .5s ease, filter .8s var(--ease), transform .9s var(--ease); }
:where(img[data-fade]:not(.is-loaded)) { opacity: 0; filter: blur(18px); }

/* Edge swipe back. */
body.is-swiping { background: #0b0809; }
.is-swiping #main { position: relative; z-index: 1; min-height: 100dvh; background: var(--bg); box-shadow: -10px 0 30px #0004; }

/* Page transitions that know their direction. */
html[data-nav="push"]::view-transition-old(root) { animation: vtPushOut .5s var(--ios) both; }
html[data-nav="push"]::view-transition-new(root) { animation: vtPushIn .5s var(--ios) both; }
html[data-nav="pop"]::view-transition-old(root) { z-index: 2; animation: vtPopOut .45s var(--ios) both; }
html[data-nav="pop"]::view-transition-new(root) { z-index: 1; animation: vtPopIn .45s var(--ios) both; }
html[data-nav="modal"]::view-transition-old(root) { animation: vtRecede .5s var(--ios) both; }
html[data-nav="modal"]::view-transition-new(root) { animation: vtSheetIn .5s var(--ios) both; }
html[data-nav="dismiss"]::view-transition-old(root) { z-index: 2; animation: vtSheetOut .42s var(--ios) both; }
html[data-nav="dismiss"]::view-transition-new(root) { z-index: 1; animation: vtEmerge .42s var(--ios) both; }
html[data-nav="tab"]::view-transition-old(root) { animation: vtFadeOut .16s ease both; }
html[data-nav="tab"]::view-transition-new(root) { animation: vtFadeIn .26s ease both; }
html:is([data-nav="modal"], [data-nav="dismiss"])::view-transition-old(topbar), html:is([data-nav="modal"], [data-nav="dismiss"])::view-transition-old(tabbar) { animation: vtFadeOut .2s ease both; }
html:is([data-nav="modal"], [data-nav="dismiss"])::view-transition-new(topbar), html:is([data-nav="modal"], [data-nav="dismiss"])::view-transition-new(tabbar) { animation: vtFadeIn .3s ease .2s both; }
@keyframes vtPushIn { from { transform: translateX(100%); } }
@keyframes vtPushOut { to { transform: translateX(-28%); filter: brightness(.8); } }
@keyframes vtPopOut { to { transform: translateX(100%); } }
@keyframes vtPopIn { from { transform: translateX(-28%); filter: brightness(.8); } }
@keyframes vtSheetIn { from { transform: translateY(100%); } }
@keyframes vtSheetOut { to { transform: translateY(100%); } }
@keyframes vtRecede { to { transform: scale(.94); filter: brightness(.6); } }
@keyframes vtEmerge { from { transform: scale(.94); filter: brightness(.6); } }
@keyframes vtFadeOut { to { opacity: 0; } }
@keyframes vtFadeIn { from { opacity: 0; } }
/* Bars keep a fixed size at large text settings, as iOS nav bars do. */
.wordmark { font-size: 15px; white-space: nowrap; }
.bar-title { font-size: 17px; }
.tab { font-size: min(.74rem, 13px); }

/* Original languages. */
[lang="hbo"] { font-family: "SBL Hebrew", "Ezra SIL", "Taamey Frank CLM", "Times New Roman", "Arial Hebrew", serif; font-size: 1.16em; line-height: 1.9; }
[lang="grc"] { font-family: "Gentium Plus", "Times New Roman", serif; font-size: 1.04em; }
.parallel [lang], .parallel[lang] { font-size: inherit; }
.parallel[lang="hbo"] { font-size: 1.08em; }
.verse[dir="rtl"] sup { margin-right: 0; margin-left: .3rem; }
.parallel[dir="rtl"] { padding-left: 0; padding-right: .75rem; border-left: 0; border-right: 3px solid var(--gold); }
.verse[dir="rtl"] .parallel[dir="ltr"] { text-align: left; }
.ketiv { color: var(--muted); font-size: .78em; }
.ketiv::after { content: '°'; }
/* Pages without a photo or colour header (the Bible reader) get a solid bar from the start. */
body:has(#main .reader) .topbar { background: color-mix(in srgb, var(--ink-dark) 82%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); box-shadow: 0 1px 0 #ffffff14; }

/* Word by word (interlinear). */
.ww-toggle { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; margin-top: .6rem; padding: .7rem .9rem; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.ww-toggle span { display: grid; gap: .1rem; }
.ww-toggle strong { font-size: .95rem; }
.ww-toggle small { color: var(--muted); font-size: .78rem; line-height: 1.3; }
.ww-toggle i { position: relative; flex: none; width: 51px; height: 31px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 18%, transparent); transition: background-color .25s; }
.ww-toggle i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px #0003; transition: transform .35s var(--spring); }
.ww-toggle.is-on i { background: var(--accent); }
.ww-toggle.is-on i::after { transform: translateX(20px); }
.interlinear { display: grid; gap: 1rem; }
.ww-verse { padding-bottom: .9rem; border-bottom: 1px solid var(--line); }
.ww-num { margin-bottom: .35rem; color: var(--gold); font: 750 .7rem var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.ww-line { display: flex; flex-wrap: wrap; gap: .3rem .2rem; }
.ww-verse > .verse { margin: 0 0 .65rem; }
.ww-verse > .ww-line { padding: .55rem .4rem; border-radius: 12px; background: color-mix(in srgb, var(--gold) 7%, transparent); }
.w { display: grid; justify-items: center; align-content: start; gap: .08rem; min-width: 48px; max-width: 136px; padding: .45rem .45rem .5rem; border: 0; border-radius: 12px; background: none; color: var(--ink); font: inherit; text-align: center; cursor: pointer; transition: background-color .2s, scale .4s var(--spring); }
.w:hover { background: color-mix(in srgb, var(--gold) 14%, transparent); }
.w:active { scale: .95; }
.w.is-selected { background: color-mix(in srgb, var(--gold) 26%, transparent); }
.w-orig { font-size: 1.2em; line-height: 1.35; }
.w-orig[lang="hbo"], .w-orig[lang="arc"] { font-family: "SBL Hebrew", "Ezra SIL", "Taamey Frank CLM", "Times New Roman", "Arial Hebrew", serif; font-size: 1.32em; }
.w-tr { color: var(--muted); font: italic .72rem/1.3 var(--sans); }
.w-gl { color: var(--ink); font: 650 .8rem/1.25 var(--sans); }
.w-gr { color: var(--accent); font: 600 .6rem/1.25 var(--sans); }
.g-orig { opacity: .45; font-weight: 500; }
.g-add { font-style: italic; font-weight: 500; }
.sheet-word .sheet-body { padding-top: .6rem; }
.word-big { margin: .5rem 0 .1rem; font-size: 2.6rem; line-height: 1.35; text-align: center; }
.word-big[lang="hbo"], .word-big[lang="arc"], .fact-row strong[lang="hbo"], .fact-row strong[lang="arc"] { font-family: "SBL Hebrew", "Ezra SIL", "Times New Roman", "Arial Hebrew", serif; }
.word-tr { color: var(--muted); font-style: italic; text-align: center; }
.word-gl { margin: .2rem 0 1rem; font: 650 1.1rem var(--sans); text-align: center; }
.fact-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.fact-row:last-child { border-bottom: 0; }
.fact-row span { color: var(--muted); font-size: .9rem; }
.fact-row strong { font-weight: 650; text-align: right; }
.word-sub { margin: 1.1rem .2rem .5rem; color: var(--muted); font: 750 .72rem var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.gram-row { display: grid; gap: .2rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.gram-row:last-child { border-bottom: 0; }
.gram-row strong { font-weight: 650; }
.gram-row.is-main strong { color: var(--accent); }
.gram-row small { color: var(--muted); font-size: .82rem; line-height: 1.4; }

/* Reader bar: reference + version capsule, then listen / Aa / search. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.reader-bar { position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top)); z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 -16px; padding: .55rem 12px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid var(--line); }
.rb-pills { display: flex; align-items: stretch; min-width: 0; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.rb-pill { display: inline-flex; align-items: center; gap: .2rem; min-width: 0; height: 40px; padding: 0 .65rem 0 .95rem; border: 0; background: none; color: var(--ink); cursor: pointer; white-space: nowrap; transition: background-color .2s; }
.rb-pill:active { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.rb-pill svg { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--gold); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.rb-ref { overflow: hidden; text-overflow: ellipsis; font: 600 1.05rem var(--serif); }
.rb-ver { padding-left: .7rem; border-left: 1.5px solid var(--line); color: var(--accent); font: 750 .8rem var(--sans); letter-spacing: .08em; }
.rb-icons { display: flex; flex: none; gap: .1rem; }
.rb-icon { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer; transition: background-color .2s, color .2s, scale .4s var(--spring); }
.rb-icon:active { scale: .9; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.rb-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rb-icon.is-on { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.rb-icon.is-on .wave { animation: wave 1.2s ease-in-out infinite; }
.rb-aa span { font: 600 1.2rem/1 var(--serif); letter-spacing: -.02em; }
.rb-aa small { font-size: .8em; }
@keyframes wave { 50% { opacity: .35; } }
.view-bible .reader { padding-top: calc(var(--topbar-h) + env(safe-area-inset-top)); }

/* Chapter opening, like a printed Bible. */
.chapter-head { display: grid; justify-items: center; gap: .1rem; margin: 1.6rem 0 1rem; text-align: center; }
.chapter-head p:first-child { color: var(--gold); font: 750 .74rem var(--sans); letter-spacing: .16em; text-transform: uppercase; }
.chapter-head p:first-child span { color: var(--muted); font-weight: 600; letter-spacing: .06em; text-transform: none; }
.chapter-head h1 { font: 500 3.4rem/1 var(--serif); color: var(--ink); }
.chapter-head .chapter-ver { color: var(--muted); font-size: .8rem; }

/* Book and chapter picker. */
.book-sec { margin: 1rem .3rem .45rem; }
.book-sec:first-child { margin-top: .2rem; }
.book-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; padding: .8rem 1rem; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: 600 1rem var(--sans); text-align: left; cursor: pointer; }
.book-row small { color: var(--muted); font-weight: 500; font-size: .82rem; }
.book-row svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--spring); }
.book-row.is-open { color: var(--accent); }
.book-row.is-open svg { transform: rotate(180deg); stroke: var(--accent); }
.book-chapters:not(:empty) { padding: .7rem .8rem .9rem; border-bottom: 1px solid var(--line); animation: rise .35s var(--ease) both; }
.book-list > :last-child, .book-list > .book-row:nth-last-child(2):has(+ .book-chapters:empty) { border-bottom: 0; }
.book-chapters .chapter-grid { margin: 0; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); }
.book-chapters .chap { height: 46px; background: var(--surface); }
.book-chapters .chap.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* Reading options. */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; min-height: 56px; padding: .65rem 1rem; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: 600 1rem var(--sans); text-align: left; cursor: pointer; }
.set-row:last-child { border-bottom: 0; }
.set-row > span:first-child { display: grid; gap: .1rem; }
.set-row small { color: var(--muted); font-size: .8rem; font-weight: 500; line-height: 1.3; }
.set-row.is-muted { color: var(--muted); cursor: default; }
.set-row .row-value { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-weight: 500; }
.set-row .row-value i { color: var(--gold); font-size: 1.3rem; font-style: normal; }
.seg { display: inline-flex; overflow: hidden; border: 1.5px solid var(--line); border-radius: 12px; }
.seg button { width: 52px; height: 38px; border: 0; background: var(--surface); color: var(--ink); font-family: var(--serif); cursor: pointer; }
.seg button:first-child { font-size: .85rem; border-right: 1.5px solid var(--line); }
.seg button:last-child { font-size: 1.25rem; }
.seg button:active { background: var(--gold-soft); }
.switch { position: relative; flex: none; width: 51px; height: 31px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 18%, transparent); transition: background-color .25s; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px #0003; transition: transform .35s var(--spring); }
.switch.is-on { background: var(--accent); }
.switch.is-on::after { transform: translateX(20px); }

/* Look up. */
.lookup { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; padding: 0 .9rem; border-radius: 14px; background: var(--bg); }
.lookup svg { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.lookup input { flex: 1; min-width: 0; height: 48px; border: 0; background: none; color: var(--ink); font: 500 1.05rem var(--sans); outline: none; }
.lookup-results.is-empty { display: none; }
.lookup-row svg { opacity: 1; transform: none; stroke: var(--gold); }
.lookup-hint { margin: .9rem .3rem 0; color: var(--muted); font-size: .84rem; line-height: 1.45; }

/* Found and spoken verses. */
.verse, .ww-verse { scroll-margin-top: 150px; }
.verse.is-flash, .ww-verse.is-flash { animation: flash 2.2s ease-out both; border-radius: 8px; }
@keyframes flash { 0%, 30% { background: color-mix(in srgb, var(--gold) 34%, transparent); } 100% { background: transparent; } }
.verse.is-reading, .ww-verse.is-reading { background: color-mix(in srgb, var(--gold) 20%, transparent); }

/* ---------- Candlelit night ---------- */
html[data-theme="night"] body { background: var(--bg); }
/* Warm light from unseen candles, flickering very gently. */
html[data-theme="night"] body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(70% 45% at 12% 0%, color-mix(in srgb, var(--glow) 16%, transparent), transparent 70%),
    radial-gradient(55% 40% at 95% 38%, color-mix(in srgb, var(--glow) 9%, transparent), transparent 70%),
    radial-gradient(80% 40% at 50% 108%, color-mix(in srgb, var(--glow) 13%, transparent), transparent 70%);
  animation: candle 7s ease-in-out infinite; }
@keyframes candle { 0%, 100% { opacity: 1; } 18% { opacity: .86; } 22% { opacity: .97; } 47% { opacity: .9; } 63% { opacity: 1; } 78% { opacity: .84; } 83% { opacity: .95; } }

/* Panels: dark walnut with a gold-leaf edge and candlelight catching the top. */
html[data-theme="night"] :is(.card, .list-card, .rb-pills, .compare-note, .sheet-list, .set-row-group) {
  border-color: color-mix(in srgb, var(--gold) 24%, transparent);
  background: linear-gradient(180deg, var(--surface-2), var(--surface) 70%);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--glow) 12%, transparent), var(--shadow); }
html[data-theme="night"] .card:hover { border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
html[data-theme="night"] .compare-note { border: 1px solid color-mix(in srgb, var(--gold) 24%, transparent); }
html[data-theme="night"] :is(.list-row, .sheet-option, .set-row) + :is(.list-row, .sheet-option, .set-row) { border-color: color-mix(in srgb, var(--gold) 13%, transparent); }

/* Gold-leaf headings, each with a small candle flame. */
html[data-theme="night"] .section-title { color: var(--gold); }
html[data-theme="night"] .section-title::before, html[data-theme="night"] .word-sub::before { content: ""; flex: none; align-self: center; width: 7px; height: 11px; margin-right: .55rem; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 72%, #fff6d8 0 22%, #ffc65a 45%, #e5802a 80%); box-shadow: 0 0 8px 2px color-mix(in srgb, var(--glow) 55%, transparent), 0 0 18px 6px color-mix(in srgb, var(--glow) 18%, transparent);
  transform-origin: 50% 100%; animation: flame 2.6s ease-in-out infinite; }
html[data-theme="night"] .section-title { justify-content: flex-start; }
html[data-theme="night"] .section-title > :is(a, button, span) { margin-left: auto; }
html[data-theme="night"] .word-sub { display: flex; align-items: center; color: var(--gold); }
@keyframes flame { 0%, 100% { transform: scale(1) rotate(-2deg); } 30% { transform: scale(.92, 1.08) rotate(2deg); } 55% { transform: scale(1.05, .95) rotate(-1deg); } 80% { transform: scale(.96, 1.05) rotate(1.5deg); } }

/* Bars and sheets: deep shadow with a thin gold line. */
html[data-theme="night"] .tabbar { background: color-mix(in srgb, #0b0806 86%, transparent); border-top: 1px solid color-mix(in srgb, var(--gold) 22%, transparent); }
html[data-theme="night"] .is-scrolled .topbar { background: color-mix(in srgb, #0b0806 84%, transparent); box-shadow: 0 1px 0 color-mix(in srgb, var(--gold) 22%, transparent); }
html[data-theme="night"] .reader-bar { background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom-color: color-mix(in srgb, var(--gold) 18%, transparent); }
html[data-theme="night"] .sheet { background: linear-gradient(180deg, #1d1510, var(--bg) 60%); box-shadow: 0 -1px 0 color-mix(in srgb, var(--gold) 30%, transparent), 0 -16px 50px #000a; }
html[data-theme="night"] .sheet .sheet-list { background: var(--surface); }
html[data-theme="night"] :is(h1, h2) { color: #f6ead2; }
html[data-theme="night"] .chapter-head h1 { color: var(--gold); text-shadow: 0 0 28px color-mix(in srgb, var(--glow) 35%, transparent); }
html[data-theme="night"] .btn-primary { box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 30%, transparent); }
html[data-theme="night"] .ww-verse > .ww-line { background: color-mix(in srgb, var(--glow) 5%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 14%, transparent); }
@media (prefers-reduced-motion: reduce) { html[data-theme="night"] body::before, html[data-theme="night"] :is(.section-title, .word-sub)::before { animation: none; } }

/* Gold leaf for the main controls at night, so tradition colours stay as accents in the text. */
html[data-theme="night"] .quick { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border-color: color-mix(in srgb, var(--gold) 26%, transparent); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--glow) 12%, transparent), 0 18px 40px #000a; }
html[data-theme="night"] .quick-icon { background: radial-gradient(120% 90% at 30% 15%, #f3dc9e, #c9973f 55%, #8a5f22); color: #2a1608; box-shadow: inset 0 1px 0 #fff5, 0 0 0 1px #00000040, 0 6px 18px color-mix(in srgb, var(--glow) 28%, transparent); }
html[data-theme="night"] :is(.tab.is-active, .ring, .next-tag, .text-link, .list-row.is-accent, .stats strong) { color: var(--gold); }
html[data-theme="night"] .list-row.is-accent > span:first-child { color: var(--gold); }
html[data-theme="night"] .tab.is-active svg { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--glow) 55%, transparent)); }
html[data-theme="night"] .btn-primary { background: linear-gradient(180deg, #e2bb6c, #c0913f); border-color: #c0913f; color: #241406; }
html[data-theme="night"] .chap.is-on, html[data-theme="night"] .book-chapters .chap.is-on { background: var(--gold); border-color: var(--gold); color: #241406; }

/* Appearance switch in the profile. */
.theme-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.theme-seg button { min-width: 3.4rem; padding: .35rem .7rem; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 650 .85rem var(--sans); cursor: pointer; transition: background-color .25s, color .25s, box-shadow .25s; }
.theme-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px #0003; }
html[data-theme="night"] .theme-seg button[aria-pressed="true"] { background: var(--gold); color: #1d1206; }
html.theme-switching, html.theme-switching * { transition: background-color .45s ease, color .45s ease, border-color .45s ease !important; }

/* ---------- Profile menu and its pages ---------- */
.menu-row { justify-content: flex-start; gap: .85rem; }
.menu-row .menu-label { flex: 1; min-width: 0; font-weight: 600; color: var(--ink); }
.menu-row .row-value { color: var(--muted); font-weight: 500; }
.menu-row .chev { color: var(--gold); font-size: 1.25rem; line-height: 1; }
.row-icon { display: grid; flex: none; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(150deg, var(--accent-2), var(--accent)); color: #fff; }
.row-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
html[data-theme="night"] .row-icon { background: radial-gradient(120% 90% at 30% 15%, #f3dc9e, #c9973f 55%, #8a5f22); color: #2a1608; box-shadow: inset 0 1px 0 #fff5; }
body:has(#main .sub-head) .topbar { background: color-mix(in srgb, var(--ink-dark) 82%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); }
.sub-head { width: min(1080px, 100%); margin: 0 auto; padding: calc(var(--topbar-h) + env(safe-area-inset-top) + .9rem) 16px .2rem; }
.sub-back { display: inline-flex; align-items: center; gap: .25rem; min-height: 36px; color: var(--gold); font-weight: 650; text-decoration: none; }
.sub-back span { font-size: 1.6rem; line-height: 1; margin-top: -.15rem; }
.sub-head h1 { margin-top: .2rem; font-size: 2rem; }
.empty-note { display: grid; gap: .5rem; justify-items: start; }
.empty-note .btn { margin-top: .4rem; }

/* ---------- Church calendar ---------- */
.feasts-link h2 { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.feasts-open { display: inline-flex; flex: none; align-items: center; gap: .35rem; color: var(--gold); font: 650 .85rem var(--sans); letter-spacing: 0; }
.feasts-open svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.cal-card { padding: .9rem .7rem 1rem; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 0 .2rem .6rem; }
.cal-head h2 { font-size: 1.35rem; }
.cal-nav { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); border-radius: 50%; background: none; color: var(--gold); cursor: pointer; }
.cal-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cal-nav:active { transform: scale(.92); }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-week span { padding-bottom: .35rem; color: var(--muted); font: 700 .7rem var(--sans); letter-spacing: .08em; text-align: center; }
.cal-cell { position: relative; display: grid; justify-items: center; align-content: start; gap: 2px; min-height: 50px; padding: 6px 0 9px; border: 1px solid transparent; border-radius: 12px; background: none; color: var(--ink); font: 600 .95rem var(--sans); cursor: pointer; transition: background-color .2s, border-color .2s, transform .15s; -webkit-tap-highlight-color: transparent; }
.cal-cell.is-blank { cursor: default; }
.cal-cell:not(.is-blank):active { transform: scale(.92); }
.cal-cell.is-sunday .cal-num { color: var(--gold); }
.cal-cell.has-feast { background: color-mix(in srgb, var(--gold) 9%, transparent); }
.cal-cell.is-today { border-color: var(--gold); }
.cal-cell.is-sel { background: var(--gold); color: #241406; }
.cal-cell.is-sel .cal-num { color: inherit; }
.cal-marks { display: flex; gap: 3px; height: 6px; }
.cal-dot, .cal-fast { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.cal-dot { background: var(--gold); box-shadow: 0 0 6px color-mix(in srgb, var(--gold) 70%, transparent); }
.cal-fast { background: #9a7fc0; }
.cal-cell.is-sel .cal-dot { background: #241406; box-shadow: none; }
.cal-color { position: absolute; left: 30%; right: 30%; bottom: 4px; height: 3px; border-radius: 2px; }
.cal-legend .cal-color { position: static; display: inline-block; width: 14px; }
.c-white { background: #efe7d6; box-shadow: 0 0 0 1px #0002; } .c-violet { background: #8a5cc0; } .c-rose { background: #e39ab4; } .c-red { background: #c8323c; } .c-green { background: #3f9a5a; }
.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; margin-top: .8rem; padding: .7rem .3rem 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.cal-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.cal-today { margin-left: auto; padding: .3rem .8rem; border: 1px solid var(--gold); border-radius: 999px; background: none; color: var(--gold); font: 650 .8rem var(--sans); cursor: pointer; }
.cal-day { display: grid; gap: .5rem; }
.cal-side { display: grid; gap: .25rem; }
.cal-side + .cal-side { padding-top: .7rem; border-top: 1px solid var(--line); }
.cal-feast { font: 600 1.35rem/1.2 var(--serif); }
.cal-season strong { font-weight: 650; }
.cal-note { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .9rem; }
.cal-swatch { width: 14px; height: 14px; border-radius: 50%; }
.cal-sub { margin: .5rem 0 .3rem; color: var(--gold); font: 750 .72rem var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.cal-saints .list-card { padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cal-feasts { padding: .2rem 0; }
.cal-month-list { list-style: none; margin: 0; padding: 0; }
.cal-month-list li + li { border-top: 1px solid var(--line); }
.cal-month-list button { display: flex; align-items: center; gap: .9rem; width: 100%; padding: .7rem 1rem; border: 0; background: none; color: var(--ink); text-align: left; cursor: pointer; }
.cal-mday { display: grid; justify-items: center; width: 2.6rem; flex: none; }
.cal-mday b { color: var(--gold); font: 600 1.35rem/1 var(--serif); }
.cal-mday small { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.cal-mname { display: grid; font-weight: 600; }
.cal-mname small { color: var(--muted); font-weight: 500; font-size: .78rem; }
.cal-empty { padding: 1rem; }
body:has(#main .cal-page) .topbar { background: color-mix(in srgb, var(--ink-dark) 82%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); }

/* Words of Christ (red letters). A deep crimson by day, a warm candlelit red by night. */
.wj { color: #b3261e; }
html[data-theme="night"] .wj { color: #ec7a64; }
html[data-theme] .no-red .wj { color: inherit; }

/* ---------- Profile pictures ---------- */
.avatar, .avatar-lg { position: relative; overflow: visible; }
.avatar > img, .avatar-lg > img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar-sym { width: 58%; height: 58%; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.avatar-lg { padding: 0; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .2s var(--spring); }
.avatar-lg:active { transform: scale(.94); }
.avatar-lg > img { box-shadow: 0 0 0 2px #e9cf8f; }
.avatar-edit { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 3px 10px #0006; }
.avatar-edit svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
.avatar > img { box-shadow: 0 0 0 1.5px #e9cf8f; }
.sheet-avatars .sheet-body { padding-bottom: 1.4rem; }
.av-group + .av-group { margin-top: 1rem; }
.av-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: .9rem .5rem; margin-top: .4rem; }
.av-opt { display: grid; justify-items: center; gap: .35rem; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.av-circle { display: grid; place-items: center; width: 66px; height: 66px; border-radius: 50%; overflow: hidden; background: radial-gradient(120% 90% at 30% 15%, #f3dc9e, #c9973f 55%, #8a5f22); color: #2a1608; font: 700 1.6rem var(--serif); box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 35%, transparent), 0 4px 12px #0004; transition: transform .2s var(--spring), box-shadow .2s; }
.av-circle img { width: 100%; height: 100%; object-fit: cover; }
.av-opt:active .av-circle { transform: scale(.92); }
.av-opt.is-on .av-circle { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--gold), 0 0 18px color-mix(in srgb, var(--gold) 45%, transparent); }
.av-name { max-width: 84px; color: var(--muted); font-size: .72rem; font-weight: 600; line-height: 1.2; text-align: center; }
.av-opt.is-on .av-name { color: var(--gold); }
html[data-theme="night"] :is(.sheet-done, .sheet-big:not(.is-danger)) { color: var(--gold); }

/* Two one-tap actions side by side at the foot of the profile. */
.action-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.action-btn { display: grid; place-items: center; min-height: 58px; padding: .7rem .8rem; border: 1px solid var(--line); color: var(--accent); font: 650 .95rem/1.25 var(--sans); text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .15s var(--ease), background-color .2s; }
html[data-theme="night"] .action-btn:not(.is-danger) { color: var(--gold); }
.action-btn:active { transform: scale(.97); }
.action-btn.is-danger { color: #c0392b; }
html[data-theme="night"] .action-btn.is-danger { color: #ff8a73; }

/* ---------- Library ---------- */
.lib-lede { margin-top: .35rem; color: var(--muted); font-size: .98rem; line-height: 1.45; max-width: 60ch; }
.lib-home, .lib-book, .lib-topic { padding-top: .6rem; }
.lib-shelf { display: grid; gap: .45rem; }
.lib-shelf .section-title { margin-top: .4rem; }
.lib-shelf-note { margin-top: -.2rem; color: var(--muted); font-size: .9rem; }
.lib-fine { color: var(--muted); font-size: .82rem; line-height: 1.45; }
.lib-fine a, .lib-about a { color: var(--accent); }
.lib-row { grid-auto-columns: 132px; gap: 14px; }

/* Covers: cloth-bound books with gilt lettering. */
.lib-cover { position: relative; isolation: isolate; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; align-content: start; gap: .35rem; aspect-ratio: 2 / 3; width: 100%; padding: 14% 10% 10%; border-radius: 4px 10px 10px 4px; color: #f3dca6; text-align: center; overflow: hidden; background: var(--cv, #5b2333); box-shadow: inset 6px 0 0 #0000002e, inset 8px 0 0 #ffffff14, 0 10px 22px -10px #0009, 0 2px 5px #0004; }
.lib-cover::before { content: ''; position: absolute; inset: 7px 7px 7px 13px; z-index: -1; border: 1px solid #f3dca655; border-radius: 3px 7px 7px 3px; }
.lib-cover::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, #ffffff1c, #0000 40%, #00000038); }
.lib-cover.c-wine { --cv: #5e1f2c; } .lib-cover.c-navy { --cv: #1e2b4a; } .lib-cover.c-green { --cv: #1f3d32; }
.lib-cover.c-gold { --cv: #6b4a1c; } .lib-cover.c-slate { --cv: #2f3640; } .lib-cover.c-rose { --cv: #6a2f45; }
.lib-cover-mark { display: grid; place-items: center; width: 46%; aspect-ratio: 1; border-radius: 50%; border: 1.5px solid #f3dca699; overflow: hidden; background: #0003; }
.lib-cover-mark img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.25) contrast(1.05); }
.lib-cover-mark svg { width: 62%; height: 62%; fill: none; stroke: #f3dca6; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.lib-cover-title { align-self: center; font: 600 .86rem/1.15 var(--serif); letter-spacing: .02em; text-wrap: balance; }
.lib-cover-author { font: 650 .5rem/1.25 var(--sans); letter-spacing: .1em; text-transform: uppercase; opacity: .85; text-wrap: balance; }
.lib-cover.is-small { width: 54px; padding: 10% 8%; gap: 0; border-radius: 2px 6px 6px 2px; }
.lib-cover.is-small :is(.lib-cover-title, .lib-cover-author) { display: none; }
.lib-cover.is-small .lib-cover-mark { width: 72%; margin-top: 30%; }
.lib-cover.is-small::before { inset: 4px 4px 4px 8px; }
.lib-cover.is-large { width: 150px; flex: none; }
.lib-cover.is-large .lib-cover-title { font-size: 1rem; }
.lib-cover.is-large .lib-cover-author { font-size: .56rem; }

.lib-tile { display: grid; gap: .5rem; align-content: start; color: var(--ink); text-decoration: none; scroll-snap-align: start; transition: transform .3s var(--ease); }
.lib-tile:active { transform: scale(.97); }
.lib-tile-text { display: grid; gap: .1rem; }
.lib-tile-text strong { font: 600 .9rem/1.2 var(--serif); }
.lib-tile-text small { color: var(--muted); font-size: .76rem; line-height: 1.25; }

.lib-continue { display: flex; align-items: center; gap: .9rem; padding: .8rem 1rem; color: var(--ink); text-decoration: none; }
.lib-continue > span:nth-child(2) { display: grid; gap: .1rem; flex: 1; min-width: 0; }
.lib-continue strong { font: 600 1.05rem/1.2 var(--serif); }
.lib-continue em { color: var(--muted); font-style: normal; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-go { color: var(--gold); font-size: 1.5rem; }
.lib-resume { text-decoration: none; }
.lib-resume b { font-weight: 700; }

.lib-chip { justify-self: start; display: inline-flex; padding: .18rem .6rem; border-radius: 999px; font-size: .68rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; background: var(--gold-soft); color: var(--accent); }
.lib-chip.t-orthodox { background: color-mix(in srgb, #2f4f8f 16%, transparent); color: #2f4f8f; }
.lib-chip.t-protestant { background: color-mix(in srgb, #2f6b4f 16%, transparent); color: #2f6b4f; }
.lib-chip.t-shared { background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--muted); }

/* Book page */
.lib-hero { display: flex; gap: 1.1rem; align-items: flex-end; }
.lib-hero-text { display: grid; gap: .3rem; min-width: 0; }
.lib-hero h1 { font: 500 clamp(1.45rem, 5.5vw, 2rem)/1.12 var(--serif); text-wrap: balance; }
.lib-by { color: var(--muted); font-size: .86rem; }
.lib-tagline { font: italic 1rem/1.35 var(--serif); }
.lib-actions { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.lib-at { color: var(--muted); font-size: .86rem; min-width: 0; }
.lib-about { display: grid; gap: .7rem; }
.lib-about p:not(.card-kicker) { font-family: var(--serif); font-size: 1.04rem; line-height: 1.55; }
.lib-about h3 { margin-top: .3rem; }
.lib-toc .list-row { font-weight: 550; min-height: 50px; }
.lib-toc .list-row.is-current { background: var(--gold-soft); }
.lib-here { color: var(--accent) !important; font-size: .74rem !important; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }

/* Reader */
.lib-reader .reader-bar { justify-content: flex-start; }
.lib-reader .reader-back { flex: none; width: 36px; height: 40px; }
.lib-reader .rb-pills { flex: 0 1 auto; }
.lib-reader .rb-pill { overflow: hidden; text-overflow: ellipsis; }
.lib-reader .rb-icons { margin-left: auto; }
.lib-chead h1 { font-size: clamp(1.5rem, 6vw, 2.1rem); line-height: 1.15; text-wrap: balance; max-width: 26ch; }
.lib-text { line-height: 1.62; }
.lib-text > p { margin: 0 0 .95em; text-wrap: pretty; }
.lib-text .lib-h { margin: 1.6em 0 .7em; font: 750 .78em/1.35 var(--sans); letter-spacing: .06em; color: var(--accent); }
.lib-text .lib-verse { padding-left: .9rem; border-left: 2px solid var(--gold-soft); font-style: italic; }
.lib-text .lib-note { color: var(--muted); font: 650 .7em var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.lib-q { margin: 0 0 1.1em; scroll-margin-top: calc(var(--topbar-h) + env(safe-area-inset-top) + 70px); border-radius: 10px; transition: background-color 1.2s; }
.lib-q.is-flash { background: color-mix(in srgb, var(--gold) 20%, transparent); }
.lib-qq { font-weight: 650; font-family: var(--sans); font-size: .9em; line-height: 1.45; }
.lib-qq b { display: inline-grid; place-items: center; min-width: 1.9em; height: 1.5em; margin-right: .35rem; padding: 0 .3em; border-radius: 999px; background: var(--gold-soft); color: var(--accent); font-size: .78em; vertical-align: .1em; }
.lib-qa { margin-top: .3rem; padding-left: .9rem; border-left: 3px solid var(--gold); }
.lib-qa p + p { margin-top: .5em; }
.lib-text [data-i] { scroll-margin-top: calc(var(--topbar-h) + env(safe-area-inset-top) + 64px); }
.lib-next { margin: -.3rem 0 .6rem; color: var(--muted); font-size: .84rem; text-align: right; }
.sheet-lib-toc .sheet-option span { text-align: left; }

/* Comparing catechisms */
.lib-cmp { display: grid; gap: .5rem; }
.lib-cmp h2 { font: 500 1.25rem var(--serif); }
.lib-cmp .lib-q { margin: .2rem 0 .4rem; font-family: var(--serif); font-size: 1.04rem; line-height: 1.5; }
.lib-more { justify-self: start; color: var(--accent); font-weight: 650; text-decoration: none; }

html[data-theme="night"] .lib-chip.t-orthodox { color: #9fb6e6; }
html[data-theme="night"] .lib-chip.t-protestant { color: #9fd0b5; }
html[data-theme="night"] .lib-tile-text strong, html[data-theme="night"] .lib-hero h1 { color: var(--gold); }
.view-library > .reader { padding-inline: 16px; padding-top: calc(var(--topbar-h) + env(safe-area-inset-top)); }
.sheet-lib-toc .sheet-option.is-on { color: var(--accent); font-weight: 750; background: var(--gold-soft); }

/* Previous/next chapter arrows at the screen edges: small, faint, low, and gone while reading down. */
.edge-nav { position: fixed; inset-inline: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); z-index: 20; display: flex; justify-content: space-between; padding: 0 max(8px, env(safe-area-inset-left)); pointer-events: none; }
.edge-btn { pointer-events: auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 72%, transparent); color: var(--muted); box-shadow: 0 2px 10px #0000001f; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: .78; text-decoration: none; transition: opacity .3s var(--ease), transform .3s var(--ease); }
.edge-btn.is-next { margin-left: auto; }
.edge-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.edge-btn:hover { opacity: 1; color: var(--accent); }
.edge-btn:active { transform: scale(.9); }
body.edge-hide .edge-btn, body.has-sheet .edge-btn { opacity: 0; pointer-events: none; transform: translateY(8px); }
html[data-theme="night"] .edge-btn { background: color-mix(in srgb, var(--bg) 70%, transparent); border-color: color-mix(in srgb, var(--gold) 22%, transparent); color: color-mix(in srgb, var(--gold) 80%, var(--muted)); }
@media (min-width: 900px) { .edge-nav { inset-inline: calc(50% - 420px); } }
@media (prefers-reduced-motion: reduce) { .edge-btn { transition: opacity .2s; transform: none !important; } }
