:root {
    --color-parchment: #f8f4ec;
    --color-ink: #2d1f14;
    --color-gold: #c8903a;
    --color-gold-light: #f0d090;
    --color-maroon-900: #3a0e0e;
    --color-maroon-800: #4a1212;
    --color-maroon-700: #6b1a1a;
    --color-maroon-600: #c52a2a;
    --color-maroon-500: #df4545;
    --color-maroon-400: #ec7070;
}

/* ── KB Loader ────────────────────────────────────────────── */
.kb-loader-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px 0;
}
.kb-loader {
    position: relative;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Outer spinning ring */
.kb-loader::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(200, 144, 58, 0.2);
    border-top-color: var(--color-gold);
    border-right-color: var(--color-maroon-700);
    animation: kbSpin 1s cubic-bezier(0.6, 0.2, 0.4, 0.8) infinite;
}
/* Inner pulse ring */
.kb-loader::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 1.5px solid rgba(200, 144, 58, 0.15);
    animation: kbPulse 1.8s ease-in-out infinite;
}
.kb-loader-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    animation: kbIconPulse 1.8s ease-in-out infinite;
    image-rendering: auto;
}
@keyframes kbSpin {
    to { transform: rotate(360deg); }
}
@keyframes kbPulse {
    0%, 100% { transform: scale(1);   opacity: 0.4; }
    50%       { transform: scale(1.1); opacity: 0.15; }
}
@keyframes kbIconPulse {
    0%, 100% { opacity: 1;    transform: scale(1); }
    50%       { opacity: 0.75; transform: scale(0.94); }
}
/* ─────────────────────────────────────────────────────────── */

html, body {
    font-family: Georgia, 'Times New Roman', serif;
    direction: rtl;
    height: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--color-parchment);
    color: var(--color-ink);
}

/* ── Bootstrap overrides ── */
.navbar {
    background-color: var(--color-maroon-900) !important;
    border-bottom: 2px solid var(--color-gold);
}

.navbar .nav-link,
.navbar .navbar-brand {
    color: var(--color-gold-light) !important;
    font-family: Georgia, serif;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: var(--color-gold) !important;
    text-decoration: underline;
}

.navbar .nav-link.active-nav-item {
    color: var(--color-gold) !important;
    font-weight: bold;
    text-decoration: underline;
}

.navbar-toggler {
    border-color: var(--color-gold) !important;
}

.navbar-toggler-icon {
    filter: brightness(0) saturate(100%) invert(75%) sepia(40%) saturate(500%) hue-rotate(5deg);
}

/* Cards / panels */
.card {
    background-color: #fffdf7 !important;
    border-color: rgba(200,144,58,0.35) !important;
}

.card-header {
    background-color: var(--color-maroon-900) !important;
    color: var(--color-gold-light) !important;
    border-bottom-color: var(--color-gold) !important;
}

/* Buttons */
.btn-primary,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--color-maroon-700) !important;
    border-color: var(--color-maroon-800) !important;
    color: #fff !important;
}

.btn-secondary,
.btn-secondary:hover {
    background-color: var(--color-maroon-800) !important;
    border-color: var(--color-maroon-900) !important;
    color: var(--color-gold-light) !important;
}

.btn-outline-primary {
    color: var(--color-maroon-700) !important;
    border-color: var(--color-maroon-700) !important;
}

.btn-outline-primary:hover {
    background-color: var(--color-maroon-700) !important;
    color: #fff !important;
}

/* Form controls */
.form-control,
.form-select {
    background-color: #fffdf7 !important;
    border-color: rgba(200,144,58,0.4) !important;
    color: var(--color-ink) !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-gold) !important;
    box-shadow: 0 0 0 0.2rem rgba(200,144,58,0.25) !important;
}

/* Tables */
.table {
    color: var(--color-ink) !important;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(200,144,58,0.06) !important;
}

/* Badges */
.badge.bg-primary {
    background-color: var(--color-maroon-700) !important;
}

/* Tabs */
.nav-tabs .nav-link.active {
    color: var(--color-maroon-700) !important;
    border-color: var(--color-gold) var(--color-gold) #fffdf7 !important;
    background-color: #fffdf7 !important;
}

.nav-tabs .nav-link {
    color: var(--color-ink) !important;
}

.nav-tabs .nav-link:hover {
    border-color: rgba(200,144,58,0.3) !important;
}

/* ── end Bootstrap overrides ── */

.popover-content {
    font-size: 12px;
    font-family: Arial;
}

h1:focus {
    outline: none;
}

p {
    margin-bottom: 0 !important;
}

.languages-dropdown {
    display: none;
}

.event:hover {
    text-decoration: underline;
}

.languages-dropdown-show {
    margin: 3px;
    position: fixed;
    background-color: var(--color-parchment);
    z-index: 1000;
    border: 1px solid var(--color-gold);
    border-radius: 3px;
    display: inline-block;
    padding: 5px;
}

.btn-primary {
    color: #fff;
    background-color: var(--color-maroon-700);
    border-color: var(--color-maroon-800);
}

.hand {
    cursor: pointer;
}

.center {
    text-align: center;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

.paragraph {
    max-width: 800px;
    margin-right: auto !important;
    margin-left: auto !important;
    border: 1px solid rgba(200,144,58,0.4);
    padding: 5px;
    border-radius: 3px;
}

#blazor-error-ui {
    background: var(--color-parchment);
    border-top: 2px solid var(--color-maroon-600);
    bottom: 0;
    box-shadow: 0 -1px 4px rgba(45,31,20,0.25);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: var(--color-maroon-800);
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }


.border {
    border: 1px solid rgba(200,144,58,0.4);
    border-radius: 3px;
    padding: 5px;
}

@font-face {
    font-family: "Athanasius";
    src: url("../Fonts/AT_____0.TTF") format("truetype");
}

@font-face {
    font-family: "Bwgrki";
    src: url('../Fonts/g2.TTF') format("truetype");
}

@font-face {
    font-family: "Hebrew";
    src: url('../Fonts/HEBREW.TTF') format("truetype");
}

@font-face {
    font-family: Ezra Sil, Ezra Sil SR, CODE2000, Times New Roman, times, serif;
}

.box {
    border: 1px solid rgba(200,144,58,0.35);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(45,31,20,0.1);
    background-color: #fffdf7;
    padding: 10px;
    margin-top: 10px;
    overflow: hidden;
}

.box hr {
    border: none;
    border-top: 1px solid rgba(200,144,58,0.3);
    margin: 8px 0;
}


.small-box {
    border: 1px solid rgba(200,144,58,0.4);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(45,31,20,0.1);
    background-color: #fffdf7;
    padding: 5px;
    margin: 5px;
}

.main-box {
    border: 1px solid rgba(200,144,58,0.4);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(45,31,20,0.1);
    background-color: #fffdf7;
    padding: 5px;
    margin-top: 10px;
}

.selected-box {
    background: var(--color-maroon-900);
    color: var(--color-gold-light) !important;
    border-color: var(--color-maroon-900) !important;
    box-shadow: 0 3px 10px rgba(58,14,14,0.35);
    font-weight: bold;
}
.selected-box img { opacity: 0.85; filter: brightness(1.3); }

/* ── Navigation pills (Study / Dictionary) ── */
.nav-pills-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 4px; }
.nav-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 16px; border-radius: 20px;
    font-size: 0.85rem; font-weight: 600; cursor: pointer;
    border: 1.5px solid rgba(200,144,58,0.4);
    background: #fffdf7; color: var(--color-maroon-900);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    user-select: none;
}
.nav-pill:hover { background: #f8f0e0; border-color: var(--color-gold); }
.nav-pill-active {
    background: var(--color-maroon-900) !important;
    color: var(--color-gold-light) !important;
    border-color: var(--color-maroon-900) !important;
    box-shadow: 0 2px 8px rgba(58,14,14,0.3);
}

/* ── KB panel (Bible page rounded boxes) ── */
.kb-panel {
    border: 1px solid rgba(200,144,58,0.35) !important;
    border-radius: 10px !important;
    background: #fffdf7;
    overflow: hidden;
}

.btn {
    font-size: 18px;
}

.form-control {
    font-size: 18px;
}

b, strong {
    font-weight: normal !important;
}

.btn-primary {
    background-color: var(--color-maroon-700) !important;
    border-color: var(--color-maroon-800) !important;
}

.btn-default {
    border-color: var(--color-gold) !important;
    background-color: var(--color-parchment);
    color: var(--color-ink);
}

.k-event, .k-task-complete {
    background: var(--color-gold) !important;
    color: #fff !important;
}

.k-scheduler-table .k-today, .k-today > .k-scheduler-datecolumn, .k-today > .k-scheduler-groupcolumn {
    background-color: rgba(200,144,58,0.15) !important;
}

.k-scheduler-timecolumn {
    display: none;
}

hr {
    margin-top: 5px !important;
    margin-bottom: 5px !important;
}

.flash {
    width: 600px !important;
    height: 600px !important;
}

@media screen and (max-width: 800px) {
    .flash {
        width: 400px;
        height: 400px;
    }
}

@media screen and (max-width: 700px) {

    .flash {
        width: 300px;
        height: 300px;
    }
}

@media screen and (max-width: 600px) {
    .flash {
        width: 100px;
        height: 100px;
    }
}


.menu-offline {
    background-color: var(--color-maroon-800);
    color: var(--color-gold-light);
}

    .menu-offline .selected .active {
        background-color: var(--color-maroon-700) !important;
        color: var(--color-gold-light);
        text-decoration: underline;
    }

.menu-online {
    background-color: var(--color-maroon-900);
    color: var(--color-gold-light);
}

    .menu-online .selected .active {
        background-color: var(--color-maroon-800) !important;
        color: var(--color-gold-light);
        text-decoration: underline;
    }

.active-nav-item {
    text-decoration: underline
}

.menu span {
    padding: 10px;
    display: inline-block;
}


.custom-label {
    font-weight: bold;
}

.day {
    font-weight: bold;
    color: #000000;
}

.border {
    border: 1px solid rgba(200,144,58,0.4);
    border-radius: 3px;
    padding: 5px;
}

@font-face {
    font-family: "Athanasius";
    src: url("../Fonts/AT_____0.TTF") format("truetype");
}

@font-face {
    font-family: "Bwgrki";
    src: url('../Fonts/g2.TTF') format("truetype");
}

@font-face {
    font-family: "Hebrew";
    src: url('../Fonts/HEBREW.TTF') format("truetype");
}

@font-face {
    font-family: Ezra Sil, Ezra Sil SR, CODE2000, Times New Roman, times, serif;
}

.book:hover {
    cursor: pointer;
    color: var(--color-maroon-600);
    text-decoration: underline;
}

.list-item {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(200,144,58,0.45);
    border-radius: 20px;
    background-color: #fffdf7;
    padding: 4px 14px;
    margin: 3px;
    font-size: 0.85rem;
    transition: background 0.15s, color 0.15s;
}

    .list-item:hover {
        cursor: pointer;
        color: var(--color-maroon-700);
        background-color: rgba(200,144,58,0.15);
    }

.list-item-selected {
    background: var(--color-maroon-900);
    color: var(--color-gold-light) !important;
    border-color: var(--color-maroon-900);
    font-weight: 600;
}

.downloaded {
    color: var(--color-gold);
}
.li-selected {
    border: 1px solid var(--color-gold);
    border-radius: 3px;
    box-shadow: 1px 1px 3px rgba(45,31,20,0.15);
    background-color: rgba(200,144,58,0.2);
    padding: 3px;
}

/* ── Bible Search redesign ───────────────────────────────── */
.bsearch-bar {
    padding: 14px 16px 12px;
    background: var(--bs-body-bg, #f8f4ec);
    border-bottom: 1px solid #e0d5c0;
    direction: rtl;
}
.bsearch-input {
    background: #fff;
    border: 2px solid #c9a84c;
    border-radius: 22px;
    padding: 8px 16px;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
    direction: rtl;
    outline: none;
    transition: border-color 0.15s;
}
.bsearch-input:focus { border-color: #3a0e0e; }
.bsearch-btn {
    background: #3a0e0e;
    color: #f0d080;
    border: none;
    border-radius: 22px;
    padding: 8px 22px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}
.bsearch-btn:hover { background: #5a1e1e; }
.bsearch-select {
    background: #fff;
    border: 1px solid #c9a84c;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    font-family: inherit;
    color: #3a0e0e;
    direction: rtl;
}
.bsearch-books-panel {
    background: #f0e8d5;
    border: 1px solid #d4c5a0;
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 10px;
}
.bsearch-books-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.bsearch-books-title { font-size: 13px; font-weight: bold; color: #3a0e0e; }
.bsearch-books-count { font-size: 11px; color: #888; font-weight: normal; margin-right: 4px; }
.bsearch-action-btn {
    border: 1px solid #c9a84c;
    border-radius: 10px;
    padding: 3px 12px;
    font-size: 11px;
    color: #3a0e0e;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    margin-right: 4px;
}
.bsearch-action-btn:hover { background: #f0e8d5; }
.bsearch-section-label {
    font-size: 10px;
    color: #888;
    margin-bottom: 4px;
    margin-top: 8px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 2px;
}
.bsearch-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.bsearch-chip {
    display: inline-block;
    border-radius: 12px;
    padding: 3px 11px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    border: none;
    transition: background 0.1s;
}
.bsearch-chip.on  { background: #3a0e0e; color: #f0d080; }
.bsearch-chip.off { background: #fff; border: 1px solid #c9a84c; color: #555; }
.bsearch-chip.off:hover { background: #f8f4ec; }
.bsearch-books-collapsed { max-height: 80px; overflow: hidden; }
.bsearch-collapse-btn {
    text-align: center;
    font-size: 11px;
    color: #888;
    margin-top: 8px;
    cursor: pointer;
    user-select: none;
}
.bsearch-collapse-btn:hover { color: #3a0e0e; }
.bsearch-results { padding: 12px 16px; direction: rtl; }
.bsearch-count { font-size: 14px; font-weight: bold; color: #3a0e0e; margin-bottom: 10px; }
.bsearch-badge {
    background: #3a0e0e;
    color: #f0d080;
    border-radius: 10px;
    padding: 1px 10px;
    font-size: 13px;
    margin-left: 6px;
}
.bsearch-card {
    background: #fff;
    border: 1px solid #e0d5c0;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    border-right: 4px solid #c9a84c;
    cursor: pointer;
    transition: box-shadow 0.15s;
    direction: rtl;
}
.bsearch-card:hover { box-shadow: 0 2px 10px rgba(58,14,14,0.1); }
.bsearch-card.expanded { border-right-color: #3a0e0e; }
.bsearch-verse-ref { font-size: 11px; color: #3a0e0e; font-weight: bold; margin-bottom: 5px; }
.bsearch-verse-text { font-size: 14px; line-height: 1.8; color: #333; }
.bsearch-verse-text mark, .bsearch-ctx-row.current mark {
    background: rgba(240,208,128,0.45);
    color: inherit;
    border-radius: 2px;
    padding: 0 2px;
}
.bsearch-expand-hint { font-size: 10px; color: #ccc; margin-top: 5px; text-align: left; direction: ltr; }
.bsearch-context { border-top: 1px solid #e8dfc8; margin-top: 10px; padding-top: 10px; }
.bsearch-ctx-row {
    display: flex;
    gap: 8px;
    padding: 3px 0;
    font-size: 13px;
    line-height: 1.7;
    color: #777;
    direction: rtl;
}
.bsearch-ctx-row.current {
    color: #222;
    font-size: 14px;
    background: rgba(240,208,128,0.15);
    border-radius: 4px;
    padding: 4px 8px;
    margin: 2px -8px;
}
.bsearch-vnum { font-size: 10px; color: #c9a84c; font-weight: bold; flex-shrink: 0; padding-top: 4px; }
.bsearch-ctx-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.bsearch-btn-primary {
    background: #3a0e0e;
    color: #f0d080;
    border: none;
    border-radius: 16px;
    padding: 6px 18px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.bsearch-btn-primary:hover { background: #5a1e1e; color: #f0d080; }
.bsearch-btn-outline {
    background: #fff;
    color: #3a0e0e;
    border: 1px solid #c9a84c;
    border-radius: 16px;
    padding: 6px 16px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
}
.bsearch-loader {
    text-align: center;
    padding: 18px;
    color: #aaa;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    direction: rtl;
}
/* ─────────────────────────────────────────────────────────── */

/* ── Daily Bread page ────────────────────────────────────── */

/* Toolbar */
.db-toolbar { background: #fffdf7; }
.db-nav-btn {
    width: 36px; height: 36px; padding: 0;
    border-radius: 50% !important;
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.db-select-day   { width: 72px; }
.db-select-month { width: 130px; }

/* Day card shell */
.db-day-card {
    border: 1px solid rgba(200,144,58,0.35);
    border-radius: 8px; overflow: hidden; background: #fffdf7;
}
.db-today { border-color: var(--color-gold) !important; box-shadow: 0 0 0 2px rgba(200,144,58,0.3); }
.db-day-header {
    background: #f8f0e0; padding: 4px 10px;
    font-size: 0.82rem; font-weight: bold; color: var(--color-maroon-900);
    border-bottom: 1px solid rgba(200,144,58,0.25); text-align: center; line-height: 1.35;
}
.db-today .db-day-header { background: var(--color-maroon-900); color: var(--color-gold-light); }

/* ── Ribbon sections ── */
.db-ribbon-morning {
    background: linear-gradient(135deg, #fff8e1, #fff3cd);
    padding: 10px 12px;
    border-bottom: 2px solid rgba(255,200,0,0.3);
}
.db-ribbon-night {
    background: linear-gradient(135deg, #e8eaf6, #e3e8f5);
    padding: 10px 12px;
}
.db-ribbon-title {
    font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em;
    display: flex; align-items: center; gap: 5px; margin-bottom: 8px;
}
.db-ribbon-morning .db-ribbon-title { color: #a05000; }
.db-ribbon-night   .db-ribbon-title { color: #283593; }

/* ── Pills ── */
.db-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.db-pill {
    display: inline-flex; align-items: center; padding: 4px 11px;
    border-radius: 20px; font-size: 0.78rem; font-weight: 600;
    cursor: pointer; user-select: none; transition: opacity 0.15s;
    border: 1px solid transparent;
}
.db-pill:hover { opacity: 0.8; }
.db-pill-m { background: #fff0c0; color: #8a5200; border-color: #f0c040; }
.db-pill-n { background: #dde2f8; color: #1a237e; border-color: #a0aade; }
.db-pill-active { font-weight: 700; box-shadow: 0 0 0 2px rgba(0,0,0,0.1); }

/* ── Expand block ── */
.db-expand-wrap {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease-out, opacity 0.2s ease-out;
    opacity: 0;
    flex-basis: 100%;
}
.db-expand-wrap.db-expand-open {
    max-height: 400px;
    opacity: 1;
    transition: max-height 0.3s ease-in, opacity 0.2s ease-in;
}
.db-expand-block {
    border-radius: 10px; overflow: hidden; margin-top: 4px;
}
.db-expand-block-m { background: #fffbe8; border: 1.5px solid #f0c040; }
.db-expand-block-n { background: #eef0fb; border: 1.5px solid #a0aade; }

.db-expand-header {
    padding: 7px 12px; display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; border-bottom: 1px solid rgba(0,0,0,0.07);
}
.db-expand-header-title  { font-size: 0.8rem; font-weight: 700; }
.db-expand-block-m .db-expand-header-title { color: #8a5200; }
.db-expand-block-n .db-expand-header-title { color: #1a237e; }
.db-expand-header-range  { font-size: 0.68rem; opacity: 0.6; margin-top: 1px; }
.db-expand-close { font-size: 0.68rem; opacity: 0.4; }

.db-expand-verses {
    padding: 8px 14px 12px; display: flex; flex-direction: column; gap: 6px;
    max-height: 260px; overflow-y: auto;
}
.db-verse-row   { display: flex; gap: 8px; align-items: baseline; }
.db-verse-no    { font-size: 0.65rem; font-weight: 700; opacity: 0.4; flex-shrink: 0; min-width: 18px; text-align: left; direction: ltr; }
.db-verse-text  { font-size: 0.82rem; line-height: 1.7; color: var(--color-ink); }

.db-loading-verses { font-size: 0.78rem; opacity: 0.55; padding: 8px 14px; }

/* ── Week / Month grid ── */
.db-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.db-month-weekday {
    text-align: center; font-size: 0.75rem; font-weight: 600;
    color: var(--color-maroon-900); padding: 4px 2px;
    background: #f8f0e0; border-radius: 4px;
}

/* Two-tone compact cell — week and month share this */
.db-cell-morning {
    background: linear-gradient(135deg, #fff8e1, #fff3cd);
    padding: 4px 6px; min-height: 28px;
    border-bottom: 1px solid rgba(255,200,0,0.25);
}
.db-cell-night {
    background: linear-gradient(135deg, #e8eaf6, #e3e8f5);
    padding: 4px 6px; min-height: 28px;
}
.db-cell-section-label {
    font-size: 0.55rem; font-weight: 700; opacity: 0.6;
    margin-bottom: 3px; display: block;
}
.db-cell-morning .db-cell-section-label { color: #a05000; }
.db-cell-night   .db-cell-section-label { color: #283593; }

/* Compact pill for week view */
.db-pill-sm {
    display: inline-block; font-size: 0.6rem; font-weight: 600;
    padding: 2px 7px; border-radius: 12px; border: 1px solid transparent;
    text-decoration: none; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; max-width: 100%;
}
.db-pill-sm-m { background: #fff0c0; color: #8a5200; border-color: #f0c040; }
.db-pill-sm-n { background: #dde2f8; color: #1a237e; border-color: #a0aade; }

/* Month dot zones */
.db-dots-row { display: flex; flex-wrap: wrap; gap: 3px; }
.db-dot {
    width: 8px; height: 8px; border-radius: 50%;
    flex-shrink: 0; display: inline-block;
}
.db-dot-morning { background: #f0a030; }
.db-dot-night   { background: #5c6bc0; }

/* Month cell header */
.db-month-cell .db-day-header { font-size: 0.8rem; padding: 3px 6px; }

/* Legend */
.db-legend      { display: flex; gap: 16px; font-size: 0.82rem; }
.db-legend-item { display: flex; align-items: center; gap: 5px; }
.db-legend-dot  { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ── Popup overlay ── */
.db-popup-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1050;
    display: flex; align-items: center; justify-content: center;
    animation: backdropIn 0.2s ease forwards;
}
@keyframes backdropIn {
    from { opacity: 0; } to { opacity: 1; }
}

.db-popup-panel {
    width: 90%; max-width: 480px; max-height: 80vh;
    background: #fff; border-radius: 16px; overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    direction: rtl;
}
@keyframes popupSpring {
    from { transform: scale(0.05); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.db-popup-header {
    padding: 12px 16px; flex-shrink: 0;
    display: flex; justify-content: space-between; align-items: flex-start;
    background: #f8f0e0; border-bottom: 1px solid rgba(200,144,58,0.25);
}
.db-popup-header-m { background: linear-gradient(135deg, #fff8e1, #fff3cd); }
.db-popup-header-n { background: linear-gradient(135deg, #e8eaf6, #e3e8f5); }

.db-popup-title { font-size: 0.9rem; font-weight: 700; color: var(--color-maroon-900); }
.db-popup-range { font-size: 0.72rem; opacity: 0.6; margin-top: 2px; }

.db-popup-close {
    background: none; border: none; font-size: 0.8rem;
    opacity: 0.4; cursor: pointer; padding: 0 0 0 8px; line-height: 1;
}
.db-popup-close:hover { opacity: 0.8; }

.db-popup-verses {
    padding: 12px 16px 16px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 6px;
}

/* ── Bible link footer ── */
.db-expand-footer {
    padding: 8px 12px 10px;
    border-top: 1px solid rgba(0,0,0,0.06);
    display: flex;
    justify-content: flex-start;
}
.db-bible-btn {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.78rem; font-weight: 600; text-decoration: none;
    padding: 5px 14px; border-radius: 20px; transition: opacity 0.15s;
}
.db-bible-btn:hover { opacity: 0.8; text-decoration: none; }
.db-bible-btn-m { background: #fff0c0; color: #8a5200; border: 1px solid #f0c040; }
.db-bible-btn-n { background: #dde2f8; color: #1a237e; border: 1px solid #a0aade; }

/* Week compact pills — clickable */
.db-pill-sm { cursor: pointer; }
.db-pill-sm:hover { opacity: 0.75; }

/* ─────────────────────────────────────────────────────────── */


/* Apple-style toggle switches */
.kb-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    align-items: center;
    direction: rtl;
}
.kb-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.kb-toggle-text {
    font-size: 13px;
    color: var(--color-ink);
    font-weight: 500;
}
.kb-toggle-track {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 26px;
    border-radius: 13px;
    background: rgba(120,80,60,0.18);
    border: 1.5px solid rgba(120,80,60,0.15);
    transition: background 0.25s ease, border-color 0.25s ease;
    flex-shrink: 0;
    cursor: pointer;
}
.kb-toggle-track.kb-toggle-on {
    background: var(--color-maroon-900);
    border-color: var(--color-maroon-900);
}
.kb-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.22);
    transition: transform 0.25s cubic-bezier(0.34,1.3,0.64,1);
}
.kb-toggle-track.kb-toggle-on .kb-toggle-thumb {
    transform: translateX(18px);
}

/* ── Bible page toolbar ──────────────────────────────────────── */
.bible-toolbar {
    padding: 10px 14px;
    margin-bottom: 10px;
}

.bible-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    direction: rtl;
}

.bible-spacer {
    flex: 1;
    min-width: 8px;
}

/* Logical group container */
.bible-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Thin vertical divider between groups */
.bible-divider {
    width: 1px;
    height: 28px;
    background: rgba(200,144,58,0.25);
    flex-shrink: 0;
}

/* Testament pills */
.bible-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: rgba(58,14,14,0.55);
    border: 1.5px solid rgba(200,144,58,0.3);
    transition: all 0.18s ease;
    user-select: none;
}
.bible-pill:hover {
    background: rgba(200,144,58,0.08);
    color: var(--color-maroon-900);
}
.bible-pill-active {
    background: var(--color-maroon-900) !important;
    color: #fff !important;
    border-color: var(--color-maroon-900) !important;
}
.bible-radio-hidden {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Select inputs */
.bible-select {
    background-color: #fffdf7 !important;
    border: 1.5px solid rgba(200,144,58,0.35) !important;
    border-radius: 8px !important;
    color: var(--color-ink) !important;
    font-size: 13px !important;
    padding: 5px 10px !important;
    height: 34px;
    appearance: auto;
    cursor: pointer;
}
.bible-select:focus {
    border-color: var(--color-gold) !important;
    box-shadow: 0 0 0 3px rgba(200,144,58,0.15) !important;
    outline: none;
}
.bible-book-select  { min-width: 120px; max-width: 180px; }
.bible-chapter-select { width: 62px; text-align: center; }
.bible-explain-select { font-size: 12px !important; height: 30px; }

/* Chapter nav: border + radius on container, overflow:hidden clips children */
.bible-chapter-nav {
    gap: 0 !important;
    align-items: stretch;
    border: 1.5px solid rgba(200,144,58,0.35);
    border-radius: 8px;
    overflow: hidden;
    height: 32px;
    background: #fffdf7;
}
.bible-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--color-maroon-700);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    padding: 0;
    flex-shrink: 0;
}
.bible-chapter-nav .bible-nav-btn:first-child {
    border-right: 1px solid rgba(200,144,58,0.35);
}
.bible-chapter-nav .bible-nav-btn:last-child {
    border-left: 1px solid rgba(200,144,58,0.35);
}
.bible-chapter-nav .bible-select {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    width: 52px;
    height: 100%;
    text-align: center;
    padding: 0 2px;
    -webkit-appearance: none;
    appearance: none;
    background-image: none !important;
    font-size: 13px;
}
.bible-nav-btn:hover {
    background: var(--color-maroon-900);
    color: #fff;
}

/* Toggles inline in toolbar */
.bible-toggles-inline {
    gap: 14px;
    flex-wrap: wrap;
}
.bible-toggles-inline .kb-toggle-label { gap: 6px; }
.bible-toggles-inline .kb-toggle-text { font-size: 12px; }

/* Action buttons */
.bible-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    height: 34px;
    border-radius: 8px;
    border: 1.5px solid rgba(200,144,58,0.3);
    background: #fffdf7;
    color: rgba(58,14,14,0.7);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.bible-action-btn:hover {
    background: rgba(58,14,14,0.06);
    color: var(--color-maroon-900);
    border-color: rgba(200,144,58,0.5);
}
.bible-langs-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--color-maroon-900);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}
.bible-langs-wrap { position: relative; }

/* Audio group */
.bible-audio-group { gap: 8px; }
.bible-audio-label {
    font-size: 12px;
    color: rgba(58,14,14,0.45);
    white-space: nowrap;
}

/* ── Custom themed audio player ── */
audio { display: none !important; } /* hide native player everywhere */

.kb-audio-player {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 10px;
    border: 1.5px solid rgba(200,144,58,0.35);
    border-radius: 20px;
    background: #fffdf7;
    min-width: 180px;
}

/* Play / pause button */
.kb-ap-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: var(--color-maroon-900);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
    padding: 0;
}
.kb-ap-btn:hover { background: var(--color-gold); }
/* Play icon (triangle) */
.kb-ap-btn::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 4px 0 4px 7px;
    border-color: transparent transparent transparent #fff;
    margin-left: 2px;
}
/* Pause icon (two bars) */
.kb-ap-btn.playing::after {
    width: 8px;
    height: 8px;
    border: none;
    margin-left: 0;
    background: linear-gradient(to right, #fff 0, #fff 35%, transparent 35%, transparent 65%, #fff 65%, #fff 100%);
    border-radius: 1px;
}

/* Time labels */
.kb-ap-current, .kb-ap-sep, .kb-ap-duration {
    font-size: 11px;
    color: rgba(58,14,14,0.55);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.kb-ap-sep { color: rgba(200,144,58,0.4); }

/* Progress bar */
.kb-ap-progress {
    flex: 1;
    height: 4px;
    background: rgba(200,144,58,0.2);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    min-width: 40px;
}
.kb-ap-fill {
    height: 100%;
    width: 0%;
    background: var(--color-maroon-900);
    border-radius: 2px;
    transition: width 0.25s linear;
}

/* ── Bible content area ──────────────────────────────────────── */
.bible-content {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: flex-start;
}
.bible-text-panel {
    flex: 1;
    padding: 12px;
    min-width: 0;
}
.bible-explain-panel {
    width: 50%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.bible-explain-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px 8px;
    border-bottom: 1px solid rgba(200,144,58,0.2);
    direction: rtl;
    flex-wrap: wrap;
}
.bible-explain-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-maroon-900);
    white-space: nowrap;
}
.bible-explain-body {
    padding: 10px 12px;
    flex: 1;
}

/* ── Katamars page toolbar ── */
.katamars-date-nav {
    height: 32px;
}
.katamars-date-nav .katamars-day-name {
    padding: 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-maroon-700);
    white-space: nowrap;
    border-right: 1px solid rgba(200,144,58,0.35);
    height: 100%;
    display: flex;
    align-items: center;
}
.katamars-date-nav .bible-select,
.katamars-date-nav .katamars-year-input {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    height: 100%;
    padding: 0 4px;
    font-size: 13px;
    -webkit-appearance: none;
    appearance: none;
    background-image: none !important;
}
.katamars-date-nav .bible-select {
    border-right: 1px solid rgba(200,144,58,0.35) !important;
}
.katamars-date-nav .katamars-year-input {
    width: 56px;
    text-align: center;
}
.katamars-day-select { width: 42px; text-align: center; }
.katamars-month-select { width: 64px; }

.katamars-coptic-nav .bible-select { height: 32px; }
.katamars-coptic-nav .katamars-year-input {
    width: 64px;
    height: 32px;
    padding: 0 6px;
    border: 1.5px solid rgba(200,144,58,0.35) !important;
    border-radius: 8px !important;
    background: #fffdf7 !important;
    font-size: 13px;
    color: var(--color-maroon-700);
    -webkit-appearance: none;
    appearance: none;
}
.katamars-source-label {
    font-size: 12px;
    color: rgba(58,14,14,0.55);
    white-space: nowrap;
}

/* ── Coptic theme tokens — ported from Next.js side ──────────── */
:root {
    --color-gold-dark: #a07020;
    --font-display: 'Reem Kufi', 'Noto Naskh Arabic', Georgia, serif;
    --font-body:    'Noto Naskh Arabic', Georgia, "Times New Roman", serif;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-parchment);
    color: var(--color-ink);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4 {
    font-family: var(--font-display);
    letter-spacing: -0.005em;
}

.kb-l2-link, .nav-link, .navbar-brand {
    font-family: var(--font-body);
}

/* Tighten color contrast for tiny gold elements */
.katamars-source-label,
.kb-mega-count,
.kb-drawer-count {
    color: var(--color-gold-dark) !important;
}

/* Gentle entrance for the Blazor article container */
@keyframes kb-content-rise {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
main > .content {
    animation: kb-content-rise 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) {
    main > .content { animation: none; }
}

/* ── L3 page-card icons (SVG) — sizing + selected-state tinting ─── */
.small-box img[src$=".svg"] {
    width: 56px;
    height: 56px;
    transition: transform 0.18s ease, opacity 0.18s ease;
    opacity: 0.88;
}
.small-box.hand:hover img[src$=".svg"] {
    transform: scale(1.06);
    opacity: 1;
}
.small-box.selected-box img[src$=".svg"] {
    opacity: 1;
}
