/* ============================================================= */
/* ------------------ Application Specific ----------------------- */
/* ============================================================= */

/* 0. Body — tiled regal background across all pages */
body {
    background: url("../images/regal.png") fixed;
}
.container {
    flex: 1;
}

/* ============================================================= */
/* Form control standardization — consistent height + font size  */
/* All inline buttons, selects, and inputs share the same height */
/* so dropdowns, search boxes, and buttons align perfectly.      */
/* ============================================================= */
button,
.button,
select,
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="number"] {
    box-sizing: border-box;
    font-size: 0.875rem;
    height: 2.1rem;
    line-height: 1;
    padding-top: 0;
    padding-bottom: 0;
}

/* Small button variant — same height, tighter horizontal padding */
.button-small {
    font-size: 0.875rem;
    height: 2.1rem;
    line-height: 1;
    padding: 0 0.75rem;
}

h1 {
    color: #252d36;
    font-size: 2.5em;
}

/* Hero banner for page-level hero images */
.hero-banner {
    display: block;
    /*width: 100%;*/
    height: auto;
    margin: 0 auto;
    border-radius: var(--radius);
    margin-bottom: var(--sp-2);
    margin-top: -50px;
}

/* 1. Navigation Bar
   Desktop (>= 768px): flex row — [Logo] [Dropdowns] [Links]. No hamburger.
   Tablet  (480-767px): hamburger toggle; panel open = centered, dropdowns inline.
   Mobile  (< 480px):   hamburger toggle; panel open = everything stacked. */
.top-nav {
    background: #1a1a2e url("../images/moroccan-flower-darker.png");
    color: #fff;
    padding: 0 1rem;
    border-bottom: 4px solid #0f3460;
}
.nav-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-top-row .logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    padding: 0.5rem 0;
}
.hamburger {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}
.nav-dropdowns {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.nav-select {
    padding: 0 0.5rem;
    border-radius: 4px;
    border: 1px solid #555;
    background: none;
    color: #fff;
    font-size: 0.875rem;
    min-width: 100px;
}
/* The closed select shows white text on the dark nav bar, but the native
   dropdown list renders on a white background — give the options dark text
   so they stay readable when the list is open. */
.nav-select option {
    color: #1a1a2e;
    background: #fff;
}
.nav-select:disabled {
    border-radius: 4px;
    border: 1px solid #555;
    background: #16213e;
    color: #fff;
    opacity: 0.5;
    cursor: not-allowed;
}
.nav-go-btn {
    padding: 0 1rem;
    border-radius: 4px;
    border: none;
    background: #0f3460;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.875rem;
}
.nav-go-btn:hover {
    background: #1a5276;
    color: #fff;
}
.nav-links a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.875rem;
}
.nav-links a:hover {
    color: #fff;
}

/* ── Desktop (>= 768 px): no hamburger, full row ── */
@media (min-width: 768px) {
    .top-nav {
        display: flex;
        align-items: center;
    }
    /*.nav-top-row {*/
    /* only contains logo; flex: none keeps it left */
}
.hamburger {
    display: none;
}
.nav-panel {
    display: flex;
    flex: 1;
    align-items: center;
}
.nav-picker {
    flex: 1;
    display: flex;
    justify-content: center;
}
.nav-links {
    margin-left: auto;
    display: flex;
    gap: 1rem;
}
.nav-links a {
    padding: 0.5rem 0;
}

/* ── Tablet + Mobile (< 768 px): hamburger, panel hidden by default ── */
@media (max-width: 767px) {
    .top-nav {
        display: flex;
        flex-direction: column;
    }
    .nav-top-row {
        width: 100%;
    }
    .nav-panel {
        display: none;
        width: 100%;
    }
    .nav-panel.open {
        display: flex;
        gap: 1rem;
        padding-bottom: 0.75rem;
    }
    .nav-links a {
        display: block;
        text-align: center;
    }

    /* ── Tablet (480-767 px): panel centered, dropdowns inline ── */
    @media (min-width: 480px) {
        .nav-panel.open {
            flex-direction: column;
            align-items: center;
        }
        .nav-dropdowns {
            flex-direction: row;
        }
        .nav-links {
            display: flex;
            gap: 1.5rem;
        }
    }

    /* ── Mobile (< 480 px): everything stacked ── */
    @media (max-width: 479px) {
        .nav-panel.open {
            flex-direction: column;
        }
        .nav-dropdowns {
            flex-direction: column;
            width: 100%;
        }
        .nav-select {
            width: 100%;
            min-width: unset;
        }
        .nav-go-btn {
            width: 100%;
            padding: 0.5rem;
        }
        .nav-links {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            padding-top: 0.5rem;
            border-top: 1px solid #333;
        }
        .nav-links a {
            padding: 0.5rem 0;
        }
    }
}

/* 1b. Site Footer */
.site-footer {
    background: #1a1a2e url("../images/moroccan-flower-darker.png");
    border-top: 4px solid #0f3460;
    color: rgba(255, 255, 255, 0.7);
    padding: 1.5rem 2rem;
    margin-top: auto;
    font-size: 0.85rem;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.footer-brand {
    font-weight: 700;
    color: #fff;
}
.footer-copy {
    opacity: 0.8;
}

/* ── Logged-in border colour override ── */
body.logged-in .top-nav {
    border-bottom-color: #e1840c;
}
body.logged-in .site-footer {
    border-top-color: #e1840c;
}

/* 2. Book Grid (homepage + /books page)
   Augments IBIS .card when used as a linked book card */
.hero {
    margin: 3rem auto;
    border-style: solid;
    border-color: silver;
    border-width: 1px 2px 2px 1px;
    border-radius: var(--radius);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.12),
        0 8px 32px rgba(0, 0, 0, 0.1);
}
.book-grid {
    padding: 2rem 0;
}
.book-grid .card {
    display: block;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: var(--content);
    font-weight: 600;
    font-size: 1.1rem;
}
.book-grid .card:hover {
    box-shadow: var(--shadow-lg);
}
.book-grid .card h2 {
    margin: 0;
    font-size: inherit;
}

/* 3. Chapter Grid
   Numbered chapter cards for book browsing */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.75rem;
    margin-top: 1.5rem;
}
.chapter-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.5rem;
    background: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--content);
    font-weight: 600;
    font-size: 1.1rem;
    transition:
        background 0.15s,
        transform 0.1s;
}
.chapter-card:hover {
    background: var(--surface-raised);
    transform: translateY(-2px);
}
.book-subtitle {
    color: var(--content-muted);
    margin-top: -0.5rem;
}

/* 4. Chapter Navigation Buttons
   Previous/next chapter links, same max-width as chapter-text */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem auto;
    gap: 1rem;
    max-width: 40em;
}
.ch-nav-btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: var(--brand-dim);
    color: var(--brand-contrast);
    border-radius: var(--radius-full);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s;
}
.ch-nav-btn:hover {
    background: var(--brand-deep);
    color: #fff;
}
.ch-nav-btn.disabled {
    background: var(--surface-raised);
    color: var(--content-muted);
    cursor: default;
}

/* 5a. Chapter View Title (centered) */
.ch-title {
    text-align: center;
}

.bible-version-switcher {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: center;
    margin: 0.75rem auto 1rem;
    max-width: 48rem;
}
.bible-version-switcher__label {
    color: var(--content-muted);
    font-size: 0.85rem;
    font-weight: 700;
    margin-right: 0.25rem;
}
.bible-version-btn {
    background: var(--surface-raised);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--content-default);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.28rem 0.7rem;
    text-decoration: none;
}
.bible-version-btn:hover,
.bible-version-btn.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--brand-contrast);
}

/* 5b. Mode Toggle Buttons (Verse / Inline / Reading) */
.mode-toggle {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 1rem;
}
.mode-btn {
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--surface-page);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--content);
}
.mode-btn:hover {
    color: var(--brand-contrast);
}
.mode-btn.active {
    background: var(--brand);
    color: var(--brand-contrast);
    border-color: var(--brand);
}

@media (max-width: 48rem) {
    .mode-btn {
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
        flex: 1;
    }
}

/* 6. Chapter Text / Verse Display
   Three modes: verse (default), inline, reading.
   All passage text justified. */
.chapter-text {
    margin: 2rem auto;
    padding: 2.5rem 3rem;
    background: url("../images/lightpaperfibers.png");
    border-style: solid;
    border-color: silver;
    border-width: 1px 2px 2px 1px;
    border-radius: var(--radius);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.12),
        0 8px 32px rgba(0, 0, 0, 0.1);
    line-height: 1.8;
    text-align: justify;
    max-width: 40em;
}

/* Chapter text responsive — reclaim horizontal space on narrow screens */
@media (max-width: 48rem) {
    .chapter-text {
        padding: 1.5rem 1.25rem;
        margin: 1.5rem -0.5rem;
        border-width: 1px 1px 2px 1px;
        border-radius: 0;
        max-width: none;
    }
}

/* Wider max-width inside parallel reader columns */
.torah-col .chapter-text {
    max-width: none;
}
.verse-line {
    margin: 0.25rem 0;
    text-indent: -1.5rem;
    max-width: none;
}
.verse-num {
    display: inline-block;
    font-weight: 700;
    color: var(--brand);
    min-width: 2rem;
    text-align: right;
    margin-right: 0.5rem;
    font-size: 0.85rem;
}
.no-verses {
    color: var(--content-muted);
    font-style: italic;
}

/* ── WEB Strong review/compare (ported from xpd-torah) ── */
.web-strong-links {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin: 0.35rem 0 0.85rem 3.5rem;
    padding: 0.5rem 0.65rem;
    text-align: left;
}
.web-strong-links summary {
    color: var(--brand);
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 700;
}
.web-strong-note {
    color: var(--content-muted);
    font-size: 0.82rem;
    line-height: 1.4;
    margin: 0.45rem 0;
}
.web-strong-token-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.web-strong-token {
    align-items: baseline;
    background: var(--surface-raised);
    border: 1px solid var(--border-default);
    border-radius: 999px;
    display: inline-flex;
    gap: 0.3rem;
    line-height: 1.2;
    padding: 0.25rem 0.55rem;
    text-decoration: none;
}
.web-strong-token:hover {
    background: var(--surface-subtle);
}
.web-strong-token__word {
    color: var(--content-default);
    font-size: 0.84rem;
}
.web-strong-token__id {
    color: var(--brand);
    font-size: 0.76rem;
    font-weight: 700;
}
.web-strong-token__status,
.web-strong-status-pill {
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.08rem 0.35rem;
    text-transform: lowercase;
}
.web-strong-token.is-checked {
    border-color: rgba(22, 163, 74, 0.45);
}
.web-strong-token.needs-review {
    border-color: rgba(217, 119, 6, 0.65);
    background: #fff7ed;
}
.web-strong-token__status,
.web-strong-status-pill.is-checked {
    background: #dcfce7;
    color: #166534;
}
.web-strong-token.needs-review .web-strong-token__status,
.web-strong-status-pill.needs-review {
    background: #ffedd5;
    color: #9a3412;
}
.web-strong-status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.75rem 0 1.25rem;
}
.web-strong-review-filters {
    align-items: end;
    background: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0.75rem 0 1.25rem;
    padding: 0.75rem;
}
.web-strong-review-filters label {
    display: grid;
    gap: 0.25rem;
    font-weight: 700;
}
.web-strong-review-filters select {
    min-width: 14rem;
}
.comparison-verse-card,
.web-comparison-card {
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin: 1rem 0;
    padding: 1rem;
}
.comparison-verse-card p {
    font-size: 1.125rem;
    line-height: 1.7;
    margin: 0.5rem 0 0;
}
.web-comparison-list {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}
.web-comparison-card header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.web-comparison-card.needs-review {
    border-color: rgba(217, 119, 6, 0.45);
}
.web-comparison-word {
    color: var(--content-default);
    font-size: 1.125rem;
    font-weight: 800;
    margin-right: 0.5rem;
}
.web-comparison-strong {
    font-weight: 700;
}
.source-word {
    font-size: 1.15rem;
    font-weight: 700;
}
.web-review-flash {
    background: #ecfdf5;
    border: 1px solid #86efac;
    border-radius: var(--radius-sm);
    color: #166534;
    font-weight: 700;
    margin: 1rem 0;
    padding: 0.75rem 1rem;
}
.web-review-decision-form {
    display: grid;
    gap: 0.4rem;
    min-width: 14rem;
}
.web-review-decision-form select,
.web-review-decision-form textarea {
    width: 100%;
}
.web-review-decision-form textarea {
    min-height: 4rem;
    resize: vertical;
}
.web-review-decision-pill {
    border-radius: 999px;
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    padding: 0.12rem 0.45rem;
    text-transform: lowercase;
}
.web-review-decision-pill.pending-review {
    background: #e0f2fe;
    color: #075985;
}
.web-review-decision-pill.is-approved {
    background: #dcfce7;
    color: #166534;
}
.web-review-decision-pill.is-rejected {
    background: #fee2e2;
    color: #991b1b;
}
.web-review-decision-pill.needs-research {
    background: #fef3c7;
    color: #92400e;
}
.web-review-decision-pill.source-unresolved {
    background: #ede9fe;
    color: #5b21b6;
}
.web-review-unresolved-box {
    background: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin-top: 0.75rem;
    max-width: 34rem;
    padding: 0.75rem;
}
.screen-reader-text {
    height: 1px;
    left: -9999px;
    overflow: hidden;
    position: absolute;
    top: auto;
    width: 1px;
}

/* ── Inline mode: verse numbers superscript, continuous text ── */
.mode-inline .verse-line {
    display: inline;
    margin: 0;
    padding-left: 0;
    text-indent: 0;
}
.mode-inline .verse-num {
    display: inline;
    font-size: 0.75rem;
    min-width: 0;
    text-align: left;
    margin: 0 0.1rem 0 0;
    vertical-align: super;
    line-height: 1;
}

/* ── Reading mode: no verse numbers, continuous text ── */
.mode-reading .verse-num {
    display: none;
}
.mode-reading .verse-line {
    display: inline;
    margin: 0;
    padding-left: 0;
    text-indent: 0;
}

/* ── Justified text for all passage display ── */
.passage-full p,
.result-content,
.side-a p,
.side-b p,
.ai-answer {
    text-align: justify;
}

/* 7. Chapter Pagination
   Wrapper around IBIS .pagination in chapter view */
.chapter-pagination {
    margin-top: 2rem;
    text-align: center;
}
.chapter-pagination .pagination a {
    padding: 0.4rem 0.75rem;
    margin: 0 2px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    text-decoration: none;
    /*color: var(--brand);*/
}
.chapter-pagination .pagination a:hover {
    background: var(--surface-subtle);
}
.chapter-pagination .pagination .current {
    background: var(--brand);
    color: var(--brand-contrast);
    border-color: var(--brand);
}

/* Muted/secondary button variant */
.button-muted {
    background: var(--surface-page, #f5f5f5);
    color: var(--content-muted, #666);
    border: 1px solid var(--border-subtle, #ddd);
}
.button-muted:hover {
    background: var(--surface-raised, #eaeaea);
    color: var(--content, #222);
}

/* Keep .button text white on hover (IBIS a:hover can interfere) */
a.button:hover {
    color: var(--brand-contrast);
}

/* 8. Search Results
   Result cards with book/ref/score header */
.search-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background: var(--surface-page);
    border-bottom: 1px solid var(--border-subtle);
}
@media (max-width: 48rem) {
    .search-bar {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }
    .search-bar input[type="text"] {
        min-width: 0;
    }
}
.search-bar input[type="text"] {
    flex: 1;
    max-width: 400px;
}
.search-bar .method {
    font-size: 0.85rem;
    color: var(--content-muted);
}
.results {
    padding: 1rem 0;
}
.result-card.card {
    padding: 1rem;
}
.result-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.result-header .rank {
    font-weight: bold;
    color: var(--brand-deep);
}
.result-header .book {
    font-weight: bold;
}
.result-header .ref {
    color: var(--content-muted);
}
.result-header .score {
    margin-left: auto;
    font-weight: bold;
    color: var(--accent-success);
}
.result-content {
    color: var(--content);
    margin-bottom: 0.5rem;
}
.result-note {
    background: #f0f7f0;
    padding: 0.5rem;
    border-left: 3px solid var(--accent-success);
    font-style: italic;
    margin-bottom: 0.5rem;
}

/* 9. Comparison Page — Side-by-Side Horizontal Scroll */

/* ── Selector form ── */
.cmp-title {
    text-align: center;
}
.compare-form {
    margin-bottom: 1.5rem;
    text-align: center;
}
.compare-selectors {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: center;
}
.cmp-select {
    padding: 0 0.5rem;
    border: 1px solid var(--border-default);
    border-radius: var(--radius);
    font-size: 0.875rem;
    min-width: 100px;
    max-width: 160px;
}
.cmp-select[name="chapter_a"] {
    min-width: 80px;
    max-width: 80px;
}
.cmp-select[name="verse_from"],
.cmp-select[name="verse_to"] {
    min-width: 95px;
    max-width: 100px;
}
.cmp-select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
/* ── Horizontal scroll container ── */
.cmp-scroll-wrap {
    margin: 1.5rem 0;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    background: var(--surface-page);
    overflow: hidden;
}
.cmp-scroll-inner {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: stretch;
    scroll-behavior: smooth;
    /* Reserve space for the horizontal scrollbar */
    padding-bottom: 8px;
}

/* ── Each column in the scroll ── */
.cmp-col {
    flex: 0 0 auto;
    min-width: 360px;
    max-width: 420px;
    width: 400px;
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    background: var(--surface-page);
}

/* ── Source column: sticks to the left ── */
.cmp-source-col {
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--surface-raised);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
}

/* ── Column title bar ── */
.cmp-col-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-subtle);
    background: inherit;
    gap: 0.5rem;
    flex-shrink: 0;
}
.cmp-col-title a {
    text-decoration: none;
    color: var(--brand-deep);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cmp-col-title a:hover {
    text-decoration: underline;
}

/* ── Score badge ── */
.cmp-score {
    font-size: 0.8rem;
    color: var(--accent-success);
    font-weight: 700;
    white-space: nowrap;
    background: color-mix(in srgb, var(--accent-success) 10%, transparent);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
}

/* ── Column text area ── */
.cmp-col-text {
    padding: 0.5rem 0.75rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* ── Verse lines ── */
.cmp-verse {
    margin: 0.2rem 0;
    line-height: 1.65;
    text-align: justify;
    font-size: 0.92rem;
}
.cmp-verse sup {
    font-weight: 700;
    color: var(--brand);
    margin-right: 0.3rem;
    font-size: 0.78rem;
}

/* ── Book group divider & header ── */
.cmp-group-divider {
    width: 0;
    flex: 0 0 0;
    border-left: 2px dashed var(--border-subtle);
    margin: 0.5rem 0;
}
.cmp-group-header {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    padding: 0.75rem 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--content-muted);
    background: var(--surface-page);
    border-right: 1px solid var(--border-subtle);
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    user-select: none;
}

/* ── Show more button ── */
.cmp-more-btn {
    margin-top: 0.4rem;
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.65rem;
    font-size: 0.85rem;
    color: var(--brand);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
    width: 100%;
    text-align: center;
}
.cmp-more-btn:hover {
    background: var(--surface-raised);
}
.cmp-extra {
    margin-top: 0.2rem;
}

/* ── Responsive: narrow screens ── */
@media (max-width: 767px) {
    .cmp-scroll-inner {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
        padding-bottom: 0;
    }
    .cmp-col {
        min-width: unset;
        max-width: unset;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }
    .cmp-source-col {
        position: static;
        box-shadow: none;
    }
    .cmp-group-divider {
        width: 100%;
        height: 0;
        border-left: none;
        border-top: 2px dashed var(--border-subtle);
        margin: 0;
    }
    .cmp-group-header {
        writing-mode: horizontal-tb;
        padding: 0.4rem 0.75rem;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        justify-content: flex-start;
    }
}

/* ── Selector form responsiveness ── */
@media (max-width: 479px) {
    .compare-selectors {
        flex-direction: column;
        width: 100%;
    }
    .cmp-select {
        width: 100%;
        min-width: unset;
    }
    .compare-selectors .button {
        width: 100%;
    }
}
.cmp-source {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--surface-page);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
}
.cmp-source h2 {
    margin-top: 0;
    margin-bottom: 0.75rem;
}
.cmp-source-text {
    max-height: 400px;
    overflow-y: auto;
}
.cmp-verse {
    margin: 0.25rem 0;
    line-height: 1.7;
    text-align: justify;
}
.cmp-verse sup {
    font-weight: 700;
    color: var(--brand);
    margin-right: 0.3rem;
    font-size: 0.8rem;
}
.cmp-parallels h3 {
    margin-bottom: 1rem;
}
.cmp-book-group {
    margin-bottom: 1.5rem;
}
.cmp-book-group h4 {
    background: var(--surface-raised);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}
.cmp-match {
    background: var(--surface-page);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}
.cmp-match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.cmp-match-header a {
    font-weight: 600;
    text-decoration: none;
}
.cmp-match-header a:hover {
    text-decoration: underline;
}
.cmp-score {
    font-size: 0.85rem;
    color: var(--accent-success);
    font-weight: 600;
}
.cmp-match-text {
    max-height: 300px;
    overflow-y: auto;
}
.cmp-more-btn {
    margin-top: 0.5rem;
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.75rem;
    font-size: 0.9rem;
    color: var(--brand);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.cmp-more-btn:hover {
    background: var(--surface-raised);
}
.cmp-more-btn[aria-expanded="true"]::after {
    content: "";
}
.cmp-extra {
    margin-top: 0.25rem;
}

/* 10. AI Answers & Sources */
.ai-answer {
    background: var(--surface-page);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1rem 0;
}
.sources {
    padding: 1rem 0;
}
.source-item {
    background: var(--surface-page);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

/* 11. Reports Table */
.report-table {
    width: 100%;
    border-collapse: collapse;
}
.report-table td,
.report-table th {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    text-align: left;
}
.report-table a {
    margin-right: 0.5rem;
}

/* 12. Status Messages */
.error {
    background: var(--accent-error);
    border: 1px solid var(--accent-warm);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: var(--radius);
    color: var(--brand-contrast);
}
.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--content-muted);
}

/* 13. Passage View */
.passage-list {
    padding: 1rem 0;
}
.passage-item {
    margin-bottom: 0.75rem;
}
.passage-item .ref {
    font-weight: bold;
    color: var(--brand-deep);
}

/* 14. Navigation Bar — 3-Section Layout (logo, dropdowns, links)
   The template structure uses .nav-left / .nav-center / .nav-right.
   Desktop: full row. Tablet/mobile: hamburger toggle. */

/* ── Base nav link colours ── */
.top-nav a {
    color: #fff;
    text-decoration: none;
}

/* Left: logo + hamburger */
.nav-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.nav-left .logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}

/* Center: dropdowns, pushed to middle */
.nav-center {
    display: flex;
    justify-content: center;
    flex: 1;
}

/* Right: nav links */
.nav-right {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-shrink: 0;
}
.nav-right a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.875rem;
}
.nav-right a:hover {
    color: #fff;
}

/* ── Desktop (>= 768 px): flex row, hamburger hidden, links right ── */
@media (min-width: 768px) {
    .top-nav {
        display: flex;
        align-items: center;
    }
    .nav-right {
        margin-left: auto;
    }
    .hamburger {
        display: none;
    }
}

/* ── Mobile (< 768 px): hamburger visible, panels hidden ── */
@media (max-width: 767px) {
    .top-nav {
        flex-direction: column;
        align-items: stretch;
    }
    .nav-left {
        justify-content: space-between;
        padding: 0.75rem 0;
        width: 100%;
    }
    .hamburger {
        display: block !important;
    }
    .nav-center {
        display: none;
        flex-direction: column;
        width: 100%;
    }
    .nav-center.open {
        display: flex;
    }
    .nav-right {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
        padding-top: 0.75rem;
        border-top: 1px solid #333;
    }
    .nav-right.open {
        display: flex;
    }
    .nav-dropdowns {
        width: 100%;
        flex-direction: column;
    }
    .nav-select {
        width: 100%;
        min-width: unset;
    }
    .nav-go-btn {
        width: 100%;
        padding: 0.5rem;
    }
    .nav-right a {
        display: block;
        padding: 0.5rem 0;
    }
}

/* 1c. Homepage Study Dashboard */
.study-dashboard {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(239, 246, 255, 0.96));
    border: 1px solid #dbe3ef;
    border-radius: var(--radius);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    margin: 1.5rem 0;
    padding: 1.25rem;
}

.study-dashboard__intro {
    max-width: 780px;
    margin: 0 auto 1rem;
    text-align: center;
}

.study-dashboard__intro h2 {
    margin: 0.15rem 0 0.35rem;
}

.study-dashboard__intro p:last-child {
    margin-bottom: 0;
}

.study-dashboard__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
}

.study-dashboard-card {
    background: #fff;
    border: 1px solid #dbe3ef;
    border-radius: 0.85rem;
    color: #1e293b;
    display: grid;
    gap: 0.35rem;
    min-height: 9.5rem;
    padding: 1rem;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.study-dashboard-card:hover,
.study-dashboard-card:focus {
    border-color: #2563eb;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.15);
    color: #0f172a;
    transform: translateY(-2px);
}

.study-dashboard-card__label {
    color: #2563eb;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.study-dashboard-card strong {
    font-size: 1.05rem;
}

.study-dashboard-card small {
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.45;
}

.homepage-bible-library {
    margin: 0.25rem auto 2.5rem auto;
    padding: 1.25rem;
    border: 1px solid rgba(70, 130, 180, 0.35);
    border-top: 4px solid var(--brand);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(70, 130, 180, 0.12), rgba(70, 130, 180, 0.04));
}
.homepage-bible-library .section-heading h1,
.homepage-bible-library .section-heading h2,
.homepage-bible-library .section-heading .eyebrow {
    color: var(--brand-deep);
}
.homepage-bible-library > .bible-card-grid > .bible-library-card {
    border-left: 4px solid var(--brand);
    background: linear-gradient(180deg, #eef7ff, var(--surface-page));
    box-shadow: 0 0.35rem 1.25rem rgba(70, 130, 180, 0.12);
}
.homepage-bible-library > .bible-card-grid .bible-card-open-button {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--brand-contrast);
}
.original-language-section {
    margin: 2rem auto 2.5rem auto;
    padding: 1.25rem;
    border: 1px solid rgba(76, 175, 80, 0.35);
    border-top: 4px solid var(--accent-success);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(76, 175, 80, 0.12), rgba(76, 175, 80, 0.04));
}
.original-language-section .section-heading h2,
.original-language-section .section-heading .eyebrow {
    color: #1f6f2b;
}
.original-language-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.original-language-section .bible-library-card {
    border-left: 4px solid var(--accent-success);
    background: linear-gradient(180deg, #eefbf0, var(--surface-page));
    box-shadow: 0 0.35rem 1.25rem rgba(76, 175, 80, 0.12);
}
.original-language-section .bible-card-open-button {
    background: var(--accent-success);
    border-color: var(--accent-success);
    color: #08240d;
}
.extra-biblical-section {
    margin: 2rem auto 2.5rem auto;
    padding: 1.25rem;
    border: 1px solid rgba(255, 152, 0, 0.35);
    border-top: 4px solid var(--accent-warm);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 152, 0, 0.12), rgba(255, 152, 0, 0.04));
}
.extra-biblical-section .section-heading h2,
.extra-biblical-section .section-heading .eyebrow {
    color: #7a4a00;
}
.extra-biblical-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.extra-biblical-section .bible-library-card {
    border-left: 4px solid var(--accent-warm);
    background: linear-gradient(180deg, #fff8e6, var(--surface-page));
    box-shadow: 0 0.35rem 1.25rem rgba(255, 152, 0, 0.12);
}
.extra-biblical-section .bible-card-open-button {
    background: var(--accent-warm);
    border-color: var(--accent-warm);
    color: #1f1300;
}
.book-columns--homepage-bibles {
    align-items: start;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}
.homepage-bible-library .section-heading {
    margin-bottom: 1rem;
}
.bible-card-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    margin: 2rem 0;
}
.bible-library-card {
    background: var(--surface-page);
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--brand-deep);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    /*gap: 1rem;*/
    padding: 1.25rem;
}
.bible-library-card__header {
    min-height: 9.5rem;
}
.bible-library-card__header h3 {
    color: var(--brand-deep);
    font-size: 1.45rem;
    margin: 0.15rem 0 0.2rem;
}
.bible-library-card__header p:last-child {
    color: var(--content-muted);
    margin: 0;
}
.bible-card-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
}
.bible-card-field {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.bible-card-form label {
    font-size: 0.82rem;
    font-weight: 800;
    margin: 0;
}
.bible-card-form select {
    width: 100%;
}
.bible-card-open-button {
    margin-top: auto;
    width: 100%;
}

/* 15b. Book Columns — Books grouped by version */

/* Four-column grid for the main versions */
.book-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin: 2rem 0;
}

.book-column {
    background: var(--surface-page);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.book-column-header {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--content-muted);
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--brand-deep);
}

.book-column-link {
    display: block;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--surface-page);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--brand-deep);
    color: var(--content);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition:
        box-shadow 0.12s,
        transform 0.12s,
        background 0.12s;
}
.book-column-link:hover {
    background: var(--surface-raised);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
    color: var(--brand-deep);
}

/* Per-column accent colors for cards and headers */
.book-column--mt .book-column-link {
    border-left-color: var(--brand-deep);
}
.book-column--lxx .book-column-link {
    border-left-color: var(--accent-success);
}
.book-column--eotc .book-column-link {
    border-left-color: #800020;
}
.book-column--targum .book-column-link {
    border-left-color: var(--accent-cool);
}

.book-column--mt .book-column-header {
    border-bottom-color: var(--brand-deep);
}
.book-column--lxx .book-column-header {
    border-bottom-color: var(--accent-success);
}
.book-column--eotc .book-column-header {
    border-bottom-color: #800020;
}
.book-column--targum .book-column-header {
    border-bottom-color: var(--accent-cool);
}

/* Pseudepigrapha section: each link matches book-column-link mini-card width */
.pseudepigrapha-section {
    margin: 0 auto 2rem auto;
    text-align: center;
    max-width: calc(75% - 0.8125rem);
}

.pseudepigrapha-header {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--content-muted);
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--accent-warm);
    display: inline-block;
}

.pseudepigrapha-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.pseudepigrapha-link {
    display: block;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--surface-page);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--accent-warm);
    color: var(--content);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition:
        box-shadow 0.12s,
        transform 0.12s,
        background 0.12s;
}
.pseudepigrapha-link:hover {
    background: var(--surface-raised);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
    color: var(--brand-deep);
}

/* Responsive: tablets → 2-column grid, phones → stack */
@media (max-width: 767px) {
    .book-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 479px) {
    .book-columns {
        grid-template-columns: 1fr;
    }
}

/* ============================================================= */
/* ─── Notes Module ─── */
/* ============================================================= */

.notes-app {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

/* Tab bar (mobile only, hidden on desktop/tablet) */
.notes-tabs {
    display: none;
    gap: var(--sp-2);
    margin-bottom: var(--sp-3);
}
.notes-tab {
    flex: 1;
    padding: var(--sp-3) var(--sp-4);
    background: var(--surface-page);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    text-align: center;
    transition:
        background 0.12s,
        color 0.12s;
}
.notes-tab.active {
    background: var(--brand, #4682b4);
    color: #fff;
    border-color: var(--brand, #4682b4);
}

/* Three-column layout */
.notes-columns {
    display: flex;
    gap: var(--sp-4);
    align-items: flex-start;
}
.notes-panel {
    background: var(--surface-page, #fff);
    border: 1px solid var(--border-subtle, #ddd);
    border-radius: var(--radius, 6px);
    padding: var(--sp-4, 1rem);
    min-height: 300px;
}
.panel-shared,
.panel-mine {
    flex: 1;
    max-width: 280px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}
.panel-display {
    flex: 2;
    min-width: 0; /* prevent flex overflow */
}

/* Panel headings */
.panel-heading {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 var(--sp-3);
    padding-bottom: var(--sp-2);
    border-bottom: 2px solid var(--brand, #4682b4);
}
.panel-mine-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-3);
    padding-bottom: var(--sp-2);
    border-bottom: 2px solid var(--brand, #4682b4);
}
.panel-mine-header .panel-heading {
    margin: 0;
    padding: 0;
    border: none;
}

/* Note list items */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}
.notes-list-item {
    padding: var(--sp-3);
    border: 1px solid var(--border-subtle, #e0e0e0);
    border-radius: var(--radius-sm, 4px);
    cursor: pointer;
    transition:
        background 0.12s,
        box-shadow 0.12s,
        border-color 0.12s;
    background: var(--surface-raised, #fafafa);
}
.notes-list-item:hover {
    background: var(--surface-hover, #f0f0f0);
    border-color: var(--brand, #4682b4);
}
.notes-list-item.active {
    background: var(--brand-dim, #38678f);
    border-color: var(--brand, #4682b4);
    color: #fff;
}
.notes-list-item.active .note-item-title {
    color: #fff;
}
.notes-list-item.active .note-item-meta,
.notes-list-item.active .note-item-ref {
    color: rgba(255, 255, 255, 0.8);
}
.note-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: var(--sp-1);
    color: var(--content, #333);
}
.note-item-meta {
    font-size: 0.8rem;
    color: var(--content-dim, #888);
}
.note-item-ref {
    font-size: 0.75rem;
    color: var(--brand, #4682b4);
    margin-top: var(--sp-1);
}

/* Note display area */
#note-display-content {
    padding: var(--sp-2);
}
.display-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--content-dim, #999);
    text-align: center;
}

.note-display-header {
    margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-3);
    border-bottom: 1px solid var(--border-subtle);
}
.note-display-header h3 {
    margin: 0 0 var(--sp-2);
    font-size: 1.4rem;
}
.note-display-meta {
    display: flex;
    gap: var(--sp-3);
    font-size: 0.8rem;
    color: var(--content-dim, #888);
    align-items: center;
    flex-wrap: wrap;
}
.note-display-ref {
    margin-top: var(--sp-2);
}
.ref-link {
    font-size: 0.9rem;
    color: var(--brand);
    text-decoration: none;
}
.ref-link:hover {
    text-decoration: underline;
}
.note-display-body {
    line-height: 1.7;
    font-size: 1rem;
    color: var(--content, #333);
    margin-bottom: var(--sp-4);
}
.note-display-actions {
    display: flex;
    gap: var(--sp-2);
    padding-top: var(--sp-3);
    border-top: 1px solid var(--border-subtle);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-shared {
    background: var(--accent-success, #4caf50);
    color: #fff;
}
.badge-success {
    background: var(--accent-success, #4caf50);
    color: #fff;
    padding: 6px 10px;
    font-size: 0.8rem;
    vertical-align: middle;
}
.badge-parallel {
    background: var(--accent, #2196f3);
    color: #fff;
    margin-right: 6px;
}
.badge-chapter {
    background: var(--accent-warm, #ff9800);
    color: #fff;
    margin-right: 6px;
}

/* Form styles for create/edit */
.notes-form {
    max-width: 720px;
    margin: 0 auto;
}
.notes-form h1 {
    margin-bottom: var(--sp-4);
}
.notes-form .form-group {
    margin-bottom: var(--sp-4);
}
.notes-form label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--sp-2);
    color: var(--content, #333);
}
.notes-form input[type="text"],
.notes-form textarea,
.notes-form select {
    width: 100%;
    padding: var(--sp-3);
    border: 1px solid var(--border-subtle, #ccc);
    border-radius: var(--radius-sm, 4px);
    font-size: 1rem;
    font-family: inherit;
    background: var(--surface-page, #fff);
    box-sizing: border-box;
}
.notes-form textarea {
    min-height: 200px;
    line-height: 1.6;
}
.notes-form select {
    cursor: pointer;
}

/* Verse link fields - shown/hidden by checkbox */
.verse-link-fields {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    padding: var(--sp-4);
    background: var(--surface-raised, #f5f5f5);
    border-radius: var(--radius-sm, 4px);
    margin-bottom: var(--sp-4);
}
.verse-link-fields .form-group {
    flex: 1;
    min-width: 140px;
    margin-bottom: 0;
}

/* Checkbox group */
.checkbox-group {
    margin-bottom: var(--sp-3);
}
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    margin-right: var(--sp-4);
    cursor: pointer;
    font-weight: 500;
}
.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Checkbox row — keeps checkboxes side by side */
.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-bottom: var(--sp-1);
}

/* Form actions */
.form-actions {
    display: flex;
    gap: var(--sp-3);
    /*padding-top: var(--sp-3);
    margin-top: var(--sp-3);*/
    border-top: 1px solid var(--border-subtle);
}

/* Inline form (for delete button alongside edit) */
.inline-form {
    display: inline;
}

/* New note button */
.new-note-btn {
    font-size: 0.85rem;
    padding: var(--sp-2) var(--sp-3);
    white-space: nowrap;
}

/* ============================================================= */
/* ─── Notes Module: Responsive ─── */
/* ============================================================= */

/* Tablet: 768-991px — 2 column with collapsible left panel */
@media (max-width: 991px) {
    .notes-columns {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .panel-shared,
    .panel-mine {
        flex: 1 1 100%;
        max-width: none;
        max-height: none;
    }
    .panel-shared {
        order: 1;
    }
    .panel-shared .notes-list {
        display: none; /* hidden by default, toggled by heading click */
    }
    .panel-mine {
        order: 2;
    }
    .panel-display {
        flex: 1 1 100%;
        order: 3;
    }
    /* Shared notes heading becomes clickable toggle */
    .panel-shared .panel-heading {
        cursor: pointer;
        position: relative;
    }
    .panel-shared .panel-heading::after {
        content: "\25BC";
        font-size: 0.7rem;
        margin-left: var(--sp-2);
    }
}

/* Mobile: <768px — single column with tab bar */
@media (max-width: 767px) {
    .notes-tabs {
        display: flex;
    }
    .notes-columns {
        flex-direction: column;
    }
    .panel-shared,
    .panel-mine {
        display: none; /* controlled by tabs */
        flex: 1 1 100%;
        max-width: none;
        max-height: none;
    }
    .panel-display {
        flex: 1 1 100%;
    }
    .notes-tabs {
        display: flex;
    }
    .verse-link-fields {
        flex-direction: column;
    }
    .verse-link-fields .form-group {
        min-width: 100%;
    }
    .note-display-meta {
        flex-direction: column;
        gap: var(--sp-1);
    }
}

/* Member Dashboard — Stat Cards */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.stat-card {
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    background: #fff;
}
.stat-card .stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand);
    line-height: 1.2;
}
.stat-card .stat-label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
}
@media (max-width: 480px) {
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 360px) {
    .stat-cards {
        grid-template-columns: 1fr;
    }
}

.member-dashboard {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}
.profile-preferences-panel {
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin-top: 1.5rem;
    max-width: 44rem;
    padding: 1rem;
}
.profile-preferences-form {
    display: grid;
    gap: 0.65rem;
    max-width: 28rem;
}
.profile-preferences-form label {
    font-weight: 800;
}
.profile-preferences-form select {
    width: 100%;
}
.profile-radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin: 0.15rem 0 0.25rem;
}
.profile-radio,
.profile-checkbox {
    align-items: center;
    display: inline-flex;
    font-weight: 600 !important;
    gap: 0.35rem;
}
.profile-radio input,
.profile-checkbox input {
    accent-color: var(--accent);
}
.profile-version-checkboxes {
    display: grid;
    gap: 0.3rem;
    margin: 0.15rem 0 0.25rem;
}
.profile-version-checkboxes .profile-checkbox {
    font-weight: 600;
}
.saved-search-entry {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}
.saved-search-main {
    flex: 1 1 auto;
    min-width: 0;
}
.saved-search-actions {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    gap: 0.5rem;
}
.badge-alert {
    background: #fef3c7;
    border: 1px solid #d97706;
    border-radius: 999px;
    color: #92400e;
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    margin-left: 0.5rem;
    padding: 0.1rem 0.5rem;
    vertical-align: middle;
}
.dashboard-panel {
    display: none;
}
.dashboard-panel.active {
    display: block;
}
.dashboard-table {
    border-collapse: collapse;
    width: 100%;
}
.dashboard-table th,
.dashboard-table td {
    padding: 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-subtle);
}
.dashboard-table th {
    background: var(--brand);
    color: var(--brand-contrast);
    border-bottom: none;
    text-align: left;
}
@media (max-width: 48rem) {
    .dashboard-table th,
    .dashboard-table td {
        padding: 0.5rem 0.25rem;
    }
}
.dashboard-table .button-small {
    background: var(--button-bg);
    border: 1px solid var(--button-border);
    border-radius: var(--radius);
    color: var(--button-color);
    display: inline-block;
    margin: 0;
    text-decoration: none;
}
.dashboard-table .button-small:hover {
    background: var(--button-bg-hover);
    border-color: var(--button-border-hover);
}
.td-right {
    text-align: right;
    white-space: nowrap;
}
.text-muted {
    color: #999;
}
.dashboard-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}
.chapter-notes-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.bookmark-btn {
    text-decoration: none;
}
.search-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.search-entry-text {
    flex: 1;
}
.search-delete {
    color: var(--brand);
    text-decoration: none;
    font-size: 1.3rem;
    line-height: 1;
    padding: 0 0.25rem;
    border-radius: 3px;
}
.search-delete:hover {
    color: var(--brand-deep);
    background: #f0f6fb;
}

/* ── Dashboard tabs responsive ── */
@media (max-width: 480px) {
    .dashboard-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0;
        flex-wrap: nowrap;
    }
    .dashboard-tabs .xpnd-tab {
        padding: 0.75rem 1rem;
        white-space: nowrap;
        font-size: 0.9rem;
    }
}

/* ============================================================= */
/* ---------- Study Workspace (ported from xpd ibis) ------------ */
/* ============================================================= */

@font-face {
    font-family: "XPnD Noto Sans Hebrew";
    src: url("../fonts/noto/NotoSansHebrew-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "XPnD Noto Sans Syriac";
    src: url("../fonts/noto/NotoSansSyriac-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "XPnD Noto Sans Imperial Aramaic";
    src: url("../fonts/noto/NotoSansImperialAramaic-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --ff-aramaic-square: "XPnD Noto Sans Hebrew", "Noto Sans Hebrew", "SBL Hebrew", "Ezra SIL", "Times New Roman", serif;
    --ff-aramaic-syriac: "XPnD Noto Sans Syriac", "Noto Sans Syriac", "Estrangelo Edessa", serif;
    --ff-aramaic-imperial: "XPnD Noto Sans Imperial Aramaic", "Noto Sans Imperial Aramaic", "Segoe UI Historic", serif;
}

.study-workspace {
    --study-sidebar-width: 18rem;
    flex: 1;
    display: block;
    min-width: 0;
}

.study-toggles {
    align-items: center;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
    margin: 0.75rem 0.75rem 0;
    position: sticky;
    top: 0.75rem;
    z-index: 1500;
}

.study-toggles-left,
.study-toggles-right {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.study-toggles .study-sidebar-toggle,
.study-toggles .study-links-toggle {
    margin: 0;
    position: static;
    z-index: auto;
}

.study-toggles-title {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    margin: 0;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #334155;
}

.study-workspace--guest {
    padding: 1rem 0.5rem 0;
}

.study-main {
    margin: 0;
    min-width: 0;
    padding: 0 0.75rem 0;
}

/* Study pages that render a plain .container (books, search, etc.)
   should start their first element at the toggle bottom, not inherit
   the IBIS container's large all-side padding. */
.study-main .container {
    padding-top: 0;
    padding-bottom: 2rem;
}

.study-sidebar-toggle {
    align-items: center;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 999px;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.2);
    color: #fff;
    cursor: pointer;
    display: flex;
    font-weight: 900;
    gap: 0.5rem;
    justify-content: center;
    margin: 0.75rem 0 0 0.75rem;
    padding: 0.58rem 0.82rem;
    position: sticky;
    top: 0.75rem;
    width: max-content;
    z-index: 1500;
}

.study-sidebar-toggle:hover,
.study-sidebar-toggle:focus {
    background: #1e293b;
    outline: 3px solid rgba(14, 116, 144, 0.24);
}

.study-sidebar-toggle span[aria-hidden="true"] {
    font-size: 1.2rem;
    line-height: 1;
}

.study-sidebar {
    background: rgba(15, 23, 42, 0.22);
    bottom: 0;
    left: 0;
    margin: 0;
    max-width: 100vw;
    opacity: 0;
    overflow-y: auto;
    padding: 4.5rem 0.75rem 1rem 0;
    pointer-events: none;
    position: fixed;
    top: 0;
    transform: translateX(calc(-1 * var(--study-sidebar-width) - 1rem));
    transition: opacity 0.18s ease, transform 0.22s ease;
    width: var(--study-sidebar-width);
    z-index: 1490;
}

.study-sidebar.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.study-sidebar-inner {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #cbd5e1;
    border-left: none;
    border-radius: 0 1rem 1rem 0;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
    min-height: 100%;
    padding: 1rem;
}

.study-sidebar-eyebrow {
    color: #2563eb;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    margin: 0 0 0.2rem;
    text-transform: uppercase;
}

.study-sidebar h2 {
    color: #0f172a;
    font-size: 1.05rem;
    margin: 0 0 0.75rem;
}

.study-sidebar-links {
    display: grid;
    gap: 0.45rem;
}

.study-sidebar-link {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    color: #0f172a;
    display: block;
    padding: 0.65rem 0.75rem;
    text-decoration: none;
}

.study-sidebar-link span,
.study-sidebar-link small {
    display: block;
}

.study-sidebar-link span {
    font-weight: 900;
}

.study-sidebar-link small {
    color: #64748b;
    font-size: 0.76rem;
    line-height: 1.25;
    margin-top: 0.12rem;
}

.study-sidebar-link:hover,
.study-sidebar-link:focus,
.study-sidebar-link.is-active {
    background: #ecfeff;
    border-color: #0891b2;
    color: #164e63;
    outline: none;
}

.study-sidebar-link.is-active {
    box-shadow: inset 4px 0 0 #0891b2;
}

/* Right-hand study links drawer: mirrors the left Study tools sidebar.
   Page-specific cross-modal study pathways (LXX+ Greek links on chapter
   pages, related modules and resource links on lexicon pages) open
   off-canvas from the right edge. */
.study-links-toggle {
    align-items: center;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 999px;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.2);
    color: #fff;
    cursor: pointer;
    display: flex;
    font-weight: 900;
    gap: 0.5rem;
    justify-content: center;
    margin: 0.75rem 0.75rem 0 auto;
    padding: 0.58rem 0.82rem;
    position: sticky;
    top: 0.75rem;
    width: max-content;
    z-index: 1500;
}

.study-links-toggle:hover,
.study-links-toggle:focus {
    background: #1e293b;
    outline: 3px solid rgba(14, 116, 144, 0.24);
}

.study-links-toggle span[aria-hidden="true"] {
    font-size: 1.2rem;
    line-height: 1;
}

.study-links-panel {
    background: rgba(15, 23, 42, 0.22);
    bottom: 0;
    margin: 0;
    max-width: 100vw;
    opacity: 0;
    overflow-y: auto;
    padding: 4.5rem 0 1rem 0.75rem;
    pointer-events: none;
    position: fixed;
    right: 0;
    top: 0;
    transform: translateX(calc(var(--study-sidebar-width) + 1rem));
    transition: opacity 0.18s ease, transform 0.22s ease;
    width: var(--study-sidebar-width);
    z-index: 1490;
}

.study-links-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.study-links-inner {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #cbd5e1;
    border-right: none;
    border-radius: 1rem 0 0 1rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
    min-height: 100%;
    padding: 1rem;
}

.study-links-inner h2 {
    color: #0f172a;
    font-size: 1.05rem;
    margin: 0 0 0.3rem;
}

.study-links-intro {
    color: #475569;
    font-size: 0.82rem;
    margin: 0 0 0.75rem;
}

.study-links-nav {
    display: grid;
    gap: 0.45rem;
}

.study-links-link {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    color: #0f172a;
    display: block;
    padding: 0.65rem 0.75rem;
    text-decoration: none;
}

.study-links-link span,
.study-links-link small {
    display: block;
}

.study-links-link span {
    font-weight: 900;
}

.study-links-link small {
    color: #64748b;
    font-size: 0.76rem;
    line-height: 1.25;
    margin-top: 0.12rem;
}

.study-links-link:hover,
.study-links-link:focus {
    background: #ecfeff;
    border-color: #0891b2;
    color: #164e63;
    outline: none;
}


.study-flow-panel {
    background: #f8fafc;
    border: 1px solid #dbe3ef;
    border-radius: 1rem;
    margin: 1rem 0;
    padding: 1rem;
}

.study-flow-panel h2 {
    margin-top: 0;
}

.study-flow-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.study-flow-links a {
    background: #ecfeff;
    border: 1px solid #a5f3fc;
    border-radius: 999px;
    color: #155e75;
    font-weight: 800;
    padding: 0.45rem 0.7rem;
    text-decoration: none;
}

.study-flow-links a:hover,
.study-flow-links a:focus {
    background: #cffafe;
    outline: 3px solid rgba(14, 116, 144, 0.22);
}

@media (max-width: 1180px) {
    .study-main {
        padding: 0.75rem 0.5rem 0;
    }

    .study-sidebar-links {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .study-toggles {
        top: 0.5rem;
    }

    .study-sidebar {
        width: min(18rem, 88vw);
    }
}

@media (max-width: 640px) {
    .study-main {
        padding: 0.5rem 0.35rem 0;
    }
}

/* ── Trongate MX modal compatibility for the public study shell ──
   (ported from xpd ibis app.css) */
/* ── Trongate MX modal compatibility for the public study shell ──
   The public template does not load the full Trongate admin CSS. MX modals are
   injected under <body>, so define the minimal overlay/container styles here
   instead of letting them inherit from the study sidebar/main flex layout. */
#overlay {
    background: rgba(15, 23, 42, 0.58);
    inset: 0;
    opacity: 1;
    position: fixed;
    z-index: 19990 !important;
}

#modal-container.mx-modal-container {
    align-items: flex-start;
    display: flex;
    height: 100vh;
    justify-content: center;
    left: 0;
    padding: 0 1rem;
    pointer-events: none;
    position: fixed;
    top: 0;
    width: 100vw;
    z-index: 20000 !important;
}

#modal-container.mx-modal-container .modal {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.35);
    color: #0f172a;
    margin-left: auto;
    margin-right: auto;
    max-width: min(570px, calc(100vw - 2rem));
    opacity: 0;
    overflow: hidden;
    pointer-events: auto;
    position: relative;
    transition: margin-top 0.3s ease, opacity 0.3s ease;
    width: 90%;
    z-index: 20010 !important;
}

#modal-container.mx-modal-container .modal-heading,
#modal-container.mx-modal-container .modal-footer {
    padding: 0.85rem 1rem;
}

#modal-container.mx-modal-container .modal-heading {
    background: #0f3460;
    color: #fff;
    font-weight: 800;
}

#modal-container.mx-modal-container .modal-body {
    padding: 1rem;
}

#modal-container.mx-modal-container .modal-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    text-align: right;
}

/* ============================================================= */
/* ---------- Shared dict-shell layout -------------------------- */
/* ---------- Used by lexicon, websters, false_friends ---------- */
/* ============================================================= */

/* Outer container */
.dict-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

/* Hero header — dark navy gradient, white text */
.dict-hero {
    background: linear-gradient(135deg, #172033 0%, #22345a 100%);
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
    color: #fff;
    margin-bottom: 1rem;
    padding: 1.5rem 2rem;
}
.dict-hero .eyebrow {
    color: #ff9334; /* brand orange */
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin: 0 0 0.4rem;
    text-transform: uppercase;
}
.dict-hero h1 {
    color: #fff;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    margin: 0 0 0.5rem;
}
.dict-hero p:last-child {
    color: #c7d0e0;
    margin: 0;
    max-width: 65ch;
}

/* Search form — flex row of input + button(s) */
.dict-search-form {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0 0 0.75rem;
}
.dict-search-form input {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    color: #0f172a;
    flex: 1 1 280px;
    font-size: 0.875rem;
    min-width: 0;
    padding: 0 0.8rem;
}
.dict-search-form input:focus {
    border-color: #2563eb;
    outline: 3px solid rgba(37, 99, 235, 0.25);
}
.dict-search-form button,
.dict-search-form .button {
    margin: 0;
}

/* Tab bar */
.dict-tab-bar {
    background: #eef1f6;
    border: 1px solid #d9dfec;
    border-radius: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 1.25rem;
    padding: 0.4rem;
}
.dict-tab-bar .xpnd-tab {
    background: transparent;
    border: 0;
    border-radius: 0.5rem;
    color: #334155;
    cursor: pointer;
    font-weight: 700;
    margin: 0;
    padding: 0.55rem 1rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.dict-tab-bar .xpnd-tab:hover,
.dict-tab-bar .xpnd-tab:focus {
    background: #e2e8f0;
    color: #0f172a;
}
.dict-tab-bar .xpnd-tab.is-active {
    background: #22345a;
    color: #fff;
}

/* Main body — holds the index + entry panels side by side */
.dict-body {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 0.38fr) minmax(0, 0.62fr);
}

/* Index panel — scrollable list, narrower than the entry panel */
.dict-body .dict-index {
    max-height: 60vh;
    overflow-y: auto;
}

/* Generic panel — always visible in the two-pane body */
.dict-panel {
    background: #fff;
    border: 1px solid #d9dfec;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    display: block;
    padding: 1.25rem;
}
.dict-panel.is-active {
    display: block;
}

/* Index panel — list of entries */
.dict-index ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.dict-index li {
    border-bottom: 1px solid #eef1f6;
}
.dict-index li:last-child {
    border-bottom: 0;
}
.dict-index li a {
    border-radius: 0.4rem;
    color: #1e293b;
    display: block;
    padding: 0.6rem 0.5rem;
    text-decoration: none;
}
.dict-index li a:hover,
.dict-index li a:focus {
    background: #f1f5f9;
}
.dict-index li a.is-active {
    background: #eef6ff;
    color: #1d4ed8;
    font-weight: 700;
}
.dict-index li a small {
    color: #64748b;
    display: block;
    font-size: 0.8rem;
}

/* Entry panel */
.dict-entry-card h2 {
    color: #0f172a;
    font-size: 1.6rem;
    margin: 0 0 0.5rem;
}
.dict-entry-meta {
    color: #475569;
    font-size: 0.9rem;
    margin: 0 0 1rem;
}
.dict-entry-meta strong {
    color: #1e3a8a;
}

/* Entry links — action / cross-reference block */
.dict-entry-links {
    background: #f8fafc;
    border: 1px solid #dbe3ef;
    border-radius: 0.75rem;
    margin: 1rem 0;
    padding: 0.85rem 1rem;
}
.dict-entry-links strong {
    color: #334155;
    display: block;
    margin-bottom: 0.4rem;
}
.dict-entry-links ul {
    margin: 0.4rem 0 0;
    padding-left: 1.25rem;
}
.dict-entry-links li {
    margin-bottom: 0.3rem;
}
.dict-entry-links a {
    color: #1d4ed8;
}

/* Source attribution */
.dict-source {
    border-top: 1px solid #eef1f6;
    color: #64748b;
    font-size: 0.85rem;
    margin: 1rem 0 0;
    padding-top: 0.75rem;
}

/* Sense definition block */
.dict-sense {
    background: #f8fafc;
    border: 1px solid #dbe3ef;
    border-radius: 0.75rem;
    margin: 0.75rem 0;
    padding: 0.85rem 1rem;
}
.dict-sense h3 {
    color: #22345a;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    margin: 0 0 0.35rem;
    text-transform: uppercase;
}
.dict-sense p {
    color: #1e293b;
    margin: 0;
}

/* Etymology section */
.dict-etymology {
    background: #f8fafc;
    border-left: 3px solid #22345a;
    border-radius: 0.5rem;
    color: #334155;
    margin: 0.75rem 0;
    padding: 0.85rem 1rem;
}
.dict-etymology strong {
    color: #22345a;
}

/* Warning message */
.dict-warning {
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 0.75rem;
    color: #92400e;
    margin: 0 0 1.25rem;
    padding: 0.85rem 1rem;
}

/* Alphabet selector grid */
.dict-alphabet {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
}
.dict-alphabet a {
    align-items: center;
    background: #fff;
    border: 1px solid #d9dfec;
    border-radius: 0.5rem;
    color: #1e293b;
    display: inline-flex;
    font-size: 0.95rem;
    font-weight: 700;
    height: 2.2rem;
    justify-content: center;
    min-width: 2.2rem;
    padding: 0 0.4rem;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.dict-alphabet a:hover,
.dict-alphabet a:focus {
    background: #eef6ff;
    border-color: #2563eb;
    color: #1d4ed8;
}
.dict-alphabet a.is-active {
    background: #22345a;
    border-color: #22345a;
    color: #fff;
}

/* Empty states */
.dict-entry-blank,
.dict-index-empty {
    color: #64748b;
    font-style: italic;
    padding: 2rem 1rem;
    text-align: center;
}
.dict-index-empty {
    margin: 0;
}

/* Responsive */
@media (max-width: 640px) {
    .dict-shell {
        padding: 0.25rem 0.5rem 1.5rem;
    }
    .dict-hero {
        padding: 1.25rem 1.25rem;
    }
    .dict-search-form {
        flex-direction: column;
        align-items: stretch;
    }
    .dict-search-form input {
        flex-basis: auto;
    }
    .dict-tab-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    .dict-tab-bar .xpnd-tab {
        white-space: nowrap;
    }
    .dict-body {
        grid-template-columns: 1fr;
    }
    .dict-body .dict-index {
        max-height: 40vh;
    }
}

/* Shared eyebrow label (used across study modules) */
.eyebrow {
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.78rem;
    font-weight: 700;
    color: #8c5a00;
}

/* ─── Workspace display panel embed mode ──────────────────────────
   Pages loaded inside the workspace display-panel iframe receive
   body.workspace-embed. These overrides remove outer shells, auto-
   centering, and generous padding so cards fill the panel width. */
.workspace-embed-content {
    margin: 0;
    padding: 0;
    width: 100%;
}

.workspace-embed-content .hebrew_concepts-shell,
.workspace-embed-content .lexicon-shell,
.workspace-embed-content .cross-ref-shell,
.workspace-embed-content .lexicon-study-shell,
.workspace-embed-content .hebrew_concepts-study-shell {
    max-width: none;
    margin: 0;
    padding: 0.75rem 0.65rem;
}

.workspace-embed-content .hebrew_concepts-hero {
    padding: 1rem 0.85rem;
    margin-bottom: 0.75rem;
}

.workspace-embed-content .hebrew_concepts-hero h1 {
    font-size: clamp(1.3rem, 3vw, 2rem);
}

.workspace-embed-content .concept-definition-list {
    gap: 0.35rem 0.6rem;
}

.workspace-embed-content .concept-toolbar {
    margin: 0 0 0.6rem;
}

.workspace-embed-content .lexicon-hero {
    padding: 0.75rem 0.85rem;
}

.workspace-embed-content .lexicon-study-tabs {
    margin-bottom: 0.35rem;
}

.workspace-embed-content .concept-study-layout,
.workspace-embed-content .concept-study-layout-mapping,
.workspace-embed-content .concept-study-layout-word {
    gap: 0.65rem;
}

.workspace-embed-content .container-wide {
    width: 100%;
    max-width: none;
    padding: 0.5rem 0;
}

.workspace-embed-content .concept-word-header {
    padding: 0.75rem 0.85rem;
}
