@font-face { font-family: Golos; src: url(fonts/golos-lat.woff2) format('woff2'); font-weight: 400 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Golos; src: url(fonts/golos-latext.woff2) format('woff2'); font-weight: 400 700; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Golos; src: url(fonts/golos-cyr.woff2) format('woff2'); font-weight: 400 700; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Golos; src: url(fonts/golos-cyrext.woff2) format('woff2'); font-weight: 400 700; font-display: swap;
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }

/* Токены — karta/DESIGN-PLAN.md (не менять). Шесть цветов с ролями, одна гарнитура, шкала 20 / 24 / 32 / 44.
   Кнопки трёх видов: заливка (главное действие), контур (всё остальное), переключатель (выбор из 2–3). */
:root {
  --paper: #FFFFFF;
  --ink: #1B2422;          /* 15,9 : 1 на белом */
  --ink-2: #4B5452;        /* вторичный текст, 7,8 : 1 */
  --yellow: #FFCC00;       /* тактильная плитка: путь, «вы здесь», номер шага */
  --center: #0A6E62;       /* дверь центра и главные кнопки, белый текст 6,1 : 1 */
  --metro: #1F5BA8;        /* только участок метро */
  --unv: #5E6664;          /* «не проверено» — всегда со словом и штриховкой */
  --line: #D5D9D7;         /* подложка карты, волосяные линии */
  --hair: #E3E6E4;         /* разделители блоков */
  --ground: #F2F3F1;
  --fill: #E9EEE8;         /* заливка второстепенных кнопок: без рамок, форма — тоном */
  --fill-h: #DDE4DC;
  --fs: 1;                 /* множитель размера текста: 1 / 1.25 / 1.5 */
  --ui: min(1rem, 22px);   /* подписи элементов управления в шапке и полосе: растут, но не ломают ряд */
  --dock-h: 88px;
  --b: 2px;
  --r: 14px;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);   /* нижний лист */
  --dots: radial-gradient(circle, rgba(27,36,34,.24) 2px, transparent 2.6px);
  /* карта (01.12): рисунок один, цвета — отсюда; варианты вида — html.look-* ниже */
  /* вид B «Рельеф» (выбран Надыром 01.12): дома светлее земли и отбрасывают тень — свет с северо-запада, без линий */
  --m-ground: #DDE5DC; --m-road: #F7F9F5; --m-road-edge: none; --m-bld: #FBFCF9; --m-bld-edge: none; --m-bld-w: 0; --m-shade: #A9B7AB;
  --m-green: #CADBC2; --m-water: #A7C9DC; --m-site: #E3E1D2; --m-path: #8C9A8E;
  --peek: min(9.5rem, 30svh);   /* сколько листа с шагами видно под картой на первом экране */
  --map-h: max(21rem, calc(100svh - var(--dock-h) - var(--peek)));
  --top-h: 72px;                /* шапка над картой: Aa и UZ/RU */
  --float: 0 0 0 1px rgba(27,36,34,.10), 0 4px 14px -4px rgba(27,36,34,.30);
  color-scheme: light;
}
html.hc { --m-ground: #FFF; --m-road: #FFF; --m-road-edge: #000; --m-bld: #FFF; --m-bld-edge: #000; --m-bld-w: 1.2; --m-shade: none; --m-green: none; --m-site: none; --m-water: #000; --m-path: #000; --float: 0 0 0 3px #000;
  --ink: #000; --ink-2: #000; --unv: #000; --line: #000; --hair: #000; --ground: #FFF; --fill: #FFF; --fill-h: #FFF; --b: 3px; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: calc(20px * var(--fs)); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.45 Golos, system-ui, sans-serif; font-variant-numeric: tabular-nums;
  overflow-x: hidden; padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom, 0px));
}
h1, h2, h3, p, ol, ul, figure { margin: 0; }
button, a { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a, [role="button"] { touch-action: manipulation; }
button, .btn, .rb { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
svg { flex: none; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 6px var(--yellow); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 50; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 8px; }
.skip:focus { top: .5rem; }
.hint { color: var(--ink-2); font-size: .85rem; line-height: 1.4; }

/* ---------- три вида кнопок ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 56px; padding: .55rem 1rem;
  border-radius: var(--r); border: var(--b) solid transparent; background: var(--fill); color: var(--ink);
  font-weight: 600; line-height: 1.2; text-decoration: none; text-align: center; overflow-wrap: break-word; hyphens: manual;
  transition: transform 120ms var(--ease), background-color 120ms, color 120ms;
}
.btn svg { width: 1.2em; height: 1.2em; }
.btn-main { background: var(--center); color: #fff; }
html.hc .btn { border-color: #000; }
html.hc .btn-main { border-color: #000; }
.btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-sq { width: 56px; padding: 0; font-size: 1.6rem; line-height: 1; flex: none; border-radius: 50%; }
.btn-s { min-height: 48px; padding: .3rem .8rem; font-size: .85rem; }
.btn-sq.btn-s { width: 48px; font-size: 1.3rem; }
.btn:disabled { color: #737A78; background: var(--ground); cursor: default; }   /* стрелка неактивна, но читается: 3,9 : 1 */
html.hc .btn:disabled { color: #767676; border-color: #767676; }

.seg { display: inline-flex; gap: 3px; padding: 3px; border-radius: var(--r); background: var(--fill); }
html.hc .seg { border: var(--b) solid #000; }
.seg-b { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-width: 56px; min-height: 48px; padding: .3rem .8rem;
  border: 0; border-radius: calc(var(--r) - 3px); background: transparent; font-weight: 600; font-size: .9rem; line-height: 1.15; text-align: center; transition: transform 120ms var(--ease), background-color 120ms, color 120ms; }
.seg-b svg { width: 1.2em; height: 1.2em; }
.seg-b[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.btn:active:not(:disabled), .seg-b:active, .rb:active, .lab:active { transform: scale(.97); }
/* нажатие видно и тоном, не только сжатием: палец закрывает кнопку, тон виден по краям */
.btn:active:not(:disabled):not([aria-pressed="true"]):not(.btn-main), .seg-b:active:not([aria-pressed="true"]) { background: var(--fill-h); }
.btn-main:active { background: #085A50; }
.rb:active .bdg { transform: scale(.92); }
.bdg { transition: transform 120ms var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled):not([aria-pressed="true"]):not(.btn-main), .seg-b:hover:not([aria-pressed="true"]) { background: var(--fill-h); }
  .btn-main:hover { background: #085A50; }
  .rb:hover .rt b { text-decoration: underline; text-underline-offset: .2em; }
}

/* ---------- шапка: одна строка; настройки — панелью под ней ---------- */
.top { position: absolute; top: 0; left: 0; right: 0; z-index: 6; padding: max(10px, env(safe-area-inset-top)) 12px 8px; pointer-events: none; }
.top-row > * { pointer-events: auto; }
.top .btn-set, .top .seg-lang { background: var(--paper); box-shadow: var(--float); }
.top .btn-set { padding-left: 8px; }
.top-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.top .seg-b { font-size: var(--ui); }
.seg-lang .seg-b { min-width: 48px; padding-inline: 10px; }
.btn-set { min-height: 48px; padding: 4px 10px 4px 4px; gap: 6px; font-size: min(.8rem, 20px); background: transparent; }
.btn-set .aa { font-size: min(1.1rem, 26px); }
.aa { font-weight: 700; font-size: 1.15em; letter-spacing: -.02em; }
.btn-set[aria-expanded="true"] { background: var(--ink); color: var(--paper); }
.prefs[open] { display: grid; gap: 1rem; }
.pref-row { display: grid; gap: .4rem; }
.pref-h { font-weight: 700; font-size: min(.9rem, 20px); }
.prefs .seg-b { font-size: var(--ui); padding-inline: 6px; }   /* лист настроек растёт с потолком, как шапка: при ×1,5 «×1,25» не ломается */
.prefs .btn { font-size: var(--ui); }
.pref-row .seg { display: flex; }
.pref-row .seg-b { flex: 1 1 0; min-width: 0; min-height: 52px; overflow-wrap: anywhere; }
.prefs > .btn { width: 100%; }
.pref-say { margin: 0; font-size: min(1.05rem, 22px); }   /* что звучит в настройках — тот же текст, что в записи */

/* ---------- главное ---------- */
main { padding: 0; }
.cols { display: block; }
/* лист с шагами наезжает на карту снизу; карта остаётся под ним (sticky) — пролистал вверх, карта снова видна */
.lead { position: relative; z-index: 2; margin-top: -1.5rem; padding: 1.35rem min(1rem, 18px) 0; background: var(--paper);
  border-radius: 24px 24px 0 0; box-shadow: 0 -1px 0 rgba(27,36,34,.08), 0 -12px 24px -14px rgba(27,36,34,.35); }   /* поля не растут с ×1,5: ширина отдаётся тексту */
html.hc .lead { box-shadow: none; border-top: 3px solid #000; }
/* заголовок, имя центра, лента и главная кнопка растут с потолком: при ×1,5 первый экран — заголовок, лента и «Слушать путь».
   Текст шага растёт на все ×1,5 — ради него и включают крупный размер. */
h1 { font-size: min(1.6rem, 38px); line-height: 1.12; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; line-height: 1.25; font-weight: 700; }
.cname { margin-top: .35rem; color: var(--ink-2); font-size: min(.85rem, 20px); line-height: 1.35; }

/* лента пути — схема линии сверху вниз, как над дверью автобуса. Слева рельс: значок узла и отрезок под ним цветом части
   (метро — синий, автобус — чернила, пешком — жёлтая плитка с точками). Строка — кнопка, ведёт к своей части шагов. */
.rib-h { margin-top: min(.8rem, 18px); font-size: min(.85rem, 19px); font-weight: 600; line-height: 1.3; color: var(--ink-2); }
.ribbon { display: grid; margin-top: .4rem; --bw: min(2.1rem, 42px); }
.rb, .rb-end { position: relative; display: grid; grid-template-columns: var(--bw) minmax(0, 1fr); column-gap: .75rem; align-items: start; text-align: left; }
.rb { min-height: 56px; padding: 0 0 .2rem; border: 0; border-radius: 12px; background: none; transition: transform 120ms var(--ease); }
.rb::before { content: ""; position: absolute; left: calc(var(--bw) / 2 - 5px); top: calc(var(--bw) - 4px); bottom: -4px; width: 10px; border-radius: 2px; background: var(--rail); }
.rb-metro { --rail: var(--metro); }
.rb-bus { --rail: var(--ink); }
.rb-walk { --rail: var(--yellow) var(--dots); }
.rb-walk::before { background-size: 8px 8px; box-shadow: inset 0 0 0 2px var(--ink); }
.ribbon[data-dir="back"] .rb-metro::before { background: repeating-linear-gradient(180deg, var(--ink) 0 6px, transparent 6px 11px); width: 6px; left: calc(var(--bw) / 2 - 3px); }
.bdg { position: relative; z-index: 1; display: grid; place-items: center; width: var(--bw); height: var(--bw); border-radius: 50%; background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 4px var(--ink); }
.bdg svg { width: 62%; height: 62%; }
.rb-metro .bdg { background: var(--metro); color: #fff; box-shadow: none; }
.ribbon[data-dir="back"] .rb-metro .bdg, .rb-walk .bdg { background: var(--yellow); color: #1B2422; }
/* номер маршрута — табличка, как на лобовом стекле: белые цифры на чернилах */
.bdg.plate { width: var(--bw); border-radius: 8px; background: var(--ink); color: #fff; box-shadow: none; font-weight: 700; font-size: min(1rem, 21px); letter-spacing: -.02em; }
.rb-end .bdg { border-radius: 10px; background: var(--center); color: #fff; box-shadow: none; }
.rb-end.is-metro .bdg { border-radius: 50%; background: var(--metro); }
html.hc .bdg { box-shadow: inset 0 0 0 3px #000; }
.rt { display: grid; min-width: 0; padding-top: calc((var(--bw) - 1.3em) / 2); }
.rt b, .rb-end > b { font-weight: 700; font-size: min(.95rem, 21px); line-height: 1.3; overflow-wrap: anywhere; }
.rb-end > b { align-self: center; }
.rt small { margin-top: 0; color: var(--ink-2); font-size: min(.8rem, 17px); line-height: 1.3; }
.rt small b { color: var(--ink); font-weight: 700; }
/* часть, где сейчас шаг: жёлтое кольцо у узла — «вы здесь» */
.rb[aria-current="step"] .bdg { outline: 4px solid var(--yellow); outline-offset: 2px; }

.listen { display: grid; gap: .5rem; margin-top: min(.8rem, 18px); }
.listen.alt { margin-top: min(1rem, 22px); }
#listen { min-height: 64px; font-size: min(1.1rem, 26px); }
#listen[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: .5rem; }
.pair .btn { font-size: .9rem; }

/* ---------- шаги: один на экран ---------- */
.stepper { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--hair); }
.seg-dir { display: flex; margin-bottom: 1rem; }
.seg-dir .seg-b { flex: 1 1 0; min-width: 0; }
/* шапка шага — табличка цвета своей части, как указатель в метро: синяя — метро, чернила — автобус, жёлтая — пешком,
   цвет центра — у двери. Два ряда: значок, «3 из 7», стрелки; ниже имя шага крупно. Липнет к верху, пока человек внутри шагов:
   прилипла — один ряд, имя шага одной строкой */
.stick-mark { display: block; height: 1px; margin-bottom: -1px; }
.stepbar { --sg: var(--fill); --sf: var(--ink); --sp: rgba(27,36,34,.1);
  position: sticky; top: 0; z-index: 15; margin-inline: calc(-1 * min(1rem, 18px)); padding: .5rem min(1rem, 18px) .55rem; background: var(--paper); transition: box-shadow 160ms; }
.stepbar[data-part="metro"] { --sg: var(--metro); --sf: #fff; --sp: rgba(255,255,255,.2); }
.stepbar[data-part="bus"] { --sg: var(--ink); --sf: #fff; --sp: rgba(255,255,255,.2); }
.stepbar[data-part="foot"] { --sg: var(--yellow); --sf: #1B2422; --sp: rgba(27,36,34,.12); }
.stepbar[data-part="door"] { --sg: var(--center); --sf: #fff; --sp: rgba(255,255,255,.2); }
html.hc .stepbar { --sg: #fff; --sf: #000; --sp: #fff; }
.stepbar.stuck { box-shadow: 0 1px 0 var(--hair), 0 6px 14px -8px rgba(27,36,34,.22); padding-top: max(.5rem, env(safe-area-inset-top)); }
html.hc .stepbar.stuck { box-shadow: 0 3px 0 #000; }
.steps { scroll-margin-top: 6rem; }
.stepper-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "p n g" "t t t"; column-gap: .65rem; row-gap: .45rem; align-items: center;
  padding: .75rem .75rem .85rem; border-radius: 18px; background: var(--sg); color: var(--sf); transition: background-color 200ms, color 200ms; }
html.hc .stepper-head { box-shadow: inset 0 0 0 3px #000; }
.stepper-head h2 { display: contents; }
.stepbar .picto.sb-picto { grid-area: p; display: grid; width: min(2.6rem, 54px); height: min(2.6rem, 54px); background: var(--paper); color: var(--ink); box-shadow: none; }
.stepbar .picto.sb-picto.bus { border-radius: 10px; }
.stepbar .picto.sb-picto.door { border-radius: 12px; color: var(--center); }
.stepbar .picto.sb-picto.metro { color: var(--metro); }
#stepOf { grid-area: n; font-size: min(.85rem, 19px); font-weight: 600; white-space: nowrap; }
#stepOf b { margin-right: .25em; font-weight: 700; }
.sb-title { grid-area: t; display: block; overflow-wrap: anywhere;   /* имя шага целиком: в самом шаге оно скрыто, обрезать нельзя */
  font-size: min(1.3rem, 28px); font-weight: 700; line-height: 1.15; letter-spacing: -.01em; }
.sb-title:empty { display: none; }
.pager { grid-area: g; display: flex; gap: .5rem; }
.btn-sq svg { width: 26px; height: 26px; }
.stepper-head .btn-sq { width: 48px; min-height: 48px; background: var(--sp); color: var(--sf); }
.stepper-head .btn-sq.btn:active:not(:disabled) { background: var(--sf); color: var(--sg); }   /* нажатие на табличке — цвета меняются местами */
.stepper-head .btn-sq:disabled { background: transparent; color: inherit; opacity: .45; }
html.hc .stepper-head .btn-sq { border-color: #000; }
.stuck .stepper-head { grid-template-areas: "p t g"; padding-block: .4rem; }
.stuck #stepOf { display: none; }
.stuck h2:has(.sb-title:empty) #stepOf { display: block; grid-area: t; }
.stuck .sb-title { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; overflow-wrap: normal; font-size: min(1rem, 22px); }
.stepbar.stuck .picto.sb-picto { width: 2.2rem; height: 2.2rem; }
/* прогресс — та же линия: пройденные отрезки цветом своей части */
.progress { display: flex; gap: 3px; margin: .6rem 0 0; }
.progress i { flex: 1; height: 8px; border-radius: 2px; background: var(--line); transition: background-color 200ms; }
.progress i.on { background: var(--ink); }
.progress i.on.metro { background: var(--metro); }
.progress i.on.foot { background-color: var(--yellow); background-image: var(--dots); background-size: 6px 6px; box-shadow: inset 0 0 0 1.5px var(--ink); }
html.hc .progress i { box-shadow: inset 0 0 0 2px #000; }
/* имя шага — на табличке; в самом шаге оно остаётся для диктора, глазами видны цифры */
.step .step-top .picto { display: none; }
.step h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.step .meta { font-size: .95rem; }

.steps { list-style: none; padding: 0; margin-top: 1rem; touch-action: pan-y; }
.steps:focus { outline: none; }
/* для диктора — весь список; глазами виден один шаг */
.step:not(.cur) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.step.cur.in { animation: stepIn 200ms var(--ease); }
@keyframes stepIn { from { opacity: .3; transform: translateX(var(--dx, 0)); } }
/* листание через View Transitions: старый шаг уходит в сторону листания, новый приходит с другой; остальная страница не мигает */
.step.cur { view-transition-name: step; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(step) { animation-duration: 240ms; animation-timing-function: var(--ease); }
::view-transition-old(step) { animation: vtOut 140ms ease-out both; }
::view-transition-new(step) { animation: vtIn 240ms var(--ease) both; }
:root[data-dx="b"] { --vx: -1; }
@keyframes vtOut { to { opacity: 0; transform: translateX(calc(var(--vx, 1) * -28px)); } }
@keyframes vtIn { from { opacity: 0; transform: translateX(calc(var(--vx, 1) * 28px)); } }
.step-top { display: flex; align-items: center; gap: .75rem; }
/* значок шага — тот же узел, что на ленте: метро — синий круг, автобус — табличка, пешком — жёлтый круг, дверь — цвет центра */
.picto { display: grid; place-items: center; width: min(3rem, 60px); height: min(3rem, 60px); border-radius: 50%; flex: none; background: var(--paper); box-shadow: inset 0 0 0 4px var(--ink); }
.picto svg { width: 58%; height: 58%; }
.picto.metro { background: var(--metro); color: #fff; box-shadow: none; }
.picto.bus { border-radius: 10px; background: var(--ink); color: #fff; box-shadow: none; }
.picto.foot { background: var(--yellow); color: #1B2422; box-shadow: none; }
.picto.door { border-radius: 12px; background: var(--center); color: #fff; box-shadow: none; }
html.hc .picto { box-shadow: inset 0 0 0 3px #000; }
.step-top > div { min-width: 0; }
.step h3, .say, .addr p { overflow-wrap: break-word; }
.step h3 { font-size: 1.35rem; line-height: 1.15; letter-spacing: -.01em; }
.step .meta { color: var(--ink-2); font-size: .85rem; }
/* «≈ 350 м   ≈ 5 мин»: цифра — главное, крупно и табличными; единица — рядом, мельче */
.meta.facts { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem 0; margin-top: .25rem; }
.fact { white-space: nowrap; }
.fact b { margin: 0 .12em; color: var(--ink); font-size: 1.55em; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fact ~ .fact { margin-left: .8rem; padding-left: .8rem; border-left: 2px solid var(--hair); }
html.hc .fact ~ .fact { border-left-color: #000; }
.say { margin-top: .9rem; font-size: 1.2rem; line-height: 1.45; max-width: 34em; }
.say span { border-radius: 4px; transition: background-color .2s; }
.say span.now { background: var(--yellow); box-shadow: 0 0 0 .12em var(--yellow); color: #1B2422; }
.hatch { display: inline-block; width: 1.4rem; height: 1.4rem; border-radius: 6px; flex: none; background: repeating-linear-gradient(135deg, var(--unv) 0 2px, transparent 2px 6px); }

/* картина шага: кусок карты (пешком). «Схема, не фото» — одной строкой под шагами (.unver) */
.scene { margin-top: 1rem; border-radius: 14px; overflow: hidden; background: var(--ground); }
html.hc .scene { border: var(--b) solid #000; }
.scene svg.crop { display: block; width: 100%; height: clamp(12rem, 52vw, 17rem); }

.voicebar { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.voicebar .btn { font-size: .9rem; min-height: 52px; flex: 1 1 auto; }
.stub { margin-top: .75rem; padding: .6rem .8rem; border-radius: 10px; background: var(--ground); font-size: .85rem; }
/* следующее действие — там, где дочитал шаг: имя следующего шага слева, шеврон справа */
.btn-next { display: flex; width: 100%; margin-top: .75rem; justify-content: space-between; text-align: left; font-size: .95rem; }
.btn-next .chev { display: grid; place-items: center; width: 2em; height: 2em; border-radius: 50%; background: var(--ink); color: var(--paper); flex: none; transition: transform 160ms var(--ease); }
.btn-next .chev svg { width: 55%; height: 55%; }
.btn-next:active .chev { transform: translateX(3px); }
#nextT { min-width: 0; overflow-wrap: anywhere; }   /* длинное узбекское слово в имени шага переносится, а не выталкивает шеврон */
.stepper .go { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--hair); }
.stepper .go-msg { margin-top: .75rem; }

/* ---------- карта: первый экран ---------- */
.mapbox { position: sticky; top: 0; z-index: 0; height: var(--map-h); }
.mapwrap { position: relative; height: 100%; }
.stage { position: absolute; inset: 0; overflow: hidden; background: var(--m-ground); touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.stage.gl { touch-action: none; }
.plan, #cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.labels { position: absolute; inset: 0; pointer-events: none; }
/* подписи карты: остановка — тёмная табличка, ориентир — белая плашка, дверь — цвет центра; растут с потолком */
.lab { position: absolute; left: 0; top: 0; pointer-events: auto; max-width: min(10rem, 190px); padding: .2rem .45rem; border: 0; border-radius: 6px; background: var(--paper); color: var(--ink);
  box-shadow: 0 0 0 1px rgba(27,36,34,.22), 0 2px 5px -1px rgba(27,36,34,.25);
  font-size: min(.75rem, 17px); font-weight: 500; line-height: 1.2; text-align: left; white-space: normal; transition: transform 120ms var(--ease), background-color 120ms; }
.lab.stop { font-weight: 600; background: var(--ink); color: var(--paper); box-shadow: 0 2px 5px -1px rgba(27,36,34,.35); }
.lab.door { padding: .3rem .6rem; background: var(--center); color: #fff; box-shadow: 0 3px 8px -2px rgba(10,110,98,.55); font-size: min(.9rem, 20px); font-weight: 700; border-radius: 10px; }
html.hc .lab { border: 2px solid #000; box-shadow: none; }
.lab.me { background: var(--yellow); color: #1B2422; font-weight: 700; box-shadow: inset 0 0 0 2px var(--ink); }
.lab.num { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; padding: 0; border-radius: 50%; font-weight: 700; font-size: .75rem; }
.lab.on { background: var(--yellow); color: #1B2422; box-shadow: inset 0 0 0 2px var(--ink); }
.legend { list-style: none; padding: 0; margin-top: .5rem; display: grid; gap: .25rem; font-size: .85rem; }
.legend b { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; margin-right: .4rem; border: 1.5px solid var(--ink); border-radius: 50%; font-size: .75rem; }
.north { position: absolute; left: 12px; top: calc(var(--top-h) + 4px); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--paper); box-shadow: var(--float); font-size: 14px; font-weight: 700; }
.north::before { content: ""; position: absolute; top: -7px; left: 50%; margin-left: -6px; border: 6px solid transparent; border-bottom: 8px solid var(--ink); border-top: 0; }
/* кнопки карты: справа столбиком над краем листа; «Я иду» — слева, жёлтая, как точка «вы здесь» */
.stage-ui { position: absolute; right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(1.5rem + 14px); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.btn-fab { width: 52px; min-height: 52px; padding: 0; border: 0; border-radius: 50%; background: var(--paper); color: var(--ink); box-shadow: var(--float); font-size: 26px; font-weight: 500; line-height: 1; }
.btn-fab svg { width: 24px; height: 24px; }
.btn-fab:active:not(:disabled) { transform: scale(.93); }
.btn-go { position: absolute; left: max(12px, env(safe-area-inset-left, 0px)); bottom: calc(1.5rem + 14px); z-index: 3; min-height: 56px; max-width: calc(100% - 92px); padding: .45rem 1.15rem .45rem .7rem; gap: .6rem;
  border: 0; border-radius: 999px; background: var(--yellow); color: #1B2422; box-shadow: inset 0 0 0 2px #1B2422, 0 6px 16px -6px rgba(27,36,34,.55); font-size: min(1rem, 22px); font-weight: 700; text-align: left; }
.go-dot { position: relative; width: 22px; height: 22px; flex: none; border-radius: 50%; background: #1B2422; box-shadow: inset 0 0 0 4px var(--yellow), 0 0 0 2px #1B2422; }
.btn-go.on { background: #1B2422; color: #fff; box-shadow: 0 6px 16px -6px rgba(27,36,34,.55); }
.btn-go.on .go-dot { background: var(--yellow); box-shadow: inset 0 0 0 5px #1B2422, 0 0 0 2px var(--yellow); }
.btn-go.on .go-dot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--yellow); animation: goPulse 1.6s var(--ease) infinite; }
@keyframes goPulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.btn-go:active { transform: scale(.97); }
html.hc .btn-go { box-shadow: inset 0 0 0 3px #000; }
.stage-msg { position: absolute; left: 1rem; right: 1rem; bottom: 1rem; padding: .6rem .8rem; background: var(--paper); box-shadow: var(--float); border-radius: 12px; font-size: .85rem; }
/* что звучит сейчас (место на карте, «Я иду») — плашкой под шапкой; положение — над кнопкой «Я иду» */
.caption { position: absolute; z-index: 4; top: var(--top-h); left: 64px; right: 12px; max-height: 40%; overflow: auto; padding: .55rem .75rem; border-radius: 14px;
  background: var(--paper); box-shadow: var(--float); font-size: .9rem; line-height: 1.4; }
.go-msg { position: absolute; z-index: 4; left: 12px; right: 76px; bottom: calc(1.5rem + 82px); padding: .55rem .75rem; border-radius: 14px; background: #FFF0B3;
  box-shadow: inset 0 0 0 2px var(--yellow), var(--float); font-weight: 600; font-size: .9rem; line-height: 1.35; }
.caption, .go-msg, .pref-say { transition: opacity 160ms var(--ease), transform 160ms var(--ease); }
@starting-style { .caption, .go-msg { opacity: 0; transform: translateY(-4px); } .pref-say { opacity: 0; } }
.caption span.now { background: var(--yellow); box-shadow: 0 0 0 .12em var(--yellow); border-radius: 4px; color: #1B2422; }
.mapinfo { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--hair); display: grid; gap: .6rem; justify-items: start; }
.mapinfo .btn { margin-top: .4rem; font-size: .9rem; }
.hatch-note { display: flex; gap: .5rem; align-items: flex-start; margin-top: .5rem; }
.osm { margin-top: .4rem; color: var(--ink-2); font-size: .8rem; }

.other, .about { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--hair); }
.other ul { margin-top: .6rem; padding-left: 1.1rem; display: grid; gap: .5rem; }
.memo-b { margin-top: 1rem; font-size: .9rem; }
.other .hint { margin-top: .4rem; }
.about p { margin-top: .6rem; }

/* v8: одна оговорка «не проверено» на все шаги — вместо бирки у каждого шага */
.unver { margin-top: 1rem; }
.unver .hatch { width: 1.1rem; height: 1.1rem; margin-top: .1rem; }

/* v8: второстепенное — за одной строкой «Ещё». Закрыто — лист короче, ничего не отвлекает от пути */
.more { margin-top: 2rem; border-top: 1px solid var(--hair); }
.more > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: .75rem;
  min-height: 64px; padding: .9rem 0; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary b { font-size: 1.15rem; }
.more > summary small { grid-row: 2; color: var(--ink-2); font-size: .85rem; line-height: 1.35; }
.more > summary::after { content: ""; grid-row: 1 / span 2; grid-column: 2; width: .6em; height: .6em; margin-right: .3rem;
  border: solid currentColor; border-width: 0 3px 3px 0; transform: translateY(-.15em) rotate(45deg); transition: transform 160ms var(--ease); }
.more[open] > summary::after { transform: translateY(.15em) rotate(-135deg); }
.more > summary:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 8px; }
.more .mapinfo { margin-top: .25rem; }
.more .about { margin-bottom: 1rem; }

/* v8: жестовый язык — кнопка появляется, только когда центр загрузил ролик для этого места */
.sign-b[hidden] { display: none; }
.sign-b svg { width: 1.35em; height: 1.35em; }
.sign-b span { hyphens: manual; }   /* «Imo-ishora tili» не рвать на дефисе: кнопка во всю ширину, под «Слушать» */
.about .sign-b { margin-top: 1rem; }
.navp .sign-b { margin-top: .5rem; }
.voicebar .sign-b { flex-basis: 100%; }   /* «Ещё раз» и «Медленнее» остаются парой, жестовый язык — строкой ниже */
.signd { padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
.signd h2 small { display: block; margin-bottom: .15rem; color: var(--ink-2); font-size: .85rem; font-weight: 600; }
.signd video { display: block; width: 100%; max-height: min(70dvh, 640px); border-radius: 14px; background: #000; object-fit: contain; }

/* ---------- нижняя полоса: две кнопки под пальцем ---------- */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem;
  padding: .5rem .75rem calc(.5rem + env(safe-area-inset-bottom, 0px)); background: var(--paper); box-shadow: 0 -1px 0 var(--line), 0 -6px 16px rgba(27,36,34,.06); }
html.hc .dock { box-shadow: none; border-top: 3px solid #000; }
.dock-b { min-height: 60px; padding: 6px 12px; gap: 8px; font-size: min(.85rem, 17px); justify-content: center; text-align: left; }
.dock-b svg { width: 1.3em; height: 1.3em; }

/* ---------- окна ---------- */
dialog { border: 0; padding: 0; color: var(--ink); background: var(--paper); }
dialog::backdrop { background: rgba(27, 36, 34, .55); }
.sheet { width: min(36rem, calc(100% - 1.5rem)); max-height: calc(100dvh - 1.5rem); overflow: auto; overscroll-behavior: contain; padding: 1.25rem; border-radius: 18px; }
html.hc .sheet { border: 3px solid #000; }
dialog[open] { transition: opacity 200ms var(--ease), transform 200ms var(--ease); }
@starting-style { dialog[open] { opacity: 0; transform: translateY(14px); } }
/* нижний лист — у большого пальца, рядом с кнопкой, что его открыла; ручка сверху — смахнуть вниз */
.bsheet { width: 100%; max-width: 100%; margin: auto 0 0; max-height: calc(100dvh - 2.5rem); border-radius: 22px 22px 0 0;
  --shx: min(1.25rem, 20px); padding: 0 var(--shx) calc(1.25rem + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -8px 24px rgba(27,36,34,.12); }
.bsheet[open] { transition: transform 280ms var(--ease-drawer); }
@starting-style { .bsheet[open] { opacity: 1; transform: translateY(100%); } }
.bsheet.out { transform: translateY(100%); transition: transform 200ms var(--ease); }
.bsheet.drag { transition: none; }
.bsheet::backdrop { background: rgba(27, 36, 34, .45); transition: opacity 280ms; }
@starting-style { .bsheet[open]::backdrop { opacity: 0; } }
.bsheet.out::backdrop { opacity: 0; transition-duration: 200ms; }
html.hc .bsheet { border: 0; border-top: 3px solid #000; }
.grab { position: sticky; top: 0; z-index: 1; margin: 0 calc(-1 * var(--shx, 1.25rem)); padding: 10px var(--shx, 1.25rem) .6rem; background: var(--paper); touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.grab-bar { display: block; width: 40px; height: 5px; margin: 0 auto 12px; border-radius: 3px; background: var(--line); }
html.hc .grab-bar { background: #000; }
.sheet h2 { font-size: 1.4rem; }
.prefs .grab h2 { font-size: min(1.2rem, 26px); }
.grab-x { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: .75rem; align-items: start; }
.grab-x .grab-bar { grid-column: 1 / -1; }
.grab-x h2:focus { outline: none; box-shadow: none; }
.sheet .pair .btn { font-size: .9rem; }
.sheet > p { margin-top: .75rem; }
.addr { margin-top: .5rem; padding: .8rem; border-radius: 12px; background: var(--ground); }
html.hc .addr { border: 3px solid #000; }
.addr p { font-size: 1.1rem; font-weight: 600; line-height: 1.3; }
.addr p + p { margin-top: .5rem; }
.addr .lm { font-weight: 400; font-size: .9rem; }
.sheet-acts { display: grid; gap: .5rem; margin-top: 1rem; }
.driver { width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; padding: max(1.5rem, env(safe-area-inset-top)) 1.25rem 1.5rem; }
.driver[open] { display: flex; flex-direction: column; gap: 1.25rem; }
.drv { font-size: 2.2rem; line-height: 1.15; font-weight: 700; overflow-wrap: anywhere; }
.drv + .drv { padding-top: 1.25rem; border-top: var(--b) solid var(--ink); }
.driver .btn { margin-top: auto; }

/* ---------- компьютер: карта слева на всю высоту, шаги справа ---------- */
@media (min-width: 900px) {
  :root { --side: min(38rem, 46vw); --map-h: calc(100vh - var(--dock-h)); --map-h: calc(100dvh - var(--dock-h)); }
  .cols { display: grid; grid-template-columns: minmax(0, 1fr) var(--side); align-items: start; }
  .top { right: var(--side); }
  .lead { margin-top: 0; padding: 1.75rem 2rem 0; border-radius: 0; box-shadow: -1px 0 0 var(--hair); }
  .stage-ui, .btn-go { bottom: 16px; }
  .go-msg { bottom: 84px; }
  .bsheet { max-width: 36rem; margin: auto auto 0; }
  .dock { grid-template-columns: repeat(2, minmax(0, 15rem)); justify-content: center; }
  .dock-b { justify-content: center; }
}

/* тихо: ничего не движется */
html.quiet *, html.quiet *::before, html.quiet *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-property: opacity, background-color, color !important; animation: none !important; } }

/* печать с телефона: только шаги и адрес; полная памятка — pamyatka.html */
@media print {
  .top, .dock, .mapbox, .mapinfo, .listen, .pager, .voicebar, .seg-dir { display: none !important; }
  .lead { margin: 0; box-shadow: none; }
  .step:not(.cur) { position: static; width: auto; height: auto; clip-path: none; overflow: visible; }
  .step { break-inside: avoid; margin-bottom: 1rem; }
}

/* схема: мышью карта двигается, когда приближена */
.stage.grabbing { cursor: grabbing; }

/* ---------- v7: карта района и ведение «от меня» ---------- */
.lab.metro { font-weight: 600; background: #1F5BA8; color: #fff; }
html.hc .lab.metro { background: #000; }
.preset-h { margin-top: min(1.4rem, 30px); font-size: min(1.05rem, 24px); line-height: 1.25; }
.navp { margin-top: min(.9rem, 20px); padding: .9rem; border-radius: 16px; background: #1B2422; color: #fff; display: grid; gap: .6rem; }
html.hc .navp { background: #000; box-shadow: 0 0 0 3px #FFCC00; }
.nav-now { display: grid; grid-template-columns: 3.5rem 1fr; gap: .75rem; align-items: center; }
.nav-ico { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 12px; background: #FFCC00; color: #1B2422; }
.nav-ico svg { width: 2.4rem; height: 2.4rem; fill: currentColor; transition: transform 200ms var(--ease); }
.nav-ico[data-t="left"] svg { transform: rotate(-90deg); } .nav-ico[data-t="right"] svg { transform: rotate(90deg); }
.nav-ico[data-t="sleft"] svg { transform: rotate(-45deg); } .nav-ico[data-t="sright"] svg { transform: rotate(45deg); }
.nav-ico[data-t="uturn"] svg { transform: rotate(180deg); }
.nav-ico[data-t="arrive"] { background: var(--center); color: #fff; }
.nav-ico[data-t="wait"] svg, .nav-ico[data-t="away"] svg, .nav-ico[data-t="bus"] svg { opacity: .35; }
.nav-say { font-size: min(1.2rem, 28px); font-weight: 700; line-height: 1.25; }
.nav-left { color: #CFE3DD; font-size: .95rem; font-variant-numeric: tabular-nums; }
.nav-left:empty { display: none; }
.nav-weak { padding: .45rem .6rem; border-radius: 10px; background: #FFF0B3; color: #1B2422; font-size: .85rem; }
.nav-choice { display: grid; gap: .55rem; padding-top: .2rem; }
.nav-choice p { font-size: .95rem; line-height: 1.4; }
.navp .btn-line { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); }
.navp .btn-main { background: #FFCC00; color: #1B2422; }
@media (prefers-reduced-motion: reduce) { .nav-ico svg { transition: none; } }
html.quiet .nav-ico svg { transition: none; }
/* во время ведения панель с поворотом — поверх карты сверху, вместо шапки: инструкцию видно без прокрутки */
html.guiding .top { visibility: hidden; }
/* ведение на телефоне: карта до нижних кнопок, заголовок и адрес под ней не видны — на экране только путь и поворот */
html.guiding { --peek: 0px; }
/* выбор «пешком / автобус»: расстояние уже в заголовке, «Ещё раз» не нужна — только две кнопки */
.navp:has(#navChoice:not([hidden])) :is(#navLeft, #navAgain, #navIco) { display: none; }   /* стрелка «прямо» тут ничего не значит */
html.guiding .navp { position: fixed; z-index: 30; top: max(8px, env(safe-area-inset-top, 0px)); left: max(8px, env(safe-area-inset-left, 0px)); right: max(8px, env(safe-area-inset-right, 0px));
  margin: 0; max-width: 40rem; max-height: calc(100dvh - var(--dock-h, 80px) - 120px); overflow: auto; box-shadow: 0 10px 28px -10px rgba(27,36,34,.6); }
@media (min-width: 900px) { html.guiding .navp { left: auto; width: 26rem; } }
/* ведение: на карте только путь, «Вы здесь», Irmoq и ориентиры по пути — подписи остановок и метро не шумят (Надыр 05.12) */
html.guiding .lab.stop, html.guiding .lab.metro { display: none; }
