﻿/* =====================================================================
   Innova o'quvchi ilovasi — mini ilova va web sayt uchun bitta dizayn (§2.5, §8).
   G'oya: oq qog'oz, siyoh va marker. Siyoh (--accent) — harakatlar va tanlangan javoblar;
   marker (--marker) faqat "siz shu yerdasiz" degan joylarda: faol menyu, reytingdagi o'z qatoringiz,
   joriy savol. Telegram faqat yorug'/qorong'i rejimni belgilaydi (platform.js), ranglar o'zimizniki.
   ===================================================================== */

@font-face {
    font-family: "Onest";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../lib/fonts/onest-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Onest";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../lib/fonts/onest-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Onest";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../lib/fonts/onest-cyrillic.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* ---------- ranglar ---------- */

:root {
    --bg: #ffffff;
    --text: #14162b;
    --muted: #646a82;
    --line: #e5e7ef;
    --line-strong: #cfd3df;
    --surface: #f5f6fa;
    --accent: #0a6e68;
    --accent-hover: #085c57;
    --accent-ink: #ffffff;
    --accent-soft: #e6f3f2;
    --marker: #ffe25a;
    --marker-soft: rgba(255, 226, 90, .38);

    --color-correct: #11825a;
    --color-wrong: #d0343e;
    --color-warning: #b25e00;
    --correct-soft: #e5f4ed;
    --wrong-soft: #fcebec;
    --warning-soft: #fdf1e2;

    --shadow-lift: 0 1px 2px rgba(20, 22, 43, .06), 0 8px 24px rgba(20, 22, 43, .08);
    --shadow-sheet: 0 -6px 30px rgba(20, 22, 43, .14);

    --font: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --r-sm: 10px;
    --r: 12px;
    --r-lg: 18px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --duration: 180ms;

    /* Eski nomlar — test-runner va boshqa joylar uchun moslik. */
    --tg-bg: var(--bg);
    --tg-text: var(--text);
    --tg-hint: var(--muted);
    --tg-link: var(--accent);
    --tg-button: var(--accent);
    --tg-button-text: var(--accent-ink);
    --tg-secondary-bg: var(--surface);
    --focus: var(--accent);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-color-scheme="light"]) {
        --bg: #121520;
        --text: #eef0f7;
        --muted: #9aa1b8;
        --line: #252a3a;
        --line-strong: #353b4f;
        --surface: #1a1e2c;
        --accent: #3fc6ba;
        --accent-hover: #5fd4c9;
        --accent-ink: #062523;
        --accent-soft: rgba(63, 198, 186, .14);
        --marker: #e6c53a;
        --marker-soft: rgba(230, 197, 58, .2);
        --color-correct: #4fd08f;
        --color-wrong: #ff7d84;
        --color-warning: #f2ad5f;
        --correct-soft: rgba(79, 208, 143, .14);
        --wrong-soft: rgba(255, 125, 132, .14);
        --warning-soft: rgba(242, 173, 95, .14);
        --shadow-lift: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
        --shadow-sheet: 0 -6px 30px rgba(0, 0, 0, .45);
    }
}

:root[data-color-scheme="dark"] {
    --bg: #121520;
    --text: #eef0f7;
    --muted: #9aa1b8;
    --line: #252a3a;
    --line-strong: #353b4f;
    --surface: #1a1e2c;
    --accent: #3fc6ba;
    --accent-hover: #5fd4c9;
    --accent-ink: #062523;
    --accent-soft: rgba(63, 198, 186, .14);
    --marker: #e6c53a;
    --marker-soft: rgba(230, 197, 58, .2);
    --color-correct: #4fd08f;
    --color-wrong: #ff7d84;
    --color-warning: #f2ad5f;
    --correct-soft: rgba(79, 208, 143, .14);
    --wrong-soft: rgba(255, 125, 132, .14);
    --warning-soft: rgba(242, 173, 95, .14);
    --shadow-lift: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-sheet: 0 -6px 30px rgba(0, 0, 0, .45);
}

/* ---------- asos ---------- */

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

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

.app {
    min-width: 320px;
    max-width: 720px;
    margin: 0 auto;
    padding: var(--space-5) var(--space-4) calc(88px + env(safe-area-inset-bottom));
}

.ic {
    width: 20px; height: 20px; flex-shrink: 0;
    fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.title { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; margin: 0 0 var(--space-5); }
.hint { font-size: 14px; color: var(--muted); margin: 0 0 var(--space-6); }
.num { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.description { white-space: pre-line; }

a { color: var(--accent); }

/* ---------- kartalar va ro'yxatlar ---------- */

.card {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
}
.card .hint, .stat .hint, .notice .hint, .profile-row .hint { margin: 0; }

/* Bir turdagi elementlar — bitta ramka ichida, ingichka chiziqlar bilan ajratilgan. */
.list {
    display: grid;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--bg);
}
.list > .card { margin: 0; border: 0; border-radius: 0; }
.list > .card + .card { border-top: 1px solid var(--line); }

.card-link {
    display: flex; align-items: center; gap: var(--space-3);
    min-height: 72px; padding: var(--space-3) var(--space-4);
    color: inherit; text-decoration: none;
    transition: background var(--duration);
}
a.card-link[href]:hover { background: var(--surface); }
a.card-link[href]:active { background: color-mix(in srgb, var(--surface) 60%, var(--line)); }
.card-main { flex: 1; min-width: 0; }
.card-title { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.card-meta strong { color: var(--text); font-weight: 650; }
.card-meta .ic { width: 15px; height: 15px; }
.card-time { color: var(--text); }
.chevron { width: 20px; height: 20px; color: var(--line-strong); }

/* Chapdagi ikonka plitasi: siyoh rangi — hozir faol, kulrang — keyinroq. */
.tile {
    width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center;
    border-radius: var(--r); background: var(--surface); color: var(--muted);
}
.tile .ic { width: 22px; height: 22px; }
.tile-accent { background: var(--accent-soft); color: var(--accent); }

.empty-state {
    display: flex; align-items: center; gap: var(--space-3);
    color: var(--muted); font-size: 14.5px; padding: var(--space-4);
    border-style: dashed; border-color: var(--line-strong);
}
.empty-state p { margin: 0; }

.section { margin-top: var(--space-8); }
.section-title {
    display: flex; align-items: center; gap: var(--space-2);
    font-size: 17px; font-weight: 650; letter-spacing: -.01em; color: var(--text);
    margin: 0 0 var(--space-3);
}

/* ---------- tugmalar va maydonlar ---------- */

.button {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    min-height: 48px; min-width: 48px; padding: 0 var(--space-5);
    border: 1px solid transparent; border-radius: var(--r);
    background: var(--accent); color: var(--accent-ink);
    font: inherit; font-size: 15.5px; font-weight: 600; letter-spacing: -.005em;
    text-decoration: none; cursor: pointer;
    transition: background var(--duration), border-color var(--duration), transform 120ms;
}
.button:hover { background: var(--accent-hover); }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .45; cursor: default; transform: none; }
.button .ic { width: 19px; height: 19px; }
.button-block { display: flex; width: 100%; }
.button-secondary { background: var(--bg); color: var(--text); border-color: var(--line-strong); }
.button-secondary:hover { background: var(--surface); }
.button-danger { color: var(--color-wrong); }
a.button { text-decoration: none; }

.link-button {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 44px; padding: 8px 10px; border: 0; border-radius: var(--r-sm);
    background: none; color: var(--accent); font: inherit; font-size: 14.5px; font-weight: 600;
    text-decoration: none; cursor: pointer;
}
.link-button:hover { background: var(--accent-soft); }
.link-button .ic { width: 18px; height: 18px; }

.icon-button {
    display: inline-grid; place-items: center;
    min-width: 44px; min-height: 44px; border: 0; border-radius: var(--r);
    background: transparent; color: var(--text); cursor: pointer;
}
.icon-button:hover { background: var(--surface); }
.icon-button .ic { width: 22px; height: 22px; }

.input {
    width: 100%; min-height: 52px; padding: 0 var(--space-4);
    border: 1.5px solid var(--line-strong); border-radius: var(--r);
    background: var(--bg); color: var(--text); font: inherit; font-size: 16px;
    transition: border-color var(--duration), box-shadow var(--duration);
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.input-wrap { position: relative; flex: 1; min-width: 0; }
.input-wrap .input { padding-left: 46px; }
.input-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

.field-label { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: var(--space-2); }
.field-error { display: flex; gap: 6px; color: var(--color-wrong); font-size: 14px; margin-top: var(--space-2); }

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 12.5px; font-weight: 600; line-height: 1.4; white-space: nowrap;
    background: var(--surface); color: var(--muted);
}
.badge-pending { background: var(--warning-soft); color: var(--color-warning); }
.badge-live { background: var(--accent-soft); color: var(--accent); }

.notice {
    display: flex; align-items: flex-start; gap: var(--space-3);
    padding: var(--space-4); border-radius: var(--r);
    background: var(--surface); margin-bottom: var(--space-3); font-size: 15px;
}
.notice > .ic { margin-top: 2px; }
.notice-ok { background: var(--correct-soft); color: var(--color-correct); }
.notice-error { background: var(--wrong-soft); color: var(--color-wrong); }

.chips { display: flex; gap: var(--space-2); margin-bottom: var(--space-3); flex-wrap: wrap; }
.chip {
    min-height: 36px; padding: 0 var(--space-4); border-radius: 999px;
    border: 1px solid var(--line-strong); background: var(--bg); color: var(--text);
    font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
    transition: background var(--duration), color var(--duration), border-color var(--duration);
}
.chip:hover { background: var(--surface); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }

/* ---------- holat ekranlari ---------- */

.center-screen {
    min-height: 68vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: var(--space-2);
}
.center-screen .icon {
    width: 72px; height: 72px; display: grid; place-items: center; margin-bottom: var(--space-3);
    border-radius: 50%; background: var(--surface); color: var(--muted);
}
.center-screen .icon .ic { width: 32px; height: 32px; stroke-width: 1.6; }
.center-screen .hint { font-size: 15px; max-width: 320px; }
.center-screen .title { margin-bottom: 0; }

.skeleton {
    background: linear-gradient(90deg, var(--surface) 25%, color-mix(in srgb, var(--surface) 55%, var(--line)) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    border-radius: var(--r-lg);
    animation: shimmer 1.2s infinite linear;
    margin-bottom: var(--space-3);
}
.skeleton-title { height: 30px; width: 55%; border-radius: var(--r-sm); margin-bottom: var(--space-5); }
.skeleton-card { height: 84px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- pastki menyu (telefon) ---------- */

.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: flex; justify-content: space-around;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: saturate(1.6) blur(12px);
    -webkit-backdrop-filter: saturate(1.6) blur(12px);
    border-top: 1px solid var(--line);
}
.tabbar a {
    flex: 1; max-width: 120px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 52px; color: var(--muted); font-size: 12px; font-weight: 500; text-decoration: none;
}
.tabbar .tab-icon {
    display: grid; place-items: center; width: 56px; height: 30px; border-radius: 999px;
    transition: background var(--duration);
}
.tabbar .ic { width: 22px; height: 22px; }
.tabbar a.active { color: var(--text); font-weight: 650; }
.tabbar a.active .tab-icon { background: var(--marker); color: var(--text); }

/* ---------- bosh sahifa ---------- */

.code-form { padding: var(--space-5) var(--space-4); }
.code-form .code-row { display: flex; gap: var(--space-2); }
.code-form .input { font-size: 20px; font-weight: 600; letter-spacing: .14em; }
.code-form .input::placeholder { font-size: 16px; font-weight: 400; letter-spacing: 0; }

/* ---------- test oldi ---------- */

.pre-meta { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: calc(var(--space-2) * -1) 0 var(--space-5); }
.info-row { display: flex; align-items: center; gap: var(--space-3); }
.info-row .hint { font-size: 13px; }
.info-value { font-weight: 600; font-size: 16px; }
.rules { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); }
.rules li { position: relative; padding-left: 20px; font-size: 15px; }
.rules li::before {
    content: ""; position: absolute; left: 3px; top: .62em;
    width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
.plain-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.pre-actions { margin-top: var(--space-5); display: grid; gap: var(--space-3); }
.countdown {
    font-size: 44px; font-weight: 700; letter-spacing: -.02em; text-align: center;
    padding: var(--space-4) 0; border: 1px solid var(--line); border-radius: var(--r-lg);
}

/* ---------- natijalar ---------- */

.stats-card { padding: 0; overflow: hidden; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { padding: var(--space-4); min-width: 0; }
.stats > .stat + .stat { border-left: 1px solid var(--line); }
.stat-value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.stat .hint { font-size: 13px; margin-top: 2px; }
.chart-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--line); }
.chart-row .hint { flex: 1; font-size: 13px; margin: 0; }

.sparkline { width: 168px; max-width: 55%; height: 48px; flex-shrink: 0; overflow: visible; }
.sparkline polyline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sparkline .spark-area { fill: var(--accent); opacity: .1; stroke: none; }
.sparkline .spark-mid { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.sparkline .spark-dot { fill: var(--accent); }
.sparkline .spark-last { stroke: var(--bg); stroke-width: 1.5; }
.sparkline .score-high { fill: var(--color-correct); }
.sparkline .score-mid { fill: var(--color-warning); }
.sparkline .score-low { fill: var(--color-wrong); }

.ring-wrap { position: relative; width: 48px; height: 48px; flex-shrink: 0; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 4.5; }
.ring-fg { fill: none; stroke-width: 4.5; stroke-linecap: round; }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; }

.result-hero { padding: 0; overflow: hidden; }
.result-hero-top { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-5) var(--space-4); }
.result-hero-top .ring-wrap { width: 88px; height: 88px; }
.result-hero-top .ring-label { font-size: 20px; letter-spacing: -.02em; }
.result-hero-score { font-size: 32px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.result-hero .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.result-hero .stat { padding: var(--space-3) var(--space-4); }
.result-hero .stat-value { font-size: 18px; }

/* Javoblar jadvali */
.answers { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.answers > .empty-state { border: 0; border-radius: 0; margin: 0; }
.answer-row {
    display: grid; grid-template-columns: 2.6em 1fr auto; align-items: center; gap: 2px var(--space-3);
    padding: 11px var(--space-4); background: var(--bg);
}
.answer-row + .answer-row { border-top: 1px solid var(--line); }
.answer-num { font-weight: 600; color: var(--muted); }
.answer-value { font-weight: 600; word-break: break-word; }
.answer-mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.answer-mark .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.answer-correct { grid-column: 2 / 4; font-size: 13.5px; color: var(--color-correct); }
.answer-ok .answer-mark { background: var(--correct-soft); color: var(--color-correct); }
.answer-bad .answer-mark { background: var(--wrong-soft); color: var(--color-wrong); }
.answer-bad .answer-value { color: var(--color-wrong); }

/* Reyting jadvali */
.board { padding: 0; overflow: hidden; }
.board-row {
    display: grid; grid-template-columns: 3em 1fr auto; align-items: center; gap: var(--space-3);
    padding: 10px var(--space-4);
}
.board-row + .board-row { border-top: 1px solid var(--line); }
.board-head { font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface); padding-top: 8px; padding-bottom: 8px; }
.board-head span:last-child, .board-score { text-align: right; }
.board-rank {
    display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
    color: var(--muted); font-size: 14px; font-weight: 600;
}
.board-score { font-weight: 650; }
.medal { font-size: 13px; font-weight: 700; color: #3b2f00; }
.medal-1 { background: #f6d55c; }
.medal-2 { background: #dfe3ea; color: #34394a; }
.medal-3 { background: #f0c6a0; color: #4a2a10; }
.board-me { background: var(--marker-soft); font-weight: 650; }
.board-sep { text-align: center; color: var(--muted); padding: 2px; letter-spacing: .2em; }

/* ---------- profil ---------- */

.profile-head { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-5); }
.profile-head .title { margin: 0; }
.avatar {
    width: 60px; height: 60px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent); font-size: 22px; font-weight: 700; letter-spacing: -.02em;
}
.profile-card { padding: 0 var(--space-4); }
.profile-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: 14px 0; }
.profile-row + .profile-row { border-top: 1px solid var(--line); }
.profile-row .num { text-align: right; font-weight: 600; }
.profile-actions { display: grid; gap: var(--space-2); margin-top: var(--space-6); }
.profile-rename { margin-bottom: var(--space-3); }

/* Profil sarlavhasi: katta avatar, ism, raqam va qachondan beri o'quvchi. */
.profile-hero {
    display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-4);
    padding: var(--space-5) var(--space-4); border-radius: 22px;
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--accent) 14%, transparent) 0, transparent 55%),
        var(--surface);
    border: 1px solid var(--line);
}
.avatar-xl { width: 72px; height: 72px; font-size: 26px; background: var(--bg); box-shadow: 0 0 0 3px var(--accent-soft); }
.profile-hero-main { min-width: 0; display: grid; gap: 4px; }
.profile-name { margin: 0 0 2px; font-size: 22px; overflow-wrap: anywhere; }
.profile-hero-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.profile-hero-meta .ic { width: 16px; height: 16px; }

/* Statistika: 2×2 plita (kompyuterda 4 ta bir qatorda). */
.profile-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); margin-bottom: var(--space-3); }
@media (min-width: 640px) { .profile-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.profile-stat {
    display: grid; gap: 2px; padding: var(--space-4); border-radius: var(--r-lg);
    background: var(--bg); border: 1px solid var(--line);
}
.profile-stat-icon {
    width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 6px;
    border-radius: 10px; background: var(--surface); color: var(--muted);
}
.profile-stat-icon .ic { width: 18px; height: 18px; }
.profile-stat-value { font-size: 24px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; }
.profile-stat-label { font-size: 13px; color: var(--muted); }
.profile-stat.score-high .profile-stat-value { color: var(--color-correct); }
.profile-stat.score-mid .profile-stat-value { color: var(--color-warning); }
.profile-stat.score-low .profile-stat-value { color: var(--color-wrong); }
.card > .field-label .ic { width: 17px; height: 17px; vertical-align: -3px; margin-right: 6px; color: var(--muted); }
.group-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.group-chip {
    display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 650;
}
.profile-section { margin-top: var(--space-6); }

/* ---------- bosh sahifa: test kartochkasi ---------- */

.list > .test-card { display: grid; gap: 6px; align-items: start; padding: var(--space-4); min-height: 0; }
.test-card-top { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.subject-chip {
    display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px;
    background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 700;
}
.code-pill {
    display: inline-flex; align-items: center; gap: 3px; min-height: 26px; padding: 0 10px; border-radius: 999px;
    border: 1.5px dashed color-mix(in srgb, var(--accent) 50%, transparent); color: var(--accent);
    font-size: 13px; font-weight: 800; letter-spacing: .05em;
}
.code-pill .ic { width: 13px; height: 13px; }
.test-card-top .badge { margin-left: auto; }
.test-card-title { font-size: 17px; white-space: normal; }
.test-card-time {
    display: flex; align-items: center; gap: 10px; margin-top: 4px; padding: 10px 12px;
    border-radius: var(--r); background: var(--surface);
}
.test-card-time > .ic { width: 20px; height: 20px; color: var(--muted); }
.test-card-clock { display: block; font-size: 20px; font-weight: 750; letter-spacing: .02em; line-height: 1.1; }
.test-card-caption { display: block; font-size: 12.5px; color: var(--muted); }
.test-card.is-active .test-card-time { background: var(--accent-soft); }
.test-card.is-active .test-card-time > .ic { color: var(--accent); }
.test-card-time.is-ending { background: var(--wrong-soft) !important; color: var(--color-wrong); }
.test-card-time.is-ending > .ic, .test-card-time.is-ending .test-card-caption { color: inherit; }
.time-bar { display: block; height: 5px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.time-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width 1s linear; }
.card > .chips:last-child { margin-bottom: 0; }

/* ---------- topshirildi ---------- */

.done .done-check {
    width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; margin-bottom: var(--space-3);
    background: var(--correct-soft); color: var(--color-correct);
    box-shadow: 0 0 0 10px color-mix(in srgb, var(--correct-soft) 50%, transparent);
    animation: pop 420ms cubic-bezier(.2, .9, .3, 1.3) both;
}
.done .done-check .ic { width: 42px; height: 42px; stroke-width: 2.4; }
.done .button { margin-top: var(--space-4); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* ---------- modal va toast ---------- */

.modal-overlay {
    position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center;
    background: rgba(14, 16, 30, .42); padding: var(--space-4);
    animation: fade-in var(--duration) ease-out;
}
.modal {
    width: 100%; max-width: 420px; max-height: 85vh; overflow: auto;
    background: var(--bg); color: var(--text); border-radius: 22px; padding: var(--space-5);
    box-shadow: var(--shadow-lift);
    animation: slide-up 220ms cubic-bezier(.2, .8, .3, 1);
}
@media (min-width: 768px) { .modal-overlay { align-items: center; } }
.modal-text { margin: 0 0 var(--space-5); line-height: 1.55; font-size: 16px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); font-size: 17px; }
.modal-actions { display: flex; gap: var(--space-2); margin-top: var(--space-3); }
.modal-actions .button { flex: 1; }
.toast {
    position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%);
    z-index: 110; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: var(--r);
    background: var(--text); color: var(--bg); font-size: 14.5px; font-weight: 500;
    box-shadow: var(--shadow-lift); transition: opacity .3s;
}
.toast-hide { opacity: 0; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes slide-up { from { transform: translateY(28px); opacity: 0; } }

/* ---------- test yechish (§6.4) ---------- */

.solving .app { padding: 0; max-width: none; }
.solve {
    position: fixed; inset: 0; z-index: 30;
    height: var(--tg-viewport-stable-height, 100dvh);
    display: flex; flex-direction: column; background: var(--bg);
}
.solve-top {
    display: grid; grid-template-columns: 1fr auto; gap: 6px var(--space-3); align-items: center;
    padding: var(--space-3) var(--space-4) 10px;
    border-bottom: 1px solid var(--line);
}
.solve-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 999px; background: var(--surface);
    font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.timer .ic { width: 17px; height: 17px; color: var(--muted); }
.timer-warn { background: var(--warning-soft); color: var(--color-warning); }
.timer-warn .ic { color: inherit; }
.timer-danger { background: var(--wrong-soft); color: var(--color-wrong); animation: blink 1s ease-in-out infinite; }
.timer-danger .ic { color: inherit; }
@keyframes blink { 50% { opacity: .55; } }
/* Berilgan vaqt — qolgan vaqt yonida, kichikroq. */
.timer-of { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.timer-warn .timer-of, .timer-danger .timer-of { color: inherit; opacity: .8; }
@media (max-width: 420px) { .timer-of { display: none; } }
.solve-progress { display: flex; align-items: center; gap: var(--space-3); font-size: 13px; font-weight: 600; }
.progress-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface); overflow: hidden; }
.progress-bar-fill { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--accent); transition: width 260ms ease-out; }
.save-status { font-size: 12.5px; color: var(--muted); text-align: right; }
.save-status[data-state="offline"] { color: var(--color-warning); font-weight: 600; }

/* Test fayli paneli: avval yuklab olish, keyin ochish. Fayl o'zi ochilib turmaydi. */
.file-bar {
    display: flex; align-items: center; gap: var(--space-3);
    padding: 10px var(--space-4); border-bottom: 1px solid var(--line); background: var(--bg);
}
.file-tile {
    width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center;
    border-radius: var(--r); background: var(--accent-soft); color: var(--accent);
}
.file-info { flex: 1; min-width: 0; }
.file-name { font-weight: 650; font-size: 15px; }
.file-hint { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.file-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.file-button { min-height: 40px; padding: 0 var(--space-4); font-size: 14.5px; }
.file-button .ic { width: 18px; height: 18px; }
.file-again { color: var(--muted); }
@media (max-width: 420px) { .file-hint { display: none; } }

.solve-body { position: relative; flex: 1; min-height: 0; display: flex; }
.pdf-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--surface); }
.pdf-close {
    display: inline-flex; align-items: center; gap: 6px; margin-left: 4px;
    min-height: 36px; padding: 0 12px; border: 0; border-radius: var(--r-sm);
    background: var(--text); color: var(--bg); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.pdf-close .ic { width: 16px; height: 16px; }
.pdf-toolbar {
    display: flex; align-items: center; gap: 2px; padding: 4px var(--space-2);
    background: var(--bg); border-bottom: 1px solid var(--line);
}
.pdf-toolbar .spacer { flex: 1; }
.page-info { font-size: 13.5px; font-weight: 600; color: var(--muted); min-width: 60px; text-align: center; }
.pdf-scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: var(--space-3); padding-bottom: 50vh; }
.pdf-pages { width: 100%; transform-origin: top left; }
.pdf-page {
    width: 100%; margin: 0 auto var(--space-3); background: #fff; border-radius: 6px; overflow: hidden;
    box-shadow: 0 0 0 1px var(--line), 0 2px 8px rgba(20, 22, 43, .06);
}
.pdf-page canvas { display: block; width: 100% !important; height: auto !important; }
.skeleton-page { height: 70vh; }

/* Javoblar varaqasi — test yechish ekranining asosiy qismi. */
.sheet { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.sheet-handle { display: flex; align-items: center; gap: var(--space-2); min-height: 52px; padding: 6px var(--space-4) 0; }
.sheet-title { font-weight: 650; }
.sheet-progress { color: var(--muted); font-size: 14px; font-weight: 600; flex: 1; }
.sheet-body { flex: 1; overflow-y: auto; padding: 0 var(--space-4) calc(var(--space-6) + env(safe-area-inset-bottom)); overscroll-behavior: contain; }

/* Telefonda ochilgan fayl — varaq ustida to'liq ekran, "Yopish" bilan. */
@media (max-width: 767.98px) {
    .pdf-pane { position: absolute; inset: 0; z-index: 10; }
}

.sheet-section {
    margin: var(--space-4) 0 var(--space-1); padding: 6px 10px; border-radius: var(--r-sm);
    font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface);
}
.q-row {
    display: flex; align-items: center; gap: var(--space-3);
    padding: 8px 6px; border-radius: var(--r);
    transition: background var(--duration);
}
.q-row + .q-row { border-top: 1px solid var(--line); border-radius: 0; }
.q-row.flash { background: var(--marker-soft); }
.q-num { width: 2.4em; flex-shrink: 0; text-align: right; font-weight: 650; color: var(--muted); }
.q-row.answered .q-num { color: var(--text); }

/* Javob variantlari — javoblar varaqasidagi doirachalar. */
.options { display: flex; gap: 10px; flex-wrap: wrap; }
.opt {
    width: 44px; height: 44px; border-radius: 50%;
    border: 1.5px solid var(--line-strong);
    background: var(--bg); color: var(--muted); font: inherit; font-weight: 650; font-size: 16px; cursor: pointer;
    transition: background 140ms, color 140ms, border-color 140ms, transform 140ms;
}
.opt:hover { border-color: var(--accent); color: var(--accent); }
.opt:active { transform: scale(.92); }
.opt[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.written-input { flex: 1; min-height: 48px; }
/* Formula maydoni (MathLive, §6.4) — oddiy maydon bilan bir xil ko'rinish. */
.q-row math-field.math-input {
    flex: 1; min-width: 0; min-height: 48px; padding: 8px 12px; font-size: 20px;
    border: 1.5px solid var(--line-strong); border-radius: var(--r);
    background: var(--bg); color: var(--text);
    --caret-color: var(--accent); --selection-background-color: var(--accent-soft);
    --contains-highlight-background-color: transparent; --placeholder-color: var(--muted);
}
.q-row math-field.math-input:focus-within { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.q-row math-field::part(virtual-keyboard-toggle), .q-row math-field::part(menu-toggle) { display: none; }
.submit-button { margin-top: var(--space-6); }

/* Javob klaviaturasi (math-input.js, keypad): raqamlar va formula belgilari bitta oynada.
   Kompyuterda — maydon ostida, telefonda — ekran pastida (.math-pad-sheet). */
.math-pad {
    position: fixed; z-index: 1060; width: 360px; max-width: calc(100vw - 16px);
    display: grid; gap: 6px; padding: 8px 10px 10px;
    background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--shadow-lift);
    animation: pad-in .14s ease-out;
}
@keyframes pad-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes pad-up { from { opacity: 0; transform: translateY(24px); } }
.math-pad-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-left: 4px; }
.math-pad-title { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.math-pad-close {
    display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
    background: var(--surface); color: var(--text); cursor: pointer; touch-action: manipulation;
}
.math-pad-close:hover { background: var(--wrong-soft); color: var(--color-wrong); }
.math-pad-close .ic { width: 18px; height: 18px; vertical-align: 0; }
.math-pad-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.math-key {
    display: flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0;
    border: 1px solid var(--line); border-radius: var(--r-sm);
    background: var(--bg); color: var(--text);
    font: inherit; font-size: 17px; font-weight: 600; cursor: pointer; touch-action: manipulation;
    user-select: none; -webkit-user-select: none;
    transition: background .12s, border-color .12s, transform .08s;
}
.math-key-digit { font-size: 19px; font-weight: 650; }
.math-key-op { background: var(--surface); color: var(--accent); }
.math-key-nav { background: var(--surface); }
.math-key:hover { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--accent); }
.math-key:active { transform: scale(.95); }
.math-key .ic { width: 19px; height: 19px; vertical-align: 0; }
.math-pad-nav { grid-template-columns: 1fr 1fr 2fr; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 2px; }
.math-key-done { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-size: 15px; }
.math-key-done:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.math-pad-sheet {
    left: 0 !important; right: 0; bottom: 0; top: auto !important;
    width: 100%; max-width: none; border-radius: 20px 20px 0 0; border-bottom: 0;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    animation: pad-up .2s cubic-bezier(.2, .8, .3, 1);
}
.math-pad-sheet .math-key { height: 48px; }
.closed .opt, .closed .written-input, .closed math-field { pointer-events: none; opacity: .55; }

.navigator { max-width: 480px; }
.nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: var(--space-2); margin-bottom: var(--space-4); }
.nav-cell {
    height: 46px; border-radius: 50%; font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
    border: 1.5px solid var(--line-strong); background: var(--bg); color: var(--text);
    aspect-ratio: 1; justify-self: center; width: 46px;
}
.nav-cell:hover { border-color: var(--accent); }
.nav-cell.answered { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.solve-banner {
    display: flex; align-items: center; justify-content: center; gap: var(--space-2);
    padding: 8px var(--space-4); font-size: 13.5px; text-align: center;
    background: var(--warning-soft); color: var(--color-warning); font-weight: 500;
}
.kbd-hint { display: none; font-size: 12.5px; color: var(--muted); margin-top: var(--space-3); padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface); }
/* Joriy savol (klaviatura bilan ishlaganda) — marker bilan belgilanadi. */
.q-row.current { background: var(--marker-soft); box-shadow: inset 3px 0 0 var(--marker); }

/* Planshet va kompyuter: chapda PDF, o'ngda javoblar varaqasi (§6.4, §8.2). */
@media (min-width: 768px) {
    .solve-top { grid-template-columns: 1fr auto minmax(180px, 240px) auto; padding-bottom: var(--space-3); }
    /* Fayl yopiq: varaq ekran markazida. Fayl ochiq: chapda PDF, o'ngda varaq. */
    .sheet { max-width: 680px; margin: 0 auto; }
    .pdf-pane:not([hidden]) + .sheet { flex: 0 0 400px; max-width: none; margin: 0; border-left: 1px solid var(--line); }
    .pdf-scroll { padding-bottom: var(--space-3); }
    .file-bar { padding-left: max(var(--space-4), calc((100% - 680px) / 2)); padding-right: max(var(--space-4), calc((100% - 680px) / 2)); }
}
@media (min-width: 1024px) and (pointer: fine) {
    .kbd-hint { display: block; }
    [data-platform="web"] .pdf-pane:not([hidden]) + .sheet { flex-basis: 40%; min-width: 400px; max-width: 560px; }
}
@media not all and (pointer: fine) { .q-row.current { box-shadow: none; background: transparent; } }

/* ---------- asosiy tugma: web saytda va eski Telegram'da sahifa pastida ---------- */

.main-action {
    position: sticky; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 10;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 28%, transparent);
}
@media (min-width: 768px) { .main-action { bottom: var(--space-4); } }

/* ---------- Telegram ichida ---------- */

[data-platform="telegram"] .app { padding-top: var(--space-4); }

/* =====================================================================
   Web sayt (§6.9): sarlavha paneli, keng ekran.
   ===================================================================== */

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.input:focus-visible { outline: none; }

.site-header {
    position: sticky; top: 0; z-index: 25;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: saturate(1.6) blur(12px);
    -webkit-backdrop-filter: saturate(1.6) blur(12px);
    border-bottom: 1px solid var(--line);
}
.site-header-inner {
    display: flex; align-items: center; gap: var(--space-3);
    max-width: 960px; margin: 0 auto; padding: 8px var(--space-4); min-height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: -.01em; min-width: 0; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark {
    width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; border-radius: 11px;
    background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 18px;
    box-shadow: inset 0 -3px 0 var(--marker);
}
.brand-mark-lg { width: 60px; height: 60px; border-radius: 18px; font-size: 30px; box-shadow: inset 0 -5px 0 var(--marker); }

/* Markaz logosi (SVG): yorug' fonda rangli, qorong'i rejimda oq variant. */
.brand-logo { --logo-h: 30px; display: inline-flex; align-items: center; gap: calc(var(--logo-h) * .3); color: var(--brand-ink, var(--text)); }
.brand-word { font-size: calc(var(--logo-h) * .66); font-weight: 800; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
.brand-logo img { display: block; height: var(--logo-h); width: auto; }
.brand-logo .logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-color-scheme="light"]) .brand-logo .logo-light { display: none; }
    :root:not([data-color-scheme="light"]) .brand-logo .logo-dark { display: block; }
}
:root[data-color-scheme="dark"] .brand-logo .logo-light { display: none; }
:root[data-color-scheme="dark"] .brand-logo .logo-dark { display: block; }
.login-brand .brand-logo { --logo-h: 46px; }

/* Kun/tun tugmasi: yorug' rejimda oy (tunga o'tish), qorong'ida quyosh. */
.theme-toggle { color: var(--muted); }
.theme-toggle:hover { color: var(--text); }
.theme-toggle .ic-sun { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-color-scheme="light"]) .theme-toggle .ic-moon { display: none; }
    :root:not([data-color-scheme="light"]) .theme-toggle .ic-sun { display: block; }
}
:root[data-color-scheme="dark"] .theme-toggle .ic-moon { display: none; }
:root[data-color-scheme="dark"] .theme-toggle .ic-sun { display: block; }

/* Telegram ichida: logo va kun/tun tugmasi tepada bitta qatorda. */
.app-topbar {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
    margin: calc(-1 * var(--space-2)) 0 var(--space-3);
}
.app-topbar .brand-logo { --logo-h: 32px; }
.app-topbar .theme-toggle { margin-right: -10px; }
/* "Orqaga" (ichki ekranlarda): logo o'rnini egallaydi — tugma katta va barmoq bilan bosishga qulay. */
.topbar-back {
    display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 14px 0 8px;
    border: 0; border-radius: 999px; background: var(--surface); color: var(--text);
    font: inherit; font-size: 15px; font-weight: 650; cursor: pointer;
}
.topbar-back[hidden] { display: none; }
.topbar-back .ic { width: 20px; height: 20px; }
.topbar-back:active { transform: scale(.97); }
.app-topbar.has-back .brand-logo { display: none; }

/* Kirish sahifasi: o'ng yuqori burchakda. */
.site-theme-toggle {
    position: fixed; z-index: 30;
    top: max(var(--space-3), env(safe-area-inset-top)); right: var(--space-3);
}

.site-nav { display: none; gap: 4px; margin-left: auto; }
.site-nav a {
    position: relative; display: inline-flex; align-items: center; gap: 8px;
    min-height: 40px; padding: 0 var(--space-3); border-radius: var(--r-sm);
    color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px;
}
.site-nav a .ic { width: 18px; height: 18px; }
.site-nav a:hover { color: var(--text); background: var(--surface); }
/* Faol bo'lim — marker bilan chizilgan. */
.site-nav a.active {
    color: var(--text);
    background: linear-gradient(transparent 58%, var(--marker) 58%, var(--marker) 88%, transparent 88%) no-repeat;
    background-size: calc(100% - 24px) 100%; background-position: 12px 0;
}
.header-theme { margin-left: auto; }
.header-logout { color: var(--muted); }
.header-logout:hover { color: var(--text); background: var(--surface); }
.header-back { margin-left: -10px; }

@media (max-width: 420px) { .header-logout .label { display: none; } }

@media (min-width: 768px) {
    .site-nav { display: flex; }
    .header-theme { margin-left: 0; }
    /* Kompyuterda sarlavhadagi menyu yetarli — pastki menyu faqat telefonda. */
    [data-platform="web"] .tabbar { display: none !important; }
    [data-platform="web"] .app { padding-bottom: var(--space-8); }
}

@media (min-width: 1024px) {
    [data-platform="web"] .app { max-width: 960px; padding: var(--space-8) var(--space-6); }
    [data-platform="web"] .title { font-size: 32px; }
    [data-platform="web"] .code-form { max-width: 560px; }
    [data-platform="web"] .home-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 var(--space-6); }
    [data-platform="web"] .home-grid > .section:last-child { grid-column: 1 / -1; }
}

.profile-actions .button { justify-content: center; }

/* Profil: yo'riqnoma (ochiladigan karta). */
.help-card > summary {
    display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none;
    font-weight: 600; min-height: 28px;
}
.help-card > summary::-webkit-details-marker { display: none; }
.help-card > summary > span { flex: 1; }
.help-card > summary .ic:first-child { color: var(--muted); }
.help-card > summary .ic:last-child { color: var(--muted); transition: transform var(--duration); }
.help-card[open] > summary .ic:last-child { transform: rotate(90deg); }
.help-body { margin: var(--space-3) 0 0; white-space: pre-line; line-height: 1.6; }

/* ---------- kirish sahifasi (§3.3) ---------- */

.site-page, [data-platform="web"] .app.site-page { max-width: 460px; padding-top: max(var(--space-8), 8vh); }
.login-brand { display: grid; justify-items: start; gap: 10px; margin-bottom: var(--space-6); }
.login-title { margin: 0; font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.login-card { padding: var(--space-6) var(--space-5); border-radius: 22px; }
.login-card form { display: grid; gap: var(--space-2); }
.login-subtitle { margin-bottom: var(--space-5); font-size: 15px; }
.login-submit { margin-top: var(--space-2); }
.login-note { margin: var(--space-2) 0 0; font-size: 13px; text-align: center; }
.login-bot { display: flex; justify-content: center; margin: var(--space-3) auto 0; }
.login-links { display: flex; justify-content: space-between; flex-wrap: wrap; margin-top: var(--space-2); }
.login-name { font-weight: 700; font-size: 18px; margin: 0 0 var(--space-2); }
.widget-host { min-height: 48px; display: flex; justify-content: center; margin-bottom: var(--space-3); }
.section-heading { font-size: 20px; letter-spacing: -.01em; margin: 0 0 var(--space-2); }
.code-input { font-size: 26px; font-weight: 700; letter-spacing: .45em; text-align: center; }
.check { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.divider { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-3) 0; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.notice-error { text-align: left; }
.waiting { display: flex; align-items: center; justify-content: center; gap: var(--space-2); margin-top: var(--space-4); color: var(--muted); font-size: 14px; }
.spinner {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid var(--line-strong); border-top-color: var(--accent);
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.dev-card { border-style: dashed !important; display: grid; justify-items: start; margin-top: var(--space-4); }

/* Bot orqali kirish ("sonni moslash"). */
.button-telegram { min-height: 54px; font-size: 16.5px; margin-bottom: var(--space-2); }
.login-other { display: flex; margin: 0 auto; }
.bot-wait { display: grid; gap: var(--space-3); text-align: center; }
.bot-number {
    justify-self: center; min-width: 150px; padding: 10px 28px; border-radius: 22px;
    font-size: 64px; font-weight: 800; letter-spacing: .08em; line-height: 1.05;
    background: var(--accent-soft); color: var(--accent);
    border: 2px dashed color-mix(in srgb, var(--accent) 45%, transparent);
}
.bot-steps { margin: 0; padding-left: 1.3em; text-align: left; color: var(--muted); font-size: 14.5px; display: grid; gap: 4px; }
.bot-wait .waiting { margin-top: 0; }
.bot-wait .login-links { margin-top: 0; }

/* ---------- bosh sahifa: markaz logosi va nomi, kirish oynasi ---------- */

.landing-header .site-header-inner { max-width: 1120px; }
.landing-header .brand-logo { --logo-h: 28px; }
.landing-actions { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.landing-signin { min-height: 42px; padding: 0 18px; border-radius: 999px; font-size: 15px; }
.landing-signin .ic { width: 18px; height: 18px; }

.landing-hero {
    position: relative; isolation: isolate; overflow: hidden;
    display: grid; place-items: center;
    min-height: calc(100svh - 64px - 57px);
    padding: 72px var(--space-4);
}

/* Fon: qog'oz nuqtalari, brend rangidagi yumshoq nur va markazdan tarqaluvchi halqalar (javob doirachalari motivi). */
.landing-backdrop { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.landing-backdrop::before {
    content: ""; position: absolute; inset: 0;
    background-image: radial-gradient(color-mix(in srgb, var(--text) 16%, transparent) 1px, transparent 1.4px);
    background-size: 22px 22px; background-position: center;
    -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 50%, #000 15%, transparent 72%);
    mask-image: radial-gradient(ellipse 62% 58% at 50% 50%, #000 15%, transparent 72%);
}
.landing-glow {
    position: absolute; left: 50%; top: 50%; width: min(680px, 120vw); aspect-ratio: 1;
    transform: translate(-50%, -50%); border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent) 0%, transparent 62%);
}
.landing-ring {
    position: absolute; left: 50%; top: 50%; aspect-ratio: 1; border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}
.landing-ring-1 { width: min(380px, 86vw); }
.landing-ring-2 { width: min(600px, 128vw); border-color: color-mix(in srgb, var(--accent) 13%, transparent); }
.landing-ring-3 { width: min(840px, 170vw); border-color: color-mix(in srgb, var(--line-strong) 60%, transparent); border-style: dashed; }
/* Halqalar bo'ylab sekin aylanuvchi nuqtalar. */
.landing-ring-1::after, .landing-ring-2::after {
    content: ""; position: absolute; top: -5px; left: calc(50% - 5px);
    width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 16%, transparent);
}
.landing-ring-2::after { width: 8px; height: 8px; top: -4px; left: calc(50% - 4px); background: var(--select); box-shadow: none; }
.landing-ring-1 { animation: orbit 46s linear infinite; }
.landing-ring-2 { animation: orbit 70s linear infinite reverse; }
@keyframes orbit { to { transform: translate(-50%, -50%) rotate(360deg); } }

.landing-hero-inner { display: grid; justify-items: center; text-align: center; max-width: 820px; }
.landing-logo .brand-logo { --logo-h: clamp(64px, 15vw, 116px); }
.landing-rule {
    display: block; width: 56px; height: 4px; margin: clamp(22px, 4vw, 32px) 0;
    border-radius: 999px; background: var(--accent);
}
.landing-name {
    margin: 0; max-width: 18ch;
    font-size: clamp(30px, 6.2vw, 60px); line-height: 1.08; font-weight: 750; letter-spacing: -.03em;
    text-wrap: balance;
}
.landing-logo, .landing-rule, .landing-name { animation: rise 640ms cubic-bezier(.2, .8, .3, 1) both; }
.landing-rule { animation-delay: 120ms; }
.landing-name { animation-delay: 200ms; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.landing-footer {
    border-top: 1px solid var(--line); padding: var(--space-4);
    text-align: center; font-size: 13px; color: var(--muted);
}

/* Kirish oynasi (dialog): telefonda pastdan chiquvchi panel, kompyuterda markazda. */
.login-dialog {
    width: min(460px, calc(100% - 24px)); max-width: none; max-height: calc(100dvh - 24px);
    padding: 0; border: 1px solid var(--line); border-radius: 24px; overflow: auto; overscroll-behavior: contain;
    background: var(--bg); color: var(--text);
    box-shadow: var(--shadow-lift), 0 32px 80px rgba(10, 12, 14, .28);
}
.login-dialog::backdrop {
    background: rgba(14, 18, 16, .5);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.login-dialog[open] { animation: dialog-in 240ms cubic-bezier(.2, .8, .3, 1); }
.login-dialog[open]::backdrop { animation: fade-in var(--duration) ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.login-dialog-body { padding: var(--space-6) var(--space-6) var(--space-5); }
.login-dialog-close { position: absolute; top: 14px; right: 14px; color: var(--muted); }
.login-dialog-close:hover { color: var(--text); }
.login-dialog .login-brand { margin-bottom: var(--space-5); padding-right: 44px; }
.login-dialog .login-brand .brand-logo { --logo-h: 38px; }
.login-dialog .login-title { font-size: 15px; }
.login-dialog-body:focus { outline: none; }
.login-dialog .login-card { border: 0; padding: 0; margin: 0; background: none; border-radius: 0; }
html:has(.login-dialog[open]) { overflow: hidden; }

@media (max-width: 560px) {
    .landing-signin { padding: 0 14px; }
    .login-dialog {
        width: 100%; max-height: 92dvh; margin: auto 0 0;
        border-radius: 24px 24px 0 0; padding-bottom: env(safe-area-inset-bottom);
    }
    .login-dialog[open] { animation: slide-up 260ms cubic-bezier(.2, .8, .3, 1); }
    .login-dialog-body { padding: var(--space-5) var(--space-4) var(--space-5); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =====================================================================
   O'quvchi: profil kartasi, ko'rsatkichlar, natijalar diagrammalari, sozlamalar ro'yxati
   ===================================================================== */

:root {
    --tone-blue: #2a78d6; --tone-blue-soft: #e8f0fb;
    --tone-violet: #6a3fc8; --tone-violet-soft: #f0ebfb;
    --tone-green: #11825a; --tone-green-soft: #e5f4ed;
    --tone-amber: #b25e00; --tone-amber-soft: #fdf1e2;
    --tone-red: #d0343e; --tone-red-soft: #fcebec;
    --tone-sky: #0b7fa8; --tone-sky-soft: #e3f3f9;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-color-scheme="light"]) {
        --tone-blue: #6ea8ff; --tone-blue-soft: rgba(110, 168, 255, .14);
        --tone-violet: #b99bff; --tone-violet-soft: rgba(185, 155, 255, .14);
        --tone-green: #4fd08f; --tone-green-soft: rgba(79, 208, 143, .14);
        --tone-amber: #f2ad5f; --tone-amber-soft: rgba(242, 173, 95, .14);
        --tone-red: #ff7d84; --tone-red-soft: rgba(255, 125, 132, .14);
        --tone-sky: #5cc8ee; --tone-sky-soft: rgba(92, 200, 238, .14);
    }
}
:root[data-color-scheme="dark"] {
    --tone-blue: #6ea8ff; --tone-blue-soft: rgba(110, 168, 255, .14);
    --tone-violet: #b99bff; --tone-violet-soft: rgba(185, 155, 255, .14);
    --tone-green: #4fd08f; --tone-green-soft: rgba(79, 208, 143, .14);
    --tone-amber: #f2ad5f; --tone-amber-soft: rgba(242, 173, 95, .14);
    --tone-red: #ff7d84; --tone-red-soft: rgba(255, 125, 132, .14);
    --tone-sky: #5cc8ee; --tone-sky-soft: rgba(92, 200, 238, .14);
}

/* ---------- profil kartasi ---------- */
.hero-card {
    display: flex; align-items: center; gap: 14px; margin-bottom: var(--space-4); padding: 14px;
    border: 1px solid var(--line); border-radius: var(--r-lg);
    background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg) 75%);
    color: var(--text); text-decoration: none; transition: border-color var(--duration);
}
a.hero-card:hover { border-color: var(--accent); }
a.hero-card:active { transform: scale(.995); }
.hero-avatar { flex-shrink: 0; }
.avatar-hero { width: 64px; height: 64px; font-size: 22px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent-soft); }
.avatar.has-photo { overflow: hidden; background: var(--bg-soft, var(--bg)); }
.avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.hero-avatar-edit {
    position: relative; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.hero-avatar-edit:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.hero-avatar-edit:active .avatar { transform: scale(.96); }
.avatar-badge {
    position: absolute; right: -4px; bottom: -4px; width: 26px; height: 26px; display: grid; place-items: center;
    border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 2px var(--bg);
}
.avatar-badge .ic { width: 15px; height: 15px; }
.hero-text { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; flex: 1; }
.role-pill {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
    background: var(--bg); border: 1px solid var(--line); color: var(--accent); font-size: 11.5px; font-weight: 700;
}
.role-pill .ic { width: 12px; height: 12px; }
.hero-name { max-width: 100%; font-size: 21px; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.hero-sub { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; color: var(--muted); font-size: 13.5px; }
.hero-sub .ic { width: 14px; height: 14px; flex-shrink: 0; }
.hero-go .ic { width: 22px; height: 22px; color: var(--muted); }
.group-hero-icon {
    width: 60px; height: 60px; flex-shrink: 0; display: grid; place-items: center; border-radius: 18px;
    background: var(--accent); color: var(--accent-ink);
}
.group-hero-icon .ic { width: 28px; height: 28px; }

/* ---------- ko'rsatkich plitalari ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); margin-bottom: var(--space-4); }
.kpi-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .kpi-grid:not(.kpi-grid-3) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi-tile {
    position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px;
    border: 1px solid var(--line); border-radius: var(--r); background: var(--bg);
    color: var(--text); text-decoration: none; transition: border-color var(--duration);
}
a.kpi-tile:hover { border-color: var(--accent); }
a.kpi-tile:active { transform: scale(.98); }
.kpi-tile-icon {
    width: 32px; height: 32px; display: grid; place-items: center; margin-bottom: 6px; border-radius: 10px;
    background: var(--accent-soft); color: var(--accent);
}
.kpi-tile-icon .ic { width: 17px; height: 17px; }
.kpi-tile-value { font-size: 20px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.kpi-tile-label { color: var(--muted); font-size: 12px; line-height: 1.25; }
.kpi-tile-go { position: absolute; top: 12px; right: 10px; color: var(--line-strong); }
.kpi-tile-go .ic { width: 16px; height: 16px; }
.kpi-tile.score-high .kpi-tile-value { color: var(--color-correct); }
.kpi-tile.score-mid .kpi-tile-value { color: var(--color-warning); }
.kpi-tile.score-low .kpi-tile-value { color: var(--color-wrong); }

/* ---------- bo'lim sarlavhalari ---------- */
.section-icon {
    width: 28px; height: 28px; display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 9px;
    background: var(--accent-soft); color: var(--accent);
}
.section-icon .ic { width: 15px; height: 15px; }
.field-label .section-icon { margin-right: 6px; vertical-align: middle; }
.code-form .field-label { display: flex; align-items: center; }
.count-pill {
    min-width: 22px; height: 22px; padding: 0 7px; display: inline-grid; place-items: center; border-radius: 999px;
    background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 700;
}

/* ---------- natijalar: diagramma kartalari ---------- */
.chart-panel { display: grid; gap: var(--space-3); padding: var(--space-4); margin-bottom: var(--space-3); }
.chart-panel-head { display: flex; align-items: flex-start; gap: 10px; }
.chart-panel-icon { width: 34px; height: 34px; display: grid; place-items: center; flex-shrink: 0; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.chart-panel-icon .ic { width: 17px; height: 17px; }
.chart-panel-title { margin: 0; font-size: 16px; font-weight: 700; }
.chart-panel-hint { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.chart-pair { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin-bottom: var(--space-3); }
.chart-pair .chart-panel { margin: 0; }

.trend-chart { display: block; width: 100%; height: auto; overflow: visible; touch-action: manipulation; }
.trend-line-grid { stroke: var(--line); stroke-width: 1; }
.trend-line-good { stroke: var(--color-correct); stroke-width: 1; stroke-dasharray: 4 4; opacity: .55; }
.trend-line-mid { stroke: var(--color-warning); stroke-width: 1; stroke-dasharray: 4 4; opacity: .55; }
.trend-line-base { stroke: var(--line-strong); stroke-width: 1; }
.trend-axis { fill: var(--muted); font-size: 10px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.trend-area { fill: var(--accent); opacity: .08; }
.trend-path { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.trend-point { cursor: pointer; outline: none; }
.trend-hit { fill: transparent; }
.trend-dot { stroke: var(--bg); stroke-width: 2; transition: r .12s; }
.trend-point.score-high .trend-dot { fill: var(--color-correct); }
.trend-point.score-mid .trend-dot { fill: var(--color-warning); }
.trend-point.score-low .trend-dot { fill: var(--color-wrong); }
.trend-point:hover .trend-dot, .trend-point:focus .trend-dot { r: 7; }

.donut-row-app { display: flex; align-items: center; gap: var(--space-4); }
.donut-box { position: relative; width: 116px; flex-shrink: 0; }
.donut-svg { display: block; width: 100%; height: auto; transform: rotate(-90deg); }
.donut-track { fill: none; stroke: var(--surface); stroke-width: 14; }
.donut-seg { fill: none; stroke-width: 14; cursor: pointer; outline: none; transition: stroke-width .15s; }
.donut-seg:hover, .donut-seg:focus { stroke-width: 18; }
.seg-high { stroke: var(--color-correct); background: var(--color-correct); }
.seg-mid { stroke: var(--color-warning); background: var(--color-warning); }
.seg-low { stroke: var(--color-wrong); background: var(--color-wrong); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; line-height: 1.1; }
.donut-value { font-size: 24px; font-weight: 750; }
.donut-caption { color: var(--muted); font-size: 11px; }
.donut-legend-app { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; gap: 4px; min-width: 0; }
.donut-legend-app button {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--r-sm);
    background: none; color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer;
}
.donut-legend-app button:hover { background: var(--surface); }
.legend-dot { width: 10px; height: 10px; flex-shrink: 0; border-radius: 3px; }
.legend-label { flex: 1; min-width: 0; }

.type-bars { display: grid; gap: 8px; }
.type-bar { display: grid; grid-template-columns: 86px minmax(0, 1fr) 42px; align-items: center; gap: 10px; padding: 4px 0; cursor: pointer; outline: none; }
.type-bar-label { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; }
.type-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.type-easy { background: #1f9a6a; } .type-medium { background: #e0a83a; } .type-hard { background: #e0545c; } .type-mock { background: #6a3fc8; }
.type-bar-track { height: 10px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.type-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .4s ease; }
.type-bar-fill.score-high { background: var(--color-correct); }
.type-bar-fill.score-mid { background: var(--color-warning); }
.type-bar-fill.score-low { background: var(--color-wrong); }
.type-bar-value { text-align: right; font-weight: 700; font-size: 14px; }

.chips-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll .chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chip-count { min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--surface); font-size: 11.5px; font-weight: 700; }
.chip[aria-pressed="true"] .chip-count { background: rgba(255, 255, 255, .2); color: inherit; }

.chart-tip {
    position: fixed; z-index: 1000; max-width: 240px; display: grid; gap: 2px; padding: 8px 11px; border-radius: 10px;
    background: var(--text); color: var(--bg); font-size: 12.5px; line-height: 1.35; box-shadow: var(--shadow-lift); pointer-events: none;
}
.chart-tip[hidden] { display: none; }

/* ---------- sozlamalar va ma'lumotlar ro'yxati ---------- */
.settings-list { display: grid; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); overflow: hidden; margin-bottom: var(--space-2); }
.settings-row {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 10px 14px;
    border: 0; border-top: 1px solid var(--line); background: none; color: var(--text);
    font: inherit; text-align: left; text-decoration: none; cursor: pointer; transition: background var(--duration);
}
.settings-list > :first-child, .settings-list > :first-child > .settings-row { border-top: 0; }
.settings-list > .settings-details { border-top: 1px solid var(--line); }
.settings-list > .settings-details > .settings-row { border-top: 0; }
a.settings-row:hover, button.settings-row:hover, summary.settings-row:hover { background: var(--surface); }
.settings-row-static { cursor: default; flex-wrap: wrap; }
.settings-icon { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; border-radius: 11px; }
.settings-icon .ic { width: 18px; height: 18px; }
.tone-navy { background: var(--accent-soft); color: var(--accent); }
.tone-blue { background: var(--tone-blue-soft); color: var(--tone-blue); }
.tone-violet { background: var(--tone-violet-soft); color: var(--tone-violet); }
.tone-green { background: var(--tone-green-soft); color: var(--tone-green); }
.tone-amber { background: var(--tone-amber-soft); color: var(--tone-amber); }
.tone-red { background: var(--tone-red-soft); color: var(--tone-red); }
.tone-sky { background: var(--tone-sky-soft); color: var(--tone-sky); }
.tone-gray { background: var(--surface); color: var(--muted); }
.settings-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.settings-label { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.settings-hint { color: var(--muted); font-size: 12.5px; }
.settings-value { color: var(--muted); font-size: 13.5px; }
.settings-go .ic { width: 18px; height: 18px; color: var(--line-strong); }
.settings-row.is-danger .settings-label { color: var(--color-wrong); }
.settings-details > summary { list-style: none; }
.settings-details > summary::-webkit-details-marker { display: none; }
.settings-details[open] .settings-go .ic { transform: rotate(90deg); }
.settings-details .help-body { margin: 0; padding: 0 14px 14px 62px; white-space: pre-line; }

.segmented { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface); margin-left: auto; }
.segmented .chip { min-height: 32px; padding: 0 10px; border: 0; border-radius: 9px; background: none; display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
.segmented .chip .ic { width: 15px; height: 15px; }
.segmented .chip[aria-pressed="true"] { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(20, 22, 43, .1); }
@media (max-width: 420px) {
    .settings-row-static .segmented { width: 100%; margin-left: 48px; }
    .segmented .chip { flex: 1; justify-content: center; }
    .segmented .chip span { display: none; }
}
.group-hint { display: flex; gap: 10px; align-items: flex-start; padding: var(--space-3) var(--space-4); margin: var(--space-3) 0; }
.group-hint .ic { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent); margin-top: 2px; }

/* =====================================================================
   Kartalar tizimi (namuna: E-OFIS): kulrang fon, oq kartalar, rangli kvadrat ikonkalar,
   KATTA HARFLI bo'lim sarlavhalari, holat kartasi (halqa + 2×2), tez harakatlar.
   ===================================================================== */

:root {
    --page: #f2f5f9;
    --card: #ffffff;
    --card-border: transparent;
    --card-shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 6px 18px rgba(15, 27, 45, .05);
    --inset: #f5f7fb;
    --inset-strong: #e8edf4;
    --r-card: 20px;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-color-scheme="light"]) {
        --page: #0b1320;
        --card: #131d2e;
        --card-border: #1f2a3b;
        --card-shadow: none;
        --inset: rgba(255, 255, 255, .04);
        --inset-strong: rgba(255, 255, 255, .08);
    }
}
:root[data-color-scheme="dark"] {
    --page: #0b1320;
    --card: #131d2e;
    --card-border: #1f2a3b;
    --card-shadow: none;
    --inset: rgba(255, 255, 255, .04);
    --inset-strong: rgba(255, 255, 255, .08);
}

html.app-soft, html.app-soft body { background: var(--page); }

/* Kartalar: oq, soya bilan, chegara yo'q (qorong'ida — ingichka chegara). */
html.app-soft .card,
html.app-soft .kpi-tile,
html.app-soft .chart-panel,
html.app-soft .hero-card {
    background-color: var(--card); border-color: var(--card-border); box-shadow: var(--card-shadow); border-radius: var(--r-card);
}
html.app-soft .hero-card { background-image: linear-gradient(135deg, var(--accent-soft) 0%, var(--card) 75%); }
html.app-soft .empty-state { background: transparent; box-shadow: none; border-color: var(--line-strong); }

/* Ro'yxatlar: bitta ramka o'rniga — alohida kartalar oralig'i bilan. */
html.app-soft .list { border: 0; background: none; overflow: visible; gap: 10px; }
html.app-soft .list > .card { border: 1px solid var(--card-border); border-radius: var(--r-card); }
html.app-soft .list > .card + .card { border-top: 1px solid var(--card-border); }

html.app-soft .settings-list { border: 0; background: none; overflow: visible; gap: 10px; }
html.app-soft .settings-list > .settings-row,
html.app-soft .settings-list > .settings-details {
    border: 1px solid var(--card-border); border-radius: var(--r-card); background: var(--card); box-shadow: var(--card-shadow);
}
html.app-soft .settings-list > .settings-details > .settings-row { border: 0; border-radius: var(--r-card); }
html.app-soft .settings-row { min-height: 68px; padding: 12px 16px; gap: 14px; }
html.app-soft .settings-icon { width: 46px; height: 46px; border-radius: 15px; }
html.app-soft .settings-icon .ic { width: 21px; height: 21px; }
html.app-soft a.settings-row:hover, html.app-soft button.settings-row:hover, html.app-soft summary.settings-row:hover { background: var(--card); border-color: var(--line-strong); }

/* Filtr tugmalari: oq "tabletka", tanlangani — to'q fon. */
html.app-soft .chip { background: var(--card); border-color: var(--card-border); box-shadow: var(--card-shadow); font-weight: 600; }
html.app-soft .chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
html.app-soft .chip-count { background: var(--inset-strong); }

/* ---------- sahifa sarlavhasi ---------- */
.page-head { margin: 4px 0 18px; }
.page-title { margin: 0; font-size: 28px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; }
.page-sub { margin: 4px 0 0; color: var(--muted); font-size: 15px; }

/* ---------- bo'lim sarlavhasi ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 2px 10px; }
.section-label {
    display: flex; align-items: center; gap: 8px; margin: 0;
    color: var(--muted); font-size: 12.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
}
.section-label .count-pill { height: 20px; min-width: 20px; font-size: 11px; letter-spacing: 0; background: var(--inset-strong); }
.section-more { color: var(--tone-blue); font-size: 14px; font-weight: 650; text-decoration: none; }
.section-more:hover { text-decoration: underline; }
html.app-soft .section { margin-top: 26px; }

/* ---------- salomlashuv ---------- */
.greet { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; color: var(--text); text-decoration: none; }
.avatar-greet {
    width: 56px; height: 56px; border-radius: 18px; font-size: 19px;
    background: linear-gradient(135deg, var(--tone-blue), var(--accent)); color: var(--accent-ink);
    box-shadow: 0 6px 16px rgba(42, 120, 214, .25);
}
.avatar-greet.has-photo, .avatar-greet.has-photo img { border-radius: 18px; }
.greet-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.greet-hello { color: var(--muted); font-size: 14px; }
.greet-name { font-size: 20px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; overflow-wrap: anywhere; }
.greet-date { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; color: var(--muted); font-size: 13px; line-height: 1.35; }

/* ---------- belgi (pill) ---------- */
.pill {
    display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; min-height: 26px; padding: 0 10px;
    border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.pill-green { background: var(--tone-green-soft); color: var(--tone-green); }
.pill-amber { background: var(--tone-amber-soft); color: var(--tone-amber); }
.pill-red { background: var(--tone-red-soft); color: var(--tone-red); }
.pill-blue { background: var(--tone-blue-soft); color: var(--tone-blue); }
.pill-gray { background: var(--inset-strong); color: var(--muted); }
.text-green { color: var(--tone-green); }
.text-amber { color: var(--tone-amber); }
.text-red { color: var(--tone-red); }
.text-blue { color: var(--tone-blue); }

/* ---------- holat kartasi ---------- */
.status-card {
    margin-bottom: 18px; padding: 18px; border: 1px solid var(--card-border); border-radius: 24px;
    background: var(--card); box-shadow: var(--card-shadow);
}
.status-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.status-card-title { margin: 0; font-size: 16px; font-weight: 650; }
.status-card-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; }
.status-ring { position: relative; width: 122px; height: 122px; }
.status-ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.status-ring-track { fill: none; stroke: var(--inset-strong); stroke-width: 10; }
.status-ring-seg { fill: none; stroke-width: 10; }
.status-ring-svg.single .status-ring-seg { stroke-linecap: round; }
.seg-green { stroke: var(--tone-green); background: var(--tone-green); }
.seg-amber { stroke: var(--tone-amber); background: var(--tone-amber); }
.seg-red { stroke: var(--tone-red); background: var(--tone-red); }
.seg-accent { stroke: var(--tone-blue); background: var(--tone-blue); }
.status-ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.status-ring-value { font-size: 25px; font-weight: 750; letter-spacing: -.02em; }
.status-ring-caption { margin-top: 3px; color: var(--muted); font-size: 12px; }
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-tile {
    display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: 14px; background: var(--inset);
    color: var(--text); font: inherit; text-align: left; text-decoration: none;
    transition: border-color var(--duration);
}
a.mini-tile, button.mini-tile { cursor: pointer; }
a.mini-tile:hover, button.mini-tile:hover { border-color: var(--line-strong); }
a.mini-tile:active, button.mini-tile:active { transform: scale(.98); }
.mini-tile-value { font-size: 20px; font-weight: 750; letter-spacing: -.01em; line-height: 1.15; }
.mini-tile-label { color: var(--muted); font-size: 12px; line-height: 1.25; }
.status-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.status-legend-item {
    display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 11px;
    border: 0; border-radius: 999px; background: var(--inset); color: var(--text);
    font: inherit; font-size: 12.5px; cursor: pointer;
}
.status-legend-item .legend-label { flex: none; }
.status-legend-item:hover { background: var(--inset-strong); }
@media (max-width: 359px) {
    .status-card-body { grid-template-columns: 1fr; justify-items: center; }
    .mini-grid { width: 100%; }
}

/* ---------- tez harakatlar ---------- */
.quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 18px; }
.quick-action {
    display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 2px 0;
    border: 0; background: none; color: var(--text); font: inherit; text-align: center; text-decoration: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.quick-action-icon {
    width: 62px; height: 62px; display: grid; place-items: center; border-radius: 20px;
    box-shadow: var(--card-shadow); transition: transform var(--duration);
}
.quick-action-icon .ic { width: 26px; height: 26px; }
.quick-action:hover .quick-action-icon { transform: translateY(-1px); }
.quick-action:active .quick-action-icon { transform: scale(.94); }
.quick-action-label { font-size: 12.5px; font-weight: 550; line-height: 1.25; }

/* ---------- ro'yxat kartasi ---------- */
.list-card {
    display: flex; align-items: center; gap: 14px; width: 100%; min-height: 76px; padding: 14px 16px;
    border: 1px solid var(--card-border); border-radius: var(--r-card); background: var(--card); box-shadow: var(--card-shadow);
    color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
    transition: border-color var(--duration), transform var(--duration);
}
a.list-card:hover, button.list-card:hover { border-color: var(--line-strong); }
a.list-card:active, button.list-card:active { transform: scale(.99); }
.list-card.is-static { cursor: default; }
.list-card-icon { width: 48px; height: 48px; flex-shrink: 0; display: grid; place-items: center; border-radius: 15px; }
.list-card-icon .ic { width: 22px; height: 22px; }
.list-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list-card-title { font-size: 16px; font-weight: 650; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-card-sub { color: var(--muted); font-size: 13.5px; line-height: 1.35; }
.list-card-sub strong { color: var(--text); font-weight: 650; }
.list-card-go { display: grid; color: var(--muted); opacity: .7; }
.list-card-go .ic { width: 18px; height: 18px; }

/* Test kodi kartasi. */
.code-form-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.code-form-head .list-card-title { white-space: normal; }
