/* Koreyscha — "Modernist" design (Claude Design, direction 1a "Grid", D-25).
   Archivo + Noto Sans KR, 0 radius, 2px rules, one red accent used only for actions — never to mean "wrong".
   Light is the default; dark follows the device setting (prefers-color-scheme). data-theme on <html> forces one
   of them; the Settings choice (spec §4.7) sets it in a later stage. */
:root {
    --color-bg: #f3f2f2;
    --color-surface: #eae9e9;
    --color-text: #201e1d;
    --color-accent: #ec3013;
    --color-divider: color-mix(in srgb, #201e1d 40%, transparent);
    --color-rule-soft: color-mix(in srgb, #201e1d 22%, transparent);
    --color-muted: #605d5d;
    --color-accent-100: #fff2ef;
    --color-accent-600: #dd2b0f;
    --color-accent-700: #ae1800;
    --color-accent-800: #7c1405;
    --color-neutral-100: #f8f4f4;
    --color-neutral-300: #d7d3d3;
    --color-neutral-400: #bab6b6;
    --color-neutral-500: #9b9797;
    --color-neutral-600: #7d7979;
    --color-neutral-800: #444141;
    --color-accent-400: #ff9783;
    --color-accent-900: #4d170e;
    --color-warn: #ae1800;
    --color-on-accent: #ffffff;
    --shadow-lg: 0 12px 32px color-mix(in srgb, #2d2b2b 22%, transparent);

    --font-heading: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-body: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-ko: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;

    --tabbar-height: 64px;
    --gutter: 20px;
    color-scheme: light;
}

[data-theme="dark"] {
    --color-bg: #191817;
    --color-surface: #242221;
    --color-text: #eeebea;
    --color-divider: color-mix(in srgb, #eeebea 32%, transparent);
    --color-rule-soft: color-mix(in srgb, #eeebea 18%, transparent);
    --color-muted: #b3afae;
    --color-accent: #f0442a;
    --color-accent-100: #3a1d17;
    --color-accent-600: #ff563c;
    --color-accent-700: #ff9783;
    --color-accent-800: #ffc4b8;
    --color-neutral-100: #2d2b2b;
    --color-neutral-300: #3a3837;
    --color-neutral-400: #555251;
    --color-neutral-500: #7d7979;
    --color-neutral-600: #9b9797;
    --color-neutral-800: #d7d3d3;
    --color-accent-400: #ff9783;
    --color-accent-900: #ffc4b8;
    --color-warn: #ff9783;
    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --color-bg: #191817;
        --color-surface: #242221;
        --color-text: #eeebea;
        --color-divider: color-mix(in srgb, #eeebea 32%, transparent);
        --color-rule-soft: color-mix(in srgb, #eeebea 18%, transparent);
        --color-muted: #b3afae;
        --color-accent: #f0442a;
        --color-accent-100: #3a1d17;
        --color-accent-600: #ff563c;
        --color-accent-700: #ff9783;
        --color-accent-800: #ffc4b8;
        --color-neutral-100: #2d2b2b;
        --color-neutral-300: #3a3837;
        --color-neutral-400: #555251;
        --color-neutral-500: #7d7979;
        --color-neutral-600: #9b9797;
        --color-neutral-800: #d7d3d3;
        --color-accent-400: #ff9783;
        --color-accent-900: #ffc4b8;
        --color-warn: #ff9783;
        color-scheme: dark;
    }
}

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

html, body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--color-accent-700); text-underline-offset: 3px; }
a:hover { color: var(--color-accent); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

h1, h2, h3 { font-family: var(--font-heading); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: 34px; margin: 4px 0 14px; outline: none; }
/* Blazor moves focus to the page title after navigation for screen readers; that is not a keyboard focus to frame. */
h1:focus, h1:focus-visible, [tabindex="-1"]:focus { outline: none; }
h2 { font-size: 20px; margin: 0 0 8px; }
h3 { font-size: 17px; margin: 12px 0 6px; }
p { margin: 0 0 10px; }

[lang="ko"], .ko { font-family: var(--font-ko); word-break: keep-all; overflow-wrap: anywhere; }
.ko { font-size: 20px; }
.ko.big { font-size: 26px; font-weight: 700; line-height: 1.2; }

.muted { color: var(--color-muted); }
.small-text { font-size: 14px; }
.kicker {
    display: block;
    font: 600 11px/1.2 var(--font-body);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--color-muted);
    margin: 0 0 6px;
}
.kicker.accent { color: var(--color-accent-700); }

.shell { min-height: 100dvh; }

.content {
    max-width: 640px;
    margin: 0 auto;
    padding: 12px var(--gutter) calc(var(--tabbar-height) + 28px + env(safe-area-inset-bottom));
}

/* Page header: kicker + big title, closed by a 2px rule (the design's grid). */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin: 0 calc(-1 * var(--gutter)) 0;
    padding: 4px var(--gutter) 12px;
    border-bottom: 2px solid var(--color-divider);
}
.page-head h1 { margin: 0; }
.avatar {
    flex: none;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-text);
    color: var(--color-bg);
    font: 800 17px var(--font-heading);
    text-decoration: none;
}
.avatar:hover { color: var(--color-bg); opacity: .9; }

.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; text-decoration: none; color: var(--color-text); }
.back:hover { color: var(--color-accent); }

/* Sections: rule-separated blocks, not rounded boxes. */
.card {
    background: transparent;
    border-top: 2px solid var(--color-divider);
    padding: 16px 0 14px;
    margin: 0;
}
.card + .card { margin-top: 0; }
.card:first-child { border-top: 0; }
h1 + .card, p + .card, .notice + .card { border-top: 2px solid var(--color-divider); }
.page-head + .card { border-top: 0; }

.notice {
    background: var(--color-accent-100);
    color: var(--color-text);
    padding: 12px 16px;
    margin: 10px 0;
    border-left: 4px solid var(--color-accent);
}
.notice code { font-size: 13px; }

/* Buttons: square, heavy labels. Primary = the one red action on a screen. */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 0 20px;
    border: 2px solid var(--color-divider);
    border-radius: 0;
    background: transparent;
    color: var(--color-text);
    font: 800 16px/1.2 var(--font-heading);
    text-decoration: none;
    cursor: pointer;
    margin: 4px 8px 4px 0;
}
.button:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); color: var(--color-text); }
.button.primary {
    background: var(--color-accent);
    color: var(--color-on-accent);
    border-color: var(--color-accent);
    min-height: 56px;
    font-size: 17px;
}
.button.primary:hover { background: var(--color-accent-600); border-color: var(--color-accent-600); color: var(--color-on-accent); }
.button.small { min-height: 44px; padding: 0 14px; font-size: 14px; border-width: 1px; }
.button.block { display: flex; width: 100%; justify-content: space-between; text-align: left; margin: 8px 0 0; }
.button .aside { font: 400 14px var(--font-body); color: var(--color-muted); white-space: nowrap; }
.button.primary .aside { color: color-mix(in srgb, var(--color-on-accent) 80%, transparent); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.selected { background: var(--color-accent); color: var(--color-on-accent); border-color: var(--color-accent); }
.arrow { width: 20px; height: 20px; flex: none; }

.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }

/* Number rows: label left, value right, hairline rules. */
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.facts dt { color: var(--color-muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts.stats { grid-template-columns: 1fr auto; gap: 0; border-top: 2px solid var(--color-divider); }
.facts.stats dt, .facts.stats dd { padding: 12px 0; border-bottom: 1px solid var(--color-rule-soft); color: var(--color-text); }
.facts.stats dd { text-align: right; white-space: nowrap; font: 800 16px var(--font-heading); padding-left: 16px; }

/* Stat cells (Bugun): big numbers in a ruled grid. */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0 calc(-1 * var(--gutter));
    border-top: 2px solid var(--color-divider);
    border-bottom: 2px solid var(--color-divider);
}
.stat-grid > div { padding: 12px; border-right: 1px solid var(--color-divider); }
.stat-grid > div:first-child { padding-left: var(--gutter); }
.stat-grid > div:last-child { border-right: 0; }
.stat-grid b { display: block; font: 800 30px/1 var(--font-heading); }
.stat-grid span { display: block; font-size: 13px; color: var(--color-muted); margin-top: 4px; }

/* Segmented control (minutes, direction, counts). */
.seg {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    border: 1px solid var(--color-divider);
    margin: 8px 0;
}
.seg > button {
    min-height: 44px;
    padding: 0 0 0 10px;
    text-align: left;
    border: 0;
    border-right: 1px solid var(--color-divider);
    background: transparent;
    color: var(--color-text);
    font: 600 14px var(--font-body);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.seg > button:last-child { border-right: 0; }
.seg > button.selected { background: var(--color-accent); color: var(--color-on-accent); }
.seg > button:disabled { opacity: .45; }

/* Week strip (Bugun). */
.week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-top: 2px solid var(--color-divider);
}
.week > div { padding: 8px 0 8px 6px; border-right: 1px solid var(--color-divider); }
.week > div:last-child { border-right: 0; }
.week .d { font-size: 12px; }
.week .n { font: 800 17px var(--font-heading); }
.week .mark { width: 6px; height: 6px; margin-top: 4px; }
.week .mark.on { background: var(--color-accent); }
.week .today { background: var(--color-text); color: var(--color-bg); }

/* Numbered list rows (Mashq). */
.menu { margin: 0 calc(-1 * var(--gutter)); }
.menu a {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 20px;
    gap: 0 8px;
    align-items: center;
    min-height: 76px;
    padding: 12px 16px 12px var(--gutter);
    border-bottom: 1px solid var(--color-divider);
    color: var(--color-text);
    text-decoration: none;
}
.menu a:hover { background: var(--color-accent-100); color: var(--color-text); }
.menu .no { font: 800 14px var(--font-heading); color: var(--color-accent-700); }
.menu .t { display: block; font: 800 17px/1.2 var(--font-heading); }
.menu .s { display: block; font-size: 14px; color: var(--color-muted); margin-top: 2px; }
.menu .aside { display: block; font-size: 13px; color: var(--color-accent-700); margin-top: 4px; }
.menu.compact { border-top: 2px solid var(--color-divider); }
.menu.compact a { grid-template-columns: minmax(0, 1fr) 20px; min-height: 64px; }

.report {
    font-size: 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-divider);
    padding: 8px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-height: 240px;
    overflow: auto;
    user-select: all;
}

/* Tab bar (UI handoff): five cells, icon over a small label, both left-aligned; the active cell is red with a 3px
   bar along its top edge. */
.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    background: var(--color-bg);
    border-top: 2px solid var(--color-divider);
    padding-bottom: env(safe-area-inset-bottom);
}
.tab {
    min-height: var(--tabbar-height);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    padding: 0 2px 0 12px;
    font: 400 10px/1.1 var(--font-body);
    color: var(--color-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
}
.tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tab-icon { width: 20px; height: 20px; flex: none; }
@media (hover: hover) { .tab:hover { color: var(--color-accent); } }
.tab.active { color: var(--color-accent); font-weight: 700; box-shadow: inset 0 3px 0 var(--color-accent); }

.boot { padding: 30vh var(--gutter) 0; }
.boot-title { font: 800 34px/1 var(--font-heading); letter-spacing: -0.02em; }
.boot-text { color: var(--color-muted); margin-top: 8px; }

#blazor-error-ui {
    background: var(--color-accent-100);
    color: var(--color-text);
    bottom: 0;
    border-top: 2px solid var(--color-accent);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem calc(0.7rem + env(safe-area-inset-bottom));
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

/* Lists and review screens */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.link-card { display: block; color: inherit; text-decoration: none; }
.link-card:hover { background: var(--color-accent-100); color: inherit; }
.link-card p { margin: 6px 0 0; }
.link-card strong { font: 800 17px/1.25 var(--font-heading); }

.pill {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    padding: 3px 8px;
    background: var(--color-surface);
    color: var(--color-text);
    white-space: nowrap;
}
.pill-ok { background: var(--color-surface); color: var(--color-text); }
.pill-warn { background: var(--color-accent-100); color: var(--color-accent-700); }
.issues { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.issues li { line-height: 1.5; }
.pill-accent { background: var(--color-accent-100); color: var(--color-accent-700); }
.pill-dark { background: var(--color-text); color: var(--color-bg); }

.chips { display: flex; flex-wrap: wrap; gap: 0; margin: 8px 0; }
.chip {
    position: relative;
    min-width: 48px;
    min-height: 44px;
    margin: 0 -1px -1px 0;
    padding: 0 12px;
    border: 1px solid var(--color-divider);
    border-radius: 0;
    background: transparent;
    color: var(--color-text);
    font: 600 14px var(--font-body);
    text-align: left;
    cursor: pointer;
}
.chip:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.chip.selected { background: var(--color-text); color: var(--color-bg); font-weight: 800; }
.chip.done { color: var(--color-muted); }
.chip.selected.done { color: var(--color-bg); }
.chip .dot { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; background: var(--color-accent); }
.chip.wide { padding: 0 14px; }
.chip:disabled { opacity: .45; cursor: not-allowed; }

.toggle { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.toggle input { width: 20px; height: 20px; accent-color: var(--color-accent); }

.entry p { margin: 6px 0; }
.entry.excluded { opacity: .55; }
.warnings { margin: 4px 0 8px; padding-left: 18px; color: var(--color-warn); font-size: 14px; }
.raw {
    white-space: pre-wrap;
    font: 12px/1.5 ui-monospace, Menlo, monospace;
    background: var(--color-surface);
    border: 1px solid var(--color-divider);
    padding: 8px;
}
details summary { min-height: 36px; cursor: pointer; color: var(--color-muted); }

.entry label { display: block; margin: 8px 0; color: var(--color-muted); font-size: 13px; }
.input {
    display: block;
    width: 100%;
    margin-top: 5px;
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 0;
    border: 1px solid var(--color-divider);
    background: var(--color-surface);
    color: var(--color-text);
    caret-color: var(--color-accent);
    font: inherit;
    font-size: 16px;
}
.input:hover { border-color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline: 1px solid var(--color-accent); outline-offset: 0; }
textarea.input { min-height: 96px; resize: vertical; }

.plain { list-style: none; padding: 0; margin: 8px 0; }
.field { display: block; margin: 10px 0; color: var(--color-muted); font-size: 13px; }

/* Card practice */
.session-bar { display: flex; align-items: center; gap: 8px; margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 4px 8px; min-height: 56px; border-bottom: 2px solid var(--color-divider); }
.session-bar .close { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--color-text); }
.session-bar .count { font: 800 15px var(--font-heading); min-width: 44px; text-align: right; }
.progress { flex: 1; height: 4px; background: var(--color-divider); overflow: hidden; }
.progress > div { height: 100%; background: var(--color-accent); transition: width .25s; }

.flashcard { padding: 16px 0 8px; }
.flashcard .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.prompt { font: 800 36px/1.1 var(--font-heading); letter-spacing: -0.02em; margin: 0 0 6px; overflow-wrap: anywhere; }
.prompt.ko { font: 700 48px/1.15 var(--font-ko); letter-spacing: -0.01em; }
.reveal { border-top: 2px solid var(--color-divider); padding-top: 14px; margin-top: 14px; }
.answer { font: 800 26px/1.2 var(--font-heading); margin: 0 0 6px; overflow-wrap: anywhere; }
.answer.ko { font: 700 36px/1.2 var(--font-ko); }

/* Buttons stay above the tab bar, the keyboard and the iPhone home bar (spec UX04). */
.actions {
    position: sticky;
    bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom) + 8px);
    display: grid;
    gap: 8px;
    padding-top: 12px;
    background: var(--color-bg);
}
.button.big { width: 100%; min-height: 56px; margin: 0; justify-content: space-between; font-size: 17px; text-align: left; }
.button.big .small-text { font: 400 14px var(--font-body); color: var(--color-muted); }
.button.rate:hover { background: var(--color-accent-100); border-color: var(--color-accent); }

.toast {
    position: fixed;
    left: 12px;
    right: 12px;
    top: calc(env(safe-area-inset-top) + 12px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 6px 6px 6px 16px;
    background: var(--color-text);
    color: var(--color-bg);
    box-shadow: var(--shadow-lg);
    z-index: 30;
}
.toast .button { margin: 0; border: 0; color: var(--color-bg); text-decoration: underline; background: transparent; }

/* Settings and results */
.header-links { display: flex; gap: 14px; font-size: 15px; }
.header-links a { min-height: 44px; display: inline-flex; align-items: center; }
.big-number { font: 800 64px/1 var(--font-heading); letter-spacing: -0.03em; }
.big-number small { font-size: 28px; color: var(--color-muted); letter-spacing: -0.02em; }
.hard-word { padding: 10px 0; border-bottom: 1px solid var(--color-rule-soft); }
.hard-word:last-child { border-bottom: 0; }

.plain-list { list-style: none; padding: 0; margin: 8px 0; border-top: 2px solid var(--color-divider); }
.plain-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 52px; border-bottom: 1px solid var(--color-rule-soft); }
.verdict { font: 800 24px/1.2 var(--font-heading); }
.verdict-ok { color: var(--color-text); }
.verdict-warn { color: var(--color-accent-700); }
.sentence { font-family: var(--font-ko); font-size: 20px; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
.hint { background: var(--color-accent-100); padding: 12px 16px; margin: 10px 0; }
.hint .kicker { color: var(--color-accent-700); }

/* Section titles, lists of recent answers, pager. */
.section-title { margin: 22px 0 0; padding-bottom: 8px; border-bottom: 2px solid var(--color-divider); }
.menu .aside.done { color: var(--color-muted); }
.recent li { padding: 8px 0; }
.recent .sentence { font-size: 17px; flex: 1 1 100%; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }

/* Strong asides, question-and-answer rows, scrolling filter chips. */
.menu .aside.strong { color: var(--color-text); font-weight: 700; }
.qa { padding: 12px 0; border-bottom: 1px solid var(--color-rule-soft); }
.qa .q { font-weight: 700; margin-bottom: 6px; }
.qa .sentence { margin: 8px 0 0; font-size: 18px; }
.filter-row { flex-wrap: nowrap; overflow-x: auto; margin: 10px calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter); scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-row .chip { flex: none; min-height: 40px; font-size: 14px; padding: 0 12px; }

/* Pronunciation buttons (D-29). */
.speak { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 8px; flex-wrap: wrap; }
.speak-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 48px; min-height: 48px; padding: 0 10px;
    border: 1px solid var(--color-divider); background: transparent; color: var(--color-text);
    font: 700 14px var(--font-body); cursor: pointer;
}
.speak-btn:hover { background: var(--color-accent-100); }
.speak-btn:active { background: var(--color-text); color: var(--color-bg); }
.speak-btn.slow { border-width: 1px; color: var(--color-muted); }
.speak-note { font-size: 13px; color: var(--color-muted); }

/* Tests (D-30). */
.test-question { padding: 16px 0 8px; }
.test-question .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.sentence.big { font-size: 24px; line-height: 1.55; margin: 6px 0 8px; }
.blank { display: inline-block; min-width: 4em; border-bottom: 3px solid var(--color-accent); margin: 0 4px; }
.options { display: grid; gap: 10px; margin-top: 14px; }
.button.option { justify-content: flex-start; text-align: left; min-height: 56px; font-size: 18px; margin: 0; white-space: normal; }
.button.option[lang="ko"] { font-family: var(--font-ko); font-size: 20px; }
.button.option.chosen { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }
.mistakes { list-style: none; padding: 0; margin: 0; }
.mistakes li { padding: 14px 0; border-bottom: 1px solid var(--color-rule-soft); }
.mistakes .sentence { font-size: 19px; }

/* Speaking practice (D-32). */
.sayit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 4px 0 8px; }
.sayit.compact { display: inline-flex; margin: 0; }
.speak-btn.mic { gap: 6px; }
.speak-btn.rec { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-on-accent); gap: 8px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; animation: rec-blink 1s infinite; }
@keyframes rec-blink { 50% { opacity: .25; } }
.speak-note.warn { color: var(--color-accent-700); flex-basis: 100%; margin: 0; }
.pron { flex-basis: 100%; border-top: 1px solid var(--color-rule-soft); padding-top: 10px; }
.pron-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.pron-score { font: 800 40px/1 var(--font-heading); }
.pron-words { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; font-family: var(--font-ko); font-size: 18px; }
.pron-word { padding: 4px 8px; border: 2px solid var(--color-divider); }
.pron-word small { font: 600 12px var(--font-body); color: var(--color-muted); }
/* Marked by line style and the score text, never by red (D-25: red means an action, not "wrong"). */
.pron-word.good { border-color: var(--color-text); }
.pron-word.mid { border-style: dashed; }
.pron-word.bad { border-style: dashed; border-color: var(--color-text); background: var(--color-surface); }
.pron-word.extra { border-style: dotted; color: var(--color-muted); }

/* Shared bits: the study timer, hints and reveal sections. */
.timer { font: 800 22px/1 var(--font-heading); font-variant-numeric: tabular-nums; padding: 4px 10px; border: 2px solid var(--color-text); }
.timer.low { background: var(--color-text); color: var(--color-bg); }
.hint { background: var(--color-surface); padding: 10px 12px; margin: 8px 0; }
.hint .kicker { display: block; margin-bottom: 4px; color: var(--color-muted); }
.reveal summary { cursor: pointer; font-weight: 700; padding: 6px 0; }

.today-stats { display: flex; gap: 18px; margin: 2px 0 10px; }
.today-stats b { font: 800 28px/1 var(--font-heading); display: block; }
.today-stats span { font-size: 13px; color: var(--color-muted); }

/* Reminder time as hour and minute lists (D-44). */
.time-select { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.time-select .input { width: auto; min-width: 84px; margin-top: 0; }
/* iOS gives native date inputs a fixed width that pushed past the screen. */
input.input[type="datetime-local"], input.input[type="date"], input.input[type="time"] { -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; box-sizing: border-box; text-align: left; }

/* Word usage (D-46): phrases, the Uzbek trap, an example. */
.usage-note { margin-top: 8px; font-size: 14px; line-height: 1.5; }
.usage-note p { margin: 6px 0; }
.usage-trap { padding: 8px 10px; border-left: 3px solid var(--color-text); background: var(--color-surface); }
.usage-phrases { list-style: none; padding: 0; margin: 6px 0; }
.usage-phrases li { padding: 2px 0; }
.usage-example span[lang="ko"] { font-size: 15px; }
.usage-uz { font-size: 18px; font-weight: 600; margin: 6px 0 10px; }
.usage-tables { list-style: none; padding: 0; margin: 8px 0 0; }
.usage-tables li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--color-divider); }
.usage-tables .grow { flex: 1; min-width: 0; font-size: 14px; }

/* Sentence ladder (D-47). */
.ladder-steps { padding-left: 20px; margin: 8px 0; line-height: 1.5; }
.ladder-steps li { margin: 6px 0; }
.ladder-feedback { margin-top: 14px; }
.ladder-feedback.ok > strong { color: var(--color-text); }
.ladder-feedback.bad > strong { color: var(--color-accent); }
.order-built { display: flex; flex-wrap: wrap; gap: 8px; min-height: 56px; padding: 10px; margin: 10px 0; border: 1px dashed var(--color-divider); align-items: center; }
.ladder-scores { list-style: none; padding: 0; margin: 10px 0; }
.ladder-scores li { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--color-divider); }

/* Preformatted text and ladder score rows. */
.pre { white-space: pre-wrap; }
.ladder-scores li { gap: 12px; }
.ladder-scores li > strong { white-space: nowrap; flex: none; }

/* Listening (D-53) */
.listen-controls { display: flex; gap: 10px; margin: 14px 0 6px; }
.listen-controls .button { margin: 0; }
.listen-controls .button.primary { flex: 1; }
.listen-options { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.listen-options li { padding: 10px 12px; border: 1px solid var(--color-rule-soft); font-family: var(--font-ko); font-size: 18px; }
.listen-options li.right { border-color: var(--color-text); font-weight: 700; }
.listen-options li.wrong { border-color: var(--color-accent); color: var(--color-accent); text-decoration: line-through; }
.listen-script p { margin: 6px 0; font-family: var(--font-ko); font-size: 18px; line-height: 1.6; }
.listen-script .pill { margin-right: 6px; }
.listen-words { padding-left: 18px; margin: 6px 0; line-height: 1.6; }
.pre-line { white-space: pre-line; }
.link-btn { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }

/* Weak points (D-54) */
.weak-cta { margin-top: 14px; }
.weak-cta p { margin: 6px 0 10px; }
.mistake-list li.row-between { display: flex; }

/* Sign-in (spec §6.3): Telegram widget and Google button stacked, each at least 44px tall. */
.signin-page { padding-top: 32px; }
.lead-text { font-size: 18px; line-height: 1.5; margin: 6px 0 16px; }
.signin-buttons { display: grid; gap: 12px; justify-items: start; margin: 12px 0 4px; }
.signin-buttons > div { min-height: 44px; }
.danger-zone { border-top: 2px solid var(--color-text); }

/* Units (spec §4.2, §4.3) */
.menu button.unit-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 20px;
    gap: 0 8px;
    align-items: center;
    width: 100%;
    min-height: 64px;
    padding: 12px 16px 12px var(--gutter);
    border: 0;
    border-bottom: 1px solid var(--color-divider);
    background: none;
    color: var(--color-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.menu button.unit-row.locked { color: var(--color-muted); }
.menu button.unit-row.locked .t { color: var(--color-muted); }
.unit-locked-note { padding: 8px var(--gutter) 12px; border-bottom: 1px solid var(--color-divider); }
.unit-locked-note p { margin: 0 0 8px; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 12px 0; padding: 0; border: 1px solid var(--color-divider); }
.steps li { border-right: 1px solid var(--color-divider); }
.steps li:last-child { border-right: 0; }
.steps .link-btn { display: block; width: 100%; padding: 10px 6px; font-size: 13px; font-weight: 600; text-align: center; }
.steps li.current { background: var(--color-text); }
.steps li.current .link-btn { color: var(--color-bg); }
/* The unit's word table, as in KoreanAiTeacher (D-36): first exposure before the cards. */
.study-bar { position: sticky; top: 0; z-index: 2; background: var(--color-bg); padding: 10px 0; border-bottom: 2px solid var(--color-text); display: grid; gap: 8px; }
.word-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.word-table th { text-align: left; font: 700 12px var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--color-muted); padding: 6px 8px; border-bottom: 2px solid var(--color-text); }
.word-table td { padding: 10px 8px; border-bottom: 1px solid var(--color-rule-soft); vertical-align: top; cursor: pointer; }
.word-table .n { width: 2.2em; color: var(--color-muted); font-variant-numeric: tabular-nums; cursor: default; }
.word-table td.ko { font-family: var(--font-ko); font-size: 20px; font-weight: 700; word-break: keep-all; overflow-wrap: normal; width: 42%; }
.word-table td.ko small { display: block; font-family: var(--font-body); font-size: 13px; font-weight: 400; color: var(--color-muted); }
.word-table td.uz { font-size: 16px; }
.word-table tr.selected td { background: var(--color-surface); }
.word-table tr.speak-row td { padding-top: 0; cursor: default; background: var(--color-surface); }
.covered { display: inline-block; width: 100%; min-width: 4em; height: 1.2em; background: repeating-linear-gradient(135deg, var(--color-surface) 0 6px, var(--color-rule-soft) 6px 8px); border: 1px dashed var(--color-divider); vertical-align: middle; }

/* PWA: update bar above the tab bar, install steps, onboarding (spec §4.1, §6.2). */
.update-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom));
    z-index: 11;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px var(--gutter);
    background: var(--color-text);
    color: var(--color-bg);
    font-weight: 600;
}
.signin-page ~ .update-banner, .onboarding ~ .update-banner { bottom: env(safe-area-inset-bottom); }
.install-steps { list-style: none; counter-reset: step; padding: 0; margin: 8px 0; border-top: 2px solid var(--color-divider); }
.install-steps li { counter-increment: step; display: grid; grid-template-columns: 28px 28px 1fr; align-items: center; gap: 10px; min-height: 56px; padding: 6px 0; border-bottom: 1px solid var(--color-rule-soft); }
.install-steps li::before { content: counter(step); font: 800 20px var(--font-heading); color: var(--color-accent); }
.install-steps svg, .install-steps img { width: 24px; height: 24px; }
.onboarding { min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: 0; }
.onboarding .onboarding-body { flex: 1; }
.onboarding .big-number { font: 800 56px/1 var(--font-heading); color: var(--color-accent); margin: 24px 0 8px; }
.onboarding-dots { display: flex; gap: 6px; margin: 16px 0; }
.onboarding-dots span { width: 24px; height: 4px; background: var(--color-rule-soft); }
.onboarding-dots span.current { background: var(--color-accent); }
.onboarding-actions { display: flex; gap: 8px; justify-content: space-between; align-items: center; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.onboarding-actions .link-btn { min-height: 44px; font-weight: 600; }

/* Teacher and admin tables (stage 7): plain rules, scroll sideways on a phone instead of squeezing. */
.table-wrap { overflow-x: auto; margin: 8px calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter); -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; font: 600 11px/1.2 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--color-muted); padding: 8px 10px 8px 0; border-bottom: 2px solid var(--color-divider); white-space: nowrap; }
.data-table td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--color-rule-soft); vertical-align: top; white-space: nowrap; }
.data-table td.wrap { white-space: normal; min-width: 140px; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table a { font-weight: 600; }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; border-top: 2px solid var(--color-divider); margin: 8px 0; }
.figures div { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--color-rule-soft); }
.figures strong { display: block; font: 800 26px/1.1 var(--font-heading); }
.figures span { font-size: 13px; color: var(--color-muted); }
.invite-link { display: block; word-break: break-all; font: 600 15px var(--font-body); padding: 10px 0; }
.card > .figures:first-child { border-top: 0; margin-top: 0; }
.chips.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.chips.days .chip { min-width: 0; padding: 0; }

/* ===== UI handoff (docs/design/ui-handoff): shared pieces. 0 radius, left-aligned labels, 2px group rules. ===== */
.app-header {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    margin: -12px calc(-1 * var(--gutter)) 0;
    padding: 12px var(--gutter);
    border-bottom: 2px solid var(--color-divider);
}
.app-header-back { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin-left: -12px; color: var(--color-text); }
.app-header-title { font: 800 18px/1.2 var(--font-heading); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-header-right { margin-left: auto; font-size: 13px; color: var(--color-muted); white-space: nowrap; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--color-text);
    font: 800 15px/1.2 var(--font-heading);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: 52px; }
.btn.small { min-height: 44px; font-size: 14px; }
.btn-primary { background: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-600); color: var(--color-bg); }
.btn-primary:active { background: var(--color-accent-700); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); color: var(--color-text); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent); padding-inline: 8px; }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-ink { background: var(--color-text); color: var(--color-bg); }
.btn svg { flex: none; }

.section-label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 0 calc(-1 * var(--gutter));
    padding: 16px var(--gutter) 6px;
    border-bottom: 2px solid var(--color-divider);
    font: 600 11px/1.2 var(--font-body);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--color-muted);
}
.section-label.accent { color: var(--color-accent-700); border-bottom-color: var(--color-text); }
.section-label-right { letter-spacing: 0; text-transform: none; font-size: 13px; font-weight: 400; }

.list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: calc(100% + 2 * var(--gutter));
    min-height: 52px;
    margin: 0 calc(-1 * var(--gutter));
    padding: 8px var(--gutter);
    border: 0;
    border-bottom: 1px solid var(--color-divider);
    background: transparent;
    color: var(--color-text);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.list-row.static { cursor: default; }
a.list-row:hover, button.list-row:hover { background: color-mix(in srgb, var(--color-text) 5%, transparent); color: var(--color-text); }
.list-row-label { display: block; font-size: 15px; }
.list-row-note { display: block; font-size: 12px; color: var(--color-muted); }
.list-row-value { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--color-muted); white-space: nowrap; }
.list-row-value svg { color: var(--color-text); }
.list-row-control { display: inline-flex; align-items: center; }
.list-row-control .seg { margin: 0; }

/* 40×22 track with a 16px knob, inside a 44px touch target. */
.switch { display: inline-flex; align-items: center; justify-content: flex-end; min-width: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.switch-track { display: flex; width: 40px; height: 22px; padding: 3px; background: var(--color-neutral-400); }
.switch-knob { width: 16px; height: 16px; background: var(--color-bg); }
.switch.on .switch-track { background: var(--color-text); justify-content: flex-end; }
.switch:disabled { opacity: .45; cursor: not-allowed; }

.tag { display: inline-flex; align-items: center; padding: 3px 10px; font-size: 11px; letter-spacing: .02em; border-radius: 0; }
.tag-neutral { background: var(--color-neutral-100); color: var(--color-neutral-800); }
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.stepper {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 calc(-1 * var(--gutter));
    padding: 0;
    border-top: 2px solid var(--color-divider);
    border-bottom: 2px solid var(--color-divider);
}
.stepper li { border-right: 1px solid var(--color-divider); min-width: 0; }
.stepper li:last-child { border-right: 0; }
.stepper button, .stepper li > span {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    min-height: 88px;
    padding: 12px 10px 12px 12px;
    border: 0;
    background: transparent;
    color: var(--color-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.stepper li > span { cursor: default; }
.stepper-no { font-size: 13px; color: var(--color-muted); }
.stepper-label { font: 600 16px/1.2 var(--font-heading); color: var(--color-muted); }
.stepper li.done .stepper-label { color: var(--color-text); }
.stepper li.current { background: var(--color-surface); }
.stepper li.current .stepper-no { color: var(--color-accent-700); }
.stepper li.current .stepper-label { color: var(--color-text); }
.stepper li.current .stepper-label::after { content: ""; display: block; width: 32px; height: 3px; margin-top: 8px; background: var(--color-accent); }
.stepper.compact button, .stepper.compact li > span { flex-direction: row; gap: 4px; min-height: 44px; align-items: center; padding: 0 8px 0 12px; font: 600 13px var(--font-heading); }
.stepper.compact li.current { background: transparent; box-shadow: inset 0 -3px 0 var(--color-accent); }
.stepper.compact li.current button, .stepper.compact li.current > span { color: var(--color-accent-700); }

.progress { height: 3px; background: var(--color-neutral-300); }
.progress > span { display: block; height: 100%; background: var(--color-accent); }

/* Loading skeleton (UX06): grey blocks where the text will be. */
.skeleton { display: block; height: 1em; background: var(--color-neutral-300); }

/* 1b Bosh sahifa. */
.home-due { display: flex; flex-direction: column; margin: 0 calc(-1 * var(--gutter)); padding: 24px var(--gutter) 20px; border-bottom: 2px solid var(--color-divider); }
.home-due .kicker { margin-bottom: 8px; }
.home-due-figure { display: flex; align-items: flex-end; gap: 12px; }
.home-due-figure b { font: 900 88px/0.9 var(--font-heading); letter-spacing: -0.04em; }
.home-due-figure span { font-size: 15px; line-height: 1.5; padding-bottom: 4px; }
.home-due p { margin: 12px 0 0; }
.home-due .btn.block { margin-top: 20px; }
.home-due .btn-ghost { align-self: flex-start; margin-top: 4px; }
.home-due-empty { font: 800 25px/1.12 var(--font-heading); margin: 4px 0 0; }
.home-unit { padding: 20px 0 16px; }
.home-unit-head { display: flex; justify-content: space-between; align-items: baseline; }
.home-unit h3 { font: 800 25px/1.12 var(--font-heading); margin: 4px 0 10px; }
.home-continue { margin-top: 16px; }

/* 1c Bo‘limlar. */
.units-title { font: 800 30px/1.12 var(--font-heading); margin: 12px 0 14px; }
.level-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--color-divider); }
.level-pick button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 52px; padding: 8px 12px; border: 0; border-right: 1px solid var(--color-divider); background: transparent; color: var(--color-muted); text-align: left; cursor: pointer; }
.level-pick button:last-child { border-right: 0; }
.level-pick b { font: 800 15px var(--font-heading); }
.level-pick span { font-size: 10px; }
.level-pick button.selected { background: var(--color-accent); color: var(--color-bg); }
.unit-rows { margin: 12px calc(-1 * var(--gutter)) 0; border-top: 2px solid var(--color-divider); }
.unit-item {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0 4px;
    min-height: 56px;
    padding: 14px var(--gutter);
    border-bottom: 1px solid var(--color-divider);
    color: var(--color-text);
    text-decoration: none;
}
a.unit-item:hover { background: color-mix(in srgb, var(--color-text) 5%, transparent); color: var(--color-text); }
.unit-no { font: 900 24px/1 var(--font-heading); letter-spacing: -0.02em; }
.unit-text { min-width: 0; font-size: 15px; }
.unit-text b { display: block; font: 600 15px/1.3 var(--font-heading); }
.unit-sub { display: block; font-size: 12px; color: var(--color-muted); margin-top: 2px; }
.unit-end { display: inline-flex; align-items: center; gap: 8px; }
.unit-end b { font: 800 15px var(--font-heading); }
.unit-item.open { background: var(--color-surface); min-height: 76px; }
.unit-item.open .unit-no { color: var(--color-accent); }
.unit-progress { display: block; width: 150px; max-width: 100%; margin-top: 8px; }
.unit-item.next .unit-no, .unit-item.locked { color: var(--color-neutral-500); }
.unit-item.next .unit-end { color: var(--color-neutral-600); }
.unit-skip { grid-column: 2 / 4; margin-top: 12px; min-height: 44px; padding: 0 12px; font-size: 14px; white-space: nowrap; }
.unit-skip-note { grid-column: 2 / 4; margin-top: 6px; font-size: 11px; color: var(--color-muted); }

/* 1d Bo‘lim · Jadval. */
.timer-box { min-width: 64px; min-height: 44px; padding: 0 10px; border: 1px solid var(--color-divider); background: transparent; color: var(--color-text); font: 600 15px var(--font-body); font-variant-numeric: tabular-nums; cursor: pointer; }
.timer-box.over { border-color: var(--color-accent); color: var(--color-accent-700); }
.cover-bar { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.cover-bar .seg { margin: 0; flex: 1; }
.cover-bar .seg > button { min-height: 44px; font-size: 13px; padding: 0 10px; }
.cover-hint { margin: -4px 0 8px; }
.word-table { margin: 0 calc(-1 * var(--gutter)); width: calc(100% + 2 * var(--gutter)); border-top: 2px solid var(--color-divider); }
.word-table th { padding: 10px 8px; font: 400 11px var(--font-body); letter-spacing: .08em; border-bottom: 2px solid var(--color-divider); }
.word-table th:first-child, .word-table td:first-child { padding-left: var(--gutter); }
.word-table th:last-child, .word-table td:last-child { padding-right: var(--gutter); }
.word-table td { padding: 12px 8px; min-height: 50px; border-bottom: 1px solid var(--color-divider); vertical-align: middle; }
.word-table .n { width: 36px; font-size: 13px; }
.word-table td.ko { font-size: 17px; font-weight: 700; width: 46%; }
.word-table td.ko small { font-size: 11px; }
.word-table td.uz { font-size: 14px; }
.covered { display: block; width: 100%; min-width: 4em; height: 24px; background: var(--color-neutral-300); border: 0; }
.trap { margin: 10px 0; padding: 12px 14px; background: var(--color-accent-100); }
.trap-title { display: flex; align-items: center; gap: 6px; font: 600 11px var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--color-accent-700); }
.trap p { margin: 6px 0 0; font-size: 14px; color: var(--color-accent-900); }
/* A screen's main action kept above the tab bar (body has overflow-x: hidden, so sticky would not stick). */
.sticky-action { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom)); z-index: 9; padding: 12px var(--gutter); background: var(--color-bg); border-top: 2px solid var(--color-divider); }
.sticky-action > * { max-width: calc(640px - 2 * var(--gutter)); margin: 0 auto; }
.sticky-space { height: 84px; }
.unit-step { padding: 16px 0; }
.unit-step h3 { font: 800 20px/1.12 var(--font-heading); margin: 0 0 8px; }
.unit-step .btn.block { margin-top: 12px; }
.stepper.compact { margin-top: 0; }

/* 1e Kartochka. */
.session-bar .progress { flex: 1; }
.progress.ink { height: 4px; }
.progress.ink > span { background: var(--color-text); }
.flashcard { margin: 0 calc(-1 * var(--gutter)); padding: 16px var(--gutter) 20px; border-bottom: 2px solid var(--color-divider); }
.flashcard-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 20px; }
.flashcard-word { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.flashcard-word .speak { flex-direction: column; margin: 8px 0 0; }
.flashcard .prompt.ko, .reveal .answer.ko { font: 900 64px/1.05 var(--font-ko); margin: 0; }
.flashcard-note { font-size: 15px; margin: 6px 0 0; }
.flashcard-hidden { padding: 20px 0; }
.flashcard-hidden p { margin: 0 0 12px; }
.reveal-btn { min-height: 56px; }
.reveal { margin: 0; padding: 16px 0; border-top: 0; }
.reveal .answer:not(.ko) { font: 800 28px/1.2 var(--font-heading); }
.rate-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 8px calc(-1 * var(--gutter)) 0; border-top: 2px solid var(--color-divider); }
.rate-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 72px; padding: 12px; border: 0; border-right: 1px solid var(--color-divider); background: transparent; color: var(--color-text); text-align: left; cursor: pointer; }
.rate-cell:last-child { border-right: 0; }
.rate-cell b { font: 800 14px/1.2 var(--font-heading); }
.rate-cell span { font-size: 11px; color: var(--color-muted); }
.rate-cell.middle { background: var(--color-text); color: var(--color-bg); }
.rate-cell.middle span { color: color-mix(in srgb, var(--color-bg) 75%, transparent); }
.rate-cell:disabled { opacity: .45; cursor: not-allowed; }

/* 1f Bo‘lim testi. */
.session-title { flex: 1; min-width: 0; font: 800 15px var(--font-heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.test-segments { display: flex; gap: 2px; margin: 12px 0 0; }
.test-segments span { flex: 1; height: 6px; background: var(--color-neutral-300); }
.test-segments span.done { background: var(--color-text); }
.test-segments span.current { background: var(--color-accent); }
.question-ask { display: block; font-size: 13px; color: var(--color-muted); margin: 16px 0 4px; }
.test-question .prompt.ko { font: 900 72px/1.05 var(--font-ko); margin: 0 0 12px; }
.choice-list { margin: 16px calc(-1 * var(--gutter)) 0; border-top: 1px solid var(--color-divider); }
.choice { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; width: 100%; min-height: 60px; padding: 8px var(--gutter); border: 0; border-bottom: 1px solid var(--color-divider); background: transparent; color: var(--color-text); text-align: left; cursor: pointer; }
.choice-letter { font: 800 13px var(--font-heading); }
.choice-text { font: 600 17px/1.3 var(--font-body); }
.choice-text[lang="ko"] { font-family: var(--font-ko); font-size: 19px; }
.choice.chosen { background: var(--color-text); color: var(--color-bg); }
.choice:disabled { cursor: progress; }
.test-foot { padding: 16px 0; }
.test-foot-links { display: flex; justify-content: space-between; margin-top: 4px; }

/* 1g Test natijasi. */
.result-figures { display: grid; grid-template-columns: 1fr 1fr; margin: 0 calc(-1 * var(--gutter)); border-bottom: 2px solid var(--color-divider); }
.result-figures > div { padding: 20px var(--gutter); }
.result-figures b { display: block; font: 900 56px/0.95 var(--font-heading); letter-spacing: -0.03em; margin-top: 6px; }
.result-figures small { font-size: 22px; font-weight: 800; color: var(--color-muted); }
.result-figures.passed .result-score { background: var(--color-accent); color: var(--color-bg); }
.result-figures.passed .result-score .kicker { color: var(--color-bg); }
.result-figures.failed .result-score { box-shadow: inset 0 0 0 2px var(--color-text); }
.result-text { padding: 16px 0; }
.result-text h4 { font: 800 20px/1.12 var(--font-heading); margin: 0 0 6px; }
.wrong-list { margin: 0 calc(-1 * var(--gutter)); }
.wrong-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 12px var(--gutter); border-bottom: 1px solid var(--color-divider); }
.wrong-row .ko { font-size: 17px; font-weight: 700; }
.wrong-row b { display: block; font-weight: 600; }
.wrong-row s { display: block; font-size: 13px; }
.result-actions { padding: 16px 0; display: grid; gap: 8px; }

/* 1h Mashq. */
.practice-head { margin: 0 calc(-1 * var(--gutter)); padding: 12px var(--gutter) 14px; border-bottom: 2px solid var(--color-divider); }
.practice-head h1 { font: 800 30px/1.12 var(--font-heading); margin: 0; }
.practice-head p { margin: 4px 0 0; }
.practice-list { margin: 0 calc(-1 * var(--gutter)); }
.practice-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 0 8px; min-height: 72px; padding: 12px var(--gutter); border-bottom: 1px solid var(--color-divider); color: var(--color-text); text-decoration: none; }
.practice-row:hover { background: color-mix(in srgb, var(--color-text) 5%, transparent); color: var(--color-text); }
.practice-no { font: 900 15px var(--font-heading); color: var(--color-neutral-500); }
.practice-text b { display: block; font: 800 16px/1.25 var(--font-heading); }
.practice-text span { display: block; font-size: 13px; color: var(--color-muted); margin-top: 2px; }
.practice-end { display: inline-flex; align-items: center; gap: 10px; }

/* 1i Premium. */
.premium-intro { padding: 16px 0; }
.premium-intro p { margin: 0 0 8px; font-size: 15px; }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; margin: 0 calc(-1 * var(--gutter)); border-top: 2px solid var(--color-divider); border-bottom: 2px solid var(--color-divider); }
.plan { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 112px; padding: 16px var(--gutter); border: 0; border-right: 2px solid var(--color-divider); background: transparent; color: var(--color-text); text-align: left; cursor: pointer; }
.plan:last-child { border-right: 0; }
.plan-head { display: flex; justify-content: space-between; width: 100%; font-size: 13px; }
.plan-save { color: var(--color-accent-400); }
.plan b { font: 900 26px/1 var(--font-heading); letter-spacing: -0.02em; }
.plan-note { font-size: 12px; color: var(--color-muted); }
.plan.selected { background: var(--color-text); color: var(--color-bg); }
.plan.selected .plan-note { color: color-mix(in srgb, var(--color-bg) 70%, transparent); }
.pay-code { padding: 16px 0; border-bottom: 1px solid var(--color-divider); margin: 0 calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
.pay-code-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.pay-code code { font: 700 30px/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: .04em; }
.bank-facts { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; margin: 0 calc(-1 * var(--gutter)); padding: 16px var(--gutter); border-bottom: 1px solid var(--color-divider); font-size: 15px; }
.bank-facts dt { color: var(--color-muted); }
.bank-facts dd { margin: 0; overflow-wrap: anywhere; }
.promo { padding: 16px 0; }
.promo-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 6px; }
.promo-row .input { min-height: 48px; }
.promo-result { margin: 8px 0 0; font-size: 12px; color: var(--color-accent-700); }

/* 1a Kirish. */
.signin-page { display: flex; flex-direction: column; min-height: 100dvh; padding-bottom: 20px; }
.signin-words { display: grid; grid-template-columns: 1fr 1fr; margin: 0 calc(-1 * var(--gutter)); border-bottom: 2px solid var(--color-divider); }
.signin-words > div { padding: 24px var(--gutter); }
.signin-words > div + div { border-left: 2px solid var(--color-divider); }
.signin-words span { display: block; font: 900 56px/1.05 var(--font-ko); }
.signin-words small { display: block; font-size: 13px; color: var(--color-muted); margin-top: 6px; }
.signin-words .accent span { color: var(--color-accent); }
.signin-pitch { padding: 20px 0 8px; }
.signin-pitch h2 { font: 800 30px/1.12 var(--font-heading); margin: 0 0 10px; }
.signin-pitch p { font-size: 15px; margin: 0; }
.signin-page.content { padding-top: 12px; }
.signin-buttons { display: grid; gap: 10px; justify-items: stretch; padding: 16px 0; margin: 0; }
.signin-buttons .signin-google { min-height: 44px; }
.signin-foot { margin: auto calc(-1 * var(--gutter)) 0; padding: 14px var(--gutter) 0; border-top: 2px solid var(--color-divider); font-size: 11px; color: var(--color-muted); }

/* 2a/2b Profil. */
.profile-head { display: flex; align-items: flex-start; gap: 16px; margin: 0 calc(-1 * var(--gutter)); padding: 20px var(--gutter); border-bottom: 2px solid var(--color-divider); }
.profile-head h1 { font: 800 20px/1.2 var(--font-heading); margin: 2px 0 8px; }
.profile-avatar { flex: none; display: flex; align-items: flex-end; width: 56px; height: 56px; padding: 0 0 6px 8px; background: var(--color-text); color: var(--color-bg); font: 900 22px/1 var(--font-heading); }
.manage-grid { display: grid; grid-template-columns: 1fr 1fr; margin: 0 calc(-1 * var(--gutter)); border-bottom: 2px solid var(--color-divider); }
.manage-cell { display: flex; flex-direction: column; gap: 8px; min-height: 104px; padding: 16px var(--gutter); color: var(--color-text); text-decoration: none; }
.manage-cell + .manage-cell { border-left: 1px solid var(--color-divider); }
.manage-cell.primary { background: var(--color-surface); }
.manage-cell b { font: 800 18px/1.2 var(--font-heading); }
.manage-cell span { font-size: 12px; color: var(--color-muted); }
.manage-cell:hover { color: var(--color-text); background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.profile-plan { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 calc(-1 * var(--gutter)); padding: 16px var(--gutter); border-bottom: 2px solid var(--color-divider); }
.profile-plan b { font: 800 16px var(--font-heading); }
.profile-plan .btn { min-height: 44px; }
.list-row-control .seg > button { min-height: 44px; padding: 0 10px; font-size: 13px; }
.manage-cell:only-child { grid-column: span 2; }
.profile-bottom { display: grid; gap: 4px; margin: 16px calc(-1 * var(--gutter)) 0; padding: 20px var(--gutter) 0; border-top: 2px solid var(--color-divider); }
.profile-bottom .btn-ghost { justify-self: start; }
.btn.danger { color: var(--color-accent-700); }

/* 2d Admin → Tizim. */
.system-seg { margin: 12px 0 6px; }
.system-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; margin: 0 calc(-1 * var(--gutter)); padding: 12px var(--gutter); border-bottom: 1px solid var(--color-divider); }
.system-row-text b { display: block; font-size: 15px; font-weight: 600; }
.system-row-text span { display: block; font-size: 12px; color: var(--color-muted); }
.system-row-text .warn-text, .warn-text { color: var(--color-accent-700); }
.spend { padding: 12px 0 16px; }
.spend-figure { margin: 0 0 10px; }
.spend-figure b { font: 900 28px var(--font-heading); }
.spend-figure span { color: var(--color-muted); }
.spend-bar { height: 6px; margin-bottom: 8px; }

/* 2c Admin panel. */
.attention-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; min-height: 52px; margin: 0 calc(-1 * var(--gutter)); padding: 8px var(--gutter); border-bottom: 1px solid var(--color-divider); color: var(--color-text); text-decoration: none; }
.attention-row b { font: 900 20px var(--font-heading); color: var(--color-accent); }
.attention-row span { font-size: 14px; }
.admin-tiles { display: grid; grid-template-columns: 1fr 1fr; margin: 0 calc(-1 * var(--gutter)); border-top: 2px solid var(--color-divider); }
.admin-tile { display: flex; flex-direction: column; justify-content: space-between; min-height: 104px; padding: 14px var(--gutter); border-bottom: 1px solid var(--color-divider); color: var(--color-text); text-decoration: none; }
.admin-tile:nth-child(odd) { border-right: 1px solid var(--color-divider); }
.admin-tile:hover { color: var(--color-text); background: color-mix(in srgb, var(--color-text) 5%, transparent); }
.admin-tile-no { font-size: 11px; color: var(--color-muted); }
.admin-tile b { display: block; font: 800 16px/1.2 var(--font-heading); }
.admin-tile span span { display: block; font-size: 12px; color: var(--color-muted); margin-top: 2px; }

/* Score chart (ScoreChart.razor, D-35/D-40): restored, lost in stage 0. */
.score-chart { margin: 12px 0 0; }
.score-chart svg { width: 100%; height: auto; max-height: 220px; overflow: visible; display: block; }
.score-chart .grid { stroke: var(--color-rule-soft); stroke-width: 1; vector-effect: non-scaling-stroke; }
.score-chart .axis { font: 600 10px var(--font-body); fill: var(--color-muted); }
.score-chart .line { fill: none; stroke: var(--color-text); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.score-chart .dot { fill: var(--color-text); stroke: var(--color-bg); stroke-width: 2; vector-effect: non-scaling-stroke; }
.score-chart .hit { fill: transparent; }
.score-chart .label { font: 800 13px var(--font-heading); fill: var(--color-text); }
.chart-x { display: flex; justify-content: space-between; font-size: 12px; color: var(--color-muted); padding-left: 24px; margin-top: 4px; }

/* Before sign-in: what the app is (L-41). Same flat language as the app: 2px rules, no cards, left-aligned. */
.landing { display: grid; gap: 14px; padding: 20px 0 24px; }
.landing .section-label { margin-top: 10px; }
.landing-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.landing-steps li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; column-gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--color-divider); }
.landing-steps li::before { content: counter(step); grid-row: span 2; font: 900 22px/1 var(--font-heading); color: var(--color-accent); }
.landing-steps b { font-size: 16px; }
.landing-steps span { font-size: 14px; color: var(--color-muted); }
.landing-word { display: grid; gap: 8px; padding: 4px 0 14px; border-bottom: 1px solid var(--color-divider); }
.landing-word p { margin: 0; }
.landing-word-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.landing-word-ko { font: 900 40px/1 var(--font-ko); }
.landing-example span[lang="ko"] { font-family: var(--font-ko); }
.landing-trap { font-size: 14px; padding-left: 10px; border-left: 3px solid var(--color-accent); }
.landing-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; }
.landing-plans > div { padding: 12px 12px 12px 0; min-width: 0; }
.landing-plans > div + div { padding-left: 12px; border-left: 1px solid var(--color-divider); }
.landing-plans ul { margin: 8px 0 0; padding-left: 18px; font-size: 14px; display: grid; gap: 4px; }
.landing-cta { margin-top: 8px; }
