/* ============================================================
   ПрофМат — дизайн-система
   ============================================================ */
@import url('/css/fonts.css');

:root {
  --sidebar-w: 248px;
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Onest', ui-monospace, monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

:root[data-theme='dark'] {
  --bg: #0b1120;
  --bg-2: #0e1628;
  --surface: #17243a;
  --surface-hi: #1c2d47;
  --surface-2: #1c2d47;
  --surface-3: #223655;
  --surface-soft: rgba(23, 36, 58, .62);
  --border: rgba(148, 163, 184, .14);
  --border-strong: rgba(148, 163, 184, .24);
  --text: #f1f5f9;
  --text-2: #cbd5e1;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --blue: #3b82f6;
  --blue-2: #2563eb;
  --cyan: #38bdf8;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --violet: #8b5cf6;
  --pink: #f472b6;
  --shadow: 0 20px 45px -28px rgba(0, 0, 0, .85);
  --shadow-hover: 0 24px 55px -24px rgba(2, 8, 20, .9);
  --glow: 0 0 0 1px rgba(59, 130, 246, .25), 0 18px 40px -26px rgba(59, 130, 246, .55);
  --chart-grid: rgba(148, 163, 184, .12);
  --scroll: #24344f;
}

:root[data-theme='light'] {
  --bg: #f3f6fb;
  --bg-2: #e9eff8;
  --surface: #ffffff;
  --surface-hi: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #e2e8f0;
  --surface-soft: rgba(255, 255, 255, .8);
  --border: rgba(15, 23, 42, .09);
  --border-strong: rgba(15, 23, 42, .16);
  --text: #0f172a;
  --text-2: #1e293b;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --blue: #2563eb;
  --blue-2: #1d4ed8;
  --cyan: #0891b2;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --violet: #7c3aed;
  --pink: #db2777;
  --shadow: 0 18px 40px -30px rgba(15, 23, 42, .35);
  --shadow-hover: 0 22px 50px -28px rgba(15, 23, 42, .4);
  --glow: 0 0 0 1px rgba(37, 99, 235, .2), 0 18px 40px -28px rgba(37, 99, 235, .45);
  --chart-grid: rgba(15, 23, 42, .08);
  --scroll: #cbd5e1;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
:root[data-theme='dark'] body {
  background:
    radial-gradient(1100px 620px at 82% -12%, rgba(59, 130, 246, .18), transparent 60%),
    radial-gradient(900px 520px at -8% 8%, rgba(56, 189, 248, .09), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}
:root[data-theme='light'] body {
  background:
    radial-gradient(1000px 560px at 85% -15%, rgba(37, 99, 235, .10), transparent 60%),
    radial-gradient(800px 480px at -5% 10%, rgba(8, 145, 178, .07), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.015em; }
p { margin: 0; }
::selection { background: rgba(59, 130, 246, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 99px; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px);
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 14px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--blue), #1e40af);
  box-shadow: 0 10px 24px -12px rgba(59, 130, 246, .9), inset 0 1px 0 rgba(255,255,255,.25);
  color: #fff;
}
.brand-name { font-size: 18px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.brand-sub { font-size: 10.5px; color: var(--muted); margin-top: 3px; letter-spacing: .04em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); padding: 8px 12px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 11px;
  color: var(--muted); font-weight: 500; cursor: pointer;
  border: 1px solid transparent;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s;
  position: relative;
}
.nav-item:hover { color: var(--text); background: var(--surface-soft); }
.nav-item.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(59, 130, 246, .22), rgba(59, 130, 246, .05));
  border-color: rgba(59, 130, 246, .25);
}
.nav-item.active::before {
  content: ''; position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 4px 4px 0; background: var(--blue);
  box-shadow: 0 0 14px rgba(59, 130, 246, .9);
}
.nav-item svg { flex: none; opacity: .9; }
.nav-badge { margin-left: auto; font-size: 11px; color: var(--muted); background: var(--surface-3); border-radius: 99px; padding: 1px 7px; }

.sidebar-spacer { flex: 1; }
.goal-card {
  border: 1px solid var(--border); border-radius: 14px; padding: 13px;
  background: linear-gradient(160deg, rgba(59, 130, 246, .13), rgba(56, 189, 248, .03));
}
.goal-card .goal-top { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.goal-card .goal-title { font-weight: 650; margin-top: 7px; font-size: 13.5px; }
.goal-card .goal-score { display: flex; align-items: baseline; gap: 5px; margin-top: 4px; }
.goal-card .goal-score b { font-size: 22px; color: var(--text); }
.goal-card .goal-score span { color: var(--muted); font-size: 12px; }
.sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted-2); font-size: 11.5px; padding: 0 4px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  backdrop-filter: blur(16px);
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.crumbs b { color: var(--text); font-size: 15px; font-weight: 650; }
.crumbs span.sep { opacity: .5; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-soft); border: 1px solid var(--border);
  border-radius: 10px; padding: 7px 11px; min-width: 230px;
  color: var(--muted); transition: border-color .18s, box-shadow .18s;
}
.search:focus-within { border-color: rgba(59, 130, 246, .5); box-shadow: 0 0 0 3px rgba(59, 130, 246, .12); }
.search input { border: 0; background: transparent; color: var(--text); outline: 0; width: 100%; font-size: 13px; }
.search input::placeholder { color: var(--muted-2); }
.icon-btn {
  width: 36px; height: 36px; flex: none; border-radius: 10px;
  display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface-soft); color: var(--muted);
  cursor: pointer; transition: all .18s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.privacy-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--green);
  border: 1px solid rgba(34, 197, 94, .28); background: rgba(34, 197, 94, .08);
  padding: 5px 10px; border-radius: 99px; white-space: nowrap;
}
.avatar {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: linear-gradient(140deg, var(--blue), #7c3aed); color: #fff;
  border: 1px solid rgba(255,255,255,.16); cursor: pointer;
  box-shadow: 0 8px 20px -12px rgba(59, 130, 246, .8);
}

.content { padding: 26px 32px 56px; max-width: 1560px; width: 100%; margin: 0 auto; animation: rise .35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 25px; letter-spacing: -.03em; }
.page-head .sub { color: var(--muted); margin-top: 5px; font-size: 13.5px; }
.hello .eyebrow { color: var(--muted); font-size: 12.5px; letter-spacing: .02em; }
.hello h1 { margin-top: 3px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 14px; border-radius: 10px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; white-space: nowrap;
  transition: transform .16s var(--ease), box-shadow .16s, border-color .16s, background .16s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  border-color: rgba(59, 130, 246, .55); color: #fff;
  box-shadow: 0 12px 26px -16px rgba(59, 130, 246, .95), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:hover { box-shadow: 0 16px 30px -14px rgba(59, 130, 246, .9); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--red); border-color: rgba(239, 68, 68, .3); background: rgba(239, 68, 68, .08); }
.btn-danger:hover { background: rgba(239, 68, 68, .14); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .55; pointer-events: none; }

/* ---------- cards/grid ---------- */
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split-7-5 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.split-8-4 { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
.section { margin-top: 16px; }

.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-hi) 92%, transparent), var(--surface));
  box-shadow: var(--shadow);
  padding: 18px;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.card.lift:hover { transform: translateY(-2px); border-color: rgba(59, 130, 246, .3); box-shadow: var(--shadow-hover); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-title .dot { width: 6px; height: 6px; border-radius: 99px; background: var(--blue); box-shadow: 0 0 10px rgba(59,130,246,.9); }
.card-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.card-link { color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.card-link:hover { color: var(--blue); }

/* KPI */
.kpi { padding: 16px; overflow: hidden; }
.kpi::after {
  content: ''; position: absolute; right: -34px; top: -44px; width: 120px; height: 120px;
  border-radius: 50%; background: radial-gradient(circle, rgba(59,130,246,.16), transparent 70%);
  pointer-events: none;
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: rgba(59, 130, 246, .14); color: var(--blue); }
.kpi-label { color: var(--muted); font-size: 12px; margin-top: 12px; }
.kpi-value { font-size: 27px; font-weight: 750; letter-spacing: -.035em; margin-top: 2px; line-height: 1.15; }
.kpi-value small { font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.kpi-hint { color: var(--muted-2); font-size: 11.5px; margin-top: 5px; display: flex; align-items: center; gap: 5px; }
.trend { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; padding: 2px 6px; border-radius: 99px; }
.trend.up { color: var(--green); background: rgba(34, 197, 94, .1); }
.trend.down { color: var(--red); background: rgba(239, 68, 68, .1); }
.trend.flat { color: var(--muted); background: var(--surface-3); }

/* ---------- chart ---------- */
.chart-wrap { position: relative; height: 290px; }
.chart-wrap.sm { height: 210px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 600;
  padding: 5px 9px; border-radius: 6px; cursor: pointer; transition: all .15s;
}
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.chart-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
select.field, input.field, textarea.field {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 9px; padding: 7px 10px; font-size: 12.5px; font-family: inherit; outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
select.field:focus, input.field:focus, textarea.field:focus { border-color: rgba(59,130,246,.55); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
label.lbl { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; letter-spacing: .02em; }

/* ---------- bars ---------- */
.bar-row { display: grid; grid-template-columns: 46px 1fr 74px; align-items: center; gap: 10px; padding: 7px 0; }
.bar-row + .bar-row { border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.bar-num { font-size: 12px; color: var(--muted); font-weight: 600; }
.bar-num b { color: var(--text); font-size: 13px; }
.bar-track { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; position: relative; }
.bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .6s var(--ease); }
.bar-fill.good { background: linear-gradient(90deg, #16a34a, var(--green)); }
.bar-fill.mid { background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.bar-fill.bad { background: linear-gradient(90deg, #dc2626, var(--red)); }
.bar-fill.none { background: var(--surface-2); }
.bar-val { text-align: right; font-size: 12px; color: var(--text-2); }
.bar-val small { color: var(--muted-2); font-size: 10.5px; display: block; }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid color-mix(in srgb, var(--border) 65%, transparent); }
.list-item:first-child { border-top: 0; padding-top: 2px; }
.list-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); }
.list-main { min-width: 0; flex: 1; }
.list-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.list-side { text-align: right; flex: none; }

/* topic chips */
.topic { padding: 10px 0; border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.topic:first-child { border-top: 0; }
.topic-top { display: flex; align-items: center; gap: 8px; }
.topic-name { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.topic-meta .bar-track { flex: 1; }
.topic-pct { font-size: 12px; font-weight: 650; min-width: 38px; text-align: right; }
.topic-note { font-size: 11px; color: var(--muted-2); margin-top: 5px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; border-radius: 99px; padding: 3px 8px; border: 1px solid transparent; white-space: nowrap; }
.badge.green { color: var(--green); background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .22); }
.badge.red { color: var(--red); background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .22); }
.badge.amber { color: var(--amber); background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .22); }
.badge.blue { color: var(--cyan); background: rgba(56, 189, 248, .1); border-color: rgba(56, 189, 248, .22); }
.badge.violet { color: #a78bfa; background: rgba(139, 92, 246, .12); border-color: rgba(139, 92, 246, .25); }
.badge.gray { color: var(--muted); background: var(--surface-2); border-color: var(--border); }

/* ---------- progress ring ---------- */
.ring { --p: 0; --size: 132px; --track: var(--surface-3); width: var(--size); height: var(--size); border-radius: 50%; flex: none;
  background: conic-gradient(var(--ring-color, var(--blue)) calc(var(--p) * 1%), var(--track) 0);
  display: grid; place-items: center; position: relative;
  filter: drop-shadow(0 12px 26px rgba(59, 130, 246, .18));
}
.ring::before { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); }
.ring-inner { position: relative; text-align: center; }
.ring-value { font-size: 26px; font-weight: 750; letter-spacing: -.04em; line-height: 1; }
.ring-sub { font-size: 10.5px; color: var(--muted); margin-top: 4px; }

/* ---------- variant cards ---------- */
.variants-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 14px; }
.v-card { padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 12px; }
.v-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.v-card-title { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.v-card-meta { color: var(--muted); font-size: 11.5px; margin-top: 3px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.v-score { text-align: right; flex: none; }
.v-score b { font-size: 20px; letter-spacing: -.03em; }
.v-score span { color: var(--muted); font-size: 11.5px; }
.v-card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.v-mini { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.v-actions { display: flex; gap: 6px; margin-left: auto; }
.v-progress { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.v-progress i { display: block; height: 100%; border-radius: 99px; }
.group-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.group-title h2 { font-size: 16px; }
.group-title .hint { color: var(--muted); font-size: 12px; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }

/* ---------- filters ---------- */
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.chip-filter { border: 1px solid var(--border); background: var(--surface-soft); color: var(--muted); border-radius: 99px; padding: 6px 12px; font-size: 12px; cursor: pointer; transition: all .15s; }
.chip-filter:hover { color: var(--text); border-color: var(--border-strong); }
.chip-filter.active { color: #fff; background: linear-gradient(135deg, var(--blue), var(--blue-2)); border-color: rgba(59,130,246,.6); }
.filters .spacer { flex: 1; }

/* ---------- task grid ---------- */
.tasks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.tasks-part-label { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 8px; }
.tasks-part-label:first-of-type { margin-top: 4px; }
.tasks-part-label span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text); }
.tasks-part-label i { font-style: normal; font-size: 11px; color: var(--muted-2); }
.task-group-row td { background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 7px 10px !important; }
.task-group-row b { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.task-group-row span { font-size: 11px; color: var(--muted-2); margin-left: 6px; }
.task-chip {
  aspect-ratio: 1; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; cursor: pointer; transition: all .16s var(--ease); position: relative; overflow: hidden;
}
.task-chip:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.task-chip b { font-size: 15px; font-weight: 650; }
.task-chip span { font-size: 8.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.task-chip.correct { background: rgba(34, 197, 94, .13); border-color: rgba(34, 197, 94, .35); color: #bbf7d0; }
.task-chip.incorrect { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .34); color: #fecaca; }
.task-chip.partial { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .34); color: #fde68a; }
.task-chip.no_data, .task-chip.not_attempted { background: var(--surface-2); color: var(--muted); }
.task-chip.correct span, .task-chip.incorrect span, .task-chip.partial span { color: inherit; opacity: .8; }
:root[data-theme='light'] .task-chip.correct { color: #14532d; }
:root[data-theme='light'] .task-chip.incorrect { color: #7f1d1d; }
:root[data-theme='light'] .task-chip.partial { color: #78350f; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 0 10px 9px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: rgba(59, 130, 246, .05); }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl .right { text-align: right; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- mistake cards ---------- */
.mistake-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.mistake { border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px; padding: 12px; }
.mistake .m-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mistake .m-type { font-size: 12px; font-weight: 650; }
.mistake .m-count { font-size: 18px; font-weight: 750; color: var(--red); }
.mistake .m-note { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ---------- empty / skeleton ---------- */
.empty { padding: 34px 16px; text-align: center; color: var(--muted); }
.empty .empty-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto 10px; color: var(--muted); }
.empty h3 { font-size: 14px; color: var(--text); margin-bottom: 4px; }
.empty p { font-size: 12px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- modal / drawer ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(4, 9, 18, .68);
  backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .18s ease;
}
:root[data-theme='light'] .overlay { background: rgba(15, 23, 42, .35); }
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: min(760px, 100%); max-height: 90vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.7); padding: 22px;
  animation: pop .22s var(--ease);
}
.modal.wide { width: min(1080px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-head h3 { font-size: 18px; }
.modal-head p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

.drawer-overlay { position: fixed; inset: 0; z-index: 95; background: rgba(4,9,18,.55); backdrop-filter: blur(3px); display: flex; justify-content: flex-end; animation: fadeIn .16s; }
.drawer { width: min(430px, 100%); height: 100%; background: var(--surface); border-left: 1px solid var(--border-strong); padding: 22px; overflow: auto; animation: slideIn .22s var(--ease); }
@keyframes slideIn { from { transform: translateX(30px); opacity: .5; } }

/* forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.field { width: 100%; }
textarea.field { resize: vertical; min-height: 74px; }
.help { font-size: 11px; color: var(--muted-2); margin-top: 4px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: var(--text-2); }
.switch input { appearance: none; width: 36px; height: 20px; border-radius: 99px; background: var(--surface-3); position: relative; cursor: pointer; transition: background .15s; border: 1px solid var(--border); }
.switch input::after { content: ''; position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: transform .15s var(--ease); }
.switch input:checked { background: var(--blue); border-color: var(--blue); }
.switch input:checked::after { transform: translateX(16px); }

/* wizard */
.steps { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.step i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); font-size: 11px; font-style: normal; }
.step.active { color: var(--text); }
.step.active i { background: var(--blue); border-color: var(--blue); color: #fff; }
.step.done i { background: rgba(34,197,94,.15); border-color: rgba(34,197,94,.4); color: var(--green); }
.step-line { width: 26px; height: 1px; background: var(--border); }

.task-table input { width: 100%; }
.task-table td { padding: 6px 5px; }
.task-table .tnum { font-weight: 650; color: var(--muted); }
.status-pick { display: flex; gap: 4px; }
.status-pick button { border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); border-radius: 7px; padding: 4px 7px; font-size: 10.5px; cursor: pointer; }
.status-pick button.on-correct { background: rgba(34,197,94,.16); color: var(--green); border-color: rgba(34,197,94,.4); }
.status-pick button.on-incorrect { background: rgba(239,68,68,.16); color: var(--red); border-color: rgba(239,68,68,.4); }
.status-pick button.on-partial { background: rgba(245,158,11,.16); color: var(--amber); border-color: rgba(245,158,11,.4); }
.status-pick button.on-not_attempted { background: var(--surface-3); color: var(--text); }
.status-pick button.on-no_data { background: var(--surface-3); color: var(--text); }

.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: 13px; padding: 24px;
  text-align: center; color: var(--muted); cursor: pointer; transition: all .18s;
  background: var(--surface-2);
}
.dropzone:hover, .dropzone.drag { border-color: var(--blue); background: rgba(59,130,246,.06); color: var(--text); }
.file-pill { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 8px 10px; border-radius: 9px; }

/* ai blocks */
.ai-card { border-color: rgba(59, 130, 246, .27); background: linear-gradient(165deg, rgba(59,130,246,.10), var(--surface) 48%); }
.ai-head { display: flex; align-items: center; gap: 10px; }
.ai-orb { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(140deg, var(--blue), var(--violet)); color: #fff; box-shadow: 0 10px 24px -12px rgba(59,130,246,.9); }
.ai-section { margin-top: 14px; }
.ai-section h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 7px; }
.ai-section p { font-size: 13px; color: var(--text-2); }
.bullets { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.bullets li { font-size: 12.5px; color: var(--text-2); }
.bullets li::marker { color: var(--blue); }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* settings */
.settings-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 90px; }
.settings-nav button { text-align: left; border: 0; background: transparent; color: var(--muted); padding: 9px 11px; border-radius: 9px; font-size: 12.5px; cursor: pointer; }
.settings-nav button:hover { background: var(--surface-soft); color: var(--text); }
.settings-nav button.active { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-top: 1px solid var(--border); }
.setting-row:first-child { border-top: 0; }
.setting-row .s-main { min-width: 0; }
.setting-row .s-title { font-size: 13px; font-weight: 600; }
.setting-row .s-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* toast */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 240px; max-width: 360px; padding: 11px 13px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: 0 20px 40px -20px rgba(0,0,0,.8);
  display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; animation: pop .2s var(--ease);
}
.toast.success { border-color: rgba(34,197,94,.35); }
.toast.error { border-color: rgba(239,68,68,.4); }
.toast .t-icon { flex: none; margin-top: 1px; }
.toast.success .t-icon { color: var(--green); }
.toast.error .t-icon { color: var(--red); }

/* auth */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden;
}
.auth::before {
  content: ''; position: absolute; inset: -20% -10%;
  background:
    radial-gradient(600px 420px at 72% 18%, rgba(59,130,246,.22), transparent 60%),
    radial-gradient(520px 380px at 20% 80%, rgba(139,92,246,.15), transparent 60%);
  pointer-events: none;
}
.auth-grid {
  position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: linear-gradient(rgba(148,163,184,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.06) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 72%);
}
.auth-card {
  position: relative; width: min(420px, 100%); padding: 30px;
  background: linear-gradient(180deg, rgba(28,45,71,.75), rgba(23,36,58,.92));
  border: 1px solid var(--border-strong); border-radius: 20px;
  box-shadow: 0 40px 100px -40px rgba(0,0,0,.9);
  backdrop-filter: blur(20px);
}
:root[data-theme='light'] .auth-card { background: rgba(255,255,255,.92); }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.auth-title { font-size: 22px; letter-spacing: -.03em; }
.auth-sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.auth-form { margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 42px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 7px; }
.pw-toggle:hover { color: var(--text); background: var(--surface-3); }
.auth-error { display: none; color: var(--red); font-size: 12px; background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.25); padding: 8px 10px; border-radius: 9px; }
.auth-error.show { display: block; }
.auth-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 7px; color: var(--muted-2); font-size: 11px; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* mobile */
.mobile-nav { display: none; }
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split-7-5, .split-8-4 { grid-template-columns: 1fr; }
}
@media (max-width: 1080px) {
  :root { --sidebar-w: 76px; }
  .brand { justify-content: center; padding: 4px 0 14px; }
  .brand-text, .nav-item span, .nav-label, .goal-card, .sidebar-foot span, .nav-badge { display: none; }
  .nav-item { justify-content: center; padding: 11px; }
  .nav-item.active::before { left: -16px; }
  .topbar { padding: 12px 20px; }
  .content { padding: 22px 20px 48px; }
  .search { min-width: 170px; }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(16px);
    border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 9.5px; padding: 5px 8px; border-radius: 8px; }
  .mobile-nav a.active { color: var(--blue); background: rgba(59,130,246,.1); }
  .content { padding: 18px 14px 84px; }
  .topbar { padding: 10px 14px; gap: 10px; }
  .search { display: none; }
  .privacy-pill { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
  .page-head h1 { font-size: 21px; }
  .modal { padding: 16px; }
  .chart-wrap { height: 240px; }
  .card { padding: 14px; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 22px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .top-actions .icon-btn { width: 34px; height: 34px; }
  .hide-xs { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ============================================================
   Компоненты страниц
   ============================================================ */

/* --- уведомления / баннеры --- */
.alert {
  display: flex; align-items: center; gap: 11px;
  border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--surface-2); color: var(--text-2);
  padding: 12px 14px; font-size: 12.5px;
  margin-bottom: 16px; line-height: 1.5;
}
.alert svg { flex: none; }
.alert > div { flex: 1; min-width: 0; }
.alert .btn { flex: none; }
.alert.amber { border-color: rgba(245, 158, 11, .35); background: rgba(245, 158, 11, .09); color: #fde68a; }
.alert.amber svg { color: var(--amber); }
.alert.amber b { color: #fef3c7; }
:root[data-theme='light'] .alert.amber { color: #78350f; }
:root[data-theme='light'] .alert.amber b { color: #78350f; }
.alert.red { border-color: rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .09); }

/* --- сверка результата: выбор «оставить / применить» --- */
.alert.review-alert { align-items: flex-start; }
.review-item {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; padding: 10px 12px; margin-top: 8px;
  border: 1px solid rgba(245, 158, 11, .28); border-radius: 10px;
  background: rgba(0, 0, 0, .16);
}
:root[data-theme='light'] .review-item { background: rgba(255, 255, 255, .55); border-color: rgba(180, 83, 9, .28); }
.review-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.review-title { font-weight: 600; font-size: 12.5px; color: inherit; }
.review-title:hover { text-decoration: underline; }
.review-nums { font-size: 12px; color: var(--muted); }
.review-nums b { color: var(--text); }
.review-btns { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 560px) { .review-btns { width: 100%; } .review-btns .btn { flex: 1; } }

/* --- строки заданий (dashboard) --- */
.taskbars { display: flex; flex-direction: column; }
.taskbar {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) 58px;
  align-items: center; gap: 14px; padding: 9px 8px; margin: 0 -8px;
  border-radius: 10px; cursor: pointer; transition: background .15s;
}
.taskbar + .taskbar { border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.taskbar:hover { background: rgba(59, 130, 246, .06); }
.taskbar:focus-visible { outline: 2px solid rgba(59, 130, 246, .5); outline-offset: 1px; }
.tb-left { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tb-left b { font-size: 13px; }
.tb-left span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-mid { min-width: 0; }
.tb-meta { font-size: 10.5px; color: var(--muted-2); margin-top: 4px; }
.tb-right { text-align: right; font-size: 13px; font-weight: 650; }

/* --- мини-заголовки и мини-статистика --- */
.mini-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); margin-bottom: 8px;
}
.mini-head.green { color: var(--green); }
.mini-head.red { color: var(--red); }
.mini-stat {
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 3px;
}
.mini-stat span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.mini-stat b { font-size: 16px; letter-spacing: -.02em; }

/* --- карта знаний / карточки тем --- */
.topics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.topic-card {
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
  padding: 13px; position: relative; overflow: hidden;
  transition: transform .18s var(--ease), border-color .18s;
}
.topic-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.tc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tc-head b { font-size: 13px; font-weight: 650; letter-spacing: -.01em; }
.tc-pct { font-size: 21px; font-weight: 750; letter-spacing: -.035em; margin-top: 8px; }
.tc-meta { font-size: 11px; color: var(--muted); margin-top: 8px; }
.tc-note {
  font-size: 11px; color: var(--muted-2); margin-top: 6px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* --- список AI-анализов --- */
.analyses-list { display: flex; flex-direction: column; gap: 12px; }
.ai-row { padding: 16px; }
.ai-row-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ai-row .badge { white-space: nowrap; }

/* --- подписи под графиком --- */
.chart-foot {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
  color: var(--muted-2); font-size: 11px; line-height: 1.5;
}

/* --- свёрнутое меню --- */
.shell.collapsed { --sidebar-w: 76px; }
.shell.collapsed .brand { justify-content: center; padding: 4px 0 14px; }
.shell.collapsed .brand-text,
.shell.collapsed .nav-item span,
.shell.collapsed .nav-label,
.shell.collapsed .goal-card,
.shell.collapsed .sidebar-foot span,
.shell.collapsed .nav-badge { display: none; }
.shell.collapsed .nav-item { justify-content: center; padding: 11px; }
.shell.collapsed .sidebar-foot { justify-content: center; }
.shell.collapsed #collapseBtn svg { transform: rotate(180deg); }

@media (max-width: 1080px) {
  .taskbar { grid-template-columns: 120px minmax(0, 1fr) 52px; gap: 10px; }
}
@media (max-width: 860px) {
  .taskbar { grid-template-columns: 1fr 52px; }
  .tb-mid { grid-column: 1 / -1; }
  .topics-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .taskbar { grid-template-columns: 1fr 46px; }
  .analyses-list .ai-row { padding: 13px; }
}
/* ============================================================
   Баллы: процент выполнения + тестовый балл ЕГЭ
   ============================================================ */
.v-format {
  flex: none; font-size: 11px; font-weight: 650; color: var(--text-2);
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 7px; padding: 3px 7px; white-space: nowrap;
}
.v-score-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.v-score-main { display: flex; align-items: baseline; gap: 7px; font-size: 25px; font-weight: 750; letter-spacing: -.04em; line-height: 1; }
.v-score-main .v-empty { color: var(--muted-2); }
.v-score-cap { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.v-secondary { text-align: right; line-height: 1.1; }
.v-secondary b { font-size: 15px; font-weight: 700; color: var(--violet); }
.v-secondary span { display: block; font-size: 9.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }

.score-badge { display: inline-flex; flex-direction: column; line-height: 1.2; }
.score-badge b { font-size: 13px; }
.score-badge i { font-style: normal; font-size: 11px; color: var(--muted); }
.score-badge em { font-style: normal; font-size: 10px; color: var(--muted-2); }
.score-badge.good b { color: var(--green); }
.score-badge.mid b { color: var(--blue); }
.score-badge.bad b { color: var(--red); }
.score-badge.none { color: var(--muted-2); font-size: 11px; }

/* ---------- hero варианта ---------- */
.grid.split-7-5, .grid.split-8-4 { align-items: start; }
.variant-hero { display: flex; flex-direction: column; gap: 18px; padding: 22px; }
.vh-main { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.vh-copy { flex: 1; min-width: 230px; display: flex; flex-direction: column; gap: 10px; }
.vh-badges { display: flex; gap: 7px; flex-wrap: wrap; }
.vh-score { display: flex; align-items: flex-end; gap: 26px; flex-wrap: wrap; }
.vh-secondary { display: flex; flex-direction: column; line-height: 1; }
.vh-secondary b { font-size: 38px; font-weight: 780; letter-spacing: -.05em; color: var(--violet); }
.vh-secondary span { font-size: 11px; color: var(--muted); margin-top: 5px; }
.vh-primary { display: flex; flex-direction: column; line-height: 1.15; padding-bottom: 2px; }
.vh-primary b { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.vh-primary span { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.vh-note { display: flex; align-items: center; gap: 5px; color: var(--muted-2); font-size: 11px; }
.vh-empty { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; }
.vh-parts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.vh-part { border: 1px solid var(--border); background: var(--surface-2); border-radius: 11px; padding: 12px 13px; }
.vh-part-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.vh-part-head span { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.vh-part-head i { font-style: normal; font-size: 10px; color: var(--muted-2); }
.vh-part-body { display: flex; align-items: baseline; gap: 8px; margin: 7px 0 8px; flex-wrap: wrap; }
.vh-part-body b { font-size: 17px; font-weight: 720; letter-spacing: -.02em; }
.vh-part-body span { font-size: 10.5px; color: var(--muted); }
.vh-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.vh-actions .btn { flex: 0 0 auto; }

/* ---------- фильтры ---------- */
.filters select.field { width: auto; min-width: 150px; }

/* ---------- KPI ---------- */
.kpis { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }

@media (max-width: 1080px) {
  .vh-parts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vh-part-meta { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .vh-main { gap: 16px; }
  .vh-secondary b { font-size: 32px; }
  .vh-parts { grid-template-columns: 1fr; }
  .vh-actions .btn { flex: 1; }
  .v-score-main { font-size: 22px; }
}

/* ---------- hero результата на главной ---------- */
.hero-result {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  gap: 26px; padding: 22px 24px; align-items: center;
  background:
    radial-gradient(720px 320px at 12% -10%, rgba(59, 130, 246, .16), transparent 65%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-hi) 94%, transparent), var(--surface));
}
.hero-main { display: flex; align-items: center; gap: 24px; min-width: 0; }
.hero-copy { min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.hero-label { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.hero-score-line { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.hero-secondary {
  font-size: 44px; font-weight: 800; letter-spacing: -.05em; line-height: 1;
  display: flex; align-items: baseline; gap: 9px;
}
.hero-secondary span {
  font-size: 12px; font-weight: 500; color: var(--muted);
  letter-spacing: 0; text-transform: none;
}
.hero-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 11.5px; }
.hero-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.hero-note { color: var(--muted-2); }
.hero-goal {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: 11.5px; font-weight: 600; color: var(--amber);
  background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .22);
  border-radius: 99px; padding: 4px 10px; margin-top: 2px;
}
.hero-goal.done { color: var(--green); background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .25); }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.hero-stat { background: var(--surface-2); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hero-stat > span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.hero-stat > b { font-size: 19px; font-weight: 730; letter-spacing: -.03em; line-height: 1.2; }
.hero-stat > i { font-style: normal; font-size: 10.5px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1180px) {
  .hero-result { grid-template-columns: 1fr; gap: 18px; }
  .hero-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .hero-main { flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero-secondary { font-size: 38px; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
}

/* колонка-стопка: карточки одна под другой без растягивания соседней */
.col-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.col-stack > .card { margin: 0; }

/* ============================================================
   Спецификация ЕГЭ-2027
   ============================================================ */
.spec-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; border-radius: 14px;
  border: 1px solid var(--border);
  background:
    linear-gradient(90deg, rgba(139, 92, 246, .10), transparent 46%),
    var(--surface);
  transition: border-color .18s var(--ease), transform .18s var(--ease);
}
.spec-banner:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.spec-banner-mark {
  width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: rgba(139, 92, 246, .14); color: var(--violet);
}
.spec-banner-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.spec-banner-main b { font-size: 13px; font-weight: 650; }
.spec-banner-main span { font-size: 11.5px; color: var(--muted); }
.spec-banner-parts { display: flex; gap: 18px; margin-left: auto; }
.spec-banner-parts span { display: flex; flex-direction: column; gap: 1px; }
.spec-banner-parts i {
  font-style: normal; font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-2);
}
.spec-banner-parts b { font-size: 14px; font-weight: 700; letter-spacing: -.02em; }
.spec-banner-link {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--violet); white-space: nowrap;
}

/* фиксированный формат в мастере */
.format-fixed { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.format-fixed > span:last-child { font-size: 11.5px; color: var(--muted); }

/* --- hero --- */
.sp-hero { padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.sp-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.sp-hero-title { max-width: 620px; }
.sp-kicker {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--violet);
}
.sp-hero-title h2 { font-size: 27px; letter-spacing: -.035em; margin-top: 8px; }
.sp-hero-title p { color: var(--muted); font-size: 12.5px; margin-top: 6px; max-width: 52ch; }
.sp-hero-nums { display: flex; gap: 26px; }
.sp-hero-nums div { display: flex; flex-direction: column; gap: 1px; }
.sp-hero-nums b { font-size: 26px; font-weight: 750; letter-spacing: -.04em; line-height: 1.1; }
.sp-hero-nums span { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-2); }

.sp-split { display: flex; flex-direction: column; gap: 10px; }
.sp-split-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-3); }
.sp-split-bar i { height: 100%; display: block; }
.sp-split-p1 { background: linear-gradient(90deg, var(--blue-2), var(--blue)); }
.sp-split-p2 { background: linear-gradient(90deg, var(--violet), var(--pink)); }
.sp-split-legend { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.sp-split-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.sp-split-legend b { color: var(--text); font-weight: 650; }
.sp-split-total { margin-left: auto; color: var(--muted-2); }
.sp-split-total b { color: var(--text); font-size: 13px; }
.dot { width: 7px; height: 7px; border-radius: 99px; display: inline-block; flex: none; }
.dot.p1 { background: var(--blue); }
.dot.p2 { background: var(--violet); }
.dot.th { background: var(--amber); }
.dot.mx { background: var(--green); }

/* --- таблицы частей --- */
.sp-part + .sp-part { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.sp-part-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.sp-part-head > div:first-child { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.sp-part-head b { font-size: 13px; font-weight: 650; }
.sp-part-head span { font-size: 11px; color: var(--muted-2); }
.sp-part-sum { display: inline-flex; align-items: baseline; gap: 4px; }
.sp-part-sum b { font-size: 16px; font-weight: 730; letter-spacing: -.03em; }
.sp-part-sum i { font-style: normal; font-size: 10.5px; color: var(--muted-2); }

.sp-table td { vertical-align: top; }
.sp-table tbody tr:hover { background: var(--surface-soft); }
.sp-topic { font-size: 12.5px; font-weight: 600; }
.sp-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.lvl {
  display: inline-block; font-size: 10px; font-weight: 600; border-radius: 99px;
  padding: 2px 7px; border: 1px solid transparent; white-space: nowrap;
}
.lvl-b { color: var(--green); background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .2); }
.lvl-p { color: var(--blue); background: rgba(59, 130, 246, .1); border-color: rgba(59, 130, 246, .2); }
.lvl-h { color: var(--amber); background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .22); }
.weight {
  display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px;
  border-radius: 6px; font-size: 12px; font-weight: 700;
  color: var(--text);
  background: color-mix(in srgb, var(--violet) calc(var(--w) * 26% + 8%), transparent);
  border: 1px solid color-mix(in srgb, var(--violet) calc(var(--w) * 30% + 10%), transparent);
}

/* --- критерии части 2 --- */
.sp-crits { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.sp-crit { border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px; padding: 14px; }
.sp-crit-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sp-crit-head b { font-size: 14px; font-weight: 700; letter-spacing: -.02em; }
.sp-crit-head span { font-size: 10.5px; color: var(--muted-2); }
.sp-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.sp-steps li { display: flex; gap: 9px; align-items: baseline; }
.sp-steps li b {
  flex: none; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center;
  font-size: 10.5px; background: var(--surface-3); color: var(--text-2);
}
.sp-steps li:first-child b { background: rgba(34, 197, 94, .16); color: var(--green); }
.sp-steps li span { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.sp-note { border-color: var(--border); background: var(--surface-2); color: var(--muted); font-size: 12px; }

/* --- шкала --- */
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 5px; }
.sc-cell {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 2px 5px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2);
}
.sc-cell i { font-style: normal; font-size: 9.5px; color: var(--muted-2); }
.sc-cell span { font-size: 12.5px; font-weight: 700; letter-spacing: -.02em; }
.sc-cell.is-threshold { border-color: rgba(245, 158, 11, .38); background: rgba(245, 158, 11, .09); }
.sc-cell.is-threshold span { color: var(--amber); }
.sc-cell.is-max { border-color: rgba(34, 197, 94, .38); background: rgba(34, 197, 94, .09); }
.sc-cell.is-max span { color: var(--green); }
.sc-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: 11px; color: var(--muted); }
.sc-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* --- пороги --- */
.sp-thresholds { display: flex; flex-direction: column; }
.sp-threshold { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.sp-threshold:first-child { border-top: 0; padding-top: 2px; }
.sp-threshold-main { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; }
.sp-threshold-main b { font-size: 24px; font-weight: 780; letter-spacing: -.045em; line-height: 1; color: var(--violet); }
.sp-threshold-main span { font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); margin-top: 3px; }
.sp-threshold-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sp-threshold-copy b { font-size: 12.5px; font-weight: 650; }
.sp-threshold-copy span { font-size: 11px; color: var(--muted); }

/* --- правила --- */
.sp-rules { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 11px; }
.sp-rules li { position: relative; padding-left: 16px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.sp-rules li::before {
  content: ''; position: absolute; left: 0; top: .52em; width: 5px; height: 5px;
  border-radius: 99px; background: var(--violet); opacity: .7;
}
.sp-rules b { color: var(--text); font-weight: 650; }

@media (max-width: 860px) {
  .sp-hero { padding: 18px; }
  .sp-hero-title h2 { font-size: 22px; }
  .sp-hero-nums { gap: 18px; }
  .sp-hero-nums b { font-size: 21px; }
  .spec-banner { flex-wrap: wrap; }
  .spec-banner-parts { margin-left: 50px; gap: 14px; }
  .spec-banner-link { margin-left: auto; }
}
@media (max-width: 560px) {
  .sp-split-total { margin-left: 0; }
  .sc-grid { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); }
  .spec-banner-parts { display: none; }
}
