        /* Themable CSS variables. Defaults match the historical Bootstrap-blue look;
           settings UI overrides these via document.documentElement.style.setProperty. */
        :root {
            --app-accent: #0d6efd;
            --app-accent-soft: color-mix(in srgb, var(--app-accent) 15%, transparent);
            --app-accent-strong: color-mix(in srgb, var(--app-accent) 25%, transparent);
            --app-accent-hover: color-mix(in srgb, var(--app-accent) 85%, black);
            --app-accent-active: color-mix(in srgb, var(--app-accent) 75%, black);
            --app-font-scale: 1;
            /* Unified corner-radius scale — use these instead of literal px values. */
            --radius-xs: 4px;
            --radius-sm: 6px;
            --radius-md: 8px;
            --radius-lg: 12px;
            --radius-xl: 20px;
            --radius-pill: 999px;
            /* Muted/secondary text + borders — theme-aware (overridden in light mode). */
            --app-muted: #8a929a;
            /* Some Bootstrap components read these directly. */
            --bs-primary: var(--app-accent);
            --bs-link-color: var(--app-accent);
            --bs-link-hover-color: var(--app-accent-hover);
        }
        [data-bs-theme="light"] {
            --app-muted: #5d666e;
        }
        /* ---- Bootstrap primary-colored components ----
           Bootstrap 5.3 compiles primary colors into per-component local CSS variables
           (and some baked-in literals). Overriding the local vars at the component
           selector cleanly recolors buttons, form controls, accordion, etc. */
        .btn-primary {
            --bs-btn-bg: var(--app-accent);
            --bs-btn-border-color: var(--app-accent);
            --bs-btn-hover-bg: var(--app-accent-hover);
            --bs-btn-hover-border-color: var(--app-accent-hover);
            --bs-btn-active-bg: var(--app-accent-active);
            --bs-btn-active-border-color: var(--app-accent-active);
            --bs-btn-disabled-bg: var(--app-accent);
            --bs-btn-disabled-border-color: var(--app-accent);
        }
        /* Used only by btn-check segmented toggle groups (All/OT/NT, journal & search
           filters, genealogy mode). Styled SOLID — muted surface when unselected,
           accent when selected — so there's no outline look but the selected option
           still stands out. (Per preference: no outline-style buttons.) */
        .btn-outline-primary {
            --bs-btn-color: var(--bs-body-color);
            --bs-btn-bg: var(--bs-tertiary-bg);
            --bs-btn-border-color: var(--bs-tertiary-bg);
            --bs-btn-hover-color: #fff;
            --bs-btn-hover-bg: var(--app-accent-hover);
            --bs-btn-hover-border-color: var(--app-accent-hover);
            --bs-btn-active-color: #fff;
            --bs-btn-active-bg: var(--app-accent);
            --bs-btn-active-border-color: var(--app-accent);
            --bs-btn-disabled-color: var(--bs-body-color);
            --bs-btn-disabled-bg: var(--bs-tertiary-bg);
            --bs-btn-disabled-border-color: var(--bs-tertiary-bg);
        }

        /* Themed scrollbars — track stays transparent so the page background
           shows through (works for both light/dark mode without conditionals);
           thumb uses the user's accent color via color-mix so it updates live
           when they change the Appearance dropdown. */
        html {
            scrollbar-color: color-mix(in srgb, var(--app-accent) 60%, transparent) transparent;
            scrollbar-width: thin;
        }
        /* WebKit / Blink (Chrome, Edge, Safari) — explicit pseudo-elements give
           us rounded corners + hover state, which the cross-browser scrollbar-color
           property can't express on its own. */
        ::-webkit-scrollbar {
            width: 10px;
            height: 10px;
        }
        ::-webkit-scrollbar-track {
            background: transparent;
        }
        ::-webkit-scrollbar-thumb {
            background-color: color-mix(in srgb, var(--app-accent) 55%, transparent);
            border-radius: var(--radius-md);
            border: 2px solid transparent;
            background-clip: padding-box;
        }
        ::-webkit-scrollbar-thumb:hover {
            background-color: color-mix(in srgb, var(--app-accent) 80%, transparent);
        }
        ::-webkit-scrollbar-thumb:active {
            background-color: var(--app-accent);
        }
        ::-webkit-scrollbar-corner {
            background: transparent;
        }

        .text-primary { color: var(--app-accent) !important; }
        .bg-primary { background-color: var(--app-accent) !important; color: #fff !important; }
        .border-primary { border-color: var(--app-accent) !important; }
        .link-primary, a.link-primary { color: var(--app-accent) !important; }
        a.link-primary:hover { color: var(--app-accent-hover) !important; }
        /* Form controls */
        .form-check-input:checked {
            background-color: var(--app-accent);
            border-color: var(--app-accent);
        }
        .form-check-input:focus {
            border-color: color-mix(in srgb, var(--app-accent) 50%, transparent);
            box-shadow: 0 0 0 0.25rem var(--app-accent-strong);
        }
        .form-control:focus,
        .form-select:focus {
            border-color: color-mix(in srgb, var(--app-accent) 50%, transparent);
            box-shadow: 0 0 0 0.25rem var(--app-accent-strong);
        }
        /* Active nav links / pills / list group items — solid accent fill needs white text. */
        .nav-pills .nav-link.active,
        .nav-pills .show > .nav-link,
        .list-group-item.active {
            background-color: var(--app-accent);
            border-color: var(--app-accent);
            color: #fff;
        }
        /* Accordion — expanded header gets full accent background with white text so it
           reads cleanly in both dark and light modes against any accent color. */
        .accordion-button:not(.collapsed) {
            background-color: var(--app-accent);
            color: #fff;
        }
        /* Recolor Bootstrap's caret SVG to white so it's visible on the accent background. */
        .accordion-button:not(.collapsed)::after {
            filter: brightness(0) invert(1);
        }
        .accordion-button:focus {
            border-color: color-mix(in srgb, var(--app-accent) 50%, transparent);
            box-shadow: 0 0 0 0.25rem var(--app-accent-strong);
        }
        /* Default text-decoration-* for links */
        a:not(.btn):not(.nav-link):not(.list-group-item):not(.dropdown-item) { color: var(--app-accent); }
        a:not(.btn):not(.nav-link):not(.list-group-item):not(.dropdown-item):hover { color: var(--app-accent-hover); }
        body {
            background-color: #f8f9fa;
            font-size: calc(1rem * var(--app-font-scale));
        }
        .container {
            max-width: 900px;
        }
        .card {
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        #responsesBody {
            max-height: 500px;
            overflow-y: auto;
        }
        .spinner-border {
            width: 1.5rem;
            height: 1.5rem;
        }
        .copy-btn {
            cursor: pointer;
            opacity: 0.7;
            border: none;
            background: none;
            padding: 2px 6px;
        }
        .copy-btn:hover {
            opacity: 1;
        }
        .card-body > .copy-btn:first-child {
            float: right;
            font-size: 1.1rem;
        }
        .name-card {
            cursor: pointer;
            border: 1px solid rgba(128,128,128,0.2);
            border-radius: var(--radius-lg);
            padding: 1rem;
            text-align: center;
            transition: transform 0.15s, box-shadow 0.15s;
        }
        .name-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }
        .name-card.active {
            border-color: var(--app-accent);
            box-shadow: 0 0 0 2px color-mix(in srgb, var(--app-accent) 25%, transparent);
        }
        .name-card-original {
            font-size: 1.4rem;
            line-height: 1.6;
            direction: rtl;
        }
        .name-card-name {
            font-weight: 600;
            font-size: 0.95rem;
        }
        .name-card-category {
            font-size: 0.75rem;
            opacity: 0.7;
        }
        .response-entry {
            border-bottom: 1px solid rgba(255,255,255,0.1);
            padding: 1rem;
            animation: slideIn 0.3s ease-out;
        }
        .response-entry:last-child {
            border-bottom: none;
        }
        .response-header {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 0.5rem;
        }
        .response-number {
            font-weight: bold;
            color: var(--app-muted);
        }
        .response-question {
            font-weight: 500;
            margin-bottom: 0.5rem;
            color: #adb5bd;
        }
        .response-question::before {
            content: "Q: ";
            color: var(--app-muted);
        }
        .response-answer {
            white-space: pre-wrap;
        }
        .response-answer::before {
            content: "A: ";
            color: var(--app-muted);
            font-weight: 500;
        }
        .empty-message {
            text-align: center;
            color: var(--app-muted);
            padding: 2rem;
        }
        /* Loading skeleton */
        .skeleton-entry {
            padding: 1rem;
            animation: pulse 1.5s ease-in-out infinite;
        }
        .skeleton-line {
            background: linear-gradient(90deg, color-mix(in srgb, var(--app-muted) 35%, transparent) 25%, color-mix(in srgb, var(--app-muted) 50%, transparent) 50%, color-mix(in srgb, var(--app-muted) 35%, transparent) 75%);
            background-size: 200% 100%;
            animation: shimmer 1.5s infinite;
            border-radius: var(--radius-xs);
            margin-bottom: 0.5rem;
        }
        .skeleton-header { height: 24px; width: 40%; }
        .skeleton-question { height: 20px; width: 60%; }
        .skeleton-answer { height: 60px; width: 100%; }
        @keyframes shimmer {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }
        @keyframes slideIn {
            from { opacity: 0; transform: translateY(-10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        /* Expand/collapse */
        .response-answer.collapsed {
            max-height: 100px;
            overflow: hidden;
            position: relative;
        }
        .response-answer.collapsed::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 40px;
            background: linear-gradient(transparent, var(--bs-card-bg, #212529));
        }
        .expand-btn {
            border: none;
            background: none;
            color: var(--app-accent);
            cursor: pointer;
            padding: 0.25rem 0;
            font-size: 0.875rem;
        }
        .expand-btn:hover { text-decoration: underline; }
        /* Vestigial state holder — visible UI is .audio-toolbar at body level. */
        .audio-indicator { display: none; }
        .audio-indicator-hidden { display: none !important; }

        /* ===== Floating audio toolbar ===== */
        .audio-toolbar {
            position: fixed;
            left: 50%;
            bottom: 1rem;
            transform: translateX(-50%) translateY(10px);
            display: flex;
            align-items: center;
            gap: 0.6rem;
            padding: 0.55rem 0.8rem;
            border-radius: var(--radius-pill);
            color: #fff;
            font-size: 0.9rem;
            background: linear-gradient(180deg, rgba(40,40,52,0.78) 0%, rgba(20,20,30,0.78) 100%);
            backdrop-filter: blur(24px) saturate(180%);
            -webkit-backdrop-filter: blur(24px) saturate(180%);
            box-shadow:
                0 12px 40px rgba(0,0,0,0.45),
                0 4px 12px rgba(0,0,0,0.25),
                inset 0 1px 0 rgba(255,255,255,0.12),
                inset 0 -1px 0 rgba(0,0,0,0.3);
            opacity: 0;
            pointer-events: none;
            visibility: hidden;
            transition: opacity 0.2s ease, transform 0.25s ease;
            z-index: 1050;
            max-width: calc(100vw - 1rem);
        }
        .audio-toolbar.visible {
            opacity: 1;
            pointer-events: auto;
            visibility: visible;
            transform: translateX(-50%) translateY(0);
        }
        [data-bs-theme="light"] .audio-toolbar {
            background: linear-gradient(180deg, rgba(245,245,250,0.85) 0%, rgba(225,225,235,0.85) 100%);
            color: #1a1a1a;
            box-shadow:
                0 12px 40px rgba(0,0,0,0.18),
                0 4px 12px rgba(0,0,0,0.10),
                inset 0 1px 0 rgba(255,255,255,0.6),
                inset 0 -1px 0 rgba(0,0,0,0.06);
        }
        .audio-tb-btn {
            background: rgba(255,255,255,0.08);
            border: 1px solid rgba(255,255,255,0.12);
            color: inherit;
            border-radius: var(--radius-pill);
            padding: 0.3rem 0.55rem;
            font-size: 0.95rem;
            line-height: 1;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 0.15rem;
            transition: background 0.15s, transform 0.05s;
        }
        .audio-tb-btn:hover  { background: rgba(255,255,255,0.16); }
        .audio-tb-btn:active { transform: scale(0.94); }
        [data-bs-theme="light"] .audio-tb-btn {
            background: rgba(0,0,0,0.05);
            border-color: rgba(0,0,0,0.08);
        }
        [data-bs-theme="light"] .audio-tb-btn:hover { background: rgba(0,0,0,0.1); }
        .audio-tb-btn-primary {
            background: var(--app-accent);
            border-color: transparent;
            color: #fff;
            min-width: 2.2rem;
            justify-content: center;
            font-size: 1.05rem;
        }
        .audio-tb-btn-primary:hover { background: var(--app-accent); filter: brightness(1.1); }
        /* SVG icon sizing inside toolbar buttons */
        .audio-tb-svg,
        .audio-tb-svg-sm { display: block; }
        .audio-tb-svg-wrap {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 22px;
            height: 22px;
        }
        .audio-tb-volume-wrap {
            display: inline-flex;
            align-items: center;
            opacity: 0.75;
        }
        .audio-tb-progress {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            flex: 1 1 240px;
            min-width: 180px;
        }
        .audio-tb-time {
            font-variant-numeric: tabular-nums;
            font-size: 0.78rem;
            opacity: 0.8;
            min-width: 2.5rem;
            text-align: center;
        }
        .audio-tb-seek {
            flex: 1 1 auto;
            height: 4px;
            accent-color: var(--app-accent);
            cursor: pointer;
        }
        .audio-tb-speed {
            background: rgba(255,255,255,0.08);
            border: 1px solid rgba(255,255,255,0.12);
            color: inherit;
            border-radius: var(--radius-pill);
            padding: 0.25rem 0.5rem;
            font-size: 0.8rem;
            cursor: pointer;
        }
        [data-bs-theme="light"] .audio-tb-speed {
            background: rgba(0,0,0,0.05);
            border-color: rgba(0,0,0,0.1);
        }
        #audioSleepBtn { font-size: 0.85rem; }
        #audioSleepBtn.sleep-active { color: var(--app-accent); font-weight: 700; }
        .audio-tb-volume {
            width: 70px;
            height: 4px;
            accent-color: var(--app-accent);
            cursor: pointer;
        }
        .audio-tb-close {
            font-size: 0.85rem;
            padding: 0.25rem 0.5rem;
            opacity: 0.85;
        }
        .audio-tb-close:hover { opacity: 1; }
        .audio-toolbar.toolbar-generating .audio-tb-btn-primary {
            background: rgba(255,255,255,0.15);
            position: relative;
        }
        .audio-toolbar.toolbar-generating .audio-tb-btn-primary::after {
            content: "";
            position: absolute;
            inset: 4px;
            border-radius: var(--radius-pill);
            border: 2px solid rgba(255,255,255,0.4);
            border-top-color: #fff;
            animation: audio-tb-spin 0.9s linear infinite;
        }
        .audio-toolbar.toolbar-generating .audio-tb-btn-primary > * { visibility: hidden; }
        @keyframes audio-tb-spin { to { transform: rotate(360deg); } }
        /* Hide non-essential controls while generating to avoid confusion */
        .audio-toolbar.toolbar-generating .audio-tb-progress,
        .audio-toolbar.toolbar-generating #audioBack10Btn,
        .audio-toolbar.toolbar-generating #audioFwd10Btn,
        .audio-toolbar.toolbar-generating .audio-tb-speed { opacity: 0.4; pointer-events: none; }

        /* Push section content above toolbar so last verses aren't hidden */
        .section-view { padding-bottom: 5rem; }

        @media (max-width: 700px) {
            .audio-toolbar {
                flex-wrap: wrap;
                justify-content: center;
                border-radius: 18px;
                left: 0.5rem;
                right: 0.5rem;
                transform: translateY(10px);
                max-width: none;
            }
            .audio-toolbar.visible { transform: translateY(0); }
            .audio-tb-progress { flex: 1 1 100%; order: 5; }
            .audio-tb-volume   { width: 60px; }
        }
        /* Hidden artifacts of the old indicator — keep selectors no-op to avoid breaking saved CSS overrides */
        .stop-audio-btn {
            border: none;
            background: none;
            color: #dc3545;
            cursor: pointer;
            padding: 2px 6px;
            font-size: 1rem;
        }
        .stop-audio-btn:hover { opacity: 0.8; }
        /* Toast notification */
        .toast-container {
            position: fixed;
            bottom: 20px;
            right: 20px;
            z-index: 1100;
        }
        .toast-notification {
            background: #198754;
            color: white;
            padding: 0.75rem 1.5rem;
            border-radius: var(--radius-md);
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
            animation: toastIn 0.3s ease-out, toastOut 0.3s ease-in 1.7s forwards;
        }
        @keyframes toastIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        @keyframes toastOut {
            from { opacity: 1; transform: translateY(0); }
            to { opacity: 0; transform: translateY(20px); }
        }
        /* Theme toggle */
        .theme-toggle {
            border: none;
            background: none;
            font-size: 1.25rem;
            cursor: pointer;
            padding: 0.25rem 0.5rem;
            opacity: 0.7;
            transition: opacity 0.2s;
        }
        .theme-toggle:hover { opacity: 1; }
        /* Hamburger menu */
        .hamburger-btn {
            border: none;
            background: none;
            font-size: 1.5rem;
            cursor: pointer;
            padding: 0.25rem 0.5rem;
            opacity: 0.8;
            transition: opacity 0.2s;
            color: inherit;
        }
        .hamburger-btn:hover { opacity: 1; }
        .sidebar-nav .nav-link {
            color: inherit;
            padding: 0.75rem 1rem;
            border-radius: var(--radius-md);
            margin-bottom: 0.25rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            transition: background 0.2s;
        }
        .sidebar-nav .nav-link:hover {
            background: rgba(128,128,128,0.15);
        }
        .sidebar-nav .nav-link.active {
            background: color-mix(in srgb, var(--app-accent) 15%, transparent);
            color: var(--app-accent);
            font-weight: 500;
        }
        .sidebar-nav .nav-icon { font-size: 1.25rem; }
        .sidebar-nav .nav-label { font-size: 0.95rem; }
        /* Collapsible nav groups */
        .nav-group { margin-bottom: 0.25rem; }
        .nav-group-header {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: var(--app-accent);
            border: none;
            color: #fff;
            font-size: 0.78rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            padding: 0.45rem 1rem;
            border-radius: var(--radius-sm);
            margin-bottom: 0.25rem;
            cursor: pointer;
            transition: filter 0.15s;
        }
        .nav-group-header:hover { filter: brightness(1.1); }
        .nav-group-chev { transition: transform 0.2s; font-size: 0.85rem; }
        .nav-group.collapsed .nav-group-chev { transform: rotate(-90deg); }
        .nav-group.collapsed .nav-group-items { display: none; }
        .nav-group-items .nav-link { padding: 0.6rem 1rem 0.6rem 1.25rem; }
        /* While filtering, collapsed groups still reveal their matches */
        .sidebar-nav.filtering .nav-group.collapsed .nav-group-items { display: block; }
        /* Study Journal */
        .journal-day-header {
            padding: 0.5rem 1rem 0.25rem;
            font-size: 0.78rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--app-muted);
            border-bottom: 1px solid rgba(128,128,128,0.15);
        }
        .journal-row {
            display: flex;
            gap: 0.75rem;
            padding: 0.65rem 1rem;
            border-bottom: 1px solid rgba(128,128,128,0.12);
            cursor: pointer;
            transition: background 0.15s;
        }
        .journal-row:hover { background: rgba(128,128,128,0.1); }
        .journal-row:last-child { border-bottom: none; }
        .journal-row-icon { font-size: 1.1rem; line-height: 1.4; }
        .journal-row-main { flex: 1; min-width: 0; }
        .journal-row-ref { font-weight: 600; font-size: 0.92rem; }
        .journal-entry-text { font-size: 0.9rem; color: var(--app-muted); white-space: pre-wrap; }
        .journal-hl-chip {
            display: inline-block;
            font-size: 0.75rem;
            padding: 0.05rem 0.6rem;
            border-radius: var(--radius-pill);
            text-transform: capitalize;
            color: #333;
        }
        .journal-hl-chip.hl-yellow { background: #ffe28a; }
        .journal-hl-chip.hl-green  { background: #b5e6b5; }
        .journal-hl-chip.hl-blue   { background: #b3d7f5; }
        .journal-hl-chip.hl-pink   { background: #f5c2d7; }

        /* ===== Edge-to-edge safe areas (Native Feel Pack) =====
           viewport-fit=cover lets the app draw under the iPhone notch / Dynamic
           Island and the home indicator; these pad the interactive surfaces back
           into the safe area. env() falls back to 0 on devices without insets. */
        body {
            padding-left: env(safe-area-inset-left, 0px);
            padding-right: env(safe-area-inset-right, 0px);
        }
        .audio-toolbar { bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
        .toast-container {
            bottom: calc(20px + env(safe-area-inset-bottom, 0px));
            right: calc(20px + env(safe-area-inset-right, 0px));
        }
        .offline-badge { top: calc(0.5rem + env(safe-area-inset-top, 0px)); }
        #iosA2HSToast { margin-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important; }
        .offcanvas-start .offcanvas-header { padding-top: calc(1rem + env(safe-area-inset-top, 0px)); }
        .offcanvas-start .offcanvas-body { padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px)); }
        .verse-why-offcanvas .offcanvas-header { padding-top: calc(1rem + env(safe-area-inset-top, 0px)); }
        .verse-why-offcanvas .offcanvas-body { padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }

        /* ===== View Transitions (Native Feel Pack) =====
           Section switches get a quick native-style fade + lift. Browsers without
           the API (or users preferring reduced motion) switch instantly. */
        @media (prefers-reduced-motion: no-preference) {
            ::view-transition-old(root) { animation: vt-fade-out 0.13s ease both; }
            ::view-transition-new(root) { animation: vt-fade-in 0.2s ease both; }
        }
        @keyframes vt-fade-out { to { opacity: 0; } }
        @keyframes vt-fade-in { from { opacity: 0; transform: translateY(8px); } }
        .section-view { display: none; }
        .section-view.active { display: block; }
        #section-home.active { display: flex; }
        /* Light mode overrides */
        [data-bs-theme="light"] .skeleton-line {
            background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
            background-size: 200% 100%;
            animation: shimmer 1.5s infinite;
        }
        [data-bs-theme="light"] .response-answer.collapsed::after {
            background: linear-gradient(transparent, #fff);
        }

        /* === Bible Reader === */
        .verse-display { line-height: 1.8; }
        .verse-display .verse-num {
            font-weight: bold;
            color: var(--app-accent);
            font-size: 0.75em;
            vertical-align: super;
            margin-right: 2px;
        }
        /* === Notes === */
        .note-icon {
            cursor: pointer;
            opacity: 0.2;
            font-size: 0.7em;
            vertical-align: super;
            margin-left: 1px;
            transition: opacity 0.2s;
            user-select: none;
        }
        .note-icon:hover { opacity: 0.7; }
        .note-icon.has-note { opacity: 1; }
        /* Verse Why Companion icon — sits next to the note pencil; tapping
           opens the right-side offcanvas with AI-generated context. */
        .verse-why-icon {
            cursor: pointer;
            opacity: 0.2;
            font-size: 0.75em;
            vertical-align: super;
            margin-left: 2px;
            transition: opacity 0.2s, transform 0.15s;
            user-select: none;
            color: var(--app-accent);
        }
        .verse-why-icon:hover { opacity: 0.9; transform: scale(1.2); }
        .verse-why-offcanvas { width: min(420px, 90vw); }
        .verse-why-section { margin-bottom: 1.1rem; }
        .verse-why-section h6 {
            font-size: 0.78rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--app-muted, #94a3b8);
            margin-bottom: 0.25rem;
        }
        .verse-why-section p { margin-bottom: 0; line-height: 1.55; }
        .verse-why-function {
            display: inline-block;
            padding: 0.2rem 0.6rem;
            border-radius: var(--radius-pill);
            background: color-mix(in srgb, var(--app-accent) 18%, transparent);
            color: var(--app-accent);
            font-size: 0.78rem;
            font-weight: 600;
        }
        .verse-why-verse-text {
            font-style: italic;
            color: var(--bs-emphasis-color, inherit);
            border-left: 3px solid var(--app-accent);
            padding: 0.5rem 0.75rem;
            background: color-mix(in srgb, var(--app-accent) 6%, transparent);
            border-radius: 0 6px 6px 0;
            margin-bottom: 1.1rem;
        }
        .note-inline {
            display: block;
            margin: 6px 0 14px 0;
            padding: 10px;
            border-left: 3px solid var(--app-accent);
            background: color-mix(in srgb, var(--app-accent) 5%, transparent);
            border-radius: var(--radius-xs);
        }
        .note-inline textarea {
            width: 100%;
            min-height: 60px;
            border: 1px solid #444;
            border-radius: var(--radius-xs);
            background: var(--bs-body-bg);
            color: var(--bs-body-color);
            padding: 6px 8px;
            font-size: 0.9em;
            resize: vertical;
        }
        .note-inline .note-actions {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
            margin-top: 6px;
        }
        .note-inline .note-actions button {
            font-size: 0.8em;
            padding: 2px 10px;
        }
        .chapter-note-card {
            border-left: 3px solid var(--app-accent);
            background: color-mix(in srgb, var(--app-accent) 5%, transparent);
            border-radius: var(--radius-xs);
            padding: 10px;
            margin-bottom: 12px;
        }
        .chapter-note-card .chapter-note-label {
            font-size: 0.85em;
            font-weight: 600;
            color: var(--app-accent);
            cursor: pointer;
            user-select: none;
        }
        .chapter-note-card textarea {
            width: 100%;
            min-height: 60px;
            border: 1px solid #444;
            border-radius: var(--radius-xs);
            background: var(--bs-body-bg);
            color: var(--bs-body-color);
            padding: 6px 8px;
            font-size: 0.9em;
            resize: vertical;
            margin-top: 6px;
        }
        .chapter-note-card .note-actions {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
            margin-top: 6px;
        }
        .chapter-note-card .note-actions button {
            font-size: 0.8em;
            padding: 2px 10px;
        }

        .chapter-nav-btn {
            border: none;
            background: none;
            color: var(--app-accent);
            cursor: pointer;
            font-size: 0.9rem;
            padding: 0.25rem 0.5rem;
        }
        .chapter-nav-btn:hover { text-decoration: underline; }
        .chapter-nav-btn:disabled { color: var(--app-muted); cursor: default; text-decoration: none; }
        /* Pill-shaped action buttons. Same family as .audio-tb-btn (toolbar)
           so the chapter Listen/Queue/Resume controls feel like part of one set. */
        .play-audio-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.35rem;
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(255,255,255,0.10);
            color: var(--app-accent);
            border-radius: var(--radius-pill);
            padding: 0.4rem 0.65rem;
            font-size: 0.85rem;
            font-weight: 600;
            line-height: 1;
            cursor: pointer;
            transition: background 0.15s, transform 0.05s, opacity 0.15s;
        }
        .play-audio-btn:hover    { background: rgba(255,255,255,0.13); }
        .play-audio-btn:active   { transform: scale(0.96); }
        .play-audio-btn:disabled { opacity: 0.35; cursor: not-allowed; }
        .play-audio-btn.loading  { opacity: 0.5; cursor: wait; }
        .play-audio-btn svg      { display: block; }
        .play-audio-btn .play-audio-label {
            font-variant-numeric: tabular-nums;
            font-size: 0.78rem;
            letter-spacing: 0.01em;
        }
        [data-bs-theme="light"] .play-audio-btn {
            background: rgba(0,0,0,0.04);
            border-color: rgba(0,0,0,0.08);
        }
        [data-bs-theme="light"] .play-audio-btn:hover {
            background: rgba(0,0,0,0.09);
        }

        /* === Explain it to me like I am 10 === */
        /* Same pill family as .play-audio-btn but filled with the accent so it
           reads as the primary action. */
        .eli10-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            background: var(--app-accent);
            border: 1px solid transparent;
            color: #fff;
            border-radius: var(--radius-pill);
            padding: 0.4rem 0.85rem;
            font-size: 0.85rem;
            font-weight: 600;
            line-height: 1;
            cursor: pointer;
            transition: filter 0.15s, transform 0.05s;
        }
        .eli10-btn:hover  { filter: brightness(1.1); color: #fff; }
        .eli10-btn:active { transform: scale(0.96); }
        .eli10-btn svg    { display: block; flex-shrink: 0; }
        /* Emoji icons inside the pill buttons get a fixed box so emoji-based and
           SVG-based buttons come out the same height. */
        .eli10-btn { min-height: 2rem; }
        .eli10-btn .eli10-emoji { font-size: 1rem; line-height: 1; display: block; flex-shrink: 0; }
        .eli10-btn .eli10-label-short { display: none; }
        @media (max-width: 480px) {
            .eli10-btn .eli10-label-full  { display: none; }
            .eli10-btn .eli10-label-short { display: inline; }
        }
        /* Chapter action toolbar at the top of the Reader: Ask / ELI10 / Share */
        .reader-chapter-actions {
            display: flex;
            align-items: stretch;
            gap: 0.5rem;
            flex-wrap: wrap;
            margin-bottom: 0.75rem;
        }
        /* Licensed-translation copyright line (inside .verse-display — reset serif) */
        .licensed-copyright {
            font-family: var(--bs-body-font-family);
            font-size: 0.75rem;
            line-height: 1.4;
            color: var(--app-muted);
            margin-top: 1rem;
            padding-top: 0.5rem;
            border-top: 1px solid var(--bs-border-color);
        }
        /* Chip row lives inside .verse-display — reset the serif/line-height it inherits */
        .explore-chapter-card {
            font-family: var(--bs-body-font-family);
            line-height: 1.5;
            border-top: 1px solid var(--bs-border-color);
            padding-top: 1rem;
        }
        /* Badges dialog */
        .badges-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
            gap: 0.75rem;
        }
        .badge-tile {
            border: 1px solid var(--bs-border-color);
            border-radius: var(--radius-md);
            padding: 0.75rem 0.5rem;
            text-align: center;
        }
        .badge-tile.locked { opacity: 0.45; }
        .badge-tile.earned { border-color: var(--app-accent); }
        .badge-tile-icon { font-size: 1.8rem; line-height: 1.2; }
        .badge-tile-name { font-weight: 600; font-size: 0.9rem; margin-top: 0.25rem; }
        /* Groups: unread indicator pill (hamburger + nav) */
        .unread-pill {
            position: absolute;
            top: -4px; right: -8px;
            min-width: 18px; height: 18px;
            padding: 0 5px;
            background: #dc3545; color: #fff;
            border-radius: 999px;
            font-size: 0.68rem; font-weight: 700;
            line-height: 18px; text-align: center;
        }
        .hamburger-btn { position: relative; }
        .sidebar-nav .nav-link { position: relative; }
        .sidebar-nav .unread-pill { right: 10px; top: 50%; transform: translateY(-50%); }
        /* Group chat */
        .group-chat-list { max-height: 55vh; overflow-y: auto; display: flex; flex-direction: column; gap: 0.4rem; padding: 0.25rem 0; }
        .group-msg { max-width: 85%; align-self: flex-start; background: var(--bs-secondary-bg, rgba(128,128,128,0.15)); border-radius: 14px 14px 14px 4px; padding: 0.45rem 0.7rem; }
        .group-msg.mine { align-self: flex-end; background: color-mix(in srgb, var(--app-accent) 22%, transparent); border-radius: 14px 14px 4px 14px; }
        .group-msg.system { align-self: center; background: none; font-size: 0.78rem; color: var(--app-muted); padding: 0.1rem 0.5rem; max-width: 100%; text-align: center; }
        .group-msg.announce { border: 1px solid color-mix(in srgb, var(--app-accent) 45%, transparent); }
        .group-msg-name { font-size: 0.72rem; font-weight: 700; opacity: 0.75; }
        .grp-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; vertical-align: middle; flex-shrink: 0; }
        .grp-avatar-fallback { display: inline-flex; align-items: center; justify-content: center; background: rgba(128, 128, 128, 0.25); font-size: 0.72rem; font-weight: 700; }
        .group-msg-name .grp-avatar { width: 18px; height: 18px; font-size: 0.6rem; }
        .group-msg-body { font-size: 0.92rem; white-space: pre-line; word-break: break-word; }
        .group-msg-time { font-size: 0.65rem; opacity: 0.55; text-align: right; }
        .group-msg-del { border: none; background: none; font-size: 0.7rem; opacity: 0.4; padding: 0 0.2rem; }
        /* Title-plus-actions rows (group Studies, My Lessons). The action buttons
           never shrink, so on a narrow screen the title was being squeezed to a
           single character per line. Give the title a floor (12rem) and let the
           action group wrap onto its own line instead. */
        .list-row { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
        .list-row-main { display: flex; align-items: center; gap: 0.5rem; flex: 1 1 12rem; min-width: 12rem; }
        .list-row-text { min-width: 0; }
        .list-row-text strong { word-break: break-word; }
        .list-row-actions { display: flex; gap: 0.25rem; flex-shrink: 0; }
        @media (max-width: 480px) {
            .list-row-actions { width: 100%; justify-content: flex-end; }
            /* Icon-only Discuss on the narrowest screens — five buttons plus the word
               "Discuss" is what overflowed the row in the first place. */
            .grp-discuss-label { display: none; }
        }
        /* Emoji picker for the chat composer — a plain grid of buttons, no library. */
        .emoji-panel { display: none; grid-template-columns: repeat(auto-fill, minmax(2rem, 1fr)); gap: 0.15rem;
            max-height: 11rem; overflow-y: auto; margin-top: 0.4rem; padding: 0.4rem;
            border: 1px solid var(--bs-border-color, rgba(128,128,128,0.35)); border-radius: var(--radius-lg); }
        .emoji-panel.show { display: grid; }
        .emoji-panel button { border: none; background: none; font-size: 1.25rem; line-height: 1;
            padding: 0.2rem; border-radius: 6px; cursor: pointer; }
        .emoji-panel button:hover, .emoji-panel button:focus-visible { background: rgba(128, 128, 128, 0.2); }
        /* Term-in-review stat strip. Wraps rather than scrolls, so it reads on a
           phone without a horizontal gesture. */
        .review-stats {
            display: flex; flex-wrap: wrap; gap: 1.25rem;
            padding: 0.85rem 0 0.25rem;
        }
        .review-stats > div { display: flex; flex-direction: column; line-height: 1.2; }
        .review-stats strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
        .review-stats span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--app-muted); }

        /* Off-screen until focused, then anchored top-left over everything. */
        .skip-link {
            position: fixed; top: -3rem; left: 0.5rem; z-index: 2000;
            background: var(--bs-primary, #0d6efd); color: #fff;
            padding: 0.55rem 1rem; border-radius: 0 0 6px 6px;
            text-decoration: none; font-weight: 600;
            transition: top 0.15s ease-in-out;
        }
        .skip-link:focus { top: 0; color: #fff; outline: 2px solid #fff; outline-offset: 2px; }
        @media (prefers-reduced-motion: reduce) { .skip-link { transition: none; } }

        /* Search hits in the journal. Inherits the text colour rather than forcing
           black, so it stays readable on the dark theme. */
        mark.journal-hit {
            background: rgba(255, 213, 79, 0.42);
            color: inherit;
            padding: 0 .12em;
            border-radius: 2px;
        }
        /* A download button that has everything saved reads as done rather than
           as another thing to press. */
        .audio-saved {
            color: var(--bs-success, #198754) !important;
            border-color: var(--bs-success, #198754) !important;
            font-weight: 700;
        }
        .group-msg-del:hover { opacity: 1; }
        .group-day-sep { align-self: center; font-size: 0.7rem; color: var(--app-muted); margin: 0.35rem 0; }
        /* Chat media. height:auto with the width/height attributes present lets the
           browser reserve the right box before the bytes land, so the thread does
           not jump around as pictures load. */
        .group-msg-media { display: block; max-width: min(280px, 100%); height: auto;
            border-radius: var(--radius-lg); margin-bottom: 0.3rem; background: rgba(128,128,128,0.12); }
        .group-msg-media-gone { font-style: italic; margin-bottom: 0.3rem; }
        .chat-attach-preview { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.4rem;
            padding: 0.4rem; border: 1px dashed var(--bs-border-color, rgba(128,128,128,0.35));
            border-radius: var(--radius-lg); }
        .chat-attach-preview img { max-height: 4.5rem; max-width: 60%; border-radius: 6px; }
        .chat-gif-panel { margin-top: 0.4rem; padding: 0.5rem;
            border: 1px solid var(--bs-border-color, rgba(128,128,128,0.35)); border-radius: var(--radius-lg); }
        .chat-gif-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr));
            gap: 0.3rem; max-height: 14rem; overflow-y: auto; }
        .chat-gif-pick { border: none; background: none; padding: 0; cursor: pointer; border-radius: 6px; }
        .chat-gif-pick img { width: 100%; height: 5rem; object-fit: cover; border-radius: 6px; display: block; }
        .chat-gif-pick:hover img, .chat-gif-pick:focus-visible img { outline: 2px solid var(--bs-primary, #0d6efd); }
        /* Attribution is a licence condition for both GIF providers, so it is not
           optional chrome — it stays visible whenever the picker is open. */
        .chat-gif-attribution { font-size: 0.7rem; color: var(--app-muted); text-align: right;
            margin-top: 0.35rem; letter-spacing: 0.02em; }
        /* Atlas "then & now" profile callout */
        .atlas-profile-today {
            background: color-mix(in srgb, var(--app-accent) 10%, transparent);
            border: 1px solid color-mix(in srgb, var(--app-accent) 30%, transparent);
            border-radius: var(--radius-md);
            padding: 0.5rem 0.7rem;
        }
        /* Seasonal challenge banner (Home) */
        .challenge-banner { border-left: 4px solid var(--app-accent); }
        .challenge-icon { font-size: 2rem; line-height: 1; }

        /* Plan reading session banner (Reader) — lives inside .verse-display,
           so reset the serif/line-height it would inherit */
        .plan-reading-banner {
            font-family: var(--bs-body-font-family);
            line-height: 1.4;
            font-size: 0.85rem;
            display: flex; align-items: center; gap: 0.5rem;
            background: color-mix(in srgb, var(--app-accent) 12%, transparent);
            border: 1px solid color-mix(in srgb, var(--app-accent) 35%, transparent);
            border-radius: var(--radius-md);
            padding: 0.45rem 0.7rem;
            margin-bottom: 0.75rem;
        }
        .plan-banner-text { flex: 1 1 auto; min-width: 0; }
        .plan-banner-exit {
            flex: 0 0 auto;
            background: none; border: none; color: inherit;
            opacity: 0.6; font-size: 0.9rem; padding: 0 0.2rem;
        }
        .plan-banner-exit:hover { opacity: 1; }

        /* Guided Scripture overlay */
        /* ---- Fullscreen image viewer ------------------------------------
           Above the guided overlay, since a picture inside a guided session
           should still open over it. Near-opaque rather than solid so the page
           beneath stays faintly legible and the overlay reads as temporary. */
        #imageViewer {
            position: fixed; inset: 0; z-index: 1095;
            background: rgba(8, 10, 14, 0.94);
            display: flex; flex-direction: column;
            animation: imgViewerIn 0.16s ease-out;
        }
        #imageViewer[hidden] { display: none; }
        @keyframes imgViewerIn { from { opacity: 0; } to { opacity: 1; } }
        @media (prefers-reduced-motion: reduce) { #imageViewer { animation: none; } }
        #imageViewerStage {
            flex: 1; min-height: 0;
            display: flex; align-items: center; justify-content: center;
            overflow: auto; overscroll-behavior: contain;
            padding: calc(3.25rem + env(safe-area-inset-top)) 1rem 1rem;
        }
        #imageViewerImg {
            max-width: 100%; max-height: 100%;
            object-fit: contain;
            border-radius: var(--radius-lg);
            cursor: zoom-in;
            /* pinch-zoom stays available on touch even before the tap-to-zoom */
            touch-action: pinch-zoom;
        }
        /* Zoomed: drop the fit constraint so the stage scrolls and the picture can
           be panned. margin:auto keeps a small image centred while zoomed. */
        #imageViewer.zoomed #imageViewerImg {
            max-width: none; max-height: none;
            width: auto; height: auto;
            margin: auto;
            cursor: zoom-out;
        }
        #imageViewerClose {
            position: absolute; top: calc(0.65rem + env(safe-area-inset-top)); right: 0.65rem;
            z-index: 2;
            width: 2.5rem; height: 2.5rem; border-radius: 50%;
            border: none; background: rgba(255, 255, 255, 0.15); color: #fff;
            font-size: 1.1rem; line-height: 1; cursor: pointer;
        }
        #imageViewerClose:hover, #imageViewerClose:focus-visible { background: rgba(255, 255, 255, 0.3); }
        #imageViewerCaption {
            flex: 0 0 auto; text-align: center; color: rgba(255, 255, 255, 0.75);
            font-size: 0.8rem; padding: 0.5rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
        }
        /* Any picture the viewer can open advertises itself as clickable. */
        .study-chapter-img, .group-msg-media { cursor: zoom-in; }

        #guidedOverlay {
            position: fixed; inset: 0; z-index: 1090;
            background: linear-gradient(160deg, var(--app-accent) 0%, #10131a 55%, #10131a 100%);
            color: #f4f4f5;
        }
        #guidedScroller {
            height: 100%;
            overflow-y: auto;
            scroll-snap-type: y mandatory;
            overscroll-behavior: contain;
        }
        .guided-card {
            min-height: 100%;
            scroll-snap-align: start;
            scroll-snap-stop: always;
            display: flex; flex-direction: column; justify-content: center; align-items: center;
            padding: 3.5rem 1.5rem calc(3rem + env(safe-area-inset-bottom));
            text-align: center;
            max-width: 680px; margin: 0 auto;
        }
        .guided-kicker { text-transform: uppercase; letter-spacing: 0.15em; font-size: 0.75rem; opacity: 0.75; margin-bottom: 0.75rem; }
        .guided-title { font-size: 1.7rem; font-weight: 700; margin-bottom: 1rem; }
        .guided-verse-text { font-family: Georgia, 'Times New Roman', serif; font-size: 1.35rem; line-height: 1.75; margin-bottom: 1.25rem; }
        .guided-reflection { font-size: 1rem; line-height: 1.6; opacity: 0.9; max-width: 34rem; }
        .guided-ref { font-size: 0.85rem; opacity: 0.7; margin-top: 1rem; }
        .guided-hint { position: absolute; bottom: calc(1rem + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; font-size: 0.8rem; opacity: 0.6; animation: guidedNudge 2.2s ease-in-out infinite; }
        @keyframes guidedNudge { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
        #guidedCloseBtn {
            position: absolute; top: calc(0.75rem + env(safe-area-inset-top)); right: 1rem; z-index: 2;
            background: rgba(255,255,255,0.15); border: none; color: inherit;
            width: 2.4rem; height: 2.4rem; border-radius: 50%; font-size: 1.1rem;
        }
        #guidedProgress {
            position: absolute; top: calc(1.35rem + env(safe-area-inset-top)); left: 1.25rem; z-index: 2;
            font-size: 0.8rem; opacity: 0.75;
        }
        @media (prefers-reduced-motion: reduce) { .guided-hint { animation: none; } }

        /* ---------- Evening Rest: warm, dark, quiet ---------- */
        #restOverlay {
            position: fixed; inset: 0; z-index: 1090; color: #f0e2c8;
            background: radial-gradient(110% 70% at 50% 0%, #2a2118 0%, #14100c 55%, #0a0806 100%);
            display: flex; flex-direction: column; transition: filter 1.2s ease;
        }
        #restOverlay[hidden] { display: none; }
        /* Once the psalm is playing the page all but goes out. */
        #restOverlay.is-asleep { filter: brightness(0.45); }
        #restCloseBtn {
            position: absolute; top: calc(0.75rem + env(safe-area-inset-top)); right: 1rem; z-index: 2;
            background: rgba(240,226,200,0.12); border: none; color: inherit;
            width: 2.4rem; height: 2.4rem; border-radius: 50%; font-size: 1.1rem; line-height: 1;
        }
        #restCloseBtn:hover, #restCloseBtn:focus-visible { background: rgba(240,226,200,0.25); }
        .rest-dots { display: flex; gap: 0.4rem; justify-content: center; padding-top: calc(1.4rem + env(safe-area-inset-top)); }
        .rest-dots span { width: 1.6rem; height: 3px; border-radius: 2px; background: rgba(240,226,200,0.2); transition: background 0.4s ease; }
        .rest-dots span.is-on { background: rgba(240,226,200,0.8); }
        .rest-stage {
            flex: 1; overflow-y: auto; width: 100%; max-width: 620px; margin: 0 auto; padding: 1.5rem 1.4rem 1rem;
            display: flex; flex-direction: column; justify-content: center; text-align: center; scrollbar-width: none;
        }
        .rest-stage::-webkit-scrollbar { display: none; }
        .rest-kicker { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; opacity: 0.7; margin-bottom: 0.9rem; }
        .rest-title { font-family: Georgia, 'Times New Roman', serif; font-size: 1.7rem; line-height: 1.3; margin-bottom: 0.8rem; text-wrap: balance; }
        .rest-text { font-size: 1.02rem; line-height: 1.65; opacity: 0.9; }
        .rest-verse { font-family: Georgia, 'Times New Roman', serif; font-size: 1.15rem; line-height: 1.7; margin: 0.9rem 0 0.3rem; }
        .rest-ref { font-size: 0.82rem; opacity: 0.65; margin-bottom: 0.9rem; }
        .rest-img { width: 100%; max-height: 30vh; object-fit: cover; border-radius: 0.8rem; margin-bottom: 1rem; opacity: 0.9; }
        .rest-breath {
            width: 9rem; height: 9rem; margin: 0.5rem auto 1.4rem; border-radius: 50%;
            background: radial-gradient(circle, rgba(240,200,140,0.45) 0%, rgba(240,200,140,0.08) 70%);
            animation: restBreathe 10s ease-in-out infinite;
        }
        @keyframes restBreathe { 0%, 100% { transform: scale(0.62); opacity: 0.55; } 40% { transform: scale(1); opacity: 1; } }
        .rest-breath-word { font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.75; min-height: 1.4rem; margin-bottom: 1rem; }
        .rest-field { text-align: left; margin-bottom: 0.9rem; }
        .rest-field label { display: block; font-size: 0.92rem; margin-bottom: 0.3rem; opacity: 0.9; }
        .rest-field textarea {
            width: 100%; min-height: 3.6rem; resize: vertical; border-radius: 0.6rem; padding: 0.6rem 0.75rem; font-size: 1rem;
            background: rgba(240,226,200,0.07); border: 1px solid rgba(240,226,200,0.2); color: inherit;
        }
        .rest-field textarea::placeholder { color: rgba(240,226,200,0.4); }
        .rest-field textarea:focus { outline: none; border-color: rgba(240,200,140,0.7); }
        .rest-btn, .rest-btn:hover, .rest-btn:focus-visible, .rest-btn:active {
            background: #d9a85c; border-color: #d9a85c; color: #1a130a; font-weight: 600;
        }
        .rest-btn:hover, .rest-btn:focus-visible { filter: brightness(1.08); }
        .rest-btn:disabled { opacity: 0.6; }
        .rest-btn-quiet, .rest-btn-quiet:hover, .rest-btn-quiet:focus-visible, .rest-btn-quiet:active {
            background: rgba(240,226,200,0.12); border-color: transparent; color: inherit;
        }
        .rest-btn-quiet:hover, .rest-btn-quiet:focus-visible { background: rgba(240,226,200,0.22); }
        .rest-btn.is-playing { background: #a8452f; border-color: #a8452f; color: #fff; }
        .rest-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; margin: 0.9rem 0; }
        .rest-chip {
            padding: 0.35rem 0.85rem; border-radius: 2rem; font-size: 0.88rem; color: inherit;
            background: rgba(240,226,200,0.08); border: 1px solid rgba(240,226,200,0.22);
        }
        .rest-chip.is-on { background: rgba(217,168,92,0.9); border-color: #d9a85c; color: #1a130a; font-weight: 600; }
        .rest-nav {
            display: flex; justify-content: space-between; gap: 0.75rem; width: 100%; max-width: 620px; margin: 0 auto;
            padding: 0.6rem 1.4rem calc(1.2rem + env(safe-area-inset-bottom));
        }
        .rest-saved { font-size: 0.85rem; opacity: 0.8; min-height: 1.3rem; }
        .rest-steps { padding-left: 1.2rem; }
        .rest-steps li { margin-bottom: 0.3rem; }
        .rest-banner { border-color: color-mix(in srgb, #d9a85c 55%, var(--bs-border-color)); }
        @media (prefers-reduced-motion: reduce) {
            .rest-breath { animation: none; transform: scale(0.85); }
            #restOverlay { transition: none; }
        }

        /* ---------- Voice conversation ---------- */
        #voiceOverlay {
            position: fixed; inset: 0; z-index: 1090; color: #f4f4f5;
            background: radial-gradient(120% 80% at 50% 100%, var(--app-accent) 0%, #141824 45%, #0c0f16 100%);
        }
        #voiceCloseBtn {
            position: absolute; top: calc(0.75rem + env(safe-area-inset-top)); right: 1rem; z-index: 2;
            background: rgba(255,255,255,0.16); border: none; color: inherit;
            width: 2.4rem; height: 2.4rem; border-radius: 50%; font-size: 1.1rem; line-height: 1;
        }
        #voiceCloseBtn:hover, #voiceCloseBtn:focus-visible { background: rgba(255,255,255,0.3); }
        .voice-wrap {
            height: 100%; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; align-items: center;
            padding: calc(3.2rem + env(safe-area-inset-top)) 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
        }
        .voice-with { font-size: 0.72rem; letter-spacing: 0.15em; text-transform: uppercase; font-weight: 600; opacity: 0.8; text-align: center; }
        .voice-transcript { flex: 1; width: 100%; overflow-y: auto; margin: 1rem 0; scrollbar-width: thin; }
        .voice-q { font-size: 1.05rem; opacity: 0.8; margin-bottom: 0.8rem; }
        .voice-q::before { content: 'You asked'; display: block; font-size: 0.65rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.75; margin-bottom: 0.15rem; }
        .voice-a { font-family: Georgia, 'Times New Roman', serif; font-size: 1.15rem; line-height: 1.65; white-space: pre-wrap; }
        #voiceTranscript a { color: #ffd98a !important; font-size: inherit !important; }
        .voice-empty { height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; opacity: 0.75; font-size: 1.05rem; line-height: 1.6; }
        .voice-orb {
            --lvl: 0; position: relative; flex-shrink: 0; width: 6.5rem; height: 6.5rem; border-radius: 50%; border: none;
            background: rgba(255,255,255,0.14); color: inherit; font-size: 2.2rem;
            display: flex; align-items: center; justify-content: center; transition: background 0.2s ease;
        }
        .voice-orb:hover, .voice-orb:focus-visible { background: rgba(255,255,255,0.22); }
        .voice-orb-ring {
            position: absolute; inset: -0.5rem; border-radius: 50%; border: 2px solid rgba(255,255,255,0.35);
            transform: scale(calc(1 + var(--lvl) * 0.45)); opacity: calc(0.25 + var(--lvl) * 0.75);
            transition: transform 0.08s linear, opacity 0.08s linear;
        }
        .voice-orb[data-state="listening"] { background: #c0392b; }
        .voice-orb[data-state="listening"] .voice-orb-ring { border-color: rgba(255,170,160,0.9); }
        .voice-orb[data-state="transcribing"] .voice-orb-ring, .voice-orb[data-state="thinking"] .voice-orb-ring {
            border-color: rgba(255,255,255,0.15); border-top-color: #fff; opacity: 1; transform: none; transition: none; animation: voiceSpin 0.9s linear infinite;
        }
        .voice-orb[data-state="speaking"] { background: var(--bs-primary); }
        .voice-orb[data-state="speaking"] .voice-orb-ring { opacity: 0.7; transition: none; animation: voicePulse 1.6s ease-in-out infinite; }
        @keyframes voiceSpin { to { transform: rotate(360deg); } }
        @keyframes voicePulse { 0%, 100% { transform: scale(1); opacity: 0.35; } 50% { transform: scale(1.22); opacity: 0.85; } }
        .voice-status { min-height: 2.6rem; margin-top: 0.9rem; font-size: 0.95rem; opacity: 0.9; text-align: center; max-width: 26rem; }
        .voice-foot { margin-top: 0.4rem; text-align: center; font-size: 0.85rem; }
        .voice-note { margin-top: 0.5rem; font-size: 0.72rem; opacity: 0.65; }
        @media (prefers-reduced-motion: reduce) {
            .voice-orb-ring { transition: none; }
            .voice-orb[data-state="speaking"] .voice-orb-ring { animation: none; }
        }

        /* ---------- Scripture Scroll: the full-screen vertical feed ---------- */
        #scrollOverlay { position: fixed; inset: 0; z-index: 1090; background: #0c0f16; color: #f4f4f5; }
        #scrollFeed {
            height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain;
            scrollbar-width: none; outline: none;
        }
        #scrollFeed::-webkit-scrollbar { display: none; }
        #scrollTopBar {
            position: absolute; top: 0; left: 0; right: 0; z-index: 3; pointer-events: none;
            display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
            padding: calc(0.7rem + env(safe-area-inset-top)) 1rem 1.4rem;
            background: linear-gradient(180deg, rgba(8,10,15,0.7) 0%, rgba(8,10,15,0) 100%);
        }
        #scrollTopBar > * { pointer-events: auto; }
        #scrollProgress { font-size: 0.8rem; opacity: 0.85; font-variant-numeric: tabular-nums; min-width: 3.5rem; }
        #scrollModeLabel { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.8; flex: 1; text-align: center; }
        #scrollCloseBtn, #scrollAutoBtn {
            background: rgba(255,255,255,0.16); border: none; color: inherit; flex: none;
            width: 2.4rem; height: 2.4rem; border-radius: 50%; font-size: 1.1rem; line-height: 1;
        }
        #scrollCloseBtn:hover, #scrollCloseBtn:focus-visible, #scrollAutoBtn:hover, #scrollAutoBtn:focus-visible { background: rgba(255,255,255,0.3); }
        /* Listening: lit, and breathing so it is plain the feed is the one talking. */
        #scrollAutoBtn.is-on { background: #f5b942; animation: scrollAutoPulse 2s ease-in-out infinite; }
        @keyframes scrollAutoPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(245,185,66,0.55); } 50% { box-shadow: 0 0 0 0.5rem rgba(245,185,66,0); } }
        @media (prefers-reduced-motion: reduce) { #scrollAutoBtn.is-on { animation: none; } }
        /* The label keeps its place in the middle whatever a theme is called. */
        #scrollModeLabel { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
        /* A dialog opened from a card (the group picker) sits above the feed, not under it. */
        body.scroll-open .modal { z-index: 1100; }
        body.scroll-open .modal-backdrop { z-index: 1099; }
        .scroll-kind-note  { background: linear-gradient(165deg, #3b4a2a 0%, #151a12 52%, #0c0f16 100%); }
        .scroll-urgent { border-left: 3px solid #ff8f8f; padding-left: 0.8rem; font-size: 1.1rem; }
        /* The pause card's recap: the run again, two to a row, one of them kept. */
        .scroll-recap { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; margin-top: 1rem; text-align: left; }
        .scroll-recap-item {
            display: flex; align-items: center; gap: 0.4rem; min-width: 0; padding: 0.45rem 0.6rem; border-radius: 0.6rem;
            color: inherit; font-size: 0.85rem; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18);
        }
        .scroll-recap-item:hover, .scroll-recap-item:focus-visible { background: rgba(255,255,255,0.2); }
        .scroll-recap-item.is-on { background: #f5b942; border-color: #f5b942; color: #1b1407; font-weight: 600; }
        .scroll-recap-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
        .scroll-recap-note { min-height: 1.3rem; margin-top: 0.5rem; opacity: 0.85; }
        .scroll-end.is-passed .scroll-recap, .scroll-end.is-passed .scroll-recap-note { display: none; }
        .scroll-card {
            position: relative; height: 100%; min-height: 100%; overflow: hidden;
            scroll-snap-align: start; scroll-snap-stop: always;
            display: flex; align-items: center; justify-content: center;
            background: linear-gradient(160deg, var(--app-accent) 0%, #141824 48%, #0c0f16 100%);
        }
        /* Each kind leans a different way so the feed has rhythm without a photo. */
        .scroll-kind-card  { background: linear-gradient(200deg, #6b4a1f 0%, #1b1712 52%, #0c0f16 100%); }
        .scroll-kind-study { background: linear-gradient(150deg, #1f4a45 0%, #111a1c 52%, #0c0f16 100%); }
        .scroll-kind-quiz  { background: linear-gradient(170deg, #4a2a63 0%, #17131f 52%, #0c0f16 100%); }
        .scroll-kind-word  { background: linear-gradient(190deg, #1f3d63 0%, #10151f 52%, #0c0f16 100%); }
        .scroll-kind-xref  { background: linear-gradient(140deg, #5a2f2a 0%, #1a1312 52%, #0c0f16 100%); }
        .scroll-bg {
            position: absolute; inset: 0; background-size: cover; background-position: center;
            opacity: 0; transition: opacity 0.6s ease; transform: scale(1.04);
        }
        .scroll-bg.is-loaded { opacity: 1; }
        .scroll-bg::after {
            content: ''; position: absolute; inset: 0;
            background: linear-gradient(180deg, rgba(8,10,15,0.62) 0%, rgba(8,10,15,0.78) 45%, rgba(8,10,15,0.92) 100%);
        }
        .scroll-body {
            position: relative; z-index: 1; width: 100%; max-width: 640px; max-height: 100%; overflow-y: auto;
            padding: calc(4rem + env(safe-area-inset-top)) 4.6rem calc(3.2rem + env(safe-area-inset-bottom)) 1.4rem;
            text-align: left; scrollbar-width: none;
        }
        .scroll-body::-webkit-scrollbar { display: none; }
        .scroll-kicker { font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; font-weight: 600; opacity: 0.8; margin-bottom: 0.8rem; }
        .scroll-prompt { font-style: italic; opacity: 0.85; margin-bottom: 0.3rem; }
        .scroll-text { font-family: Georgia, 'Times New Roman', serif; font-size: 1.5rem; line-height: 1.55; margin-bottom: 0.9rem; text-wrap: pretty; }
        .scroll-text.is-long { font-size: 1.2rem; line-height: 1.6; }
        .scroll-title { font-family: Georgia, 'Times New Roman', serif; font-size: 1.8rem; line-height: 1.25; font-weight: 600; margin-bottom: 0.7rem; }
        .scroll-ref { font-size: 0.85rem; opacity: 0.75; margin-bottom: 0.9rem; }
        .scroll-note { font-size: 1rem; line-height: 1.6; opacity: 0.92; }
        .scroll-verse-quote { font-family: Georgia, 'Times New Roman', serif; font-size: 1.05rem; line-height: 1.65; opacity: 0.9; border-left: 2px solid rgba(255,255,255,0.35); padding-left: 0.8rem; margin-bottom: 0.9rem; }
        .scroll-context { font-family: Georgia, 'Times New Roman', serif; font-size: 1.1rem; line-height: 1.7; margin-bottom: 0.9rem; }
        .scroll-context .ctx-dim { opacity: 0.6; }
        .scroll-context sup { opacity: 0.6; margin-right: 0.2rem; font-family: var(--bs-body-font-family); }
        .scroll-ai-tag { display: inline-block; font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.1rem 0.45rem; border-radius: 1rem; background: rgba(255,255,255,0.14); opacity: 0.85; margin-top: 0.8rem; }
        .scroll-mine { display: inline-block; font-size: 0.72rem; padding: 0.15rem 0.6rem; border-radius: 1rem; background: rgba(255,214,102,0.22); color: #ffe7a3; margin-bottom: 0.8rem; }
        .scroll-word-lemma { font-size: 3rem; line-height: 1.2; margin-bottom: 0.2rem; }
        .scroll-arrow { opacity: 0.6; margin: 0.2rem 0 0.7rem; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; }
        .scroll-options { display: grid; gap: 0.5rem; margin-top: 0.4rem; }
        .scroll-option {
            text-align: left; padding: 0.7rem 0.9rem; border-radius: 0.7rem; color: inherit; font-size: 1rem;
            background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18);
        }
        .scroll-option:not(:disabled):hover { background: rgba(255,255,255,0.18); }
        .scroll-option.is-right { background: rgba(46,160,90,0.45); border-color: rgba(120,220,160,0.9); }
        .scroll-option.is-wrong { background: rgba(200,70,70,0.4); border-color: rgba(240,140,140,0.9); }
        .scroll-explain { margin-top: 0.8rem; font-size: 0.95rem; line-height: 1.55; opacity: 0.92; }
        /* The action rail, down the right edge like every vertical feed. */
        .scroll-rail {
            position: absolute; z-index: 2; right: 0.55rem; bottom: calc(2.6rem + env(safe-area-inset-bottom));
            display: flex; flex-direction: column; gap: 0.75rem; align-items: center;
        }
        .scroll-act {
            background: none; border: none; color: inherit; padding: 0; width: 3.4rem;
            display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
        }
        .scroll-act-icon {
            width: 2.75rem; height: 2.75rem; border-radius: 50%; display: flex; align-items: center; justify-content: center;
            font-size: 1.2rem; background: rgba(255,255,255,0.14); transition: transform 0.15s ease, background 0.15s ease;
        }
        .scroll-act:hover .scroll-act-icon, .scroll-act:focus-visible .scroll-act-icon { background: rgba(255,255,255,0.28); }
        .scroll-act:active .scroll-act-icon { transform: scale(0.92); }
        .scroll-act.is-on .scroll-act-icon { background: #f5b942; color: #1b1407; }
        .scroll-act.is-playing .scroll-act-icon { background: var(--bs-danger); }
        .scroll-act-label { font-size: 0.65rem; opacity: 0.85; }
        .scroll-burst {
            position: absolute; z-index: 4; left: 50%; top: 50%; font-size: 5rem; pointer-events: none;
            transform: translate(-50%, -50%) scale(0.4); opacity: 0; animation: scrollBurst 0.7s ease-out;
        }
        @keyframes scrollBurst {
            0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
            30% { transform: translate(-50%, -50%) scale(1.15); opacity: 0.95; }
            100% { transform: translate(-50%, -60%) scale(1); opacity: 0; }
        }
        .scroll-end { text-align: center; background: linear-gradient(180deg, #171c2a 0%, #0c0f16 100%); }
        .scroll-end .scroll-body { padding-right: 1.4rem; text-align: center; }
        .scroll-end-mark { font-family: Georgia, 'Times New Roman', serif; font-size: 2.1rem; margin-bottom: 0.5rem; }
        .scroll-end-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: 1.3rem; }
        .scroll-end.is-passed .scroll-end-actions { display: none; }
        .scroll-launch-stat { font-variant-numeric: tabular-nums; }
        @media (max-width: 480px) {
            .scroll-text { font-size: 1.3rem; }
            .scroll-text.is-long { font-size: 1.08rem; }
            .scroll-title { font-size: 1.5rem; }
            .scroll-body { padding-right: 4.2rem; padding-left: 1.1rem; }
        }
        @media (prefers-reduced-motion: reduce) {
            .scroll-bg { transition: none; transform: none; }
            .scroll-burst { animation: none; }
            .scroll-act-icon { transition: none; }
        }
        /* Row that holds Listen on the left and ELI10 on the right inside the study card */
        .audio-action-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.6rem;
            flex-wrap: wrap;
            margin-top: 0.5rem;
        }
        /* Keep Listen + continuous-play toggle adjacent on the left of the row. */
        .audio-action-left {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .eli10-card {
            border-left: 4px solid var(--app-accent);
        }
        .eli10-bigidea {
            background: var(--app-accent-soft);
            border-left: 3px solid var(--app-accent);
            padding: 0.75rem 1rem;
            border-radius: 0.25rem;
            font-size: 1.05rem;
        }
        .eli10-story p { margin-bottom: 0.85rem; line-height: 1.55; }
        .eli10-keywords dt {
            font-weight: 600;
            color: var(--app-accent);
            margin-top: 0.4rem;
        }
        .eli10-keywords dd { margin-left: 1rem; margin-bottom: 0.25rem; }
        .eli10-verse {
            background: var(--app-accent-soft);
            padding: 0.75rem 1rem;
            border-radius: 0.25rem;
        }
        .eli10-prayer {
            font-style: italic;
            padding-left: 1rem;
            border-left: 3px solid var(--app-accent);
        }
        .eli10-fyi summary { cursor: pointer; }
        .eli10-actions { padding-top: 0.5rem; border-top: 1px solid rgba(128,128,128,0.2); }

        /* === Bible Study === */
        .study-accordion .accordion-button { font-weight: 500; }
        .study-list { padding-left: 1.25rem; }
        .study-list li { margin-bottom: 0.5rem; }
        .nephilim-badge {
            display: inline-block;
            background: linear-gradient(135deg, #6f42c1, #d63384);
            color: white;
            padding: 0.25rem 0.75rem;
            border-radius: var(--radius-xl);
            font-size: 0.8rem;
            font-weight: 500;
        }
        .nephilim-box {
            border-left: 4px solid #6f42c1;
            padding: 0.75rem 1rem;
            margin-top: 0.75rem;
            border-radius: 0 8px 8px 0;
            background: rgba(111,66,193,0.08);
        }

        /* === Cross References === */
        .ref-card {
            border-left: 4px solid var(--app-muted);
            padding: 0.75rem 1rem;
            margin-bottom: 0.75rem;
            border-radius: 0 8px 8px 0;
        }
        .ref-card.quotation { border-left-color: var(--app-accent); }
        .ref-card.thematic { border-left-color: #198754; }
        .ref-card.fulfillment { border-left-color: #dc3545; }
        .ref-card.parallel { border-left-color: #ffc107; }
        .ref-type-badge {
            display: inline-block;
            padding: 0.15rem 0.5rem;
            border-radius: var(--radius-lg);
            font-size: 0.75rem;
            font-weight: 500;
            text-transform: uppercase;
        }
        .ref-type-badge.quotation { background: color-mix(in srgb, var(--app-accent) 15%, transparent); color: var(--app-accent); }
        .ref-type-badge.thematic { background: rgba(25,135,84,0.15); color: #198754; }
        .ref-type-badge.fulfillment { background: rgba(220,53,69,0.15); color: #dc3545; }
        .ref-type-badge.parallel { background: rgba(255,193,7,0.15); color: #cc9a06; }

        /* === Timeline === */
        .era-pills {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-bottom: 1rem;
        }
        .era-pill {
            border: 1px solid var(--app-muted);
            background: none;
            color: inherit;
            padding: 0.3rem 0.75rem;
            border-radius: var(--radius-xl);
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        .era-pill:hover { border-color: var(--app-accent); color: var(--app-accent); }
        .era-pill.active { background: var(--app-accent); border-color: var(--app-accent); color: white; }
        .timeline-vertical {
            position: relative;
            padding-left: 2rem;
        }
        .timeline-vertical::before {
            content: '';
            position: absolute;
            left: 0.5rem;
            top: 0;
            bottom: 0;
            width: 2px;
            background: var(--app-muted);
        }
        .timeline-event {
            position: relative;
            margin-bottom: 1.5rem;
            animation: slideIn 0.3s ease-out;
        }
        .timeline-event::before {
            content: '';
            position: absolute;
            left: -1.75rem;
            top: 0.5rem;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: var(--app-accent);
            border: 2px solid var(--bs-body-bg, #212529);
        }
        .timeline-date {
            font-size: 0.8rem;
            color: var(--app-muted);
            font-weight: 500;
        }
        .timeline-title { font-weight: 600; }
        .timeline-people .badge {
            font-size: 0.7rem;
            margin-right: 0.25rem;
        }
        .timeline-refs {
            font-size: 0.8rem;
            color: var(--app-accent);
        }
        .timeline-event-header { cursor: pointer; }
        .timeline-event-header:hover .timeline-title { color: var(--app-accent); }
        .timeline-event-body {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
            opacity: 0;
        }
        .timeline-event.expanded .timeline-event-body {
            max-height: 500px;
            opacity: 1;
        }
        .timeline-event-header .expand-arrow {
            display: inline-block;
            transition: transform 0.2s;
            font-size: 0.7rem;
            opacity: 0.5;
        }
        .timeline-event.expanded .expand-arrow { transform: rotate(90deg); }
        .timeline-person { cursor: pointer; transition: all 0.15s; }
        .timeline-person:hover { background: var(--app-accent) !important; color: #fff !important; }
        .scripture-ref-link { color: var(--app-accent); text-decoration: none; font-size: 0.8rem; }
        .scripture-ref-link:hover { text-decoration: underline; }
        .era-figure-link { color: inherit; text-decoration: none; border-bottom: 1px dashed var(--app-accent); }
        .era-figure-link:hover { color: var(--app-accent); }
        .era-header {
            padding: 0.75rem 1rem;
            margin-bottom: 1rem;
            border-radius: var(--radius-md);
            background: color-mix(in srgb, var(--app-accent) 8%, transparent);
            border-left: 4px solid var(--app-accent);
        }
        .era-header h5 { margin-bottom: 0.25rem; }
        .era-header .era-dates { color: var(--app-muted); font-size: 0.85rem; }

        /* === Greek & Hebrew === */
        .strongs-card {
            border: 1px solid rgba(128,128,128,0.3);
            border-radius: var(--radius-lg);
            padding: 1.25rem;
        }
        .strongs-word {
            font-size: 1.5rem;
            font-weight: 600;
        }
        .strongs-number {
            font-size: 0.9rem;
            color: var(--app-muted);
        }
        .translation-table th { font-weight: 500; }
        .interlinear-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }
        .interlinear-word {
            text-align: center;
            border: 1px solid rgba(128,128,128,0.2);
            border-radius: var(--radius-md);
            padding: 0.5rem;
            min-width: 80px;
            cursor: pointer;
            transition: border-color 0.2s;
        }
        .interlinear-word:hover { border-color: var(--app-accent); }
        .interlinear-original {
            font-size: 1.1rem;
            font-weight: 500;
        }
        .interlinear-translit {
            font-size: 0.75rem;
            color: var(--app-muted);
            font-style: italic;
        }
        .interlinear-english {
            font-size: 0.85rem;
            font-weight: 500;
        }
        .interlinear-parsing {
            font-size: 0.65rem;
            color: var(--app-muted);
        }
        .interlinear-strongs {
            font-size: 0.7rem;
            color: var(--app-accent);
        }
        .interlinear-pos {
            font-size: 0.65rem;
            color: var(--app-muted);
            font-style: italic;
        }

        /* === Original Language Text === */
        .original-text {
            font-size: 1.5rem;
            line-height: 2;
            direction: auto;
            text-align: center;
            padding: 1rem;
            border-radius: var(--radius-md);
            background: color-mix(in srgb, var(--app-accent) 5%, transparent);
            margin-bottom: 1rem;
        }
        .literal-translation {
            font-style: italic;
            padding: 0.75rem 1rem;
            border-left: 3px solid var(--app-muted);
            margin-bottom: 1rem;
            color: #adb5bd;
        }
        [data-bs-theme="light"] .literal-translation { color: #495057; }
        .translation-note {
            border-left: 3px solid #ffc107;
            padding: 0.5rem 0.75rem;
            margin-bottom: 0.5rem;
            border-radius: 0 6px 6px 0;
            background: rgba(255,193,7,0.08);
            font-size: 0.9rem;
        }
        .translation-note::before {
            content: "💡 ";
        }

        /* === Era Detail Panel === */
        .era-detail-panel {
            display: none;
            animation: slideIn 0.3s ease-out;
        }
        .era-detail-panel.visible { display: block; }
        .era-detail-card {
            border: 1px solid rgba(128,128,128,0.2);
            border-radius: var(--radius-lg);
            padding: 1.25rem;
            margin-bottom: 1rem;
        }
        .era-detail-card h6 {
            cursor: pointer;
            user-select: none;
            margin-bottom: 0;
        }
        .era-detail-card h6::before {
            content: '▸ ';
            display: inline-block;
            transition: transform 0.2s;
        }
        .era-detail-card h6.expanded::before {
            transform: rotate(90deg);
        }
        .era-detail-body {
            display: none;
            margin-top: 0.75rem;
        }
        .era-detail-body.show { display: block; }
        .era-gallery {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 1rem;
            margin-top: 0.75rem;
        }
        .era-gallery-item {
            border: 1px solid rgba(128,128,128,0.2);
            border-radius: var(--radius-md);
            overflow: hidden;
        }
        .era-gallery-item img {
            width: 100%;
            height: 180px;
            object-fit: cover;
        }
        .era-gallery-item .caption {
            padding: 0.5rem 0.75rem;
            font-size: 0.85rem;
        }
        .era-figure-card {
            border: 1px solid rgba(128,128,128,0.15);
            border-radius: var(--radius-md);
            padding: 0.75rem 1rem;
            margin-bottom: 0.5rem;
        }
        .era-figure-card h6 { margin-bottom: 0.25rem; font-size: 0.95rem; }
        .era-figure-card .badge { font-size: 0.7rem; }
        .era-location-row {
            display: flex;
            justify-content: space-between;
            padding: 0.4rem 0;
            border-bottom: 1px solid rgba(128,128,128,0.1);
            font-size: 0.9rem;
        }
        .era-location-row:last-child { border-bottom: none; }

        /* === E-Reader Controls === */
        .reader-toolbar {
            display: flex;
            align-items: center;
            gap: 1rem;
            flex-wrap: wrap;
            padding: 0.5rem 0;
        }
        .reader-control {
            display: flex;
            align-items: center;
            gap: 0.35rem;
        }
        .reader-control label {
            font-size: 0.75rem;
            color: var(--app-muted);
            white-space: nowrap;
            margin: 0;
        }
        .reader-control-btn {
            border: 1px solid rgba(128,128,128,0.3);
            background: none;
            color: inherit;
            width: 28px;
            height: 28px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: 0.85rem;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: border-color 0.2s, background 0.2s;
            padding: 0;
        }
        .reader-control-btn:hover {
            border-color: var(--app-accent);
            background: color-mix(in srgb, var(--app-accent) 8%, transparent);
        }
        .reader-control-value {
            font-size: 0.8rem;
            min-width: 28px;
            text-align: center;
            font-weight: 500;
        }
        .font-select {
            font-size: 0.8rem;
            padding: 0.15rem 0.4rem;
            border: 1px solid rgba(128,128,128,0.3);
            border-radius: var(--radius-sm);
            background: none;
            color: inherit;
            cursor: pointer;
        }
        .verse-display {
            transition: font-size 0.2s, line-height 0.2s, font-family 0.2s;
        }
        .verse-display.font-serif { font-family: Georgia, 'Times New Roman', serif; }
        .verse-display.font-sans { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
        .verse-display.font-literary { font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif; }

        /* === Shared section loading === */
        .section-loading {
            text-align: center;
            padding: 3rem;
            color: var(--app-muted);
        }
        .section-error {
            text-align: center;
            padding: 2rem;
            color: #dc3545;
        }
        /* === Home === */
        #section-home {
            position: relative;
            min-height: calc(100vh - 110px);
            min-height: calc(100dvh - 110px);
            flex-direction: column;
            justify-content: space-between;  /* buttons pinned top, VOTD pinned bottom */
            overflow: visible;
        }
        #section-home > :not(.home-hero-video) {
            position: relative;
            z-index: 1;
        }
        .home-hero-video {
            position: fixed;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center;
            z-index: 0;
            pointer-events: none;
        }
        #section-home::before {
            content: '';
            position: fixed;
            inset: 0;
            background: linear-gradient(180deg, rgba(0,0,0,0.58) 0%, rgba(0,0,0,0.16) 28%, rgba(0,0,0,0.14) 72%, rgba(0,0,0,0.45) 100%);
            z-index: 0;
            pointer-events: none;
        }
        [data-bs-theme="light"] #section-home::before {
            background: linear-gradient(180deg, rgba(255,255,255,0.68) 0%, rgba(255,255,255,0.16) 28%, rgba(255,255,255,0.14) 72%, rgba(255,255,255,0.38) 100%);
        }
        /* Keep app header + appearance popover above the full-screen Home video,
           and give the header a frosted glass bar on Home so the title, subtitle,
           hamburger, and theme toggle stay crisp over bright video frames. */
        #mainContent > .text-center.position-relative {
            z-index: 10;
        }
        #mainContent:has(#section-home.active) > .text-center.position-relative {
            background: rgba(0, 0, 0, 0.58);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid rgba(255, 255, 255, 0.18);
            border-radius: 14px;
            padding: 0.65rem 3.25rem;
            box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
        }
        #mainContent:has(#section-home.active) > .text-center.position-relative > .start-0 {
            left: 0.5rem !important;
            top: 0.5rem !important;
        }
        #mainContent:has(#section-home.active) > .text-center.position-relative > .end-0 {
            right: 0.5rem !important;
            top: 0.5rem !important;
        }
        #mainContent:has(#section-home.active) #sectionTitle {
            color: #fff;
            text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
        }
        #mainContent:has(#section-home.active) #sectionSubtitle {
            color: rgba(255, 255, 255, 0.85) !important;
            margin-bottom: 0 !important;
        }
        #mainContent:has(#section-home.active) .hamburger-btn,
        #mainContent:has(#section-home.active) .theme-toggle {
            opacity: 1;
            color: #fff;
        }
        [data-bs-theme="light"] #mainContent:has(#section-home.active) > .text-center.position-relative {
            background: rgba(255, 255, 255, 0.88);
            border-color: rgba(0, 0, 0, 0.12);
            box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
        }
        [data-bs-theme="light"] #mainContent:has(#section-home.active) #sectionTitle {
            color: #111;
            text-shadow: none;
        }
        [data-bs-theme="light"] #mainContent:has(#section-home.active) #sectionSubtitle {
            color: rgba(0, 0, 0, 0.72) !important;
        }
        [data-bs-theme="light"] #mainContent:has(#section-home.active) .hamburger-btn,
        [data-bs-theme="light"] #mainContent:has(#section-home.active) .theme-toggle {
            color: #111;
        }
        .home-buttons-overlay {
            position: relative;
            z-index: 1;
            padding: 1rem;
        }
        .home-buttons-overlay .row {
            margin-top: 25px;
        }
        .home-btn {
            width: 100%;
            padding: 0.85rem 0.5rem;
            /* Match the streak widget's panel style (.home-streak-inner) so the
               top row and the middle card read as one set. */
            border: 1px solid rgba(255,255,255,0.18);
            border-radius: 14px;
            background: rgba(0,0,0,0.55);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            color: #fff;
            text-align: center;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(0,0,0,0.35), 0 16px 40px rgba(0,0,0,0.5);
            transition: transform 0.2s ease, box-shadow 0.2s ease,
                        border-color 0.2s ease, background 0.2s ease;
        }
        .home-btn:hover {
            transform: translateY(-2px);
            border-color: rgba(255,255,255,0.35);
            background: rgba(0,0,0,0.65);
            box-shadow:
                0 12px 30px rgba(0,0,0,0.45),
                0 0 24px color-mix(in srgb, var(--app-accent) 32%, transparent);
        }
        .home-btn:active {
            transform: translateY(0);
            box-shadow: 0 6px 14px rgba(0,0,0,0.35);
        }
        [data-bs-theme="light"] .home-btn {
            background: rgba(255,255,255,0.85);
            color: #222;
            border-color: rgba(0,0,0,0.10);
        }
        [data-bs-theme="light"] .home-btn:hover {
            background: rgba(255,255,255,0.95);
            border-color: rgba(0,0,0,0.18);
        }
        [data-bs-theme="light"] .home-btn .home-btn-desc { color: rgba(0,0,0,0.55); }
        .home-btn-icon {
            display: block;
            font-size: 1.4rem;
            margin-bottom: 0.15rem;
        }
        .home-btn-label {
            display: block;
            font-weight: 600;
            font-size: 0.8rem;
            white-space: nowrap;   /* never wrap the label — shrink the font instead */
            line-height: 1.1;
        }
        .home-btn-desc {
            display: none;
            font-size: 0.7rem;
            color: rgba(255,255,255,0.6);
            margin-top: 0.15rem;
        }
        /* The fourth button. Same panel as the other three so the row reads as one
           set, but sized to its content (col-auto) instead of taking a quarter of
           the width — the three destinations stay the emphasis. Icon + label keeps
           its height identical to its neighbours, so it adds no vertical space. */
        .home-btn-more {
            width: auto;              /* .home-btn is width:100%; in a col-auto that must not apply */
            padding-left: 0.7rem;
            padding-right: 0.7rem;
        }
        .home-btn-more .home-btn-label { font-size: 0.75rem; opacity: 0.92; }

        .study-chapter-img {
            width: 100%;
            border-radius: var(--radius-lg);
            aspect-ratio: 16 / 9;
            object-fit: cover;
            margin: 0 auto 1rem;
            display: block;
            border: 2px solid var(--bs-primary);
            box-shadow: 0 4px 15px color-mix(in srgb, var(--app-accent) 30%, transparent);
        }

        /* === Reading Plans === */
        .plan-day-list { max-height: 60vh; overflow-y: auto; }
        .plan-day-row {
            display: flex; align-items: center; gap: 0.5rem;
            padding: 0.5rem 0.75rem; border-bottom: 1px solid rgba(128,128,128,0.15);
            font-size: 0.85rem;
        }
        .plan-day-row.done { opacity: 0.6; }
        .plan-day-row.today { background: color-mix(in srgb, var(--app-accent) 10%, transparent); border-radius: var(--radius-md); font-weight: 600; }
        .plan-day-num { min-width: 55px; font-weight: 500; }
        .plan-day-label { flex: 1; }
        /* Built plans say what to look for each day, under the chapters. */
        .plan-day-focus { display: block; font-weight: 400; font-size: 0.85rem; opacity: 0.75; line-height: 1.4; margin-top: 0.1rem; }
        .plan-built-tag { white-space: normal; opacity: 0.85; }
        .plan-builder { border-color: color-mix(in srgb, var(--app-accent) 45%, var(--bs-border-color)); }
        .plan-day-check { font-size: 1rem; }

        /* ===== Appearance settings dropdown ===== */
        .appearance-wrapper { position: relative; }
        .appearance-panel {
            position: absolute;
            top: 100%;
            right: 0;
            margin-top: 0.4rem;
            min-width: 280px;
            background: var(--bs-body-bg, #1a1d21);
            border: 1px solid var(--bs-border-color, rgba(255,255,255,0.15));
            border-radius: 10px;
            box-shadow: 0 8px 24px rgba(0,0,0,0.25);
            padding: 0.85rem;
            z-index: 1050;
        }
        .appearance-panel[hidden] { display: none; }
        .appearance-section { margin-bottom: 0.85rem; }
        .appearance-section:last-child { margin-bottom: 0; }
        .appearance-label {
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            opacity: 0.7;
            margin-bottom: 0.4rem;
            letter-spacing: 0.04em;
        }
        .appearance-segmented {
            display: flex;
            gap: 0;
            border: 1px solid var(--bs-border-color, rgba(255,255,255,0.15));
            border-radius: var(--radius-sm);
            overflow: hidden;
        }
        .appearance-segmented button {
            flex: 1;
            background: transparent;
            border: none;
            color: inherit;
            padding: 0.35rem 0.6rem;
            font-size: 0.85rem;
            cursor: pointer;
            transition: background 0.12s;
        }
        .appearance-segmented button:hover { background: color-mix(in srgb, var(--app-accent) 12%, transparent); }
        .appearance-segmented button.active {
            background: var(--app-accent);
            color: #fff;
        }
        .appearance-swatches {
            display: grid;
            grid-template-columns: repeat(8, 1fr);
            gap: 0.4rem;
            margin-bottom: 0.5rem;
        }
        .appearance-swatch {
            width: 26px;
            height: 26px;
            border-radius: 50%;
            border: 2px solid transparent;
            cursor: pointer;
            padding: 0;
            transition: transform 0.12s, border-color 0.12s;
        }
        .appearance-swatch:hover { transform: scale(1.1); }
        .appearance-swatch.active {
            border-color: var(--bs-body-color, #fff);
            box-shadow: 0 0 0 2px var(--app-accent);
        }
        .appearance-custom {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.85rem;
        }
        .appearance-custom input[type="color"] {
            width: 36px;
            height: 26px;
            padding: 0;
            border: 1px solid var(--bs-border-color, rgba(255,255,255,0.15));
            border-radius: var(--radius-xs);
            cursor: pointer;
            background: transparent;
        }
        .appearance-footer {
            border-top: 1px solid var(--bs-border-color, rgba(255,255,255,0.1));
            padding-top: 0.65rem;
            text-align: right;
        }
        .appearance-reset {
            background: transparent;
            border: none;
            color: inherit;
            opacity: 0.6;
            font-size: 0.8rem;
            cursor: pointer;
            text-decoration: underline;
        }
        .appearance-reset:hover { opacity: 1; }

        /* ============================================================
           Tier 1 — VOTD, Bookmarks, Highlights, Search, Audio queue
           ============================================================ */

        /* Who God Says I Am cards: the affirmation is the headline, set large and
           serif so the first-person line reads as something to say, not a title. */
        .identity-kicker {
            font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
            font-weight: 600; color: var(--bs-primary); margin-bottom: 0.5rem;
        }
        .identity-headline {
            font-family: Georgia, 'Times New Roman', serif;
            font-size: 1.5rem; line-height: 1.3; font-weight: 600; margin-bottom: 0.25rem;
        }
        /* The fear deck names the fear above the answer. */
        .identity-prompt { font-size: 1.05rem; font-style: italic; opacity: 0.85; margin-bottom: 0.15rem; }
        /* Every card picture is 16:9 and lazy-loaded. Reserving the box up front means
           the page doesn't grow under the reader as pictures arrive — otherwise a chip
           jump, a deep link or Play all lands thousands of pixels off once the images
           above the target load. */
        .identity-card .study-chapter-img { aspect-ratio: 16 / 9; object-fit: cover; }
        .identity-card-hero .identity-headline { font-size: 1.9rem; }
        .identity-verse p { line-height: 1.8; margin-bottom: 0.25rem; }
        .identity-reflection { font-size: 1.02rem; line-height: 1.6; }
        .identity-cat { color: var(--bs-primary); font-weight: 600; }
        .identity-card.identity-flash { box-shadow: 0 0 0 3px var(--app-accent); transition: box-shadow 0.4s ease; }
        .identity-actions .btn.is-playing, #identityHomePlay.is-playing { background: var(--bs-danger); border-color: var(--bs-danger); }
        /* ---------- Family Devotions: big, friendly, read from across a table ---------- */
        .family-next { border-color: color-mix(in srgb, var(--app-accent) 50%, var(--bs-border-color)); }
        .family-next-icon { font-size: 2.6rem; line-height: 1; }
        .family-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.5rem; }
        .family-story {
            display: flex; align-items: center; gap: 0.7rem; text-align: left; padding: 0.6rem 0.8rem; border-radius: 0.7rem;
            border: 1px solid var(--bs-border-color); background: var(--bs-tertiary-bg); color: var(--bs-body-color);
        }
        .family-story:hover, .family-story:focus-visible { border-color: var(--app-accent); }
        .family-story-icon { font-size: 1.5rem; width: 2rem; text-align: center; flex-shrink: 0; }
        .family-story-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
        .family-story-title { font-weight: 600; }
        .family-story-ref { font-size: 0.8rem; opacity: 0.7; }
        .family-story-tick { color: var(--bs-success); font-weight: 700; }
        .family-story.is-done .family-story-title { opacity: 0.75; }
        #familyOverlay {
            position: fixed; inset: 0; z-index: 1085; display: flex; flex-direction: column;
            background: var(--bs-body-bg); color: var(--bs-body-color);
        }
        #familyOverlay[hidden] { display: none; }
        #familyCloseBtn {
            position: absolute; top: calc(0.75rem + env(safe-area-inset-top)); right: 1rem; z-index: 2;
            background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); color: inherit;
            width: 2.4rem; height: 2.4rem; border-radius: 50%; font-size: 1.1rem; line-height: 1;
        }
        .family-dots { display: flex; gap: 0.4rem; justify-content: center; min-height: 3px; padding-top: calc(1.5rem + env(safe-area-inset-top)); }
        .family-dots span { width: 2rem; height: 4px; border-radius: 2px; background: var(--bs-border-color); }
        .family-dots span.is-on { background: var(--app-accent); }
        .family-stage { flex: 1; overflow-y: auto; width: 100%; max-width: 720px; margin: 0 auto; padding: 1.4rem 1.3rem 1rem; }
        .family-center { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
        .family-big-icon { font-size: 4rem; line-height: 1; margin-bottom: 0.6rem; }
        .family-kicker { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--bs-primary); margin-bottom: 0.5rem; }
        .family-title { font-family: Georgia, 'Times New Roman', serif; font-size: 2rem; line-height: 1.25; margin-bottom: 0.9rem; text-wrap: balance; }
        .family-lead { font-size: 1.25rem; line-height: 1.55; }
        .family-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 0.9rem; margin-bottom: 1rem; }
        .family-story-text-body p, .family-prayer p { font-size: 1.3rem; line-height: 1.7; margin-bottom: 1rem; }
        .family-prayer { font-family: Georgia, 'Times New Roman', serif; }
        .family-words p { font-size: 1.05rem; margin-bottom: 0.4rem; }
        .family-questions { padding-left: 1.4rem; }
        .family-questions li { font-size: 1.4rem; line-height: 1.5; margin-bottom: 1.1rem; padding-left: 0.3rem; }
        .family-questions li::marker { color: var(--bs-primary); font-weight: 700; }
        .family-verse {
            font-family: Georgia, 'Times New Roman', serif; font-size: 1.6rem; line-height: 1.55; margin: 0.5rem 0 1.2rem;
            padding: 1rem 1.2rem; border-left: 4px solid var(--app-accent); background: var(--bs-tertiary-bg); border-radius: 0 0.7rem 0.7rem 0;
        }
        .family-verse footer { font-family: var(--bs-body-font-family); font-size: 0.9rem; opacity: 0.75; margin-top: 0.6rem; }
        .family-fyi { margin-top: 0.8rem; padding: 0.6rem 0.8rem; border-radius: 0.6rem; background: var(--bs-tertiary-bg); font-size: 0.95rem; }
        .family-fyi summary { cursor: pointer; font-weight: 600; }
        .family-fyi p { margin: 0.5rem 0 0; }
        .family-nav {
            display: flex; justify-content: space-between; gap: 0.75rem; width: 100%; max-width: 720px; margin: 0 auto;
            padding: 0.7rem 1.3rem calc(1.1rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--bs-border-color);
        }
        .family-nav[hidden] { display: none; }
        @media (max-width: 480px) {
            .family-title { font-size: 1.6rem; }
            .family-story-text-body p, .family-prayer p { font-size: 1.15rem; }
            .family-questions li { font-size: 1.2rem; }
            .family-verse { font-size: 1.3rem; }
        }

        /* ---------- Study Paths ---------- */
        .path-card { cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease; }
        .path-card:hover, .path-card:focus-visible { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.22); }
        .path-card-icon { font-size: 2rem; line-height: 1; margin-bottom: 0.5rem; }
        .path-steps { position: relative; }
        .path-step { border: 1px solid var(--bs-border-color); border-radius: 0.7rem; margin-bottom: 0.5rem; background: var(--bs-body-bg); }
        .path-step.is-open { border-color: color-mix(in srgb, var(--app-accent) 55%, var(--bs-border-color)); }
        .path-step-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.9rem; cursor: pointer; border-radius: 0.7rem; }
        .path-step-head:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 2px; }
        .path-step-n {
            flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 50%; display: flex; align-items: center; justify-content: center;
            font-weight: 600; font-size: 0.9rem; background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color);
        }
        .path-step.is-done .path-step-n { background: var(--bs-success); border-color: var(--bs-success); color: #fff; }
        .path-step.is-open:not(.is-done) .path-step-n { background: var(--bs-primary); border-color: var(--bs-primary); color: #fff; }
        .path-step-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
        .path-step-name { font-weight: 600; }
        .path-step.is-done:not(.is-open) .path-step-name { opacity: 0.7; }
        .path-step-ref { font-size: 0.82rem; opacity: 0.7; }
        .path-step-chev { opacity: 0.6; transition: transform 0.2s ease; }
        .path-step:not(.is-open) .path-step-chev { transform: rotate(-90deg); }
        .path-step-body { padding: 0 0.9rem 0.9rem 3.65rem; }
        .path-why { line-height: 1.6; margin-bottom: 0.8rem; }
        .path-stops { display: grid; gap: 0.4rem; }
        .path-stop {
            display: flex; align-items: center; gap: 0.7rem; width: 100%; text-align: left; padding: 0.55rem 0.75rem;
            border-radius: 0.6rem; border: 1px solid var(--bs-border-color); background: var(--bs-tertiary-bg); color: var(--bs-body-color);
        }
        .path-stop:hover, .path-stop:focus-visible { border-color: var(--app-accent); }
        .path-stop:disabled { opacity: 0.6; }
        .path-stop-icon { font-size: 1.15rem; width: 1.6rem; text-align: center; flex-shrink: 0; }
        .path-stop-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
        .path-stop-label { font-weight: 600; }
        .path-stop-sub { font-size: 0.8rem; opacity: 0.7; }
        .path-stop-tick { opacity: 0.55; font-size: 1.1rem; }
        .path-stop.is-visited .path-stop-tick { color: var(--bs-success); opacity: 1; font-weight: 700; }
        .path-reflect { margin-top: 0.8rem; padding: 0.6rem 0.8rem; border-left: 3px solid var(--app-accent); font-family: Georgia, 'Times New Roman', serif; line-height: 1.55; }
        .path-reflect-kicker { display: block; font-family: var(--bs-body-font-family); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.7; margin-bottom: 0.2rem; }
        @media (max-width: 480px) { .path-step-body { padding-left: 0.9rem; } }
        @media (prefers-reduced-motion: reduce) { .path-card, .path-step-chev { transition: none; } }

        /* Praying Scripture: the study that opens under a card. */
        .prayer-study-inner { border-left: 3px solid var(--app-accent); padding-left: 0.9rem; }
        .prayer-study-inner h6 { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bs-primary); margin: 0.9rem 0 0.3rem; }
        .prayer-study-inner h6:first-child { margin-top: 0; }
        .prayer-study-inner p, .prayer-study-inner li { line-height: 1.6; }
        .prayer-study-inner ul { padding-left: 1.1rem; margin-bottom: 0.5rem; }
        .prayer-phrase { font-family: Georgia, 'Times New Roman', serif; font-style: italic; }
        .prayer-word { font-size: 1.5rem; line-height: 1.2; margin-right: 0.3rem; }
        .prayer-caution { background: var(--bs-tertiary-bg); border-radius: 0.5rem; padding: 0.55rem 0.75rem; }
        /* Advent: the twenty-five doors. The grid is the calendar; a door further
           down the page that has not opened yet shows its day and nothing else. */
        .advent-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem; max-width: 26rem; }
        .advent-day {
            position: relative; aspect-ratio: 1 / 1; border-radius: 0.6rem; border: 1px solid var(--bs-border-color);
            background: var(--bs-tertiary-bg); color: var(--bs-body-color);
            font-family: Georgia, 'Times New Roman', serif; font-size: 1.15rem; font-weight: 600;
            display: flex; align-items: center; justify-content: center;
            transition: transform 0.15s ease, box-shadow 0.15s ease;
        }
        .advent-day:not(.is-locked):hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.18); }
        .advent-day.is-locked { opacity: 0.45; }
        .advent-day.is-today { background: var(--bs-primary); border-color: var(--bs-primary); color: #fff; box-shadow: 0 0 0 3px var(--app-accent); }
        .advent-day-lock { position: absolute; right: 0.2rem; bottom: 0.1rem; font-size: 0.6rem; }
        .advent-door { cursor: pointer; border-style: dashed; background: var(--bs-tertiary-bg); }
        .advent-door .card-body { display: flex; align-items: center; gap: 1rem; padding: 0.9rem 1.1rem; }
        .advent-door-n { font-family: Georgia, 'Times New Roman', serif; font-size: 2rem; font-weight: 600; line-height: 1; min-width: 2.4rem; text-align: center; opacity: 0.55; }
        .advent-door-label { font-size: 0.9rem; opacity: 0.7; }
        .advent-countdown {
            display: flex; align-items: center; gap: 0.9rem; padding: 0.8rem 1rem; border-radius: 0.6rem;
            border: 1px solid var(--bs-border-color); background: var(--bs-tertiary-bg);
        }
        .advent-countdown-n { font-family: Georgia, 'Times New Roman', serif; font-size: 2.2rem; font-weight: 600; line-height: 1; color: var(--bs-primary); }
        @media (prefers-reduced-motion: reduce) { .advent-day { transition: none; } }
        @media (max-width: 480px) {
            .identity-headline { font-size: 1.3rem; }
            .identity-card-hero .identity-headline { font-size: 1.55rem; }
        }

        /* Verse of the Day card on Home */
        .votd-card {
            margin: 1rem auto 10px auto;   /* pinned to the bottom of the home card w/ 10px gap */
            max-width: 760px;
            border-radius: 14px;
            padding: 1px;
            background: linear-gradient(135deg, var(--app-accent), var(--app-accent-hover));
            /* Two-layer drop shadow gives the card real depth against the hero video. */
            box-shadow:
                0 4px 12px rgba(0,0,0,0.35),
                0 16px 40px rgba(0,0,0,0.5);
            position: relative;
            z-index: 2;
        }
        .votd-card-inner {
            background: rgba(0,0,0,0.55);
            color: #fff;
            border-radius: 13px;
            padding: 0.85rem 1.1rem;
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
        }
        [data-bs-theme="light"] .votd-card-inner { background: rgba(255,255,255,0.85); color: #222; }
        .votd-eyebrow {
            font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
            opacity: 0.85; margin-bottom: 0.3rem; font-weight: 600;
        }
        .votd-text {
            font-family: Georgia, 'Times New Roman', serif;
            font-size: 0.95rem; line-height: 1.5; margin-bottom: 0.35rem;
            transition: opacity 0.25s ease;
        }
        .votd-ref { font-weight: 600; opacity: 0.9; margin-bottom: 0.6rem; font-size: 0.85rem; transition: opacity 0.25s ease; }
        /* The When I Am Afraid card names the fear first, as it does in its deck. */
        .votd-prompt { font-style: italic; opacity: 0.85; font-size: 0.85rem; margin-bottom: 0.1rem; }
        /* The deck carousel on Home: the whole inner face fades between decks; the
           dots are the only chrome. */
        #identityHomeInner.is-turning .votd-eyebrow, #identityHomeInner.is-turning .votd-prompt,
        #identityHomeInner.is-turning .votd-text, #identityHomeInner.is-turning .votd-ref { opacity: 0; }
        .votd-eyebrow, .votd-prompt { transition: opacity 0.25s ease; }
        .votd-dots { display: flex; gap: 0.45rem; justify-content: center; margin-top: 0.6rem; }
        .votd-dots button {
            width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0;
            background: rgba(255,255,255,0.4); cursor: pointer;
        }
        .votd-dots button.active { background: #fff; }
        .votd-dots button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
        @media (prefers-reduced-motion: reduce) {
            #identityHomeInner.is-turning .votd-eyebrow, #identityHomeInner.is-turning .votd-prompt,
            #identityHomeInner.is-turning .votd-text, #identityHomeInner.is-turning .votd-ref { opacity: 1; }
        }
        .votd-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
        .votd-actions .btn { font-size: 0.8rem; padding: 0.3rem 0.7rem; flex: 0 1 auto; min-width: 0; }
        /* Mobile: tighter spacing, smaller verse text, full-width buttons that always fit */
        @media (max-width: 480px) {
            .votd-card { margin: 0.6rem auto 10px auto; }
            .votd-card-inner { padding: 0.7rem 0.85rem; }
            .votd-text { font-size: 0.85rem; line-height: 1.45; }
            .votd-ref { font-size: 0.78rem; }
            .votd-eyebrow { font-size: 0.65rem; }
            .votd-actions .btn { flex: 1 1 0; font-size: 0.78rem; padding: 0.35rem 0.4rem; }
        }

        /* Skeleton loading state — shown immediately so the home view doesn't
           wait on the VOTD fetch. JS swaps real content in once it arrives. */
        .votd-skeleton-line {
            display: block; height: 1.2rem; margin: 0.35rem 0;
            border-radius: var(--radius-xs);
            background: linear-gradient(90deg,
                rgba(255,255,255,0.08) 0%,
                rgba(255,255,255,0.18) 50%,
                rgba(255,255,255,0.08) 100%);
            background-size: 200% 100%;
            animation: votd-shimmer 1.4s ease-in-out infinite;
        }
        [data-bs-theme="light"] .votd-skeleton-line {
            background: linear-gradient(90deg,
                rgba(0,0,0,0.06) 0%,
                rgba(0,0,0,0.12) 50%,
                rgba(0,0,0,0.06) 100%);
            background-size: 200% 100%;
        }
        .votd-skeleton-line-short { width: 70%; }
        .votd-skeleton-line-ref { width: 35%; height: 0.95rem; }
        @keyframes votd-shimmer {
            0%   { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }
        .votd-card.votd-loading .votd-actions .btn { opacity: 0.55; pointer-events: none; }

        /* Star bookmark icon (used inline next to chapter titles, verses, character names, etc.) */
        .bookmark-star {
            display: inline-block; cursor: pointer; user-select: none;
            font-size: 1.05em; vertical-align: middle; opacity: 0.55;
            transition: opacity 0.15s, transform 0.15s;
            margin-left: 0.35rem;
        }
        .bookmark-star:hover { opacity: 1; transform: scale(1.15); }
        .bookmark-star.is-bookmarked { opacity: 1; color: #ffc107; }
        .bookmark-star.is-bookmarked:hover { color: #ffca2c; }

        /* Reader verse wrapper — needed for highlights + bookmarks per verse */
        .reader-verse {
            display: inline; /* keep flowing text */
            border-radius: var(--radius-xs);
            padding: 0 2px;
            transition: background-color 0.18s;
        }
        .reader-verse.hl-yellow { background-color: rgba(255, 235, 59, 0.32); }
        .reader-verse.hl-green  { background-color: rgba(76, 175, 80, 0.28); }
        .reader-verse.hl-blue   { background-color: rgba(33, 150, 243, 0.28); }
        .reader-verse.hl-pink   { background-color: rgba(233, 30, 99, 0.28); }
        [data-bs-theme="light"] .reader-verse.hl-yellow { background-color: rgba(255, 230, 0, 0.45); }
        [data-bs-theme="light"] .reader-verse.hl-green  { background-color: rgba(102, 220, 105, 0.45); }
        [data-bs-theme="light"] .reader-verse.hl-blue   { background-color: rgba(120, 190, 255, 0.45); }
        [data-bs-theme="light"] .reader-verse.hl-pink   { background-color: rgba(255, 120, 170, 0.45); }
        .reader-verse .bookmark-star { font-size: 0.85em; }

        /* Verse actions popover (highlight palette + bookmark) */
        .verse-popover {
            position: absolute; z-index: 1500;
            background: var(--bs-body-bg, #212529); color: var(--bs-body-color, #fff);
            border: 1px solid rgba(128,128,128,0.3);
            border-radius: var(--radius-md); padding: 0.4rem 0.5rem;
            box-shadow: 0 8px 24px rgba(0,0,0,0.4);
            display: flex; gap: 0.35rem; align-items: center;
        }
        .verse-popover-swatch {
            width: 22px; height: 22px; border-radius: 50%;
            border: 2px solid rgba(255,255,255,0.2); cursor: pointer;
            transition: transform 0.12s;
        }
        .verse-popover-swatch:hover { transform: scale(1.18); }
        .verse-popover-swatch.sw-yellow { background: #ffe60a; }
        .verse-popover-swatch.sw-green  { background: #4caf50; }
        .verse-popover-swatch.sw-blue   { background: #2196f3; }
        .verse-popover-swatch.sw-pink   { background: #e91e63; }
        .verse-popover-swatch.sw-clear  { background: transparent; border: 2px dashed #aaa; }
        .verse-popover-divider {
            width: 1px; height: 22px; background: rgba(128,128,128,0.3); margin: 0 0.2rem;
        }
        .verse-popover-btn {
            background: transparent; border: 0; color: inherit; cursor: pointer;
            padding: 0.15rem 0.35rem; border-radius: var(--radius-xs); font-size: 1rem;
        }
        .verse-popover-btn:hover { background: rgba(128,128,128,0.2); }

        /* Verse image range picker */
        .vi-range-row {
            display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem;
        }
        .vi-range-label { width: 3.2rem; opacity: 0.8; }
        .vi-range-value {
            min-width: 2.75rem; text-align: center; font-weight: 600; font-size: 1.05rem;
            padding: 0.1rem 0.4rem; border-radius: var(--radius-sm);
            background: var(--app-accent-soft);
        }
        .vi-step { min-width: 2.4rem; font-size: 1.1rem; line-height: 1; }
        .vi-preview-wrap {
            display: flex; justify-content: center; margin: 0.75rem 0 0.4rem;
            min-height: 120px;
        }
        /* Square card, never wider than the dialog and never taller than the viewport. */
        .vi-preview {
            width: min(280px, 60vh); max-width: 100%; aspect-ratio: 1 / 1;
            border-radius: var(--radius-md); box-shadow: 0 6px 18px rgba(0,0,0,0.35);
            background: rgba(128,128,128,0.15);
        }

        /* Audio queue panel under the reader audio buttons */
        .audio-queue-panel {
            margin-top: 0.5rem; padding: 0.4rem 0.6rem;
            background: rgba(128,128,128,0.12); border-radius: var(--radius-sm);
            font-size: 0.85rem; display: flex; align-items: center; gap: 0.5rem;
        }
        .audio-queue-label { font-weight: 600; opacity: 0.8; }
        .audio-queue-item {
            display: inline-block; padding: 0.1rem 0.5rem; margin: 0 0.25rem;
            border-radius: var(--radius-pill); background: var(--app-accent-soft); font-size: 0.8rem;
        }
        .audio-queue-clear {
            margin-left: auto; background: transparent; border: 0; color: inherit;
            opacity: 0.7; cursor: pointer; font-size: 1rem;
        }
        .audio-queue-clear:hover { opacity: 1; color: #ff6b6b; }

        /* Devotional of the Day */
        .devotional-today { padding: 0.5rem 0.25rem; }
        .devotional-date { font-size: 0.8rem; opacity: 0.7; margin-bottom: 0.25rem; text-transform: uppercase; letter-spacing: 0.04em; }
        .devotional-title { color: var(--app-accent); margin-bottom: 0.35rem; }
        .devotional-theme { display: inline-block; font-size: 0.78rem; padding: 0.15rem 0.55rem;
            background: var(--app-accent-soft); color: var(--app-accent); border-radius: var(--radius-pill); margin-bottom: 0.6rem; }
        .devotional-scripture {
            border-left: 3px solid var(--app-accent);
            padding: 0.35rem 0.7rem; margin: 0.4rem 0 0.8rem 0;
            font-style: italic; font-size: 0.95rem;
        }
        .devotional-content {
            white-space: pre-line; line-height: 1.7; font-size: 1.0rem;
        }
        .devotional-loading .devotional-title,
        .devotional-loading .devotional-scripture,
        .devotional-loading .devotional-content {
            min-height: 1.5rem;
        }
        .devotional-archive-row {
            display: flex; justify-content: space-between; align-items: center;
            padding: 0.5rem 0.4rem; border-bottom: 1px solid rgba(128,128,128,0.18);
            cursor: pointer; transition: background 0.12s;
        }
        .devotional-archive-row:hover { background: var(--app-accent-soft); }
        .devotional-archive-row:last-child { border-bottom: none; }
        .devotional-archive-meta { flex: 1 1 auto; min-width: 0; }
        .devotional-archive-title { font-weight: 600; }
        .devotional-archive-date { font-size: 0.78rem; opacity: 0.7; }

        /* Genealogy tree */
        .genealogy-tree-container {
            position: relative; overflow: auto;
            min-height: 60vh; max-height: 80vh;
            background: rgba(128,128,128,0.04);
            border-radius: var(--radius-sm);
            padding: 1rem;
        }
        .genealogy-tree-container svg { display: block; }
        .genealogy-node-rect {
            fill: #444; stroke: var(--app-accent); stroke-width: 1.5;
            cursor: pointer; transition: fill 0.12s;
        }
        .genealogy-node:hover .genealogy-node-rect { fill: var(--app-accent-soft); }
        .genealogy-node-text {
            fill: #fff; font-size: 13px; pointer-events: none; user-select: none;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
        }
        /* AI-suggested nodes: dashed stroke + slightly muted fill so they're visually
           distinct from curated seed data. Hover treatment still applies. */
        .genealogy-node-ai .genealogy-node-rect {
            stroke-dasharray: 4 3; fill: #5a5560;
        }
        .genealogy-edge { stroke: var(--app-accent); stroke-width: 1.2; fill: none; opacity: 0.65; }

        /* Per-leaf "+ AI" expand affordance */
        .genealogy-ai-btn { cursor: pointer; }
        .genealogy-ai-btn-rect {
            fill: var(--app-accent); stroke: none; opacity: 0.85;
            transition: opacity 0.12s;
        }
        .genealogy-ai-btn:hover .genealogy-ai-btn-rect { opacity: 1.0; }
        .genealogy-ai-btn-text {
            fill: #fff; font-size: 11px; font-weight: 600;
            pointer-events: none; user-select: none;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
        }
        .genealogy-ai-btn-loading .genealogy-ai-btn-rect { opacity: 0.5; }

        /* Sermon regenerate inline panel */
        .sermon-regenerate-panel {
            background: rgba(128,128,128,0.06);
            border: 1px solid rgba(128,128,128,0.22);
            border-radius: var(--radius-sm);
            padding: 0.75rem;
        }
        /* Sermon share-link inline panel */
        .sermon-share-panel {
            background: rgba(128,128,128,0.06);
            border: 1px solid rgba(128,128,128,0.22);
            border-radius: var(--radius-sm);
            padding: 0.75rem;
        }
        /* Read-only shared sermon view — leans on Bootstrap alert + card; subtle accent */
        .sermon-shared-view { border-left: 4px solid var(--app-accent); }

        /* Sermon result card */
        .sermon-result-card {
            padding: 1rem 1.1rem;
        }
        .sermon-result-title { color: var(--app-accent); margin-bottom: 0.25rem; }
        .sermon-section-heading { color: var(--app-accent); margin-top: 1rem; margin-bottom: 0.4rem; }
        .sermon-illustration {
            border-left: 3px solid var(--app-accent); padding: 0.4rem 0.7rem;
            background: rgba(128,128,128,0.05); margin: 0.4rem 0; font-style: italic;
        }
        .sermon-reading-chip {
            display: inline-flex; align-items: center; gap: 0.35rem;
            padding: 0.25rem 0.6rem; border-radius: var(--radius-pill);
            background: var(--app-accent-soft); color: var(--app-accent);
            font-size: 0.85rem;
        }
        .sermon-reading-chip button {
            background: none; border: none; color: inherit;
            padding: 0; opacity: 0.7; cursor: pointer; font-size: 1rem; line-height: 1;
        }
        .sermon-my-row {
            display: flex; justify-content: space-between; align-items: center;
            padding: 0.5rem 0.4rem; gap: 0.5rem;
            border-bottom: 1px solid rgba(128,128,128,0.18);
        }
        .sermon-my-row:last-child { border-bottom: none; }
        .sermon-my-meta { flex: 1 1 auto; min-width: 0; }
        .sermon-my-title { font-weight: 600; color: var(--app-accent); }
        .sermon-my-sub { font-size: 0.78rem; opacity: 0.75; }

        /* Church Fathers commentary cards */
        .cf-summary { font-size: 0.95rem; opacity: 0.9; border-left: 3px solid var(--app-accent); padding-left: 0.6rem; }
        .cf-card {
            padding: 0.75rem; border-radius: var(--radius-sm);
            background: rgba(128,128,128,0.06);
            border: 1px solid rgba(128,128,128,0.18);
        }
        .cf-head { margin-bottom: 0.35rem; }
        .cf-name { font-size: 1.0rem; }
        .cf-era { font-size: 0.8rem; margin-left: 0.35rem; }
        .badge.cf-tradition {
            background: var(--app-accent-soft); color: var(--app-accent);
            font-weight: 500; margin-left: 0.4rem;
        }
        .cf-quote {
            border-left: 3px solid var(--app-accent); margin: 0.4rem 0;
            padding: 0.25rem 0.6rem; font-style: italic; opacity: 0.95;
        }
        .cf-quote footer.cf-ref { font-size: 0.78rem; margin-top: 0.25rem; font-style: normal; opacity: 0.75; }
        .cf-ref { margin-bottom: 0.2rem; }
        .cf-comment { font-size: 0.93rem; }

        /* Saved Prayers list */
        .saved-prayers-summary { cursor: pointer; user-select: none; padding: 0.25rem 0; }
        .saved-prayer-row {
            display: flex; align-items: center; gap: 0.75rem;
            padding: 0.55rem 0.5rem; border-bottom: 1px solid rgba(128,128,128,0.18);
        }
        .saved-prayer-row:last-child { border-bottom: none; }
        .saved-prayer-meta { flex: 1 1 auto; min-width: 0; }
        .saved-prayer-title { font-weight: 600; color: var(--app-accent); font-size: 0.95rem; }
        .saved-prayer-intent { font-size: 0.85rem; opacity: 0.85; margin: 0.1rem 0; }
        .saved-prayer-date { font-size: 0.75rem; }
        .saved-prayer-actions { display: flex; gap: 0.35rem; flex: 0 0 auto; }

        /* Search (concordance) results */
        .concordance-result {
            padding: 0.6rem 0.75rem; border-bottom: 1px solid rgba(128,128,128,0.18);
            cursor: pointer; transition: background 0.12s;
        }
        .concordance-result:hover { background: var(--app-accent-soft); }
        .concordance-result-ref {
            font-weight: 600; color: var(--app-accent); font-size: 0.95rem;
            margin-bottom: 0.15rem;
        }
        .concordance-result-text { font-family: Georgia, 'Times New Roman', serif; font-size: 0.95rem; line-height: 1.5; }
        .concordance-result-text mark {
            background: var(--app-accent); color: #fff; padding: 0 2px; border-radius: 2px;
        }
        .concordance-summary {
            padding: 0.5rem 0.75rem; font-size: 0.85rem; opacity: 0.8;
            border-bottom: 1px solid rgba(128,128,128,0.2);
        }

        /* Feature 2 — Interactive Map Atlas */
        .atlas-map-container {
            height: 70vh;
            min-height: 500px;
            border-radius: var(--radius-lg);
            overflow: hidden;
            border: 1px solid rgba(128,128,128,0.25);
        }
        @media (max-width: 991px) {
            .atlas-map-container { height: 50vh; min-height: 350px; }
        }
        /* Leaflet pin colors keyed to era. Implemented via SVG-data-URI markers so
           we don't need external image files. */
        .atlas-pin {
            background: var(--app-accent);
            width: 18px; height: 18px;
            border-radius: 50% 50% 50% 0;
            border: 2px solid #fff;
            transform: rotate(-45deg);
            box-shadow: 0 2px 4px rgba(0,0,0,0.3);
        }
        .atlas-pin.era-ot   { background: #d97706; }   /* amber-600 — Old Testament */
        .atlas-pin.era-nt   { background: #2563eb; }   /* blue-600 — New Testament */
        .atlas-pin.era-both { background: #059669; }   /* emerald-600 — both */
        .atlas-place-ref-list { max-height: 50vh; overflow-y: auto; }
        .atlas-place-ref { padding: 0.35rem 0; border-bottom: 1px solid rgba(128,128,128,0.15); }
        .atlas-place-ref:last-child { border-bottom: none; }
        .atlas-place-ref a { text-decoration: none; }
        .atlas-place-ref a:hover { text-decoration: underline; }

        /* Feature 1 — Topical Concordance Builder */
        .topic-card-main:hover { opacity: 0.85; }
        .topic-verse-row:last-child { border-bottom: none !important; padding-bottom: 0 !important; margin-bottom: 0 !important; }
        .topic-verse-nav { text-decoration: none; }
        .topic-verse-nav:hover { text-decoration: underline; }
        .add-to-topic-menu {
            position: absolute;
            z-index: 9000;
            min-width: 240px;
            max-width: 320px;
            background: var(--bs-body-bg);
            border: 1px solid rgba(128,128,128,0.25);
            border-radius: 10px;
            box-shadow: 0 8px 30px rgba(0,0,0,0.18);
            padding: 0.4rem;
            max-height: 60vh;
            overflow-y: auto;
        }
        .add-to-topic-header {
            font-size: 0.8rem;
            font-weight: 600;
            color: var(--app-muted, #94a3b8);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            padding: 0.25rem 0.5rem 0.4rem;
        }
        .add-to-topic-item {
            display: block;
            width: 100%;
            text-align: left;
            padding: 0.45rem 0.6rem;
            border: none;
            background: transparent;
            border-radius: var(--radius-sm);
            font-size: 0.92rem;
            color: inherit;
            cursor: pointer;
        }
        .add-to-topic-item:hover {
            background: color-mix(in srgb, var(--app-accent) 12%, transparent);
        }
        .add-to-topic-empty {
            padding: 0.5rem 0.6rem;
            font-size: 0.85rem;
            color: var(--app-muted, #94a3b8);
            font-style: italic;
        }
        .add-to-topic-new {
            color: var(--app-accent);
        }
        .topic-save-btn {
            flex-shrink: 0;
            min-width: 2.25rem;
        }

        /* Bookmarks full-page view */
        .bookmarks-filter-chips {
            display: flex; flex-wrap: wrap; gap: 0.4rem;
        }
        .bookmark-chip {
            padding: 0.3rem 0.75rem; border-radius: var(--radius-pill);
            border: 1px solid rgba(128,128,128,0.3);
            background: transparent; color: inherit;
            font-size: 0.85rem; cursor: pointer;
            transition: background 0.12s, color 0.12s, border-color 0.12s;
        }
        .bookmark-chip:hover {
            border-color: var(--app-accent);
            color: var(--app-accent);
        }
        .bookmark-chip.active {
            background: var(--app-accent);
            border-color: var(--app-accent);
            color: #fff;
        }
        .bookmark-chip .chip-count {
            opacity: 0.7; margin-left: 0.3rem; font-size: 0.78rem;
        }
        .bookmark-chip.active .chip-count { opacity: 0.9; }

        .bookmark-row {
            display: flex; align-items: center; gap: 0.75rem;
            padding: 0.75rem 1rem;
            border-bottom: 1px solid rgba(128,128,128,0.18);
            cursor: pointer;
            transition: background 0.12s;
        }
        .bookmark-row:hover { background: var(--app-accent-soft); }
        .bookmark-row:last-child { border-bottom: none; }
        .bookmark-row-icon {
            font-size: 1.4rem; flex-shrink: 0; width: 2rem; text-align: center;
        }
        .bookmark-row-main {
            flex: 1; min-width: 0;
        }
        .bookmark-row-label {
            font-weight: 600; font-size: 0.98rem;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .bookmark-row-meta {
            font-size: 0.78rem; opacity: 0.65; margin-top: 0.1rem;
        }
        .bookmark-row-type {
            font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
            opacity: 0.7; margin-right: 0.5rem;
        }
        .bookmark-row-remove {
            background: transparent; border: 0; color: inherit;
            opacity: 0.4; cursor: pointer; padding: 0.25rem 0.5rem;
            font-size: 1.1rem; border-radius: var(--radius-xs);
            transition: opacity 0.12s, color 0.12s, background 0.12s;
        }
        .bookmark-row-remove:hover {
            opacity: 1; color: #ff6b6b; background: rgba(255,107,107,0.1);
        }
        .bookmarks-empty-state {
            padding: 3rem 1rem; text-align: center; opacity: 0.7;
        }
        .bookmarks-empty-state-icon { font-size: 3rem; margin-bottom: 0.5rem; opacity: 0.5; }
        .bookmarks-empty-state-hint {
            font-size: 0.85rem; opacity: 0.75; margin-top: 0.5rem;
        }
        .bookmarks-group-header {
            padding: 0.6rem 1rem 0.4rem;
            font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase;
            opacity: 0.7; font-weight: 600;
            background: rgba(128,128,128,0.05);
            border-bottom: 1px solid rgba(128,128,128,0.15);
        }

        /* ===== Summer Pack 1: streak widget, autoplay, offline badge, journeys ===== */

        /* Home reading-streak + Continue widget — must sit above the hero video
           (which is position:absolute z-index:0), same as the VOTD card. */
        .home-streak-widget {
            max-width: 640px; margin: 0.5rem auto 0.85rem;
            position: relative; z-index: 2;
        }
        .home-streak-inner {
            background: rgba(0,0,0,0.55); color: #fff;
            border: 1px solid rgba(255,255,255,0.18);
            border-radius: 14px; padding: 0.85rem 1rem;
            display: flex; flex-direction: column; gap: 0.6rem;
            backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.35), 0 16px 40px rgba(0,0,0,0.5);
        }
        [data-bs-theme="light"] .home-streak-inner {
            background: rgba(255,255,255,0.85); color: #222;
            border-color: rgba(0,0,0,0.10);
        }
        .home-streak-main { display: flex; align-items: center; gap: 0.75rem; }
        .home-streak-flame { font-size: 1.9rem; line-height: 1; flex: 0 0 auto; }
        .home-streak-copy { flex: 1 1 auto; min-width: 0; }
        .home-streak-headline { font-weight: 700; font-size: 1.02rem; }
        .home-streak-sub { font-size: 0.82rem; opacity: 0.75; }
        .home-streak-stats { display: flex; gap: 0.9rem; flex: 0 0 auto; }
        .home-streak-stats > div { text-align: center; line-height: 1.1; }
        .home-streak-stats strong { display: block; font-size: 1.15rem; color: var(--app-accent); }
        .home-streak-stats span { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.65; }
        .home-streak-continue {
            width: 100%; border: none; border-radius: 10px; cursor: pointer;
            background: var(--app-accent); color: #fff; font-weight: 600;
            padding: 0.55rem 0.8rem; font-size: 0.92rem; transition: filter 0.15s;
        }
        .home-streak-continue span { opacity: 0.85; font-weight: 500; }
        .home-streak-continue:hover { filter: brightness(1.08); }
        .home-streak-plan {
            display: flex; align-items: center; gap: 0.6rem; width: 100%;
            background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.22);
            border-radius: 10px; padding: 0.5rem 0.7rem; cursor: pointer; text-align: left;
            color: inherit; transition: border-color 0.15s, background 0.15s;
        }
        .home-streak-plan:hover { border-color: var(--app-accent); background: rgba(255,255,255,0.18); }
        [data-bs-theme="light"] .home-streak-plan {
            background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.12);
        }
        [data-bs-theme="light"] .home-streak-plan:hover { background: rgba(0,0,0,0.09); }
        .hs-plan-icon { font-size: 1.3rem; flex: 0 0 auto; }
        .hs-plan-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
        .hs-plan-text strong { font-size: 0.9rem; }
        .hs-plan-text span { font-size: 0.78rem; opacity: 0.72; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .hs-plan-go { flex: 0 0 auto; font-size: 0.82rem; font-weight: 600; color: var(--app-accent); }
        @media (max-width: 560px) {
            /* Smaller top buttons pulled closer to the top, to free vertical room
               in the fixed-aspect-ratio home card. Narrower gutters + padding give
               the (non-wrapping) labels room so the font can stay readable. */
            .home-buttons-overlay { padding: 0.6rem 0.5rem; }
            .home-buttons-overlay .row { margin-top: 6px; --bs-gutter-x: 0.5rem; }
            .home-btn { padding: 0.5rem 0.15rem; border-radius: var(--radius-lg); }
            .home-btn-icon { font-size: 1.1rem; margin-bottom: 0.1rem; }
            .home-btn-label { font-size: 0.68rem; }
            .home-btn-more { padding-left: 0.4rem; padding-right: 0.4rem; }
            .home-btn-more .home-btn-label { font-size: 0.62rem; }

            /* Trim the streak widget to ~half size on phones: keep only the streak
               line + Continue button. Stats, helper text, and the plan nudge are
               hidden here (all remain on larger screens). */
            .home-streak-widget { margin: 0.35rem auto 0.4rem; max-width: 460px; }
            .home-streak-inner { padding: 0.45rem 0.6rem; gap: 0.4rem; border-radius: var(--radius-lg); }
            .home-streak-main { gap: 0.5rem; align-items: center; }
            .home-streak-flame { font-size: 1.3rem; }
            .home-streak-headline { font-size: 0.86rem; }
            .home-streak-sub { display: none; }
            .home-streak-stats { display: none; }
            .home-streak-plan { display: none; }
            .home-streak-continue { padding: 0.38rem 0.6rem; font-size: 0.8rem; }
        }

        /* Very narrow phones: shrink the (non-wrapping) home button labels further. */
        @media (max-width: 380px) {
            .home-btn { padding: 0.45rem 0.1rem; }
            .home-btn-icon { font-size: 1rem; }
            .home-btn-label { font-size: 0.6rem; }
            .home-btn-more { padding-left: 0.3rem; padding-right: 0.3rem; }
            .home-btn-more .home-btn-label { font-size: 0.55rem; }
        }

        /* Continuous-play (autoplay) toggle — lit state (Reader + Bible Study) */
        .audio-autoplay-btn.autoplay-on {
            background: var(--app-accent); color: #fff; border-color: var(--app-accent);
        }

        /* "Back to …" bar: bottom-left, above the audio toolbar when that is showing. */
        .return-bar {
            position: fixed; left: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
            z-index: 1049; transition: bottom 0.25s ease;
        }
        .return-bar .btn { border-radius: var(--radius-pill); box-shadow: 0 4px 14px rgba(0,0,0,0.35); }
        .audio-toolbar.visible ~ .return-bar { bottom: calc(4.6rem + env(safe-area-inset-bottom, 0px)); }
        /* QR modal: the SVG scales to the dialog, never wider than a phone screen. */
        .qr-code svg { width: min(72vw, 320px); height: auto; background: #fff; padding: 12px; border-radius: 12px; }

        /* Offline badge */
        .offline-badge {
            position: fixed; top: calc(0.5rem + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
            z-index: 1080; background: #b45309; color: #fff;
            padding: 0.3rem 0.8rem; border-radius: 50px; font-size: 0.8rem; font-weight: 600;
            box-shadow: 0 2px 10px rgba(0,0,0,0.3);
        }

        /* Journey pills + map markers + step list */
        .journey-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; }
        .journey-pill {
            border: 1px solid var(--j-color, rgba(128,128,128,0.4));
            color: var(--j-color, inherit); background: transparent;
            border-radius: 50px; padding: 0.25rem 0.7rem; font-size: 0.82rem; font-weight: 600;
            cursor: pointer; transition: background 0.15s, color 0.15s;
        }
        .journey-pill:hover { background: color-mix(in srgb, var(--j-color, #888) 14%, transparent); }
        .journey-pill.active { background: var(--j-color, #555); color: #fff; }
        .journey-pill-clear { border-color: rgba(128,128,128,0.4); color: inherit; opacity: 0.8; }
        .journey-marker {
            width: 24px; height: 24px; border-radius: 50%; color: #fff;
            display: flex; align-items: center; justify-content: center;
            font-size: 0.78rem; font-weight: 700; border: 2px solid #fff;
            box-shadow: 0 1px 4px rgba(0,0,0,0.5);
        }
        .journey-step-list { display: flex; flex-direction: column; gap: 0.15rem; }
        .journey-step {
            display: flex; gap: 0.6rem; padding: 0.5rem; border-radius: var(--radius-md); cursor: pointer;
            transition: background 0.15s;
        }
        .journey-step:hover { background: rgba(128,128,128,0.10); }
        .journey-step.active { background: rgba(128,128,128,0.16); }
        .journey-step-num {
            flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; color: #fff;
            display: flex; align-items: center; justify-content: center;
            font-size: 0.72rem; font-weight: 700;
        }
        .journey-step-body { min-width: 0; }
        .journey-step-name { font-weight: 600; font-size: 0.9rem; }
        .journey-step-ref { margin-left: 0.4rem; font-size: 0.8rem; font-weight: 500; }
        .journey-step-note { font-size: 0.8rem; opacity: 0.72; }

        /* ===== Summer Pack 2: quiz scores, streak share, study export ===== */

        /* Home streak: Continue + Share share a row */
        .home-streak-actions { display: flex; gap: 0.5rem; }
        .home-streak-actions .home-streak-continue { flex: 1 1 auto; }
        .home-streak-share {
            flex: 0 0 auto; width: 46px; border: none; border-radius: 10px; cursor: pointer;
            background: rgba(255,255,255,0.15); color: #fff; font-size: 1.05rem;
            transition: background 0.15s;
        }
        .home-streak-share:hover { background: rgba(255,255,255,0.28); }
        [data-bs-theme="light"] .home-streak-share { background: rgba(0,0,0,0.08); color: #222; }
        [data-bs-theme="light"] .home-streak-share:hover { background: rgba(0,0,0,0.14); }

        /* Quiz best badge + scores dashboard */
        .quiz-best-badge {
            display: inline-block; font-weight: 600; font-size: 0.9rem;
            padding: 0.3rem 0.8rem; border-radius: 50px; margin-bottom: 0.4rem;
            background: rgba(128,128,128,0.14);
        }
        .quiz-best-badge.new { background: var(--app-accent); color: #fff; }
        .quiz-history-list { display: flex; flex-direction: column; }
        .quiz-history-row {
            display: flex; align-items: center; gap: 0.6rem;
            padding: 0.55rem 0.2rem; border-bottom: 1px solid rgba(128,128,128,0.15);
        }
        .quiz-history-row:last-child { border-bottom: none; }
        .qh-ref { flex: 0 0 7.5rem; font-weight: 600; font-size: 0.9rem; }
        .qh-bar { flex: 1 1 auto; min-width: 40px; }
        .qh-score { flex: 0 0 auto; font-size: 0.85rem; white-space: nowrap; }
        .qh-attempts { flex: 0 0 auto; }
        @media (max-width: 560px) {
            .qh-ref { flex-basis: 5.5rem; font-size: 0.82rem; }
            .qh-bar { display: none; }
            .qh-score { font-size: 0.8rem; }
        }

        /* Study guide Word/PDF export buttons */
        .study-export-row { display: flex; gap: 0.5rem; margin-bottom: 0.6rem; }

        /* ===== Scripture Memory game ===== */
        .memory-dashboard { background: linear-gradient(135deg, color-mix(in srgb, var(--app-accent) 22%, transparent), transparent); }
        .memory-stat-num { font-size: 1.4rem; font-weight: 700; }
        .memory-stat-lbl { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.7; }
        .memory-stars { color: var(--app-accent); letter-spacing: 1px; font-size: 0.9rem; }

        .flashcard { perspective: 1200px; cursor: pointer; margin: 0 auto; max-width: 560px; }
        .flashcard-inner { position: relative; width: 100%; min-height: 200px; transition: transform 0.6s cubic-bezier(.2,.8,.2,1); transform-style: preserve-3d; }
        .flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
        .flashcard-face { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden;
            display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
            padding: 1.5rem; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--app-accent) 40%, transparent);
            background: color-mix(in srgb, var(--app-accent) 10%, var(--bs-body-bg)); }
        .flashcard-back { transform: rotateY(180deg); }
        .fc-ref { font-size: 1.6rem; font-weight: 700; color: var(--app-accent); }
        .fc-hint { font-size: 0.8rem; opacity: 0.65; margin-top: 0.6rem; }
        .fc-text { font-size: 1.15rem; line-height: 1.7; }
        .fc-ref-sm { font-size: 0.85rem; opacity: 0.7; margin-top: 0.6rem; }

        .scramble-answer { min-height: 2.4rem; padding: 0.5rem; border-radius: 10px; margin-bottom: 0.75rem;
            background: color-mix(in srgb, var(--app-accent) 8%, transparent); line-height: 2; }
        .scramble-chosen { display: inline-block; padding: 0.1rem 0.45rem; margin: 0.15rem; border-radius: 8px;
            background: var(--app-accent); color: #fff; font-size: 0.95rem; }
        .scramble-pool { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
        .scramble-chip { padding: 0.35rem 0.7rem; border-radius: 10px; border: none; font-size: 0.95rem;
            background: var(--bs-tertiary-bg); color: var(--bs-body-color); transition: transform 0.1s; }
        .scramble-chip:hover { background: color-mix(in srgb, var(--app-accent) 30%, var(--bs-tertiary-bg)); }
        .scramble-chip:active { transform: scale(0.94); }
        .scramble-chip.shake { animation: memShake 0.4s; background: rgba(220,53,69,0.35); }
        @keyframes memShake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-6px)} 40%,80%{transform:translateX(6px)} }

        .memory-celebrate { animation: memPop 0.5s cubic-bezier(.2,1.4,.4,1); }
        @keyframes memPop { 0%{transform:scale(0.85);opacity:0} 100%{transform:scale(1);opacity:1} }
    

/* ==========================================================================
   Review Fixes (2026-11-29): Light Mode contrast, pulse keyframes, CLS, a11y
   ========================================================================== */
@keyframes pulse {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.9; }
}

[data-bs-theme="light"] .response-question {
    color: #495057;
}
[data-bs-theme="light"] .response-entry {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}
[data-bs-theme="light"] .note-inline textarea,
[data-bs-theme="light"] .chapter-note-card textarea {
    border-color: #ced4da;
    background-color: #fff;
    color: #212529;
}
[data-bs-theme="light"] .votd-dots button {
    background: rgba(0, 0, 0, 0.25);
}
[data-bs-theme="light"] .votd-dots button[aria-selected="true"],
[data-bs-theme="light"] .votd-dots button.active {
    background: var(--app-accent, #0d6efd);
}
[data-bs-theme="light"] .genealogy-node:hover .genealogy-node-text {
    fill: #111827;
}

#pwaInstallToast {
    margin-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
}


