/* ================================================================
   shiny.vibetool — Шинный калькулятор
   Design tokens · base · layout · components
   ================================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Colors — light */
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --surface-2: #FBFCFD;
  --border: #E4E7EC;
  --border-strong: #D0D5DD;
  --text: #0F1724;
  --muted: #5B6472;
  --muted-2: #8A94A3;

  --primary: #1F5FFF;
  --primary-hover: #1749CC;
  --primary-soft: #EAF0FF;
  --primary-ink: #0E3BB8;

  /* Brand (shiny) — градиент для logotype: серебристый блик → primary → глубокий индиго */
  --brand-glow: #7FB4FF;
  --brand-deep: #0E3BB8;
  --brand-shine: linear-gradient(135deg, #7FB4FF 0%, #1F5FFF 45%, #0E3BB8 100%);

  --success: #12A150;
  --success-soft: #E3F6EC;
  --warning: #D97706;
  --warning-soft: #FDF2E0;
  --danger: #DC2626;
  --danger-soft: #FCE7E7;

  --cpa: #FF5A1F;
  --cpa-hover: #E64A13;
  --cpa-soft: #FFEDE3;

  /* Focus ring */
  --ring: 0 0 0 3px rgba(31, 95, 255, 0.28);

  /* Radii */
  --r-8: 8px;
  --r-12: 12px;
  --r-16: 16px;

  /* Spacing scale */
  --s-4: 4px;  --s-8: 8px;  --s-12: 12px; --s-16: 16px;
  --s-20: 20px; --s-24: 24px; --s-32: 32px; --s-48: 48px; --s-64: 64px;

  /* Type */
  --f-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Shadow */
  --sh-1: 0 1px 2px rgba(15, 23, 36, 0.04), 0 1px 1px rgba(15, 23, 36, 0.03);
  --sh-2: 0 1px 3px rgba(15, 23, 36, 0.06), 0 4px 12px rgba(15, 23, 36, 0.04);
  --sh-pop: 0 8px 28px rgba(15, 23, 36, 0.10);

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0E1117;
  --surface: #161B22;
  --surface-2: #1B2230;
  --border: #2A313C;
  --border-strong: #3A424F;
  --text: #E6EDF3;
  --muted: #9AA4B2;
  --muted-2: #6B7486;

  --primary: #4F86FF;
  --primary-hover: #6E9CFF;
  --primary-soft: #1A2444;
  --primary-ink: #C9D9FF;

  --brand-glow: #A9C8FF;
  --brand-deep: #2A58D6;
  --brand-shine: linear-gradient(135deg, #A9C8FF 0%, #4F86FF 45%, #2A58D6 100%);

  --success: #3DD68C;
  --success-soft: #0E2A1C;
  --warning: #FFB84D;
  --warning-soft: #2A1F0E;
  --danger: #F87171;
  --danger-soft: #2A1414;

  --cpa: #FF6A33;
  --cpa-hover: #FF8656;
  --cpa-soft: #2A1710;

  --ring: 0 0 0 3px rgba(79, 134, 255, 0.35);

  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-2: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
  --sh-pop: 0 8px 28px rgba(0, 0, 0, 0.5);

  color-scheme: dark;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1,h2,h3,h4,h5 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 24px; line-height: 1.25; letter-spacing: -0.02em; }
h2 { font-size: 20px; line-height: 1.3; }
h3 { font-size: 17px; line-height: 1.35; }
p  { margin: 0; }
a  { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
ul, ol { margin: 0; padding-left: 20px; }
table { border-collapse: collapse; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s-24) 0; }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 6px;
}

.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ---------- Layout ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: var(--s-16);
  padding: var(--s-12) var(--s-16);
  max-width: 1200px; margin: 0 auto;
}
/* ─── Brand logotype: Shiny VibeTool ─────────────────────────────── */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  text-decoration: none;
  transition: background-color 180ms ease, transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  isolation: isolate;
}
.brand:hover {
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  text-decoration: none;
}
.brand:active { transform: scale(0.98); }

.brand-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  position: relative;
  filter: drop-shadow(0 1px 2px color-mix(in srgb, var(--brand-deep) 28%, transparent));
  transition: transform 360ms cubic-bezier(0.16, 1, 0.3, 1);
}
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand:hover .brand-mark { transform: rotate(-18deg); }

.brand--lg .brand-mark { width: 36px; height: 36px; }

.brand-wordmark {
  font-family: var(--f-sans);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.015em;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}
.brand--lg .brand-wordmark { font-size: 18px; }

/* «Shiny» — цветовой акцент с глянцевым градиентом */
.brand-word-1 {
  background: var(--brand-shine);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  letter-spacing: -0.02em;
  position: relative;
}
/* Блик-shimmer, который пробегает по тексту при hover */
.brand-word-1::after {
  content: "Shiny";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg,
    transparent 30%,
    rgba(255, 255, 255, 0.85) 48%,
    transparent 66%);
  background-size: 220% 100%;
  background-position: 120% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  pointer-events: none;
  transition: background-position 700ms ease;
}
.brand:hover .brand-word-1::after {
  background-position: -20% 0;
}

/* «VibeTool» — плотный нейтральный */
.brand-word-2 {
  color: var(--text);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .brand-mark, .brand-word-1::after, .brand { transition: none; }
  .brand:hover .brand-mark { transform: none; }
}

.header-spacer { flex: 1; }

.header-nav { display: none; gap: var(--s-4); }
.header-nav a {
  color: var(--muted); font-size: 14px; font-weight: 500;
  padding: 6px 10px; border-radius: var(--r-8);
}
.header-nav a:hover { color: var(--text); background: var(--bg); text-decoration: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--r-8);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.icon-btn:hover { color: var(--text); background: var(--bg); border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; }

.offline-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 20%, transparent);
}
.offline-dot.off { background: var(--muted-2); box-shadow: none; }

/* Offline banner */
.offline-banner {
  display: flex; align-items: center; gap: var(--s-8);
  padding: 10px var(--s-16);
  background: var(--warning-soft); color: var(--text);
  border-bottom: 1px solid color-mix(in srgb, var(--warning) 30%, var(--border));
  font-size: 13px;
}
.offline-banner svg { width: 16px; height: 16px; color: var(--warning); flex-shrink: 0; }
.offline-banner strong { font-weight: 600; }

/* Main content */
.main {
  flex: 1;
  max-width: 1200px; width: 100%;
  margin: 0 auto;
  padding: var(--s-8) var(--s-16) var(--s-48);
}

.hero { margin-bottom: var(--s-24); }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--muted);
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  margin-bottom: var(--s-12);
}
.hero .eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.hero h1 {
  font-size: 26px; line-height: 1.22; letter-spacing: -0.02em;
  margin-bottom: var(--s-8);
}
.hero .lede { color: var(--muted); font-size: 15px; max-width: 640px; }

/* Tabs */
.tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-12);
  margin-bottom: var(--s-16);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 1 auto; min-width: fit-content;
  padding: 10px 12px;
  background: transparent; border: 0; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--muted);
  border-radius: var(--r-8);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.tab svg { width: 16px; height: 16px; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] {
  background: var(--primary-soft); color: var(--primary-ink); font-weight: 600;
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-16);
  box-shadow: var(--sh-1);
}
.card-pad { padding: var(--s-20); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-12);
  padding: var(--s-16) var(--s-20);
  border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 16px; }
.card-head .muted { color: var(--muted); font-size: 13px; }

/* Input form */
.form-section { margin-bottom: var(--s-16); }
.form-label-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  margin-bottom: var(--s-8);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.form-label-row .tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); color: var(--muted-2);
  font-size: 10px; font-weight: 700; cursor: help;
  border: 1px solid var(--border);
}

/* --- Tire diagram illustration --- */
.diagram {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-12);
  padding: var(--s-16);
  margin-bottom: var(--s-16);
  display: grid; grid-template-columns: 1fr; gap: var(--s-12);
}
.diagram svg { display: block; width: 100%; height: auto; max-height: 180px; }
.diagram .legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.diagram .legend span { display: inline-flex; align-items: center; gap: 6px; }
.diagram .legend .sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* --- Field with help tooltip --- */
.size-field { position: relative; }
.help-btn {
  position: absolute; top: 0; right: 0;
  width: 18px; height: 18px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted-2);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; font-family: var(--f-sans);
  cursor: help; padding: 0;
  transition: color .15s, border-color .15s;
}
.help-btn:hover, .help-btn:focus-visible { color: var(--primary); border-color: var(--primary); }
.help-pop {
  position: absolute; top: 22px; right: -4px; z-index: 10;
  width: 240px;
  background: var(--text); color: var(--surface);
  border-radius: var(--r-8);
  padding: 10px 12px;
  font-size: 12px; line-height: 1.5;
  box-shadow: var(--sh-pop);
  opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity .15s, transform .15s;
}
[data-theme="dark"] .help-pop { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.help-pop::before {
  content: ""; position: absolute; top: -5px; right: 8px;
  width: 10px; height: 10px;
  background: inherit; transform: rotate(45deg);
}
.help-btn:hover + .help-pop, .help-btn:focus-visible + .help-pop, .help-pop:hover {
  opacity: 1; transform: translateY(0); pointer-events: auto;
}
.help-pop strong { color: #fff; }
[data-theme="dark"] .help-pop strong { color: var(--text); }

/* --- Onboarding coach-mark --- */
.coach {
  position: relative;
  background: linear-gradient(180deg, var(--primary-soft), var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  border-radius: var(--r-12);
  padding: 12px 16px 12px 44px;
  margin-bottom: var(--s-12);
  font-size: 13px; color: var(--text); line-height: 1.5;
  display: flex; align-items: flex-start; gap: 8px;
}
.coach svg { position: absolute; left: 14px; top: 14px; width: 20px; height: 20px; color: var(--primary); }
.coach strong { color: var(--primary-ink); font-weight: 600; }
.coach-close {
  margin-left: auto; background: transparent; border: 0; color: var(--muted); cursor: pointer;
  font-size: 18px; line-height: 1; padding: 0 4px;
}
.coach-close:hover { color: var(--text); }
.coach.hidden { display: none; }
.size-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: var(--s-8);
}
.size-field { position: relative; }
.size-field label {
  display: block; font-size: 11px; color: var(--muted);
  margin-bottom: 4px; padding-left: 2px; text-transform: uppercase; letter-spacing: 0.04em;
}
.size-field .prefix {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2); font-size: 13px;
  pointer-events: none;
  font-family: var(--f-mono);
}
.size-field.has-prefix input { padding-left: 26px; }
.size-input {
  width: 100%;
  height: 52px;
  padding: 0 var(--s-12);
  font-family: var(--f-mono); font-variant-numeric: tabular-nums;
  font-size: 18px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text); background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-12);
  transition: border-color .15s, box-shadow .15s, background .15s;
  -moz-appearance: textfield;
}
.size-input::-webkit-outer-spin-button,
.size-input::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.size-input:hover { border-color: var(--border-strong); }
.size-input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.size-input.error { border-color: var(--danger); }
.size-input.error:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 28%, transparent); }
.size-unit {
  position: absolute; right: 12px; bottom: 16px;
  font-size: 11px; color: var(--muted-2);
  pointer-events: none; letter-spacing: 0.04em;
}
.error-msg {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--danger);
  margin-top: var(--s-8);
}
.error-msg svg { width: 14px; height: 14px; }

.size-row-label {
  display: flex; align-items: center; gap: var(--s-8);
  font-size: 13px; color: var(--muted); margin-bottom: var(--s-8);
}
.size-row-label .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2);
}
.size-row-label.current .dot { background: var(--text); }
.size-row-label.new .dot { background: var(--primary); }

.size-row { margin-bottom: var(--s-16); }
.size-row:last-of-type { margin-bottom: var(--s-20); }

/* Button */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-8);
  height: 48px; padding: 0 var(--s-20);
  border-radius: var(--r-12);
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  border: 1px solid transparent; background: transparent; color: var(--text);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); text-decoration: none; }
.btn-ghost {
  background: var(--surface); color: var(--text); border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg); border-color: var(--border-strong); text-decoration: none; }
.btn-full { width: 100%; }
.btn-cpa {
  background: var(--cpa); color: #fff; border-color: var(--cpa);
}
.btn-cpa:hover { background: var(--cpa-hover); border-color: var(--cpa-hover); text-decoration: none; color: #fff; }

/* Result card */
.result { margin-top: var(--s-16); }
.result-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-16);
  padding: var(--s-20);
  border-bottom: 1px solid var(--border);
}
.result-note {
  margin: 0;
  padding: 0 var(--s-20) var(--s-20);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.result-body { padding: var(--s-20); }
.verdict {
  display: inline-flex; align-items: center; gap: var(--s-8);
  padding: 6px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  border: 1px solid transparent;
}
.verdict svg { width: 16px; height: 16px; }
.verdict.ok      { color: var(--success); background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.verdict.warning { color: var(--warning); background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.verdict.danger  { color: var(--danger);  background: var(--danger-soft);  border-color: color-mix(in srgb, var(--danger) 25%, transparent); }

.result-headline { flex: 1; }
.result-headline .kicker {
  font-size: 12px; font-weight: 500; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.result-headline .sizes {
  font-family: var(--f-mono); font-size: 18px; font-weight: 600;
  color: var(--text);
  display: flex; align-items: center; gap: var(--s-8); flex-wrap: wrap;
}
.result-headline .sizes .arrow { color: var(--muted-2); }
.result-headline .sizes .new { color: var(--primary); }

/* Big number */
.result-big {
  display: grid; grid-template-columns: 1fr; gap: var(--s-16);
  padding: var(--s-20);
}
.big-metric {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
}
.big-metric .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.big-metric .value {
  font-family: var(--f-mono); font-variant-numeric: tabular-nums;
  font-size: 44px; font-weight: 600; letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}
.big-metric .value.pos { color: var(--warning); }
.big-metric .value.ok { color: var(--success); }
.big-metric .value.neg { color: var(--danger); }
.big-metric .hint { font-size: 12px; color: var(--muted); }

/* Rows */
.metrics {
  display: grid; grid-template-columns: 1fr;
  gap: 0;
  padding: 0 var(--s-20) var(--s-8);
}
.metric-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-12) 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.metric-row .k { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.metric-row .k svg { width: 14px; height: 14px; color: var(--muted-2); }
.metric-row .v { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.metric-row .v.pos { color: var(--warning); }
.metric-row .v.ok { color: var(--success); }
.metric-row .v.neg { color: var(--danger); }
.metric-row .v.muted { color: var(--muted); font-weight: 500; }

/* Visualization — isometric 30° */
.tires-viz {
  padding: var(--s-20);
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: var(--s-12);
}
.tires-svg {
  width: 100%;
  max-width: 720px;
  height: auto;
  display: block;
  margin: 0 auto;
}
.tires-svg .vz-new {
  transform-box: fill-box;
  transform-origin: center bottom;
  opacity: 1;
  transition: opacity 300ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
}
.tires-svg .vz-arrow,
.tires-svg .vz-table {
  transition: opacity 260ms ease-out 160ms;
}
@starting-style {
  .tires-svg .vz-new { opacity: 0; transform: translateY(6px) scale(0.97); }
  .tires-svg .vz-arrow,
  .tires-svg .vz-table { opacity: 0; }
}
.tires-legend {
  display: flex; align-items: center; justify-content: center; gap: var(--s-20);
  font-size: 12px; color: var(--muted); flex-wrap: wrap;
}
.tires-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tires-legend .sw { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.tires-legend .sw.cur {
  border: 1.5px dashed var(--muted);
  background: transparent;
}
.tires-legend .sw.new {
  border: 1.5px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 14%, transparent);
}

@media (max-width: 560px) {
  .tires-viz { padding: var(--s-16) var(--s-8); }
  .tires-svg { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .tires-svg .vz-new,
  .tires-svg .vz-arrow,
  .tires-svg .vz-table { transition: none; }
  @starting-style {
    .tires-svg .vz-new { opacity: 1; transform: none; }
    .tires-svg .vz-arrow,
    .tires-svg .vz-table { opacity: 1; }
  }
}

/* CPA card */
.cpa-card {
  margin-top: var(--s-16);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-16);
  overflow: hidden;
}
.cpa-head {
  display: flex; align-items: center; gap: var(--s-12);
  padding: var(--s-16) var(--s-20) 0;
}
.cpa-marker {
  font-size: 11px; color: var(--muted-2);
  letter-spacing: 0.02em;
}
.cpa-body { padding: var(--s-12) var(--s-20) var(--s-20); }
.cpa-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.cpa-desc { font-size: 13px; color: var(--muted); margin-bottom: var(--s-12); }
.cpa-row {
  display: flex; align-items: center; gap: var(--s-12);
  flex-wrap: wrap;
}
.cpa-price { font-family: var(--f-mono); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.cpa-price .was { color: var(--muted-2); font-size: 13px; text-decoration: line-through; font-weight: 500; margin-left: 6px; }
.cpa-shops { font-size: 12px; color: var(--muted); }

/* SEO block */
.seo {
  margin-top: var(--s-48);
  display: grid; grid-template-columns: 1fr;
  gap: var(--s-24);
}
.seo h2 {
  font-size: 22px; letter-spacing: -0.02em; margin-bottom: var(--s-12);
  scroll-margin-top: 80px;
}
.seo h3 { font-size: 16px; margin-top: var(--s-16); margin-bottom: var(--s-8); }
.seo p { color: var(--text); margin-bottom: var(--s-12); }
.seo ul { color: var(--text); margin-bottom: var(--s-12); }
.seo li { margin-bottom: 4px; }
.seo .muted { color: var(--muted); }

.toc {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-12);
  padding: var(--s-16) var(--s-20);
}
.toc-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--s-8); }
.toc ol { margin: 0; padding-left: 18px; color: var(--text); }
.toc li { padding: 3px 0; font-size: 14px; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--primary); }
.toc a.active { color: var(--primary); font-weight: 600; }

/* FAQ <details> */
.faq { display: flex; flex-direction: column; gap: var(--s-8); }
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--r-12);
  background: var(--surface);
  overflow: hidden;
}
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: var(--s-16) var(--s-20);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-12);
  font-weight: 500; font-size: 15px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  width: 16px; height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235B6472' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-size: contain; background-repeat: no-repeat;
  transition: transform .2s;
  flex-shrink: 0;
}
.faq details[open] summary::after { transform: rotate(180deg); }
.faq .faq-body {
  padding: 0 var(--s-20) var(--s-20);
  color: var(--text); font-size: 14px; line-height: 1.6;
}
.faq .faq-body p { margin-bottom: var(--s-8); }

/* Sizes grid (popular) */
.sizes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-8);
}
.size-chip {
  padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-12);
  font-family: var(--f-mono); font-weight: 600; font-size: 14px;
  color: var(--text);
  text-align: center;
  transition: border-color .15s, background .15s;
}
.size-chip:hover { border-color: var(--primary); background: var(--primary-soft); text-decoration: none; color: var(--primary-ink); }

/* Ad placeholder (РСЯ) */
.ad-slot {
  margin: var(--s-32) auto;
  width: 300px; max-width: 100%; height: 250px;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border-strong);
  background: var(--surface-2); color: var(--muted-2);
  font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase;
  border-radius: var(--r-8);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: auto;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  padding: var(--s-32) var(--s-16);
  display: grid; grid-template-columns: 1fr; gap: var(--s-24);
}
.footer-col h4 { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: var(--s-12); }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-col a { color: var(--text); font-size: 14px; }
.footer-col a:hover { color: var(--primary); }
.footer-legal {
  border-top: 1px solid var(--border);
  padding: var(--s-16);
  color: var(--muted); font-size: 12px;
  text-align: left; max-width: 1200px; margin: 0 auto;
  line-height: 1.5;
}

/* Sticky mobile CTA (when keyboard hides primary) */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  padding: 10px var(--s-16) calc(10px + env(safe-area-inset-bottom));
  z-index: 20;
  display: none;
}
.sticky-cta.show { display: block; }

/* Breadcrumbs */
.breadcrumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: var(--s-12); flex-wrap: wrap; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs .sep { color: var(--muted-2); }

/* Info cards (SEO page) */
.info-cards { display: grid; grid-template-columns: 1fr; gap: var(--s-8); margin-bottom: var(--s-20); }
.info-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-12); padding: var(--s-16);
}
.info-card .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.info-card .val { font-family: var(--f-mono); font-weight: 600; font-size: 20px; letter-spacing: -0.01em; }
.info-card .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Analogues table */
.analogues-table { display: none; }
.analogues-cards { display: flex; flex-direction: column; gap: var(--s-8); }
.analogue-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-12);
  padding: var(--s-16);
  display: grid; grid-template-columns: 1fr auto; gap: var(--s-8) var(--s-12);
  align-items: center;
}
.analogue-card .size { font-family: var(--f-mono); font-weight: 600; font-size: 16px; }
.analogue-card .diameter { font-family: var(--f-mono); font-size: 13px; color: var(--muted); }
.analogue-card .deviation { font-family: var(--f-mono); font-size: 13px; font-weight: 600; text-align: right; }
.analogue-card .verdict-sm {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-8);
  padding-top: var(--s-8);
  border-top: 1px dashed var(--border);
}
.analogue-card .status-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.analogue-card .status-chip svg { width: 12px; height: 12px; }
.status-chip.ok { background: var(--success-soft); color: var(--success); }
.status-chip.warning { background: var(--warning-soft); color: var(--warning); }
.status-chip.danger { background: var(--danger-soft); color: var(--danger); }

.deviation.ok { color: var(--success); }
.deviation.warning { color: var(--warning); }
.deviation.danger { color: var(--danger); }

/* Skeleton */
@keyframes sk { 0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0} }
.skeleton {
  background-color: var(--bg);
  background-image: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 6%, transparent), transparent);
  background-size: 200px 100%;
  background-repeat: no-repeat;
  border-radius: 6px;
  display: inline-block;
  animation: sk 1.2s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

/* ===== Responsive ===== */
@media (min-width: 768px) {
  .header-inner { padding: var(--s-12) var(--s-24); }
  .header-nav { display: flex; }
  .main { padding: var(--s-12) var(--s-24) var(--s-64); }
  .hero h1 { font-size: 34px; }
  .hero .lede { font-size: 16px; }

  .result-big { grid-template-columns: 1fr 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; column-gap: var(--s-32); }
  .metric-row { border-top: 0; border-bottom: 1px solid var(--border); }

  .sizes-grid { grid-template-columns: repeat(4, 1fr); }

  .info-cards { grid-template-columns: repeat(3, 1fr); }

  .analogues-table { display: table; width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-12); overflow: hidden; }
  .analogues-cards { display: none; }
  .analogues-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding: var(--s-12) var(--s-16); background: var(--bg); border-bottom: 1px solid var(--border); }
  .analogues-table td { padding: var(--s-12) var(--s-16); font-size: 14px; border-top: 1px solid var(--border); }
  .analogues-table td.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-weight: 600; }
  .analogues-table tr:first-child td { border-top: 0; }
  .analogues-table tr:hover td { background: var(--surface-2); }

  .footer-inner { grid-template-columns: 2fr 1fr 1fr; gap: var(--s-48); padding: var(--s-48) var(--s-24); }
}

@media (min-width: 1024px) {
  .hero h1 { font-size: 40px; }

  .layout-2col {
    display: grid;
    grid-template-columns: minmax(0, 720px) 280px;
    gap: var(--s-48);
    align-items: start;
  }
  .layout-2col .sidebar {
    display: flex; flex-direction: column; gap: var(--s-16);
  }
  .main { padding-top: var(--s-16); }

  .seo { grid-template-columns: 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Print */
@media print {
  .header, .footer, .ad-slot, .cpa-card, .sticky-cta { display: none; }
}

/* ───── Cookie banner (VibeTools standard) ───────────────────────────────── */
.cookie-banner {
  position: fixed; left: var(--s-16); right: var(--s-16); bottom: var(--s-16);
  z-index: 40;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-12);
  box-shadow: var(--sh-pop);
  padding: var(--s-16);
  display: flex; align-items: center; gap: var(--s-12);
  flex-wrap: wrap;
  max-width: 600px; margin: 0 auto;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner__text { font-size: 13px; color: var(--muted); flex: 1; min-width: 200px; line-height: 1.5; }
.cookie-banner__text a { color: var(--primary); }

/* ───── Toast ─────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--text); color: var(--surface);
  padding: 10px 16px; border-radius: var(--r-8);
  font-size: 14px;
  box-shadow: var(--sh-pop);
  z-index: 50;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.toast.show { opacity: 1; }
[data-theme="dark"] .toast { background: var(--surface); color: var(--text); border: 1px solid var(--border); }

/* ───── Site-meta: дата + курсы ЦБ в шапке ───────────────────────────────── */
.site-meta {
  display: none;
  align-items: center; gap: var(--s-12);
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.site-meta__date { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 500; }
.site-meta__date svg { color: var(--primary); }
.site-meta__sep { width: 1px; height: 14px; background: var(--border); }
.site-meta__rates { display: inline-flex; align-items: center; gap: 10px; }
.site-meta__rate { display: inline-flex; align-items: baseline; gap: 4px; color: var(--text); }
.site-meta__flag { color: var(--muted); font-weight: 600; }
.site-meta__src {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--muted-2);
  background: var(--surface); border: 1px solid var(--border);
  padding: 2px 6px; border-radius: 4px;
}
@media (min-width: 768px) { .site-meta { display: inline-flex; } }

/* ───── Lang switch ──────────────────────────────────────────────────────── */
.lang-switch {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: var(--r-8);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted); font-size: 13px; font-weight: 600;
  text-decoration: none;
  transition: color .15s, background .15s, border-color .15s;
}
.lang-switch svg { color: var(--muted-2); transition: color .15s; }
.lang-switch:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); text-decoration: none; }
.lang-switch:hover svg { color: var(--primary); }

/* ───── Social icons (footer) ────────────────────────────────────────────── */
.socials { margin-top: var(--s-12); display: flex; gap: 10px; }
.social-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  transition: color .15s, background .15s, border-color .15s, transform .15s;
}
.social-icon svg { width: 18px; height: 18px; }
.social-icon:hover { color: var(--primary); background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); transform: translateY(-1px); text-decoration: none; }

/* ───── Prose: типографика служебных страниц (about/contact/privacy/terms/faq) ─ */
.prose {
  font-size: 15.5px; line-height: 1.7; color: var(--text);
}
.prose h1 {
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-12);
}
.prose .lede { font-size: 17px; color: var(--muted); margin: 0 0 var(--s-24); line-height: 1.55; }
.prose h2 {
  font-size: 20px; line-height: 1.3;
  margin: var(--s-32) 0 var(--s-12);
  letter-spacing: -0.01em;
  padding-top: var(--s-8);
  border-top: 1px solid var(--border);
}
.prose h2:first-of-type { border-top: 0; padding-top: 0; margin-top: var(--s-24); }
.prose h3 { font-size: 17px; margin: var(--s-20) 0 var(--s-8); }
.prose p { margin: 0 0 var(--s-16); }
.prose ul, .prose ol { margin: 0 0 var(--s-16); padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--muted-2); }
.prose a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--primary) 35%, transparent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}
.prose a:hover { color: var(--primary-hover); text-decoration-color: var(--primary-hover); }
.prose a.btn,
.prose a.btn:hover { color: #fff; text-decoration: none; }
.prose strong { color: var(--text); font-weight: 600; }
.prose code {
  font-family: var(--f-mono); font-size: 0.9em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 6px;
  color: var(--primary-ink);
}
.prose .muted { color: var(--muted); }
.prose .faq { display: flex; flex-direction: column; gap: var(--s-8); margin-top: var(--s-16); }
.prose details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-12);
  padding: 14px 18px;
  transition: border-color .15s, box-shadow .15s;
}
.prose details[open] { border-color: var(--primary-soft); box-shadow: var(--sh-1); }
.prose details summary {
  cursor: pointer;
  font-weight: 600; color: var(--text); font-size: 15.5px;
  list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-12);
  padding: 2px 0;
}
.prose details summary::-webkit-details-marker { display: none; }
.prose details summary::after {
  content: "+"; color: var(--muted); font-size: 20px; line-height: 1;
  transition: transform .2s, color .15s;
}
.prose details[open] summary::after { content: "−"; color: var(--primary); }
.prose .faq-body { padding-top: 10px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.prose .faq-body p { margin: 0; }

/* Crumbs (служебные страницы) */
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--primary); }

/* Utility */
.nowrap { white-space: nowrap; }

/* ── Analogues grid (razmer page + calculator "by-disk" mode) ───────────── */
.analogues-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s-12);
}
a.analogue-card {
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-12);
  padding: var(--s-16);
  display: flex;
  flex-direction: column;
  gap: var(--s-12);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
a.analogue-card:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 20px -10px rgba(31, 95, 255, 0.35);
  transform: translateY(-1px);
  text-decoration: none;
}
a.analogue-card:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.analogue-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-8);
}
.analogue-size {
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.analogue-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.analogue-badge.ok { background: var(--success-soft); color: var(--success); }
.analogue-badge.warning { background: var(--warning-soft); color: var(--warning); }
.analogue-badge.danger { background: var(--danger-soft); color: var(--danger); }

.analogue-metrics {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: var(--s-8);
  border-top: 1px dashed var(--border);
}
.analogue-metrics .metric-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-8);
  font-size: 13px;
}
.analogue-metrics .metric-row .k { color: var(--muted); }
.analogue-metrics .metric-row .v {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 600;
}

/* Footer legal: no awkward breaks */
.footer-legal {
  text-wrap: pretty;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* Speedometer error table (replace mode) */
.speedo-table {
  margin: 0 var(--s-20) var(--s-20);
  padding: var(--s-16);
  background: var(--surface-2, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--r-md, 10px);
}
.speedo-table .speedo-head { margin-bottom: var(--s-12); }
.speedo-table .speedo-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}
.speedo-table .speedo-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.speedo-table table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.speedo-table thead th {
  text-align: right;
  font-weight: 500;
  color: var(--muted);
  font-family: var(--font, system-ui);
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.speedo-table thead th:first-child { text-align: left; }
.speedo-table tbody td {
  padding: 7px 8px;
  border-bottom: 1px dashed var(--border);
  text-align: right;
  color: var(--text);
}
.speedo-table tbody tr:last-child td { border-bottom: 0; }
.speedo-table tbody td:first-child { text-align: left; color: var(--muted); }
.speedo-table .num.ok   { color: var(--success); }
.speedo-table .num.neg  { color: var(--danger); }
.speedo-table .num.muted { color: var(--muted); }

/* Formula details — transparent math for diameter calculation */
.formula-details {
  margin: 0 var(--s-20) var(--s-20);
  border: 1px solid var(--border);
  border-radius: var(--r-md, 10px);
  background: var(--surface);
  overflow: hidden;
}
.formula-details > summary {
  cursor: pointer;
  padding: var(--s-12) var(--s-16);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  user-select: none;
}
.formula-details > summary::-webkit-details-marker { display: none; }
.formula-details > summary::before {
  content: '＋';
  font-family: var(--f-mono);
  color: var(--muted);
  width: 14px;
  text-align: center;
}
.formula-details[open] > summary::before { content: '−'; }
.formula-details > summary:hover { background: var(--surface-2, rgba(0,0,0,0.02)); }
.formula-body {
  padding: 0 var(--s-16) var(--s-16);
  border-top: 1px solid var(--border);
}
.formula-hint {
  margin: var(--s-12) 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.formula-block + .formula-block { margin-top: var(--s-12); }
.formula-size {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}
.formula-size-label { color: var(--muted); }
.formula-size-value {
  font-family: var(--f-mono);
  font-weight: 600;
  color: var(--text);
}
.formula-steps {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.formula-steps li { font-size: 13px; line-height: 1.6; color: var(--text); }
.formula-step-k { display: inline-block; color: var(--muted); margin-right: 6px; }
.formula-steps code {
  font-family: var(--f-mono);
  font-size: 12.5px;
  color: var(--text);
  background: none;
  padding: 0;
}
.formula-steps code b { color: var(--primary); font-weight: 600; }
.formula-legend {
  margin: var(--s-12) 0 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
  font-style: italic;
}

/* Clearance / wheel-arch block — differentiator vs. razmerkoles/pokrishka */
.clearance-block {
  margin: 0 var(--s-20) var(--s-20);
  padding: var(--s-16);
  background: var(--surface-2, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--r-md, 10px);
}
.clearance-head { margin-bottom: var(--s-12); }
.clearance-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}
.clearance-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.clearance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: var(--s-12);
}
@media (max-width: 520px) {
  .clearance-grid { grid-template-columns: 1fr; }
}
.clr-cell {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
}
.clr-cell.ok  { border-left-color: var(--success); }
.clr-cell.warn { border-left-color: var(--warning); }
.clr-cell.err { border-left-color: var(--danger); }
.clr-k {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 4px;
}
.clr-v {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
.clr-cell.ok .clr-v  { color: var(--success); }
.clr-cell.warn .clr-v { color: var(--warning); }
.clr-cell.err .clr-v { color: var(--danger); }
.clearance-verdicts {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s-12);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cv {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--surface);
  border-left: 3px solid var(--border);
}
.cv.ok  { border-left-color: var(--success); }
.cv.warn { border-left-color: var(--warning); }
.cv.err { border-left-color: var(--danger); }
.clearance-note {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
  font-style: italic;
}

/* Car picker (factory tire size by brand/model) */
.car-picker {
  border: 1px dashed var(--border);
  border-radius: var(--r-md, 10px);
  background: var(--surface);
  margin-bottom: var(--s-16);
  overflow: hidden;
}
.car-picker > summary {
  cursor: pointer;
  padding: var(--s-12) var(--s-16);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  user-select: none;
}
.car-picker > summary::-webkit-details-marker { display: none; }
.car-picker > summary svg { color: var(--primary); flex-shrink: 0; }
.car-picker > summary:hover { background: var(--surface-2, rgba(0,0,0,0.02)); }
.car-picker[open] > summary { border-bottom: 1px solid var(--border); }
.car-picker-body {
  padding: var(--s-16);
  display: flex;
  flex-direction: column;
  gap: var(--s-12);
}
.car-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-12);
}
@media (max-width: 520px) {
  .car-grid { grid-template-columns: 1fr; }
}
.car-field { display: flex; flex-direction: column; gap: 4px; }
.car-field label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.car-field select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg, #fff);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%23666' stroke-width='1.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.car-field select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.car-field select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 0;
  border-color: var(--primary);
}
.car-result {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: var(--s-12);
  background: var(--surface-2, rgba(0,0,0,0.03));
  border-radius: 8px;
  font-size: 14px;
}
.car-result[hidden] { display: none; }
.car-result-label { color: var(--muted); }
.car-result-size {
  font-family: var(--f-mono);
  font-weight: 700;
  color: var(--primary);
  font-size: 15px;
  flex: 1;
}
.btn-ghost {
  background: none;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: background .15s;
}
.btn-ghost:hover { background: var(--primary); color: #fff; }
.car-note {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* Disk specs: ET / PCD / DIA */
.disk-specs {
  margin-top: var(--s-16);
  border: 1px dashed var(--border);
  border-radius: var(--r-md, 10px);
  background: var(--surface);
  overflow: hidden;
}
.disk-specs > summary {
  cursor: pointer;
  padding: var(--s-12) var(--s-16);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  user-select: none;
}
.disk-specs > summary::-webkit-details-marker { display: none; }
.disk-specs > summary svg { color: var(--primary); flex-shrink: 0; }
.disk-specs > summary:hover { background: var(--surface-2, rgba(0,0,0,0.02)); }
.disk-specs[open] > summary { border-bottom: 1px solid var(--border); }
.disk-specs-body {
  padding: var(--s-16);
  display: flex;
  flex-direction: column;
  gap: var(--s-12);
}
.disk-specs-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.size-grid.size-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 640px) {
  .size-grid.size-grid-3 { grid-template-columns: 1fr; }
}
.disk-verdict {
  padding: var(--s-12);
  background: var(--surface-2, rgba(0,0,0,0.03));
  border-radius: 8px;
}
.disk-verdict-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.disk-verdict ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.disk-verdict li {
  padding-left: 22px;
  position: relative;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
.disk-verdict li::before {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--f-mono);
  font-weight: 700;
}
.disk-verdict li.ok::before   { content: '✓'; color: var(--success); }
.disk-verdict li.warn::before { content: '!'; color: var(--warning); }
.disk-verdict li.err::before  { content: '✗'; color: var(--danger); }

/* Sidebar utilities: inch↔mm + DOT decoder */
.utils-card {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.util-row {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.util-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg, #fff);
  color: var(--text);
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
}
.util-row input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 0;
  border-color: var(--primary);
}
.util-unit {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  min-width: 44px;
  text-align: left;
}
.util-eq {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 2px 0;
}
.util-hint {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}
.util-result {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  padding: 10px 12px;
  background: var(--surface-2, rgba(0,0,0,0.03));
  border-radius: 6px;
  border-left: 3px solid var(--border);
}
.util-result.ok   { border-left-color: var(--success); color: var(--text); }
.util-result.warn { border-left-color: var(--warning); color: var(--text); }
.util-result.err  { border-left-color: var(--danger);  color: var(--text); }
.util-result-age {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.util-result-verdict { margin-top: 6px; font-size: 12.5px; }

/* ─── Sidebar ad banners 280×80 (stacked) ──────────────────────────── */
.sidebar-banners {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-banner {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 2px;
  width: 100%;
  height: 80px;
  border-radius: var(--r-8, 8px);
  border: 1px dashed var(--border-strong);
  background:
    repeating-linear-gradient(135deg,
      var(--surface-2) 0 10px,
      color-mix(in srgb, var(--border) 30%, var(--surface-2)) 10px 20px);
  color: var(--muted);
  text-decoration: none;
  transition: transform 180ms ease-out, border-color 180ms ease-out, color 180ms ease-out;
}
.sidebar-banner:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}
.sidebar-banner:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.sidebar-banner-kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.sidebar-banner-hint {
  font-size: 12px;
  color: var(--muted-2);
}
.sidebar-banner:hover .sidebar-banner-hint { color: var(--primary); }

/* ─── Back-to-top button ────────────────────────────────────────────── */
.back-to-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 16px));
  bottom: max(20px, env(safe-area-inset-bottom, 20px));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--sh-pop);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.9);
  transition: opacity 220ms ease, transform 220ms cubic-bezier(0.16, 1, 0.3, 1), background-color 180ms ease;
  z-index: 50;
}
.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.back-to-top:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
}
.back-to-top:focus-visible {
  outline: none;
  box-shadow: var(--ring), var(--sh-pop);
}
.back-to-top svg { width: 20px; height: 20px; }

@media (prefers-reduced-motion: reduce) {
  .back-to-top { transition: opacity 0.01ms linear; transform: none; }
  .back-to-top.is-visible { transform: none; }
}
@media print {
  .back-to-top, .sidebar-banners { display: none !important; }
}

/* ─── E-E-A-T block: автор, методика, первоисточники, даты ─────────── */
.eeat-block {
  margin: var(--s-32) 0 var(--s-24);
  padding: var(--s-24);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 14px);
  display: grid;
  gap: var(--s-20);
}
.eeat-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
}
.eeat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.eeat-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--s-20);
  align-items: start;
}
@media (max-width: 720px) {
  .eeat-grid { grid-template-columns: 1fr; gap: var(--s-16); }
  .eeat-block { padding: var(--s-16); }
}
.eeat-author {
  padding: var(--s-16);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.eeat-author-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.eeat-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  color: var(--primary);
  display: grid;
  place-items: center;
}
.eeat-avatar svg { width: 24px; height: 24px; }
.eeat-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.eeat-role {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}
.eeat-bio {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 12px;
}
.eeat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.eeat-chip {
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  border-radius: 999px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.eeat-method {
  padding: var(--s-16);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.eeat-method-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
}
.eeat-method-list code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12.5px;
  padding: 1px 6px;
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
  border: 1px solid var(--border);
  border-radius: 4px;
}
.eeat-sources {
  padding-top: var(--s-16);
  border-top: 1px solid var(--border);
}
.eeat-sources-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
}
.eeat-sources-list a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dashed color-mix(in srgb, var(--primary) 40%, transparent);
}
.eeat-sources-list a:hover { border-bottom-style: solid; }
.eeat-meta {
  padding-top: var(--s-16);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-12);
}
.eeat-meta-item {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  display: grid;
  gap: 2px;
}
.eeat-meta-k {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.eeat-meta-hint {
  font-size: 12px;
  color: var(--muted);
}
.eeat-meta-item time {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.eeat-meta-item a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.eeat-meta-item a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════════════════
   Contact Form — форма обратной связи на /contact/
   ══════════════════════════════════════════════════════════════════════════ */
.contact-intro {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: var(--s-24);
  line-height: 1.6;
}
.contact-intro strong { color: var(--text); font-weight: 600; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-20);
}
.contact-form__row {
  display: flex;
  flex-direction: column;
  gap: var(--s-8);
}
.contact-form__label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.contact-form__hint {
  font-size: 12px;
  color: var(--muted-2);
  font-weight: 400;
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  padding: 10px var(--s-12);
  border: 1px solid var(--border);
  border-radius: var(--r-8);
  font: inherit;
  font-size: 15px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.contact-form textarea {
  resize: vertical;
  min-height: 140px;
  font-family: var(--f-sans);
}
.contact-form__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.contact-form__captcha {
  display: flex;
  justify-content: center;
}
.contact-form__submit {
  align-self: flex-start;
  min-width: 200px;
}
.contact-form__status {
  min-height: 1.5em;
  font-size: 13px;
  color: var(--muted);
  padding: var(--s-8) 0;
}
.contact-form__status.is-error {
  color: var(--danger);
}
.contact-form__status.is-success {
  color: var(--success);
  padding: var(--s-12) var(--s-16);
  background: var(--success-soft);
  border-radius: var(--r-8);
  font-weight: 500;
}

/* Hide socials block on shiny — duplicated in footer */
h2:has(+ .contact-socials),
.contact-socials { display: none !important; }

/* Socials heading (shared partial renders <h2> — target by :has(+ .contact-socials)) */
h2:has(+ .contact-socials),
.contact-socials-heading {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: var(--s-32) 0 var(--s-16);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--s-12);
}
h2:has(+ .contact-socials)::before,
.contact-socials-heading::before {
  content: "";
  flex-shrink: 0;
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--brand-shine);
}

/* Socials grid */
.contact-socials {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-12);
  margin-top: 0;
}
@media (min-width: 560px) {
  .contact-socials { grid-template-columns: 1fr 1fr; gap: var(--s-16); }
}

/* Social card — premium CTA plate */
.contact-social {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-16);
  padding: var(--s-16) var(--s-20);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-12);
  text-decoration: none !important;
  color: var(--text);
  box-shadow: var(--sh-1);
  overflow: hidden;
  isolation: isolate;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 180ms ease,
              box-shadow 200ms ease;
}
/* Decorative glow on hover (brand shine), behind content */
.contact-social::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--brand-shine);
  opacity: 0;
  z-index: -1;
  transition: opacity 220ms ease;
  border-radius: inherit;
}
.contact-social:hover,
.contact-social:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  box-shadow: var(--sh-pop);
  text-decoration: none !important;
}
.contact-social:focus-visible {
  outline: none;
  box-shadow: var(--sh-pop), var(--ring);
}
.contact-social:active { transform: translateY(-1px); }

/* Kill underlines on nested tags (override global a{} reset) */
.contact-social,
.contact-social * { text-decoration: none !important; }

/* Icon tile — primary-soft frame, brand-accent glyph */
.contact-social__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-8);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--primary-soft);
  color: var(--primary);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
              background 180ms ease,
              color 180ms ease;
}
.contact-social:hover .contact-social__icon {
  transform: scale(1.05) rotate(-3deg);
}

/* Brand tints per network — subtle, inside shiny frame */
.contact-social__icon--tg {
  background: color-mix(in srgb, #229ED9 14%, var(--primary-soft));
  color: #1E8BBE;
}
.contact-social__icon--vk {
  background: color-mix(in srgb, #0077FF 14%, var(--primary-soft));
  color: #0A66D1;
}
[data-theme="dark"] .contact-social__icon--tg {
  background: color-mix(in srgb, #229ED9 22%, var(--primary-soft));
  color: #6AC5EC;
}
[data-theme="dark"] .contact-social__icon--vk {
  background: color-mix(in srgb, #0077FF 22%, var(--primary-soft));
  color: #89B4FF;
}

/* On hover the whole card goes brand-shine — icon tile turns glass */
.contact-social:hover::after,
.contact-social:focus-visible::after { opacity: 1; }
.contact-social:hover,
.contact-social:focus-visible { color: #FFFFFF; border-color: transparent; }
.contact-social:hover .contact-social__icon,
.contact-social:focus-visible .contact-social__icon {
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.contact-social:hover .contact-social__handle,
.contact-social:focus-visible .contact-social__handle { color: rgba(255, 255, 255, 0.85); }

/* Text */
.contact-social__title {
  font-weight: 600;
  margin: 0 0 2px;
  font-size: 15px;
  letter-spacing: -0.005em;
  color: inherit;
}
.contact-social__handle {
  margin: 0;
  font-size: 13px;
  font-family: var(--f-mono);
  font-feature-settings: "tnum";
  color: var(--muted);
  transition: color 180ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .contact-social,
  .contact-social::after,
  .contact-social__icon { transition: none; }
  .contact-social:hover,
  .contact-social:focus-visible { transform: none; }
  .contact-social:hover .contact-social__icon { transform: none; }
}

/* Alias for shared contact-form.partial.php */
.result-card {
  margin-bottom: var(--s-32);
}

/* Contact page header */
.contact-page-header {
  display: flex;
  align-items: center;
  gap: var(--s-16);
  margin-bottom: var(--s-32);
}
.contact-page-header__icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: var(--r-12);
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.contact-page-header__title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}
.contact-page-header__sub {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* Contact topics list */
.contact-topics {
  margin-top: var(--s-32);
  padding-top: var(--s-24);
  border-top: 1px solid var(--border);
}
.contact-topics__heading {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 var(--s-16);
  letter-spacing: -0.01em;
}
.contact-topics__list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-12);
}
.contact-topics__item {
  display: flex;
  gap: var(--s-12);
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}
.contact-topics__item a { color: var(--primary); }
.contact-topics__dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
}
.contact-topics__dot--danger  { background: var(--danger); }
.contact-topics__dot--primary { background: var(--primary); }
.contact-topics__dot--warning { background: var(--warning); }
.contact-topics__dot--muted   { background: var(--muted-2); }

/* Footer CTA — акцент-карточка над копирайтом */
.site-footer__cta {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--s-16);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-top: 1px solid var(--border);
}
.site-footer__cta-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
}
.site-footer__cta-icon svg { width: 18px; height: 18px; }
.site-footer__cta-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  text-align: left;
}
.site-footer__cta a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--primary) 35%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color 160ms ease;
}
.site-footer__cta a:hover { text-decoration-color: var(--primary); }

@media (max-width: 560px) {
  .site-footer__cta {
    flex-direction: row;
    padding: var(--s-16) var(--s-16);
    gap: 10px;
  }
  .site-footer__cta-icon { width: 32px; height: 32px; }
  .site-footer__cta-icon svg { width: 16px; height: 16px; }
  .site-footer__cta-text { font-size: 13px; }
}

/* ── /disk/ page ── */
.btn-disk-width {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 14px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 14px; font-family: var(--f-mono); font-weight: 600;
  color: var(--text); text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.btn-disk-width:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); color: var(--primary); }
.btn-disk-width--all { font-family: var(--f-sans); font-weight: 400; color: var(--primary); border-color: var(--primary); }

.rim-nav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 14px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 14px; font-family: var(--f-mono); font-weight: 600;
  color: var(--text); text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.rim-nav-btn:hover { border-color: var(--primary); color: var(--primary); }
.rim-nav-btn--active {
  background: var(--primary); color: #fff; border-color: var(--primary); cursor: default;
}

/* ================================================================
   .prose — Long-form reading typography
   Применяется к большим SEO-блокам, статьям и legal-страницам.
   Цели: комфортная мера ~70 cch, межстрочный 1.7, мягкие h2/h3,
   аккуратные списки/blockquote/code, оптические правки шрифта.
   ================================================================ */
.prose {
  --prose-measure: 72ch;
  --prose-size: 17px;
  --prose-leading: 1.72;
  --prose-h2-size: 26px;
  --prose-h3-size: 19px;
  --prose-gap: 1.1em;

  color: var(--text);
  font-size: var(--prose-size);
  line-height: var(--prose-leading);
  font-feature-settings: "ss01", "cv11", "kern";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  hanging-punctuation: first last;
}
.prose > * { max-width: var(--prose-measure); }
.prose > .toc,
.prose > .faq,
.prose > figure,
.prose > table,
.prose > .prose-callout { max-width: none; }

.prose > * + * { margin-top: var(--prose-gap); }
.prose p { margin: 0; text-wrap: pretty; }
.prose .lede {
  font-size: 1.12em;
  color: var(--muted);
  line-height: 1.55;
  text-wrap: balance;
}

.prose h2 {
  font-size: var(--prose-h2-size);
  line-height: 1.25;
  letter-spacing: -0.018em;
  font-weight: 700;
  margin-top: 1.8em;
  scroll-margin-top: 80px;
  text-wrap: balance;
}
.prose h2 + p,
.prose h2 + ul,
.prose h2 + ol { margin-top: 0.6em; }
.prose h3 {
  font-size: var(--prose-h3-size);
  line-height: 1.35;
  font-weight: 650;
  margin-top: 1.5em;
  text-wrap: balance;
}
.prose h2:first-child,
.prose h3:first-child { margin-top: 0; }

/* Lists */
.prose ul,
.prose ol { padding-left: 1.4em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--muted-2); }
.prose ul li::marker { font-size: 0.9em; }

.prose strong { font-weight: 650; color: var(--text); }
.prose em { font-style: italic; }

/* Inline code & numeric spans */
.prose code:not(pre code) {
  font-family: var(--f-mono);
  font-size: 0.92em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.08em 0.42em;
  border-radius: 6px;
  color: var(--primary-ink);
  white-space: nowrap;
}
.prose .num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  white-space: nowrap;
}

/* Links */
.prose a:not(.btn):not(.term) {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--primary) 35%, transparent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color .15s, color .15s;
}
.prose a:not(.btn):not(.term):hover {
  color: var(--primary-hover);
  text-decoration-color: currentColor;
}

/* Blockquote */
.prose blockquote {
  margin: 1.4em 0;
  padding: 0.4em 1.1em;
  border-left: 3px solid var(--primary);
  color: var(--muted);
  font-style: italic;
}

/* Callouts */
.prose-callout {
  margin: 1.4em 0;
  padding: 14px 18px;
  border-radius: var(--r-12);
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}
.prose-callout--warn { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.prose-callout--ok   { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.prose-callout strong { display: block; margin-bottom: 4px; font-size: 14px; letter-spacing: 0.01em; }

/* Tables inside prose */
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 1.2em 0;
}
.prose th, .prose td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.prose th { font-weight: 600; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }

/* Mobile tuning — short measure, slightly smaller h2 */
@media (max-width: 640px) {
  .prose {
    --prose-size: 16.5px;
    --prose-leading: 1.68;
    --prose-h2-size: 22px;
    --prose-h3-size: 17px;
  }
}

/* Variant: применять .prose к section.seo и legal-articles */
.seo > article,
section.seo > article {
  /* see .prose rules above when class is added inline */
}

/* ================================================================
   .term — Inline glossary tooltip (термин с подсказкой)
   Использование:
     <button type="button" class="term" popovertarget="t-etrto"
             aria-describedby="t-etrto">ETRTO</button>
     <span popover="auto" id="t-etrto" class="term-pop" role="tooltip">
       European Tyre and Rim Technical Organisation — стандарт
       геометрии шин и дисков.
     </span>
   Нативный popover API (Baseline 2024). Без JS.
   ================================================================ */
.term {
  font: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--primary);
  cursor: help;
  text-decoration: underline dotted;
  text-decoration-color: color-mix(in srgb, var(--primary) 50%, transparent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: color .15s, text-decoration-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.term:hover { color: var(--primary-hover); text-decoration-color: currentColor; }
.term:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 3px; }

.term-pop {
  max-width: min(360px, calc(100vw - 32px));
  padding: 16px 18px;
  border-radius: var(--r-12);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--sh-pop);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  position: fixed;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
}
.term-pop::backdrop { background: rgba(15, 23, 36, 0.32); backdrop-filter: blur(2px); }
[data-theme="dark"] .term-pop::backdrop { background: rgba(0, 0, 0, 0.55); }

@media (min-width: 641px) {
  .term-pop {
    max-width: 380px;
    padding: 18px 20px;
    font-size: 15px;
  }
}
.term-pop strong { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.term-pop code { font-family: var(--f-mono); font-size: 13px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

@starting-style {
  .term-pop:popover-open { opacity: 0; scale: 0.96; }
}
.term-pop:popover-open {
  opacity: 1;
  scale: 1;
  transition: opacity .18s ease-out, scale .18s ease-out, overlay .18s allow-discrete, display .18s allow-discrete;
}

@media (prefers-reduced-motion: reduce) {
  .term-pop:popover-open { transition: none; scale: 1; }
}

/* Show-more for analogue grid */
.analogues-more[hidden] { display: none; }
.show-more-btn {
  margin-top: var(--s-16);
  width: 100%;
  padding: var(--s-12) var(--s-16);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-12);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.show-more-btn:hover { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); border-color: var(--primary); }
.show-more-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.show-more-count { color: var(--muted); font-weight: 500; margin-left: 4px; }
/* ─── Bottom Nav (mobile only, brand-tinted) ──────────────────────────────────
   Цвет берётся из --bnav-color (fallback --color-primary, затем --primary).
   Каждый инструмент окрашивает меню в свой brand-токен.
   ──────────────────────────────────────────────────────────────────────────── */

.bnav { display: none; }

@media (max-width: 767px) {
  .bnav {
    --bnav-color: var(--color-primary, var(--primary, #1F5FFF));
    --bnav-ink: #0f172a;
    --bnav-bg: color-mix(in srgb, var(--bnav-color) 6%, #ffffff 94%);
    --bnav-border: color-mix(in srgb, var(--bnav-color) 22%, transparent);
    --bnav-shadow: color-mix(in srgb, var(--bnav-color) 28%, transparent);
    --bnav-muted: color-mix(in srgb, var(--bnav-ink) 62%, transparent);
    --bnav-active-bg: color-mix(in srgb, var(--bnav-color) 12%, transparent);

    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--bnav-bg);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
            backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid var(--bnav-border);
    box-shadow: 0 -8px 24px -12px var(--bnav-shadow);
    transform: translateY(110%);
    transition: transform .28s cubic-bezier(.32, .72, .24, 1);
    will-change: transform;
  }

  /* Тонкая цветная линия-акцент сверху */
  .bnav::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg,
      transparent,
      var(--bnav-color) 30%,
      var(--bnav-color) 70%,
      transparent);
    opacity: .55;
  }

  .bnav[data-state="visible"] { transform: translateY(0); }

  @media (prefers-color-scheme: dark) {
    .bnav {
      --bnav-ink: #e6edf3;
      --bnav-bg: color-mix(in srgb, var(--bnav-color) 10%, #11151c 90%);
      --bnav-border: color-mix(in srgb, var(--bnav-color) 32%, transparent);
      --bnav-shadow: rgba(0, 0, 0, .45);
      --bnav-muted: color-mix(in srgb, var(--bnav-ink) 60%, transparent);
      --bnav-active-bg: color-mix(in srgb, var(--bnav-color) 22%, transparent);
    }
  }

  /* Fallback без backdrop-filter: плотный тонированный фон */
  @supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .bnav {
      background: color-mix(in srgb, var(--bnav-color) 8%, #ffffff 92%);
    }
    @media (prefers-color-scheme: dark) {
      .bnav {
        background: color-mix(in srgb, var(--bnav-color) 14%, #11151c 86%);
      }
    }
  }

  .bnav__link {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    min-height: 52px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--bnav-muted);
    transition: color .15s ease, background-color .2s ease, transform .15s ease;
  }

  .bnav__link:hover { color: var(--bnav-ink); }
  .bnav__link:active { transform: scale(.96); }
  .bnav__link:focus-visible {
    outline: 2px solid var(--bnav-color);
    outline-offset: -2px;
  }

  .bnav__link[aria-current="page"] {
    color: var(--bnav-color);
    background: var(--bnav-active-bg);
    font-weight: 600;
  }
  .bnav__link[aria-current="page"] .bnav__icon {
    transform: translateY(-1px);
  }

  .bnav__icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    transition: transform .2s ease;
  }

  .bnav__label {
    font-size: 11px;
    line-height: 1.1;
    font-weight: 500;
    letter-spacing: -0.01em;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  @media (max-width: 380px) {
    .bnav__label { font-size: 10px; }
    .bnav__link { gap: 2px; padding: 6px 1px; }
  }

  /* Защита от перекрытия контента нижним меню */
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }

  /* Кнопка «Наверх» поднимается над меню */
  .scroll-to-top {
    bottom: calc(72px + env(safe-area-inset-bottom)) !important;
  }

  @media (prefers-reduced-motion: reduce) {
    .bnav { transition: none; }
    .bnav__link, .bnav__icon { transition: none; }
  }
}

#faq { scroll-margin-top: 80px; }
