* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #3b82f6;
    --accent-color: #2563eb;
    --text-color: #111827;
    --light-text: #6b7280;
    --bg-color: #f8f9fb;
    --light-bg: #ffffff;
    --border-color: #e5e7eb;
    --success-color: #059669;
    --reading-max: 42rem;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1rem;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

.nav-ref-input-wrap {
    flex: 1;
    max-width: 20rem;
}

.nav-ref-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-color);
    color: var(--text-color);
}

.nav-ref-input::placeholder { color: var(--light-text); }
.nav-ref-input {
    touch-action: manipulation;
}
.nav-ref-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--light-text);
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-links a:hover { color: var(--primary-color); }

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6rem 20px;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero .btn-primary { background: white; color: #667eea; border-color: white; }
.hero .btn-primary:hover { background: #f8f9ff; border-color: #f8f9ff; }
.hero .btn-secondary { background: transparent; color: white; border-color: rgba(255,255,255,0.7); }
.hero .btn-secondary:hover { background: white; color: #667eea; border-color: white; }

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }

.btn-secondary {
    background: var(--light-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-color);
    border-color: var(--light-text);
}

/* Sections */
section {
    padding: 4rem 20px;
}

section h3 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
    text-align: center;
}

/* About Section */
.about {
    background-color: var(--light-bg);
}

.about ul.feature-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.about li {
    padding: 1rem;
    background: white;
    border-left: 4px solid var(--secondary-color);
    border-radius: 0.25rem;
}

.about strong {
    color: var(--primary-color);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.feature-card h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.feature-card p {
    color: var(--light-text);
}

/* Principles */
.principles {
    background-color: var(--light-bg);
}

.principles-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.principle {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    border-top: 4px solid var(--secondary-color);
}

.principle h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.principle p {
    color: var(--light-text);
    line-height: 1.8;
}

/* Technology Section */
.technology {
    background-color: white;
}

.tech-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tech-category {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--secondary-color);
}

.tech-category h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.tech-category ul {
    list-style: none;
}

.tech-category li {
    padding: 0.5rem 0;
    color: var(--light-text);
}

.tech-category li:before {
    content: "▸ ";
    color: var(--secondary-color);
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Source Code Section */
.source-code {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.source-code h3 {
    color: white;
}

.source-code p {
    margin-bottom: 1.5rem;
}

/* Footer */
.footer {
    background-color: #1f2937;
    color: white;
    text-align: center;
    padding: 2rem 20px;
    margin-top: 4rem;
}

.footer p {
    margin: 0.5rem 0;
    color: #d1d5db;
}

.heart {
    color: #ef4444;
}

/* Responsive Design - Mobile-first breakpoints: 768, 430, 360 */

@media (max-width: 768px) {
    .navbar .container {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0.5rem 1rem;
    }

    .nav-ref-input-wrap {
        order: 3;
        max-width: 100%;
        width: 100%;
        flex-basis: 100%;
        margin-top: 0.25rem;
    }

    .nav-ref-input {
        min-height: 2.75rem;
        font-size: 1rem;
        padding: 0.5rem 0.875rem;
    }

    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .nav-links a {
        padding: 0.35rem 0;
        min-height: 2.25rem;
        display: inline-flex;
        align-items: center;
    }

    .hero h2 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .cta-buttons a {
        width: 100%;
        text-align: center;
        min-height: 2.75rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    section {
        padding: 2rem 1rem;
    }

    .container {
        padding: 0 1rem;
    }

    section h3 {
        font-size: 1.5rem;
    }

    .features-grid,
    .principles-content,
    .tech-stack {
        grid-template-columns: 1fr;
    }

    /* Passage layout: stack main then sidebar */
    .passage-layout {
        flex-direction: column;
        gap: 1.25rem;
        padding: 0;
    }

    .passage-section {
        max-width: none;
        padding: 1rem;
    }

    .passage-ref-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    .passage-form {
        gap: 0.45rem;
        padding: 0.65rem 0.75rem;
    }

    .passage-form select {
        min-width: 0;
        width: 100%;
        min-height: 2.5rem;
    }

    .passage-form input[type="number"],
    .passage-form input[type="text"] {
        min-height: 2.5rem;
    }

    .quick-ref-input {
        width: 100%;
        min-width: 0;
    }

    .passage-form .btn-primary {
        min-height: 2.75rem;
        width: 100%;
        margin-top: 0;
    }

    .passage-structured-summary {
        font-size: 0.84rem;
        padding-top: 0.25rem;
    }

    /* Search */
    .search-row {
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: stretch;
    }

    .lemma-search-row {
        flex-wrap: wrap;
        align-items: stretch;
    }

    .lemma-search-lang {
        flex: 1 1 auto;
        min-height: 2.75rem;
    }

    .search-input {
        max-width: none;
        flex: 1 1 100%;
        min-width: 0;
        min-height: 2.75rem;
    }

    .lemma-search-input {
        flex: 1 1 100%;
    }

    .search-section .btn-secondary {
        min-height: 2.75rem;
        min-width: 5rem;
        flex-shrink: 0;
    }

    .passage-main .passage-study-tools {
        margin-top: 0.85rem;
        padding: 0.75rem 0.8rem;
    }

    .passage-study-tools-lead {
        font-size: 0.76rem;
        margin-bottom: 0.55rem;
    }

    /* Passage nav buttons - wrap with comfortable tap targets */
    .passage-nav {
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
    }

    .passage-nav .btn-secondary {
        min-height: 2.75rem;
        min-width: 2.75rem;
        padding: 0.5rem 0.75rem;
    }

    .history-nav-wrap {
        flex-basis: 100%;
        display: flex;
        gap: 0.5rem;
        margin-bottom: 0.25rem;
    }

    .reading-area {
        max-width: 100%;
        padding: 0.25rem 0;
    }

    /* Premium passage reading: spacing and typography */
    .translation-block {
        padding: 1rem 1rem;
        margin-bottom: 1.25rem;
    }

    .translation-block--passage-level {
        padding-left: calc(1rem - 3px);
    }

    .translation-text {
        font-size: 1.0625rem;
        line-height: 1.75;
        margin-top: 0.5rem;
    }

    .translation-passage-ref {
        font-size: 0.8rem;
    }

    .translation-text--passage-prose {
        margin-top: 0.35rem;
    }

    .result-reference {
        font-size: 1.125rem;
        margin-bottom: 0.5rem;
        line-height: 1.3;
    }

    .verse-header {
        gap: 0.35rem;
        margin-bottom: 0.75rem;
    }

    .verse-header-actions {
        margin-left: 0;
        flex: 1 1 100%;
        justify-content: flex-start;
    }

    .passage-nav-utilities {
        margin-left: 0;
        flex: 1 1 100%;
        padding-top: 0.45rem;
        border-top: 1px solid rgba(148, 163, 184, 0.22);
        justify-content: flex-start;
    }

    .section-divider {
        margin: 1rem 0;
    }

    .passage-section h3 {
        margin-bottom: 0.35rem;
    }

    .passage-desc {
        font-size: 0.8125rem;
        line-height: 1.45;
        margin-bottom: 0.55rem;
    }

    /* Tables: contain overflow, horizontal scroll */
    .tokens-wrap,
    .interlinear-wrap {
        margin: 0 -1rem;
        padding: 0 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
    }

    .token-table,
    .interlinear-table {
        min-width: 480px;
        font-size: 0.85rem;
    }

    .token-table th,
    .token-table td,
    .interlinear-table th,
    .interlinear-table td {
        padding: 0.4rem 0.5rem;
    }

    .cross-ref-items {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Occurrence explorer: scroll container */
    .occurrence-explorer {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
        max-width: 100%;
    }

    .occurrence-row {
        grid-template-columns: 6rem 3.5rem 1fr 1fr;
        gap: 0.5rem;
        min-width: 320px;
        font-size: 0.8rem;
    }

    /* Sidebar: full width, comfortable height */
    .bookmarks-sidebar {
        width: 100%;
        max-width: none;
        max-height: min(20rem, 50vh);
        order: 2;
        flex-shrink: 0;
        padding: 1rem 1rem;
    }

    .bookmarks-list li,
    .session-ref,
    .collection-item {
        min-height: 2.25rem;
        display: flex;
        align-items: center;
    }

    .search-result-item {
        padding: 0.5rem 0;
        min-height: 2.5rem;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
    }

    /* Ref preview: constrain to viewport to prevent overflow */
    .ref-preview {
        max-width: min(320px, calc(100vw - 2rem));
    }

    /* AI study */
    .ai-question-row {
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: stretch;
    }

    .ai-question-input {
        flex: 1 1 100%;
        min-width: 0;
        min-height: 2.75rem;
    }

    .ai-study-btn {
        min-height: 2.75rem;
        min-width: 4rem;
    }

    .topic-chips {
        gap: 0.4rem;
    }

    .topic-chip {
        min-height: 2rem;
        padding: 0.35rem 0.6rem;
    }

    /* Pinned verses, save controls */
    .pinned-save-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .pinned-save-wrap .btn-secondary {
        width: 100%;
        min-height: 2.5rem;
    }

    .search-results-save-wrap .btn-secondary {
        width: 100%;
        min-height: 2.5rem;
    }

    /* Session/collection controls */
    .sessions-create {
        flex-wrap: wrap;
    }

    .session-name-input {
        flex: 1 1 100%;
        min-width: 0;
        min-height: 2.25rem;
    }

    .session-export-import {
        gap: 0.35rem;
    }

    .btn-session {
        min-height: 2.5rem;
        padding: 0.4rem 0.6rem;
    }

    /* Context / cross-ref list items: comfortable tap targets */
    .context-verse {
        padding: 0.625rem 0;
        min-height: 2.5rem;
        display: flex;
        align-items: center;
    }

    .place-item {
        padding: 0.55rem 0;
        gap: 0.4rem;
    }

    /* Strong's links: adequate tap area */
    .strong-link {
        padding: 0.15em 0.1em;
        margin: -0.15em -0.1em;
        border-radius: 0.2em;
    }

    /* Status toast: mobile-safe position with safe area */
    .status-toast {
        left: max(1rem, env(safe-area-inset-left));
        right: max(1rem, env(safe-area-inset-right));
        bottom: max(1rem, env(safe-area-inset-bottom));
        max-width: none;
        padding: 0.75rem 1rem;
    }

    .exit-presentation-btn {
        bottom: max(1rem, env(safe-area-inset-bottom));
        right: max(1rem, env(safe-area-inset-right));
        left: max(1rem, env(safe-area-inset-left));
        max-width: none;
        min-height: 2.75rem;
        padding: 0.6rem 1rem;
    }

    .pinned-verse-ref-link,
    .pinned-verse-text {
        line-height: 1.45;
    }

    .pinned-verse-item {
        padding-bottom: 0.875rem;
    }
}

@media (max-width: 430px) {
    .logo h1 {
        font-size: 1.1rem;
    }

    .navbar .container {
        padding: 0.5rem 0.75rem;
    }

    .nav-links {
        gap: 0.75rem;
        font-size: 0.875rem;
    }

    .passage-section {
        padding: 0.75rem;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

    .hero {
        padding: 4rem 1rem;
    }

    .feature-card,
    .principle,
    .tech-category {
        padding: 1.5rem;
    }

    .study-panel,
    .translation-block,
    .ai-study-section,
    .map-section,
    .pinned-verse-panel {
        padding: 0.75rem 1rem;
    }

    .translation-block--passage-level {
        padding-left: calc(1rem - 3px);
    }

    .word-study-controls-stack {
        gap: 0.4rem;
    }
    .word-study-controls-stack > .word-study-compare-summary.study-panel,
    .word-study-controls-stack > .note-pin-study-helper.study-panel,
    .word-study-controls-stack > .word-study-pinned-wrap.study-panel {
        padding: 0.4rem 0.55rem;
    }
    .word-study-controls-stack > .word-study-result.study-panel {
        padding: 0.55rem 0.7rem;
    }

    /* Places: roomier rows, readable wraps, ~44px min tap targets */
    .place-item {
        padding: 0.7rem 0;
        gap: 0.5rem;
    }
    .place-item.place-item-active {
        padding: 0.65rem 0.5rem 0.65rem 0.65rem;
        margin: 0.2rem 0 0.2rem -0.3rem;
    }
    .place-item-head {
        align-items: flex-start;
    }
    .place-name {
        min-height: 2.75rem;
        display: flex;
        align-items: flex-start;
        padding: 0.35rem 0.35rem 0.35rem 0;
        box-sizing: border-box;
    }
    .place-coords-indicator {
        margin-top: 0.35rem;
    }
    .place-focus-map-btn {
        align-self: flex-start;
        min-height: 2.75rem;
        padding: 0.4rem 0.85rem;
        margin-left: 0 !important;
        border: 1px solid var(--border-color);
        border-radius: 6px;
        background: var(--light-bg);
        font-size: 0.85rem;
        text-decoration: none;
        line-height: 1.25;
    }
    .place-focus-map-btn:active {
        background: var(--border-color);
    }
    .place-item-active .place-focus-map-btn {
        border-color: rgba(59, 130, 246, 0.55);
        background: rgba(59, 130, 246, 0.14);
        color: var(--primary-color);
        font-weight: 600;
    }
    .place-item-active .place-focus-map-btn:active {
        background: rgba(59, 130, 246, 0.22);
    }
    .place-summary {
        line-height: 1.55;
    }

    .context-expand-btn,
    .topic-chip,
    .cross-ref-filter-chip,
    .interlinear-toggle,
    .show-more-refs {
        min-height: 2.25rem;
        padding: 0.4rem 0.65rem;
    }

    .bookmark-btn,
    .pin-verse-btn,
    .add-to-collection-btn {
        min-width: 2.75rem;
        min-height: 2.75rem;
        padding: 0.4rem;
    }

    .translation-text {
        font-size: 1rem;
        line-height: 1.72;
    }

    .result-reference {
        font-size: 1rem;
        line-height: 1.35;
    }

    .translation-block {
        margin-bottom: 1rem;
    }

    .section-divider {
        margin: 0.875rem 0;
    }

    .passage-section h3 {
        margin-bottom: 0.25rem;
    }

    .occurrence-row {
        grid-template-columns: 5rem 3rem 1fr 1fr;
        min-width: 280px;
    }
}

@media (max-width: 360px) {
    .logo h1 {
        font-size: 1rem;
    }

    .nav-links a {
        font-size: 0.8125rem;
    }

    .passage-form select,
    .passage-form input,
    .search-input {
        font-size: 0.9375rem;
    }

    .passage-nav .btn-secondary {
        font-size: 0.8125rem;
        padding: 0.5rem 0.625rem;
        min-height: 2.5rem;
    }

    .token-table,
    .interlinear-table {
        min-width: 400px;
        font-size: 0.8rem;
    }

    .occurrence-row {
        min-width: 260px;
    }

    .translation-text {
        font-size: 0.9375rem;
        line-height: 1.7;
    }

    .translation-text--passage-prose {
        font-size: 0.9375rem;
        line-height: 1.72;
    }

    .translation-passage-ref {
        font-size: 0.78rem;
        letter-spacing: 0.02em;
    }

    .passage-section {
        padding: 0.625rem;
    }
}

/* Passage viewer */
.passage-section {
    padding: 1.5rem 1rem;
    max-width: 960px;
    margin: 0 auto;
}

.passage-ref-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.passage-layout .passage-main > h3 {
    margin-bottom: 0.35rem;
}

.passage-desc {
    color: var(--light-text);
    margin-bottom: 0.85rem;
    font-size: 0.875rem;
    line-height: 1.48;
    max-width: 42rem;
}

.passage-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    flex: 1 1 16rem;
    min-width: 0;
    padding: 0.85rem 0.95rem;
    background: rgba(148, 163, 184, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
}
.passage-lookup-primary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem 0.65rem;
    width: 100%;
    align-items: end;
}
@media (min-width: 640px) {
    .passage-lookup-primary {
        grid-template-columns: minmax(0, 1fr) minmax(7.5rem, 11rem) auto;
        gap: 0.55rem 0.75rem;
    }
}
.passage-ref-field,
.passage-translation-field,
.passage-load-submit-wrap {
    min-width: 0;
}
.passage-load-submit-wrap {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.passage-lookup-primary-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.2rem;
    font-size: 0.9375rem;
    color: var(--text-color);
}
.passage-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}
.passage-form select,
.passage-form input[type="number"],
.passage-form input[type="text"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
}
.passage-form select {
    min-width: 12rem;
}
.passage-translation-field select {
    min-width: 0;
    width: 100%;
}
.passage-form .passage-structured-field select#book {
    min-width: 0;
    width: 100%;
}
.passage-form input[type="number"] {
    width: 5rem;
    max-width: 100%;
}
.passage-ref-input-primary,
.quick-ref-input {
    width: 100%;
    min-width: 0;
}
.passage-load-btn {
    width: 100%;
    min-height: 2.75rem;
    font-weight: 600;
}
@media (min-width: 640px) {
    .passage-load-btn {
        width: auto;
        min-width: 5.75rem;
    }
}
.translation-pref-label {
    font-size: 0.85rem;
    color: var(--light-text);
    font-weight: 500;
}
.passage-structured-details {
    margin-top: 0.15rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    padding-top: 0.35rem;
}
.passage-structured-summary {
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary-color, #2563eb);
    list-style-position: outside;
    padding: 0.35rem 0 0.15rem;
    user-select: none;
    border-radius: 4px;
}
.passage-structured-summary:focus {
    outline: none;
}
.passage-structured-summary:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.passage-structured-summary::-webkit-details-marker {
    color: var(--light-text);
}
.passage-structured-summary-hint {
    font-weight: 500;
    color: var(--light-text);
    font-size: 0.85rem;
}
.passage-structured-details-body {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.55rem 0.85rem;
    padding: 0.5rem 0 0.15rem;
}
.passage-structured-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1 1 100%;
    min-width: 0;
}
.passage-structured-field--chapter {
    flex: 0 0 auto;
}
.passage-structured-field--chapter input[type="number"] {
    width: 5rem;
}
.passage-structured-field--verse {
    flex: 1 1 10rem;
    min-width: 0;
}
.passage-structured-field--verse input[type="text"] {
    width: 100%;
    min-width: 6rem;
}
@media (min-width: 640px) {
    .passage-structured-field {
        flex: 1 1 auto;
    }
    .passage-structured-field:first-child {
        flex: 1 1 14rem;
        min-width: 12rem;
    }
}

.search-section {
    margin-bottom: 0;
    flex: 1 1 100%;
    min-width: 0;
    padding: 1rem 1.1rem;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
/* Verse search / lemma / Strong: below loaded passage (scripture-first layout). */
.passage-main .passage-study-tools {
    margin-top: 1.1rem;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(148, 163, 184, 0.28);
}
.passage-study-tools-lead {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--light-text);
    margin: 0 0 0.7rem;
    letter-spacing: 0.02em;
}
.passage-study-tools-hint {
    font-weight: 500;
    opacity: 0.92;
}
.passage-scripture-block-start {
    margin-top: 0.5rem;
    margin-bottom: 0.45rem;
}
.search-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--light-text);
    margin-bottom: 0.25rem;
}
.search-label-primary {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-color);
    margin-bottom: 0.35rem;
}
.search-label-secondary {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--light-text);
    margin-top: 0.75rem;
    margin-bottom: 0.2rem;
}

.search-verse-block {
    padding-bottom: 0.85rem;
    margin-bottom: 0.65rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
}

.search-advanced-block {
    margin-top: 0.15rem;
    padding: 0.65rem 0.75rem 0.5rem;
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.055);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.search-advanced-lead {
    margin: 0 0 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--light-text);
    line-height: 1.35;
}

.search-advanced-hint {
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--light-text);
    opacity: 0.88;
}

.search-dismiss-hint {
    margin: 0.5rem 0 0.35rem;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--light-text);
}

.search-section .search-advanced-block .search-label-secondary {
    margin-top: 0.45rem;
    margin-bottom: 0.15rem;
    font-size: 0.78rem;
}

.search-section .search-advanced-block .search-label-secondary:first-of-type {
    margin-top: 0.2rem;
}

.search-section .search-advanced-block .lemma-search-row + .search-label-secondary {
    margin-top: 0.55rem;
}

.search-section .search-advanced-block .lemma-search-row {
    margin-top: 0.2rem;
}

.search-section .search-advanced-block .lemma-search-lang,
.search-section .search-advanced-block .lemma-search-input {
    font-size: 0.9rem;
}

.search-section .search-advanced-block .lemma-search-lang {
    padding: 0.38rem 0.45rem;
    border-color: rgba(148, 163, 184, 0.45);
    background: var(--light-bg);
}

.search-section .search-advanced-block .search-advanced-btn {
    font-size: 0.8125rem;
    padding: 0.4rem 0.65rem;
    color: var(--light-text);
    border-color: rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.65);
}

.search-section .search-advanced-block .search-advanced-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: var(--light-bg);
}

.search-section .search-advanced-block .search-advanced-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.search-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.lemma-search-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.35rem;
}
.lemma-search-lang {
    min-width: 7.5rem;
    padding: 0.45rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.95rem;
}
.lemma-search-input {
    min-width: 12rem;
}
.search-input {
    flex: 1;
    max-width: 20rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
}
.search-results-save-wrap {
    margin-top: 0.5rem;
}
.pinned-save-wrap {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.pinned-clear-all-btn {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    cursor: pointer;
    color: var(--light-text);
}
.pinned-clear-all-btn:hover {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}
.search-results {
    margin-top: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    max-height: 12rem;
    overflow-y: auto;
}
.search-result-item {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.search-result-item:last-child {
    border-bottom: none;
}
.search-result-item:hover {
    background-color: rgba(59, 130, 246, 0.08);
}
.search-result-item.search-result-active {
    background-color: rgba(59, 130, 246, 0.12);
}
.search-result-ref {
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 0.5rem;
}
.search-result-snippet {
    color: var(--text-color);
}
.search-highlight {
    background-color: rgba(250, 204, 21, 0.35);
    padding: 0 0.1em;
    border-radius: 0.15em;
}

.topic-launcher {
    margin-top: 0.85rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    font-size: 0.8125rem;
}
.topic-launcher-label {
    color: var(--light-text);
    margin-right: 0.5rem;
    display: block;
    margin-bottom: 0.35rem;
}
.topic-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.25rem;
}
.topic-chip {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    background: var(--light-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.topic-chip:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary-color);
}

.passage-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    align-items: center;
    margin-bottom: 1rem;
}
/* Verse nav inside .reading-area: visually tied to the loaded passage block (parent supplies reading max-width). */
.passage-nav.passage-nav--in-reading {
    margin-top: 0.35rem;
    margin-bottom: 0.85rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}
/* Before first successful passage load: verse step + copy utilities read as inactive (buttons are disabled; this softens the strip). */
.passage-nav.passage-nav--awaiting-passage .passage-nav-steps,
.passage-nav.passage-nav--awaiting-passage .passage-nav-utilities {
    opacity: 0.72;
}
.passage-nav-steps {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.passage-nav-utilities {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    margin-left: auto;
}
.passage-nav .btn-secondary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}
.passage-nav .btn-secondary:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
}
.passage-nav .passage-nav-utilities .passage-nav-util-btn {
    color: var(--light-text);
    border-color: rgba(148, 163, 184, 0.42);
    background: rgba(148, 163, 184, 0.06);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.passage-nav .passage-nav-utilities .passage-nav-util-btn:hover {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(100, 116, 139, 0.45);
    color: var(--text-color);
}
.passage-nav .passage-nav-utilities .passage-nav-util-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.passage-nav .passage-nav-utilities .passage-nav-util-btn:disabled {
    opacity: 0.55;
}
.passage-nav .btn-secondary:disabled {
    opacity: 0.5;
    cursor: default;
}
.passage-error {
    margin-bottom: 1rem;
    padding: 0.65rem 0.9rem;
    border-radius: 6px;
    border: 1px solid rgba(185, 28, 28, 0.38);
    background: rgba(185, 28, 28, 0.07);
    color: #991b1b;
    font-size: 0.9375rem;
    line-height: 1.45;
    max-width: var(--reading-max, 52rem);
}
.passage-loading {
    margin-bottom: 1rem;
    padding: 0.55rem 0.85rem;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(148, 163, 184, 0.09);
    color: var(--light-text);
    font-size: 0.9375rem;
    line-height: 1.45;
    max-width: var(--reading-max, 52rem);
}
.reading-area {
    max-width: var(--reading-max);
    margin-left: auto;
    margin-right: auto;
}

.passage-results {
    margin-top: 1.5rem;
}

.result-reference {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}
.section-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.25rem 0;
}
.context-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.95rem 0 0.5rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}
.context-heading {
    font-size: 1rem;
    margin: 0;
    font-weight: 600;
    color: var(--text-color);
}
.context-expand-controls {
    display: flex;
    gap: 0.25rem;
}
.context-expand-btn {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--primary-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.context-expand-btn:hover {
    background-color: rgba(59, 130, 246, 0.08);
}
.context-list {
    margin-bottom: 0;
    font-size: 0.95rem;
}
.context-verse {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.context-verse:last-child {
    border-bottom: none;
}
.context-verse:hover {
    background-color: rgba(59, 130, 246, 0.08);
}
.context-verse-current {
    background-color: rgba(59, 130, 246, 0.12);
    font-weight: 500;
}
.context-ref {
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 0.5rem;
}

/* Surrounding verses sit inline after main translations — subordinate, not a peer “study module” */
.passage-surrounding-verses {
    margin: 0.35rem 0 0;
}
.context-section-header--reading-inline {
    margin-top: 0.45rem;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}
.context-section-header--reading-inline .context-heading {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--light-text);
}
.passage-surrounding-verses-hint {
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--light-text);
    margin: 0.1rem 0 0.35rem;
    max-width: 42rem;
}
.passage-surrounding-verses .context-list {
    font-size: 0.9rem;
}

.passage-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.places-heading {
    font-size: 1rem;
    margin: 0 0 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}
.timeline-heading {
    font-size: 1rem;
    margin: 0 0 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}
.timeline-panel {
    margin-bottom: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text-color);
}
.timeline-ref-line {
    font-size: 0.82rem;
    color: var(--light-text);
    margin: 0 0 0.45rem;
}
.timeline-segment-label {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
    padding: 0;
    color: var(--text-color);
}
.timeline-segment-body .timeline-segment-label {
    margin-top: 0;
}
.timeline-segment-summary {
    margin: 0;
    line-height: 1.45;
}
.timeline-segment-summary--muted {
    color: var(--light-text);
    font-size: 0.85rem;
}
.timeline-panel-soft-note {
    font-size: 0.76rem;
    line-height: 1.45;
    color: var(--light-text);
    margin: 0 0 0.5rem;
    padding: 0.3rem 0.4rem;
    border-radius: 4px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.2);
}
.timeline-segment-body {
    margin: 0 0 0.55rem;
    padding: 0.45rem 0.5rem 0.5rem;
    border-radius: 6px;
    border-left: 3px solid rgba(59, 130, 246, 0.45);
    background: rgba(148, 163, 184, 0.06);
}
.timeline-era-context {
    margin: 0 0 0.55rem;
    padding: 0.45rem 0.5rem 0.5rem;
    border-radius: 6px;
    border: 1px dashed rgba(148, 163, 184, 0.55);
    background: rgba(148, 163, 184, 0.04);
}
.timeline-era-context__label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--light-text);
    margin: 0 0 0.35rem;
    line-height: 1.3;
}
.timeline-era-context__text {
    font-size: 0.82rem;
    color: var(--text-color);
    margin: 0;
    line-height: 1.45;
    font-style: italic;
}
.timeline-era-context__hint {
    font-size: 0.72rem;
    color: var(--light-text);
    margin: 0.4rem 0 0;
    line-height: 1.4;
}
.timeline-uncertainty-hint {
    font-size: 0.75rem;
    color: var(--light-text);
    margin: 0.35rem 0 0.25rem;
    line-height: 1.4;
}
.timeline-state {
    font-size: 0.9rem;
    line-height: 1.45;
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    border: 1px dashed var(--border-color);
    background: var(--light-bg);
}
.timeline-state--loading {
    font-style: italic;
    color: var(--light-text);
    border-style: dashed;
}
.timeline-state .timeline-state-title {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}
.timeline-state .timeline-state-detail {
    display: block;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--light-text);
}
.timeline-state--loading .timeline-state-title {
    font-style: normal;
    opacity: 0.92;
}
.timeline-state--loading .timeline-state-detail {
    font-style: italic;
}
.timeline-state--empty {
    color: var(--light-text);
    border-style: dashed;
}
.timeline-state--empty .timeline-state-title {
    opacity: 0.88;
}
.timeline-state--error {
    border-style: solid;
    border-color: rgba(192, 57, 43, 0.35);
    background: rgba(192, 57, 43, 0.05);
    color: var(--text-color);
}
.timeline-state--error .timeline-state-title {
    color: var(--error-color, #c0392b);
}
.timeline-state--error .timeline-state-detail {
    color: var(--text-color);
}
.timeline-retry {
    color: var(--primary-color);
    font-weight: 500;
}
.timeline-neighbors {
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--light-text);
    margin: 0 0 0.65rem;
    padding: 0.35rem 0.45rem;
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.22);
}
.timeline-neighbors__part {
    display: inline;
}
.timeline-neighbors__lbl {
    font-weight: 600;
    color: var(--light-text);
    margin-right: 0.15rem;
}
.timeline-how-placed {
    margin: 0.55rem 0 0.4rem;
    font-size: 0.82rem;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 0.45rem 0.55rem;
    background: rgba(148, 163, 184, 0.06);
}
.timeline-how-placed-summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-color);
    list-style: none;
}
.timeline-how-placed-summary::-webkit-details-marker {
    display: none;
}
.timeline-how-placed-body {
    margin-top: 0.45rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    color: var(--text-color);
    line-height: 1.45;
}
.timeline-how-placed-body p {
    margin: 0 0 0.45rem;
    font-size: 0.82rem;
}
.timeline-how-placed-body p:last-child {
    margin-bottom: 0;
}
.timeline-how-placed-footnote {
    font-size: 0.75rem !important;
    color: var(--light-text) !important;
    margin-top: 0.55rem !important;
    padding-top: 0.45rem !important;
    border-top: 1px solid rgba(148, 163, 184, 0.22) !important;
    line-height: 1.4 !important;
}
.timeline-rail-wrap {
    margin: 0 0 0.5rem;
}
.timeline-rail-intro {
    font-size: 0.78rem;
    color: var(--light-text);
    margin: 0 0 0.45rem;
    line-height: 1.45;
}
.timeline-rail-track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    height: 5px;
    margin: 0 0 0.5rem;
    padding: 2px;
    border-radius: 4px;
    background: rgba(148, 163, 184, 0.18);
    box-sizing: border-box;
}
.timeline-rail-track__seg {
    min-height: 3px;
    border-radius: 2px;
    background: rgba(148, 163, 184, 0.12);
}
.timeline-rail-track__seg--active {
    background: var(--primary-color);
    opacity: 0.65;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}
.timeline-rail-position {
    font-size: 0.74rem;
    line-height: 1.45;
    color: var(--light-text);
    margin: 0.5rem 0 0;
    padding: 0.35rem 0.4rem;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
}
.timeline-rail {
    list-style: none;
    margin: 0 0 0.55rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    align-items: stretch;
}
.timeline-rail__item {
    margin: 0;
    padding: 0.4rem 0.35rem 0.45rem;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.06);
    text-align: center;
    min-width: 0;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.timeline-rail__item--active {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.12);
    box-shadow: inset 3px 0 0 var(--primary-color);
    font-weight: 600;
}
.timeline-rail__idx {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    margin-bottom: 0.25rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(148, 163, 184, 0.25);
    color: var(--text-color);
}
.timeline-rail__item--active .timeline-rail__idx {
    background: var(--primary-color);
    color: #fff;
}
.timeline-rail__name {
    display: block;
    font-size: 0.72rem;
    line-height: 1.35;
    color: var(--text-color);
    overflow-wrap: anywhere;
    hyphens: auto;
}
@media (prefers-reduced-motion: reduce) {
    .timeline-rail__item {
        transition: none;
    }
}
@media (max-width: 520px) {
    .timeline-rail {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
        margin-bottom: 0.6rem;
    }
    .timeline-rail-intro {
        margin-bottom: 0.4rem;
    }
    .timeline-rail-track {
        margin-bottom: 0.45rem;
    }
    .timeline-how-placed {
        margin-top: 0.6rem;
        padding: 0.5rem 0.45rem;
    }
    .timeline-neighbors {
        margin-bottom: 0.55rem;
    }
}
.places-list {
    margin-bottom: 0;
    font-size: 0.95rem;
}
.places-item-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.places-panel-intro {
    font-size: 0.85rem;
    color: var(--light-text);
    margin: 0 0 0.5rem;
    line-height: 1.35;
}
.places-map-banner {
    font-size: 0.82rem;
    line-height: 1.45;
    margin: 0 0 0.65rem;
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    border: 1px dashed var(--border-color);
}
.places-map-banner--none {
    color: var(--text-color);
    background: rgba(59, 130, 246, 0.06);
    border-color: rgba(59, 130, 246, 0.25);
}
.places-map-banner--partial {
    color: var(--text-color);
    background: var(--light-bg);
}
.place-synonyms {
    font-size: 0.82rem;
    color: var(--secondary-color);
    font-style: italic;
    margin: 0;
    line-height: 1.4;
}
.place-ref-matched {
    font-size: 0.82rem;
    color: var(--text-color);
    margin: 0;
    line-height: 1.4;
    opacity: 0.92;
}
.place-no-coords {
    font-size: 0.78rem;
    color: var(--text-color);
    margin: 0;
    line-height: 1.4;
    font-weight: 500;
}
.place-item-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.65rem;
}
.place-item-head .place-name {
    flex: 1 1 auto;
    min-width: 0;
}
.place-coords-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--secondary-color);
    opacity: 0.88;
    white-space: nowrap;
    flex-shrink: 0;
}
.place-coords-indicator__dot {
    display: inline-block;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--primary-color);
    opacity: 0.62;
}
.place-coords-indicator__text {
    font-size: inherit;
}
.places-state {
    font-size: 0.9rem;
    line-height: 1.45;
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    border: 1px dashed var(--border-color);
    background: var(--light-bg);
}
.places-state--loading {
    font-style: italic;
    color: var(--light-text);
    border-style: dashed;
}
.places-state--loading .places-state-title {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    font-style: normal;
}
.places-state--loading .places-state-detail {
    display: block;
    font-size: 0.85rem;
    color: var(--light-text);
    line-height: 1.45;
}
.places-state--empty {
    color: var(--light-text);
    border-style: dashed;
}
.places-state--empty .places-state-title {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.88;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}
.places-state--empty .places-state-detail {
    display: block;
    font-size: 0.85rem;
    color: var(--light-text);
}
.places-state--error {
    border-style: solid;
    border-color: rgba(192, 57, 43, 0.35);
    background: rgba(192, 57, 43, 0.05);
}
.places-state--error .places-state-title {
    display: block;
    font-weight: 600;
    color: var(--error-color, #c0392b);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}
.places-state--error .places-state-detail {
    display: block;
    font-size: 0.85rem;
    color: var(--text-color);
}
.places-state--error .places-retry {
    color: var(--primary-color);
    font-weight: 500;
}
.place-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.48rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}
.place-item:last-child {
    border-bottom: none;
}
/* List-only rows: dashed rail + light panel (readable; not a dimmed “disabled” row). */
.place-item--no-coords {
    border-left: 2px dashed var(--border-color);
    padding-left: 0.5rem;
    margin-left: -0.15rem;
    border-radius: 0.3rem;
    background: var(--light-bg);
    cursor: default;
}
/* Map highlight: solid fill + left bar (distinct from keyboard focus ring below). Slightly stronger so list row matches an open popup. */
.place-item.place-item-active {
    border-left: 4px solid var(--primary-color);
    padding: 0.5rem 0.5rem 0.5rem 0.65rem;
    margin: 0.15rem 0 0.15rem -0.35rem;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 0.375rem;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.42);
}
/* Keyboard: dashed ring (tab to row / link / button). Map-highlighted row uses solid blue panel instead. */
.place-item--has-coords:focus-within {
    outline: 2px dashed var(--secondary-color);
    outline-offset: 3px;
    border-radius: 0.375rem;
}
.place-item--has-coords:focus-within:not(.place-item-active) {
    outline-color: rgba(37, 99, 235, 0.55);
}
.place-item.place-item-active.place-item--has-coords:focus-within {
    outline: 1px dashed rgba(30, 64, 175, 0.65);
    outline-offset: 2px;
    /* Softer halo so focus ring + highlight panel are not doubly heavy. */
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.28);
}
.place-item-active .place-focus-map-btn:focus-visible {
    outline-width: 2px;
    outline-offset: 1px;
}
.place-map-active-badge {
    display: none;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary-color);
    margin: 0 0 0.15rem;
    line-height: 1.2;
}
.place-item.place-item-active .place-map-active-badge {
    display: block;
}
/* Show on map: stronger “selected” look while this row is the map highlight (text unchanged). */
.place-item-active .place-focus-map-btn {
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.16);
    border: 1px solid rgba(59, 130, 246, 0.5);
    border-radius: 6px;
    padding: 0.12em 0.5em;
    text-decoration: none;
}
.place-item-active .place-focus-map-btn:hover {
    background: rgba(59, 130, 246, 0.26);
    border-color: rgba(37, 99, 235, 0.65);
    color: var(--primary-color);
}
.place-name {
    display: block;
    color: var(--primary-color);
    margin-bottom: 0;
    font-weight: bold;
    line-height: 1.35;
    overflow-wrap: break-word;
}
a.place-name {
    text-decoration: none;
}
a.place-name:hover {
    text-decoration: underline;
}
.place-summary {
    margin: 0;
    margin-top: 0.1rem;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    color: var(--text-color);
    font-size: 0.9rem;
    line-height: 1.52;
}
.place-profile-details.place-ref-details {
    margin-top: 0.35rem;
}
.place-profile-body {
    margin-top: 0.45rem;
    padding-top: 0.2rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}
.place-profile-line {
    margin: 0 0 0.42rem;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-color);
}
.place-profile-line:last-child {
    margin-bottom: 0;
}
.place-profile-label {
    display: block;
    font-weight: 600;
    color: var(--light-text);
    margin-bottom: 0.12rem;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.place-profile-value {
    display: block;
    overflow-wrap: anywhere;
    word-break: break-word;
    padding-left: 0.05rem;
}
.place-profile-line--see-also .place-profile-label {
    margin-bottom: 0.2rem;
}
.place-profile-see-also {
    margin: 0;
    padding-left: 1.15rem;
    line-height: 1.42;
    list-style-type: disc;
}
.place-profile-see-also li {
    margin-bottom: 0.22rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.place-profile-see-also li:last-child {
    margin-bottom: 0;
}
.place-profile-see-also .ref-link.place-profile-see-also-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}
.place-profile-see-also .ref-link.place-profile-see-also-link:hover {
    text-decoration: underline;
}
.place-profile-ref-plain {
    color: var(--text-color);
    opacity: 0.88;
}
.map-popup-see-also-wrap {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.74rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.map-popup-see-also-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}
.map-popup-see-also-link:hover {
    text-decoration: underline;
}
.map-popup-see-also-plain {
    color: inherit;
    opacity: 0.9;
}
.place-ref-details {
    margin-top: 0.25rem;
    font-size: 0.78rem;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 0.32rem 0.48rem 0.4rem;
    background: rgba(148, 163, 184, 0.06);
}
.place-ref-details-summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--light-text);
    list-style: none;
    line-height: 1.4;
}
.place-ref-details summary::-webkit-details-marker {
    display: none;
}
.place-ref-details[open] {
    padding-bottom: 0.45rem;
}
.place-ref-list {
    margin: 0.55rem 0 0;
    padding-left: 1.1rem;
    padding-top: 0.05rem;
    color: var(--text-color);
    font-size: 0.8rem;
    line-height: 1.42;
}
.place-ref-list li {
    margin-bottom: 0.28rem;
}
.place-ref-list li:last-child {
    margin-bottom: 0;
}

.translations-heading {
    font-size: 1rem;
    margin: 0 0 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}
.translations-toolbar {
    margin: 0.15rem 0 0.6rem;
    padding: 0.35rem 0.55rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.06);
}
.translations-toolbar label {
    margin-right: 0;
    font-size: 0.9rem;
    color: var(--light-text);
}
.translation-filter-status {
    font-size: 0.85rem;
    color: var(--light-text);
    flex: 1 1 10rem;
    min-width: 0;
}
.translations-toolbar--filtered-active .translation-filter-status {
    font-weight: 600;
    color: var(--text-color);
}
.translations-toolbar select {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    background: var(--light-bg);
}
.translations-toolbar--filtered-active {
    margin: 0.05rem 0 0.65rem;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.07);
    border: 1px solid rgba(59, 130, 246, 0.25);
}
.translations-context-status {
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--light-text);
    margin: 0 0 0.55rem;
    padding: 0.4rem 0.55rem;
    border-radius: 6px;
    max-width: var(--reading-max, 52rem);
}
.translations-context-status--solo {
    background: rgba(148, 163, 184, 0.12);
    border-left: 3px solid var(--border-color);
    color: var(--text-color);
}
.translations-context-status--filtered {
    background: rgba(59, 130, 246, 0.09);
    border-left: 3px solid rgba(37, 99, 235, 0.55);
    color: var(--text-color);
}
.translations-context-status--warning {
    background: rgba(185, 28, 28, 0.08);
    border-left: 3px solid rgba(185, 28, 28, 0.45);
    color: var(--text-color);
}
.interlinear-toggle {
    margin-left: 0.5rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.8rem;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    cursor: pointer;
}
.interlinear-toggle:hover {
    background: var(--border-color);
}
.result-translations {
    margin-bottom: 0;
}
.esv-attribution {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--light-text);
    max-width: var(--reading-max);
}
.esv-attribution a {
    color: var(--primary-color);
}
.licenses-inline-link {
    font-size: 0.8125rem;
    margin: 0.15rem 0 0.65rem;
}
.licenses-inline-link a {
    color: var(--primary-color);
}
.licenses-page {
    padding: 1.25rem 20px 3rem;
    max-width: 42rem;
}
.licenses-page-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    line-height: 1.3;
}
.licenses-page-lead {
    color: var(--light-text);
    font-size: 0.9375rem;
    margin-bottom: 1.25rem;
}
.licenses-section h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
}
.licenses-section p {
    font-size: 0.9375rem;
    margin: 0.5rem 0;
    line-height: 1.6;
}
.licenses-section blockquote {
    margin: 0.65rem 0;
    padding: 0.65rem 0.85rem;
    border-left: 3px solid var(--border-color);
    background: var(--light-bg);
    font-size: 0.875rem;
    line-height: 1.55;
}
.licenses-section .source-ref {
    font-size: 0.8125rem;
    color: var(--light-text);
    margin-top: 2rem;
    line-height: 1.5;
}
/* Secondary / contextual note on licenses page (e.g. Guide to Permissions pointer). */
.licenses-section .licenses-secondary {
    font-size: 0.875rem;
    color: var(--light-text);
    line-height: 1.55;
    margin: 0.65rem 0 0.5rem;
}
.study-panel {
    padding: 1rem 1.25rem;
    background: var(--light-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.translation-block {
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    background: var(--light-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.translation-block:last-child { margin-bottom: 0; }

/* Translation label row (WEB/KJV/ESV): shared hierarchy; body stays in .translation-text */
.translation-block-heading {
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--light-text);
}
.translation-block-heading strong {
    font-size: inherit;
    font-weight: 700;
    color: var(--text-color);
}
.translation-name-display {
    font-weight: 500;
    color: var(--light-text);
}
.translation-block-dash {
    font-weight: 400;
    color: var(--light-text);
}

.translation-text {
    margin: 0.65rem 0 0;
    color: var(--text-color);
    font-size: 1.0625rem;
    line-height: 1.7;
}

/* ESV (and any future passage-API row): one continuous text blob vs per-verse VerseText rows */
.translation-block--passage-level {
    border-left: 3px solid rgba(37, 99, 235, 0.42);
    /* Align prose with WEB/KJV: border + padding-left equals default left padding */
    padding-left: calc(1.25rem - 3px);
}
.translation-passage-ref {
    margin: 0.3rem 0 0;
    padding: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--light-text);
    line-height: 1.4;
    text-transform: none;
}
.translation-text--passage-prose {
    margin: 0.4rem 0 0;
    padding: 0;
    font-size: 1.0625rem;
    line-height: 1.75;
    max-width: 52rem;
}
.translation-text--passage-prose:not(:last-child) {
    margin-bottom: 0;
}

.verse-block {
    display: block;
    margin-top: 0.5em;
}
.verse-block.verse-selected-for-note {
    border-radius: 0.25rem;
    background-color: rgba(59, 130, 246, 0.08);
    box-shadow: inset 2px 0 0 0 rgba(59, 130, 246, 0.45);
}
.verse-block:first-child {
    margin-top: 0;
}
.verse-block + .verse-block::before {
    display: none;
}
.verse-num {
    font-size: 0.8em;
    font-weight: 600;
    color: var(--light-text);
    margin-right: 0.15em;
}

.verse-note-indicator {
    display: inline-block;
    width: 0.5em;
    height: 0.5em;
    border-radius: 999px;
    background: var(--primary-color);
    opacity: 0.65;
    margin-left: 0.35em;
    vertical-align: middle;
    cursor: pointer;
}

.verse-note-indicator[hidden] { display: none; }

.verse-note-indicator:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.verse-note-highlight {
    background-color: rgba(37, 99, 235, 0.12);
    border-radius: 0.25rem;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
}

/* Align with .context-verse-current: verses inside the loaded same-chapter range */
.translation-text .verse-block--active-passage {
    background-color: rgba(59, 130, 246, 0.1);
    border-radius: 0.2rem;
}

/* Persistent while the note editor targets this verse (subtler than .verse-note-highlight click flash) */
.verse-note-editing-active {
    border-radius: 0.25rem;
    background-color: rgba(37, 99, 235, 0.05);
    box-shadow: inset 3px 0 0 0 rgba(37, 99, 235, 0.4);
}
.verse-block.verse-note-highlight.verse-note-editing-active {
    background-color: rgba(37, 99, 235, 0.14);
    box-shadow:
        0 0 0 1px rgba(37, 99, 235, 0.35),
        inset 3px 0 0 0 rgba(37, 99, 235, 0.45);
}
.multi-verse-note-action {
    margin: 0.35rem 0 0.5rem;
}
.multi-verse-note-action-btn {
    border: none;
    background: none;
    color: var(--secondary-color);
    font-size: 0.85rem;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
}
.multi-verse-note-clear-btn {
    border: none;
    background: none;
    color: var(--light-text);
    font-size: 0.85rem;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    margin-left: 0.75rem;
}
.multi-verse-note-clear-btn:focus-visible,
.multi-verse-note-action-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.no-translations {
    color: var(--light-text);
}
.tokens-heading {
    font-size: 1rem;
    margin: 0 0 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}
.tokens-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.token-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.token-table th,
.token-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border: 1px solid var(--border-color);
}
.token-table th {
    background: var(--light-bg);
    font-weight: 600;
    color: var(--primary-color);
}
.interlinear-heading {
    font-size: 1rem;
    margin: 0 0 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}
.interlinear-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.interlinear-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.interlinear-table th,
.interlinear-table td {
    padding: 0.35rem 0.5rem;
    text-align: left;
    border: 1px solid var(--border-color);
}
.interlinear-table th {
    background: var(--light-bg);
    font-weight: 600;
    color: var(--primary-color);
}
.logo-link {
    text-decoration: none;
    color: inherit;
}
.logo-link:hover {
    color: var(--primary-color);
}

.strong-link { cursor: pointer; text-decoration: underline; }
.strong-link:hover { color: var(--primary-color); }
.strong-link-selected { color: var(--primary-color); font-weight: 600; }
.rtl-token-cell { text-align: right; }
.word-study-result { margin-top: 0; padding: 1rem 1.25rem; background: var(--light-bg); border-radius: 8px; border: 1px solid var(--border-color); font-size: 0.9rem; }
.word-study-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.35rem; gap: 0.5rem; }
.word-study-header-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; flex-shrink: 0; }
.word-study-clear,
.word-study-pin,
.word-study-active-collapse { font-size: 0.8rem; padding: 0.15rem 0.4rem; cursor: pointer; background: transparent; border: 1px solid var(--border-color); border-radius: 3px; }
.word-study-clear:hover,
.word-study-pin:hover,
.word-study-active-collapse:hover { background: var(--border-color); }
#wordStudyResult.word-study-result--collapsed .word-study-body { display: none !important; }

/* Compare, pin helper, pinned, active — one vertical column, shared spacing */
.word-study-controls-stack {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.word-study-controls-stack > .word-study-compare-summary.study-panel,
.word-study-controls-stack > .note-pin-study-helper.study-panel,
.word-study-controls-stack > .word-study-pinned-wrap.study-panel {
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
}
.word-study-controls-stack > .word-study-result.study-panel {
    padding: 0.65rem 0.85rem;
}
.word-study-controls-stack .word-study-compare-summary {
    margin-bottom: 0;
    padding: 0;
    border: none;
    background: transparent;
}
.word-study-controls-stack .note-pin-study-helper {
    margin-bottom: 0;
}
.word-study-controls-stack .word-study-pinned-wrap {
    margin-bottom: 0;
}
.word-study-controls-stack .word-study-pinned-toolbar {
    margin-bottom: 0.25rem;
    gap: 0.3rem 0.5rem;
}

.word-study-compare-summary { font-size: 0.8rem; color: var(--light-text); margin-bottom: 0.35rem; line-height: 1.4; padding: 0.35rem 0.65rem; background: var(--light-bg); border-radius: 6px; border: 1px dashed var(--border-color); }
.word-study-compare-summary-intro,
.word-study-compare-summary-mid { font-weight: normal; color: var(--light-text); }
.word-study-compare-chip { font: inherit; font-size: 0.8rem; display: inline; margin: 0 0.1rem; padding: 0.15rem 0.4rem; vertical-align: baseline; cursor: pointer; color: var(--primary-color); background: var(--light-bg); border: 1px solid var(--border-color); border-radius: 3px; text-decoration: none; line-height: 1.35; }
.word-study-compare-chip:hover { background: rgba(59, 130, 246, 0.08); border-color: var(--primary-color); }
.word-study-compare-chip:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 1px; }
.note-pin-study-helper { margin-bottom: 0.35rem; }
.note-pin-study-helper-btn { font-size: 0.8rem; padding: 0.15rem 0.4rem; cursor: pointer; background: transparent; border: 1px solid var(--border-color); border-radius: 3px; color: var(--light-text); }
.note-pin-study-helper-btn:hover { background: var(--border-color); color: var(--text-color, inherit); }
.word-study-pinned-wrap { margin-bottom: 0.5rem; }
.word-study-pinned-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.35rem 0.75rem; margin-bottom: 0.35rem; font-size: 0.8rem; color: var(--light-text); }
.word-study-pinned-label { font-weight: 600; color: var(--light-text); letter-spacing: 0.02em; text-transform: uppercase; font-size: 0.72rem; }
.word-study-pinned-toolbar-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.word-study-pinned-collapse,
.word-study-pinned-open-active,
.word-study-pinned-remove { font-size: 0.8rem; padding: 0.15rem 0.4rem; cursor: pointer; background: transparent; border: 1px solid var(--border-color); border-radius: 3px; color: var(--light-text); }
.word-study-pinned-collapse:hover,
.word-study-pinned-open-active:hover,
.word-study-pinned-remove:hover { background: var(--border-color); }
.word-study-pinned-wrap--collapsed .word-study-pinned-host { display: none !important; }
.word-study-pinned-host { opacity: 0.92; font-size: 0.88rem; border-style: dashed; }
.word-study-inner.word-study-inner--pinned .word-study-header strong { color: var(--light-text); }
.word-study-meta { margin-bottom: 0.35rem; }
.word-study-refs { font-size: 0.9rem; margin-bottom: 0.5rem; }
.study-breadcrumb-bar { font-size: 0.85rem; color: var(--light-text); margin-bottom: 0.35rem; line-height: 1.45; }
.study-breadcrumb-bar .study-trail-label { font-weight: 600; color: var(--primary-color); margin-right: 0.35rem; }
.study-breadcrumb-bar .study-trail-link { text-decoration: underline; cursor: pointer; color: var(--primary-color); }
.study-breadcrumb-bar .study-trail-sep { margin: 0 0.2rem; color: var(--light-text); font-weight: normal; }

.word-study-occurrences { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border-color); }
.occurrences-heading { font-size: 0.85rem; font-weight: 600; color: var(--primary-color); margin-bottom: 0.35rem; }
.occurrence-count-note { font-size: 0.8rem; color: var(--light-text); margin: 0 0 0.5rem; }

.occurrence-stats-summary {
  font-size: 0.8rem;
  color: var(--light-text);
  opacity: 0.92;
  margin: 0 0 0.5rem;
  line-height: 1.35;
}
.occurrence-filter-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; margin: 0 0 0.35rem; }
.occurrence-filter-label { font-size: 0.8rem; color: var(--light-text); white-space: nowrap; }
.occurrence-filter-label .nav-ref-input { width: 10rem; max-width: 42vw; min-width: 5.5rem; vertical-align: middle; }
.occurrence-filter-label select.occurrence-filter-morph {
    font-size: 0.85rem;
    min-width: 8rem;
    max-width: min(100%, 18rem);
    padding: 0.25rem 0.4rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
    background: var(--bg-panel);
    color: var(--text);
    vertical-align: middle;
}
.occurrence-explorer { font-size: 0.9rem; }
.occurrence-group { margin-bottom: 0.75rem; }
.occurrence-group:last-child { margin-bottom: 0; }
.occurrence-group-heading { font-weight: 600; color: var(--primary-color); font-size: 0.85rem; margin-bottom: 0.35rem; padding-bottom: 0.2rem; border-bottom: 1px solid var(--border-color); }
.occurrence-rows { display: flex; flex-direction: column; gap: 0; }
.occurrence-row { display: grid; grid-template-columns: 8rem 4rem 1fr 1fr; gap: 0.75rem; align-items: baseline; padding: 0.35rem 0; border-bottom: 1px solid var(--border-color); font-size: 0.85rem; }
.occurrence-row:last-child { border-bottom: none; }
.occurrence-row:hover { background-color: rgba(59, 130, 246, 0.06); }
.occurrence-row.occurrence-row-current {
    background-color: rgba(59, 130, 246, 0.08);
    border-radius: 0.25rem;
}
.occurrence-ref { flex-shrink: 0; }
.occurrence-surface { font-style: italic; color: var(--text-color); }
.occurrence-lemma { color: var(--primary-color); }
.occurrence-gloss { color: var(--light-text); }
.ref-link { color: var(--primary-color); text-decoration: none; transition: background-color 0.2s ease; }
.ref-link:hover { text-decoration: underline; }
.ref-link:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
.ref-link-active { background-color: rgba(59, 130, 246, 0.2); border-radius: 0.25rem; }
.ref-link-from { font-weight: 600; }
.cross-ref-retry { color: var(--primary-color); text-decoration: none; margin-left: 0.25rem; }
.cross-ref-retry:hover { text-decoration: underline; }

/* Cross-reference preview popup */
.ref-preview {
    position: fixed;
    z-index: 1000;
    max-width: 320px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    line-height: 1.4;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
}
.ref-preview-title { font-weight: 600; color: var(--primary-color); margin-bottom: 0.25rem; }
.ref-preview-text { color: var(--text-color); }

.section-icon { margin-right: 0.35rem; font-size: 0.95em; opacity: 0.85; }
.section-heading-with-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-heading-with-toggle .section-icon {
    flex: 0 0 auto;
}
.section-collapsed-hint {
    margin-left: 0.2rem;
    font-size: 0.74rem;
    line-height: 1.25;
    color: var(--light-text);
    font-weight: 400;
    opacity: 0.92;
}
.section-collapse-toggle {
    margin-left: auto;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-color);
    border-radius: 999px;
    font-size: 0.76rem;
    line-height: 1.3;
    font-weight: 600;
    padding: 0.14rem 0.58rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.section-collapse-toggle:hover {
    border-color: rgba(100, 116, 139, 0.55);
    background: rgba(148, 163, 184, 0.16);
}
.section-collapse-toggle:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.section-heading-collapsed {
    color: var(--light-text);
}
.section-heading-collapsed .section-icon {
    opacity: 0.65;
}
.reader-collapsible-body.reader-collapsed {
    display: none !important;
}
@media (max-width: 640px) {
    .section-heading-with-toggle {
        flex-wrap: wrap;
        row-gap: 0.35rem;
    }
    .section-collapsed-hint {
        order: 3;
        width: 100%;
        margin-left: 0;
    }
}
.loading-placeholder {
    color: var(--light-text);
    font-style: italic;
    line-height: 1.45;
}
.empty-placeholder {
    color: var(--light-text);
    line-height: 1.45;
}

/* Collapsed secondary sections (reading context, cross-refs): loading/empty/error read as deliberate panel states */
.context-list.study-panel:not(:has(.context-verse)),
.cross-ref-list.study-panel:not(:has(.cross-ref-items)) {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: stretch;
}
.context-list.study-panel:not(:has(.context-verse)) > p,
.cross-ref-list.study-panel:not(:has(.cross-ref-items)) > p {
    margin: 0;
}
.context-list.study-panel:not(:has(.context-verse)) > p.loading-placeholder,
.context-list.study-panel:not(:has(.context-verse)) > p.empty-placeholder,
.cross-ref-list.study-panel:not(:has(.cross-ref-items)) > p.loading-placeholder,
.cross-ref-list.study-panel:not(:has(.cross-ref-items)) > p.empty-placeholder {
    display: block;
    padding: 0.55rem 0.75rem;
    border-radius: 6px;
    border: 1px dashed var(--border-color);
    background: var(--light-bg);
    box-sizing: border-box;
    width: 100%;
}
.context-list.study-panel:not(:has(.context-verse)) > p.loading-placeholder,
.cross-ref-list.study-panel:not(:has(.cross-ref-items)) > p.loading-placeholder {
    font-style: italic;
    color: var(--light-text);
}
.context-retry {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    margin-left: 0.15rem;
}
.context-retry:hover {
    text-decoration: underline;
}

.token-table td.token-table-status-cell,
.interlinear-table td.token-table-status-cell {
    padding: 0.65rem 0.75rem !important;
    border-radius: 6px;
    border: 1px dashed var(--border-color);
    background: var(--light-bg);
    font-size: 0.9rem;
    line-height: 1.45;
    vertical-align: middle;
}
.token-table td.token-table-status-cell.loading-placeholder,
.interlinear-table td.token-table-status-cell.loading-placeholder {
    font-style: italic;
    color: var(--light-text);
}
.cross-ref-heading { font-size: 1rem; margin: 0 0 0.5rem; font-weight: 600; color: var(--text-color); }
.cross-ref-filter-wrap { margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.cross-ref-filter-label { font-size: 0.85rem; color: var(--light-text); }
.cross-ref-filter-chips { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.cross-ref-filter-chip { font-size: 0.8rem; padding: 0.2rem 0.5rem; border: 1px solid var(--border-color); border-radius: 0.25rem; background: transparent; color: var(--light-text); cursor: pointer; }
.cross-ref-filter-chip:hover { border-color: var(--secondary-color); color: var(--secondary-color); }
.cross-ref-filter-chip:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
.cross-ref-filter-chip-active { border-color: var(--secondary-color); color: var(--secondary-color); background: var(--light-bg); }
.cross-ref-type-label { font-size: 0.75rem; color: var(--light-text); margin-right: 0.25rem; }
.cross-ref-list { margin-bottom: 0; font-size: 0.95rem; }
.cross-ref-items { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.cross-ref-items li { margin-bottom: 0; display: flex; align-items: baseline; }
.show-more-refs { margin-top: 0.5rem; font-size: 0.85rem; padding: 0.25rem 0.5rem; background: transparent; border: 1px solid var(--border-color); border-radius: 0.25rem; color: var(--primary-color); cursor: pointer; }
.show-more-refs:hover { background: var(--light-bg); }
.show-more-refs:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }

.ai-study-heading { font-size: 1rem; margin: 0 0 0.5rem; font-weight: 600; color: var(--text-color); }
.ai-study-section { margin-bottom: 0; padding: 1rem 1.25rem; background: var(--light-bg); border-radius: 8px; border: 1px solid var(--border-color); }
.ai-study-desc { font-size: 0.9rem; color: var(--light-text); margin: 0 0 0.5rem; }
.ai-study-actions { margin-bottom: 0.5rem; }
.ai-question-label { display: block; font-size: 0.85rem; color: var(--light-text); margin-bottom: 0.25rem; }
.ai-question-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; align-items: center; }
.ai-question-input { flex: 1; min-width: 0; padding: 0.35rem 0.5rem; font-size: 0.9rem; border: 1px solid var(--border-color); border-radius: 0.25rem; }
.ai-question-input:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
.ai-summarize-btn { margin-top: 0.25rem; }
.ai-study-btn:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
.ai-study-loading {
    font-size: 0.9rem;
    color: var(--light-text);
    font-style: italic;
    margin-top: 0.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: 6px;
    border: 1px dashed var(--border-color);
    background: var(--light-bg);
    line-height: 1.45;
}
.ai-study-error {
    font-size: 0.9rem;
    color: var(--error-color, #c0392b);
    margin-top: 0.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(192, 57, 43, 0.35);
    background: rgba(192, 57, 43, 0.05);
    line-height: 1.45;
}
.ai-study-result { font-size: 0.95rem; color: var(--text-color); margin-top: 0.5rem; line-height: 1.5; }
/* Echo of the prompt for this response (reduces confusion when asking multiple times). */
.ai-study-question-echo {
    font-size: 0.85rem;
    color: var(--light-text);
    margin-bottom: 0.45rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-color);
    line-height: 1.35;
    word-break: break-word;
}
.ai-study-question-echo-label {
    font-weight: 600;
    color: var(--text-color);
    margin-right: 0.35rem;
}
.ai-study-answer { margin-bottom: 0.25rem; }
.ai-study-grounding-translation {
    margin: 0.3rem 0 0.15rem;
}
.ai-study-grounding-translation-badge {
    display: inline-block;
    font-size: 0.76rem;
    line-height: 1.3;
    color: var(--light-text);
    background: rgba(148, 163, 184, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    padding: 0.12rem 0.48rem;
}
.ai-study-citations { font-size: 0.85rem; color: var(--light-text); margin-top: 0.5rem; }
.ai-study-citations .ai-study-citation-ref { color: var(--primary-color); }
.ai-study-supporting-passages {
    font-size: 0.82rem;
    color: var(--light-text);
    margin-top: 0.55rem;
    padding: 0.45rem 0.55rem;
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.22);
}
.ai-study-supporting-passages-label {
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text-color);
}
.ai-study-supporting-item {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    margin-top: 0.35rem;
}
.ai-study-supporting-item:first-of-type { margin-top: 0.15rem; }
.ai-study-supporting-refline .ai-study-citation-ref { color: var(--primary-color); }
.ai-study-supporting-source { opacity: 0.85; font-weight: 400; }
.ai-study-supporting-text { line-height: 1.35; word-break: break-word; }
.ai-study-confidence-notes { font-size: 0.8rem; color: var(--light-text); margin-top: 0.5rem; opacity: 0.85; }
.ai-study-save-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    margin-top: 0.65rem;
}
.ai-study-save-hint {
    font-size: 0.78rem;
    color: var(--light-text);
    margin: 0;
    line-height: 1.35;
    max-width: 100%;
    word-break: break-word;
}
.ai-study-save-to-note-btn { font-size: 0.85rem; padding: 0.25rem 0.5rem; }
/* Client-side summary of which /ask request fields were sent (not model behavior). */
.ai-study-provenance {
    font-size: 0.75rem;
    color: var(--light-text);
    margin-top: 0.5rem;
    line-height: 1.4;
}
.ai-study-provenance-label {
    font-weight: 500;
    margin-right: 0.25rem;
    opacity: 0.9;
}
.ai-study-provenance-chip {
    display: inline-block;
    margin: 0.15rem 0.35rem 0 0;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.map-section { margin-bottom: 0; padding: 1rem 1.25rem; background: var(--light-bg); border-radius: 8px; border: 1px solid var(--border-color); }
.map-heading { font-size: 1.1rem; margin: 0 0 0.5rem; color: var(--primary-color); }
.map-canvas { width: 100%; min-height: 260px; border: 1px solid var(--border-color); border-radius: 0.375rem; margin-bottom: 0.5rem; }
.map-caption { margin: 0; font-size: 0.85rem; color: var(--light-text); line-height: 1.4; }
.map-focus-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.75rem;
    margin: 0 0 0.35rem 0;
}
.map-focus-row .map-focused-place {
    margin: 0;
    flex: 1 1 12rem;
    min-width: 0;
}
.map-focused-place { font-size: 0.85rem; line-height: 1.4; color: var(--primary-color); font-weight: 500; opacity: 0.92; }
.map-clear-focus-btn {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: transparent;
    color: var(--light-text);
    cursor: pointer;
    flex-shrink: 0;
}
.map-clear-focus-btn:hover {
    background: var(--border-color);
    color: var(--text-color);
}
.map-clear-focus-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.map-caption--loading { font-style: italic; color: var(--light-text); }
.map-caption--info { color: var(--light-text); border-left: 3px solid var(--secondary-color); padding-left: 0.5rem; }
.map-caption--warn { color: var(--error-color, #c0392b); }
.map-caption--success { color: var(--light-text); }
.leaflet-popup-content .map-popup-inner {
    margin: 0;
    min-width: 0;
    max-width: min(280px, calc(100vw - 2.75rem));
}
.leaflet-popup-content .map-popup-sections {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.52rem;
}
.leaflet-popup-content .map-popup-sections .map-popup-label {
    margin-top: 0;
}
.leaflet-popup-content .map-popup-sections .map-popup-summary {
    margin-top: 0;
    line-height: 1.45;
    word-break: break-word;
    hyphens: auto;
}
.leaflet-popup-content .map-popup-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.28;
    margin: 0 0 0.28rem;
    color: var(--primary-color);
    word-break: break-word;
}
.leaflet-popup-content .map-popup-summary {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--text-color);
    word-break: break-word;
    hyphens: auto;
}
.leaflet-popup-content .map-popup-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--light-text);
    margin-top: 0.45rem;
    margin-bottom: 0.1rem;
    line-height: 1.3;
}
.leaflet-popup-content .map-popup-block {
    display: block;
    font-size: 0.82rem;
    line-height: 1.42;
    color: var(--text-color);
    word-break: break-word;
    hyphens: auto;
}
.leaflet-popup-content .map-popup-matched,
.leaflet-popup-content .map-popup-refs {
    color: var(--light-text);
}
/* Long “Other references” lists: scroll inside popup instead of stretching height. */
.leaflet-popup-content .map-popup-block.map-popup-refs {
    max-height: 6.75rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overflow-wrap: break-word;
    padding-right: 0.35rem;
    margin-top: 0.08rem;
    line-height: 1.4;
}
.place-focus-map-btn {
    margin-left: 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--light-bg);
    color: var(--secondary-color);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    padding: 0.22em 0.55em;
    line-height: 1.25;
}
.place-focus-map-btn:hover {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.07);
    color: var(--primary-color);
}
.place-focus-map-btn:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
.place-focus-map-state-hint {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--light-text);
    white-space: nowrap;
    user-select: none;
}

/* Passage layout: main + sidebar */
.passage-layout {
    display: flex;
    gap: 1.5rem;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1rem;
}

.passage-main {
    flex: 1;
    min-width: 0;
}

.passage-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

/* Verse header: reference + actions */
.verse-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}
.verse-header .result-reference {
    margin-bottom: 0;
    flex: 1 1 12rem;
    min-width: 0;
    word-break: break-word;
}
.verse-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem 0.45rem;
    flex: 0 1 auto;
    margin-left: auto;
    max-width: 100%;
}
.go-to-compare-btn {
    font-size: 0.8125rem;
    padding: 0.35rem 0.65rem;
    flex-shrink: 0;
    white-space: nowrap;
    opacity: 0.9;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}
.go-to-compare-btn:hover,
.go-to-compare-btn:focus-visible {
    opacity: 1;
}
.translations-compare-hint {
    font-size: 0.875rem;
    color: var(--light-text);
    margin: 0 0 0.5rem 0;
    line-height: 1.45;
}
.verse-header-icon-btn,
.bookmark-btn {
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.25rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: rgba(148, 163, 184, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 6px;
    cursor: pointer;
    color: var(--light-text);
    opacity: 0.95;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.pin-verse-btn,
.add-to-collection-btn {
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.25rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: rgba(148, 163, 184, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 6px;
    cursor: pointer;
    color: var(--light-text);
    opacity: 0.95;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.bookmark-btn:hover,
.pin-verse-btn:hover,
.add-to-collection-btn:hover {
    color: var(--secondary-color);
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.35);
}
.bookmark-btn:focus-visible,
.pin-verse-btn:focus-visible,
.add-to-collection-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.bookmark-btn.bookmark-active {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.08);
}
.bookmark-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pin-verse-btn.pin-verse-active {
    color: var(--secondary-color);
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.06);
}

.pinned-verse-panel[data-busy] .pinned-verse-move-up,
.pinned-verse-panel[data-busy] .pinned-verse-move-down,
.pinned-verse-panel[data-busy] .pinned-verse-unpin,
.pinned-verse-panel[data-busy] .pinned-clear-all-btn,
.pinned-verse-panel[data-busy] .pinned-verse-ref-link {
    pointer-events: none;
    opacity: 0.6;
}
.pinned-verse-panel {
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
.pinned-verses-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.pinned-verse-item {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}
.pinned-verse-item.pinned-verse-current {
    background-color: rgba(59, 130, 246, 0.1);
    border-radius: 0.25rem;
}
.pinned-verse-item.pinned-verse-current-ref {
    background-color: rgba(59, 130, 246, 0.05);
    border-radius: 0.25rem;
    border-left: 2px solid rgba(59, 130, 246, 0.4);
}
.pinned-verse-current-label {
    font-size: 0.75rem;
    color: var(--light-text);
    margin-right: 0.5rem;
    font-weight: 500;
}
.pinned-verse-ref-only-label {
    font-style: italic;
    opacity: 0.9;
}
.pinned-verse-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}
.pinned-verse-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}
.pinned-verse-ref-link {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary-color);
}
.pinned-verse-ref-link {
    text-decoration: none;
}
.pinned-verse-ref-link:hover {
    text-decoration: underline;
}
.pinned-verse-code {
    font-size: 0.8rem;
    color: var(--light-text);
    margin-left: 0.25rem;
}
.pinned-verse-reorder {
    display: inline-flex;
    gap: 0.15rem;
}
.pinned-verse-move-up,
.pinned-verse-move-down {
    font-size: 0.75rem;
    padding: 0.15rem 0.35rem;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 0.2rem;
    cursor: pointer;
    color: var(--light-text);
}
.pinned-verse-move-up:hover:not(:disabled),
.pinned-verse-move-down:hover:not(:disabled) {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}
.pinned-verse-move-up:disabled,
.pinned-verse-move-down:disabled {
    opacity: 0.4;
    cursor: default;
}
.pinned-verse-unpin {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    cursor: pointer;
    color: var(--light-text);
}
.pinned-verse-unpin:hover {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}
.pinned-verse-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-color);
}

.study-trail-context {
    font-size: 0.85rem;
    color: var(--light-text);
    margin-bottom: 0.35rem;
}
.study-trail-context.study-trail-clickable {
    color: var(--secondary-color);
    cursor: pointer;
    text-decoration: none;
}
.study-trail-context.study-trail-clickable:hover {
    text-decoration: underline;
}
.study-trail-context.study-trail-clickable:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.back-to-ref-wrap {
    margin-bottom: 0.5rem;
}
.back-to-ref-link {
    font-size: 0.9rem;
    color: var(--secondary-color);
    text-decoration: none;
}
.back-to-ref-link:hover {
    text-decoration: underline;
}
.back-to-ref-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Note section */
.note-section {
    margin-bottom: 1rem;
}
.note-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 0.35rem;
}
.back-to-passage-note-wrap {
    margin-bottom: 0.35rem;
}
.note-study-context-hint {
    font-size: 0.8rem;
    color: var(--light-text);
    margin: 0 0 0.4rem;
    line-height: 1.35;
}
.note-editor-wrap {
    position: relative;
    min-height: 4.5rem;
}
.note-read-preview-hint {
    font-size: 0.8rem;
    color: var(--light-text);
    margin: 0 0 0.35rem;
    line-height: 1.35;
}
.note-editor-wrap .note-textarea,
.note-editor-wrap .note-body-read-view {
    width: 100%;
    box-sizing: border-box;
}
.note-body-read-view {
    font-size: 0.95rem;
    font-family: inherit;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    min-height: 4.5rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    cursor: text;
    background: var(--bg-color, #fff);
    color: var(--text-color);
}
.note-body-read-view .note-study-context-jump {
    display: inline;
    font: inherit;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    cursor: pointer;
    text-decoration: underline;
    color: var(--primary-color);
}
.note-body-read-view .note-study-context-jump:hover {
    color: var(--secondary-color, var(--primary-color));
}
/* Plain-text --- AI Study --- markers (read view only; storage is unchanged) */
.note-body-read-view .note-ai-study-heading {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--light-text);
    margin-top: 0.75em;
    margin-bottom: 0.2em;
}
.note-body-read-view .note-ai-study-heading:first-child {
    margin-top: 0;
}
.back-to-passage-note-btn {
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--secondary-color);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
}
.back-to-passage-note-btn:hover {
    color: var(--primary-color);
}
.back-to-passage-note-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.note-dirty-indicator {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--light-text);
    margin-left: 0.35rem;
}
.note-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 0.5rem;
}
.note-textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
}
.note-actions {
    display: flex;
    gap: 0.5rem;
}
.note-save-inline-status {
    font-size: 0.8rem;
    color: var(--success-color);
    align-self: center;
}
.note-shortcut-hint {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--light-text);
    align-self: center;
}
.btn-note {
    padding: 0.35rem 0.75rem;
    font-size: 0.9rem;
    border-radius: 0.375rem;
    border: 1px solid var(--secondary-color);
    background: var(--secondary-color);
    color: white;
    cursor: pointer;
}
.btn-note:hover {
    opacity: 0.9;
}
.btn-note:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn-note-secondary {
    background: white;
    color: var(--text-color);
    border-color: var(--border-color);
}
.btn-note-secondary:hover {
    background: var(--light-bg);
}

/* Bookmarks sidebar */
.bookmarks-sidebar {
    width: 220px;
    flex-shrink: 0;
    padding: 1rem 1.25rem;
    background: var(--light-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
}
.bookmarks-sidebar-heading {
    font-size: 1rem;
    margin: 0 0 0.75rem;
    color: var(--primary-color);
}
.bookmarks-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.bookmarks-list li {
    margin-bottom: 0.35rem;
}
.bookmark-sidebar-item {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    flex-wrap: wrap;
    padding: 0.2rem 0;
    border-radius: 0.25rem;
}
.bookmark-sidebar-item-current {
    background-color: rgba(59, 130, 246, 0.12);
}
.bookmark-sidebar-current-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--secondary-color);
    flex-shrink: 0;
}
.bookmark-ref {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
}
.bookmark-ref:hover {
    text-decoration: underline;
}
.bookmarks-empty {
    margin: 0;
    font-size: 0.85rem;
    color: var(--light-text);
    line-height: 1.4;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1rem 0;
}
.sessions-sidebar-heading {
    font-size: 1rem;
    margin: 0 0 0.5rem;
    color: var(--primary-color);
}
.sessions-create {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}
.session-name-input {
    flex: 1;
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}
.btn-session {
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    border-radius: 0.375rem;
    border: 1px solid var(--secondary-color);
    background: var(--secondary-color);
    color: white;
    cursor: pointer;
}
.btn-session:hover:not(:disabled) { opacity: 0.9; }
.btn-session:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-session-secondary {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--border-color);
}
.btn-session-secondary:hover { background: rgba(59, 130, 246, 0.08); }
.session-json-hint {
    margin: 0.5rem 0 0.25rem;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--light-text);
}
.session-export-import {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.sessions-list-wrap { margin-top: 0.25rem; }
.sessions-loading { margin: 0; font-size: 0.85rem; color: var(--light-text); font-style: italic; }
.sessions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}
.sessions-list li { margin-bottom: 0.35rem; }
.session-item { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.session-ref { cursor: pointer; padding: 0.2rem 0; border-radius: 0.25rem; }
.session-ref:hover { background-color: rgba(59, 130, 246, 0.08); }
.session-ref.session-active { background-color: rgba(59, 130, 246, 0.12); }
.session-active-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--secondary-color);
    flex-shrink: 0;
}
.session-name { flex: 1; min-width: 0; }
.session-date { font-size: 0.8rem; color: var(--light-text); flex-shrink: 0; }
.session-rename-btn,
.session-delete-btn {
    background: none;
    border: none;
    color: var(--light-text);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0 0.15rem;
    flex-shrink: 0;
}
.session-rename-btn:hover,
.session-delete-btn:hover { color: var(--primary-color); }
.sessions-empty {
    margin: 0;
    font-size: 0.85rem;
    color: var(--light-text);
}

.collections-list-wrap { margin-top: 0.25rem; }
.collections-loading { margin: 0; font-size: 0.85rem; color: var(--light-text); font-style: italic; }
.collections-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}
.collections-list li { margin-bottom: 0.35rem; }
.collection-item {
    cursor: pointer;
    padding: 0.2rem 0;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.15rem;
}
.collection-item:hover { background-color: rgba(59, 130, 246, 0.08); }
.collection-item.collection-item-expanded {
    background-color: rgba(59, 130, 246, 0.12);
}
.collection-name { flex: 1; min-width: 0; }
.collection-count { font-size: 0.75rem; color: var(--light-text); }
.collection-rename,
.collection-delete {
    background: none;
    border: none;
    color: var(--light-text);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0 0.15rem;
}
.collection-rename:hover,
.collection-delete:hover { color: var(--primary-color); }
.collection-expand { font-size: 0.7rem; color: var(--light-text); margin-left: 0.25rem; }
.collection-verses {
    list-style: none;
    padding: 0.25rem 0 0 0.75rem;
    margin: 0;
    font-size: 0.85rem;
    flex-basis: 100%;
}
.collection-verses[hidden] { display: none; }
.collection-verse-item {
    margin-bottom: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.collection-verse-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.35rem;
    min-width: 0;
}
.collection-verse-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
}
.collection-verse-ref {
    color: var(--primary-color);
    text-decoration: none;
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}
.collection-verse-ref:hover { text-decoration: underline; }
.collection-verse-translation {
    font-size: 0.8rem;
    color: var(--light-text);
    flex-shrink: 0;
    overflow-wrap: break-word;
}
.collection-verse-note-preview {
    font-size: 0.8rem;
    color: var(--light-text);
    padding: 0.15rem 0 0 0.35rem;
    margin-left: 0.15rem;
    border-left: 2px solid var(--border-color);
    line-height: 1.35;
}
.collection-verse-note-preview:not([hidden]) {
    cursor: pointer;
}
.collection-verse-note-preview:not([hidden]):hover {
    color: var(--primary-color);
}
.collection-verse-note-preview:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.collection-verse-add-note {
    font-size: 0.8rem;
    color: var(--light-text);
    padding: 0.15rem 0 0 0.35rem;
    margin-left: 0.15rem;
    border-left: 2px solid var(--border-color);
    line-height: 1.35;
}
.collection-verse-add-note:not([hidden]) {
    cursor: pointer;
}
.collection-verse-add-note:not([hidden]):hover {
    color: var(--primary-color);
}
.collection-verse-add-note:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.collection-verse-bookmark {
    background: none;
    border: none;
    color: var(--light-text);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.3;
    padding: 0.1rem 0.2rem;
    flex-shrink: 0;
}
.collection-verse-bookmark:hover { color: var(--secondary-color); }
.collection-verse-bookmark.bookmark-active { color: var(--secondary-color); }
.collection-verse-bookmark:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.collection-verse-pin {
    background: none;
    border: none;
    color: var(--light-text);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.3;
    padding: 0.1rem 0.2rem;
    flex-shrink: 0;
}
.collection-verse-pin:hover { color: var(--secondary-color); }
.collection-verse-pin.pin-verse-active { color: var(--secondary-color); }
.collection-verse-pin:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.collection-verse-pin:disabled,
.collection-verse-bookmark:disabled,
.collection-verse-remove:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.collection-verse-remove {
    background: none;
    border: none;
    color: var(--light-text);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.3;
    padding: 0.1rem 0.25rem;
    flex-shrink: 0;
}
.collection-verse-remove:hover { color: var(--primary-color); }
.collection-verse-item.collection-verse-current {
    background-color: rgba(59, 130, 246, 0.08);
    border-radius: 0.25rem;
    padding: 0.3rem 0.4rem;
}
.collection-verse-current-label {
    font-size: 0.75rem;
    color: var(--light-text);
    flex-shrink: 0;
    margin-right: 0.1rem;
    line-height: 1.3;
}
.collections-empty {
    margin: 0;
    font-size: 0.85rem;
    color: var(--light-text);
    line-height: 1.4;
}

.active-session-banner {
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    background: var(--light-bg);
    border-radius: 0.375rem;
    border-left: 4px solid var(--secondary-color);
}
.active-session-icon { margin-right: 0.25rem; }

/* Presentation mode: distraction-reduced teaching/reading view */
.exit-presentation-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 200;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.exit-presentation-btn:hover {
    background: var(--secondary-color);
}

body.presentation-mode .passage-form,
body.presentation-mode .passage-desc,
body.presentation-mode .search-section,
body.presentation-mode .bookmarks-sidebar,
body.presentation-mode .active-session-banner,
body.presentation-mode .note-section,
body.presentation-mode .context-expand-controls,
body.presentation-mode .passage-surrounding-verses-hint,
body.presentation-mode .timeline-section,
body.presentation-mode .places-heading,
body.presentation-mode .places-list,
body.presentation-mode .translations-toolbar,
body.presentation-mode .go-to-compare-btn,
body.presentation-mode .translations-compare-hint,
body.presentation-mode .cross-ref-heading,
body.presentation-mode .cross-ref-filter-wrap,
body.presentation-mode .cross-ref-list,
body.presentation-mode .ai-study-heading,
body.presentation-mode .ai-study-section,
body.presentation-mode #mapSectionWrap,
body.presentation-mode .tokens-heading,
body.presentation-mode .tokens-wrap,
body.presentation-mode #interlinearSection,
body.presentation-mode .word-study-controls-stack {
    display: none !important;
}
body.presentation-mode .passage-section h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}
body.presentation-mode .passage-layout {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}
body.presentation-mode .result-reference {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
body.presentation-mode .translation-block {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    font-size: 1.15rem;
    line-height: 1.7;
}
body.presentation-mode .translation-block--passage-level {
    padding-left: calc(1.25rem - 3px);
}
body.presentation-mode .translation-block-heading {
    font-size: 0.875rem;
}
body.presentation-mode .translation-text {
    font-size: 1.1rem;
    margin-top: 0.55rem;
}
body.presentation-mode .translation-passage-ref {
    font-size: 0.9rem;
    margin-top: 0.35rem;
    margin-bottom: 0;
    color: var(--light-text);
}
body.presentation-mode .translation-text--passage-prose {
    font-size: 1.12rem;
    line-height: 1.78;
    max-width: none;
    margin-top: 0.45rem;
}
body.presentation-mode .context-list {
    font-size: 1rem;
    padding: 0.75rem 1rem;
}
body.presentation-mode .translations-heading {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}
body.presentation-mode .section-divider {
    margin: 1.25rem 0;
}

/* Presentation mode: mobile tweaks */
@media (max-width: 768px) {
    body.presentation-mode .passage-layout {
        max-width: none;
        padding: 0 1rem;
    }

    body.presentation-mode .result-reference {
        font-size: 1.25rem;
    }

    body.presentation-mode .translation-text {
        font-size: 1rem;
    }

    body.presentation-mode .translation-text--passage-prose {
        font-size: 1.02rem;
    }

    body.presentation-mode .translation-block {
        padding: 0.75rem 1rem;
    }

    body.presentation-mode .translation-block--passage-level {
        padding-left: calc(1rem - 3px);
    }
}

@media (max-width: 430px) {
    body.presentation-mode .result-reference {
        font-size: 1.1rem;
    }

    body.presentation-mode .translation-text {
        font-size: 0.9375rem;
    }

    body.presentation-mode .translation-text--passage-prose {
        font-size: 0.9375rem;
    }

    body.presentation-mode .translation-passage-ref {
        font-size: 0.82rem;
    }

    body.presentation-mode .passage-section h3 {
        font-size: 1rem;
    }
}

/* Status toast (collection save feedback, etc.) */
.status-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.6rem 1rem;
    background: var(--text-color);
    color: white;
    font-size: 0.9rem;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-width: 320px;
}
.status-toast-error {
    background: #b91c1c;
}

/* Explore Map MVP (standalone, dataset-driven) */
.explore-map-main {
    outline: none;
}
.explore-map-error {
    margin-bottom: 0.9rem;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(185, 28, 28, 0.45);
    background: rgba(254, 226, 226, 0.35);
    color: var(--text-color);
    font-size: 0.85rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.explore-map-retry {
    margin-left: 0.5rem;
    vertical-align: middle;
    min-height: 2.5rem;
    padding: 0.15rem 0.65rem;
    border-radius: 6px;
}
.explore-map-error .explore-map-retry:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.explore-map-canvas--pending {
    background: repeating-linear-gradient(
        -45deg,
        rgba(148, 163, 184, 0.08),
        rgba(148, 163, 184, 0.08) 8px,
        rgba(148, 163, 184, 0.02) 8px,
        rgba(148, 163, 184, 0.02) 16px
    );
}
.explore-map-section {
    padding: 1.5rem 0 2.5rem;
}
.explore-map-inner {
    max-width: 1200px;
}
.explore-map-title {
    margin-bottom: 0.5rem;
}
.explore-map-intro {
    color: var(--light-text);
    margin-bottom: 1.25rem;
    line-height: 1.55;
    max-width: 52rem;
}
.explore-map-intro a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 3px;
}
.explore-map-toolbar {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}
.explore-map-filter-label {
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
}
.explore-map-filter-input {
    min-width: min(12rem, 100%);
    min-height: 44px;
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.55);
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
    max-width: 100%;
}
.explore-map-filter-input:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    background: rgba(148, 163, 184, 0.06);
}
.explore-map-filter-input:focus-visible:not(:disabled) {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.explore-map-filter-hint {
    font-size: 0.75rem;
    color: var(--light-text);
    flex-basis: 100%;
}
.explore-map-chip-wrap {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.explore-map-chip-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.65rem;
}
.explore-map-chip-legend {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--light-text);
    min-width: 5.5rem;
}
.explore-map-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    flex: 1;
    min-width: 0;
}
.explore-map-chip {
    min-height: 36px;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.55);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-color);
    font-size: 0.82rem;
    cursor: pointer;
    line-height: 1.3;
}
.explore-map-chip:hover {
    border-color: rgba(59, 130, 246, 0.45);
    background: rgba(59, 130, 246, 0.08);
}
.explore-map-chip:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.explore-map-chip--active:focus-visible {
    outline-offset: 3px;
}
.explore-map-chip--active {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.18);
    font-weight: 600;
}
.explore-map-active-filters {
    margin-bottom: 0.9rem;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.28);
    background: rgba(59, 130, 246, 0.06);
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-color);
}
.explore-map-active-filters__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    justify-content: space-between;
}
.explore-map-active-filters__summary {
    flex: 1 1 12rem;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.explore-map-active-filters__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}
.explore-map-filter-clear-btn {
    min-height: 32px;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.55);
    background: var(--light-bg);
    color: var(--text-color);
    font-size: 0.78rem;
    cursor: pointer;
    line-height: 1.3;
}
.explore-map-filter-clear-btn:hover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}
.explore-map-filter-clear-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.explore-map-filter-clear-btn--all {
    font-weight: 600;
    border-color: rgba(59, 130, 246, 0.45);
}
.explore-map-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: stretch;
}
.explore-map-list-panel {
    flex: 1 1 280px;
    max-width: 100%;
    min-width: 260px;
}
.explore-map-list-heading {
    font-size: 1rem;
    margin: 0 0 0.35rem;
}
.explore-map-list-status {
    font-size: 0.85rem;
    color: var(--light-text);
    margin-bottom: 0.55rem;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(148, 163, 184, 0.06);
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.5;
}
.explore-place-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: min(70vh, 520px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.04);
}
.explore-place-list:empty {
    min-height: 3.5rem;
    background: rgba(148, 163, 184, 0.03);
}
.explore-place-item {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    cursor: pointer;
    outline: none;
    transition: background-color 120ms ease-in-out, border-left-color 120ms ease-in-out;
}
.explore-place-item:last-child {
    border-bottom: none;
}
.explore-place-item:hover:not(.explore-place-item-active) {
    background: rgba(148, 163, 184, 0.08);
}
.explore-place-item:focus-visible {
    box-shadow: inset 0 0 0 2px var(--primary-color);
}
.explore-place-item-active:focus-visible {
    box-shadow: inset 0 0 0 2px var(--primary-color);
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}
.explore-place-item-active {
    background: rgba(59, 130, 246, 0.16);
    border-left: 3px solid var(--primary-color);
    padding-left: calc(0.75rem - 3px);
}
.explore-place-item-head {
    line-height: 1.32;
}
.explore-place-item-head .explore-place-name {
    font-weight: 700;
}
.explore-place-item .explore-place-name:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
    border-radius: 4px;
}
.explore-place-meta {
    margin: 0.26rem 0 0;
    padding: 0;
    font-size: 0.72rem;
    line-height: 1.38;
    color: var(--light-text);
    letter-spacing: 0.02em;
}
.explore-place-summary {
    margin: 0.4rem 0 0;
    font-size: 0.88rem;
    line-height: 1.47;
    color: var(--text-color);
}
.explore-place-syns {
    margin: 0.38rem 0 0;
    font-size: 0.78rem;
    color: var(--light-text);
    line-height: 1.42;
}
.explore-place-profile {
    margin-top: 0.44rem;
    font-size: 0.78rem;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 0.42rem 0.52rem;
    background: rgba(148, 163, 184, 0.06);
}
.explore-place-profile summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--light-text);
    list-style: none;
}
.explore-place-profile summary::-webkit-details-marker {
    display: none;
}
.explore-place-profile summary:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}
.explore-place-profile-body {
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}
.explore-profile-line {
    margin-bottom: 0.28rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.explore-profile-line:last-child {
    margin-bottom: 0;
}
.explore-profile-label {
    font-weight: 600;
    color: var(--light-text);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-right: 0.25rem;
}
.explore-map-map-panel {
    flex: 2 1 360px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.explore-map-canvas {
    width: 100%;
    min-height: min(55vh, 440px);
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    z-index: 0;
}
.explore-map-canvas:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}
.explore-map-caption {
    margin: 0;
    font-size: 0.82rem;
}
.map-popup-external {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
}
/* Explore map popups use the same .map-popup-inner / .map-popup-sections stack as passage.html */
.leaflet-popup-content .map-popup-inner > .map-popup-external {
    margin-top: 0.5rem;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}
.leaflet-popup-content .map-popup-inner--explore .map-popup-external a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}
/* Explore Map marker popups only (passage uses .map-popup-inner without --explore). */
.leaflet-popup-content .map-popup-inner--explore > .map-popup-title {
    margin-bottom: 0.36rem;
}
.leaflet-popup-content .map-popup-inner--explore:has(> .map-popup-meta.explore-place-meta) > .map-popup-title {
    margin-bottom: 0.22rem;
}
.leaflet-popup-content .map-popup-inner--explore > .map-popup-meta.explore-place-meta {
    margin: 0 0 0.36rem;
    line-height: 1.38;
}
.leaflet-popup-content .map-popup-inner--explore > .map-popup-sections {
    gap: 0.5rem;
    margin-top: 0;
}
.leaflet-popup-content .map-popup-inner--explore:not(:has(> .map-popup-meta.explore-place-meta)) > .map-popup-sections > .map-popup-label:first-child,
.leaflet-popup-content .map-popup-inner--explore:not(:has(> .map-popup-meta.explore-place-meta)) > .map-popup-sections > .map-popup-summary:first-child {
    margin-top: 0;
}
.leaflet-popup-content .map-popup-inner--explore:has(> .map-popup-meta.explore-place-meta) > .map-popup-sections {
    padding-top: 0.42rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}
.leaflet-popup-content .map-popup-inner--explore:has(> .map-popup-meta.explore-place-meta) > .map-popup-sections > .map-popup-label:first-child {
    margin-top: 0;
}
.leaflet-popup-content .map-popup-inner--explore:has(> .map-popup-meta.explore-place-meta) > .map-popup-sections > .map-popup-label {
    margin-top: 0.34rem;
    margin-bottom: 0.06rem;
}
.leaflet-popup-content .map-popup-inner--explore:has(> .map-popup-meta.explore-place-meta) .map-popup-sections .map-popup-summary {
    font-size: 0.8rem;
    line-height: 1.42;
    color: var(--light-text);
}
.leaflet-popup-content .map-popup-inner--explore:has(> .map-popup-meta.explore-place-meta) > .map-popup-sections > .map-popup-block {
    font-size: 0.8rem;
    line-height: 1.4;
}
.leaflet-popup-content .map-popup-inner--explore:not(:has(> .map-popup-meta.explore-place-meta)) .map-popup-sections .map-popup-summary {
    line-height: 1.48;
}
.leaflet-popup-content .map-popup-inner--explore .map-popup-see-also-wrap {
    line-height: 1.42;
    margin-top: 0.1rem;
}
.leaflet-popup-content .map-popup-inner--explore > .map-popup-external {
    margin-top: 0.48rem;
    padding-top: 0.38rem;
}
.leaflet-popup-content .map-popup-inner--explore .explore-map-popup-section-label {
    margin-top: 0.28rem;
    margin-bottom: 0.14rem;
}
.leaflet-popup-content .map-popup-inner--explore .explore-map-popup-verse-previews {
    margin: 0.02rem 0 0.18rem;
    display: grid;
    gap: 0.28rem;
}
.leaflet-popup-content .map-popup-inner--explore .explore-map-popup-inline-status {
    margin: 0;
    font-size: 0.76rem;
    line-height: 1.36;
    color: var(--muted-text);
}
.leaflet-popup-content .map-popup-inner--explore .explore-map-popup-verse-preview {
    margin: 0;
    padding: 0.34rem 0.42rem;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.07);
}
.leaflet-popup-content .map-popup-inner--explore .explore-map-popup-verse-label {
    margin: 0 0 0.12rem;
    font-size: 0.72rem;
    line-height: 1.3;
    font-weight: 700;
    color: var(--light-text);
}
.leaflet-popup-content .map-popup-inner--explore .explore-map-popup-verse-text {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.42;
    color: var(--text-color);
    overflow-wrap: anywhere;
}
.leaflet-popup-content .map-popup-inner--explore .explore-map-ref-list {
    margin-top: 0.08rem;
    padding-left: 1rem;
}
.leaflet-popup-content .map-popup-inner--explore .explore-map-ref-list a {
    text-underline-offset: 2px;
}
@media (max-width: 720px) {
    .explore-map-section {
        padding: 1.1rem 0 1.75rem;
    }
    .explore-map-intro {
        margin-bottom: 1rem;
    }
    .explore-map-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
    }
    .explore-map-filter-label {
        margin-bottom: 0.05rem;
    }
    .explore-map-filter-input {
        width: 100%;
        min-width: 0;
        touch-action: manipulation;
    }
    .explore-map-chip-wrap {
        gap: 0.62rem;
        margin-bottom: 0.92rem;
    }
    .explore-map-chip-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
    }
    .explore-map-chip-legend {
        min-width: 0;
        font-size: 0.8rem;
        margin-bottom: 0.06rem;
    }
    .explore-map-chips {
        width: 100%;
        gap: 0.42rem;
    }
    .explore-map-chip {
        min-height: 44px;
        padding: 0.3rem 0.75rem;
        font-size: 0.85rem;
        touch-action: manipulation;
    }
    .explore-map-active-filters {
        padding: 0.55rem 0.62rem;
        font-size: 0.85rem;
        line-height: 1.5;
    }
    .explore-map-active-filters__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.48rem;
    }
    .explore-map-active-filters__summary {
        flex: none;
        width: 100%;
    }
    .explore-map-active-filters__actions {
        width: 100%;
        justify-content: flex-start;
        gap: 0.42rem;
    }
    .explore-map-filter-clear-btn {
        min-height: 44px;
        padding: 0.28rem 0.65rem;
        font-size: 0.8rem;
        touch-action: manipulation;
    }
    .explore-map-layout {
        flex-direction: column;
        gap: 0.85rem;
    }
    .explore-map-list-panel,
    .explore-map-map-panel {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
    }
    .explore-map-list-heading {
        font-size: 1.03rem;
        margin-bottom: 0.42rem;
    }
    .explore-map-list-status {
        font-size: 0.88rem;
        line-height: 1.52;
        margin-bottom: 0.55rem;
        padding: 0.48rem 0.58rem;
    }
    .explore-place-item {
        padding: 0.72rem 0.82rem;
        touch-action: manipulation;
    }
    .explore-place-item-active {
        padding-left: calc(0.82rem - 3px);
    }
    .explore-place-meta {
        font-size: 0.74rem;
        margin-top: 0.3rem;
        line-height: 1.38;
    }
    .explore-place-summary {
        margin-top: 0.44rem;
        font-size: 0.9rem;
        line-height: 1.5;
    }
    .explore-place-syns {
        margin-top: 0.4rem;
        line-height: 1.43;
    }
    .explore-place-profile {
        margin-top: 0.5rem;
        padding: 0.48rem 0.58rem;
    }
    .explore-place-profile-body {
        margin-top: 0.4rem;
        padding-top: 0.4rem;
    }
    .explore-place-list {
        max-height: min(38vh, 300px);
        min-height: 10.5rem;
    }
    .explore-map-canvas {
        min-height: min(40vh, 300px);
    }
    .explore-map-caption {
        line-height: 1.45;
    }
    /* Explore Map marker popups only (passage omits --explore) */
    .leaflet-popup-content .map-popup-inner--explore {
        max-width: min(300px, calc(100vw - 2rem));
    }
    .leaflet-popup-content .map-popup-inner--explore .map-popup-title {
        font-size: 1rem;
        line-height: 1.25;
    }
    .leaflet-popup-content .map-popup-inner--explore .map-popup-summary {
        font-size: 0.86rem;
    }
    .leaflet-popup-content .map-popup-inner--explore .map-popup-block {
        font-size: 0.84rem;
    }
    .leaflet-popup-content .map-popup-inner--explore > .map-popup-meta.explore-place-meta {
        font-size: 0.74rem;
        line-height: 1.38;
    }
    .leaflet-popup-content .map-popup-inner--explore:has(> .map-popup-meta.explore-place-meta) > .map-popup-sections {
        gap: 0.5rem;
        padding-top: 0.42rem;
    }
    .leaflet-popup-content .map-popup-inner--explore .map-popup-see-also-wrap {
        line-height: 1.45;
    }
    .leaflet-popup-content .map-popup-inner--explore .explore-map-popup-verse-preview {
        padding: 0.36rem 0.46rem;
    }
    .leaflet-popup-content .map-popup-inner--explore .explore-map-popup-verse-text {
        font-size: 0.8rem;
        line-height: 1.46;
    }
    .leaflet-popup-content .map-popup-inner--explore > .map-popup-external a {
        display: inline-block;
        padding: 0.25rem 0;
        min-height: 44px;
        line-height: 1.4;
        box-sizing: border-box;
        touch-action: manipulation;
    }
}

/* Cognito app host (biblebot.heisrisen.net) — sign-in gate */
.app-auth-gate {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.app-auth-gate[hidden] {
    display: none !important;
}
.app-auth-gate-inner {
    width: 100%;
    max-width: 28rem;
}
.app-auth-card {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.75rem 1.5rem;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}
.app-auth-card h2 {
    margin-bottom: 0.5rem;
    font-size: 1.35rem;
}
.app-auth-lead {
    margin-bottom: 0.75rem;
    color: var(--text-color);
}
.app-auth-muted {
    font-size: 0.9rem;
    color: var(--light-text);
    margin-bottom: 1.25rem;
    line-height: 1.45;
}
.app-auth-muted code {
    font-size: 0.82rem;
    word-break: break-all;
}
.app-signin-btn {
    width: 100%;
    justify-content: center;
}
.app-main[hidden] {
    display: none !important;
}
.app-callback-main {
    padding: 3rem 1rem;
    text-align: center;
}
