/* ============================================================
   СДВГ у взрослых — самооценка проявлений
   Дизайн: спокойная тёплая нейтраль, минимум декора,
   максимум читаемости и удобства на мобильных.
   ============================================================ */

:root {
  --bg: #f6f4ef;
  --bg-deep: #efece4;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --surface-3: #f3f1ea;
  --ink: #1d2329;
  --ink-soft: #38414a;
  --muted: #667085;
  --muted-2: #8a919c;
  --line: #e3dfd6;
  --line-strong: #d3cec2;
  --accent: #0f766e;
  --accent-soft: #e6f4f1;
  --accent-ink: #0b5d57;
  --pos: #c2410c;
  --pos-soft: #fff1e8;
  --pos-line: #f5c6ab;
  --neg: #5b6b7c;
  --neg-soft: #eef2f6;
  --neg-line: #cbd6e2;
  --zero: #7b8494;
  --zero-soft: #f1f3f6;
  --danger: #b42318;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(29, 35, 41, .04), 0 10px 30px rgba(29, 35, 41, .05);
  --shadow-soft: 0 1px 2px rgba(29, 35, 41, .04);
  --topbar-h: 68px;
  --sidebar-w: 286px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 8% -10%, #fbf7ef 0%, rgba(251, 247, 239, 0) 62%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: var(--accent-ink); text-underline-offset: 3px; }

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.022em;
  font-weight: 720;
}

p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

:focus-visible {
  outline: 3px solid rgba(15, 118, 110, .38);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- Оболочка ---------- */

.shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  background: rgba(246, 244, 239, .88);
  border-bottom: 1px solid rgba(227, 223, 214, .8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 740;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex: 0 0 auto;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
}
.brand-sub {
  display: block;
  font-size: 11px;
  font-weight: 550;
  color: var(--muted);
  letter-spacing: .01em;
  line-height: 1.2;
}

.top-progress {
  flex: 1 1 auto;
  min-width: 120px;
  max-width: 460px;
  margin-left: 6px;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 5px;
  white-space: nowrap;
}
.progress-meta strong { color: var(--ink-soft); font-weight: 700; }
.progress {
  height: 6px;
  border-radius: 99px;
  background: #e7e3da;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), #2a9d8f);
  transition: width .18s ease;
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 15px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: #c4beb1; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.btn.primary:hover { background: #2b333b; border-color: #2b333b; }
.btn.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: rgba(29, 35, 41, .05); color: var(--ink); }
.btn.small { min-height: 34px; padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn.danger { color: var(--danger); border-color: #e7c4c0; background: #fff; }
.btn.danger:hover { background: #fff6f5; }

.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  cursor: pointer;
  color: var(--ink-soft);
}
.icon-btn:hover { background: var(--surface-2); }

.menu-btn { display: none; }

/* ---------- Раскладка ---------- */

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: start;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
}
.layout.no-sidebar { grid-template-columns: minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow: auto;
  padding: 20px 14px 40px 20px;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: #d8d3c8; border-radius: 99px; }

.side-group { margin-bottom: 20px; }
.side-group-title {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .11em;
  font-weight: 750;
  color: var(--muted-2);
  padding: 0 10px 7px;
}
.side-link {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13.5px;
  line-height: 1.25;
  border: 1px solid transparent;
}
.side-link:hover { background: var(--surface-2); }
.side-link.active {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  font-weight: 680;
}
.side-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.side-link.active .side-num { color: var(--accent); }
.side-name { min-width: 0; }
.side-count {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.side-link.has-progress .side-count { color: var(--accent-ink); font-weight: 700; }

.sidebar-foot {
  margin-top: 26px;
  padding: 14px 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.main {
  min-width: 0;
  padding: 30px 28px 80px;
}
.main.narrow { max-width: 980px; margin: 0 auto; }

/* ---------- Вступление ---------- */

.intro { max-width: 1000px; margin: 0 auto; padding: 34px 0 40px; }
.intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .01em;
  margin-bottom: 18px;
}
.intro-badge::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}
.intro h1 {
  font-size: clamp(34px, 5vw, 56px);
  max-width: 850px;
  margin-bottom: 18px;
}
.intro .lead {
  font-size: clamp(16.5px, 1.6vw, 19px);
  color: var(--ink-soft);
  max-width: 760px;
  line-height: 1.55;
}
.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 26px 0 8px;
}
.intro-actions .btn { min-height: 46px; padding: 11px 20px; font-size: 14.5px; }

.intro-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 18px 0 30px;
  color: var(--muted);
  font-size: 13px;
}
.intro-stats span { display: inline-flex; align-items: center; gap: 6px; }
.intro-stats b { color: var(--ink); font-weight: 700; }

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  gap: 16px;
  margin-top: 8px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-soft);
}
.card h2, .card h3 { font-size: 16px; margin-bottom: 10px; }
.card p { color: var(--ink-soft); font-size: 14.5px; }
.card p + p { margin-top: 10px; }

.instruction { border-left: 3px solid var(--accent); }
.instruction .quote {
  font-size: 15.5px;
  color: var(--ink);
  line-height: 1.6;
}
.instruction .quote p + p { margin-top: 9px; }

.legend-list { display: grid; gap: 8px; margin-top: 4px; }
.legend-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.legend-val {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: center;
  padding: 5px 0;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--ink);
}
.legend-val.pos { background: var(--pos-soft); color: var(--pos); }
.legend-val.neg { background: var(--neg-soft); color: var(--neg); }

.notice {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: #fffaf2;
  border: 1px solid #f0dfc4;
  color: #6b4a20;
  font-size: 13.5px;
  line-height: 1.55;
}
.notice strong { color: #4d3516; }

.resume-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  font-size: 13.5px;
  color: var(--muted);
}
.resume-banner b { color: var(--ink); }

/* ---------- Раздел с вопросами ---------- */

.section-head { margin-bottom: 20px; }
.eyebrow {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .11em;
  font-weight: 750;
  color: var(--accent-ink);
  margin-bottom: 9px;
}
.section-head h1 {
  font-size: clamp(27px, 3.6vw, 40px);
  margin-bottom: 10px;
  max-width: 900px;
}
.section-head .section-desc {
  color: var(--muted);
  font-size: 15px;
  max-width: 800px;
}
.section-hint {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.section-hint .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); }

.section-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.stat-pill b { color: var(--ink); font-weight: 700; }
.stat-pill.pos b { color: var(--pos); }
.stat-pill.neg b { color: var(--neg); }

.questions { display: grid; gap: 12px; }

.q {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 13px;
  box-shadow: var(--shadow-soft);
}
.q-main {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 32px;
  gap: 10px;
  align-items: start;
}
.q-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
  padding-top: 3px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.q-text {
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--ink);
  min-width: 0;
}
.q-reset {
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
}
.q-reset:hover { background: var(--surface-3); color: var(--ink); border-color: var(--line); }

.q-controls {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px 62px;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  padding-left: 48px;
}
.q-end {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted-2);
  text-align: center;
  user-select: none;
}
.q-value {
  justify-self: end;
  min-width: 56px;
  text-align: center;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  font-size: 13.5px;
  padding: 5px 8px;
  border-radius: 9px;
  background: var(--zero-soft);
  color: var(--zero);
}
.q-value.pos { background: var(--pos-soft); color: var(--pos); }
.q-value.neg { background: var(--neg-soft); color: var(--neg); }

/* ---------- Бегунок ---------- */

.slider-wrap {
  position: relative;
  height: 42px;
  display: flex;
  align-items: center;
  min-width: 0;
}
.slider-track {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 8px;
  transform: translateY(-50%);
  border-radius: 99px;
  background: #e7e3da;
  z-index: 0;
}
.slider-fill {
  position: absolute;
  top: 50%;
  height: 8px;
  transform: translateY(-50%);
  border-radius: 99px;
  width: 0;
  left: 50%;
  background: var(--pos);
  z-index: 1;
  pointer-events: none;
}
.slider-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 16px;
  transform: translate(-50%, -50%);
  border-radius: 2px;
  background: #b9b2a5;
  z-index: 2;
  pointer-events: none;
}
.slider-wrap input[type="range"] {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 42px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  touch-action: pan-y;
}
.slider-wrap input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  background: transparent;
  border-radius: 99px;
}
.slider-wrap input[type="range"]::-moz-range-track {
  height: 8px;
  background: transparent;
  border-radius: 99px;
}
.slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -9px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 1px 4px rgba(29, 35, 41, .2);
  transition: transform .08s ease, border-color .12s ease;
}
.slider-wrap input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 1px 4px rgba(29, 35, 41, .2);
}
.slider-wrap input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.08); }
.q-controls.pos .slider-wrap input[type="range"]::-webkit-slider-thumb { border-color: var(--pos); }
.q-controls.pos .slider-wrap input[type="range"]::-moz-range-thumb { border-color: var(--pos); }
.q-controls.neg .slider-wrap input[type="range"]::-webkit-slider-thumb { border-color: var(--neg); }
.q-controls.neg .slider-wrap input[type="range"]::-moz-range-thumb { border-color: var(--neg); }
.q-controls.pos .slider-fill { background: var(--pos); }
.q-controls.neg .slider-fill { background: var(--neg); }

.q.is-touched { border-color: #dcd7cb; }

.section-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.section-nav .nav-right { display: flex; gap: 8px; flex-wrap: wrap; }
.section-nav .nav-left { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Результаты ---------- */

.results { max-width: 1080px; margin: 0 auto; padding: 10px 0 40px; }

.result-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(22px, 4vw, 38px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.result-hero::after {
  content: "";
  position: absolute;
  right: -80px; top: -100px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15,118,110,.10), rgba(15,118,110,0) 68%);
  pointer-events: none;
}
.result-hero h1 { font-size: clamp(26px, 3.2vw, 36px); max-width: 700px; }
.result-hero .sub {
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
  max-width: 700px;
}
.score-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 18px 0 12px;
}
.score-num {
  font-size: clamp(56px, 10vw, 92px);
  font-weight: 780;
  letter-spacing: -0.05em;
  line-height: .95;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.score-max { font-size: 20px; color: var(--muted-2); font-weight: 650; }
.score-bar {
  height: 14px;
  border-radius: 99px;
  background: #ece8df;
  overflow: hidden;
  max-width: 760px;
}
.score-bar > span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #2a9d8f 0%, #e9a23b 62%, #c2410c 100%);
  transition: width .4s ease;
}
.score-note {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--muted);
  max-width: 760px;
}

.counts-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.count-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 15px;
  box-shadow: var(--shadow-soft);
}
.count-card .label { font-size: 11.5px; color: var(--muted); }
.count-card .num {
  font-size: 24px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
  letter-spacing: -0.02em;
}
.count-card.pos .num { color: var(--pos); }
.count-card.neg .num { color: var(--neg); }
.count-card.neu .num { color: var(--zero); }

.results h2 {
  font-size: 21px;
  margin: 34px 0 12px;
}
.results h2 .h2-note {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0;
  margin-left: 8px;
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.group-card.resources {
  background: linear-gradient(180deg, #f4faf8, #ffffff 70%);
  border-color: #cfe6e0;
}
.group-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}
.group-card .g-label { font-size: 12px; color: var(--muted); }
.group-card .g-score {
  font-size: 32px;
  font-weight: 760;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin: 4px 0 8px;
}
.group-card .g-meta { font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.group-card .bar { margin-top: 2px; }

.bar {
  height: 8px;
  border-radius: 99px;
  background: #ece8df;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #2a9d8f, #e9a23b 70%, #c2410c);
}

.rank-list {
  display: grid;
  gap: 8px;
}
.rank-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow-soft);
}
.rank-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
}
.rank-num {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.rank-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  min-width: 0;
}
.rank-score {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 750;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.rank-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.rank-meta .p { color: var(--pos); }
.rank-meta .n { color: var(--neg); }

.item-list { display: grid; gap: 8px; }
.item-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow-soft);
}
.item-val {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  text-align: center;
  padding: 4px 0;
  border-radius: 8px;
  background: var(--pos-soft);
  color: var(--pos);
}
.item-val.neg { background: var(--neg-soft); color: var(--neg); }
.item-val.zero { background: var(--zero-soft); color: var(--zero); }
.item-text { font-size: 14px; line-height: 1.45; color: var(--ink); }
.item-src { font-size: 11px; color: var(--muted-2); margin-top: 4px; }

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13.5px;
  background: rgba(255, 255, 255, .5);
}

details.neutral-details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
details.neutral-details > summary {
  cursor: pointer;
  padding: 14px 16px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink-soft);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
details.neutral-details > summary::-webkit-details-marker { display: none; }
details.neutral-details > summary::after {
  content: "+";
  font-size: 18px;
  color: var(--muted-2);
  font-weight: 400;
}
details.neutral-details[open] > summary::after { content: "−"; }
.neutral-body {
  padding: 0 14px 14px;
  max-height: 420px;
  overflow: auto;
}
.neutral-body .item-row { box-shadow: none; }

.interpretation {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 3vw, 26px);
  box-shadow: var(--shadow-soft);
}
.interpretation h2 { margin: 0 0 12px; font-size: 20px; }
.interpretation p { font-size: 14.5px; color: var(--ink-soft); line-height: 1.6; }
.interpretation p + p { margin-top: 10px; }
.interpretation ul { margin: 10px 0 0; padding-left: 20px; }
.interpretation li { font-size: 14.5px; color: var(--ink-soft); line-height: 1.55; margin-bottom: 5px; }
.interpretation .callout {
  margin-top: 14px;
  padding: 13px 15px;
  border-radius: 12px;
  background: #fffaf2;
  border: 1px solid #f0dfc4;
  color: #6b4a20;
  font-size: 13px;
  line-height: 1.55;
}

.disclaimer {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}
.disclaimer strong { color: var(--ink-soft); }

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.print-only { display: none; }

/* ---------- Все ответы ---------- */

.answers-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.answers-head h1 { font-size: clamp(26px, 3.4vw, 36px); }
.answers-head p { color: var(--muted); font-size: 13.5px; margin-top: 6px; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 18px;
}
.filter-btn {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  border-radius: 99px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
}
.filter-btn:hover { background: var(--surface-2); }
.filter-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.answer-section { margin-bottom: 18px; }
.answer-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}
.answer-section-head h2 { font-size: 16px; }
.answer-section-head .score {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.answer-section .item-list { gap: 6px; }
.answer-section .item-row { padding: 10px 12px; }

/* ---------- Тост ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  z-index: 300;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.noscript {
  max-width: 640px;
  margin: 60px auto;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

/* ---------- Мобильное меню ---------- */

.backdrop {
  display: none;
  position: fixed;
  inset: var(--topbar-h) 0 0;
  background: rgba(29, 35, 41, .32);
  z-index: 35;
}
.backdrop.show { display: block; }

/* ---------- Адаптив ---------- */

@media (max-width: 1080px) {
  :root { --sidebar-w: 250px; }
  .main { padding: 24px 20px 70px; }
  .q-controls { padding-left: 48px; }
}

@media (max-width: 860px) {
  :root { --topbar-h: 60px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-grid; }
  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    height: auto;
    width: min(310px, 86vw);
    z-index: 40;
    background: var(--bg);
    transform: translateX(-102%);
    transition: transform .2s ease;
    box-shadow: 20px 0 50px rgba(29, 35, 41, .12);
    padding-top: 18px;
  }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 22px 16px 70px; }
  .top-progress { max-width: none; margin-left: 0; }
  .top-actions .btn span.long { display: none; }
  .intro-grid { grid-template-columns: minmax(0, 1fr); }
  .group-grid { grid-template-columns: minmax(0, 1fr); }
  .counts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .q-controls {
    grid-template-columns: 30px minmax(0, 1fr) 30px 54px;
    padding-left: 0;
    margin-top: 12px;
  }
  .q-main { grid-template-columns: 34px minmax(0, 1fr) 30px; gap: 8px; }
  .q-text { font-size: 15px; }
}

@media (max-width: 620px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .brand-sub { display: none; }
  .brand span.brand-text { display: none; }
  .top-actions { gap: 6px; }
  .top-actions .btn { padding: 8px 10px; }
  .top-actions .btn.answers-btn { display: none; }
  .progress-meta { font-size: 10.5px; }
  .pm-label { display: none; }
  .pm-detail { display: none; }
  .top-progress { min-width: 40px; }
  .intro { padding-top: 22px; }
  .intro h1 { font-size: 34px; }
  .card { padding: 18px; }
  .q { padding: 14px 13px 11px; border-radius: 15px; }
  .q-text { font-size: 14.5px; }
  .q-value { min-width: 50px; font-size: 12.5px; }
  .q-end { font-size: 9.5px; }
  .score-num { font-size: 64px; }
  .section-nav { position: sticky; bottom: 0; background: rgba(246,244,239,.94); backdrop-filter: blur(10px); margin-left: -16px; margin-right: -16px; padding: 12px 16px; border-top: 1px solid var(--line); z-index: 20; }
  .section-nav .btn { flex: 1; }
  .section-nav .nav-left, .section-nav .nav-right { flex: 1; }
  .item-row { grid-template-columns: 46px minmax(0, 1fr); gap: 10px; }
  .rank-head { grid-template-columns: 28px minmax(0, 1fr) auto; }
}

@media (max-width: 380px) {
  .q-controls { grid-template-columns: 26px minmax(0, 1fr) 26px 48px; gap: 5px; }
  .q-value { min-width: 44px; padding: 4px 5px; }
}

/* ---------- Печать ---------- */

@media print {
  @page { margin: 14mm; }
  :root { --bg: #fff; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .topbar, .sidebar, .backdrop, .toast, .no-print, .section-nav, .result-actions { display: none !important; }
  .layout { display: block; }
  .main { padding: 0; max-width: none; }
  .results { max-width: none; padding: 0; }
  .print-only { display: block; margin-bottom: 14px; }
  .print-only h1 { font-size: 18pt; }
  .print-only p { color: #444; font-size: 9pt; }
  .result-hero, .count-card, .group-card, .rank-row, .item-row, .interpretation, .disclaimer, details.neutral-details {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
  .result-hero { padding: 18px; }
  .score-num { font-size: 48pt; }
  .results h2 { margin-top: 18px; }
  .rank-row, .item-row { page-break-inside: avoid; }
  .neutral-body { max-height: none; overflow: visible; }
  details.neutral-details { display: block; }
  details.neutral-details > summary { list-style: none; }
  details.neutral-details > summary::after { content: ""; }
  details.neutral-details .neutral-body { display: block !important; }
  .bar, .score-bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: #000; text-decoration: none; }
}

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