/* ============ Центр тестирования колледжа — строгое оформление ============ */

:root {
  --accent: #1e4d40;
  --accent-dark: #143a2f;
  --accent-weak: #e5ece9;
  --ok: #1f6b3c;
  --ok-weak: #e7f0e9;
  --bad: #963028;
  --bad-weak: #f7eae8;
  --warn: #8a5a12;
  --warn-weak: #f6efe0;

  --radius: 3px;
  --radius-sm: 2px;
  --sans: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", "PT Serif", serif;
  --mono: "Cascadia Mono", Consolas, "Courier New", monospace;
}

html[data-theme="light"], html:not([data-theme="dark"]) {
  --bg: #f0eee8;
  --surface: #ffffff;
  --surface-2: #f7f5f0;
  --surface-3: #ece8e0;
  --border: #d9d3c8;
  --border-strong: #b8b1a3;
  --text: #211f1b;
  --text-2: #423e37;
  --muted: #6c655b;
}

html[data-theme="dark"] {
  --bg: #1a1917;
  --surface: #232120;
  --surface-2: #2a2826;
  --surface-3: #322f2c;
  --border: #3c3833;
  --border-strong: #524d46;
  --text: #e8e4dd;
  --text-2: #cac4ba;
  --muted: #968e83;

  --accent: #63a892;
  --accent-dark: #7cbca7;
  --accent-weak: #23302c;
  --ok: #5fa877;
  --ok-weak: #212b23;
  --bad: #d1746a;
  --bad-weak: #2f2220;
  --warn: #c79445;
  --warn-weak: #2d2619;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 700; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: .95rem; }
p { margin: 0 0 .9rem; }

.container { width: min(1200px, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(720px, 100% - 2rem); margin-inline: auto; }

.muted { color: var(--muted); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-1 { margin-top: .4rem; } .mt-2 { margin-top: .8rem; } .mt-3 { margin-top: 1.4rem; }
.mb-2 { margin-bottom: .8rem; } .mb-3 { margin-bottom: 1.4rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: .8rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grow { flex: 1; }
.hidden { display: none !important; }

/* ============ Верхняя полоса ============ */

.topbar { background: var(--accent-dark); color: #f2efe8; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 34px; }
.topbar-title { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; }
.topbar .header-tools { padding: 0; }
.topbar .switch { border-color: rgba(255, 255, 255, .28); }
.topbar .switch button { background: transparent; color: #ded9d0; }
.topbar .switch button + button { border-left-color: rgba(255, 255, 255, .28); }
.topbar .switch button:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.topbar .switch button.active { background: #f2efe8; color: var(--accent-dark); }

/* ============ Шапка ============ */

.header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: stretch; gap: 1.5rem; min-height: 56px; }

.logo { display: flex; align-items: center; gap: .6rem; font-weight: 700; padding: .5rem 0; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 32px; height: 32px; border-radius: var(--radius-sm); flex: none;
  display: grid; place-items: center; background: var(--accent); color: #fff;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.15; color: var(--text); }
.logo-text b { font-size: 1rem; font-family: var(--serif); }
.logo-text small { font-size: .68rem; font-weight: 400; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }

.nav-links { display: flex; align-items: stretch; margin-left: auto; }
.nav-link {
  display: flex; align-items: center; padding: 0 .8rem; font-size: .9rem;
  color: var(--text-2); border-bottom: 2px solid transparent;
}
.nav-link:hover { color: var(--accent); text-decoration: none; background: var(--surface-2); }
.nav-link.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.nav-links .btn { align-self: center; margin-left: .5rem; }

.header-tools { display: flex; align-items: center; gap: .4rem; padding: .5rem 0 .5rem .5rem; }

.switch { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.switch button {
  border: 0; background: var(--surface); color: var(--muted); cursor: pointer;
  font: inherit; font-size: .78rem; font-weight: 600; padding: .25rem .55rem;
}
.switch button + button { border-left: 1px solid var(--border); }
.switch button:hover { background: var(--surface-2); color: var(--text); }
.switch button.active { background: var(--accent); color: #fff; }

.burger { display: none; width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text); }

/* ============ Кнопки ============ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem 1rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--border-strong); }
.btn-outline:hover:not(:disabled) { background: var(--surface-2); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: var(--border); }
.btn-danger:hover:not(:disabled) { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-ok { background: var(--surface); color: var(--ok); border-color: var(--border); }
.btn-ok:hover:not(:disabled) { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-sm { padding: .28rem .6rem; font-size: .82rem; }
.btn-lg { padding: .65rem 1.3rem; font-size: .98rem; }
.btn-block { width: 100%; }

/* ============ Карточки и сетки ============ */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.card-tight { padding: .8rem .9rem; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  margin: -1.1rem -1.2rem 1rem; padding: .7rem 1.2rem; border-bottom: 1px solid var(--border);
  background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.card-tight .card-title { margin: -.8rem -.9rem .8rem; padding: .55rem .9rem; }
.card-title h3 { margin: 0; font-size: .8rem; font-family: var(--sans); font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }

.grid { display: grid; gap: .9rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .45rem;
  border-radius: var(--radius-sm); font-size: .78rem; font-weight: 600;
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text-2);
}
.badge-accent { background: var(--accent-weak); color: var(--accent); border-color: var(--accent); }
.badge-ok { background: var(--ok-weak); color: var(--ok); border-color: var(--ok); }
.badge-bad { background: var(--bad-weak); color: var(--bad); border-color: var(--bad); }
.badge-warn { background: var(--warn-weak); color: var(--warn); border-color: var(--warn); }

/* ============ Формы ============ */

.field { display: block; margin-bottom: .9rem; }
.field > span, .label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-2); margin-bottom: .3rem; }
.input, input[type="text"], input[type="password"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; padding: .45rem .6rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: .92rem; outline: none;
}
.input:focus, input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type="color"] { padding: .1rem; height: 34px; }
textarea { min-height: 76px; resize: vertical; }
select option { background: var(--surface); color: var(--text); }
.hint { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.form-error {
  background: var(--bad-weak); color: var(--bad); border: 1px solid var(--bad);
  padding: .5rem .7rem; border-radius: var(--radius-sm); font-size: .88rem; margin-bottom: .9rem;
}
.checkbox { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; font-size: .9rem; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ============ Вход и регистрация ============ */

.auth-wrap { display: grid; place-items: center; padding: 2.5rem 0 3rem; flex: 1; }
.auth-card { width: min(440px, 100%); }
.auth-card h1 { font-size: 1.3rem; margin-bottom: .2rem; }
.auth-card > p { font-size: .9rem; }
.auth-foot { text-align: center; margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--border);
  font-size: .88rem; color: var(--muted); }

.captcha-box { display: flex; gap: .5rem; align-items: flex-start; }
.captcha-img { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff;
  width: 240px; height: 80px; flex: none; cursor: pointer; }
.captcha-refresh {
  width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); cursor: pointer; display: grid; place-items: center;
}
.captcha-refresh:hover { color: var(--accent); border-color: var(--accent); }

/* ============ Главная ============ */

main { flex: 1; padding-bottom: 2.5rem; }

.hero { background: var(--surface); border-bottom: 1px solid var(--border); padding: 2.2rem 0 1.8rem; margin-bottom: 1.8rem; }
.hero-grid { display: block; max-width: 820px; margin-inline: auto; text-align: center; }
.hero h1 { font-size: 2.1rem; margin-bottom: .6rem; }
.hero p { color: var(--text-2); max-width: 62ch; margin-inline: auto; }
.hero-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.2rem; justify-content: center; }
.hero-stats { display: flex; gap: 0; margin-top: 1.6rem; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; max-width: 560px; }
.hero-stat { flex: 1; padding: .7rem .9rem; background: var(--surface-2); }
.hero-stat + .hero-stat { border-left: 1px solid var(--border); }
.hero-stat b { display: block; font-size: 1.4rem; line-height: 1.2; }
.hero-stat span { font-size: .8rem; color: var(--muted); }
.hero-visual { display: none; }

.section { padding: 0 0 2rem; }
.section-head { margin-bottom: 1.1rem; padding-bottom: .5rem; text-align: center;
  border-bottom: 3px double var(--border-strong); }
.section-head h2 { font-size: 1.2rem; margin: 0; }
.section-head p { color: var(--muted); font-size: .9rem; margin: .2rem 0 0; }




/* ============ Предметы и тесты ============ */

.page-head { padding: 1.5rem 0 1.2rem; }
.page-head h1 { margin-bottom: .2rem; }
.page-head { border-bottom: 1px solid var(--border); margin-bottom: 1.2rem; text-align: center; }
.page-head .btn { float: left; }
.page-head p { color: var(--muted); margin: 0; font-size: .92rem; }



.progress { height: 6px; border-radius: 2px; background: var(--surface-3); overflow: hidden; border: 1px solid var(--border); }
.progress > div { height: 100%; background: var(--accent); }
.progress.ok > div { background: var(--ok); }
.progress.good > div { background: #3f9c5c; }
.progress.mid > div { background: var(--warn); }
.progress.bad > div { background: var(--bad); }

/* ============ Показатели и диаграммы ============ */


.spark { width: 100%; height: 84px; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.spark-area { fill: var(--accent-weak); stroke: none; }
.spark-dots circle { fill: var(--accent); }

.bars { display: flex; flex-direction: column; gap: .45rem; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 1.1fr) 3fr auto; gap: .6rem; align-items: center; font-size: .85rem; }
.bar-label { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 14px; background: var(--surface-3); border: 1px solid var(--border); border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); }
.bar-value { font-weight: 600; font-size: .82rem; min-width: 2.5rem; text-align: right; }

.cols { display: flex; align-items: flex-end; gap: .3rem; height: 160px; border-bottom: 1px solid var(--border); }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .2rem; min-width: 0; }
.col-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.col-bar { width: 100%; background: var(--accent); border-radius: 2px 2px 0 0; }
.col-value { font-size: .72rem; font-weight: 600; color: var(--muted); }
.col-label { font-size: .68rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.donut-wrap { position: relative; width: 120px; height: 120px; margin-inline: auto; }
.donut { transform: rotate(-90deg); width: 120px; height: 120px; }
.donut circle { fill: none; stroke-width: 10; }
.donut-bg { stroke: var(--surface-3); }
.donut-fill { stroke: var(--accent); }
.donut-fill.ok { stroke: var(--ok); } .donut-fill.good { stroke: #3f9c5c; }
.donut-fill.mid { stroke: var(--warn); } .donut-fill.bad { stroke: var(--bad); }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center b { font-size: 1.5rem; }
.donut-center span { font-size: .75rem; color: var(--muted); }

/* ============ Таблицы ============ */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
/* внутри карточки таблица не обводится второй рамкой, а идёт от края до края */
.card > .table-wrap,
.card > div > .table-wrap { border-left: 0; border-right: 0; border-radius: 0; margin: 0 -1.2rem -1.1rem; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 560px; }
th, td { padding: .45rem .7rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted);
  font-weight: 700; background: var(--surface-2); border-bottom: 1px solid var(--border-strong); }
td + td, th + th { border-left: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: var(--surface-2); }
tbody tr:hover { background: var(--accent-weak); }

.grade { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: .9rem; border: 1px solid; }
.grade-5 { background: var(--ok-weak); color: var(--ok); border-color: var(--ok); }
.grade-4 { background: var(--ok-weak); color: #3f7d4f; border-color: #3f7d4f; }
.grade-3 { background: var(--warn-weak); color: var(--warn); border-color: var(--warn); }
.grade-2 { background: var(--bad-weak); color: var(--bad); border-color: var(--bad); }

.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); font-size: .9rem; }
.empty svg { opacity: .3; margin-bottom: .5rem; }

/* ============ Прохождение теста ============ */

.quiz-top {
  padding: .6rem .9rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.quiz-title { font-weight: 700; font-size: .95rem; }
.quiz-sub { font-size: .8rem; color: var(--muted); }
.timer {
  display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .6rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border-strong);
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1rem; font-family: var(--mono);
}
.timer.warn { color: var(--warn); border-color: var(--warn); background: var(--warn-weak); }
.timer.danger { color: var(--bad); border-color: var(--bad); background: var(--bad-weak); }

.quiz-layout { display: grid; grid-template-columns: 1fr 230px; gap: 1rem; align-items: start; }
.q-card { padding: 1.2rem 1.4rem; }
.q-num { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.q-text { font-size: 1.05rem; font-weight: 600; margin: .4rem 0 1.1rem; line-height: 1.5; white-space: pre-line; }

.options { display: flex; flex-direction: column; gap: .4rem; }
.option {
  display: flex; align-items: flex-start; gap: .6rem; padding: .55rem .7rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  font: inherit; font-size: .93rem; text-align: left; width: 100%; color: var(--text); line-height: 1.45;
}
.option:hover:not(.locked) { border-color: var(--accent); background: var(--accent-weak); }
.option.selected { border-color: var(--accent); background: var(--accent-weak); }
.option.correct { border-color: var(--ok); background: var(--ok-weak); }
.option.wrong { border-color: var(--bad); background: var(--bad-weak); }
.option.locked { cursor: default; }
.opt-mark {
  width: 22px; height: 22px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  display: grid; place-items: center; font-size: .78rem; font-weight: 700; flex: none;
  color: var(--muted); background: var(--surface-2);
}
.option[data-kind="single"] .opt-mark { border-radius: 50%; }
.option.selected .opt-mark { background: var(--accent); border-color: var(--accent); color: #fff; }
.option.correct .opt-mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.option.wrong .opt-mark { background: var(--bad); border-color: var(--bad); color: #fff; }

.feedback { margin-top: 1rem; padding: .7rem .9rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
  border-left-width: 3px; font-size: .92rem; }
.feedback.good { background: var(--ok-weak); border-color: var(--border); border-left-color: var(--ok); }
.feedback.bad { background: var(--bad-weak); border-color: var(--border); border-left-color: var(--bad); }
.feedback b { display: block; margin-bottom: .2rem; }
.feedback .explain { font-size: .88rem; color: var(--text-2); }

.quiz-actions { display: flex; gap: .5rem; justify-content: space-between; margin-top: 1rem; flex-wrap: wrap; }

.qmap { padding: .8rem .9rem; }
.qmap h4 { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: .5rem; }
.qmap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(32px, 1fr)); gap: .25rem;
  max-height: 60vh; overflow-y: auto; }
.qmap-btn {
  aspect-ratio: 1; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2);
  color: var(--muted); font: inherit; font-weight: 600; font-size: .78rem; cursor: pointer;
}
.qmap-btn:hover { border-color: var(--accent); color: var(--accent); }
.qmap-btn.answered { background: var(--accent-weak); border-color: var(--accent); color: var(--accent); }
.qmap-btn.correct { background: var(--ok-weak); border-color: var(--ok); color: var(--ok); }
.qmap-btn.wrong { background: var(--bad-weak); border-color: var(--bad); color: var(--bad); }
.qmap-btn.current { outline: 2px solid var(--accent); outline-offset: -2px; font-weight: 800; }

.streak { display: inline-flex; align-items: center; gap: .3rem; font-weight: 700; color: var(--warn); font-size: .9rem; }

/* ============ Результат ============ */

.result-hero { text-align: center; padding: 1.6rem 1.2rem; }
.result-badge {
  display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .8rem; border-radius: var(--radius-sm);
  font-weight: 700; font-size: .9rem; margin-bottom: .8rem; border: 1px solid;
}
.result-badge.pass { background: var(--ok-weak); color: var(--ok); border-color: var(--ok); }
.result-badge.fail { background: var(--bad-weak); color: var(--bad); border-color: var(--bad); }
.result-hero h1 { font-size: 1.3rem; }
.result-figures { display: flex; gap: 0; justify-content: center; flex-wrap: wrap; margin-top: 1.2rem;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.figure { padding: .7rem 1.4rem; background: var(--surface-2); flex: 1; min-width: 130px; }
.figure + .figure { border-left: 1px solid var(--border); }
.figure b { display: block; font-size: 1.3rem; }
.figure span { font-size: .78rem; color: var(--muted); }

.review-item { padding: .9rem 1rem; margin-bottom: .6rem; border-left: 3px solid var(--border); }
.review-item.ok { border-left-color: var(--ok); }
.review-item.err { border-left-color: var(--bad); }
.review-q { font-weight: 600; margin: .3rem 0 .7rem; white-space: pre-line; line-height: 1.5; }
.answer-line { display: flex; gap: .5rem; align-items: flex-start; font-size: .9rem; padding: .2rem 0; }
.answer-line .tag { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: var(--muted); min-width: 115px; padding-top: .12rem; }
.answer-line.correct span:last-child { color: var(--ok); font-weight: 600; }
.answer-line.mine span:last-child { color: var(--bad); }
.explain-box { margin-top: .6rem; padding: .6rem .8rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); font-size: .88rem; color: var(--text-2); }

/* ============ Вкладки ============ */

.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1.2rem; overflow-x: auto; }
.tab {
  padding: .55rem .95rem; border: 0; background: transparent; color: var(--text-2); font: inherit;
  font-size: .9rem; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--accent); background: var(--surface-2); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ============ Модальные окна ============ */

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(20, 24, 30, .45);
  display: grid; place-items: center; padding: 1.5rem; }
.modal {
  width: min(720px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 1.2rem 1.3rem; box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
}
.modal h3 { margin-bottom: .9rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.modal-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem;
  padding-top: .8rem; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* ============ Уведомления ============ */

.toast-box { position: fixed; right: 1rem; bottom: 1rem; z-index: 200; display: flex; flex-direction: column; gap: .4rem; }
.toast {
  padding: .55rem .8rem; border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-left-width: 3px; font-size: .88rem; font-weight: 500;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12); max-width: 320px; opacity: 0;
}
.toast.show { opacity: 1; }
.toast-error { border-left-color: var(--bad); color: var(--bad); }
.toast-success { border-left-color: var(--ok); color: var(--ok); }

/* ============ Подвал ============ */

.footer { border-top: 1px solid var(--border); background: var(--surface); padding: .9rem 0; margin-top: auto; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  flex-wrap: wrap; font-size: .84rem; color: var(--muted); }
.footer .credit { font-style: italic; }

/* ============ Текстовая страница ============ */

.article { max-width: 68ch; margin-inline: auto; }
.article h2 { font-size: 1.15rem; margin-top: 1.6rem; padding-bottom: .25rem;
  border-bottom: 1px solid var(--border); }
.article h2:first-child { margin-top: 0; }
.article p { color: var(--text-2); }

/* ============ Загрузка ============ */

.skeleton { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); height: 80px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border);
  border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 2rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Адаптив ============ */

@media (max-width: 980px) {
  .quiz-layout { grid-template-columns: 1fr; }
  .qmap { order: -1; }
  .qmap-grid { max-height: none; }
}

@media (max-width: 760px) {
  .container, .narrow { width: min(100%, 100% - 1.4rem); }
  .header-inner { flex-wrap: wrap; position: relative; }
  .burger { display: grid; place-items: center; align-self: center; margin-left: auto; }
  .nav-links {
    display: none; width: 100%; flex-direction: column; align-items: stretch;
    border-top: 1px solid var(--border); margin: 0; padding-bottom: .4rem;
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: .55rem .2rem; border-bottom: 1px solid var(--border); border-left: 2px solid transparent; }
  .nav-link.active { border-bottom-color: var(--border); border-left-color: var(--accent); }
  .nav-links .btn { margin: .5rem .2rem 0; }
  .header-tools { order: 3; padding-left: 0; }
  .hero h1 { font-size: 1.5rem; }
  .hero-stats { flex-wrap: wrap; }
  .hero-stat { min-width: 33%; }
  .card { padding: .9rem 1rem; }
  .card-title { margin: -.9rem -1rem .8rem; padding: .6rem 1rem; }
  .q-card { padding: 1rem; }
  .q-text { font-size: 1rem; }
  .figure { min-width: 50%; }
}

/* ============ Таблицы-реестры и плотные блоки ============ */

th.num, td.num { text-align: right; }
td.num { font-variant-numeric: tabular-nums; }

.link-strong { font-weight: 600; color: var(--accent); }
.cell-note { font-size: .82rem; color: var(--muted); margin-top: .1rem; max-width: 52ch; }
tr.row-me { background: var(--accent-weak) !important; font-weight: 600; }
td .progress { margin: .2rem 0 .1rem; max-width: 130px; }

/* характеристики теста: подписи слева, значения справа */
table.props { min-width: 0; width: auto; border: 1px solid var(--border); background: var(--surface); }
table.props th { text-transform: none; font-size: .84rem; font-weight: 600; color: var(--muted);
  background: var(--surface-2); white-space: nowrap; width: 1%; }
table.props td { font-size: .9rem; }

/* строка показателей в кабинете */
.stat-strip { display: flex; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; flex-wrap: wrap; }
.stat-cell { flex: 1; min-width: 150px; padding: .6rem .8rem; }
.stat-cell + .stat-cell { border-left: 1px solid var(--border); }
.stat-cell b { display: block; font-size: 1.3rem; line-height: 1.25; }
.stat-cell span { font-size: .8rem; color: var(--muted); }

/* строка «действие + кнопка» */
.side-action { display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  padding: .6rem 0; }
.side-action + .side-action { border-top: 1px solid var(--border); }
.side-action b { font-size: .92rem; }
.side-action .muted { font-size: .82rem; }

/* список «возможностей» без карточек */
.deflist { margin: 0; border-top: 1px solid var(--border); }
.deflist dt { font-weight: 600; padding: .55rem .9rem .1rem; font-size: .92rem; }
.deflist dd { margin: 0; padding: 0 .9rem .55rem; color: var(--muted); font-size: .88rem; }
.deflist dt:not(:first-child) { border-top: 1px solid var(--border); margin-top: .1rem; padding-top: .6rem; }
.deflist { border-bottom: 1px solid var(--border); }
