/* ==========================================
   BSA Study Bible Reader - Premium Design
   Warm, elegant palette: burgundy/gold/parchment
   Distinct from NTR's cool blue/purple tones
   ========================================== */

/* ----- Hero Section ----- */
.bsa-hero {
    background: linear-gradient(135deg, #1a0f0a 0%, #2c1810 40%, #3d2317 100%);
    padding: 2.5rem 0 1.5rem;
    position: relative;
    text-align: center;
    isolation: isolate;
}
.bsa-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.06;
    background:
        radial-gradient(circle at 20% 80%, #c9a84c 0, transparent 45%),
        radial-gradient(circle at 80% 20%, #8b4513 0, transparent 40%);
    pointer-events: none;
    z-index: -1;
}
.bsa-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.25), transparent);
    z-index: -1;
}

.bsa-header {
    margin-bottom: 1rem;
}

.bsa-badge {
    display: inline-block;
    padding: 0.3rem 1rem;
    background: rgba(201, 168, 76, 0.1);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #d4af37;
    margin-bottom: 0.4rem;
    letter-spacing: 0.04em;
}

.bsa-title {
    font-size: 2rem;
    color: #faf3e0;
    margin: 0;
    font-weight: 700;
    line-height: 1.2;
}

.bsa-title-accent {
    background: linear-gradient(135deg, #d4af37, #c9a84c, #b8952e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bsa-subtitle {
    font-size: 0.85rem;
    color: rgba(250, 243, 224, 0.5);
    margin: 0.3rem 0 0;
    font-weight: 400;
}

/* ----- Toolbar ----- */
.bsa-toolbar {
    max-width: 620px;
    margin: 0 auto;
    background: rgba(250, 243, 224, 0.06);
    border: 1px solid rgba(201, 168, 76, 0.12);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
}

.bsa-toolbar__row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
}

.bsa-select-group {
    position: relative;
    flex-shrink: 0;
}

.bsa-select-group--book {
    min-width: 100px;
}

.bsa-select-group--ch {
    min-width: 60px;
}

.bsa-toolbar__sep {
    display: block;
    width: 1px;
    height: 22px;
    background: rgba(201, 168, 76, 0.15);
    flex-shrink: 0;
}

.bsa-nav-compact {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.bsa-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: 6px;
    background: rgba(250, 243, 224, 0.06);
    color: rgba(250, 243, 224, 0.8);
    cursor: pointer;
    transition: all var(--transition);
}
.bsa-nav-btn:hover:not(:disabled) {
    background: rgba(201, 168, 76, 0.1);
    border-color: rgba(201, 168, 76, 0.3);
    color: #d4af37;
}
.bsa-nav-btn:disabled {
    opacity: 0.25;
    cursor: default;
}

.bsa-search-wrap {
    position: relative;
    flex: 1;
    min-width: 120px;
    max-width: 180px;
}

.bsa-search-icon {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(250, 243, 224, 0.3);
    pointer-events: none;
}

.bsa-search-input {
    width: 100%;
    padding: 0.4rem 0.5rem 0.4rem 1.6rem;
    font-family: var(--font-text);
    font-size: 0.78rem;
    color: rgba(250, 243, 224, 0.9);
    background: rgba(250, 243, 224, 0.06);
    border: 1px solid rgba(201, 168, 76, 0.1);
    border-radius: 6px;
    outline: none;
    transition: all var(--transition);
}
.bsa-search-input::placeholder {
    color: rgba(250, 243, 224, 0.2);
}
.bsa-search-input:focus {
    border-color: #d4af37;
    box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.1);
}

.bsa-font-size {
    display: flex;
    gap: 2px;
    background: rgba(250, 243, 224, 0.05);
    border: 1px solid rgba(201, 168, 76, 0.08);
    border-radius: 6px;
    padding: 2px;
    flex-shrink: 0;
}

.bsa-font-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: rgba(250, 243, 224, 0.3);
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1;
}
.bsa-font-btn[data-size="small"] { font-size: 0.65rem; }
.bsa-font-btn[data-size="medium"] { font-size: 0.82rem; }
.bsa-font-btn[data-size="large"] { font-size: 1rem; }
.bsa-font-btn:hover {
    color: rgba(250, 243, 224, 0.7);
    background: rgba(250, 243, 224, 0.08);
}
.bsa-font-btn--active {
    color: #d4af37 !important;
    background: rgba(201, 168, 76, 0.15) !important;
}

/* ----- Version Select (compact dropdown) ----- */
.bsa-version-select {
    position: relative;
    flex-shrink: 0;
}
.bsa-version-select__trigger {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.35rem 0.5rem;
    background: rgba(250, 243, 224, 0.06);
    border: 1px solid rgba(201, 168, 76, 0.12);
    border-radius: 6px;
    color: rgba(250, 243, 224, 0.7);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.8rem;
}
.bsa-version-select__trigger:hover {
    border-color: rgba(201, 168, 76, 0.25);
    color: #d4af37;
}
.bsa-version-select__icon { font-size: 0.85rem; line-height: 1; }
.bsa-version-select__arrow {
    opacity: 0.5;
    transition: transform 0.2s ease;
}
.bsa-version-select__trigger--open .bsa-version-select__arrow {
    transform: rotate(180deg);
    opacity: 1;
}
.bsa-version-select__panel {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 500;
    min-width: 170px;
    background: #2c1810;
    border: 1px solid rgba(201, 168, 76, 0.12);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-4px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.bsa-version-select__panel--open {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.bsa-version-select__option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(250, 243, 224, 0.7);
    text-decoration: none;
    transition: all 0.15s ease;
}
.bsa-version-select__option:hover {
    background: rgba(201, 168, 76, 0.08);
    color: #faf3e0;
}
.bsa-version-select__option--active {
    color: #d4af37;
    font-weight: 600;
    background: rgba(201, 168, 76, 0.06);
}

/* ----- Reading Section ----- */
.bsa-section {
    padding: 2rem 0 4rem;
    background: #faf6ef;
    min-height: 60vh;
}

/* ----- Content ----- */
.bsa-content {
    max-width: 760px;
    margin: 0 auto;
}

/* ----- Chapter Header ----- */
.bsa-chapter-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(139, 69, 19, 0.08);
}

.bsa-chapter-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: #2c1810;
    margin: 0;
    scroll-margin-top: 1.5rem;
}

/* Font size header — ascuns pe toate ecranele (folosim varianta din toolbar) */
.bsa-font-size--header { display: none; }

/* ----- Section Headings ----- */
.bsa-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    margin: 1.25rem 0 0.75rem;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.04), rgba(201, 168, 76, 0.04));
    border-left: 3px solid #c9a84c;
    border-top: 1px solid rgba(201, 168, 76, 0.08);
    border-right: 1px solid rgba(201, 168, 76, 0.08);
    border-bottom: 1px solid rgba(201, 168, 76, 0.08);
}
.bsa-heading:first-child { margin-top: 0; }
.bsa-heading span {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: #5c3a28;
    letter-spacing: 0.02em;
}
.bsa-heading__note-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 50%;
    background: rgba(201, 168, 76, 0.08);
    color: #b8942e;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
    margin-left: auto;
}
.bsa-heading__note-btn:hover {
    background: rgba(201, 168, 76, 0.15);
    border-color: #c9a84c;
    color: #8b6914;
    transform: scale(1.1);
}
.bsa-heading__note-btn svg { width: 13px; height: 13px; }

/* ----- Paragraphs ----- */
.bsa-paragraphs {
    line-height: 2;
    transition: font-size 0.2s ease, opacity 0.15s ease;
}
.bsa-content[data-font-size="small"] .bsa-paragraphs { font-size: 0.95rem; }
.bsa-content[data-font-size="medium"] .bsa-paragraphs { font-size: 1.08rem; }
.bsa-content[data-font-size="large"] .bsa-paragraphs { font-size: 1.25rem; }

.bsa-paragraph {
    margin-bottom: 0.65rem;
    position: relative;
}

.bsa-paragraph__text {
    color: #2c1810;
    margin: 0;
    position: relative;
    line-height: 1.85;
}

/* Explanation Note Button (inline) */
.bsa-paragraph__note-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    vertical-align: baseline;
    position: relative;
    top: -0.1em;
    padding: 0.05rem 0.35rem 0.05rem 0.2rem;
    border: 1px solid rgba(201, 168, 76, 0.25);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.06), rgba(139, 69, 19, 0.04));
    color: #8b6914;
    cursor: pointer;
    font-family: var(--font-text);
    font-size: 0.72em;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}
.bsa-paragraph__note-btn:hover {
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.15), rgba(139, 69, 19, 0.08));
    border-color: #c9a84c;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(201, 168, 76, 0.2);
}
.bsa-paragraph__note-btn:focus-visible {
    outline: 2px solid #c9a84c;
    outline-offset: 2px;
}

.bsa-paragraph__note-btn--active {
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.2), rgba(139, 69, 19, 0.1)) !important;
    border-color: #b8942e !important;
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

.bsa-paragraph__note-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #d4af37, #b8942e);
    border-radius: 50%;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.bsa-paragraph__note-btn:hover .bsa-paragraph__note-dot {
    transform: scale(1.3);
}

.bsa-paragraph__note-label {
    font-size: 0.68em;
    letter-spacing: 0.02em;
}

/* ----- Verse Numbers (discreet superscript) ----- */
.bsa-verse-num {
    font-size: 0.6em;
    font-weight: 500;
    vertical-align: super;
    line-height: 1;
    color: rgba(44, 24, 16, 0.35);
    letter-spacing: 0;
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
}
.bsa-verse-num:hover {
    color: rgba(44, 24, 16, 0.7);
}

/* ----- Search Highlight ----- */
.bsa-highlight {
    background: rgba(201, 168, 76, 0.25);
    border-radius: 3px;
    padding: 0.05rem 0.15rem;
    transition: background 0.2s ease;
}

/* ----- No Results ----- */
.bsa-no-results {
    text-align: center;
    padding: 3rem 1rem;
    animation: bsaFadeIn 0.3s ease;
}
.bsa-no-results__icon { font-size: 3rem; margin-bottom: 0.75rem; opacity: 0.6; }
.bsa-no-results h3 {
    font-size: 1.25rem;
    color: #2c1810;
    margin-bottom: 0.5rem;
}
.bsa-no-results p {
    font-size: 0.95rem;
    color: rgba(44, 24, 16, 0.55);
}

/* ----- Chapter Footer ----- */
.bsa-chapter-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(139, 69, 19, 0.06);
}
.bsa-chapter-footer__info {
    font-size: 0.85rem;
    color: rgba(44, 24, 16, 0.55);
}

/* ----- Bottom Navigation ----- */
.bsa-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 0.6rem 1rem;
    background: rgba(139, 69, 19, 0.03);
    border: 1px solid rgba(139, 69, 19, 0.06);
    border-radius: var(--radius-sm);
    transition: opacity 0.2s ease;
}

.bsa-bottom-nav__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(139, 69, 19, 0.1);
    border-radius: 6px;
    background: #faf6ef;
    color: rgba(44, 24, 16, 0.6);
    font-family: var(--font-text);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
}
.bsa-bottom-nav__btn:hover:not(:disabled) {
    border-color: #c9a84c;
    color: #2c1810;
    background: rgba(201, 168, 76, 0.04);
}
.bsa-bottom-nav__btn:disabled { opacity: 0.25; cursor: default; }
.bsa-bottom-nav__label { display: none; }
.bsa-bottom-nav__info {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(44, 24, 16, 0.55);
    white-space: nowrap;
    min-width: 70px;
    text-align: center;
    letter-spacing: 0.02em;
}

/* ==========================================
   Explanation Popup - Premium Design
   ========================================== */
.bsa-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 15, 10, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(2px);
}
.bsa-popup-overlay--open {
    opacity: 1;
    pointer-events: auto;
}

.bsa-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: min(92vw, 520px);
    max-height: min(80vh, 600px);
    background: #faf6ef;
    border-radius: 18px;
    box-shadow: 0 25px 60px rgba(26, 15, 10, 0.25), 0 0 0 1px rgba(201, 168, 76, 0.1);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.bsa-popup--open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.bsa-popup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(139, 69, 19, 0.08);
    flex-shrink: 0;
}
.bsa-popup__header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}
.bsa-popup__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.12), rgba(139, 69, 19, 0.06));
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #8b6914;
    white-space: nowrap;
}
.bsa-popup__ref {
    font-size: 0.82rem;
    font-weight: 600;
    color: #2c1810;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bsa-popup__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(44, 24, 16, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.bsa-popup__close:hover {
    background: rgba(139, 69, 19, 0.06);
    color: #2c1810;
}

.bsa-popup__body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    scroll-behavior: smooth;
}
.bsa-popup__body::-webkit-scrollbar { width: 6px; }
.bsa-popup__body::-webkit-scrollbar-track { background: transparent; }
.bsa-popup__body::-webkit-scrollbar-thumb {
    background: rgba(139, 69, 19, 0.12);
    border-radius: 3px;
}
.bsa-popup__body::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 69, 19, 0.2);
}

/* Popup Resource Card */
.bsa-popup-resource {
    animation: bsaFadeIn 0.3s ease;
}

.bsa-popup-resource__header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.65rem;
    border-bottom: 2px solid rgba(201, 168, 76, 0.12);
}

.bsa-popup-resource__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.12), rgba(139, 69, 19, 0.06));
    color: #b8942e;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.bsa-popup-resource__preceding {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: #5c3a28;
    line-height: 1.3;
    font-style: italic;
}
.bsa-popup-resource__preceding::before { content: '„'; }
.bsa-popup-resource__preceding::after { content: '”'; }

.bsa-popup-resource__text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #2c1810;
    margin-bottom: 0.75rem;
}
.bsa-popup-resource__text p {
    margin-bottom: 0.75rem;
}
.bsa-popup-resource__text p:last-child {
    margin-bottom: 0;
}

.bsa-popup-resource__highlight {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.06), rgba(139, 69, 19, 0.03));
    border: 1px solid rgba(201, 168, 76, 0.12);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}
.bsa-popup-resource__highlight-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #b8942e;
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.bsa-popup-resource__highlight-text {
    font-size: 0.88rem;
    line-height: 1.5;
    color: rgba(44, 24, 16, 0.6);
    font-style: italic;
}

/* Footer navigation */
.bsa-popup__footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(139, 69, 19, 0.08);
    flex-shrink: 0;
}
.bsa-popup__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.bsa-popup__nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(139, 69, 19, 0.1);
    border-radius: 8px;
    background: #faf6ef;
    color: rgba(44, 24, 16, 0.6);
    font-family: var(--font-text);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.bsa-popup__nav-btn:hover:not(:disabled) {
    border-color: #c9a84c;
    color: #2c1810;
    background: rgba(201, 168, 76, 0.04);
}
.bsa-popup__nav-btn:disabled { opacity: 0.25; cursor: default; }
.bsa-popup__nav-btn svg { flex-shrink: 0; }
.bsa-popup__counter {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(44, 24, 16, 0.5);
    white-space: nowrap;
}

/* ==========================================
   Custom Select - Premium Dropdown
   ========================================== */

.bsa-custom-select { position: relative; }

.bsa-custom-select__trigger {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    width: 100%;
    padding: 0.4rem 0.6rem;
    font-family: var(--font-text);
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(250, 243, 224, 0.9);
    background: rgba(250, 243, 224, 0.06);
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
    line-height: 1.3;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    letter-spacing: 0.01em;
    white-space: nowrap;
    text-align: left;
    user-select: none;
}
.bsa-custom-select__trigger:hover {
    border-color: rgba(201, 168, 76, 0.3);
}
.bsa-custom-select__trigger:focus-visible {
    border-color: #d4af37;
    box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.15), 0 0 12px rgba(201, 168, 76, 0.08);
}
.bsa-custom-select__trigger:active { transform: scale(0.97); }
.bsa-custom-select__trigger--open {
    border-color: #d4af37;
    background: rgba(201, 168, 76, 0.08);
}

.bsa-custom-select__value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.bsa-custom-select__arrow {
    flex-shrink: 0;
    color: rgba(250, 243, 224, 0.5);
    opacity: 0.7;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.bsa-custom-select__trigger--open .bsa-custom-select__arrow {
    opacity: 1;
    transform: rotate(180deg);
}

/* Panel */
.bsa-custom-select__panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 500;
    min-width: 220px;
    max-width: 320px;
    max-height: 420px;
    background: #2c1810;
    border: 1px solid rgba(201, 168, 76, 0.12);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.15);
    overflow: clip;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(-4px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.bsa-custom-select__panel--open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Panel header */
.bsa-custom-select__panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem 0.4rem;
    flex-shrink: 0;
}
.bsa-custom-select__panel-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(250, 243, 224, 0.55);
    letter-spacing: 0.03em;
}
.bsa-custom-select__panel-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(250, 243, 224, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}
.bsa-custom-select__panel-close:hover {
    background: rgba(250, 243, 224, 0.06);
    color: rgba(250, 243, 224, 0.6);
}

/* Options list */
.bsa-custom-select__options {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0 0.5rem 0.5rem;
}
.bsa-custom-select__options::-webkit-scrollbar { width: 4px; }
.bsa-custom-select__options::-webkit-scrollbar-track { background: transparent; }
.bsa-custom-select__options::-webkit-scrollbar-thumb {
    background: rgba(201, 168, 76, 0.2);
    border-radius: 2px;
}

/* Group label */
.bsa-custom-select__group-label {
    padding: 0.4rem 0.65rem 0.2rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(250, 243, 224, 0.55);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Option item */
.bsa-custom-select__option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.65rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #e3dac8;
    font-family: var(--font-text);
    font-size: 0.82rem;
    font-weight: 600;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
    text-align: left;
}
.bsa-custom-select__option:hover {
    background: rgba(201, 168, 76, 0.08);
    color: #faf3e0;
}
.bsa-custom-select__option--active {
    background: rgba(201, 168, 76, 0.12) !important;
    color: #d4af37 !important;
    font-weight: 600;
}
.bsa-custom-select__option:focus-visible {
    outline: 2px solid #d4af37;
    outline-offset: -2px;
}

/* Option name */
.bsa-custom-select__option-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Option chapter count */
.bsa-custom-select__option-chapters {
    font-size: 0.68rem;
    color: rgba(250, 243, 224, 0.45);
    flex-shrink: 0;
}

/* Grid options (chapters) */
.bsa-custom-select__options--grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.25rem;
    padding: 0.25rem 0.5rem 0.5rem;
}
.bsa-custom-select__options--grid .bsa-custom-select__option {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0.3rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    gap: 0;
}
.bsa-custom-select__options--grid .bsa-custom-select__option:hover {
    background: rgba(201, 168, 76, 0.08);
}

/* ==========================================
   Search Dropdown — Global Bible Search
   ========================================== */

.bsa-search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 600;
    min-width: 280px;
    max-width: min(480px, 95vw);
    max-height: 420px;
    background: #2c1810;
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    flex-direction: column;
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.bsa-search-dropdown--open {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.bsa-search-dropdown__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.85rem;
    border-bottom: 1px solid rgba(201, 168, 76, 0.08);
    flex-shrink: 0;
}
.bsa-search-dropdown__count {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(250, 243, 224, 0.5);
    letter-spacing: 0.04em;
}
.bsa-search-dropdown__hint {
    font-size: 0.6rem;
    color: rgba(250, 243, 224, 0.25);
    letter-spacing: 0.02em;
}

.bsa-search-dropdown__list {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0.25rem 0;
}
.bsa-search-dropdown__list::-webkit-scrollbar { width: 4px; }
.bsa-search-dropdown__list::-webkit-scrollbar-track { background: transparent; }
.bsa-search-dropdown__list::-webkit-scrollbar-thumb {
    background: rgba(201, 168, 76, 0.2);
    border-radius: 2px;
}

.bsa-search-dropdown__item {
    display: block;
    width: 100%;
    padding: 0.55rem 0.85rem;
    border: none;
    background: transparent;
    color: rgba(250, 243, 224, 0.8);
    font-family: var(--font-text);
    text-align: left;
    cursor: pointer;
    transition: all 0.12s ease;
    border-left: 3px solid transparent;
}
.bsa-search-dropdown__item:hover {
    background: rgba(201, 168, 76, 0.08);
    color: #faf3e0;
    border-left-color: rgba(201, 168, 76, 0.3);
}
.bsa-search-dropdown__item--focused {
    background: rgba(201, 168, 76, 0.1) !important;
    color: #faf3e0 !important;
    border-left-color: #d4af37 !important;
    outline: none;
}

.bsa-search-dropdown__item--text {
    border-left-color: rgba(61, 174, 151, 0.42);
}

.bsa-search-dropdown__item--explanation {
    border-left-color: rgba(212, 175, 55, 0.34);
}

.bsa-search-dropdown__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.18rem;
}

.bsa-search-dropdown__ref {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #d4af37;
    margin-bottom: 0.15rem;
    letter-spacing: 0.02em;
}

.bsa-search-dropdown__meta .bsa-search-dropdown__ref {
    margin-bottom: 0;
}

.bsa-search-dropdown__type {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 0.12rem 0.42rem;
    font-family: var(--font-ui);
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.bsa-search-dropdown__type--text {
    background: rgba(61, 174, 151, 0.16);
    color: #8be4d2;
}

.bsa-search-dropdown__type--explanation {
    background: rgba(212, 175, 55, 0.14);
    color: #f3d783;
}

.bsa-search-dropdown__snippet {
    display: block;
    font-size: 0.78rem;
    line-height: 1.55;
    color: rgba(250, 243, 224, 0.55);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.bsa-search-dropdown__snippet mark {
    background: rgba(212, 175, 55, 0.3);
    color: #faf3e0;
    border-radius: 2px;
    padding: 0 0.1rem;
}

.bsa-search-dropdown__more {
    display: block;
    width: calc(100% - 1rem);
    margin: 0.35rem 0.5rem 0.45rem;
    text-align: center;
    padding: 0.58rem 0.85rem;
    border: 1px solid rgba(212, 175, 55, 0.16);
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.08);
    font-size: 0.7rem;
    font-weight: 800;
    color: rgba(250, 243, 224, 0.58);
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
.bsa-search-dropdown__more:hover {
    background: rgba(212, 175, 55, 0.14);
    border-color: rgba(212, 175, 55, 0.36);
    color: #faf3e0;
    transform: translateY(-1px);
}

.bsa-search-dropdown__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 0.85rem;
    font-size: 0.8rem;
    color: rgba(250, 243, 224, 0.4);
}
.bsa-search-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(201, 168, 76, 0.15);
    border-top-color: #d4af37;
    border-radius: 50%;
    animation: bsaSpin 0.6s linear infinite;
}

.bsa-search-dropdown__empty,
.bsa-search-dropdown__error {
    padding: 1.25rem 0.85rem;
    text-align: center;
    font-size: 0.82rem;
    color: rgba(250, 243, 224, 0.4);
    line-height: 1.5;
}

.bsa-search-modal-open {
    overflow: hidden;
}

.bsa-search-modal {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 3vw, 2rem);
}

.bsa-search-modal--open {
    display: flex;
}

.bsa-search-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 28, 36, 0.58);
    backdrop-filter: blur(10px);
}

.bsa-search-modal__panel {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    max-height: min(82vh, 760px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.18);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 253, 247, 0.99), rgba(247, 251, 246, 0.98));
    box-shadow: 0 28px 86px rgba(9, 28, 36, 0.36);
}

.bsa-search-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem clamp(1rem, 3vw, 1.55rem);
    border-bottom: 1px solid rgba(17, 61, 57, 0.08);
    background: linear-gradient(135deg, rgba(223, 247, 239, 0.72), rgba(255, 244, 210, 0.54));
}

.bsa-search-modal__eyebrow {
    display: block;
    margin-bottom: 0.22rem;
    color: rgba(17, 61, 57, 0.58);
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.bsa-search-modal__title {
    margin: 0;
    color: #173d39;
    font-family: var(--font-heading);
    font-size: clamp(1.25rem, 2.4vw, 1.85rem);
    line-height: 1.1;
}

.bsa-search-modal__summary {
    margin: 0.3rem 0 0;
    color: rgba(17, 61, 57, 0.62);
    font-family: var(--font-ui);
    font-size: 0.86rem;
    font-weight: 700;
}

.bsa-search-modal__close {
    flex: 0 0 auto;
    width: 2.35rem;
    height: 2.35rem;
    border: 1px solid rgba(17, 61, 57, 0.12);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.74);
    color: rgba(17, 61, 57, 0.72);
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.bsa-search-modal__close:hover {
    background: #fff;
    color: #173d39;
    transform: scale(1.04);
}

.bsa-search-modal__body {
    flex: 1;
    overflow: auto;
    padding: 0.65rem;
    background: rgba(255, 253, 247, 0.74);
}

.bsa-search-modal__list {
    display: grid;
    gap: 0.45rem;
}

.bsa-search-modal__item {
    display: block;
    width: 100%;
    padding: 0.82rem 0.95rem;
    border: 1px solid rgba(17, 61, 57, 0.08);
    border-left: 4px solid transparent;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.76);
    color: #173d39;
    font-family: var(--font-text);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.bsa-search-modal__item:hover {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(17, 61, 57, 0.1);
}

.bsa-search-modal__item--text {
    border-left-color: rgba(77, 184, 160, 0.78);
}

.bsa-search-modal__item--explanation {
    border-left-color: rgba(245, 200, 76, 0.9);
}

.bsa-search-modal__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.25rem;
}

.bsa-search-modal__ref {
    color: #173d39;
    font-family: var(--font-ui);
    font-size: 0.83rem;
    font-weight: 900;
}

.bsa-search-modal__type {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 0.16rem 0.48rem;
    font-family: var(--font-ui);
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.bsa-search-modal__type--text {
    background: rgba(77, 184, 160, 0.14);
    color: #117f73;
}

.bsa-search-modal__type--explanation {
    background: rgba(245, 200, 76, 0.18);
    color: #8b6b10;
}

.bsa-search-modal__snippet {
    display: block;
    color: rgba(17, 61, 57, 0.72);
    font-size: 0.92rem;
    line-height: 1.62;
}

.bsa-search-modal__snippet mark {
    background: rgba(233, 118, 91, 0.18);
    color: #173d39;
    border-radius: 3px;
    padding: 0 0.12rem;
}

.bsa-search-modal__loading,
.bsa-search-modal__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 12rem;
    color: rgba(17, 61, 57, 0.62);
    font-family: var(--font-ui);
    font-size: 0.92rem;
    font-weight: 800;
    text-align: center;
}

.bsa-search-modal__loading--done {
    min-height: 4.5rem;
    color: rgba(17, 61, 57, 0.42);
    font-size: 0.82rem;
}

@keyframes bsaSpin {
    to { transform: rotate(360deg); }
}

/* Animations */
@keyframes bsaFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 768px) {
    .bsa-hero { padding: 1.5rem 0 1rem; }
    .bsa-title { font-size: 1.6rem; }
    .bsa-toolbar { padding: 0.4rem 0.5rem; border-radius: var(--radius-sm); }
    .bsa-toolbar__row { gap: 0.3rem; }
    .bsa-section { padding: 1.25rem 0 3rem; }
    .bsa-chapter-title { font-size: 1.3rem; }
    .bsa-select-group--book { min-width: 80px; }
    .bsa-search-wrap { min-width: 80px; max-width: 130px; }
    .bsa-search-input { font-size: 0.72rem; padding: 0.3rem 0.4rem 0.3rem 1.4rem; }

    .bsa-font-size--header { display: none; }
    .bsa-font-size { gap: 1px; padding: 1px; }
    .bsa-font-btn { width: 22px; height: 22px; }

    .bsa-paragraph__note-btn { font-size: 0.65em; padding: 0.02rem 0.25rem 0.02rem 0.15rem; }
    .bsa-paragraph__note-dot { width: 5px; height: 5px; }
    .bsa-paragraph__note-label { display: none; }

    .bsa-version-select__panel { left: auto; right: 0; max-width: min(260px, calc(100vw - 1.5rem)); }

    .bsa-custom-select__panel {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.95);
        max-width: min(90vw, 360px);
        max-height: 70vh;
        z-index: 10000;
    }
    .bsa-custom-select__panel--open {
        transform: translate(-50%, -50%) scale(1);
    }
    .bsa-custom-select__options--grid { grid-template-columns: repeat(4, 1fr); }
    .bsa-custom-select__panel-close { display: flex; }

    .bsa-bottom-nav__label { display: inline; }
}

@media (max-width: 480px) {
    .bsa-toolbar__sep { display: none; }
    .bsa-version-select { order: 10; }
    .bsa-search-wrap { order: 11; min-width: 60px; max-width: 100px; }
    .bsa-font-size { order: 12; }
    .bsa-select-group--book { min-width: 70px; }
    .bsa-custom-select__trigger { font-size: 0.75rem; padding: 0.3rem 0.4rem; }
    .bsa-custom-select__options--grid { grid-template-columns: repeat(3, 1fr); }
    .bsa-paragraph { margin-bottom: 0.5rem; }
}

/* ==========================================
   Study Notes Refinement
   ========================================== */
.bsa-content {
    max-width: 920px;
}

.bsa-chapter-header {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.bsa-paragraphs {
    line-height: 1.86;
}

.bsa-paragraph {
    border-radius: 16px;
}

.bsa-paragraph--with-notes {
    margin: 0.9rem 0;
    padding: 1rem 1.1rem 0.95rem;
    background:
        linear-gradient(135deg, rgba(255, 252, 245, 0.96), rgba(250, 238, 214, 0.82)),
        linear-gradient(90deg, rgba(201, 168, 76, 0.1), transparent 46%);
    border: 1px solid rgba(139, 69, 19, 0.09);
    border-left: 4px solid rgba(201, 168, 76, 0.76);
    box-shadow: 0 14px 34px rgba(69, 43, 26, 0.055);
}

.bsa-paragraph--with-notes:hover {
    border-color: rgba(139, 69, 19, 0.13);
    box-shadow: 0 18px 44px rgba(69, 43, 26, 0.075);
}

.bsa-paragraph__text > .bsa-paragraph__note-btn {
    display: none !important;
}

.bsa-paragraph__study-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    margin-top: 0.75rem;
    padding: 0.36rem 0.6rem 0.36rem 0.48rem;
    border: 1px solid rgba(160, 110, 35, 0.18);
    border-radius: 999px;
    background: rgba(255, 250, 241, 0.9);
    color: #79531a;
    font-family: var(--font-text);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68), 0 8px 18px rgba(101, 65, 24, 0.055);
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.bsa-paragraph__study-btn:hover,
.bsa-paragraph__study-btn.bsa-expl-trigger--active {
    background: #fff7e7;
    border-color: rgba(201, 168, 76, 0.48);
    color: #4d3014;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 12px 24px rgba(101, 65, 24, 0.08);
    transform: translateY(-1px);
}

.bsa-paragraph__study-btn:focus-visible {
    outline: 2px solid rgba(201, 168, 76, 0.82);
    outline-offset: 3px;
}

.bsa-paragraph__study-mark {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #d7b553, #9b6d1b);
    box-shadow: 0 0 0 4px rgba(201, 168, 76, 0.13);
}

.bsa-paragraph__study-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    background: rgba(121, 83, 26, 0.1);
    color: #6b4918;
    font-size: 0.68rem;
}

.bsa-heading--with-notes {
    padding-right: 0.65rem;
}

.bsa-heading__note-btn {
    gap: 0.25rem;
    width: auto;
    min-width: 2.1rem;
    padding: 0 0.42rem;
    border-radius: 999px;
}

.bsa-heading__note-btn span {
    font-family: var(--font-text);
    font-size: 0.7rem;
    font-weight: 800;
    color: inherit;
}

.bsa-heading__note-btn.bsa-expl-trigger--active {
    background: rgba(201, 168, 76, 0.2);
    border-color: rgba(201, 168, 76, 0.52);
    color: #5f4215;
}

.bsa-verse-num {
    margin-right: 0.14em;
    font-size: 0.58em;
    font-weight: 700;
    color: rgba(117, 76, 31, 0.48);
}

.bsa-popup {
    width: min(94vw, 720px);
    max-height: min(86vh, 680px);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 252, 245, 0.99), rgba(250, 246, 239, 0.99)),
        #faf6ef;
    box-shadow: 0 30px 86px rgba(26, 15, 10, 0.28), 0 0 0 1px rgba(201, 168, 76, 0.16);
}

.bsa-popup__header {
    padding: 0.9rem 1rem 0.8rem 1.2rem;
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.08), rgba(139, 69, 19, 0.035));
}

.bsa-popup__badge {
    background: rgba(255, 250, 241, 0.78);
}

.bsa-popup__ref {
    color: rgba(44, 24, 16, 0.68);
}

.bsa-popup__body {
    padding: 1.15rem;
}

.bsa-popup-resource__header {
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 0.95rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid rgba(201, 168, 76, 0.13);
    border-left: 4px solid rgba(201, 168, 76, 0.72);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 250, 241, 0.96), rgba(250, 238, 214, 0.55));
}

.bsa-popup-resource__icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
}

.bsa-popup-resource__preceding {
    font-family: var(--font-text);
    font-size: 0.96rem;
    font-weight: 700;
    color: #4b2d18;
    font-style: normal;
}

.bsa-popup-resource__text {
    padding: 1rem 1.05rem;
    border: 1px solid rgba(139, 69, 19, 0.075);
    border-radius: 16px;
    background: rgba(255, 253, 248, 0.78);
    color: #2f1b11;
}

.bsa-popup-resource__text p {
    margin-bottom: 0.9rem;
}

.bsa-popup-resource__text p:first-child {
    color: #5f4215;
    font-weight: 700;
}

.bsa-popup-resource__highlight {
    margin-top: 0.9rem;
    margin-bottom: 0;
    background: rgba(201, 168, 76, 0.07);
}

.bsa-custom-select__search {
    position: relative;
    padding: 0 0.75rem 0.5rem;
    flex-shrink: 0;
}

.bsa-custom-select__search-icon {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(250, 243, 224, 0.32);
    pointer-events: none;
}

.bsa-custom-select__search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.45rem 0.5rem 0.45rem 1.6rem;
    border: 1px solid rgba(201, 168, 76, 0.1);
    border-radius: 8px;
    background: rgba(250, 243, 224, 0.06);
    color: rgba(250, 243, 224, 0.9);
    font-family: var(--font-text);
    font-size: 0.8rem;
    outline: none;
}

.bsa-custom-select__search-input::placeholder {
    color: rgba(250, 243, 224, 0.24);
}

.bsa-custom-select__search-input:focus {
    border-color: #d4af37;
    box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.12);
}

.bsa-custom-select__option--selected {
    background: rgba(201, 168, 76, 0.12) !important;
    color: #d4af37 !important;
}

.bsa-custom-select__backdrop {
    position: fixed;
    inset: 0;
    z-index: 480;
    background: rgba(26, 15, 10, 0.36);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.bsa-custom-select__backdrop--visible {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .bsa-content {
        max-width: 100%;
    }

    .bsa-paragraph--with-notes {
        margin: 0.75rem 0;
        padding: 0.85rem 0.85rem 0.8rem;
        border-radius: 14px;
    }

    .bsa-paragraph__study-btn {
        margin-top: 0.6rem;
        font-size: 0.72rem;
    }

    .bsa-popup {
        width: calc(100vw - 1.5rem);
        max-height: calc(100vh - 2rem);
        border-radius: 18px;
    }

    .bsa-popup__header {
        padding: 0.78rem 0.8rem 0.72rem 0.9rem;
    }

    .bsa-popup__body {
        padding: 0.9rem;
    }

    .bsa-popup-resource__header,
    .bsa-popup-resource__text {
        border-radius: 14px;
    }
}

/* ==========================================
   Optimistic Premium Palette
   ========================================== */
:root {
    --bsa-optimistic-ink: #173d39;
    --bsa-optimistic-muted: #5a746e;
    --bsa-optimistic-teal: #117f73;
    --bsa-optimistic-teal-soft: #dff7ef;
    --bsa-optimistic-gold: #d7a82f;
    --bsa-optimistic-sun: #f5c84c;
    --bsa-optimistic-coral: #e9765b;
    --bsa-optimistic-cream: #fff9eb;
    --bsa-optimistic-paper: #fffdf7;
    --bsa-optimistic-border: rgba(17, 127, 115, 0.16);
}

.bsa-hero {
    background:
        linear-gradient(135deg, rgba(255, 249, 235, 0.98) 0%, rgba(224, 249, 238, 0.96) 42%, rgba(220, 244, 255, 0.92) 72%, rgba(255, 229, 198, 0.95) 100%);
    z-index: 30;
    overflow: visible;
}

.bsa-hero::before {
    opacity: 0.42;
    background:
        linear-gradient(115deg, rgba(17, 127, 115, 0.16), transparent 34%),
        linear-gradient(245deg, rgba(245, 200, 76, 0.22), transparent 38%);
}

.bsa-hero::after {
    background: linear-gradient(90deg, transparent, rgba(17, 127, 115, 0.24), rgba(215, 168, 47, 0.28), transparent);
}

.bsa-badge {
    background: rgba(255, 255, 255, 0.74);
    border-color: rgba(17, 127, 115, 0.16);
    color: var(--bsa-optimistic-teal);
    box-shadow: 0 8px 22px rgba(17, 127, 115, 0.08);
}

.bsa-title {
    color: var(--bsa-optimistic-ink);
}

.bsa-title-accent {
    background: linear-gradient(135deg, var(--bsa-optimistic-teal), #35aa89, var(--bsa-optimistic-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bsa-subtitle {
    color: rgba(23, 61, 57, 0.66);
}

.bsa-toolbar {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(17, 127, 115, 0.14);
    box-shadow: 0 18px 42px rgba(17, 127, 115, 0.1);
    position: relative;
    z-index: 40;
}

.bsa-toolbar__sep {
    background: rgba(17, 127, 115, 0.14);
}

.bsa-nav-btn,
.bsa-custom-select__trigger,
.bsa-version-select__trigger,
.bsa-search-input,
.bsa-font-size,
.bsa-verse-toggle {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(17, 127, 115, 0.16);
    color: rgba(23, 61, 57, 0.82);
}

.bsa-nav-btn:hover:not(:disabled),
.bsa-custom-select__trigger:hover,
.bsa-custom-select__trigger--open,
.bsa-version-select__trigger:hover,
.bsa-version-select__trigger--open,
.bsa-search-input:focus {
    border-color: rgba(17, 127, 115, 0.42);
    color: var(--bsa-optimistic-teal);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 0 3px rgba(17, 127, 115, 0.1);
}

.bsa-custom-select__arrow,
.bsa-version-select__arrow,
.bsa-search-icon {
    color: rgba(23, 61, 57, 0.46);
}

.bsa-search-input::placeholder {
    color: rgba(23, 61, 57, 0.36);
}

.bsa-font-btn {
    color: rgba(23, 61, 57, 0.46);
}

.bsa-font-btn:hover {
    color: var(--bsa-optimistic-teal);
    background: rgba(17, 127, 115, 0.08);
}

.bsa-font-btn--active {
    color: var(--bsa-optimistic-teal) !important;
    background: rgba(17, 127, 115, 0.12) !important;
}

.bsa-section {
    background:
        linear-gradient(180deg, #fbfff8 0%, #fff9eb 44%, #fffdf7 100%);
    position: relative;
    z-index: 1;
}

.bsa-chapter-title,
.bsa-paragraph__text,
.bsa-no-results h3,
.bsa-bottom-nav__info,
.bsa-popup__ref {
    color: var(--bsa-optimistic-ink);
}

.bsa-chapter-header,
.bsa-chapter-footer,
.bsa-popup__header,
.bsa-popup__footer {
    border-color: rgba(17, 127, 115, 0.1);
}

.bsa-heading {
    background: linear-gradient(135deg, rgba(17, 127, 115, 0.07), rgba(245, 200, 76, 0.1));
    border-left-color: var(--bsa-optimistic-teal);
    border-top-color: rgba(17, 127, 115, 0.1);
    border-right-color: rgba(17, 127, 115, 0.1);
    border-bottom-color: rgba(17, 127, 115, 0.1);
}

.bsa-heading span {
    color: #24504a;
}

.bsa-heading__note-btn,
.bsa-paragraph__note-btn {
    background: rgba(255, 255, 255, 0.74);
    border-color: rgba(17, 127, 115, 0.18);
    color: var(--bsa-optimistic-teal);
}

.bsa-heading__note-btn:hover,
.bsa-heading__note-btn.bsa-expl-trigger--active,
.bsa-paragraph__note-btn:hover,
.bsa-paragraph__note-btn--active {
    background: rgba(223, 247, 239, 0.9) !important;
    border-color: rgba(17, 127, 115, 0.42) !important;
    color: #0c5f55 !important;
    box-shadow: 0 8px 22px rgba(17, 127, 115, 0.1);
}

.bsa-paragraph--with-notes {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(223, 247, 239, 0.48)),
        linear-gradient(90deg, rgba(17, 127, 115, 0.08), transparent 48%);
    border-color: rgba(17, 127, 115, 0.13);
    border-left-color: rgba(17, 127, 115, 0.78);
    box-shadow: 0 16px 38px rgba(17, 127, 115, 0.07);
}

.bsa-paragraph--with-notes:hover {
    border-color: rgba(17, 127, 115, 0.22);
    box-shadow: 0 20px 46px rgba(17, 127, 115, 0.1);
}

.bsa-paragraph__study-btn {
    background: rgba(255, 255, 255, 0.86);
    border-color: rgba(17, 127, 115, 0.18);
    color: var(--bsa-optimistic-teal);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 8px 20px rgba(17, 127, 115, 0.07);
}

.bsa-paragraph__study-btn:hover,
.bsa-paragraph__study-btn.bsa-expl-trigger--active {
    background: rgba(223, 247, 239, 0.96);
    border-color: rgba(17, 127, 115, 0.42);
    color: #0b5e55;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 12px 28px rgba(17, 127, 115, 0.12);
}

.bsa-paragraph__study-mark,
.bsa-paragraph__note-dot {
    background: linear-gradient(135deg, var(--bsa-optimistic-coral), var(--bsa-optimistic-sun));
    box-shadow: 0 0 0 4px rgba(233, 118, 91, 0.14);
}

.bsa-paragraph__study-count {
    background: rgba(17, 127, 115, 0.1);
    color: #0b5e55;
}

.bsa-verse-num {
    color: rgba(17, 127, 115, 0.52);
}

.bsa-verse-num:hover {
    color: var(--bsa-optimistic-teal);
}

.bsa-crossrefs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin: -0.2rem 0 1.05rem;
    color: rgba(23, 61, 57, 0.48);
    font-size: 0.78rem;
    line-height: 1.45;
}

.bsa-crossrefs__label {
    color: rgba(17, 127, 115, 0.48);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bsa-crossrefs__items {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.bsa-crossrefs__link,
.bsa-crossrefs__text {
    display: inline-flex;
    align-items: center;
    padding: 0.16rem 0.48rem;
    border: 1px solid rgba(17, 127, 115, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.54);
    color: rgba(23, 61, 57, 0.62);
    font-size: 0.76rem;
    font-weight: 600;
    text-decoration: none;
}

.bsa-crossrefs__link:hover,
.bsa-crossrefs__link:focus-visible {
    border-color: rgba(17, 127, 115, 0.28);
    background: rgba(223, 247, 239, 0.78);
    color: var(--bsa-optimistic-teal);
    outline: none;
}

.bsa-paragraph--focused {
    outline: 2px solid rgba(233, 118, 91, 0.48);
    outline-offset: 4px;
    box-shadow: 0 0 0 6px rgba(233, 118, 91, 0.1), 0 18px 48px rgba(17, 127, 115, 0.12);
    transition: outline-color 0.2s ease, box-shadow 0.2s ease;
}

@media (max-width: 640px) {
    .bsa-crossrefs {
        justify-content: flex-start;
        margin: -0.1rem 0 0.85rem;
        font-size: 0.74rem;
    }

    .bsa-crossrefs__link,
    .bsa-crossrefs__text {
        font-size: 0.72rem;
        padding: 0.13rem 0.42rem;
    }
}

.bsa-bottom-nav {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(17, 127, 115, 0.12);
}

.bsa-bottom-nav__btn {
    background: var(--bsa-optimistic-paper);
    border-color: rgba(17, 127, 115, 0.14);
    color: rgba(23, 61, 57, 0.66);
}

.bsa-bottom-nav__btn:hover:not(:disabled) {
    border-color: rgba(17, 127, 115, 0.36);
    color: var(--bsa-optimistic-teal);
    background: rgba(223, 247, 239, 0.66);
}

.bsa-custom-select__panel,
.bsa-version-select__panel,
.bsa-search-dropdown {
    background: #173d39;
    border-color: rgba(245, 200, 76, 0.18);
    box-shadow: 0 18px 46px rgba(12, 58, 53, 0.28);
    z-index: 1200;
}

.bsa-custom-select__panel-title,
.bsa-custom-select__group-label,
.bsa-search-dropdown__count {
    color: rgba(255, 249, 235, 0.62);
}

.bsa-custom-select__option,
.bsa-version-select__option,
.bsa-search-dropdown__item {
    color: rgba(255, 249, 235, 0.86);
}

.bsa-custom-select__option:hover,
.bsa-version-select__option:hover,
.bsa-search-dropdown__item:hover,
.bsa-search-dropdown__item--focused {
    background: rgba(245, 200, 76, 0.12) !important;
    color: #fff9eb !important;
    border-left-color: var(--bsa-optimistic-sun) !important;
}

.bsa-custom-select__option--active,
.bsa-custom-select__option--selected,
.bsa-version-select__option--active {
    background: rgba(245, 200, 76, 0.15) !important;
    color: #f9d978 !important;
}

.bsa-custom-select__option-chapters,
.bsa-search-dropdown__snippet,
.bsa-search-dropdown__hint,
.bsa-search-dropdown__more,
.bsa-search-dropdown__loading,
.bsa-search-dropdown__empty,
.bsa-search-dropdown__error {
    color: rgba(255, 249, 235, 0.54);
}

.bsa-search-dropdown__ref {
    color: #f9d978;
}

.bsa-search-dropdown__snippet mark {
    background: rgba(233, 118, 91, 0.34);
    color: #fff9eb;
}

.bsa-search-dropdown__item--text {
    border-left-color: rgba(77, 184, 160, 0.52);
}

.bsa-search-dropdown__item--explanation {
    border-left-color: rgba(245, 200, 76, 0.4);
}

.bsa-search-dropdown__item--text:hover,
.bsa-search-dropdown__item--text.bsa-search-dropdown__item--focused {
    background: rgba(77, 184, 160, 0.12) !important;
    border-left-color: #4db8a0 !important;
}

.bsa-search-dropdown__item--explanation:hover,
.bsa-search-dropdown__item--explanation.bsa-search-dropdown__item--focused {
    background: rgba(245, 200, 76, 0.12) !important;
    border-left-color: var(--bsa-optimistic-sun) !important;
}

.bsa-search-dropdown__type--text {
    background: rgba(77, 184, 160, 0.16);
    color: #9be9da;
}

.bsa-search-dropdown__type--explanation {
    background: rgba(245, 200, 76, 0.14);
    color: #f9d978;
}

.bsa-custom-select__search-input {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(245, 200, 76, 0.16);
    color: #fff9eb;
}

.bsa-custom-select__search-input::placeholder {
    color: rgba(255, 249, 235, 0.34);
}

.bsa-custom-select__search-input:focus {
    border-color: rgba(245, 200, 76, 0.62);
    box-shadow: 0 0 0 2px rgba(245, 200, 76, 0.14);
}

.bsa-popup-overlay {
    background: rgba(17, 61, 57, 0.42);
}

.bsa-popup {
    background: linear-gradient(180deg, rgba(255, 253, 247, 0.99), rgba(246, 255, 249, 0.99)), var(--bsa-optimistic-paper);
    box-shadow: 0 30px 86px rgba(17, 61, 57, 0.24), 0 0 0 1px rgba(17, 127, 115, 0.14);
}

.bsa-popup__header {
    background: linear-gradient(135deg, rgba(223, 247, 239, 0.88), rgba(255, 244, 210, 0.76));
}

.bsa-popup__badge {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(17, 127, 115, 0.14);
    color: var(--bsa-optimistic-teal);
}

.bsa-popup__close {
    color: rgba(23, 61, 57, 0.56);
}

.bsa-popup__close:hover {
    background: rgba(17, 127, 115, 0.08);
    color: var(--bsa-optimistic-ink);
}

.bsa-popup-resource__header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(223, 247, 239, 0.58));
    border-color: rgba(17, 127, 115, 0.14);
    border-left-color: rgba(17, 127, 115, 0.72);
}

.bsa-popup-resource__icon {
    background: linear-gradient(135deg, rgba(17, 127, 115, 0.12), rgba(245, 200, 76, 0.18));
    color: var(--bsa-optimistic-teal);
}

.bsa-popup-resource__header .bsa-popup-resource__icon {
    display: none;
}

.bsa-popup-resource__preceding,
.bsa-popup-resource__text {
    color: var(--bsa-optimistic-ink);
}

.bsa-popup-resource__header {
    margin-bottom: 0.75rem;
    padding: 0.55rem 0.7rem;
    border-left-width: 2px;
    background: rgba(255, 255, 255, 0.46);
    box-shadow: none;
}

.bsa-popup-resource__preceding {
    font-family: var(--font-text);
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1.45;
    color: rgba(23, 61, 57, 0.56);
}

.bsa-popup-resource__text {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(17, 127, 115, 0.1);
    color: #20252b;
    font-weight: 400;
    font-size: 0.98rem;
    line-height: 1.78;
    box-shadow: 0 14px 34px rgba(17, 127, 115, 0.06);
}

.bsa-popup-resource__text p,
.bsa-popup-resource__text p:first-child {
    color: #20252b;
    font-weight: 400;
    margin: 0;
}

.bsa-popup-resource__text p + p {
    margin-top: 0.92rem;
    padding-top: 0.92rem;
    border-top: 1px solid rgba(23, 61, 57, 0.08);
}

.bsa-popup-resource__highlight-label {
    color: var(--bsa-optimistic-teal);
}

.bsa-popup-resource__highlight {
    background: rgba(255, 244, 210, 0.72);
    border-color: rgba(215, 168, 47, 0.18);
}

.bsa-popup-resource__highlight-text {
    color: rgba(23, 61, 57, 0.66);
}

.bsa-popup__nav-btn {
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(17, 127, 115, 0.14);
    color: rgba(23, 61, 57, 0.68);
}

.bsa-popup__nav-btn:hover:not(:disabled) {
    background: rgba(223, 247, 239, 0.8);
    border-color: rgba(17, 127, 115, 0.34);
    color: var(--bsa-optimistic-teal);
}

.bsa-popup__counter,
.bsa-chapter-footer__info,
.bsa-no-results p {
    color: var(--bsa-optimistic-muted);
}

/* Mobile selector layer fix: keep book/chapter pickers above the backdrop
   and let their own lists scroll instead of the Bible text behind them. */
@media (max-width: 768px) {
    body.bsa-custom-select-open {
        overflow: hidden;
    }

    .bsa-custom-select__backdrop,
    .bsa-custom-select__backdrop--visible {
        z-index: 20 !important;
        touch-action: none;
    }

    .bsa-custom-select__panel {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        width: min(92vw, 380px) !important;
        max-width: min(92vw, 380px) !important;
        max-height: min(72dvh, 560px) !important;
        z-index: 99990 !important;
        overflow: hidden !important;
        transform: translate(-50%, -50%) scale(0.96) !important;
        overscroll-behavior: contain;
    }

    .bsa-custom-select__panel--open {
        transform: translate(-50%, -50%) scale(1) !important;
    }

    .bsa-custom-select__options {
        min-height: 0;
        max-height: none !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }
}
