:root {
    color-scheme: light;
    --ink: #18191b;
    --ink-2: #5b5e64;
    --muted: #74777d;
    --bg: #fff;
    --surface: #fff;
    --surface-2: #f6f6f7;
    --line: #e8e9ec;
    --line-strong: #dedfe2;
    --divider: #f0f0f1;
    --soft: #f5f6f7;
    --accent: #ff3d32;
    --accent-dark: #e92b22;
    --peach: #fff0ed;
    --white: #fff;
    --header-bg: rgba(255,255,255,.93);
    --hero-ring: rgba(255,255,255,.85);
    --note-bg: #fff8dd; --note-ink: #765a00; --note-line: #ead996;
    --hot-bg: #fff0ec; --hot-ink: #9b321c;
    --fav-bg: #fff6e5; --fav-ink: #a5690a;
    --stop-rail: #f2b2ad;
    --pill-muted: #bfc1c5;
    --ok-ring: #e6f7ee;
    --map-a: #fff; --map-b: #f1f3f4;
    --hero-blob: #ffb6ae;
    --shadow: 0 16px 48px rgba(22, 24, 29, .08);
    --radius: 24px;
}
/* Dark: follows the system unless the visitor picked a theme in the header. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --ink: #ececee; --ink-2: #b3b6bc; --muted: #9a9da4;
        --bg: #111214; --surface: #1a1b1e; --surface-2: #16171a;
        --line: #2a2c31; --line-strong: #373a40; --divider: #232428; --soft: #23252a;
        --peach: #3a1d19; --white: #1a1b1e;
        --header-bg: rgba(17,18,20,.9); --hero-ring: rgba(255,255,255,.08);
        --note-bg: #3a3212; --note-ink: #f0d67a; --note-line: #5a4d1a;
        --hot-bg: #3a1d19; --hot-ink: #ffb3a7;
        --fav-bg: #3a2d12; --fav-ink: #f5c26b;
        --stop-rail: #7a3a35; --pill-muted: #55585f; --ok-ring: #173a28;
        --map-a: #1d1f23; --map-b: #141518; --hero-blob: #5a2622;
        --shadow: 0 16px 48px rgba(0, 0, 0, .45);
    }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --ink: #ececee; --ink-2: #b3b6bc; --muted: #9a9da4;
    --bg: #111214; --surface: #1a1b1e; --surface-2: #16171a;
    --line: #2a2c31; --line-strong: #373a40; --divider: #232428; --soft: #23252a;
    --peach: #3a1d19; --white: #1a1b1e;
    --header-bg: rgba(17,18,20,.9); --hero-ring: rgba(255,255,255,.08);
    --note-bg: #3a3212; --note-ink: #f0d67a; --note-line: #5a4d1a;
    --hot-bg: #3a1d19; --hot-ink: #ffb3a7;
    --fav-bg: #3a2d12; --fav-ink: #f5c26b;
    --stop-rail: #7a3a35; --pill-muted: #55585f; --ok-ring: #173a28;
    --map-a: #1d1f23; --map-b: #141518; --hero-blob: #5a2622;
    --shadow: 0 16px 48px rgba(0, 0, 0, .45);
}
/* Component display rules must never beat the hidden attribute. */
[hidden] { display: none !important; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--bg); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; }
/* Short pages (planner, 404): the footer sits at the bottom of the window, not mid-screen. */
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
/* Form fields follow the theme; the dark UA default is a flat grey box. */
input, textarea, select { color: var(--ink); background: var(--surface); }
button { cursor: pointer; }
.container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header { position: sticky; z-index: 50; top: 0; background: var(--header-bg); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); }
.header-inner { height: 76px; display: flex; align-items: center; gap: 34px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 850; letter-spacing: -.7px; }
.brand-mark { width: 36px; height: 36px; flex: none; display: block; border-radius: 10px; }
.brand-name { color: var(--ink); }
.brand-name b { color: var(--accent); font-weight: inherit; }
.header-nav { display: flex; gap: 24px; font-size: 14px; font-weight: 650; }
.header-nav a { padding: 10px 0; white-space: nowrap; }
.header-nav a:hover { color: var(--accent); }
.header-search { position: relative; display: flex; margin-left: auto; background: var(--soft); border-radius: 13px; padding: 4px; }
.header-search input { width: 220px; padding: 9px 12px; border: 0; outline: 0; background: transparent; }
.header-search button { padding: 9px 14px; border: 0; border-radius: 10px; color: var(--bg); background: var(--ink); font-weight: 700; font-size: 13px; }
/* Tablets in landscape and small laptops: menu, city and search share one line,
   a long city name ("Екатеринбург") is cut instead of pushing the header wider. */
@media (max-width: 1180px) {
    .header-inner { gap: 20px; }
    .header-nav { gap: 16px; }
    .header-search input { width: 150px; }
    .city-chip { max-width: 150px; }
    .city-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}

.hero { padding: 30px 0 18px; }
.hero-card { position: relative; overflow: hidden; min-height: 520px; padding: 70px; border-radius: 34px; background: var(--surface-2); }
.hero-card::before { content: ""; position: absolute; width: 420px; height: 420px; right: -70px; top: -145px; border-radius: 50%; background: var(--accent); box-shadow: -100px 290px 0 -110px var(--hero-blob); }
.hero-card::after { content: ""; position: absolute; right: 70px; bottom: 48px; width: 270px; height: 140px; border-radius: 80px 18px 80px 18px; border: 28px solid var(--hero-ring); transform: rotate(-12deg); }
.hero-copy, .hero-search, .hero-stats { position: relative; z-index: 2; max-width: 720px; }
.eyebrow { display: block; margin-bottom: 10px; color: var(--accent); font-size: 12px; line-height: 1.2; font-weight: 850; letter-spacing: 1.4px; text-transform: uppercase; }
.hero h1 { max-width: 800px; margin: 0; font-size: clamp(42px, 6vw, 72px); line-height: .98; letter-spacing: -4.2px; }
.hero h1 span { color: var(--ink-2); }
.hero-copy p { max-width: 590px; margin: 24px 0 0; color: var(--ink-2); font-size: 19px; }
.hero-search { width: 680px; max-width: 100%; margin-top: 38px; }
/* Small laptops: a smaller sun and title, so the headline does not run into it. */
@media (min-width: 901px) and (max-width: 1180px) {
    .hero-card::before { width: 300px; height: 300px; right: -100px; top: -140px; }
    .hero h1 { font-size: 56px; }
}
.hero-search > label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 750; }
.hero-search-row { display: flex; padding: 7px; border-radius: 18px; background: var(--surface); box-shadow: 0 15px 36px rgba(22,24,29,.1); }
.hero-search-row input { min-width: 0; flex: 1; padding: 15px 18px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 16px; }
.hero-search-row button, .search-page-form button { padding: 14px 22px; border: 0; border-radius: 13px; background: var(--accent); color: white; font-weight: 800; }
.hero-search-row button:hover, .search-page-form button:hover, .primary-button:hover { background: var(--accent-dark); }
.hero-stats { display: flex; gap: 38px; margin-top: 34px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 22px; line-height: 1.1; letter-spacing: -.7px; }
.hero-stats span { margin-top: 4px; color: var(--muted); font-size: 12px; }

.search-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 80; padding: 8px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); }
.search-suggest-large { top: calc(100% + 8px); }
.suggest-item { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 11px 12px; border-radius: 10px; width: 100%; text-align: left; background: none; border: none; font: inherit; cursor: pointer; color: inherit; }
.suggest-item:hover, .suggest-item.active { background: var(--soft); }
.suggest-item strong { display: block; font-size: 14px; }
.suggest-item small { color: var(--muted); font-size: 12px; }

.planner-form { display: flex; align-items: flex-end; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.planner-field { position: relative; flex: 1 1 220px; min-width: 200px; }
.planner-field label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.planner-field input { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line-strong); font: inherit; }
.planner-swap { padding-bottom: 13px; color: var(--muted); font-size: 18px; }

.nearby-widget { margin-top: 22px; }
.nearby-widget .ghost { padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 700; font-size: 13px; }
.nearby-results { margin-top: 12px; display: grid; gap: 6px; max-width: 420px; }
.nearby-results .suggest-item { border: 1px solid var(--line); }

.btn-favorite { margin-top: 12px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 700; font-size: 13px; cursor: pointer; }
.btn-favorite.active { border-color: #f5a623; background: var(--fav-bg); color: var(--fav-ink); }

.report-widget { padding: 18px 0; }
.report-widget summary { cursor: pointer; font-weight: 700; }
.report-widget form { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; max-width: 520px; }
.report-widget textarea { padding: 12px; border-radius: 12px; border: 1px solid var(--line-strong); font: inherit; resize: vertical; }
.report-widget .report-status { color: var(--accent); font-size: 13px; margin: 0; }

.section { padding: 78px 0; }
.section-muted { background: var(--surface-2); }
.compact-top { padding-top: 40px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin-bottom: 30px; }
.section-heading h2, .result-block h2 { margin: 0; font-size: 34px; line-height: 1.12; letter-spacing: -1.5px; }
.section-heading p { max-width: 390px; margin: 0; color: var(--muted); }
.city-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.city-card { min-height: 92px; display: flex; align-items: center; gap: 15px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); transition: .2s ease; }
.city-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 12px 30px rgba(22,24,29,.07); }
.city-initial { width: 50px; height: 50px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 15px; background: var(--peach); color: var(--accent); font-size: 20px; font-weight: 850; }
.city-card strong { display: block; }
.city-card small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.arrow { margin-left: auto; color: var(--muted); font-size: 20px; }
.route-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.route-card { min-height: 108px; display: flex; align-items: center; gap: 17px; padding: 19px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); transition: .2s ease; }
.route-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(22,24,29,.06); }
/* Before the route-badge-* colours so a mini badge takes its mode's colour. */
.mini-badge { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 7px; background: var(--accent); color: white; font-size: 11px; font-weight: 800; }
.route-badge, .route-number-large { display: grid; place-items: center; flex: 0 0 auto; min-width: 58px; height: 58px; padding: 0 12px; border-radius: 17px; background: var(--accent); color: white; font-size: 20px; font-weight: 900; }
.route-badge-tram, .route-number-large.route-badge-tram { background: #7b54e7; }
.route-badge-trolleybus, .route-number-large.route-badge-trolleybus { background: #2189e8; }
.route-badge-minibus, .route-number-large.route-badge-minibus,
.route-badge-route_taxi, .route-number-large.route-badge-route_taxi { background: #ef8e21; }
.route-card-copy { min-width: 0; display: flex; flex-direction: column; }
.route-card-copy small { margin-bottom: 5px; color: var(--muted); font-size: 12px; }
/* Three lines: intercity titles open with a long origin ("Симферополь (Автостанция …)"),
   two lines cut them before the destination. */
.route-card-copy strong { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow-wrap: anywhere; font-size: 16px; line-height: 1.3; }
.route-card-arrow { margin-left: auto; color: var(--muted); font-size: 20px; }
/* Some "numbers" are words ("Новая Тура", "2Реч-й"): they wrap inside the badge instead of widening it. */
.route-card .route-badge { height: auto; min-height: 58px; padding-block: 6px; max-width: 104px; white-space: normal; text-align: center; line-height: 1.1; overflow-wrap: anywhere; }
.route-card-times { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 7px; font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; }
.route-card-times span, .route-card-times em { color: var(--muted); font-size: 13px; font-weight: 500; font-style: normal; }
.benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 50px; }
.benefits article { padding-top: 20px; border-top: 1px solid var(--line); }
.benefits article > span { color: var(--accent); font-weight: 850; font-size: 12px; }
.benefits h3 { margin: 15px 0 8px; font-size: 20px; }
.benefits p { margin: 0; color: var(--muted); }

.page-head, .route-hero { padding: 66px 0 44px; background: var(--surface-2); }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 9px; margin-bottom: 30px; color: var(--muted); font-size: 13px; }
.breadcrumbs a:hover { color: var(--accent); }
.hero-city { display: none; }
.page-head h1, .route-hero h1 { margin: 0; font-size: clamp(38px, 5vw, 62px); line-height: 1; letter-spacing: -3px; overflow-wrap: break-word; }
.page-head > .container > p, .route-title-row p { margin: 18px 0 0; color: var(--muted); font-size: 18px; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 30px; }
.filter-pills a { padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); font-size: 13px; font-weight: 700; }
.filter-pills a span { margin-left: 5px; color: var(--muted); }
.filter-pills a.active { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.filter-pills a.active span { color: var(--pill-muted); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 24px; margin-top: 30px; }
.letter-index { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.letter-index a { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--surface); border: 1px solid var(--line-strong); font-size: 13px; font-weight: 700; }
.letter-index a:hover { border-color: var(--ink); }
.city-letter-group { margin-bottom: 34px; scroll-margin-top: 90px; }
.city-letter-heading { font-size: 22px; margin: 0 0 14px; color: var(--muted); }
@media (max-width: 720px) { .city-grid { grid-template-columns: 1fr; } }
.pagination a, .pagination span { min-width: 92px; padding: 10px; color: var(--muted); }
.pagination a:hover { color: var(--accent); }

.route-title-row { display: flex; align-items: center; gap: 24px; }
.route-number-large { min-width: 86px; height: 86px; border-radius: 24px; font-size: 31px; box-shadow: 0 16px 30px rgba(255,61,50,.18); }
.schedule-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); align-items: start; gap: 28px; }
.schedule-controls { position: sticky; top: 104px; display: grid; gap: 14px; }
.control-card { padding: 18px; border: 1px solid var(--line); border-radius: 18px; }
.control-label { display: block; margin-bottom: 12px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; }
.weekday-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.weekday-grid button { height: 38px; border: 0; border-radius: 10px; background: var(--soft); font-size: 12px; font-weight: 800; }
.weekday-grid button.active { background: var(--accent); color: white; }
.direction-list { display: grid; gap: 7px; }
.direction-list button { width: 100%; display: flex; align-items: center; gap: 9px; padding: 10px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); text-align: left; font-size: 13px; }
.direction-list button > span:first-child { width: 25px; height: 25px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 8px; background: var(--soft); font-weight: 800; }
.direction-list .direction-name { min-width: 0; }
.direction-list .direction-name small { white-space: nowrap; }
.direction-list button.active { background: var(--soft); color: var(--ink); font-weight: 700; }
.direction-list button.active > span:first-child { background: var(--ink); color: var(--bg); }
.update-note { display: flex; align-items: center; gap: 10px; padding: 4px 8px; color: var(--muted); font-size: 12px; }
.update-note i { width: 9px; height: 9px; border-radius: 50%; background: #24b56a; box-shadow: 0 0 0 5px var(--ok-ring); }
.update-note b { color: var(--ink); }
.direction-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 12px 35px rgba(22,24,29,.045); }
.direction-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 26px 30px; border-bottom: 1px solid var(--line); }
.direction-head h2 { margin: 0; font-size: 25px; letter-spacing: -.8px; }
.direction-head > span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.stop-list { margin: 0; padding: 6px 0 6px 0; list-style: none; }
.stop-item { position: relative; display: grid; grid-template-columns: 56px 1fr; min-height: 100px; }
.stop-line { position: relative; display: block; width: 100%; }
.stop-line::before { content: ""; position: absolute; left: 29px; top: 0; bottom: 0; width: 3px; background: var(--stop-rail); }
.stop-line i { position: absolute; z-index: 1; left: 22px; top: 29px; width: 17px; height: 17px; border: 4px solid var(--accent); border-radius: 50%; background: var(--surface); }
.stop-item:first-child .stop-line::before { top: 38px; }
.stop-item:last-child .stop-line::before { bottom: calc(100% - 38px); }
.stop-content { padding: 23px 28px 23px 2px; border-bottom: 1px solid var(--divider); }
.stop-item:last-child .stop-content { border-bottom: 0; }
.stop-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; }
.stop-heading h3 { margin: 0; font-size: 18px; }
.stop-heading small { color: var(--muted); font-size: 11px; }
.stop-times { margin-top: 10px; }
/* Inline, not flex: on a narrow phone the line wraps and the arrow follows the last word
   instead of hanging alone at the right edge. */
.stop-times summary { display: inline-block; color: var(--accent); font-size: 13px; font-weight: 750; cursor: pointer; list-style: none; }
.stop-times summary::-webkit-details-marker { display: none; }
.stop-times summary::after { content: "▾"; display: inline-block; margin-left: 7px; transition: transform .2s; }
.stop-times[open] summary::after { transform: rotate(180deg); }
.stop-times .times-list { padding: 12px 0 4px; }
.times-list { display: flex; flex-wrap: wrap; gap: 7px; }
.times-list time { padding: 7px 10px; border-radius: 9px; background: var(--soft); font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; }
.times-list .interval-chip, .times-list .unassigned-chip { background: var(--note-bg); color: var(--note-ink); }
/* The next runs before a stop's list opens (main session, 04.11): the soonest red, the rest plain. */
.next-chips { margin-top: 10px; align-items: center; }
.next-chips time.is-next { background: var(--accent); color: #fff; }
.next-chips-day { color: var(--muted); font-size: 12px; font-weight: 700; }
.tt-refusal p { margin: 0 0 10px; color: var(--ink-2); font-size: 14px; }
/* Yandex draws the captcha 300 px wide; a phone column is a little narrower. */
.tt-captcha { max-width: 100%; overflow-x: auto; }
.tt-retry { padding: 7px 12px; border: 1px solid var(--divider); border-radius: 9px; background: var(--soft); color: var(--ink); font-weight: 700; cursor: pointer; }
.unassigned-note { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.route-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.no-times { margin: 0; color: var(--muted); font-size: 13px; }
.board-no-times { margin: 0 0 14px; font-size: 15px; }
.literal-route-note { width: fit-content; margin-top: 10px !important; padding: 7px 10px; border-radius: 9px; background: var(--hot-bg); color: var(--hot-ink) !important; font-size: 13px !important; font-weight: 750; }
.stale-route-note { width: fit-content; margin-top: 8px !important; padding: 7px 10px; border-radius: 9px; background: var(--note-bg); color: var(--note-ink) !important; font-size: 13px !important; font-weight: 750; }
.route-sources { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-top: 12px; color: var(--muted); font-size: 12px; }
.route-sources a { padding: 4px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font-weight: 700; text-transform: uppercase; }
.interval-chip { background: var(--hot-bg); color: var(--hot-ink); }
.unassigned-note { flex-basis: 100%; color: var(--note-ink); }
.unassigned-chip { border: 1px solid var(--note-line); background: var(--note-bg); color: var(--note-ink); }
.route-map { margin: 0 20px 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-2); }
.route-map-head { display: flex; justify-content: space-between; gap: 20px; padding: 13px 16px; background: var(--surface); font-size: 13px; }
.route-map-head a { color: var(--accent); font-weight: 750; }
.route-map > svg { display: block; width: 100%; height: auto; min-height: 210px; background: radial-gradient(circle at 20% 30%, var(--map-a) 0, var(--map-b) 60%); }
.route-map-line { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.route-map-stop { fill: var(--surface); stroke: var(--ink); stroke-width: 3; }

.search-page-head { padding-bottom: 55px; }
.search-page-form { max-width: 700px; display: flex; gap: 8px; margin-top: 28px; padding: 7px; border-radius: 17px; background: var(--surface); box-shadow: var(--shadow); }
.search-page-form input { min-width: 0; flex: 1; padding: 14px 16px; border: 0; outline: 0; background: transparent; }
.result-block + .result-block { margin-top: 54px; }
.result-block h2 { margin-bottom: 18px; font-size: 26px; }
.stop-results { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stop-results a { display: flex; align-items: center; gap: 13px; padding: 17px; border: 1px solid var(--line); border-radius: 16px; }
.stop-results a > span:last-child { margin-left: auto; color: var(--muted); }
.stop-results strong, .stop-results small { display: block; }
.stop-results small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.stop-pin { width: 17px; height: 17px; border: 4px solid var(--accent); border-radius: 50%; }
.empty-state { padding: 72px 30px; border: 1px dashed var(--line-strong); border-radius: 24px; background: var(--surface-2); text-align: center; }
.empty-state h3, .empty-state h1 { margin: 0 0 8px; font-size: 28px; }
.empty-state p { margin: 0; color: var(--muted); }
.empty-dot { display: block; width: 18px; height: 18px; margin: 0 auto 18px; border: 5px solid var(--accent); border-radius: 50%; }
.error-state > span { color: var(--accent); font-size: 72px; font-weight: 900; letter-spacing: -5px; }
.primary-button { display: inline-block; margin-top: 24px; padding: 13px 19px; border-radius: 12px; background: var(--accent); color: white; font-weight: 800; }

.site-footer { padding: 50px 0; border-top: 1px solid var(--line); background: var(--surface-2); }
.footer-inner { display: flex; justify-content: space-between; gap: 40px; color: var(--muted); font-size: 13px; }
.brand-small { color: var(--ink); font-size: 19px; gap: 8px; }
.brand-small .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
.footer-inner p { margin: 8px 0 0; }
.footer-note { max-width: 430px; text-align: right; }

@media (max-width: 900px) {
    .header-nav { display: none; }
    .hero-card { min-height: auto; padding: 52px 36px; }
    .hero-card::before { width: 240px; height: 240px; right: -100px; top: -100px; }
    .hero-card::after { display: none; }
    .city-grid { grid-template-columns: repeat(2, 1fr); }
    .schedule-layout { grid-template-columns: 1fr; }
    .schedule-controls { position: static; grid-template-columns: 1fr 1fr; }
    .update-note { display: none; }
}

@media (max-width: 650px) {
    .container { width: min(100% - 24px, 1180px); }
    .header-inner { height: 66px; }
    .header-search { display: none; }
    .brand { font-size: 20px; }
    .hero { padding-top: 12px; }
    .hero-card { padding: 38px 22px; border-radius: 24px; }
    .hero h1 { font-size: 43px; letter-spacing: -2.7px; }
    .hero-copy p { font-size: 16px; }
    .hero-search-row { display: block; }
    .hero-search-row input, .hero-search-row button { width: 100%; }
    .hero-stats { gap: 20px; }
    .hero-stats strong { font-size: 18px; }
    .section { padding: 52px 0; }
    .section-heading { display: block; }
    .section-heading p { margin-top: 12px; }
    .city-grid, .route-grid, .benefits, .stop-results { grid-template-columns: 1fr; }
    .benefits { gap: 25px; }
    .page-head, .route-hero { padding: 40px 0 30px; }
    .page-head h1, .route-hero h1 { font-size: 39px; letter-spacing: -2px; }
    .route-title-row { align-items: flex-start; }
    .route-number-large { min-width: 66px; height: 66px; border-radius: 19px; font-size: 24px; }
    .schedule-controls { grid-template-columns: 1fr; }
    .direction-head { padding: 22px 20px; }
    .direction-head > span { display: none; }
    .stop-item { grid-template-columns: 48px 1fr; }
    .stop-line::before { left: 23px; }
    .stop-line i { left: 16px; }
    .stop-content { padding-right: 18px; }
    .stop-heading { display: block; }
    .stop-heading small { display: block; margin-top: 3px; }
    .route-map { margin: 0 12px 16px; }
    .route-map-head { display: block; }
    .route-map-head a { display: block; margin-top: 5px; }
    .footer-inner { display: block; }
    .footer-note { margin-top: 25px; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; }
}

/* Route facts and the live "now" card (step 4) */
.route-facts-wrap { padding: 0 0 6px; }
.route-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0; }
.route-facts div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.route-facts dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.route-facts dd { margin: 4px 0 0; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.now-card { margin-bottom: 16px; padding: 16px 18px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 16px; background: var(--surface); }
.now-card p { margin: 4px 0 0; }
.now-stop { color: var(--muted); font-size: 13px; }
.now-main strong { font-size: 30px; font-weight: 850; font-variant-numeric: tabular-nums; }
.now-main span { margin-left: 6px; color: var(--accent); font-weight: 800; }
.now-meta { color: var(--muted); font-size: 13px; }
.stop-next { margin-left: auto; padding: 3px 8px; border-radius: 8px; background: var(--hot-bg); color: var(--hot-ink); font-size: 12px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stop-heading .stop-next + small { margin-left: 8px; }
@media (max-width: 640px) {
  .route-facts { grid-template-columns: repeat(2, 1fr); }
  .route-facts dd { font-size: 16px; }
  .stop-heading { flex-wrap: wrap; }
}
.route-facts-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.route-faq h2 { margin: 0 0 14px; }
.route-faq details { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); margin-bottom: 10px; }
.route-faq summary { padding: 14px 16px; font-weight: 750; cursor: pointer; }
.route-faq p { margin: 0; padding: 0 16px 14px; color: var(--muted); line-height: 1.55; }

/* City page: route number tiles (step 6) */
.route-badge-train, .route-number-large.route-badge-train { background: #1f9d55; }
.route-badge-metro, .route-number-large.route-badge-metro { background: #c2255c; }
.route-badge-water, .route-number-large.route-badge-water { background: #0c8fa3; }
.route-badge-cable, .route-number-large.route-badge-cable { background: #5f6b7a; }
.tile-filter { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.tile-filter span { color: var(--muted); font-size: 13px; font-weight: 700; }
.tile-filter input { width: min(100%, 320px); padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); font: inherit; }
.tile-section { margin-bottom: 26px; scroll-margin-top: 90px; }
.tile-section h2 { margin: 0 0 12px; font-size: 20px; }
.tile-section h2 span { color: var(--muted); font-size: 14px; font-weight: 700; }
.num-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.num-tiles.route-badge-bus, .num-tiles.route-badge-tram, .num-tiles.route-badge-trolleybus, .num-tiles.route-badge-route_taxi,
.num-tiles.route-badge-train, .num-tiles.route-badge-metro, .num-tiles.route-badge-water, .num-tiles.route-badge-cable { background: none; }
.num-tiles { --tile: var(--accent); }
.num-tiles.route-badge-tram { --tile: #7b54e7; }
.num-tiles.route-badge-trolleybus { --tile: #2189e8; }
.num-tiles.route-badge-route_taxi { --tile: #ef8e21; }
.num-tiles.route-badge-train { --tile: #1f9d55; }
.num-tiles.route-badge-metro { --tile: #c2255c; }
.num-tiles.route-badge-water { --tile: #0c8fa3; }
.num-tiles.route-badge-cable { --tile: #5f6b7a; }
.num-tile { display: grid; place-items: center; min-height: 48px; padding: 4px 6px; border-radius: 12px; background: var(--tile, var(--accent)); color: white; font-size: 16px; font-weight: 850; text-align: center; word-break: break-word; line-height: 1.1; font-variant-numeric: tabular-nums; }
.num-tile:hover { filter: brightness(1.08); }
.num-tile.is-empty { background: var(--surface) !important; color: var(--muted); border: 1px dashed var(--line-strong); }
.named-routes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 18px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 14px; }
.named-routes a { font-weight: 650; }
.named-routes small { color: var(--muted); }
.tile-legend { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.tile-legend .num-tile { display: inline-grid; min-height: 28px; min-width: 38px; font-size: 12px; }
@media (max-width: 640px) {
  .num-tiles { grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; }
  .num-tile { min-height: 44px; font-size: 15px; }
  .tile-filter input { flex: 1; width: auto; }
}

/* Theme toggle, phone bottom bar, back-to-top (step 7) */
.theme-toggle { display: grid; place-items: center; width: 40px; height: 40px; margin-left: 10px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); cursor: pointer; }
.theme-toggle:hover { border-color: var(--line-strong); }
.bottom-bar { display: none; }
.to-top { position: fixed; right: 18px; bottom: 22px; z-index: 60; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); font-size: 20px; font-weight: 800; box-shadow: var(--shadow); cursor: pointer; }
@media (max-width: 900px) {
  .bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--header-bg); backdrop-filter: blur(18px); }
  .bottom-bar a { display: grid; justify-items: center; gap: 2px; padding: 4px 0; color: var(--muted); font-size: 11px; font-weight: 700; }
  .bottom-bar a.active { color: var(--accent); }
  .bottom-bar a { white-space: nowrap; letter-spacing: -.2px; }
  .bottom-bar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .to-top { bottom: calc(76px + env(safe-area-inset-bottom)); right: 14px; }
  .theme-toggle { margin-left: auto; }
}
.page-anchors { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 13px; font-weight: 700; }
.page-anchors a { color: var(--accent); }
#raspisanie, #voprosy, #oshibka { scroll-margin-top: 80px; }
/* Grid items default to min-width: auto, so one long no-wrap title widened the whole card grid past the screen. */
.route-card, .route-card-copy { min-width: 0; }

/* Yandex map (step 8) */
.route-map-canvas { position: relative; z-index: 0; isolation: isolate; height: 380px; background: var(--map-b); }
/* Owner's decision: no "Открыть Яндекс Карты" button and no copyright/logo block
   on our maps (the API's own `copyrights: false` is ignored). */
.route-map-canvas .ymaps3--map-copyrights,
.route-map-canvas .ymaps3--open-maps-button,
.route-map-canvas .ymaps3--control:has(.ymaps3--open-maps-button) { display: none !important; }
.map-buttons { position: absolute; z-index: 5; right: 10px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; }
.map-button { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 12px; background: var(--surface); color: var(--ink); font: 700 22px/1 inherit; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); cursor: pointer; }
.map-button:hover { color: var(--accent); }
.map-button svg { width: 20px; height: 20px; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.map-button.is-busy { opacity: .55; }
.map-me { display: block; width: 18px; height: 18px; border: 3px solid #fff; border-radius: 50%; background: #2f7bff; box-shadow: 0 0 0 6px rgba(47, 123, 255, .25), 0 1px 4px rgba(0, 0, 0, .3); transform: translate(-50%, -50%); }
@media (max-width: 640px) { .route-map-canvas { height: 280px; } }

/* Stop board (step 9) */
.board-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.board-head h2 { margin: 0; }
.weekday-row { display: flex; flex-wrap: wrap; gap: 6px; }
.weekday-row button { min-width: 44px; }
.board-list { display: grid; gap: 10px; }
.board-row { display: flex; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.board-row .route-badge { min-width: 52px; height: 52px; font-size: 18px; border-radius: 15px; }
.board-main { min-width: 0; flex: 1; }
.board-title { display: block; }
.board-title span { color: var(--muted); font-weight: 600; }
.board-toward { margin: 3px 0 0; color: var(--ink-2); font-size: 14px; }
.board-next { margin: 8px 0 0; width: fit-content; padding: 5px 10px; border-radius: 10px; background: var(--soft); font-weight: 800; font-variant-numeric: tabular-nums; }
.board-next.is-soon { background: var(--hot-bg); color: var(--hot-ink); }
.board-row .stop-times { margin-top: 8px; }
.stop-map .route-map-canvas { height: 320px; }
@media (max-width: 640px) {
  .board-row { padding: 12px; gap: 10px; }
  .board-row .route-badge { min-width: 44px; height: 44px; font-size: 15px; }
}
/* Transfers on the route stop list (step 9) */
.transfers { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 6px 0 0; font-size: 12px; }
.transfers span { color: var(--muted); margin-right: 2px; }
.transfers-more { color: var(--muted); font-weight: 700; }
/* City index split by letter (step 9) */
.letter-index a.active { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.city-list { columns: 4 200px; column-gap: 28px; margin: 0; padding: 0; list-style: none; }
.city-list li { break-inside: avoid; padding: 5px 0; border-bottom: 1px solid var(--divider); }
.city-list a { font-weight: 650; }
.city-list small { color: var(--muted); margin-left: 4px; }
.route-facts .is-wide { grid-column: span 2; }
.route-facts .is-wide dd { font-size: 15px; }

/* Share and print (step 11) */
.share-status { margin-left: 8px; color: var(--muted); font-size: 13px; }
@media print {
  .site-header, .site-footer, .bottom-bar, .to-top, .theme-toggle, .btn-favorite, .share-status, .route-map,
  .now-wrap, .schedule-controls, .page-anchors, #pohozhie, #voprosy, #oshibka, .stop-next, .transfers, .next-chips { display: none !important; }
  body { padding: 0; background: #fff; color: #000; }
  .route-hero, .page-head { padding: 0 0 12px; background: none; }
  .schedule-layout { display: block; }
  .direction-panel { border: 0; box-shadow: none; }
  .stop-content { padding: 8px 0; break-inside: avoid; }
  .times-list time { padding: 0 4px; background: none; font-weight: 600; }
  .stop-times summary::after { content: none; }
  .route-facts div { border-color: #ccc; }
}
.print-only { display: none; }
@media print { .print-only { display: block; margin: 6px 0 0; font-weight: 700; } }

/* Route reviews (step 11) */
.route-reviews h2 { margin: 0 0 14px; }
.route-reviews h2 span { margin-left: 8px; color: var(--muted); font-size: 15px; font-weight: 700; }
.review { padding: 14px 16px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.review p { margin: 0; line-height: 1.55; }
.review-meta { margin-bottom: 6px !important; color: var(--muted); font-size: 13px; }
.review-meta b { color: #f5a623; letter-spacing: 1px; margin-right: 6px; }
.review-meta b span { color: var(--line-strong); }
.review-empty { color: var(--muted); }
.review-widget { padding: 12px 0; }
.review-widget summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.review-widget form { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
.review-widget textarea, .review-widget input[type="text"] { padding: 12px; border-radius: 12px; border: 1px solid var(--line-strong); font: inherit; }
.review-widget .report-status { color: var(--accent); font-size: 13px; margin: 0; }
.rating-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; margin: 0; padding: 0; border: 0; }
.rating-label { color: var(--muted); font-size: 13px; font-weight: 700; margin-bottom: -6px; }
.rating-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating-input label { font-size: 28px; line-height: 1; color: var(--line-strong); cursor: pointer; }
.rating-input input:checked ~ label, .rating-input label:hover, .rating-input label:hover ~ label { color: #f5a623; }
.rating-input input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 4px; }
.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
@media print { #otzyvy { display: none !important; } }

/* Planner: journeys with one change (step 12) */
.transfer-card { margin-bottom: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.transfer-leg { display: flex; align-items: center; gap: 12px; }
.transfer-leg .route-badge { min-width: 46px; height: 46px; font-size: 16px; border-radius: 13px; }
.transfer-leg p { margin: 0; }
.transfer-leg small { display: block; color: var(--muted); font-size: 12px; }
.transfer-change { margin: 8px 0 8px 58px; color: var(--accent); font-size: 13px; font-weight: 700; }
.transfer-times { margin: 10px 0 0; color: var(--muted); font-size: 13px; }

/* Yandex map pins (JS API v3 places the element's top-left on the point) */
.ymap-pin { position: absolute; display: block; width: 12px; height: 12px; transform: translate(-50%, -50%); border: 3px solid #18191b; border-radius: 50%; background: #fff; box-sizing: border-box; }
.ymap-pin.is-big { width: 18px; height: 18px; }
.ymap-pin.is-accent { border-color: var(--accent); }
.ymap-label { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); padding: 3px 8px; border-radius: 8px; background: #fff; color: #18191b; font-size: 12px; font-weight: 700; white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.city-fare { max-width: 760px; margin-top: 14px !important; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }

/* ---- Route page, stage 1 (Oct 2026): timetable on the first screen ---- */
.route-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.route-actions .btn-favorite { margin-top: 0; }
.route-facts-wrap { padding: 18px 0 4px; }
.route-facts-line { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.route-facts-line li { display: flex; align-items: baseline; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 13px; color: var(--muted); }
.route-facts-line b { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.route-facts-note { font-size: 13px; }
.control-label { font-size: 12px; }
.stop-heading small { font-size: 13px; }
.mini-badge { font-size: 12px; }
.unassigned-note { font-size: 13px; }

.day-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.day-strip button { min-width: 0; display: grid; gap: 2px; justify-items: center; padding: 7px 8px; border: 0; border-radius: 12px; background: var(--soft); color: var(--ink); cursor: pointer; }
.day-strip button span { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.day-strip button b { font-size: 17px; font-variant-numeric: tabular-nums; }
.day-strip button.is-weekend b { color: var(--accent-dark); }
.day-strip button[data-offset="0"], .day-strip button[data-offset="1"] { grid-column: span 2; }
.day-strip button.active { background: var(--accent); }
.day-strip button.active span, .day-strip button.active b { color: #fff; }
.day-strip button:focus-visible, .weekday-grid button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.route-map-wrap { margin: 0 20px 20px; }
.route-map-wrap .route-map { margin: 10px 0 0; }
.route-map-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); font-size: 14px; font-weight: 750; cursor: pointer; list-style: none; }
.route-map-toggle::-webkit-details-marker { display: none; }
.route-map-toggle::before { content: '🗺'; }
.route-map-wrap[open] > .route-map-toggle { display: none; }

/* Grid children must not grow with a long strip of dates. */
.schedule-layout > *, .schedule-controls, .control-card { min-width: 0; }
.day-strip { max-width: 100%; }

/* A day's timetable (owner's layout, 06.11.2026): "Ближайшие" on top, the gone
   hours folded into one line, then a block per hour — the hour on a plate on the
   left, its minutes ":MM" on the right, wrapping inside the block — and the
   headway line. Up to eight runs a day: plain HH:MM chips (.times-list > time). */
.times-list > time.is-past { color: var(--muted); opacity: .6; }
.times-list > time.is-next { background: var(--accent); color: #fff; }
.times-list:has(.tt-hours) { display: block; }
.tt-next { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 7px; margin-bottom: 10px; }
.tt-next > span { margin-right: 3px; color: var(--muted); font-size: 12px; font-weight: 800; }
.tt-next time.is-next { background: var(--accent); color: #fff; }
.tt-next small { margin-right: 5px; color: var(--accent); font-size: 13px; font-weight: 750; }
.tt-gone { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin: 0 0 10px; padding: 6px 12px; border-radius: 10px; background: var(--soft); color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.tt-gone button { padding: 7px 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 750; cursor: pointer; }
.tt-hours { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.tt-hour { display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 7px; border: 1px solid var(--line); border-radius: 13px; }
.tt-h { flex: 0 0 auto; display: grid; justify-items: center; min-width: 46px; padding: 5px 6px 4px; border-radius: 9px; background: var(--soft); font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }
.tt-h small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 700; }
.tt-mins { display: flex; flex-wrap: wrap; gap: 2px 0; min-width: 0; padding-top: 3px; }
.times-list .tt-mins time { padding: 3px 3px; border-radius: 7px; background: transparent; font-size: 15px; font-weight: 700; }
.tt-mins time::before { content: ":"; color: var(--muted); font-weight: 500; }
.times-list .tt-mins time.is-past { color: var(--muted); opacity: .6; font-weight: 500; }
.times-list .tt-mins time.is-next { background: var(--accent); color: #fff; }
.tt-mins time.is-next::before { color: inherit; }
.tt-hour.is-now { border-color: var(--accent); }
.tt-hour.is-now .tt-h { background: var(--accent); color: #fff; }
.tt-hour.is-now .tt-h small { color: inherit; opacity: .85; }
.is-folded .tt-hour.is-gone { display: none; }
.tt-total { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
/* Phones: two blocks a row, three minutes a line (a run every 10 min = two lines). */
@media (max-width: 640px) {
    .tt-hours { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 6px; }
    .tt-hour { gap: 5px; padding: 5px; border-radius: 11px; }
    .tt-h { min-width: 38px; padding: 4px 4px 3px; font-size: 19px; }
    .tt-mins { gap: 1px 0; padding-top: 2px; }
    .times-list .tt-mins time { padding: 3px 2px; font-size: 14px; }
    .tt-next { gap: 5px; }
    .tt-next time { padding: 6px 8px; }
}
/* 320 px: still two blocks a row, two minutes a line. */
@media (max-width: 360px) {
    .tt-hours { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
    .tt-h { min-width: 32px; font-size: 17px; }
}
.transfers-more { font-size: 13px; }

@media (max-width: 640px) {
    /* Phone: number, direction and the next runs on the first screen. */
    .route-hero { padding: 18px 0 16px; }
    .route-hero h1 { font-size: 26px; letter-spacing: -1px; }
    .route-hero .eyebrow, .route-hero .breadcrumbs { display: none; }
    /* The stop's name says nothing of the town: with the crumbs gone, the city leads the line. */
    .hero-city { display: inline; color: var(--ink); font-weight: 700; }
    .hero-city::after { content: " · "; color: var(--muted); font-weight: 400; }
    .route-title-row { gap: 14px; }
    .route-title-row .route-number-large { min-width: 54px; height: 54px; font-size: 21px; border-radius: 14px; }
    .route-title-row p.route-subtitle { margin-top: 6px; font-size: 15px; }
    .route-actions { margin-top: 10px; }
    .route-actions .btn-favorite { padding: 7px 11px; }
    .btn-icon .btn-text { display: none; }

    /* Facts in one swipeable line; the details live further down. */
    .route-facts-wrap { padding-top: 12px; }
    .route-facts-line { flex-wrap: nowrap; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; padding-right: 24px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
    .route-facts-line li { flex: 0 0 auto; padding: 6px 9px; }
    .route-facts-line li span { display: none; }
    .route-facts-line li[data-fact="span"] span, .route-facts-line li[data-fact="trips"] span { display: inline; }
    .route-facts-line li[data-fact="days"], .route-facts-line li[data-fact="stops"], .route-facts-line li[data-fact="length"] { display: none; }
    [data-facts-note], .fare-note, .page-anchors { display: none; }

    /* The first stop already shows the next run and marks it in the table. */
    .now-wrap { display: none; }
    .schedule-app.section { padding-top: 14px; }
    .schedule-layout { gap: 10px; }
    .schedule-controls { gap: 8px; }
    .control-card { padding: 10px; }
    /* The picked variant is already lit in the switch. */
    .direction-head, .control-card .control-label { display: none; }
    .day-strip { display: flex; overflow-x: auto; scrollbar-width: none; }
    .day-strip button { flex: 0 0 auto; min-width: 56px; padding: 6px 8px; grid-column: auto; }
    .day-strip button span { font-size: 12px; }
    .direction-list { gap: 4px; }
    .direction-list button { padding: 7px 8px; font-size: 13px; }
    .route-map-wrap { margin: 10px 12px 4px; }
    .route-map-toggle { padding: 7px 12px; font-size: 13px; }
    .stop-item { min-height: 0; }
    .stop-content { padding-top: 16px; padding-bottom: 16px; }
}

/* ---- Stage 2 (Oct 2026): menu, footer, pages ---- */
.header-nav a.active { color: var(--accent); }
.city-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); font-size: 13px; font-weight: 700; white-space: nowrap; }
.city-chip::before { content: '📍'; font-size: 12px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 32px; color: var(--muted); font-size: 14px; }
.footer-grid nav { display: grid; align-content: start; gap: 8px; }
.footer-grid h2 { margin: 0 0 4px; color: var(--ink); font-size: 14px; }
.footer-grid nav a { color: var(--ink-2); }
.footer-grid nav a:hover { color: var(--accent); }
.footer-brand p { margin: 10px 0 0; max-width: 34ch; }
.footer-grid .footer-note { text-align: left; font-size: 13px; }
.prose { max-width: 72ch; }
.prose h2 { margin: 32px 0 10px; font-size: 22px; }
.prose p, .prose li { color: var(--ink-2); line-height: 1.6; }
.prose ul { padding-left: 20px; display: grid; gap: 6px; }
.search-understood { margin: 12px 0 0; color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.search-understood b { padding: 3px 9px; border-radius: 8px; background: var(--soft); color: var(--ink); }
.search-understood a { color: var(--accent); font-weight: 700; }
.city-card strong small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}
/* City page: list of routes, or number tiles. */
.route-list-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.route-list-tools .tile-filter { margin: 0; flex: 1 1 280px; }
.route-list-tools .tile-filter input { width: 100%; max-width: 420px; font-size: 15px; }
.view-switch { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--soft); }
.view-switch button { padding: 7px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 750; cursor: pointer; }
.view-switch button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.route-list { --tile: var(--accent); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 6px 14px; margin: 0; padding: 0; list-style: none; }
.route-list.route-badge-tram { --tile: #7b54e7; }
.route-list.route-badge-trolleybus { --tile: #2189e8; }
.route-list.route-badge-route_taxi { --tile: #ef8e21; }
.route-list.route-badge-train { --tile: #1f9d55; }
.route-list.route-badge-metro { --tile: #c2255c; }
.route-list.route-badge-water { --tile: #0c8fa3; }
.route-list.route-badge-cable { --tile: #5f6b7a; }
.route-list[class*="route-badge-"] { background: none; color: inherit; }
.route-list a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 8px 4px 4px; border-radius: 12px; color: var(--ink); }
.route-list a:hover { background: var(--soft); }
.route-list b { flex: 0 0 auto; display: grid; place-items: center; min-width: 46px; height: 36px; padding: 0 6px; border-radius: 10px; background: var(--tile); color: #fff; font-size: 15px; font-variant-numeric: tabular-nums; }
.route-list li { min-width: 0; }
.route-list span { min-width: 0; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; line-height: 1.3; color: var(--ink-2); }
.route-list.is-empty b { background: var(--surface); color: var(--muted); border: 1px dashed var(--line-strong); }
.route-list > li.route-badge-tram { --tile: #7b54e7; }
.route-list > li.route-badge-trolleybus { --tile: #2189e8; }
.route-list > li.route-badge-route_taxi { --tile: #ef8e21; }
.route-list > li.route-badge-train { --tile: #1f9d55; }
.route-list > li.route-badge-metro { --tile: #c2255c; }
.route-list > li.route-badge-water { --tile: #0c8fa3; }
.route-list > li.route-badge-cable { --tile: #5f6b7a; }
.route-list > li.is-untimed b { background: var(--surface); color: var(--muted); border: 1px dashed var(--line-strong); }
.route-list-more { margin: 12px 0 0; font-weight: 700; }
.direction-more summary { padding: 8px 10px; color: var(--accent); font-size: 14px; font-weight: 700; cursor: pointer; }
.direction-more[open] summary { color: var(--muted); }
.route-untimed { margin-top: 10px; }
.route-untimed summary { color: var(--muted); font-size: 14px; font-weight: 700; cursor: pointer; }
.route-untimed .route-list { margin-top: 10px; }
.as-tiles .route-list { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.as-tiles .route-list a { padding: 0; min-height: 0; }
.as-tiles .route-list b { width: 100%; height: 48px; font-size: 16px; }
.as-tiles .route-list span { display: none; }
@media (max-width: 640px) { .route-list { grid-template-columns: minmax(0, 1fr); } }
.region-group { margin-top: 22px; }
.region-group h2 { margin: 0 0 10px; font-size: 17px; }
.region-group h2 span { color: var(--muted); font-size: 13px; }
/* Home (stage 2) */
.hero-card { min-height: 0; padding: 56px 70px; }
.hero-locate { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.hero-locate-status { color: var(--ink-2); font-size: 14px; }
/* A short block: the next section's own top padding is spacing enough. */
.home-mine.section { padding-bottom: 0; }
.home-mine .container { display: grid; gap: 24px; }
.mine-city h2 { margin: 6px 0 4px; font-size: 28px; }
.mine-city p { margin: 0; color: var(--muted); }
.mine-city p a { color: var(--accent); font-weight: 700; }
.mine-stops { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 14px; }
.mine-stops a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-strong); }
.mine-stops-title { width: 100%; margin: 0; color: var(--muted); }
.section-heading p a { color: var(--accent); font-weight: 700; }
@media (max-width: 640px) {
    .hero-card { padding: 28px 18px; border-radius: 24px; }
    .hero-card::before, .hero-card::after { display: none; }
    .hero h1 { font-size: 34px; letter-spacing: -1.5px; }
    .hero-copy p { font-size: 16px; margin-top: 14px; }
    .hero-search { margin-top: 22px; }
    .hero-search-row input { padding: 12px; }
    .hero-stats { gap: 20px; margin-top: 22px; }
    .city-grid-home { grid-template-columns: 1fr 1fr; gap: 8px; }
    .city-grid-home .city-card { padding: 12px; gap: 8px; }
    .city-grid-home .city-initial, .city-grid-home .arrow { display: none; }
    .benefits { grid-template-columns: 1fr; gap: 20px; }
}
.ghost { padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 14px; cursor: pointer; }
.ghost:hover { border-color: var(--ink-2); }
.ghost:disabled { opacity: .6; cursor: progress; }
@media (max-width: 640px) {
    .page-head h1 { font-size: 32px; letter-spacing: -1px; }
    .city-fare { font-size: 13px; padding: 8px 10px; }
    .filter-pills { flex-wrap: nowrap; overflow-x: auto; margin-top: 16px; padding-bottom: 4px; scrollbar-width: none; }
    .filter-pills a { flex: 0 0 auto; padding: 8px 12px; }
    .nearby-widget { margin-top: 12px; }
    .route-list-tools .view-switch { display: none; }
}
@media (max-width: 640px) {
    .page-head .city-fare { font-size: 13px; line-height: 1.45; }
    .page-head > .container > p { font-size: 16px; }
    [data-route-tiles].section { padding-top: 18px; }
}
/* Planner (stage 3) */
.planner-swap { align-self: flex-end; margin-bottom: 4px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 18px; cursor: pointer; }
.planner-near { margin-top: 6px; padding: 0; border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 700; cursor: pointer; }
.planner-submit { padding: 13px 22px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 800; cursor: pointer; }
.planner-submit:hover { background: var(--accent-dark); }
.planner-status { flex-basis: 100%; margin: 0; color: var(--ink-2); font-size: 14px; }
.planner-option { align-items: flex-start; margin-bottom: 14px; }
.planner-option-body { flex: 1; min-width: 0; }
.planner-option-meta, .planner-option-today { margin: 4px 0; color: var(--muted); font-size: 14px; }
.planner-option-meta b { color: var(--ink); }
.planner-times summary { color: var(--accent); font-size: 13px; font-weight: 750; cursor: pointer; }
.planner-times .times-list { display: block; }
@media (max-width: 640px) {
    .planner-form { gap: 10px; }
    .planner-swap { align-self: center; margin: 0; }
    .planner-submit { width: 100%; }
}
/* Stop page (stage 3) */
.stop-sign svg { width: 42px; height: 42px; color: #fff; }
@media print {
  .stop-board .weekday-grid, .board-next, .stop-map, .section-muted, [data-print-board], .nearby-widget { display: none !important; }
  .board-row { break-inside: avoid; border: 0; border-bottom: 1px solid #999; border-radius: 0; padding: 8px 0; }
  .board-row .stop-times summary { display: none; }
  /* Printed: the whole day in hour blocks, nothing folded, nothing lit. */
  .tt-next, .tt-gone { display: none !important; }
  .is-folded .tt-hour.is-gone { display: flex; }
  .tt-hours { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; }
  .tt-hour, .tt-hour.is-now { break-inside: avoid; padding: 3px; border-color: #bbb; }
  .tt-h, .tt-hour.is-now .tt-h { background: none; color: #000; font-size: 16px; }
  .times-list time, .times-list .tt-mins time { color: #000 !important; opacity: 1 !important; background: none !important; }
}
.city-about p { max-width: 75ch; color: var(--ink-2); line-height: 1.6; }
.error-search { margin: 18px auto 10px; max-width: 460px; }
.error-hints-title { margin-bottom: 6px; font-weight: 700; }
.error-hints { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin: 0 auto 14px; }
.changes-kind { margin: 14px 0 8px; font-size: 15px; color: var(--ink-2); }
/* Fingers, not cursors: list links and badges get a taller hit area on phones
   without changing how they look (links were 17–22 px tall). */
@media (max-width: 640px) {
    .footer-grid nav a, .named-routes a, .city-list a, .mine-city a, .section-heading a, .breadcrumbs a, .transfers-more { display: inline-block; padding-block: 8px; }
    .named-routes, .city-list { row-gap: 2px; }
    .footer-grid nav { gap: 0; }
    .mini-badge { min-width: 34px; height: 30px; font-size: 12px; }
    .transfers { row-gap: 6px; }
    .stop-times summary, .planner-times summary { padding-block: 8px; }
    .stop-heading h3 a { display: inline-block; padding-block: 2px; margin-block: -2px; }
    .review-widget, .report-widget { padding-block: 4px; }
    .review-widget summary, .report-widget summary { padding-block: 8px; }
    .board-title { padding-block: 3px; }
    .planner-near { margin-top: 0; padding-block: 8px; }
    /* Stop board: seven days in one row even at 320 px. */
    .weekday-row { flex: 1 1 100%; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
    .weekday-row button { min-width: 0; }
    /* 404: the search field gets the room the card padding and the button took. */
    .error-state { padding-inline: 14px; }
    .error-search button { padding-inline: 16px; }
}
/* Route cards (search, directions, similar) on phones and on tablets, where they stand
   two in a row: the destination is the point, so the badge shrinks, the arrow goes
   (the whole card is the link) and the title gets a fourth line. */
@media (max-width: 900px) {
    .route-card { min-height: 0; gap: 12px; padding: 14px; border-radius: 16px; }
    .route-card .route-badge { min-width: 46px; min-height: 46px; padding: 4px 8px; border-radius: 13px; font-size: 16px; }
    .route-card-arrow { display: none; }
    .route-card-copy strong { -webkit-line-clamp: 4; font-size: 15px; }
}
/* Planner: "Ближайшая ко мне" hangs under the "Откуда" field instead of
   making it taller, so both fields and the buttons line up. */
@media (min-width: 641px) {
    .planner-form { padding-bottom: 30px; }
    .planner-field .planner-near { position: absolute; left: 0; top: calc(100% + 6px); }
}
/* 320 px phones: five labels in one line each. */
@media (max-width: 360px) {
    .bottom-bar a { font-size: 10px; }
}
