/* ============================================================
   Sabaq — дизайн-система
   ============================================================ */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f8;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #8b95a7;
  --border: #e3e7ef;
  --border-strong: #cfd6e3;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef0ff;
  --primary-ink: #ffffff;
  --success: #047857;
  --success-soft: #e7f8f1;
  --warning: #b45309;
  --warning-soft: #fff6e6;
  --danger: #dc2626;
  --danger-soft: #fdeeee;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 6px 16px -6px rgba(15, 23, 42, .08);
  --shadow-lg: 0 20px 50px -12px rgba(15, 23, 42, .25);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --header-h: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --surface: #121a2c;
    --surface-2: #19233a;
    --text: #e8ecf5;
    --text-2: #a8b2c6;
    --text-3: #6f7b93;
    --border: #232e47;
    --border-strong: #33405e;
    --primary: #8b93ff;
    --primary-hover: #a3a9ff;
    --primary-soft: #1d2350;
    --primary-ink: #0b1020;
    --success: #4ade9b;
    --success-soft: #0f2e25;
    --warning: #f5b454;
    --warning-soft: #33260f;
    --danger: #f87171;
    --danger-soft: #3a1717;
    --shadow-sm: none;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.015em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- раскладка ---------- */
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.page { padding-top: 28px; padding-bottom: 96px; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }

/* ---------- шапка ---------- */
.app-header {
  position: sticky; top: 0; z-index: 30; height: var(--header-h);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.app-header .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--primary), #7c3aed); display: grid; place-items: center; color: #fff; }
.brand-mark svg { width: 17px; height: 17px; stroke: #fff; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand-role { font-weight: 500; color: var(--text-3); font-size: 14px; }
.user-menu { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 650; font-size: 13px; flex: none; }
.user-name { font-size: 14px; font-weight: 550; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- заголовок страницы ---------- */
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 14px; font-weight: 500; margin-bottom: 12px; }
.crumb:hover { color: var(--text); text-decoration: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head .sub { margin-top: 6px; color: var(--text-2); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }

/* ---------- карточки ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-body { padding: 20px; }
.card.interactive { transition: border-color .15s, box-shadow .15s, transform .15s; cursor: pointer; color: inherit; display: block; }
.card.interactive:hover { border-color: var(--border-strong); box-shadow: var(--shadow); text-decoration: none; transform: translateY(-1px); }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s; user-select: none;
  text-decoration: none !important; -webkit-tap-highlight-color: transparent;
}
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent); outline-offset: 1px; }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 1px 2px rgba(79, 70, 229, .25); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-icon { width: 36px; padding: 0; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- формы ---------- */
.field { display: block; }
.field + .field { margin-top: 14px; }
.label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.hint { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
.input, .textarea, .select {
  width: 100%; font: inherit; font-size: 15px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px 12px; min-height: 42px;
  transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.input-code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 22px; letter-spacing: .25em; text-transform: uppercase; text-align: center; font-weight: 700; height: 56px; }
.form-error { color: var(--danger); font-size: 13.5px; margin-top: 12px; min-height: 1px; }
.form-error:empty { display: none; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin: 0; }

/* сегментированный переключатель */
.segmented { display: inline-flex; background: var(--surface-2); padding: 4px; border-radius: 11px; gap: 4px; width: 100%; }
.segmented button { flex: 1; height: 34px; border: 0; background: transparent; color: var(--text-2); font: inherit; font-weight: 600; font-size: 14px; border-radius: 8px; cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* зона загрузки */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  border: 1.5px dashed var(--border-strong); border-radius: var(--r); padding: 28px 16px; background: var(--surface-2);
  cursor: pointer; transition: border-color .15s, background .15s; color: var(--text-2);
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .dz-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--surface); display: grid; place-items: center; color: var(--primary); box-shadow: var(--shadow); }
.dropzone strong { color: var(--text); }
.dropzone input { display: none; }
.file-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }

/* ---------- статусы и метки ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.no-dot::before { display: none; }
.pill.success { background: var(--success-soft); color: var(--success); }
.pill.warning { background: var(--warning-soft); color: var(--warning); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.primary { background: var(--primary-soft); color: var(--primary); }
.chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.score { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 8px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.score.good { background: var(--success-soft); color: var(--success); }
.score.mid { background: var(--warning-soft); color: var(--warning); }
.score.bad { background: var(--danger-soft); color: var(--danger); }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--warning-soft); color: var(--warning); font-size: 14px; margin-bottom: 20px; }
.banner strong { color: inherit; }
.banner .i { margin-top: 2px; }

/* ---------- статистика ---------- */
.stat { padding: 16px 18px; }
.stat .k { font-size: 13px; color: var(--text-2); font-weight: 500; }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ---------- списки ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--border); color: inherit; }
.list-item:first-child { border-top: 0; }
a.list-item:hover, .list-item.clickable:hover { background: var(--surface-2); text-decoration: none; cursor: pointer; }
.list-item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .meta { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.list-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.list-icon.success { background: var(--success-soft); color: var(--success); }
.list-icon.warning { background: var(--warning-soft); color: var(--warning); }
.chev { color: var(--text-3); }

.empty { text-align: center; padding: 36px 20px; color: var(--text-2); }
.empty .empty-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto 12px; color: var(--text-3); }
.empty h3 { color: var(--text); margin-bottom: 4px; }

/* ---------- класс ---------- */
.class-card .grade { width: 46px; height: 46px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 750; font-size: 16px; flex: none; }
.code-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--primary-soft); }
.code-value { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 26px; font-weight: 750; letter-spacing: .18em; color: var(--primary); }

/* ---------- таблицы ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 600; padding: 10px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.table td { padding: 14px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover td { background: var(--surface-2); }
.table th:first-child { border-top-left-radius: var(--r-lg); }
.table th:last-child { border-top-right-radius: var(--r-lg); }

/* ---------- задания ---------- */
.task-card { position: relative; }
.task-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.task-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 650; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.task-num { width: 26px; height: 26px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 13px; font-weight: 700; letter-spacing: 0; }
.task-prompt { font-size: 16px; line-height: 1.6; white-space: pre-wrap; margin-bottom: 16px; }
.option {
  display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 12px 14px; margin-top: 8px;
  border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer;
  transition: border-color .12s, background .12s; -webkit-tap-highlight-color: transparent; font-size: 15px;
}
.option:hover { border-color: var(--border-strong); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); flex: none; display: grid; place-items: center; transition: border-color .12s; }
.option .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); transform: scale(0); transition: transform .12s; }
.option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.option:has(input:checked) .radio { border-color: var(--primary); }
.option:has(input:checked) .radio::after { transform: scale(1); }
.option:has(input:focus-visible) { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
.word-count { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-3); margin-top: 8px; }

.opt-edit { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.opt-edit .correct-toggle { width: 36px; height: 36px; border-radius: 9px; border: 1.5px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: transparent; flex: none; }
.opt-edit .correct-toggle.on { background: var(--success); border-color: var(--success); color: #fff; }

/* результат */
.result-card { border-left: 4px solid var(--border); }
.result-card.ok { border-left-color: var(--success); }
.result-card.fail { border-left-color: var(--danger); }
.answer-box { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); white-space: pre-wrap; font-size: 15px; }
.verdict { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; font-weight: 550; }
.verdict.ok { color: var(--success); }
.verdict.fail { color: var(--danger); }
.criteria { display: grid; gap: 12px; margin: 16px 0; }
.criterion .top { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 6px; }
.criterion .top b { font-variant-numeric: tabular-nums; }
.meter { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 4px; background: var(--primary); }
.feedback-block { border-radius: 12px; padding: 14px 16px; margin-top: 12px; font-size: 14px; }
.feedback-block.good { background: var(--success-soft); }
.feedback-block.improve { background: var(--warning-soft); }
.feedback-block h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.feedback-block.good h4 { color: var(--success); }
.feedback-block.improve h4 { color: var(--warning); }
.feedback-block ul { margin: 0; padding-left: 18px; }
.feedback-block li + li { margin-top: 4px; }
.fix-old { text-decoration: line-through; color: var(--danger); }
.fix-new { color: var(--success); font-weight: 600; }

.score-hero { display: flex; align-items: center; gap: 20px; }
.ring { --p: 0; --c: var(--primary); width: 88px; height: 88px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring > div { width: 70px; height: 70px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 750; font-size: 20px; font-variant-numeric: tabular-nums; }

/* прогресс выполнения */
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 3px; transition: width .2s; }

/* нижняя панель действий */
.actionbar {
  position: sticky; bottom: 0; z-index: 20; margin-top: 24px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 16px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

/* ---------- модальное окно / нижний лист ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade .15s; }
.sheet { width: 100%; max-width: 720px; max-height: calc(100vh - 48px); overflow: auto; background: var(--bg); border-radius: 20px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.sheet.narrow { max-width: 440px; }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.sheet-body { padding: 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- уведомления ---------- */
.toasts { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: #111827; color: #fff; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); animation: pop .2s ease-out; }
.toast.error { background: var(--danger); }
.toast .i { color: #4ade80; }
.toast.error .i { color: #fff; }

/* ---------- скелетон загрузки ---------- */
.skeleton { border-radius: 10px; background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- авторизация ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: linear-gradient(150deg, #4338ca 0%, #6d28d9 60%, #7c3aed 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; right: -180px; bottom: -200px; background: radial-gradient(closest-side, rgba(255,255,255,.18), transparent); }
.auth-side .brand { color: #fff; }
.auth-side .brand-mark { background: rgba(255,255,255,.18); }
.auth-side h2 { font-size: 30px; line-height: 1.2; font-weight: 700; max-width: 420px; letter-spacing: -0.02em; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; position: relative; z-index: 1; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: rgba(255,255,255,.9); }
.auth-points .i { margin-top: 3px; color: #c4b5fd; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }

/* ---------- лендинг ---------- */
.hero { padding: 72px 0 56px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 13px; font-weight: 600; margin-bottom: 20px; }
.hero h1 { font-size: 48px; line-height: 1.08; letter-spacing: -0.035em; font-weight: 750; }
.hero h1 .accent { background: linear-gradient(90deg, var(--primary), #8b5cf6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 18px; color: var(--text-2); margin-top: 18px; max-width: 520px; line-height: 1.6; }
.hero .cta { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.mock { position: relative; }
.mock .card { box-shadow: var(--shadow-lg); }
.mock .floating { position: absolute; right: -14px; bottom: -22px; width: 230px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step .n { width: 36px; height: 36px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 750; margin-bottom: 14px; }
.step h3 { font-size: 16px; margin-bottom: 6px; }
.landing-section { padding: 40px 0; }
.landing-section > h2 { font-size: 26px; text-align: center; margin-bottom: 8px; }
.landing-section > p { text-align: center; color: var(--text-2); margin-bottom: 28px; }
.footer { border-top: 1px solid var(--border); padding: 24px 0; color: var(--text-3); font-size: 13px; }

/* ============================================================
   Адаптация
   ============================================================ */
@media (max-width: 960px) {
  .layout-2 { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 48px; }
  .mock .floating { right: 8px; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 720px) {
  .grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .container { padding: 0 16px; }
  .page { padding-top: 18px; padding-bottom: 120px; }
  h1 { font-size: 22px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 18px; }
  .page-head .actions .btn { width: 100%; }
  .user-name, .brand-role, .hide-xs, .hide-sm { display: none !important; }
  .grid.cols-2 > .field { margin: 0; }
  .card-pad, .card-body { padding: 16px; }
  .card-head { padding: 14px 16px; }
  .list-item { padding: 14px 16px; }
  .stat { padding: 12px; }
  .stat .k { font-size: 12px; }
  .stat .v { font-size: 20px; }
  .code-value { font-size: 22px; }
  .hero h1 { font-size: 34px; }
  .hero .lead { font-size: 16px; }
  .hero .cta .btn { flex: 1; }
  .mock .floating { position: static; width: auto; margin-top: 12px; }
  .inline-form > * { flex: 1 1 100%; }
  .inline-form .btn { width: 100%; }
  .task-prompt { font-size: 15.5px; }
  /* таблица превращается в карточки */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 14px 16px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
  .table tr:last-child { border-bottom: 0; }
  .table td { padding: 0; border: 0; }
  .table td.t-main { grid-column: 1; font-weight: 600; }
  .table td.t-score { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .table td.t-meta { grid-column: 1; color: var(--text-2); font-size: 13px; }
  .table td.t-action { display: none; }
  /* панель действий прилипает к низу экрана */
  .actionbar { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; border-radius: 18px 18px 0 0; border-width: 1px 0 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .actionbar .btn { flex: 1; }
  /* модальное окно становится нижним листом */
  .overlay { align-items: flex-end; padding: 0; }
  .sheet { max-height: 92vh; border-radius: 20px 20px 0 0; animation: slideup .22s ease-out; padding-bottom: env(safe-area-inset-bottom); }
  .sheet.narrow { max-width: none; }
  .toasts { bottom: calc(88px + env(safe-area-inset-bottom)); }
  .auth-main { align-items: flex-start; padding-top: 32px; }
}
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
