@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;         /* рамки и подложка карты */
  --ground: #F2F3F1;
  --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);
  --dots: radial-gradient(circle, rgba(27,36,34,.24) 2px, transparent 2.6px);
  color-scheme: light;
}
html.hc { --ink: #000; --ink-2: #000; --unv: #000; --line: #000; --ground: #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; }
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 var(--ink); background: var(--paper); 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); border-color: var(--center); color: #fff; }
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; }
.btn-s { min-height: 48px; padding: .3rem .8rem; font-size: .85rem; }
.btn-sq.btn-s { width: 48px; font-size: 1.3rem; }
.btn:disabled { color: #8A918F; border-color: #BFC5C2; cursor: default; }
html.hc .btn:disabled { color: #767676; border-color: #767676; }

.seg { display: inline-flex; border: var(--b) solid var(--ink); border-radius: var(--r); overflow: hidden; background: var(--paper); }
.seg-b { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-width: 56px; min-height: 48px; padding: .3rem .8rem;
  border: 0; background: var(--paper); font-weight: 600; font-size: .9rem; line-height: 1.15; text-align: center; transition: background-color 120ms, color 120ms; }
.seg-b svg { width: 1.2em; height: 1.2em; }
.seg-b + .seg-b { border-left: var(--b) solid var(--ink); }
.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); }
@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(--ground); }
  .btn-main:hover { background: #085A50; }
  .rb:hover span { text-decoration: underline; text-underline-offset: .2em; }
}

/* ---------- шапка: одна строка; настройки — панелью под ней ---------- */
.top { padding: max(10px, env(safe-area-inset-top)) 16px 10px; border-bottom: var(--b) solid var(--line); }
.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 12px; gap: 6px; font-size: min(.8rem, 20px); }
.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 { display: grid; gap: 1rem; margin-top: .75rem; padding-top: .75rem; border-top: var(--b) solid var(--line); }
.pref-row { display: grid; gap: .4rem; }
.pref-h { font-weight: 700; font-size: .9rem; }
.pref-row .seg { display: flex; }
.pref-row .seg-b { flex: 1 1 0; min-width: 0; min-height: 52px; overflow-wrap: anywhere; }
.prefs > .btn { justify-self: start; }

/* ---------- главное ---------- */
main { padding: 1rem 1rem 0; max-width: 1180px; margin: 0 auto; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
h1 { font-size: 1.6rem; line-height: 1.15; 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: .85rem; line-height: 1.35; }

/* лента пути: весь путь одной строкой и навигация по частям; жёлтый участок — то, что идём ногами */
.ribbon { display: flex; flex-wrap: wrap; gap: var(--b); margin-top: 1rem; border: var(--b) solid var(--ink); border-radius: var(--r); overflow: hidden; background: var(--ink); }
.rb { display: flex; align-items: center; gap: .35rem; min-height: 56px; padding: .3rem .55rem; border: 0; border-radius: 0; font-weight: 700; font-size: .9rem;
  white-space: nowrap; flex: 1 1 auto; text-align: left; transition: transform 120ms var(--ease); }
.rb svg { width: 1.3rem; height: 1.3rem; }
.rb-metro { background: var(--metro); color: #fff; }
.rb-bus { background: var(--paper); }
.rb-walk { background-color: var(--yellow); background-image: var(--dots); background-size: 9px 9px; color: #1B2422; }
/* часть, где сейчас шаг: толстая черта снизу, как «вы здесь» на схеме линии */
.rb[aria-current="step"] { box-shadow: inset 0 -6px 0 var(--ink); }
.rb-metro[aria-current="step"] { box-shadow: inset 0 -6px 0 #fff; }

.listen { display: grid; gap: .5rem; margin-top: 1rem; }
#listen { min-height: 64px; font-size: 1.1rem; }
#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: 1rem; border-top: var(--b) solid var(--line); }
.seg-dir { display: flex; margin-bottom: 1rem; }
.seg-dir .seg-b { flex: 1 1 0; min-width: 0; }
.stepper-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
#stepOf { font-size: 1rem; }
#stepOf b { display: inline-grid; place-items: center; min-width: 2.2rem; height: 2.2rem; margin-right: .4rem; padding: 0 .3rem; border-radius: 8px;
  background: var(--yellow); color: #1B2422; font-weight: 700; box-shadow: inset 0 0 0 var(--b) var(--ink); }
.pager { display: flex; gap: .5rem; }
.progress { display: flex; gap: 4px; margin: .75rem 0 0; }
.progress i { flex: 1; height: 8px; border-radius: 4px; background: var(--line); }
.progress i.on { background: var(--yellow); box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
html.hc .progress i.on { box-shadow: inset 0 0 0 2px #000; }

.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)); } }
.step-top { display: flex; align-items: center; gap: .75rem; }
.picto { display: grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: 12px; border: var(--b) solid var(--ink); flex: none; }
.picto svg { width: 2rem; height: 2rem; }
.picto.metro { background: var(--metro); border-color: var(--metro); color: #fff; }
.picto.foot { background: var(--yellow); color: #1B2422; }
html.hc .picto.metro { border-color: #000; }
.step-top > div { min-width: 0; }
.step h3, .say, .addr p { overflow-wrap: break-word; }
.step h3 { font-size: 1.2rem; line-height: 1.25; }
.step .meta { color: var(--ink-2); font-size: .85rem; }
.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; }
.status { display: inline-flex; align-items: center; gap: .5rem; margin-top: .9rem; padding: .3rem .7rem .3rem .3rem; border: var(--b) solid var(--unv); border-radius: 10px;
  color: var(--unv); font-size: .85rem; font-weight: 600; }
.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); }
.status-more { margin-top: .4rem; color: var(--ink-2); font-size: .85rem; line-height: 1.4; }

/* картина шага: схема линии (метро и автобус) или кусок карты (пешком). Не фото — так и подписано */
.scene { margin-top: 1rem; border: var(--b) solid var(--line); border-radius: 16px; overflow: hidden; background: var(--ground); }
.scene svg.crop { display: block; width: 100%; height: clamp(12rem, 52vw, 17rem); }
.scene figcaption { display: flex; gap: .5rem; align-items: flex-start; padding: .5rem .75rem; border-top: var(--b) solid var(--line); background: var(--paper);
  color: var(--ink-2); font-size: .8rem; line-height: 1.35; }
.scene figcaption .hatch { width: 1.1rem; height: 1.1rem; margin-top: .1rem; }
.strip { list-style: none; padding: .9rem .9rem .9rem .75rem; display: grid; }
.strip li { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); align-items: center; column-gap: .6rem; }
.strip li > span, .strip li > b { overflow-wrap: anywhere; }
.strip .node b { font-weight: 600; font-size: .85rem; line-height: 1.25; padding: .15rem 0; }
.strip .node i { justify-self: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--paper); border: 3px solid var(--ink); }
.strip .node.metro i { border-color: var(--metro); background: var(--metro); }
.strip .node.center i { border-radius: 5px; background: var(--center); border-color: var(--center); }
html.hc .strip .node.metro i, html.hc .strip .node.center i { border-color: #000; }
.strip .edge { min-height: 2.4rem; }
.strip .node { min-height: 1.9rem; }
.strip .edge i { justify-self: center; align-self: stretch; width: 10px; border-radius: 5px; background: var(--ink); }
.strip .edge span { color: var(--ink-2); font-size: .8rem; }
.strip .edge.walk i { width: 6px; background: repeating-linear-gradient(180deg, var(--ink) 0 6px, transparent 6px 11px); }
.strip .edge.bus i { background: var(--ink) repeating-linear-gradient(180deg, transparent 0 4px, var(--paper) 4px 6px, transparent 6px 10%); }
.strip .edge.foot i { width: 12px; background-color: var(--yellow); background-image: var(--dots); background-size: 8px 8px; box-shadow: inset 0 0 0 2px var(--ink); }
/* где сейчас шаг: крупно, жёлтым — как «вы здесь» на схеме у двери автобуса */
.strip .cur > b, .strip .cur > span { color: var(--ink); font-weight: 700; font-size: 1.05rem; }
.strip .node.cur i { width: 2rem; height: 2rem; background: var(--yellow); border: 4px solid var(--ink); border-radius: 50%; }
.strip .edge.cur { background: linear-gradient(90deg, transparent 0 .35rem, rgba(255,204,0,.35) .35rem); border-radius: 10px; }
.strip .edge.cur i { width: 14px; box-shadow: 0 0 0 3px var(--yellow); }
.strip .now { display: inline-block; margin-left: .4rem; padding: 0 .4rem; border-radius: 6px; background: var(--ink); color: var(--paper); font-size: .75rem; font-weight: 600; vertical-align: .1em; }

.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-left: 6px solid var(--unv); background: var(--ground); font-size: .85rem; }

/* ---------- карта ---------- */
.mapbox h2 { margin-bottom: .6rem; }
.mapbox > .hint { margin-top: .6rem; }
.stage { position: relative; margin-top: .75rem; height: min(62svh, 30rem); min-height: 340px; border: var(--b) solid var(--line); border-radius: 16px; overflow: hidden;
  background: var(--ground); touch-action: pan-y; 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: 10rem; padding: .2rem .45rem; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--paper);
  font-size: .75rem; font-weight: 500; line-height: 1.2; text-align: left; white-space: normal; }
.lab.stop { font-weight: 600; border-width: var(--b); }
.lab.door { padding: .3rem .6rem; background: var(--center); border: var(--b) solid var(--center); color: #fff; font-size: .9rem; font-weight: 700; border-radius: 10px; }
html.hc .lab.door { border-color: #000; }
.lab.me { background: var(--ink); border-color: var(--ink); color: var(--paper); font-weight: 700; }
.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; border-color: 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: .6rem; top: .6rem; display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--paper); border: var(--b) solid var(--ink); font-size: .75rem; }
.north::before { content: ""; position: absolute; top: -9px; left: 50%; margin-left: -6px; border: 6px solid transparent; border-bottom: 8px solid var(--ink); border-top: 0; }
.stage-ui { position: absolute; right: .6rem; bottom: .6rem; display: flex; gap: .4rem; align-items: center; }
.stage-msg { position: absolute; left: 1rem; right: 1rem; bottom: 1rem; padding: .6rem .8rem; background: var(--paper); border: var(--b) solid var(--ink); border-radius: 12px; font-size: .85rem; }
.go { display: grid; gap: .5rem; margin-top: .75rem; }
.go .btn { justify-self: start; font-size: .9rem; }
.go-msg { padding: .55rem .8rem; border-left: 6px solid var(--yellow); background: var(--ground); font-weight: 600; font-size: .9rem; }
.caption { min-height: 1.45em; margin-top: .6rem; 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: 1rem; border-top: var(--b) solid var(--line); }
.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; }

/* ---------- нижняя полоса: две кнопки под пальцем ---------- */
.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); border-top: var(--b) solid var(--ink); }
.dock-b { min-height: 60px; padding: 6px 10px; gap: 6px; font-size: min(.85rem, 17px); justify-content: flex-start; 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; border: var(--b) solid var(--ink); }
dialog[open] { transition: opacity 200ms var(--ease), transform 200ms var(--ease); }
@starting-style { dialog[open] { opacity: 0; transform: translateY(14px); } }
.sheet h2 { font-size: 1.4rem; }
.sheet > p { margin-top: .75rem; }
.addr { margin-top: .5rem; padding: .8rem; border-radius: 12px; border: var(--b) solid var(--ink); background: var(--ground); }
.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) {
  .cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; gap: 2.5rem; }
  .mapbox { position: sticky; top: 1rem; }
  .stage { height: min(70vh, 34rem); }
  .top { padding-inline: 1.5rem; }
  .top-row, .prefs { max-width: 1180px; margin-inline: auto; }
  .prefs { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
  .prefs > .btn { grid-column: 1 / -1; }
  .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: none !important; animation: none !important; } }

/* печать с телефона: только шаги и адрес; полная памятка — pamyatka.html */
@media print {
  .top, .dock, .mapbox, .listen, .pager, .voicebar, .seg-dir { display: none !important; }
  .step:not(.cur) { position: static; width: auto; height: auto; clip-path: none; overflow: visible; }
  .step { break-inside: avoid; margin-bottom: 1rem; }
}
