/* =====================================================================
   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); }
.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; } }
.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 { display: inline-flex; align-items: center; }
.brand-logo img { display: block; height: 30px; 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 img { height: 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 img { height: 32px; }
.app-topbar .theme-toggle { margin-right: -10px; }

/* 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); }

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

.landing-header .site-header-inner { max-width: 1120px; }
.landing-header .brand-logo img { height: 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 img { height: 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 img { height: 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; }
}
