/* Tonico Chart Viewer Styles */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&display=swap');

/* Base theme with fallbacks (keep simple for old Safari) */
html {
    background: #ffffff;
    color: #111111;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    line-height: 1.45;

    /* Spacing defaults (tuned for lyrics-visible vs lyrics-hide). */
    --gap-lyr-ww: 11px;      /* word-to-word boundary (no divider in text); driven by lyrics size */
    --gap-hide-chords: 16px; /* chord separation when lyrics are hidden */
    --gap-lyr-to-bare: 12px; /* lyric block (ends with word) -> next block has no lyrics */
}

.chords-xs { --gap-hide-chords: 12px; --gap-lyr-to-bare: 6px; }
.chords-s  { --gap-hide-chords: 14px; --gap-lyr-to-bare: 8px; }
.chords-m  { --gap-hide-chords: 16px; --gap-lyr-to-bare: 12px; }
.chords-l  { --gap-hide-chords: 20px; --gap-lyr-to-bare: 18px; }
.chords-xl { --gap-hide-chords: 24px; --gap-lyr-to-bare: 24px; }

/* Gap between adjacent lyric word blocks when there is no visible divider.
   This must track lyrics size (not chord size), otherwise large lyrics with small chords look “glued”. */
.lyrics-xs { --gap-lyr-ww: 8px; }
.lyrics-s  { --gap-lyr-ww: 9px; }
.lyrics-m  { --gap-lyr-ww: 11px; }
.lyrics-l  { --gap-lyr-ww: 13px; }
.lyrics-xl { --gap-lyr-ww: 15px; }

a {
    color: inherit;
}

/* Site nav */
.site-nav {
    position: fixed;
    left: 24px;
    top: 24px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.nav-home {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--v-text, #111);
    text-decoration: none;
}
.nav-home:hover { color: var(--v-accent, #2a7ae2); }
.nav-logo {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    flex-shrink: 0;
}
.nav-dash {
    font-size: 12px;
    color: var(--v-text-3, #777);
    text-decoration: none;
    padding-left: 31px;
}
.nav-dash:hover { color: var(--v-accent, #2a7ae2); }
.nav-lang {
    font-size: 12px;
    color: var(--v-text-3, #777);
    background: none;
    border: 1px solid var(--v-border, #ddd);
    border-radius: 6px;
    padding: 2px 7px;
    cursor: pointer;
    margin-left: 31px;
}
.nav-lang:hover { color: var(--v-accent, #2a7ae2); border-color: var(--v-accent, #2a7ae2); }
.site-nav.hidden { display: none; }

@media (max-width: 1400px) {
    .site-nav {
        position: static;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 8px 12px;
        border-bottom: 1px solid var(--v-border, #ddd);
    }
    .nav-dash { padding-left: 0; }
    .nav-lang { margin-left: auto; }
}

/* Header */
.top {
    padding: 14px 12px;
    border-bottom: 1px solid #e6e6e6;
}

/* Two-column header grid */
.header-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: flex-start;
    align-items: flex-start;
    gap: 16px;
}

.header-left {
    -webkit-flex: 1;
    flex: 1;
    min-width: 0;
}

.header-right {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    max-width: 280px;
    min-width: 160px;
    padding-top: 2px;
}

/* Title row: h1 + refresh + Copy to My Charts */
.title-row {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 8px;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
}

.h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
}

.refresh-btn {
    font-size: 20px;
    padding: 4px 8px;
    border: 1px solid #cfcfcf;
    border-radius: 5px;
    background: #fff;
    color: #111;
    cursor: pointer;
    line-height: 1;
    transition: background 0.2s;
}

.refresh-btn:hover {
    background: #f5f5f5;
}

.refresh-btn:active {
    background: #e0e0e0;
}

.meta {
    margin-top: 6px;
    color: #444;
    font-size: 14px;
}

.info-label {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.transcribed-by {
    margin-top: 4px;
    font-size: 14px;
}

.transcribed-name {
    color: #444;
    font-weight: 500;
}

/* Right column: transcriber notes + reference links */
.arr {
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
}

.ref-links {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 6px;
}

.ref-link {
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #333;
    text-decoration: none;
    border: 1px solid #d8d8d8;
    border-radius: 999px;
    padding: 3px 10px;
    background: #fff;
}

.ref-link:hover {
    border-color: #999;
}

.ref-link-name {
    line-height: 1;
}

.controls {
    max-width: 1100px;
    margin: 12px auto 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.label {
    font-size: 14px;
    color: #222;
}

.select {
    font-size: 16px;
    padding: 8px 10px;
    border: 1px solid #cfcfcf;
    border-radius: 5px;
    background: #fff;
    color: #111;
}

.select.small {
    padding: 6px 8px;
    font-size: 14px;
}

.btn {
    font-size: 14px;
    padding: 8px 10px;
    border: 1px solid #cfcfcf;
    border-radius: 5px;
    background: #fff;
    color: #111;
    cursor: pointer;
}

.btn.primary {
    border-color: #111;
    background: #111;
    color: #fff;
}

.btn:active {
    transform: translateY(1px);
}

/* Settings panel (CSS-first toggle) */
.cfg-toggle {
    position: absolute;
    left: -9999px;
}

.cfg-panel {
    display: none;
    width: 100%;
    border: 1px solid #e6e6e6;
    border-radius: 5px;
    padding: 10px;
    background: #fafafa;
}

#cfgToggle:checked~.btn[for="cfgToggle"] {
    border-color: #111;
}

#cfgToggle:checked~.cfg-panel {
    display: block;
}

.cfg-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.cfg-row:first-child {
    margin-top: 0;
}

.cfg-label {
    min-width: 70px;
    font-size: 13px;
    color: #333;
}

.radios {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.radio {
    font-size: 13px;
    border: 1px solid #d8d8d8;
    border-radius: 5px;
    padding: 6px 10px;
    background: #fff;
}

.radio input {
    margin-right: 6px;
}

/* Lineage block (inside header-left) */
.lineage-block {
    margin-top: 6px;
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}

.lineage-line {
    margin-bottom: 4px;
}

.lineage-link {
    color: #2a7ae2;
    text-decoration: none;
}

.lineage-link:hover {
    text-decoration: underline;
}

.lineage-owner {
    color: #777;
}

.lineage-toggle {
    background: none;
    border: none;
    color: #2a7ae2;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 0;
}

.lineage-toggle:hover {
    text-decoration: underline;
}

/* Lineage modal */
.lineage-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lineage-modal.open {
    display: flex;
}

.lineage-modal-inner {
    background: #fff;
    border-radius: 14px;
    max-width: 480px;
    width: 100%;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.lineage-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #e6e6e6;
}

.lineage-modal-title {
    font-weight: 700;
    font-size: 16px;
    color: #111;
}

.lineage-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #666;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.lineage-modal-close:hover {
    color: #111;
}

.lineage-chain {
    list-style: decimal;
    margin: 0;
    padding: 16px 16px 16px 36px;
    overflow-y: auto;
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

.lineage-chain li {
    margin-bottom: 4px;
}

.lineage-current {
    font-weight: 600;
    color: #111;
}

.header-note {
    max-width: 1100px;
    margin: 10px auto 0;
    padding: 8px 10px;
    border: 1px dashed #d0d0d0;
    border-radius: 5px;
    background: #ffffff;
    color: #333;
    font-size: 12px;
    line-height: 1.35;
}

/* Viewport + columns */
.viewport {
    position: relative;
}

.columns {
    /* Default (non-play): vertical flow and normal page scroll. */
    height: auto;
    max-height: none;
    overflow-x: visible;
    overflow-y: visible;
    padding: 14px 12px;
    background: #fff;
}

/* Play mode: fixed-height viewport with horizontal paging. */
body.play-mode .columns {
    height: var(--viewer-vh, 100vh);
    max-height: var(--viewer-vh, 100vh);
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

body.play-mode .top,
body.play-mode .controls,
body.play-mode .disclaimer {
    display: none;
}

/* Real columns (built by JS in play mode) */
.real-columns-track {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: nowrap;
}

.real-column {
    box-sizing: border-box;
    flex: 0 0 auto;
    flex-shrink: 0;
}

.section {
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-column-break-inside: avoid;
    margin: 0 0 14px;
}

/* Section header with letter identifier */
.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    break-after: avoid;
}

.section-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 5px;
    background: #111;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
}

.h2 {
    margin: 0;
    font-size: 16px;
    color: #111;
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.phrase {
    display: inline-flex;
    position: relative;
    vertical-align: top;
    flex-wrap: wrap;
    align-items: flex-start;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 0 10px 8px;
    margin: 8px 4px 8px 0;
    background: #f5f5f5;        
    break-inside: avoid;
}

/* Phrase index super-label (does not take layout space) */
.phrase-index {
    position: absolute;
    top: 3px;
    left: 3px;
    font-size: 10px;
    font-weight: 500;
    line-height: 1;    
    color: #7f7f7f;
    pointer-events: none;
    user-select: none;    
}

.section-divider {
    height: 2px;
    background: #d0d0d0;
    margin-bottom: 16px;
    break-inside: avoid;
}

/* Content blocks (viewer replicas) */
.content-container {
    display: inline-flex;
    align-items: center;
    margin: 15px 12px 3px 0;
}

/* More spacing as chord size increases (helps readability, avoids cramped clusters) */
.chords-m .content-container {
    margin-right: 16px;
}

.chords-l .content-container {
    margin-right: 20px;
}

.chords-xl .content-container {
    margin-right: 24px;
}

/* Lyric-bearing blocks (MID + lyrics-only): default to no extra horizontal gap.
    The user's dividers (spaces, hyphens, etc.) are already part of the lyric text.
    Note: edge="none" means "no lyrics" and should keep normal chord spacing. */
.content-container[data-lyr-edge-left="word"],
.content-container[data-lyr-edge-left="div"] {
    margin-right: 0;
}

/* If two lyric blocks meet with word-to-word (no divider visible), add a small gap. */
body .content-container[data-lyr-edge-right="word"] + .content-container[data-lyr-edge-left="word"] {
    margin-left: var(--gap-lyr-ww);
}

/* Fix: lyric-bearing chord (no POST, ends in word) followed by a bare chord (no lyrics).
   Without this, the lyric-bearing container has margin-right:0 and the next chord can look glued. */
body .content-container[data-lyr-edge-right="word"] + .content-container:not([data-lyr-edge-left]) {
    margin-left: var(--gap-lyr-to-bare);
}

/* In lyrics-hide, we don't want lyric-driven boundary spacing. */
.lyrics-hide .content-container[data-lyr-edge-right="word"] + .content-container[data-lyr-edge-left="word"],
.lyrics-hide .content-container[data-lyr-edge-right="word"] + .content-container:not([data-lyr-edge-left]) {
    margin-left: 0;
}

/* When lyrics are hidden, lyric-only blocks are meaningless; hide them.
   Also ensure chord blocks still have readable separation. */
.lyrics-hide .content-container.lyrics-only {
    display: none;
}

.lyrics-hide .content-container[data-lyr-edge-left] {
    margin-right: var(--gap-hide-chords);
}

/* Lyrics-only containers should not reserve horizontal spacing */
.content-container.lyrics-only {
    margin-right: 0;
}

.chords-m .content-container.lyrics-only,
.chords-l .content-container.lyrics-only,
.chords-xl .content-container.lyrics-only {
    margin-right: 0;
}

/* With word-level PRE/POST, spacing is part of the lyric text (dividers).
   Avoid inserting extra visual gaps between adjacent lyrics-only containers. */

.content-chord-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
}

.content-chord-container .chord-lyrics-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 42px;
    /* 21px chord + 21px lyrics base */
}

.content-chord-container .chord-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    white-space: nowrap;
    min-height: 21px;
    line-height: 1;
}

/* Set special min-height for when Chord is XL to preserve
lyrics alignment between PRE-MID-POST blocks */
.chords-xl .content-chord-container .chord-row {
    min-height: 26px;
}

.content-chord-container .spacer {
    display: inline-block;
    flex-shrink: 0;
    width: 0px;
}

.content-chord-container .chord {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 500;
    line-height: 1;
}

.content-chord-container .chord.chord-empty {
    display: none;
}

.content-chord-container .chord.has-frets {
    text-decoration: overline dotted;
    text-decoration-thickness: 2px;
    text-decoration-color: #169063;
}

/* Frets tooltip (legacy viewer): hover on desktop, tap-to-toggle via JS (frets-open).
   Uses data-frets="x 0 2 2 1 0" with spaces for readability. */
.content-chord-container .chord.has-frets,
.content-chord-container .chord-only.has-frets {
    position: relative;
}

.content-chord-container .chord.has-frets::after,
.content-chord-container .chord-only.has-frets::after {
    content: attr(data-frets);
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    margin-bottom: 6px;
    padding: 6px 8px;
    border-radius: 6px;
    background: rgba(20, 20, 20, 0.95);
    color: #fff;
    font-family: "DM Mono", monospace;
    font-size: 12px;
    line-height: 1.2;
    white-space: pre;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    z-index: 50;
    display: none;
    pointer-events: none;
}

.content-chord-container .chord.has-frets::before,
.content-chord-container .chord-only.has-frets::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    margin-bottom: 1px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(20, 20, 20, 0.95);
    z-index: 51;
    display: none;
    pointer-events: none;
}

.content-chord-container .chord.has-frets:hover::after,
.content-chord-container .chord.has-frets.frets-open::after,
.content-chord-container .chord-only.has-frets:hover::after,
.content-chord-container .chord-only.has-frets.frets-open::after {
    display: block;
}

.content-chord-container .chord.has-frets:hover::before,
.content-chord-container .chord.has-frets.frets-open::before,
.content-chord-container .chord-only.has-frets:hover::before,
.content-chord-container .chord-only.has-frets.frets-open::before {
    display: block;
}

.content-chord-container .lyrics-line {
    font-family: "DM Mono", monospace;
    white-space: pre;
    min-height: 21px;
    line-height: 1.2;
}

.content-chord-container .chord-only {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-weight: 500;
    line-height: 1;
    min-height: 42px;
    /* Same as chord-lyrics-wrapper to keep alignment */
    display: flex;
    align-items: center;
    /* Align to top like chords with lyrics */
}

.content-chord-container .chord-only.has-frets {
    text-decoration: overline dotted;
    text-decoration-thickness: 2px;
    text-decoration-color: #169063;
}

.lyrics-xs .content-chord-container .lyrics-line {
    font-size: 0.75em;
}

.lyrics-s .content-chord-container .lyrics-line {
    font-size: 0.85em;
}

.lyrics-m .content-chord-container .lyrics-line {
    font-size: 1em;
}

.lyrics-l .content-chord-container .lyrics-line {
    font-size: 1.3em;
}

.lyrics-xl .content-chord-container .lyrics-line {
    font-size: 1.6em;
}

.lyrics-hide .content-chord-container .lyrics-line {
    display: none;
}

.chords-xs .content-chord-container .chord,
.chords-xs .content-chord-container .chord-only {
    font-size: 0.75em;
}

.chords-s .content-chord-container .chord,
.chords-s .content-chord-container .chord-only {
    font-size: 0.85em;
}

.chords-m .content-chord-container .chord,
.chords-m .content-chord-container .chord-only {
    font-size: 1em;
}

.chords-l .content-chord-container .chord,
.chords-l .content-chord-container .chord-only {
    font-size: 1.3em;
}

.chords-xl .content-chord-container .chord,
.chords-xl .content-chord-container .chord-only {
    font-size: 1.6em;
}

.content-text-note {
    font-family: "DM Mono", monospace;
    display: flex;
    max-width: 260px;
    border: 1px solid #111;
    margin-right: 3px;
    padding: 3px;
    font-size: 0.8em;
}

/* Key Change (viewer) — mirror editor structure */
.key-change-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px;
    border-radius: 3px;
    background: #F26A4B;
    color: #181818;
    line-height: 1.1;
}

/* Center Key Change vertically within the phrase flex line */
.content-container.content-key-change {
    align-self: center;
}

.key-change-wrapper .key-change-label {
    font-size: 0.8em;
    font-weight: 500;
}

.key-change-wrapper .key-change-key {
    font-weight: 600;
}

.content-symbol {
    display: flex;
    flex-direction: column;
    padding: 3px;
    font-size: 0.8em;
    line-height: 1;
    color: inherit;
}

.content-symbol .symbol-icon {
    height: 33px;
    width: auto;
    display: block;
    color: currentColor;
}

/* n-close-repeat: "2x" + closing repeat icon */
.content-symbol--n-close-repeat {
    flex-direction: row;
    align-items: center;
}

.content-symbol--n-close-repeat .symbol-text--repeat-count {
    font-weight: 700;
    font-size: 1.4em;
    margin-right: 3px;
    margin-top: 3px;
}

/* n-alternation: SVG absolutely positioned, number in normal flow */
.content-symbol--n-alternation {
    position: relative;
    min-height: 35px;
    padding-left: 18px;
    justify-content: center;
}

.content-symbol--n-alternation .symbol-icon.numbered-alternation {
    height: 35px;
    position: absolute;
    left: 5px;
    top: 0px;
}

.content-symbol--n-alternation .symbol-text--alternation {
    font-weight: 700;
    font-size: 1.4em;
    line-height: 1;
}

/* Play overlay */
.play-overlay {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    display: none;
    z-index: 50;
}

.play-overlay.on {
    display: block;
}

.zone {
    position: relative;
    background: rgba(0, 0, 0, 0);
    display: flex;
}

.zone-exit {
    height: 30%;
    -webkit-align-items: flex-start;
    align-items: flex-start;
    justify-content: center;
}

.zone-row {
    height: 70%;
    display: flex;
}

.zone-prev {
    width: 50%;
    -webkit-align-items: flex-end;
    align-items: flex-end;
    justify-content: flex-start; 
}

.zone-next {
    width: 50%;
    -webkit-align-items: flex-end;
    align-items: flex-end;
    justify-content: flex-end;
}

.zone-indicator {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    line-height: 1.2;
    pointer-events: none;
    user-select: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.zone-exit .zone-indicator {
    font-size: 22px;
}

/* Hide indicators by default (JS will show them when appropriate) */
#prevIndicator,
#nextIndicator {
    display: none;
}

#prevIndicator.visible,
#nextIndicator.visible {
    display: block;
    margin: 30px 10px;
}

/* Mobile tweaks */
@media (max-width: 600px) {
    .h1 {
        font-size: 20px;
    }

    .header-grid {
        -webkit-flex-direction: column;
        flex-direction: column;
        gap: 8px;
    }

    .header-left {
        -webkit-order: 1;
        order: 1;
    }

    .controls {
        -webkit-order: 2;
        order: 2;
        align-items: stretch;
    }

    .header-right {
        -webkit-order: 3;
        order: 3;
        max-width: none;
        width: 100%;
    }

    .select {
        width: auto;
    }
}

/* ── Dark theme ── */
[data-theme="dark"] {
    color-scheme: dark;
}

html[data-theme="dark"] {
    background: #13151f;
    color: #dddad2;
}

[data-theme="dark"] .top {
    border-bottom-color: #2e3040;
}

[data-theme="dark"] .meta,
[data-theme="dark"] .transcribed-name,
[data-theme="dark"] .arr,
[data-theme="dark"] .ref-link,
[data-theme="dark"] .lineage-block,
[data-theme="dark"] .lineage-chain,
[data-theme="dark"] .cfg-label,
[data-theme="dark"] .content-sym,
[data-theme="dark"] .header-note {
    color: #9a9890;
}

[data-theme="dark"] .lineage-owner,
[data-theme="dark"] .lineage-modal-close {
    color: #858890;
}

[data-theme="dark"] .lineage-modal-close:hover,
[data-theme="dark"] .lineage-modal-title,
[data-theme="dark"] .lineage-current,
[data-theme="dark"] .h2,
[data-theme="dark"] .label {
    color: #dddad2;
}

[data-theme="dark"] .lineage-link,
[data-theme="dark"] .lineage-toggle {
    color: #6da8f2;
}

[data-theme="dark"] .ref-link,
[data-theme="dark"] .radio {
    border-color: #2e3040;
    background: #1c1e2a;
}

[data-theme="dark"] .ref-link:hover {
    border-color: #858890;
}

[data-theme="dark"] .select,
[data-theme="dark"] .btn,
[data-theme="dark"] .refresh-btn {
    border-color: #2e3040;
    background: #1c1e2a;
    color: #dddad2;
}

[data-theme="dark"] .btn.primary {
    border-color: #dddad2;
    background: #dddad2;
    color: #13151f;
}

[data-theme="dark"] .btn.clone-btn {
    border-color: #6da8f2;
    background: #6da8f2;
    color: #13151f;
}

[data-theme="dark"] .btn.clone-btn:hover {
    background: #88bdf5;
}

[data-theme="dark"] .cfg-panel {
    border-color: #2e3040;
    background: #1a1c28;
}

[data-theme="dark"] #cfgToggle:checked~.btn[for="cfgToggle"] {
    border-color: #dddad2;
}

[data-theme="dark"] .columns {
    background: #13151f;
}

[data-theme="dark"] .section-letter {
    background: #dddad2;
    color: #13151f;
}

[data-theme="dark"] .phrase {
    border-color: #858890;
    background: #1a1c28;
}

[data-theme="dark"] .phrase-index {
    color: #858890;
}

[data-theme="dark"] .section-divider {
    background: #2e3040;
}

[data-theme="dark"] .content-text-note {
    border-color: #dddad2;
}

[data-theme="dark"] .lineage-modal-inner {
    background: #1c1e2a;
}

[data-theme="dark"] .lineage-modal-header {
    border-bottom-color: #2e3040;
}

[data-theme="dark"] .header-note {
    border-color: #2e3040;
    background: #1c1e2a;
}

[data-theme="dark"] .refresh-btn:hover {
    background: #232535;
}

[data-theme="dark"] .refresh-btn:active {
    background: #2e3040;
}

[data-theme="dark"] .disclaimer {
    color: #858890;
}

[data-theme="dark"] .disclaimer a {
    color: #858890;
}

[data-theme="dark"] .nav-home {
    color: #dddad2;
}

[data-theme="dark"] .nav-home:hover,
[data-theme="dark"] .nav-dash:hover,
[data-theme="dark"] .nav-lang:hover {
    color: #6da8f2;
}

[data-theme="dark"] .nav-dash,
[data-theme="dark"] .nav-lang {
    color: #858890;
}

[data-theme="dark"] .nav-lang {
    border-color: #3a3d50;
}

@media (max-width: 1400px) {
    [data-theme="dark"] .site-nav {
        border-bottom-color: #2e3040;
    }
}

[data-theme="dark"] .zone-indicator {
    color: rgba(221, 218, 210, 0.7);
}