/* Крюк — стили. Две поверхности: ночь (запрос) и день (распечатка маршрута). */

:root {
  --night: #0C1428;
  --night-2: #121C36;
  --night-3: #1B2749;
  --on-night: #F1F4FA;
  --muted-n: #93A0BC;
  --hair-n: rgba(241, 244, 250, 0.16);

  --day: #EEF1F6;
  --day-2: #FFFFFF;
  --ink: #0C1428;
  --muted-d: #5B6577;
  --hair-d: rgba(12, 20, 40, 0.14);

  --plane: #D24515;
  --train: #0B8556;
  --bus: #1F6FB8;
  --car: #5B6577;
  --plane-n: #E45A22;
  --train-n: #159A69;
  --bus-n: #2E8FD8;
  --car-n: #93A0BC;

  --serif: 'Piazzolla', 'Times New Roman', Georgia, serif;
  --sans: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --gutter: clamp(16px, 3vw, 44px);
  --max: 1440px;
  --radius: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: auto; }
html[data-motion='on'] { scroll-behavior: smooth; }

body {
  margin: 0;
  font: 400 16px/1.5 var(--sans);
  color: var(--ink);
  background: var(--day);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
svg { display: block; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px; }

.wrap {
  width: min(100% - var(--gutter) * 2, var(--max));
  margin-inline: auto;
}

/* ---------- Ночь: запрос ---------- */

.hero {
  background: var(--night);
  color: var(--on-night);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: clip;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-mark { width: 44px; height: 30px; }
.brand-name { font: 500 26px/1 var(--serif); letter-spacing: -0.01em; }

.nav-links { display: flex; gap: 28px; font-size: 15px; }
.nav-links a { color: var(--muted-n); text-decoration: none; }
.nav-links a:hover { color: var(--on-night); }

.ask-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(32px, 6vh, 80px) clamp(40px, 8vh, 96px);
  position: relative;
}

.lede {
  font-size: clamp(15px, 1.15vw, 18px);
  color: var(--muted-n);
  max-width: 44ch;
  margin-bottom: clamp(28px, 4vh, 56px);
}

.ask {
  font: 500 clamp(38px, 6.4vw, 104px) / 1.04 var(--serif);
  letter-spacing: -0.018em;
  max-width: 18ch;
  text-wrap: balance;
}
.ask-line { display: block; }

.slot {
  display: inline;
  padding: 0 0.05em;
  margin: 0;
  border: 0;
  border-bottom: 0.045em dotted var(--muted-n);
  border-radius: 0;
  background: none;
  font: inherit;
  font-style: italic;
  font-weight: 400;
  color: inherit;
  line-height: 1;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.slot:hover { border-bottom-color: var(--on-night); }
.slot.is-open,
.slot:focus-visible {
  background: var(--on-night);
  color: var(--night);
  border-bottom-color: transparent;
  border-radius: 0.14em;
  outline: none;
}
.slot-quiet { color: var(--muted-n); }

.ask-sub {
  margin-top: clamp(24px, 3.5vh, 44px);
  font: 400 clamp(19px, 1.7vw, 27px) / 1.35 var(--serif);
  color: var(--muted-n);
  max-width: 58ch;
}
.ask-sub .slot { color: var(--on-night); }

.ask-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 26px;
  font-size: 15px;
  color: var(--muted-n);
}
.opt { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.opt input {
  appearance: none;
  width: 34px;
  height: 20px;
  margin: 0;
  border-radius: 999px;
  background: var(--night-3);
  border: 1px solid var(--hair-n);
  position: relative;
  cursor: pointer;
  transition: background-color 0.18s var(--ease);
}
.opt input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted-n);
  transition: transform 0.18s var(--ease), background-color 0.18s var(--ease);
}
.opt input:checked { background: var(--on-night); border-color: var(--on-night); }
.opt input:checked::after { transform: translateX(14px); background: var(--night); }
.opt:has(input:checked) { color: var(--on-night); }

.go-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 18px 36px;
  margin-top: clamp(30px, 5vh, 56px);
}

.go {
  height: 64px;
  padding: 0 34px;
  border: 0;
  border-radius: 999px;
  background: var(--on-night);
  color: var(--night);
  font-size: 18px;
  font-weight: 500;
  transition: transform 0.18s var(--ease), opacity 0.18s var(--ease);
}
.go:hover { transform: translateY(-1px); }
.go:active { transform: translateY(0); }
.go[disabled] { opacity: 0.6; cursor: progress; }

.scan {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted-n);
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.scan li { opacity: 0; transform: translateY(4px); }
html[data-motion='off'] .scan li,
.scan li.is-in { opacity: 1; transform: none; transition: opacity 0.3s var(--ease), transform 0.3s var(--ease); }
.scan li strong { color: var(--on-night); font-weight: 500; }

/* Поповер под активным слотом */
.popover {
  position: absolute;
  z-index: 20;
  min-width: 280px;
  max-width: min(420px, calc(100vw - 32px));
  background: var(--day-2);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(4, 8, 20, 0.45), 0 2px 8px rgba(4, 8, 20, 0.3);
  padding: 14px;
  font-size: 15px;
}
.popover[hidden] { display: none; }
.pop-title { font: 500 13px/1.3 var(--sans); color: var(--muted-d); margin-bottom: 10px; }
.pop-search {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--hair-d);
  border-radius: 10px;
  font: inherit;
  margin-bottom: 8px;
  background: var(--day);
}
.pop-search:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.pop-list { max-height: 300px; overflow: auto; margin: 0 -6px; }
.pop-group { font-size: 12px; color: var(--muted-d); padding: 10px 8px 4px; }
.pop-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  padding: 8px 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  text-align: left;
}
.pop-item:hover, .pop-item:focus-visible { background: var(--day); outline: none; }
.pop-item.is-current { background: var(--ink); color: var(--day-2); }
.pop-item small { color: var(--muted-d); font-size: 12px; white-space: nowrap; }
.pop-item.is-current small { color: rgba(255, 255, 255, 0.7); }

.pop-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.pop-row + .pop-row { border-top: 1px solid var(--hair-d); }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--hair-d);
  border-radius: 10px;
  background: var(--day-2);
  font-size: 18px;
  line-height: 1;
}
.stepper button:hover { background: var(--day); }
.stepper output { min-width: 84px; text-align: center; font: 500 18px/1 var(--serif); font-variant-numeric: tabular-nums; }
.pop-input {
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--hair-d);
  border-radius: 10px;
  font: inherit;
  background: var(--day);
  width: 100%;
}
.pop-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--hair-d);
  border-radius: 999px;
  background: var(--day-2);
  font-size: 14px;
}
.chip-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.chip-toggle:has(input:checked) { background: var(--ink); color: var(--day-2); border-color: var(--ink); }
.chip-toggle .ico { width: 16px; height: 16px; fill: currentColor; }
.pop-hint { font-size: 13px; color: var(--muted-d); margin-top: 10px; line-height: 1.4; }

/* ---------- День: результаты ---------- */

.results { padding-block: clamp(40px, 6vw, 88px) clamp(48px, 6vw, 96px); }
.results[hidden] { display: none; }

.results-head { max-width: 76ch; }
.results-title {
  font: 500 clamp(36px, 4.6vw, 68px) / 1.02 var(--serif);
  letter-spacing: -0.015em;
}
.results-sub {
  margin-top: 10px;
  font: 400 clamp(18px, 1.5vw, 24px) / 1.3 var(--serif);
  color: var(--muted-d);
}
.baseline {
  margin-top: 22px;
  padding: 16px 18px;
  border-left: 3px solid var(--ink);
  background: var(--day-2);
  border-radius: 0 10px 10px 0;
  font-size: 16px;
  line-height: 1.5;
  max-width: 64ch;
}
.baseline strong { font-weight: 500; }

.results-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 3vw, 56px);
  margin-top: clamp(32px, 4vw, 56px);
  align-items: start;
}

.scen-list { border-bottom: 1px solid var(--hair-d); }
.scen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'title nums' 'chain chain' 'why why' 'flags flags';
  gap: 6px 20px;
  padding: 20px 16px;
  margin: 0 -16px;
  border-top: 1px solid var(--hair-d);
  cursor: pointer;
  transition: background-color 0.18s var(--ease);
}
.scen:hover { background: rgba(255, 255, 255, 0.55); }
.scen.is-active { background: var(--day-2); border-radius: 12px; border-top-color: transparent; }
.scen.is-active + .scen { border-top-color: transparent; }
.idx {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--hair-d);
  font: 500 12px/1 var(--sans);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.scen.is-active .idx { background: var(--ink); color: var(--day-2); border-color: var(--ink); }
.scen-title { grid-area: title; font-size: 14px; color: var(--muted-d); display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.scen-title b { font-weight: 500; color: var(--ink); }
.scen-title .also { font-size: 13px; }
.scen-nums {
  grid-area: nums;
  font: 500 clamp(24px, 2vw, 30px) / 1 var(--serif);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}
.scen-nums small { display: block; margin-top: 4px; font: 400 14px/1 var(--sans); color: var(--muted-d); }
.scen-chain { grid-area: chain; font-size: 15px; line-height: 1.5; min-width: 0; overflow-wrap: anywhere; }
.chain-city { white-space: nowrap; }
.scen-why { grid-area: why; font-size: 14px; color: var(--muted-d); line-height: 1.45; }
.scen-flags { grid-area: flags; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.flag {
  font-size: 12px;
  line-height: 1;
  padding: 6px 9px;
  border: 1px solid var(--hair-d);
  border-radius: 999px;
  color: var(--muted-d);
  background: transparent;
}
.flag.risk-1 { border-color: rgba(210, 69, 21, 0.4); color: var(--plane); }
.flag.risk-2 { background: var(--plane); border-color: var(--plane); color: #fff; }

.chain-sep { color: var(--muted-d); }
.mode { font-weight: 500; white-space: nowrap; }
.mode .ico { width: 15px; height: 15px; display: inline-block; vertical-align: -2px; margin-right: 4px; fill: currentColor; }
.mode.m-plane { color: var(--plane); }
.mode.m-train { color: var(--train); }
.mode.m-bus { color: var(--bus); }
.mode.m-car { color: var(--car); }

.detail { position: sticky; top: 20px; }

.map-card {
  position: relative;
  background: var(--night);
  color: var(--on-night);
  border-radius: var(--radius);
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.map-card svg { width: 100%; height: 100%; }
.map-legend {
  position: absolute;
  left: 14px;
  bottom: 12px;
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--muted-n);
}
.map-legend li { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { width: 14px; height: 0; border-top: 2px solid currentColor; display: inline-block; }
.map-legend .m-plane { color: var(--plane-n); }
.map-legend .m-train { color: var(--train-n); }
.map-legend .m-bus { color: var(--bus-n); }
.map-legend .m-car { color: var(--car-n); }
.map-legend .m-train i, .map-legend .m-bus i, .map-legend .m-car i { border-top-style: dashed; }

.map-land { fill: #1F2D55; }
.map-grat { fill: none; stroke: rgba(241, 244, 250, 0.09); stroke-width: 0.6; }
.map-route { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.map-route.ghost { stroke: rgba(241, 244, 250, 0.22); stroke-width: 1.2; }
.map-route.m-plane { stroke: var(--plane-n); }
.map-route.m-train { stroke: var(--train-n); stroke-dasharray: 5 4; }
.map-route.m-bus { stroke: var(--bus-n); stroke-dasharray: 5 4; }
.map-route.m-car { stroke: var(--car-n); stroke-dasharray: 2 4; }
.map-route.m-hidden { stroke: var(--plane-n); stroke-dasharray: 1 6; opacity: 0.6; }
.map-city { fill: var(--on-night); stroke: var(--night); stroke-width: 1.5; }
.map-label { font: 500 12px var(--sans); fill: var(--on-night); paint-order: stroke; stroke: var(--night); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.map-label.minor { fill: var(--muted-n); font-weight: 400; }
.map-empty { font: 400 14px var(--sans); fill: var(--muted-n); }

.detail-body { margin-top: 22px; }
.detail-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.detail-head > div:first-child { min-width: 0; flex: 1 1 320px; }
.detail-title { font: 500 clamp(22px, 1.9vw, 28px) / 1.2 var(--serif); letter-spacing: -0.01em; max-width: 34ch; overflow-wrap: anywhere; }
.detail-title .mode { font-family: var(--sans); font-size: 0.62em; vertical-align: 0.12em; }
.detail-when { font-size: 14px; color: var(--muted-d); margin-top: 8px; line-height: 1.5; }
.detail-nums { text-align: right; font: 500 28px/1 var(--serif); font-variant-numeric: tabular-nums; white-space: nowrap; }
.detail-nums small { display: block; margin-top: 6px; font: 400 14px/1.3 var(--sans); color: var(--muted-d); }

.share {
  margin-top: 14px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--hair-d);
  border-radius: 999px;
  background: var(--day-2);
  font-size: 14px;
}
.share:hover { background: var(--day); }

.timeline { margin-top: 26px; display: grid; grid-template-columns: 64px 28px 1fr; row-gap: 0; }
.tl-time { font-size: 13px; color: var(--muted-d); font-variant-numeric: tabular-nums; padding-top: 3px; line-height: 1.35; }
.tl-time b { display: block; font-weight: 500; color: var(--ink); font-size: 14px; }
.tl-rail { position: relative; }
.tl-rail::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 0;
  bottom: 0;
  border-left: 2px solid var(--hair-d);
}
.tl-rail.m-plane::before { border-color: var(--plane); }
.tl-rail.m-train::before { border-color: var(--train); border-left-style: dashed; }
.tl-rail.m-bus::before { border-color: var(--bus); border-left-style: dashed; }
.tl-rail.m-car::before { border-color: var(--car); border-left-style: dotted; }
.tl-rail .dot {
  position: absolute;
  left: 8px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--day);
  border: 2px solid var(--ink);
}
.tl-rail.is-first .dot, .tl-rail.is-last .dot { background: var(--ink); }
.tl-body { padding: 0 0 22px 4px; }
.tl-body.quiet { padding-bottom: 16px; }
.tl-title { font-weight: 500; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-title .ico { width: 16px; height: 16px; fill: currentColor; }
.tl-title.m-plane .ico { color: var(--plane); }
.tl-title.m-train .ico { color: var(--train); }
.tl-title.m-bus .ico { color: var(--bus); }
.tl-title.m-car .ico { color: var(--car); }
.tl-meta { font-size: 13.5px; color: var(--muted-d); margin-top: 3px; line-height: 1.45; }
.tl-meta a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--hair-d); }
.tl-meta a:hover { text-decoration-color: currentColor; }
.tl-body.quiet .tl-title { font-weight: 400; color: var(--muted-d); font-size: 14px; }

.tickets { margin-top: 10px; }
.tickets-note { font-size: 13px; color: var(--muted-d); margin: -4px 0 12px; line-height: 1.45; max-width: 60ch; }
.tickets h4, .know h4 { font: 500 14px/1.3 var(--sans); color: var(--muted-d); margin: 0 0 10px; }
.ticket {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding: 14px 16px;
  background: var(--day-2);
  border-radius: 12px;
  margin-bottom: 8px;
  align-items: center;
}
.ticket-name { font-weight: 500; }
.ticket-route { font-size: 13.5px; color: var(--muted-d); }
.ticket-price { font: 500 22px/1 var(--serif); font-variant-numeric: tabular-nums; text-align: right; }
.ticket-link {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--hair-d);
  margin-top: 2px;
}
.ticket-link:hover { border-color: currentColor; }
.ticket-link .ico { width: 14px; height: 14px; fill: currentColor; }
.ticket.ghost-note { background: rgba(210, 69, 21, 0.08); }
.ticket .sum { font-size: 13.5px; color: var(--muted-d); }

.know { margin-top: 22px; }
.know li { font-size: 14px; line-height: 1.5; padding: 8px 0; border-top: 1px solid var(--hair-d); }
.know li b { font-weight: 500; }

.analysis {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(24px, 3vw, 56px);
  margin-top: clamp(48px, 6vw, 96px);
  padding-top: clamp(32px, 4vw, 56px);
  border-top: 1px solid var(--hair-d);
}
.analysis h3 { font: 500 clamp(22px, 2vw, 30px) / 1.15 var(--serif); letter-spacing: -0.01em; }
.hint { font-size: 14px; color: var(--muted-d); margin-top: 6px; max-width: 56ch; line-height: 1.45; }
.pareto-wrap { position: relative; margin-top: 18px; }
.pareto-wrap svg { width: 100%; height: auto; }
.p-grid { stroke: var(--hair-d); stroke-width: 1; }
.p-axis { font: 400 12px var(--sans); fill: var(--muted-d); }
.p-dot { fill: var(--muted-d); opacity: 0.35; }
.p-dot:hover { opacity: 0.9; }
.p-scen { fill: var(--day); stroke: var(--ink); stroke-width: 1.6; }
.p-scen.is-active { fill: var(--ink); }
.p-label { font: 500 12px var(--sans); fill: var(--ink); paint-order: stroke; stroke: var(--day); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.p-hit { fill: transparent; cursor: pointer; }
.tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background: var(--ink);
  color: var(--on-night);
  font-size: 13px;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: 8px;
  max-width: 280px;
  transform: translate(-50%, calc(-100% - 12px));
}
.tip[hidden] { display: none; }
.tip b { font-weight: 500; }

.calendar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-top: 18px; align-items: end; }
.cal-day { text-align: center; font-size: 13px; color: var(--muted-d); }
.cal-bar { display: flex; flex-direction: column; justify-content: flex-end; height: 120px; }
.cal-bar i { display: block; background: var(--muted-d); opacity: 0.35; border-radius: 4px 4px 0 0; }
.cal-day.is-picked .cal-bar i { background: var(--ink); opacity: 1; }
.cal-day.is-best .cal-price { color: var(--ink); font-weight: 500; }
.cal-price { margin-top: 8px; font-variant-numeric: tabular-nums; }
.cal-date { margin-top: 2px; }
.cal-day.is-picked .cal-date { color: var(--ink); font-weight: 500; }

/* ---------- Как считаем ---------- */

.how { background: var(--day-2); padding-block: clamp(48px, 6vw, 96px); }
.how h2 { font: 500 clamp(32px, 3.6vw, 52px) / 1.05 var(--serif); letter-spacing: -0.015em; }
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 2.5vw, 40px);
  margin-top: clamp(28px, 3vw, 48px);
  counter-reset: step;
}
.steps li { counter-increment: step; padding-top: 16px; border-top: 1px solid var(--hair-d); }
.steps li::before {
  content: counter(step);
  display: block;
  font: 400 clamp(28px, 2.4vw, 36px) / 1 var(--serif);
  color: var(--muted-d);
  margin-bottom: 14px;
}
.steps h3 { font: 500 18px/1.3 var(--sans); }
.steps p { margin-top: 8px; font-size: 15px; line-height: 1.55; color: var(--muted-d); }
.disclaimer { margin-top: clamp(28px, 3vw, 48px); font-size: 14px; color: var(--muted-d); max-width: 70ch; line-height: 1.5; }

.foot { background: var(--night); color: var(--muted-n); font-size: 14px; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding-block: 26px; }
.foot a { color: var(--on-night); text-decoration: none; }

/* ---------- Появление результатов ---------- */
html[data-motion='on'] .results.is-in { animation: rise 0.6s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
html[data-motion='on'] .map-route.draw { stroke-dasharray: var(--len) var(--len); stroke-dashoffset: var(--len); animation: draw 1.1s var(--ease) forwards; animation-delay: var(--delay, 0s); }
@keyframes draw { to { stroke-dashoffset: 0; } }

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

@media (max-width: 1080px) {
  .results-grid { grid-template-columns: 1fr; }
  .detail { position: static; }
  .analysis { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .nav-links { gap: 18px; font-size: 14px; }
  .brand-name { font-size: 22px; }
  .ask { max-width: none; }
  .ask-sub { font-size: 18px; }
  .go { width: 100%; }
  .go-row { flex-direction: column; align-items: stretch; }
  .scan { min-height: 0; }
  .popover {
    position: fixed;
    left: 12px !important;
    right: 12px;
    top: auto !important;
    bottom: 12px;
    max-width: none;
    max-height: 70vh;
    overflow: auto;
  }
  .scen { margin: 0; padding: 18px 0; border-radius: 0; }
  .scen.is-active { margin: 0 calc(-1 * var(--gutter)); padding: 18px var(--gutter); }
  .scen-nums { font-size: 22px; }
  .timeline { grid-template-columns: 52px 24px 1fr; }
  .tl-time { font-size: 12px; }
  .steps { grid-template-columns: 1fr; }
  .map-card { aspect-ratio: 4 / 3; }
  .map-legend { gap: 10px; font-size: 11px; }
  .detail-head { flex-direction: column; }
  .detail-nums { text-align: left; }
}
