/* ============================================================
   ONENESS BIBLE — Brand Palette
   ============================================================ */
:root {
    --navy: #1a3a7a;
    --navy-dark: #122a5c;
    --navy-light: #2a4d94;
    --gold: #e6a820;
    --gold-dark: #c88f18;
    --gold-light: #f5c542;

    --bg: #fdf8f0;
    --bg-elevated: #ffffff;
    --text: #1a1a1a;
    --text-soft: #4a4a4a;
    --muted: #8a8a8a;
    --border: #e8e0d0;
    --card: #ffffff;

    --accent: var(--navy);
    --accent-hover: var(--navy-dark);
    --highlight: var(--gold);

    --reader-font-size: 18px;
    --reader-line-height: 1.7;
    --reader-font-family: Georgia, 'Times New Roman', serif;
    --reader-max-width: 720px;

    --ui-font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --shadow-sm: 0 1px 3px rgba(26, 58, 122, 0.06);
    --shadow-md: 0 4px 12px rgba(26, 58, 122, 0.08);
    --shadow-lg: 0 8px 24px rgba(26, 58, 122, 0.12);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --header-row-1-height: 52px;
    --header-row-2-height: 48px;
}

[data-theme="dark"] {
    --bg: #0f1a2e;
    --bg-elevated: #16253e;
    --text: #f0e8d8;
    --text-soft: #c9c2b4;
    --muted: #8892a6;
    --border: #253451;
    --card: #1a2840;

    --accent: var(--gold);
    --accent-hover: var(--gold-dark);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
}

body {
    min-height: 100%;
}

body {
    font-family: var(--ui-font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   SPLASH SCREEN
   ============================================================ */
.splash {
    position: fixed;
    inset: 0;
    background: #1a3a7a;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.splash.dismissing {
    opacity: 0;
    transform: translateY(-24px) scale(1.02);
    pointer-events: none;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    padding: 2rem;
}

.splash-logo {
    width: 160px;
    height: 160px;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.85);
    animation: splashLogoIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0s forwards;
    filter: drop-shadow(0 20px 60px rgba(230, 168, 32, 0.35));
}

@keyframes splashLogoIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.splash-title {
    font-family: var(--ui-font);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    opacity: 0;
    transform: translateY(12px);
    animation: splashTitleIn 0.5s ease 0.4s forwards;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.splash-title-gradient {
    background: linear-gradient(135deg, #e6a820 0%, #f5c542 50%, #e6a820 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: splashTitleSweep 2s ease infinite;
}

.splash-title-plain {
    color: #ffffff;
    opacity: 0.85;
    font-weight: 400;
}

@keyframes splashTitleIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes splashTitleSweep {
    0% {
        background-position: -100% center;
    }

    100% {
        background-position: 200% center;
    }
}

.splash-tagline {
    font-family: var(--ui-font);
    font-size: 0.95rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.62);
    letter-spacing: 0.01em;
    margin: 0;
    opacity: 0;
    transform: translateY(12px);
    animation: splashTaglineIn 0.5s ease 0.7s forwards;
}

@keyframes splashTaglineIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {

    .splash-logo,
    .splash-title,
    .splash-tagline,
    .splash-title-gradient {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .splash-title-gradient {
        background: #e6a820;
        -webkit-text-fill-color: #e6a820;
    }
}

@media (max-width: 500px) {
    .splash-logo {
        width: 120px;
        height: 120px;
    }

    .splash-title {
        font-size: 1.6rem;
    }

    .splash-tagline {
        font-size: 0.85rem;
    }
}

/* ============================================================
   SVG Icon Base
   ============================================================ */
.icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    stroke-width: 2;
    color: currentColor;
}

.icon-sun {
    display: none !important;
}

.icon-moon {
    display: inline-block;
}

[data-theme="dark"] .icon-sun {
    display: inline-block !important;
}

[data-theme="dark"] .icon-moon {
    display: none !important;
}

/* ============================================================
   Reader Header — 2 rows
   ============================================================ */
header {
    padding: 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
    overflow: visible;
}

header.hidden {
    display: none;
}

.header-row {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.header-row-1 {
    height: var(--header-row-1-height);
    gap: 0.4rem;
    border-bottom: 1px solid var(--border);
}

.header-row-2 {
    min-height: var(--header-row-2-height);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    gap: 0.35rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.header-row-2::-webkit-scrollbar {
    display: none;
}

.header-row-1.hidden-row {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    height: 0 !important;
    min-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none;
    overflow: hidden;
}

.header-row-2.hidden-row {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    min-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .header-row {
        transition: none;
    }
}

/* ============================================================
   Row 1 — Logo + Icons
   ============================================================ */
.brand-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: inherit;
    transition: background 0.15s;
}

.brand-link:hover {
    background: rgba(26, 58, 122, 0.06);
}

[data-theme="dark"] .brand-link:hover {
    background: rgba(230, 168, 32, 0.08);
}

.brand-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
}

.brand-name {
    font-family: var(--ui-font);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--navy);
    letter-spacing: -0.01em;
}

[data-theme="dark"] .brand-name {
    color: var(--gold);
}

.brand-name .bible {
    font-weight: 400;
    opacity: 0.7;
}

.header-spacer {
    flex: 1;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}

.icon-btn .icon {
    width: 20px;
    height: 20px;
}

.icon-btn:hover {
    background: rgba(26, 58, 122, 0.08);
    color: var(--navy);
}

[data-theme="dark"] .icon-btn:hover {
    background: rgba(230, 168, 32, 0.12);
    color: var(--gold);
}

/* ============================================================
   Row 2 — Search + Controls
   ============================================================ */
.search-inline {
    flex: 1 1 auto;
    min-width: 100px;
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 0.4rem 0 1.7rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-inline:focus-within {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(26, 58, 122, 0.1);
}

[data-theme="dark"] .search-inline:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(230, 168, 32, 0.12);
}

.search-inline .search-icon {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--muted);
    pointer-events: none;
}

.search-inline input {
    flex: 1;
    font-family: inherit;
    font-size: 0.82rem;
    padding: 0.4rem 0;
    border: none;
    background: transparent;
    color: var(--text);
    outline: none;
    min-width: 0;
    width: 100%;
}

.search-inline input::placeholder {
    color: var(--muted);
}

.search-inline button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 0.2rem 0.25rem;
    border-radius: var(--radius-sm);
    transition: color 0.15s;
    flex-shrink: 0;
}

.search-inline button .icon {
    width: 13px;
    height: 13px;
}

.search-inline button:hover {
    color: var(--accent);
}

select,
button {
    font-family: inherit;
    font-size: 0.82rem;
    padding: 0.4rem 0.55rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    flex-shrink: 0;
}

select:hover,
button:hover {
    border-color: var(--navy);
    color: var(--navy);
}

[data-theme="dark"] select:hover,
[data-theme="dark"] button:hover {
    border-color: var(--gold);
    color: var(--gold);
}

#translationSelect {
    max-width: 70px;
    font-weight: 600;
    color: var(--navy);
    border-color: var(--navy);
    background: rgba(26, 58, 122, 0.05);
}

#translationSelect:hover {
    background: rgba(26, 58, 122, 0.1);
    color: var(--navy);
}

[data-theme="dark"] #translationSelect {
    color: var(--gold);
    border-color: var(--gold);
    background: rgba(230, 168, 32, 0.08);
}

#bookSelect {
    max-width: 90px;
}

#chapterSelect {
    max-width: 65px;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    flex-shrink: 0;
    max-width: 32px;
}

.nav-btn .icon {
    width: 15px;
    height: 15px;
}

/* ============================================================
   Button variants
   ============================================================ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
    font-weight: 600;
    max-width: none;
}

.btn-primary:hover {
    background: var(--navy-dark);
    border-color: var(--navy-dark);
    color: #fff;
}

[data-theme="dark"] .btn-primary {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--navy-dark);
}

[data-theme="dark"] .btn-primary:hover {
    background: var(--gold-dark);
    border-color: var(--gold-dark);
    color: var(--navy-dark);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: var(--card);
    color: var(--text);
    border: 1.5px solid var(--border);
    max-width: none;
}

.btn-secondary:hover {
    border-color: var(--navy);
    color: var(--navy);
}

[data-theme="dark"] .btn-secondary:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.btn-primary .icon,
.btn-secondary .icon {
    color: currentColor;
}

/* ============================================================
   Main reader
   ============================================================ */
main#reader {
    max-width: var(--reader-max-width);
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    font-size: var(--reader-font-size);
    line-height: var(--reader-line-height);
    font-family: var(--reader-font-family);
    transition: max-width 0.2s, font-size 0.15s;
}

main#reader.hidden {
    display: none;
}

.chapter-title {
    font-family: var(--ui-font);
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--navy);
    text-align: center;
    letter-spacing: -0.01em;
}

[data-theme="dark"] .chapter-title {
    color: var(--gold);
}

.verse {
    margin-bottom: 0.75rem;
    cursor: pointer;
    position: relative;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
    padding: 0.15rem 0.35rem;
    margin-left: -0.35rem;
    margin-right: -0.35rem;
}

.verse:hover {
    background: rgba(26, 58, 122, 0.05);
}

[data-theme="dark"] .verse:hover {
    background: rgba(230, 168, 32, 0.06);
}

.verse-num {
    font-family: var(--ui-font);
    font-size: 0.7em;
    color: var(--gold);
    font-weight: 700;
    vertical-align: super;
    margin-right: 0.4rem;
    letter-spacing: 0.02em;
}

/* ============================================================
   HOME SCREEN
   ============================================================ */
#home {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    padding: 2rem 1.5rem 3rem;
    background: var(--bg);
    z-index: 5;
    -webkit-overflow-scrolling: touch;
}

#home.hidden {
    display: none;
}

.home-container {
    max-width: 640px;
    margin: 0 auto;
    animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.home-hero {
    text-align: center;
    padding: 1rem 0 2rem;
}

.home-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.home-title {
    font-family: var(--ui-font);
    font-size: 2rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

[data-theme="dark"] .home-title {
    color: var(--gold);
}

.home-title .bible {
    font-weight: 400;
    opacity: 0.65;
}

.home-tagline {
    font-family: var(--ui-font);
    font-size: 0.95rem;
    color: var(--muted);
    font-style: italic;
    letter-spacing: 0.01em;
}

.home-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.4rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}

.home-card:hover {
    box-shadow: var(--shadow-md);
}

.card-label {
    font-family: var(--ui-font);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.card-label .icon {
    width: 16px;
    height: 16px;
    color: var(--gold);
}

.votd-text {
    font-family: var(--reader-font-family);
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.votd-ref {
    font-family: var(--ui-font);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: 0.02em;
}

[data-theme="dark"] .votd-ref {
    color: var(--gold);
}

.votd-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.votd-actions button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
}

.votd-actions .icon {
    width: 14px;
    height: 14px;
}

.continue-title {
    font-family: var(--ui-font);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.continue-sub {
    font-family: var(--ui-font);
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.home-full-btn {
    width: 100%;
}

/* ============================================================
   Offline Download card
   ============================================================ */
.offline-state {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.offline-state.hidden {
    display: none;
}

.offline-desc {
    font-family: var(--ui-font);
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text-soft);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.offline-desc .icon {
    color: #2e7d32;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

[data-theme="dark"] .offline-desc .icon {
    color: #81c784;
}

.translation-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.translation-check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.65rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-family: var(--ui-font);
    font-size: 0.9rem;
}

.translation-check:hover {
    border-color: var(--navy);
    background: rgba(26, 58, 122, 0.03);
}

[data-theme="dark"] .translation-check:hover {
    border-color: var(--gold);
    background: rgba(230, 168, 32, 0.05);
}

.translation-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--navy);
    cursor: pointer;
    flex-shrink: 0;
}

[data-theme="dark"] .translation-check input[type="checkbox"] {
    accent-color: var(--gold);
}

.translation-check span {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    flex: 1;
}

.translation-check em {
    font-style: normal;
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 0.1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--navy), var(--gold));
    border-radius: 999px;
    transition: width 0.2s ease;
}

[data-theme="dark"] .progress-fill {
    background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
}

.progress-percent {
    font-family: var(--ui-font);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gold);
    text-align: right;
    margin: 0;
    letter-spacing: 0.05em;
}

.offline-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.offline-meta-text {
    font-family: var(--ui-font);
    font-size: 0.78rem;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: none;
    padding: 0.3rem 0.5rem;
    font-family: var(--ui-font);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
    max-width: none;
}

.link-btn:hover {
    color: var(--navy);
    background: rgba(26, 58, 122, 0.06);
}

[data-theme="dark"] .link-btn:hover {
    color: var(--gold);
    background: rgba(230, 168, 32, 0.1);
}

.link-btn .icon {
    width: 13px;
    height: 13px;
}

.link-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   Stats
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.stat {
    text-align: center;
    padding: 0.5rem 0.25rem;
    border-radius: var(--radius-sm);
    background: var(--bg);
}

.stat-value {
    font-family: var(--ui-font);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
    margin-bottom: 0.25rem;
}

[data-theme="dark"] .stat-value {
    color: var(--gold);
}

.stat-label {
    font-family: var(--ui-font);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.home-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.home-actions .btn-primary,
.home-actions .btn-secondary {
    font-size: 1rem;
    padding: 0.85rem 1.2rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.home-actions .icon {
    width: 18px;
    height: 18px;
}

.home-footer {
    text-align: center;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.home-footer-links {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.home-footer-links button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-family: inherit;
    transition: color 0.15s;
    max-width: none;
}

.home-footer-links button .icon {
    width: 14px;
    height: 14px;
}

.home-footer-links button:hover {
    color: var(--navy);
    background: none;
}

[data-theme="dark"] .home-footer-links button:hover {
    color: var(--gold);
}

.home-version {
    font-family: var(--ui-font);
    font-size: 0.75rem;
    color: var(--muted);
}

/* ============================================================
   Loading, errors, empty
   ============================================================ */
.loading,
.error {
    text-align: center;
    color: var(--muted);
    padding: 2rem;
    font-family: var(--ui-font);
    font-size: 0.95rem;
}

.error {
    color: #c0392b;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 2rem 0;
    font-size: 0.95rem;
    line-height: 1.7;
    font-family: var(--ui-font);
}

/* ============================================================
   Footer
   ============================================================ */
footer.app-footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.75rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    font-family: var(--ui-font);
}

footer.app-footer.hidden {
    display: none;
}

/* ============================================================
   Search results overlay
   ============================================================ */
.search-results {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 100;
    overflow-y: auto;
    padding: 1.5rem;
}

.search-results.hidden {
    display: none;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 720px;
    margin: 0 auto 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

#searchStatus {
    font-size: 0.95rem;
    color: var(--navy);
    font-weight: 700;
    font-family: var(--ui-font);
}

[data-theme="dark"] #searchStatus {
    color: var(--gold);
}

#closeSearchBtn,
#closeBookmarksBtn,
#closeSettingsBtn,
#closeAboutBtn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--ui-font);
    font-size: 0.85rem;
    padding: 0.4rem 0.7rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    max-width: none;
}

#closeSearchBtn .icon,
#closeBookmarksBtn .icon,
#closeSettingsBtn .icon,
#closeAboutBtn .icon {
    width: 14px;
    height: 14px;
}

#closeSearchBtn:hover,
#closeBookmarksBtn:hover,
#closeSettingsBtn:hover,
#closeAboutBtn:hover {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

[data-theme="dark"] #closeSearchBtn:hover,
[data-theme="dark"] #closeBookmarksBtn:hover,
[data-theme="dark"] #closeSettingsBtn:hover,
[data-theme="dark"] #closeAboutBtn:hover {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--navy-dark);
}

#searchResultsList {
    max-width: 720px;
    margin: 0 auto;
}

.result-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.9rem 1.1rem;
    margin-bottom: 0.5rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--card);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    cursor: pointer;
    transition: all 0.15s;
    max-width: none;
    white-space: normal;
    overflow: visible;
}

.result-item:hover {
    border-color: var(--navy);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

[data-theme="dark"] .result-item:hover {
    border-color: var(--gold);
}

.result-ref {
    display: block;
    font-family: var(--ui-font);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.result-text mark {
    background: rgba(230, 168, 32, 0.35);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

.search-progress {
    font-size: 0.9rem;
    color: var(--muted);
    text-align: center;
    padding: 1rem;
    font-family: var(--ui-font);
}

/* ============================================================
   Verse highlights & toolbar
   ============================================================ */
.verse.highlight {
    background: rgba(230, 168, 32, 0.22);
    border-radius: var(--radius-sm);
    transition: background 0.4s;
}

.verse.hl-yellow {
    background: rgba(255, 235, 59, 0.35);
}

.verse.hl-green {
    background: rgba(76, 175, 80, 0.28);
}

.verse.hl-blue {
    background: rgba(33, 150, 243, 0.25);
}

.verse.hl-pink {
    background: rgba(233, 30, 99, 0.22);
}

.verse.hl-purple {
    background: rgba(156, 39, 176, 0.22);
}

.verse.selected {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
}

[data-theme="dark"] .verse.selected {
    outline-color: var(--gold);
}

.verse.bookmarked::before {
    content: "🔖";
    position: absolute;
    left: -1.3rem;
    top: 0.2rem;
    font-size: 0.75rem;
    opacity: 0.85;
}

.verse-toolbar {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.55rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    font-family: var(--ui-font);
}

.verse-toolbar.hidden {
    display: none;
}

.vt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    padding: 0.35rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    color: var(--text);
    line-height: 1;
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
    max-width: none;
}

.vt-btn .icon {
    width: 18px;
    height: 18px;
}

.vt-btn:hover {
    background: rgba(26, 58, 122, 0.08);
}

[data-theme="dark"] .vt-btn:hover {
    background: rgba(230, 168, 32, 0.12);
}

.vt-btn.active {
    background: var(--navy);
    color: #fff;
}

[data-theme="dark"] .vt-btn.active {
    background: var(--gold);
    color: var(--navy-dark);
}

.vt-divider {
    width: 1px;
    height: 18px;
    background: var(--border);
    margin: 0 0.15rem;
}

.vt-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s, border-color 0.15s;
    flex-shrink: 0;
    max-width: none;
}

.vt-color[data-color="yellow"] {
    background: #fff59d;
}

.vt-color[data-color="green"] {
    background: #a5d6a7;
}

.vt-color[data-color="blue"] {
    background: #90caf9;
}

.vt-color[data-color="pink"] {
    background: #f48fb1;
}

.vt-color[data-color="purple"] {
    background: #ce93d8;
}

.vt-color:hover,
.vt-color.active {
    border-color: var(--navy);
    transform: scale(1.1);
}

[data-theme="dark"] .vt-color:hover,
[data-theme="dark"] .vt-color.active {
    border-color: var(--gold);
}

/* ============================================================
   Side panels
   ============================================================ */
.bookmarks-panel,
.settings-panel,
.about-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 150;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bookmarks-panel.hidden,
.settings-panel.hidden,
.about-panel.hidden {
    display: none;
}

.bookmarks-header,
.settings-header,
.about-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    font-family: var(--ui-font);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--navy);
}

[data-theme="dark"] .bookmarks-header,
[data-theme="dark"] .settings-header,
[data-theme="dark"] .about-header {
    color: var(--gold);
}

.bookmarks-header>span,
.settings-header>span,
.about-header>span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.bookmarks-header .icon,
.settings-header .icon,
.about-header .icon {
    width: 18px;
    height: 18px;
    color: var(--gold);
}

.bookmark-item {
    padding: 0.9rem 1rem;
    border: 1.5px solid var(--border);
    border-left-width: 4px;
    border-radius: var(--radius-md);
    background: var(--card);
    color: var(--text);
    font-family: var(--ui-font);
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 0.5rem;
    transition: box-shadow 0.15s;
}

.bookmark-item:hover {
    box-shadow: var(--shadow-sm);
}

.bookmark-ref {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.bookmark-text {
    display: block;
    color: var(--text-soft);
    font-family: var(--reader-font-family);
    font-size: 0.95rem;
}

.bookmark-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
    margin-top: 0.6rem;
}

.bookmark-actions button {
    font-size: 0.78rem;
    padding: 0.3rem 0.6rem;
    font-family: var(--ui-font);
    max-width: none;
}

.settings-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.setting {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.92rem;
    font-family: var(--ui-font);
}

.setting>span {
    display: flex;
    justify-content: space-between;
    color: var(--text);
    font-weight: 500;
}

.setting>span em {
    color: var(--gold);
    font-style: normal;
    font-weight: 700;
}

.setting input[type="range"] {
    width: 100%;
    cursor: pointer;
    accent-color: var(--navy);
}

[data-theme="dark"] .setting input[type="range"] {
    accent-color: var(--gold);
}

.setting select {
    font-family: inherit;
    font-size: 0.92rem;
    padding: 0.5rem 0.65rem;
    max-width: none;
    text-overflow: clip;
    overflow: visible;
}

.reset-btn {
    margin-top: 0.5rem;
    font-family: var(--ui-font);
    font-size: 0.9rem;
    padding: 0.6rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    max-width: none;
}

.reset-btn:hover {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

[data-theme="dark"] .reset-btn:hover {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--navy-dark);
}

/* ============================================================
   About panel
   ============================================================ */
.about-body {
    font-family: var(--ui-font);
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--text-soft);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.about-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.about-title {
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -0.01em;
}

[data-theme="dark"] .about-title {
    color: var(--gold);
}

.about-title .bible {
    font-weight: 400;
    opacity: 0.65;
}

.about-tagline {
    text-align: center;
    font-style: italic;
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: -0.75rem;
}

.about-section {
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.about-section h3 {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.about-section p {
    margin-bottom: 0.65rem;
}

.about-section p:last-child {
    margin-bottom: 0;
}

.about-section strong {
    color: var(--text);
    display: block;
    margin-bottom: 0.15rem;
}

.about-section a {
    color: var(--navy);
    text-decoration: none;
    font-weight: 600;
    word-break: break-word;
}

.about-section a:hover {
    text-decoration: underline;
}

[data-theme="dark"] .about-section a {
    color: var(--gold);
}

/* ============================================================
   Install banner
   ============================================================ */
.install-banner {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    max-width: 480px;
    margin: 0 auto;
    background: var(--navy);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 1rem 1.2rem;
    box-shadow: var(--shadow-lg);
    z-index: 250;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    animation: slideUp 0.35s ease;
}

.install-banner.hidden {
    display: none;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.install-banner-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.install-banner-text {
    flex: 1;
    font-family: var(--ui-font);
    font-size: 0.88rem;
    line-height: 1.35;
}

.install-banner-text strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}

.install-banner-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.install-banner-actions button {
    font-size: 0.8rem;
    padding: 0.4rem 0.7rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    max-width: none;
}

.install-banner .btn-install {
    background: var(--gold);
    color: var(--navy-dark);
}

.install-banner .btn-install:hover {
    background: var(--gold-light);
    color: var(--navy-dark);
}

.install-banner .btn-dismiss {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.install-banner .btn-dismiss:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: var(--navy);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-family: var(--ui-font);
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 300;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
    max-width: 90vw;
}

.toast.hidden {
    display: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-8px);
}

[data-theme="dark"] .toast {
    background: var(--gold);
    color: var(--navy-dark);
}

/* ============================================================
   Responsive — mobile tweaks
   ============================================================ */
@media (max-width: 500px) {
    main#reader {
        padding: 1.5rem 1rem;
    }

    #home {
        padding: 1.5rem 1rem 3rem;
    }

    .home-logo {
        width: 76px;
        height: 76px;
    }

    .home-title {
        font-size: 1.6rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .brand-name {
        font-size: 1rem;
    }

    .brand-logo {
        width: 26px;
        height: 26px;
    }

    .verse.bookmarked::before {
        left: -1.05rem;
        font-size: 0.7rem;
    }

    .verse-toolbar {
        padding: 0.3rem 0.4rem;
        gap: 0.2rem;
    }

    .vt-color {
        width: 18px;
        height: 18px;
    }

    .bookmarks-panel,
    .settings-panel,
    .about-panel {
        max-width: 100%;
    }

    .icon-btn {
        width: 34px;
        height: 34px;
    }

    .icon-btn .icon {
        width: 18px;
        height: 18px;
    }

    .header-row-2 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        gap: 0.25rem;
    }

    .search-inline {
        min-width: 90px;
        padding: 0 0.3rem 0 1.4rem;
    }

    .search-inline .search-icon {
        left: 0.4rem;
        width: 12px;
        height: 12px;
    }

    .search-inline input {
        font-size: 0.75rem;
    }

    select {
        font-size: 0.72rem;
        padding: 0.32rem 0.4rem;
    }

    #translationSelect {
        max-width: 52px;
    }

    #bookSelect {
        max-width: 65px;
    }

    #chapterSelect {
        max-width: 44px;
    }

    .nav-btn {
        width: 26px;
        height: 26px;
        max-width: 26px;
    }

    .nav-btn .icon {
        width: 12px;
        height: 12px;
    }
}