:root {
  --ink: #173d53;
  --ink-2: #24546d;
  --ink-soft: #eaf1f4;
  --gold: #c5963c;
  --gold-soft: #f7eed9;
  --rose: #a75d66;
  --rose-soft: #f7eaec;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f4f3ef;
  --text: #19313e;
  --muted: #63747d;
  --border: #dde4e6;
  --success: #38745e;
  --danger: #a23b3b;
  --shadow: 0 18px 50px rgba(23, 61, 83, .12);
  --shadow-soft: 0 7px 24px rgba(23, 61, 83, .08);
  --radius-xl: 1.6rem;
  --radius-lg: 1.15rem;
  --radius-md: .85rem;
  --font-scale: 1;
  color-scheme: light;
}

html[data-theme="dark"] {
  --ink: #a9d4e9;
  --ink-2: #8fc0d8;
  --ink-soft: #193542;
  --gold: #e0b663;
  --gold-soft: #423821;
  --rose: #e39aa4;
  --rose-soft: #412d33;
  --paper: #10232c;
  --surface: #17303b;
  --surface-2: #1b3743;
  --text: #eef5f6;
  --muted: #b2c2c8;
  --border: #31505c;
  --success: #86c9ad;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
  --shadow-soft: 0 7px 24px rgba(0, 0, 0, .2);
  color-scheme: dark;
}

html[data-font="large"] { --font-scale: 1.12; }
html[data-font="xlarge"] { --font-scale: 1.24; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: calc(16px * var(--font-scale)); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 92% 3%, rgba(197, 150, 60, .14), transparent 24rem),
    linear-gradient(180deg, var(--paper), var(--surface-2));
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(5.8rem + env(safe-area-inset-bottom));
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: var(--ink-2); }
svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; background: var(--surface); color: var(--text); padding: .8rem 1rem; border-radius: .6rem; box-shadow: var(--shadow); }
.skip-link:focus { top: 1rem; }

.topbar {
  width: min(100% - 2rem, 74rem);
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 0 .8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand { display: flex; align-items: center; gap: .78rem; min-width: 0; }
.brand-mark {
  width: 2.7rem;
  aspect-ratio: 1;
  flex: 0 0 auto;
  border-radius: 50% 50% 46% 54%;
  display: grid;
  place-items: center;
  background: var(--ink);
  box-shadow: 0 7px 18px rgba(23, 61, 83, .22);
  transform: rotate(-3deg);
}
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; background: var(--gold-soft); border-radius: 3px; }
.brand-mark::before { width: .32rem; height: 1.42rem; }
.brand-mark::after { width: 1rem; height: .32rem; margin-top: -.35rem; }
.brand-mark { position: relative; }
.brand strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 1.12rem; letter-spacing: -.01em; }
.brand small { display: block; color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: .5rem; }

.icon-button, .close-button {
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.icon-button:hover, .icon-button:focus-visible, .close-button:hover, .close-button:focus-visible { border-color: var(--gold); background: var(--gold-soft); }

main { width: min(100% - 2rem, 74rem); margin: 0 auto; }
.view { animation: view-in .28s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(.4rem); } to { opacity: 1; transform: translateY(0); } }

.greeting-row { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 1rem; padding: 1.35rem 0 1.1rem; }
.eyebrow { margin: 0 0 .28rem; color: var(--gold); font-size: .74rem; line-height: 1.2; font-weight: 800; text-transform: uppercase; letter-spacing: .13em; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { color: var(--text); }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 5vw, 3.7rem); line-height: 1.05; letter-spacing: -.035em; font-weight: 600; }
h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.45rem, 3vw, 2.1rem); line-height: 1.15; font-weight: 600; }
h3 { margin: 0; font-size: 1.05rem; line-height: 1.3; }
.intro { max-width: 40rem; margin: .65rem 0 0; color: var(--muted); }
.streak { width: 4.4rem; height: 4.4rem; border-radius: 50%; display: grid; place-content: center; text-align: center; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 42%, transparent); }
.streak span { font-size: 1.35rem; font-weight: 800; line-height: 1; color: var(--gold); }
.streak small { display: block; font-size: .69rem; color: var(--muted); margin-top: .15rem; }

.hero-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(140deg, #14384b, #215873);
  color: #f8fbfc;
  border-radius: var(--radius-xl);
  padding: clamp(1.25rem, 4vw, 2.35rem);
  box-shadow: var(--shadow);
  isolation: isolate;
}
.hero-card::before { content: ""; position: absolute; width: 18rem; height: 18rem; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; right: -8rem; top: -10rem; box-shadow: 0 0 0 2.8rem rgba(255,255,255,.035), 0 0 0 5.8rem rgba(255,255,255,.025); z-index: -1; }
.hero-card .card-kicker { display: flex; align-items: center; gap: .55rem; color: #ead8a5; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.pulse-dot { width: .55rem; height: .55rem; border-radius: 50%; background: #e8be62; box-shadow: 0 0 0 .28rem rgba(232,190,98,.16); }
.scripture-quote { max-width: 48rem; margin: 1rem 0 .7rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.35rem, 3.5vw, 2rem); line-height: 1.42; }
.hero-card .reference { color: #d8e6ec; margin: 0; font-weight: 700; font-size: .9rem; }
.hero-card .reflection { max-width: 46rem; margin: .95rem 0 0; color: #cbdce3; font-size: .92rem; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin-top: 1.35rem; }

.primary-button, .soft-button, .text-button, .link-button {
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .48rem;
  min-height: 2.75rem;
  font-weight: 750;
  text-decoration: none;
}
.primary-button { padding: .72rem 1rem; border-radius: .8rem; color: #173342; background: #e9c46a; box-shadow: 0 7px 16px rgba(9,27,35,.18); }
.primary-button:hover, .primary-button:focus-visible { background: #f1cf7c; transform: translateY(-1px); }
.primary-button.large { padding-inline: 1.4rem; min-width: 8rem; }
.soft-button { padding: .68rem .9rem; border: 1px solid var(--border); border-radius: .8rem; color: var(--text); background: var(--surface); }
.hero-card .soft-button { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); color: #fff; }
.soft-button:hover, .soft-button:focus-visible { border-color: var(--gold); background: var(--gold-soft); }
.soft-button.icon-only, .favorite-action { width: 2.8rem; padding: 0; }
.soft-button.is-favorite svg, .favorite-action.is-favorite svg { fill: var(--rose); color: var(--rose); }
.text-button { min-height: 2.2rem; padding: .25rem; background: transparent; color: inherit; }
.text-button svg { width: 1rem; height: 1rem; }
.text-button:hover, .text-button:focus-visible { color: var(--gold); }
.card-actions .text-button { color: #fff; margin-left: .2rem; }
button:disabled { opacity: .42; cursor: not-allowed; transform: none !important; }

.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .85rem; margin: 1rem 0 2.15rem; }
.quick-card { min-height: 5rem; display: flex; align-items: center; gap: .8rem; text-align: left; padding: .85rem; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-soft); cursor: pointer; }
.quick-card:hover, .quick-card:focus-visible { border-color: color-mix(in srgb, var(--gold) 68%, var(--border)); transform: translateY(-2px); }
.quick-icon { width: 2.7rem; aspect-ratio: 1; flex: 0 0 auto; display: grid; place-items: center; border-radius: .85rem; }
.quick-icon.blue { color: var(--ink-2); background: var(--ink-soft); }
.quick-icon.gold { color: #92691d; background: var(--gold-soft); }
.quick-icon.rose { color: var(--rose); background: var(--rose-soft); }
.quick-card strong, .quick-card small { display: block; }
.quick-card strong { font-size: .95rem; }
.quick-card small { color: var(--muted); font-size: .76rem; }

.section-block { margin: 0 0 2rem; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: .9rem; }
.saint-card { display: grid; grid-template-columns: 5rem 1fr; gap: 1rem; align-items: start; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: 1rem; box-shadow: var(--shadow-soft); }
.saint-date { display: grid; place-content: center; text-align: center; min-height: 5rem; border-radius: 1rem; background: var(--gold-soft); color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 34%, transparent); }
.saint-date span { font-family: Georgia, serif; font-size: 2rem; line-height: 1; }
.saint-date small { margin-top: .25rem; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .11em; }
.content-label { display: inline-flex; width: fit-content; padding: .18rem .48rem; border-radius: 999px; background: var(--ink-soft); color: var(--ink-2); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.saint-content h3 { margin: .38rem 0 .42rem; font-family: Georgia, serif; font-size: 1.3rem; }
.saint-content p { margin: 0; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.saint-content .text-button { margin-top: .55rem; color: var(--ink-2); }

.daily-path { border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--border); padding: 1.15rem; box-shadow: var(--shadow-soft); }
.progress-label { color: var(--muted); font-size: .82rem; font-weight: 700; }
.path-progress, .rosary-progress { height: .38rem; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.path-progress span, .rosary-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), #e4c779); transition: width .35s ease; }
.path-items { margin-top: .6rem; }
.path-item { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .8rem; padding: .85rem .2rem; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.path-item:last-child { border-bottom: 0; }
.path-item strong, .path-item small { display: block; }
.path-item small { color: var(--muted); font-size: .78rem; margin-top: .1rem; }
.task-check { width: 1.65rem; height: 1.65rem; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border); color: transparent; }
.task-check svg { width: .95rem; }
.path-item.is-complete .task-check { color: #fff; border-color: var(--success); background: var(--success); }
.chevron { color: var(--muted); width: 1rem; }

.page-heading { max-width: 45rem; padding: 2.1rem 0 1.35rem; }
.page-heading p:last-child { color: var(--muted); margin: .7rem 0 0; }
.complete-bible-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .85rem; width: 100%; max-width: 42rem; margin-bottom: .75rem; padding: .9rem; color: #f8fbfc; text-decoration: none; border-radius: var(--radius-lg); background: linear-gradient(135deg, #173d53, #245f78); box-shadow: var(--shadow-soft); }
.complete-bible-card:hover, .complete-bible-card:focus-visible { transform: translateY(-1px); box-shadow: var(--shadow); }
.complete-bible-mark { width: 2.75rem; aspect-ratio: 1; display: grid; place-items: center; border-radius: .82rem; color: #f3d487; background: rgba(255,255,255,.1); }
.complete-bible-card strong, .complete-bible-card small { display: block; }
.complete-bible-card small { margin-top: .12rem; color: #d3e4ea; font-size: .76rem; }
.complete-bible-card .chevron { color: #fff; }
.search-box { display: flex; align-items: center; gap: .6rem; width: 100%; max-width: 42rem; background: var(--surface); border: 1px solid var(--border); border-radius: .95rem; padding: 0 .85rem; box-shadow: var(--shadow-soft); }
.search-box svg { color: var(--muted); flex: 0 0 auto; }
.search-box input { width: 100%; min-height: 3.15rem; border: 0; outline: 0; background: transparent; color: var(--text); }
.search-box:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent); }
.filter-pills { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; padding: 1rem 0 .85rem; }
.filter-pills::-webkit-scrollbar { display: none; }
.filter-pill { flex: 0 0 auto; min-height: 2.35rem; border: 1px solid var(--border); border-radius: 999px; padding: .45rem .82rem; background: var(--surface); cursor: pointer; font-weight: 700; font-size: .82rem; }
.filter-pill.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.content-list { display: grid; gap: .75rem; padding-bottom: 1rem; }
.content-card { display: grid; grid-template-columns: 3rem 1fr auto; gap: .85rem; align-items: center; width: 100%; padding: 1rem; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-soft); text-align: left; }
.content-card .book-badge { width: 3rem; aspect-ratio: 1; display: grid; place-items: center; border-radius: .9rem; background: var(--ink-soft); color: var(--ink-2); }
.content-card .book-badge svg { width: 1.35rem; }
.content-card h3 { margin-bottom: .18rem; }
.content-card p { margin: 0; color: var(--muted); font-size: .83rem; }
.content-card .card-open { width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border: 0; background: transparent; border-radius: 50%; cursor: pointer; color: var(--muted); }
.content-card .card-open:hover { background: var(--gold-soft); color: var(--gold); }
.empty-state { text-align: center; padding: 3.2rem 1rem; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius-lg); }
.empty-state svg { width: 2.6rem; height: 2.6rem; color: var(--gold); margin-bottom: .6rem; }
.empty-state h3 { margin-bottom: .3rem; }
.empty-state p { margin: 0; }

.rosary-heading { text-align: center; margin-inline: auto; }
.may-banner { max-width: 45rem; margin: 0 auto 1rem; display: flex; align-items: flex-start; gap: .8rem; padding: .95rem; border-radius: var(--radius-lg); background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 38%, transparent); }
.may-banner > span { color: var(--gold); font-size: 1.45rem; }
.may-banner p { margin: .15rem 0 0; color: var(--muted); font-size: .85rem; }
.mystery-tabs { display: flex; gap: .5rem; overflow-x: auto; max-width: 48rem; margin: 0 auto 1rem; padding: .2rem .1rem .5rem; scrollbar-width: none; }
.mystery-tab { flex: 1 0 auto; min-width: 7.2rem; min-height: 2.7rem; border-radius: .85rem; border: 1px solid var(--border); background: var(--surface); padding: .55rem .75rem; font-weight: 700; cursor: pointer; }
.mystery-tab.is-active { color: #fff; background: var(--ink-2); border-color: var(--ink-2); box-shadow: var(--shadow-soft); }
.mystery-tab small { display: block; font-size: .65rem; opacity: .75; font-weight: 600; }
.rosary-player { max-width: 48rem; margin: 0 auto; position: relative; overflow: hidden; text-align: center; min-height: 28rem; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2.2rem clamp(1rem, 5vw, 3rem); border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow); }
.rosary-player::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 0, color-mix(in srgb, var(--gold-soft) 65%, transparent), transparent 42%); pointer-events: none; }
.rosary-orbit { width: 5.6rem; height: 5.6rem; margin-bottom: 1.3rem; position: relative; border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); border-radius: 50%; box-shadow: 0 0 0 .65rem color-mix(in srgb, var(--gold-soft) 65%, transparent); }
.rosary-orbit::before, .rosary-orbit::after { content: ""; position: absolute; border-radius: 50%; background: var(--gold); width: .7rem; height: .7rem; top: 50%; transform: translateY(-50%); }
.rosary-orbit::before { left: -.35rem; }
.rosary-orbit::after { right: -.35rem; }
.rosary-orbit span { position: absolute; width: .45rem; height: .45rem; border-radius: 50%; background: color-mix(in srgb, var(--gold) 70%, var(--surface)); }
.step-overline { position: relative; margin: 0 0 .35rem; color: var(--gold); font-weight: 800; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.rosary-player h2 { position: relative; max-width: 35rem; }
.prayer-text { position: relative; max-width: 38rem; min-height: 5rem; margin: .9rem 0; font-family: Georgia, serif; font-size: 1.08rem; line-height: 1.72; color: var(--muted); }
.decade-counter { position: relative; display: flex; align-items: baseline; gap: .35rem; margin: .3rem 0 .8rem; }
.decade-counter span { font-family: Georgia, serif; font-size: 2.4rem; color: var(--gold); }
.decade-counter small { color: var(--muted); }
.player-actions { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: .5rem; }
.rosary-progress { position: absolute; left: 1rem; right: 1rem; bottom: 1rem; }
.howto-card { max-width: 48rem; margin: 1rem auto 2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: .2rem 1rem; }
.howto-card summary { cursor: pointer; padding: .9rem 0; font-weight: 750; }
.howto-card ol { margin: 0 0 1rem; padding-left: 1.35rem; color: var(--muted); }

.prayer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; padding-bottom: 1rem; }
.prayer-card { min-height: 10rem; display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-soft); }
.prayer-card h3 { margin-top: .15rem; font-family: Georgia, serif; font-size: 1.22rem; }
.prayer-card p { margin: 0; color: var(--muted); font-size: .84rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.prayer-card .prayer-actions { display: flex; align-items: center; gap: .35rem; margin-top: auto; padding-top: .55rem; width: 100%; }
.prayer-card .prayer-actions .text-button { color: var(--ink-2); }
.prayer-card .prayer-actions .favorite-mini { margin-left: auto; width: 2.2rem; height: 2.2rem; padding: 0; min-height: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.favorite-mini.is-favorite { color: var(--rose); }
.favorite-mini.is-favorite svg { fill: currentColor; }

.bottom-nav { position: fixed; z-index: 40; left: 50%; bottom: max(.65rem, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 1rem), 38rem); display: grid; grid-template-columns: repeat(5, 1fr); gap: .15rem; padding: .42rem; border: 1px solid color-mix(in srgb, var(--border) 80%, transparent); border-radius: 1.4rem; background: color-mix(in srgb, var(--surface) 90%, transparent); box-shadow: 0 15px 45px rgba(14, 40, 52, .2); backdrop-filter: blur(16px); }
.nav-item { min-width: 0; min-height: 3.55rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; border: 0; border-radius: 1rem; background: transparent; color: var(--muted); cursor: pointer; font-size: .67rem; font-weight: 700; }
.nav-item svg { width: 1.28rem; height: 1.28rem; }
.nav-item.is-active { color: var(--ink-2); background: var(--ink-soft); }

.modal { width: min(calc(100% - 1.25rem), 42rem); max-height: min(88vh, 48rem); margin: auto; padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: 0 30px 90px rgba(0,0,0,.28); overflow: auto; }
.modal::backdrop { background: rgba(8, 25, 34, .62); backdrop-filter: blur(4px); }
.modal[open] { animation: modal-in .22s ease both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(1rem) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.15rem .85rem; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 1.55rem; }
.modal > .reference, .modal > .content-label, .modal > .reader-body, .modal > .reader-reflection, .modal > .virtue-box, .modal > .modal-actions { margin-left: 1.15rem; margin-right: 1.15rem; }
.modal > .reference { margin-top: 1rem; color: var(--gold); font-weight: 800; }
.reader-body { margin-top: 1rem; white-space: pre-line; font-family: Georgia, serif; font-size: 1.06rem; line-height: 1.8; }
.reader-reflection { padding: .9rem; border-left: .22rem solid var(--gold); background: var(--gold-soft); border-radius: 0 .75rem .75rem 0; color: var(--text); }
.modal-actions { display: flex; flex-wrap: wrap; gap: .6rem; padding: .4rem 0 1.2rem; }
.virtue-box { margin-top: 1rem; padding: 1rem; background: var(--ink-soft); border-radius: var(--radius-md); border: 0; }
.virtue-box span { color: var(--ink-2); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }
.virtue-box p { margin: .25rem 0 0; }
.close-button { flex: 0 0 auto; font-size: 1.5rem; line-height: 1; }

.settings-modal { width: min(calc(100% - 1.25rem), 36rem); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.15rem; border-bottom: 1px solid var(--border); }
.setting-row strong, .setting-row small { display: block; }
.setting-row small { margin-top: .18rem; color: var(--muted); font-size: .76rem; }
.segmented { display: flex; padding: .2rem; border-radius: .75rem; background: var(--surface-2); }
.segmented button { min-width: 2.35rem; height: 2.15rem; padding: .25rem; border: 0; border-radius: .58rem; background: transparent; cursor: pointer; font-weight: 800; }
.segmented button.is-active { background: var(--surface); color: var(--gold); box-shadow: var(--shadow-soft); }
.switch-button { width: 3.8rem; height: 2.15rem; display: flex; align-items: center; justify-content: space-between; padding: .25rem .4rem; border: 0; border-radius: 999px; background: var(--surface-2); cursor: pointer; }
.switch-button span { width: 1.55rem; height: 1.55rem; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-soft); transition: transform .2s ease; }
.switch-button svg { width: .95rem; color: var(--gold); }
.switch-button[aria-checked="true"] { background: var(--ink-2); }
.switch-button[aria-checked="true"] span { transform: translateX(1.42rem); }
.switch-button[aria-checked="true"] svg { transform: translateX(-1.75rem); color: #fff; }
.status-badge { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .35rem; color: var(--success); font-size: .75rem; font-weight: 800; }
.status-badge span { width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.status-badge span:last-child { width: auto; height: auto; border-radius: 0; background: transparent; }
.status-badge.is-offline { color: var(--gold); }
.settings-section { padding: 1rem 1.15rem; border-bottom: 1px solid var(--border); }
.settings-section:last-child { border-bottom: 0; }
.settings-section h3 { margin-bottom: .35rem; }
.settings-section p { margin: 0; color: var(--muted); font-size: .86rem; }
.settings-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.settings-title-row h3 { margin-top: 0; }
.offline-size { flex: 0 0 auto; margin-top: .1rem; padding: .22rem .5rem; border-radius: 999px; color: var(--ink-2); background: var(--ink-soft); font-size: .7rem; font-weight: 800; }
.offline-progress { display: grid; gap: .3rem; margin-top: .85rem; }
.offline-progress progress { width: 100%; height: .55rem; border: 0; border-radius: 999px; overflow: hidden; accent-color: var(--gold); background: var(--surface-2); }
.offline-progress progress::-webkit-progress-bar { border-radius: 999px; background: var(--surface-2); }
.offline-progress progress::-webkit-progress-value { border-radius: 999px; background: linear-gradient(90deg, var(--gold), #e4c779); }
.offline-progress small, .offline-detail { color: var(--muted); font-size: .75rem !important; }
.offline-detail { margin-top: .7rem !important; }
.voice-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-top: .85rem; }
.voice-fields label { display: grid; gap: .3rem; min-width: 0; color: var(--muted); font-size: .75rem; font-weight: 700; }
.voice-fields select { width: 100%; min-height: 2.75rem; padding: .55rem 2rem .55rem .7rem; border: 1px solid var(--border); border-radius: .72rem; color: var(--text); background: var(--surface); }
.voice-fields select:focus { border-color: var(--gold); }
.voice-preview-row { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; margin-top: .75rem; }
.voice-preview-row small { color: var(--muted); font-size: .72rem; }
.stack-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .8rem; }
.file-button { cursor: pointer; }
.small-copy { margin-top: .65rem !important; font-size: .75rem !important; }
.legal-links { display: flex; flex-wrap: wrap; gap: .45rem .9rem; margin-top: .8rem; }
.legal-links a { font-size: .78rem; font-weight: 750; }
.version-copy { margin-top: .65rem !important; font-size: .7rem !important; }

.calendar-modal { width: min(calc(100% - 1.25rem), 38rem); }
.calendar-controls { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .65rem; padding: 1rem 1.15rem .7rem; }
.calendar-controls select { width: 100%; min-height: 2.75rem; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: .75rem; color: var(--text); background: var(--surface); font: inherit; font-weight: 750; text-align: center; }
.calendar-controls .icon-only { font-size: 1.6rem; line-height: 1; }
.calendar-note { margin: 0 1.15rem .8rem; color: var(--muted); font-size: .78rem; }
.saint-calendar-list { display: grid; gap: .5rem; padding: 0 1.15rem 1.2rem; }
.calendar-saint { width: 100%; display: grid; grid-template-columns: 2.6rem 1fr auto; align-items: center; gap: .75rem; min-height: 3.7rem; padding: .55rem .65rem; border: 1px solid var(--border); border-radius: .85rem; color: var(--text); background: var(--surface); text-align: left; cursor: pointer; }
.calendar-saint:hover, .calendar-saint:focus-visible { border-color: var(--gold); background: var(--gold-soft); }
.calendar-saint-day { width: 2.35rem; height: 2.35rem; display: grid; place-items: center; border-radius: .7rem; color: var(--ink-2); background: var(--ink-soft); font-family: Georgia, serif; font-size: 1.08rem; font-weight: 700; }
.calendar-saint strong, .calendar-saint small { display: block; }
.calendar-saint small { margin-top: .08rem; color: var(--muted); font-size: .7rem; }
.calendar-saint svg { width: 1rem; color: var(--muted); }

.silence-modal { width: min(calc(100% - 1.25rem), 30rem); }
.silence-content { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 2rem 1rem 1.2rem; }
.breath-ring { width: 11rem; height: 11rem; margin: 1.4rem 0; display: grid; place-items: center; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); background: radial-gradient(circle, var(--gold-soft), transparent 68%); animation: breathe 8s ease-in-out infinite; }
.breath-ring span { font-family: Georgia, serif; font-size: 2.2rem; color: var(--gold); }
@keyframes breathe { 0%,100% { transform: scale(.88); } 50% { transform: scale(1); } }
.silence-content p:not(.eyebrow) { color: var(--muted); }
.silence-content .text-button { margin-top: .5rem; }

.toast { position: fixed; z-index: 80; left: 50%; bottom: 6.6rem; transform: translate(-50%, 1rem); max-width: calc(100% - 2rem); padding: .75rem 1rem; border-radius: .85rem; color: #fff; background: #17313d; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .22s ease; text-align: center; font-size: .85rem; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.offline-banner { position: fixed; z-index: 39; left: 50%; bottom: 6.2rem; transform: translateX(-50%); width: max-content; max-width: calc(100% - 2rem); padding: .55rem .8rem; border-radius: .7rem; color: #fff; background: #6c4b19; font-size: .75rem; box-shadow: var(--shadow-soft); }

*:focus-visible { outline: 3px solid color-mix(in srgb, var(--gold) 72%, white); outline-offset: 2px; }

@media (min-width: 760px) {
  body { padding-bottom: 2rem; }
  .topbar { padding-top: 1.25rem; }
  main { padding-bottom: 2rem; }
  .bottom-nav { left: 1rem; top: 50%; bottom: auto; transform: translateY(-50%); width: 5.3rem; grid-template-columns: 1fr; padding: .55rem; }
  .nav-item { min-height: 4.15rem; }
  body { padding-left: 6.5rem; }
  .quick-grid { gap: 1rem; }
  .hero-card { min-height: 21rem; display: flex; flex-direction: column; justify-content: center; }
  .saint-card { grid-template-columns: 6rem 1fr; padding: 1.2rem; }
  .saint-date { min-height: 6rem; }
  .toast { bottom: 2rem; }
  .offline-banner { bottom: 1rem; }
}

@media (max-width: 560px) {
  main, .topbar { width: min(100% - 1.2rem, 74rem); }
  .greeting-row { align-items: start; }
  .intro { font-size: .9rem; }
  .quick-grid { grid-template-columns: 1fr; gap: .55rem; }
  .quick-card { min-height: 4.35rem; }
  .saint-card { grid-template-columns: 4.2rem 1fr; gap: .8rem; }
  .saint-date { min-height: 4.2rem; }
  .saint-date span { font-size: 1.65rem; }
  .prayer-grid { grid-template-columns: 1fr; }
  .content-card { grid-template-columns: 2.65rem 1fr auto; padding: .85rem; }
  .content-card .book-badge { width: 2.65rem; }
  .bottom-nav { border-radius: 1.15rem; }
  .nav-item { min-height: 3.35rem; font-size: .62rem; }
  .nav-item svg { width: 1.18rem; height: 1.18rem; }
  .modal { border-radius: 1.25rem; }
  .voice-fields { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
