/* CatholicScroll — mobile-first, dark by default, parchment light mode */
:root {
  --bg: #12151c;
  --bg-2: #181c26;
  --card: #1d2230;
  --card-2: #242a3a;
  --line: #2e3546;
  --text: #ecebe6;
  --muted: #98a1b3;
  --accent: #d8b45a;        /* liturgical gold */
  --accent-ink: #1a1507;
  --wj: #f08a7e;            /* words of Jesus */
  --fav: #f06d7b;
  --ok: #6fcf97;
  --bad: #f2994a;
  --radius: 18px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --top-h: 52px;
  --tab-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f1e7; --bg-2: #efe8da; --card: #fffdf8; --card-2: #f4eee2; --line: #e2d8c4;
    --text: #23201a; --muted: #6f6758; --accent: #8a6a16; --accent-ink: #fffdf8; --wj: #a8322a;
    --fav: #c8364a; color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 70px); }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.5 var(--sans);
  min-height: 100dvh; -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: 1.5rem; }
.icon { width: 22px; height: 22px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.row-gap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }

/* ---------- Top bar & tab bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between; padding: 0 14px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.brand { color: var(--text); font-weight: 700; font-size: 1.05rem; letter-spacing: .2px; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); }
.top-actions { display: flex; gap: 4px; }
.top-actions a { color: var(--muted); padding: 8px; border-radius: 10px; display: grid; place-items: center; }
.top-actions a:hover { color: var(--text); background: var(--card); }

.main { max-width: 680px; margin: 0 auto; padding: 12px 14px calc(var(--tab-h) + var(--safe-b) + 24px); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--bg-2) 92%, transparent); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .2px;
}
.tab:hover { text-decoration: none; color: var(--text); }
.tab.active { color: var(--accent); }
.tab .icon { width: 24px; height: 24px; }

/* ---------- Chips / segmented ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 14px; border-radius: 999px; background: var(--card); color: var(--text);
  border: 1px solid var(--line); font-size: .9rem; white-space: nowrap;
}
.chip:hover { text-decoration: none; border-color: var(--accent); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.segmented { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.segmented a { flex: 1; text-align: center; padding: 9px 8px; border-radius: 9px; color: var(--muted); font-weight: 600; display: flex; gap: 6px; justify-content: center; align-items: center; }
.segmented a:hover { text-decoration: none; color: var(--text); }
.segmented a.on { background: var(--card-2); color: var(--text); }
.segmented .icon { width: 18px; height: 18px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); font: 600 .95rem var(--sans); cursor: pointer;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.small { padding: 6px 12px; font-size: .85rem; border-radius: 10px; }

/* ---------- Feed & cards ---------- */
.feed { display: flex; flex-direction: column; gap: 14px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px 14px;
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.card-tag { font-size: .72rem; text-transform: uppercase; letter-spacing: 1.2px; color: var(--accent); font-weight: 700; margin-bottom: 10px; }
.scripture { font-family: var(--serif); font-size: 1.32rem; line-height: 1.6; }
.scripture.long { font-size: 1.12rem; }
.scripture.short { font-size: 1.6rem; line-height: 1.5; }
.scripture.xlong { font-size: 1.02rem; line-height: 1.55; }
.scripture .v + .v::before { content: " "; }
.vn { font-family: var(--sans); font-size: .58em; color: var(--muted); font-weight: 700; margin-right: 3px; vertical-align: super; line-height: 0; }
.wj { color: var(--wj); }
.ind { display: inline-block; width: 1.2em; }
.gap { color: var(--muted); padding: 0 .3em; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--line); }
.card-ref { font-weight: 700; font-size: .95rem; }
.card-actions { display: flex; gap: 2px; }
.act {
  background: none; border: 0; color: var(--muted); padding: 8px; border-radius: 10px; cursor: pointer; display: grid; place-items: center;
}
.act:hover { color: var(--text); background: var(--card-2); }
.act.fav.on { color: var(--fav); }
.act.fav.on svg { fill: currentColor; }
.act.pop { animation: pop .3s ease; }
@keyframes pop { 50% { transform: scale(1.3); } }

.prayer-title { font-family: var(--serif); font-size: 1.35rem; }
.prayer-title a { color: var(--text); }
.prayer-body { font-family: var(--serif); font-size: 1.15rem; line-height: 1.65; }
.prayer-body p { margin: 0 0 .8em; }
.prayer-note { color: var(--muted); font-size: .9rem; font-style: italic; margin: 0; }
.card.pause { background: linear-gradient(160deg, var(--card-2), var(--card)); border-color: var(--accent); }
.pause-lead { color: var(--muted); margin-top: 0; }

.sentinel { display: grid; place-items: center; min-height: 80px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.end-note { text-align: center; color: var(--muted); padding: 22px 8px; font-family: var(--serif); font-style: italic; }
.empty { text-align: center; color: var(--muted); padding: 40px 12px; }
.empty .btn { margin-top: 12px; }

/* ---------- Page headers, panels ---------- */
.page-head { margin: 6px 0 16px; }
.page-head.compact { margin-bottom: 12px; }
.page-head p { margin: .2em 0 .8em; }
.eyebrow { text-transform: uppercase; letter-spacing: 1.2px; font-size: .75rem; color: var(--accent); font-weight: 700; margin: 0 0 4px !important; }
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); margin-bottom: 8px; }
.back .icon { width: 18px; height: 18px; }
.section-title { font-size: 1.05rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 22px 0 10px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.panel h2 { font-size: 1.15rem; }
.panel h3 { font-size: 1rem; margin-top: 18px; }
.notice { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; border: 1px solid; }
.notice.ok { border-color: var(--ok); color: var(--ok); }
.notice.bad { border-color: var(--bad); color: var(--bad); }
.translation-note { color: var(--muted); font-size: .8rem; text-align: center; margin: 22px 8px 0; }
.links { margin: 8px 0 0; padding-left: 18px; }

/* ---------- Topics ---------- */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.topic {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 14px; border-radius: 16px; background: var(--card);
  border: 1px solid var(--line); color: var(--text); min-height: 118px;
}
.topic:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.topic-icon { font-size: 1.6rem; line-height: 1; }
.topic-name { font-weight: 700; }
.topic-blurb { font-size: .82rem; color: var(--muted); }

/* ---------- Bible reader ---------- */
.reader-bar {
  position: sticky; top: var(--top-h); z-index: 15; margin: -12px -14px 12px; padding: 10px 14px 8px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.reader-bar-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.reader-pick { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; }
.reader-pick .icon { color: var(--accent); }
.reader-pct { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 700; }
.progress { height: 6px; background: var(--card-2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s ease; min-width: 2px; }
.reader .feed { gap: 0; }
.load-prev { width: 100%; justify-content: center; margin-bottom: 8px; }
.chapter { font-family: var(--serif); font-size: 1.2rem; line-height: 1.75; padding: 8px 2px 18px; }
.chapter-title { font-family: var(--sans); font-size: 1.3rem; margin: 18px 0 8px; }
.chapter-title a { color: var(--text); }
.section-heading { font-family: var(--sans); font-size: .95rem; color: var(--accent); font-weight: 700; margin: 18px 0 4px; font-style: italic; }
.para { margin: 0 0 .9em; }
.chapter .v { scroll-margin-top: calc(var(--top-h) + 80px); }
.chapter .v:target, .chapter .v.flash { background: color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 4px; }
.end-note a { color: var(--accent); }

.book-list { display: flex; flex-direction: column; gap: 6px; }
.book { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.book summary { padding: 12px 14px; cursor: pointer; font-weight: 600; display: flex; justify-content: space-between; list-style: none; }
.book summary::-webkit-details-marker { display: none; }
.book[open] summary { border-bottom: 1px solid var(--line); }
.chapter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; padding: 12px; }
.chapter-grid a { display: grid; place-items: center; height: 40px; border-radius: 10px; background: var(--card-2); color: var(--text); font-weight: 600; }
.chapter-grid a:hover { background: var(--accent); color: var(--accent-ink); text-decoration: none; }

/* ---------- Mass ---------- */
.date-strip { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.date-nav { color: var(--muted); padding: 8px 4px; display: grid; place-items: center; }
.date-days { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.date-day { display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: 12px; color: var(--text); border: 1px solid transparent; }
.date-day:hover { text-decoration: none; background: var(--card); }
.date-day .dow { font-size: .7rem; color: var(--muted); text-transform: uppercase; }
.date-day .dom { font-weight: 700; font-size: 1.05rem; }
.date-day.today { border-color: var(--line); }
.date-day.on { background: var(--accent); }
.date-day.on .dow, .date-day.on .dom { color: var(--accent-ink); }
.date-pick { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.date-pick input { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font: inherit; }
.mass-group { font-size: 1.1rem; color: var(--accent); margin: 14px 0 0; }
.reading-cite { font-size: 1.05rem; color: var(--muted); font-weight: 600; }
.reading-text { font-size: 1.08rem; line-height: 1.55; }
.reading-text.long { font-size: .98rem; }
.reading-text.xlong { font-size: .92rem; }
.parish h2 { margin-bottom: 2px; }
.stream-note { margin: 10px 0 4px; }
.times { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: .92rem; }
.times th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px 6px 0; width: 45%; vertical-align: top; }
.times td { padding: 6px 0; }
.times tr + tr { border-top: 1px solid var(--line); }
.yt-lite {
  position: relative; aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; margin-top: 12px;
  background: #000 center/cover no-repeat; display: grid; place-items: center;
}
.yt-lite:not(.thumb) { background: radial-gradient(circle at 50% 40%, #2b3247, #0b0d12); }
.yt-lite iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-play {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(0,0,0,.65); color: #fff; font: 700 .95rem var(--sans); backdrop-filter: blur(4px);
}
.yt-play:hover { background: #c4302b; }
.yt-lite.thumb .yt-play { padding: 12px; }
.yt-lite.thumb .yt-play svg { fill: #fff; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.video .yt-lite { margin-top: 6px; }
.video-title { margin: 6px 0 0; font-size: .9rem; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video p.muted { margin: 2px 0 0; }

/* ---------- Search / me ---------- */
.search-form { display: flex; gap: 8px; margin: 10px 0; }
.search-form input {
  flex: 1; min-width: 0; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit;
}
.search-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.results { padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.results li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-family: var(--serif); }
.results strong { font-family: var(--sans); font-size: .9rem; margin-right: 6px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 8px; text-align: center; display: flex; flex-direction: column; }
.stat-n { font-size: 1.7rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat-l { font-size: .78rem; color: var(--muted); }
.code { font: 700 1.05rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 1px; background: var(--card-2); padding: 10px 12px; border-radius: 10px; word-break: break-all; user-select: all; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 50; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 760px) {
  .scripture { font-size: 1.45rem; }
  .main { padding-top: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Accounts ---------- */
.signin-link { font-weight: 700; font-size: .9rem; color: var(--accent) !important; padding: 8px 10px !important; }
.top-actions a.signed-in { color: var(--accent); }
.auth { max-width: 440px; margin: 8px auto 0; }
.auth h1 { margin-bottom: .3em; }
.auth-links { text-align: center; color: var(--muted); margin-top: 16px; }
.form { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }
.form.row { flex-direction: row; align-items: flex-end; flex-wrap: wrap; }
.form.row .grow { flex: 1; min-width: 180px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: .9rem; font-weight: 600; }
.field input {
  padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: 400 1rem var(--sans); width: 100%;
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--accent); font: 600 .85rem var(--sans); cursor: pointer; padding: 6px 8px; }
.check { display: flex; gap: 8px; align-items: center; font-size: .92rem; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.btn.block { width: 100%; justify-content: center; }
.btn.danger { background: #c0392b; border-color: #c0392b; color: #fff; }
.btn.ghost.danger { background: transparent; color: #e06c5f; border-color: #e06c5f; }
.hint { color: var(--muted); font-size: .85rem; margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.code-input { font: 700 1.4rem ui-monospace, Menlo, Consolas, monospace !important; letter-spacing: 4px; text-align: center; }
.notice.warn { border-color: var(--bad); color: var(--text); }
.notice .inline { display: inline; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
.badge { display: inline-block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; padding: 2px 8px; border-radius: 99px; border: 1px solid; vertical-align: middle; }
.badge.ok { color: var(--ok); border-color: var(--ok); }
.badge.warn { color: var(--bad); border-color: var(--bad); }
details.sub { margin: 12px 0; }
details.sub summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.activity { list-style: none; padding: 0; margin: 8px 0 0; }
.activity li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.danger-zone { border-color: color-mix(in srgb, #c0392b 50%, var(--line)); }
.steps { padding-left: 20px; } .steps li { margin-bottom: 10px; }
.qr { background: #fff; padding: 10px; border-radius: 12px; width: 220px; height: 220px; margin: 10px 0; }
.qr svg { width: 100%; height: 100%; display: block; }
.recovery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; list-style: none; padding: 0; }
.recovery code { display: block; text-align: center; padding: 8px; background: var(--card-2); border-radius: 8px; font: 700 1rem ui-monospace, Menlo, Consolas, monospace; }

/* ---------- Full-screen snap tiles (one card per screen, swipe to the next) ---------- */
html.snap { --bar-h: 0px; scroll-snap-type: y mandatory; scroll-padding-top: calc(var(--top-h) + var(--bar-h) + 8px); }
html.snap:has(.snap-bar) { --bar-h: 50px; }
html.snap .main { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 8px); }
.snap-bar {
  position: sticky; top: var(--top-h); z-index: 12; height: var(--bar-h); margin: -12px -14px 0; padding: 0 14px;
  display: flex; align-items: center; gap: 6px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.snap-bar .chips { padding: 0; }
.topic-bar .back { margin: 0; padding: 6px; }
.topic-bar-title { font-weight: 700; font-size: 1.05rem; }
.feed.tiles { gap: 16px; padding-top: 8px; }
.tile {
  height: calc(100dvh - var(--top-h) - var(--bar-h) - var(--tab-h) - var(--safe-b) - 16px);
  min-height: 300px; scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; flex-direction: column; overflow: hidden;
}
.tile-main { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
/* Center content when it fits; start at the top when it's taller than the tile. */
.tile-main > :first-child { margin-top: auto; }
.tile-main > :last-child { margin-bottom: auto; }
.tile .card-foot { flex: none; }
.prayer-body.long { font-size: 1rem; line-height: 1.55; }
.end-tile { text-align: center; }
.end-amen { font-family: var(--serif); font-size: 1.8rem; margin: 0 0 8px; color: var(--accent); }
.center-row { justify-content: center; }
.mass-intro .segmented { margin-bottom: 12px; }
.mass-title { font-family: var(--serif); font-size: 1.5rem; text-align: center; margin: 2px 0 4px; }
.mass-divider .mass-title { font-size: 1.8rem; }
.podcast { background: var(--card-2); border-radius: 14px; padding: 12px 14px; margin: 14px 0 6px; }
.podcast-head { display: flex; align-items: center; gap: 6px; font-weight: 700; margin: 0 0 8px; }
.podcast-head .icon { width: 18px; height: 18px; color: var(--accent); fill: currentColor; }
.podcast-label { margin: 8px 0 4px; font-size: .85rem; font-weight: 700; color: var(--accent); }
.podcast audio { width: 100%; height: 40px; }
.podcast p.small { margin: 8px 0 0; }
.swipe-hint { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 14px; animation: nudge 2.4s ease-in-out infinite; }
.swipe-hint::before { content: "↑ "; }
@keyframes nudge { 0%, 100% { transform: translateY(0); opacity: .7; } 50% { transform: translateY(-5px); opacity: 1; } }
details.parish summary { cursor: pointer; list-style: none; display: flex; flex-direction: column; gap: 2px; }
details.parish summary::-webkit-details-marker { display: none; }
details.parish summary::after { content: "Show"; color: var(--accent); font-size: .8rem; font-weight: 700; }
details.parish[open] summary::after { content: "Hide"; }
.parish-name { font-weight: 700; font-size: 1.05rem; }

/* ---------- Read aloud ---------- */
.reader-tools { display: flex; align-items: center; gap: 8px; }
.tts-btn .icon { width: 18px; height: 18px; }
.tts-btn[aria-pressed="true"] { background: var(--card-2); color: var(--accent); }
.tts-panel { display: flex; gap: 10px; align-items: flex-end; margin-top: 8px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.tts-panel[hidden] { display: none; }
.tts-panel label { display: flex; flex-direction: column; gap: 3px; }
.tts-panel label.grow { flex: 1; min-width: 150px; }
.tts-panel select { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: .9rem; max-width: 100%; }
.chapter .v.speaking { background: color-mix(in srgb, var(--accent) 26%, transparent); border-radius: 4px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 26%, transparent); }
.results .ctx { display: inline-block; margin-left: 6px; font-size: .85em; white-space: nowrap; }
.small { font-size: .88rem; }

/* =====================================================================
   Accessibility & display preferences (classes on <html> from Prefs)
   ===================================================================== */
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/AtkinsonHyperlegible-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/AtkinsonHyperlegible-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "OpenDyslexic"; src: url("fonts/OpenDyslexic-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
:root { --bar-h: 0px; --season: var(--accent); }
html:has(.snap-bar) { --bar-h: 50px; }
html.fs-1 { font-size: 87.5%; }
html.fs-2 { font-size: 93.75%; }
html.fs-3 { font-size: 100%; }
html.fs-4 { font-size: 112.5%; }
html.fs-5 { font-size: 125%; }
html.fs-6 { font-size: 140%; }
html.font-sans { --serif: var(--sans); }
html.font-atkinson { --serif: "Atkinson Hyperlegible", var(--sans); --sans: "Atkinson Hyperlegible", system-ui, sans-serif; }
html.font-dyslexic { --serif: "OpenDyslexic", var(--sans); --sans: "OpenDyslexic", system-ui, sans-serif; }
html.font-dyslexic .scripture, html.font-dyslexic .chapter, html.font-dyslexic .prayer-body { line-height: 1.8; }
html.spaced .scripture, html.spaced .chapter, html.spaced .prayer-body, html.spaced .lectio-text, html.spaced p { line-height: 1.95; letter-spacing: .035em; word-spacing: .12em; }
html.no-red .wj { color: inherit; }
html.no-vn .vn { display: none; }
html.theme-dark {
  --bg: #12151c; --bg-2: #181c26; --card: #1d2230; --card-2: #242a3a; --line: #2e3546; --text: #ecebe6; --muted: #98a1b3;
  --accent: #d8b45a; --accent-ink: #1a1507; --wj: #f08a7e; --fav: #f06d7b; color-scheme: dark;
}
html.theme-light {
  --bg: #f6f1e7; --bg-2: #efe8da; --card: #fffdf8; --card-2: #f4eee2; --line: #e2d8c4;
  --text: #23201a; --muted: #6f6758; --accent: #8a6a16; --accent-ink: #fffdf8; --wj: #a8322a; --fav: #c8364a; color-scheme: light;
}
html.theme-sepia {
  --bg: #f1e4c8; --bg-2: #eadbbb; --card: #f8eed8; --card-2: #efe1c2; --line: #d9c49c;
  --text: #3b2a16; --muted: #75603f; --accent: #8a5a12; --accent-ink: #fff8ea; --wj: #9b2c1f; --fav: #b3374a; color-scheme: light;
}
html.hc { --bg: #000; --bg-2: #000; --card: #0d0d0d; --card-2: #1a1a1a; --line: #9aa3b5; --text: #fff; --muted: #e2e6ee; --accent: #ffd35c; --accent-ink: #000; --wj: #ff9d93; color-scheme: dark; }
html.hc.theme-light, html.hc.theme-sepia { --bg: #fff; --bg-2: #fff; --card: #fff; --card-2: #f0f0f0; --line: #222; --text: #000; --muted: #222; --accent: #5a3d00; --accent-ink: #fff; --wj: #8a0000; color-scheme: light; }
html.hc .card, html.hc .panel { border-width: 2px; }
html.hc a:not(.btn):not(.tab):not(.chip) { text-decoration: underline; }
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.reduce-motion .tile { height: auto; min-height: 0; }
@media (prefers-reduced-motion: reduce) { .swipe-hint { animation: none; } }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
@media (max-width: 400px) { .brand-name { display: none; } .signin-link { padding: 8px 6px !important; } }

/* Liturgical colors */
.c-green { --lit: #3f8f5a; } .c-violet { --lit: #7d4fb0; } .c-white { --lit: #e9dfc4; } .c-red { --lit: #c0392b; } .c-rose { --lit: #d98aa7; }
html.season-green { --season: #3f8f5a; } html.season-violet { --season: #8a5cc0; } html.season-white { --season: #d8b45a; }
html.season-red { --season: #c0392b; } html.season-rose { --season: #d98aa7; }
html[class*="season-"] .topbar { box-shadow: inset 0 -2px 0 var(--season); }
html[class*="season-"] .tab.active { color: var(--season); }
html.season-white .tab.active { color: var(--accent); }
.lit-dot { display: inline-block; width: .8em; height: .8em; border-radius: 50%; background: var(--lit, var(--accent)); margin-right: 6px; vertical-align: -.05em; box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 25%, transparent); flex: none; }
.lit-line { color: var(--muted); font-size: .88rem; margin: 2px 0 8px; }
.lit-pill .icon { color: var(--season); }

/* Today tile */
.today-tile { background: linear-gradient(165deg, color-mix(in srgb, var(--lit) 22%, var(--card)), var(--card) 65%); border-color: color-mix(in srgb, var(--lit) 45%, var(--line)); }
.today-title { font-family: var(--serif); font-size: 1.55rem; margin: 2px 0 2px; }
.saint { background: color-mix(in srgb, var(--card-2) 75%, transparent); border-radius: 14px; padding: 12px 14px; margin: 10px 0; }
.saint h3 { font-family: var(--serif); font-size: 1.15rem; margin: 0 0 4px; }
.saint p { margin: 0; line-height: 1.55; }
.saint .card-tag { margin-bottom: 4px; }
.saint-bio { line-height: 1.55; }
.today-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.today-actions .btn { justify-content: flex-start; text-align: left; display: flex; gap: 8px; align-items: center; }
.today-actions .icon { width: 18px; height: 18px; flex: none; }

/* Guided prayer tile */
.guided-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 8px; }
.guided { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 14px; background: var(--card-2); color: var(--text); border: 1px solid var(--line); }
.guided:hover { text-decoration: none; border-color: var(--accent); }
.guided .icon { width: 26px; height: 26px; color: var(--accent); }
.guided strong { font-size: 1rem; }
.guided span { font-size: .8rem; color: var(--muted); }

/* Calendar */
.day-card { padding: 16px 18px; border-left: 6px solid var(--lit); margin-bottom: 14px; }
.day-card h2 { font-family: var(--serif); font-size: 1.4rem; margin: 2px 0; }
.month-nav { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 6px; }
.month-nav h2 { margin: 0; font-size: 1.2rem; }
.lit-days { list-style: none; padding: 0; margin: 0 0 20px; }
.lit-days .season-row { font-size: .75rem; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 800; color: var(--lit); padding: 14px 4px 6px; }
.lit-day a { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 12px; color: var(--text); border-top: 1px solid var(--line); }
.lit-day a:hover { text-decoration: none; background: var(--card); }
.lit-day.on a { background: var(--card-2); }
.lit-day.today .dom { color: var(--accent); }
.ld-date { display: flex; flex-direction: column; align-items: center; width: 38px; flex: none; }
.ld-date .dow { font-size: .68rem; color: var(--muted); text-transform: uppercase; }
.ld-date .dom { font-weight: 800; font-size: 1.05rem; }
.ld-title { display: flex; flex-direction: column; font-size: .92rem; line-height: 1.3; }
.ld-title small { color: var(--muted); font-size: .8rem; }
.lit-day.k-solemnity .ld-title, .lit-day.k-sunday .ld-title, .lit-day.k-triduum .ld-title { font-weight: 800; }
.lit-day.k-feast .ld-title { font-weight: 700; }

/* Rosary beads */
.beads { margin: 14px 0; text-align: center; }
.bead-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.bead { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent); transition: background .2s, transform .2s; }
.bead.on { background: var(--accent); transform: scale(1.12); }
.bead-btn { min-width: 220px; justify-content: center; font-size: 1.05rem; padding: 14px 18px; }
.bead-count { opacity: .75; font-variant-numeric: tabular-nums; margin-left: 6px; }
.beads.complete .bead-btn { background: var(--card-2); color: var(--accent); }
.after-beads { opacity: .5; transition: opacity .3s; }
.after-beads.show { opacity: 1; }
.fruit { text-align: center; color: var(--muted); margin-top: 12px; }
.mystery .scripture { text-align: center; }
details.sub { margin: 8px 0; }
details.sub summary { cursor: pointer; color: var(--accent); font-weight: 700; font-size: .9rem; }

/* Lectio / Examen */
.lectio-text { font-family: var(--serif); font-size: 1.2rem; line-height: 1.6; }
.lectio-passage { font-size: 1.15rem; }
.lectio-q { font-family: var(--serif); font-size: 1.1rem; line-height: 1.55; padding-left: 1.1em; }
.lectio-q li { margin: 6px 0; }
textarea.journal { width: 100%; background: var(--card-2); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: 1rem/1.5 var(--sans); resize: vertical; margin-top: 10px; }
.timer { text-align: center; }
.timer-face { font: 800 3rem/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--accent); margin: 14px 0; }
.timer.running .timer-face { animation: breathe 8s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* Examination of conscience */
.privacy-note { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; margin: 10px 0; }
.privacy-note .icon { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.exam-sec summary { cursor: pointer; font-weight: 700; display: flex; gap: 10px; align-items: baseline; line-height: 1.35; }
.exam-num { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%; background: var(--card-2); color: var(--accent); font-size: .85rem; flex: none; }
.checklist { list-style: none; padding: 0; margin: 10px 0 0; }
.checklist li { border-top: 1px solid var(--line); }
.checklist label { display: flex; gap: 10px; padding: 10px 2px; align-items: flex-start; cursor: pointer; line-height: 1.45; }
.checklist input { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--accent); }
.my-list { padding-left: 1.2em; line-height: 1.5; }
.my-list li { margin: 6px 0; }
.count-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: .72rem; padding: 0 5px; }
.steps { padding-left: 1.2em; }
.steps li { margin: 10px 0; }
.steps p { margin: 4px 0 0; color: var(--muted); line-height: 1.5; }

/* Plans */
.plan-list { display: grid; gap: 10px; }
.plan { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 10px; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--text); }
.plan:hover { text-decoration: none; border-color: var(--accent); }
.plan-icon { grid-row: 1 / span 3; font-size: 1.7rem; line-height: 1; align-self: center; }
.plan-name { font-weight: 700; }
.plan .progress { grid-column: 2; margin-top: 8px; }
.plan.active { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.plan-days { list-style: none; padding: 0; margin: 10px 0 20px; }
.plan-days a { display: flex; gap: 12px; align-items: center; padding: 9px 6px; border-top: 1px solid var(--line); color: var(--text); font-size: .92rem; }
.plan-days a:hover { text-decoration: none; background: var(--card); }
.pd-n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--card-2); font-weight: 800; font-size: .8rem; flex: none; }
.plan-days .done .pd-n { background: var(--accent); color: var(--accent-ink); }
.plan-days .done .pd-n .icon { width: 16px; height: 16px; }
.plan-days .next a { background: var(--card); font-weight: 700; }
.plan-day-label { color: var(--muted); font-weight: 700; margin: 4px 0 0; }
.plan-done-bar { margin: 10px 0 20px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.plan-done-bar .icon { width: 18px; height: 18px; vertical-align: -3px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; margin-bottom: 8px; }

/* Settings */
.settings .panel { display: flex; flex-direction: column; gap: 12px; }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card-2); cursor: pointer; font-weight: 600; }
.radio-pill:has(input:checked) { border-color: var(--accent); color: var(--accent); }
.switch { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer; line-height: 1.4; }
.switch input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.switch input[type=time], .settings select, [data-offline-book] { background: var(--card-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font: inherit; }
.field output { color: var(--accent); margin-left: 6px; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.preview { background: var(--card-2); border-radius: 12px; padding: 12px 14px; }
.settings-save { position: sticky; bottom: calc(var(--tab-h) + var(--safe-b) + 8px); text-align: center; z-index: 5; }
.settings-save .btn { box-shadow: 0 6px 20px rgba(0,0,0,.35); }
#reminders h2 .icon, #offline h2 .icon { width: 20px; height: 20px; vertical-align: -3px; color: var(--accent); }
.offline-bar { position: fixed; top: var(--top-h); left: 0; right: 0; z-index: 40; background: var(--bad); color: #1a1507; text-align: center; font-size: .85rem; font-weight: 700; padding: 6px; }
.offline-bar[hidden] { display: none; }
.act .icon { pointer-events: none; }
html[lang=es] details.parish summary::after { content: "Mostrar"; }
html[lang=es] details.parish[open] summary::after { content: "Ocultar"; }
.plan .progress, .plan .progress-fill { display: block; }
.switch > span { flex: 1 1 180px; min-width: 0; }
