/* «Попутчик» — дизайн-система «Путевой наряд».
   Токены и фирменные компоненты перенесены 1:1 из design/mockup.html. */

:root {
  --paper: #F5F2E9; --blank: #FFFFFF; --ink: #1D2129; --ink-2: #5C6167;
  --signal: #FF6A13; --signal-text: #B84A00; --go: #1E7F4F; --stop: #C42B1C;
  --dispatch: #24548F; --warn: #F2B705;
  --line: #D8D3C4; --amber-num: #B84A00; --badge-vio: #6A4FB0;
  --chart-1: #FF6A13; --chart-2: #24548F;
  --display: "Bahnschrift SemiCondensed", "Bahnschrift", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15181C; --blank: #1F242B; --ink: #ECEAE2; --ink-2: #A8ADB5;
    --signal: #FF7A1A; --signal-text: #FF7A1A; --go: #3DBE7B; --stop: #E5533D;
    --dispatch: #5B8FD4; --warn: #C99A0B;
    --line: #343941; --amber-num: #FFC53D; --badge-vio: #A992E0;
    --chart-1: #E4650F; --chart-2: #5B8FD4;
  }
}
:root[data-theme="light"] {
  --paper: #F5F2E9; --blank: #FFFFFF; --ink: #1D2129; --ink-2: #5C6167;
  --signal: #FF6A13; --signal-text: #B84A00; --go: #1E7F4F; --stop: #C42B1C;
  --dispatch: #24548F; --warn: #F2B705;
  --line: #D8D3C4; --amber-num: #B84A00; --badge-vio: #6A4FB0;
  --chart-1: #FF6A13; --chart-2: #24548F;
}
:root[data-theme="dark"] {
  --paper: #15181C; --blank: #1F242B; --ink: #ECEAE2; --ink-2: #A8ADB5;
  --signal: #FF7A1A; --signal-text: #FF7A1A; --go: #3DBE7B; --stop: #E5533D;
  --dispatch: #5B8FD4; --warn: #C99A0B;
  --line: #343941; --amber-num: #FFC53D; --badge-vio: #A992E0;
  --chart-1: #E4650F; --chart-2: #5B8FD4;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 17px; line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--signal-text); }

.disp { font-family: var(--display); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }

/* ── каркас приложения ─────────────────── */
.app-head { max-width: 640px; margin: 0 auto; padding: 14px 16px 0; }
.app-head[hidden] { display: none; }
.view {
  max-width: 640px; margin: 0 auto;
  padding: 12px 16px calc(88px + env(safe-area-inset-bottom));
  display: grid; gap: 14px; align-content: start;
}
.view.wide { max-width: 1020px; }

.shift-plate {
  background: var(--signal); color: #1D2129; padding: 8px 14px 10px; transform: rotate(-1.2deg);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
}
.shift-plate .d1 { font-family: var(--display); text-transform: uppercase; font-size: 24px; line-height: 1.05; letter-spacing: .03em; }
.shift-plate .d2 { font-size: 13px; font-weight: 600; }

.hero-plate {
  background: var(--signal); color: #1D2129;
  display: inline-block; padding: 10px 28px 14px;
  transform: rotate(-1.6deg);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
}
.hero-plate h1 { margin: 0; font-family: var(--display); text-transform: uppercase; font-size: clamp(44px, 12vw, 72px); line-height: .95; letter-spacing: .02em; }
.hatch-strip { height: 14px; margin-top: 18px;
  background: repeating-linear-gradient(45deg, var(--signal) 0 12px, transparent 12px 24px); opacity: .9; }

/* нижняя навигация */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; background: var(--blank); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar[hidden] { display: none; }
.tabbar a {
  flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; text-decoration: none; color: var(--ink-2); font-size: 11px; letter-spacing: .02em;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--signal-text); box-shadow: inset 0 3px 0 var(--signal); font-weight: 600; }
.tabbar a[hidden] { display: none; }

/* ── штампы, плашки, статусы ───────────── */
.stamp {
  display: inline-block; padding: 4px 14px; position: relative;
  font-family: var(--display); text-transform: uppercase; letter-spacing: .08em; font-size: 15px;
  border: 2px solid currentColor; transform: rotate(-3deg); border-radius: 2px;
}
.stamp::before { content: ""; position: absolute; inset: 3px; border: 1px solid currentColor; border-radius: 1px; }
.stamp.go { color: var(--go); }
.stamp.sig { color: var(--signal-text); }
.stamp.blue { color: var(--dispatch); }
.stamp.stop { color: var(--stop); }
.stamp.small { font-size: 11px; padding: 1px 8px; transform: rotate(-2deg); }
.stamp.big { font-size: 26px; padding: 8px 20px; }
.stamp-drop { animation: stampdrop .18s ease-out; }
@keyframes stampdrop {
  from { transform: rotate(-3deg) scale(1.6); opacity: 0; }
  to { transform: rotate(-3deg) scale(1); opacity: 1; }
}

.m-badge { font-family: var(--display); font-size: 13px; letter-spacing: .05em; color: #fff; background: var(--dispatch); border-radius: 20px; padding: 1px 10px; flex: none; }
.m-badge.pending { background: var(--ink-2); }
/* ночью фоны бейджей светлеют — тёмный текст держит контраст ≥4.5:1 */
@media (prefers-color-scheme: dark) { .m-badge { color: #15181C; } }
:root[data-theme="dark"] .m-badge { color: #15181C; }
:root[data-theme="light"] .m-badge { color: #fff; }

.offline, .hatch-note {
  background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--warn) 45%, transparent) 0 10px, transparent 10px 20px), var(--blank);
  border: 1px solid var(--warn); color: var(--ink); font-size: 13.5px; font-weight: 600; padding: 8px 12px; border-radius: 4px;
}

/* ── талон ─────────────────────────────── */
.talon { background: var(--blank); border: 1px solid var(--line); border-radius: 4px; position: relative; }
.talon .t-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 0; flex-wrap: wrap; }
.talon .t-num { font-family: var(--display); font-size: 15px; letter-spacing: .06em; text-transform: uppercase; }
.talon .t-body { padding: 8px 14px 12px; }
.tear { position: relative; border-top: 2px dashed var(--line); }
.tear::before, .tear::after {
  content: ""; position: absolute; top: -9px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line);
}
.tear::before { left: -9px; } .tear::after { right: -9px; }
.t-stub { padding: 10px 14px 12px; font-size: 13.5px; color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

.route-line { font-size: 15px; font-weight: 600; }
.route-meta { font-size: 13.5px; color: var(--ink-2); }

.board-h { font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.mini-talon { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
a.mini-talon { text-decoration: none; color: inherit; }
.mini-talon .who { font-size: 14px; line-height: 1.25; flex: 1; min-width: 0; }
.mini-talon .who small { color: var(--ink-2); display: block; }
.mini-talon .when { margin-left: auto; text-align: right; font-size: 14px; font-weight: 700; flex: none; }
.mini-talon .when small { display: block; font-weight: 400; color: var(--ink-2); }

/* ── большие кнопки ЕДУ / НЕ ЕДУ ───────── */
.btn-row { display: flex; gap: 10px; }
.btn { flex: 1; min-height: 64px; border-radius: 6px; border: 2px solid transparent; cursor: pointer;
  font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; font-size: 22px;
  display: flex; align-items: center; justify-content: center; transition: transform .15s ease; }
.btn:active { transform: scale(1.05); }
.btn:focus-visible { outline: 3px solid var(--dispatch); outline-offset: 2px; }
.btn-go { background: var(--go); color: #fff; }
.btn-no { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-go.stamped { box-shadow: inset 0 0 0 3px var(--blank), inset 0 0 0 5px rgba(255,255,255,.7); }

.btn-close { min-height: 56px; border-radius: 6px; border: none; background: var(--signal); color: #1D2129; cursor: pointer;
  font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; font-size: 19px; width: 100%; }
.btn-close:focus-visible { outline: 3px solid var(--dispatch); outline-offset: 2px; }

/* ── маршрутная лента ──────────────────── */
.lenta { position: relative; margin: 4px 0 4px 8px; padding-left: 22px; display: grid; gap: 14px; }
.lenta::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--ink); }
.stop-n { position: relative; font-size: 14.5px; }
.stop-n::before { content: ""; position: absolute; left: -22px; top: 5px; width: 10px; height: 10px; background: var(--paper); border: 2px solid var(--ink); }
.stop-n.fin::before { background: var(--signal); border-color: var(--signal); }
.stop-n .t { font-weight: 700; margin-right: 8px; }
.stop-n small { color: var(--ink-2); }

.plate-mini { display: inline-block; border: 2px solid var(--ink); border-radius: 3px; padding: 0 8px; font-family: var(--display); font-size: 16px; letter-spacing: .1em; background: var(--blank); }

/* ── жетоны (компостер) ────────────────── */
.tokens-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.token {
  min-height: 104px; border-radius: 12px; border: 2px solid var(--line); background: var(--blank);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  cursor: pointer; position: relative; font-family: var(--body); font-size: inherit;
  transition: transform .18s ease, border-color .18s ease; color: var(--ink); padding: 8px;
}
.token.static { cursor: default; }
.token .init { width: 44px; height: 44px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink-2);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }
.token .nm { font-size: 13.5px; }
.token .tab { font-size: 11.5px; color: var(--ink-2); letter-spacing: .06em; text-align: center; }
.token:focus-visible { outline: 3px solid var(--dispatch); outline-offset: 2px; }
.token.punched { border-color: var(--go); transform: rotate(2deg); }
.token.punched .init { border-color: var(--go); }
.token.punched::after {
  content: "✓"; position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--go); color: #fff; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 3px solid var(--paper);
}
.token.disputed { border-color: var(--warn); }

/* ── одометр ───────────────────────────── */
/* одометр — всегда тёмный «остров», цифры янтарные независимо от темы */
.odo { --amber-num: #FFC53D; display: flex; align-items: center; gap: 10px; background: #101214; border-radius: 8px; padding: 10px 14px; border: 1px solid #343941; }
.odo .sum { font-family: var(--display); font-size: 28px; letter-spacing: .05em; min-width: 118px; text-align: right; margin-left: auto; }
.odo .cap2 { color: #A8ADB5; font-size: 12.5px; line-height: 1.35; }

.closed-block { display: grid; gap: 14px; justify-items: start; background: var(--blank); border: 1px solid var(--line); border-radius: 4px; padding: 16px; }
.closed-block .odo { width: 100%; }

/* ── плитки и таблицы (админ, компенсация) ─ */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.tile { background: var(--blank); border: 1px solid var(--line); padding: 12px 14px; border-radius: 6px; }
.tile .lbl { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); }
.tile .val { font-family: var(--display); font-size: 30px; letter-spacing: .02em; margin-top: 2px; }
.tile.pay { border-color: var(--signal); box-shadow: inset 0 3px 0 var(--signal); }
.tile.pay .val { color: var(--signal-text); }

.reg { overflow-x: auto; background: var(--blank); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; }
table.rt { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 14px; }
.rt th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); font-weight: 600; padding: 8px 10px; border-bottom: 2px solid var(--ink); }
.rt td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rt tr:last-child td { border-bottom: none; }
.rt tr.disputed td { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--warn) 22%, transparent) 0 8px, transparent 8px 16px); }
.rt .sum-c { text-align: right; font-weight: 700; }
.rt tr.total td { border-top: 2px solid var(--ink); font-weight: 700; }

/* ── формы ─────────────────────────────── */
.form-grid { display: grid; gap: 14px; }
.form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); font-weight: 600; }
input, select, textarea {
  width: 100%; min-height: 48px; background: var(--blank); border: 1px solid var(--line);
  border-radius: 4px; color: var(--ink); font: inherit; padding: 8px 12px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid var(--dispatch); outline-offset: 1px;
}
input[type="checkbox"] { width: 24px; height: 24px; min-height: 0; accent-color: var(--signal); }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 48px; font-size: 15px; cursor: pointer; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-day {
  min-width: 48px; min-height: 48px; border: 2px solid var(--line); background: var(--blank); border-radius: 6px;
  color: var(--ink); font-family: var(--display); font-size: 15px; letter-spacing: .04em; cursor: pointer; padding: 0 12px;
  transition: transform .15s ease;
}
.chip-day:active { transform: scale(1.05); }
.chip-day.on { background: var(--signal); border-color: var(--signal); color: #1D2129; }
.chip-day:focus-visible { outline: 3px solid var(--dispatch); outline-offset: 2px; }

.btn2 {
  min-height: 48px; border-radius: 6px; border: 2px solid var(--ink); background: transparent; color: var(--ink);
  font-family: var(--display); text-transform: uppercase; letter-spacing: .05em; font-size: 16px;
  cursor: pointer; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; transition: transform .15s ease;
}
.btn2:active { transform: scale(1.04); }
.btn2:focus-visible { outline: 3px solid var(--dispatch); outline-offset: 2px; }
.btn2.primary { background: var(--signal); border-color: var(--signal); color: #1D2129; }
.btn2.go { background: var(--go); border-color: var(--go); color: #fff; }
.btn2.blue { border-color: var(--dispatch); color: var(--dispatch); }
.btn2.armed, .btn2.danger { background: var(--stop); border-color: var(--stop); color: #fff; }
.btn2.sm { min-height: 48px; font-size: 14px; padding: 0 12px; }
.btn2[disabled] { opacity: .5; cursor: default; }

.seg { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { flex: 1; min-height: 48px; border: none; background: var(--blank); color: var(--ink-2); font: inherit; cursor: pointer; }
.seg button.on { background: var(--ink); color: var(--paper); font-weight: 600; }
.seg button:focus-visible { outline: 3px solid var(--dispatch); outline-offset: -3px; }

/* конструктор точек маршрута */
.pt-list { display: grid; gap: 6px; }
.pt-row { display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); background: var(--paper); border-radius: 4px; padding: 6px 10px; font-size: 15px; }
.pt-row .seq { font-family: var(--display); color: var(--ink-2); min-width: 22px; }
.pt-row .pt-t { flex: 1; min-width: 0; }
.pt-row .pt-t small { color: var(--ink-2); }
.pt-row button { min-width: 48px; min-height: 48px; border: 1px solid var(--line); background: var(--blank); border-radius: 4px; cursor: pointer; color: var(--ink); font-size: 16px; }
.search-res { display: grid; gap: 6px; }
.search-res button {
  display: block; width: 100%; text-align: left; min-height: 48px; border: 1px solid var(--line);
  background: var(--blank); border-radius: 4px; padding: 8px 12px; font: inherit; color: var(--ink); cursor: pointer;
}
.search-res button small { color: var(--ink-2); }

.route-pick { display: grid; gap: 8px; }
.route-pick label { display: flex; gap: 10px; align-items: center; min-height: 48px; border: 1px solid var(--line); border-radius: 4px; padding: 6px 12px; background: var(--paper); cursor: pointer; font-size: 15px; }
.route-pick input { width: 22px; height: 22px; min-height: 0; flex: none; accent-color: var(--signal); }

/* ── прочее ────────────────────────────── */
.list { display: grid; gap: 10px; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sub-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px dashed var(--line); font-size: 15px; flex-wrap: wrap; }
.sub-row .nm { flex: 1; min-width: 140px; }
.sub-row small { color: var(--ink-2); display: block; }
.backlink { font-size: 14px; color: var(--signal-text); text-decoration: none; font-weight: 600; justify-self: start; }
.t-head-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.t-title { font-size: 24px; }
.sec-h { font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; font-size: 16px; margin: 10px 0 0; }
.empty { border: 2px dashed var(--line); border-radius: 6px; padding: 22px 16px; text-align: center; color: var(--ink-2); font-size: 15px; }
.loading { text-align: center; color: var(--ink-2); font-family: var(--display); letter-spacing: .12em; text-transform: uppercase; padding: 36px 0; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.login-list { display: grid; gap: 10px; }
.login-card {
  display: flex; align-items: center; gap: 12px; min-height: 64px; background: var(--blank);
  border: 1px solid var(--line); border-radius: 4px; padding: 10px 14px; cursor: pointer;
  font: inherit; color: var(--ink); text-align: left; width: 100%;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  transition: transform .15s ease;
}
.login-card:active { transform: scale(1.02); }
/* clip-path срезает наружный outline — уводим фокус внутрь (WCAG 2.4.7) */
.login-card:focus-visible { outline: 3px solid var(--dispatch); outline-offset: -3px; }
.login-card .init { width: 44px; height: 44px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink-2); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.login-card small { color: var(--ink-2); display: block; }

.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav .lbl { flex: 1; text-align: center; font-family: var(--display); text-transform: uppercase; letter-spacing: .05em; font-size: 22px; }
.month-nav button { width: 48px; height: 48px; border: 1px solid var(--line); background: var(--blank); border-radius: 6px; font-size: 20px; color: var(--ink); cursor: pointer; }

.toasts {
  position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom));
  display: grid; gap: 8px; z-index: 40; justify-items: center; pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 4px; font-size: 14.5px;
  max-width: 520px; box-shadow: 0 8px 24px -12px rgba(0,0,0,.5); animation: toast-in .18s ease;
  border-left: 6px solid var(--stop);
}
.toast.ok { border-left-color: var(--go); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 480px) {
  .form-row2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ── ночная смена: табличные цифры светятся янтарём (DESIGN.md) ──
   Применяем к .num, но исключаем поля ввода и оранжевую плашку смены,
   где янтарь на янтаре/оранжевом был бы нечитаем. */
@media (prefers-color-scheme: dark) {
  .num { color: var(--amber-num); }
  input.num, select.num, textarea.num { color: var(--ink); }
  .shift-plate .num { color: #1D2129; }
}
:root[data-theme="dark"] .num { color: var(--amber-num); }
:root[data-theme="dark"] input.num,
:root[data-theme="dark"] select.num,
:root[data-theme="dark"] textarea.num { color: var(--ink); }
:root[data-theme="dark"] .shift-plate .num { color: #1D2129; }
:root[data-theme="light"] .num { color: inherit; }
/* одометр перекрывает общие правила (равная специфичность → последним) */
.odo .sum { color: var(--amber-num); }

/* ── дашборд: bar-чарт (реюз вёрстки Диспетчерской, DESIGN.md) ── */
.chart { border: 1px solid var(--line); border-radius: 6px; padding: 14px; background: var(--blank); }
.chart h4 { margin: 0 0 2px; font-size: 15px; }
.chart .sub { font-size: 12.5px; color: var(--ink-2); margin-bottom: 10px; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; flex-wrap: wrap; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 5px; vertical-align: -1px; }
.bars-wrap { overflow-x: auto; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 132px; border-bottom: 1px solid var(--line); padding: 0 2px; }
.day-g { flex: 1; min-width: 22px; display: flex; align-items: flex-end; justify-content: center; height: 100%; position: relative; }
.bar { width: 62%; max-width: 16px; border-radius: 4px 4px 0 0; min-height: 3px; position: relative; }
.bar.f { background: var(--chart-1); }
.bar.b { background: var(--chart-2); }
/* подпись значения над столбцом — высокий контраст, т.к. у оранжевого низкий (DESIGN.md) */
.bar-v { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600;
  color: var(--ink); font-variant-numeric: tabular-nums; }
.x-lbls { display: flex; gap: 4px; padding: 6px 2px 0; }
.x-lbls span { flex: 1; min-width: 22px; text-align: center; font-size: 10.5px; color: var(--ink-2); }

/* ══ ФАЗА 3 ══════════════════════════════════════════ */

/* «Вам по пути» — причины подбора списком с галочкой */
.why { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.why li { position: relative; padding-left: 20px; font-size: 13px; color: var(--ink-2); }
.why li::before { content: "✓"; position: absolute; left: 2px; top: 0; color: var(--go); font-weight: 700; }

/* ── карта маршрутов (схематичный SVG, без внешних тайлов) ── */
.map-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--blank);
  border: 1px solid var(--line); border-radius: 6px; padding: 12px 6px; }
.map-wrap svg { display: block; }
/* подписи узлов с «гало» цветом бумаги — читаемо поверх линий в обеих темах */
.mnode-t { fill: var(--ink); font-family: var(--body); font-size: 12px; font-weight: 600;
  paint-order: stroke; stroke: var(--paper); stroke-width: 3px; stroke-linejoin: round; }
.mnode-s { fill: var(--ink-2); font-size: 10.5px; font-weight: 400; }
/* плашка M-кода на линии: как .m-badge — светлый текст днём, тёмный ночью */
.mcap-t { fill: #fff; font-family: var(--display); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
@media (prefers-color-scheme: dark) { .mcap-t { fill: #15181C; } }
:root[data-theme="dark"] .mcap-t { fill: #15181C; }
:root[data-theme="light"] .mcap-t { fill: #fff; }

/* ── HR: разбивка по населённым пунктам (горизонтальные бары) ── */
.tile .tile-sub { font-size: 11px; color: var(--ink-2); margin-top: 3px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.tile .val .unit { font-family: var(--body); font-size: 15px; font-weight: 400; color: var(--ink-2); letter-spacing: 0; }
.hbars { display: grid; gap: 8px; margin-top: 6px; }
.hbar-row { display: grid; grid-template-columns: minmax(72px, 1.1fr) 2fr auto; gap: 10px; align-items: center; }
.hbar-lbl { font-size: 13px; }
.hbar-track { height: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--chart-1); border-radius: 2px 0 0 2px; }
.hbar-val { font-size: 13px; font-weight: 700; text-align: right; white-space: nowrap; }
.hbar-val small { display: block; font-weight: 400; font-size: 11px; color: var(--ink-2); }

/* нижняя навигация: 6 вкладок — держим подписи в одну строку */
.tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── тумблер (уведомления) ── */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px;
  background: var(--blank); border: 1px solid var(--line); border-radius: 6px; padding: 8px 14px; cursor: pointer; }
.switch.off { opacity: .6; cursor: default; }
.switch .sw-txt { font-size: 15px; }
.switch .sw-txt small { display: block; color: var(--ink-2); font-size: 13px; }
.switch input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 52px; height: 30px; min-height: 0;
  flex: none; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .15s ease; }
.switch input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
  border-radius: 50%; background: var(--blank); box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform .15s ease; }
.switch input[type="checkbox"]:checked { background: var(--go); }
.switch input[type="checkbox"]:checked::after { transform: translateX(22px); }
.switch input[type="checkbox"]:disabled { cursor: default; }
.switch input[type="checkbox"]:focus-visible { outline: 3px solid var(--dispatch); outline-offset: 2px; }
