/* ==========================================================================
   Банк задач — оформление
   Светлая и тёмная темы. Все цвета заданы переменными: тема переключается
   атрибутом data-theme на <html>, а значения подставляются из блоков ниже.
   ========================================================================== */

:root {
    color-scheme: light;

    --bg: #f5f6fb;
    --blob-1: rgba(99, 102, 241, .26);
    --blob-2: rgba(219, 39, 119, .16);
    --blob-4: rgba(59, 130, 246, .22);
    --blob-3: rgba(16, 185, 129, .18);
    --grid: rgba(15, 23, 42, .05);
    --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.07'/%3E%3C/svg%3E");
    --pattern: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='1300' height='800' viewBox='0 0 1300 800'><g stroke='%234f46e5' stroke-width='1.6' stroke-linecap='round' opacity='.12'><path d='M96 130h28M110 116v28 M290 90h20M300 80v20 M508 160h24M520 148v24 M750 110h20M760 100v20 M1016 150h28M1030 136v28 M180 330h20M190 320v20 M418 300h24M430 288v24 M890 330h20M900 320v20 M1138 380h24M1150 368v24 M118 620h24M130 608v24 M350 680h20M360 670v20 M626 600h28M640 586v28 M970 650h20M980 640v20 M1188 560h24M1200 548v24'/></g><g fill='none' stroke='%234f46e5' stroke-width='1.5' opacity='.07'><circle cx='1180' cy='120' r='170'/><circle cx='150' cy='700' r='210'/></g><text x='40' y='250' font-family='Georgia,serif' font-size='120' fill='%234f46e5' opacity='.10'>&%238721;</text><text x='1140' y='660' font-family='Georgia,serif' font-size='150' fill='%234f46e5' opacity='.10'>&%23960;</text><text x='620' y='110' font-family='Georgia,serif' font-size='90' fill='%234f46e5' opacity='.09'>&%238747;</text></svg>");

    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Manrope', 'Inter', system-ui, sans-serif;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --input-bg: #ffffff;

    --ink: #0f172a;
    --ink-2: #475569;
    --muted: #94a3b8;
    --line: #e6e9f2;
    --line-strong: #d5dbeb;
    --track: #e7eaf5;

    --brand: #4f46e5;
    --brand-2: #7c3aed;
    --brand-soft: #eef2ff;
    --brand-ink: #3730a3;

    --ok: #10b981;
    --ok-soft: #ecfdf5;
    --ok-ink: #047857;

    --warn: #f59e0b;
    --warn-soft: #fffbeb;
    --warn-ink: #b45309;

    --bad: #ef4444;
    --bad-soft: #fef2f2;
    --bad-ink: #b91c1c;

    --topbar-bg: rgba(255, 255, 255, .82);
    --footer-bg: rgba(255, 255, 255, .6);

    --radius: 18px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
    --shadow: 0 18px 40px -22px rgba(15, 23, 42, .35);
}

[data-theme="dark"] {
    color-scheme: dark;

    --bg: #0b1020;
    --blob-1: rgba(99, 102, 241, .40);
    --blob-2: rgba(219, 39, 119, .24);
    --blob-4: rgba(59, 130, 246, .34);
    --blob-3: rgba(16, 185, 129, .26);
    --grid: rgba(255, 255, 255, .06);
    --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.06'/%3E%3C/svg%3E");
    --pattern: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='1300' height='800' viewBox='0 0 1300 800'><g stroke='%23a5b4fc' stroke-width='1.6' stroke-linecap='round' opacity='.12'><path d='M96 130h28M110 116v28 M290 90h20M300 80v20 M508 160h24M520 148v24 M750 110h20M760 100v20 M1016 150h28M1030 136v28 M180 330h20M190 320v20 M418 300h24M430 288v24 M890 330h20M900 320v20 M1138 380h24M1150 368v24 M118 620h24M130 608v24 M350 680h20M360 670v20 M626 600h28M640 586v28 M970 650h20M980 640v20 M1188 560h24M1200 548v24'/></g><g fill='none' stroke='%23a5b4fc' stroke-width='1.5' opacity='.07'><circle cx='1180' cy='120' r='170'/><circle cx='150' cy='700' r='210'/></g><text x='40' y='250' font-family='Georgia,serif' font-size='120' fill='%23a5b4fc' opacity='.10'>&%238721;</text><text x='1140' y='660' font-family='Georgia,serif' font-size='150' fill='%23a5b4fc' opacity='.10'>&%23960;</text><text x='620' y='110' font-family='Georgia,serif' font-size='90' fill='%23a5b4fc' opacity='.09'>&%238747;</text></svg>");
    --surface: #131a2e;
    --surface-2: #1a2340;
    --input-bg: #0f1729;

    --ink: #e8ecf7;
    --ink-2: #a8b3cc;
    --muted: #7c88a3;
    --line: #232c47;
    --line-strong: #2f3a5c;
    --track: #1d2540;

    --brand: #6366f1;
    --brand-2: #8b5cf6;
    --brand-soft: rgba(99, 102, 241, .18);
    --brand-ink: #c7d2fe;

    --ok: #34d399;
    --ok-soft: rgba(16, 185, 129, .15);
    --ok-ink: #6ee7b7;

    --warn: #fbbf24;
    --warn-soft: rgba(245, 158, 11, .15);
    --warn-ink: #fcd34d;

    --bad: #f87171;
    --bad-soft: rgba(239, 68, 68, .16);
    --bad-ink: #fca5a5;

    --topbar-bg: rgba(11, 16, 32, .78);
    --footer-bg: rgba(11, 16, 32, .6);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow: 0 24px 60px -30px rgba(0, 0, 0, .95);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    color: var(--ink);
    background-color: var(--bg);
    background-image:
        var(--noise),
        var(--pattern),
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px),
        radial-gradient(780px 560px at 0% 0%, var(--blob-1), transparent 70%),
        radial-gradient(780px 540px at 100% 0%, var(--blob-2), transparent 70%),
        radial-gradient(780px 580px at 0% 100%, var(--blob-3), transparent 70%),
        radial-gradient(820px 560px at 100% 100%, var(--blob-4), transparent 70%);
    background-size:
        140px 140px,
        1300px 800px,
        34px 34px,
        34px 34px,
        auto, auto, auto, auto;
    background-position:
        0 0,
        center center,
        0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
    background-attachment: fixed, fixed, scroll, scroll, fixed, fixed, fixed, fixed;
    background-repeat: repeat, no-repeat, repeat, repeat, no-repeat, no-repeat, no-repeat, no-repeat;
    transition: background-color .25s ease, color .25s ease;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--brand-soft); color: var(--brand-ink); }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
    border-radius: 10px;
}

.container { width: 100%; max-width: 1060px; margin: 0 auto; padding: 0 22px; }
main { flex: 1 0 auto; }

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.02em; }

/* Кастомный скроллбар */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 99px;
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ---------- Шапка ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--topbar-bg);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.topbar::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand), var(--brand-2), transparent);
    opacity: .5;
    pointer-events: none;
}
.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 68px;
}
.topbar__actions { display: flex; align-items: center; gap: 10px; }

.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand__mark {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border-radius: 12px;
    color: #fff; font-weight: 700; font-size: 20px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 8px 18px -8px rgba(79, 70, 229, .9);
    transition: transform .25s ease;
}
.brand:hover .brand__mark { transform: rotate(-6deg); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; font-weight: 800; font-size: 15px; }
.brand__text small {
    font-weight: 600; font-size: 10.5px; letter-spacing: .08em;
    text-transform: uppercase; color: var(--muted);
}

/* Кнопка переключения темы */
.theme-toggle {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink-2);
    font-size: 17px; line-height: 1;
    cursor: pointer;
    transition: border-color .18s ease, transform .18s ease;
}
.theme-toggle:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.theme-toggle__icon--moon { display: inline; }
.theme-toggle__icon--sun { display: none; }
[data-theme="dark"] .theme-toggle__icon--moon { display: none; }
[data-theme="dark"] .theme-toggle__icon--sun { display: inline; }

/* Плашка пользователя */
.user-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 13px 5px 5px;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: var(--surface);
    color: var(--ink);
    font-size: 14px; font-weight: 600;
}
.user-chip:hover { text-decoration: none; border-color: var(--line-strong); }
.user-chip__avatar {
    width: 28px; height: 28px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff; font-size: 13px; font-weight: 800;
}

@media (max-width: 560px) {
    .brand__text small { display: none; }
    .user-chip__name { display: none; }
}

/* Узкие телефоны: шапка должна влезать целиком */
@media (max-width: 430px) {
    .topbar__inner { gap: 8px; }
    .topbar__actions { gap: 6px; }
    .brand__text { display: none; }
    .brand__mark { width: 36px; height: 36px; font-size: 18px; border-radius: 11px; }
    .theme-toggle { width: 36px; height: 36px; }
    .topbar .btn--sm { padding: 7px 10px; font-size: 13.5px; min-height: 34px; }
    .user-chip { padding: 4px; }
    .user-chip__avatar { width: 26px; height: 26px; }
}

/* ---------- Кнопки ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px;
    padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
    font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
    white-space: nowrap; text-decoration: none;
    transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease, color .2s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 12px 24px -14px rgba(79, 70, 229, 1);
}
.btn--primary::after {
    content: "";
    position: absolute;
    top: 0; left: -90%;
    width: 55%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
    transform: skewX(-20deg);
    transition: left .55s ease;
    pointer-events: none;
}
.btn--primary:hover { box-shadow: 0 16px 28px -14px rgba(79, 70, 229, 1); color: #fff; }
.btn--primary:hover::after { left: 140%; }
.btn--ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn--ghost:hover { border-color: var(--line-strong); color: var(--ink); }
.btn--light { background: #fff; color: #4338ca; box-shadow: 0 10px 22px -12px rgba(0, 0, 0, .4); }
.btn--light:hover { background: #eef2ff; color: #3730a3; }
.btn--outline-light { background: transparent; border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn--outline-light:hover { background: rgba(255, 255, 255, .12); border-color: #fff; color: #fff; }
.btn--sm { min-height: 36px; padding: 7px 14px; font-size: 14px; border-radius: 10px; }
.btn--block { width: 100%; }

/* ---------- Сообщения ---------- */
.alerts { display: flex; flex-direction: column; gap: 8px; padding-top: 18px; }

.alert { padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.alert--error { background: var(--bad-soft); border: 1px solid var(--bad); color: var(--bad-ink); }
.alert--ok { background: var(--ok-soft); border: 1px solid var(--ok); color: var(--ok-ink); }
.alert--info { background: var(--brand-soft); border: 1px solid var(--brand); color: var(--brand-ink); }

/* ---------- Первый экран ---------- */
.hero { padding: 32px 0 26px; }

.hero__banner {
    position: relative;
    z-index: -2;
    overflow: hidden;
    border-radius: 28px;
    padding: 52px 48px;
    color: #fff;
    background:
        radial-gradient(900px 360px at 88% -20%, rgba(219, 39, 119, .42), transparent 62%),
        radial-gradient(700px 320px at -10% 120%, rgba(16, 185, 129, .28), transparent 60%),
        linear-gradient(120deg, #4338ca, #6d28d9, #8b5cf6, #4338ca);
    background-size: auto, auto, 300% 300%;
    animation: heroShift 18s ease infinite;
    box-shadow: 0 40px 80px -40px rgba(79, 70, 229, 1);
}
@keyframes heroShift {
    0% { background-position: 0% 50%, 0% 50%, 0% 50%; }
    50% { background-position: 0% 50%, 0% 50%, 100% 50%; }
    100% { background-position: 0% 50%, 0% 50%, 0% 50%; }
}

.hero__kicker {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    font-size: 12px; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.hero__title {
    margin: 0 0 14px;
    font-size: clamp(34px, 5vw, 60px);
    line-height: 1.02; letter-spacing: -.045em; font-weight: 800;
    color: #fff;
}

.hero__sub {
    margin: 0 0 22px;
    max-width: 58ch;
    font-size: 17px; line-height: 1.6;
    color: rgba(255, 255, 255, .82);
}

.hero__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.hero__tag,
.hero__tags span {
    font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, .88);
    padding: 7px 13px; border-radius: 99px;
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .18);
    backdrop-filter: blur(4px);
}

.hero__decor { position: absolute; inset: 0; pointer-events: none; }
.hero__decor span {
    position: absolute;
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    color: rgba(255, 255, 255, .10);
    line-height: 1;
    user-select: none;
}
.hero__decor span:nth-child(1) { font-size: 190px; right: -18px; top: -32px; transform: rotate(12deg); }
.hero__decor span:nth-child(2) { font-size: 120px; left: 46%; top: -14px; transform: rotate(-8deg); }
.hero__decor span:nth-child(3) { font-size: 150px; right: 34%; bottom: -52px; transform: rotate(-6deg); }
.hero__decor span:nth-child(4) { font-size: 92px; left: -12px; bottom: -26px; transform: rotate(10deg); }

.hero__stats { margin: 0; }
.hero .stat {
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    backdrop-filter: blur(6px);
}
.hero .stat__value { color: #fff; }
.hero .stat__value span { color: rgba(255, 255, 255, .6); }
.hero .stat__label { color: rgba(255, 255, 255, .72); }

.hero__progress { background: rgba(255, 255, 255, .22); margin-top: 18px; }
.hero__progress .progress__bar { background: linear-gradient(90deg, #34d399, #a7f3d0); }

.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }

@media (max-width: 640px) {
    .hero__banner { padding: 34px 26px; }
}

.stats { display: flex; flex-wrap: wrap; gap: 12px; }
.stat {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 14px; padding: 12px 18px; box-shadow: var(--shadow-sm);
    min-width: 132px;
    transition: transform .18s ease, box-shadow .2s ease;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat__value { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.stat__value span { color: var(--muted); font-weight: 600; font-size: 16px; }
.stat__label {
    font-size: 11px; font-weight: 700; letter-spacing: .07em;
    text-transform: uppercase; color: var(--muted);
}

.progress { height: 9px; margin-top: 14px; border-radius: 99px; background: var(--track); overflow: hidden; }
.progress--lg { height: 12px; margin-top: 18px; }
.progress__bar {
    height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, #34d399, var(--ok));
    transition: width .45s ease;
}

/* ---------- Панель фильтров и голова, выглядывающая из-за неё ---------- */
.panel {
    position: relative;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: 18px;
}
.panel::before {
    content: "";
    position: absolute;
    left: 18px; right: 18px; top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand), transparent);
    opacity: .45;
    pointer-events: none;
}

/* ---------- Поля и фильтры ---------- */
.filters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: end; }
.field--wide { grid-column: span 2; }
@media (max-width: 860px) {
    .filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .filters { grid-template-columns: 1fr; }
    .field--wide { grid-column: span 1; }
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label {
    font-size: 11.5px; font-weight: 700; letter-spacing: .07em;
    text-transform: uppercase; color: var(--ink-2);
}

select, input[type="text"], input[type="password"], input[type="email"],
input[type="number"], textarea {
    width: 100%; padding: 11px 13px;
    border: 1px solid var(--line); border-radius: 12px;
    background: var(--input-bg); color: var(--ink);
    font: inherit; font-size: 15px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
select {
    appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
}
select:disabled { color: var(--muted); background-color: var(--surface-2); }
select:focus, input:focus, textarea:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .18);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }

/* Иконка поиска в поле «Поиск по тексту» */
#q {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.5' y2='16.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
    padding-left: 44px;
}

.filters__actions { display: flex; gap: 8px; }
.filters__actions .btn { flex: 1; }

.switch {
    display: flex; align-items: center; gap: 9px;
    height: 44px; padding: 0 13px;
    border: 1px solid var(--line); border-radius: 12px;
    background: var(--input-bg); color: var(--ink-2);
    font-size: 14.5px; font-weight: 500;
    cursor: pointer; user-select: none;
    transition: border-color .15s ease;
}
.switch:hover { border-color: var(--line-strong); }
.switch input[type="checkbox"] {
    width: 17px; height: 17px;
    accent-color: var(--brand); cursor: pointer; flex: 0 0 auto;
}
.switch--disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Заголовок списка ---------- */
.list-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 12px; margin: 30px 0 14px; flex-wrap: wrap;
}
.list-head h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.list-head p { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- Карточки задач ---------- */
.tasks { display: flex; flex-direction: column; gap: 16px; padding-bottom: 40px; }

.task {
    position: relative;
    display: grid; grid-template-columns: 5px 1fr;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    scroll-margin-top: 92px;
    transition: transform .18s ease, box-shadow .22s ease, background-color .25s ease;
}
.task:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.task:target { box-shadow: 0 0 0 3px rgba(79, 70, 229, .28), var(--shadow); }
.task__bar { background: var(--muted); }
.task--easy .task__bar { background: linear-gradient(180deg, #6ee7b7, var(--ok)); }
.task--medium .task__bar { background: linear-gradient(180deg, #fcd34d, var(--warn)); }
.task--hard .task__bar { background: linear-gradient(180deg, #fca5a5, var(--bad)); }
.task--solved { background: linear-gradient(180deg, var(--surface), var(--ok-soft)); }
.task__body { padding: 20px 22px; min-width: 0; }
@media (max-width: 560px) { .task__body { padding: 16px; } }

.task__meta {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.task__meta-left { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.task__num {
    width: 30px; height: 30px;
    display: inline-grid; place-items: center;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-size: 12.5px; font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    transition: transform .2s ease, background-color .2s ease, color .2s ease;
}
.task:hover .task__num { color: var(--brand); transform: scale(1.06); }

.pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px; border-radius: 99px;
    font-size: 12.5px; font-weight: 600; line-height: 1.3; white-space: nowrap;
}
.pill--topic { background: var(--brand-soft); color: var(--brand-ink); }
.pill--easy { background: var(--ok-soft); color: var(--ok-ink); }
.pill--medium { background: var(--warn-soft); color: var(--warn-ink); }
.pill--hard { background: var(--bad-soft); color: var(--bad-ink); }
.pill--source { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.pill--solved { background: var(--ok); color: #fff; }

.task__video { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.task__video:hover { color: var(--brand); }

.task__text { max-width: 70ch; font-size: 16.5px; line-height: 1.62; color: var(--ink); }
.task__text, .solution__text { overflow-wrap: break-word; }

/* Длинные формулы не должны растягивать карточку (актуально для телефона) */
mjx-container { max-width: 100%; overflow-x: auto; overflow-y: hidden; }
.task__image {
    display: block; max-width: 100%; max-height: 320px;
    margin-top: 12px; border-radius: 12px; border: 1px solid var(--line);
}

.answer { display: flex; gap: 10px; margin-top: 16px; }
.answer__input {
    flex: 1; min-height: 46px;
    font-family: ui-monospace, SFMono-Regular, 'JetBrains Mono', Menlo, monospace;
    letter-spacing: .02em;
}
@media (max-width: 600px) { .answer { flex-direction: column; } }

.result {
    display: flex; gap: 10px; align-items: flex-start;
    margin-top: 14px; padding: 12px 14px;
    border-radius: 12px; font-size: 14.5px; font-weight: 500;
    animation: pop .22s ease;
}
.result--ok { background: var(--ok-soft); border: 1px solid var(--ok); color: var(--ok-ink); }
.result--bad { background: var(--bad-soft); border: 1px solid var(--bad); color: var(--bad-ink); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Письменное решение ---------- */
[hidden] { display: none !important; }

.solution-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }

.solution {
    margin-top: 12px; padding: 16px 18px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: 14px;
    animation: pop .2s ease;
}
.solution__label {
    margin-bottom: 8px;
    font-size: 11px; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--muted);
}
.solution__text { font-size: 15.5px; line-height: 1.7; color: var(--ink); }

/* ---------- Пустое состояние ---------- */
.empty {
    text-align: center; padding: 54px 24px;
    background: var(--surface); border: 1px dashed var(--line-strong);
    border-radius: var(--radius); color: var(--ink-2);
}
.empty__icon { font-size: 34px; margin-bottom: 10px; }
.empty h3 { margin: 0 0 6px; color: var(--ink); font-size: 19px; }
.empty p { margin: 0 0 18px; font-size: 14.5px; }

/* ---------- Вход и регистрация ---------- */
.auth { display: grid; place-items: center; padding: 56px 22px; }
.auth__card {
    width: 100%; max-width: 430px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 22px; box-shadow: var(--shadow);
    padding: 34px 30px;
}
.auth__title { margin: 0 0 6px; font-size: 26px; letter-spacing: -.025em; }
.auth__sub { margin: 0 0 22px; font-size: 14.5px; color: var(--ink-2); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth__footer { margin: 18px 0 0; text-align: center; font-size: 14px; color: var(--ink-2); }

.field__help { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.field__help ul { margin: 6px 0 0; padding-left: 18px; }
.field__error { font-size: 13px; font-weight: 600; color: var(--bad-ink); }

/* ---------- Профиль ---------- */
.profile { padding: 36px 0 64px; }

.profile__head {
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
    padding: 24px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.avatar-lg {
    width: 76px; height: 76px; flex: 0 0 auto;
    display: grid; place-items: center;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff; font-size: 32px; font-weight: 800;
    box-shadow: 0 14px 28px -14px rgba(79, 70, 229, 1);
}
.profile__name { margin: 0; font-size: 26px; letter-spacing: -.025em; }
.profile__meta { margin: 5px 0 0; font-size: 14px; color: var(--ink-2); }
.profile__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 620px) { .profile__actions { margin-left: 0; width: 100%; } }

.grid-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0 0; }
@media (max-width: 760px) { .grid-stats { grid-template-columns: repeat(2, 1fr); } }

.section { margin-top: 32px; }
.section__title {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    margin: 0 0 12px; font-size: 17px; letter-spacing: -.01em;
}
.section__title span { font-size: 13px; font-weight: 500; color: var(--muted); }

.topic-row {
    display: grid; grid-template-columns: 1fr auto; gap: 8px 14px;
    align-items: center;
    padding: 13px 16px; margin-bottom: 8px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 14px;
}
.topic-row__name { font-size: 14.5px; font-weight: 600; }
.topic-row__count {
    font-size: 13px; color: var(--muted); font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.topic-row__bar { grid-column: 1 / -1; height: 7px; border-radius: 99px; background: var(--track); overflow: hidden; }
.topic-row__fill {
    height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, #34d399, var(--ok));
    transition: width .45s ease;
}

.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.activity__item {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 12px 16px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 14px; font-size: 14.5px;
}
.activity__text { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity__text:hover { color: var(--brand); }
.activity__date { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* ---------- Подвал ---------- */
.footer {
    margin-top: auto; padding: 26px 0;
    border-top: 1px solid var(--line);
    background: var(--footer-bg);
    color: var(--muted); font-size: 13px;
}
.footer__inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Пагинация ---------- */
.pagination {
    display: flex; flex-wrap: wrap; gap: 8px;
    justify-content: center; align-items: center;
    padding: 10px 0 46px;
}
.page-btn {
    min-width: 40px; min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 13px; border-radius: 11px;
    border: 1px solid var(--line); background: var(--surface);
    color: var(--ink-2); font-size: 14px; font-weight: 600;
    text-decoration: none;
    transition: border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.page-btn:hover { text-decoration: none; border-color: var(--brand); color: var(--brand); }
.page-btn--active {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border-color: transparent; color: #fff;
    box-shadow: 0 10px 20px -12px rgba(79, 70, 229, .95);
}
.page-btn--disabled { opacity: .45; }
.page-ellipsis { color: var(--muted); padding: 0 2px; }

/* ---------- Системные настройки ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* ---------- Печать: чистый лист с задачами ---------- */
@media print {
    body { background: #fff; color: #000; }
    .topbar, .footer, .panel, .pagination, .answer,
    .solution-actions, .alerts, .progress, .alert--info,
    .variant__actions, .variant__foot, .variant__input, .variant__mark { display: none !important; }
    .hero { padding: 0 0 10px; }
    .stats { display: none !important; }
    .task {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
        page-break-inside: avoid;
    }
    .task__text { max-width: none; }
    .pill { background: #fff !important; color: #000 !important; border: 1px solid #bbb; }
    .task__num { color: #555; }
}

/* ---------- 3D-куб в баннере (чистый CSS) ---------- */
.cube-scene {
    position: absolute;
    right: 164px;
    top: 50%;
    width: 150px;
    height: 150px;
    margin-top: -115px;
    perspective: 900px;
    pointer-events: none;
    animation: cube-float 7s ease-in-out infinite;
}

.cube {
    position: relative;
    width: 150px;
    height: 150px;
    transform-style: preserve-3d;
    animation: cube-spin 26s linear infinite;
}

.cube__face {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 62px;
    line-height: 1;
    color: rgba(255, 255, 255, .92);
    text-shadow: 0 4px 18px rgba(0, 0, 0, .35);
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05));
    box-shadow: inset 0 0 40px rgba(255, 255, 255, .10);
    backdrop-filter: blur(2px);
}

.cube__face--front  { transform: translateZ(75px); }
.cube__face--back   { transform: rotateY(180deg) translateZ(75px); }
.cube__face--right  { transform: rotateY(90deg) translateZ(75px); }
.cube__face--left   { transform: rotateY(-90deg) translateZ(75px); }
.cube__face--top    { transform: rotateX(90deg) translateZ(75px); }
.cube__face--bottom { transform: rotateX(-90deg) translateZ(75px); }

@keyframes cube-spin {
    from { transform: rotateX(-16deg) rotateY(0deg); }
    to   { transform: rotateX(-16deg) rotateY(360deg); }
}
@keyframes cube-float {
    0%, 100% { transform: translateY(-8px); }
    50%      { transform: translateY(8px); }
}

@media (max-width: 900px) {
    .cube-scene { display: none; }
}

/* ---------- Вариант ЕГЭ: настройка ---------- */
.variant { padding: 32px 0 56px; }
.variant__head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.variant__title { margin: 0 0 6px; font-size: 30px; letter-spacing: -.03em; }
.variant__sub { margin: 0; color: var(--ink-2); font-size: 14.5px; max-width: 70ch; }
.variant__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.variant-form {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: 20px;
}
.variant-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
    font: inherit; font-size: 13.5px; font-weight: 600;
    padding: 8px 14px; border-radius: 99px;
    border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

.variant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }

.variant-tile {
    position: relative;
    display: flex; flex-direction: column; gap: 3px;
    padding: 12px 14px;
    border: 1px solid var(--line); border-radius: 14px;
    background: var(--surface); cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.variant-tile input { position: absolute; opacity: 0; pointer-events: none; }
.variant-tile__num { font-family: var(--font-display); font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.variant-tile__count { font-size: 12.5px; color: var(--muted); }
.variant-tile:hover { border-color: var(--brand); }
.variant-tile:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-soft);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .14);
}
.variant-tile:has(input:checked) .variant-tile__num { color: var(--brand-ink); }
.variant-tile--empty { opacity: .45; cursor: not-allowed; }
.variant-tile--empty:hover { border-color: var(--line); }

.variant-form__footer { display: flex; align-items: flex-end; gap: 14px; margin-top: 20px; flex-wrap: wrap; }
.variant-form__per { max-width: 170px; }

/* ---------- Вариант ЕГЭ: прохождение ---------- */
.variant__summary {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 20px; margin-bottom: 18px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.variant__score { font-size: 32px; font-weight: 800; letter-spacing: -.03em; }
.variant__score span { font-size: 17px; color: var(--muted); font-weight: 700; }
.variant__score-label { color: var(--ink-2); font-size: 14.5px; }

.variant__form { display: flex; flex-direction: column; gap: 14px; }
.variant__task .task__body { padding: 18px 20px; }
.variant__input { margin-top: 12px; max-width: 280px; }

.variant__mark {
    font-size: 12.5px; font-weight: 700;
    padding: 4px 10px; border-radius: 99px;
    background: var(--surface-2); color: var(--ink-2);
}
.variant__mark--ok { background: var(--ok-soft); color: var(--ok-ink); }
.variant__mark--bad { background: var(--bad-soft); color: var(--bad-ink); }
.variant__hint { margin-top: 8px; font-size: 13.5px; color: var(--bad-ink); }
.variant__foot { margin: 6px 0 10px; }

.list-head__right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

@media (max-width: 560px) {
    .variant__title { font-size: 24px; }
    .variant__input { max-width: none; }
    .variant__summary { flex-direction: column; align-items: flex-start; gap: 6px; }
    .variant-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}

/* Самопроверка заданий 13–19 */
.variant__answer-note {
    margin-top: 12px; padding: 10px 12px;
    font-size: 13.5px; color: var(--ink-2);
    background: var(--surface-2);
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
}
.variant__self {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-top: 14px;
}
.variant__self-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
