/* Fonts are served from this site (no Google request, works offline). */
@font-face { font-family: 'Barlow Semi Condensed'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/barlow-semi-condensed-latin-500-normal.woff2) format('woff2'); 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: 'Barlow Semi Condensed'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/barlow-semi-condensed-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Barlow Semi Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/barlow-semi-condensed-latin-600-normal.woff2) format('woff2'); 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: 'Barlow Semi Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/barlow-semi-condensed-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Barlow Semi Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/barlow-semi-condensed-latin-700-normal.woff2) format('woff2'); 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: 'Barlow Semi Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/barlow-semi-condensed-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'B612 Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/b612-mono-latin-400-normal.woff2) format('woff2'); 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: 'B612 Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/b612-mono-latin-700-normal.woff2) format('woff2'); 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: 'Noto Sans Arabic'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/noto-sans-arabic-arabic-500-normal.woff2) format('woff2'); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }
@font-face { font-family: 'Noto Sans Arabic'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/noto-sans-arabic-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }

:root {
  /* Layout: home = one narrow column of cards; route = full-bleed map with a bottom sheet (side panel from 760px). */
  --sign-yellow: #f5c400;
  --sign-green: #0a6b41;
  --bg: #eef2ef;
  --surface: #ffffff;
  --surface-2: #f3f6f4;
  --ink: #13211a;
  --muted: #55665d;
  --line: #d3dcd6;
  --accent: #0a6b41;
  --on-accent: #ffffff;
  --nav-bg: #0b4a30;
  --nav-ink: #ffffff;
  --danger: #c4302b;
  --on-danger: #ffffff;
  --route: #0a7a49;
  --appr: #1a73e8;
  --det-temp: #e8590c;
  --det-alt: #7048e8;
  --route-case: #ffffff;
  --route-done: #a3b3aa;
  --scrim: rgba(238, 242, 239, 0.86);
  --shadow: 0 8px 28px rgba(9, 38, 25, 0.2);
  --tile-filter: none;
  --f-ui: "Barlow Semi Condensed", "Noto Sans Arabic", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --f-num: var(--f-ui);
  --f-sign: "B612 Mono", "Barlow Semi Condensed", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1310;
    --surface: #141d18;
    --surface-2: #1a251f;
    --ink: #e5ede8;
    --muted: #93a49a;
    --line: #27352d;
    --accent: #36c184;
    --on-accent: #04140c;
    --nav-bg: #0d3324;
    --nav-ink: #f1f7f3;
    --danger: #ff6a5c;
    --on-danger: #1d0503;
    --route: #3fd893;
    --appr: #6fb1ff;
    --det-temp: #ff922b;
    --det-alt: #9775fa;
    --route-case: #0c1310;
    --route-done: #3d4a43;
    --scrim: rgba(12, 19, 16, 0.86);
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
    --tile-filter: invert(1) hue-rotate(180deg) brightness(0.82) contrast(0.92) saturate(0.55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1310;
  --surface: #141d18;
  --surface-2: #1a251f;
  --ink: #e5ede8;
  --muted: #93a49a;
  --line: #27352d;
  --accent: #36c184;
  --on-accent: #04140c;
  --nav-bg: #0d3324;
  --nav-ink: #f1f7f3;
  --danger: #ff6a5c;
  --on-danger: #1d0503;
  --route: #3fd893;
  --appr: #6fb1ff;
  --det-temp: #ff922b;
  --det-alt: #9775fa;
  --route-case: #0c1310;
  --route-done: #3d4a43;
  --scrim: rgba(12, 19, 16, 0.86);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  --tile-filter: invert(1) hue-rotate(180deg) brightness(0.82) contrast(0.92) saturate(0.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-ui);
  font-size: 18px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
.sheet, .loading-card { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--sign-yellow); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }

/* ---------- the stop sign: yellow disc, green H ---------- */
.hsign {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--sign-yellow);
  color: var(--sign-green);
  border: 2px solid var(--sign-green);
  font: 700 14px/1 var(--f-ui);
}
.hsign-lg { width: 52px; height: 52px; font-size: 30px; border-width: 3px; }
.hsign-xl { width: 56px; height: 56px; font-size: 32px; border-width: 3px; }
.hsign.term { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--sign-green); }

/* ---------- home ---------- */
.brand {
  background: var(--hero) right 4px bottom 4px / auto 62% no-repeat, var(--nav-bg);
  color: var(--nav-ink);
  padding-block: calc(env(safe-area-inset-top, 0px) + 22px) 30px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
/* decoration: faint street map and a bus in a hurry (mirrored for right-to-left) */
:root { --hero: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 900 220%22%3E%3Cdefs%3E%3ClinearGradient id=%22s%22 x1=%220%22 x2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%23fff%22 stop-opacity=%220%22/%3E%3Cstop offset=%221%22 stop-color=%22%23fff%22 stop-opacity=%22.8%22/%3E%3C/linearGradient%3E%3ClinearGradient id=%22r%22 x1=%220%22 x2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%23f4c400%22 stop-opacity=%220%22/%3E%3Cstop offset=%22.6%22 stop-color=%22%23f4c400%22 stop-opacity=%22.5%22/%3E%3C/linearGradient%3E%3Cfilter id=%22b%22 x=%22-50%25%22 y=%22-20%25%22 width=%22200%25%22 height=%22140%25%22%3E%3CfeGaussianBlur stdDeviation=%2214 0%22/%3E%3C/filter%3E%3C/defs%3E%3Cg fill=%22none%22 stroke=%22%23fff%22 stroke-linecap=%22round%22 opacity=%22.07%22%3E%3Cpath stroke-width=%229%22 d=%22M-20 60 C120 40 220 90 360 70 S600 20 760 50 920 40 940 30%22/%3E%3Cpath stroke-width=%227%22 d=%22M80 230 C110 160 170 120 260 110 S420 140 520 120%22/%3E%3Cpath stroke-width=%226%22 d=%22M420 -10 C430 50 470 90 520 120 S620 200 700 240%22/%3E%3Cpath stroke-width=%225%22 d=%22M640 -10 C650 40 700 80 820 90 S900 110 930 140%22/%3E%3Cpath stroke-width=%224%22 d=%22M-10 150 C60 160 120 190 200 230%22/%3E%3C/g%3E%3Cpath d=%22M120 178 H780%22 stroke=%22%23fff%22 stroke-opacity=%22.08%22 stroke-width=%2216%22 stroke-linecap=%22round%22/%3E%3Cpath d=%22M120 178 H780%22 stroke=%22url(%23r)%22 stroke-width=%223%22 stroke-dasharray=%2218 14%22/%3E%3Cg stroke=%22url(%23s)%22 stroke-linecap=%22round%22%3E%3Cpath d=%22M330 120 H640%22 stroke-width=%223%22/%3E%3Cpath d=%22M400 136 H630%22 stroke-width=%222%22/%3E%3Cpath d=%22M300 150 H645%22 stroke-width=%224%22/%3E%3Cpath d=%22M450 105 H640%22 stroke-width=%222%22/%3E%3Cpath d=%22M370 165 H640%22 stroke-width=%222.5%22/%3E%3C/g%3E%3Cg filter=%22url(%23b)%22 opacity=%22.35%22 fill=%22%23fff%22%3E%3Crect x=%22560%22 y=%2296%22 width=%22210%22 height=%2272%22 rx=%2214%22/%3E%3C/g%3E%3Cg opacity=%22.3%22%3E%3Crect x=%22640%22 y=%2296%22 width=%22210%22 height=%2272%22 rx=%2214%22 fill=%22%23fff%22/%3E%3Cg fill=%22%230b4a30%22%3E%3Crect x=%22652%22 y=%22108%22 width=%2230%22 height=%2226%22 rx=%224%22/%3E%3Crect x=%22690%22 y=%22108%22 width=%2230%22 height=%2226%22 rx=%224%22/%3E%3Crect x=%22728%22 y=%22108%22 width=%2230%22 height=%2226%22 rx=%224%22/%3E%3Crect x=%22766%22 y=%22108%22 width=%2230%22 height=%2226%22 rx=%224%22/%3E%3Cpath d=%22M806 108 h26 q8 0 10 8 l3 20 h-39z%22/%3E%3Crect x=%22652%22 y=%22144%22 width=%22190%22 height=%224%22 rx=%222%22/%3E%3C/g%3E%3Cg fill=%22%230b4a30%22%3E%3Ccircle cx=%22682%22 cy=%22170%22 r=%2214%22/%3E%3Ccircle cx=%22808%22 cy=%22170%22 r=%2214%22/%3E%3C/g%3E%3Cg fill=%22%23fff%22%3E%3Ccircle cx=%22682%22 cy=%22170%22 r=%226%22/%3E%3Ccircle cx=%22808%22 cy=%22170%22 r=%226%22/%3E%3C/g%3E%3Crect x=%22842%22 y=%22148%22 width=%228%22 height=%228%22 rx=%222%22 fill=%22%23f4c400%22/%3E%3C/g%3E%3C/svg%3E"); }
[dir="rtl"] { --hero: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 900 220%22%3E%3Cdefs%3E%3ClinearGradient id=%22s%22 x1=%220%22 x2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%23fff%22 stop-opacity=%220%22/%3E%3Cstop offset=%221%22 stop-color=%22%23fff%22 stop-opacity=%22.8%22/%3E%3C/linearGradient%3E%3ClinearGradient id=%22r%22 x1=%220%22 x2=%221%22%3E%3Cstop offset=%220%22 stop-color=%22%23f4c400%22 stop-opacity=%220%22/%3E%3Cstop offset=%22.6%22 stop-color=%22%23f4c400%22 stop-opacity=%22.5%22/%3E%3C/linearGradient%3E%3Cfilter id=%22b%22 x=%22-50%25%22 y=%22-20%25%22 width=%22200%25%22 height=%22140%25%22%3E%3CfeGaussianBlur stdDeviation=%2214 0%22/%3E%3C/filter%3E%3C/defs%3E%3Cg transform=%22translate(900,0) scale(-1,1)%22%3E%3Cg fill=%22none%22 stroke=%22%23fff%22 stroke-linecap=%22round%22 opacity=%22.07%22%3E%3Cpath stroke-width=%229%22 d=%22M-20 60 C120 40 220 90 360 70 S600 20 760 50 920 40 940 30%22/%3E%3Cpath stroke-width=%227%22 d=%22M80 230 C110 160 170 120 260 110 S420 140 520 120%22/%3E%3Cpath stroke-width=%226%22 d=%22M420 -10 C430 50 470 90 520 120 S620 200 700 240%22/%3E%3Cpath stroke-width=%225%22 d=%22M640 -10 C650 40 700 80 820 90 S900 110 930 140%22/%3E%3Cpath stroke-width=%224%22 d=%22M-10 150 C60 160 120 190 200 230%22/%3E%3C/g%3E%3Cpath d=%22M120 178 H780%22 stroke=%22%23fff%22 stroke-opacity=%22.08%22 stroke-width=%2216%22 stroke-linecap=%22round%22/%3E%3Cpath d=%22M120 178 H780%22 stroke=%22url(%23r)%22 stroke-width=%223%22 stroke-dasharray=%2218 14%22/%3E%3Cg stroke=%22url(%23s)%22 stroke-linecap=%22round%22%3E%3Cpath d=%22M330 120 H640%22 stroke-width=%223%22/%3E%3Cpath d=%22M400 136 H630%22 stroke-width=%222%22/%3E%3Cpath d=%22M300 150 H645%22 stroke-width=%224%22/%3E%3Cpath d=%22M450 105 H640%22 stroke-width=%222%22/%3E%3Cpath d=%22M370 165 H640%22 stroke-width=%222.5%22/%3E%3C/g%3E%3Cg filter=%22url(%23b)%22 opacity=%22.35%22 fill=%22%23fff%22%3E%3Crect x=%22560%22 y=%2296%22 width=%22210%22 height=%2272%22 rx=%2214%22/%3E%3C/g%3E%3Cg opacity=%22.3%22%3E%3Crect x=%22640%22 y=%2296%22 width=%22210%22 height=%2272%22 rx=%2214%22 fill=%22%23fff%22/%3E%3Cg fill=%22%230b4a30%22%3E%3Crect x=%22652%22 y=%22108%22 width=%2230%22 height=%2226%22 rx=%224%22/%3E%3Crect x=%22690%22 y=%22108%22 width=%2230%22 height=%2226%22 rx=%224%22/%3E%3Crect x=%22728%22 y=%22108%22 width=%2230%22 height=%2226%22 rx=%224%22/%3E%3Crect x=%22766%22 y=%22108%22 width=%2230%22 height=%2226%22 rx=%224%22/%3E%3Cpath d=%22M806 108 h26 q8 0 10 8 l3 20 h-39z%22/%3E%3Crect x=%22652%22 y=%22144%22 width=%22190%22 height=%224%22 rx=%222%22/%3E%3C/g%3E%3Cg fill=%22%230b4a30%22%3E%3Ccircle cx=%22682%22 cy=%22170%22 r=%2214%22/%3E%3Ccircle cx=%22808%22 cy=%22170%22 r=%2214%22/%3E%3C/g%3E%3Cg fill=%22%23fff%22%3E%3Ccircle cx=%22682%22 cy=%22170%22 r=%226%22/%3E%3Ccircle cx=%22808%22 cy=%22170%22 r=%226%22/%3E%3C/g%3E%3Crect x=%22842%22 y=%22148%22 width=%228%22 height=%228%22 rx=%222%22 fill=%22%23f4c400%22/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); }
[dir="rtl"] .brand { background-position: left 4px bottom 4px, 0 0; }
@media (min-width: 760px) {
  .brand { background-size: auto 92%, auto; background-position: right calc(50% - 470px) bottom 6px, 0 0; }
  [dir="rtl"] .brand { background-position: left calc(50% - 470px) bottom 6px, 0 0; }
}
/* language picker in the header */
.brand-inner { max-width: 640px; margin: 0 auto; display: flex; gap: 14px; align-items: center; }
.brand-text { flex: 1; min-width: 0; }
.lang { flex: none; align-self: flex-start; }
.lang select {
  min-height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--nav-ink) 35%, transparent);
  background: transparent;
  color: var(--nav-ink);
  font: 600 16px var(--f-ui);
}
.lang select option { color: var(--ink); background: var(--surface); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.brand h1 { font-size: 32px; font-weight: 700; letter-spacing: 0.01em; line-height: 1.05; }
.brand p { margin: 4px 0 0; font-size: 17px; opacity: 0.86; }

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 calc(env(safe-area-inset-bottom, 0px) + 40px);
}
.search {
  margin-top: -16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.lbl { font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ft { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.ft-fields { display: grid; gap: 12px; min-width: 0; }
.field { display: grid; gap: 6px; min-width: 0; }
.swap {
  width: 48px;
  height: 48px;
  margin-top: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
}
.swap svg { width: 24px; height: 24px; }
.ref-row { display: flex; gap: 10px; align-items: flex-end; }
.ref-field { flex: 0 0 132px; }
.btn-search { flex: 1; min-height: 56px; font-size: 20px; }
.opt { text-transform: none; letter-spacing: 0; font-weight: 500; }
.inp {
  width: 100%;
  min-width: 0;
  height: 56px;
  padding: 0 14px;
  font: 600 20px var(--f-ui);
  color: var(--ink);
  background: var(--surface-2);
  border: 2px solid var(--line);
  border-radius: 12px;
}
.inp:focus { border-color: var(--accent); outline: none; }
.inp::placeholder { color: var(--muted); font-weight: 500; }
/* list of stops under "from" and "to" */
.field:has(> .sugg) { position: relative; }
.inp[role="combobox"] { padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: right 20px center, right 14px center; background-size: 6px 6px; background-repeat: no-repeat; }
.sugg {
  position: absolute;
  z-index: 30;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  max-height: min(46vh, 340px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.sugg-i { padding: 13px 14px; font: 600 18px var(--f-ui); color: var(--ink); border-bottom: 1px solid var(--line); cursor: pointer; }
.sugg-i:last-child { border-bottom: 0; }
.sugg-i:hover, .sugg-i[aria-selected="true"] { background: var(--surface-2); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.1;
  text-align: center;
}
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn-danger { background: var(--danger); color: var(--on-danger); border-color: transparent; }
.btn-big { min-height: 60px; font-size: 21px; width: 100%; }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn.on { background: var(--accent); color: var(--on-accent); border-color: transparent; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  font-size: 17px;
}
.chip[aria-checked="true"], .chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.search .chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.search .chip { padding: 4px 6px; border-radius: 12px; font-size: 16px; line-height: 1.1; }

.status { margin: 16px 2px 0; display: flex; gap: 10px; align-items: flex-start; color: var(--muted); }
.status.error { color: var(--danger); font-weight: 600; }
.status .spin { margin-top: 3px; }

.sec-h {
  margin: 28px 2px 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
/* voice and how-to, folded */
.more-box { margin-top: 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.more-box > summary { min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 2px; font-weight: 700; font-size: 18px; cursor: pointer; list-style: none; }
.more-box > summary::-webkit-details-marker { display: none; }
.more-box > summary::after { content: ''; width: 10px; height: 10px; margin-inline-start: auto; border: solid var(--muted); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.more-box[open] > summary::after { transform: rotate(-135deg); }
.more-box > section { padding-bottom: 16px; }
.more-box .sec-h { margin-top: 8px; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list li { display: flex; gap: 8px; }
.item {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: start;
}
.item-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.item-name { font-weight: 700; font-size: 19px; line-height: 1.2; overflow-wrap: anywhere; }
.item-sub { font-size: 15px; color: var(--muted); overflow-wrap: anywhere; }
.chev { color: var(--muted); font-size: 26px; line-height: 1; }
.chev::after { content: '›'; }
[dir="rtl"] .chev::after { content: '‹'; }
[dir="rtl"] .flip { transform: scaleX(-1); }
.del {
  flex: none;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}
.del.confirm { min-width: 84px; background: var(--danger); color: var(--on-danger); border-color: transparent; }
.more { margin: 10px 2px 0; color: var(--muted); font-size: 16px; }
.empty { margin: 0 2px; color: var(--muted); font-size: 17px; }

.badge {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 52px;
  height: 36px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--b, var(--accent));
  color: var(--bt, var(--on-accent));
  font: 700 18px/1 var(--f-sign);
  letter-spacing: -0.02em;
}

.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; }
.steps li::before {
  content: counter(s);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  color: var(--accent);
  font: 700 16px/1 var(--f-num);
}
.fine { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); display: grid; gap: 8px; }
.fine p { margin: 0; }
.fine a { color: inherit; }

/* ---------- route view ---------- */
.routeview { position: fixed; inset: 0; background: var(--bg); }
#map { position: absolute; inset: 0; background: var(--surface-2); }
.maplibregl-map { font-family: var(--f-ui); background: var(--surface-2); }
.maplibregl-ctrl-attrib { font-size: 11px; }
.maplibregl-ctrl-top-right { top: calc(env(safe-area-inset-top, 0px) + 66px); right: env(safe-area-inset-right, 0px); }
.navigating .maplibregl-ctrl-top-right { top: calc(env(safe-area-inset-top, 0px) + 128px); }
.maplibregl-popup-content { font: 600 16px/1.3 var(--f-ui); color: #10241a; min-width: 230px; padding: 12px 30px 12px 14px; border-radius: 12px; box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35); }
.maplibregl-popup-close-button { width: 30px; height: 30px; font-size: 22px; color: #4a5a52; }
.maplibregl-marker { cursor: pointer; }
.voice-row { display: flex; gap: 8px; align-items: stretch; }
.voice-sel { flex: 1 1 0; min-width: 0; width: 0; font-size: 16px; }
.fine-tip { margin: 8px 0 0; font-size: 14px; color: var(--muted); line-height: 1.35; }
.share-row { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; line-height: 1.35; cursor: pointer; }
.share-row input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--accent); }
/* departures in the stop bubble (the bubble itself stays white in both themes) */
.pop .tt-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 8px; font: 600 14px var(--f-ui); color: #4a5a52; }
.pop .tt-day { margin: 0; padding: 2px 0; font-size: 14px; }
.pop .tt { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; max-height: 156px; overflow-y: auto; margin-top: 6px; padding-right: 2px; }
.pop .tt span { text-align: center; padding: 5px 0; border-radius: 6px; background: #eef3f0; color: #10241a; font: 600 15px var(--f-ui); font-variant-numeric: tabular-nums; }
.pop .tt span.past { opacity: 0.4; }
.pop .tt span.next { background: #0b4a30; color: #fff; }
.pop .tt-msg { margin: 8px 0 0; font: 500 14px/1.35 var(--f-ui); color: #4a5a52; }
.pop .tt-note { margin: 6px 0 0; font: 500 12px var(--f-ui); color: #6b7a72; }

.topbar {
  position: absolute;
  z-index: 1000;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: max(12px, env(safe-area-inset-left, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.fab {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
}
.fab svg { width: 24px; height: 24px; }
.navigating .topbar { display: none; }

.sheet {
  position: absolute;
  z-index: 1000;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 56%;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 calc(env(safe-area-inset-bottom, 0px) + 18px);
  transition: max-height 0.25s ease;
}
.sheet.collapsed { max-height: 206px; overflow: hidden; }
.handle {
  display: grid;
  place-items: center;
  width: 100%;
  height: 26px;
  border: 0;
  background: transparent;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.handle span { width: 46px; height: 5px; border-radius: 3px; background: var(--line); }
.sheet-head { display: flex; gap: 12px; align-items: flex-start; }
.sheet-head .badge { margin-top: 2px; }
.sheet-title { flex: 1; min-width: 0; }
.sheet-title h2 { font-size: 23px; line-height: 1.15; overflow-wrap: anywhere; }
.sheet-title p { margin: 3px 0 0; font-size: 15px; color: var(--muted); overflow-wrap: anywhere; }
.meta { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 2px 0; font: 500 16px/1.3 var(--f-ui); color: var(--muted); font-variant-numeric: tabular-nums; }
.meta span:not(:last-child)::after { content: '·'; margin: 0 8px; }
.warn {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--sign-yellow);
  background: var(--surface-2);
  font-size: 16px;
}
.env-warn { margin: 16px 0 24px; font-weight: 600; border-color: var(--danger); }
.resume {
  margin: -16px 0 0;
  position: relative;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 2px solid var(--accent);
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
  justify-items: start;
}
.resume .btn-big { width: 100%; }
.resume:not([hidden]) + .search { margin-top: 16px; }
/* saved lines first: the search card sits below them, so it must not reach up 16px like it does under the header */
#savedSec + .search { margin-top: 16px; }
.resume-line { display: flex; gap: 12px; align-items: center; font-weight: 700; font-size: 20px; line-height: 1.2; }
.resume .link { margin: 0; }
.news-list { margin: 0; padding-inline-start: 22px; display: grid; gap: 6px; font-size: 17px; }
.confirm-card { width: min(360px, 100%); background: var(--surface); padding: 22px 18px; border-radius: 20px; box-shadow: var(--shadow); font-size: 22px; }
.confirm-card .btn { width: 100%; }
.info {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.choose { margin-top: 18px; display: grid; gap: 12px; }
.choose-title { margin: 0 2px; font-weight: 700; font-size: 19px; line-height: 1.3; }
.choose-map { height: 210px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.place-n {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font: 700 17px/1 var(--f-sign);
}
.place-pin { background: none; border: 0; }
.place-pin span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  border: 2px solid var(--surface);
  font: 700 14px/1 var(--f-sign);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.pick-note { margin: 0 2px 10px; display: grid; gap: 4px; font-size: 16px; color: var(--muted); }
.pick-note div { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.pick-note b { color: var(--ink); }
.pick-note .link { margin: 0; padding: 0; font-size: 16px; }
.item.var { padding: 10px 12px; }
.item.var .item-name { font-size: 17px; }
.actions { margin-top: 14px; display: grid; gap: 8px; }
.actions-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.actions-row .btn { padding: 0 8px; font-size: 17px; }
.sub-h { margin: 22px 0 8px; font-size: 14px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.sibs { display: grid; gap: 8px; }
.sibs .item { padding: 10px 12px; }
.sibs .item-name { font-size: 17px; }

.stops { list-style: none; margin: 0; padding: 0; }
.stop {
  width: 100%;
  display: grid;
  grid-template-columns: 30px 26px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: start;
}
.stop.sel { background: color-mix(in srgb, var(--accent) 14%, transparent); box-shadow: inset 4px 0 0 var(--accent); border-radius: 8px; }
[dir="rtl"] .stop.sel { box-shadow: inset -4px 0 0 var(--accent); }
.stop.sel .stop-n, .stop.sel .stop-name { color: var(--accent); }
.stop-n { font: 700 17px var(--f-num); color: var(--muted); text-align: end; font-variant-numeric: tabular-nums; }
.stop-name { font-weight: 600; font-size: 19px; line-height: 1.2; overflow-wrap: anywhere; }
.stop-km { font: 500 15px var(--f-num); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: end; }
.stop-min { display: block; font-size: 14px; }
/* the stop list as a line diagram: one thick band in the line's colour through all stop signs */
.stops li { position: relative; }
.stops li::before { content: ''; position: absolute; top: 0; bottom: 0; inset-inline-start: 50px; width: 6px; background: var(--lc, var(--route)); }
.stops li:first-child::before { top: 50%; }
.stops li:last-child::before { bottom: 50%; }
.stops li:only-child::before { display: none; }
.stop .hsign { position: relative; }
.link {
  margin-top: 14px;
  border: 0;
  background: none;
  padding: 6px 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 17px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.src { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- map markers ---------- */
.stop-pin, .me { background: none; border: 0; }
.stop-pin span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--sign-yellow);
  color: var(--sign-green);
  border: 2px solid var(--sign-green);
  font: 700 12px/1 var(--f-ui);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.stop-pin.term span { width: 28px; height: 28px; font-size: 15px; border-width: 3px; }
.stop-pin { display: grid !important; place-items: center; }
.stop-pin span { font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.stop-pin.n2:not(.next):not(.term) span { font-size: 11px; }
.stop-pin.n3:not(.next) span { font-size: 9.5px; }
.dense .stop-pin:not(.term):not(.next) span { width: 12px; height: 12px; font-size: 0; border-width: 2px; }
.stop-pin.next span { width: 34px; height: 34px; font-size: 18px; border-width: 3px; box-shadow: 0 0 0 4px var(--surface), 0 2px 10px rgba(0, 0, 0, 0.45); }
.me svg { width: 44px; height: 44px; display: block; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4)); }
.me circle { fill: var(--surface); stroke: var(--accent); stroke-width: 3; }
.me path { fill: var(--accent); }

/* ---------- navigation cards ---------- */
.navtop {
  position: absolute;
  z-index: 1001;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: max(10px, env(safe-area-inset-left, 0px));
  right: max(10px, env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  min-height: 104px;
  border-radius: 20px;
  background: var(--nav-bg);
  color: var(--nav-ink);
  box-shadow: var(--shadow);
}
.navtop.off { background: var(--danger); color: var(--on-danger); }
.navtop { flex-wrap: wrap; row-gap: 8px; }
/* lanes before the turn: the ones to take bright, the others dim */
/* lanes before the turn: a dark band across the top of the turn card, one big arrow per lane like the road markings,
   lanes separated by dashed lines; the lanes to take white, the others dim */
.lanes { order: -1; flex-basis: calc(100% + 32px); margin: -12px -16px 2px; padding: 6px 10px; display: flex; justify-content: center; background: rgba(0, 0, 0, 0.42); border-radius: 20px 20px 0 0; }
.lanes[hidden] { display: none; }
.lane { flex: 0 1 62px; min-width: 34px; height: 60px; display: grid; place-items: center; color: rgba(255, 255, 255, 0.3); }
.lane + .lane { border-inline-start: 2px dashed rgba(255, 255, 255, 0.3); }
.lane.ok { color: #ffffff; }
.lane svg { width: 100%; max-width: 50px; height: 50px; }
.lane .ico-stroke { stroke-width: 4.5; }
.lane .dim { opacity: 0.3; }
.man-icon { flex: none; width: 66px; height: 66px; display: grid; place-items: center; }
.man-icon svg { width: 66px; height: 66px; }
.ico-stroke { fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.ico-fill { fill: currentColor; }
.man-txt { min-width: 0; flex: 1; }
.man-dist { font: 700 38px/1.05 var(--f-num); font-variant-numeric: tabular-nums; }
.man-dist:empty { display: none; }
.man-text { font-size: 21px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }

.navbottom {
  position: absolute;
  z-index: 1001;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 14px calc(env(safe-area-inset-bottom, 0px) + 14px);
  display: grid;
  gap: 10px;
}
.nb-stop { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.nb-left { min-width: 0; display: grid; gap: 2px; }
.eyebrow { font-size: 14px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.nb-name-row { display: flex; gap: 10px; align-items: center; min-width: 0; }
.nb-name { font-size: 25px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.nb-count { font-size: 15px; color: var(--muted); }
.nb-dist { flex: none; font: 700 30px/1 var(--f-num); color: var(--accent); font-variant-numeric: tabular-nums; padding-bottom: 4px; }
.nb-next { font-size: 17px; font-weight: 600; color: var(--muted); overflow-wrap: anywhere; }
/* the last 150 m before a stop: the card turns dark green with a yellow stripe. Only colours change, not sizes,
   so the map does not move. Everything in the card takes light colours (contrast at least 4.5:1 on the green);
   the round map buttons above the card keep theirs. */
.navbottom.soon { background: var(--nav-bg); color: #ffffff; box-shadow: inset 0 6px 0 var(--sign-yellow), var(--shadow); }
.navbottom.soon > :not(.zoom-fabs):not(.left-fabs):not(.view-fab) {
  --ink: #ffffff;
  --muted: #cfe2d7;
  --line: rgba(255, 255, 255, 0.45);
  --surface: var(--nav-bg);
  --surface-2: rgba(255, 255, 255, 0.12);
  --accent: var(--sign-yellow);
  --on-accent: #13211a;
  --danger: #ffb8ad;
  color: var(--ink);
}
/* small card while driving: one line (stop and distance) and the progress; the handle opens the rest */
.navbottom:not(.open) .nb-more { display: none !important; }
.navbottom { padding-top: 4px; gap: 8px; }
.nb-handle { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 36px; margin: 0 -8px; padding: 0 8px; border: 0; background: none; color: var(--muted); font-size: 15px; font-weight: 600; touch-action: none; }
.nb-handle .grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); }
.navbottom .nb-stop { cursor: pointer; }
/* simulation: pause / go on, also in the small card */
.sim-mini { flex: none; align-self: center; width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--accent); background: transparent; color: var(--accent); font: 700 20px/1 var(--f-ui); }
.sim-mini.on { background: var(--accent); color: var(--on-accent); }
.sim-mini[hidden], .navbottom.open .sim-mini { display: none; }
/* opened on a small phone: the map buttons step aside so they do not cover the turn card */
@media (max-height: 780px) {
  .navbottom.open .zoom-fabs, .navbottom.open .left-fabs, .navbottom.open .view-fab { display: none; }
}
.progress { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.4s linear; }
/* simulation: the bar is a slider */
.progress.seek { position: relative; height: 8px; margin: 14px 0 12px; border-radius: 4px; overflow: visible; cursor: pointer; touch-action: none; }
.progress.seek::before { content: ''; position: absolute; inset: -16px 0; }
.progress.seek span { position: relative; border-radius: 4px; transition: none; }
.progress.seek span::after { content: ''; position: absolute; inset-inline-end: -11px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); box-sizing: border-box; }
.simctl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.simctl .eyebrow { margin-right: 4px; }
.simctl .chip { min-height: 48px; padding: 0 16px; }
.sim-hint { flex-basis: 100%; font-size: 14px; color: var(--muted); }
/* driver's view / view from above: a round button on the map, just above the bottom card */
.view-fab { position: absolute; bottom: calc(100% + 12px); inset-inline-end: max(12px, env(safe-area-inset-right, 0px)); font: 700 17px/1 var(--f-ui); }
/* map buttons while driving are bigger: easier to hit on a shaking dashboard */
.navbottom .fab { width: 64px; height: 64px; }
.navbottom .fab svg { width: 28px; height: 28px; }
/* left side: back to the bus (only when the map was moved by hand) and voice on/off */
.left-fabs { position: absolute; bottom: calc(100% + 12px); inset-inline-start: max(12px, env(safe-area-inset-left, 0px)); display: grid; gap: 10px; }
.center-fab:not(.on) { display: none; }
/* along the line (OpenStreetMap): the speed limit of this road, and the next traffic light / railway crossing / stop sign */
.speed-sign { width: 58px; height: 58px; border-radius: 50%; background: #ffffff; border: 6px solid #d0021b; color: #111111; box-sizing: border-box;
  display: grid; place-items: center; font-size: 22px; font-weight: 800; letter-spacing: -0.5px; box-shadow: var(--shadow); font-variant-numeric: tabular-nums; }
.speed-sign.over { animation: speed-over 1s ease-in-out infinite alternate; }
@keyframes speed-over { to { background: #ffe3e0; transform: scale(1.08); } }
.speed-sign[hidden], .road-next[hidden] { display: none; }
.road-next { justify-self: start; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 10px; border-radius: 22px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.road-next i { width: 14px; height: 28px; border-radius: 4px; background: #1b211e; border: 1.5px solid #ffffff;
  background-image: radial-gradient(circle at 50% 22%, #ff4d3d 3px, transparent 3.5px), radial-gradient(circle at 50% 50%, #ffc21a 3px, transparent 3.5px), radial-gradient(circle at 50% 78%, #2fd06f 3px, transparent 3.5px); }
.road-next[data-k="r"] i { width: 26px; height: 26px; border: 0; border-radius: 0; background: none;
  background-image: linear-gradient(45deg, transparent 42%, #e03131 42%, #e03131 58%, transparent 58%), linear-gradient(-45deg, transparent 42%, #e03131 42%, #e03131 58%, transparent 58%); }
.road-next[data-k="x"] i { width: 24px; height: 24px; border: 2px solid #ffffff; border-radius: 0; background: #d0021b;
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.center-fab.on { background: var(--accent); color: var(--on-accent); border-color: transparent; }
/* after moving the map by hand: a wide button with its name, so the way back is easy to find while driving */
.navbottom .center-fab.on { width: auto; border-radius: 32px; padding-inline: 18px 22px; grid-auto-flow: column; gap: 8px; font-size: 18px; font-weight: 700; }
.fab.muted { color: var(--danger); }
/* nearer / further while driving: above the 2D/3D button */
.zoom-fabs { position: absolute; bottom: calc(100% + 86px); inset-inline-end: max(12px, env(safe-area-inset-right, 0px)); display: grid; gap: 10px; }
/* a saved detour begins soon: drive it or stay on the line */
.det-ask { display: grid; gap: 8px; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--det-alt); background: var(--surface-2); }
.det-ask.temp { border-color: var(--det-temp); }
.det-ask[hidden] { display: none; }
.det-ask-txt { font-size: 19px; font-weight: 700; }
.det-ask-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nb-actions { display: grid; }
/* End: outlined, so it does not shout; holding it fills it red from the start side */
.btn-stop { position: relative; overflow: hidden; background: transparent; border: 2px solid var(--danger); color: var(--danger); gap: 10px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.btn-stop small { font-size: 15px; font-weight: 500; opacity: 0.8; }
.btn-stop > * { position: relative; }
.btn-stop::before { content: ''; position: absolute; inset: 0; inset-inline-end: 100%; background: var(--danger); opacity: 0.25; }
.btn-stop.holding::before { inset-inline-end: 0; transition: inset-inline-end 0.8s linear; }

/* ---------- overlays ---------- */
.loading {
  position: absolute;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  background: var(--scrim);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.loading-card { max-width: 380px; display: grid; gap: 14px; justify-items: center; text-align: center; font-size: 19px; font-weight: 600; }
.loading-card .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.spin {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
.loading .spin { width: 40px; height: 40px; border-width: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed;
  z-index: 3000;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
  transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--bg);
  font-size: 17px;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.in-route .toast { bottom: auto; top: calc(env(safe-area-inset-top, 0px) + 72px); }
.in-route.navigating .toast { top: calc(env(safe-area-inset-top, 0px) + 128px); }

@media (min-width: 760px) {
  .sheet {
    left: max(16px, env(safe-area-inset-left, 0px));
    right: auto;
    top: calc(env(safe-area-inset-top, 0px) + 78px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    width: 400px;
    max-height: none;
    border-radius: 20px;
    padding-left: 18px;
    padding-right: 18px;
  }
  .sheet.collapsed { max-height: none; overflow-y: auto; }
  .handle { display: none; }
  .sheet-head { padding-top: 18px; }
  .navtop { right: auto; width: 420px; }
  .navbottom { left: max(16px, env(safe-area-inset-left, 0px)); right: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); width: 420px; border-radius: 20px; }
  .topbar { justify-content: flex-start; gap: 8px; left: calc(max(16px, env(safe-area-inset-left, 0px)) + 0px); width: 400px; }
  .topbar .fab:last-child { margin-left: auto; }
}
@media (min-width: 760px) {
  [dir="rtl"] .sheet { left: auto; right: max(16px, env(safe-area-inset-right, 0px)); }
  [dir="rtl"] .navtop { left: auto; right: max(10px, env(safe-area-inset-right, 0px)); }
  [dir="rtl"] .navbottom { left: auto; right: max(16px, env(safe-area-inset-right, 0px)); }
  [dir="rtl"] .topbar { left: auto; right: max(16px, env(safe-area-inset-right, 0px)); }
}
[dir="rtl"] .maplibregl-ctrl-top-right { right: auto; left: env(safe-area-inset-left, 0px); }
[dir="rtl"] .maplibregl-ctrl-top-right .maplibregl-ctrl { float: left; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 0.01ms !important; }
}

/* Impressum and Datenschutz: plain reading pages in the same look as the home screen */
.legal { padding-bottom: 40px; line-height: 1.45; font-size: 17px; }
.legal h2 { font-size: 22px; margin: 26px 0 8px; }
.legal p, .legal ul { margin: 0 0 10px; }
.legal ul { padding-inline-start: 22px; }
.legal a { color: var(--accent); }
.legal .ph { background: var(--sign-yellow); color: #13211a; padding: 0 4px; border-radius: 3px; }
.legal .back { display: inline-block; margin-top: 18px; font-weight: 600; }

/* recorded road: info under the line title, and the question after a drive */
.track-box { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 16px; display: grid; gap: 8px; }
.track-box p { margin: 0; }
.track-box .row { display: flex; flex-wrap: wrap; gap: 8px; }
.track-box .link { margin: 0; }
.track-box.offer { border: 2px solid var(--accent); background: var(--surface); }
.track-box .track-hint { font-size: 14px; color: var(--muted); }

/* feedback: a message to the owner, from the home screen or a line */
.fb-dlg { position: fixed; z-index: 2500; padding: 16px; }
.fb-card { display: grid; gap: 10px; font-size: 17px; }
.fb-card h2 { font-size: 22px; }
.fb-card .fine-tip { margin: 0; }
.fb-msg { height: auto; min-height: 130px; padding: 10px 12px; font-size: 18px; font-weight: 500; resize: vertical; }
.fb-link { margin: 0; padding: 0; font-size: inherit; color: inherit; text-decoration: underline; }

/* start stop: the first stop, or a later one when taking over a bus on the way */
.start-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; font: 600 16px var(--f-ui); color: var(--muted); }
.start-sel { height: 46px; font-size: 17px; }
.start-row.on .start-sel { border-color: var(--accent); }
.pop .tt-start { display: block; margin: 6px 0 0; padding: 0; font: 600 15px var(--f-ui); }

/* detours of the line in the sheet */
.det-box { margin: 12px 0 0; display: grid; gap: 8px; }
.det-box .sub-h { margin: 0; }
.det-box .track-hint, .det-item .track-hint { font-size: 14px; color: var(--muted); margin: 0; }
.det-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.det-dot { flex: none; width: 14px; height: 14px; margin-top: 4px; border-radius: 50%; background: var(--det-alt); }
.det-dot.temp { background: var(--det-temp); }
.det-txt { flex: 1; min-width: 0; display: grid; gap: 2px; font-size: 16px; }
.det-btns { display: grid; gap: 4px; justify-items: end; }
.det-btns .link { margin: 0; }
.det-temp { display: flex; gap: 8px; align-items: center; font-size: 16px; }
.det-temp input { width: 22px; height: 22px; accent-color: var(--det-temp); }

/* no connection: a small pill at the top that stays while offline */
.net-pill {
  position: fixed;
  z-index: 2500;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--danger);
  color: var(--on-danger);
  font-size: 15px;
  font-weight: 700;
  box-shadow: var(--shadow);
  pointer-events: none;
}
.in-route .net-pill { top: calc(env(safe-area-inset-top, 0px) + 74px); }
.in-route.navigating .net-pill { top: calc(env(safe-area-inset-top, 0px) + 122px); }

/* guide: full screen over home or the line, one card per topic; button names shown as keys */
.help-btn {
  flex: none;
  align-self: flex-start;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--nav-ink) 35%, transparent);
  background: transparent;
  color: var(--nav-ink);
  font: 700 22px/1 var(--f-ui);
}
.help-all { margin-top: 16px; width: 100%; }
.help-view {
  position: fixed;
  inset: 0;
  z-index: 2000;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg);
  color: var(--ink);
}
.help-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  background: var(--nav-bg);
  color: var(--nav-ink);
}
.help-head .fab { width: 48px; height: 48px; box-shadow: none; }
.help-head h2 { margin: 0; font-size: 26px; font-weight: 700; }
.help-wrap { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 32px); }
.help-intro { margin: 18px 0 0; font-size: 18px; line-height: 1.4; }
.help-safety { font-weight: 600; }
.help-list { display: grid; gap: 10px; margin-top: 16px; }
.help-t { scroll-margin-top: 84px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.help-t > summary {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 19px;
  cursor: pointer;
  list-style: none;
}
.help-t > summary::-webkit-details-marker { display: none; }
.help-t > summary::after { content: ''; flex: none; width: 10px; height: 10px; margin-inline-start: auto; border: solid var(--muted); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.help-t[open] > summary::after { transform: rotate(-135deg); }
.help-t[open] > summary { border-bottom: 1px solid var(--line); }
.help-ic { flex: none; width: 30px; font-size: 24px; text-align: center; }
.help-steps { margin: 0; padding: 12px 14px 4px; padding-inline-start: 40px; display: grid; gap: 10px; font-size: 17px; line-height: 1.45; }
.help-steps li::marker { color: var(--accent); font-weight: 700; }
.help-tip { margin: 6px 14px 14px; padding: 8px 12px; border-inline-start: 4px solid var(--sign-yellow); background: var(--surface-2); border-radius: 8px; font-size: 16px; line-height: 1.4; }
.help-tip::before { content: '💡 '; }
.ui-k {
  display: inline;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  font-weight: 700;
  white-space: normal;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
