/* =====================================================================
   MODERN PUBLICATION & STUDY BROCHURE DESIGN SYSTEM
   JW Editorial Playbook · White, Shades of Red & Black Palette
   Pure White (#FFFFFF) · Crimson (#A81C22) · Oxblood (#7A1419) · Jet (#141414)
   ===================================================================== */

:root,
[data-theme="light"] {
    --font-sans: 'Noto Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-serif: 'Noto Serif', Georgia, serif;
    --reader-scale: 1;

    /* Pure White & Subtle Ash-White Bands */
    --bg: #ffffff;
    --bg-band: #f6f4f4;
    --bg-tint: #faf8f8;
    --bg-hover: #f2eded;

    /* Rich Black & Charcoal Ink */
    --ink: #141414;
    --ink-soft: #444444;
    --ink-muted: #767272;
    --border: #e6e2e2;
    --border-strong: #cfc9c9;

    /* Curated Shades of Red */
    --brand-red: #a81c22;
    --brand-red-dark: #7a1419;
    --brand-red-bright: #c83232;
    --brand-red-soft: #fbf2f2;
    --brand-red-border: #edd5d6;

    /* Category Accents (Shades of Red & Black) */
    --cat-bible: #a81c22;
    --cat-sermons: #1c1c1c;
    --cat-books: #6e1318;
    --cat-daily: #cf4647;

    /* Study Highlighter (Soft Blush-Crimson Highlight) */
    --highlight-verse: #fdeded;
    --highlight-border: #a81c22;

    --shadow-panel: 0 20px 52px rgba(0, 0, 0, 0.24);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
    --bg: #111111;
    --bg-band: #1a1919;
    --bg-tint: #1f1d1d;
    --bg-hover: #282424;

    --ink: #f5f3f3;
    --ink-soft: #c4bebe;
    --ink-muted: #8c8585;
    --border: #2a2727;
    --border-strong: #3d3838;

    --brand-red: #dc3f45;
    --brand-red-dark: #b4282e;
    --brand-red-bright: #ef5b60;
    --brand-red-soft: #261718;
    --brand-red-border: #472426;

    --cat-bible: #dc3f45;
    --cat-sermons: #e5e2e2;
    --cat-books: #a82b31;
    --cat-daily: #f06e72;

    --highlight-verse: #2b1819;
    --highlight-border: #dc3f45;

    --shadow-panel: 0 24px 64px rgba(0, 0, 0, 0.72);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

b, strong { font-weight: 500; }

html {
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--ink);
    overflow-x: hidden;
    transition: background-color 0.22s ease, color 0.22s ease;
}

.hidden { display: none !important; }
.mt-20 { margin-top: 22px; }

.container-pub {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* =====================================================================
   1. SPLASH SCREEN (CRIMSON & BLACK SQUARE TILE)
   ===================================================================== */
#splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s var(--ease);
}

.splash-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.splash-tile {
    width: 72px;
    height: 72px;
    background: var(--brand-red);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(168, 28, 34, 0.22);
}

.splash-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
    background: #ffffff;
    border-radius: 2px;
    padding: 4px;
}

.splash-monogram {
    color: #ffffff;
    font-weight: 500;
    font-size: 1.28rem;
    letter-spacing: 0.06em;
}

.splash-brand-logo {
    height: 136px;
    width: auto;
    max-width: 340px;
    object-fit: contain;
    display: block;
    mix-blend-mode: multiply;
    filter: contrast(1.06);
}

.splash-progress {
    width: 120px;
    height: 2.5px;
    background: var(--border);
    overflow: hidden;
}

.splash-progress span {
    display: block;
    width: 45%;
    height: 100%;
    background: var(--brand-red);
    animation: PubLoad 1.15s ease-in-out infinite;
}

@keyframes PubLoad {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(260%); }
}

.loading-txt {
    font-size: 0.82rem;
    color: var(--ink-muted);
    font-weight: 500;
}

/* =====================================================================
   2. MINIMALIST SINGLE-ROW PUBLICATION HEADER
   ===================================================================== */
.view {
    display: none;
    opacity: 0;
    padding-bottom: 120px;
    transition: opacity 0.35s ease;
}
.view.is-active { display: block; opacity: 1; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-top: 3px solid var(--brand-red);
    border-bottom: 1px solid var(--border);
}

.header-top-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.brand-lockup {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    min-width: 0;
}

.nav-brand-logo {
    height: 62px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    display: block;
    mix-blend-mode: multiply;
    filter: contrast(1.06);
}

.nav-brand-tagline {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--ink-soft);
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-align: center;
}

@media (min-width: 680px) {
    .nav-brand-logo {
        height: 70px;
        max-width: 280px;
    }
    .nav-brand-tagline {
        font-size: 0.76rem;
    }
}

/* Crisp Jet-Black Square Badge with Crimson Accent */
.brand-square-tile {
    width: 34px;
    height: 34px;
    background: #141414;
    border-bottom: 3px solid var(--brand-red);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    flex-shrink: 0;
}

.top-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
    border-radius: 1px;
    padding: 2px;
    display: none;
}

.brand-mono {
    color: #ffffff;
    font-weight: 500;
    font-size: 0.74rem;
    letter-spacing: 0.05em;
}

.brand-titles {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.org-name {
    font-size: 0.98rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-btn {
    width: 32px;
    height: 32px;
    border-radius: 3px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--ink-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}
.tool-btn:hover {
    border-color: var(--brand-red);
    color: var(--brand-red);
    background: var(--brand-red-soft);
}

/* =====================================================================
   3. FLOATING HISTORY PILL & HALF-SCREEN OFFCANVAS
   ===================================================================== */
.history-fab {
    position: fixed;
    right: 18px;
    bottom: 20px;
    z-index: 4500;
    height: 38px;
    padding: 0 14px 0 6px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s var(--ease), bottom 0.28s var(--ease), border-color 0.18s ease, box-shadow 0.18s ease;
}

.history-fab-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--brand-red-soft);
    color: var(--brand-red);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.history-fab:hover {
    border-color: var(--brand-red);
    box-shadow: 0 6px 22px rgba(168, 28, 34, 0.12);
    transform: translateY(-1px);
}

.history-fab:hover .history-fab-icon {
    background: var(--brand-red);
    color: #ffffff;
}

body.has-mini-player .history-fab {
    bottom: 80px;
}

/* Half-Screen Offcanvas Backdrop & Sheet */
.offcanvas-backdrop {
    position: fixed;
    inset: 0;
    z-index: 6200;
    background: rgba(15, 15, 15, 0.32);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.offcanvas-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.offcanvas-half {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    height: 50dvh;
    min-height: 290px;
    max-height: 460px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s var(--ease);
}

.offcanvas-backdrop.is-open .offcanvas-half {
    transform: translateY(0);
}

.offcanvas-handle-wrap {
    display: flex;
    justify-content: center;
    padding: 10px 0 4px;
    flex-shrink: 0;
}

.offcanvas-handle {
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: var(--border-strong);
}

.offcanvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 1.2rem 0.8rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.offcanvas-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink);
}
.offcanvas-title i {
    color: var(--brand-red);
    font-size: 0.88rem;
}

.offcanvas-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.clear-history-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 0.74rem;
    font-weight: 400;
    color: var(--ink-muted);
    cursor: pointer;
    transition: color 0.16s ease, background-color 0.16s ease;
}
.clear-history-btn:hover {
    color: var(--brand-red);
    background: var(--brand-red-soft);
}

.offcanvas-close-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-band);
    color: var(--ink-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background-color 0.16s ease, color 0.16s ease;
}
.offcanvas-close-btn:hover {
    background: var(--bg-hover);
    color: var(--ink);
}

.offcanvas-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.6rem 0.85rem 1.25rem;
}

.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2.25rem 1.25rem;
}

.history-empty-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-band);
    color: var(--ink-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: 12px;
}

.history-empty-title {
    margin: 0 0 4px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink);
}

.history-empty-sub {
    margin: 0;
    font-size: 0.76rem;
    color: var(--ink-muted);
    max-width: 260px;
    line-height: 1.45;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 10px;
    border-radius: 8px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: background-color 0.16s ease;
}
.history-item:hover { background: var(--bg-band); }

.history-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.history-meta {
    flex: 1;
    min-width: 0;
}

.history-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.history-title {
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-time-pill {
    font-size: 0.66rem;
    font-variant-numeric: tabular-nums;
    background: var(--bg-band);
    color: var(--ink-soft);
    padding: 1px 6px;
    border-radius: 999px;
    flex-shrink: 0;
}

.history-sub {
    display: block;
    font-size: 0.73rem;
    color: var(--ink-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-dot { margin: 0 2px; }

.history-play-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand-red-soft);
    color: var(--brand-red);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.66rem;
    flex-shrink: 0;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.history-item:hover .history-play-btn {
    background: var(--brand-red);
    color: #ffffff;
}

/* Crisp Rectangular Publication Button */
.pub-btn-solid {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--brand-red);
    color: #ffffff;
    border: none;
    border-radius: 3px;
    padding: 9px 18px;
    font-family: var(--font-sans);
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.18s ease;
}
.pub-btn-solid:hover { background: var(--brand-red-dark); }
.pub-btn-solid.sm { padding: 7px 14px; font-size: 0.78rem; }

/* =====================================================================
   4. MINIMALIST MODERN PASTOR LISTING (COMPACT IMAGES & TEXT)
   ===================================================================== */
.pub-main {
    padding: 1.85rem 0 0;
}

.section-heading-minimal {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: 0.65rem;
    margin-bottom: 1.65rem;
    border-bottom: 1px solid var(--border);
}

.section-title-minimal {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--ink);
    position: relative;
}
.section-title-minimal::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -0.7rem;
    width: 28px;
    height: 2px;
    background: var(--brand-red);
}

.section-count {
    font-size: 0.74rem;
    font-weight: 400;
    color: var(--ink-muted);
}

/* Compact, Balanced Multi-Column Grid */
.voices-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.85rem 1.15rem;
}

@media (min-width: 560px) {
    .voices-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 2rem 1.5rem;
    }
}

@media (min-width: 820px) {
    .voices-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 2.25rem 1.75rem;
    }
}

@media (min-width: 1040px) {
    .voices-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 2.25rem 1.75rem;
    }
}

/* Unboxed, Compact Brochure Column */
.voice-card {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
}

.voice-photo-frame {
    width: 100%;
    max-width: 168px;
    aspect-ratio: 1 / 1;
    border-radius: 3px;
    overflow: hidden;
    background: var(--bg-band);
    margin-bottom: 0.7rem;
    position: relative;
}

.voice-portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.42s var(--ease);
}

/* Crimson Sliding Bottom Hairline on Hover */
.voice-photo-frame::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--brand-red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s var(--ease);
}

@media (hover: hover) {
    .voice-card:hover .voice-portrait { transform: scale(1.035); }
    .voice-card:hover .voice-photo-frame::after { transform: scaleX(1); }
    .voice-card:hover .voice-name { color: var(--brand-red); }
}

.voice-card.is-playing-voice .voice-photo-frame::after {
    transform: scaleX(1);
}

.playing-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: var(--brand-red);
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 2px;
    display: none;
    align-items: center;
    gap: 4px;
}
.voice-card.is-playing-voice .playing-badge { display: inline-flex; }

.voice-name {
    margin: 0 0 2px;
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.25;
    color: var(--ink);
    transition: color 0.16s ease;
}

.voice-church {
    font-size: 0.73rem;
    color: var(--ink-muted);
    line-height: 1.32;
    margin-bottom: 8px;
}

/* Minimalist Icon-Above-Label Category Links (Evenly Distributed) */
.sm-acts {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 168px;
    margin-top: auto;
    padding-top: 9px;
    border-top: 1px solid var(--border);
}

.sm-act-link {
    flex: 1;
    background: none;
    border: none;
    padding: 2px 0;
    color: var(--ink-soft);
    font-family: var(--font-sans);
    font-size: 0.65rem;
    font-weight: 400;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
}

.sm-act-link i {
    font-size: 0.88rem;
    color: var(--ink);
    transition: color 0.15s ease;
}

.sm-act-link:hover,
.sm-act-link:hover i {
    color: var(--brand-red);
}

/* =====================================================================
   5. PUBLICATION LIBRARY SHEET & VISUAL BIBLE GRID (RED & BLACK)
   ===================================================================== */
.sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 6000;
    background: rgba(10, 10, 10, 0.56);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

@media (min-width: 740px) {
    .sheet-backdrop {
        align-items: center;
        padding: 1.5rem;
    }
}

.sheet-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.sheet-panel {
    width: 100%;
    max-width: 720px;
    height: 94dvh;
    max-height: 860px;
    background: var(--bg);
    border-radius: 4px 4px 0 0;
    box-shadow: var(--shadow-panel);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.28s var(--ease);
}

@media (min-width: 740px) {
    .sheet-panel {
        height: 88dvh;
        border-radius: 4px;
        border: 1px solid var(--border);
    }
}

.sheet-backdrop.is-open .sheet-panel { transform: translateY(0); }

.sheet-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.72rem 1.2rem;
    background: var(--bg-band);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.back-link {
    background: none;
    border: none;
    color: var(--ink-soft);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 6px;
    transition: color 0.15s ease;
}
.back-link:hover { color: var(--ink); text-decoration: none; }

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 3px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.92rem;
    cursor: pointer;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--ink); }

.font-size-btn {
    height: 30px;
    padding: 0 9px;
    border-radius: 3px;
    border: 1px solid var(--border-strong);
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
}
.font-size-btn:hover {
    border-color: var(--brand-red);
    color: var(--brand-red);
}

.pastor-masthead {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 1.1rem 1.35rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.ps-avatar {
    width: 60px;
    height: 60px;
    border-radius: 3px;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.ps-details { min-width: 0; }
.ps-role {
    display: block;
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand-red);
}
.ps-name {
    margin: 2px 0;
    font-size: 1.24rem;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.2;
}
.ps-church {
    margin: 0;
    font-size: 0.84rem;
    color: var(--ink-soft);
}

.ps-tabs {
    display: flex;
    background: var(--bg-band);
    border-bottom: 1px solid var(--border);
    padding: 0 1rem;
    overflow-x: auto;
    flex-shrink: 0;
}

.ps-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.75rem 0.95rem 0.65rem;
    color: var(--ink-soft);
    font-family: var(--font-sans);
    font-size: 0.84rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
}
.ps-tab:hover { color: var(--brand-red); }
.ps-tab.is-active {
    color: var(--brand-red);
    border-bottom-color: var(--brand-red);
    background: var(--bg);
}

.ps-search-wrap {
    margin: 0.9rem 1.35rem 0.2rem;
    position: relative;
    flex-shrink: 0;
}

.ps-search-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--ink-muted);
}

.ps-search-wrap input {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 35px;
    border-radius: 3px;
    border: 1px solid var(--border-strong);
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 0.88rem;
}
.ps-search-wrap input:focus { border-color: var(--brand-red); }

.ps-stage {
    flex: 1;
    overflow-y: auto;
    padding: 1.2rem 1.35rem 2.5rem;
}

/* Tabbed Old / New Testament Switcher */
.testament-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--bg-band);
    padding: 3px;
    gap: 4px;
    margin-bottom: 14px;
}

.testament-tab {
    background: transparent;
    border: none;
    border-radius: 2px;
    padding: 8px 10px;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--ink-soft);
    cursor: pointer;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.testament-tab:hover {
    color: var(--ink);
}

.testament-tab.is-active {
    background: var(--brand-red);
    color: #ffffff;
}

.bible-book-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

@media (min-width: 560px) {
    .bible-book-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.book-tile {
    padding: 9px 8px;
    border: 1px solid var(--border);
    border-radius: 2px;
    background: var(--bg-band);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 0.76rem;
    font-weight: 400;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.book-tile:hover {
    background: var(--brand-red);
    border-color: var(--brand-red);
    color: #ffffff;
}

/* Numbered Chapter Squares */
.chapter-nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--brand-red);
}

.selected-book-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--ink);
}

.chapter-instruction {
    margin: 0 0 12px;
    font-size: 0.84rem;
    color: var(--ink-soft);
}

.chapter-square-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
    gap: 6px;
    margin-bottom: 18px;
}

.chap-sq {
    height: 42px;
    border-radius: 2px;
    border: 1px solid var(--border);
    background: var(--bg-band);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.chap-sq:hover,
.chap-sq.is-selected {
    background: var(--brand-red);
    border-color: var(--brand-red);
    color: #ffffff;
}

.verse-range-box {
    background: var(--brand-red-soft);
    border: 1px solid var(--brand-red-border);
    border-left: 4px solid var(--brand-red);
    border-radius: 3px;
    padding: 1rem 1.15rem;
}

.verse-range-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 10px;
}

.vr-title {
    font-weight: 500;
    font-size: 0.98rem;
    color: var(--ink);
}

.vr-selects {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.field-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--ink-soft);
    margin-bottom: 4px;
}

.pub-select {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border-radius: 3px;
    border: 1px solid var(--border-strong);
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 400;
}

/* Catalog List */
.catalog-list {
    display: flex;
    flex-direction: column;
}

.catalog-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 10px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.16s ease;
}
.catalog-item:hover { background: var(--bg-tint); }

.list-thumb {
    width: 50px;
    height: 50px;
    border-radius: 3px;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.date-box {
    width: 48px;
    height: 48px;
    border-radius: 3px;
    background: #141414;
    border-bottom: 3px solid var(--brand-red);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.date-box span {
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #f2a2a5;
}
.date-box b {
    font-size: 0.96rem;
    font-weight: 500;
}

.item-meta { flex: 1; min-width: 0; }
.item-title {
    display: block;
    font-size: 0.94rem;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.3;
    margin-bottom: 2px;
}
.item-sub {
    font-size: 0.76rem;
    color: var(--ink-muted);
}

.item-play-sq {
    width: 32px;
    height: 32px;
    border-radius: 3px;
    background: var(--brand-red-soft);
    color: var(--brand-red);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    flex-shrink: 0;
}
.catalog-item:hover .item-play-sq {
    background: var(--brand-red);
    color: #ffffff;
}

.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--ink-muted);
}

/* =====================================================================
   6. MAGAZINE ARTICLE READER (OBSIDIAN BLACK & CRIMSON MASTHEAD)
   ===================================================================== */
.reader-panel { max-width: 780px; }

.reader-tools {
    display: flex;
    align-items: center;
    gap: 6px;
}

.reader-scroll {
    flex: 1;
    overflow-y: auto;
}

.article-masthead {
    background: #141414;
    border-top: 4px solid var(--brand-red);
    color: #ffffff;
    padding: 2.2rem 1.75rem 1.95rem;
}

@media (min-width: 680px) {
    .article-masthead { padding: 2.6rem 3.25rem 2.2rem; }
}

.article-date {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #e6676b;
    margin-bottom: 10px;
}

.article-title {
    margin: 0 0 8px;
    font-size: 1.9rem;
    font-weight: 500;
    line-height: 1.2;
    color: #ffffff;
}

.article-author {
    margin: 0;
    font-size: 0.9rem;
    color: #c9c3c3;
}

.article-body {
    padding: 2.2rem 1.75rem 5rem;
    font-family: var(--font-serif);
    font-size: calc(1.14rem * var(--reader-scale));
    line-height: 1.85;
    color: var(--ink);
}

@media (min-width: 680px) {
    .article-body { padding: 2.5rem 3.25rem 5.5rem; }
}

.scrip-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-sans);
    font-size: 0.82em;
    font-weight: 500;
    color: var(--brand-red);
    background: var(--brand-red-soft);
    border-bottom: 1.5px solid var(--brand-red);
    padding: 1px 7px;
    border-radius: 2px;
    margin: 0 2px;
    cursor: pointer;
}
.scrip-link:hover {
    background: var(--brand-red);
    color: #ffffff;
}

/* =====================================================================
   7. STUDY AUDIO PLAYER OVERLAY (WHITE · RED · BLACK)
   ===================================================================== */
#pv {
    position: fixed;
    inset: 0;
    z-index: 7000;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.36s var(--ease);
}
#pv.is-open { transform: translateY(0); }

.p-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.72rem 1.2rem;
    background: var(--bg-band);
    border-top: 3px solid var(--brand-red);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.p-mode-tag {
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--ink-muted);
    display: none;
}
@media (min-width: 640px) { .p-mode-tag { display: inline; } }

.p-head-right {
    display: flex;
    align-items: center;
    gap: 5px;
}

.chip-btn {
    height: 30px;
    padding: 0 10px;
    border-radius: 3px;
    border: 1px solid var(--border-strong);
    background: var(--bg);
    color: var(--ink-soft);
    font-family: var(--font-sans);
    font-size: 0.74rem;
    font-weight: 500;
    cursor: pointer;
}
.chip-btn.is-active {
    background: var(--brand-red);
    border-color: var(--brand-red);
    color: #ffffff;
}

/* Study-Highlighted Audio Bible Column */
.vl {
    flex: 1;
    overflow-y: auto;
    max-width: 740px;
    width: 100%;
    margin: 0 auto;
    padding: 1.75rem 1.35rem 230px;
}

.bible-chapter-banner {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 2px solid var(--brand-red);
}

.bible-dropcap-num {
    font-family: var(--font-sans);
    font-size: 2.5rem;
    font-weight: 500;
    line-height: 1;
    color: var(--brand-red);
}

.bible-chapter-title {
    font-size: 1.28rem;
    font-weight: 500;
    color: var(--ink);
}

.vl .vi {
    padding: 11px 14px;
    margin-bottom: 4px;
    border-radius: 3px;
    font-family: var(--font-serif);
    font-size: calc(1.16rem * var(--reader-scale));
    line-height: 1.84;
    color: var(--ink);
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: background-color 0.22s ease, border-color 0.22s ease;
}

.vl .vi:hover { background: var(--bg-tint); }

.vl .vi b {
    font-family: var(--font-sans);
    font-size: 0.78em;
    font-weight: 500;
    vertical-align: super;
    margin-right: 7px;
    color: var(--brand-red);
}

.vl .vi.is-active {
    background: var(--highlight-verse);
    border-left-color: var(--highlight-border);
}

/* Artwork & Chapters Stage */
#bookStage {
    flex: 1;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1.35rem 230px;
}

.cover-stage { margin: auto 0 1.75rem; }

.book-cover-large {
    width: min(250px, 64vw);
    height: min(250px, 64vw);
    border-radius: 3px;
    object-fit: cover;
    border: 1px solid var(--border);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
    display: block;
}

.book-chapters {
    width: 100%;
    max-width: 560px;
}

.chapter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    border-left: 3px solid transparent;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 400;
    color: var(--ink-soft);
}
.chapter-row:hover { background: var(--bg-band); color: var(--ink); }
.chapter-row.is-active {
    background: var(--brand-red-soft);
    border-left-color: var(--brand-red);
    color: var(--brand-red);
}
.chapter-idx {
    font-weight: 500;
    color: var(--brand-red);
    margin-right: 10px;
}

#pv.mode-bible .vl { display: block; }
#pv.mode-bible #bookStage { display: none; }
#pv.mode-book .vl { display: none; }
#pv.mode-book #bookStage { display: flex; }

/* Study Audio Console Footer (Protruding Portrait + Inline Playback & Controls) */
.p-foot {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.09);
    padding: 0.75rem 1.25rem 1.35rem;
    overflow: visible;
}

.p-foot-inner {
    max-width: 740px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

.foot-left {
    width: 88px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* 2x Larger Pastor Image Protruding Above the Player Box */
.footer-art {
    width: 88px;
    height: 88px;
    margin-top: -54px;
    border-radius: 4px;
    object-fit: cover;
    border: 3px solid var(--bg);
    background: var(--bg-band);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22), 0 0 0 1px var(--border);
    display: block;
}

.foot-name {
    margin-top: 8px;
    width: 100%;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--ink);
    text-align: center;
    line-height: 1.2;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.foot-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

.scrubber-wrap {
    width: 100%;
    margin: 0;
}

.sc-header-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.track-ref {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.time-row {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    color: var(--ink-muted);
    flex-shrink: 0;
}
.time-sep { opacity: 0.5; }

.sc-track {
    position: relative;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    width: 100%;
}

.sc-fill {
    height: 100%;
    width: 0%;
    background: var(--brand-red);
    border-radius: 2px;
    position: relative;
    transition: width 0.1s linear;
}

.sc-fill::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--brand-red);
    border: 2px solid var(--bg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.sc-inp {
    position: absolute;
    top: -12px;
    left: 0;
    width: 100%;
    height: 28px;
    opacity: 0;
    cursor: pointer;
}

/* Controls Inline with Pastor's Name */
.btn-deck {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 300px;
    width: 100%;
    min-height: 40px;
}

.c-btn {
    background: none;
    border: none;
    color: var(--ink-soft);
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}
.c-btn:hover, .c-btn.is-active { color: var(--brand-red); }

.speed-btn {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 3px;
    border: 1px solid var(--border-strong);
    background: var(--bg-band);
    min-width: 38px;
}

.play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand-red);
    color: #ffffff;
    font-size: 0.94rem;
}
.play-btn:hover { background: var(--brand-red-dark); color: #ffffff; }

/* =====================================================================
   8. DOCKED PUBLICATION AUDIO BAR
   ===================================================================== */
#mp {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 66px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    padding: 0 1.2rem;
    z-index: 5000;
    cursor: pointer;
    transform: translateY(100%);
    transition: transform 0.28s var(--ease);
}
#mp.is-visible { transform: translateY(0); }

.mp-track-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border);
}
.mp-bar {
    height: 100%;
    width: 0%;
    background: var(--brand-red);
    transition: width 0.15s linear;
}

.ma {
    width: 40px;
    height: 40px;
    border-radius: 3px;
    object-fit: cover;
    margin-right: 12px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.mp-meta { flex: 1; min-width: 0; }
.m-tit {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.m-art {
    font-size: 0.76rem;
    color: var(--ink-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mp-play {
    background: var(--brand-red);
    color: #ffffff;
    border-radius: 50%;
}
.mp-play:hover { background: var(--brand-red-dark); color: #ffffff; }

/* =====================================================================
   9. TOAST & SCROLLBAR
   ===================================================================== */
.pub-toast {
    position: fixed;
    bottom: 82px;
    left: 50%;
    transform: translate(-50%, 10px);
    background: #141414;
    border-left: 3px solid var(--brand-red);
    color: #ffffff;
    padding: 9px 18px;
    border-radius: 3px;
    font-size: 0.82rem;
    font-weight: 400;
    opacity: 0;
    pointer-events: none;
    z-index: 9500;
    transition: opacity 0.2s ease, transform 0.2s var(--ease);
}
.pub-toast.is-shown {
    opacity: 1;
    transform: translate(-50%, 0);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
