/* ==========================================================================
   DARK THEME  (applies only when <html data-theme="dark">, see includes/theme_head.php)
   Palette taken from Edge's forced-dark rendering, with explicit colours where that
   algorithm loses meaning (highlights, header, buttons).
   Most UI colours are inline styles (render.php, scripts-rog.js), hence the !important
   and the [style*=...] selectors.
   ========================================================================== */

html[data-theme="dark"] {
    color-scheme: dark;
    --d-bg: #111111;
    --d-surface: #1c1c1c;
    --d-surface-2: #242424;
    --d-border: #3a3a3a;
    --d-text: #e6e6e6;
    --d-muted: #a0a0a0;
    --d-link: #8ab4ff;
    --d-strong: #9fa8ff;
    --d-ro: #f0665a;
    --d-accent: #3d6fa5;
    --d-mark: #f5c518;
    --d-mark-soft: #2e2810;
}

/* ---- Page ---- */
html[data-theme="dark"],
html[data-theme="dark"] body {
    background: var(--d-bg) !important;
    color: var(--d-text) !important;
}
:where(html[data-theme="dark"]) a { color: var(--d-link); } /* zero extra specificity: class colours win */
html[data-theme="dark"] hr { border-color: var(--d-border); }
html[data-theme="dark"] ::placeholder { color: var(--d-muted); }

/* ---- Sticky header: darker blue (production) / darker red (COM), still distinguishable ---- */
html[data-theme="dark"] #sticky-header { background: #24456b !important; }
html[data-theme="dark"] #sticky-header[style*="E74C3C" i] { background: #7a2e26 !important; }

/* ---- Hamburger menu (markup: includes/hamburger_modal.php) ---- */
html[data-theme="dark"] .menu-content {
    background: var(--d-bg) !important;
    color: var(--d-text) !important;
}
html[data-theme="dark"] .menu-content .hamburger-title,
html[data-theme="dark"] .menu-content .menu-item,
html[data-theme="dark"] .menu-content .menu-votd-toggle .chevron,
html[data-theme="dark"] .menu-content .chevron { color: var(--d-text) !important; }
html[data-theme="dark"] .menu-content .menu-subitem { color: var(--d-muted) !important; }
html[data-theme="dark"] .menu-content .menu-item:hover,
html[data-theme="dark"] .menu-content .menu-item.active,
html[data-theme="dark"] .menu-content .menu-subitem:hover,
html[data-theme="dark"] .menu-content .menu-subitem.active { color: var(--d-link) !important; }
html[data-theme="dark"] .menu-content .hamburger-version { color: var(--d-muted) !important; }
html[data-theme="dark"] .menu-content .menu-separator { border-top-color: var(--d-border) !important; }
html[data-theme="dark"] .menu-content a { background: transparent !important; }

/* ---- Generic buttons / inputs ---- */
html[data-theme="dark"] button:not([class]) {
    background: var(--d-surface-2);
    color: var(--d-text);
    border-color: var(--d-border);
}
html[data-theme="dark"] button:not([class]):hover { background: #333; }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: var(--d-surface);
    color: var(--d-text);
    border-color: var(--d-border);
}
/* Header buttons keep their transparent/white-outline look */
html[data-theme="dark"] #sticky-header button,
html[data-theme="dark"] #sticky-header select,
html[data-theme="dark"] #sticky-header input {
    background-color: transparent;
    color: #fff;
}

/* ---- Reader: interlinear verses ---- */
html[data-theme="dark"] .rog-flex-verse { background: var(--d-surface); box-shadow: none; }
html[data-theme="dark"] .rog-flex-title { background: #1f2a3d; color: var(--d-text); }
html[data-theme="dark"] .rog-flex-ref,
html[data-theme="dark"] .rog-flex-strong,
html[data-theme="dark"] .rog-flex-strong a,
html[data-theme="dark"] .aba-strong,
html[data-theme="dark"] .aba-strong a { color: var(--d-strong) !important; }
html[data-theme="dark"] .rog-flex-greek,
html[data-theme="dark"] .aba-greek { color: var(--d-text) !important; }
html[data-theme="dark"] .rog-flex-romanian,
html[data-theme="dark"] .aba-ro { color: var(--d-ro) !important; }
html[data-theme="dark"] .rog-invert { background: var(--d-ro); color: #111; }
html[data-theme="dark"] .verse-ref-number:hover { color: var(--d-link); }
html[data-theme="dark"] .chapter-sticky-header { color: var(--d-text) !important; }
html[data-theme="dark"] .chapter-header-static { background: #3a3210 !important; color: var(--d-text) !important; outline: none !important; }
html[data-theme="dark"] .chapter-header-static * { outline: none !important; }

/* Legacy table layout */
html[data-theme="dark"] .verse-table-aba,
html[data-theme="dark"] .verse-table-aba tr,
html[data-theme="dark"] .verse-table-aba td { background: var(--d-surface) !important; color: var(--d-text) !important; }
html[data-theme="dark"] .verse-table-aba .aba-title-row td { color: var(--d-link) !important; border-bottom-color: var(--d-link) !important; }
html[data-theme="dark"] .verse-table-aba .aba-ref-cell { background: var(--d-surface-2) !important; color: var(--d-text) !important; border-right-color: var(--d-border) !important; }
html[data-theme="dark"] th { background-color: var(--d-surface-2); }

/* ---- Highlights: must stay visible on dark (Edge turned these into dim olive) ---- */
/* Selected verse: server-rendered inline gradient (#ffffcc), or set from JS, which the browser
   re-serializes as rgb(255, 255, 204) and adds .verse-highlighted */
html[data-theme="dark"] .rog-flex-verse[style*="ffffcc" i],
html[data-theme="dark"] .rog-flex-verse[style*="rgb(255, 255, 204)"],
html[data-theme="dark"] .rog-flex-verse.verse-highlighted {
    background: var(--d-mark-soft) !important;
    border-left: 4px solid var(--d-mark);
}
/* Strong number matched by a search (#ffff00 set from JS) */
html[data-theme="dark"] a[style*="rgb(255, 255, 0)"],
html[data-theme="dark"] mark[style*="rgb(255, 255, 0)"],
html[data-theme="dark"] mark {
    background: var(--d-mark) !important;
    color: #111 !important;
}
html[data-theme="dark"] .tts-highlight { background: #5c4a00 !important; color: #fff; }
/* Read-aloud: the verse being spoken (scripts-tts-step.js adds .tts-step-highlight and an inline #ffeeba) */
html[data-theme="dark"] .tts-step-highlight {
    background: #4a3a10 !important;
    color: #fff !important;
    border-left: 4px solid var(--d-mark);
}
html[data-theme="dark"] .noutati-diff-highlight { background: #5c4a00; color: #fff; }

/* ---- Strong's / note modals ---- */
html[data-theme="dark"] .strongid-modal-instance {
    background: rgba(17,17,17,0.98) !important;
    border-color: var(--d-accent) !important;
}
html[data-theme="dark"] .modal-caption-fixed {
    background: var(--d-surface) !important;
    border-bottom-color: var(--d-accent) !important;
}
html[data-theme="dark"] .modal-caption-fixed,
html[data-theme="dark"] .modal-caption-fixed * { color: var(--d-link) !important; }
html[data-theme="dark"] .modal-footer-fixed {
    background: var(--d-bg) !important;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.4) !important;
}
html[data-theme="dark"] #modalUnifiedModalContent,
html[data-theme="dark"] #modalRoNoteClickText,
html[data-theme="dark"] .modal-prefs-content,
html[data-theme="dark"] .modal-ro-note-content {
    background: var(--d-bg) !important;
    color: var(--d-text) !important;
    box-shadow: none;
}
html[data-theme="dark"] .strongid-modal-instance [style*="background:#fff"],
html[data-theme="dark"] .strongid-modal-instance [style*="background: #fff"],
html[data-theme="dark"] .modal-prefs-content [style*="background:#fff;"] {
    background: var(--d-bg) !important;
}
html[data-theme="dark"] .strongid-modal-instance [style*="color:#666"],
html[data-theme="dark"] .strongid-modal-instance [style*="color:#555"],
html[data-theme="dark"] .strongid-modal-instance [style*="color:#333"],
html[data-theme="dark"] .strongid-modal-instance [style*="color:#999"] { color: var(--d-muted) !important; }
html[data-theme="dark"] .strongid-modal-instance [style*="color:#337ab7"],
html[data-theme="dark"] .strongid-modal-instance [style*="color:#4a90e2"] { color: var(--d-link) !important; }
html[data-theme="dark"] .strongid-modal-instance [style*="border-top"] { border-color: var(--d-border) !important; }
/* Bright action buttons: calmer on dark */
html[data-theme="dark"] .strongid-modal-instance [style*="background:#337ab7"] { background: var(--d-accent) !important; color: #fff !important; }
html[data-theme="dark"] .strongid-modal-instance [style*="background:#28a745"],
html[data-theme="dark"] .strong-copy-btn,
html[data-theme="dark"] .note-copy-btn { background: #2d7a45 !important; color: #fff !important; }
html[data-theme="dark"] .strong-search-btn { background: var(--d-accent) !important; color: #fff !important; }
html[data-theme="dark"] .modal-prefs-content label,
html[data-theme="dark"] .modal-prefs-content label span { color: var(--d-text) !important; }
html[data-theme="dark"] .modal-prefs-content [style*="color:#444"] { color: var(--d-muted) !important; }
html[data-theme="dark"] .modal-prefs-content button { background: var(--d-surface-2) !important; color: var(--d-text) !important; }
html[data-theme="dark"] .modal-prefs-content [style*="#fff3cd"] { background: #3a3210 !important; border-color: #8a6d00 !important; color: #f0d36a !important; }
html[data-theme="dark"] .modal-scroll-slider { background: rgba(255,255,255,0.12); }
html[data-theme="dark"] .modal-scroll-track { background: #444; }

/* ---- Welcome modal, context menu, copy-range modal ---- */
html[data-theme="dark"] .verse-context-menu,
html[data-theme="dark"] .copy-range-modal { background: var(--d-bg); color: var(--d-text); }
/* Welcome / news modals: content (config/welcome_modal*.php) is pastel callouts with dark text,
   so the card stays light in dark mode; inline-style text colours would be unreadable otherwise. */
html[data-theme="dark"] .welcome-modal-content { color: #222 !important; }
html[data-theme="dark"] .welcome-modal-content .modal-header { background: #24456b; }
html[data-theme="dark"] .welcome-modal-content .modal-footer { border-top-color: var(--d-border); }
html[data-theme="dark"] .verse-context-menu .menu-item { background: var(--d-bg); border-bottom-color: var(--d-border); }
html[data-theme="dark"] .verse-context-menu .menu-item .label { color: var(--d-text); }
html[data-theme="dark"] .verse-context-menu .menu-item:hover:not(.disabled) { background: var(--d-surface-2); }
html[data-theme="dark"] .verse-context-menu .menu-item .badge { background: #1f2a3d; color: var(--d-link); }
html[data-theme="dark"] .copy-range-modal .modal-footer { background: var(--d-surface); border-top-color: var(--d-border); }
html[data-theme="dark"] .copy-range-instruction,
html[data-theme="dark"] .verse-num,
html[data-theme="dark"] .verse-text { color: var(--d-text); }
html[data-theme="dark"] .verse-item { border-bottom-color: var(--d-border); }
html[data-theme="dark"] .verse-item:hover { background: var(--d-mark-soft); }
html[data-theme="dark"] .verse-item.start-verse { background: #16301c; }
html[data-theme="dark"] .verse-item.in-range { background: #1a2433; }
html[data-theme="dark"] .verse-item.end-verse { background: #14293d; }
html[data-theme="dark"] .copy-range-modal .btn-cancel { background: var(--d-surface-2); color: var(--d-text); }

/* ---- Footer ---- */
html[data-theme="dark"] .chapter-footer { background: var(--d-bg) !important; border-top-color: var(--d-border); }
html[data-theme="dark"] .lang-select-label { color: var(--d-muted); }
html[data-theme="dark"] .lang-select { background: var(--d-surface-2); border-color: var(--d-border); color: var(--d-text); }
html[data-theme="dark"] .lang-select:hover { background: #333; border-color: #555; }
html[data-theme="dark"] .beta-notice { background: #2b2113 !important; border-color: #8a5a00 !important; }
html[data-theme="dark"] .beta-notice [style*="e65100" i] { color: #ffb74d !important; }
html[data-theme="dark"] .beta-notice [style*="color: #666"],
html[data-theme="dark"] .beta-notice [style*="color:#666"] { color: var(--d-muted) !important; }
html[data-theme="dark"] .beta-notice a { color: #ffa040 !important; }
html[data-theme="dark"] .chapter-footer-nav { background: var(--d-bg); border-top-color: var(--d-border); }
html[data-theme="dark"] .chapter-footer-copyright { background: var(--d-surface); border-top-color: var(--d-border); color: var(--d-muted); }
html[data-theme="dark"] .footer-about-title { color: var(--d-text); }
html[data-theme="dark"] .footer-about-content { color: #c4c4c4; }
html[data-theme="dark"] .footer-about-note,
html[data-theme="dark"] .footer-about-note em { color: var(--d-muted); }
html[data-theme="dark"] .chapter-footer-nav a { color: var(--d-link); }
html[data-theme="dark"] .footer-about-link a { background: var(--d-accent); }

/* ==========================================================================
   PAGE: Noutăți  (noutati.php inline <style> + data/noutati/*.release.html)
   ========================================================================== */
html[data-theme="dark"] .noutati-intro,
html[data-theme="dark"] .noutati-count,
html[data-theme="dark"] .noutati-release-summary { color: #b4b4b4; }
html[data-theme="dark"] .noutati-release-date,
html[data-theme="dark"] .noutati-empty,
html[data-theme="dark"] .noutati-no-releases,
html[data-theme="dark"] .noutati-diff-title { color: var(--d-muted); }
html[data-theme="dark"] .noutati-release { background: var(--d-surface); border-color: var(--d-border); }
html[data-theme="dark"] .noutati-release-link { color: var(--d-link); border-color: var(--d-accent); }
html[data-theme="dark"] .noutati-release-link:hover { background: var(--d-accent); color: #fff; }
html[data-theme="dark"] .noutati-book-title { border-bottom-color: var(--d-border); }
html[data-theme="dark"] .noutati-verse-item { border-bottom-color: var(--d-border); }
html[data-theme="dark"] .noutati-verse-ref { color: var(--d-link); }
html[data-theme="dark"] .noutati-verse-accounted .noutati-verse-ref { color: #7f9cc4; }
html[data-theme="dark"] .noutati-rogth-badge { color: var(--d-muted); background: var(--d-surface-2); border-color: var(--d-border); }
html[data-theme="dark"] .noutati-book-nav { background: var(--d-surface); border-color: var(--d-border); }
html[data-theme="dark"] .noutati-book-nav-btn { color: var(--d-link); background: var(--d-surface-2); border-color: var(--d-border); }
html[data-theme="dark"] .noutati-book-nav-btn:hover { background: #1f2a3d; }
html[data-theme="dark"] .noutati-changed-entry { border-color: var(--d-border); }
html[data-theme="dark"] .noutati-changed-ref { background: var(--d-surface-2); border-bottom-color: var(--d-border); }
html[data-theme="dark"] .noutati-diff-nou { background: #12261a; border-bottom-color: #1f4a2a; }
html[data-theme="dark"] .noutati-diff-vechi { background: #2a1f14; }
html[data-theme="dark"] .noutati-diff-label--nou { color: #7bd88f; }
html[data-theme="dark"] .noutati-diff-label--vechi { color: #e0a070; }
html[data-theme="dark"] .noutati-diff-text--vechi { color: #cdb8a6; }
html[data-theme="dark"] .noutati-diff-deleted { background: #5a2f14; color: #fff; }
html[data-theme="dark"] .noutati-error { color: #ff8a80; background: #3a1a1a; border-color: #6b2b2b; }
html[data-theme="dark"] .noutati-float-fontsize,
html[data-theme="dark"] .votd-float-fontsize { background: rgba(30,30,30,0.95); }
html[data-theme="dark"] .noutati-float-fontsize button,
html[data-theme="dark"] .votd-float-fontsize button { color: var(--d-link); background: transparent; }
html[data-theme="dark"] .noutati-float-fontsize button:active,
html[data-theme="dark"] .votd-float-fontsize button:active { background: #1f2a3d; }
/* Inline colours inside the release HTML: reds/blues/black used for Greek/Romanian words */
html[data-theme="dark"] .noutati-page [style*="d30000" i],
html[data-theme="dark"] .noutati-page [style*="9a0000" i] { color: var(--d-ro) !important; }
html[data-theme="dark"] .noutati-page [style*="032cfc" i] { color: var(--d-link) !important; }
html[data-theme="dark"] .noutati-page [style*="color:#000"],
html[data-theme="dark"] .noutati-page [style*="color: #000"] { color: var(--d-text) !important; }

/* ==========================================================================
   PAGE: Mana zilei / VOTD  (assets/style-votd.css, style-votd-modal.css)
   The modal rules in style-votd-modal.css reuse the reader's classes, already covered above.
   ========================================================================== */
html[data-theme="dark"] body.votd-page { background: var(--d-bg); }
html[data-theme="dark"] .nav-btn { background: var(--d-surface-2); color: var(--d-text); border-color: var(--d-border); }
html[data-theme="dark"] .nav-btn:hover { background: #333; border-color: #4a4a4a; }
html[data-theme="dark"] .nav-btn.today { background: var(--d-accent); border-color: var(--d-accent); color: #fff; }
html[data-theme="dark"] .votd-content { background: var(--d-surface); }
html[data-theme="dark"] .votd-arhiva-entrypoint a,
html[data-theme="dark"] .votd-main-title,
html[data-theme="dark"] .verse-reference a,
html[data-theme="dark"] .related-verse { color: var(--d-link); }
html[data-theme="dark"] .votd-breadcrumbs,
html[data-theme="dark"] .votd-crumb-current { color: #8a9aa5; }
html[data-theme="dark"] .votd-breadcrumbs a,
html[data-theme="dark"] .votd-subtitle { color: #9fb3be; }
html[data-theme="dark"] .votd-crumb-sep { color: #555; }
html[data-theme="dark"] .votd-content section h2 { color: var(--d-text); }
html[data-theme="dark"] .votd-content section h3 { color: #c8c8c8; }
html[data-theme="dark"] .votd-content section p { color: #d0d0d0; }
html[data-theme="dark"] body.votd-page .verse-text { color: var(--d-text); background: linear-gradient(to right, #1c1c1c 0%, #232323 100%); }
html[data-theme="dark"] .verse-reference { color: #c8c8c8; }
html[data-theme="dark"] .verse-greek-clickable {
    background: linear-gradient(145deg, #1b2f4a 0%, #223a5a 50%, #2a4a70 100%);
    border-color: #3d6fa5; border-bottom-color: #4a82bd;
}
html[data-theme="dark"] .verse-greek-link:hover .verse-greek-clickable {
    background: linear-gradient(145deg, #223a5a 0%, #2a4a70 50%, #335a88 100%);
}
html[data-theme="dark"] .greek-header h2 { color: #9ec5ff; }
html[data-theme="dark"] .greek-click-icon,
html[data-theme="dark"] .greek-hint,
html[data-theme="dark"] .verse-greek-link:hover .greek-click-icon { color: var(--d-link); }
html[data-theme="dark"] .greek-text { color: #dbe4ec; }
html[data-theme="dark"] .votd-commentary p { background: #1f1f1f; color: #d0d0d0; }
html[data-theme="dark"] .votd-teaching .teaching-content { background: #2b2210; }
html[data-theme="dark"] .votd-teaching .teaching-content h3 { color: #ffb74d; }
html[data-theme="dark"] .votd-teaching .teaching-content p { color: #d8d8d8; }
html[data-theme="dark"] .votd-teaching .teaching-content strong { color: #ff8a65; }
html[data-theme="dark"] .votd-teaching .teaching-content em { color: #b4b4b4; }
html[data-theme="dark"] .votd-meditation p { background: #16273a; color: #d0d0d0; }
html[data-theme="dark"] .votd-prayer p { background: #2a1a2e; color: #d0d0d0; }
html[data-theme="dark"] .votd-quote blockquote { background: #2b2113; color: #d8d8d8; }
html[data-theme="dark"] .related-verses-list li { background: var(--d-surface-2); }
html[data-theme="dark"] .related-verses-list li:hover { background: #2e2e2e; }
html[data-theme="dark"] .video-info,
html[data-theme="dark"] .playlist-progress,
html[data-theme="dark"] .song-channel { color: var(--d-muted); }
html[data-theme="dark"] .song-card { background: var(--d-surface-2); }
html[data-theme="dark"] .song-title { color: var(--d-text); }
html[data-theme="dark"] .calendar-link { background: #2b2113; color: var(--d-text); }
html[data-theme="dark"] .noutati-page [style*="color:#555"],
html[data-theme="dark"] .noutati-page [style*="color: #555"],
html[data-theme="dark"] .noutati-page [style*="color:#666"],
html[data-theme="dark"] .noutati-page [style*="color:#888"] { color: #b4b4b4 !important; }

/* ==========================================================================
   Shared helpers for the remaining pages (inline colour utilities used in markup)
   ========================================================================== */
html[data-theme="dark"] .help-float-fontsize,
html[data-theme="dark"] .descarcari-float-fontsize { background: rgba(30,30,30,0.95); }
html[data-theme="dark"] .help-float-fontsize button,
html[data-theme="dark"] .descarcari-float-fontsize button { color: var(--d-link); background: transparent; }
html[data-theme="dark"] .carti-page-body [style*="color:#336699"],
html[data-theme="dark"] .descarcari-page-body [style*="color:#336699"] { color: var(--d-link) !important; }
html[data-theme="dark"] .carti-page-body [style*="color:#444"],
html[data-theme="dark"] .carti-page-body [style*="color:#666"],
html[data-theme="dark"] .descarcari-page-body [style*="color:#444"],
html[data-theme="dark"] .descarcari-page-body [style*="color:#666"] { color: #b4b4b4 !important; }
html[data-theme="dark"] .descarcari-page-body [style*="color:#999"] { color: var(--d-muted) !important; }
html[data-theme="dark"] .descarcari-page-body [style*="color:#d30000"] { color: var(--d-ro) !important; }

/* ---- PAGE: Despre (despre.php) ---- */
html[data-theme="dark"] .despre-page { background: var(--d-bg); }
html[data-theme="dark"] .despre-container,
html[data-theme="dark"] .top-controls { background: var(--d-surface); box-shadow: none; }
html[data-theme="dark"] .despre-content { color: #d8d8d8; }
html[data-theme="dark"] .despre-content h1,
html[data-theme="dark"] .despre-content h2,
html[data-theme="dark"] .despre-content h3 { color: var(--d-text); }
html[data-theme="dark"] .despre-content h4 { color: #cfd8dc; }
html[data-theme="dark"] .despre-content h2 { border-bottom-color: var(--d-border); }
html[data-theme="dark"] .despre-content .last-updated { color: var(--d-muted); }
html[data-theme="dark"] .despre-content a { color: var(--d-strong); }
html[data-theme="dark"] .despre-content .highlight { background: #2b2610; }
html[data-theme="dark"] .despre-content table { background: var(--d-surface-2); }
html[data-theme="dark"] .despre-content .note { color: #5fd35a; }
html[data-theme="dark"] .despre-lang-select { background: var(--d-surface-2); border-color: var(--d-border); color: var(--d-text); }
html[data-theme="dark"] .despre-lang-select:hover { background: #333; border-color: #555; }
html[data-theme="dark"] .control-btn,
html[data-theme="dark"] .despre-close-fixed { background: var(--d-accent); color: #fff; }
html[data-theme="dark"] .control-btn.close-btn { background: #b02a37; }

/* ---- PAGE: Cum se face (help.php) ---- */
html[data-theme="dark"] .hero-section { background: #2b2610; box-shadow: none; }
html[data-theme="dark"] .hero-section h1,
html[data-theme="dark"] .tutorial-title,
html[data-theme="dark"] .platform-instruction strong,
html[data-theme="dark"] .video-info h2 { color: var(--d-link); }
html[data-theme="dark"] .hero-section p,
html[data-theme="dark"] .tutorial-description,
html[data-theme="dark"] .platform-instruction,
html[data-theme="dark"] .video-info p { color: #b4b4b4; }
html[data-theme="dark"] .platform-desktop strong { color: #d4a373; }
html[data-theme="dark"] .tutorial-card { background: var(--d-surface); box-shadow: none; border: 1px solid var(--d-border); }
html[data-theme="dark"] .tutorial-thumbnail { background: #2a2a2a; }
html[data-theme="dark"] .video-modal-content { background: var(--d-surface); }
html[data-theme="dark"] .close-button { background: var(--d-accent); }

/* ---- PAGE: Dicționar (dictionary.php) ---- */
html[data-theme="dark"] .under-construction { background: var(--d-surface); box-shadow: none; }
html[data-theme="dark"] .under-construction h1 { color: var(--d-link); }
html[data-theme="dark"] .under-construction p { color: #b4b4b4; }
html[data-theme="dark"] .under-construction .back-link { background: var(--d-accent); color: #fff; }

/* ---- PAGES: Cărțile Bibliei (carti.php) + Descărcări (descarcari.php) ---- */
html[data-theme="dark"] .section-card { background: var(--d-surface); box-shadow: none; border: 1px solid var(--d-border); }
html[data-theme="dark"] .section-card h2,
html[data-theme="dark"] .section-card h3,
html[data-theme="dark"] .share-link-btn { color: var(--d-link); }
html[data-theme="dark"] .section-card h4 { color: #c8c8c8; }
html[data-theme="dark"] .section-card p,
html[data-theme="dark"] .section-card ul,
html[data-theme="dark"] .section-card li { color: #cfcfcf; }
html[data-theme="dark"] .carti-book-link,
html[data-theme="dark"] .carti-chapter-link { background: #1f2a3d; color: var(--d-link); }
html[data-theme="dark"] .carti-book-link:hover,
html[data-theme="dark"] .carti-chapter-link:hover { background: var(--d-accent); color: #fff; }
html[data-theme="dark"] .grace-notice { background: #2b2610; color: var(--d-text); }
html[data-theme="dark"] code { background: #2a2a2a; color: var(--d-text); }
html[data-theme="dark"] .pdf-category-books { background: var(--d-surface); }
html[data-theme="dark"] .pdf-book-cell a { color: var(--d-link); }
html[data-theme="dark"] .pdf-book-cell.published { background: #16273a; border-color: #1f3d63; }
html[data-theme="dark"] .pdf-book-cell.published:hover { background: #1f3d63; }
html[data-theme="dark"] .pdf-book-cell.pending { background: #1f1f1f; border-color: #333; color: #777; }
html[data-theme="dark"] .pdf-book-cell .pub-date { color: var(--d-muted); }

/* ---- PAGE: Caută (cauta.php) ---- */
html[data-theme="dark"] .cauta-form input[type="search"] { border-color: var(--d-border); }
html[data-theme="dark"] .cauta-form .cauta-history-btn { background: #1f2a3d; color: var(--d-link); border-color: var(--d-accent); }
html[data-theme="dark"] .cauta-history-list { background: var(--d-surface); border-color: var(--d-border); }
html[data-theme="dark"] .cauta-history-item,
html[data-theme="dark"] .cauta-history-clear,
html[data-theme="dark"] .cauta-history-empty { background: var(--d-surface); color: var(--d-text); border-bottom-color: var(--d-border); }
html[data-theme="dark"] .cauta-opt select { background: var(--d-surface-2); color: var(--d-text); border-color: var(--d-border); }
html[data-theme="dark"] .cauta-hint > summary,
html[data-theme="dark"] .cauta-chunk-toggle,
html[data-theme="dark"] .cauta-chunk-link { color: var(--d-link); }
html[data-theme="dark"] .cauta-error { background: #3a1a1a; color: #ff8a80; border-color: #6b2b2b; }
html[data-theme="dark"] .cauta-scroll-slider { background: rgba(255,255,255,0.12); }
html[data-theme="dark"] .cauta-back-to-top { background: var(--d-accent); }

/* ---- PAGE: Arhiva Mana zilei (votd_arhiva.php) ---- */
html[data-theme="dark"] .votd-arhiva-intro { color: #b4b4b4; }
html[data-theme="dark"] .votd-arhiva-section-title { color: var(--d-link); border-bottom-color: var(--d-border); }
html[data-theme="dark"] .votd-arhiva-item { border-bottom-color: var(--d-border); }
html[data-theme="dark"] .votd-arhiva-item a,
html[data-theme="dark"] .votd-arhiva-month-nav a,
html[data-theme="dark"] .votd-arhiva-back-link { color: var(--d-link); }
html[data-theme="dark"] .votd-arhiva-item-meta,
html[data-theme="dark"] .votd-arhiva-month-count { color: var(--d-muted); }
html[data-theme="dark"] .votd-arhiva-month-link { border-color: var(--d-border); color: var(--d-link); background: var(--d-surface-2); }
html[data-theme="dark"] .votd-arhiva-month-link:hover { background: #1f2a3d; }
html[data-theme="dark"] .votd-arhiva-year-title { color: #c8c8c8; }

/* ==========================================================================
   Fix round 3
   ========================================================================== */

/* ---- Descărcări / PDF pages: inline-coloured callout boxes ---- */
html[data-theme="dark"] .download-notice[style*="fdf6e3" i] { background: #2b2610 !important; }
html[data-theme="dark"] .download-notice[style*="eef6ff" i] { background: #16273a !important; }
html[data-theme="dark"] .download-notice { color: var(--d-text); }
html[data-theme="dark"] .download-notice [style*="color:#444"],
html[data-theme="dark"] .download-notice [style*="color:#666"],
html[data-theme="dark"] .download-notice [style*="color:#555"] { color: #cfcfcf !important; }

/* ---- Despre: hand-made interlinear demo tables (data/rog_about_*.html) ----
   Each table has an inline white background; their cell text inherits the page colour. */
html[data-theme="dark"] .despre-content table {
    background: var(--d-surface-2) !important;
    color: var(--d-text);
}
html[data-theme="dark"] .despre-content table font[color*="D30000" i],
html[data-theme="dark"] .despre-content table [style*="#D30000" i] { color: var(--d-ro) !important; }
html[data-theme="dark"] .despre-content table font[color*="032cfc" i],
html[data-theme="dark"] .despre-content table [style*="#032cfc" i] { color: #8ab4ff !important; }
html[data-theme="dark"] .despre-content table [style*="color:#000"] { color: var(--d-text) !important; }
html[data-theme="dark"] .despre-content font[color*="D30000" i] { color: var(--d-ro) !important; }
html[data-theme="dark"] .despre-content font[color*="032cfc" i] { color: #8ab4ff !important; }
html[data-theme="dark"] .despre-content font[color*="2ecc23" i] { color: #5fd35a !important; }

/* ---- Caută: collapsible hint + search-term highlight on plain-text Bibles ---- */
html[data-theme="dark"] .cauta-hint { color: var(--d-muted); }
html[data-theme="dark"] .cauta-hint > summary {
    background: #1f2a3d;
    border-color: var(--d-accent);
    color: var(--d-link);
}
html[data-theme="dark"] .cauta-hint > summary:hover { background: #26344d; }
/* scripts-cauta.js wraps the match in a <span style="background-color:#ffff00"> */
html[data-theme="dark"] span[style*="rgb(255, 255, 0)"],
html[data-theme="dark"] span[style*="#ffff00" i] {
    background: var(--d-mark) !important;
    color: #111 !important;
}

/* ---- One-time attention pulse on the header moon button (class added by includes/theme_head.php).
   Not gated on data-theme: first-time visitors on a light phone are the audience. ---- */
/* The header scrolls horizontally (overflow-x:auto), which also clips vertically, so the ring can be
   cut off: the scale + opacity change stays visible even then. */
@keyframes themePulse {
    0%   { box-shadow: 0 0 0 0 rgba(255,255,255,0.85); transform: scale(1);    opacity: 1; }
    50%  { transform: scale(1.18); opacity: 1; }
    70%  { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,255,255,0);    transform: scale(1);    opacity: 0.6; }
}
#themeToggle.theme-pulse { animation: themePulse 1.7s ease-out 6; } /* 6 x 1.7s = ~10 s */
@media (prefers-reduced-motion: reduce) {
    #themeToggle.theme-pulse { animation: none; }
}

/* ==========================================================================
   Fix round 4: reader floating font control + passage-selector modal
   ========================================================================== */

/* Reader floating A▲/A▼ control (render-nav.css): white box + light text was invisible */
html[data-theme="dark"] .mobile-float-fontsize { background: rgba(30,30,30,0.95); }
html[data-theme="dark"] .mobile-float-fontsize button { color: var(--d-link); background: transparent; }
html[data-theme="dark"] .mobile-float-fontsize button:active { background: #1f2a3d; }

/* Passage selector modal (render.php #passageSelectorModal, lists filled by render-nav.js) */
html[data-theme="dark"] .modal-passage-content {
    background: var(--d-bg) !important;
    color: var(--d-text) !important;
    box-shadow: none !important;
}
html[data-theme="dark"] #modalPassageCaption { color: var(--d-text); }
html[data-theme="dark"] .modal-passage-content [style*="background:#fafafa"] { background: var(--d-surface) !important; }
html[data-theme="dark"] .modal-passage-content .modal-list-item { color: var(--d-text); }
html[data-theme="dark"] .modal-passage-content .modal-list-item.selected {
    background: #1f3d63 !important;
    color: #cfe3ff !important;
}
html[data-theme="dark"] #modalRefInput {
    background: var(--d-surface) !important;
    color: var(--d-text) !important;
    border-color: var(--d-border) !important;
}
html[data-theme="dark"] #modalRefHistory {
    background: var(--d-surface-2) !important;
    color: var(--d-link) !important;
    border-color: var(--d-accent) !important;
}
html[data-theme="dark"] #modalRefHistoryList {
    background: var(--d-surface) !important;
    border-color: var(--d-border) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.6) !important;
}
html[data-theme="dark"] #modalRefHistoryList button { color: var(--d-text) !important; border-top-color: var(--d-border) !important; }
html[data-theme="dark"] #modalRefOk,
html[data-theme="dark"] #passageModalConfirm { background: var(--d-accent) !important; color: #fff !important; }
html[data-theme="dark"] #passageModalCancel {
    background: var(--d-surface-2) !important;
    color: var(--d-text) !important;
    border: 1px solid var(--d-border) !important;
}

/* Passage selector, round 2: render-nav.css forces light colours with !important, so these must too */
html[data-theme="dark"] .modal-passage-content label,
html[data-theme="dark"] .modal-passage-content #modalPassageCaption,
html[data-theme="dark"] #modalPassageCaption { color: var(--d-text) !important; }
html[data-theme="dark"] .modal-passage-content .modal-list-item {
    background: var(--d-surface) !important;
    color: var(--d-text) !important;
}
html[data-theme="dark"] .modal-passage-content .modal-list-item.selected {
    background: #1f3d63 !important;
    color: #cfe3ff !important;
}
html[data-theme="dark"] .modal-passage-content #modalDirectList,
html[data-theme="dark"] .modal-passage-content #modalBookList,
html[data-theme="dark"] .modal-passage-content #modalChapterList,
html[data-theme="dark"] .modal-passage-content #modalVerseList {
    background: var(--d-surface) !important;
    scrollbar-color: #555 var(--d-surface);
}
html[data-theme="dark"] #modalBookList::-webkit-scrollbar,
html[data-theme="dark"] #modalChapterList::-webkit-scrollbar,
html[data-theme="dark"] #modalVerseList::-webkit-scrollbar { background: var(--d-surface); }
html[data-theme="dark"] #modalBookList::-webkit-scrollbar-thumb,
html[data-theme="dark"] #modalChapterList::-webkit-scrollbar-thumb,
html[data-theme="dark"] #modalVerseList::-webkit-scrollbar-thumb { background: #555; }
/* Reference box: true black, like the search box on Caută */
html[data-theme="dark"] .modal-passage-content #modalRefInput {
    background: #000 !important;
    color: var(--d-text) !important;
    border: 1px solid #555 !important;
}

/* Caută: result-group links ("Exo 4:14 1-100 …") and their expand toggle had light-blue boxes */
html[data-theme="dark"] .cauta-chunk-link,
html[data-theme="dark"] .cauta-chunk-toggle { background: #1f2a3d; color: var(--d-link); }
html[data-theme="dark"] .cauta-chunk-link:hover,
html[data-theme="dark"] .cauta-chunk-toggle:hover { background: #26344d; }
