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

:focus-visible {
    outline: 2px solid #b8860b;
    outline-offset: 2px;
}

body {
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.7;
    color: #1a1a1a;
    background: #f9f9f6;
}

.container {
    min-height: 100vh;
    position: relative;
}

:root {
    --access-font-size: 16px;
    --access-line-height: 1.7;
}

.text-column {
    max-width: 740px;
    margin: 0 auto;
    padding: 2rem 3rem 3rem 3rem;
    font-size: var(--access-font-size);
    line-height: var(--access-line-height);
}

.text-column h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.text-column h3 {
    font-size: 1rem;
    font-weight: normal;
    color: #555;
    margin-bottom: 1rem;
}

.text-column h4 {
    font-size: 1.05rem;
    margin: 1.5rem 0 0.75rem;
}

.audio-duration {
    font-style: italic;
    font-size: 0.85rem;
    color: #888;
    margin: -0.75rem 0 0.5rem;
    display: none;
}

.text-column p {
    margin-bottom: 1rem;
    text-align: justify;
}

.text-column .quote {
    margin-left: 1.5rem;
    border-left: 3px solid #ccc;
    padding-left: 1rem;
    color: #444;
    font-style: italic;
}

.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    height: 100vh;
    background: #fff;
    border-left: 1px solid #ddd;
    padding: 2rem 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    transform: translateX(0);
    transition: transform 0.3s ease;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.12);
}

.sidebar.collapsed {
    transform: translateX(100%);
}

.sidebar-toggle {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    line-height: 1;
    z-index: 5;
    color: #555;
}

.sidebar-toggle:hover {
    background: #f0f0f0;
}

.sidebar-content {
    padding-top: 1.5rem;
    font-size: var(--access-font-size);
    line-height: var(--access-line-height);
}

.sidebar-content h2 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.sidebar-hint {
    color: #999;
    font-style: italic;
    font-size: 0.9rem;
}

.sidebar-reopen {
    display: none;
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 4px 0 0 4px;
    cursor: pointer;
    padding: 0.75rem 0.4rem;
    font-size: 0.8rem;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    z-index: 100;
    color: #555;
    box-shadow: -1px 0 4px rgba(0, 0, 0, 0.08);
    letter-spacing: 0.1em;
}

.sidebar-reopen:hover {
    background: #f4f4f4;
    color: #222;
}

.sidebar-reopen.visible {
    display: block;
}

.popoutHighlight {
    text-decoration: underline dotted #000000;
    text-underline-offset: 2px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.popoutHighlight:hover {
    background-color: #fff3b0;
    text-decoration: none;
}

.popoutHighlight.active {
    background-color: #ffe066;
    text-decoration: none;
}

@keyframes jumpPulse {
    0% {
        background-color: transparent;
    }
    20% {
        background-color: #ffd700;
    }
    70% {
        background-color: #ffd700;
    }
    100% {
        background-color: transparent;
    }
}

.popoutHighlight.jump-highlight {
    animation: jumpPulse 1.5s ease-in-out;
}

.glossary-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
    color: #333;
}

.glossary-subtitle {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1rem;
    font-style: italic;
}

.glossary-item {
    padding: 0.6rem 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.glossary-item:last-child {
    border-bottom: none;
}

.glossary-term {
    cursor: pointer;
    color: #1a1a1a;
    font-weight: 500;
    flex: 1;
    transition: color 0.15s;
}

.glossary-entry .definition {
    font-size: var(--access-font-size);
    line-height: var(--access-line-height);
}

.glossary-term:hover {
    color: #b8860b;
}

.glossary-jump {
    cursor: pointer;
    font-size: 0.78rem;
    color: #999;
    white-space: nowrap;
    padding: 0.2rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    transition: all 0.15s;
    text-decoration: none;
    font-family: inherit;
}

.glossary-jump:hover {
    background: #f0f0f0;
    color: #333;
    border-color: #bbb;
}

.popout {
    display: none;
}

/* --- Site header --- */
.site-header {
    text-align: center;
    padding: 3rem 0 0.5rem;
    border-bottom: 2px solid #ddd;
    margin-bottom: 2.5rem;
}

.site-header h1 {
    font-size: 2.2rem;
    font-weight: normal;
    letter-spacing: 0.05em;
    color: #1a1a1a;
    margin-bottom: 0.4rem;
}

.site-header h1 a {
    color: inherit;
    text-decoration: none;
}

.site-header h1 a:hover {
    color: #b8860b;
}

.library-back-link {
    display: inline-block;
    font-size: 0.85rem;
    color: #888;
    text-decoration: none;
    margin-bottom: 2rem;
    transition: color 0.15s;
}

.library-back-link:hover {
    color: #b8860b;
}

/* --- Cover page --- */
.cover-page {
    padding-top: 1rem;
    padding-bottom: 4rem;
}

.cover-layout {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}

.cover-image-wrapper {
    flex-shrink: 0;
    width: 280px;
}

.cover-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 3px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.cover-info {
    flex: 1;
    min-width: 0;
}

.cover-author {
    font-size: 1rem;
    color: #888;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.cover-title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.3rem;
    line-height: 1.2;
}

.cover-subtitle {
    font-size: 1rem;
    color: #666;
    font-style: italic;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.cover-year {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 1.5rem;
}

.cover-description p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #333;
    text-align: justify;
    margin-bottom: 1.5rem;
}

.cover-chapters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.cover-chapters .chapter-link,
.cover-chapters .placeholder {
    flex: 0 0 calc(33.333% - 0.35rem);
    text-align: center;
    padding: 0.5rem 0.4rem;
    box-sizing: border-box;
}

.cover-back-link {
    color: inherit;
    text-decoration: none;
}

.cover-back-link:hover {
    color: #b8860b;
}

.back-to-cover {
    display: inline-block;
    font-size: 0.85rem;
    color: #888;
    text-decoration: none;
    margin-bottom: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 0.2rem 0.7rem;
    transition: all 0.15s;
}

.back-to-cover:hover {
    background: #f0ede6;
    border-color: #b8860b;
    color: #1a1a1a;
}

.chapter-link {
    font-size: 0.85rem;
    padding: 0.2rem 0.7rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    color: #555;
    text-decoration: none;
    transition: all 0.15s;
}

.chapter-link:hover {
    background: #f0ede6;
    border-color: #b8860b;
    color: #1a1a1a;
}

.placeholder {
    font-size: 0.85rem;
    color: #bbb;
    font-style: italic;
}

/* --- Audio Player --- */
.audio-player {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: end;
}
.audio-player.visible {
    opacity: 1;
    pointer-events: auto;
}
.audio-player-controls {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 28px 28px 0 0;
    padding: 0 16px;
    margin: 0 20px 0 0;
    opacity: 0;
    transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.35s ease;
}
.audio-player.expanded .audio-player-controls {
    max-height: 60px;
    padding: 8px 16px;
    opacity: 1;
}
.audio-expand-btn {
    display: none;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 18px;
    padding: 2px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}
.audio-player.playing .audio-expand-btn {
    display: flex;
}
.audio-expand-btn:hover {
    color: #333;
}
.speed-btn {
    background: none;
    border: 2px solid #ccc;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 16px;
    line-height: 1;
    transition:
        border-color 0.15s,
        color 0.15s;
}
.speed-btn:hover {
    border-color: #b8860b;
    color: #b8860b;
}
.speed-display {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    min-width: 42px;
    text-align: center;
    font-family: monospace;
}
.audio-player-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 28px;
    padding: 0 3px 0 0;
    overflow: hidden;
    flex-shrink: 0;
    width: 54px;
    height: 54px;
    transition:
        min-width 0.4s ease,
        gap 0.4s ease,
        padding 0.4s ease,
        width 0.4s ease;
}
.audio-player.playing .audio-player-inner {
    min-width: 200px;
    gap: 6px;
    padding: 4px;
    width: auto;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 28px;
}
.audio-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(184, 134, 11, 0.25);
    border-radius: 28px;
    width: 0%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.audio-player.playing .audio-progress {
    opacity: 1;
}
.play-btn {
    position: relative;
    z-index: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #b8860b;
    color: #fff;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto;
    transition: background 0.15s;
}
.play-btn:hover {
    background: #a07509;
}
.play-btn .material-icons-outlined {
    font-size: 24px;
}

/* --- Current Line Highlight --- */
.current-line {
    background: rgba(184, 134, 11, 0.15);
    border-radius: 2px;
    transition: background 0.3s;
}
.sentence-segment {
    transition: background 0.3s;
}

@media (max-width: 700px) {
    .cover-layout {
        flex-direction: column;
        align-items: center;
    }

    .cover-image-wrapper {
        width: 200px;
    }

    .cover-info {
        text-align: center;
    }

    .cover-chapters {
        justify-content: center;
    }

    .audio-player {
        bottom: 16px;
        right: 16px;
    }
    .audio-player-inner {
        padding: 0 3px 0 0;
        width: 44px;
        height: 44px;
    }
    .audio-player.playing .audio-player-inner {
        gap: 4px;
        min-width: 140px;
        padding: 2px;
        width: auto;
        height: auto;
        border: 1px solid #ddd;
        border-radius: 28px;
    }
    .audio-player-controls {
        padding: 0 12px;
    }
    .audio-player.expanded .audio-player-controls {
        padding: 6px 12px;
    }
    .play-btn {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }
    .play-btn .material-icons-outlined {
        font-size: 20px;
    }
    .audio-expand-btn {
        font-size: 16px;
    }
    .speed-btn {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
    .speed-display {
        font-size: 12px;
        min-width: 34px;
    }
}

/* --- Bottom Bar (shared container) --- */
.mm-bottom-bar {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 999;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
}

.mm-bottom-bar .audio-player {
    position: static;
    bottom: auto;
    right: auto;
    z-index: auto;
    transition: opacity 0.4s ease;
}

.mm-bottom-bar .audio-player-inner {
    width: 54px;
    height: 54px;
    padding: 0 3px 0 0;
}

.mm-bottom-bar .audio-player.playing .audio-player-inner {
    min-width: 200px;
    width: auto;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 28px;
}

/* --- Accessibility Widget (inside bar) --- */
.accessibility-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    position: relative;
}

.accessibility-btn-container {
    width: 54px;
    height: 54px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.accessibility-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #b8860b;
    color: #fff;
    border: none;
    font-size: 37px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: background 0.15s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.accessibility-btn:hover {
    background: #a07509;
}

.accessibility-panel {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.accessibility-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.access-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.access-control-row:last-child {
    margin-bottom: 0;
}

.access-control-label {
    font-size: 0.85rem;
    color: #555;
    font-family: Georgia, "Times New Roman", serif;
    min-width: 70px;
}

.access-control-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #ccc;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        border-color 0.15s,
        color 0.15s,
        background 0.15s;
    line-height: 1;
    padding: 0;
}

.access-control-btn:hover {
    border-color: #b8860b;
    color: #b8860b;
    background: #fffbf0;
}

.access-control-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    min-width: 40px;
    text-align: center;
    font-family: monospace;
}

.access-control-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Dark Mode --- */
.dark-mode {
    background: #1c1b1a;
}

.dark-mode body {
    background: #1c1b1a;
    color: #d4c9a8;
}

.dark-mode a {
    color: #c9a84c;
}

.dark-mode a:hover {
    color: #d9bc5c;
}

.dark-mode .container {
    background: #1c1b1a;
}

.dark-mode .text-column h1 {
    color: #e8dcc8;
}

.dark-mode .text-column h3 {
    color: #a09880;
}

.dark-mode .text-column h4 {
    color: #e8dcc8;
}

.dark-mode .audio-duration {
    color: #a09880;
}

.dark-mode .text-column p {
    color: #d4c9a8;
}

.dark-mode .text-column .quote {
    border-left-color: #3a3834;
    color: #a09880;
}

.dark-mode .sidebar {
    background: #232220;
    border-left-color: #3a3834;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.4);
}

.dark-mode .sidebar-toggle {
    background: #232220;
    border-color: #3a3834;
    color: #a09880;
}

.dark-mode .sidebar-toggle:hover {
    background: #2e2c28;
}

.dark-mode .sidebar-content h2 {
    color: #e8dcc8;
    border-bottom-color: #2e2c28;
}

.dark-mode .sidebar-hint {
    color: #7a7258;
}

.dark-mode .sidebar-reopen {
    background: #232220;
    border-color: #3a3834;
    border-right-color: #232220;
    color: #a09880;
    box-shadow: -1px 0 4px rgba(0, 0, 0, 0.3);
}

.dark-mode .sidebar-reopen:hover {
    background: #2e2c28;
    color: #d4c9a8;
}

.dark-mode .popoutHighlight {
    text-decoration-color: #a09880;
}

.dark-mode .popoutHighlight:hover {
    background-color: #3a3834;
}

.dark-mode .popoutHighlight.active {
    background-color: #4a3828;
}

.dark-mode .popoutHighlight.jump-highlight {
    animation-name: jumpPulseDark;
}

@keyframes jumpPulseDark {
    0% { background-color: transparent; }
    20% { background-color: #4a3828; }
    70% { background-color: #4a3828; }
    100% { background-color: transparent; }
}

.dark-mode .glossary-title {
    color: #e8dcc8;
}

.dark-mode .glossary-subtitle {
    color: #7a7258;
}

.dark-mode .glossary-item {
    border-bottom-color: #2e2c28;
}

.dark-mode .glossary-term {
    color: #d4c9a8;
}

.dark-mode .glossary-term:hover {
    color: #c9a84c;
}

.dark-mode .glossary-jump {
    color: #7a7258;
    border-color: #3a3834;
    background: #232220;
}

.dark-mode .glossary-jump:hover {
    background: #2e2c28;
    color: #d4c9a8;
    border-color: #555;
}

.dark-mode .site-header {
    border-bottom-color: #2e2c28;
}

.dark-mode .site-header h1 {
    color: #e8dcc8;
}

.dark-mode .library-back-link {
    color: #7a7258;
}

.dark-mode .library-back-link:hover {
    color: #c9a84c;
}

.dark-mode .cover-author {
    color: #7a7258;
}

.dark-mode .cover-title {
    color: #e8dcc8;
}

.dark-mode .cover-subtitle {
    color: #a09880;
}

.dark-mode .cover-year {
    color: #7a7258;
}

.dark-mode .cover-description p {
    color: #d4c9a8;
}

.dark-mode .chapter-link {
    border-color: #3a3834;
    color: #a09880;
}

.dark-mode .chapter-link:hover {
    background: #2e2c28;
    border-color: #c9a84c;
    color: #d4c9a8;
}

.dark-mode .back-to-cover {
    color: #7a7258;
    border-color: #3a3834;
}

.dark-mode .back-to-cover:hover {
    background: #2e2c28;
    border-color: #c9a84c;
    color: #d4c9a8;
}

.dark-mode .placeholder {
    color: #555;
}

.dark-mode .audio-player-controls {
    background: #232220;
    border-color: #3a3834;
}

.dark-mode .audio-player-inner {
    background: #232220;
    border-color: #3a3834;
}

.dark-mode .audio-player.playing .audio-player-inner {
    border-color: #3a3834;
}

.dark-mode .audio-expand-btn {
    color: #7a7258;
}

.dark-mode .audio-expand-btn:hover {
    color: #d4c9a8;
}

.dark-mode .speed-btn {
    border-color: #3a3834;
    color: #a09880;
}

.dark-mode .speed-btn:hover {
    border-color: #c9a84c;
    color: #c9a84c;
}

.dark-mode .speed-display {
    color: #a09880;
}

.dark-mode .mm-bottom-bar .audio-player-inner {
    border-color: #3a3834;
}

.dark-mode .mm-bottom-bar .audio-player.playing .audio-player-inner {
    border-color: #3a3834;
}

.dark-mode .accessibility-btn-container {
    background: #232220;
    border-color: #3a3834;
}

.dark-mode .accessibility-panel {
    background: #232220;
    border-color: #3a3834;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.3);
}

.dark-mode .access-control-label {
    color: #a09880;
}

.dark-mode .access-control-btn {
    background: #232220;
    border-color: #3a3834;
    color: #a09880;
}

.dark-mode .access-control-btn:hover {
    border-color: #c9a84c;
    color: #c9a84c;
    background: #2e2c28;
}

.dark-mode .access-control-value {
    color: #d4c9a8;
}

.dark-mode .access-toggle-track {
    background: #3a3834;
}

.dark-mode .access-toggle-input:checked + .access-toggle-track {
    background: #c9a84c;
}

.dark-mode :focus-visible {
    outline-color: #c9a84c;
}

.dark-mode .current-line {
    background: rgba(201, 168, 76, 0.15);
}

.dark-mode .glossary-page .subtitle {
    color: #7a7258 !important;
}

.dark-mode .glossary-entry {
    background: #232220 !important;
    border-color: #3a3834 !important;
}

.dark-mode .glossary-entry:hover {
    border-color: #c9a84c !important;
}

.dark-mode .glossary-entry .term {
    color: #e8dcc8 !important;
}

.dark-mode .glossary-entry .definition {
    color: #d4c9a8 !important;
}

.dark-mode .glossary-entry .chapter-ref {
    color: #7a7258 !important;
}

.dark-mode .glossary-nav {
    background: #1c1b1a !important;
    border-bottom-color: #2e2c28 !important;
}

.dark-mode .glossary-nav a {
    background: #232220 !important;
    border-color: #3a3834 !important;
    color: #7a7258 !important;
}

.dark-mode .glossary-nav a:hover {
    background: #2e2c28 !important;
    border-color: #c9a84c !important;
    color: #d4c9a8 !important;
}

.dark-mode .empty-state {
    color: #7a7258 !important;
}

.dark-mode [id^="letter-"] {
    color: #e8dcc8 !important;
}

/* --- Homepage dark mode --- */
.dark-mode .library {
    background: #1c1b1a;
    color: #d4c9a8;
}

.dark-mode .site-header .tagline {
    color: #7a7258;
}

.dark-mode .author-name {
    color: #e8dcc8 !important;
    border-bottom-color: #2e2c28 !important;
}

.dark-mode .work-card {
    background: #232220 !important;
    border-color: #3a3834 !important;
}

.dark-mode .work-card:hover {
    border-color: #c9a84c !important;
}

.dark-mode .work-title a {
    color: #d4c9a8 !important;
}

.dark-mode .work-title a:hover {
    color: #c9a84c !important;
}

.dark-mode .work-meta {
    color: #7a7258 !important;
}

.dark-mode .coming-soon-badge {
    color: #7a7258 !important;
    border-color: #7a7258 !important;
}

.dark-mode .site-nav a {
    color: #7a7258 !important;
}

.dark-mode .site-nav a:hover {
    color: #c9a84c !important;
}

.dark-mode .site-footer {
    color: #555 !important;
    border-top-color: #2e2c28 !important;
}

.dark-mode .site-footer a {
    color: #7a7258 !important;
}

.dark-mode .site-footer a:hover {
    color: #c9a84c !important;
}

/* --- Site Notes page dark mode --- */
.dark-mode .notes-page .tagline {
    color: #7a7258 !important;
}

.dark-mode .note-card {
    background: #232220 !important;
    border-color: #3a3834 !important;
}

.dark-mode .note-card h2 {
    color: #e8dcc8 !important;
}

.dark-mode .note-card p {
    color: #d4c9a8 !important;
}

.dark-mode .back-link {
    color: #7a7258 !important;
}

.dark-mode .back-link:hover {
    color: #c9a84c !important;
}



/* --- Blinders overlay bars --- */
.blinder-bar-top,
.blinder-bar-bottom {
    position: fixed;
    z-index: 900;
    background: #000;
    pointer-events: none;
}

/* --- Toggle switch (Blinders) --- */
.access-toggle {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    line-height: 1;
}

.access-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.access-toggle-track {
    width: 36px;
    height: 20px;
    background: #ccc;
    border-radius: 10px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.access-toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.access-toggle-input:checked + .access-toggle-track {
    background: #b8860b;
}

.access-toggle-input:checked + .access-toggle-track::after {
    transform: translateX(16px);
}

.access-toggle-input:focus-visible + .access-toggle-track {
    outline: 2px solid #b8860b;
    outline-offset: 2px;
    border-radius: 10px;
}

.dark-mode .access-toggle-input:focus-visible + .access-toggle-track {
    outline-color: #c9a84c;
}

@media (max-width: 700px) {
    .mm-bottom-bar {
        bottom: 16px;
        right: 16px;
        gap: 6px;
    }

    .mm-bottom-bar .audio-player-inner {
        width: 44px;
        height: 44px;
        padding: 0 3px 0 0;
    }

    .mm-bottom-bar .audio-player.playing .audio-player-inner {
        min-width: 140px;
        width: auto;
        height: auto;
        border: 1px solid #ddd;
        border-radius: 28px;
    }

    .accessibility-btn-container {
        width: 44px;
        height: 44px;
    }

    .accessibility-btn {
        width: 38px;
        height: 38px;
        font-size: 17px;
    }

    .accessibility-panel {
        width: 190px;
        padding: 12px 14px;
    }

    .access-control-label {
        font-size: 0.8rem;
        min-width: 60px;
    }

    .access-control-btn {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }

    .access-control-value {
        font-size: 0.8rem;
        min-width: 34px;
    }
}
