/* ===== Тема: светлая (Яндекс/2ГИС) и тёмная ===== */
:root {
  --bg: #ffffff;
  --bg-soft: #f4f5f7;
  --bg-hover: #eef0f3;
  --text: #21201f;
  --text-2: #6b6f76;
  --text-3: #9aa0a8;
  --line: #e7e8ea;
  --accent: #2b7cff;        /* синий маршрута */
  --accent-press: #1a66e0;
  --yellow: #ffcc00;        /* фирменный жёлтый */
  --green: #19aa1e;         /* 2ГИС */
  --red: #ff3d3d;
  --amber: #ff9b0f;
  --shadow: 0 6px 24px rgba(0, 0, 0, .12), 0 1px 4px rgba(0, 0, 0, .06);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .12);
  --radius: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #1f2023;
  --bg-soft: #2a2b2f;
  --bg-hover: #323338;
  --text: #f2f2f3;
  --text-2: #a7abb3;
  --text-3: #767b84;
  --line: #34363b;
  --accent: #4c8dff;
  --accent-press: #3a7cf0;
  --shadow: 0 6px 24px rgba(0, 0, 0, .45), 0 1px 4px rgba(0, 0, 0, .3);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font: 15px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input { font: inherit; color: inherit; }
svg { fill: currentColor; }

#map { position: fixed; inset: 0; }

/* ===== Панель ===== */
.panel {
  position: fixed; z-index: 10;
  top: 16px; left: 16px; bottom: 16px;
  width: 384px;
  display: flex; flex-direction: column;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: panel-in .5s var(--ease) backwards;
}
@keyframes panel-in { from { opacity: 0; transform: translateX(-24px); } }
.sheet-handle { display: none; }

.search {
  display: flex; align-items: center; gap: 4px;
  margin: 12px; padding: 0 4px 0 12px;
  height: 48px;
  background: var(--bg-soft);
  border-radius: 12px;
  transition: box-shadow .2s, background .2s;
}
.search:focus-within { background: var(--bg); box-shadow: 0 0 0 2px var(--yellow) inset; }
.search .ico { width: 20px; height: 20px; color: var(--text-3); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 0 6px; height: 100%; }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear { width: 32px; height: 32px; border-radius: 8px; font-size: 22px; color: var(--text-3); }
.search-clear:hover { background: var(--bg-hover); }
.route-btn {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  transition: transform .15s, background .15s;
}
.route-btn svg { width: 20px; height: 20px; }
.route-btn:hover { background: var(--accent-press); }
.route-btn:active { transform: scale(.94); }

/* Вкладки с «чернилами» */
.tabs { position: relative; display: flex; padding: 0 12px; border-bottom: 1px solid var(--line); }
.tab {
  padding: 10px 12px 12px; font-weight: 600; color: var(--text-2);
  transition: color .2s;
}
.tab.active { color: var(--text); }
.tab-ink {
  position: absolute; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0;
  background: var(--yellow);
  transition: left .3s var(--ease), width .3s var(--ease);
}
.badge {
  display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px;
  border-radius: 10px; background: var(--red); color: #fff;
  font-size: 12px; line-height: 20px; text-align: center;
  transition: transform .3s var(--spring);
}
.badge.bump { transform: scale(1.35); }
.badge.zero { background: var(--bg-hover); color: var(--text-2); }

.tab-page { display: none; flex: 1; min-height: 0; flex-direction: column; }
.tab-page.active { display: flex; animation: fade-up .3s var(--ease); }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }

/* Статистика */
.stats { display: flex; align-items: center; gap: 8px; padding: 12px 16px 4px; }
.stat { display: flex; flex-direction: column; padding: 8px 12px; background: var(--bg-soft); border-radius: 12px; }
.stat.wide { flex: 1; min-width: 0; }
.stat b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat span { font-size: 12px; color: var(--text-2); }
.live { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--text-3); letter-spacing: .5px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.live.on { color: var(--green); }
.live.on i { background: var(--green); animation: live-pulse 1.6s infinite; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(25, 170, 30, .6); } 100% { box-shadow: 0 0 0 8px rgba(25, 170, 30, 0); } }

.filters { display: flex; gap: 6px; padding: 8px 16px; }
.chip {
  padding: 6px 12px; border-radius: 18px; font-size: 13px; font-weight: 500;
  background: var(--bg-soft); color: var(--text-2);
  transition: background .2s, color .2s, transform .15s;
}
.chip:hover { background: var(--bg-hover); }
.chip:active { transform: scale(.95); }
.chip.active { background: var(--text); color: var(--bg); }

/* Лента событий */
.feed { flex: 1; overflow-y: auto; padding: 4px 8px 16px; overscroll-behavior: contain; }
.feed::-webkit-scrollbar { width: 8px; }
.feed::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.card {
  position: relative;
  display: grid; grid-template-columns: 36px 1fr; gap: 4px 12px;
  padding: 12px; margin: 2px 0; border-radius: 12px;
  cursor: pointer;
  transition: background .2s, transform .2s var(--ease), opacity .4s, max-height .4s var(--ease);
  animation: card-in .45s var(--spring) backwards;
}
@keyframes card-in { from { opacity: 0; transform: translateY(-12px) scale(.97); } }
.card:hover, .card.hl { background: var(--bg-hover); }
.card:active { transform: scale(.985); }
.card.leaving { opacity: 0; transform: translateX(-20px); }
.card.fresh::after {
  content: ""; position: absolute; inset: 0; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 2px var(--yellow) inset;
  animation: fresh 2.4s ease-out forwards;
}
@keyframes fresh { to { box-shadow: 0 0 0 2px transparent inset; } }
.card-icon {
  grid-row: span 3; width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; color: #fff;
}
.card-icon svg { width: 20px; height: 20px; }
.card-icon.exact { background: var(--red); }
.card-icon.approx { background: var(--amber); }
.card-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.card-title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer {
  flex: none; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 2px 8px; border-radius: 10px; background: var(--bg-soft); color: var(--text-2);
}
.timer.low { background: rgba(255, 61, 61, .12); color: var(--red); }
.card-text { color: var(--text); font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; word-break: break-word; }
.card-meta { font-size: 12px; color: var(--text-2); display: flex; gap: 6px; flex-wrap: wrap; }
.prec { padding: 0 6px; border-radius: 6px; background: var(--bg-soft); }
.progress { grid-column: 2; height: 3px; border-radius: 2px; background: var(--bg-soft); overflow: hidden; margin-top: 4px; }
.progress i { display: block; height: 100%; background: var(--red); transform-origin: left; transition: transform 1s linear; }
.progress i.approx { background: var(--amber); }

.empty { text-align: center; color: var(--text-2); padding: 48px 24px; animation: fade-up .4s var(--ease); }
.empty svg { width: 56px; height: 56px; color: var(--line); margin-bottom: 8px; }


/* ===== Маршрут ===== */
.route-form { padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.route-points { position: relative; display: flex; flex-direction: column; gap: 6px; padding-right: 44px; }
.route-points::before {
  content: ""; position: absolute; left: 13px; top: 30px; bottom: 30px;
  border-left: 2px dotted var(--text-3);
}
.rp { display: flex; align-items: center; gap: 10px; }
.rp input {
  flex: 1; min-width: 0; height: 44px; padding: 0 12px;
  border: 0; outline: 0; border-radius: 10px; background: var(--bg-soft);
  transition: box-shadow .2s, background .2s;
}
.rp input:focus { background: var(--bg); box-shadow: 0 0 0 2px var(--accent) inset; }
.pin-dot {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.pin-dot.a { background: var(--green); }
.pin-dot.b { background: var(--red); }
.swap {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  color: var(--text-2); transition: background .2s, transform .3s var(--spring);
}
.swap svg { width: 20px; height: 20px; transform: rotate(90deg); }
.swap:hover { background: var(--bg-hover); }
.swap.spin { transform: translateY(-50%) rotate(180deg); }

.modes { display: flex; gap: 6px; background: var(--bg-soft); padding: 4px; border-radius: 12px; }
.mode {
  flex: 1; height: 36px; border-radius: 9px; display: grid; place-items: center; color: var(--text-2);
  transition: background .2s, color .2s, box-shadow .2s;
}
.mode svg { width: 22px; height: 22px; }
.mode.active { background: var(--bg); color: var(--text); box-shadow: var(--shadow-sm); }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.track { width: 44px; height: 26px; border-radius: 13px; background: var(--line); position: relative; transition: background .25s; flex: none; }
.thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .25s var(--spring); }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track .thumb { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 2px var(--accent); }

.primary {
  height: 48px; border-radius: 12px; font-weight: 600;
  background: var(--yellow); color: #21201f;
  transition: transform .15s, filter .2s;
}
.primary:hover { filter: brightness(.96); }
.primary:active { transform: scale(.98); }
.primary.loading { pointer-events: none; color: transparent; position: relative; }
.primary.loading::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px;
  border: 3px solid rgba(0, 0, 0, .2); border-top-color: #21201f; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.route-result { flex: 1; overflow-y: auto; padding: 0 16px 16px; animation: fade-up .35s var(--ease); }
.route-summary { display: flex; align-items: baseline; gap: 12px; padding: 12px 0 4px; }
.route-summary .time { font-size: 28px; font-weight: 700; }
.route-summary .dist { color: var(--text-2); }
.route-note { font-size: 13px; padding: 8px 12px; border-radius: 10px; margin: 6px 0; }
.route-note.ok { background: rgba(25, 170, 30, .1); color: var(--green); }
.route-note.warn { background: rgba(255, 155, 15, .12); color: #c46f00; }
:root[data-theme="dark"] .route-note.warn { color: var(--amber); }
.route-compare { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.maneuvers { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: m; }
.maneuvers li {
  display: flex; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line);
  font-size: 14px; cursor: pointer; border-radius: 8px;
  animation: card-in .35s var(--ease) backwards;
}
.maneuvers li:hover { background: var(--bg-hover); }
.maneuvers .m-dist { margin-left: auto; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ===== Кнопки карты ===== */
.map-controls {
  position: fixed; z-index: 5; right: 16px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 12px;
}
.ctrl-group { display: flex; flex-direction: column; background: var(--bg); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.ctrl {
  width: 48px; height: 48px; display: grid; place-items: center; background: var(--bg); color: var(--text);
  transition: background .15s;
}
.ctrl + .ctrl { border-top: 1px solid var(--line); }
.ctrl svg { width: 24px; height: 24px; }
.ctrl:hover { background: var(--bg-hover); }
.ctrl:active svg { transform: scale(.9); }
.ctrl.single { border-radius: 50%; box-shadow: var(--shadow); }
#compass-needle { transition: transform .2s; }
#locate.active { color: var(--accent); }

/* ===== Маркеры ===== */
.mm-marker { cursor: pointer; will-change: transform; }
.mm-pin {
  position: relative; width: 44px; height: 54px;
  transform-origin: 50% 100%;
  animation: pin-drop .6s var(--spring) backwards;
  transition: transform .2s var(--spring), opacity .4s;
}
@keyframes pin-drop {
  0% { transform: translateY(-40px) scale(.6); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: none; }
}
.mm-marker:hover .mm-pin, .mm-marker.hl .mm-pin { transform: translateY(-4px) scale(1.12); }
.mm-pin.leaving { transform: scale(0); opacity: 0; transition: transform .4s var(--ease), opacity .4s; }
.mm-pin svg.body { position: absolute; inset: 0; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .3)); }
.mm-pin .ring { position: absolute; left: 4px; top: 4px; width: 36px; height: 36px; transform: rotate(-90deg); }
.mm-pin .ring circle { fill: none; stroke-width: 3; }
.mm-pin .ring .bg { stroke: rgba(255, 255, 255, .35); }
.mm-pin .ring .fg { stroke: #fff; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.mm-pin .glyph { position: absolute; left: 12px; top: 12px; width: 20px; height: 20px; color: #fff; }
.mm-pulse {
  position: absolute; left: 50%; bottom: -6px; width: 16px; height: 8px; margin-left: -8px;
  border-radius: 50%; background: rgba(0, 0, 0, .25);
}
.mm-pulse::before, .mm-pulse::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 80px; height: 40px; margin: -20px -40px;
  border-radius: 50%; border: 2px solid var(--pin-color, var(--red));
  opacity: 0; animation: wave 2.4s ease-out 3;
}
.mm-pulse::after { animation-delay: .8s; }
@keyframes wave { 0% { transform: scale(.1); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }

.route-marker {
  width: 32px; height: 32px; border-radius: 50%; color: #fff; font-weight: 700;
  display: grid; place-items: center; border: 3px solid #fff; box-shadow: var(--shadow-sm);
  animation: pin-drop .5s var(--spring) backwards; cursor: grab;
}
.route-marker.a { background: var(--green); }
.route-marker.b { background: var(--red); }

/* Попап */
.maplibregl-popup-content {
  background: var(--bg); color: var(--text); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow);
  font: inherit; max-width: 300px;
}
.maplibregl-popup-tip { border-top-color: var(--bg) !important; border-bottom-color: var(--bg) !important; }
.maplibregl-popup-close-button { font-size: 20px; color: var(--text-3); right: 6px; top: 4px; }
.maplibregl-popup { animation: popup-in .25s var(--spring); }
@keyframes popup-in { from { opacity: 0; transform: translateY(6px) scale(.96); } }
.pp-title { font-weight: 700; margin: 0 16px 6px 0; }
.pp-text { font-size: 14px; margin-bottom: 8px; word-break: break-word; }
.pp-meta { font-size: 12px; color: var(--text-2); }
.pp-actions { display: flex; gap: 6px; margin-top: 10px; }
.pp-actions button { flex: 1; padding: 8px; border-radius: 8px; background: var(--bg-soft); font-size: 13px; font-weight: 600; }
.pp-actions button:hover { background: var(--bg-hover); }
.maplibregl-ctrl-attrib { background: rgba(255, 255, 255, .7) !important; border-radius: 8px 0 0 0; }
:root[data-theme="dark"] .maplibregl-ctrl-attrib { background: rgba(31, 32, 35, .7) !important; color: var(--text-2); }
:root[data-theme="dark"] .maplibregl-ctrl-attrib a { color: var(--text-2); }

/* Контекстное меню (правый клик / долгое нажатие) */
.ctx-menu {
  position: fixed; z-index: 30; min-width: 200px; padding: 6px;
  background: var(--bg); border-radius: 12px; box-shadow: var(--shadow);
  animation: popup-in .2s var(--spring);
}
.ctx-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 8px; text-align: left; font-size: 14px; }
.ctx-menu button:hover { background: var(--bg-hover); }
.ctx-menu .dot { width: 10px; height: 10px; border-radius: 50%; }

/* Тосты */
.toasts { position: fixed; z-index: 40; top: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 12px; background: var(--text); color: var(--bg);
  box-shadow: var(--shadow); font-size: 14px; max-width: min(90vw, 420px); cursor: pointer;
  animation: toast-in .4s var(--spring) both;
}
.toast.out { animation: toast-out .3s var(--ease) forwards; }
.toast i { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--red); }
.toast.err i { background: var(--amber); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-16px) scale(.95); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-12px); } }

/* ===== Мобильная версия: нижняя шторка ===== */
@media (max-width: 760px) {
  .panel {
    top: auto; left: 0; right: 0; bottom: 0; width: auto;
    height: 88vh; border-radius: 20px 20px 0 0;
    transform: translateY(var(--sheet-offset, 50vh));
    transition: transform .4s var(--ease);
    animation: sheet-in .5s var(--ease) backwards;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .panel.dragging { transition: none; }
  @keyframes sheet-in { from { transform: translateY(100%); } }
  .panel[data-snap="peek"] { --sheet-offset: calc(88vh - 150px); }
  .panel[data-snap="half"] { --sheet-offset: 44vh; }
  .panel[data-snap="full"] { --sheet-offset: 0px; }
  .sheet-handle { display: grid; place-items: center; height: 20px; cursor: grab; touch-action: none; }
  .sheet-handle span { width: 40px; height: 5px; border-radius: 3px; background: var(--line); }
  .search { margin-top: 4px; }
  .map-controls { top: 16px; transform: none; right: 12px; gap: 8px; }
  .ctrl { width: 44px; height: 44px; }
  .toasts { top: 12px; }
}

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

/* Пустая лента: действия вместо заглушки */
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; }
.empty-actions a { text-decoration: none; }
.chip.report { margin-left: auto; background: var(--yellow); color: #21201f; text-decoration: none; font-weight: 600; }
.chip.report:hover { filter: brightness(.96); background: var(--yellow); }
/* Первая загрузка ленты — тонкая полоса вместо заглушек */
.feed:empty { position: relative; min-height: 3px; }
.feed:empty::before { content: ""; position: absolute; left: 16px; right: 16px; top: 8px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent) no-repeat; background-size: 40% 100%; animation: feed-load 1.1s var(--ease) infinite; }
@keyframes feed-load { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* Моё местоположение: точная (GPS) — синяя с волной, примерная (IP) — бледная */
.me-wrap { width: 22px; height: 22px; cursor: pointer; }
.me-dot { position: relative; width: 22px; height: 22px; border-radius: 50%; background: #2b7cff; border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: background .3s; animation: pin-drop .5s var(--spring) backwards; }
.me-dot::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid #2b7cff; animation: me-wave 2s ease-out infinite; }
.me-dot.approx { background: #9cbcf5; }
.me-dot.approx::after { animation: none; border-style: dashed; opacity: .6; }
@keyframes me-wave { from { transform: scale(1); opacity: .8; } to { transform: scale(2.6); opacity: 0; } }

/* Подсказки адресов */
.has-suggest { position: relative; }
.suggest {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px);
  max-height: 320px; overflow-y: auto; padding: 6px;
  background: var(--bg); border-radius: 12px; box-shadow: var(--shadow);
  animation: popup-in .18s var(--ease);
}
.search .suggest { left: -4px; right: -4px; }
.rp .suggest { left: 38px; }
.sg-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.sg-item:hover, .sg-item.active { background: var(--bg-hover); }
.sg-ico { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-soft); color: var(--text-2); }
.sg-ico svg { width: 16px; height: 16px; }
.sg-item.me .sg-ico { background: rgba(43, 124, 255, .12); color: var(--accent); }
.sg-text { display: flex; flex-direction: column; min-width: 0; }
.sg-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-label b { font-weight: 700; }
.sg-sub { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Нормализация нативных элементов: одинаково в Chrome, Firefox, Safari */
input, button { -webkit-appearance: none; appearance: none; }
input[type=search]::-webkit-search-decoration, input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
input::placeholder { color: var(--text-3); opacity: 1; }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* Действия маршрута: построить + сбросить */
.route-actions { display: flex; gap: 8px; }
.route-actions .primary { flex: 1; }
.secondary { display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 14px; border-radius: 12px;
  background: var(--bg-soft); color: var(--text); font-weight: 600; transition: background .2s, transform .15s; }
.secondary svg { width: 18px; height: 18px; }
.secondary:hover { background: var(--bg-hover); }
.secondary:active { transform: scale(.97); }

/* Общественный транспорт: варианты поездки */
.itin { padding: 12px; margin: 6px 0; border-radius: 12px; border: 1px solid var(--line); cursor: pointer;
  transition: border-color .2s, background .2s; animation: card-in .35s var(--ease) backwards; }
.itin:hover { background: var(--bg-hover); }
.itin.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.itin-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.itin-head .time { font-size: 22px; font-weight: 700; }
.itin-head .dist { color: var(--text-2); font-variant-numeric: tabular-nums; }
.itin-meta { width: 100%; font-size: 12px; color: var(--text-2); }
.legs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 8px; }
.leg { display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px; border-radius: 8px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.leg.walk { background: var(--bg-soft); color: var(--text-2); font-weight: 600; }
.leg-sep { color: var(--text-3); }
.itin-steps { list-style: none; margin: 10px 0 0; padding: 0; }
.itin-steps li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.step-ico { width: 22px; flex: none; text-align: center; }
.muted-s { font-size: 12px; color: var(--text-2); }
.yandex-link { display: inline-flex; height: 40px; margin-top: 8px; text-decoration: none; font-size: 14px; }
.nearby { margin: 4px 0 8px; padding-left: 18px; font-size: 13px; color: var(--text-2); }
