/* =========================================================
   EduSuite — единая дизайн-система
   Светлая и тёмная темы, SVG-иконки, hover-обратная связь.
   Анимации используются только для индикации загрузки.
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* --- Токены светлой темы --- */
:root {
    color-scheme: light;

    --c-bg: #f4f6fb;
    --c-surface: #ffffff;
    --c-surface-2: #ffffff;
    --c-bg-subtle: #f3f5fa;
    --c-border: #edf0f6;
    --c-border-strong: #dbe1ec;

    --c-text: #0f172a;
    --c-text-soft: #3f4a63;
    --c-text-muted: #5b6579;

    --c-primary: #4f46e5;
    --c-primary-hover: #4338ca;
    --c-primary-soft: #eef1ff;

    --c-success: #15803d;
    --c-success-soft: #dcfce7;
    --c-warning: #b45309;
    --c-warning-soft: #fef3c7;
    --c-danger: #dc2626;
    --c-danger-hover: #b91c1c;
    --c-danger-soft: #fee2e2;

    --c-violet: #7c3aed;
    --c-violet-soft: #f4efff;
    --c-sky: #0369a1;
    --c-sky-soft: #e0f2fe;
    --c-amber: #b45309;
    --c-amber-soft: #fef3c7;

    --c-place-bg: #fff7ed;
    --c-place-text: #c2410c;
    --c-group-bg: #eff6ff;
    --c-group-text: #1d4ed8;

    --c-topbar-bg: rgba(244, 246, 251, 0.86);
    --c-hover-row: #f8fafc;
    --c-selected-bg: #f6f7ff;
    --c-overlay: rgba(15, 23, 42, 0.4);
    --c-modal-scrim: rgba(15, 23, 42, 0.5);
    --c-toast-bg: #1e293b;
    --c-toast-text: #ffffff;
    --c-scrollbar: #c3cbd9;
    --c-spinner-track: #e2e8f0;
    --c-progress-track: #e9edf5;
    --c-code-bg: #0f172a;
    --c-code-text: #c7d2fe;

    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

    --r-sm: 0.75rem;
    --r-md: 1rem;
    --r-lg: 1.5rem;
    --r-xl: 2rem;

    --sp-page: 1.5rem;

    --shadow-card: 0 1px 2px rgba(34, 41, 60, 0.05);
    --shadow-pop: 0 20px 40px -12px rgba(30, 41, 59, 0.22);
    --shadow-primary: 0 16px 32px -12px rgba(79, 70, 229, 0.55);

    --icon-size: 1.125rem;
}

/* --- Токены тёмной темы --- */
[data-theme="dark"] {
    color-scheme: dark;

    --c-bg: #0a0f1f;
    --c-surface: #111a30;
    --c-surface-2: #16213c;
    --c-bg-subtle: #16213c;
    --c-border: #1e2a47;
    --c-border-strong: #2d3c63;

    --c-text: #f1f5f9;
    --c-text-soft: #c9d3e4;
    --c-text-muted: #94a3b8;

    --c-primary: #8b93ff;
    --c-primary-hover: #a5adff;
    --c-primary-soft: rgba(139, 147, 255, 0.16);

    --c-success: #4ade80;
    --c-success-soft: rgba(74, 222, 128, 0.14);
    --c-warning: #fbbf24;
    --c-warning-soft: rgba(251, 191, 36, 0.14);
    --c-danger: #f87171;
    --c-danger-hover: #fca5a5;
    --c-danger-soft: rgba(248, 113, 113, 0.14);

    --c-violet: #a78bfa;
    --c-violet-soft: rgba(167, 139, 250, 0.16);
    --c-sky: #38bdf8;
    --c-sky-soft: rgba(56, 189, 248, 0.14);
    --c-amber: #fbbf24;
    --c-amber-soft: rgba(251, 191, 36, 0.14);

    --c-place-bg: rgba(251, 146, 60, 0.14);
    --c-place-text: #fdba74;
    --c-group-bg: rgba(96, 165, 250, 0.14);
    --c-group-text: #93c5fd;

    --c-topbar-bg: rgba(10, 15, 31, 0.86);
    --c-hover-row: #16213c;
    --c-selected-bg: rgba(139, 147, 255, 0.12);
    --c-overlay: rgba(2, 6, 23, 0.6);
    --c-modal-scrim: rgba(2, 6, 23, 0.65);
    --c-toast-bg: #1e2a47;
    --c-toast-text: #f1f5f9;
    --c-scrollbar: #2d3c63;
    --c-spinner-track: #243050;
    --c-progress-track: #22304f;
    --c-code-bg: #0b1224;
    --c-code-text: #a5b4fc;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-pop: 0 24px 48px -12px rgba(0, 0, 0, 0.65);
    --shadow-primary: 0 16px 32px -12px rgba(139, 147, 255, 0.4);
}

@media (min-width: 1024px) {
    :root { --sp-page: 3rem; }
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-sans);
    background-color: var(--c-bg);
    color: var(--c-text);
    -webkit-font-smoothing: antialiased;
    -webkit-overflow-scrolling: touch;
}

/* --- Иконки --- */
.icon {
    width: var(--icon-size);
    height: var(--icon-size);
    flex-shrink: 0;
    display: inline-block;
    vertical-align: -0.2em;
}
.icon-lg { width: 1.6rem; height: 1.6rem; }
.icon-xl { width: 2.25rem; height: 2.25rem; }

/* --- Типографика --- */
.page-title { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.page-subtitle { font-size: 0.875rem; font-weight: 600; color: var(--c-text-muted); margin: 0.375rem 0 0; }
.section-title { font-size: 1.125rem; font-weight: 800; margin: 0; }
.text-muted { color: var(--c-text-muted); }
.text-soft { color: var(--c-text-soft); }
.eyebrow {
    font-size: 0.6875rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--c-text-muted);
}

@media (min-width: 768px) {
    .page-title { font-size: 2.25rem; }
}

/* --- Кнопки --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.875rem 1.5rem; border: 1px solid transparent; border-radius: var(--r-md);
    font-family: inherit; font-size: 0.8125rem; font-weight: 700;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
    transform: translateY(0);
}
.btn:active { transform: translateY(1px) scale(0.985); }
.btn:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: linear-gradient(135deg, var(--c-primary), var(--c-violet));
    color: #fff; box-shadow: var(--shadow-primary);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--c-primary-hover), var(--c-violet)); box-shadow: 0 18px 38px -12px var(--c-primary); }

.btn-secondary {
    background: var(--c-surface); color: var(--c-text-soft); border-color: var(--c-border-strong);
}
.btn-secondary:hover { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-selected-bg); }

.btn-ghost { background: transparent; color: var(--c-text-soft); }
.btn-ghost:hover { background: var(--c-bg-subtle); color: var(--c-text); }

.btn-danger { background: var(--c-danger); color: #fff; }
.btn-danger:hover { background: var(--c-danger-hover); box-shadow: 0 14px 28px -12px var(--c-danger); }

.btn-block { width: 100%; }
.btn-sm { padding: 0.625rem 1rem; font-size: 0.75rem; }
.btn-lg { padding: 1rem 1.75rem; font-size: 0.9375rem; }
.btn-icon { padding: 0.75rem; width: 2.75rem; height: 2.75rem; }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.25rem; height: 2.25rem; flex-shrink: 0;
    padding: 0; border: none; border-radius: 0.625rem; cursor: pointer;
    background: transparent; color: var(--c-text-muted);
    transition: background-color 0.15s, color 0.15s, transform 0.1s;
}
.icon-btn:hover { background: var(--c-primary-soft); color: var(--c-primary); }
.icon-btn:active { transform: scale(0.94); }

/* --- Тема --- */
.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.5rem; height: 2.5rem; flex-shrink: 0;
    border: 1px solid var(--c-border-strong); border-radius: var(--r-sm);
    background: var(--c-surface); color: var(--c-text-soft); cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.theme-toggle:hover { color: var(--c-primary); border-color: var(--c-primary); background: var(--c-selected-bg); }
.theme-icon-sun { display: none; }
.theme-icon-moon { display: block; }
[data-theme="dark"] .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }

/* --- Формы --- */
.field { display: block; margin-bottom: 1.25rem; }
.field-label {
    display: block; margin-bottom: 0.5rem;
    font-size: 0.75rem; font-weight: 700; color: var(--c-text-soft);
}
.input, .select, .textarea {
    width: 100%; padding: 0.9375rem 1.125rem;
    background: var(--c-bg-subtle); color: var(--c-text);
    border: 2px solid var(--c-border); border-radius: var(--r-md);
    font-family: inherit; font-size: 0.875rem; font-weight: 600;
    transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s; outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--c-text-muted); font-weight: 500; }
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--c-primary); background: var(--c-surface);
    box-shadow: 0 0 0 4px var(--c-primary-soft);
}
.textarea { resize: vertical; min-height: 6rem; }
.note-input {
    height: 9rem; min-height: 9rem; max-height: 9rem;
    resize: none; overflow-y: auto; line-height: 1.5;
}
.field-hint { margin: 0.5rem 0 0; font-size: 0.6875rem; font-weight: 600; color: var(--c-text-muted); }
.checkbox {
    display: inline-flex; align-items: center; gap: 0.625rem;
    cursor: pointer; user-select: none; margin-bottom: 1.25rem;
    font-size: 0.8125rem; font-weight: 600; color: var(--c-text-soft);
}
.checkbox input { position: absolute; opacity: 0; pointer-events: none; }
.checkbox-box {
    display: inline-flex; align-items: center; justify-content: center;
    flex: none; width: 1.25rem; height: 1.25rem;
    background: var(--c-bg-subtle); border: 2px solid var(--c-border-strong); border-radius: 0.4375rem;
    color: transparent; transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.checkbox:hover .checkbox-box { border-color: var(--c-primary); }
.checkbox input:checked + .checkbox-box { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.checkbox input:focus-visible + .checkbox-box { outline: none; box-shadow: 0 0 0 3px var(--c-primary-soft); }
.checkbox-box .icon { width: 0.875rem; height: 0.875rem; }

.password-wrap { position: relative; }
.password-wrap .input { padding-right: 3rem; }
.password-toggle {
    position: absolute; right: 0.375rem; top: 50%; transform: translateY(-50%);
    color: var(--c-text-muted); border-radius: var(--r-sm);
}
.password-toggle:hover, .password-toggle.active { color: var(--c-primary); }
.password-generate { margin-top: 0.625rem; width: 100%; justify-content: center; }
.pw-checklist {
    list-style: none; margin: 0.75rem 0 0; padding: 0;
    display: grid; gap: 0.4375rem;
}
.pw-checklist li {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.75rem; font-weight: 700; color: var(--c-text-muted);
    transition: color 0.15s;
}
.pw-checklist li::before {
    content: ''; flex: none; width: 0.875rem; height: 0.875rem; border-radius: 999px;
    border: 2px solid var(--c-border-strong); background: transparent; transition: all 0.15s;
}
.pw-checklist li.ok { color: var(--c-success); }
.pw-checklist li.ok::before {
    content: '✓'; display: inline-flex; align-items: center; justify-content: center;
    width: 0.9375rem; height: 0.9375rem; border-color: var(--c-success);
    background: var(--c-success); color: #fff; font-size: 0.625rem; font-weight: 800;
}
.field-error {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.875rem 1.125rem; margin-bottom: 1.25rem;
    background: var(--c-danger-soft); color: var(--c-danger);
    border: 1px solid transparent; border-radius: var(--r-md);
    font-size: 0.8125rem; font-weight: 700; text-align: left;
}
.form-divider { position: relative; text-align: center; margin: 1.5rem 0; }
.form-divider span {
    display: inline-block; padding: 0 0.875rem; position: relative; z-index: 1;
    background: var(--c-surface); color: var(--c-text-muted);
    font-size: 0.6875rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
}
.form-divider::before {
    content: ''; position: absolute; left: 0; right: 0; top: 50%;
    height: 1px; background: var(--c-border-strong);
}

[hidden] { display: none !important; }

/* --- Карточки --- */
.card {
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--r-xl); padding: 1.5rem; box-shadow: var(--shadow-card);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.card-interactive { cursor: pointer; text-decoration: none; color: var(--c-text); }
.card-interactive:hover {
    transform: translateY(-4px);
    border-color: var(--c-primary); box-shadow: var(--shadow-primary);
}
.card-interactive:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.card-interactive.selected { border-color: var(--c-primary); background: var(--c-selected-bg); box-shadow: 0 0 0 2px var(--c-primary); }

.card-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.icon-tile {
    display: flex; align-items: center; justify-content: center;
    width: 3rem; height: 3rem; border-radius: var(--r-md);
    background: var(--c-primary-soft); color: var(--c-primary);
    margin-bottom: 1rem;
}
.icon-tile-violet { background: var(--c-violet-soft); color: var(--c-violet); }
.icon-tile-sky { background: var(--c-sky-soft); color: var(--c-sky); }
.icon-tile-amber { background: var(--c-amber-soft); color: var(--c-amber); }
.icon-tile-success { background: var(--c-success-soft); color: var(--c-success); }
.icon-tile-danger { background: var(--c-danger-soft); color: var(--c-danger); }

.kind-image { color: var(--c-success); background: var(--c-success-soft); }
.kind-video { color: var(--c-violet); background: var(--c-violet-soft); }
.kind-audio { color: var(--c-sky); background: var(--c-sky-soft); }
.kind-doc { color: var(--c-place-text); background: var(--c-place-bg); }
.kind-file { color: var(--c-text-muted); background: var(--c-bg-subtle); }

/* --- Таблицы --- */
.table-wrap {
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--r-xl); overflow: auto; box-shadow: var(--shadow-card);
}
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th {
    padding: 1rem; text-align: left; background: var(--c-bg-subtle);
    font-size: 0.6875rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--c-text-muted);
    border-bottom: 1px solid var(--c-border-strong); white-space: nowrap;
}
.table td { padding: 1rem; border-bottom: 1px solid var(--c-border); font-weight: 600; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background-color 0.12s; }
.table tbody tr:hover td { background: var(--c-hover-row); }

/* --- Бейджи --- */
.badge {
    display: inline-flex; align-items: center; gap: 0.375rem;
    padding: 0.3125rem 0.625rem; border-radius: 0.5rem;
    font-size: 0.6875rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
    white-space: nowrap;
}
.badge-primary { background: var(--c-primary-soft); color: var(--c-primary); }
.badge-success { background: var(--c-success-soft); color: var(--c-success); }
.badge-warning { background: var(--c-warning-soft); color: var(--c-warning); }
.badge-danger { background: var(--c-danger-soft); color: var(--c-danger); }
.badge-muted { background: var(--c-bg-subtle); color: var(--c-text-muted); }

/* --- Пустое состояние --- */
.empty-state { padding: 4rem 1.5rem; text-align: center; }
.empty-state .icon-tile { margin: 0 auto 1.25rem; width: 4rem; height: 4rem; }
.empty-state h3 { margin: 0 0 0.5rem; font-size: 1.125rem; font-weight: 800; }
.empty-state p { margin: 0 auto 1.75rem; max-width: 22rem; font-size: 0.8125rem; font-weight: 600; color: var(--c-text-muted); }

/* --- Скроллбары --- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-scrollbar); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-text-muted); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Убираем залипающие ховеры на тач-устройствах */
@media (hover: none) {
    .card-interactive:hover { transform: none; box-shadow: var(--shadow-card); }
    .btn, .icon-btn { transition: none; }
}

/* --- Панель инструментов --- */
.toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.625rem;
    padding: 0.75rem; margin-bottom: 1.5rem;
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--r-md); box-shadow: var(--shadow-card);
}
.toolbar .field { margin-bottom: 0; }
.toolbar-search { flex: 1; max-width: 26rem; }
.toolbar-spacer { flex: 1; }
.date-input {
    padding: 0.75rem 1rem; font-family: var(--font-sans); font-size: 0.8125rem; font-weight: 700;
    color: var(--c-text); background: var(--c-bg-subtle); border: 1px solid var(--c-border-strong);
    border-radius: var(--r-sm); cursor: pointer; color-scheme: light;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.date-input:hover { border-color: var(--c-primary); }
.date-input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-soft); }
/* Иконка-календарь нативного инпута должна быть видна на тёмном фоне */
::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 1; }
[data-theme="dark"] .date-input { color-scheme: dark; }
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: 1; }

/* --- Сетка дней расписания --- */
.week-nav {
    position: sticky; top: calc(var(--topbar-h) + 0.375rem); z-index: 30;
    display: flex; flex-direction: column; gap: 0.5rem;
    margin-bottom: 1rem; padding: 0.625rem 0.875rem;
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--r-md); box-shadow: var(--shadow-card);
}
.week-nav-top { display: flex; align-items: center; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
/* На широких экранах кнопка «Эта неделя» и календарь одинаковой фиксированной ширины, по центру */
.week-nav-top .date-input,
.week-nav-top .btn { flex: 0 0 8.75rem; width: 8.75rem; max-width: 100%; box-sizing: border-box; justify-content: center; white-space: nowrap; }
.week-nav-arrows { display: flex; align-items: center; gap: 0.75rem; justify-content: center; }
.week-nav-arrow {
    width: 2.5rem; height: 2.5rem; flex-shrink: 0; border-radius: 999px;
    background: var(--c-bg-subtle); border: 1px solid var(--c-border);
    color: var(--c-text-soft);
    transition: color 0.15s, border-color 0.15s, background-color 0.15s, transform 0.1s;
}
.week-nav-arrow:hover { color: var(--c-primary); border-color: var(--c-primary); background: var(--c-selected-bg); transform: scale(1.05); }
.week-nav-period {
    font-size: 0.75rem; font-weight: 800; color: var(--c-text-muted);
    white-space: nowrap; text-align: center;
}
.week-cache-note {
    margin: 0.125rem 0 0; font-size: 0.75rem; font-weight: 700;
    color: var(--c-primary); text-align: center;
}
.day-grid {
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fit, 24rem);
    justify-content: center;
    align-items: start;
    align-content: start;
}
.day-card {
    display: flex; flex-direction: column; overflow: hidden;
    width: 24rem; max-width: 100%;
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--r-lg); box-shadow: var(--shadow-card);
    transition: border-color 0.2s, box-shadow 0.2s;
}
/* Дни с 2–3 парами не должны выглядеть слишком короткими */
.day-card { min-height: 18rem; }
.day-card:hover { border-color: var(--c-border-strong); box-shadow: var(--shadow-pop); }
/* Текущий день: мягкая рамка и тонкое кольцо-подсветка вместо яркой тени */
.day-card.today { border-color: color-mix(in srgb, var(--c-primary) 60%, transparent); box-shadow: 0 0 0 3px var(--c-primary-soft), var(--shadow-card); }
.day-card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    min-height: 2.75rem;
    padding: 0.5rem 1rem; background: var(--c-bg-subtle); border-bottom: 1px solid var(--c-border);
}
.day-card.today .day-card-head { background: linear-gradient(135deg, var(--c-primary), var(--c-violet)); }
.day-card.today .day-card-head .day-name,
.day-card.today .day-card-head .day-date { color: #fff; }
.day-name { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 800; text-transform: capitalize; min-width: 0; }
.day-date { font-size: 0.75rem; font-weight: 700; color: var(--c-text-muted); white-space: nowrap; }
/* Бейдж «идёт/следующая пара» — собственная строка под шапкой, не спорит с названием и датой */
.day-card .current-lesson-badge { margin: 0; }
.current-lesson-strip { display: flex; justify-content: center; padding: 0; }
.current-lesson-strip:has(.current-lesson-badge:not([hidden])) { padding: 0.375rem 0.75rem 0.25rem; }
.day-card-body { display: flex; flex-direction: column; gap: 0.375rem; padding: 0.75rem; }

.slot { display: flex; gap: 0.5rem; padding: 0.375rem 0.25rem 0.375rem 0.5rem; border-radius: var(--r-sm); align-items: stretch; }
.slot-time {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem;
    flex: none; width: 5.25rem;
    padding: 0.5rem 0.25rem 0.375rem;
}
.slot-number {
    display: flex; align-items: center; justify-content: center;
    flex: none; width: 1.5rem; height: 1.5rem;
    font-size: 0.6875rem; font-weight: 800;
    background: var(--c-primary-soft); color: var(--c-primary); border-radius: 0.5rem;
}
.slot-hours { font-size: 0.625rem; font-weight: 700; color: var(--c-text-muted); line-height: 1.1; white-space: nowrap; }
.slot-body {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.375rem;
    border-left: 1px solid var(--c-border); padding: 0.125rem 0 0.125rem 0.75rem;
}
/* «Окно» — отдельный тип элемента: не пара, а пустой слот с штриховой заливкой */
.window {
    display: flex; align-items: center; justify-content: center;
    min-height: 4rem; padding: 0.5rem;
    border: 1px dashed var(--c-border-strong); border-radius: var(--r-sm);
    background: repeating-linear-gradient(45deg, transparent, transparent 8px, var(--c-bg-subtle) 8px, var(--c-bg-subtle) 16px);
}
.window-label {
    font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--c-text-muted);
}

.lesson {
    position: relative; padding: 0.5rem 0.625rem; border-radius: var(--r-sm);
    padding-left: 0.5rem; transition: background-color 0.15s, border-color 0.15s;
    border: 1px solid transparent;
    min-height: 3rem;
    display: flex; flex-direction: column; justify-content: center;
    min-width: 0;
}
.lesson:hover { background: var(--c-bg-subtle); }
.lesson + .lesson { margin-top: 0.25rem; border-top: 1px solid var(--c-border); }
.lesson::before {
    content: ''; position: absolute; left: 0; top: 0.25rem; bottom: 0.25rem;
    width: 3px; border-radius: 999px; background: var(--c-primary);
}
.lesson[data-type="lecture"]::before { background: var(--c-violet); }
.lesson[data-type="practice"]::before { background: var(--c-success); }
.lesson[data-type="exam"]::before { background: var(--c-danger); }
.lesson-title { margin: 0 0 0.25rem; font-size: 0.875rem; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; word-break: break-word; }
.lesson .lesson-time { font-size: 0.6875rem; font-weight: 700; color: var(--c-text-muted); }

/* Идёт прямо сейчас — подсветка текущей пары */
.lesson.current-lesson {
    border-color: var(--c-success);
    background: var(--c-success-soft);
}
.lesson.current-lesson::before { background: var(--c-success); }
.current-lesson-badge {
    display: inline-flex; align-items: center; gap: 0.25rem;
    font-size: 0.625rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
    color: #fff;
    background: var(--c-success); border-radius: 0.5rem; padding: 0.125rem 0.5rem;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.chip {
    display: inline-flex; align-items: center; gap: 0.3125rem;
    padding: 0.25rem 0.5rem; border-radius: 0.5rem;
    font-size: 0.6875rem; font-weight: 700; max-width: 100%;
    background: var(--c-bg-subtle); color: var(--c-text-soft);
    border: 1px solid var(--c-border); text-decoration: none;
    overflow-wrap: anywhere; word-break: break-word;
    transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
a.chip:hover { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-selected-bg); }
.chip-tag { background: var(--c-primary-soft); color: var(--c-primary); border-color: transparent; }
.chip-subgroup { background: var(--c-sky-soft); color: var(--c-sky); border-color: transparent; }
.chip-place { background: var(--c-place-bg); color: var(--c-place-text); border-color: transparent; }
.chip-place:hover { border-color: var(--c-place-text); }
.chip-group { background: var(--c-group-bg); color: var(--c-group-text); border-color: transparent; }
/* Кабинет не указан — приглушённый плейсхолдер */
.chip-placeholder { color: var(--c-text-muted); font-style: italic; opacity: 0.8; }

/* --- Приглушение акцентов расписания в тёмной теме --- */
[data-theme="dark"] .day-card.today .day-card-head { background: linear-gradient(135deg, #3f46ad, #6d28d9); }
[data-theme="dark"] .lesson::before { opacity: 0.6; }
[data-theme="dark"] .lesson.current-lesson { border-color: color-mix(in srgb, var(--c-success) 45%, transparent); }
[data-theme="dark"] .slot-number,
[data-theme="dark"] .chip-tag { color: color-mix(in srgb, var(--c-primary) 60%, var(--c-text-muted)); }
[data-theme="dark"] .chip-subgroup { color: color-mix(in srgb, var(--c-sky) 55%, var(--c-text-muted)); }
[data-theme="dark"] .chip-place { color: color-mix(in srgb, var(--c-place-text) 60%, var(--c-text-muted)); }
[data-theme="dark"] .chip-group { color: color-mix(in srgb, var(--c-group-text) 60%, var(--c-text-muted)); }
[data-theme="dark"] .current-lesson-badge { background: var(--c-success-soft); color: var(--c-success); }

/* --- Таблица журнала --- */
.table-journal { width: auto; font-size: 0.8125rem; }
.table-journal th, .table-journal td { padding: 0.5rem 0.625rem; text-align: center; }

.col-sticky { position: sticky; z-index: 2; background: var(--c-surface); }
thead .col-sticky { z-index: 4; background: var(--c-bg-subtle); }
.col-index { left: 0; width: 2.75rem; min-width: 2.75rem; max-width: 2.75rem; color: var(--c-text-muted); font-weight: 700; }
.col-name {
    left: 2.75rem; width: 14rem; min-width: 14rem; max-width: 14rem;
    text-align: left; border-right: 1px solid var(--c-border);
}
.col-lesson { width: 5.5rem; min-width: 5.5rem; max-width: 5.5rem; }
.col-avg {
    width: 5rem; min-width: 5rem; max-width: 5rem; font-weight: 800;
    border-left: 1px solid var(--c-border); background: var(--c-bg-subtle);
}

.lesson-date { display: block; font-size: 0.6875rem; font-weight: 700; color: var(--c-text-muted); }
.lesson-type {
    display: inline-block; margin-top: 0.25rem; padding: 0.125rem 0.375rem;
    border-radius: 0.375rem; font-size: 0.625rem; font-weight: 800;
    background: var(--c-primary-soft); color: var(--c-primary); white-space: nowrap;
}
.lesson-type[data-type="exam"],
.lesson-type[data-type="credit"],
.lesson-type[data-type="diff_credit"] { background: var(--c-danger-soft); color: var(--c-danger); }
.lesson-edit, .row-tools button {
    padding: 0.25rem; border: none; background: none; cursor: pointer;
    color: var(--c-text-muted); border-radius: 0.25rem;
    transition: background-color 0.15s, color 0.15s;
}
.lesson-edit { display: block; margin: 0.25rem auto 0; }
.lesson-edit:hover, .row-tools button:hover { color: var(--c-primary); background: var(--c-primary-soft); }
.student-name { font-weight: 600; }
.row-tools { display: inline-flex; gap: 0.125rem; margin-left: 0.5rem; opacity: 0; transition: opacity 0.15s; }
tbody tr:hover .row-tools, .row-tools:focus-within { opacity: 1; }

.cell-mark { position: relative; padding: 0.25rem !important; }
.cell-mark.has-note::after {
    content: ''; position: absolute; top: 0.25rem; right: 0.25rem;
    width: 0.375rem; height: 0.375rem; border-radius: 50%; background: var(--c-warning);
}
.mark-input, .mark-static {
    display: block; width: 100%; min-width: 2.5rem; padding: 0.375rem 0.25rem;
    font-family: var(--font-sans); font-size: 0.875rem; font-weight: 800; text-align: center;
    color: var(--c-text); background: transparent;
    border: 1px solid transparent; border-radius: var(--r-sm);
    transition: background-color 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.mark-input[data-value=""]:hover, .mark-input:not([data-value]):hover { background: var(--c-bg-subtle); }
.mark-input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-soft); }
.mark-input[data-value="5"], .mark-static[data-value="5"],
.mark-input[data-value="4"], .mark-static[data-value="4"] { color: var(--c-success); background: var(--c-success-soft); }
.mark-input[data-value="3"], .mark-static[data-value="3"] { color: var(--c-warning); background: var(--c-warning-soft); }
.mark-input[data-value="2"], .mark-static[data-value="2"] { color: var(--c-danger); background: var(--c-danger-soft); }
.mark-input[data-value="Н"], .mark-static[data-value="Н"],
.mark-input[data-value="н"], .mark-static[data-value="н"] { color: var(--c-text-muted); background: var(--c-bg-subtle); }
.mark-input.saved { background: var(--c-success-soft); box-shadow: 0 0 0 2px var(--c-success); }

/* --- Просмотр журнала по ссылке: без меню пользователя --- */
.shared-layout { min-height: 100vh; }
.shared-topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    padding: 1rem var(--sp-page);
    background: var(--c-bg); border-bottom: 1px solid var(--c-border);
    backdrop-filter: blur(8px);
}
.shared-topbar-info { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.shared-topbar-mark {
    display: flex; align-items: center; justify-content: center;
    width: 2.25rem; height: 2.25rem; flex-shrink: 0;
    background: var(--c-primary-soft); color: var(--c-primary);
    border-radius: var(--r-md);
}
.shared-topbar-title { margin: 0; font-size: 1.125rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shared-topbar-actions { display: flex; align-items: center; gap: 0.5rem; }

/* --- Страница общего скачивания --- */
.share-panel {
    max-width: 34rem; margin: 0 auto; padding: 2.5rem 1rem;
    display: flex; flex-direction: column; align-items: center; text-align: center;
}
.icon-share-hero { width: 4rem; height: 4rem; margin-bottom: 1rem; }
.share-note { color: var(--c-text-muted); font-weight: 600; font-size: 0.875rem; margin: 0 0 1.25rem; }
.share-files { width: 100%; padding: 0.75rem; margin-bottom: 1.5rem; }
.share-file-row {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.5rem 0.375rem; text-align: left;
}
.share-file-row + .share-file-row { border-top: 1px solid var(--c-border); }
.share-file-name {
    flex: 1; min-width: 0; font-weight: 700; font-size: 0.875rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.share-file-size { font-weight: 700; color: var(--c-text-muted); font-size: 0.75rem; white-space: nowrap; }
.share-download { padding: 0.875rem 2rem; }
.share-link-row { display: flex; gap: 0.5rem; }
.share-link-row .input { flex: 1; min-width: 0; }
.share-link-row .btn { white-space: nowrap; }

/* --- Таймер времени жизни ссылки --- */
.share-timer {
    position: relative; width: 8.5rem; height: 8.5rem; margin-bottom: 1.25rem;
}
.share-timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.share-timer-track,
.share-timer-bar {
    fill: none; stroke-width: 8;
}
.share-timer-track { stroke: var(--c-border); }
.share-timer-bar {
    stroke: url(#share-timer-grad); stroke-linecap: round;
    stroke-dasharray: 326.7; transition: stroke-dashoffset 1s linear;
}
.share-timer-text {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 0.15rem;
}
.share-timer-value {
    font-weight: 800; font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.03em;
    animation: share-timer-pulse 2s ease-in-out infinite;
}
.share-timer-label { font-size: 0.7rem; font-weight: 600; color: var(--c-text-muted); }
@keyframes share-timer-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}
.share-expired-title { font-size: 1.15rem; font-weight: 800; margin: 0 0 0.5rem; }
@media (prefers-reduced-motion: reduce) {
    .share-timer-value { animation: none; }
    .share-timer-bar { transition: none; }
}

/* --- Плитки статистики --- */
.stat-row { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); }
.stat-tile {
    display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
    padding: 1.25rem 0.75rem; text-align: center;
    background: var(--c-bg-subtle); border: 1px solid var(--c-border); border-radius: var(--r-md);
    transition: border-color 0.15s;
}
.stat-tile:hover { border-color: var(--c-primary); }
.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--c-primary); line-height: 1; }
.stat-label { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--c-text-muted); }

.divider { margin: 1.5rem 0; border: none; border-top: 1px solid var(--c-border); }
.field-row { display: flex; gap: 0.75rem; }
.field-row .field { flex: 1; }
.hint {
    display: flex; align-items: center; gap: 0.5rem; margin-top: 1rem;
    font-size: 0.75rem; color: var(--c-text-muted);
}

/* --- Хранилище --- */
.file-item { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; cursor: pointer; }
.file-item:hover { border-color: var(--c-border-strong); box-shadow: var(--shadow-pop); }
.file-item.selected { border-color: var(--c-primary); box-shadow: var(--shadow-primary); }
.file-selected-badge {
    position: absolute; top: 0.875rem; right: 0.875rem;
    display: flex; align-items: center; justify-content: center;
    width: 1.5rem; height: 1.5rem; border-radius: 999px;
    background: var(--c-primary); color: #fff; box-shadow: var(--shadow-primary);
}
.file-selected-badge svg { width: 0.875rem; height: 0.875rem; }

.file-name {
    width: 100%; margin: 0.5rem 0 0.375rem; font-size: 0.875rem; font-weight: 700;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-meta { margin: 0 0 1.25rem; font-size: 0.6875rem; font-weight: 700; color: var(--c-text-muted); }
.file-actions { display: flex; gap: 0.375rem; align-items: center; margin-top: auto; width: 100%; justify-content: center; }
.file-actions .btn-sm { flex: 1; }
.file-actions button, .file-actions a { pointer-events: auto; }
.file-actions .btn-icon { color: var(--c-text-muted); }
.file-actions .btn-icon:hover { background: var(--c-bg-subtle); }
.file-btn-download { color: var(--c-success) !important; }
.file-btn-download:hover { background: var(--c-success-soft) !important; }
.file-btn-share { color: var(--c-violet) !important; }
.file-btn-share:hover { background: var(--c-violet-soft) !important; }
.file-btn-delete { color: var(--c-danger) !important; }
.file-btn-delete:hover { background: var(--c-danger-soft) !important; }

.selection-bar {
    position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 0.75rem; z-index: 90;
    padding: 0.875rem 1.25rem;
    background: var(--c-surface); border: 1px solid var(--c-border-strong);
    border-radius: var(--r-md); box-shadow: var(--shadow-pop);
}
.selection-bar form { margin: 0; }

.centered-mark-file { background: var(--c-bg-subtle); color: var(--c-text-soft); margin: 0; }

/* --- Загрузка файлов (прогресс) --- */
.upload-overlay {
    position: fixed; inset: 0; z-index: 300;
    display: none; align-items: center; justify-content: center;
    background: var(--c-modal-scrim); backdrop-filter: blur(4px); padding: 1rem;
}
.upload-overlay.active { display: flex; }
.upload-panel {
    width: 100%; max-width: 26rem; padding: 2rem; text-align: center;
    background: var(--c-surface); border-radius: var(--r-xl); box-shadow: var(--shadow-pop);
}
.upload-panel .icon-tile { margin: 0 auto 1rem; }
.upload-label { font-size: 0.875rem; font-weight: 700; margin: 0.25rem 0 0.125rem; }
.upload-file-name {
    margin: 0 0 1.25rem; font-size: 0.75rem; font-weight: 600; color: var(--c-text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.progress-track {
    height: 0.625rem; border-radius: 999px; overflow: hidden;
    background: var(--c-progress-track);
}
.progress-bar {
    height: 100%; width: 0%; border-radius: 999px;
    background: linear-gradient(90deg, var(--c-primary), var(--c-violet));
    transition: width 0.15s;
}
.progress-label { margin-top: 0.625rem; font-size: 0.75rem; font-weight: 800; color: var(--c-text-muted); }

/* --- Индикатор загрузки (loading) --- */
.spinner {
    width: 2.5rem; height: 2.5rem; border-radius: 50%;
    border: 3px solid var(--c-spinner-track);
    border-top-color: var(--c-primary);
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}
.spinner-sm { width: 1.25rem; height: 1.25rem; border-width: 2px; }
.skeleton {
    width: 100%; min-height: 60vh; border-radius: var(--r-lg);
    background: linear-gradient(90deg, var(--c-bg-subtle) 25%, var(--c-border) 50%, var(--c-bg-subtle) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* --- Предпросмотр файлов --- */
.preview-modal { padding: 1rem; }
.preview-modal .modal-panel {
    max-width: 56rem; width: 100%; height: min(82vh, 48rem);
    padding: 1.25rem; display: flex; flex-direction: column;
}
.preview-head { display: grid; grid-template-columns: auto 1fr auto; gap: 0.75rem; align-items: center; margin-bottom: 1rem; }
.preview-kind { margin: 0; width: 2.25rem; height: 2.25rem; border-radius: 0.625rem; }
.preview-title {
    font-size: 0.9375rem; font-weight: 800; margin: 0; text-align: center;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.preview-body {
    flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
    background: var(--c-bg-subtle); border: 1px solid var(--c-border);
    border-radius: var(--r-md); overflow: auto; position: relative;
}
.preview-body img, .preview-body video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--r-sm); }
.preview-body iframe {
    width: 100%; height: 100%; border: none; background: #fff; border-radius: var(--r-sm);
}
.preview-body pre {
    margin: 0; padding: 1.5rem; white-space: pre-wrap; word-break: break-word;
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    font-size: 0.8125rem; color: var(--c-text); text-align: left;
}
.preview-body .doc-view {
    width: 100%; height: 100%; padding: 1.5rem 2rem; text-align: left;
    background: var(--c-surface); font-size: 0.875rem; line-height: 1.6; overflow: auto;
}
.preview-loading { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.preview-fallback { text-align: center; padding: 2rem; }

/* --- Главная страница / лендинг --- */
.landing {
    display: flex; flex-direction: column;
    min-height: 100vh;
    background:
        radial-gradient(900px 520px at 88% -8%, var(--c-violet-soft), transparent 60%),
        radial-gradient(760px 460px at -6% 22%, var(--c-sky-soft), transparent 55%),
        radial-gradient(620px 420px at 50% 110%, var(--c-amber-soft), transparent 60%),
        var(--c-bg);
}
.landing-nav {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    padding: 1.25rem var(--sp-page);
}
.landing-nav .sidebar-brand { margin-bottom: 0; }
.landing-nav-actions { margin-left: auto; display: flex; align-items: center; gap: 0.625rem; }
.brand-badge {
    display: inline-flex; align-items: center; gap: 0.45rem;
    font-size: 0.6875rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--c-violet); background: var(--c-violet-soft);
    padding: 0.3125rem 0.75rem; border-radius: 999px;
}
.hero {
    text-align: center; padding: clamp(2.5rem, 8vh, 5.5rem) var(--sp-page) 3rem;
    max-width: 60rem; margin: 0 auto;
}
.hero h1 {
    font-size: clamp(2.1rem, 5.6vw, 3.6rem); font-weight: 800; letter-spacing: -0.03em;
    margin: 1.25rem 0 0;
    line-height: 1.08;
}
.hero h1 .grad {
    background: linear-gradient(120deg, var(--c-primary), var(--c-violet) 55%, var(--c-sky));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lead {
    max-width: 40rem; margin: 1.25rem auto 0;
    font-size: 1.0625rem; font-weight: 500; color: var(--c-text-soft); line-height: 1.6;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 2.25rem; }

/* Плавное «плавание» текста hero. Движение чисто трансформацией — без перерисовки макета */
.anim-float-1, .anim-float-2, .anim-float-3 {
    animation-name: float-soft;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    will-change: transform;
}
.anim-float-1 { animation-duration: 5.5s; animation-delay: 0s; }
.anim-float-2 { animation-duration: 6.5s; animation-delay: 0.45s; }
.anim-float-3 { animation-duration: 7.5s; animation-delay: 0.9s; }
@keyframes float-soft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@media (prefers-reduced-motion: reduce) {
    .anim-float-1, .anim-float-2, .anim-float-3 { animation: none; }
}

.landing-section { max-width: 68rem; margin: 0 auto; padding: 3.5rem var(--sp-page) 0; }
.landing-section-head { text-align: center; max-width: 40rem; margin: 0 auto 2.5rem; }
.landing-section-head h2 { margin: 0.5rem 0 0; font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; }

.feature-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feature-card {
    padding: 1.75rem; background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--r-xl); box-shadow: var(--shadow-card);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.feature-card:hover { transform: translateY(-3px); border-color: var(--c-primary); box-shadow: var(--shadow-primary); }
.feature-card h3 { margin: 1rem 0 0.375rem; font-size: 1rem; font-weight: 800; }
.feature-card p { margin: 0; font-size: 0.8125rem; font-weight: 600; color: var(--c-text-muted); line-height: 1.5; }

.module-card { display: flex; flex-direction: column; align-items: flex-start; text-decoration: none; color: var(--c-text); }
.module-card .btn { width: 100%; margin-top: 1.25rem; }
.module-card .badge { margin-top: 1rem; }
.module-card .page-subtitle { flex: 1; }
.module-card .icon-tile { margin-bottom: 1.25rem; }

.cta-band {
    max-width: 68rem; margin: 4rem auto 0; padding: 0 var(--sp-page) 4rem;
}
.cta-card {
    position: relative; overflow: hidden; text-align: center;
    padding: clamp(2rem, 6vw, 3.5rem); border-radius: var(--r-xl);
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #7c3aed 55%, #0ea5e9);
    box-shadow: var(--shadow-pop);
}
[data-theme="dark"] .cta-card {
    background: linear-gradient(135deg, #4338ca, #7c3aed 55%, #0284c7);
}
.cta-card::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(420px 240px at 90% 10%, rgba(255,255,255,.25), transparent 60%);
}
.cta-card h2 { position: relative; margin: 0 0 0.625rem; font-size: clamp(1.5rem, 3.4vw, 2.25rem); font-weight: 800; letter-spacing: -0.02em; }
.cta-card p { position: relative; margin: 0 auto 1.75rem; max-width: 34rem; font-size: 0.9375rem; font-weight: 500; color: rgba(255,255,255,.85); }
.cta-actions { position: relative; display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.btn-light {
    background: #fff; color: #4f46e5; box-shadow: 0 16px 32px -12px rgba(0,0,0,.35);
}
.btn-light:hover { background: #eef2ff; color: #4338ca; }
.btn-ghost-light { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.btn-ghost-light:hover { background: rgba(255,255,255,.24); }

.landing-footer {
    margin-top: auto;
    border-top: 1px solid var(--c-border);
    padding: 1.5rem var(--sp-page);
    display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
    color: var(--c-text-muted); font-size: 0.75rem; font-weight: 600;
}
.landing-footer .sidebar-brand { margin: 0; }
.landing-footer-links { margin-left: auto; display: flex; gap: 1.25rem; }
.landing-footer a { color: var(--c-text-muted); text-decoration: none; transition: color 0.15s; }
.landing-footer a:hover { color: var(--c-primary); }

/* --- Справка / База знаний --- */
.guide-card {
    display: flex; gap: 1rem; align-items: flex-start; padding: 1.5rem;
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--r-xl); box-shadow: var(--shadow-card);
}
.guide-card .icon-tile { margin-bottom: 0; flex-shrink: 0; }
.guide-card h3 { margin: 0 0 0.25rem; font-size: 1rem; font-weight: 800; }
.guide-card p { margin: 0; font-size: 0.8125rem; font-weight: 600; color: var(--c-text-muted); line-height: 1.55; }
.guide-card ol { margin: 0.75rem 0 0; padding-left: 1.25rem; font-size: 0.8125rem; font-weight: 600; color: var(--c-text-soft); }
.guide-card li { margin-bottom: 0.25rem; }
code.cli {
    display: block; margin-top: 0.5rem; padding: 0.875rem 1.125rem;
    background: var(--c-code-bg); color: var(--c-code-text);
    border: 1px solid var(--c-border-strong); border-radius: var(--r-sm);
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    font-size: 0.78125rem; overflow-x: auto; white-space: nowrap;
}
code.key-code {
    padding: 0.125rem 0.375rem; background: var(--c-bg-subtle);
    border: 1px solid var(--c-border); border-radius: var(--r-sm);
    font-size: 0.75rem; font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    color: var(--c-text-muted);
}

/* --- База знаний: аккордеон FAQ --- */
.faq-list { display: grid; gap: 0.75rem; max-width: 46rem; margin: 0 auto; }
.faq-item {
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--r-lg); overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.faq-item:hover { border-color: var(--c-border-strong); }
.faq-item[open] { border-color: var(--c-primary); box-shadow: var(--shadow-primary); }
.faq-item summary {
    display: flex; align-items: center; gap: 0.75rem; cursor: pointer;
    padding: 1rem 1.25rem; list-style: none;
    font-size: 0.875rem; font-weight: 800; color: var(--c-text);
    user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: ''; margin-left: auto; flex-shrink: 0;
    width: 0.5rem; height: 0.5rem;
    border-right: 2px solid var(--c-text-muted);
    border-bottom: 2px solid var(--c-text-muted);
    transform: rotate(45deg) translateY(-0.125rem);
    transition: transform 0.2s;
}
.faq-item[open] summary::after { transform: rotate(225deg) translateY(-0.125rem); }
.faq-body {
    padding: 0 1.25rem 1rem; font-size: 0.8125rem; font-weight: 600;
    color: var(--c-text-muted); line-height: 1.55;
}

/* --- Выбор файла (нативный input скрыт) --- */
.file-choose {
    position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 0.625rem;
    padding: 0.875rem; background: var(--c-bg-subtle);
    border: 1px dashed var(--c-border-strong); border-radius: var(--r-md);
    transition: border-color 0.15s, background-color 0.15s;
}
.file-choose:hover { border-color: var(--c-primary); background: var(--c-selected-bg); }
.file-choose-input {
    position: absolute; width: 0.0625rem; height: 0.0625rem; overflow: hidden;
    opacity: 0; clip: rect(0 0 0 0); white-space: nowrap;
}
.file-choose-btn { cursor: pointer; margin: 0; }
.file-choose-name {
    font-size: 0.8125rem; font-weight: 600; color: var(--c-text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.file-choose.chosen .file-choose-name { color: var(--c-primary); }

/* --- Drag & drop --- */
.file-choose.dragover {
    border-color: var(--c-primary);
    background: var(--c-primary-soft);
    box-shadow: var(--shadow-secondary);
}
.drop-overlay {
    position: fixed; inset: 0; z-index: 350;
    display: flex; align-items: center; justify-content: center;
    background: var(--c-modal-scrim); backdrop-filter: blur(3px); padding: 1rem;
}
.drop-overlay-inner {
    display: flex; align-items: center; gap: 1rem;
    padding: 2rem 2.5rem;
    background: var(--c-surface); border: 2px dashed var(--c-primary);
    border-radius: var(--r-xl); box-shadow: var(--shadow-pop);
    font-size: 1rem; font-weight: 800; color: var(--c-text);
}
.drop-overlay-inner .icon-tile { margin: 0; }

/* --- Мобильные правки --- */
@media (max-width: 640px) {
    /* Инпуты >15px, чтобы iOS Safari не зумил страницу при фокусе */
    .input, .select, .textarea { font-size: 1rem; }
    .modal { padding: 0.625rem; }
    .modal-panel { padding: 1.25rem; max-height: 92vh; }
    .modal-actions { flex-wrap: wrap; }
    .modal-actions .btn { min-width: 0; white-space: nowrap; }
    .field-row { flex-direction: column; gap: 0; }
    .stat-row { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
    .stat-tile { padding: 0.875rem 0.375rem; }
    .stat-value { font-size: 1.25rem; }
    .col-name { width: 10rem; min-width: 10rem; max-width: 10rem; }
    .row-tools { opacity: 1; }
    .selection-bar { left: 1rem; right: 1rem; transform: none; flex-wrap: wrap; justify-content: center; }
    .hero-cta .btn { flex: 1; min-width: 10rem; }
    .preview-modal .modal-panel { height: 88vh; }
    .guide-card { flex-direction: column; }
    .code-block { font-size: 0.6875rem; }
    .toolbar-search { flex: 0 1 100%; max-width: none; }
    .day-grid { grid-template-columns: 1fr; gap: 0.75rem; }
    .day-card { width: 100%; }
    .slot-time { width: 5.25rem; }
}