/* ==========================================================================
   Next-Generation-Hub — дизайн-система
   Голубо-белая светлая тема (по умолчанию) и тёмно-синяя тёмная. Все цвета — через переменные.
   ========================================================================== */

:root {
  --bg: #f4f8ff;
  --bg-soft: #eaf1fc;
  --bg-sunken: #e2ebf8;
  --surface: #ffffff;
  --surface-2: #f8fbff;
  --text: #0b1b35;
  --text-2: #44546f;
  --text-3: #7b8ba6;
  --line: #dde6f3;
  --line-2: #c9d6ea;
  --ink: #1d5bf0;          /* основной синий: кнопки, активные пункты, акцентные блоки */
  --ink-hover: #1648c4;
  --ink-text: #ffffff;
  --ink-text-2: #d3e0ff;
  --ink-line: rgb(255 255 255 / 0.22);
  --accent: #cfe3ff;       /* мягкий голубой: подсветки и бейджи */
  --accent-ink: #0b2a6b;
  --accent-ink-2: #2b4a86;
  --accent-text: #1d5bf0;
  --accent-glow: rgb(29 91 240 / 0.18);
  --dot: #38bdf8;
  --focus: #1d5bf0;
  --focus-ring: rgb(29 91 240 / 0.18);
  --overlay: rgb(11 27 53 / 0.45);
  --header-bg: rgb(244 248 255 / 0.82);

  --ok: #15803d;      --ok-bg: #e5f6ea;
  --warn: #b45309;    --warn-bg: #fdf3e1;
  --bad: #c62828;     --bad-bg: #fdeaea;
  --info: #1d4ed8;    --info-bg: #e3ecfe;

  --shadow-sm: 0 1px 2px rgb(11 27 53 / 0.05);
  --shadow: 0 10px 30px -12px rgb(29 60 120 / 0.2);
  --shadow-lg: 0 30px 60px -20px rgb(29 60 120 / 0.28);

  --font-display: "Unbounded", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: 220ms var(--ease);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0b1426;
  --bg-soft: #0f1b31;
  --bg-sunken: #0a1222;
  --surface: #111f38;
  --surface-2: #152442;
  --text: #e8effc;
  --text-2: #a7b6d0;
  --text-3: #7385a4;
  --line: #1e2f4f;
  --line-2: #2a3e64;
  --ink: #2f6bea;
  --ink-hover: #4a80f0;
  --ink-text: #ffffff;
  --ink-text-2: #cfddfb;
  --ink-line: rgb(255 255 255 / 0.2);
  --accent: #1e3a70;
  --accent-ink: #dce8ff;
  --accent-ink-2: #a9c2f0;
  --accent-text: #7da7ff;
  --accent-glow: rgb(56 189 248 / 0.22);
  --dot: #38bdf8;
  --focus: #7da7ff;
  --focus-ring: rgb(125 167 255 / 0.25);
  --overlay: rgb(2 6 16 / 0.65);
  --header-bg: rgb(11 20 38 / 0.8);

  --ok: #4ade80;      --ok-bg: rgb(74 222 128 / 0.12);
  --warn: #fbbf24;    --warn-bg: rgb(251 191 36 / 0.12);
  --bad: #f87171;     --bad-bg: rgb(248 113 113 / 0.12);
  --info: #7aa2ff;    --info-bg: rgb(122 162 255 / 0.13);

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow: 0 10px 30px -12px rgb(0 0 0 / 0.6);
  --shadow-lg: 0 30px 60px -20px rgb(0 0 0 / 0.7);
  color-scheme: dark;
}

/* --- База ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--t), color var(--t);
  overflow-x: hidden;
}
img, video, svg, iframe { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.75rem, 3.6vw, 2.9rem); }
h2 { font-size: clamp(1.35rem, 2.4vw, 2rem); }
h3 { font-size: clamp(1.1rem, 1.6vw, 1.3rem); letter-spacing: -0.01em; }
h4 { font-size: 1rem; }
small { font-size: .85em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 1000;
  background: var(--ink); color: var(--ink-text); padding: 10px 16px; border-radius: 10px;
  transition: top var(--t);
}
.skip-link:focus { top: 12px; color: var(--ink-text); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon { flex: none; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.display { font-family: var(--font-display); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }

/* --- Кнопки --------------------------------------------------------------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  border: 1px solid var(--btn-bd); border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  font: 600 15px/1.2 var(--font-body); letter-spacing: -0.005em;
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: background-color var(--t), color var(--t), border-color var(--t), transform var(--t), box-shadow var(--t);
}
.btn:hover { border-color: var(--text); color: var(--btn-fg); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn .icon { transition: transform var(--t); }
.btn:hover .icon-shift { transform: translateX(3px); }
.btn-primary { --btn-bg: var(--ink); --btn-fg: var(--ink-text); --btn-bd: var(--ink); }
.btn-primary:hover { --btn-bg: var(--ink-hover); --btn-bd: var(--ink-hover); color: var(--ink-text); }
.btn-accent { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); --btn-bd: var(--accent); }
.btn-accent:hover { filter: brightness(1.04); color: var(--accent-ink); box-shadow: 0 8px 24px -8px var(--accent-glow); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; }
.btn-ghost:hover { --btn-bg: var(--bg-soft); --btn-bd: transparent; }
.btn-danger { --btn-fg: var(--bad); }
.btn-danger:hover { --btn-bg: var(--bad-bg); --btn-bd: var(--bad); color: var(--bad); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn-xs { min-height: 30px; padding: 4px 10px; font-size: 13px; gap: 6px; }
.btn-lg { min-height: 56px; padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }

.link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; border-bottom: 1px solid transparent; transition: border-color var(--t), gap var(--t); }
.link:hover { border-color: currentColor; gap: 10px; }

/* --- Чипы, бейджи --------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--text-2); background: var(--surface);
  transition: all var(--t); white-space: nowrap;
}
a.chip:hover { border-color: var(--text); color: var(--text); }
.chip.is-active { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }
.chip .count { font-size: 12px; opacity: .6; font-variant-numeric: tabular-nums; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2);
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 4px var(--accent-glow); }

.badge {
  --b-fg: var(--text-2); --b-bg: var(--bg-soft);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  color: var(--b-fg); background: var(--b-bg);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.no-dot::before { display: none; }
.badge-ok, .badge-present, .badge-enrolled { --b-fg: var(--ok); --b-bg: var(--ok-bg); }
.badge-warn, .badge-late, .badge-contacted { --b-fg: var(--warn); --b-bg: var(--warn-bg); }
.badge-bad, .badge-absent, .badge-rejected { --b-fg: var(--bad); --b-bg: var(--bad-bg); }
.badge-info, .badge-excused, .badge-new { --b-fg: var(--info); --b-bg: var(--info-bg); }
.badge-ink { --b-fg: var(--ink-text); --b-bg: var(--ink); }
.badge-accent { --b-fg: var(--accent-ink); --b-bg: var(--accent); }
.badge-role-admin { --b-fg: var(--ink-text); --b-bg: var(--ink); }
.badge-role-manager { --b-fg: var(--info); --b-bg: var(--info-bg); }
.badge-role-teacher { --b-fg: var(--accent-ink); --b-bg: var(--accent); }
.badge-role-student { --b-fg: var(--text-2); --b-bg: var(--bg-soft); }

/* --- Шапка ---------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t), background-color var(--t);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -0.02em; }
.logo-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  background: var(--ink); color: var(--ink-text); font-size: 12px; font-weight: 700; letter-spacing: 0;
  position: relative; overflow: hidden;
}
.logo-mark::after { content: ""; position: absolute; right: 5px; top: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--dot); }
.logo-text small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 11px; color: var(--text-3); letter-spacing: .02em; margin-top: 1px; }
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 12px; }
.main-nav a {
  padding: 8px 14px; border-radius: 999px; font-size: 15px; font-weight: 500; color: var(--text-2);
  transition: color var(--t), background-color var(--t);
}
.main-nav a:hover { color: var(--text); background: var(--bg-soft); }
.main-nav a[aria-current="page"] { color: var(--text); background: var(--bg-soft); }
.header-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.lang-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.lang-switch form { display: contents; }
.lang-switch button {
  border: 0; background: transparent; color: var(--text-3); cursor: pointer;
  font: 600 12px/1 var(--font-body); letter-spacing: .04em; padding: 8px 10px; border-radius: 999px;
  transition: color var(--t), background-color var(--t);
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button[aria-current="true"] { background: var(--ink); color: var(--ink-text); }

.theme-toggle {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
  display: grid; place-items: center; transition: border-color var(--t), transform var(--t);
}
.theme-toggle:hover { border-color: var(--text); }
.theme-toggle .icon { position: absolute; transition: opacity var(--t), transform 400ms var(--ease); }
.theme-toggle .icon-moon { opacity: 0; transform: rotate(-60deg) scale(.6); }
[data-theme="dark"] .theme-toggle .icon-sun { opacity: 0; transform: rotate(60deg) scale(.6); }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 1; transform: none; }

.burger { display: none; }

/* Мобильное меню */
.mobile-nav {
  position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column;
  background: var(--bg); padding: 20px var(--gutter) 32px;
  transform: translateY(-8px); opacity: 0; visibility: hidden;
  transition: opacity var(--t), transform var(--t), visibility var(--t);
}
.mobile-nav.is-open { opacity: 1; transform: none; visibility: visible; }
.mobile-nav-top { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.mobile-nav nav { display: flex; flex-direction: column; margin-top: 24px; }
.mobile-nav nav a {
  font-family: var(--font-display); font-size: clamp(1.6rem, 8vw, 2.2rem); font-weight: 600; letter-spacing: -0.02em;
  padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center;
}
.mobile-nav-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 16px; }

/* --- Секции публичного сайта --------------------------------------------- */
.section { padding: clamp(44px, 6vw, 84px) 0; }
.section-sm { padding: clamp(32px, 4.5vw, 56px) 0; }
.section-soft { background: var(--bg-soft); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(22px, 3vw, 36px); }
.section-head h2 { margin: 0; max-width: 24ch; }
.section-head p { max-width: 46ch; margin: 0; color: var(--text-2); font-size: 16px; }

/* Hero */
.hero { position: relative; padding: clamp(32px, 5vw, 72px) 0 clamp(36px, 5vw, 64px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero h1 { margin: 18px 0 18px; font-size: clamp(2rem, 4.4vw, 3.5rem); line-height: 1.06; letter-spacing: -0.03em; }
.hero h1 em { font-style: normal; position: relative; white-space: nowrap; }
.hero h1 em::after {
  content: ""; position: absolute; left: -2%; right: -2%; bottom: .06em; height: .32em; z-index: -1;
  background: var(--accent); border-radius: 4px; transform: skewX(-8deg);
}
.hero-lead { font-size: 17px; color: var(--text-2); max-width: 42ch; margin-bottom: 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: grid; grid-template-columns: repeat(3, auto); gap: clamp(20px, 4vw, 48px); margin-top: clamp(28px, 4vw, 44px); justify-content: start; }
.hero-stats b { display: block; font-family: var(--font-display); font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.hero-stats span { display: block; margin-top: 8px; color: var(--text-3); font-size: 14px; }

.orbit { position: relative; aspect-ratio: 1; width: 100%; max-width: 430px; margin-left: auto; container-type: inline-size; }
.orbit-ring { position: absolute; inset: 0; border: 1px solid var(--line-2); border-radius: 50%; }
.orbit-ring.r2 { inset: 16%; border-style: dashed; }
.orbit-ring.r3 { inset: 32%; }
.orbit-core {
  position: absolute; inset: 37%; border-radius: 50%; background: var(--ink); color: var(--ink-text);
  display: grid; place-items: center; text-align: center; box-shadow: var(--shadow-lg);
  font-family: var(--font-display); font-weight: 700; font-size: clamp(14px, 2vw, 22px); letter-spacing: -0.02em; line-height: 1;
}
.orbit-core small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; opacity: .6; margin-top: 6px; }
.orbit-spin { position: absolute; inset: 0; animation: spin 60s linear infinite; }
.orbit-node {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px;
  transform: rotate(var(--a)) translateY(-50cqw) rotate(calc(var(--a) * -1));
}
.orbit-node > span {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text); box-shadow: var(--shadow);
  animation: spin 60s linear infinite reverse;
  transition: background-color var(--t), color var(--t), transform var(--t);
}
.orbit-node:hover > span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.orbit-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--dot); top: 16%; left: 50%; margin-left: -5px; box-shadow: 0 0 0 6px var(--accent-glow); }
@keyframes spin { to { transform: rotate(360deg); } }


/* Направления */
.directions { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.direction-card { grid-column: span 2; }
.direction-card:nth-child(4), .direction-card:nth-child(5) { grid-column: span 3; }
.direction-card {
  position: relative; display: flex; flex-direction: column; gap: 12px; min-height: 200px;
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
  overflow: hidden; isolation: isolate;
  transition: color var(--t), border-color var(--t), transform var(--t);
}
.direction-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ink);
  clip-path: circle(0% at 100% 0%); transition: clip-path 600ms var(--ease);
}
.direction-card:hover { color: var(--ink-text); border-color: var(--ink); }
.direction-card:hover::before { clip-path: circle(150% at 100% 0%); }
.direction-card:hover p { color: var(--ink-text-2); }
.direction-card .num { font: 600 13px/1 var(--font-body); color: var(--text-3); letter-spacing: .06em; }
.direction-card:hover .num { color: var(--ink-text-2); }
.direction-icon {
  width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center;
  background: var(--bg-soft); color: var(--text); transition: background-color var(--t), color var(--t), transform 500ms var(--ease);
}
.direction-card:hover .direction-icon { background: var(--accent); color: var(--accent-ink); transform: rotate(-8deg) scale(1.05); }
.direction-card h3 { margin: auto 0 0; font-size: clamp(1.05rem, 1.4vw, 1.2rem); }
.direction-card p { margin: 0; color: var(--text-2); font-size: 15px; transition: color var(--t); }
.direction-card .go {
  position: absolute; right: 24px; top: 24px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line-2); display: grid; place-items: center; transition: all var(--t);
}
.direction-card:hover .go { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); transform: rotate(45deg); }

/* Преимущества */
.features { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.feature { padding: 32px 28px 8px 0; border-right: 1px solid var(--line); }
.feature + .feature { padding-left: 28px; }
.feature:last-child { border-right: 0; }
.feature .n { font-family: var(--font-display); font-size: 14px; color: var(--text-3); margin-bottom: 18px; display: block; }
.feature h3 { margin-bottom: 10px; }
.feature p { color: var(--text-2); font-size: 15px; }

/* Карточки курсов */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.course-card {
  display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); overflow: hidden; transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-2); }
.course-card-body { display: flex; flex-direction: column; gap: 12px; padding: 24px; flex: 1; }
.course-card h3 { margin: 0; font-size: 1.2rem; }
.course-card p { margin: 0; color: var(--text-2); font-size: 15px; }
.course-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.course-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.price { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; letter-spacing: -0.02em; }
.price small { font-family: var(--font-body); font-weight: 500; font-size: 13px; color: var(--text-3); letter-spacing: 0; }

.cover {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-soft); color: var(--text);
  display: grid; place-items: center;
}
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease); }
.course-card:hover .cover img { transform: scale(1.04); }
.cover-art { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--line-2); }
.cover-icon {
  position: relative; width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); color: var(--text);
  transition: transform 500ms var(--ease), background-color var(--t);
}
.course-card:hover .cover-icon { transform: translateY(-4px) rotate(-6deg); background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.cover-tag { position: absolute; left: 16px; top: 16px; }
.cover-tag .badge { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* Учителя */
.teacher-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 20px; }
.teacher-card { display: flex; flex-direction: column; gap: 14px; }
.teacher-photo {
  aspect-ratio: 1 / 1; border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-soft);
  display: grid; place-items: center; position: relative; border: 1px solid var(--line);
}
.teacher-photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); transition: filter 500ms var(--ease), transform 600ms var(--ease); }
.teacher-card:hover .teacher-photo img { filter: none; transform: scale(1.03); }
.teacher-initials { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.2rem, 4vw, 3rem); letter-spacing: -0.04em; color: var(--text-3); transition: color var(--t); }
.teacher-card:hover .teacher-initials { color: var(--text); }
.teacher-photo .dir-icons { position: absolute; left: 14px; bottom: 14px; display: flex; gap: 6px; }
.teacher-photo .dir-icons span { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); }
.teacher-card h3 { margin: 0; font-size: 1.05rem; }
.teacher-card p { margin: 2px 0 0; color: var(--text-2); font-size: 14px; }

/* Новости */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.news-card {
  display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--surface); transition: transform var(--t), box-shadow var(--t);
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.news-thumb { aspect-ratio: 16 / 10; background: var(--bg-soft); overflow: hidden; position: relative; }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease); }
.news-card:hover .news-thumb img { transform: scale(1.04); }
.news-thumb-text {
  position: absolute; inset: 0; padding: 24px; display: flex; align-items: flex-end;
  background: var(--ink); color: var(--ink-text);
  font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; line-height: 1.15; letter-spacing: -0.02em;
}
.news-thumb-text::before { content: ""; position: absolute; right: 24px; top: 24px; width: 12px; height: 12px; border-radius: 50%; background: var(--dot); }
.news-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.news-body h3 { margin: 0; font-size: 1.1rem; line-height: 1.3; }
.news-body p { margin: 0; color: var(--text-2); font-size: 15px; }
.news-date { font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 8px; }

/* CTA / заявка */
.cta {
  position: relative; background: linear-gradient(135deg, var(--ink), var(--ink-hover)); color: var(--ink-text); border-radius: var(--radius-xl);
  padding: clamp(24px, 4vw, 48px); overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px);
}
.cta::before {
  content: ""; position: absolute; width: 520px; height: 520px; right: -180px; top: -220px; border-radius: 50%;
  border: 1px solid var(--ink-line); box-shadow: 0 0 0 60px transparent, inset 0 0 0 60px transparent;
  opacity: .5;
}
.cta::after { content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--dot); right: 48px; top: 48px; box-shadow: 0 0 0 10px rgb(255 255 255 / .14); }
.cta h2 { max-width: 14ch; }
.cta p { color: var(--ink-text-2); font-size: 17px; max-width: 42ch; }
.cta .eyebrow { color: var(--ink-text-2); }
.cta-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.cta-points li { display: flex; gap: 12px; align-items: center; color: var(--ink-text); }
.cta-points li .icon { color: var(--ink-text); opacity: .9; }
.cta .form-card { position: relative; z-index: 1; }
.cta .form-card p { max-width: none; font-size: 15px; color: var(--text-2); }
.cta .form-card p.faint { font-size: 12.5px; color: var(--text-3); }

.form-card { background: var(--surface); color: var(--text); border-radius: var(--radius-lg); padding: clamp(20px, 3vw, 32px); box-shadow: var(--shadow-lg); }

/* Контакты */
.contact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.contact-item {
  display: flex; flex-direction: column; gap: 14px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); transition: border-color var(--t), transform var(--t);
}
a.contact-item:hover { border-color: var(--text); transform: translateY(-2px); }
.contact-item .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--bg-soft); }
.contact-item span { color: var(--text-3); font-size: 13px; }
.contact-item b { font-weight: 600; font-size: 16px; line-height: 1.35; word-break: break-word; }

/* Карта */
.map-card { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.map-card iframe { display: block; width: 100%; height: clamp(260px, 36vw, 400px); border: 0; background: var(--bg-soft); }
.map-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--line); }
.map-address { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); }
.map-address b { color: var(--text); font-weight: 600; }

/* Страницы */
.page-hero { padding: clamp(28px, 4vw, 56px) 0 clamp(20px, 3vw, 32px); border-bottom: 1px solid var(--line); }
.page-hero h1 { margin: 16px 0 12px; max-width: 18ch; }
.page-hero p { color: var(--text-2); font-size: 16px; max-width: 56ch; margin: 0; }
.breadcrumbs { display: flex; gap: 8px; align-items: center; color: var(--text-3); font-size: 14px; flex-wrap: wrap; }
.breadcrumbs a:hover { color: var(--text); }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 32px 0; }

.course-hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.course-facts { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.course-facts div { padding: 20px 22px; border-bottom: 1px solid var(--line); }
.course-facts div:nth-child(odd) { border-right: 1px solid var(--line); }
.course-facts div:nth-last-child(-n+2) { border-bottom: 0; }
.course-facts span { display: block; font-size: 13px; color: var(--text-3); margin-bottom: 6px; }
.course-facts b { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.02em; }
.sticky-card { position: sticky; top: 96px; }

.prose { font-size: 17px; line-height: 1.75; color: var(--text); max-width: 70ch; }
.prose p { margin: 0 0 1.1em; }
.prose h2, .prose h3 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }

.article-cover { border-radius: var(--radius-xl); overflow: hidden; margin: 32px 0; border: 1px solid var(--line); }
.article-cover img { width: 100%; max-height: 560px; object-fit: cover; }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 80px); align-items: start; }
.big-quote { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.1rem, 1.7vw, 1.4rem); line-height: 1.35; letter-spacing: -0.02em; margin: 0; }
.numbers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.number-card { padding: 28px; border-radius: var(--radius-lg); background: var(--bg-soft); }
.number-card b { font-family: var(--font-display); font-size: clamp(1.6rem, 2.8vw, 2.2rem); font-weight: 600; letter-spacing: -0.04em; line-height: 1; display: block; }
.number-card span { color: var(--text-2); font-size: 15px; display: block; margin-top: 10px; }
.number-card.is-ink { background: var(--ink); color: var(--ink-text); }
.number-card.is-ink span { color: var(--ink-text-2); }
.number-card.is-accent { background: var(--accent); color: var(--accent-ink); }
.number-card.is-accent span { color: var(--accent-ink-2); }

.result-page { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 64px 0; }
.result-icon { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 28px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); animation: pop 600ms var(--ease) both; }
.result-icon.is-muted { background: var(--bg-soft); color: var(--text); }
.result-code { font-family: var(--font-display); font-weight: 700; font-size: clamp(3.6rem, 9vw, 6rem); letter-spacing: -0.06em; line-height: .9; margin: 0 0 16px; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }

/* Подвал */
.site-footer { border-top: 1px solid var(--line); padding: clamp(36px, 5vw, 56px) 0 28px; margin-top: clamp(24px, 4vw, 48px); background: var(--surface-2); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 32px; }
.footer-grid h4 { font-family: var(--font-body); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: 16px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-grid a { color: var(--text-2); transition: color var(--t); }
.footer-grid a:hover { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--text-3); font-size: 14px; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 32px; }
.socials { display: flex; gap: 8px; }
.socials a { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; color: var(--text); transition: all var(--t); }
.socials a:hover { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }

/* --- Формы ---------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 16px; }
.form-grid .span-2, .form-grid .field-wide { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.field .req { color: var(--bad); }
.field .help { font-size: 13px; color: var(--text-3); line-height: 1.45; }
.field .errors { list-style: none; margin: 0; padding: 0; color: var(--bad); font-size: 13px; font-weight: 500; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--bad); }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"],
input[type="url"], input[type="date"], input[type="time"], input[type="datetime-local"], input[type="search"],
select, textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--text);
  font: 400 15px/1.4 var(--font-body);
  transition: border-color var(--t), box-shadow var(--t), background-color var(--t);
  -webkit-appearance: none; appearance: none;
}
textarea { resize: vertical; min-height: 96px; }
select {
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2385858c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:hover, select:hover, textarea:hover { border-color: var(--text-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--focus-ring); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--text); width: 18px; height: 18px; margin: 0; cursor: pointer; }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; font-weight: 500; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* Чекбокс-списки (чипы) */
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.check-list > div, .check-list li { display: contents; }
.check-list label {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: all var(--t); background: var(--surface); user-select: none;
}
.check-list label:hover { border-color: var(--text); }
.check-list input { width: 16px; height: 16px; }
.check-list label:has(input:checked) { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }
.check-list label:has(input:checked) input { accent-color: var(--accent); }
.check-list.is-column { flex-direction: column; flex-wrap: nowrap; gap: 0; max-height: 360px; overflow: auto; border: 1px solid var(--line-2); border-radius: 12px; }
.check-list.is-column label { border: 0; border-radius: 0; border-bottom: 1px solid var(--line); width: 100%; padding: 10px 14px; }
.check-list.is-column label:has(input:checked) { background: var(--bg-soft); color: var(--text); }
.check-list.is-column label.is-hidden { display: none; }

/* Файл / загрузка */
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  min-height: 170px; padding: 24px; border: 1.5px dashed var(--line-2); border-radius: var(--radius); background: var(--surface-2);
  transition: border-color var(--t), background-color var(--t); cursor: pointer;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--text); background: var(--bg-soft); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--ink); color: var(--ink-text); }
.dropzone b { font-size: 15px; }
.dropzone small { color: var(--text-3); }
.dropzone .file-name { font-weight: 600; color: var(--text); word-break: break-all; }
.current-file { font-size: 13px; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.current-file a { text-decoration: underline; }

.progress { display: none; margin-top: 16px; }
.progress.is-visible { display: block; }
.progress-bar { height: 10px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; border: 1px solid var(--line); }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--ink); border-radius: inherit; transition: width 200ms linear; background-image: linear-gradient(90deg, var(--ink), var(--text-2)); }
.progress-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-top: 8px; font-variant-numeric: tabular-nums; }

/* Языковые вкладки */
.lang-tabs { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.lang-tabs-nav { display: flex; gap: 4px; padding: 6px; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.lang-tabs-nav button {
  border: 0; background: transparent; color: var(--text-2); cursor: pointer; padding: 8px 16px; border-radius: 10px;
  font: 600 13px/1 var(--font-body); letter-spacing: .04em; display: inline-flex; align-items: center; gap: 8px;
}
.lang-tabs-nav button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.lang-tabs-nav .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.lang-tabs-nav .dot.is-filled { background: var(--ok); }
.lang-tabs-nav .dot.is-error { background: var(--bad); }
.lang-pane { padding: 20px; display: grid; gap: 16px; }
.lang-pane[hidden] { display: none; }

/* Flash-сообщения */
.messages { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(440px, calc(100vw - 32px)); }
.message {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 14px 16px; border-radius: 14px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 14.5px; line-height: 1.45;
  animation: slide-in 400ms var(--ease) both;
}
.message .icon { margin-top: 1px; }
.message-success .icon-status { color: var(--ok); }
.message-error .icon-status { color: var(--bad); }
.message-body { flex: 1; word-break: break-word; }
.message button { background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; padding: 2px; border-radius: 6px; }
.message button:hover { opacity: 1; }
.message.is-leaving { animation: slide-out 300ms var(--ease) both; }
@keyframes slide-in { from { transform: translateY(12px); opacity: 0; } }
@keyframes slide-out { to { transform: translateX(24px); opacity: 0; } }

.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; font-size: 14.5px; background: var(--bg-soft); color: var(--text); border: 1px solid var(--line); }
.alert-warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.alert-bad { background: var(--bad-bg); border-color: transparent; color: var(--bad); }
.alert-info { background: var(--info-bg); border-color: transparent; color: var(--info); }
.alert-ok { background: var(--ok-bg); border-color: transparent; color: var(--ok); }

/* Пагинация */
.pagination { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 40px; height: 40px; padding: 0 12px; display: inline-grid; place-items: center; border-radius: 999px;
  border: 1px solid var(--line); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; transition: all var(--t);
}
.pagination a:hover { border-color: var(--text); }
.pagination .is-current { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }
.pagination .gap { border: 0; min-width: 20px; padding: 0; }

/* Аватар */
.avatar {
  --size: 40px; width: var(--size); height: var(--size); flex: none; border-radius: 50%; overflow: hidden;
  display: inline-grid; place-items: center; background: var(--bg-soft); color: var(--text-2);
  font: 600 calc(var(--size) * .36)/1 var(--font-display); letter-spacing: -0.02em; border: 1px solid var(--line);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { --size: 32px; }
.avatar-lg { --size: 72px; }
.avatar-xl { --size: 112px; }
.user-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.user-cell b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-cell small { display: block; color: var(--text-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==========================================================================
   Кабинеты
   ========================================================================== */
.cab { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; background: var(--bg-soft); }
.cab-sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  padding: 20px 16px; background: var(--bg); border-right: 1px solid var(--line);
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.cab-sidebar .logo { padding: 4px 8px 20px; font-size: 14px; white-space: nowrap; }
.cab-overlay { display: none; }
.cab-user { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 12px; border-radius: 14px; background: var(--bg-soft); }
.cab-user b { font-size: 14px; display: block; line-height: 1.3; }
.cab-nav { display: flex; flex-direction: column; gap: 22px; flex: 1; }
.cab-nav h6 { margin: 0 0 6px; padding: 0 12px; font: 600 11px/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.cab-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cab-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  font-size: 14.5px; font-weight: 500; color: var(--text-2); transition: background-color var(--t), color var(--t);
}
.cab-nav a:hover { background: var(--bg-soft); color: var(--text); }
.cab-nav a[aria-current="page"] { background: var(--ink); color: var(--ink-text); }
.cab-nav a[aria-current="page"] .nav-badge { background: var(--accent); color: var(--accent-ink); }
.nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--accent); color: var(--accent-ink); }
.cab-sidebar-foot { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.cab-sidebar-foot a, .cab-sidebar-foot button {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; font: 500 14.5px/1.4 var(--font-body);
  color: var(--text-2); background: none; border: 0; width: 100%; cursor: pointer; text-align: left;
}
.cab-sidebar-foot a:hover, .cab-sidebar-foot button:hover { background: var(--bg-soft); color: var(--text); }

.cab-main { display: flex; flex-direction: column; min-width: 0; }
.cab-topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px;
  height: 68px; padding: 0 clamp(16px, 3vw, 32px);
  background: color-mix(in srgb, var(--bg-soft) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.cab-topbar .crumbs { font-size: 14px; color: var(--text-3); display: flex; align-items: center; gap: 8px; min-width: 0; }
.cab-topbar .crumbs b { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cab-topbar .tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.cab-burger { display: none; }
.cab-content { padding: clamp(20px, 3vw, 36px) clamp(16px, 3vw, 32px) 64px; width: 100%; max-width: 1400px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head h1 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); margin: 0; letter-spacing: -0.03em; }
.page-head p { margin: 8px 0 0; color: var(--text-2); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 14px; margin-bottom: 12px; transition: color var(--t), gap var(--t); }
.back-link:hover { color: var(--text); gap: 10px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.card-pad { padding: clamp(18px, 2.4vw, 28px); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 1.05rem; margin: 0; letter-spacing: -0.01em; }
.card-body { padding: 20px 24px; }
.card-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.card.is-ink { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }
.card.is-ink .muted, .card.is-ink .faint { color: var(--ink-text-2); }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }

.stat { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--text-2); font-size: 14px; font-weight: 500; }
.stat-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-soft); color: var(--text); }
.stat b { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -0.04em; line-height: 1; }
.stat small { color: var(--text-3); font-size: 13px; }
.stat.is-ink .stat-top, .stat.is-ink small { color: var(--ink-text-2); }
.stat.is-ink .stat-ic { background: rgb(255 255 255 / .16); color: var(--ink-text); }
.stat.is-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.stat.is-accent .stat-top, .stat.is-accent small { color: var(--accent-ink-2); }
.stat.is-accent .stat-ic { background: rgb(255 255 255 / .45); color: var(--accent-ink); }

/* Таблицы */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14.5px; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3);
  padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2);
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background-color var(--t); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.table a.row-link { font-weight: 600; }
.table a.row-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.table .is-muted-row td { opacity: .55; }
.card > .table-wrap:first-child .table th:first-child { border-top-left-radius: var(--radius-lg); }
.card > .table-wrap:first-child .table th:last-child { border-top-right-radius: var(--radius-lg); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.toolbar form { display: contents; }
.search { position: relative; flex: 1 1 260px; max-width: 420px; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input { padding-left: 42px; border-radius: 999px; min-height: 44px; }
.toolbar select { width: auto; min-height: 44px; border-radius: 999px; padding-left: 16px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }

/* Пустое состояние */
.empty { text-align: center; padding: clamp(40px, 6vw, 72px) 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .ic {
  width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; margin-bottom: 12px;
  background: var(--bg-soft); color: var(--text-2); border: 1px dashed var(--line-2);
}
.empty h3 { margin: 0; font-size: 1.1rem; }
.empty p { margin: 0 0 12px; color: var(--text-2); max-width: 40ch; }

/* Списки в карточках */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 14px; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .date-tile {
  width: 52px; flex: none; text-align: center; border-radius: 12px; padding: 6px 0; background: var(--bg-soft);
  font-variant-numeric: tabular-nums;
}
.list .date-tile b { display: block; font-family: var(--font-display); font-size: 18px; line-height: 1.1; }
.list .date-tile small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.list .date-tile.is-today { background: var(--accent); color: var(--accent-ink); }
.list .date-tile.is-today small { color: var(--accent-ink-2); }

/* Графики */
.bars { display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 48px; gap: 12px; align-items: center; font-size: 14px; }
.bar-row .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.bar-track { height: 12px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.bar-track, .bar-fill { display: block; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--ink); transform-origin: left; animation: grow-x 900ms var(--ease) both; }
.bar-fill.good { background: var(--ok); }
.bar-fill.mid { background: var(--warn); }
.bar-fill.low { background: var(--bad); }
.bar-row .val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes grow-y { from { transform: scaleY(0); } }

.columns-chart { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; height: 200px; align-items: end; padding-top: 24px; }
.columns-chart .col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; min-width: 0; }
.columns-chart .col-bar {
  width: 100%; max-width: 44px; border-radius: 10px 10px 4px 4px; background: var(--ink); position: relative; min-height: 4px;
  transform-origin: bottom; animation: grow-y 900ms var(--ease) both;
}
.columns-chart .col:last-child .col-bar { background: var(--dot); }
.columns-chart .col-bar span { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.columns-chart .col small { font-size: 11px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

.ring { --p: 0; --size: 132px; width: var(--size); height: var(--size); border-radius: 50%; position: relative; flex: none;
  background: conic-gradient(var(--ring-color, var(--ink)) calc(var(--p) * 1%), var(--bg-soft) 0); display: grid; place-items: center; }
.ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--surface); }
.ring b { position: relative; font-family: var(--font-display); font-size: 1.6rem; letter-spacing: -0.04em; }
.ring.good { --ring-color: var(--ok); } .ring.mid { --ring-color: var(--warn); } .ring.low { --ring-color: var(--bad); }
.card.is-ink .ring::before { background: var(--ink); }

.stack-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--bg-soft); gap: 2px; }
.stack-bar span { height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: 13.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.c-present { background: var(--ok); } .c-late { background: var(--warn); } .c-absent { background: var(--bad); } .c-excused { background: var(--info); }

.pct { font-weight: 700; font-variant-numeric: tabular-nums; }
.pct.good { color: var(--ok); } .pct.mid { color: var(--warn); } .pct.low { color: var(--bad); } .pct.none { color: var(--text-3); }

/* Группы / карточки групп */
.group-card { display: flex; flex-direction: column; gap: 16px; padding: 22px; transition: border-color var(--t), transform var(--t), box-shadow var(--t); }
a.group-card:hover, .group-card.is-link:hover { border-color: var(--text); transform: translateY(-2px); box-shadow: var(--shadow); }
.group-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.group-card .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--bg-soft); }
.group-card h3 { margin: 0; font-size: 1.05rem; }
.group-card .meta { display: grid; gap: 6px; font-size: 14px; color: var(--text-2); }
.group-card .meta span { display: flex; align-items: center; gap: 8px; }
.group-card .foot { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--line); margin-top: auto; font-size: 14px; }

/* Сегментный переключатель статуса */
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--line); gap: 2px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; transition: all 160ms var(--ease); user-select: none;
}
.seg label:hover { color: var(--text); background: var(--surface); }
.seg label .short { display: none; }
.seg label .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .5; }
.seg input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 1px; }
.seg input:checked + label.s-present { background: var(--ok); color: #fff; }
.seg input:checked + label.s-late { background: var(--warn); color: #fff; }
.seg input:checked + label.s-absent { background: var(--bad); color: #fff; }
.seg input:checked + label.s-excused { background: var(--info); color: #fff; }
[data-theme="dark"] .seg input:checked + label { color: #0a0a0a !important; }
.seg input:checked + label .dot { opacity: 1; background: currentColor; }

.mark-table td { padding-top: 12px; padding-bottom: 12px; }
.mark-table input.grade { width: 72px; min-height: 40px; text-align: center; padding: 8px; }
.mark-table input.comment { min-height: 40px; padding: 8px 12px; min-width: 160px; }
.mark-table tr.is-unmarked .user-cell b::after { content: " •"; color: var(--warn); }
.mark-bar {
  position: sticky; bottom: 0; z-index: 5; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 14px 24px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.mark-summary { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; color: var(--text-2); }
.mark-summary b { color: var(--text); font-variant-numeric: tabular-nums; }
.mark-summary i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Журнал: матрица */
.journal-wrap { overflow: auto; max-height: 72vh; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.journal { border-collapse: separate; border-spacing: 0; font-size: 14px; min-width: 100%; }
.journal th, .journal td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; text-align: center; background: var(--surface); }
.journal thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-weight: 600; font-size: 12px; color: var(--text-2); padding: 10px 6px; min-width: 52px; }
.journal thead th .wd { display: block; font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.journal thead th.is-today { background: var(--accent); color: var(--accent-ink); }
.journal thead th.is-today .wd { color: var(--accent-ink-2); }
.journal .sticky-col { position: sticky; left: 0; z-index: 1; text-align: left; padding: 10px 16px; min-width: 220px; max-width: 260px; box-shadow: 1px 0 0 var(--line); }
.journal thead .sticky-col { z-index: 3; }
.journal .sum-col { position: sticky; right: 0; z-index: 1; min-width: 76px; padding: 10px 12px; box-shadow: -1px 0 0 var(--line); }
.journal thead .sum-col { z-index: 3; }
.journal tfoot td { background: var(--surface-2); font-weight: 600; font-size: 12.5px; padding: 10px 6px; position: sticky; bottom: 0; }
.journal tfoot .sticky-col { z-index: 3; }
.journal tbody tr:hover td { background: var(--surface-2); }
.jcell { display: grid; place-items: center; min-height: 48px; padding: 6px; position: relative; }
.jmark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  font: 700 12px/1 var(--font-body); color: #fff; position: relative; transition: transform 160ms var(--ease);
}
.jmark:hover { transform: scale(1.12); }
.jmark.present { background: var(--ok); } .jmark.late { background: var(--warn); } .jmark.absent { background: var(--bad); } .jmark.excused { background: var(--info); }
[data-theme="dark"] .jmark { color: #0a0a0a; }
.jmark .has-comment { position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); border: 2px solid var(--surface); }
.jempty { width: 30px; height: 30px; border-radius: 9px; border: 1.5px dashed var(--line-2); display: grid; place-items: center; color: var(--text-3); transition: all var(--t); }
a.jempty:hover { border-color: var(--text); color: var(--text); border-style: solid; }
.month-nav { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.month-nav b { min-width: 150px; text-align: center; font-size: 14.5px; text-transform: capitalize; }

/* Урок / плеер */
.player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; background: #000; border: 1px solid var(--line); }
.player iframe, .player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lesson-card { display: flex; flex-direction: column; overflow: hidden; transition: transform var(--t), box-shadow var(--t), border-color var(--t); }
.lesson-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.lesson-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--ink); color: var(--ink-text); overflow: hidden; display: grid; place-items: center; }
.lesson-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .9; transition: transform 600ms var(--ease), opacity var(--t); }
.lesson-card:hover .lesson-thumb img { transform: scale(1.05); opacity: 1; }
.lesson-thumb .play { position: relative; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: var(--shadow-lg); transition: transform var(--t); }
.lesson-card:hover .play { transform: scale(1.1); }
.lesson-thumb .num { position: absolute; left: 14px; top: 12px; font-family: var(--font-display); font-weight: 600; font-size: 13px; background: rgb(0 0 0 / .55); color: #fff; padding: 4px 10px; border-radius: 999px; }
.lesson-thumb .src { position: absolute; right: 12px; top: 12px; }
.lesson-thumb .src .badge { background: rgb(0 0 0 / .55); color: #fff; }
.lesson-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.lesson-body h3 { margin: 0; font-size: 1rem; line-height: 1.35; }
.lesson-body .meta { font-size: 13px; color: var(--text-3); display: flex; gap: 10px; flex-wrap: wrap; }
.lesson-body .foot { margin-top: auto; padding-top: 12px; display: flex; gap: 6px; justify-content: space-between; align-items: center; }
.playlist { list-style: none; margin: 0; padding: 6px; display: grid; gap: 2px; max-height: 540px; overflow: auto; }
.playlist a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; font-size: 14px; transition: background-color var(--t); }
.playlist a:hover { background: var(--bg-soft); }
.playlist a[aria-current="true"] { background: var(--ink); color: var(--ink-text); }
.playlist .n { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--bg-soft); font-size: 12px; font-weight: 700; color: var(--text); }
.playlist a[aria-current="true"] .n { background: var(--accent); color: var(--accent-ink); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; font-size: 14.5px; margin: 0; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }

.profile-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }

/* Вход */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); }
.auth-art { position: relative; background: var(--ink); color: var(--ink-text); padding: clamp(28px, 4vw, 56px); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.auth-art .logo-mark { background: var(--ink-text); color: var(--ink); }
.auth-art h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); max-width: 12ch; line-height: 1.02; letter-spacing: -0.04em; }
.auth-art p { color: var(--ink-text-2); max-width: 36ch; }
.auth-art .orbit { position: absolute; width: 560px; right: -160px; bottom: -160px; opacity: .6; pointer-events: none; }
.auth-art .orbit-ring { border-color: var(--ink-line); }
.auth-art .orbit-core { background: var(--accent); color: var(--accent-ink); }
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 5vw, 72px); }
.auth-form .inner { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-form h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.auth-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: clamp(32px, 6vw, 72px); }
.demo-hint { margin-top: 28px; padding: 16px; border-radius: 14px; background: var(--bg-soft); font-size: 13.5px; color: var(--text-2); }
.demo-hint code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--surface); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; color: var(--text); }



/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (max-width: 1100px) {
  .main-nav { display: none; }
  .burger { display: inline-grid; }
  .header-tools .lang-switch, .header-tools .btn-cabinet-text { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
  .feature:nth-child(2) { border-right: 0; }
  .feature:nth-child(3) { padding-left: 0; }
  .feature:nth-child(n+3) { border-top: 1px solid var(--line); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .hero-grid, .cta, .course-hero, .about-grid, .grid-main { grid-template-columns: 1fr; }
  .orbit { max-width: 380px; margin: 0 auto; }
  .directions { grid-template-columns: repeat(2, 1fr); }
  .direction-card, .direction-card:nth-child(4), .direction-card:nth-child(5) { grid-column: span 1; }
  .direction-card:nth-child(5) { grid-column: span 2; }
  .sticky-card { position: static; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Кабинет: боковое меню уезжает */
  .cab { grid-template-columns: 1fr; }
  .cab-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 100; width: min(300px, 86vw);
    transform: translateX(-100%); transition: transform 320ms var(--ease); box-shadow: var(--shadow-lg);
  }
  .cab.is-nav-open .cab-sidebar { transform: none; }
  .cab-overlay { display: block; position: fixed; inset: 0; z-index: 99; background: var(--overlay); opacity: 0; visibility: hidden; transition: opacity var(--t), visibility var(--t); }
  .cab.is-nav-open .cab-overlay { opacity: 1; visibility: visible; }
  .cab-burger { display: inline-grid; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 280px; }
  .auth-art .orbit { width: 380px; right: -120px; bottom: -140px; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .header-inner { height: 64px; gap: 12px; }
  .logo-text small { display: none; }
  .header-tools .btn-enroll { display: none; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .directions { grid-template-columns: 1fr; }
  .direction-card, .direction-card:nth-child(n) { grid-column: span 1; min-height: 220px; }
  .features { grid-template-columns: 1fr; }
  .feature, .feature + .feature { padding: 24px 0 8px; border-right: 0; border-top: 1px solid var(--line); }
  .feature:first-child { border-top: 0; }
  .feature .n { margin-bottom: 16px; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-4.keep-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .numbers { grid-template-columns: 1fr 1fr; }
  .number-card { padding: 20px; }
  .course-facts { grid-template-columns: 1fr 1fr; }
  .cta { border-radius: var(--radius-lg); }
  .cta::after { right: 28px; top: 28px; }
  .messages { left: 16px; right: 16px; bottom: 16px; max-width: none; }
  .cab-topbar { height: 60px; }
  .cab-topbar .lang-switch { display: none; }
  .card-head, .card-body, .list > li { padding-left: 16px; padding-right: 16px; }
  .table th, .table td { padding: 12px; }
  .seg label { padding: 7px 9px; }
  .seg label .txt { display: none; }
  .seg label .short { display: inline; }
  .bar-row { grid-template-columns: 90px 1fr 40px; }
  .journal .sticky-col { min-width: 150px; max-width: 170px; padding: 8px 10px; }
  .journal .sticky-col small { display: none; }
  .mark-bar { padding: 12px 16px; }
  .month-nav b { min-width: 120px; }
  .page-head .actions { width: 100%; }
  .hero h1 { font-size: clamp(1.7rem, 8vw, 2.2rem); }
  .hero h1 em { white-space: normal; }
  /* Отметка занятия: строка студента становится карточкой */
  .mark-table thead { display: none; }
  .mark-table, .mark-table tbody, .mark-table td { display: block; width: 100%; }
  .mark-table tr { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .mark-table td { border: 0; padding: 0 !important; }
  .mark-table td:nth-child(-n+2) { grid-column: 1 / -1; }
  .mark-table .seg { display: flex; width: 100%; }
  .mark-table .seg label { flex: 1; justify-content: center; padding: 9px 4px; }
  .mark-table input.grade { width: 100%; }
  .mark-table input.comment { min-width: 0; }
  /* Таблицы превращаются в карточки */
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table-stack td { border: 0; padding: 4px 0; }
  .table-stack td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 2px; }
  .table-stack .actions { justify-content: flex-start; padding-top: 8px; }
}

@media (max-width: 380px) {
  .hero-stats b { font-size: 1.5rem; }
  .header-tools { gap: 6px; }
  .theme-toggle, .btn-icon { width: 40px; height: 40px; min-height: 40px; }
}

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

@media print {
  .site-header, .site-footer, .cab-sidebar, .cab-topbar, .messages, .mark-bar, .no-print { display: none !important; }
  .cab { display: block; background: #fff; }
  .journal-wrap { max-height: none; overflow: visible; }
}
