/* ==========================================================================
   TeacherDesk — тёмная неоновая фиолетовая тема
   ========================================================================== */

:root {
    /* ==================== ТЁМНАЯ ТЕМА (базовая) ==================== */
    --bg: #07050d;
    --bg-2: #0d0a18;
    --panel: rgba(23, 17, 41, 0.78);
    --panel-solid: #171129;
    --panel-2: #1e1736;
    --line: rgba(168, 85, 247, 0.18);
    --line-strong: rgba(168, 85, 247, 0.38);
    --neon: #a855f7;
    --neon-soft: #c98bff;
    --neon-deep: #7c3aed;
    --text: #ece8f8;
    --text-strong: #ffffff;
    --muted: #a299c2;
    --ok: #4ade80;
    --warn: #fbbf24;
    --bad: #fb7185;
    --radius: 14px;
    --shadow: 0 0 0 1px var(--neon-a12), 0 12px 40px var(--shadow-c);
    --glow: 0 0 22px var(--neon-a30);

    /* поверхности и подложки */
    --surface-3: rgba(30, 23, 54, 0.7);
    --surface-4: rgba(30, 23, 54, 0.85);
    --surface-5: rgba(30, 23, 54, 0.96);
    --surface-ghost: rgba(30, 23, 54, 0.6);
    --surface-hover: rgba(45, 33, 78, 0.8);
    --surface-input: rgba(10, 7, 20, 0.9);
    --surface-float: rgba(12, 9, 24, 0.8);
    --surface-icon: rgba(12, 9, 24, 0.7);
    --topbar-bg: rgba(10, 7, 20, 0.82);
    --backdrop: rgba(6, 4, 12, 0.72);
    --scroll-track: rgba(14, 10, 28, 0.85);
    --scroll-edge: rgba(14, 10, 28, 0.9);
    --scrollbar-bg: rgba(20, 14, 38, 0.9);
    --scroll-end: #4c1d95;
    --thead-att-1: #241a40;
    --thead-att-2: #1b1432;
    --thead-grade-1: #1f1738;
    --row-hover-bg: #1d1533;
    --warn-bg: rgba(60, 45, 10, 0.35);
    --danger-bg: rgba(120, 30, 60, 0.75);

    /* акцентные полутона */
    --accent-grad-1: rgba(124, 58, 237, 0.9);
    --accent-grad-2: rgba(88, 28, 180, 0.9);
    --tint-subtle: rgba(124, 58, 237, 0.10);
    --tint-soft: rgba(124, 58, 237, 0.13);
    --tint-mid: rgba(124, 58, 237, 0.18);
    --tint-strong: rgba(124, 58, 237, 0.22);
    --tint-hover: rgba(124, 58, 237, 0.24);
    --tint-active: rgba(124, 58, 237, 0.26);
    --tint-on: rgba(124, 58, 237, 0.28);
    --tint-35: rgba(124, 58, 237, 0.35);
    --tint-glow-30: rgba(124, 58, 237, 0.30);
    --orb-1: rgba(124, 58, 237, 0.16);
    --neon-a10: rgba(168, 85, 247, 0.10);
    --neon-a12: rgba(168, 85, 247, 0.12);
    --neon-a14: rgba(168, 85, 247, 0.14);
    --neon-a18: rgba(168, 85, 247, 0.18);
    --neon-a22: rgba(168, 85, 247, 0.22);
    --neon-a28: rgba(168, 85, 247, 0.28);
    --neon-a30: rgba(168, 85, 247, 0.30);
    --neon-a45: rgba(168, 85, 247, 0.45);
    --neon-a50: rgba(168, 85, 247, 0.5);
    --neon-a55: rgba(168, 85, 247, 0.55);
    --neon-a85: rgba(168, 85, 247, 0.85);
    --neon-a95: rgba(168, 85, 247, 0.95);
    --neon-a0: rgba(168, 85, 247, 0);

    /* статусные полутона */
    --bad-a12: rgba(251, 113, 133, 0.12);
    --bad-a16: rgba(251, 113, 133, 0.16);
    --bad-a40: rgba(251, 113, 133, 0.4);
    --bad-a50: rgba(251, 113, 133, 0.5);
    --bad-a55: rgba(251, 113, 133, 0.55);
    --bad-a60: rgba(251, 113, 133, 0.6);
    --ok-a14: rgba(74, 222, 128, 0.14);
    --ok-a45: rgba(74, 222, 128, 0.45);
    --ok-a55: rgba(74, 222, 128, 0.55);
    --warn-a30: rgba(251, 191, 36, 0.3);
    --warn-a75: rgba(251, 191, 36, 0.75);
    --warn-text: #fcd9a1;
    --err-text: #ffd7de;

    /* прочее */
    --muted-strong: #9d94bd;
    --muted-hover: #c4b5fd;
    --faint: #6b6388;
    --empty: #4b4463;
    --pulse: #e9d5ff;
    --shimmer: rgba(233, 213, 255, 0.16);
    --shine: rgba(255, 255, 255, 0.28);
    --shadow-c: rgba(0, 0, 0, 0.55);
    --on-accent: #ffffff;
    color-scheme: dark;
}

/* ==========================================================================
   СВЕТЛАЯ ТЕМА
   Переопределяются только токены: правила ниже выбирают цвета через var(),
   поэтому вся вёрстка перекрашивается целиком, без дублирования селекторов.
   Режим «как в системе» разрешает JS: он подставляет light или dark.
   ========================================================================== */

:root[data-theme="light"] {
    --bg: #f3f1fa;
    --bg-2: #e9e5f5;
    --panel: rgba(255, 255, 255, 0.88);
    --panel-solid: #ffffff;
    --panel-2: #f2eefb;
    --line: rgba(109, 40, 217, 0.16);
    --line-strong: rgba(109, 40, 217, 0.34);
    --neon: #7c3aed;
    --neon-soft: #6d28d9;
    --neon-deep: #5b21b6;
    --text: #1c1828;
    --text-strong: #0e0b16;
    --muted: #6b6384;
    --ok: #15803d;
    --warn: #b45309;
    --bad: #be123c;
    --shadow: 0 0 0 1px rgba(109, 40, 217, 0.10), 0 12px 32px rgba(28, 16, 60, 0.10);
    --glow: 0 0 18px rgba(124, 58, 237, 0.16);

    --surface-3: #f1edfb;
    --surface-4: #ece6f8;
    --surface-5: #ffffff;
    --surface-ghost: #f3f0fb;
    --surface-hover: #e6dff6;
    --surface-input: #ffffff;
    --topbar-bg: rgba(255, 255, 255, 0.88);
    --surface-float: #ffffff;
    --surface-icon: #efeaf9;
    --backdrop: rgba(28, 18, 52, 0.38);
    --scroll-track: #ece7f6;
    --scroll-edge: #ffffff;
    --scrollbar-bg: #f1ecfa;
    --scroll-end: #c4b5fd;
    --thead-att-1: #efe8fc;
    --thead-att-2: #e6ddf7;
    --thead-grade-1: #f2edfc;
    --row-hover-bg: #ece4fa;
    --warn-bg: #fdf2df;
    --danger-bg: #fce7ec;

    --accent-grad-1: rgba(124, 58, 237, 0.95);
    --accent-grad-2: rgba(109, 40, 217, 0.95);
    --tint-subtle: rgba(124, 58, 237, 0.07);
    --tint-soft: rgba(124, 58, 237, 0.09);
    --tint-mid: rgba(124, 58, 237, 0.13);
    --tint-strong: rgba(124, 58, 237, 0.15);
    --tint-hover: rgba(124, 58, 237, 0.18);
    --tint-active: rgba(124, 58, 237, 0.16);
    --tint-on: rgba(124, 58, 237, 0.20);
    --tint-35: rgba(124, 58, 237, 0.24);
    --tint-glow-30: rgba(124, 58, 237, 0.10);
    --orb-1: rgba(124, 58, 237, 0.08);
    --neon-a10: rgba(124, 58, 237, 0.10);
    --neon-a12: rgba(124, 58, 237, 0.10);
    --neon-a14: rgba(124, 58, 237, 0.10);
    --neon-a18: rgba(124, 58, 237, 0.16);
    --neon-a22: rgba(124, 58, 237, 0.18);
    --neon-a28: rgba(124, 58, 237, 0.22);
    --neon-a30: rgba(124, 58, 237, 0.20);
    --neon-a45: rgba(124, 58, 237, 0.30);
    --neon-a50: rgba(124, 58, 237, 0.34);
    --neon-a55: rgba(124, 58, 237, 0.30);
    --neon-a85: rgba(124, 58, 237, 0.45);
    --neon-a95: rgba(124, 58, 237, 0.55);
    --neon-a0: rgba(124, 58, 237, 0);

    --bad-a12: rgba(190, 18, 60, 0.08);
    --bad-a16: rgba(190, 18, 60, 0.10);
    --bad-a40: rgba(190, 18, 60, 0.32);
    --bad-a50: rgba(190, 18, 60, 0.40);
    --bad-a55: rgba(190, 18, 60, 0.45);
    --bad-a60: rgba(190, 18, 60, 0.55);
    --ok-a14: rgba(21, 128, 61, 0.12);
    --ok-a45: rgba(21, 128, 61, 0.35);
    --ok-a55: rgba(21, 128, 61, 0.45);
    --warn-a30: rgba(180, 83, 9, 0.28);
    --warn-a75: rgba(180, 83, 9, 0.50);
    --warn-text: #92400e;
    --err-text: #9f1239;

    --muted-strong: #6f6889;
    --muted-hover: #4c1d95;
    --faint: #a9a2c0;
    --empty: #b3abcd;
    --pulse: #7c3aed;
    --shimmer: rgba(124, 58, 237, 0.10);
    --shine: rgba(255, 255, 255, 0.5);
    --shadow-c: rgba(28, 16, 60, 0.14);
    color-scheme: light;
}



* { box-sizing: border-box; }

html, body { height: 100%; }

/* iOS не увеличивает текст самовольно — иначе кнопки в шапке расползаются. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    margin: 0;
    background:
        radial-gradient(1100px 620px at 12% -8%, var(--tint-strong), transparent 60%),
        radial-gradient(900px 520px at 100% 0%, var(--neon-a14), transparent 55%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
    background-attachment: fixed;
    color: var(--text);
    font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    min-height: 100vh;
}

.glow { position: fixed; border-radius: 50%; filter: blur(120px); pointer-events: none; z-index: 0; }
.glow-a { width: 420px; height: 420px; background: var(--orb-1); top: -90px; left: -60px; animation: drift-a 26s ease-in-out infinite; }
.glow-b { width: 380px; height: 380px; background: var(--neon-a10); bottom: -120px; right: -80px; animation: drift-b 32s ease-in-out infinite; }

@keyframes drift-a {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(90px, 60px) scale(1.18); }
}
@keyframes drift-b {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-70px, -80px) scale(1.12); }
}

/* Индикатор фонового сохранения/загрузки данных */
.progress {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    width: 0;
    z-index: 90;
    background: linear-gradient(90deg, var(--neon-deep), var(--neon-soft), var(--text-strong));
    box-shadow: 0 0 14px var(--neon-a85);
    opacity: 0;
    transition: width .18s ease, opacity .3s ease;
}
.progress.on { opacity: 1; }

/* ------------------------------------------------------------------ шапка */

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 26px;
    background: var(--topbar-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.brand {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-decoration: none;
    color: var(--text);
    text-shadow: 0 0 18px var(--neon-a55);
}
.brand span { color: var(--neon-soft); }

.crumbs { color: var(--muted); font-size: 13px; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.crumbs a { color: var(--neon-soft); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.topbar-actions { display: flex; gap: 10px; }

/* Гамбургер-кнопка: на десктопе не видна, на мобильном открывает меню. */
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-ghost);
    color: var(--neon-soft);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
    transition: border-color .16s ease, background .16s ease;
}
.nav-toggle:hover { border-color: var(--neon); background: var(--tint-hover); }
.nav-toggle[aria-expanded="true"] { border-color: var(--neon); background: var(--tint-active); }

/* Базовая навигация: всегда в строку на десктопе, скрывается на мобильном. */
.nav { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nav-btn {
    padding: 6px 12px; border-radius: 10px; font-size: 12.5px; font-weight: 600;
    border: 1px solid var(--line); color: var(--neon-soft); text-decoration: none;
    background: var(--surface-ghost); white-space: nowrap;
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.nav-btn:hover { border-color: var(--neon); background: var(--tint-hover); }
.nav-btn.on { background: var(--tint-active); border-color: var(--neon); color: var(--text-strong); }

/* Кнопка обновления расписания в меню: тот же размер, что и ссылки,
   но выделена градиентом — она меняет данные, а не просто переходить. */
.sched-refresh-btn {
    padding: 6px 12px; border-radius: 10px; font-size: 12.5px; font-weight: 600;
    border: 1px solid var(--line-strong); white-space: nowrap; cursor: pointer;
    background: linear-gradient(180deg, var(--accent-grad-1), var(--accent-grad-2));
    color: var(--on-accent); font-family: inherit;
    transition: box-shadow .16s ease, opacity .16s ease;
}
.sched-refresh-btn:hover { box-shadow: var(--glow); }
.sched-refresh-btn:disabled { opacity: .6; cursor: progress; }

/* ------------------------------------------------------------------ кнопки */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 15px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: linear-gradient(180deg, var(--accent-grad-1), var(--accent-grad-2));
    color: var(--on-accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: box-shadow .18s ease, transform .18s ease, background .18s ease, border-color .18s ease;
}
.btn:hover { box-shadow: var(--glow); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-ghost {
    background: var(--surface-ghost);
    border-color: var(--line);
    color: var(--neon-soft);
}
.btn-ghost:hover { background: var(--surface-hover); border-color: var(--line-strong); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-danger { background: var(--danger-bg); border-color: var(--bad-a40); }

.loading { padding: 60px; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------------ главная */

.home {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(360px, 1.15fr);
    gap: 34px;
    padding: 46px 34px 60px;
    max-width: 1400px;
    margin: 0 auto;
    animation: fade .35s ease;
}

.hero { align-self: center; padding: 10px 0 20px; }
.hero-badge {
    display: inline-block;
    padding: 4px 12px;
    margin-bottom: 18px;
    border-radius: 999px;
    font-size: 10.5px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--neon-soft);
    background: var(--tint-soft);
    border: 1px solid var(--line-strong);
    animation: rise .4s ease both;
}
.hero-title {
    margin: 0 0 16px;
    font-size: 64px;
    line-height: 1.02;
    font-weight: 900;
    letter-spacing: -2px;
    color: var(--text-strong);
    position: relative;
    animation: titleGlow 4s ease-in-out infinite alternate;
}
.hero-title span {
    background: linear-gradient(110deg, var(--neon-soft) 0%, var(--neon) 40%, var(--text-strong) 70%, var(--neon-soft) 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shimmer 6s linear infinite;
}
@keyframes titleGlow {
    from { text-shadow: 0 0 20px var(--neon-a30), 0 0 60px var(--tint-mid); }
    to   { text-shadow: 0 0 36px var(--neon-a55), 0 0 90px var(--tint-glow-30); }
}
.hero-line {
    height: 2px;
    width: 100%;
    max-width: 340px;
    margin-bottom: 20px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--neon), transparent);
    animation: lineGrow .8s ease .2s both;
}
@keyframes lineGrow { from { max-width: 0; } to { max-width: 340px; } }
.hero-sub { margin: 0 0 24px; color: var(--muted); font-size: 14.5px; max-width: 44ch; line-height: 1.55; animation: fade .5s ease .15s both; }
.hero-stats {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
    padding: 14px 18px;
    border-radius: var(--radius);
    background: var(--surface-3);
    border: 1px solid var(--line);
    animation: rise .5s ease .25s both;
}
.hs-item { display: flex; flex-direction: column; gap: 2px; }
.hs-num { font-size: 22px; font-weight: 800; color: var(--neon-soft); text-shadow: 0 0 18px var(--neon-a45); }
.hs-lab { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.hs-sep { width: 1px; height: 32px; background: var(--line-strong); }
.hero-hint {
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px dashed var(--line-strong);
    background: var(--surface-ghost);
    color: var(--muted);
    font-size: 12.5px;
    animation: fade .5s ease .35s both;
}
.hero-hint code { color: var(--neon-soft); }

.groups-panel h2 { margin: 0 0 14px; font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: .3px; }
.groups-panel h2 small { color: var(--muted); font-weight: 500; margin-left: 8px; }

.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }

.group-card {
    display: block;
    padding: 16px 16px 14px;
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    animation: rise .3s ease both;
}
.group-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow), var(--glow); }
.group-card .gc-code { font-size: 22px; font-weight: 800; color: var(--neon-soft); letter-spacing: .3px; }
.group-card .gc-spec { margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.group-card .gc-disc { margin-top: 10px; font-size: 13px; color: var(--text); min-height: 2.9em; }
.group-card .gc-meta { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.pill { padding: 2px 9px; border-radius: 999px; background: var(--tint-strong); border: 1px solid var(--line); color: var(--neon-soft); }

.file-warnings { margin-top: 16px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--warn-a30); background: var(--warn-bg); color: var(--warn-text); font-size: 12.5px; }
.file-warnings b { display: block; margin-bottom: 6px; color: var(--warn); }
.empty-note { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* ------------------------------------------------------------------ ведомость */

.sheet-page { position: relative; z-index: 1; padding: 22px 26px 60px; max-width: none; margin: 0 auto; animation: fade .3s ease; overflow-x: clip; }

.sheet-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 20px;
    padding: 18px 20px;
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.sh-main { flex: 1; min-width: 260px; }
.sh-title { font-size: 24px; font-weight: 800; color: var(--text-strong); letter-spacing: .3px; }
.sh-title .sh-code { color: var(--neon-soft); text-shadow: 0 0 20px var(--neon-a50); }
.sh-sub { margin-top: 4px; color: var(--muted); font-size: 13px; }
.sh-disc { margin-top: 8px; font-size: 14px; color: var(--text); }
.sh-disc b { color: var(--neon-soft); font-weight: 600; }

.stats { display: flex; flex-wrap: wrap; gap: 10px; }
.stat {
    min-width: 104px;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--surface-3);
    border: 1px solid var(--line);
}
.stat .s-val { font-size: 19px; font-weight: 800; color: var(--neon-soft); }
.stat .s-lab { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.stat.ok .s-val { color: var(--ok); }
.stat.bad .s-val { color: var(--bad); }

.sheet-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.legend { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.legend kbd {
    padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-strong);
    background: var(--surface-4); color: var(--neon-soft); font-size: 11px; font-family: inherit;
}

/* ------------------------------------------------------------- таблица */

.table-shell {
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
    overflow: auto;
    max-height: calc(100vh - 235px);
    min-height: 420px;
    scrollbar-color: var(--neon-deep) var(--scrollbar-bg);
}
.table-shell::-webkit-scrollbar { width: 12px; height: 12px; }
.table-shell::-webkit-scrollbar-track { background: var(--scroll-track); }
.table-shell::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--neon-deep), var(--scroll-end));
    border-radius: 8px; border: 2px solid var(--scroll-edge);
}
.table-shell::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--neon), var(--neon-deep)); }
.table-shell::-webkit-scrollbar-corner { background: var(--scroll-track); }

/* Слои таблицы: обычный tbody < sticky колонки tbody (10) < tfoot (20/25) <
   thead (30) < sticky колонки thead (40). Порядок z-index критичен: иначе
   колонка ФИО наезжает на заголовок сверху или на итоговую полосу снизу. */
table.sheet { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13px; }

table.sheet th, table.sheet td {
    border-right: 1px solid var(--neon-a10);
    border-bottom: 1px solid var(--neon-a10);
    padding: 0;
    vertical-align: top;
    background: var(--panel-solid);
}

table.sheet thead th {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--panel-2);
    color: var(--text);
    font-weight: 600;
    font-size: 12.5px;
    padding: 10px 10px;
    min-width: 96px;
    text-align: center;
    border-bottom: 1px solid var(--line-strong);
}
table.sheet thead th.grp-att { background: linear-gradient(180deg, var(--thead-att-1), var(--thead-att-2)); min-width: 132px; }
table.sheet thead th.grp-grade { background: linear-gradient(180deg, var(--thead-grade-1), var(--panel-solid)); min-width: 104px; }
table.sheet thead th.col-abs-head { min-width: 84px; }

.sticky-col { position: sticky !important; z-index: 10; }
.col-num { left: 0; width: 40px; min-width: 40px; max-width: 40px; text-align: center; color: var(--muted); font-size: 11.5px; }
.col-name { left: 40px; width: 300px; min-width: 300px; max-width: 300px; text-align: left !important; padding-left: 14px !important; vertical-align: middle !important; }
/* Угловые заголовки sticky-колонок должны перекрывать и строки, и остальные заголовки. */
thead .sticky-col { z-index: 40; }
tbody .col-num, tbody .col-name { background: var(--panel-solid); }
tbody tr:hover .col-num, tbody tr:hover .col-name { background: var(--row-hover-bg); }

/* Номер строки: по центру, моноширинные цифры, мягкая подсветка строки. */
td.col-num {
    vertical-align: middle;
    padding: 4px 0;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: .3px;
    color: var(--muted-strong);
}
tbody tr:hover td.col-num { color: var(--muted-hover); }

td.col-name { padding: 10px 14px !important; font-size: 13.2px; white-space: normal; word-break: break-word; line-height: 1.3; }
.student-name { cursor: pointer; border-bottom: 1px dashed transparent; transition: border-color .15s ease, color .15s ease; }
.student-name:hover { border-bottom-color: var(--line-strong); color: var(--neon-soft); }
.student-del { opacity: 0; margin-left: 6px; vertical-align: middle; }
tr:hover .student-del { opacity: 1; }
.note-dot {
    display: inline-block;
    width: 7px; height: 7px;
    margin-left: 7px;
    border-radius: 50%;
    background: var(--warn);
    box-shadow: 0 0 8px var(--warn-a75);
    vertical-align: middle;
    animation: breathe 2.8s ease-in-out infinite;
}
tr.row-inactive td.col-name { color: var(--muted); font-style: italic; }
tr.row-inactive td { opacity: .72; }
.tag-gone { display: inline-block; margin-left: 6px; font-size: 10px; color: var(--warn); }

/* --------------------------------------------------------------- ячейки */

/* td остаётся табличной ячейкой: флекс-колонка живёт внутри .cell-box.
   vertical-align: middle выравнивает содержимое по центру строки —
   номера и отметки стоят ровно даже в высоких строках с заметками. */
table.sheet tbody td { vertical-align: middle; }
.cell-box {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 58px;
}
/* Подсветка выбранной/редактируемой ячейки — вся площадь td, ровно и сплошно. */
table.sheet tbody td.selected { background: var(--tint-mid); box-shadow: inset 0 0 0 2px var(--neon); }
table.sheet tbody td.editing, table.sheet tbody td.editing:hover { background: var(--tint-strong); }

/* Заливка всей ячейки при наведении: ровно, без «дыр» от внутренних элементов. */
table.sheet tbody td:not(.sticky-col) { transition: background .12s ease; }
table.sheet tbody td:not(.sticky-col):not(.selected):not(.editing):hover { background: var(--tint-soft); }
table.sheet tbody td.selected:hover { background: var(--tint-hover); }

.cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 58px;
    padding: 12px 10px;
    text-align: center;
    outline: none;
    cursor: cell;
    white-space: normal;
    word-break: break-word;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .3px;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    border-radius: 4px;
    transition: background .15s ease;
}
.cell:focus-visible { outline: 2px solid var(--neon); outline-offset: -2px; }
td.editing .cell { cursor: text; background: var(--tint-strong); }

/* Крупная кнопка отметки: зона клика 54x44. Фон прозрачный, чтобы
   ховер-заливка ячейки выглядела сплошной. */
.att-btn {
    width: 54px;
    height: 44px;
    margin: 7px 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--faint);
    font: inherit;
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .12s ease;
}
.att-btn:hover { border-color: var(--neon); background: transparent; box-shadow: var(--glow); }
.att-btn:active { transform: scale(.94); }
.att-btn.absent { color: var(--bad); border-color: var(--bad-a55); background: var(--bad-a16); }
.att-btn.absent { animation: markPop .22s ease; }

/* Заметка ячейки: показана, только когда есть текст или ячейка открыта для ввода. */
.cell-note {
    display: none;
    width: calc(100% - 12px);
    margin: 0 6px 7px;
    padding: 3px 6px;
    font-size: 11px;
    line-height: 1.35;
    text-align: center;
    color: var(--neon-soft);
    word-break: break-word;
    outline: none;
    cursor: cell;
    border-radius: 5px;
    background: var(--tint-subtle);
    border: 1px dashed var(--neon-a28);
}
.cell-box.has-note .cell-note,
.cell-box.open .cell-note { display: block; }
.cell-note[contenteditable="true"] {
    background: var(--tint-active);
    border: 1px solid var(--neon);
    box-shadow: 0 0 0 3px var(--tint-soft);
    cursor: text;
    min-height: 20px;
    color: var(--text-strong);
}
.cell-note:empty::before { content: "текст заметки…"; color: var(--muted); font-style: italic; }

/* Стрелка-карандаш: появляется при наведении на ячейку или когда заметка уже есть. */
.note-toggle {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-float);
    color: var(--muted);
    font-size: 9px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: color .15s ease, border-color .15s ease;
}
td:hover .note-toggle { display: inline-flex; }
.cell-box.has-note .note-toggle { display: inline-flex; color: var(--neon-soft); border-color: var(--line-strong); }
.note-toggle:hover { color: var(--text-strong); border-color: var(--neon); background: var(--tint-35); }

/* Пропуски и итог */
.abs-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    padding: 8px;
    color: var(--bad);
    font-weight: 800;
    font-size: 14px;
}
.abs-badge.zero { color: var(--empty); font-weight: 500; }

.cell.final { font-weight: 800; font-size: 16px; color: var(--text-strong); }
.cell.final.auto { color: var(--neon-soft); }
.cell.final.manual { color: var(--warn); }
.cell.final.empty { color: var(--empty); font-weight: 600; }
.final-sub { display: block; font-size: 10px; color: var(--muted); line-height: 1; padding: 0 4px 8px; text-align: center; }

.col-head { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.col-head .ch-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-head .ch-date { font-size: 10px; color: var(--muted); font-weight: 500; }
.col-head .ch-kind { font-size: 9.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--neon); opacity: .8; }
.col-actions { display: flex; gap: 4px; margin-top: 2px; opacity: 0; transition: opacity .15s ease; }
thead th:hover .col-actions { opacity: 1; }
.icon-btn {
    border: 1px solid var(--line);
    background: var(--surface-icon);
    color: var(--muted);
    border-radius: 6px;
    font-size: 10px;
    line-height: 1;
    padding: 3px 5px;
    cursor: pointer;
}
.icon-btn:hover { color: var(--neon-soft); border-color: var(--line-strong); background: var(--tint-hover); }
.icon-btn.danger:hover { color: var(--bad); border-color: var(--bad-a50); background: var(--bad-a12); }

/* Итоговая строка прижата к низу и перекрывает строки tbody — включая sticky
   колонки № и ФИО (z-index 10), иначе фамилии студента лезут поверх полоски. */
table.sheet tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: var(--panel-2);
    border-top: 1px solid var(--line-strong);
    font-size: 11px;
    color: var(--muted);
    padding: 6px 8px;
    text-align: center;
}
table.sheet tfoot .sticky-col { z-index: 25; background: var(--panel-2); }
table.sheet tfoot b { color: var(--neon-soft); font-weight: 700; }
table.sheet tfoot .bad-num { color: var(--bad); }

/* ------------------------------------------------------------- список занятий */

.sessions-panel {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel);
}
.sessions-panel h3 { margin: 0 0 10px; font-size: 13px; color: var(--text); font-weight: 700; }
.session-list { display: flex; flex-wrap: wrap; gap: 8px; }
.session-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 8px 6px 12px; border-radius: 999px;
    background: var(--surface-3); border: 1px solid var(--line); font-size: 12px;
}
.session-chip .sc-name { color: var(--text); }
.session-chip .sc-stat { color: var(--muted); font-size: 11px; }
.session-chip .sc-stat b { color: var(--bad); }

/* ------------------------------------------------------------- уведомления */

.toast-host { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.toast {
    min-width: 240px; max-width: 380px;
    padding: 11px 15px; border-radius: 12px; font-size: 12.5px;
    background: var(--surface-5); border: 1px solid var(--line-strong);
    box-shadow: var(--shadow); color: var(--text);
    animation: slide .22s ease;
}
.toast.error { border-color: var(--bad-a60); color: var(--err-text); }
.toast.ok { border-color: var(--ok-a45); }

/* ------------------------------------------------------------- модалка */

.modal-backdrop {
    position: fixed; inset: 0; z-index: 50;
    display: flex; align-items: center; justify-content: center;
    background: var(--backdrop); backdrop-filter: blur(4px);
}
.modal-backdrop.hidden { display: none; }
.modal {
    width: min(420px, 92vw); padding: 20px;
    border-radius: var(--radius); background: var(--panel-solid);
    border: 1px solid var(--line-strong); box-shadow: var(--shadow), var(--glow);
}
.modal-title { margin: 0 0 14px; font-size: 16px; }
.modal-body { display: flex; flex-direction: column; gap: 12px; }
.field label { display: block; margin-bottom: 5px; font-size: 11.5px; color: var(--muted); }
.field input {
    width: 100%; padding: 9px 11px; border-radius: 10px;
    background: var(--surface-input); border: 1px solid var(--line-strong);
    color: var(--text); font: inherit; font-size: 13px; outline: none;
}
.field input:focus { border-color: var(--neon); box-shadow: 0 0 0 3px var(--neon-a18); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- компактный календарь внутри модалки ---------- */

.inline-cal { margin-top: 8px; }
/* Шапка: стрелки по краям, по центру переключатели месяца и года. */
.ic-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.ic-nav { flex: none; width: 26px; height: 26px; display: flex; align-items: center;
    justify-content: center; border-radius: 8px; border: 1px solid var(--line);
    background: var(--surface-3); color: var(--neon-soft); font: inherit; font-size: 14px;
    line-height: 1; cursor: pointer;
    transition: transform .12s ease, border-color .12s ease, background .12s ease; }
.ic-nav:hover { transform: translateY(-1px); border-color: var(--neon);
    background: var(--tint-active); color: var(--text-strong); }
.ic-switch { flex: 1; min-width: 0; display: flex; align-items: center;
    justify-content: center; gap: 4px; }
.ic-pick { border: 1px solid transparent; background: none; border-radius: 8px;
    padding: 4px 8px; font: inherit; font-size: 13px; font-weight: 700;
    color: var(--neon-soft); cursor: pointer; white-space: nowrap;
    transition: border-color .12s ease, background .12s ease, color .12s ease; }
.ic-pick:hover { border-color: var(--line-strong); background: var(--surface-3); }
/* Подсветка активного переключателя: открыт выбор месяца или года. */
.ic-pick.ic-pick-on { color: var(--text-strong); border-color: var(--neon);
    background: var(--tint-active); box-shadow: var(--glow); }
.ic-title { flex: 1; text-align: center; font-size: 13px; font-weight: 700;
    color: var(--neon-soft); }
.ic-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
/* Месяцы и годы крупнее по тексту, поэтому колонок меньше. */
.ic-grid-coarse { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ic-wd { text-align: center; font-size: 10px; color: var(--muted);
    padding-bottom: 2px; text-transform: uppercase; letter-spacing: .4px; }
.ic-blank { height: 32px; }
.ic-day { display: flex; align-items: center; justify-content: center;
    position: relative;
    height: 32px; border-radius: 8px; border: 1px solid var(--line);
    background: var(--surface-3); color: var(--text); font: inherit;
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: transform .12s ease, border-color .12s ease, background .12s ease; }
.ic-day:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.ic-day.on { border-color: var(--neon); background: var(--tint-active);
    color: var(--text-strong); box-shadow: var(--glow); }
.ic-day.today { color: var(--warn); }
.ic-day.weekend { background: var(--surface-ghost); color: var(--muted); }
/* Точка под числом: в этот день в базе есть занятия (панель выбора даты). */
.ic-day.has::after { content: ""; position: absolute; left: 50%; bottom: 4px;
    width: 3px; height: 3px; margin-left: -1.5px; border-radius: 50%;
    background: var(--neon); }
.ic-cell { display: flex; align-items: center; justify-content: center;
    height: 34px; border-radius: 8px; border: 1px solid var(--line);
    background: var(--surface-3); color: var(--text); font: inherit;
    font-size: 11.5px; font-weight: 600; cursor: pointer;
    transition: transform .12s ease, border-color .12s ease, background .12s ease; }
.ic-cell:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.ic-cell.on { border-color: var(--neon); background: var(--tint-active);
    color: var(--text-strong); box-shadow: var(--glow); }

.hidden { display: none !important; }

/* ------------------------------------------------------------- анимации */

@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slide { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes cellPulse {
    0%, 100% { box-shadow: inset 0 0 0 2px var(--neon); }
    50% { box-shadow: inset 0 0 0 2px var(--pulse), 0 0 12px var(--neon-a55); }
}
@keyframes markPop { 0% { transform: scale(.55); } 60% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes shimmer { from { background-position: -220% 0; } to { background-position: 220% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* Появление строк таблицы: лёгкий каскад, без задержки на длинных списках */
tbody tr { animation: rowIn .28s ease backwards; }
tbody tr:nth-child(1) { animation-delay: .01s; }
tbody tr:nth-child(2) { animation-delay: .03s; }
tbody tr:nth-child(3) { animation-delay: .05s; }
tbody tr:nth-child(4) { animation-delay: .07s; }
tbody tr:nth-child(5) { animation-delay: .09s; }
tbody tr:nth-child(6) { animation-delay: .11s; }
tbody tr:nth-child(7) { animation-delay: .13s; }
tbody tr:nth-child(8) { animation-delay: .15s; }
tbody tr:nth-child(9) { animation-delay: .17s; }
tbody tr:nth-child(10) { animation-delay: .19s; }
tbody tr:nth-child(n+11) { animation-delay: .21s; }
@keyframes rowIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

/* Отметка посещаемости «выпрыгивает» при простановке */
.cell.present, .cell.absent { animation: markPop .22s ease; }

/* Итоговая оценка мягко подсвечивается после пересчёта */
.cell.final.recount { animation: finalFlash .6s ease; }
@keyframes finalFlash {
    0% { text-shadow: 0 0 0 var(--neon-a0); }
    35% { text-shadow: 0 0 18px var(--neon-a95); }
    100% { text-shadow: 0 0 0 var(--neon-a0); }
}

/* Карточки групп: бегущий блик при наведении */
.group-card { position: relative; overflow: hidden; }
.group-card::after {
    content: "";
    position: absolute;
    top: -60%; left: -70%;
    width: 55%; height: 220%;
    background: linear-gradient(105deg, transparent, var(--shimmer), transparent);
    transform: translateX(-160%) rotate(8deg);
    pointer-events: none;
}
.group-card:hover::after { transition: transform .75s ease; transform: translateX(360%) rotate(8deg); }

/* Кнопки: короткий неоновый блик */
.btn { position: relative; overflow: hidden; }
.btn::before {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(100deg, transparent 35%, var(--shine) 50%, transparent 65%);
    background-size: 260% 100%;
    opacity: 0;
    pointer-events: none;
}
.btn:hover::before { opacity: 1; animation: shimmer .9s linear; }

/* Плитки статистики: появление и подмигивание значения при изменении */
.stat { animation: rise .3s ease backwards; transition: transform .18s ease, box-shadow .18s ease; }
.stat:nth-child(1) { animation-delay: .02s; }
.stat:nth-child(2) { animation-delay: .06s; }
.stat:nth-child(3) { animation-delay: .10s; }
.stat:nth-child(4) { animation-delay: .14s; }
.stat:nth-child(5) { animation-delay: .18s; }
.stat:nth-child(6) { animation-delay: .22s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--glow); }
.s-val.bump { animation: bump .45s ease; }
@keyframes bump { 0% { transform: scale(1); } 45% { transform: scale(1.22); } 100% { transform: scale(1); } }

/* Чипы занятий: мягкое появление списка */
.session-chip { animation: rise .26s ease backwards; transition: border-color .18s ease, transform .18s ease; }
.session-chip:hover { border-color: var(--line-strong); transform: translateY(-1px); }

/* Экран загрузки: неоновое кольцо */
.loading {
    display: flex; flex-direction: column; align-items: center; gap: 16px;
    padding: 90px 20px; color: var(--muted);
}
.loading::before {
    content: "";
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 2px solid var(--neon-a22);
    border-top-color: var(--neon);
    animation: spin .85s linear infinite;
}

/* Логотип в шапке: спокойная неоновая пульсация */
.brand::after {
    content: "";
    display: inline-block;
    width: 6px; height: 6px;
    margin-left: 8px;
    border-radius: 50%;
    background: var(--neon);
    box-shadow: 0 0 10px var(--neon);
    vertical-align: middle;
    animation: breathe 2.6s ease-in-out infinite;
}

/* Модальное окно: плавный вход */
.modal { animation: modalIn .22s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-backdrop { animation: fade .18s ease; }

/* Уведомления: уходят с лёгким сдвигом */
.toast { box-shadow: var(--shadow), 0 0 18px var(--neon-a18); }

/* --------------------------------------------------------------- расписание */

.sched { position: relative; z-index: 1; padding: 22px 26px 60px; animation: fade .3s ease; }

.sched-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 20px;
    padding: 18px 20px;
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.sched-who { flex: 1; min-width: 260px; }
.sched-badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    background: var(--tint-strong); border: 1px solid var(--line);
    color: var(--neon-soft); font-size: 11px; letter-spacing: .5px; text-transform: uppercase;
}
.sched-title { margin: 10px 0 0; font-size: 26px; font-weight: 800; color: var(--text-strong); letter-spacing: .3px; }
.sched-sub { margin-top: 5px; color: var(--neon-soft); font-size: 13.5px; }
.sched-note { margin-top: 3px; color: var(--muted); font-size: 12px; }

.sched-tools { display: flex; flex-direction: column; gap: 10px; min-width: 240px; }
.sched-label { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; display: block; }

/* Кнопка-«селект»: открывает собственный список с поиском вместо системного. */
.sched-pick {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 5px;
    padding: 9px 11px;
    border-radius: 10px;
    background: var(--panel-2);
    border: 1px solid var(--line-strong);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease;
}
.sched-pick .sp-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-pick .sp-hint { flex: 0 0 auto; margin-left: auto; color: var(--muted); font-size: 11px; font-style: normal; white-space: nowrap; }
.sched-pick::after { content: '▾'; margin-left: 6px; color: var(--neon-soft); font-size: 12px; transition: transform .16s ease; }
.sched-pick:hover { border-color: var(--neon); box-shadow: var(--glow); }
.sched-pick:focus { outline: none; }
.sched-pick:focus-visible { border-color: var(--neon); box-shadow: 0 0 0 3px var(--neon-a18); }
.sched-pick[aria-expanded="true"] { border-color: var(--neon); box-shadow: var(--glow); }
.sched-pick[aria-expanded="true"]::after { transform: rotate(180deg); }

/* Панель выбора: всегда влезает в экран, список прокручивается внутри. */
.picker-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /* dvh — реальная видимая высота (без панелей браузера). vh оставлен
       запасным вариантом для старых браузеров, где dvh не поддерживается. */
    height: 100vh;
    height: 100dvh;
    z-index: 55;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--backdrop);
    backdrop-filter: blur(4px);
    animation: fade .18s ease;
}
.picker {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(460px, 100%);
    /* Высота считается от видимой области (её задаёт JS через visualViewport),
       а не от vh: на iOS vh больше реального экрана и панель уезжала вниз. */
    max-height: min(640px, 100%);
    border-radius: var(--radius);
    background: var(--panel-solid);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow), var(--glow);
    overflow: hidden;
    animation: modalIn .22s cubic-bezier(.2, .9, .3, 1.2);
}
.picker-title { margin: 0; padding: 16px 52px 10px 18px; font-size: 15px; font-weight: 700; }
.picker-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-3);
    color: var(--muted);
    font: inherit;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: color .16s ease, border-color .16s ease;
}
.picker-close:hover { color: var(--text); border-color: var(--line-strong); }

.picker-search {
    margin: 0 18px 10px;
    padding: 9px 12px;
    border-radius: 10px;
    background: var(--surface-input);
    border: 1px solid var(--line-strong);
    color: var(--text);
    font: inherit;
    font-size: 13px;
}
.picker-search:focus { outline: none; border-color: var(--neon); box-shadow: 0 0 0 3px var(--neon-a18); }
.picker-search::placeholder { color: var(--muted); }
.picker-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 10px 12px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}
.picker-item:hover { background: var(--tint-mid); }
.picker-item:focus-visible { outline: none; border-color: var(--neon); background: var(--tint-mid); }
.picker-item.on { background: var(--tint-on); color: var(--neon-soft); font-weight: 700; }
.picker-item .pi-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-item .pi-hint { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.picker-item.on .pi-hint { color: var(--neon-soft); }
.picker-item.on::after { content: '✓'; flex: 0 0 auto; font-size: 13px; color: var(--neon); }
.picker-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* Панель выбора даты: та же оболочка, что у списков, но внутри сетка дней. */
.picker-date { width: min(344px, 100%); }
.picker-date .picker-title { padding-bottom: 4px; }
.picker-cal { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 14px 2px; }
.picker-cal .inline-cal { margin-top: 0; }
/* Ячейки крупнее, чем в модалке: панель открывают и пальцем на телефоне. */
.picker-date .ic-day, .picker-date .ic-blank { height: 38px; }
.picker-date .ic-day { font-size: 14px; }
.picker-date .ic-cell { height: 40px; font-size: 13px; }
.picker-cal-note { display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 4px 14px 0; color: var(--muted); font-size: 11px; }
.pcn-dot { flex: none; width: 4px; height: 4px; border-radius: 50%; background: var(--neon); }
.picker-cal-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 8px 10px; margin-top: 10px; padding: 10px 14px 14px; border-top: 1px solid var(--line); }
.pcf-selected { color: var(--neon-soft); font-size: 12.5px; font-weight: 700; text-align: right; }

/* Пока открыт список, страница под ним не прокручивается (важно для iOS). */
body.picker-open { overflow: hidden; }
.sched-actions { display: flex; flex-wrap: wrap; gap: 10px; min-width: 0; }
.sched-actions .btn { flex: 1 1 auto; min-width: 0; justify-content: center; }

.sched-days { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.sched-day {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    min-width: 92px; padding: 10px 14px; cursor: pointer;
    border-radius: 12px; background: var(--surface-3);
    border: 1px solid var(--line); color: var(--muted);
    font-family: inherit; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.sched-day:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.sched-day.on { border-color: var(--neon); background: var(--tint-active); box-shadow: var(--glow); }
.sched-day .sd-date { font-size: 17px; font-weight: 800; color: var(--neon-soft); }
.sched-day .sd-wd { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; }
.sched-day .sd-count { font-size: 11px; color: var(--muted); }
.sched-day.today .sd-wd::after { content: ' · сегодня'; color: var(--warn); }

.sched-panel h2 { margin: 0 0 14px; font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: .3px; }
.sched-panel h2 small { color: var(--muted); font-weight: 500; margin-left: 8px; }
.sched-scroll {
    border-radius: var(--radius); border: 1px solid var(--line);
    background: var(--panel); box-shadow: var(--shadow); overflow: auto;
    scrollbar-color: var(--neon-deep) var(--scrollbar-bg);
}
table.sched-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.sched-table th, table.sched-table td {
    padding: 11px 14px; text-align: left; vertical-align: top;
    border-bottom: 1px solid var(--neon-a12);
}
table.sched-table thead th {
    position: sticky; top: 0; z-index: 1;
    background: var(--panel-solid); color: var(--muted);
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px;
}
table.sched-table tbody tr { animation: rise .3s ease backwards; }
table.sched-table tbody tr:hover { background: var(--tint-subtle); }
table.sched-table tbody tr:last-child td { border-bottom: none; }
.sc-slot { width: 34px; font-weight: 800; color: var(--neon-soft); text-align: center; }
.sc-time { width: 116px; white-space: nowrap; color: var(--neon-soft); font-variant-numeric: tabular-nums; }
.sc-room { width: 84px; white-space: nowrap; color: var(--neon-soft); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.sc-subject { min-width: 260px; }
.sc-group { width: 96px; white-space: nowrap; color: var(--text); font-weight: 600; }
.sc-teacher { width: 170px; color: var(--text); }
.sc-kind { margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.sc-place { color: var(--muted); font-size: 12.5px; }

.sched-search {
    width: 100%; padding: 9px 12px; border-radius: 10px;
    background: var(--panel-2); border: 1px solid var(--line-strong);
    color: var(--text); font-family: inherit; font-size: 13px;
}
.sched-search:focus { outline: none; border-color: var(--neon); box-shadow: var(--glow); }
.sched-search::placeholder { color: var(--muted); }

.sched-back { margin-top: 20px; }
.sched-back .btn { display: inline-block; }

/* Расписание звонков: два блока рядом, на узких экранах — друг под другом. */
.bells-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 16px; align-items: start; }
.bells-grid .sched-panel { margin: 0; }
.bells-grid .sched-panel h2 { margin-bottom: 4px; }
.bells-note { margin: 0 0 12px; }
.sched-panel.bells-today {
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow), var(--glow);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.bells-grid .sc-slot { width: 46px; }

@media (max-width: 980px) {
    .home { grid-template-columns: 1fr; padding: 28px 18px 40px; }
    .hero-title { font-size: 44px; }
    .sheet-page { padding: 16px 12px 40px; }
    .table-shell { max-height: none; min-height: 0; }
    .col-name { width: 220px; min-width: 220px; max-width: 220px; }
    table.sheet thead th.grp-grade { min-width: 84px; }
    .sched { padding: 18px 16px 44px; }
}

/* ------------------------------------------------- планшеты и телефоны */

/* Расписание на планшетах и телефонах: строки таблицы становятся карточками.
   Порог 860px выбран под iPad в портретной ориентации (768/820px), где
   шесть колонок таблицы уже не помещаются без горизонтальной прокрутки. */
@media (max-width: 860px) {
    .sched-scroll { overflow: visible; border: none; background: none; box-shadow: none; }

    table.sched-table,
    table.sched-table tbody,
    table.sched-table tr,
    table.sched-table td { display: block; width: auto; }
    table.sched-table thead { display: none; }
    table.sched-table tr {
        position: relative;
        margin-bottom: 10px;
        padding: 12px 14px;
        border-radius: 12px;
        border: 1px solid var(--line);
        background: var(--panel);
        box-shadow: var(--shadow);
    }
    table.sched-table tr:last-child { margin-bottom: 0; }
    table.sched-table td {
        padding: 2px 0;
        border: none;
        text-align: left;
        font-size: 13px;
    }
    table.sched-table td[data-label]::before {
        content: attr(data-label) " — ";
        color: var(--muted);
        font-size: 10.5px;
        text-transform: uppercase;
        letter-spacing: .4px;
    }
    .sc-slot {
        position: absolute;
        top: 10px; right: 12px;
        width: auto;
        padding: 2px 9px;
        border-radius: 999px;
        background: var(--tint-hover);
        border: 1px solid var(--line);
        font-size: 12px;
    }
    /* Номер пары в карточке: только цифра. Слово «пара» добавляется в тексте
       с правильным склонением, а в тесной плашке оно ломало бы формат. */
    .sc-slot::after { content: none; }
    .sc-time { width: auto; font-size: 15px; font-weight: 700; padding-right: 60px; }
    .sc-time::before { content: none !important; }
    .sc-room { width: auto; text-align: left; }
    .sc-subject { min-width: 0; margin-top: 6px; font-size: 14px; }
    .sc-subject::before { content: none !important; }
    .sc-teacher, .sc-group { width: auto; }
    .sc-place { font-size: 12px; margin-top: 4px; word-break: break-word; }
}

@media (max-width: 760px) {
    /* Шапка: бренд слева, гамбургер справа. Меню раскрывается вниз. */
    .topbar { flex-wrap: wrap; gap: 8px 10px; padding: 10px 12px; }
    .brand { flex: 0 0 auto; font-size: 17px; }
    .brand::after { margin-left: 5px; }

    /* Гамбургер виден только на мобильном. */
    .nav-toggle { display: inline-flex; }
    /* По умолчанию меню скрыто — JS показывает при нажатии гамбургера. */
    .nav {
        display: none;
        order: 2;
        flex: 1 0 100%;
        flex-direction: column;
        padding: 8px 0;
        gap: 4px;
        align-items: stretch;
    }
    .nav-btn {
        width: 100%;
        text-align: center;
        padding: 10px 12px;
        font-size: 13px;
        border-radius: 10px;
    }
    .sched-refresh-btn {
        width: 100%;
        text-align: center;
        padding: 10px 12px;
        font-size: 13px;
        border-radius: 10px;
    }
    .crumbs { order: 3; flex: 1 0 100%; font-size: 12px; }
    .theme-switch { order: 4; margin-left: auto; }

    .glow-a, .glow-b { display: none; }

    /* Главная */
    .home { gap: 22px; padding: 20px 12px 32px; }
    .hero-title { font-size: 36px; letter-spacing: -1px; }
    .hero-sub { font-size: 13.5px; }
    .hero-stats { gap: 12px; padding: 12px 14px; }
    .hs-num { font-size: 19px; }
    .group-grid { grid-template-columns: 1fr; gap: 10px; }
    .group-card { padding: 14px; }

    /* Ведомость */
    .sheet-page { padding: 12px 8px 32px; }
    .sheet-head { padding: 14px; gap: 12px; }
    .sh-title { font-size: 19px; }
    .sh-main { min-width: 0; }
    .stats { width: 100%; gap: 8px; }
    .stat { flex: 1 1 90px; min-width: 0; padding: 8px 10px; }
    .stat .s-val { font-size: 17px; }
    .sheet-tools { gap: 8px; }
    .sheet-tools .btn { flex: 1 1 auto; justify-content: center; }
    .legend { display: none; }

    /* Таблица: компактнее, ФИО уже, но горизонтальный скролл остаётся. */
    .col-num { width: 30px; min-width: 30px; max-width: 30px; font-size: 11px; }
    .col-name { left: 30px; width: 150px; min-width: 150px; max-width: 150px; }
    td.col-name { padding: 8px 10px !important; font-size: 12.5px; }
    table.sheet { font-size: 12.5px; }
    table.sheet thead th { min-width: 84px; padding: 8px 6px; font-size: 11.5px; }
    table.sheet thead th.grp-att { min-width: 108px; }
    .cell, .abs-badge, .cell-box { min-height: 46px; }
    .cell { padding: 9px 6px; font-size: 14px; }
    .att-btn { width: 46px; height: 38px; margin: 4px 0; font-size: 18px; }
    .cell-note { font-size: 10.5px; }
    .col-head .ch-name { max-width: 92px; }
    .sessions-panel { padding: 12px; }
    .session-chip { font-size: 11.5px; }

    /* Расписание: карточки вместо широкой таблицы. */
    .sched { padding: 14px 10px 36px; }
    .sched-head { padding: 14px; gap: 14px; }
    .sched-who { min-width: 0; }
    .sched-title { font-size: 21px; }
    .sched-sub { font-size: 12.5px; }
    .sched-tools { min-width: 0; width: 100%; }
    .sched-actions .btn { flex: 1 1 120px; justify-content: center; }
    .sched-days { gap: 8px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
    .sched-day { min-width: 78px; padding: 8px 10px; flex: 0 0 auto; }
    .sched-day .sd-date { font-size: 15px; }
    .sched-panel h2 { font-size: 15px; }

    /* Модалка и уведомления — на всю ширину экрана. */
    .modal { width: calc(100vw - 24px); padding: 16px; max-height: calc(100vh - 32px); overflow: auto; }
    .modal-actions { flex-wrap: wrap; }
    .modal-actions .btn { flex: 1 1 120px; justify-content: center; }
    .toast-host { left: 10px; right: 10px; bottom: 10px; }
    .toast { min-width: 0; max-width: none; }

    /* iOS не зумит страницу, если поле не меньше 16px. */
    .sched-search, .field input, .field textarea { font-size: 16px; }

    /* Панель выбора: снизу, как системный лист, чтобы дотягиваться большим пальцем. */
    .picker-backdrop {
        padding: 10px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        align-items: flex-end;
    }
    .picker { width: 100%; max-height: min(78dvh, 100%); }
    .picker-search { font-size: 16px; }
    .picker-item { padding: 13px 12px; font-size: 15px; }
}

@media (max-width: 420px) {
    .hero-title { font-size: 30px; }
    .topbar-actions .btn { padding: 6px 8px; }
    .col-name { width: 124px; min-width: 124px; max-width: 124px; }
    td.col-name { font-size: 12px; }
    .sched-title { font-size: 18px; }
    .stat { flex: 1 1 78px; }
}

/* На сенсорных экранах нет наведения: служебные кнопки видны сразу. */
@media (hover: none) {
    .student-del, .note-toggle, .col-actions { opacity: 1; display: inline-flex; }
    .col-actions { display: flex; }
}

/* Уважение к системной настройке «уменьшить движение» */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001s !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001s !important;
    }
}

/* ==========================================================================
   Новые блоки: навигация, тема, экран входа, календарь, титульная страница
   ========================================================================== */

/* Переключатель темы: три сегмента в одной рамке. */
.theme-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px;
    background: var(--surface-ghost); border: 1px solid var(--line); }
.theme-btn {
    width: 30px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 8px; background: transparent; color: var(--muted);
    font-size: 13px; cursor: pointer; transition: background .16s ease, color .16s ease;
}
.theme-btn:hover { color: var(--neon-soft); background: var(--tint-mid); }
.theme-btn.on { background: var(--tint-active); color: var(--text-strong); }

/* Логотип в шапке и на титульной странице.
   Подложка и рамка убраны: показываем прозрачный PNG (logo_fon.*),
   а светлая плитка под ним выглядела бы как белый квадрат. */
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; object-fit: contain; }
.brand-text { line-height: 1.1; }

/* ------------------------------------------------------------------ экраны */

.entry { display: flex; justify-content: center; padding: 48px 18px 64px; }
.entry-card {
    width: min(620px, 100%); padding: 30px 30px 26px; border-radius: 20px;
    background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
    animation: rise .34s ease both;
}
.entry-card.narrow { width: min(460px, 100%); }
.entry-logo { width: 84px; height: 84px; border-radius: 14px; object-fit: contain;
    display: block; margin: 0 auto 16px; }
.entry-kicker { font-size: 11px; letter-spacing: 1.1px; text-transform: uppercase;
    color: var(--muted); margin-bottom: 8px; text-align: center; }
.entry-title { margin: 0 0 10px; font-size: 40px; font-weight: 900; letter-spacing: -1px;
    color: var(--text-strong); text-align: center; }
.entry-title.small { font-size: 26px; letter-spacing: -.3px; }
.entry-sub { margin: 0 auto 22px; max-width: 46ch; color: var(--muted); font-size: 13.5px;
    line-height: 1.6; text-align: center; }
.entry-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.entry-btn { flex: 1 1 210px; flex-direction: column; align-items: stretch; gap: 3px;
    padding: 14px 16px; text-align: left; }
.entry-btn-title { font-size: 15px; font-weight: 800; }
.entry-btn-note { font-size: 11.5px; font-weight: 500; opacity: .82; }
.entry-remember { display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 18px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.entry-remember input { width: 15px; height: 15px; accent-color: var(--neon); cursor: pointer; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form .entry-actions { margin-top: 6px; }

/* --------------------------------------------------------------- календарь */

.cal { margin-bottom: 16px; padding: 12px; border-radius: var(--radius);
    background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.cal-move { display: flex; gap: 6px; }
.cal-range { flex: 1; min-width: 150px; color: var(--muted); font-size: 12.5px; }
/* Поле даты — кнопка, а не <input type="date">: системный календарь браузера
   не перенимает тему сайта и на телефоне открывается чужим окном. Панель
   рисует интерфейс (openDatePicker). */
.cal-pick {
    display: inline-flex; align-items: center; gap: 6px; min-height: 32px;
    padding: 6px 10px; border-radius: 9px; background: var(--surface-input);
    border: 1px solid var(--line-strong); color: var(--text); font: inherit;
    font-size: 12.5px; font-variant-numeric: tabular-nums; cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease;
}
.cal-pick .cp-text { white-space: nowrap; }
.cal-pick::after { content: '▾'; color: var(--neon-soft); font-size: 12px; transition: transform .16s ease; }
.cal-pick:hover { border-color: var(--neon); box-shadow: var(--glow); }
.cal-pick:focus { outline: none; }
.cal-pick:focus-visible { border-color: var(--neon); box-shadow: 0 0 0 3px var(--neon-a18); }
.cal-pick[aria-expanded="true"] { border-color: var(--neon); box-shadow: var(--glow); }
.cal-pick[aria-expanded="true"]::after { transform: rotate(180deg); }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.cal-day {
    display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px;
    border-radius: 11px; border: 1px solid var(--line); background: var(--surface-3);
    color: var(--muted); font: inherit; cursor: pointer;
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.cal-day:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.cal-day.on { border-color: var(--neon); background: var(--tint-active); box-shadow: var(--glow); }
.cal-day.today .cd-wd { color: var(--warn); }
.cal-day.weekend { background: var(--surface-ghost); }
.cal-day.blank { opacity: .72; }
/* Воскресенье — выходной: расписания не бывает, клик ведёт на понедельник. */
.cal-day.sunday { opacity: .5; background: var(--surface-ghost); }
.cal-day.sunday .cd-num { color: var(--muted); }
.cal-day.sunday .cd-count { font-size: 9px; letter-spacing: .2px; }
.cd-wd { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; }
.cd-num { font-size: 18px; font-weight: 800; color: var(--neon-soft); line-height: 1.15; }
.cd-count { font-size: 10px; color: var(--muted); white-space: nowrap; }

/* ----------------------------------------------------------- режим и списки */

.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 11px;
    background: var(--surface-ghost); border: 1px solid var(--line); }
.seg-btn { padding: 6px 14px; border: 0; border-radius: 8px; background: transparent;
    color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
    transition: background .16s ease, color .16s ease; }
.seg-btn:hover { color: var(--neon-soft); }
.seg-btn.on { background: var(--tint-active); color: var(--text-strong); }

/* Выпадающие списки рисует интерфейс: см. .sched-pick и .picker-backdrop. */

/* Служебная строка об импорте — только для администратора. */
.sched-serv { margin-top: 8px; padding: 7px 10px; border-radius: 9px; font-size: 11px;
    color: var(--muted); background: var(--surface-3); border: 1px dashed var(--line-strong);
    word-break: break-word; }

/* Недельный разворот: блоки дней подряд. */
.sched-week { display: flex; flex-direction: column; gap: 14px; }
.sched-day-block { padding: 14px 16px; border-radius: var(--radius);
    background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.sched-day-block.on { border-color: var(--neon); box-shadow: var(--shadow), var(--glow); }
.sched-day-block.weekend { background: var(--surface-ghost); }
.sched-day-block h3 { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--text); }
.sched-day-block h3 small { margin-left: 8px; font-size: 11.5px; font-weight: 500; color: var(--muted); }

/* Сообщение об отсутствии расписания. */
.empty-note b { display: block; margin-bottom: 6px; font-size: 14px; color: var(--text); }
.empty-note p { margin: 0 0 12px; color: var(--muted); font-size: 12.5px; }
.empty-note.thin { padding: 12px; font-size: 12.5px; }

/* ------------------------------------------------------- титульная страница */

/* Водяной знак logo_fon.* на фоне титульных экранов (класс ставит JS,
   когда в папке logo/ есть файл logo_fon.png). */
.landing.has-logo-bg, .entry.has-logo-bg { position: relative; }
.has-logo-bg::before {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: var(--logo-bg, none) center / min(480px, 75%) no-repeat;
    opacity: .32; mix-blend-mode: screen;
}
.has-logo-bg > * { position: relative; z-index: 1; }
:root[data-theme="light"] .has-logo-bg::before { opacity: .07; mix-blend-mode: normal; }

.landing { max-width: 1080px; margin: 0 auto; padding: 40px 26px 64px; animation: fade .32s ease; }
.landing-head { display: flex; align-items: center; gap: 22px; margin-bottom: 30px; }
.landing-logo { width: 96px; height: 96px; border-radius: 16px; object-fit: contain;
    flex: 0 0 auto; }
.landing-head .entry-kicker { text-align: left; margin-bottom: 6px; }
.landing-head .hero-title { font-size: 52px; }
.landing-head .hero-sub { margin: 14px 0 0; max-width: 60ch; }
.landing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 14px; }
.tile {
    display: flex; flex-direction: column; gap: 7px; padding: 20px; border-radius: var(--radius);
    background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
    text-decoration: none; color: var(--text); animation: rise .3s ease both;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.tile:nth-child(2) { animation-delay: .07s; }
.tile:nth-child(3) { animation-delay: .14s; }
.tile:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow), var(--glow); }
.tile-num { font-size: 11px; letter-spacing: 1.4px; color: var(--neon); }
.tile-title { font-size: 17px; font-weight: 800; color: var(--text-strong); }
.tile-note { font-size: 12px; color: var(--muted); line-height: 1.45; }
.landing-foot { margin-top: 26px; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.foot-admin { color: var(--muted); text-decoration: none; opacity: .55; margin-left: 8px; transition: opacity .16s ease; }
.foot-admin:hover { opacity: 1; text-decoration: underline; }

/* ------------------------------------------------------------------ подвал */

.site-footer {
    position: relative; z-index: 1;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 14px;
    max-width: 1080px; margin: 10px auto 0; padding: 16px 26px 26px;
    border-top: 1px solid var(--line);
    color: var(--muted); font-size: 12px; line-height: 1.6; text-align: center;
}
.site-footer a { color: var(--neon-soft); text-decoration: none; white-space: nowrap; }
.site-footer a:hover { text-decoration: underline; }

@media (max-width: 760px) {
    .topbar { padding: 9px 12px; }
    .brand-logo { width: 26px; height: 26px; }
    /* Стили гамбургера и .nav уже заданы выше — здесь только контент. */

    .entry { padding: 22px 12px 40px; }
    .entry-card { padding: 20px 16px; }
    .entry-title { font-size: 28px; }
    .entry-btn { flex: 1 1 100%; }

    .landing { padding: 22px 14px 40px; }
    .site-footer { padding: 14px 14px 22px; }
    .landing-head { flex-direction: column; align-items: flex-start; gap: 14px; }
    .landing-logo { width: 70px; height: 70px; }
    .landing-head .hero-title { font-size: 32px; }

    .cal { padding: 9px; }
    .cal-bar { gap: 7px; }
    .cal-row { gap: 4px; }
    .cal-day { padding: 6px 2px; }
    .cd-num { font-size: 15px; }
    .cd-count { font-size: 9px; }
    /* Кнопка, а не поле: 16px для защиты от авто-зума iOS уже не нужен,
       но на всю ширину строки она остаётся крупной кнопкой под палец. */
    .cal-pick { flex: 1 1 100%; min-height: 40px; justify-content: center; }
}
