/* ==========================================================================
   Scripture Workspace
   ========================================================================== */

.workspace {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.library-pane,
.reading-pane {
    background: var(--tp-card);
    border: 1px solid var(--tp-border);
    border-radius: 14px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.07);
}

.library-pane {
    position: sticky;
    top: 20px;
    height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 24px;
}

.reading-pane {
    min-width: 0;
    padding: 24px;
}

.library-pane-heading {
    margin-bottom: 26px;
}

.library-pane-kicker,
.reading-kicker,
.verse-resource-kicker,
.knowledge-entry-kicker {
    margin-bottom: 4px;
    color: var(--tp-muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.library-pane h2 {
    margin: 0;
    font-size: 2rem;
    line-height: 1.1;
}

.library-form {
    display: flex;
    flex-direction: column;
}

.library-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.library-section label {
    display: block;
    margin: 0;
    font-size: 0.96rem;
    font-weight: 700;
}

.library-section select {
    width: 100%;
    min-height: 48px;
    box-sizing: border-box;
    padding: 9px 38px 9px 12px;
    border: 1px solid var(--tp-border);
    border-radius: 9px;
    background: #fff;
    color: inherit;
    font: inherit;
    font-size: 0.96rem;
}

.library-section select:hover {
    border-color: rgba(177, 110, 24, 0.72);
}

.library-section select:focus {
    outline: 3px solid rgba(177, 110, 24, 0.16);
    border-color: var(--tp-bronze);
}

.library-form hr {
    width: 100%;
    margin: 25px 0;
    border: 0;
    border-top: 1px solid var(--tp-border);
}

.library-help {
    margin-top: 30px;
    padding: 15px;
    border: 1px solid #dbc99f;
    border-radius: 10px;
    background: #fff9e9;
    color: #5f4b25;
}

.library-help strong {
    display: block;
    margin-bottom: 5px;
    color: var(--tp-bronze);
}

.library-help p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
}


/* ==========================================================================
   Reading Header
   ========================================================================== */

.reading-header {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--tp-border);
}

.reading-title-row {
    display: flex;
    justify-content: space-between;
    gap: 22px;
    align-items: flex-start;
}

.reading-header h1 {
    margin: 0;
    color: var(--tp-bronze);
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.08;
}

.reading-version {
    margin: 7px 0 0;
    color: var(--tp-muted);
}

.chapter-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.chapter-nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-decoration: none;
}


/* ==========================================================================
   Reading Progress
   ========================================================================== */

.reading-progress {
    flex: 0 0 auto;
}

.reading-progress-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
    padding: 12px 16px;
    border: 2px solid transparent;
    border-radius: 12px;
    text-align: left;
    cursor: pointer;
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease;
}

.reading-progress-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.11);
}

.reading-progress-button:focus-visible {
    outline: 3px solid rgba(30, 144, 255, 0.25);
    outline-offset: 2px;
}

.reading-progress-button.incomplete {
    border-color: #c7cbd1;
    background: #f4f5f7;
    color: #333;
}

.reading-progress-button.complete {
    border-color: #3c8d55;
    background: #eaf7ee;
    color: #145728;
}

.reading-progress-button.saving {
    opacity: 0.72;
    cursor: wait;
}

.progress-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    font-size: 1.35rem;
    font-weight: 900;
}

.complete .progress-status-icon {
    background: #2f7b47;
    color: #fff;
}

.incomplete .progress-status-icon {
    border: 2px solid #9aa0a8;
    background: #fff;
    color: #555;
}

.progress-status-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.progress-status-copy strong {
    font-size: 0.98rem;
}

.progress-status-copy small {
    color: inherit;
    font-size: 0.76rem;
    opacity: 0.76;
}


/* ==========================================================================
   Verse Rows
   ========================================================================== */

.scripture-passages {
    border-top: 1px solid var(--tp-border);
}

.verse-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 28px;
    gap: 13px;
    align-items: start;
    padding: 17px 10px;
    border-bottom: 1px solid var(--tp-border);
    cursor: pointer;
    transition:
        background 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.verse-row:hover,
.verse-row:focus-visible {
    position: relative;
    z-index: 1;
    background: #fff7df;
    box-shadow: inset 4px 0 0 var(--tp-gold);
    transform: translateX(2px);
    outline: none;
}

.verse-number {
    padding-top: 1px;
    color: var(--tp-bronze);
    font-size: 1.08rem;
    font-weight: 800;
    text-align: right;
}

.verse-body {
    min-width: 0;
}

.verse-text {
    font-size: 1.04rem;
    line-height: 1.62;
}

.verse-open-indicator {
    padding-top: 1px;
    color: #a9a39a;
    font-size: 1.7rem;
    font-weight: 300;
    line-height: 1;
    opacity: 0;
    transform: translateX(-4px);
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}

.verse-row:hover .verse-open-indicator,
.verse-row:focus-visible .verse-open-indicator {
    opacity: 1;
    transform: translateX(0);
}


/* ==========================================================================
   Verse Resource Badges
   ========================================================================== */

.verse-resource-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
}

.verse-resource-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 25px;
    padding: 2px 8px;
    border: 1px solid #d7d7d7;
    border-radius: 999px;
    background: #f7f7f7;
    color: #333;
    font-size: 0.8rem;
    line-height: 1;
}

.verse-resource-badge strong {
    font-size: 0.78rem;
}

.resource-commandment {
    border-color: #d5b45d;
    background: #fff4c9;
}

.resource-law {
    border-color: #b6a47a;
    background: #f5edd7;
}

.resource-cross-reference {
    border-color: #91b8d7;
    background: #eaf5fd;
}

.resource-parallel-passage {
    border-color: #aa9bc8;
    background: #f2edff;
}

.resource-prophecy {
    border-color: #b999d1;
    background: #f5eafd;
}

.resource-fulfillment {
    border-color: #8fc59d;
    background: #ebf8ee;
}

.resource-teaching {
    border-color: #7fb7bd;
    background: #e8f7f8;
}

.resource-observation {
    border-color: #9db68b;
    background: #eff7e9;
}

.resource-question {
    border-color: #e1b36b;
    background: #fff3de;
}

.resource-person {
    border-color: #9db0ca;
    background: #edf2f9;
}

.resource-place {
    border-color: #95bd9e;
    background: #eaf6ed;
}

.resource-feast {
    border-color: #d8a870;
    background: #fff0df;
}

.resource-sacrifice {
    border-color: #c7a990;
    background: #f8eee7;
}

.resource-calendar {
    border-color: #8cb6cf;
    background: #eaf5fb;
}

.resource-statistic {
    border-color: #88bca9;
    background: #e8f7f1;
}

.resource-note {
    border-color: #c5c5c5;
    background: #f6f6f6;
}

.resource-other {
    border-color: #b8adca;
    background: #f2eff7;
}


/* ==========================================================================
   Empty Scripture State
   ========================================================================== */

.empty-scripture-selection {
    padding: 70px 20px;
    text-align: center;
}

.empty-scripture-icon {
    margin-bottom: 12px;
    font-size: 3rem;
}

.empty-scripture-selection h2 {
    margin: 0 0 8px;
}

.empty-scripture-selection p {
    margin: 0;
    color: var(--tp-muted);
}


/* ==========================================================================
   Modal Overlay
   ========================================================================== */

.hidden {
    display: none !important;
}

body.modal-open {
    overflow: hidden;
}

.scripture-modal {
    position: fixed;
    z-index: 3000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(20, 18, 14, 0.62);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.scripture-modal-card {
    position: relative;
    width: min(900px, 100%);
    max-height: min(90vh, 980px);
    overflow-y: auto;
    box-sizing: border-box;
    padding: 32px;
    border: 1px solid var(--tp-border);
    border-radius: 17px;
    background: var(--tp-card);
    box-shadow: 0 20px 65px rgba(0, 0, 0, 0.36);
    animation: scripture-modal-in 0.18s ease-out;
}

@keyframes scripture-modal-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.scripture-modal-close {
    position: sticky;
    z-index: 20;
    top: 0;
    float: right;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: -10px -10px 10px 18px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #696969;
    color: #fff;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
    transition:
        background 0.15s ease,
        transform 0.15s ease;
}

.scripture-modal-close:hover {
    background: #474747;
    transform: scale(1.04);
}

.scripture-modal-close:focus-visible {
    outline: 3px solid rgba(30, 144, 255, 0.35);
}

.modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 70px 15px;
    color: var(--tp-muted);
    text-align: center;
}

.modal-loading-icon {
    font-size: 2.8rem;
    animation: scripture-loading-pulse 1.1s ease-in-out infinite;
}

@keyframes scripture-loading-pulse {
    0%,
    100% {
        opacity: 0.48;
        transform: scale(0.96);
    }

    50% {
        opacity: 1;
        transform: scale(1.04);
    }
}


/* ==========================================================================
   Verse Resource Header
   ========================================================================== */

.verse-resource-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    padding-right: 42px;
}

.verse-resource-heading h2 {
    margin: 0;
    color: var(--tp-bronze);
    font-size: clamp(1.8rem, 4vw, 2.55rem);
    line-height: 1.1;
}

.verse-version-label {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
    color: var(--tp-muted);
    font-size: 0.9rem;
}

.verse-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.verse-tool-button {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--tp-border);
    border-radius: 8px;
    background: #fff;
    color: inherit;
    font: inherit;
    font-size: 0.87rem;
    font-weight: 700;
    cursor: pointer;
}

.verse-tool-button:hover {
    border-color: var(--tp-bronze);
    background: #fff7e3;
}

.verse-tool-button.primary {
    border-color: var(--tp-blue);
    background: var(--tp-blue);
    color: #fff;
}

.verse-tool-button.primary:hover {
    filter: brightness(0.94);
}

.selected-verse-text {
    margin: 22px 0;
    padding: 18px 20px;
    border: 0;
    border-left: 5px solid var(--tp-gold);
    border-radius: 0 10px 10px 0;
    background: #fff9e9;
    color: inherit;
    font-size: 1.08rem;
    line-height: 1.65;
}


/* ==========================================================================
   Drawer Tabs and Sections
   ========================================================================== */

.drawer-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--tp-border);
}

.drawer-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--tp-muted);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
}

.drawer-tab:hover {
    background: #f3f3f3;
    color: inherit;
}

.drawer-tab.active {
    border-color: #d5c28f;
    background: #fff6db;
    color: var(--tp-bronze);
}

.drawer-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    font-size: 0.74rem;
}

.drawer-section {
    display: none;
}

.drawer-section.active {
    display: block;
}


/* ==========================================================================
   Resource Overview
   ========================================================================== */

.resource-overview {
    margin-bottom: 22px;
    padding: 17px;
    border: 1px solid var(--tp-border);
    border-radius: 12px;
    background: #fcfbf8;
}

.resource-overview-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 13px;
}

.resource-overview h3 {
    margin: 0;
    font-size: 1.12rem;
}

.resource-overview p {
    margin: 4px 0 0;
    color: var(--tp-muted);
    font-size: 0.88rem;
}

.resource-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.resource-count-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--tp-border);
    border-radius: 999px;
    background: #fff;
    color: inherit;
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease;
}

.resource-count-chip:hover {
    border-color: var(--tp-bronze);
    background: #fff8e7;
    transform: translateY(-1px);
}

.resource-count-icon {
    font-size: 1rem;
}


/* ==========================================================================
   Empty Resources
   ========================================================================== */

.empty-resources {
    padding: 45px 20px;
    border: 1px dashed #cfc7b5;
    border-radius: 12px;
    background: #fcfaf5;
    text-align: center;
}

.empty-resources-icon {
    margin-bottom: 10px;
    font-size: 2.7rem;
}

.empty-resources h3 {
    margin: 0 0 8px;
}

.empty-resources p {
    max-width: 590px;
    margin: 0 auto 18px;
    color: var(--tp-muted);
    line-height: 1.5;
}


/* ==========================================================================
   Knowledge Groups
   ========================================================================== */

.knowledge-groups {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.knowledge-group {
    overflow: hidden;
    scroll-margin-top: 18px;
    border: 1px solid var(--tp-border);
    border-radius: 11px;
    background: #fff;
}

.knowledge-group > summary {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto 20px;
    gap: 8px;
    align-items: center;
    padding: 13px 15px;
    background: #f5ecda;
    color: var(--tp-bronze);
    font-weight: 800;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.knowledge-group > summary::-webkit-details-marker {
    display: none;
}

.knowledge-group > summary:hover {
    background: #f0e2c5;
}

.knowledge-summary-icon {
    font-size: 1.15rem;
}

.knowledge-summary-label {
    min-width: 0;
}

.knowledge-summary-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 27px;
    height: 27px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    font-size: 0.78rem;
}

.knowledge-summary-chevron {
    color: #8e7b50;
    font-size: 1.45rem;
    font-weight: 400;
    transform: rotate(0deg);
    transition: transform 0.16s ease;
}

.knowledge-group[open] .knowledge-summary-chevron {
    transform: rotate(90deg);
}

.knowledge-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    background: #fbfbfb;
}


/* ==========================================================================
   Knowledge Cards
   ========================================================================== */

.knowledge-card {
    padding: 16px;
    border: 1px solid #dedede;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.045);
}

.knowledge-card-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.knowledge-card-title {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    min-width: 0;
}

.knowledge-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 9px;
    background: #fff4d2;
    font-size: 1.2rem;
}

.knowledge-card-type {
    margin-bottom: 2px;
    color: var(--tp-muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.knowledge-card h4 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
}

.knowledge-path {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    color: var(--tp-muted);
    font-size: 0.82rem;
}

.knowledge-path-divider {
    color: #b4aea2;
}

.knowledge-card-body {
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid #ededed;
    font-size: 0.95rem;
    line-height: 1.58;
}

.knowledge-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.knowledge-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border: 1px solid #d5d5d5;
    border-radius: 999px;
    background: #f5f5f5;
    color: #555;
    font-size: 0.7rem;
    font-weight: 800;
}

.visibility-private {
    border-color: #c8a879;
    background: #f7eddf;
    color: #744d19;
}

.visibility-shared {
    border-color: #90abc7;
    background: #eaf2fa;
    color: #245783;
}

.visibility-public {
    border-color: #82b994;
    background: #e9f6ed;
    color: #23663a;
}

.status-draft {
    background: #f2f2f2;
    color: #666;
}

.status-research {
    border-color: #9eb7d5;
    background: #edf4fc;
    color: #315f91;
}

.status-review {
    border-color: #d7ae69;
    background: #fff1db;
    color: #815518;
}

.status-verified {
    border-color: #78b68b;
    background: #e8f6ec;
    color: #24683a;
}

.status-published {
    border-color: #688db8;
    background: #e8f0fa;
    color: #244f80;
}

.status-archived {
    border-color: #bababa;
    background: #ededed;
    color: #666;
}

.private-working-notes {
    margin-top: 13px;
    border: 1px solid #d8c7ae;
    border-radius: 8px;
    background: #fff9ef;
}

.private-working-notes summary {
    padding: 9px 11px;
    color: #6f542b;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.private-working-notes > div {
    padding: 0 11px 11px;
    color: #51442f;
    font-size: 0.9rem;
    line-height: 1.5;
}


/* ==========================================================================
   Knowledge Entry Form
   ========================================================================== */

.knowledge-entry-panel {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.knowledge-entry-heading {
    margin-bottom: 20px;
}

.knowledge-entry-heading h3 {
    margin: 0;
    font-size: 1.5rem;
}

.knowledge-entry-heading p {
    margin: 6px 0 0;
    color: var(--tp-muted);
    line-height: 1.45;
}

.knowledge-entry-panel form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-grid {
    display: grid;
    gap: 14px;
}

.form-grid.two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three-column {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.form-field label {
    font-size: 0.9rem;
    font-weight: 800;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--tp-border);
    border-radius: 8px;
    background: #fff;
    color: inherit;
    font: inherit;
}

.form-field input,
.form-field select {
    min-height: 44px;
    padding: 9px 11px;
}

.form-field textarea {
    min-height: 110px;
    padding: 10px 11px;
    line-height: 1.45;
    resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: 3px solid rgba(30, 144, 255, 0.15);
    border-color: var(--tp-blue);
}

.knowledge-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

.knowledge-form-actions button {
    min-height: 42px;
    padding: 8px 16px;
}

.secondary-button {
    border: 1px solid var(--tp-border);
    background: #fff;
    color: inherit;
}

.secondary-button:hover {
    background: #f3f3f3;
}

.form-message {
    display: none;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
}

.form-message:not(:empty) {
    display: block;
}

.form-message.loading {
    border: 1px solid #9eb7d5;
    background: #edf4fc;
    color: #315f91;
}

.form-message.error {
    border: 1px solid #d9a2a2;
    background: #fdeeee;
    color: #8a2828;
}


/* ==========================================================================
   Success and Error Notices
   ========================================================================== */

.modal-success-notice {
    position: sticky;
    z-index: 30;
    top: 0;
    display: block;
    margin: -12px auto 14px;
    padding: 10px 14px;
    border: 1px solid #75b78a;
    border-radius: 9px;
    background: #e8f7ed;
    color: #1d6735;
    font-size: 0.88rem;
    font-weight: 800;
    text-align: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.modal-success-notice.leaving {
    opacity: 0;
    transform: translateY(-6px);
}

.drawer-error {
    padding: 65px 20px;
    text-align: center;
}

.drawer-error-icon {
    margin-bottom: 10px;
    font-size: 2.8rem;
}

.drawer-error h2 {
    margin: 0 0 8px;
}

.drawer-error p {
    max-width: 570px;
    margin: 0 auto 18px;
    color: var(--tp-muted);
}


/* ==========================================================================
   Shared Helpers
   ========================================================================== */

.muted {
    color: var(--tp-muted);
}


/* ==========================================================================
   Responsive Layout
   ========================================================================== */

@media (max-width: 1050px) {
    .workspace {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .reading-title-row {
        flex-direction: column;
    }

    .reading-progress {
        width: 100%;
    }

    .reading-progress-button {
        width: 100%;
        max-width: 420px;
    }
}

@media (max-width: 900px) {
    .workspace {
        grid-template-columns: 1fr;
    }

    .library-pane {
        position: static;
        height: auto;
    }

    .library-form {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }

    .library-form hr {
        display: none;
    }

    .library-help {
        margin-top: 20px;
    }
}

@media (max-width: 720px) {
    .reading-pane,
    .library-pane {
        padding: 18px;
    }

    .scripture-modal {
        align-items: flex-start;
        padding: 10px;
    }

    .scripture-modal-card {
        width: 100%;
        max-height: calc(100vh - 20px);
        padding: 22px 17px;
        border-radius: 12px;
    }

    .verse-resource-header {
        flex-direction: column;
        padding-right: 32px;
    }

    .verse-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .drawer-tabs {
        overflow-x: auto;
        white-space: nowrap;
    }

    .knowledge-card-header {
        flex-direction: column;
    }

    .knowledge-badges {
        justify-content: flex-start;
    }

    .form-grid.two-column,
    .form-grid.three-column {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .library-form {
        grid-template-columns: 1fr;
    }

    .reading-title-row {
        gap: 15px;
    }

    .chapter-nav {
        flex-direction: column;
    }

    .chapter-nav-button {
        width: 100%;
        box-sizing: border-box;
    }

    .verse-row {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 10px;
        padding: 15px 5px;
    }

    .verse-open-indicator {
        display: none;
    }

    .verse-text {
        font-size: 1rem;
        line-height: 1.56;
    }

    .verse-resource-badges {
        gap: 5px;
    }

    .verse-resource-badge {
        padding: 2px 7px;
    }

    .reading-progress-button {
        min-width: 0;
        max-width: none;
    }

    .selected-verse-text {
        padding: 15px;
        font-size: 1rem;
    }

    .drawer-tab {
        padding: 8px 10px;
        font-size: 0.82rem;
    }

    .knowledge-group > summary {
        grid-template-columns: 28px minmax(0, 1fr) auto 17px;
        padding: 12px;
    }

    .knowledge-card-list {
        padding: 10px;
    }

    .knowledge-card {
        padding: 13px;
    }

    .knowledge-form-actions {
        flex-direction: column-reverse;
    }

    .knowledge-form-actions button {
        width: 100%;
    }
}
/* ==========================================================================
   Phase 2 — Parallel Study Bible
   ========================================================================== */

.parallel-study-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.parallel-study-heading {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.parallel-study-kicker {
    margin-bottom: 4px;
    color: var(--tp-muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.parallel-study-heading h3 {
    margin: 0;
    color: var(--tp-bronze);
    font-size: 1.5rem;
    line-height: 1.2;
}

.parallel-study-heading p {
    max-width: 680px;
    margin: 7px 0 0;
    color: var(--tp-muted);
    line-height: 1.5;
}


/* ==========================================================================
   Parallel Study Controls
   ========================================================================== */

.parallel-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--tp-border);
    border-radius: 12px;
    background: #fcfbf8;
}

.parallel-control-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-width: 260px;
}

.parallel-control-group label,
.parallel-version-field label {
    color: inherit;
    font-size: 0.88rem;
    font-weight: 800;
}

.parallel-control-group select,
.parallel-version-field select {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    padding: 8px 38px 8px 11px;
    border: 1px solid var(--tp-border);
    border-radius: 8px;
    background: #fff;
    color: inherit;
    font: inherit;
    font-size: 0.9rem;
}

.parallel-control-group select:hover,
.parallel-version-field select:hover {
    border-color: rgba(177, 110, 24, 0.7);
}

.parallel-control-group select:focus,
.parallel-version-field select:focus {
    outline: 3px solid rgba(30, 144, 255, 0.15);
    border-color: var(--tp-blue);
}

.parallel-version-selectors {
    display: grid;
    grid-template-columns: repeat(
        2,
        minmax(0, 1fr)
    );
    gap: 13px;
}

.parallel-version-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.parallel-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.parallel-action-row button {
    min-height: 42px;
    padding: 8px 16px;
    border-radius: 8px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.parallel-action-row button:disabled {
    opacity: 0.66;
    cursor: wait;
}


/* ==========================================================================
   Parallel Messages
   ========================================================================== */

.parallel-message {
    display: none;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 0.88rem;
    line-height: 1.4;
}

.parallel-message:not(:empty) {
    display: block;
}

.parallel-message.loading {
    border-color: #9eb7d5;
    background: #edf4fc;
    color: #315f91;
}

.parallel-message.success {
    border-color: #7db88f;
    background: #e8f6ec;
    color: #24683a;
}

.parallel-message.error {
    border-color: #d9a2a2;
    background: #fdeeee;
    color: #8a2828;
}


/* ==========================================================================
   Parallel Results Grid
   ========================================================================== */

.parallel-results {
    display: grid;
    gap: 14px;
    align-items: stretch;
}

.parallel-results:empty {
    display: none;
}

.parallel-results.columns-2 {
    grid-template-columns: repeat(
        2,
        minmax(0, 1fr)
    );
}

.parallel-results.columns-3 {
    grid-template-columns: repeat(
        3,
        minmax(0, 1fr)
    );
}

.parallel-results.columns-4 {
    grid-template-columns: repeat(
        4,
        minmax(0, 1fr)
    );
}


/* ==========================================================================
   Parallel Version Cards
   ========================================================================== */

.parallel-version-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--tp-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.055);
}

.parallel-version-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding: 13px 14px;
    border-bottom: 1px solid #e4dcc9;
    background: #f6ead0;
}

.parallel-version-abbreviation {
    color: var(--tp-bronze);
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.parallel-version-name {
    margin-top: 3px;
    color: var(--tp-muted);
    font-size: 0.74rem;
    line-height: 1.3;
}

.parallel-copy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    padding: 0;
    border: 1px solid #d2c39e;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    color: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition:
        background 0.15s ease,
        transform 0.15s ease,
        border-color 0.15s ease;
}

.parallel-copy-button:hover {
    border-color: var(--tp-bronze);
    background: #fff;
    transform: translateY(-1px);
}

.parallel-copy-button:focus-visible {
    outline: 3px solid rgba(30, 144, 255, 0.18);
    outline-offset: 2px;
}

.parallel-reference {
    padding: 11px 14px 0;
    color: var(--tp-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.parallel-verse-text {
    flex: 1;
    padding: 12px 14px 17px;
    font-size: 0.96rem;
    line-height: 1.62;
}


/* ==========================================================================
   Parallel Loading, Empty, and Error States
   ========================================================================== */

.parallel-loading,
.parallel-empty-state,
.parallel-error-state {
    grid-column: 1 / -1;
    padding: 46px 20px;
    border: 1px dashed #ccc3b0;
    border-radius: 12px;
    background: #fcfaf5;
    text-align: center;
}

.parallel-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 11px;
    color: var(--tp-muted);
}

.parallel-loading-icon {
    font-size: 2.6rem;
    animation:
        parallel-loading-pulse
        1.1s
        ease-in-out
        infinite;
}

@keyframes parallel-loading-pulse {
    0%,
    100% {
        opacity: 0.5;
        transform: scale(0.96);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.parallel-empty-icon,
.parallel-error-icon {
    margin-bottom: 10px;
    font-size: 2.7rem;
}

.parallel-empty-state h3,
.parallel-error-state h4 {
    margin: 0 0 8px;
}

.parallel-empty-state p,
.parallel-error-state p {
    max-width: 600px;
    margin: 0 auto;
    color: var(--tp-muted);
    line-height: 1.5;
}


/* ==========================================================================
   Wider Modal During Parallel Study
   ========================================================================== */

.scripture-modal-card:has(
    #drawerSection-compare.active
) {
    width: min(1180px, 100%);
}

#drawerSection-compare.active {
    animation:
        parallel-section-in
        0.16s
        ease-out;
}

@keyframes parallel-section-in {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ==========================================================================
   Responsive Parallel Study
   ========================================================================== */

@media (max-width: 1100px) {
    .parallel-results.columns-4 {
        grid-template-columns: repeat(
            2,
            minmax(0, 1fr)
        );
    }

    .parallel-results.columns-3 {
        grid-template-columns: repeat(
            2,
            minmax(0, 1fr)
        );
    }
}

@media (max-width: 820px) {
    .parallel-version-selectors {
        grid-template-columns: 1fr;
    }

    .parallel-control-group {
        max-width: none;
    }

    .parallel-results.columns-2,
    .parallel-results.columns-3,
    .parallel-results.columns-4 {
        grid-template-columns: 1fr;
    }

    .parallel-study-heading {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .parallel-controls {
        padding: 14px;
    }

    .parallel-action-row {
        flex-direction: column;
        align-items: stretch;
    }

    .parallel-action-row button {
        width: 100%;
    }

    .parallel-version-card {
        border-radius: 10px;
    }

    .parallel-version-header {
        padding: 12px;
    }

    .parallel-reference {
        padding: 10px 12px 0;
    }

    .parallel-verse-text {
        padding: 10px 12px 15px;
        font-size: 0.94rem;
    }
}
/* ==========================================================================
   Scripture Speaker Highlighting
   ========================================================================== */

.scripture-red-text {
    color: #c00000;
    font-weight: 600;
}

.scripture-father-text {
    color: #0057b8;
    font-weight: 600;
}

.scripture-son-text {
    color: #d96800;
    font-weight: 600;
}

.scripture-spirit-text {
    color: #7030a0;
    font-weight: 600;
}

.scripture-earth-text {
    color: #795548;
    font-weight: 600;
}

/*
 * Keep highlighted text readable when selected or hovered.
 */
.verse-row:hover .scripture-red-text,
.verse-row:focus-visible .scripture-red-text {
    color: #a80000;
}

.verse-row:hover .scripture-father-text,
.verse-row:focus-visible .scripture-father-text {
    color: #004995;
}

.verse-row:hover .scripture-son-text,
.verse-row:focus-visible .scripture-son-text {
    color: #b95300;
}

.verse-row:hover .scripture-spirit-text,
.verse-row:focus-visible .scripture-spirit-text {
    color: #602689;
}

.verse-row:hover .scripture-earth-text,
.verse-row:focus-visible .scripture-earth-text {
    color: #624238;
}

/* ==========================================================================
   Scripture Speaker Highlighting
   ========================================================================== */

.scripture-red-text {
    color: #c00000;
    font-weight: 600;
}

.scripture-father-text {
    color: #0057b8;
    font-weight: 600;
}

.scripture-son-text {
    color: #d96800;
    font-weight: 600;
}

.scripture-spirit-text {
    color: #7030a0;
    font-weight: 600;
}

.scripture-earth-text {
    color: #795548;
    font-weight: 600;
}


/* ========================================================================== 
   Final Scripture Reader Polish
   ========================================================================== */

.library-section label {
    display: flex;
    align-items: center;
    gap: 7px;
}

.chapter-nav-polished {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr);
    align-items: center;
    gap: 14px;
    margin-top: 20px;
    padding: 14px 0 0;
}

.chapter-nav-side {
    display: flex;
}

.chapter-nav-next {
    justify-content: flex-end;
}

.chapter-nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid #bd9a4d;
    border-radius: 10px;
    background: linear-gradient(180deg, #fffaf0, #f5e7c5);
    color: #7b4b0c;
    font-size: 0.86rem;
    font-weight: 850;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 3px 8px rgba(125, 83, 20, 0.12);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.chapter-nav-button:hover {
    background: #efd9a7;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(125, 83, 20, 0.18);
}

.chapter-nav-current {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: #173e60;
    text-align: center;
}

.chapter-nav-current strong {
    font-size: 0.95rem;
}

.chapter-nav-current span {
    color: var(--tp-muted);
    font-size: 0.76rem;
}

.scripture-passages {
    border-top: 0;
}

.verse-row {
    grid-template-columns: 46px minmax(0, 1fr) 24px;
    margin: 0 -8px;
    padding: 19px 14px;
    border-radius: 9px;
}

.verse-row.is-selected {
    position: relative;
    z-index: 1;
    background: #fff4cf;
    box-shadow: inset 5px 0 0 var(--tp-gold), 0 4px 14px rgba(113, 79, 24, 0.08);
}

.verse-number {
    min-width: 34px;
    color: #a46312;
    font-size: 1.12rem;
    font-weight: 900;
}

.verse-text {
    line-height: 1.68;
}

.verse-resource-badges {
    gap: 8px;
    margin-top: 10px;
}

.verse-resource-badge.emoji-resource-badge {
    min-height: 30px;
    padding: 4px 10px;
    border-color: #d7c8a7;
    background: #fffaf0;
    color: #173e60;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.verse-resource-badge.emoji-resource-badge > span:first-child {
    font-size: 1rem;
}

.verse-resource-badge.emoji-resource-badge strong {
    font-size: 0.8rem;
}

/* Emoji identifies type; avoid maintaining a separate color legend. */
.verse-resource-badge[class*="resource-"] {
    border-color: #d7c8a7;
    background: #fffaf0;
}

.reader-help {
    margin: 0 0 8px;
    padding: 10px 13px;
    border-radius: 9px;
    background: #fff9e9;
    color: #675438;
    font-size: .86rem;
}

@media (max-width: 700px) {
    .chapter-nav-polished {
        grid-template-columns: 1fr 1fr;
    }

    .chapter-nav-current {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .chapter-nav-previous {
        grid-column: 1;
    }

    .chapter-nav-next {
        grid-column: 2;
    }

    .chapter-nav-button {
        width: 100%;
    }
}


/* ==========================================================================
   Final Scripture navigation and resource hub refinements
   ========================================================================== */

.chapter-nav-polished {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.chapter-nav-next {
    justify-self: end;
}

.resource-hub-bar {
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tp-border);
}

.resource-hub-button {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto 20px;
    gap: 11px;
    align-items: center;
    width: 100%;
    min-height: 58px;
    padding: 10px 14px;
    border: 1px solid #d5c28f;
    border-radius: 12px;
    background:
        linear-gradient(
            135deg,
            #fff9e8,
            #f7ecd0
        );
    color: var(--tp-bronze);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease,
        background 0.15s ease;
}

.resource-hub-button:hover {
    border-color: #b99545;
    background:
        linear-gradient(
            135deg,
            #fff6d9,
            #f2e1b8
        );
    box-shadow: 0 6px 16px rgba(117, 82, 23, 0.12);
    transform: translateY(-1px);
}

.resource-hub-button.active {
    cursor: default;
}

.resource-hub-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.72);
    font-size: 1.12rem;
}

.resource-hub-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.resource-hub-copy strong {
    font-size: 0.98rem;
}

.resource-hub-copy small {
    overflow: hidden;
    color: #756a58;
    font-size: 0.76rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-hub-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 31px;
    height: 31px;
    padding: 0 9px;
    border-radius: 999px;
    background: #fff;
    color: #755317;
    font-size: 0.8rem;
    font-weight: 900;
}

.resource-hub-return {
    opacity: 0;
    color: #80682e;
    font-size: 1.1rem;
    font-weight: 900;
    transform: translateX(5px);
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}

.resource-hub-button.return-mode .resource-hub-return {
    opacity: 1;
    transform: translateX(0);
}

.resource-hub-button.return-mode .resource-hub-copy small {
    color: #6d5931;
}

@media (max-width: 700px) {
    .chapter-nav-polished {
        grid-template-columns: 1fr 1fr;
    }

    .resource-hub-button {
        grid-template-columns: 32px minmax(0, 1fr) auto 16px;
        gap: 8px;
        padding: 9px 11px;
    }

    .resource-hub-icon {
        width: 32px;
        height: 32px;
    }

    .resource-hub-copy small {
        display: none;
    }
}


/* ==========================================================================
   Unified responsive Scripture reader
   ========================================================================== */

.verse-row.last-reading-position {
    box-shadow:
        0 0 0 3px rgba(227, 174, 46, .48),
        0 4px 14px rgba(22, 47, 73, .08);
}

@media (max-width: 760px) {
    .workspace {
        display: block;
    }

    .library-pane {
        position: static;
        width: auto;
        min-height: 0;
        margin: 0 0 10px;
        padding: 10px;
        border: 1px solid #d9e3ec;
        border-radius: 14px;
        background: #fff;
    }

    .library-pane-heading,
    .library-help,
    .library-form hr {
        display: none;
    }

    .library-form {
        display: grid;
        grid-template-columns:
            minmax(0, 1.4fr)
            minmax(76px, .7fr)
            minmax(84px, .8fr);
        gap: 7px;
    }

    .library-section {
        min-width: 0;
        margin: 0;
        padding: 0;
    }

    .library-section label {
        margin-bottom: 4px;
        font-size: .7rem;
    }

    .library-section label span {
        display: none;
    }

    .library-section select {
        width: 100%;
        min-width: 0;
        padding: 10px 7px;
        border-radius: 9px;
        font-size: .83rem;
    }

    .reading-pane {
        width: 100%;
        min-width: 0;
    }

    .reading-header {
        padding: 4px 2px 10px;
    }

    .reading-title-row {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        text-align: center;
    }

    .reading-kicker,
    .reading-version {
        display: none;
    }

    .reading-title-row h1 {
        margin: 0;
        font-size: 1.35rem;
    }

    .reading-progress {
        width: auto;
    }

    .reading-progress-button {
        min-height: 0;
        padding: 8px 12px;
        border-radius: 999px;
    }

    .progress-status-copy small {
        display: none;
    }

    .chapter-nav-polished {
        margin-top: 8px;
    }

    .chapter-nav-button {
        min-width: 42px;
        padding: 8px 11px;
        font-size: 0;
        border-radius: 50%;
    }

    .chapter-nav-button span {
        font-size: 1.25rem;
    }

    .scripture-passages {
        gap: 8px;
    }

    .verse-row {
        grid-template-columns: 30px minmax(0, 1fr) 22px;
        gap: 9px;
        padding: 13px 10px;
        border-radius: 13px;
        align-items: start;
    }

    .verse-number {
        width: 27px;
        height: 27px;
        font-size: .78rem;
    }

    .verse-body,
    .verse-text {
        min-width: 0;
        width: 100%;
    }

    .verse-text {
        white-space: normal;
        word-break: normal;
        overflow-wrap: break-word;
        font-size: 1.02rem;
        line-height: 1.55;
    }

    .verse-open-indicator {
        align-self: center;
    }

    .verse-resource-badges {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
        margin-top: 8px;
    }

    .scripture-modal {
        align-items: flex-end;
        padding: 0;
    }

    .scripture-modal-card {
        width: 100%;
        max-width: none;
        max-height: 94dvh;
        margin: 0;
        border-radius: 22px 22px 0 0;
        padding:
            16px
            14px
            calc(20px + env(safe-area-inset-bottom));
    }

    .scripture-modal-close {
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 390px) {
    .library-form {
        grid-template-columns: minmax(0, 1fr) 72px 78px;
    }

    .library-section select {
        padding-inline: 5px;
        font-size: .78rem;
    }

    .verse-row {
        grid-template-columns: 28px minmax(0, 1fr) 18px;
        gap: 7px;
    }

    .verse-text {
        font-size: 1rem;
    }
}


/* Larger mobile Scripture text */
@media (max-width: 760px) {
  .workspace{font-size:18px}
  .library-pane,.reading-pane{padding:14px}
  .library-section label{font-size:.82rem}
  .library-section select{min-height:50px;font-size:.98rem}
  .reading-title-row h1{font-size:1.75rem;line-height:1.2}
  .chapter-nav-button{min-width:48px;min-height:48px}
  .chapter-nav-button span{font-size:1.45rem}
  .verse-row{grid-template-columns:38px minmax(0,1fr) 24px;gap:10px;padding:16px 11px}
  .verse-number{width:32px;height:32px;font-size:.95rem}
  .verse-text{font-size:1.18rem;line-height:1.68}
  .verse-resource-badge,.verse-resource-badge strong{font-size:.88rem}
  .scripture-modal-card{font-size:18px}
  .verse-resource-heading h2{font-size:1.9rem}
  .verse-version-label{font-size:1rem}
  .selected-verse-text{font-size:1.14rem;line-height:1.68}
  .drawer-tab{min-height:46px;font-size:.95rem}
  .knowledge-card-body,.private-working-notes>div,.parallel-verse-text{font-size:1.02rem;line-height:1.62}
  .form-field label{font-size:.98rem}
  .form-field input,.form-field select{min-height:50px;font-size:1rem}
  .form-field textarea{min-height:130px;font-size:1rem;line-height:1.5}
}
@media (max-width:390px){
  .workspace{font-size:19px}
  .verse-text{font-size:1.2rem;line-height:1.7}
}


/* ==========================================================================
   v36.1 — Bottom Chapter Navigation
   ========================================================================== */

.chapter-nav-bottom {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 2px solid var(--tp-border);
}

.mobile-bottom-chapter-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin: 18px 0 calc(92px + env(safe-area-inset-bottom));
    padding: 14px 10px;
    border: 1px solid #d9c28a;
    border-radius: 14px;
    background: #fffaf0;
    box-shadow: 0 5px 16px rgba(101, 69, 18, 0.10);
}

.mobile-bottom-nav-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    padding: 8px 11px;
    border: 1px solid #bd9a4d;
    border-radius: 10px;
    background: linear-gradient(180deg, #fffaf0, #f5e7c5);
    color: #7b4b0c;
    font-size: 0.84rem;
    font-weight: 850;
    line-height: 1.15;
    text-decoration: none;
}

.mobile-bottom-nav-button.next {
    justify-content: flex-end;
    text-align: right;
}

.mobile-bottom-nav-button.disabled {
    visibility: hidden;
    pointer-events: none;
}

.mobile-bottom-nav-current {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #173e60;
    text-align: center;
}

.mobile-bottom-nav-current strong {
    font-size: 0.85rem;
}

.mobile-bottom-nav-current span {
    color: var(--tp-muted);
    font-size: 0.72rem;
}

@media (max-width: 480px) {
    .mobile-bottom-chapter-nav {
        grid-template-columns: 1fr 1fr;
    }

    .mobile-bottom-nav-current {
        display: none;
    }

    .mobile-bottom-nav-button {
        width: 100%;
        box-sizing: border-box;
    }
}
