/* ============================================================
   SA/BA Interview Trainer — design system
   Стиль: графитовый минимализм, тонкие линии, моно-акценты
   ============================================================ */

:root {
  color-scheme: dark;

  /* surfaces */
  --bg: #08090b;
  --bg-soft: #0b0d10;
  --panel: #101317;
  --panel-2: #14181e;
  --panel-3: #191e25;
  --line: #222831;
  --line-soft: #1a1f26;
  --line-strong: #2e3641;

  /* text */
  --text: #e9ecf1;
  --text-2: #b6bec9;
  --muted: #868f9c;
  --dim: #5f6873;

  /* brand */
  --accent: #d3f26a;
  --accent-2: #b6e13f;
  --accent-ink: #10130a;
  --accent-soft: rgba(211, 242, 106, 0.12);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, 0.14);

  /* semantic */
  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, 0.13);
  --warn: #f5b642;
  --warn-soft: rgba(245, 182, 66, 0.13);
  --bad: #ff6b6b;
  --bad-soft: rgba(255, 107, 107, 0.13);
  --info: #6aa9ff;
  --info-soft: rgba(106, 169, 255, 0.13);

  /* levels */
  --lvl-easy: #3ddc97;
  --lvl-medium: #f5b642;
  --lvl-hard: #ff6b6b;

  /* type */
  --font-ui: 'Inter', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;

  /* shape */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  --header-h: 62px;
  --maxw: 1280px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  /* Страховка от горизонтального скролла на мобиле: clip (а не hidden),
     чтобы не ломать sticky-шапку. Причины чиним точечно, это лишь сеть. */
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* фоновая сетка-точка, лёгкое свечение сверху */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 420px at 78% -8%, rgba(211, 242, 106, 0.07), transparent 62%),
    radial-gradient(700px 380px at 8% 0%, rgba(167, 139, 250, 0.07), transparent 60%);
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image: radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.5;
  pointer-events: none;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: clamp(34px, 5.2vw, 60px); }
h2 { font-size: clamp(24px, 3vw, 34px); }
h3 { font-size: 19px; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
ul, ol { margin: 0 0 12px; padding-left: 20px; }
li { margin-bottom: 6px; }
li::marker { color: var(--dim); }
code, pre, kbd { font-family: var(--font-mono); }
img, svg { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--accent); color: var(--accent-ink); }

/* скроллбары */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ============================ утилиты ============================ */

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: 1560px; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--accent);
  opacity: 0.7;
}
.eyebrow.plain::before { display: none; }
.section-title { margin-bottom: 10px; }
.section-lead { color: var(--text-2); max-width: 62ch; font-size: 16px; }

.section { padding: 84px 0; position: relative; }
.section-tight { padding: 48px 0; }
.section-bordered { border-top: 1px solid var(--line-soft); }

/* ============================ кнопки ============================ */

.btn {
  --btn-bg: var(--panel-2);
  --btn-fg: var(--text);
  --btn-bd: var(--line-strong);
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  min-height: 40px;
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-md);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 600 14px/1 var(--font-ui);
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease), transform 0.12s var(--ease), color 0.16s var(--ease);
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { background: var(--panel-3); border-color: #3a444f; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

.btn-primary {
  --btn-bg: var(--accent);
  --btn-fg: var(--accent-ink);
  --btn-bd: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-soft);
}
.btn-primary:hover {
  --btn-bg: var(--accent-2);
  --btn-bd: var(--accent-2);
  color: var(--accent-ink);
  box-shadow: 0 8px 30px -10px rgba(211, 242, 106, 0.55);
}

.btn-ghost { --btn-bg: transparent; --btn-bd: var(--line); --btn-fg: var(--text-2); }
.btn-ghost:hover { --btn-bg: var(--panel-2); --btn-fg: var(--text); border-color: var(--line-strong); }

.btn-outline { --btn-bg: transparent; --btn-bd: var(--line-strong); }

.btn-danger { --btn-bg: transparent; --btn-bd: rgba(255, 107, 107, 0.4); --btn-fg: var(--bad); }
.btn-danger:hover { --btn-bg: var(--bad-soft); color: var(--bad); }

.btn-sm { padding: 6px 12px; min-height: 32px; font-size: 13px; border-radius: var(--r-sm); }
.btn-lg { padding: 14px 26px; min-height: 50px; font-size: 15.5px; border-radius: var(--r-lg); }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--panel-2); color: var(--text-2); cursor: pointer;
  transition: all 0.15s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--panel-3); }

.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--accent); font: inherit; font-size: 13.5px;
}
.link-btn:hover { text-decoration: underline; }

/* ============================ чипы / бейджи ============================ */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--panel-2);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.chip-accent { border-color: rgba(211, 242, 106, 0.35); color: var(--accent); background: var(--accent-soft); }
.chip-info { border-color: rgba(106, 169, 255, 0.3); color: var(--info); background: var(--info-soft); }
.chip-violet { border-color: rgba(167, 139, 250, 0.3); color: var(--violet); background: var(--violet-soft); }

.level {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em;
  text-transform: uppercase; white-space: nowrap;
}
.level::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
.level-easy { color: var(--lvl-easy); }
.level-medium { color: var(--lvl-medium); }
.level-hard { color: var(--lvl-hard); }

.level-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 11px; border-radius: var(--r-pill);
  font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em;
  border: 1px solid currentColor;
}
.level-pill.level-easy { background: rgba(61, 220, 151, 0.1); }
.level-pill.level-medium { background: rgba(245, 182, 66, 0.1); }
.level-pill.level-hard { background: rgba(255, 107, 107, 0.1); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.03em;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
}
.badge-ok { color: var(--ok); border-color: rgba(61, 220, 151, 0.3); background: var(--ok-soft); }
.badge-warn { color: var(--warn); border-color: rgba(245, 182, 66, 0.3); background: var(--warn-soft); }
.badge-bad { color: var(--bad); border-color: rgba(255, 107, 107, 0.3); background: var(--bad-soft); }
.badge-info { color: var(--info); border-color: rgba(106, 169, 255, 0.3); background: var(--info-soft); }
.badge-accent { color: var(--accent); border-color: rgba(211, 242, 106, 0.3); background: var(--accent-soft); }
.badge-violet { color: var(--violet); border-color: rgba(167, 139, 250, 0.3); background: var(--violet-soft); }

.tag-filter {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--panel);
  color: var(--text-2); font-size: 13px; cursor: pointer;
  font-family: var(--font-ui);
  transition: all 0.15s var(--ease);
}
.tag-filter:hover { border-color: var(--line-strong); color: var(--text); background: var(--panel-2); }
.tag-filter[aria-pressed="true"] {
  border-color: rgba(211, 242, 106, 0.45);
  background: var(--accent-soft);
  color: var(--accent);
}
.tag-filter .count { font-family: var(--font-mono); font-size: 11px; color: var(--dim); }
.tag-filter[aria-pressed="true"] .count { color: rgba(211, 242, 106, 0.7); }

/* ============================ карточки / панели ============================ */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
}
.card-hover { transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), background 0.18s var(--ease); }
.card-hover:hover { border-color: var(--line-strong); background: var(--panel-2); transform: translateY(-2px); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.panel-title {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--muted); margin: 0;
}
.panel-body { padding: 18px; }

.divider { height: 1px; background: var(--line-soft); border: 0; margin: 0; }

/* ============================ шапка ============================ */

.site-header {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  background: rgba(8, 9, 11, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .wrap {
  height: 100%;
  display: flex; align-items: center; gap: 28px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: -0.03em; font-size: 15.5px;
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  box-shadow: 0 0 20px -4px rgba(211, 242, 106, 0.5);
}
.brand-logo {
  width: 30px; height: 30px; border-radius: 8px; display: block;
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.8);
}
.brand-sub { color: var(--dim); font-weight: 500; font-size: 13px; }

.main-nav { display: flex; align-items: center; gap: 2px; margin-left: 6px; }
.main-nav a {
  padding: 7px 12px; border-radius: var(--r-sm);
  color: var(--muted); font-size: 14px; font-weight: 500;
  transition: all 0.15s var(--ease);
}
.main-nav a:hover { color: var(--text); background: var(--panel-2); }
.main-nav a[aria-current="page"] { color: var(--text); background: var(--panel-2); }
.main-nav a[aria-current="page"]::after {
  content: ''; display: block; height: 2px; margin-top: 3px;
  background: var(--accent); border-radius: 2px;
}

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.progress-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 12px 5px 6px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--panel); font-size: 12.5px; color: var(--text-2);
}
.progress-chip .avatar {
  width: 24px; height: 24px; border-radius: 99px;
  background: linear-gradient(135deg, var(--violet), var(--accent));
  color: #10130a; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
}
.progress-chip b { color: var(--text); font-family: var(--font-mono); font-weight: 600; }

.burger { display: none; }
.hidden-mobile { display: inline; }

/* ============================ подвал ============================ */

.site-footer {
  border-top: 1px solid var(--line-soft);
  background: var(--bg-soft);
  padding: 56px 0 32px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line-soft);
}
.footer-col h4 {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--dim); margin-bottom: 14px; font-weight: 500;
}
.footer-col a { display: block; color: var(--text-2); font-size: 14px; padding: 4px 0; }
.footer-col a:hover { color: var(--accent); }
.footer-note { color: var(--dim); font-size: 13.5px; max-width: 40ch; }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding-top: 24px; color: var(--dim); font-size: 12.5px;
  font-family: var(--font-mono);
}

/* ============================ лендинг: hero ============================ */

.hero { padding: 76px 0 64px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }

.hero h1 { margin-bottom: 20px; }
.hero h1 .accent { color: var(--accent); }
.hero h1 .strike { color: var(--dim); text-decoration: line-through; text-decoration-color: rgba(255, 107, 107, 0.6); text-decoration-thickness: 3px; }
.hero-lead { font-size: 17.5px; color: var(--text-2); max-width: 54ch; margin-bottom: 28px; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }

.hero-stats { display: flex; flex-wrap: wrap; gap: 28px; padding-top: 24px; border-top: 1px solid var(--line-soft); }
.hero-stat .num {
  font-family: var(--font-mono); font-size: 26px; font-weight: 600;
  color: var(--text); letter-spacing: -0.02em; display: block;
}
.hero-stat .lbl { font-size: 12.5px; color: var(--muted); }

/* карточка-превью ревью в hero */
.hero-visual { position: relative; }
.mock-window {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}
.mock-titlebar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
  background: var(--panel-2);
}
.mock-dots { display: flex; gap: 5px; }
.mock-dots i { width: 9px; height: 9px; border-radius: 99px; background: var(--line-strong); display: block; }
.mock-dots i:first-child { background: #3a424c; }
.mock-titlebar .path { font-family: var(--font-mono); font-size: 11.5px; color: var(--dim); margin-left: 6px; }
.mock-body { padding: 18px; font-size: 13.5px; }

.agent-line { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line-soft); }
.agent-line:last-child { border-bottom: 0; padding-bottom: 0; }
.agent-avatar {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  border: 1px solid var(--line-strong); background: var(--panel-3);
}
.agent-avatar.sa { color: var(--info); border-color: rgba(106, 169, 255, 0.35); background: var(--info-soft); }
.agent-avatar.arch { color: var(--violet); border-color: rgba(167, 139, 250, 0.35); background: var(--violet-soft); }
.agent-line .who { font-size: 12.5px; color: var(--muted); font-family: var(--font-mono); }
.agent-line .what { color: var(--text-2); }

.float-card {
  position: absolute;
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-family: var(--font-mono); font-size: 12px;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8);
}
.float-card.fc-1 { top: -18px; right: -10px; color: var(--accent); border-color: rgba(211, 242, 106, 0.3); }
.float-card.fc-2 { bottom: -16px; left: -14px; color: var(--info); border-color: rgba(106, 169, 255, 0.3); }

/* ============================ лендинг: секции ============================ */

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.feature-card { padding: 24px; }
.feature-num {
  font-family: var(--font-mono); font-size: 11px; color: var(--dim);
  letter-spacing: 0.1em; margin-bottom: 14px; display: block;
}
.feature-card h3 { margin-bottom: 8px; font-size: 17px; }
.feature-card p { color: var(--text-2); font-size: 14px; }
.feature-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; margin-bottom: 16px;
  background: var(--panel-3); border: 1px solid var(--line);
  color: var(--accent); font-family: var(--font-mono); font-size: 15px;
}

.steps { counter-reset: step; display: grid; gap: 0; }
.step {
  display: grid; grid-template-columns: 56px 1fr; gap: 20px;
  padding: 22px 0; border-bottom: 1px solid var(--line-soft);
}
.step:last-child { border-bottom: 0; }
.step-num {
  font-family: var(--font-mono); font-size: 13px; color: var(--accent);
  border: 1px solid rgba(211, 242, 106, 0.3); background: var(--accent-soft);
  border-radius: var(--r-sm); height: 34px; display: grid; place-items: center;
}
.step h3 { font-size: 16.5px; margin-bottom: 6px; }
.step p { color: var(--text-2); font-size: 14px; margin: 0; }

/* логотипы/соцпруф строка */
.proof-strip {
  display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center;
  padding: 18px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  color: var(--dim); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em;
}
.proof-strip span b { color: var(--text-2); font-weight: 600; }

/* отзывы */
.quote { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.quote p { color: var(--text-2); font-size: 14.5px; }
.quote-who { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.quote-who .avatar {
  width: 36px; height: 36px; border-radius: 99px;
  background: var(--panel-3); border: 1px solid var(--line-strong);
  display: grid; place-items: center; font-family: var(--font-mono); font-size: 12px; color: var(--accent);
}
.quote-who .name { font-size: 13.5px; font-weight: 600; }
.quote-who .role { font-size: 12px; color: var(--muted); }

/* тарифы */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
.price-card { padding: 26px; position: relative; display: flex; flex-direction: column; gap: 16px; }
.price-card.popular {
  border-color: rgba(211, 242, 106, 0.45);
  background: linear-gradient(180deg, rgba(211, 242, 106, 0.06), var(--panel) 42%);
}
.price-flag {
  position: absolute; top: -11px; left: 26px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 10px; border-radius: var(--r-pill); font-weight: 700;
}
.price-name { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.price-value { font-family: var(--font-mono); font-size: 38px; font-weight: 600; letter-spacing: -0.03em; }
.price-value small { font-size: 14px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.price-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.price-features li { display: flex; gap: 9px; font-size: 13.5px; color: var(--text-2); margin: 0; }
.price-features li::before { content: '→'; color: var(--accent); font-family: var(--font-mono); }
.price-features li.off { color: var(--dim); }
.price-features li.off::before { content: '×'; color: var(--dim); }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--line-soft); }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 18px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-weight: 600; font-size: 15.5px; letter-spacing: -0.01em;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; font-family: var(--font-mono); color: var(--accent);
  font-size: 20px; transition: transform 0.2s var(--ease); flex: 0 0 auto;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 0 20px; color: var(--text-2); font-size: 14.5px; max-width: 80ch; }

/* CTA блок */
.cta-band {
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 48px;
  background:
    radial-gradient(600px 260px at 88% 0%, rgba(211, 242, 106, 0.1), transparent 60%),
    var(--panel);
  display: grid; grid-template-columns: 1.4fr auto; gap: 32px; align-items: center;
}
.cta-band h2 { margin-bottom: 10px; }
.cta-band p { color: var(--text-2); max-width: 56ch; }

/* ============================ каталог ============================ */

.page-head { padding: 40px 0 24px; border-bottom: 1px solid var(--line-soft); }
.page-head h1 { font-size: clamp(26px, 3.4vw, 38px); margin-bottom: 8px; }
.page-head .lead { color: var(--text-2); max-width: 70ch; font-size: 15px; }

.catalog-layout { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 24px; padding: 24px 0 80px; align-items: start; }

.filters { position: sticky; top: calc(var(--header-h) + 18px); display: grid; gap: 18px; }
.filter-group { padding: 16px; }
.filter-group h4 {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 12px; font-weight: 500;
}
.filter-list { display: flex; flex-direction: column; gap: 3px; }
.filter-option {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 9px; border-radius: var(--r-sm);
  cursor: pointer; font-size: 13.5px; color: var(--text-2);
  border: 1px solid transparent; transition: all 0.14s var(--ease);
}
.filter-option:hover { background: var(--panel-2); color: var(--text); }
.filter-option input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; cursor: pointer; }
.filter-option .count { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--dim); }
.filter-option[data-on="true"] { background: var(--panel-2); border-color: var(--line); color: var(--text); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; max-height: 260px; overflow: auto; padding-right: 4px; }

.list-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-bottom: 14px; margin-bottom: 4px;
}
.search {
  position: relative; flex: 1 1 260px; min-width: 200px;
}
.search input {
  width: 100%; padding: 10px 12px 10px 34px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md);
  color: var(--text); font: 400 14px var(--font-ui);
  transition: border-color 0.15s var(--ease);
}
.search input::placeholder { color: var(--dim); }
.search input:focus { outline: none; border-color: var(--line-strong); background: var(--panel-2); }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--dim); font-size: 14px; pointer-events: none; }

/* Поиск внутри .field (админка): не даём padding полей перекрыть отступ под лупу */
.field .search input { padding: 10px 12px 10px 34px; }

.select {
  padding: 10px 12px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-md); color: var(--text-2); font: 400 13.5px var(--font-ui); cursor: pointer;
}
.select:focus { outline: none; border-color: var(--line-strong); }

.result-count { font-family: var(--font-mono); font-size: 12px; color: var(--dim); }

/* таблица задач */
.task-table { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--panel); }
.task-thead, .task-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 190px 96px 86px;
  gap: 14px; align-items: center;
}
.task-thead {
  padding: 10px 16px; background: var(--panel-2); border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.11em; text-transform: uppercase; color: var(--dim);
}
.task-row {
  padding: 14px 16px; border-bottom: 1px solid var(--line-soft);
  transition: background 0.14s var(--ease);
  text-decoration: none; color: inherit; display: grid;
}
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: var(--panel-2); }
.task-row:hover .task-title { color: var(--accent); }
.task-status {
  width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); color: var(--dim); font-size: 11px; font-family: var(--font-mono);
}
.task-status[data-state="draft"] { color: var(--warn); border-color: rgba(245, 182, 66, 0.4); background: var(--warn-soft); }
.task-status[data-state="review"] { color: var(--info); border-color: rgba(106, 169, 255, 0.4); background: var(--info-soft); }
.task-status[data-state="done"] { color: var(--ok); border-color: rgba(61, 220, 151, 0.4); background: var(--ok-soft); }
.task-title { font-weight: 550; font-size: 14.5px; letter-spacing: -0.01em; color: var(--text); transition: color 0.14s var(--ease); }
.task-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.task-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.task-tags .chip { font-size: 10.5px; padding: 2px 8px; }
.task-rate { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); text-align: right; }
.task-time { font-family: var(--font-mono); font-size: 12.5px; color: var(--dim); text-align: right; }

.empty-state {
  padding: 56px 24px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--panel);
}
.empty-state h3 { color: var(--text); margin-bottom: 8px; font-size: 17px; }

/* ============================ подборки ============================ */

.collections-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; padding: 24px 0 80px; }
.collection-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.collection-top { padding: 24px 24px 18px; display: flex; gap: 16px; align-items: flex-start; }
.collection-ico {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; font-size: 19px;
  background: var(--panel-3); border: 1px solid var(--line);
}
.collection-card h3 { font-size: 18px; margin-bottom: 6px; }
.collection-card .desc { color: var(--text-2); font-size: 13.5px; }
.collection-meta {
  display: flex; gap: 16px; padding: 0 24px 16px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--dim);
}
.collection-meta b { color: var(--text-2); font-weight: 500; }
.collection-tasks { border-top: 1px solid var(--line-soft); background: var(--bg-soft); }
.collection-task {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 24px; border-bottom: 1px solid var(--line-soft);
  color: var(--text-2); font-size: 13.5px; transition: all 0.14s var(--ease);
}
.collection-task:last-child { border-bottom: 0; }
.collection-task:hover { background: var(--panel-2); color: var(--text); }
.collection-task .lvl { margin-left: auto; }
.collection-foot { padding: 14px 24px; border-top: 1px solid var(--line-soft); }

/* ============================ страница задачи ============================ */

.task-page { padding: 0 0 80px; }
.task-crumb {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 14px 0; font-family: var(--font-mono); font-size: 11.5px; color: var(--dim);
}
.task-crumb a { color: var(--muted); }
.task-crumb a:hover { color: var(--accent); }
.task-crumb .sep { color: var(--line-strong); }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 16px;
  align-items: stretch;
  transition: grid-template-columns 240ms var(--ease);
}

/* Добавляем редактору 10% его исходной ширины; элементы управления не вызывают скачков. */
@media (min-width: 1081px) {
  .workspace:has(.pane[aria-label="Ваше решение"]:focus-within) {
    grid-template-columns: minmax(0, 0.892fr) minmax(0, 1.188fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  .workspace { transition: none; }
}

.pane {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: flex; flex-direction: column;
  min-height: 620px;
  overflow: hidden;
}

.pane-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  flex-wrap: wrap;
}
.pane-head .title { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.pane-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.pane-scroll { overflow: auto; flex: 1 1 auto; }

/* описание задачи */
.statement { padding: 22px 24px 32px; font-size: 14.5px; color: var(--text-2); }
.statement h2 { font-size: 15px; margin: 26px 0 10px; color: var(--text);
  font-family: var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500; }
.statement h2:first-child { margin-top: 0; }
.statement p { margin-bottom: 12px; }
.statement ul, .statement ol { margin-bottom: 14px; }
.statement li { margin-bottom: 7px; }
.statement strong { color: var(--text); font-weight: 600; }
.statement code {
  background: var(--panel-3); border: 1px solid var(--line);
  padding: 1px 5px; border-radius: 4px; font-size: 12.5px; color: var(--accent);
}
.statement blockquote {
  margin: 16px 0; padding: 12px 16px;
  border-left: 2px solid var(--accent); background: var(--accent-soft);
  border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--text-2); font-size: 13.5px;
}

.info-box {
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg-soft); padding: 14px 16px; margin: 16px 0;
}
.info-box .ib-title {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--dim); margin-bottom: 8px;
}

.rubric-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.rubric-list li {
  display: flex; gap: 10px; align-items: flex-start; margin: 0;
  font-size: 13.5px; color: var(--text-2);
}
.rubric-list li .w {
  flex: 0 0 auto; font-family: var(--font-mono); font-size: 10px;
  padding: 2px 6px; border-radius: 4px; margin-top: 2px;
  border: 1px solid var(--line); color: var(--muted); background: var(--panel-2);
}
.rubric-list li .w.high { color: var(--bad); border-color: rgba(255, 107, 107, 0.3); background: var(--bad-soft); }
.rubric-list li .w.mid { color: var(--warn); border-color: rgba(245, 182, 66, 0.3); background: var(--warn-soft); }

details.fold { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-soft); margin-top: 12px; }
details.fold summary {
  cursor: pointer; padding: 12px 16px; font-size: 13.5px; font-weight: 550;
  list-style: none; display: flex; align-items: center; gap: 10px; color: var(--text-2);
}
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::before { content: '▸'; color: var(--accent); font-family: var(--font-mono); transition: transform 0.18s var(--ease); }
details.fold[open] summary::before { transform: rotate(90deg); }
details.fold .fold-body { padding: 0 16px 16px; color: var(--text-2); font-size: 13.5px; border-top: 1px solid var(--line-soft); padding-top: 14px; }

/* вкладки решения */
.tabs-bar {
  display: flex; align-items: stretch; gap: 8px;
  padding: 8px; border-bottom: 1px solid var(--line);
  background: var(--panel-2); overflow-x: auto; scrollbar-width: none;
}
.tabs-bar::-webkit-scrollbar { display: none; }
/* Рамка объединяет название и меню в одну вкладку; её цвета следуют теме. */
.tab-group {
  display: flex; flex: 0 0 auto; align-items: stretch;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: transparent;
}
/* Активность показываем акцентом, а не тёмной заливкой: иначе неактивная
   вкладка выглядела более выделенной, особенно в серой теме. */
.tab-group:has(.tab[aria-selected="true"]) {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  background: var(--accent-soft);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.tab-actions {
  border: 0; background: none; color: var(--muted); cursor: pointer;
  padding: 0 9px; font-size: 20px;
  border-left: 1px solid var(--line-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.tab-actions:hover { color: var(--text); background: var(--panel-3); }
.tab {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; border: 0; background: none; cursor: pointer;
  color: var(--muted); font: 500 13px var(--font-ui); white-space: nowrap;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
  transition: color 0.14s var(--ease);
}
.tab:hover { color: var(--text-2); }
.tab[aria-selected="true"] { color: var(--text); font-weight: 600; }
.tab .kind {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--dim);
}
.tab[aria-selected="true"] .kind { border-color: rgba(211, 242, 106, 0.4); color: var(--accent); background: var(--accent-soft); }
.tab-add {
  display: flex; align-items: center; gap: 6px; padding: 11px 12px;
  background: none; border: 0; cursor: pointer; color: var(--dim);
  font: 500 13px var(--font-ui); white-space: nowrap;
}
.tab-add:hover { color: var(--accent); }

.tab-panel { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }

/* WYSIWYG */
.editor-toolbar {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  padding: 8px 12px; border-bottom: 1px solid var(--line-soft); background: var(--bg-soft);
}
.editor-toolbar button {
  min-width: 30px; height: 30px; padding: 0 8px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: none; color: var(--muted); cursor: pointer;
  font: 500 13px var(--font-ui); transition: all 0.13s var(--ease);
}
.editor-toolbar button:hover { background: var(--panel-2); color: var(--text); border-color: var(--line); }
.editor-toolbar button[data-active="true"] { background: var(--accent-soft); color: var(--accent); border-color: rgba(211, 242, 106, 0.3); }
.editor-toolbar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }

.wysiwyg {
  flex: 1 1 auto; min-height: 380px; padding: 20px 24px 40px;
  overflow: auto; font-size: 14.5px; line-height: 1.7; color: var(--text-2);
  outline: none;
}
.wysiwyg:empty::before { content: attr(data-placeholder); color: var(--dim); }
.wysiwyg h1, .wysiwyg h2, .wysiwyg h3 { color: var(--text); margin: 20px 0 10px; letter-spacing: -0.01em; }
.wysiwyg h1 { font-size: 22px; } .wysiwyg h2 { font-size: 18px; } .wysiwyg h3 { font-size: 15.5px; }
.wysiwyg p { margin-bottom: 12px; }
.wysiwyg ul, .wysiwyg ol { margin-bottom: 12px; }
.wysiwyg strong { color: var(--text); }
.wysiwyg a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.wysiwyg blockquote {
  margin: 14px 0; padding: 10px 16px; border-left: 2px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--text-2);
}
.wysiwyg code {
  background: var(--panel-3); border: 1px solid var(--line); padding: 1px 5px;
  border-radius: 4px; font-size: 12.5px; color: var(--accent);
}
.wysiwyg pre {
  background: #0a0c0f; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px; overflow: auto; margin: 14px 0;
}
.wysiwyg pre code { background: none; border: 0; padding: 0; color: var(--text-2); font-size: 12.5px; }
.wysiwyg table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 13.5px; }
.wysiwyg th, .wysiwyg td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.wysiwyg th { background: var(--panel-2); color: var(--text); font-weight: 600; }
.wysiwyg hr { border-top: 1px solid var(--line); margin: 18px 0; }

/* редактор кода диаграмм */
.diagram-editor { display: grid; grid-template-rows: auto minmax(0, 1fr); flex: 1 1 auto; min-height: 0; }
.diagram-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 0; }
.diagram-split.preview-hidden { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.code-area {
  width: 100%; height: 100%; min-height: 320px; resize: none;
  padding: 16px 18px; border: 0; border-right: 1px solid var(--line-soft);
  background: #0a0c0f; color: #dfe5ec;
  font: 400 12.8px/1.65 var(--font-mono);
  outline: none; tab-size: 2;
}
.diagram-split.preview-hidden .code-area { border-right: 0; border-bottom: 0; }
.preview-area[hidden] { display: none; }
.preview-area {
  overflow: auto; padding: 18px; background:
    linear-gradient(45deg, rgba(255,255,255,0.014) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.014) 75%) 0 0 / 18px 18px,
    linear-gradient(45deg, rgba(255,255,255,0.014) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.014) 75%) 9px 9px / 18px 18px,
    #fcfcfd;
  display: grid; place-items: start center;
}
.preview-area svg { max-width: 100%; height: auto; }
.preview-area img { max-width: 100%; }
.preview-empty { color: #6b7280; font-family: var(--font-mono); font-size: 12.5px; padding: 40px 20px; text-align: center; }
.preview-error {
  color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 8px; padding: 12px 14px; font-family: var(--font-mono); font-size: 12px;
  white-space: pre-wrap; width: 100%;
}
.diagram-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft); background: var(--bg-soft);
  font-family: var(--font-mono); font-size: 11px; color: var(--dim);
}
.diagram-toolbar .spacer { margin-left: auto; }
.snippet-btn {
  padding: 4px 9px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--panel-2); color: var(--text-2); cursor: pointer;
  font: 400 11.5px var(--font-mono); transition: all 0.14s var(--ease);
}
.snippet-btn:hover { border-color: rgba(211, 242, 106, 0.4); color: var(--accent); background: var(--accent-soft); }

/* статусная строка решения */
.solution-foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; border-top: 1px solid var(--line); background: var(--panel-2);
  font-family: var(--font-mono); font-size: 11.5px; color: var(--dim);
}
.save-dot { width: 6px; height: 6px; border-radius: 99px; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.save-dot.busy { background: var(--warn); box-shadow: 0 0 8px var(--warn); }

/* ============================ ревью ============================ */

.review-section { margin-top: 20px; scroll-margin-top: calc(var(--header-h) + 16px); }

.review-progress { padding: 24px; }
.rp-agents { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 18px; }
.rp-agent { border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; background: var(--bg-soft); }
.rp-agent-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.rp-agent-head .name { font-size: 13.5px; font-weight: 600; }
.rp-agent-head .role { font-family: var(--font-mono); font-size: 10.5px; color: var(--dim); }
.rp-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.rp-steps li { display: flex; gap: 9px; align-items: center; font-size: 12.8px; color: var(--dim); margin: 0; }
.rp-steps li .mark {
  width: 15px; height: 15px; border-radius: 99px; border: 1px solid var(--line-strong);
  display: grid; place-items: center; font-size: 9px; flex: 0 0 auto;
}
.rp-steps li[data-state="active"] { color: var(--text-2); }
.rp-steps li[data-state="active"] .mark { border-color: var(--accent); color: var(--accent); animation: pulse 1.1s infinite; }
.rp-steps li[data-state="done"] { color: var(--muted); }
.rp-steps li[data-state="done"] .mark { background: var(--ok-soft); border-color: rgba(61, 220, 151, 0.4); color: var(--ok); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.progress-bar { height: 4px; background: var(--panel-3); border-radius: 99px; overflow: hidden; }
.progress-bar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width 0.4s var(--ease); }

.verdict-head { padding: 24px; border-bottom: 1px solid var(--line-soft); }
.verdict-top { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.verdict-grade {
  font-family: var(--font-mono); font-size: 40px; font-weight: 600; letter-spacing: -0.04em; line-height: 1;
}
.verdict-label { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; margin-bottom: 6px; }
.verdict-summary { color: var(--text-2); font-size: 14px; max-width: 76ch; }

.grade-meter { display: flex; gap: 3px; margin-top: 14px; }
.grade-meter i { height: 5px; flex: 1; border-radius: 2px; background: var(--panel-3); }
.grade-meter i.on-1 { background: var(--bad); } .grade-meter i.on-2 { background: var(--warn); }
.grade-meter i.on-3 { background: var(--info); } .grade-meter i.on-4 { background: var(--ok); }
.grade-meter i.on-5 { background: var(--accent); }

.verdict-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.vstat .k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); display: block; }
.vstat .v { font-size: 14px; color: var(--text-2); }

.review-agent { padding: 22px 24px; border-bottom: 1px solid var(--line-soft); }
.review-agent:last-child { border-bottom: 0; }
.ra-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ra-avatar {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  border: 1px solid var(--line-strong);
}
.ra-avatar.sa { color: var(--info); background: var(--info-soft); border-color: rgba(106, 169, 255, 0.35); }
.ra-avatar.arch { color: var(--violet); background: var(--violet-soft); border-color: rgba(167, 139, 250, 0.35); }
.ra-name { font-size: 15px; font-weight: 650; }
.ra-role { font-family: var(--font-mono); font-size: 11px; color: var(--dim); }
.ra-score { margin-left: auto; text-align: right; }
.ra-score .num { font-family: var(--font-mono); font-size: 22px; font-weight: 600; }
.ra-score .lbl { font-family: var(--font-mono); font-size: 10px; color: var(--dim); letter-spacing: 0.08em; text-transform: uppercase; }

.ra-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.ra-block h5 {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--dim); margin: 0 0 9px; font-weight: 500; display: flex; align-items: center; gap: 7px;
}
.ra-block h5 .dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.ra-block.good h5 { color: var(--ok); }
.ra-block.miss h5 { color: var(--warn); }
.ra-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ra-list li { display: flex; gap: 9px; font-size: 13.5px; color: var(--text-2); margin: 0; line-height: 1.55; }
.ra-list li .ico { flex: 0 0 auto; font-family: var(--font-mono); font-size: 12px; margin-top: 1px; }
.ra-block.good .ico { color: var(--ok); }
.ra-block.miss .ico { color: var(--warn); }
.ra-block.miss .ico.crit { color: var(--bad); }

.ra-narrative {
  margin-top: 18px; padding: 16px 18px;
  border: 1px solid var(--line); border-left: 2px solid var(--violet);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--bg-soft); font-size: 14px; color: var(--text-2);
}
.review-agent.sa .ra-narrative { border-left-color: var(--info); }
.ra-narrative .lbl {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--dim); margin-bottom: 8px; display: block;
}

.ra-questions { margin-top: 16px; }
.ra-questions ol { margin: 0; padding-left: 20px; }
.ra-questions li { font-size: 13.5px; color: var(--text-2); }
.ra-questions li::marker { color: var(--accent); font-family: var(--font-mono); }

.review-foot {
  padding: 18px 24px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  border-top: 1px solid var(--line-soft); background: var(--bg-soft);
}
.review-foot .note { font-family: var(--font-mono); font-size: 11px; color: var(--dim); margin-left: auto; }

.crit-card {
  margin-top: 20px; padding: 18px 20px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--bg-soft);
}
.crit-card h5 {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--dim); margin: 0 0 10px; font-weight: 500;
}
.crit-row { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13.5px; }
.crit-row:last-child { border-bottom: 0; }
.crit-row .state { flex: 0 0 auto; font-family: var(--font-mono); font-size: 10.5px; padding: 2px 8px; border-radius: var(--r-pill); }
.crit-row .state.hit { color: var(--ok); background: var(--ok-soft); }
.crit-row .state.miss { color: var(--warn); background: var(--warn-soft); }
.crit-row .state.crit { color: var(--bad); background: var(--bad-soft); }
.crit-row .why { color: var(--muted); font-size: 12.5px; margin-top: 3px; }

/* ============================ модалка / тосты ============================ */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 5, 7, 0.72); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 24px;
  animation: fadeIn 0.16s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(520px, 100%);
  background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); padding: 26px;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9);
  animation: popIn 0.18s var(--ease);
}
.modal.wide { width: min(720px, 100%); }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 19px; margin-bottom: 10px; }
.modal p { color: var(--text-2); font-size: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.modal .checklist { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.modal .checklist li { display: flex; gap: 9px; font-size: 13.5px; color: var(--text-2); margin: 0; }
.modal .checklist li::before { content: '✓'; color: var(--accent); font-family: var(--font-mono); }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 10px; max-width: 360px; }
.toast {
  background: var(--panel-2); border: 1px solid var(--line-strong);
  border-left: 2px solid var(--accent); border-radius: var(--r-md);
  padding: 12px 16px; font-size: 13.5px; color: var(--text-2);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8);
  animation: slideIn 0.2s var(--ease);
}
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
.toast.bad { border-left-color: var(--bad); }
.toast b { color: var(--text); display: block; margin-bottom: 2px; font-size: 13.5px; }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* выпадающее меню добавления вкладки */
.menu {
  position: absolute; z-index: 80; min-width: 240px;
  background: var(--panel-2); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); padding: 6px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.85);
  animation: popIn 0.14s var(--ease);
}
.menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: var(--r-sm); background: none;
  color: var(--text-2); font: 400 13.5px var(--font-ui); cursor: pointer; text-align: left;
}
.menu button:hover { background: var(--panel-3); color: var(--text); }
.menu button .k { font-family: var(--font-mono); font-size: 10px; color: var(--dim); margin-left: auto; }
.menu .menu-sep { height: 1px; background: var(--line); margin: 5px 0; }

/* ============================ диагностика ============================ */

.assess-intro { max-width: 780px; margin: 0 auto; padding: 48px 0 80px; }
.competency-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 20px 0 28px; }
.competency-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel);
}
.competency-item .ci-ico {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto;
  display: grid; place-items: center; font-family: var(--font-mono); font-size: 11px;
  background: var(--panel-3); border: 1px solid var(--line); color: var(--accent);
}
.competency-item .ci-name { font-size: 13.5px; font-weight: 600; }
.competency-item .ci-desc { font-size: 12.5px; color: var(--muted); }

.quiz-shell { max-width: 820px; margin: 0 auto; padding: 32px 0 80px; }
.quiz-top { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.quiz-top .progress-bar { flex: 1; }
.quiz-counter { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.quiz-card { padding: 30px; }
.quiz-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.quiz-q { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 22px; line-height: 1.4; }
.quiz-q .ctx { display: block; font-size: 14px; font-weight: 400; color: var(--muted); margin-top: 10px; line-height: 1.6; }
.options { display: grid; gap: 9px; }
.option {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg-soft); cursor: pointer; transition: all 0.14s var(--ease);
  font-size: 14px; color: var(--text-2);
}
.option:hover { border-color: var(--line-strong); background: var(--panel-2); color: var(--text); }
.option[data-selected="true"] { border-color: rgba(211, 242, 106, 0.5); background: var(--accent-soft); color: var(--text); }
.option .key {
  flex: 0 0 24px; width: 24px; height: 24px; border-radius: 6px;
  border: 1px solid var(--line-strong); display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11px; color: var(--muted); background: var(--panel);
}
.option[data-selected="true"] .key { border-color: var(--accent); color: var(--accent); background: rgba(211, 242, 106, 0.12); }
.quiz-nav { display: flex; gap: 10px; align-items: center; margin-top: 24px; }
.quiz-nav .spacer { margin-left: auto; }
.quiz-dots { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; }
.quiz-dots button {
  width: 22px; height: 22px; border-radius: 5px; padding: 0;
  border: 1px solid var(--line); background: var(--panel);
  font: 400 10px var(--font-mono); color: var(--dim); cursor: pointer;
}
.quiz-dots button[data-answered="true"] { background: var(--accent-soft); border-color: rgba(211, 242, 106, 0.35); color: var(--accent); }
.quiz-dots button[data-current="true"] { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 2px var(--accent-soft); }

/* результаты */
.result-hero { padding: 40px 0 28px; }
.level-card {
  display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center;
  padding: 28px; border: 1px solid rgba(211, 242, 106, 0.3);
  background: linear-gradient(120deg, rgba(211, 242, 106, 0.07), var(--panel) 55%);
  border-radius: var(--r-xl);
}
.level-ring {
  width: 132px; height: 132px; border-radius: 99px; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--panel-3) 0);
  position: relative;
}
.level-ring::after {
  content: ''; position: absolute; inset: 8px; border-radius: 99px;
  background: var(--panel); border: 1px solid var(--line);
}
.level-ring .val { position: relative; z-index: 1; text-align: center; }
.level-ring .val b { font-family: var(--font-mono); font-size: 30px; display: block; line-height: 1; }
.level-ring .val span { font-family: var(--font-mono); font-size: 10px; color: var(--dim); letter-spacing: 0.08em; }

.competency-bars { display: grid; gap: 14px; }
.cbar .top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.cbar .name { font-size: 13.5px; font-weight: 550; }
.cbar .pct { margin-left: auto; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.cbar .track { height: 7px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.cbar .track i { display: block; height: 100%; border-radius: 99px; transition: width 0.7s var(--ease); }
.cbar .verdict { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.cbar[data-tier="strong"] .track i { background: var(--ok); }
.cbar[data-tier="ok"] .track i { background: var(--info); }
.cbar[data-tier="weak"] .track i { background: var(--warn); }
.cbar[data-tier="bad"] .track i { background: var(--bad); }
.cbar[data-tier="strong"] .pct { color: var(--ok); }
.cbar[data-tier="weak"] .pct { color: var(--warn); }
.cbar[data-tier="bad"] .pct { color: var(--bad); }

.plan-item {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--panel); margin-bottom: 9px;
}
.plan-item .n { font-family: var(--font-mono); font-size: 11px; color: var(--dim); }
.plan-item .t { font-size: 14px; font-weight: 550; }
.plan-item .s { font-size: 12.5px; color: var(--muted); }

/* ============================ админка ============================ */

.admin-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding: 24px 0 80px; align-items: start; }
.admin-nav { position: sticky; top: calc(var(--header-h) + 18px); display: grid; gap: 3px; }
.admin-nav button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border: 1px solid transparent; border-radius: var(--r-md);
  background: none; color: var(--muted); cursor: pointer; text-align: left;
  font: 500 13.5px var(--font-ui); transition: all 0.14s var(--ease);
}
.admin-nav button:hover { background: var(--panel); color: var(--text); }
.admin-nav button[aria-current="true"] { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.admin-nav button .k { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--dim); }

.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--dim); font-weight: 500; background: var(--panel-2);
}
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); color: var(--text-2); vertical-align: middle; }
.data-table tr:hover td { background: var(--panel-2); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .cell-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Админка: текст чуть светлее, чем в остальном интерфейсе */
.avatar {
  border-radius: 99px; background: var(--panel-3); border: 1px solid var(--line-strong);
  display: inline-grid; place-items: center; flex: 0 0 auto;
  font-family: var(--font-mono); color: var(--accent);
}.admin-layout .data-table td { color: #c6ccd4; }
.admin-layout .data-table td .dim,
.admin-layout .dim { color: #8d949d; }
.admin-layout .muted { color: #a2a9b3; }
html[data-theme="light"] .admin-layout .data-table td { color: var(--text-2); }
html[data-theme="light"] .admin-layout .dim { color: var(--dim); }
html[data-theme="light"] .admin-layout .muted { color: var(--muted); }

.field { display: grid; gap: 7px; margin-bottom: 16px; }
.reference-editor { min-width: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.reference-tabs { display: flex; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.reference-tabs [role="tab"] { padding: 10px 18px; min-height: 44px; border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; color: var(--muted); cursor: pointer; font: 500 13px var(--font-ui); }
.reference-tabs [aria-selected="true"] { color: var(--text); background: var(--accent-soft); border-color: var(--line-strong); }
.reference-tabs [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.field .reference-editor textarea { border: 0; border-radius: 0; min-height: 280px; font: 12.5px/1.6 var(--font-mono); resize: vertical; }
.reference-preview { padding: 20px; min-height: 280px; overflow-wrap: anywhere; overflow-x: auto; }
.reference-preview h1, .reference-preview h2, .reference-preview h3 { color: var(--text); margin: 18px 0 10px; }
.reference-preview > :first-child { margin-top: 0; }
.reference-preview table { border-collapse: collapse; margin: 14px 0; }
.reference-preview td, .reference-preview th { border: 1px solid var(--line); padding: 8px 12px; }
.reference-preview pre { white-space: pre-wrap; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--text-2); letter-spacing: 0; }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea {
  padding: 11px 14px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r-md); color: var(--text); font: 400 14px/1.55 var(--font-ui);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
  width: 100%;
}
.field textarea { min-height: 80px; resize: vertical; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65; }
.field input::placeholder, .field textarea::placeholder { color: var(--dim); opacity: 1; }
.field input:not([type="checkbox"]):not([type="radio"]):hover, .field select:hover, .field textarea:hover { border-color: var(--line-strong); }
.field input:not([type="checkbox"]):not([type="radio"]):focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: rgba(211, 242, 106, 0.45); background: var(--panel);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
html[data-theme="light"] .field input:not([type="checkbox"]):not([type="radio"]):focus,
html[data-theme="light"] .field select:focus,
html[data-theme="light"] .field textarea:focus { border-color: rgba(77, 124, 15, 0.5); }

/* Аккордеон панелей (карточка задачи): клик по шапке сворачивает тело */
.acc > .panel-head { cursor: pointer; user-select: none; }
.acc > .panel-head::after {
  content: '▸'; font-family: var(--font-mono); color: var(--dim); margin-left: 8px; flex: 0 0 auto;
  transition: transform 0.18s var(--ease), color 0.18s var(--ease);
}
.acc[data-acc="open"] > .panel-head::after { transform: rotate(90deg); color: var(--accent); }
.acc[data-acc="closed"] > .panel-body { display: none; }

.switch {
  position: relative; width: 38px; height: 21px; border-radius: 99px;
  background: var(--panel-3); border: 1px solid var(--line-strong); cursor: pointer; flex: 0 0 auto;
  transition: all 0.16s var(--ease);
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px; border-radius: 99px; background: var(--dim);
  transition: all 0.16s var(--ease);
}
.switch[aria-checked="true"] { background: var(--accent-soft); border-color: rgba(211, 242, 106, 0.45); }
.switch[aria-checked="true"]::after { left: 19px; background: var(--accent); }

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.kpi { padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); }
.kpi .k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.kpi .v { font-family: var(--font-mono); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; }

/* ============================ диаграммы (превью mermaid/plantuml) ============================ */

.diagram-embed { background: #fcfcfd; border-radius: var(--r-md); padding: 16px; margin: 14px 0; overflow: auto; }
.diagram-embed svg { max-width: 100%; height: auto; }

/* ============================ адаптив ============================ */

@media (max-width: 1180px) {
  .task-thead, .task-row { grid-template-columns: 30px minmax(0, 1fr) 150px 90px; }
  .task-time { display: none; }
  .task-thead .th-time { display: none; }
}

@media (max-width: 1080px) {
  .hidden-mobile { display: none; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .grid-3, .pricing-grid { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .pane { min-height: 480px; }
  .catalog-layout { grid-template-columns: 1fr; }
  .filters { position: static; grid-template-columns: 1fr 1fr; display: grid; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { position: static; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); display: grid; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cta-band { grid-template-columns: 1fr; padding: 32px; }
}

@media (max-width: 860px) {
  .main-nav { display: none; }
  .main-nav.open {
    display: flex; position: absolute; top: var(--header-h); left: 0; right: 0; z-index: 70;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--panel); border-bottom: 1px solid var(--line);
    padding: 10px 16px 16px; margin-left: 0;
  }
  .main-nav.open a { padding: 10px 12px; }
  .main-nav.open a[aria-current="page"]::after { display: none; }
  /* На узком экране обе строки начинаются от одного края; меню открывается под всей шапкой. */
  .site-header { height: auto; }
  .site-header .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; padding-top: 10px; padding-bottom: 10px; }
  .site-header .brand { grid-column: 1; grid-row: 1; justify-self: start; }
  .burger { display: inline-flex; grid-column: 2; grid-row: 1; }
  .header-actions { grid-column: 1 / -1; grid-row: 2; margin-left: 0; justify-content: flex-start; flex-wrap: wrap; }
  .main-nav.open { top: 100%; }
  .grid-3, .grid-2, .pricing-grid, .collections-grid, .ra-cols, .rp-agents, .competency-grid { grid-template-columns: 1fr; }
  .diagram-split { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(220px, 1fr) minmax(220px, 1fr); }
  .code-area { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .level-card { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .section { padding: 56px 0; }
  .hero { padding: 44px 0; }
  .task-thead { display: none; }
  .task-row { grid-template-columns: 26px minmax(0, 1fr); gap: 10px; }
  .task-rate, .task-tags { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .verdict-top { flex-direction: column; gap: 12px; }
  .pane-head .actions { width: 100%; margin-left: 0; }
  /* На телефоне все вкладки и добавление видны без скрытой прокрутки вправо.
     Длинное название переносится внутри кнопки; меню остаётся отдельной
     областью нажатия и не сжимается вместе с текстом. */
  .tabs-bar { flex-wrap: wrap; overflow-x: visible; }
  .tab-group { flex: 0 1 auto; min-width: 0; max-width: 100%; }
  .tab { flex: 1 1 auto; min-width: 0; min-height: 44px; white-space: normal; text-align: left; }
  .tab .kind { flex: 0 0 auto; }
  .tab > span:last-child { min-width: 0; overflow-wrap: anywhere; }
  .tab-actions { flex: 0 0 36px; min-height: 44px; }
  .tab-add { min-height: 44px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .site-header .wrap { gap: 8px 10px; padding-top: 8px; padding-bottom: 8px; }
  /* Длинная кнопка подборки («Начать подборку → <название>») переносится,
     а не уезжает за правый край карточки. */
  .collection-foot { flex-wrap: wrap; }
  .collection-foot .btn { white-space: normal; text-align: left; line-height: 1.45; }
  .header-actions { gap: 6px; }
  .header-actions .btn { padding: 8px 12px; min-height: 36px; font-size: 13px; }
  .grid-4 { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .filters { grid-template-columns: 1fr; }
  .cta-band { padding: 24px; }
  .quiz-card { padding: 20px; }
}

@media print {
  .site-header, .site-footer, .tabs-bar, .editor-toolbar, .solution-foot, .toasts { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ============================================================
   Светлая тема: включается атрибутом <html data-theme="light">.
   Выбор пользователя хранится в localStorage (sa-trainer:theme).
   Тёмные редакторы кода (.code-area, pre) оставлены тёмными
   осознанно — это привычный контраст рабочей области.
   ============================================================ */

html[data-theme="light"] {
  color-scheme: light;

  --bg: #f3f3ef;
  --bg-soft: #eaeae4;
  --panel: #ffffff;
  --panel-2: #f5f5f1;
  --panel-3: #e8e8e0;
  --line: #dddcd2;
  --line-soft: #e7e7de;
  --line-strong: #c9c9bc;

  --text: #181a1c;
  --text-2: #41474d;
  --muted: #687078;
  --dim: #9aa1a8;

  --accent: #4d7c0f;
  --accent-2: #65a30d;
  --accent-ink: #ffffff;
  --accent-soft: rgba(77, 124, 15, 0.1);

  --violet: #7c3aed;
  --violet-soft: rgba(124, 58, 237, 0.1);

  --ok: #15803d;
  --ok-soft: rgba(21, 128, 61, 0.1);
  --warn: #b45309;
  --warn-soft: rgba(180, 83, 9, 0.12);
  --bad: #dc2626;
  --bad-soft: rgba(220, 38, 38, 0.08);
  --info: #2563eb;
  --info-soft: rgba(37, 99, 235, 0.1);

  --lvl-easy: #15803d;
  --lvl-medium: #b45309;
  --lvl-hard: #dc2626;
}

html[data-theme="light"] body::before {
  background:
    radial-gradient(900px 420px at 78% -8%, rgba(77, 124, 15, 0.1), transparent 62%),
    radial-gradient(700px 380px at 8% 0%, rgba(124, 58, 237, 0.08), transparent 60%);
}

html[data-theme="light"] body::after {
  background-image: radial-gradient(rgba(20, 24, 20, 0.07) 1px, transparent 1px);
  opacity: 0.6;
}

html[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.86);
}

html[data-theme="light"] .btn-primary:hover {
  box-shadow: 0 8px 30px -10px rgba(77, 124, 15, 0.5);
}

html[data-theme="light"] .brand-mark {
  box-shadow: 0 0 20px -6px rgba(77, 124, 15, 0.5);
}

html[data-theme="light"] .mock-window {
  box-shadow: 0 40px 90px -50px rgba(30, 35, 20, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

html[data-theme="light"] .float-card.fc-1 {
  border-color: rgba(77, 124, 15, 0.4);
}

html[data-theme="light"] .cta-band {
  background:
    radial-gradient(600px 260px at 88% 0%, rgba(77, 124, 15, 0.12), transparent 60%),
    var(--panel);
}

html[data-theme="light"] .chip-accent {
  border-color: rgba(77, 124, 15, 0.4);
}

html[data-theme="light"] .tag-filter[aria-pressed="true"] {
  border-color: rgba(77, 124, 15, 0.5);
}

html[data-theme="light"] .tag-filter[aria-pressed="true"] .count {
  color: rgba(77, 124, 15, 0.75);
}

html[data-theme="light"] .tab[aria-selected="true"] .kind {
  border-color: rgba(77, 124, 15, 0.45);
}

html[data-theme="light"] .step-num {
  border-color: rgba(77, 124, 15, 0.4);
}

html[data-theme="light"] .price-card.popular {
  border-color: rgba(77, 124, 15, 0.5);
  background: linear-gradient(180deg, rgba(77, 124, 15, 0.07), var(--panel) 42%);
}

html[data-theme="light"] .option[data-selected="true"] {
  border-color: rgba(77, 124, 15, 0.55);
}

html[data-theme="light"] .option[data-selected="true"] .key {
  border-color: var(--accent);
}

html[data-theme="light"] .quiz-dots button[data-answered="true"] {
  border-color: rgba(77, 124, 15, 0.4);
}

html[data-theme="light"] .level-card {
  border-color: rgba(77, 124, 15, 0.35);
  background: linear-gradient(120deg, rgba(77, 124, 15, 0.08), var(--panel) 55%);
}

html[data-theme="light"] .editor-toolbar button[data-active="true"] {
  border-color: rgba(77, 124, 15, 0.4);
}

html[data-theme="light"] .snippet-btn:hover {
  border-color: rgba(77, 124, 15, 0.45);
}

html[data-theme="light"] .switch[aria-checked="true"] {
  border-color: rgba(77, 124, 15, 0.5);
}

/* ============================================================
   Серая тема «IDE» (в духе Darcula): компромисс между чёрной
   и белой. Тёмно-серый хром, приглушённый текст, акцент тот же
   лаймовый — бренд сохраняется во всех трёх темах.
   ============================================================ */

html[data-theme="gray"] {
  color-scheme: dark;

  --bg: #222427;
  --bg-soft: #1e2023;
  --panel: #292c30;
  --panel-2: #303338;
  --panel-3: #383c42;
  --line: #40444b;
  --line-soft: #33373d;
  --line-strong: #535963;

  --text: #c2c6cc;
  --text-2: #a6abb3;
  --muted: #979da6;
  --dim: #858b95;
}

html[data-theme="gray"] body::before {
  background:
    radial-gradient(900px 420px at 78% -8%, rgba(211, 242, 106, 0.09), transparent 62%),
    radial-gradient(700px 380px at 8% 0%, rgba(167, 139, 250, 0.09), transparent 60%);
}

html[data-theme="gray"] body::after {
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  opacity: 0.5;
}

html[data-theme="gray"] .site-header {
  background: rgba(34, 36, 39, 0.92);
}

/* ============================================================
   Хаб analystgym.ru — не сайт, а развилка: два полуэкрана,
   магнит-диагностика по центру. Без шапки и подвала.
   ============================================================ */

.hub { min-height: 100vh; display: flex; flex-direction: column; position: relative; overflow: clip; }

.hub-blob { position: fixed; z-index: 0; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(90px); opacity: 0.5; pointer-events: none; }
.hub-blob.b1 { left: -12vmax; top: -14vmax; background: radial-gradient(circle, rgba(211, 242, 106, 0.13), transparent 65%); animation: hubDrift 16s ease-in-out infinite alternate; }
.hub-blob.b2 { right: -14vmax; bottom: -16vmax; background: radial-gradient(circle, rgba(167, 139, 250, 0.13), transparent 65%); animation: hubDrift 20s ease-in-out infinite alternate-reverse; }
@keyframes hubDrift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(4vmax, 3vmax) scale(1.12); }
}

.hub-top {
  position: relative; flex: 0 0 auto; z-index: 8;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 30px; pointer-events: none;
}
.hub-top > * { pointer-events: auto; }

.hub-logo { display: flex; align-items: center; gap: 16px; }
.hub-logo img {
  flex: 0 0 auto;
  width: 76px; height: 76px; border-radius: 19px; display: block;
  box-shadow: 0 18px 44px -16px rgba(0, 0, 0, 0.85);
}
.hub-logo-fallback { width: 76px; height: 76px; border-radius: 19px; font-size: 22px; }
.hub-logo-text { display: flex; flex-direction: column; gap: 3px; }
.hub-logo-title { font-weight: 700; letter-spacing: -0.03em; font-size: 23px; line-height: 1.1; }
.hub-logo-sub { font-family: var(--font-mono); font-size: 11px; line-height: 1.45; letter-spacing: 0.08em; color: var(--muted); }

.hub-split { flex: 1 1 auto; display: flex; min-height: calc(100vh - 310px); position: relative; z-index: 1; }

.hub-half {
  flex: 1 1 0; min-width: 0; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  padding: 56px 54px 64px; text-decoration: none;
  transition: flex 0.55s var(--ease), background 0.3s var(--ease);
}
.hub-half:not(.hub-coming-soon):hover { flex: 1.45 1 0; }
.hub-half::after {
  content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity 0.4s var(--ease); pointer-events: none;
}
.hub-half:not(.hub-coming-soon):hover::after { opacity: 1; }
.hub-practice { border-right: 1px solid var(--line-soft); }
.hub-practice::after { background: radial-gradient(560px 340px at 70% 30%, rgba(211, 242, 106, 0.09), transparent 65%); }
.hub-courses::after { background: radial-gradient(560px 340px at 30% 30%, rgba(167, 139, 250, 0.12), transparent 65%); }
.hub-coming-soon { background: rgba(167, 139, 250, 0.035); }
.hub-coming-soon .hub-kicker, .hub-coming-soon .hub-go { color: var(--violet); }
.nav-coming-soon { color: var(--muted); font-size: 13px; }
.nav-coming-soon small { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; margin-left: 4px; }

.hub-kicker { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); margin-bottom: 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hub-title { font-size: clamp(44px, 5.6vw, 92px); line-height: 1; letter-spacing: -0.04em; font-weight: 700; margin-bottom: 20px; }
.hub-practice .hub-title .accent { color: var(--accent); }
.hub-courses .hub-title .accent { color: var(--violet); }
.hub-desc { color: var(--text-2); font-size: 16px; max-width: 44ch; margin-bottom: 26px; }
.hub-stats { display: flex; gap: 26px; flex-wrap: wrap; margin-bottom: 30px; }
.hub-stats .num { font-family: var(--font-mono); font-size: 24px; font-weight: 600; display: block; }
.hub-stats .lbl { font-size: 12px; color: var(--muted); }
.hub-go { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); transition: color 0.2s var(--ease); display: flex; align-items: center; gap: 10px; }
.hub-go .arrow { transition: transform 0.25s var(--ease); display: inline-block; }
.hub-half:not(.hub-coming-soon):hover .hub-go { color: var(--text); }
.hub-half:hover .hub-go .arrow { transform: translateX(8px); }
.hub-practice:hover .hub-go { color: var(--accent); }
.hub-courses .hub-go { color: var(--violet); }

.hub-strip {
  position: relative; z-index: 5;
  padding: 10px 0 30px;
}
.hub-strip-in {
  display: flex; align-items: center; gap: 28px;
  padding: 26px 28px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(211, 242, 106, 0.09), rgba(211, 242, 106, 0.02));
}
.hub-strip-title {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 6px;
}
.hub-strip p { margin: 0; color: var(--text-2); font-size: 14.5px; max-width: 70ch; }
.hub-strip .btn { margin-left: auto; flex: 0 0 auto; }

.hub-foot {
  display: flex; align-items: center; justify-content: center;
  padding: 14px 16px 20px; font-family: var(--font-mono); font-size: 11px; color: var(--dim);
}

@media (max-width: 860px) {
  .hub-split { flex-direction: column; min-height: 0; }
  .hub-half, .hub-half:hover { flex: 0 0 auto; padding: 36px 24px 44px; }
  .hub-top { padding: 20px 24px; border-bottom: 1px solid var(--line-soft); }
  .hub-title { font-size: clamp(34px, 8vw, 52px); }
  .hub-logo { gap: 10px; min-width: 0; }
  .hub-logo img, .hub-logo-fallback { width: 48px; height: 48px; border-radius: 13px; }
  .hub-logo-text { min-width: 0; }
  .hub-logo-title { font-size: 19px; }
  .hub-logo-sub { font-size: 10px; }
  .hub-practice { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .hub-strip-in { flex-direction: column; align-items: stretch; gap: 16px; }
  .hub-strip .btn { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hub-blob { animation: none; }
  .hub-half, .hub-half::after, .hub-go, .hub-go .arrow { transition: none; }
}

/* ============================ курсы ============================ */

.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 24px 0 80px; }

.course-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.course-card-top { padding: 24px 24px 18px; display: flex; gap: 16px; align-items: flex-start; }
.course-logo {
  flex: 0 0 52px; width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: #10130a;
  box-shadow: 0 10px 26px -12px rgba(0, 0, 0, 0.7);
}
.course-card h3 { font-size: 18px; margin-bottom: 6px; }
.course-card .tagline { color: var(--accent); font-size: 13px; font-weight: 550; margin-bottom: 8px; }
.course-card .desc { color: var(--text-2); font-size: 13.5px; }
.course-outcomes { list-style: none; padding: 0 24px; margin: 0 0 16px; display: grid; gap: 7px; }
.course-outcomes li { display: flex; gap: 9px; font-size: 13px; color: var(--text-2); margin: 0; }
.course-outcomes li::before { content: '✓'; color: var(--accent); font-family: var(--font-mono); flex: 0 0 auto; }
.course-meta {
  display: flex; gap: 14px; flex-wrap: wrap; padding: 0 24px 16px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--dim);
}
.course-meta b { color: var(--text-2); font-weight: 500; }
.course-foot {
  margin-top: auto; padding: 16px 24px;
  border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 14px; background: var(--bg-soft);
}
.course-price { font-family: var(--font-mono); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.course-price-old { font-family: var(--font-mono); font-size: 13px; color: var(--dim); text-decoration: line-through; }
.course-price-free { font-family: var(--font-mono); font-size: 15px; color: var(--ok); font-weight: 600; }
.course-foot .btn { margin-left: auto; }

/* страница курса: сайдбар уроков + контент */
.learn-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; padding: 24px 0 80px; align-items: start; }
.learn-side { position: sticky; top: calc(var(--header-h) + 18px); display: grid; gap: 14px; grid-template-rows: auto minmax(0, 1fr); max-height: calc(100vh - var(--header-h) - 36px); }
.learn-course { padding: 18px; display: flex; gap: 14px; align-items: center; }
a.learn-course { text-decoration: none; color: inherit; transition: border-color 0.15s var(--ease); }
a.learn-course:hover { border-color: var(--line-strong); }
a.learn-course:hover h3 { color: var(--accent); }
.learn-course .course-logo { flex-basis: 44px; width: 44px; height: 44px; font-size: 13px; border-radius: 11px; }
.learn-course h3 { font-size: 15.5px; }
.learn-lessons { padding: 8px; overflow-y: auto; min-height: 0; }
.lesson-link {
  display: flex; gap: 11px; align-items: flex-start; width: 100%;
  padding: 10px 12px; border-radius: var(--r-md); border: 1px solid transparent;
  background: none; color: var(--text-2); cursor: pointer; text-align: left;
  font: 400 13.5px var(--font-ui); transition: all 0.14s var(--ease);
  text-decoration: none;
}
.lesson-link:hover { background: var(--panel-2); color: var(--text); }
.lesson-link[data-current="true"] { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.lesson-num {
  flex: 0 0 24px; width: 24px; height: 24px; border-radius: 7px;
  border: 1px solid var(--line-strong); display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); background: var(--panel);
}
.lesson-link[data-done="true"] .lesson-num { background: var(--ok-soft); border-color: rgba(61, 220, 151, 0.4); color: var(--ok); }
.lesson-link[data-locked="true"] { opacity: 0.62; }
.lesson-link[data-locked="true"] .lesson-num { color: var(--dim); }
.lesson-link .lt { font-weight: 550; font-size: 13.5px; line-height: 1.4; }
.lesson-link .lm { font-family: var(--font-mono); font-size: 10.5px; color: var(--dim); margin-top: 3px; }
.lesson-link .lock { margin-left: auto; color: var(--dim); font-size: 12px; flex: 0 0 auto; }

.learn-main { min-width: 0; }
.learn-body { padding: 26px 28px 36px; font-size: 15px; color: var(--text-2); }
.learn-body h3 { color: var(--text); font-size: 17px; margin: 22px 0 10px; }
.learn-body h3:first-child { margin-top: 0; }
.learn-body p { margin-bottom: 13px; }
.learn-body ul, .learn-body ol { margin-bottom: 14px; }
.learn-body strong { color: var(--text); }
.learn-body code {
  background: var(--panel-3); border: 1px solid var(--line);
  padding: 1px 5px; border-radius: 4px; font-size: 12.5px; color: var(--accent);
}
.learn-nav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 16px 28px; border-top: 1px solid var(--line-soft); background: var(--bg-soft); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.learn-nav .spacer { margin-left: auto; }

.paywall { padding: 48px 32px; text-align: center; }
.paywall .lock-big {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 18px;
  display: grid; place-items: center; font-size: 22px;
  background: var(--panel-3); border: 1px solid var(--line-strong); color: var(--muted);
}
.paywall h3 { font-size: 20px; margin-bottom: 10px; }
.paywall p { color: var(--text-2); font-size: 14px; max-width: 52ch; margin: 0 auto 20px; }

@media (max-width: 1080px) {
  .course-grid { grid-template-columns: 1fr 1fr; }
  .learn-layout { grid-template-columns: 1fr; }
  .learn-side { position: static; max-height: none; }
}
@media (max-width: 860px) {
  .course-grid { grid-template-columns: 1fr; }
  .learn-body { padding: 20px 18px 28px; }
  .learn-nav { padding: 14px 18px; }
}

/* ---------- модули курса и секции урока (контент из output/) ---------- */

.module-group { border-bottom: 1px solid var(--line-soft); }
.module-group:last-child { border-bottom: 0; }
.module-group summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px; }
.module-group summary::-webkit-details-marker { display: none; }
.module-group summary::before { content: '▸'; color: var(--accent); font-family: var(--font-mono); transition: transform 0.18s var(--ease); flex: 0 0 auto; }
.module-group[open] summary::before { transform: rotate(90deg); }
.mg-title { font-size: 13px; font-weight: 600; flex: 1 1 auto; }
.mg-count { font-family: var(--font-mono); font-size: 10.5px; color: var(--dim); flex: 0 0 auto; }
.mg-count.done { color: var(--ok); }
.mg-body { padding: 0 4px 8px; }
.mg-section {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--dim); padding: 10px 12px 4px;
}

.section-h {
  font-size: 15px; margin: 28px 0 12px; color: var(--text);
  font-family: var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500;
  padding-top: 20px; border-top: 1px solid var(--line-soft);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.section-h:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.jump-btn {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 13px; border-radius: var(--r-pill);
  border: 1px solid rgba(61, 220, 151, 0.4);
  background: var(--ok-soft); color: var(--ok);
  font: 600 12px/1.5 var(--font-ui); letter-spacing: 0.01em; white-space: nowrap;
  transition: all 0.15s var(--ease);
}
.jump-btn:hover { background: rgba(61, 220, 151, 0.22); border-color: var(--ok); color: var(--text); }
.jump-btn[data-active="true"] { background: rgba(61, 220, 151, 0.28); border-color: var(--ok); color: var(--text); }

.learn-body h2 { font-size: 21px; margin: 6px 0 14px; letter-spacing: -0.01em; }

/* ---------- витрина артефактов ---------- */

.artifact-list { display: grid; gap: 10px; margin-top: 16px; }
.artifact-card {
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--panel); overflow: hidden;
  transition: border-color 0.15s var(--ease);
}
.artifact-card:hover { border-color: var(--line-strong); }
.artifact-card[open] { border-color: var(--line-strong); }
.artifact-card summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 13px;
  padding: 13px 15px;
}
.artifact-card summary::-webkit-details-marker { display: none; }
.artifact-ico {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; font-size: 17px;
  background: var(--panel-3); border: 1px solid var(--line); color: var(--accent);
}
.artifact-head { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.artifact-title { font-size: 14px; font-weight: 600; color: var(--text); }
.artifact-desc { font-size: 12.5px; color: var(--muted); }
.artifact-lines { font-size: 10.5px; white-space: nowrap; }
.artifact-chev {
  flex: 0 0 auto; color: var(--dim); font-family: var(--font-mono);
  transition: transform 0.18s var(--ease);
}
.artifact-card[open] .artifact-chev { transform: rotate(90deg); color: var(--accent); }
.artifact-body {
  border-top: 1px solid var(--line-soft); padding: 18px;
  background: var(--bg-soft); max-height: 560px; overflow: auto;
}
.artifact-body h2 { font-size: 18px; }
.artifact-body h3 { font-size: 15px; }
.learn-body h3 { font-size: 16.5px; margin: 22px 0 10px; }
.learn-body h4 { font-size: 14.5px; margin: 18px 0 8px; }
.learn-body table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13.5px; }
.learn-body th, .learn-body td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.learn-body th { background: var(--panel-2); color: var(--text); font-weight: 600; }
.learn-body pre {
  background: #0a0c0f; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px; overflow: auto; margin: 14px 0;
}
.learn-body pre code { background: none; border: 0; padding: 0; color: var(--text-2); font-size: 12.5px; }
.learn-body blockquote {
  margin: 14px 0; padding: 10px 16px; border-left: 2px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--text-2);
}
