/* STS NAV night design (Figma "Design (night)", approved 14 Oct 2026) */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(../fonts/inter-latin.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 Georgian'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(../fonts/noto-sans-georgian.woff2) format('woff2');
  unicode-range: U+0589, U+10A0-10FF, U+1C90-1CBA, U+1CBD-1CBF, U+205A, U+2D00-2D2F, U+2E31;
}
:root {
  --bg-app: #0c0e15; --bg-map: #10121b;
  --glass: rgba(25, 27, 38, .88); --raised: #20232f; --pressed: #2a2d3b; --hair: rgba(255, 255, 255, .08);
  --t1: #f2f3f7; --t2: #9ba1b2; --t3: #6c7285;
  --violet: #8b7cf6; --violet-strong: #7468f0; --blue: #4f7cff; --green: #4ade80; --amber: #fbbf24; --orange: #fb923c; --red: #f87171;
  --route-a: #3d7bff; --route-b: #8b5cf6; --scrim: rgba(0, 0, 0, .55);
  --shadow: 0 12px 32px rgba(0, 0, 0, .45); --glow: 0 8px 24px rgba(116, 104, 240, .45);
  --font: 'Inter', 'Noto Sans Georgian', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;   /* Inter: Latin and numbers; Georgian from Noto */
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body {
  height: 100%; margin: 0; background: var(--bg-app); color: var(--t1); font: 400 16px/1.35 var(--font);
  -webkit-text-size-adjust: 100%; overscroll-behavior: none; touch-action: manipulation;
}
button { font: inherit; color: inherit; cursor: pointer; }
#map { position: fixed; inset: 0; background: var(--bg-map); }
.glass {
  background: var(--glass); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--hair); box-shadow: var(--shadow);
}

/* ---------------------------------------------------------------- driving view */
.fade {
  position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; height: calc(var(--sb) + 176px); pointer-events: none;
  background: linear-gradient(to bottom, rgba(12, 14, 21, 0), rgba(12, 14, 21, .92));
}
.top {
  position: fixed; z-index: 10; top: calc(var(--st) + 8px); left: calc(var(--sl) + 12px); right: calc(var(--sr) + 81px);
  max-width: 420px; display: flex; flex-direction: column; align-items: stretch; pointer-events: none;
}
.banner {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px 16px 16px; border-radius: 22px;
  pointer-events: auto; --tone: var(--violet);
}
.banner.tone-orange { --tone: var(--orange); }
.banner.tone-blue { --tone: var(--blue); }
.banner.tone-grey { --tone: var(--t2); }
.b-icon { width: 44px; height: 44px; flex: none; color: var(--t1); }
.b-icon svg { width: 100%; height: 100%; display: block; }
.b-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.b-tag { display: flex; align-items: center; gap: 6px; color: var(--tone); font: 600 13px/1.3 var(--font); }
.b-tag i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.b-tag span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-dist { display: flex; align-items: baseline; gap: 5px; }
.b-dist .num { font: 600 34px/1.1 var(--font); letter-spacing: -.2px; font-variant-numeric: tabular-nums; }
.b-dist .unit { font: 500 20px/1.1 var(--font); color: var(--t2); }
.b-instr { font: 400 16px/1.35 var(--font); color: var(--t2); }
.b-street {
  font: 500 20px/1.25 var(--font); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.b-dist:empty, .b-instr:empty, .b-street:empty { display: none; }
.pills { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.pills:not(:has(> :not([hidden]))) { display: none; }
.pill {
  height: 40px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px;
  font: 500 15px/1.3 var(--font); pointer-events: auto; white-space: nowrap;
}
.then { color: var(--t2); }
.then-icon { width: 22px; height: 22px; display: inline-block; color: var(--t1); }
.then-icon svg { width: 100%; height: 100%; display: block; }
.round:active, .btn:active, .sheet .item:active, .tile:active { filter: brightness(1.25); }

.side {
  position: fixed; z-index: 10; top: calc(var(--st) + 8px); right: calc(var(--sr) + 12px);
  display: flex; flex-direction: column; gap: 10px;
}
.round { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; padding: 0; color: var(--t1); }
.round svg { width: 24px; height: 24px; display: block; }
.round.accent { background: var(--violet-strong); border: 0; box-shadow: var(--glow); }
.round:disabled { color: var(--t3); }              /* skip, while there is nothing to skip */

.gpshelp, .pausecard { margin-top: 8px; border-radius: 22px; padding: 16px; pointer-events: auto; }
.gh-head { display: flex; gap: 10px; align-items: flex-start; }
.gh-icon { width: 24px; height: 24px; flex: none; color: var(--t1); }
.gh-icon svg { width: 100%; height: 100%; display: block; }
.gh-title { font: 500 17px/1.35 var(--font); }
.gh-text { margin-top: 10px; font: 400 13px/1.4 var(--font); color: var(--t2); }
.gh-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.pc-text { font: 400 15px/1.45 var(--font); color: var(--t2); }
.pausecard .btn { margin-top: 14px; }

.dock {
  position: fixed; z-index: 11; left: calc(var(--sl) + 16px); right: calc(var(--sr) + 16px); bottom: calc(var(--sb) + 62px);
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.dock > * { pointer-events: auto; }
/* bottom row: skip on the left (away from menu, sound and pause), re-centre on the right */
.dock > .dock-row { display: flex; align-items: flex-end; pointer-events: none; }
.dock-row > * { pointer-events: auto; }
#btnSkip { margin-left: -4px; }
#btnRecenter { margin-left: auto; margin-right: -4px; }
.toast {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; border-radius: 18px;
  font: 500 17px/1.35 var(--font);
}
.toast button { flex: none; border: 0; background: none; padding: 4px 0; color: var(--violet); font: 600 17px/1.3 var(--font); }
.simbar { border-radius: 22px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.sim-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#simTitle { font: 600 13px/1.3 var(--font); color: var(--violet); }
.seg3 { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--raised); }
.seg3 button { width: 46px; height: 30px; border: 0; border-radius: 9px; background: transparent; color: var(--t2); font: 500 15px/1 var(--font); }
.seg3 button.on { background: var(--violet-strong); color: var(--t1); }
.sim-btns { display: flex; gap: 8px; }
.sim-btns button {
  padding: 11px 12px; border: 0; border-radius: 14px; background: var(--raised); color: var(--t1);
  font: 500 15px/1.3 var(--font); white-space: nowrap;
}
#simMiss { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#simStop { color: var(--red); }

.bottom { position: fixed; z-index: 10; left: calc(var(--sl) + 16px); right: calc(var(--sr) + 16px); bottom: calc(var(--sb) + 10px); }
.status { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.st-line { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; white-space: nowrap; font: 500 17px/1.3 var(--font); }
.st-line i { font-style: normal; color: var(--t3); }
.st-time { color: var(--green); }
.st-km { color: var(--t2); }
.st-end { color: var(--violet); font-variant-numeric: tabular-nums; }
.gpschip { flex: none; display: inline-flex; align-items: center; gap: 6px; font: 500 13px/1.3 var(--font); color: var(--t2); --dot: var(--t3); }
.gpschip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--dot); }
.gpschip.good { --dot: var(--green); } .gpschip.fair { --dot: var(--amber); } .gpschip.poor { --dot: var(--red); }
.gpschip.none { --dot: var(--t3); } .gpschip.sim { --dot: var(--blue); }
.bar { position: relative; height: 4px; margin-top: 10px; border-radius: 2px; background: rgba(255, 255, 255, .12); overflow: hidden; }
#barFill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 2px; background: linear-gradient(90deg, var(--route-a), var(--route-b)); }
#barMissed { position: absolute; inset: 0; pointer-events: none; }
#barMissed i { position: absolute; top: 0; bottom: 0; background: var(--red); min-width: 2px; }

.car { width: 48px; height: 48px; }
.car svg { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 0 11px rgba(139, 124, 246, .55)); }
.car .ring { stroke: var(--violet); }
.car.off .ring { stroke: var(--orange); }
.car.off svg { filter: drop-shadow(0 0 11px rgba(251, 146, 60, .55)); }
.car.paused .ring { stroke: var(--t3); }
.car.paused svg { filter: none; }

/* map credits: a small (i) under the pause button */
.maplibregl-ctrl-top-right { top: calc(var(--st) + 202px); right: calc(var(--sr) + 26px); }
.maplibregl-ctrl-top-right .maplibregl-ctrl { margin: 0; }
.maplibregl-ctrl-attrib.maplibregl-compact { min-height: 24px; background: var(--glass); border: 1px solid var(--hair); color: var(--t2); font: 400 11px/1.4 var(--font); }
.maplibregl-ctrl-attrib a { color: var(--t2); }
.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button { background: none; }
.maplibregl-ctrl-attrib-button::before {
  content: 'i'; position: absolute; inset: 0; display: grid; place-items: center; font: 600 13px/1 var(--font); color: var(--t2);
}

/* ---------------------------------------------------------------- menu sheet */
.sheet-back { position: fixed; inset: 0; z-index: 20; background: var(--scrim); }
.sheet {
  position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; max-height: 86vh; overflow: auto; -webkit-overflow-scrolling: touch;
  background: var(--bg-app); border: 1px solid var(--hair); border-bottom: 0; border-radius: 28px 28px 0 0;
  padding: 12px calc(var(--sr) + 16px) calc(var(--sb) + 16px) calc(var(--sl) + 16px);
  overscroll-behavior: none; will-change: transform;          /* no bounce inside it: a pull down at the top moves the whole sheet */
}
.sheet .grab-zone { margin: -12px 0 0; padding: 12px 0 14px; }        /* a bigger place to grab the sheet */
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .18); margin: 0 auto; }
.sheet h3 { margin: 18px 4px 6px; font: 600 13px/1.3 var(--font); color: var(--t3); }
.sheet .item {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 16px; margin: 0 0 8px;
  border: 0; border-radius: 16px; background: var(--raised); color: var(--t1); font: 500 17px/1.35 var(--font);
}
.sheet .item svg { width: 24px; height: 24px; flex: none; display: block; }
.sheet .item.accent { background: var(--pressed); color: var(--violet); }
.sheet .item.danger { color: var(--red); }
.sheet .item:disabled { opacity: .45; }
.sheet .note { margin: 0 4px 10px; font: 400 15px/1.4 var(--font); color: var(--t3); }
.missed-list { list-style: none; margin: 0 0 10px; padding: 0; }
.missed-list li { padding: 4px; font: 500 17px/1.35 var(--font); color: var(--t2); }
.missed-list li b { font-weight: 500; color: var(--red); margin-right: 6px; }

/* the voice choice (start screen and menu): Georgian / English */
.voicerow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 10px 10px 16px;
  border-radius: 16px; background: var(--raised); border: 1px solid var(--hair);
}
.sheet .voicerow { margin: 0 0 8px; border: 0; }
.vr-label { display: flex; align-items: center; gap: 12px; white-space: nowrap; font: 500 17px/1.35 var(--font); }
.vr-label svg { width: 24px; height: 24px; flex: none; display: block; color: var(--t2); }
.seg2 { flex: none; margin-left: auto; display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--bg-app); }   /* on a narrow phone it moves under the label */
.seg2 button {
  min-width: 80px; height: 38px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent;
  color: var(--t2); font: 500 15px/1 var(--font);
}
.seg2 button.on { background: var(--violet-strong); color: var(--t1); }
.seg2 button:active { filter: brightness(1.25); }

/* ---------------------------------------------------------------- start screen */
.home {
  position: fixed; inset: 0; z-index: 30; overflow: auto; -webkit-overflow-scrolling: touch; background: var(--bg-app);
  padding: calc(var(--st) + 18px) calc(var(--sr) + 16px) calc(var(--sb) + 24px) calc(var(--sl) + 16px);
}
.wrap { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.brand img { display: block; width: 172px; height: auto; }
.brand p { margin: 10px 0 0; font: 400 13px/1.4 var(--font); color: var(--t2); }
.title { margin: 0 0 18px; font: 700 26px/1.2 var(--font); }
.days { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.tile {
  display: flex; flex-direction: column; gap: 6px; min-height: 82px; padding: 16px; border-radius: 18px;
  border: 1px solid var(--hair); background: var(--raised); color: var(--t1); text-align: left;
}
.tile.current { border-color: rgba(139, 124, 246, .55); }
.t-name { font: 600 18px/1.25 var(--font); }
.t-km { font: 500 15px/1.3 var(--font); color: var(--t2); min-height: 19px; }
.t-prog { display: flex; align-items: center; gap: 8px; }
.t-prog .tb { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.t-prog .tb i { display: block; height: 100%; border-radius: 2px; background: var(--violet); }
.t-prog span { font: 500 15px/1.3 var(--font); color: var(--violet); }
.daycard { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 22px; border: 1px solid var(--hair); background: var(--raised); }
.daycard h2 { margin: 0 0 4px; font: 600 21px/1.25 var(--font); }
.meta { margin: 0; font: 400 15px/1.4 var(--font); color: var(--t2); }
.meta.small { margin-top: 4px; font-size: 13px; color: var(--t3); }
.meta .warn { color: var(--amber); }
.mini-map { display: block; width: 100%; height: 190px; border-radius: 16px; border: 1px solid var(--hair); background: var(--bg-map); }
.prog-line { font: 500 17px/1.3 var(--font); }
.prog-missed { margin-top: 6px; font: 400 13px/1.4 var(--font); color: var(--red); }
.prog-missed.none { color: var(--t3); }
.btn {
  display: block; width: 100%; min-height: 54px; padding: 15px 20px; border-radius: 16px; border: 1px solid var(--hair);
  background: var(--raised); color: var(--t1); font: 600 17px/1.3 var(--font); text-align: center;
}
.btn.primary { background: var(--violet-strong); border-color: transparent; box-shadow: var(--glow); }
.btn.quiet { background: transparent; border-color: transparent; box-shadow: none; color: var(--violet); }
.btn:disabled { opacity: .5; }
.loading {
  display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 22px; border: 1px solid var(--hair);
  background: var(--raised); font: 500 17px/1.35 var(--font);
}
.spinner {
  flex: none; width: 24px; height: 24px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .12); border-top-color: var(--violet);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.errnote {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 18px;
  background: rgba(248, 113, 113, .12); border: 1px solid rgba(248, 113, 113, .35); font: 400 15px/1.45 var(--font);
}
.errnote b {
  flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px;
  background: var(--red); color: var(--bg-app); font: 700 14px/1 var(--font);
}
.credits { margin: 0; font: 400 13px/1.4 var(--font); color: var(--t3); }

/* ---------------------------------------------------------------- landscape (phone across the dashboard) */
@media (orientation: landscape) and (max-height: 560px) {
  .top { top: calc(var(--st) + 12px); left: calc(var(--sl) + 8px); right: auto; width: min(300px, 40vw); }
  .side { top: calc(var(--st) + 12px); }
  .maplibregl-ctrl-top-right { top: calc(var(--st) + 206px); }
  .bottom, .dock { left: calc(var(--sl) + 16px); right: auto; width: min(361px, 46vw); }
  /* skip: bottom right, far below pause (the left column has the card, messages and the status line) */
  #btnSkip { position: fixed; z-index: 10; right: calc(var(--sr) + 12px); bottom: calc(var(--sb) + 10px); margin: 0; }
  .fade { height: calc(var(--sb) + 130px); }
}
