/*noinspection CssUnusedSymbol*/
/* LAYOUT + THEME TOKENS */
:root {
    --bg: #fef9f0;
    --navy: #1c2846;
    --navy2: #2e4070;
    --red: #c0292f;
    --green: #2e6b3e;
    --gold: #8a6030;
    --text: #2a1f0e;
    --muted: #7a6e5a;
    --border: #ddd0bc;
    --card: #ffffff;
    --tag: #f0e8da;
    --warn: #8a6030;
    --fix: #2e6b3e;
    --hu: #b52228;
    --irreg: #4a5fa0;
    --flag-height: 10px;
    --desktop-toc-height: 2.7rem;
    --desktop-sticky-stack: 6rem;
}

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

body {
    font-family: 'EB Garamond', Georgia, serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.6;
    padding-top: var(--flag-height);
}

/* HEADER */
.site-header {
    background: var(--navy);
    color: #f5e8d0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.flag-stripe {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 130;
    height: var(--flag-height);
    background: linear-gradient(to bottom, #ce2939 33.33%, #fff 33.33%, #fff 66.66%, #3d7a4a 66.66%);
}

.header-inner {
    padding: 1.35rem 2rem 0.85rem;
}

.overline {
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #8fa0bf;
    margin-bottom: 0.5rem;
}

.site-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4.3vw, 2.9rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #f5e8d0;
    margin-bottom: 0.1rem;
    line-height: 1.1;
}

.site-header h1 em {
    color: #e05560;
    font-style: normal;
}

.site-header .sub {
    font-style: italic;
    color: #8fa0bf;
    font-size: 1rem;
}

.header-version {
    font-size: 0.68rem;
    color: #6a7e9e;
    letter-spacing: 0.06em;
    margin-top: 0.05rem;
    margin-bottom: 0;
    line-height: 1;
    font-family: 'EB Garamond', serif;
}

/* TOC + STICKY NAV */
.toc-nav {
    background: var(--navy2);
    padding: 0.42rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.toc-rail {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    min-width: 0;
}

.toc-rail::-webkit-scrollbar {
    display: none;
}

.toc-rail a {
    flex: 0 0 auto;
}

.toc-rail a + a::before {
    content: '·';
    display: inline-block;
    margin: 0 0.4rem 0 0.2rem;
    color: #7f95b9;
}

.toc-nav a {
    color: #aac0e0;
    text-decoration: none;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.2s;
}

.toc-nav a:hover {
    color: #fff;
}

.toc-arrow {
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(15, 22, 40, 0.45);
    color: #f0e8d4;
    height: 1.8rem;
    min-width: 1.8rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    font-size: 0.8rem;
    padding: 0;
    transition: background 0.15s, border-color 0.15s;
}

.toc-arrow:hover {
    background: rgba(15, 22, 40, 0.75);
    border-color: rgba(255, 255, 255, 0.45);
}

@media (min-width: 900px) {
    .toc-nav {
        position: sticky;
        top: var(--flag-height);
        z-index: 120;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        height: var(--desktop-toc-height);
    }

    .toc-rail {
        height: 100%;
        align-items: center;
    }

    .lens-bar {
        position: sticky;
        top: calc(var(--flag-height) + var(--desktop-toc-height));
        z-index: 119;
    }

    html {
        scroll-padding-top: calc(var(--flag-height) + var(--desktop-sticky-stack) + 0.45rem);
    }

    .sec-title,
    .cat-section {
        scroll-margin-top: calc(var(--flag-height) + var(--desktop-sticky-stack) + 0.45rem);
    }
}

/* MAIN LAYOUT */
main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* CALLOUTS / NOTICES */
.notice {
    border-left: 4px solid;
    padding: 1rem 1.25rem 1rem;
    border-radius: 0 6px 6px 0;
    margin-bottom: 1.25rem;
}

.notice.hom {
    border-color: var(--warn);
    background: #f5ede0;
}

.notice h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.notice.hom h3 {
    color: var(--warn);
}

.notice p {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.nlist {
    columns: 2;
    column-gap: 1.5rem;
    font-size: 0.88rem;
}

.nlist li {
    list-style: none;
    padding-left: 1.4em;
    position: relative;
    margin-bottom: 0.2rem;
    break-inside: avoid;
}

.nlist.hom li::before {
    content: '⚠';
    position: absolute;
    left: 0;
    color: var(--warn);
}

.nlist li strong {
    color: var(--hu);
}

@media (max-width: 600px) {
    .nlist {
        columns: 1;
    }
}

/* SECTION HEADERS */
.sec-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--navy);
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.4rem;
    margin: 2.5rem 0 1.5rem;
}

.sec-title small {
    display: block;
    font-size: 0.68rem;
    font-family: 'EB Garamond', serif;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.15rem;
}

/* GRAMMAR TABLES */
.grammar-block {
    margin-bottom: 2.5rem;
}

.grammar-block h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    color: var(--navy);
    margin-bottom: 0.25rem;
}

.grammar-block h3.grammar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    background: var(--navy);
    color: #f0e8d4;
    padding: 0.45rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.6rem;
}

.grammar-block .tnote {
    font-style: italic;
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 0.75rem;
}

.grammar-table-scroll {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

table.gt {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

table.gt th {
    background: var(--navy);
    color: #f0e8d4;
    padding: 0.45rem 0.75rem;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    text-align: center;
}

table.gt th.lh {
    text-align: left;
    background: var(--navy2);
}

table.gt td {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

table.gt tr:nth-child(even) td {
    background: #f8f0e4;
}

table.gt td.pr {
    font-weight: 600;
    color: var(--navy);
    white-space: nowrap;
}

table.gt td.hu {
    color: var(--hu);
    font-weight: 600;
}

table.gt td.sfx {
    color: var(--red);
    font-weight: 700;
}

.suf {
    color: var(--red);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(183, 40, 46, 0.72);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.08em;
}

.irreg-note {
    background: #fef3f3;
    border: 1px solid #f0c0c0;
    border-radius: 4px;
    padding: 0.6rem 0.9rem;
    font-size: 0.86rem;
    color: #6b2020;
    margin-top: 0.5rem;
}

/* Vowel harmony */
table.vh {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0 1rem;
}

table.vh th {
    background: var(--navy);
    color: white;
    padding: 0.5rem 1rem;
    font-family: 'Playfair Display', serif;
    font-size: 0.88rem;
}

table.vh td {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    vertical-align: top;
}

table.vh .b-cls {
    background: #fff2f2;
}

table.vh .f-cls {
    background: #f2f5ff;
}

table.vh .r-cls {
    background: #f2fff5;
}

.vh-v {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    display: block;
    margin-bottom: 0.2rem;
}

.vh-x {
    font-size: 0.83rem;
    color: var(--muted);
}

/* VOCAB CARDS */
.cat-section {
    margin-bottom: 2rem;
    scroll-margin-top: 1rem;
}

.cat-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.7rem;
}

.cat-head h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: var(--navy);
    font-weight: 600;
}

.cat-head .ct {
    font-size: 0.78rem;
    color: var(--muted);
    background: var(--tag);
    padding: 0.1em 0.55em;
    border-radius: 10px;
}

.cat-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

.vocab-grid {
    display: grid;
    grid-template-columns:repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.45rem;
}

.ve {
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--card);
    position: relative;
    display: flex;
    flex-direction: column;
}

.ve.w {
    border-left: 3px solid var(--warn);
}

.ve.f {
    border-left: 3px solid var(--fix);
}

.ve.irr {
    border-left: 3px solid var(--irreg);
}

.ve-main {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.ve-hu {
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--hu);
}

.ve-arr {
    color: var(--muted);
    font-size: 0.82rem;
}

.ve-en {
    color: var(--text);
    font-size: 0.92rem;
}

.ve-note {
    font-style: italic;
    color: var(--muted);
    font-size: 0.76rem;
    margin-top: 0.15rem;
    line-height: 1.3;
}

.ve-cog {
    font-size: 0.72rem;
    color: #4a7a9b;
    margin-top: 0.1rem;
    line-height: 1.3;
}

.ve-badge {
    position: absolute;
    top: 0.35rem;
    right: 0.5rem;
    font-size: 0.72rem;
    color: var(--warn);
}

.cefr-badge {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 700;
    padding: 0.08em 0.4em;
    border-radius: 999px;
    vertical-align: middle;
    margin-left: 0.1em;
    line-height: 1.6;
    letter-spacing: 0.04em;
    font-family: 'EB Garamond', serif;
    border: 1px solid;
}
.cefr-A1   { color: #3a7a46; background: #e8f4eb; border-color: #b4d9bc; }
.cefr-A2   { color: #1a6e6e; background: #e4f3f3; border-color: #9fd4d4; }
.cefr-B1   { color: #2b5aa0; background: #e8eef8; border-color: #aec0e4; }
.cefr-B2plus { color: #6b3a8a; background: #f0eaf8; border-color: #c9aee0; }

.ve-irr-badge {
    position: absolute;
    top: 0.35rem;
    right: 0.5rem;
    font-size: 0.68rem;
    color: var(--irreg);
    font-style: italic;
}

/* PRINT */
@media print {
    body {
        background: white;
        font-size: 9.5pt;
    }

    .flag-stripe {
        height: 6pt;
    }

    .site-header {
        background: white !important;
        color: black !important;
        border-bottom: 1pt solid #999;
    }

    .site-header h1, .overline, .site-header .sub {
        color: black !important;
    }

    .toc-nav {
        display: none;
    }

    .sec-title {
        page-break-before: always;
        color: black;
    }

    .sec-title:first-of-type {
        page-break-before: auto;
    }

    .ve {
        border: 0.5pt solid #ccc;
        break-inside: avoid;
    }

    table.gt th {
        background: #333 !important;
    }

    .notice.hom {
        background: white !important;
        border-left-width: 2pt;
    }

    .grammar-block {
        page-break-inside: avoid;
    }
}

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

    table.gt {
        font-size: 0.78rem;
    }
}

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

/* LENS BAR */
.lens-bar {
    background: #f0e8da;
    border-bottom: 1px solid var(--border);
    padding: 0.45rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.lens-label {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    font-family: 'EB Garamond', serif;
    margin-right: 0.15rem;
    white-space: nowrap;
}

.lens-btn {
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    padding: 0.2em 0.75em;
    border-radius: 999px;
    font-size: 0.78rem;
    font-family: 'EB Garamond', serif;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.7;
}

.lens-btn:hover {
    border-color: var(--navy);
    color: var(--navy);
}

.lens-btn.active {
    background: var(--navy);
    color: #f5e8d0;
    border-color: var(--navy);
}

.lens-banner {
    background: var(--navy2);
    color: #c8d8f0;
    font-size: 0.78rem;
    text-align: center;
    padding: 0.3rem 1rem;
    letter-spacing: 0.03em;
    display: none;
}

.lens-banner.vis {
    display: block;
}

.level-group {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.lens-sep {
    color: var(--muted);
    font-size: 0.9rem;
    padding: 0 0.15rem;
    user-select: none;
}

.lens-spacer {
    flex: 1;
    min-width: 0.5rem;
}

.level-btn {
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    padding: 0.12em 0.65em;
    border-radius: 999px;
    font-size: 0.73rem;
    font-family: 'EB Garamond', serif;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.7;
    letter-spacing: 0.03em;
}

.level-btn:hover {
    border-color: var(--navy);
    color: var(--navy);
}

.level-btn.active {
    background: #556b8a;
    color: #f5e8d0;
    border-color: #556b8a;
}

.fc-section-btn,
.dr-section-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 4px;
    padding: 0.1em 0.45em;
    font-size: 0.68rem;
    cursor: pointer;
    font-family: 'EB Garamond', serif;
    transition: all 0.15s;
    line-height: 1.6;
}

.fc-section-btn:hover {
    border-color: var(--navy2);
    color: var(--navy2);
}

.dr-section-btn:hover {
    border-color: var(--green);
    color: var(--green);
}

.grammar-drill-btn {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.18em 0.7em;
    border-color: rgba(232, 200, 138, 0.78);
    color: #3f2b06;
    background: linear-gradient(180deg, #efd8a3 0%, #e8c88a 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 0 0 1px rgba(70, 50, 10, 0.18), 0 3px 8px rgba(10, 10, 12, 0.28);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
}

.grammar-drill-btn:hover {
    border-color: #f7e4ba;
    color: #2a1d04;
    background: linear-gradient(180deg, #f3dfb4 0%, #ecd29b 100%);
    transform: translateY(-1px);
}

.fc-global-btn {
    background: var(--navy2);
    color: #c8d8f0;
    border: none;
    border-radius: 4px;
    padding: 0.25em 0.85em;
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    font-family: 'EB Garamond', serif;
    transition: background 0.15s;
    margin-left: 0.4rem;
}

.fc-global-btn:hover {
    background: var(--navy);
}

.fc-global-btn:disabled {
    background: #9aa3b3;
    color: #e8ecf4;
    cursor: not-allowed;
    opacity: 0.7;
}

.fc-global-btn:disabled:hover {
    background: #9aa3b3;
}

.dr-global-btn {
    background: var(--green);
    color: #eef8f0;
    border: none;
    border-radius: 4px;
    padding: 0.25em 0.85em;
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    font-family: 'EB Garamond', serif;
    transition: filter 0.15s;
}

.dr-global-btn:hover {
    filter: brightness(0.92);
}

.ve-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 0.35rem;
}

.ve-conj-btn {
    background: rgba(28, 40, 70, 0.07);
    border: 1px solid rgba(28, 40, 70, 0.16);
    color: var(--navy2);
    border-radius: 4px;
    padding: 0.13em 0.6em;
    font-size: 0.68rem;
    cursor: pointer;
    font-family: 'EB Garamond', serif;
    line-height: 1.5;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.ve-conj-btn:hover {
    background: rgba(28, 40, 70, 0.12);
}

@media (min-width: 900px) {
    body.grammar-lens-active .lens-bar {
        top: var(--flag-height);
    }
}

/* FLASHCARD OVERLAY */
.fc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(14, 12, 10, 0.97);
    z-index: 1000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.fc-overlay.open {
    display: flex;
}

.fc-prog-wrap {
    width: min(500px, 100%);
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-bottom: 1.75rem;
}

.fc-prog-fill {
    height: 100%;
    background: var(--red);
    border-radius: 2px;
    transition: width 0.35s;
}

.fc-card {
    width: min(500px, 100%);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.7);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.fc-card-stripe {
    height: 9px;
    background: linear-gradient(to bottom, #ce2939 33.33%, #fff 33.33%, #fff 66.66%, #3d7a4a 66.66%);
}

.fc-card-body {
    background: var(--navy);
    padding: 2rem 2rem 1.5rem;
}

.fc-face-label {
    font-size: 0.67rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #8fa0bf;
    margin-bottom: 0.65rem;
}

.fc-word {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    color: #f5e8d0;
    line-height: 1.2;
}

.fc-prompt {
    color: #8fa0bf;
    font-style: italic;
    font-size: 0.83rem;
    margin-top: 1.1rem;
}

.fc-back {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    display: none;
}

.fc-back.show {
    display: block;
}

.fc-back-label {
    font-size: 0.67rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8fa0bf;
    margin-bottom: 0.45rem;
}

.fc-back-word {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.3rem, 3.5vw, 1.9rem);
    color: #e8c88a;
}

.fc-back-note {
    font-style: italic;
    color: #6a7f98;
    font-size: 0.8rem;
    margin-top: 0.45rem;
    line-height: 1.4;
}

.fc-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.75rem;
}

.fc-ctrl {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #c8d8f0;
    border-radius: 6px;
    padding: 0.45em 1.1em;
    font-size: 0.83rem;
    cursor: pointer;
    font-family: 'EB Garamond', serif;
    transition: background 0.15s;
}

.fc-ctrl:hover {
    background: rgba(255, 255, 255, 0.14);
}

.fc-counter {
    color: #8fa0bf;
    font-size: 0.8rem;
    font-family: 'EB Garamond', serif;
    min-width: 5rem;
    text-align: center;
}

.fc-close {
    position: absolute;
    top: 1.1rem;
    right: 1.2rem;
    background: none;
    border: none;
    color: #8fa0bf;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem;
}

.fc-close:hover {
    color: #f5e8d0;
}

/* CONJUGATION / DRILL OVERLAYS */
.cg-overlay, .dr-overlay {
    position: fixed;
    inset: 0;
    background: rgba(14, 12, 10, 0.97);
    z-index: 1001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.cg-overlay.open, .dr-overlay.open {
    display: flex;
}

.cg-shell, .dr-shell {
    width: min(840px, 100%);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.7);
    position: relative;
}

.cg-close, .dr-close {
    position: absolute;
    top: 0.8rem;
    right: 1rem;
    background: none;
    border: none;
    color: #8fa0bf;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.cg-close:hover, .dr-close:hover {
    color: #f5e8d0;
}

.cg-body, .dr-body {
    background: var(--navy);
    padding: 1.2rem 1.25rem 1.35rem;
    color: #c8d8f0;
    max-height: min(82vh, 860px);
    overflow: auto;
}

.cg-title, .dr-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.4rem, 4vw, 2rem);
    color: #f5e8d0;
    line-height: 1.18;
}

.cg-sub, .dr-sub {
    font-size: 0.8rem;
    color: #8fa0bf;
    letter-spacing: 0.04em;
    margin-top: 0.35rem;
}

.cg-badges {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.cg-badge {
    font-size: 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 999px;
    padding: 0.14em 0.6em;
    color: #aac0e0;
}

.cg-badge.irr {
    color: #e8c88a;
    border-color: rgba(232, 200, 138, 0.45);
    background: rgba(232, 200, 138, 0.12);
}

.cg-badge.ik {
    color: #83a2d8;
}

.cg-tabs {
    display: flex;
    gap: 0.45rem;
    margin-top: 1rem;
    margin-bottom: 0.8rem;
}

.cg-tab {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #c8d8f0;
    border-radius: 5px;
    padding: 0.24em 0.82em;
    font-family: 'EB Garamond', serif;
    cursor: pointer;
}

.cg-tab.active {
    background: #263761;
    border-color: #38579b;
    color: #f5e8d0;
}

table.cg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: fixed;
}

table.cg-table th:nth-child(1), table.cg-table td:nth-child(1) {
    width: 24%;
}

table.cg-table th:nth-child(2), table.cg-table td:nth-child(2) {
    width: 38%;
}

table.cg-table th:nth-child(3), table.cg-table td:nth-child(3) {
    width: 38%;
}

table.cg-table th {
    background: #253861;
    color: #dfe9f8;
    padding: 0.42rem 0.64rem;
    font-family: 'Playfair Display', serif;
    font-size: 0.82rem;
    text-align: center;
}

table.cg-table th:first-child {
    text-align: left;
    background: #324978;
}

table.cg-table td {
    padding: 0.39rem 0.64rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

table.cg-table tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.035);
}

table.cg-table td:first-child {
    white-space: nowrap;
    color: #aac0e0;
    font-weight: 600;
}

table.cg-table .suf {
    color: #7fc4ff;
    font-weight: 800;
    background: rgba(127, 196, 255, 0.2);
    padding: 0 0.05em;
    text-decoration: none;
    border-bottom: 2px solid rgba(127, 196, 255, 0.95);
}

.cg-imp-note {
    color: #f5e8d0;
    font-weight: 600;
    background: rgba(232, 200, 138, 0.12);
    border-left: 3px solid rgba(232, 200, 138, 0.7);
}

.cg-imp-dim td {
    opacity: 0.52;
    color: #94a7c6;
}

.cg-imp-dim td:first-child {
    color: #8aa0c3;
}

.cg-form.irr {
    color: #e8c88a;
    font-weight: 600;
}

.cg-split {
    margin-top: 0.8rem;
    padding: 0.62rem 0.75rem;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.83rem;
    color: #a9bedf;
    line-height: 1.4;
}

.cg-split strong {
    color: #e8c88a;
    font-weight: 600;
}

.dr-start {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.dr-mode-btn, .dr-submit, .dr-restart {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #d9e5f6;
    border-radius: 6px;
    padding: 0.4em 0.95em;
    cursor: pointer;
    font-family: 'EB Garamond', serif;
    font-size: 0.88rem;
}

.dr-mode-btn:hover, .dr-submit:hover, .dr-restart:hover {
    background: rgba(255, 255, 255, 0.15);
}

.dr-question {
    margin-top: 0.95rem;
    padding: 0.8rem 0.9rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
}

.dr-progress {
    font-size: 0.78rem;
    color: #8fa0bf;
    letter-spacing: 0.03em;
}

.dr-prompt {
    margin-top: 0.35rem;
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.2rem, 4vw, 1.65rem);
    line-height: 1.25;
    color: #f5e8d0;
}

.dr-hint {
    margin-top: 0.3rem;
    font-size: 0.92rem;
    color: #aac0e0;
}

.dr-answer {
    margin-top: 0.85rem;
}

.dr-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.dr-input {
    flex: 1;
    min-width: 220px;
    background: #f9f4ea;
    border: 1px solid #d8cab4;
    border-radius: 6px;
    font-size: 1.06rem;
    padding: 0.5rem 0.62rem;
    color: #372918;
    font-family: 'EB Garamond', serif;
}

.dr-keys {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.55rem;
}

.dr-key {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: #d6e4f8;
    border-radius: 4px;
    padding: 0.18em 0.52em;
    cursor: pointer;
    font-family: 'Playfair Display', serif;
}

.dr-opts {
    margin-top: 0.8rem;
    display: grid;
    grid-template-columns:1fr 1fr;
    gap: 0.45rem;
}

.dr-opt {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.07);
    color: #deebf8;
    border-radius: 6px;
    padding: 0.5rem 0.62rem;
    text-align: left;
    font-family: 'EB Garamond', serif;
    font-size: 1.08rem;
    cursor: pointer;
}

.dr-opt:hover {
    background: rgba(255, 255, 255, 0.15);
}

.dr-opt.disabled {
    opacity: 0.65;
    cursor: default;
}

.dr-feedback {
    margin-top: 0.8rem;
    font-size: 0.9rem;
    min-height: 1.4rem;
    border-radius: 6px;
    padding: 0.6rem 0.7rem;
    background: rgba(0, 0, 0, 0.12);
}

.dr-feedback-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.08rem;
    line-height: 1.2;
}

.dr-feedback-answer {
    margin-top: 0.2rem;
}

.dr-feedback-yours {
    margin-top: 0.15rem;
    color: #aac0e0;
}

.dr-feedback.ok {
    color: #7ce09c;
}

.dr-feedback.bad {
    color: #f0b36a;
}

.dr-actions {
    margin-top: 0.6rem;
}

.dr-next {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f2f6ff;
    border-radius: 6px;
    padding: 0.34em 0.95em;
    cursor: pointer;
    font-family: 'EB Garamond', serif;
}

.dr-next:hover {
    background: rgba(255, 255, 255, 0.18);
}

.dr-summary {
    margin-top: 1rem;
    padding: 0.88rem 0.95rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
}

.dr-score {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: #f5e8d0;
}

.dr-missed {
    margin-top: 0.62rem;
    font-size: 0.83rem;
    color: #aac0e0;
    line-height: 1.45;
}

.dr-missed li {
    margin-bottom: 0.25rem;
}

/* DEBUG CONJUGATION DUMP */
.debug-conj-section {
    margin: 1.1rem 1.5rem 2.4rem;
    display: flex;
    justify-content: flex-end;
}

.debug-conj-btn {
    background: #1f3d6f;
    color: #e9f2ff;
    border: 1px solid rgba(188, 210, 242, 0.35);
    border-radius: 6px;
    padding: 0.42em 1em;
    font-family: 'EB Garamond', serif;
    font-size: 0.9rem;
    cursor: pointer;
}

.debug-conj-btn:hover {
    background: #2a4d87;
}

.debug-conj-output {
    display: none;
    margin-top: 0.8rem;
    padding: 0.8rem;
    background: #fff8ee;
    border: 1px solid #d9cbb7;
    border-radius: 8px;
    color: #2a2014;
}

.debug-conj-output.open {
    display: block;
}

.debug-cg-verb {
    padding: 0.8rem 0;
    border-bottom: 1px dashed #c9b79f;
}

.debug-cg-verb:last-child {
    border-bottom: none;
}

.debug-cg-verb h3 {
    margin: 0 0 0.45rem;
    font-size: 1.18rem;
    color: #1f2f50;
}

.debug-cg-gloss {
    font-size: 0.9rem;
    color: #6d5638;
    font-weight: 400;
}

.debug-cg-tense {
    margin-top: 0.45rem;
}

.debug-cg-tense h4 {
    margin: 0.5rem 0 0.35rem;
    color: #2d436f;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.debug-cg-table {
    margin: 0;
}

body.debug-only-mode {
    background: #fff;
    color: #111;
}

body.debug-only-mode .flag-stripe,
body.debug-only-mode header,
body.debug-only-mode .toc-nav,
body.debug-only-mode .lens-bar,
body.debug-only-mode .fc-overlay,
body.debug-only-mode .cg-overlay,
body.debug-only-mode .dr-overlay,
body.debug-only-mode #debug-conjugations {
    display: none !important;
}

body.debug-only-mode .debug-only-main {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 1rem 1.25rem 2rem;
}

body.debug-only-mode .debug-conj-output {
    display: block;
    background: #fff;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
}

body.debug-only-mode .debug-conj-output h2 {
    margin: 0 0 0.8rem;
    font-family: serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #111;
}

body.debug-only-mode .debug-cg-verb {
    border-bottom: 1px solid #ddd;
    padding: 0.7rem 0;
}

body.debug-only-mode .debug-cg-verb h3,
body.debug-only-mode .debug-cg-gloss,
body.debug-only-mode .debug-cg-tense h4 {
    color: #111;
    font-family: serif;
    letter-spacing: 0;
    text-transform: none;
}

body.debug-only-mode .debug-cg-table,
body.debug-only-mode .debug-cg-table th,
body.debug-only-mode .debug-cg-table td {
    font-family: serif;
    color: #111;
    background: #fff !important;
    border: 1px solid #ccc;
}

body.debug-only-mode .debug-cg-table th {
    font-weight: 700;
}

body.debug-only-mode .debug-cg-table .suf {
    color: #111;
    border-bottom: none;
    background: none;
    font-weight: 700;
    padding: 0;
}

@media print {
    .debug-conj-btn {
        display: none !important;
    }

    .debug-conj-output {
        display: block !important;
        border: none;
        background: #fff;
        padding: 0;
        margin: 0;
    }

    .debug-cg-verb {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

@media (max-width: 760px) {
    .cg-body, .dr-body {
        padding: 1rem 0.85rem 1.05rem;
    }

    table.cg-table {
        font-size: 0.82rem;
    }
}

@media (max-width: 620px) {
    .dr-opts {
        grid-template-columns:1fr;
    }

    .dr-input-row {
        flex-direction: column;
        align-items: stretch;
    }

    .dr-input {
        font-size: 1.18rem;
        padding: 0.6rem 0.66rem;
    }
}

/* ── INTERVIEW SECTION ─────────────────────────────────────────────────────── */

.interview-fc-btn,
.interview-dr-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 4px;
    padding: 0.1em 0.45em;
    font-size: 0.68rem;
    cursor: pointer;
    font-family: 'EB Garamond', serif;
    transition: all 0.15s;
    line-height: 1.6;
}

.interview-fc-btn:hover {
    border-color: var(--navy2);
    color: var(--navy2);
}

.interview-dr-btn:hover {
    border-color: var(--green);
    color: var(--green);
}

.interview-controls {
    margin-bottom: 0.8rem;
}

.interview-cat-label {
    font-size: 0.82rem;
    color: var(--muted);
}

.interview-cat-select {
    margin-left: 0.4em;
    font-family: 'EB Garamond', serif;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.15em 0.5em;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
}

.iq-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.32rem 0.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.93rem;
}

.iq-row:last-child {
    border-bottom: none;
}

.iq-hu {
    font-family: 'Playfair Display', serif;
    color: var(--navy);
    font-weight: 500;
    flex-shrink: 0;
}

.iq-sep {
    color: var(--muted);
    flex-shrink: 0;
}

.iq-en {
    color: var(--text);
}

/* ── FLASHCARD SAMPLE RESPONSE ─────────────────────────────────────────────── */

.fc-back-response {
    margin-top: 0.9rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.fc-back-resp-label {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8fa0bf;
    margin-bottom: 0.35rem;
}

.fc-back-resp-hu {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: 1rem;
    color: #c8d8f0;
    line-height: 1.4;
}

.fc-back-resp-en {
    font-size: 0.78rem;
    color: #6a7f98;
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* drill prompt sub-text (interview respond mode) */
.dr-prompt-sub {
    font-size: 0.82em;
    color: #8fa0bf;
    font-style: normal;
}
