/* 9days — a quiet, typography-led ceremonial design.
   Light is the day office (warm parchment and ink), dark is the vigil
   (near-black warmth, candlelit text). One serif throughout: Newsreader.
   Rubrics — instructional lines — are set in liturgical red, as in a missal. */

@font-face {
    font-family: 'Newsreader';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url('fonts/newsreader-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Newsreader';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url('fonts/newsreader-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ─── Tokens ─── */
:root {
    --bg: #f6f1e5;
    --bg-raised: #fcf8ef;
    --ink: #2a2418;
    --soft: #6b5f49;
    --gold: #8a6b2c;
    --gold-bright: #b8933f;
    --rubric: #93321f;
    --hairline: rgba(80, 64, 37, .26);
    --hairline-strong: rgba(80, 64, 37, .45);
    --wax-1: #efe5cd;
    --wax-2: #d9cba6;
    /* Wash: the warm/cool tone bled into the page and paper gradients.
       Breathe: the two hues of the slow, living gradient behind everything. */
    --wash: #8a6b2c;
    --breathe-a: #c9a45c;
    --breathe-b: #b8933f;
    /* Film grain for the tinted gradients: a tiling turbulence speckle. */
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
    color-scheme: light;
}
:root[data-theme='dark'] {
    /* The vigil, by night: cool blue-black stone rather than warm brown,
       with candlelit gold kept only as the accent. */
    --bg: #0d1017;
    --bg-raised: #161b25;
    --ink: #dde3ee;
    --soft: #96a2b6;
    --gold: #c9a45c;
    --gold-bright: #dfc084;
    --rubric: #d07a63;
    --hairline: rgba(178, 199, 228, .16);
    --hairline-strong: rgba(178, 199, 228, .30);
    --wax-1: #e6dabb;
    --wax-2: #c9b98f;
    --wash: #3d597d;
    --breathe-a: #26436a;
    --breathe-b: #38455f;
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.10 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
    color-scheme: dark;
}

/* ─── Tints: real colour symbolism, one hue per devotion ───
   Mysteries — Joyful: Marian blue (the infancy, lived beside Mary);
   Luminous: the silver light of the Jordan and Tabor; Sorrowful: the deep
   red of the Passion; Glorious: Easter gold. Novenas — Sacred Heart:
   crimson of the burning Heart; Divine Mercy: the pale ray; Holy Spirit:
   Pentecost fire; St. Joseph: the night indigo of his dreams; Perpetual
   Help: the icon's deep blue on gold; Immaculate Conception: Lourdes blue
   and white; St. Thérèse: the shower of roses; St. Jude: the green of
   hope; St. Anthony: Franciscan brown and lily. */
.tint-joyful { --tint: #3f5d8a; }
.tint-luminous { --tint: #57707e; }
.tint-sorrowful { --tint: #7c2b33; }
.tint-glorious { --tint: #8a6b24; }
.tint-sacred-heart { --tint: #8e2f3c; }
.tint-divine-mercy { --tint: #4e7d99; }
.tint-holy-spirit { --tint: #ad4a1c; }
.tint-st-joseph { --tint: #414c72; }
.tint-perpetual-help { --tint: #2f4d6e; }
.tint-immaculate-conception { --tint: #4a7ab5; }
.tint-st-therese { --tint: #a04a5e; }
.tint-st-jude { --tint: #40684d; }
.tint-st-anthony { --tint: #6e4e2f; }
:root[data-theme='dark'] .tint-joyful { --tint: #9db8dd; }
:root[data-theme='dark'] .tint-luminous { --tint: #a9c2cc; }
:root[data-theme='dark'] .tint-sorrowful { --tint: #d08c86; }
:root[data-theme='dark'] .tint-glorious { --tint: #d9b96a; }
:root[data-theme='dark'] .tint-sacred-heart { --tint: #d98d92; }
:root[data-theme='dark'] .tint-divine-mercy { --tint: #92bdd6; }
:root[data-theme='dark'] .tint-holy-spirit { --tint: #e09a63; }
:root[data-theme='dark'] .tint-st-joseph { --tint: #a3aed4; }
:root[data-theme='dark'] .tint-perpetual-help { --tint: #8fb0c9; }
:root[data-theme='dark'] .tint-immaculate-conception { --tint: #a5c4ea; }
:root[data-theme='dark'] .tint-st-therese { --tint: #e0a3ae; }
:root[data-theme='dark'] .tint-st-jude { --tint: #9dc4a7; }
:root[data-theme='dark'] .tint-st-anthony { --tint: #c8a67e; }

/* ─── Base ─── */
*, *::before, *::after { box-sizing: border-box; }
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* Lock the zoom level so 9days feels like a native app: allow panning and
       scrolling, but no pinch- or double-tap-to-zoom. */
    touch-action: pan-x pan-y;
}
body {
    margin: 0;
    /* The page is a single sheet: a fixed grain over a soft candlelit wash,
       so the whole app reads as ink laid on textured paper. */
    background-color: var(--bg);
    background-image: var(--grain),
        radial-gradient(125% 78% at 50% -12%, color-mix(in srgb, var(--wash) 12%, transparent), transparent 58%);
    background-attachment: fixed;
    color: var(--ink);
    font-family: 'Newsreader', 'Iowan Old Style', Georgia, serif;
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-x pan-y;
}
/* The breathing soul: two soft pools of colour behind everything, drifting
   and swelling on a slow ~19s cycle so the page feels alive without ever
   calling attention to itself. Oversized and fixed, so its motion never
   reveals an edge. */
body::before {
    content: '';
    position: fixed;
    inset: -25%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(38% 46% at 26% 22%, color-mix(in srgb, var(--breathe-a) 62%, transparent), transparent 68%),
        radial-gradient(44% 52% at 78% 76%, color-mix(in srgb, var(--breathe-b) 55%, transparent), transparent 70%);
    opacity: .5;
    will-change: transform, opacity;
    animation: breathe 19s ease-in-out infinite;
}
@keyframes breathe {
    0%, 100% { transform: scale(1) translate3d(0, 0, 0); opacity: .34; }
    50% { transform: scale(1.14) translate3d(0, -2%, 0); opacity: .6; }
}
::selection { background: color-mix(in srgb, var(--gold) 26%, transparent); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 2px; }

#app {
    max-width: 42rem;
    margin: 0 auto;
    min-height: 100dvh;
    padding: calc(env(safe-area-inset-top) + .55rem) 1.1rem calc(env(safe-area-inset-bottom) + 5.6rem);
}

/* ─── Wordmark ─── */
#topbar {
    text-align: center;
    padding: .5rem 0 .85rem;
    border-bottom: 1px solid var(--hairline);
    box-shadow: 0 4px 0 -3px var(--hairline);
    margin-bottom: 1.3rem;
}
#topbar a {
    color: var(--ink);
    text-decoration: none;
    font-size: .95rem;
    font-weight: 500;
    letter-spacing: .34em;
    text-transform: uppercase;
}
#topbar .mark-cross { color: var(--gold); margin-right: .5em; letter-spacing: 0; }

/* ─── Bottom navigation ─── */
#nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--hairline);
    z-index: 10;
}
.nav-inner {
    max-width: 42rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding-bottom: env(safe-area-inset-bottom);
}
#nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .18rem;
    padding: .6rem 0 .55rem;
    color: var(--soft);
    text-decoration: none;
    font-size: .6rem;
    letter-spacing: .17em;
    text-transform: uppercase;
}
#nav a[aria-current] { color: var(--gold); }

/* ─── Typographic utilities ─── */
.center { text-align: center; }
.soft { color: var(--soft); }
.small { font-size: .82rem; }
.kicker {
    text-align: center;
    color: var(--gold);
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: .24em;
    text-transform: uppercase;
    margin: 1.1rem 0 .35rem;
}
.rubric {
    color: var(--rubric);
    font-size: .88rem;
    letter-spacing: .02em;
    margin: .5rem 0;
}
.rubric-inline {
    color: var(--rubric);
    font-size: .68rem;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.latin-sub {
    color: var(--gold);
    font-size: .78rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    margin-bottom: .5rem;
}
.date-line {
    text-align: center;
    color: var(--soft);
    font-size: .74rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    margin: .2rem 0 .9rem;
}
.page-title {
    text-align: center;
    font-size: 1.72rem;
    font-weight: 500;
    line-height: 1.25;
    margin: .15rem 0 .5rem;
    text-wrap: balance;
}
.intro-note { max-width: 30rem; margin: 0 auto 1.1rem; }
.back-link {
    display: inline-block;
    color: var(--soft);
    text-decoration: none;
    font-size: .82rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin: .1rem 0 .4rem;
}
.back-link:hover { color: var(--gold); }

/* ─── Ornamental rule ─── */
.rule {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin: 1.7rem 0;
    color: var(--gold);
}
.rule::before, .rule::after {
    content: '';
    flex: 1;
    border-top: 1px solid var(--hairline);
}
.rule-orn { font-size: .95rem; line-height: 1; }

/* ─── Cards, rows, blocks ─── */
.card {
    background-color: var(--bg-raised);
    background-image: var(--grain),
        linear-gradient(158deg, color-mix(in srgb, var(--wash) 7%, var(--bg-raised)), var(--bg-raised) 72%);
    border: 1px solid var(--hairline);
    border-radius: 6px;
    padding: 1.45rem 1.35rem;
    margin: .9rem 0;
}
.card-title { font-size: 1.42rem; font-weight: 500; margin: .1rem 0 .15rem; }
.block { margin: 1.4rem 0; text-align: center; }
.rows { display: grid; gap: .7rem; margin: .9rem 0; text-align: left; }
.row-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .95rem 1.1rem;
    background-color: var(--bg-raised);
    background-image: var(--grain),
        linear-gradient(158deg, color-mix(in srgb, var(--wash) 6%, var(--bg-raised)), var(--bg-raised) 74%);
    border: 1px solid var(--hairline);
    border-radius: 6px;
    color: var(--ink);
    text-decoration: none;
    transition: border-color .25s;
}
.row-item:hover { border-color: var(--gold); }
.row-item--tall { padding: 1.1rem 1.15rem; }
.row-title { font-size: 1.14rem; font-weight: 500; }
.row-sub { font-size: .9rem; color: var(--soft); margin-top: .1rem; }
.row-meta { display: flex; align-items: center; gap: .8rem; margin-top: .45rem; flex-wrap: wrap; }
.row-go { color: var(--gold); flex-shrink: 0; }
.badge {
    font-size: .66rem;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--gold);
    border: 1px solid var(--hairline-strong);
    border-radius: 999px;
    padding: .12rem .55rem;
}
.badge--done { border-color: var(--gold); }

/* ─── Buttons & controls ─── */
.btn {
    position: relative;
    display: inline-block;
    font-family: inherit;
    font-size: .78rem;
    font-weight: 500;
    letter-spacing: .16em;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    color: var(--gold);
    background: transparent;
    border: 1px solid var(--gold);
    border-radius: 3px;
    padding: .78rem 1.5rem;
    margin-top: .9rem;
    cursor: pointer;
    transition: background-color .25s, color .25s;
}
.btn::after {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
    border-radius: 1px;
    pointer-events: none;
}
.btn:hover { background: color-mix(in srgb, var(--gold) 10%, transparent); }
.btn--solid { background: var(--gold); color: var(--bg); }
.btn--solid::after { border-color: color-mix(in srgb, var(--bg) 55%, transparent); }
.btn--solid:hover { background: var(--gold-bright); }
.btn--small { padding: .5rem 1rem; font-size: .7rem; }
.btn:disabled { opacity: .35; cursor: default; }
.btn:disabled:hover { background: transparent; }

.link-btn {
    font-family: inherit;
    font-size: .74rem;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gold);
    background: none;
    border: none;
    padding: .3rem 0;
    cursor: pointer;
}
.link-btn--dim { color: var(--soft); }
.link-btn--warn { color: var(--rubric); }
.quiet-link {
    display: inline-block;
    color: var(--gold);
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
    font-size: .95rem;
    margin-top: .55rem;
}
.quiet-link.inline { margin: 0; font-size: inherit; }
.quiet-link.center { display: table; margin-left: auto; margin-right: auto; }

.seg-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .55rem .9rem; margin: .55rem 0; }
.seg-label {
    font-size: .68rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--soft);
    min-width: 6.2rem;
    text-align: right;
}
.seg {
    display: inline-flex;
    border: 1px solid var(--hairline-strong);
    border-radius: 999px;
    overflow: hidden;
}
.seg--floating { display: flex; width: fit-content; margin: .4rem auto .1rem; }
.seg-opt {
    font-family: inherit;
    font-size: .74rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--soft);
    background: none;
    border: none;
    padding: .38rem .9rem;
    cursor: pointer;
}
.seg-opt[aria-pressed='true'] {
    color: var(--gold);
    background: color-mix(in srgb, var(--gold) 13%, transparent);
}

.field {
    display: block;
    width: 100%;
    font-family: inherit;
    font-size: 1.02rem;
    color: var(--ink);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--hairline-strong);
    padding: .5rem .1rem;
    margin-bottom: .5rem;
    resize: vertical;
}
.field:focus { outline: none; border-bottom-color: var(--gold); }
.field::placeholder { color: color-mix(in srgb, var(--soft) 72%, transparent); }

/* ─── Prayer text ─── */
.prayer-title { font-size: 1.44rem; font-weight: 500; margin: .25rem 0 .5rem; text-wrap: balance; }
.prayer-text {
    font-size: 1.2rem;
    line-height: 1.7;
    white-space: pre-line;
    margin: .55rem 0;
}
.body-text { font-size: 1.06rem; line-height: 1.72; margin: .55rem 0; }
.scripture {
    margin: .9rem 0;
    padding-left: 1rem;
    border-left: 2px solid var(--gold);
}
.scripture p { font-size: 1.12rem; line-height: 1.6; margin: 0; }
.scripture cite {
    display: block;
    font-style: normal;
    font-size: .68rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--gold);
    margin-top: .4rem;
}
.context-line {
    text-align: center;
    font-size: .85rem;
    color: var(--soft);
    margin-bottom: .1rem;
}
.meditation-text { font-size: 1.05rem; }

/* ─── The rosary stage ───
   A fixed, full-height screen: the bead chain runs around the edge like a
   rosary laid about a frame, the pendant cross hangs at the top centre, the
   prayer sits in the middle, and the controls keep to the foot. */
body.mode-stage #topbar { display: none; }

.rosary-stage {
    position: fixed;
    top: env(safe-area-inset-top);
    bottom: calc(4.4rem + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: min(100vw, 44rem);
}
.rosary-stage::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: var(--grain), linear-gradient(172deg, color-mix(in srgb, var(--tint, var(--gold)) 9%, transparent), transparent 58%);
}
.stage-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}
.chain-line { fill: none; stroke: var(--hairline); stroke-width: 1; }
.bead {
    fill: var(--bg);
    stroke: var(--hairline-strong);
    stroke-width: 1.1;
    transition: fill .35s, stroke .35s;
}
.bead.done { fill: color-mix(in srgb, var(--gold) 55%, var(--bg)); stroke: color-mix(in srgb, var(--gold) 70%, var(--bg)); }
.bead.now {
    fill: var(--gold-bright);
    stroke: var(--gold-bright);
    filter: drop-shadow(0 0 4px color-mix(in srgb, var(--gold-bright) 80%, transparent));
    animation: bead-pulse 2.2s ease-in-out infinite alternate;
}
.bead--cross { fill: none; stroke-width: 5; stroke-linecap: square; }
.bead--cross.done { fill: none; }
.bead--cross.now { fill: none; }
@keyframes bead-pulse { from { opacity: .78; } to { opacity: 1; } }

.stage-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 0 clamp(26px, 8vw, 46px);
}
.stage-head { text-align: center; padding-top: 116px; }
.stage-head .kicker { margin: 0 0 .1rem; }
.stage-head .prayer-title { text-align: center; font-size: 1.48rem; margin: .05rem 0; }
.stage-head .latin-sub { margin-bottom: 0; }
.stage-head .step-note { margin: .1rem 0 0; }
.stage-text {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
}
.stage-text-inner {
    margin: auto 0;
    width: 100%;
    max-width: 33rem;
    align-self: center;
    padding: .7rem 0 .9rem;
}
.stage-text .prayer-text { text-align: center; font-size: 1.17rem; line-height: 1.62; }
.stage-text .meditation-text { text-align: left; font-size: 1.03rem; }
.stage-text .scripture { margin: .5rem 0 .8rem; }
.stage-text .rubric { text-align: center; }
/* Lift the controls clear of the bead chain that runs along the bottom edge
   of the frame, so the buttons never sit on top of the rosary. */
.stage-foot { flex: 0 0 auto; padding: .3rem 0 1.9rem; }
.stage-foot .controls { margin: 0; }
.controls { display: flex; gap: .8rem; justify-content: center; align-items: stretch; }
.controls .btn { margin-top: 0; }
.controls .btn--solid { flex: 1; max-width: 21rem; }
.progress-line {
    text-align: center;
    color: var(--soft);
    font-size: .68rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    margin: 0 0 .5rem;
}
.front-stack { display: grid; gap: .3rem; justify-items: center; text-align: center; }
.set-links {
    text-align: center;
    font-size: .82rem;
    color: var(--soft);
    margin-top: .8rem;
}
.set-current { color: var(--tint, var(--gold)); }
.complete-orn { text-align: center; font-size: 2.1rem; color: var(--gold); margin: .4rem 0 .1rem; }

/* ─── Novenas ─── */
/* The nine novenas, as a 3×3 launcher grid of tinted tiles. */
.novena-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .6rem;
    margin: .9rem 0 .4rem;
}
.novena-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 6.6rem;
    padding: .85rem .6rem;
    border: 1px solid var(--hairline);
    border-radius: 6px;
    color: var(--ink);
    text-decoration: none;
    text-align: center;
    transition: border-color .25s;
}
.novena-tile:hover { border-color: var(--tint, var(--gold)); }
.novena-tile-name { font-size: .96rem; font-weight: 500; line-height: 1.22; text-wrap: balance; }

/* The nine days of a novena, as a 3×3 grid of beads. */
.day-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .55rem;
    max-width: 15rem;
    margin: 1.2rem auto .4rem;
}
.day-cell {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    align-content: center;
    border: 1px solid var(--hairline-strong);
    border-radius: 50%;
    color: var(--soft);
    font-size: .74rem;
    text-decoration: none;
    transition: border-color .25s;
}
/* The calendar date a day falls on, when the novena is kept on the
   traditional days before the feast. */
.day-cell .day-date {
    font-size: .5rem;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: inherit;
    opacity: .72;
    margin-top: .08rem;
}
.day-cell:hover { border-color: var(--gold); }
.day-cell.done { background: var(--gold); border-color: var(--gold); color: var(--bg); }
.day-cell.next { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent); }

.toc { margin: .6rem 0 1.4rem; }
.toc-row {
    display: flex;
    align-items: baseline;
    gap: .9rem;
    padding: .62rem .15rem;
    border-bottom: 1px solid var(--hairline);
    color: var(--ink);
    text-decoration: none;
}
.toc-row:hover .toc-theme { color: var(--gold); }
.toc-n {
    min-width: 2.2ch;
    text-align: right;
    color: var(--gold);
    font-size: .8rem;
    letter-spacing: .08em;
}
.toc-theme { flex: 1; transition: color .2s; }
.toc-row.done .toc-theme { color: var(--soft); }
.toc-date { color: var(--soft); font-size: .72rem; letter-spacing: .05em; }
.toc-check { color: var(--gold); font-size: .85rem; }

/* Notes under the keeping-the-novena controls. */
.keeping-note { margin: .15rem auto .7rem; max-width: 26rem; }

.office { margin: 1.7rem 0; }
.office-heading {
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--gold);
    margin: 0 0 .45rem;
}
.meditation p:first-child::first-letter {
    float: left;
    font-size: 3.05em;
    line-height: .82;
    padding: .04em .12em 0 0;
    font-weight: 500;
    color: var(--gold);
}
.conclude-note { max-width: 30rem; margin-left: auto; margin-right: auto; }
.center-text { text-align: center; }

/* ─── Intentions ─── */
.compose { text-align: left; }
.compose .kicker { text-align: left; margin-top: 0; }
.card-actions { display: flex; gap: 1.15rem; flex-wrap: wrap; margin-top: .7rem; }
.intention-text { font-size: 1.13rem; line-height: 1.6; margin: 0 0 .2rem; }
.intention--answered .intention-text { color: var(--soft); }
.share-feedback { margin-top: .4rem; }
.share-field {
    width: 100%;
    font-family: inherit;
    font-size: .78rem;
    color: var(--soft);
    background: transparent;
    border: 1px solid var(--hairline);
    border-radius: 4px;
    padding: .45rem .55rem;
}
.pray-area { margin-top: .6rem; }
.pray-area .prayer-text { font-size: 1.06rem; }

.intention-quote {
    margin: 1.2rem auto .4rem;
    max-width: 32rem;
    text-align: center;
}
.intention-quote::before {
    content: '“';
    display: block;
    font-size: 2.7rem;
    line-height: .6;
    color: var(--gold);
}
.intention-quote p { font-size: 1.34rem; line-height: 1.55; margin: .5rem 0 0; }
.votive-after { margin-top: .6rem; display: grid; gap: .45rem; justify-items: center; }

/* ─── The votive candle ─── */
.candle {
    position: relative;
    width: 90px;
    height: 128px;
    margin: 1.3rem auto 0;
}
.candle-wax {
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 76px;
    background: linear-gradient(to right, var(--wax-2), var(--wax-1) 38%, var(--wax-1) 62%, var(--wax-2));
    border-radius: 3px 3px 4px 4px;
}
.candle-wick {
    position: absolute;
    bottom: 75px; left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 7px;
    background: #4a3f2c;
}
.candle-flame {
    position: absolute;
    bottom: 80px; left: 50%;
    transform: translateX(-50%);
    width: 15px;
    height: 27px;
    background: radial-gradient(closest-side at 50% 72%, #fff8da 0%, #f8c545 52%, rgba(238, 128, 22, .92) 78%, transparent 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    transform-origin: 50% 100%;
    opacity: 0;
    transition: opacity .9s ease;
}
.candle-glow {
    position: absolute;
    bottom: 52px; left: 50%;
    transform: translate(-50%, 0);
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, rgba(248, 186, 74, .34) 0%, transparent 68%);
    filter: blur(4px);
    opacity: 0;
    transition: opacity 1.2s ease;
}
.candle.lit .candle-flame { opacity: 1; animation: flame-flicker 1.9s ease-in-out infinite; }
.candle.lit .candle-glow { opacity: 1; animation: glow-breathe 2.8s ease-in-out infinite; }
@keyframes flame-flicker {
    0%, 100% { transform: translateX(-50%) scale(1, 1); }
    26% { transform: translateX(-50.5%) scale(1.05, 1.07) skewX(-1.6deg); }
    52% { transform: translateX(-49.5%) scale(.96, .94) skewX(1.8deg); }
    78% { transform: translateX(-50%) scale(1.02, 1.04); }
}
@keyframes glow-breathe {
    0%, 100% { opacity: .8; }
    50% { opacity: 1; }
}

/* ─── Settings & epigraph ─── */
.settings { margin-bottom: 1.4rem; }
.epigraph {
    margin: 2.5rem auto 1rem;
    max-width: 28rem;
    text-align: center;
    color: var(--soft);
    font-size: .97rem;
}
.epigraph p { margin: .2rem 0; }
.epigraph-cite {
    font-size: .66rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--gold);
    margin-top: .35rem;
}

/* ─── Tinted panels, banners, and scoped accents ─── */
.tint-panel {
    border-color: color-mix(in srgb, var(--tint, var(--gold)) 34%, var(--hairline));
    background-image: var(--grain), linear-gradient(155deg,
        color-mix(in srgb, var(--tint, var(--gold)) 15%, var(--bg-raised)) 0%,
        color-mix(in srgb, var(--tint, var(--gold)) 5%, var(--bg-raised)) 65%,
        var(--bg-raised) 100%);
}
.tint-panel .row-go { color: var(--tint, var(--gold)); }
.tint-panel .badge { color: var(--tint, var(--gold)); border-color: color-mix(in srgb, var(--tint, var(--gold)) 45%, transparent); }
.tint-label {
    color: var(--tint, var(--gold));
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.tint-banner {
    border: 1px solid color-mix(in srgb, var(--tint, var(--gold)) 30%, var(--hairline));
    border-radius: 8px;
    padding: 1.35rem 1.3rem 1.15rem;
    margin: .5rem 0 1.1rem;
    background-image: var(--grain), linear-gradient(150deg,
        color-mix(in srgb, var(--tint, var(--gold)) 24%, var(--bg-raised)),
        color-mix(in srgb, var(--tint, var(--gold)) 7%, var(--bg-raised)));
}
.tint-banner .page-title { text-align: left; font-size: 1.9rem; margin: .3rem 0 .25rem; }
.banner-feast { color: var(--tint, var(--gold)); font-size: .8rem; letter-spacing: .04em; }

.tint-scope .kicker,
.tint-scope .office-heading,
.tint-scope .toc-n,
.tint-scope .toc-check,
.tint-scope .latin-sub,
.tint-scope .quiet-link { color: var(--tint, var(--gold)); }
.tint-scope .quiet-link { border-bottom-color: color-mix(in srgb, var(--tint, var(--gold)) 40%, transparent); }
.tint-scope .meditation p:first-child::first-letter { color: var(--tint, var(--gold)); }
.tint-scope .scripture { border-left-color: var(--tint, var(--gold)); }
.tint-scope .scripture cite { color: var(--tint, var(--gold)); }
.tint-scope .btn { border-color: var(--tint, var(--gold)); color: var(--tint, var(--gold)); }
.tint-scope .btn::after { border-color: color-mix(in srgb, var(--tint, var(--gold)) 45%, transparent); }
.tint-scope .btn:hover { background: color-mix(in srgb, var(--tint, var(--gold)) 10%, transparent); }
.tint-scope .btn--solid { background: var(--tint, var(--gold)); color: var(--bg); }
.tint-scope .btn--solid::after { border-color: color-mix(in srgb, var(--bg) 55%, transparent); }
.tint-scope .btn--solid:hover { background: color-mix(in srgb, var(--tint, var(--gold)) 84%, var(--ink)); }
.tint-scope .day-cell.done { background: var(--tint, var(--gold)); border-color: var(--tint, var(--gold)); }
.tint-scope .day-cell.next {
    border-color: var(--tint, var(--gold));
    color: var(--tint, var(--gold));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint, var(--gold)) 18%, transparent);
}
.tint-scope .rule { color: var(--tint, var(--gold)); }
.tint-scope .set-links .quiet-link { color: var(--tint, var(--gold)); }
.tint-scope .seg-opt[aria-pressed='true'] {
    color: var(--tint, var(--gold));
    background: color-mix(in srgb, var(--tint, var(--gold)) 13%, transparent);
}

/* ─── Editorial page heads (left-aligned lists) ─── */
.page-head { text-align: left; margin: .3rem 0 1.1rem; }
.page-head .kicker { text-align: left; margin: .4rem 0 .1rem; }
.page-head .page-title { text-align: left; font-size: 2.05rem; margin: 0 0 .4rem; }
.page-head .intro-note { margin: 0; max-width: 33rem; }

/* ─── First visit, novena intentions, taught prayers ─── */
.first-visit { border-color: color-mix(in srgb, var(--gold) 40%, var(--hairline)); }
.first-visit .kicker { text-align: left; margin-top: 0; }
.first-visit .body-text { margin: .3rem 0 .2rem; }
.first-visit .card-actions { margin: .6rem 0 .5rem; }
.first-visit .btn { margin-top: 0; }
.first-visit .small { margin: 0; }

.intent-card .kicker { text-align: left; margin-top: 0; }
.intent-sentence { display: block; font-size: 1.06rem; margin: .2rem 0 0; }
.intent-field { font-size: 1.06rem; }
.intent-card .card-actions { align-items: baseline; margin-top: .4rem; }
.intent-card .btn { margin-top: 0; }
.intent-note { margin: 0; }

.novena-intention {
    border-left: 2px solid var(--tint, var(--gold));
    padding: .3rem 0 .3rem 1rem;
    color: var(--soft);
    font-size: 1.03rem;
    margin: 1.1rem 0 0;
}
.office-sub { font-size: 1.03rem; font-weight: 500; margin: 1rem 0 .15rem; }
.common-text { font-size: 1.06rem; }
.office--common { border-top: 1px solid var(--hairline); padding-top: 1.2rem; }
.conclude-note { max-width: none; text-align: left; }

/* ─── Motion ─── */
.view-enter { animation: view-in .5s cubic-bezier(.2, .7, .3, 1); }
@keyframes view-in {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .view-enter { animation: none; }
    .bead.now { animation: none; }
    body::before { animation: none; }
    .candle.lit .candle-flame, .candle.lit .candle-glow { animation: none; }
    * { transition-duration: .01s !important; }
}
