:root {
    --app-ink: #172033;
    --app-muted: #687086;
    --app-primary: #164194;
    --app-primary-dark: #12377C;
    --app-accent: #E4032E;
    --app-canvas: #f5f3fb;
    --app-card: rgba(255, 255, 255, .94);
    --app-line: rgba(18, 55, 124, .14);
    --app-surface-subtle: #fafafa;
    --app-line-subtle: #eeeeee;
    --app-shadow-subtle-inset: inset 0 0 50px rgba(23, 32, 51, .03);
    --app-shadow: 0 24px 70px rgba(18, 55, 124, .15);
}

html, body { min-height: 100%; }
body {
    color: var(--app-ink);
    background:
        radial-gradient(circle at 8% 10%, rgba(22, 65, 148, .16), transparent 32rem),
        radial-gradient(circle at 92% 88%, rgba(228, 3, 46, .11), transparent 30rem),
        var(--app-canvas);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: var(--app-primary-dark); }
.btn-primary {
    --bs-btn-bg: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: var(--app-primary-dark);
    --bs-btn-hover-border-color: var(--app-primary-dark);
}
.text-muted { color: var(--app-muted) !important; }
.activity-details-list { display: grid; gap: 0; }
.activity-details-list > div { display: grid; grid-template-columns: minmax(8rem, .35fr) minmax(0, 1fr); gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--app-line); }
.activity-details-list > div:last-child { border-bottom: 0; }
.activity-details-list dt { color: var(--app-muted); font-size: .75rem; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.activity-details-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-founder-footer { flex: 0 0 auto; display: flex; justify-content: center; padding: .35rem 1rem max(1rem, env(safe-area-inset-bottom)); }
.site-founder-footer a { display: inline-flex; align-items: center; gap: .45rem; color: var(--app-muted); font-size: .66rem; font-weight: 650; letter-spacing: .025em; text-decoration: none; opacity: .72; transition: opacity .16s ease; }
.site-founder-footer a:hover, .site-founder-footer a:focus-visible { color: var(--app-muted); opacity: 1; }
.site-founder-footer img { display: block; width: 6.25rem; height: auto; filter: grayscale(1); transition: filter .16s ease; }
.site-founder-footer a:hover img, .site-founder-footer a:focus-visible img { filter: grayscale(0); }
.flashcard-toolbar {
    position: relative;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(3rem, 1fr) auto minmax(3rem, 1fr);
    align-items: center;
    gap: 1rem;
    padding: 1rem clamp(1rem, 3vw, 2.5rem);
}
.toolbar-group { justify-self: start; display: flex; align-items: center; gap: .65rem; }
.toolbar-search-slot { min-width: 3rem; justify-self: start; }
.toolbar-user-menu { justify-self: end; }
.learning-mode-switch { justify-self: center; display: inline-flex; align-items: center; padding: .22rem; border: 1px solid var(--app-line); border-radius: .85rem; background: rgba(255,255,255,.86); box-shadow: 0 8px 28px rgba(18,55,124,.1); backdrop-filter: blur(10px); }
.learning-mode-switch a { min-width: 5.5rem; padding: .55rem .9rem; border-radius: .66rem; color: var(--app-ink); font-size: .82rem; font-weight: 750; text-align: center; text-decoration: none; }
.learning-mode-switch a:hover { color: var(--app-primary); }
.learning-mode-switch a.active { color: #fff; background: var(--app-ink); box-shadow: 0 4px 12px rgba(23,32,51,.2); }
.toolbar-button {
    width: 3rem;
    height: 3rem;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--app-line);
    border-radius: 50%;
    color: var(--app-ink);
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 8px 28px rgba(18, 55, 124, .10);
    backdrop-filter: blur(10px);
}
.toolbar-button:hover { color: var(--app-primary); background: #fff; }
.flashcard-search { position: relative; width: 3rem; transition: width .2s ease; }
.flashcard-search.is-open { width: min(28rem, calc(100vw - 10rem)); }
.flashcard-search-control { height: 3rem; display: flex; align-items: center; border: 1px solid transparent; border-radius: 999px; transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease; }
.flashcard-search.is-open .flashcard-search-control { border-color: var(--app-line); background: rgba(255, 255, 255, .9); box-shadow: 0 8px 28px rgba(18, 55, 124, .10); backdrop-filter: blur(10px); }
.flashcard-search-toggle { flex: 0 0 3rem; }
.flashcard-search.is-open .flashcard-search-toggle { border-color: transparent; background: transparent; box-shadow: none; }
.flashcard-search-input { min-width: 0; width: 0; height: 100%; padding: 0; border: 0; outline: 0; color: var(--app-ink); background: transparent; font-size: .92rem; opacity: 0; pointer-events: none; transition: width .2s ease, padding .2s ease, opacity .15s ease; }
.flashcard-search.is-open .flashcard-search-input { width: 100%; padding: 0 1rem 0 .15rem; opacity: 1; pointer-events: auto; }
.flashcard-search-input::-webkit-search-cancel-button { cursor: pointer; }
.flashcard-search-results { position: absolute; top: calc(100% + .55rem); left: 50%; z-index: 40; width: min(30rem, calc(100vw - 2rem)); max-height: min(28rem, calc(100vh - 6rem)); padding: .4rem; border: 1px solid var(--app-line); border-radius: 1rem; background: rgba(255, 255, 255, .98); box-shadow: var(--app-shadow); overflow-y: auto; transform: translateX(-50%); backdrop-filter: blur(16px); }
.flashcard-search-results[hidden] { display: none !important; }
.flashcard-search-result { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .72rem .8rem; border-radius: .7rem; color: var(--app-ink); text-decoration: none; }
.flashcard-search-result:hover, .flashcard-search-result.is-active { color: var(--app-primary-dark); background: rgba(22, 65, 148, .09); }
.flashcard-search-result-copy { min-width: 0; }
.flashcard-search-result-text { display: block; font-weight: 750; overflow-wrap: anywhere; }
.flashcard-search-result-category { display: block; margin-top: .12rem; color: var(--app-muted); font-size: .72rem; }
.flashcard-search-result-type { flex: 0 0 auto; color: var(--app-muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.flashcard-search-result-metadata { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: .28rem; }
.flashcard-search-result-levels { display: inline-flex; align-items: center; justify-content: flex-end; gap: .24rem; }
.flashcard-search-result-level { display: inline-flex; align-items: center; justify-content: center; min-height: 1.18rem; padding: .12rem .34rem; border-radius: 999px; font-size: .59rem; line-height: 1; font-weight: 800; letter-spacing: .02em; }
.flashcard-search-result-cefr { color: #24467f; background: #e8eefb; }
.flashcard-search-message { margin: 0; padding: .85rem; color: var(--app-muted); font-size: .82rem; text-align: center; }
.settings-menu { width: min(23rem, calc(100vw - 2rem)); max-height: calc(100vh - 5.5rem); padding: 1.1rem; border: 1px solid var(--app-line); box-shadow: var(--app-shadow); overflow-y: auto; }
.settings-menu .form-check { min-height: 1.65rem; }
.settings-submenu-heading { margin: 0; border-top: 1px solid var(--app-line); }
.settings-submenu-heading:first-child { border-top: 0; }
.settings-submenu-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: .8rem .15rem; border: 0; color: var(--app-ink); background: transparent; font-size: 1rem; font-weight: 750; text-align: left; }
.settings-submenu-toggle:hover, .settings-submenu-toggle[aria-expanded="true"] { color: var(--app-primary-dark); }
.settings-submenu-toggle:focus-visible { outline: 2px solid rgba(22, 65, 148, .4); outline-offset: 2px; border-radius: .25rem; }
.settings-submenu-chevron { font-size: .72rem; transition: transform .18s ease; }
.settings-submenu-toggle[aria-expanded="true"] .settings-submenu-chevron { transform: rotate(180deg); }
.settings-submenu-panel { padding: .1rem .25rem .85rem; }
.language-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .2rem .75rem; }
.settings-hint { margin: .4rem 0 1rem; color: var(--app-muted); font-size: .75rem; line-height: 1.35; }
.option-unavailable { color: var(--app-muted); opacity: .62; }
.option-unavailable .fa-lock { font-size: .65rem; }
.category-menu { width: min(27rem, calc(100vw - 2rem)); }
.category-options { display: grid; gap: .15rem; max-height: 280px; margin-bottom: 1rem; margin-left: -10px; padding-left: 10px; overflow-x: hidden; overflow-y: auto; }

.flashcard-stage {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 1rem clamp(3.75rem, 7vw, 7rem) 3rem;
    transition: opacity .16s ease, transform .16s ease;
}
.flashcard-stage.is-card-loading { opacity: .48; transform: scale(.992); }
.flashcard-stage.card-arrives-from-left { animation: card-arrives-from-left .24s ease-out; }
.flashcard-stage.card-arrives-from-right { animation: card-arrives-from-right .24s ease-out; }
.flashcard-card {
    width: min(58rem, 100%);
    min-height: min(41rem, calc(100vh - 9rem));
    padding: clamp(1.35rem, 4vw, 3.25rem);
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 2rem;
    background: var(--app-card);
    box-shadow: var(--app-shadow);
    backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
}
.flashcard-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; color: var(--app-muted); font-size: .83rem; letter-spacing: .04em; text-transform: uppercase; }
.flashcard-levels { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.flashcard-top-pill { display: inline-flex; align-items: center; min-height: 1.85rem; padding: .3rem .62rem; border-radius: 999px; font-size: .72rem; line-height: 1; font-weight: 800; letter-spacing: .035em; }
.cefr-pill { color: #24467f; background: #e8eefb; }
.difficulty-pill { transition: color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.difficulty-label { margin-right: .2rem; }
.difficulty-level-empty { color: var(--app-muted); background: #eef0f4; }
.difficulty-level-1 { color: #fff; background: #15803d; }
.difficulty-level-2 { color: #123c24; background: #4ade80; }
.difficulty-level-3 { color: #28420b; background: #84cc16; }
.difficulty-level-4 { color: #354507; background: #bef264; }
.difficulty-level-5 { color: #4b3b03; background: #facc15; }
.difficulty-level-6 { color: #4f2f03; background: #f59e0b; }
.difficulty-level-7 { color: #fff; background: #f97316; }
.difficulty-level-8 { color: #fff; background: #ef4444; }
.difficulty-level-9 { color: #fff; background: #b91c1c; }
.difficulty-level-10 { color: #fff; background: #6f1623; }
.flashcard-content {
    width: 100%;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.type-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .38rem .7rem; border-radius: 999px; color: var(--app-primary-dark); background: rgba(22, 65, 148, .10); font-weight: 700; }
.type-pill.flashcard-top-pill { border: 1px solid rgba(22, 65, 148, .10); background: transparent; }
.current-category { display: inline-flex; align-items: flex-start; justify-content: flex-end; gap: .4rem; margin-left: auto; color: var(--app-muted); font-weight: 650; line-height: 1.25; letter-spacing: 0; text-align: right; text-transform: none; }
.current-category i { margin-top: .12rem; color: var(--app-primary); }
.current-category-path { display: flex; min-width: 0; flex-direction: column; align-items: flex-end; text-align: right; }
.current-category-parent, .current-category-name { display: block; overflow-wrap: anywhere; }
.current-category-parent { color: var(--app-ink); font-weight: 700; }
.polish-phrase {
    margin: clamp(4.5rem, 14vh, 7.5rem) 0 clamp(1.25rem, 3vh, 2rem);
    font-size: clamp(2.1rem, 6vw, 4.3rem);
    line-height: 1.08;
    font-weight: 760;
    letter-spacing: -.045em;
    text-align: center;
    text-wrap: balance;
}
.sentence-form { margin-top: 1rem; color: var(--app-muted); font-size: 1rem; font-weight: 500; letter-spacing: 0; text-transform: none; text-align: center; }
.language-reveal-list { width: min(100%, 34rem); margin-inline: auto; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .7rem; }
.language-reveal {
    width: 100%;
    min-width: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: .18rem;
    padding: .65rem .75rem;
    border: 1px solid var(--app-line);
    border-radius: 1rem;
    color: var(--app-ink);
    background: #fff;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.language-reveal:hover { transform: translateY(-2px); border-color: rgba(22, 65, 148, .45); box-shadow: 0 8px 20px rgba(18, 55, 124, .11); }
.language-reveal.is-open { transform: translateY(-2px); border-color: var(--app-primary); background: rgba(22, 65, 148, .08); box-shadow: 0 0 0 2px rgba(22, 65, 148, .18), 0 10px 24px rgba(18, 55, 124, .18); }
.language-reveal .flag { font-size: 1.55rem; line-height: 1; }
.language-reveal .language-code { font-size: .7rem; font-weight: 800; letter-spacing: .08em; }
.translation-panel { width: min(100%, 40rem); margin: 0 auto 1.25rem; padding: clamp(1.1rem, 3vw, 1.75rem); border-radius: 1.35rem; background: linear-gradient(135deg, rgba(22, 65, 148, .09), rgba(228, 3, 46, .06)); text-align: center; }
.translation-panel[hidden] { display: none !important; }
.translation-language { color: var(--app-muted); font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.translation-text { margin: .45rem 0 1rem; font-size: clamp(1.55rem, 4vw, 2.65rem); line-height: 1.2; font-weight: 700; }
.translation-plain-line { display: block; }
.translation-variant-line { display: block; box-sizing: border-box; width: fit-content; max-width: 100%; margin: 0 auto .75rem; }
.translation-variant-phrase { display: flex; align-items: flex-start; justify-content: center; gap: .45rem; width: fit-content; max-width: 100%; margin-inline: auto; }
.translation-variant-text { min-width: 0; text-align: center; }
.translation-text > .translation-plain-line:first-child ~ .translation-variant-line { font-size: .62em; font-weight: 650; }
.translation-text > .translation-variant-line:last-child { margin-bottom: 0; }
.translation-alternative-line { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .35rem .55rem; width: fit-content; max-width: 100%; margin: .8rem auto 0; font-size: .52em; line-height: 1.35; font-weight: 500; }
.translation-alternative-label { color: var(--app-muted); font-size: .72em; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.translation-alternative-text { font-weight: 700; }
.translation-reading { display: block; margin: .18em 0 0; font-size: .5em; line-height: 1.35; font-weight: 400; letter-spacing: 0; }
.translation-reading i { font-weight: 400; }
.translation-reading b { font-weight: 800; }
.translation-script-line { display: block; margin-bottom: .75rem; }
.translation-script-label { display: inline-block; margin-right: .45em; padding: .2em .45em; border-radius: .45em; color: var(--app-primary-dark); background: rgba(22, 65, 148, .1); font-size: .32em; line-height: 1.25; font-weight: 800; letter-spacing: .04em; vertical-align: top; transform: translateY(.25em); }
.translation-script-text { font-weight: 700; }
.tts-inline-action { display: block; margin: .35rem 0 0; font-size: 1rem; text-align: center; }
.tts-button { margin: 0; border-color: rgba(22, 65, 148, .25); color: var(--app-primary-dark); background: rgba(255,255,255,.65); }
.tts-button:hover { color: #fff; background: var(--app-primary); border-color: var(--app-primary); }
.tts-button.is-speaking, .tts-button.is-speaking:hover { color: #fff; background: var(--app-accent); border-color: var(--app-accent); }
.translation-variant-label { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; margin-right: .2rem; border-radius: .55rem; color: var(--app-primary-dark); background: rgba(22, 65, 148, .1); font-size: .82rem; line-height: 1; vertical-align: top; cursor: help; }
.translation-variant-phrase > .translation-variant-label { flex: 0 0 auto; margin: .18em 0 0; }
.pronunciation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-top: 1.25rem; }
.pronunciation-item { padding: .75rem; border-radius: .9rem; background: rgba(255, 255, 255, .72); }
.pronunciation-item-wide { grid-column: 1 / -1; }
.pronunciation-item small { display: block; color: var(--app-muted); font-weight: 700; margin-bottom: .2rem; }
.pronunciation-item span { white-space: pre-line; }
.pronunciation-item .translation-variant-label { width: 1.5rem; height: 1.5rem; font-size: .72rem; vertical-align: .1em; }
.translation-detail-grid { align-items: stretch; }
.translation-info-panel { position: relative; min-width: 0; text-align: center; }
.translation-info-panel-wide { grid-column: 1 / -1; }
.translation-info-heading { position: relative; display: flex; align-items: center; justify-content: center; gap: .5rem; margin: 0; list-style: none; }
.translation-info-heading::-webkit-details-marker { display: none; }
.translation-info-heading > small { color: var(--app-muted); font-weight: 700; text-transform: none; letter-spacing: 0; }
.translation-collapse-chevron { display: none; color: var(--app-muted); font-size: .65rem; transition: transform .18s ease; }
.translation-info-panel[open] .translation-collapse-chevron { transform: rotate(180deg); }
.translation-info-content { margin-top: .4rem; }
.translation-info-lemma { display: block; font-size: 1rem; line-height: 1.35; overflow-wrap: anywhere; }
.translation-info-part-of-speech { display: block; margin-top: .3rem; color: var(--app-muted); font-size: .78rem; line-height: 1.3; }
.translation-note-hint { position: absolute; top: .7rem; right: .7rem; padding: 0; border: 0; color: var(--bs-warning) !important; background: transparent; font-size: 1rem; line-height: 1; box-shadow: none; opacity: .78; }
.translation-note-hint:hover { color: var(--bs-warning) !important; background: transparent; opacity: 1; }
.translation-alternatives-list { display: grid; gap: 0; margin: .2rem 0 0; padding: 0; list-style: none; }
.translation-alternatives-list li { display: flex; align-items: center; justify-content: center; gap: .35rem; padding: .08rem 0; border-bottom: 0; }
.translation-alternative-copy { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .28rem .45rem; }
.translation-alternative-copy strong { overflow-wrap: anywhere; }
.translation-alternative-kind { color: var(--app-muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .045em; }
.translation-alternative-cefr { display: inline-flex; align-items: center; justify-content: center; min-height: 1.18rem; padding: .12rem .34rem; border-radius: 999px; color: #24467f; background: #e8eefb; font-size: .59rem; line-height: 1; font-weight: 800; letter-spacing: .02em; }
.translation-preferred-star { color: #e4a400; font-size: .75rem; }
.translation-detail-empty { display: block; margin-top: .35rem; color: var(--app-muted); font-size: .82rem; }
.tts-button-compact { flex: 0 0 auto; width: 1.65rem; height: 1.65rem; display: inline-grid; place-items: center; margin: 0; padding: 0; border-radius: 999px; font-size: .68rem; }
.card-nav {
    position: fixed;
    z-index: 10;
    top: 50%;
    transform: translateY(-50%);
    width: 3.25rem;
    height: 5.5rem;
    display: grid;
    place-items: center;
    border: 1px solid var(--app-line);
    color: var(--app-primary-dark);
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 10px 30px rgba(18, 55, 124, .11);
    backdrop-filter: blur(10px);
    transition: width .15s ease, background .15s ease;
}
.card-nav:hover { width: 3.6rem; color: #fff; background: var(--app-primary); }
.card-nav.is-disabled { pointer-events: none; opacity: .48; }
.card-nav-prev { left: 0; border-radius: 0 1.2rem 1.2rem 0; }
.card-nav-next { right: 0; border-radius: 1.2rem 0 0 1.2rem; }
.guest-note { margin-top: 1rem; color: var(--app-muted); text-align: center; font-size: .85rem; }

@keyframes card-arrives-from-left {
    from { opacity: 0; transform: translateX(-1.5rem); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes card-arrives-from-right {
    from { opacity: 0; transform: translateX(1.5rem); }
    to { opacity: 1; transform: translateX(0); }
}

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card { width: min(28rem, 100%); border: 1px solid rgba(255,255,255,.82); border-radius: 1.75rem; background: var(--app-card); box-shadow: var(--app-shadow); }

.admin-body { background: #f6f7fb; }
.admin-layout { min-height: 100vh; display: grid; grid-template-columns: 16.5rem minmax(0, 1fr); }
.admin-sidebar { position: sticky; top: 0; height: 100vh; padding: 1.5rem 1rem; color: #e8eefb; background: #0e285b; overflow-y: auto; }
.admin-brand { display: flex; align-items: center; gap: .8rem; padding: .35rem .65rem 1.5rem; color: #fff; text-decoration: none; font-weight: 800; }
.admin-brand-mark { width: 2.45rem; height: 2.45rem; display: grid; place-items: center; border-radius: .8rem; background: linear-gradient(135deg, var(--app-primary), var(--app-accent)); }
.admin-nav { display: grid; gap: .3rem; }
.admin-nav a, .admin-nav-toggle { display: flex; align-items: center; gap: .75rem; padding: .72rem .8rem; border-radius: .75rem; color: #c7d3ee; text-decoration: none; }
.admin-nav a:hover, .admin-nav a.active, .admin-nav-toggle:hover, .admin-nav-toggle.active { color: #fff; background: rgba(255,255,255,.11); }
.admin-nav i { width: 1.2rem; text-align: center; }
.admin-nav-toggle { width: 100%; border: 0; background: transparent; font: inherit; text-align: left; }
.admin-nav-chevron { margin-left: auto; font-size: .65rem; transition: transform .18s ease; }
.admin-nav-toggle[aria-expanded="true"] .admin-nav-chevron { transform: rotate(180deg); }
.admin-nav-submenu { margin: .2rem 0 .1rem 2.7rem; padding-left: .65rem; border-left: 1px solid rgba(255,255,255,.18); }
.admin-nav-submenu a { padding: .48rem .65rem; border-radius: .55rem; font-size: .83rem; }
.admin-content { min-width: 0; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; padding: 1rem clamp(1rem, 3vw, 2rem); border-bottom: 1px solid #e8e9f1; background: #fff; }
.admin-main { padding: clamp(1rem, 3vw, 2rem); }
.admin-page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.admin-page-header h1 { margin: 0; font-size: clamp(1.55rem, 3vw, 2rem); font-weight: 750; }
.admin-card { border: 1px solid #e8e9f1; border-radius: 1rem; background: #fff; box-shadow: 0 8px 30px rgba(18, 55, 124, .05); }
.course-admin-language-list { display: grid; gap: 1rem; }
.course-admin-language-card { scroll-margin-top: 1rem; overflow: hidden; }
.course-admin-language-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.15rem; border-bottom: 1px solid #e8e9f1; }
.course-admin-language-header > div { display: flex; align-items: center; gap: .8rem; }
.course-admin-language-header h2 { margin: 0; font-size: 1.05rem; font-weight: 800; }
.course-admin-language-flag { font-size: 1.65rem; }
.course-admin-course-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; padding: 1rem; }
.course-admin-course-tile { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; padding: 1rem; border: 1px solid #e1e5ee; border-radius: .85rem; color: var(--app-ink); text-decoration: none; }
.course-admin-course-tile:hover { border-color: rgba(22,65,148,.38); color: var(--app-primary-dark); box-shadow: 0 8px 20px rgba(18,55,124,.08); }
.course-admin-course-tile small { color: var(--app-muted); }
.course-admin-course-tile > i { position: absolute; right: 1rem; bottom: 1rem; }
.course-admin-empty { grid-column: 1 / -1; padding: 1.25rem; border: 1px dashed #dfe3ec; border-radius: .85rem; color: var(--app-muted); text-align: center; }
.course-revision-list { max-height: 34rem; overflow-y: auto; }
.course-revision-item { padding: .9rem 1rem; border-bottom: 1px solid #eceef4; }
.course-revision-item:last-child { border-bottom: 0; }
.course-revision-item.is-published { box-shadow: inset .25rem 0 0 #198754; background: #f5fbf7; }
.course-revision-item p { margin: .35rem 0; font-size: .8rem; }
.course-revision-item small { color: var(--app-muted); }
.course-block-admin-list { display: grid; }
.course-block-admin-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: .65rem; padding: .75rem 1rem; border-bottom: 1px solid #eceef4; }
.course-block-admin-item:last-child { border-bottom: 0; }
.course-block-admin-item > div { min-width: 0; }
.course-block-admin-item small { display: block; color: var(--app-muted); font-size: .65rem; overflow: hidden; text-overflow: ellipsis; }
.course-block-admin-item form { margin: 0; }
.course-block-admin-order { width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: .55rem; color: var(--app-primary-dark); background: rgba(22,65,148,.09); font-size: .72rem; font-weight: 800; }

.course-chapter-editor { padding-bottom: 5.5rem; }
.course-editor-page-header { align-items: flex-end; }
.course-editor-header-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: .55rem; }
.course-editor-save-state { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .58rem; border-radius: 999px; font-size: .72rem; font-weight: 750; }
.course-editor-save-state.is-saved { color: #237447; background: #e9f7ef; }
.course-editor-save-state.is-dirty { color: #8a5b00; background: #fff3cd; }
.course-editor-settings-card { padding: 1.25rem; }
.course-editor-section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.15rem; }
.course-editor-section-heading > div { display: flex; align-items: center; gap: .8rem; }
.course-editor-section-heading h2, .course-editor-blocks-heading h2 { margin: 0; font-size: 1.08rem; font-weight: 800; }
.course-editor-section-heading p, .course-editor-blocks-heading p { margin: .14rem 0 0; color: var(--app-muted); font-size: .78rem; }
.course-editor-section-icon { flex: 0 0 auto; width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: .7rem; color: var(--app-primary-dark); background: rgba(22,65,148,.09); }
.course-editor-settings-grid { display: grid; grid-template-columns: minmax(16rem, 2fr) minmax(7rem, .45fr) minmax(10rem, .7fr) minmax(9rem, .65fr); gap: .9rem; }
.course-editor-summary-field { grid-column: 1 / -1; }
.editor-floating-field { --editor-field-bg: #fff; position: relative; min-width: 0; margin-top: .35rem; }
.editor-floating-field > label { position: absolute; top: -.52rem; left: .78rem; z-index: 2; max-width: calc(100% - 1.55rem); padding: 0 .28rem; color: var(--app-muted); background: var(--editor-field-bg); font-size: .72rem; font-weight: 650; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.editor-floating-field > .form-control, .editor-floating-field > .form-select { min-height: 3rem; padding-top: .65rem; border-color: #dce1eb; background-color: var(--editor-field-bg); }
.editor-floating-field > .form-control:focus, .editor-floating-field > .form-select:focus { border-color: rgba(22,65,148,.55); box-shadow: 0 0 0 .2rem rgba(22,65,148,.1); }
.editor-floating-field-textarea > .form-control { min-height: 4.2rem; padding-top: .85rem; resize: vertical; }
.editor-floating-field .invalid-feedback, .editor-floating-field .form-error-message { margin: .3rem 0 0; }
.course-editor-icon-field > .form-control { padding-right: 2.8rem; }
.course-editor-icon-preview { position: absolute; top: 50%; right: .9rem; z-index: 2; color: var(--app-primary); transform: translateY(-50%); pointer-events: none; }
.course-editor-advanced-settings { margin-top: .9rem; border-top: 1px solid #edf0f5; }
.course-editor-advanced-settings summary { width: fit-content; padding: .8rem .1rem .15rem; color: var(--app-muted); font-size: .75rem; font-weight: 700; cursor: pointer; }
.course-editor-advanced-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; padding-top: .65rem; }
.course-editor-settings-actions { display: flex; justify-content: flex-end; margin-top: 1rem; }
.course-editor-blocks-section { margin-top: 1.75rem; }
.course-editor-blocks-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.course-editor-block-count { flex: 0 0 auto; color: var(--app-muted); font-size: .78rem; }
.course-editor-block-count strong { color: var(--app-ink); }
.course-editor-block-list { display: grid; gap: .65rem; }
.course-editor-block { --editor-field-bg: #fff; border: 1px solid #dde2ec; border-radius: .9rem; background: #fff; box-shadow: 0 5px 18px rgba(18,55,124,.035); overflow: hidden; transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease; }
.course-editor-block:hover { border-color: #c8d1e2; }
.course-editor-block.is-open { border-color: rgba(22,65,148,.35); box-shadow: 0 8px 28px rgba(18,55,124,.08); }
.course-editor-block.is-dirty { border-color: rgba(230,167,0,.65); box-shadow: inset .25rem 0 0 #e6a700, 0 8px 28px rgba(18,55,124,.07); }
.course-editor-block.is-dragging { opacity: .55; box-shadow: 0 18px 40px rgba(18,55,124,.2); }
.course-editor-block-header { min-height: 4.25rem; display: grid; grid-template-columns: auto auto auto minmax(0, 1fr) auto auto; align-items: center; gap: .65rem; padding: .55rem .7rem; }
.course-editor-drag-handle { align-self: stretch; width: 1.8rem; padding: 0; border: 0; color: #9ba4b7; background: transparent; cursor: grab; touch-action: none; }
.course-editor-drag-handle:active { cursor: grabbing; }
.course-editor-block-order { width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: .55rem; color: var(--app-primary-dark); background: rgba(22,65,148,.08); font-size: .68rem; font-weight: 800; }
.course-editor-block-icon { width: 2.15rem; height: 2.15rem; display: grid; place-items: center; border-radius: .65rem; color: var(--app-primary); background: #f1f5fc; }
.course-editor-block-toggle { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .35rem; border: 0; color: var(--app-ink); background: transparent; text-align: left; }
.course-editor-block-toggle > span { min-width: 0; }
.course-editor-block-toggle strong { display: block; font-size: .88rem; }
.course-editor-block-toggle small { display: block; margin-top: .1rem; color: var(--app-muted); font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course-editor-block-toggle > i { color: var(--app-muted); font-size: .7rem; transition: transform .16s ease; }
.course-editor-block.is-open .course-editor-block-toggle > i { transform: rotate(180deg); }
.course-editor-block-state { min-width: 5.3rem; color: #237447; font-size: .68rem; font-weight: 750; text-align: right; }
.course-editor-block.is-dirty .course-editor-block-state { color: #8a5b00; }
.course-editor-block-menu { display: flex; align-items: center; gap: .25rem; }
.course-editor-block-menu .btn { width: 2rem; height: 2rem; display: inline-grid; place-items: center; padding: 0; }
.course-editor-block-body { padding: 1rem 1.15rem 1.15rem; border-top: 1px solid #edf0f5; background: #fbfcff; }
.course-editor-block-body[hidden] { display: none !important; }
.course-editor-fields { --editor-field-bg: #fbfcff; display: grid; gap: 1rem; }
.course-editor-textarea { overflow-y: hidden; }
.course-editor-field-help { margin: -.45rem 0 0; color: var(--app-muted); font-size: .72rem; }
.course-editor-field-help i { color: var(--app-primary); }
.course-editor-block-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; padding-top: .9rem; border-top: 1px solid #edf0f5; }
.course-editor-block-footer small { color: #9aa2b2; font-size: .62rem; }
.course-editor-errors { margin-top: .75rem; padding: .65rem .8rem; border-radius: .6rem; color: #842029; background: #f8d7da; font-size: .76rem; }
.course-editor-errors[hidden] { display: none !important; }
.course-editor-divider-preview { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .8rem; color: var(--app-muted); font-size: .75rem; }
.course-editor-divider-preview span { height: 1px; background: #dce1eb; }
.course-editor-repeater { display: grid; gap: .65rem; }
.course-editor-repeater-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.course-editor-repeater-heading strong { font-size: .82rem; }
.course-editor-repeater-heading span { color: var(--app-muted); font-size: .68rem; }
.course-editor-repeater [data-repeater-rows] { display: grid; gap: .6rem; }
.course-editor-repeater-row { display: grid; grid-template-columns: 2rem minmax(0, 1fr) minmax(0, 1fr) 2rem; align-items: center; gap: .55rem; }
.course-editor-vocabulary-repeater .course-editor-repeater-row { grid-template-columns: 2rem minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1fr) 2rem; }
.course-editor-dialogue-repeater .course-editor-repeater-row { grid-template-columns: 2rem minmax(6rem, .4fr) minmax(10rem, 1.15fr) minmax(9rem, .9fr) minmax(10rem, 1fr) 2rem; }
.course-editor-repeater-row.is-empty-row { opacity: .7; }
.course-editor-repeater-row:focus-within { opacity: 1; }
.course-editor-repeater-number { width: 1.75rem; height: 1.75rem; display: grid; place-items: center; border-radius: 50%; color: var(--app-muted); background: #edf1f7; font-size: .65rem; font-weight: 800; }
.course-editor-repeater-row [data-remove-row] { width: 2rem; height: 2rem; display: grid; place-items: center; padding: 0; color: var(--app-muted); }
.course-editor-choice { display: grid; gap: .8rem; }
.course-editor-choice-list { display: grid; gap: .85rem; }
.course-editor-choice-question { display: grid; gap: .75rem; padding: .9rem; border: 1px solid var(--app-line); border-radius: .85rem; background: #f9fafc; }
.course-editor-choice-question > header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.course-editor-choice-question > header strong { color: var(--app-primary-dark); font-size: .78rem; }
.course-editor-choice-options { display: grid; gap: .55rem; padding: .7rem; border: 1px solid #e8ebf1; border-radius: .7rem; background: #fff; }
.course-editor-choice-option-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.course-editor-choice-option-heading strong { font-size: .74rem; }
.course-editor-choice-option-heading span { color: var(--app-muted); font-size: .66rem; }
.course-editor-choice-options [data-choice-option-list] { display: grid; gap: .5rem; }
.course-editor-choice-option { display: grid; grid-template-columns: 2rem minmax(0,1fr) 2rem; align-items: center; gap: .55rem; }
.course-editor-choice-correct { position: relative; display: grid; place-items: center; margin: 0; cursor: pointer; }
.course-editor-choice-correct input { position: absolute; opacity: 0; pointer-events: none; }
.course-editor-choice-correct span { width: 1.75rem; height: 1.75rem; display: grid; place-items: center; border: 1px solid var(--app-line); border-radius: 50%; color: transparent; background: #fff; transition: color .15s ease, border-color .15s ease, background .15s ease; }
.course-editor-choice-correct:hover span, .course-editor-choice-correct input:focus-visible + span { border-color: var(--app-primary); }
.course-editor-choice-correct input:checked + span { color: #fff; border-color: #2c9559; background: #2c9559; }
.course-editor-choice-correct span i { font-size: .65rem; }
.course-editor-choice-option [data-remove-choice-option] { width: 2rem; height: 2rem; display: grid; place-items: center; padding: 0; color: var(--app-muted); }
.course-editor-empty { min-height: 12rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; padding: 2rem; border: 1px dashed #cfd6e3; border-radius: .9rem; color: var(--app-muted); text-align: center; }
.course-editor-empty i { color: var(--app-primary); font-size: 1.6rem; }
.course-editor-empty strong { color: var(--app-ink); }
.course-editor-add-menu { min-width: 13rem; }
.course-editor-add-menu .dropdown-item { display: flex; align-items: center; gap: .65rem; padding-block: .55rem; }
.course-editor-add-menu .dropdown-item i { width: 1.2rem; color: var(--app-primary); text-align: center; }
.course-editor-savebar { position: fixed; right: 1.5rem; bottom: 1.25rem; left: 18rem; z-index: 1030; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; border: 1px solid rgba(22,65,148,.2); border-radius: .9rem; background: rgba(255,255,255,.96); box-shadow: 0 16px 45px rgba(18,55,124,.2); backdrop-filter: blur(12px); }
.course-editor-savebar[hidden] { display: none !important; }
.course-editor-savebar > div { display: flex; align-items: center; gap: .65rem; }
.course-editor-savebar small { color: var(--app-muted); }
.course-editor-unsaved-dot { width: .65rem; height: .65rem; border-radius: 50%; background: #e6a700; box-shadow: 0 0 0 .25rem rgba(230,167,0,.14); }
.course-editor-toast { position: fixed; top: 1rem; right: 1rem; z-index: 1090; max-width: 28rem; padding: .75rem 1rem; border-radius: .75rem; color: #fff; background: #237447; box-shadow: 0 12px 32px rgba(18,55,124,.22); font-size: .82rem; font-weight: 650; }
.course-editor-toast.is-danger { background: #b42332; }
.course-editor-toast[hidden] { display: none !important; }

.course-stage { flex: 1; display: grid; place-items: center; padding: 1rem clamp(1rem, 6vw, 6rem) 3rem; }
.course-card { --course-card-padding: clamp(1.4rem, 4vw, 3.25rem); width: min(74rem, 100%); min-height: min(42rem, calc(100vh - 9rem)); padding: var(--course-card-padding); border: 1px solid rgba(255,255,255,.82); border-radius: 2rem; background: var(--app-card); box-shadow: var(--app-shadow); backdrop-filter: blur(18px); }
.course-card-topline { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.course-language-selector { display: inline-flex; align-items: center; gap: .45rem; padding: .6rem .8rem; border: 1px solid var(--app-line); border-radius: .8rem; color: var(--app-ink); background: #fff; font-size: .85rem; }
.course-kind-label { color: var(--app-muted); font-size: .8rem; font-weight: 650; }
.course-overview-section + .course-overview-section { margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid var(--app-line); }
.course-overview-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin: clamp(2rem, 6vh, 3.8rem) 0 1.6rem; }
.course-overview-heading h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.05; font-weight: 780; letter-spacing: -.04em; }
.course-planned-badge { display: inline-flex; align-items: center; margin-left: .65rem; padding: .35rem .55rem; border: 1px solid rgba(22,65,148,.14); border-radius: 999px; color: var(--app-primary-dark); background: rgba(22,65,148,.07); font-size: .68rem; line-height: 1; font-weight: 750; letter-spacing: .02em; vertical-align: middle; white-space: nowrap; }
.course-overview-heading p { max-width: 42rem; margin: .75rem 0 0; color: var(--app-muted); }
.course-outline-link { flex: 0 0 auto; padding-bottom: .25rem; font-size: .82rem; font-weight: 750; text-decoration: none; }
.course-chapter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.course-chapter-card { position: relative; min-width: 0; min-height: 13.5rem; display: flex; flex-direction: column; align-items: flex-start; padding: 1.2rem; border: 1px solid var(--app-line); border-radius: 1rem; color: var(--app-ink); background: rgba(255,255,255,.68); text-decoration: none; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.course-chapter-card:not(.is-planned):hover { transform: translateY(-2px); border-color: rgba(22,65,148,.38); color: var(--app-ink); box-shadow: 0 12px 28px rgba(18,55,124,.1); }
.course-chapter-card:first-child { background: rgba(22,65,148,.045); }
.course-chapter-card.is-planned { cursor: default; border-style: dashed; color: var(--app-ink); background: var(--app-surface-subtle); box-shadow: none; }
.course-chapter-card.is-planned > * { opacity: .5; }
.course-chapter-card.is-planned .course-chapter-icon { color: var(--app-muted); }
.course-chapter-meta { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.course-chapter-number { color: var(--app-primary); font-size: .78rem; font-weight: 800; }
.course-chapter-cefr { display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; padding: .26rem .48rem; border-radius: 999px; color: #24467f; background: #e8eefb; font-size: .66rem; line-height: 1; font-weight: 800; letter-spacing: .025em; }
.course-chapter-icon { margin: 1rem 0 .7rem; font-size: 1.4rem; }
.course-chapter-card > strong { font-size: 1rem; }
.course-chapter-card p { margin: .45rem 0 1rem; color: var(--app-muted); font-size: .78rem; line-height: 1.45; }
.course-chapter-card > span:last-child { margin-top: auto; color: var(--app-primary); font-size: .76rem; font-weight: 750; }
.course-chapter-card > .course-chapter-planned-label:last-child { display: inline-flex; align-items: center; gap: .3rem; color: var(--app-muted); }
.course-plan-empty { grid-column: 1 / -1; min-height: 12rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; padding: 2rem; border: 1px dashed var(--app-line); border-radius: 1rem; color: var(--app-muted); text-align: center; }
.course-plan-empty i { margin-bottom: .35rem; color: var(--app-primary); font-size: 1.45rem; }
.course-plan-empty strong { color: var(--app-ink); }
.course-empty-state { min-height: 31rem; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.course-empty-state > i { margin-bottom: 1rem; color: var(--app-primary); font-size: 2rem; }
.course-empty-state h1 { font-size: 2rem; }
.course-empty-state p { color: var(--app-muted); }
.course-reader-stage { align-items: start; }
.course-reader { width: min(62rem, 100%); container-type: inline-size; }
.course-reader-header { max-width: 45rem; margin: clamp(2.5rem, 7vh, 5rem) auto 3rem; text-align: center; }
.course-reader-kicker { color: var(--app-primary); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.course-reader-header h1 { margin: .6rem 0; font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.05; font-weight: 780; letter-spacing: -.04em; }
.course-reader-header p { color: var(--app-muted); font-size: 1.05rem; }
.course-content-blocks { width: min(46rem, 100%); margin-inline: auto; }
.course-block-heading-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem 1rem; margin: 2.4rem 0 .8rem; }
.course-block-heading { margin: 0; font-size: 1.55rem; font-weight: 760; }
.course-anchor-target { scroll-margin-top: 2rem; }
.course-section-anchor, .course-dialogue-heading-link { position: relative; color: inherit; text-decoration: none; }
.course-section-anchor { display: inline-block; }
.course-section-anchor:hover, .course-section-anchor:focus-visible, .course-dialogue-heading-link:hover, .course-dialogue-heading-link:focus-visible { color: inherit; }
.course-section-anchor:focus-visible, .course-dialogue-heading-link:focus-visible { outline: 0; }
.course-section-anchor-icon { position: absolute; top: 50%; left: -1.4rem; color: #8991a2; font-size: 1.25rem; line-height: 1; opacity: 0; transform: translateY(-50%); transition: color .18s ease, left .18s ease, opacity .18s ease; }
.course-block-heading:hover .course-section-anchor-icon, .course-block-heading:focus-within .course-section-anchor-icon, .course-dialogue-heading-link:hover .course-section-anchor-icon, .course-dialogue-heading-link:focus-visible .course-section-anchor-icon { left: -1.75rem; color: var(--app-primary); opacity: .5; }
.course-play-sequence-button { flex: 0 0 auto; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.course-block-rich-text { color: #30394c; font-size: 1.02rem; line-height: 1.8; }
.course-markdown > :first-child { margin-top: 0; }
.course-markdown > :last-child { margin-bottom: 0; }
.course-markdown h1, .course-markdown h2, .course-markdown h3, .course-markdown h4, .course-markdown h5, .course-markdown h6 { margin: 1.6em 0 .55em; color: var(--app-ink); line-height: 1.3; font-weight: 760; }
.course-markdown h1 { font-size: 1.55rem; }
.course-markdown h2 { font-size: 1.38rem; }
.course-markdown h3 { font-size: 1.2rem; }
.course-markdown h4 { font-size: 1.08rem; }
.course-markdown p { margin: 0 0 .9rem; }
.course-markdown ul, .course-markdown ol { margin: .65rem 0 .9rem; padding-left: 1.4rem; }
.course-markdown li + li { margin-top: .28rem; }
.course-markdown code { padding: .08em .35em; border-radius: .35rem; background: rgba(22,65,148,.075); font-size: .9em; }
.course-markdown blockquote { margin: 1rem 0; padding-left: 1rem; border-left: .2rem solid rgba(22,65,148,.3); color: var(--app-muted); }
.course-block-summary { display: flex; gap: 1rem; padding: 1.25rem; border: 1px solid rgba(22,65,148,.16); border-radius: 1rem; background: rgba(22,65,148,.055); }
.course-block-summary > div { min-width: 0; }
.course-block-summary-icon { flex: 0 0 auto; margin-top: .28rem; color: var(--app-primary); line-height: 1; }
.course-block-callout { display: flex; gap: 1rem; margin: 1.5rem 0; padding: 1.2rem; border: 1px solid rgba(181,129,25,.2); border-radius: 1rem; background: rgba(255,248,226,.68); }
.course-block-callout > div { min-width: 0; }
.course-block-callout-icon { flex: 0 0 auto; margin-top: .24rem; color: #b17a11; line-height: 1; }
.course-block-callout-body { margin-top: .3rem; }
.course-block-example { display: grid; gap: .2rem; margin: 1rem 0; padding: 1rem 1.2rem; border-left: .25rem solid var(--app-primary); background: #fff; }
.course-audio-source { min-width: 0; display: flex; align-items: center; gap: .55rem; }
.course-audio-source > strong { min-width: 0; overflow-wrap: anywhere; }
.course-block-example .course-audio-source > strong { font-size: 1.2rem; }
.course-block-example > span, .course-block-example > small { color: var(--app-muted); }
.course-pronunciation { display: block; color: var(--app-primary-dark) !important; font-size: .78rem; line-height: 1.4; font-weight: 560; letter-spacing: .01em; }
.course-block-dialogue-section { position: relative; isolation: isolate; margin: 4rem 0; }
.course-block-dialogue-section::before { content: ""; position: absolute; top: -2rem; bottom: -2rem; left: 50%; z-index: 0; width: calc(100cqw + var(--course-card-padding) + var(--course-card-padding)); border-top: 1px solid var(--app-line-subtle); border-bottom: 1px solid var(--app-line-subtle); background: var(--app-surface-subtle); box-shadow: var(--app-shadow-subtle-inset); transform: translateX(-50%); pointer-events: none; }
.course-block-dialogue-section > * { position: relative; z-index: 1; }
.course-dialogue-header { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: .75rem 1rem; margin-bottom: 1rem; }
.course-dialogue-heading-link { flex: 1 1 18rem; min-width: 0; display: block; }
.course-dialogue-actions.btn-group { display: inline-flex; align-items: stretch; justify-content: flex-end; flex-wrap: nowrap; gap: 0; width: auto; border-radius: 999px; box-shadow: 0 3px 10px rgba(22,65,148,.05); }
.course-dialogue-actions.btn-group > .course-dialogue-action-button { min-height: 1.8rem; padding: .28rem .65rem; color: var(--app-primary-dark); border-color: rgba(22,65,148,.2); border-radius: 0; background: rgba(255,255,255,.78); font-size: .75rem; font-weight: 700; line-height: 1.2; }
.course-dialogue-actions.btn-group > .course-dialogue-action-button:first-child { border-radius: 999px 0 0 999px; }
.course-dialogue-actions.btn-group > .course-dialogue-action-button:last-child { border-radius: 0 999px 999px 0; }
.course-dialogue-actions.btn-group > .course-dialogue-action-button:hover, .course-dialogue-actions.btn-group > .course-dialogue-action-button:focus-visible { z-index: 2; color: var(--app-primary); border-color: rgba(22,65,148,.38); background: rgba(22,65,148,.055); box-shadow: none; }
.course-dialogue-heading-link .course-section-anchor-icon,
h3 .course-section-anchor-icon,
h4 .course-section-anchor-icon,
h5 .course-section-anchor-icon,
h6 .course-section-anchor-icon { top: .62rem; font-size: 1rem; }
.course-dialogue-header h3 { margin: 0; font-size: 1.05rem; font-weight: 760; }
.course-dialogue-header p { margin: .25rem 0 0; color: var(--app-muted); font-size: .82rem; line-height: 1.45; }
.course-vocabulary-toolbar { display: flex; justify-content: flex-end; margin-bottom: .75rem; }
.course-block-dialogue { display: flex; flex-direction: column; gap: .9rem; }
.course-dialogue-line { display: flex; align-items: flex-end; gap: .6rem; width: min(88%, 38rem); }
.course-dialogue-line.is-opening { align-self: flex-start; }
.course-dialogue-line.is-reply { align-self: flex-end; flex-direction: row-reverse; }
.course-dialogue-avatar { flex: 0 0 auto; width: 2.15rem; height: 2.15rem; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--app-primary); font-size: .75rem; font-weight: 800; box-shadow: 0 4px 12px rgba(22,65,148,.18); }
.course-dialogue-bubble { min-width: 0; padding: .85rem 1rem; border: 1px solid rgba(22,65,148,.12); border-radius: 1.05rem 1.05rem 1.05rem .3rem; background: rgba(22,65,148,.075); box-shadow: 0 6px 18px rgba(18,55,124,.05); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.course-dialogue-line.is-reply .course-dialogue-avatar { background: #b52f55; box-shadow: 0 4px 12px rgba(181,47,85,.18); }
.course-dialogue-line.is-reply .course-dialogue-bubble { border-color: rgba(181,47,85,.13); border-radius: 1.05rem 1.05rem .3rem 1.05rem; background: rgba(228,3,46,.055); }
.course-dialogue-line.is-speaking .course-dialogue-bubble { transform: translateY(-1px); border-color: rgba(22,65,148,.34); box-shadow: 0 0 0 3px rgba(22,65,148,.13), 0 12px 28px rgba(18,55,124,.16); }
.course-dialogue-line.is-reply.is-speaking .course-dialogue-bubble { border-color: rgba(181,47,85,.34); box-shadow: 0 0 0 3px rgba(181,47,85,.12), 0 12px 28px rgba(181,47,85,.14); }
.course-dialogue-speaker-row { display: flex; align-items: center; gap: .4rem; }
.course-dialogue-speaker { display: block; color: var(--app-primary-dark); font-size: .82rem; }
.course-dialogue-line.is-reply .course-dialogue-speaker { color: #912342; }
.course-utterance-button, .course-dialogue-utterance-button { width: 1.35rem; height: 1.35rem; border-color: rgba(22,65,148,.18); font-size: .52rem; }
.course-dialogue-bubble p { margin: .2rem 0 0; line-height: 1.5; }
.course-dialogue-pronunciation { display: block; margin-top: .15rem; color: var(--app-primary-dark); font-size: .76rem; line-height: 1.4; }
.course-dialogue-line.is-reply .course-dialogue-pronunciation { color: #912342; }
.course-dialogue-bubble small[data-dialogue-translation] { display: block; margin-top: .5rem; padding-top: .45rem; border-top: 1px solid rgba(22,65,148,.1); color: var(--app-muted); line-height: 1.45; }
.course-dialogue-line.is-reply .course-dialogue-bubble small[data-dialogue-translation] { border-top-color: rgba(181,47,85,.1); }
.course-block-vocabulary-section { margin: 1.5rem 0; }
.course-block-vocabulary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.course-block-vocabulary > div { display: flex; flex-direction: column; padding: .85rem; border: 1px solid var(--app-line); border-radius: .75rem; background: #fff; }
.course-block-vocabulary span { color: var(--app-muted); font-size: .85rem; }
.course-block-exercise { --course-exercise-padding: 1.5rem; --course-exercise-anchor-left: -2.3rem; position: relative; isolation: isolate; overflow: hidden; margin: 3rem 0; padding: var(--course-exercise-padding); border: 1px solid rgba(22,65,148,.2); border-radius: 1.35rem; background: linear-gradient(145deg, rgba(22,65,148,.115) 0%, rgba(248,251,255,.97) 42%, rgba(255,255,255,.98) 100%); box-shadow: 0 16px 42px rgba(22,65,148,.1); }
.course-block-exercise::before { content: ""; position: absolute; inset: 0 0 auto; z-index: -1; height: .28rem; border-radius: 1.35rem 1.35rem 0 0; background: linear-gradient(90deg, var(--app-primary), #4f7fe0 55%, #6da5ef); }
.course-block-exercise::after { content: ""; position: absolute; top: -8rem; right: -7rem; z-index: -1; width: 16rem; height: 16rem; border-radius: 50%; background: radial-gradient(circle, rgba(75,126,224,.16), rgba(75,126,224,0) 68%); pointer-events: none; }
.course-exercise-header { position: relative; margin-bottom: 1.2rem; }
.course-exercise-kicker { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .45rem 1rem; margin-bottom: .65rem; color: var(--app-muted); font-size: .67rem; font-weight: 800; text-transform: uppercase; letter-spacing: .075em; }
.course-exercise-kicker > span:first-child { display: inline-flex; align-items: center; gap: .38rem; color: var(--app-primary-dark); }
.course-exercise-kicker > span:first-child i { width: 1.45rem; height: 1.45rem; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--app-primary); font-size: .58rem; box-shadow: 0 4px 12px rgba(22,65,148,.2); }
.course-exercise-kicker > span:last-child { padding: .28rem .52rem; border: 1px solid rgba(22,65,148,.14); border-radius: 999px; background: rgba(255,255,255,.7); }
.course-exercise-header .course-section-anchor { color: var(--app-ink); font-size: 1.32rem; font-weight: 790; }
.course-exercise-header .course-section-anchor > span { display: inline-flex; align-items: center; gap: .55rem; }
.course-exercise-header .course-section-anchor > span > i { width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: .62rem; color: var(--app-primary); background: rgba(255,255,255,.78); box-shadow: 0 5px 14px rgba(22,65,148,.08); font-size: .9rem; }
.course-exercise-header .course-section-anchor-icon { left: var(--course-exercise-anchor-left); }
.course-exercise-header:hover .course-section-anchor-icon, .course-exercise-header:focus-within .course-section-anchor-icon { left: calc(var(--course-exercise-anchor-left) - .3rem); color: var(--app-primary); opacity: .5; }
.course-exercise-header p { margin: .5rem 0 0 2.55rem; color: var(--app-muted); font-size: .86rem; }
.course-exercise-questions { display: grid; gap: 1rem; }
.course-exercise-question { padding: 1.05rem; border: 1px solid rgba(22,65,148,.13); border-radius: .95rem; background: rgba(255,255,255,.94); box-shadow: 0 8px 22px rgba(22,65,148,.055); }
.course-exercise-question-heading { display: flex; align-items: flex-start; gap: .65rem; margin-bottom: .85rem; }
.course-exercise-question-heading > span { flex: 0 0 auto; display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; color: var(--app-primary); background: rgba(22,65,148,.08); font-size: .65rem; font-weight: 800; }
.course-exercise-question h4 { margin: .18rem 0 0; font-size: 1rem; line-height: 1.45; font-weight: 740; }
.course-exercise-options { display: grid; gap: .5rem; }
.course-exercise-option { width: 100%; display: grid; grid-template-columns: 1.8rem minmax(0,1fr) 1rem; align-items: center; gap: .65rem; padding: .65rem .75rem; color: var(--app-ink); border: 1px solid var(--app-line); border-radius: .7rem; background: #fff; text-align: left; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease; }
.course-exercise-option:not(:disabled):hover, .course-exercise-option:not(:disabled):focus-visible { border-color: rgba(22,65,148,.46); background: rgba(22,65,148,.045); box-shadow: 0 7px 18px rgba(22,65,148,.09); transform: translateY(-1px); outline: 0; }
.course-exercise-option:disabled { cursor: default; }
.course-exercise-option-letter { display: grid; place-items: center; width: 1.65rem; height: 1.65rem; border-radius: .45rem; color: var(--app-primary); background: rgba(22,65,148,.08); font-size: .68rem; font-weight: 800; }
.course-exercise-option > i { color: #a0a8b8; font-size: .72rem; }
.course-exercise-option.is-incorrect { color: #8d2630; border-color: rgba(190,52,65,.28); background: rgba(190,52,65,.055); }
.course-exercise-option.is-incorrect .course-exercise-option-letter { color: #a42a36; background: rgba(190,52,65,.1); }
.course-exercise-option.is-incorrect > i { color: #b5313e; }
.course-exercise-option.is-correct { color: #17623a; border-color: rgba(37,139,82,.32); background: rgba(37,139,82,.07); box-shadow: 0 5px 16px rgba(37,139,82,.07); }
.course-exercise-option.is-correct .course-exercise-option-letter { color: #17623a; background: rgba(37,139,82,.12); }
.course-exercise-option.is-correct > i { color: #258b52; }
.course-exercise-feedback { min-height: 1.2rem; margin: .7rem 0 0 3rem; color: #9a303b; font-size: .82rem; font-weight: 650; }
.course-exercise-feedback:empty { margin-top: 0; min-height: 0; }
.course-exercise-feedback.is-correct { color: #1d7445; }
.course-block-divider { margin: 2.5rem 0; border-color: var(--app-line); opacity: 1; }
.course-reader-footer { width: min(54rem, 100%); margin: 4rem auto 0; padding-top: 2rem; border-top: 1px solid var(--app-line); }
.course-reader-navigation { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 1rem; }
.course-reader-nav-slot { min-width: 0; display: flex; align-items: stretch; }
.course-reader-nav-slot.is-next { justify-content: flex-end; }
.course-reader-chapter-link { min-width: 0; max-width: 100%; display: inline-flex; align-items: center; gap: .45rem; padding: .6rem .8rem; border: 1px solid var(--app-line); border-radius: .8rem; color: var(--app-ink); background: #fff; font-size: .85rem; text-decoration: none; }
.course-reader-chapter-link > i { flex: 0 0 auto; font-size: .72rem; }
.course-reader-chapter-link strong { min-width: 0; line-height: 1.35; overflow-wrap: anywhere; }
.course-reader-chapter-number { flex: 0 0 auto; color: var(--app-primary); font-size: .72rem; font-weight: 800; }
.course-reader-chapter-link.is-planned { cursor: default; border-style: dashed; background: var(--app-surface-subtle); }
.course-reader-chapter-link.is-planned > * { opacity: .52; }
.course-reader-back-link { align-self: center; white-space: nowrap; }
.course-toc { position: fixed; right: clamp(1rem, 2.5vw, 2rem); bottom: max(1.25rem, env(safe-area-inset-bottom)); z-index: 50; display: flex; flex-direction: column; align-items: flex-end; }
.course-toc-toggle { width: 3rem; height: 3rem; display: grid; place-items: center; padding: 0; border: 1px solid var(--app-line); border-radius: 50%; color: var(--app-primary-dark); background: rgba(255,255,255,.92); box-shadow: 0 10px 30px rgba(18,55,124,.18); backdrop-filter: blur(14px); transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.course-toc-toggle:hover { color: #fff; border-color: var(--app-primary); background: var(--app-primary); box-shadow: 0 13px 34px rgba(18,55,124,.25); transform: translateY(-2px); }
.course-toc-toggle:focus-visible, .course-toc-close:focus-visible, .course-toc-link:focus-visible { outline: 3px solid rgba(22,65,148,.2); outline-offset: 2px; }
.course-toc.is-open .course-toc-toggle { color: #fff; border-color: var(--app-primary); background: var(--app-primary); }
.course-toc-panel { position: absolute; right: 0; bottom: calc(100% + .75rem); width: min(22rem, calc(100vw - 2rem)); max-height: min(68vh, 36rem); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--app-line); border-radius: 1.15rem; background: rgba(255,255,255,.97); box-shadow: 0 22px 58px rgba(18,55,124,.2); opacity: 0; transform: translateY(.55rem) scale(.98); transform-origin: bottom right; backdrop-filter: blur(18px); transition: opacity .18s ease, transform .18s ease; }
.course-toc-panel[hidden] { display: none; }
.course-toc.is-open .course-toc-panel { opacity: 1; transform: translateY(0) scale(1); }
.course-toc-header { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1rem .85rem 1.1rem; border-bottom: 1px solid var(--app-line); }
.course-toc-header > div { min-width: 0; display: flex; flex-direction: column; }
.course-toc-header span { color: var(--app-primary); font-size: .65rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.course-toc-header strong { font-size: 1.05rem; line-height: 1.3; }
.course-toc-close { flex: 0 0 auto; width: 2rem; height: 2rem; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; color: var(--app-muted); background: transparent; transition: color .16s ease, background-color .16s ease; }
.course-toc-close:hover { color: var(--app-primary-dark); background: rgba(22,65,148,.08); }
.course-toc-nav { min-height: 0; display: flex; flex-direction: column; gap: .16rem; padding: .65rem; overflow-y: auto; overscroll-behavior: contain; }
.course-toc-link { position: relative; min-width: 0; display: grid; grid-template-columns: 1rem minmax(0, 1fr); align-items: start; gap: .58rem; padding: .62rem .7rem; border-radius: .68rem; color: var(--app-ink); font-size: .79rem; line-height: 1.4; font-weight: 680; text-decoration: none; transition: color .16s ease, background-color .16s ease, transform .16s ease; }
.course-toc-link > i { margin-top: .18rem; color: #a0a8b8; font-size: .68rem; text-align: center; transition: color .16s ease; }
.course-toc-link > span { min-width: 0; overflow-wrap: anywhere; }
.course-toc-link.is-subsection { margin-left: .85rem; color: var(--app-muted); font-size: .75rem; font-weight: 620; }
.course-toc-link:hover { color: var(--app-primary-dark); background: rgba(22,65,148,.06); transform: translateX(2px); }
.course-toc-link:hover > i, .course-toc-link.is-active > i { color: var(--app-primary); }
.course-toc-link.is-active { color: var(--app-primary-dark); background: rgba(22,65,148,.1); }
.course-toc-link.is-active::before { content: ""; position: absolute; top: .48rem; bottom: .48rem; left: 0; width: .18rem; border-radius: 999px; background: var(--app-primary); }

@media (min-width: 768px) {
    .course-block-exercise { --course-exercise-anchor-left: -2rem; margin-right: -3rem; margin-left: -3rem; padding-right: 3rem; padding-left: 3rem; }
}

.command-reference-list { display: grid; gap: 1rem; }
.command-reference-card { min-width: 0; }
.command-reference-number, .command-reference-icon { flex: 0 0 auto; width: 2.35rem; height: 2.35rem; display: grid; place-items: center; border-radius: .75rem; color: var(--app-primary-dark); background: rgba(22, 65, 148, .1); font-weight: 800; }
.command-iterations-input { width: 4.5rem; min-height: 1.75rem; padding: .15rem .4rem; color: var(--app-primary-dark); font-weight: 700; text-align: center; }
.command-copy-group { min-width: 0; flex-wrap: nowrap; }
.command-reference-input { min-width: 0; padding-block: .8rem; color: #dbe7ff; border-color: #10224a; background: #10224a; font-family: var(--bs-font-monospace); font-size: .78rem; white-space: nowrap; }
.command-reference-input:focus { color: #fff; border-color: var(--app-primary); background: #10224a; box-shadow: 0 0 0 .2rem rgba(22, 65, 148, .2); }
.command-reference-input[readonly] { cursor: text; }
.command-copy-button { flex: 0 0 auto; min-width: 6.5rem; }
.command-argument-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.command-argument-grid > div { min-width: 0; padding: .75rem; border: 1px solid #e8e9f1; border-radius: .75rem; background: #fbfcff; }
.command-argument-grid dt { margin-bottom: .25rem; font-size: .78rem; overflow-wrap: anywhere; }
.command-argument-grid dd { margin: 0; color: var(--app-muted); font-size: .78rem; line-height: 1.4; }
.ai-compact-toolbar { padding: 1rem 1.15rem; border-bottom: 1px solid #e8e9f1; }
.ai-queue-search { max-width: 48rem; }
[data-ai-queue-results] { transition: opacity .15s ease; }
[data-ai-queue-results].is-ai-queue-loading { opacity: .45; pointer-events: none; }
.ai-compact-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem 1rem; color: var(--app-muted); font-size: .72rem; }
.ai-compact-legend-item { display: inline-flex; align-items: center; gap: .35rem; }
.ai-compact-legend-dot { width: .55rem; height: .55rem; border-radius: 50%; background: #d5dae5; }
.ai-compact-legend-dot.is-ready { background: #3a9a63; }
.ai-compact-legend-dot.is-review { background: #e6a700; }
.ai-compact-legend-dot.is-error { background: #d83b4b; }
.ai-compact-list { display: grid; }
.ai-compact-row { min-width: 0; display: grid; grid-template-columns: minmax(13rem, 1.05fr) minmax(28rem, 2fr) auto; align-items: center; gap: 1rem; padding: .7rem 1rem; border-bottom: 1px solid #eceef4; }
.ai-compact-row:last-child { border-bottom: 0; }
.ai-compact-row:hover { background: #fafbfe; }
.ai-compact-source { min-width: 0; display: flex; align-items: center; gap: .65rem; }
.ai-compact-source-flag { flex: 0 0 auto; display: grid; place-items: center; min-width: 2.15rem; height: 2.15rem; padding: .2rem; border-radius: .65rem; background: #f0f3f9; font-size: 1.05rem; }
.ai-compact-source-copy { min-width: 0; }
.ai-compact-source-text { font-weight: 750; line-height: 1.25; overflow-wrap: anywhere; }
.ai-compact-source-meta { margin-top: .15rem; color: var(--app-muted); font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-compact-languages { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: .38rem; }
.ai-language-chip { position: relative; width: 2.35rem; height: 2.35rem; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .05rem; padding: .15rem; border: 1px solid #dce1eb; border-radius: .65rem; color: var(--app-ink); background: #fff; line-height: 1; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.ai-language-chip:hover, .ai-language-chip:focus-visible { z-index: 1; transform: translateY(-1px); outline: 0; box-shadow: 0 5px 14px rgba(18,55,124,.13); }
.ai-language-chip-flag { font-size: 1rem; }
.ai-language-chip-code { color: var(--app-muted); font-size: .52rem; font-weight: 850; letter-spacing: .04em; }
.ai-language-chip::after { position: absolute; top: -.18rem; right: -.18rem; width: .52rem; height: .52rem; border: 2px solid #fff; border-radius: 50%; content: ""; background: #d5dae5; }
.ai-language-chip.is-ready { border-color: rgba(48,132,83,.35); background: #f5fbf7; }
.ai-language-chip.is-ready::after { background: #3a9a63; }
.ai-language-chip.is-review { border-color: #e6a700; background: #fff9e6; box-shadow: inset 0 0 0 1px rgba(230,167,0,.18); }
.ai-language-chip.is-review::after { background: #e6a700; }
.ai-language-chip.is-error { border-color: #d83b4b; background: #fff1f2; box-shadow: inset 0 0 0 1px rgba(216,59,75,.15); }
.ai-language-chip.is-error::after { background: #d83b4b; }
.ai-language-chip.is-empty { opacity: .42; filter: grayscale(.7); }
.ai-compact-actions { display: flex; align-items: center; justify-content: flex-end; gap: .35rem; }
.ai-compact-actions form { margin: 0; }
.ai-compact-actions .btn { width: 2rem; height: 2rem; display: inline-grid; place-items: center; padding: 0; }
.ai-language-popover { --bs-popover-max-width: 25rem; --bs-popover-border-color: #dfe3ec; --bs-popover-header-bg: #f6f8fc; box-shadow: 0 12px 35px rgba(18,55,124,.16); }
.ai-language-popover .popover-body { font-size: .78rem; line-height: 1.4; }
.ai-popover-title { margin-bottom: .4rem; font-size: .88rem; font-weight: 800; }
.ai-popover-meta { display: flex; flex-wrap: wrap; gap: .25rem .65rem; margin-top: .5rem; color: var(--app-muted); }
.ai-popover-note { margin-top: .5rem; padding: .45rem .55rem; border-radius: .5rem; color: #6f5100; background: #fff4cc; }
.ai-popover-note.is-error { color: #842029; background: #f8d7da; }
.ai-popover-representations { display: grid; gap: .12rem; margin-top: .45rem; padding-top: .4rem; border-top: 1px solid #eceef4; }
.stat-card { height: 100%; padding: 1.25rem; }
.stat-icon { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border-radius: .9rem; color: var(--app-primary-dark); background: rgba(22, 65, 148, .1); }
.stat-value { margin-top: 1rem; font-size: 2rem; font-weight: 800; }
.table > :not(caption) > * > * { padding: .85rem .9rem; vertical-align: middle; }
.table thead th { color: var(--app-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; border-bottom-width: 1px; }
.translation-admin-block { border: 1px solid #e8e9f1; border-radius: 1rem; overflow: hidden; }
.translation-admin-title { padding: .8rem 1rem; background: #f7f6fc; font-weight: 750; }
.translation-admin-fields { padding: 1rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.ai-translation-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin-top: -.35rem; }
.ai-translation-status { font-size: .82rem; font-weight: 600; }
.v2-filter-form .form-label { margin-bottom: .25rem; color: var(--app-muted); font-weight: 700; }
.v2-progress-summary { border-top: 1px solid #e8e9f1; }
.v2-progress-bar { height: .9rem; display: flex; overflow: hidden; border-radius: 999px; background: #eef1f6; box-shadow: inset 0 1px 2px rgba(18,55,124,.1); }
.v2-progress-segment { min-width: 0; height: 100%; transition: width .2s ease; }
.v2-progress-segment.is-complete, .v2-progress-swatch.is-complete { background: #3a9a63; }
.v2-progress-segment.is-awaiting, .v2-progress-swatch.is-awaiting { background: #e6a700; }
.v2-progress-segment.is-missing, .v2-progress-swatch.is-missing { background: #d83b4b; }
.v2-progress-segment.is-not-started, .v2-progress-swatch.is-not-started { background: #d5dae5; }
.v2-progress-legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem 1rem; color: var(--app-muted); font-size: .72rem; }
.v2-progress-legend-item { min-width: 0; display: flex; align-items: flex-start; gap: .4rem; line-height: 1.35; }
.v2-progress-legend-item strong { color: var(--app-ink); white-space: nowrap; }
.v2-progress-swatch { flex: 0 0 auto; width: .65rem; height: .65rem; margin-top: .14rem; border-radius: .2rem; }
.v2-dictionary-table td { vertical-align: top; }
.v2-dictionary-table .ai-language-chip { width: 2.2rem; height: 2.2rem; }
.v2-source-info-badge { cursor: help; }
.v2-detail-page { padding-top: .35rem; }
.v2-data-list dt { padding-top: .45rem; color: var(--app-muted); }
.v2-data-list dd { min-width: 0; padding-top: .45rem; }
.v2-json { max-width: 100%; max-height: 18rem; margin: 0; padding: .8rem; border-radius: .65rem; color: #dbe7ff; background: #10224a; font-size: .75rem; white-space: pre-wrap; overflow: auto; }
.v2-expression-card { scroll-margin-top: 1rem; overflow: hidden; }
.v2-expression-origin { border-color: rgba(22, 65, 148, .38); box-shadow: inset .28rem 0 0 var(--app-primary), 0 8px 30px rgba(18, 55, 124, .05); }
.v2-expression-archived { border-style: dashed; opacity: .82; }
.v2-expression-archived .v2-expression-header { background: #f0f1f4; }
.v2-expression-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid #e1e6f0; background: linear-gradient(135deg, #f8faff, #f2f5fb); }
.v2-expression-header > div { min-width: 0; }
.v2-expression-header h2 { line-height: 1.25; overflow-wrap: anywhere; }
.v2-expression-header .btn { flex: 0 0 auto; }
.v2-parameter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.v2-parameter-grid > div { display: flex; flex-direction: column; gap: .18rem; padding: .8rem; border: 1px solid #e8e9f1; border-radius: .75rem; background: #fbfcff; }
.v2-parameter-grid small { color: var(--app-muted); font-weight: 700; }
.v2-expression-card .table-responsive { border-radius: .75rem; }
.v2-expression-card details summary { color: var(--app-primary-dark); cursor: pointer; }

@media (max-width: 991.98px) {
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; width: 100%; height: auto; }
    .admin-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .admin-nav > a { justify-content: center; }
    .admin-nav > a span, .admin-nav-toggle .admin-nav-label, .admin-nav-toggle .admin-nav-chevron { display: none; }
    .admin-nav-toggle { justify-content: center; }
    .admin-nav-submenu { margin-left: 0; padding-left: 0; border-left: 0; }
    .admin-nav-submenu a { justify-content: center; padding-inline: .25rem; font-size: .7rem; }
    .ai-compact-row { grid-template-columns: minmax(13rem, .8fr) minmax(24rem, 1.5fr) auto; }
    .command-argument-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .v2-progress-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .course-admin-course-grid, .course-chapter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .course-editor-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .course-editor-title-field, .course-editor-summary-field { grid-column: 1 / -1; }
    .course-editor-dialogue-repeater .course-editor-repeater-row { grid-template-columns: 2rem minmax(7rem, .45fr) minmax(10rem, 1fr) 2rem; }
    .course-editor-dialogue-repeater .course-editor-repeater-row .editor-floating-field:nth-of-type(3) { grid-column: 2 / 4; }
    .course-editor-savebar { left: 1rem; right: 1rem; }
}

@media (min-width: 768px) {
    .polish-phrase { margin: clamp(0rem, 14vh, 2.5rem) 0 clamp(1.25rem, 3vh, 2rem); }
    .flashcard-stage.has-open-translation .polish-phrase { margin: clamp(0rem, 14vh, 1.5rem) 0 clamp(1.25rem, 3vh, 2rem); }
    .translation-info-heading { pointer-events: none; }
}

@media (max-width: 767.98px) {
    .command-reference-card { padding: 1rem !important; }
    .command-copy-button { min-width: auto; }
    .command-copy-button [data-copy-label] { display: none; }
    .command-copy-button i { margin-right: 0 !important; }
    .command-argument-grid { grid-template-columns: 1fr; }
    .flashcard-toolbar { gap: .55rem; }
    .flashcard-toolbar.has-open-search { grid-template-columns: minmax(0, 1fr) auto; }
    .flashcard-toolbar.has-open-search .toolbar-group { width: 100%; min-width: 0; }
    .flashcard-toolbar.has-open-search .learning-mode-switch { display: none; }
    .flashcard-toolbar.has-open-search .toolbar-user-menu { grid-column: 2; }
    .learning-mode-switch a { min-width: 4.25rem; padding-inline: .55rem; }
    .flashcard-search.is-open { width: calc(100vw - 8.5rem); }
    .flashcard-toolbar.has-open-search .flashcard-search.is-open { width: 100%; }
    .flashcard-stage { align-items: start; padding: .5rem 3.2rem 1.5rem; }
    .flashcard-card { min-height: calc(100vh - 7.5rem); border-radius: 1.35rem; }
    .flashcard-meta { align-items: center; justify-content: space-between; }
    .flashcard-content {
        min-height: calc(100vh - 14rem);
        min-height: calc(100dvh - 14rem);
    }
    .current-category { width: 100%; margin-left: 0; }
    .polish-phrase { margin: 2rem 0 1rem; }
    .language-reveal-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; }
    .language-reveal { padding: .6rem .35rem; border-radius: .85rem; }
    .pronunciation-grid, .translation-admin-fields, .v2-parameter-grid { grid-template-columns: 1fr; }
    .difficulty-label { display: none; }
    .translation-info-panel-wide { grid-column: auto; }
    .translation-info-heading { cursor: pointer; }
    .translation-collapse-chevron { display: inline-block; }
    .translation-info-panel:not([open]) .translation-note-hint { display: none; }
    .v2-expression-header { align-items: flex-start; padding: 1rem; }
    .card-nav { width: 2.7rem; height: 4.5rem; }
    .language-options { grid-template-columns: 1fr; }
    .admin-page-header { align-items: flex-start; flex-direction: column; }
    .ai-compact-row { grid-template-columns: 1fr auto; gap: .65rem; }
    .ai-compact-languages { grid-column: 1 / -1; grid-row: 2; }
    .ai-compact-actions { grid-column: 2; grid-row: 1; }
    .v2-progress-legend { grid-template-columns: 1fr; }
    .course-stage { align-items: start; padding: .5rem .75rem 1.5rem; }
    .course-card { --course-card-padding: 1.2rem; min-height: calc(100vh - 7.5rem); border-radius: 1.35rem; }
    .course-card-topline, .course-overview-heading, .course-admin-language-header { align-items: flex-start; flex-direction: column; }
    .course-chapter-grid, .course-admin-course-grid, .course-block-vocabulary { grid-template-columns: 1fr; }
    .course-overview-heading { margin-top: 2rem; }
    .course-outline-link { align-self: flex-start; }
    .course-editor-header-actions { width: 100%; justify-content: flex-start; }
    .course-editor-settings-grid, .course-editor-advanced-grid { grid-template-columns: 1fr; }
    .course-editor-title-field, .course-editor-summary-field { grid-column: auto; }
    .course-editor-block-header { grid-template-columns: auto auto minmax(0, 1fr) auto; gap: .4rem; }
    .course-editor-block-icon, .course-editor-block-state { display: none; }
    .course-editor-block-menu { grid-column: 3 / -1; justify-content: flex-end; }
    .course-editor-repeater-row, .course-editor-vocabulary-repeater .course-editor-repeater-row, .course-editor-dialogue-repeater .course-editor-repeater-row { grid-template-columns: 1.75rem minmax(0, 1fr) 2rem; }
    .course-editor-repeater-row .editor-floating-field, .course-editor-dialogue-repeater .course-editor-repeater-row .editor-floating-field:nth-of-type(3) { grid-column: 2 / 3; }
    .course-editor-repeater-row [data-remove-row] { grid-column: 3; grid-row: 1; }
    .course-editor-savebar { align-items: flex-start; flex-direction: column; }
    .course-editor-savebar small { display: none; }
    .course-dialogue-line { width: 94%; }
    .course-dialogue-avatar { width: 1.9rem; height: 1.9rem; font-size: .68rem; }
    .course-block-exercise { --course-exercise-padding: .9rem; --course-exercise-anchor-left: -1.7rem; }
    .course-exercise-question { padding: .85rem; }
    .course-exercise-header p { margin-left: 0; }
    .course-dialogue-actions.btn-group { width: 100%; justify-content: flex-start; }
    .course-reader-footer { padding-bottom: 3.75rem; }
    .course-reader-navigation { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
    .course-reader-back-link { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
    .course-toc { right: 1rem; bottom: max(1rem, env(safe-area-inset-bottom)); }
    .course-toc-panel { width: calc(100vw - 2rem); max-height: min(72vh, 34rem); }
}

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

@media (prefers-reduced-motion: reduce) {
    .flashcard-stage { transition: none; }
    .flashcard-stage.card-arrives-from-left,
    .flashcard-stage.card-arrives-from-right { animation: none; }
    .course-toc-toggle, .course-toc-panel, .course-toc-link { transition: none; }
}
