/* NAV — full-screen turn-by-turn navigation (prefix .nv-) · design v2
   Look: Google Maps / Apple Maps blend in the ไปกัน! v2 language — green gradient maneuver card with a crisp white
   arrow and Prompt type, white road shield with green text, round liquid-glass map buttons, strong-glass bottom
   card with a big green ETA, blue "เริ่ม" pill, red round ✕. Line icons and kind tiles only (no emoji).
   Layouts:
   - portrait (phones, iPad portrait): maneuver card on top, glass card at the bottom, map buttons on the right
   - "column" (landscape phones + iPad landscape, aspect >= 13/10): maneuver card + bottom card in a left column
   Colors: tokens only — the navigation palette is the --nav-* tokens, mapped once to --nv-* below. */

/* the palette is also needed by our sheets, which live in #overlayRoot */
.nv-root, .nv-ls, .nv-sr, .nv-handoff {
  --nv-green: var(--nav-green);
  --nv-green-2: var(--nav-green-2);
  --nv-deep: var(--nav-green-2);                 /* lanes row / "จากนั้น" strip under the card */
  --nv-banner: linear-gradient(135deg, var(--nav-green) 0%, var(--nav-green-2) 100%);
  --nv-banner-shadow: color-mix(in srgb, var(--nav-green-2) 34%, transparent);
  --nv-eta: var(--nav-eta);
  --nv-blue: var(--nav-blue);                    /* fills (เริ่ม, active buttons, puck) */
  --nv-blue-2: var(--nav-blue-2);
  --nv-blue-ink: var(--nav-blue);                /* text / strokes on light surfaces */
  --nv-red: var(--nav-red);
  --nv-on: var(--ink-inverse);
  --nv-shield-bg: var(--nav-shield-bg);
  --nv-shield-ink: var(--nav-shield-ink);
  --nv-route: var(--nv-blue);
  --nv-route-alt: color-mix(in srgb, var(--nv-blue) 35%, var(--ink-4));
  --nv-tint: color-mix(in srgb, var(--nav-green) 12%, var(--surface));   /* maneuver tiles in lists */
  --nv-tint-ink: var(--nav-green-2);
  --nv-blue-tint: color-mix(in srgb, var(--nav-blue) 11%, var(--surface));
  --nv-chip: color-mix(in srgb, var(--surface) 78%, transparent);         /* small controls on glass */
}
/* night (after sunset): deep green card */
.nv-root[data-night="1"] {
  --nv-banner: linear-gradient(135deg, var(--nav-green-night) 0%, var(--nav-green-night-2) 100%);
  --nv-deep: var(--nav-green-night-2);
  --nv-banner-shadow: color-mix(in srgb, var(--nav-green-night-2) 45%, transparent);
}
/* dark mode: night card, brighter ETA green and blue text, deeper tints */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.nv-root, .nv-ls, .nv-sr, .nv-handoff) {
    --nv-banner: linear-gradient(135deg, var(--nav-green-night) 0%, var(--nav-green-night-2) 100%);
    --nv-deep: var(--nav-green-night-2);
    --nv-banner-shadow: color-mix(in srgb, var(--nav-green-night-2) 55%, transparent);
    --nv-eta: var(--nav-eta-dark);
    --nv-blue-ink: var(--nav-blue-dark);
    --nv-route-alt: color-mix(in srgb, var(--nav-blue-dark) 40%, var(--ink-4));
    --nv-tint: color-mix(in srgb, var(--nav-green) 22%, var(--surface));
    --nv-tint-ink: var(--nav-eta-dark);
    --nv-blue-tint: color-mix(in srgb, var(--nav-blue) 24%, var(--surface));
    --nv-chip: color-mix(in srgb, var(--surface-2) 80%, transparent);
  }
}
:root[data-theme="dark"] :is(.nv-root, .nv-ls, .nv-sr, .nv-handoff) {
  --nv-banner: linear-gradient(135deg, var(--nav-green-night) 0%, var(--nav-green-night-2) 100%);
  --nv-deep: var(--nav-green-night-2);
  --nv-banner-shadow: color-mix(in srgb, var(--nav-green-night-2) 55%, transparent);
  --nv-eta: var(--nav-eta-dark);
  --nv-blue-ink: var(--nav-blue-dark);
  --nv-route-alt: color-mix(in srgb, var(--nav-blue-dark) 40%, var(--ink-4));
  --nv-tint: color-mix(in srgb, var(--nav-green) 22%, var(--surface));
  --nv-tint-ink: var(--nav-eta-dark);
  --nv-blue-tint: color-mix(in srgb, var(--nav-blue) 24%, var(--surface));
  --nv-chip: color-mix(in srgb, var(--surface-2) 80%, transparent);
}

.nv-root {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg-2);
  color: var(--ink);
}
.nv-map { position: absolute; inset: 0; z-index: 0; background: var(--bg-2); --mv-puck: var(--nv-blue); }
.nv-empty { display: grid; align-content: center; padding-top: calc(var(--sp-8) + var(--safe-top)); }
.nv-empty .empty { margin-bottom: 8vh; }
.nv-empty .empty p { max-width: 32ch; }
.nv-empty .btn svg { width: 18px; height: 18px; }
/* the map view's own recenter button would duplicate ours (and hide under the card) */
.nv-map .mv-recenter { display: none !important; }
/* Google-like puck: blue arrow with a light accuracy halo */
.nv-map .mv-me.is-nav .mv-me-arrow path { fill: var(--nv-blue); stroke: var(--surface); stroke-width: 3.2; }
.nv-map .mv-me.is-nav .mv-me-acc { display: block; background: color-mix(in srgb, var(--nv-blue) 13%, transparent); border-color: color-mix(in srgb, var(--nv-blue) 30%, transparent); }
.nv-map .mv-me-dot { background: var(--nv-blue); }
.nv-map .mv-me-dot::after { border-color: var(--nv-blue); }

/* shared: liquid-glass surface for everything that floats over the map */
.nv-fab, .nv-speed, .nv-recenter, .nv-pill, .nv-card, .nv-simbar, .nv-gpsfail, .nv-pre, .nv-arr-card {
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-edge), var(--shadow-glass);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nv-fab, .nv-speed, .nv-recenter, .nv-pill, .nv-card, .nv-simbar, .nv-gpsfail, .nv-pre, .nv-arr-card { background: var(--surface); }
}

/* mini kind tile used inline in text lines */
.ico-tile.nv-mini { width: 22px; height: 22px; border-radius: 7px; }
.ico-tile.nv-mini svg { width: 14px; height: 14px; }

/* toasts during navigation: line icon, floated just above our cards (offset set from nav.js) */
.toast .nv-toast-ico { flex: 0 0 auto; display: inline-grid; place-items: center; opacity: .92; }
body:has(.nv-root) #toastRoot { bottom: var(--nv-toast-b, calc(var(--sp-6) + var(--safe-bottom))); }
/* while one of our sheets is open, toasts drop to the top so they never cover the sheet's title or rows */
body:has(.nv-root):has(#overlayRoot .overlay) #toastRoot { top: calc(var(--sp-3) + var(--safe-top)); bottom: auto; }

/* ============ overlay grid ============ */
.nv-ui {
  position: absolute; inset: 0; z-index: 2;
  pointer-events: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "top" "mid" "bottom";
  gap: var(--sp-2);
  padding: calc(10px + var(--safe-top)) calc(10px + var(--safe-right)) calc(10px + var(--safe-bottom)) calc(10px + var(--safe-left));
}
.nv-root[data-phase="prestart"] .nv-top,
.nv-root[data-phase="prestart"] .nv-bottom,
.nv-root[data-phase="prestart"] .nv-mid-left { display: none; }
.nv-root[data-phase="nav"] .nv-pre { display: none; }

.nv-top, .nv-bottom {
  display: flex; flex-direction: column; gap: var(--sp-2);
  width: 100%; max-width: 600px; justify-self: center;
  min-width: 0;
}
.nv-top { grid-area: top; }
.nv-bottom { grid-area: bottom; }
.nv-mid {
  grid-area: mid;
  display: flex; justify-content: space-between; align-items: stretch; gap: var(--sp-2);
  min-height: 0; min-width: 0;
}
.nv-mid-left { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: var(--sp-2); }

/* ============ maneuver card (green gradient) ============ */
.nv-banner {
  position: relative; z-index: 1;
  pointer-events: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 18px 14px 12px;
  background: var(--nv-banner);
  color: var(--nv-on);
  border-radius: 26px;
  box-shadow: 0 14px 34px var(--nv-banner-shadow), 0 2px 6px color-mix(in srgb, var(--nv-deep) 30%, transparent);
  min-width: 0;
}
.nv-ban-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.nv-ban-turn {
  flex: 0 0 auto;
  width: clamp(66px, 19vw, 92px);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.nv-arrow { width: clamp(50px, 14vw, 68px); aspect-ratio: 1; display: grid; place-items: center; color: var(--nv-on); }
.nv-arrow svg { width: 100%; height: 100%; max-width: none; filter: drop-shadow(0 1px 1px color-mix(in srgb, var(--nv-deep) 45%, transparent)); }
.nv-dist { display: flex; align-items: baseline; justify-content: center; gap: 3px; line-height: 1; white-space: nowrap; font-family: var(--font-num); }
.nv-dist:has(b:empty) { display: none; }
.nv-dist b { font-weight: 700; font-size: clamp(1.15rem, 1rem + .8vw, 1.45rem); letter-spacing: -0.02em; }
.nv-dist span { font-weight: 400; font-size: clamp(.8rem, .74rem + .3vw, .95rem); opacity: .9; }
.nv-ban-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nv-act {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(.98rem, .9rem + .45vw, 1.15rem); line-height: 1.3;
  opacity: .9; overflow-wrap: anywhere;
}
.nv-act:empty { display: none; }
.nv-act svg { flex: 0 0 auto; }
.nv-street {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.35rem, 1.1rem + 1.5vw, 1.95rem); line-height: 1.22; letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nv-road { margin-right: 8px; }
/* road-number shield: white rounded chip, green text */
.nv-shield {
  display: inline-flex; align-items: center;
  padding: .02em .4em; margin: .06em 0;
  border-radius: .32em;
  background: var(--nv-shield-bg); color: var(--nv-shield-ink);
  font-family: var(--font-display); font-weight: 700; line-height: 1.2; letter-spacing: 0;
  white-space: nowrap; vertical-align: .06em;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--nv-deep) 35%, transparent);
}
.nv-shield.sm { font-size: .6em; vertical-align: .22em; }
.nv-banner[data-state="wait"], .nv-banner[data-state="reroute"] {
  background: linear-gradient(135deg, var(--nv-blue) 0%, var(--nv-blue-2) 100%);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--nv-blue-2) 32%, transparent);
}
.nv-banner[data-state="wait"] .nv-street, .nv-banner[data-state="reroute"] .nv-street, .nv-banner[data-state="nogps"] .nv-street { font-size: clamp(1.05rem, .95rem + .7vw, 1.3rem); font-weight: 400; }
.nv-banner[data-state="wait"] .nv-arrow { animation: nvPulse 1.6s var(--ease) infinite; }
.nv-banner[data-state="reroute"] .nv-arrow svg { animation: spin 1.1s linear infinite; }
.nv-banner[data-state="nogps"] { background: var(--slate); box-shadow: var(--shadow-glass); }

.nv-lanes {
  display: flex; justify-content: center; gap: 4px;
  padding: 5px 6px; margin: 0 -6px -2px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--nv-deep) 78%, transparent);
  min-width: 0; overflow: hidden;
}
.nv-lane { flex: 0 1 38px; min-width: 22px; height: 34px; display: grid; place-items: center; border-radius: 10px; opacity: .42; }
.nv-lane svg { width: 24px; height: 24px; }
.nv-lane.on { opacity: 1; }

/* "จากนั้น" strip tucked under the card */
.nv-then {
  pointer-events: auto;
  align-self: flex-start;
  position: relative; z-index: 0;
  display: inline-flex; align-items: center; gap: 6px;
  max-width: calc(100% - 28px); min-width: 0;
  margin: -24px 0 0 16px;
  padding: 22px 14px 8px 12px;
  border-radius: 0 0 18px 18px;
  background: var(--nv-deep);
  color: var(--nv-on);
  font-family: var(--font-display); font-weight: 400; font-size: var(--fs-sm);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--nv-deep) 30%, transparent);
}
.nv-then svg { width: 22px; height: 22px; flex: 0 0 auto; }
.nv-then-l { flex: 0 0 auto; opacity: .85; }
.nv-then-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* status pills under the card */
.nv-pills { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.nv-pills:empty { display: none; }
.nv-pill {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%; min-width: 0; min-height: 34px;
  padding: 5px 13px 5px 11px;
  border-radius: var(--r-pill);
  color: var(--ink);
  font: inherit; font-size: var(--fs-sm); font-weight: 700;
}
.nv-pill > span { min-width: 0; overflow-wrap: anywhere; }
.nv-pill svg { flex: 0 0 auto; color: var(--ink-2); }
.nv-pill .spinner { width: 16px; height: 16px; border-width: 2.5px; flex: 0 0 auto; }
.nv-pill.sim svg { color: var(--grape); }
.nv-pill.warn svg { color: var(--warn); }
.nv-pill.reroute .spinner { border-color: var(--nv-blue-tint); border-top-color: var(--nv-blue); }
.nv-pill.place { min-height: 38px; cursor: pointer; }
.nv-pill.place svg:first-child { color: var(--nv-blue-ink); }
.nv-pill.place svg:last-child { opacity: .7; }

/* ============ map buttons (right, round glass) ============ */
.nv-fabs {
  pointer-events: auto;
  flex: 0 0 auto;
  align-self: flex-start;
  margin-left: auto;
  display: flex; flex-direction: column; gap: 10px;
}
.nv-fab {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--ink);
  transition: transform 90ms var(--ease), background var(--dur), color var(--dur);
}
.nv-fab:active { transform: scale(.93); }
.nv-fab svg { width: 22px; height: 22px; }
.nv-fab.off { color: var(--nv-red); }
.nv-fab.on, .nv-fab[aria-pressed="true"][data-act="satellite"] { background: var(--nv-blue); color: var(--nv-on); border-color: transparent; }
.nv-fab[hidden] { display: none; }

.nv-speed {
  pointer-events: auto;
  flex: 0 0 auto;
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--ink);
  line-height: 1;
}
.nv-speed b { font-family: var(--font-num); font-weight: 700; font-size: 1.35rem; letter-spacing: -0.02em; }
.nv-speed span { font-size: 0.58rem; font-weight: 700; color: var(--ink-2); margin-top: 2px; }
.nv-recenter {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 0 18px 0 14px;
  border-radius: var(--r-pill);
  color: var(--nv-blue-ink);
  font: inherit; font-weight: 700; font-size: var(--fs-sm);
}
.nv-recenter[hidden] { display: none; }

/* ============ bottom card (strong glass) ============ */
.nv-card {
  pointer-events: auto;
  display: flex; flex-direction: column; gap: 12px;
  padding: 14px;
  border-radius: 28px;
  min-width: 0;
}
.nv-card-row { padding-left: 4px; }
.nv-card-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-width: 0; }
.nv-sum { min-width: 0; line-height: 1.2; }
.nv-sum-1 { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 7px; min-width: 0; }
.nv-rt { color: var(--nv-eta); font-family: var(--font-num); font-size: clamp(1.55rem, 1.3rem + 1.3vw, 2rem); font-weight: 700; letter-spacing: -0.02em; }
.nv-rd { color: var(--ink-2); font-family: var(--font-num); font-size: clamp(.92rem, .88rem + .25vw, 1.05rem); font-weight: 400; }
.nv-sum-2 {
  display: flex; align-items: center; gap: 5px;
  min-width: 0; margin-top: 4px;
  color: var(--ink-2); font-size: var(--fs-sm); font-weight: 400;
  white-space: nowrap; overflow: hidden;
}
.nv-sum-2 > svg, .nv-sum-2 .ico-tile { flex: 0 0 auto; }
.nv-eta { flex: 0 0 auto; color: var(--ink); font-weight: 700; font-family: var(--font-num); }
.nv-dot { flex: 0 0 auto; opacity: .6; }
.nv-next-l { flex: 0 0 auto; }
.nv-nextname { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--ink); font-weight: 700; }
/* round ⋯ and red ✕ */
.nv-round, .nv-x {
  width: 46px; height: 46px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  transition: transform 90ms var(--ease);
}
.nv-round { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.nv-x { background: var(--nv-red); color: var(--nv-on); border: 0; box-shadow: 0 8px 18px color-mix(in srgb, var(--nv-red) 35%, transparent); }
.nv-round:active, .nv-x:active { transform: scale(.94); }
.nv-goal {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 12px; border-radius: 14px;
  background: var(--mint-soft);
  font-size: var(--fs-xs); font-weight: 400; line-height: 1.45; min-width: 0;
}
.nv-goal > svg { flex: 0 0 auto; color: var(--mint); margin-top: 1px; }
.nv-goal > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.nv-goal.bad { background: var(--danger-soft); }
.nv-goal.bad > svg { color: var(--danger); }
/* legs still estimated: a neutral "ประมาณการ" line, no green/red verdict yet */
.nv-goal.est { background: var(--surface-sunk); color: var(--ink-2); }
.nv-goal.est > svg { color: var(--ink-3); }
.nv-goal[hidden] { display: none; }
/* secondary actions: icon over label, soft squircles (Apple Maps card style) */
.nv-acts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; min-width: 0; }
.nv-acts button {
  min-width: 0; min-height: 54px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 6px 4px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--nv-chip); color: var(--ink);
  font: inherit; font-size: .76rem; font-weight: 700; line-height: 1.15;
  transition: transform 90ms var(--ease), background var(--dur);
}
.nv-acts button:active { transform: scale(.95); }
.nv-acts button svg { flex: 0 0 auto; color: var(--ink-2); }
.nv-acts button > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv-acts [data-act="sim"][aria-pressed] { background: var(--grape-soft); color: var(--grape); border-color: transparent; }
.nv-acts [data-act="sim"][aria-pressed] svg { color: var(--grape); }

/* GPS failure card */
.nv-gpsfail {
  pointer-events: auto;
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: 24px;
  min-width: 0;
}
.nv-gpsfail[hidden] { display: none; }
.nv-gf-text { display: flex; gap: var(--sp-3); align-items: center; min-width: 0; line-height: 1.35; }
.nv-gf-text .small { color: var(--ink-2); overflow-wrap: anywhere; }
.nv-gf-btns { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.nv-gf-btns .btn { flex: 1 1 140px; }

/* simulation bar */
.nv-simbar {
  pointer-events: auto;
  display: flex; align-items: center; gap: 6px;
  padding: 5px;
  border-radius: var(--r-pill);
  min-width: 0;
}
.nv-simbar[hidden] { display: none; }
.nv-sim-tag { flex: 0 0 auto; display: inline-grid; place-items: center; width: 36px; color: var(--grape); }
.nv-simbar .nv-sel { flex: 1 1 0; width: auto; min-width: 0; min-height: 44px; padding: 4px 8px 4px 12px; border-radius: var(--r-pill); font-weight: 700; font-size: var(--fs-sm); background-color: var(--nv-chip); border: 1px solid var(--line); }
.nv-simbar .nv-sel[data-sim="mult"] { flex: 0 1 78px; }
.nv-simbtn {
  flex: 0 0 auto; width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--nv-chip); color: var(--ink);
}
.nv-simbtn:active { transform: scale(.94); }

/* ============ pre-start (floating glass route overview) ============ */
.nv-pre {
  position: absolute; z-index: 3;
  left: calc(10px + var(--safe-left)); right: calc(10px + var(--safe-right)); bottom: calc(10px + var(--safe-bottom));
  margin-inline: auto;
  max-width: 600px;
  /* never cover the round map buttons stacked at the top right (4 × 48 px + gaps) */
  max-height: min(68%, 740px, calc(100% - 256px - var(--safe-top) - var(--safe-bottom)));
  display: flex; flex-direction: column; min-height: 0;
  border-radius: 28px;
  overflow: hidden;
  animation: nvSheetUp 320ms var(--ease);
}
.nv-pre-grab { display: none; }
.nv-pre-head { flex: 0 0 auto; display: flex; align-items: flex-start; gap: var(--sp-3); padding: 18px 14px 10px 18px; min-width: 0; }
.nv-pre-titles { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nv-pre-kicker { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); letter-spacing: .02em; }
.nv-pre-kicker svg { flex: 0 0 auto; }
.nv-pre-kicker .min0 { overflow-wrap: anywhere; }
.nv-pre-time { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; margin: 2px 0 0; font-size: inherit; line-height: 1.15; }
.nv-pre-time .nv-rt { font-size: clamp(1.7rem, 1.4rem + 1.5vw, 2.2rem); }
.nv-pre-sub {
  display: flex; align-items: center; gap: 5px; min-width: 0;
  font-size: var(--fs-sm); color: var(--ink-2); font-weight: 400;
}
.nv-pre-sub .ico-tile { flex: 0 0 auto; }
.nv-pre-sub .nv-nextname { white-space: nowrap; }
.nv-pre-when { display: flex; align-items: center; gap: 5px; font-size: var(--fs-xs); color: var(--ink-3); font-weight: 400; }
.nv-pre-when svg { flex: 0 0 auto; }
.nv-pre-btns { flex: 0 0 auto; display: flex; gap: 8px; }
.nv-pre-body {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  padding: 4px var(--sp-4) var(--sp-4);
  display: flex; flex-direction: column; gap: var(--sp-4);
}
.nv-pre-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.nv-pre-tags .badge { white-space: normal; padding: 3px 10px; }
.nv-pre-tags .badge:first-child { background: var(--nv-chip); border: 1px solid var(--line); }
.nv-pre-status { display: flex; flex-direction: column; gap: var(--sp-2); }
.nv-pre-status[hidden] { display: none; }
.nv-status-row { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--ink-2); font-weight: 400; }
.nv-status-row .spinner { flex: 0 0 auto; width: 18px; height: 18px; border-width: 2.5px; }
.nv-pre .callout > svg { flex: 0 0 auto; }
.callout.nv-goalbox > svg { color: var(--mint); }
.callout.danger.nv-goalbox > svg { color: var(--danger); }
.callout.nv-goal-est > svg { color: var(--ink-2); }
.nv-pre .callout.warn > svg { color: var(--warn); }
.nv-pre .callout.danger > svg { color: var(--danger); }
.nv-pre .callout.ok > svg { color: var(--mint); }
.nv-pre-sec { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.nv-sec-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-width: 0; }
.nv-pre-label { font-family: var(--font-display); font-size: var(--fs-md); font-weight: 700; }
.nv-3d { flex: 0 0 auto; color: var(--nv-blue-ink); }
.nv-3d svg { width: 17px; height: 17px; }
/* edge-to-edge scroller: match the pre-start body padding (base .chips.scroll uses the page gutter) */
.nv-legchips.scroll { margin-inline: calc(-1 * var(--sp-4)); padding-inline: var(--sp-4); scroll-padding-inline: var(--sp-4); }
.nv-legchips .chip { flex: 0 0 auto; background: var(--nv-chip); }
.nv-legchips .chip[aria-pressed="true"] { background: var(--primary-soft); }
.nv-legtitle { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); flex-wrap: wrap; }
.nv-legend { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.nv-legend .min0 { overflow-wrap: anywhere; }
.nv-arrow-sm { display: inline-grid; color: var(--ink-3); }
.nv-legopts { min-width: 0; }
.nv-stoplist { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.nv-daysep { margin-top: var(--sp-2); display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); letter-spacing: .02em; }
.nv-daysep:first-child { margin-top: 0; }
.nv-daysep svg { flex: 0 0 auto; }
.nv-stop {
  display: flex; align-items: center; gap: 10px;
  min-height: 58px; padding: 8px 12px 8px 10px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer; min-width: 0;
  transition: border-color var(--dur), background var(--dur), box-shadow var(--dur), transform 90ms;
}
.nv-stop:active { transform: scale(.985); }
.nv-stop:has(input:checked) { border-color: var(--nv-blue); background: var(--nv-blue-tint); box-shadow: 0 0 0 1px var(--nv-blue) inset; }
.nv-stop:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.nv-stop-no {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-sunk); color: var(--ink-2);
  font-size: var(--fs-xs); font-weight: 700;
}
.nv-stop.in .nv-stop-no { background: var(--nv-blue); color: var(--nv-on); }
.nv-stop.done .nv-stop-no { background: var(--mint); color: var(--nv-on); }
.nv-stop-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.nv-stop-name { font-weight: 700; overflow-wrap: anywhere; }
.nv-stop-sub { font-size: var(--fs-xs); color: var(--ink-2); overflow-wrap: anywhere; }
.nv-stop.done .nv-stop-name { color: var(--ink-2); }
.nv-stop-first { flex: 0 0 auto; background: var(--nv-blue); color: var(--nv-on); }
.nv-stop-radio { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.nv-pre-hint { font-size: var(--fs-sm); color: var(--ink-2); }
.nv-pre-foot {
  flex: 0 0 auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px var(--sp-4) 14px;
  border-top: 1px solid var(--line);
}
.nv-pre-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nv-listpill {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 8px 16px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-1);
  font: inherit; font-family: var(--font-display); font-size: 1.05rem; font-weight: 700;
  transition: transform 90ms var(--ease);
}
.nv-listpill:active { transform: scale(.97); }
.nv-listpill > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv-go {
  flex: 1.35 1 0; min-width: 0;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 8px 24px;
  border: 0; border-radius: var(--r-pill);
  background: var(--nv-blue); color: var(--nv-on);
  font: inherit; font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; line-height: 1.1;
  text-decoration: none;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--nv-blue) 35%, transparent);
  transition: transform 90ms var(--ease), background var(--dur);
}
.nv-go:hover { background: var(--nv-blue-2); }
.nv-go:active { transform: scale(.97); }
.nv-go svg { width: 22px; height: 22px; flex: 0 0 auto; }
.nv-go > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv-go .spinner { width: 20px; height: 20px; border-color: color-mix(in srgb, var(--nv-on) 35%, transparent); border-top-color: var(--nv-on); }
.nv-go.block { width: 100%; font-size: var(--fs-lg); min-height: 52px; }
.nv-pre-foot.nogps .nv-go { background: var(--surface-sunk); color: var(--ink-2); box-shadow: none; }
.nv-pre-foot.nogps .nv-simstart { --btn-bg: var(--nv-blue); --btn-ink: var(--nv-on); }
.nv-pre-simrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; min-width: 0; }
.nv-pre-simrow .btn { padding-inline: 12px; min-height: 44px; box-shadow: none; --btn-bg: var(--nv-chip); --btn-ink: var(--ink); border: 1px solid var(--line); border-radius: var(--r-pill); font-size: var(--fs-sm); }
.nv-pre-simrow .btn svg { width: 17px; height: 17px; color: var(--grape); }
.nv-pre-foot.nogps .nv-pre-simrow .nv-simstart svg { color: var(--nv-on); }
.nv-pre-simrow .nv-sel { width: auto; max-width: 8.6rem; min-height: 44px; padding: 6px 4px 6px 12px; font-weight: 700; font-size: var(--fs-sm); border-radius: var(--r-pill); background-color: var(--nv-chip); border: 1px solid var(--line); }

/* background-mode note (pre-start + menu) */
.nv-bgnote {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: var(--fs-sm); line-height: 1.45; min-width: 0;
}
.nv-bgnote > .ico-tile { margin-top: 1px; }
.nv-bgnote b { display: block; }
.nv-bgnote .min0 { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.nv-bgnote .min0 > span { overflow-wrap: anywhere; color: var(--ink-2); }
.nv-hobtn { margin-top: 6px; max-width: 100%; border-radius: var(--r-pill); }
.nv-hobtn svg { width: 17px; height: 17px; color: var(--nv-blue-ink); }

/* ============ arrival ============ */
.nv-arrival {
  position: absolute; inset: 0; z-index: 6;
  display: grid; place-items: center;
  padding: calc(var(--sp-4) + var(--safe-top)) calc(var(--sp-4) + var(--safe-right)) calc(var(--sp-4) + var(--safe-bottom)) calc(var(--sp-4) + var(--safe-left));
  background: color-mix(in srgb, var(--bg) 42%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: fadeIn var(--dur) var(--ease);
}
.nv-arrival[hidden] { display: none; }
.nv-arr-card {
  position: relative;
  width: min(100%, 420px); max-height: 100%;
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; align-items: stretch; gap: var(--sp-2);
  padding: var(--sp-6) var(--sp-5) var(--sp-4);
  border-radius: var(--r-xl);
  box-shadow: var(--glass-edge), var(--shadow-3);
  text-align: center;
  animation: popIn 260ms var(--ease);
}
.nv-arr-tile { position: relative; align-self: center; margin-bottom: var(--sp-1); }
.nv-arr-tile .ico-tile { width: 68px; height: 68px; border-radius: 22px; }
.nv-arr-tile .ico-tile svg { width: 32px; height: 32px; }
.nv-arr-check {
  position: absolute; right: -6px; bottom: -6px;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--mint); color: var(--nv-on);
  border: 3px solid var(--surface);
}
.nv-arr-kicker { font-family: var(--font-display); font-weight: 400; color: var(--nv-eta); font-size: var(--fs-sm); letter-spacing: .01em; }
.nv-arr-card h2 { font-size: var(--fs-2xl); overflow-wrap: anywhere; }
.nv-arr-sub { color: var(--ink-2); font-size: var(--fs-sm); }
.nv-arr-next {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: var(--fs-sm); padding: 8px 14px; border-radius: var(--r-pill);
  background: var(--nv-chip); border: 1px solid var(--line); color: var(--ink-2);
  overflow-wrap: anywhere; text-align: left;
}
.nv-arr-next svg { flex: 0 0 auto; color: var(--nv-blue-ink); }
.nv-arr-next b { color: var(--ink); }
.nv-arr-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); margin-top: var(--sp-2); }
.nv-arr-actions .btn { border-radius: var(--r-pill); }
.nv-arr-actions .btn svg { width: 19px; height: 19px; color: var(--ink-2); }
.nv-arr-card .nv-go.block { margin-top: 2px; }
.nv-arr-card .btn.ghost svg { width: 17px; height: 17px; }

/* ============ sheets (rendered in #overlayRoot) ============ */
.nv-handoff { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
/* grouped rows (iOS settings style): one white card, hairline separators */
.nv-group {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.nv-ho {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%; min-height: 64px;
  padding: 10px 14px;
  border: 0; border-radius: 0;
  background: transparent; color: var(--ink);
  text-decoration: none; text-align: left; font: inherit;
  min-width: 0;
  transition: background var(--dur);
}
.nv-group > .nv-ho + .nv-ho { border-top: 1px solid var(--line); }
button.nv-ho:active, a.nv-ho:active { background: var(--surface-sunk); }
.nv-ho-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.nv-ho-body > b { font-weight: 700; overflow-wrap: anywhere; }
.nv-ho-body > span { font-size: var(--fs-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.nv-ho-go { flex: 0 0 auto; display: inline-grid; color: var(--ink-3); }
.nv-ho > .btn { flex: 0 0 auto; }
.nv-ok { display: inline-flex; align-items: center; gap: 4px; }
.nv-ok svg { color: var(--mint); flex: 0 0 auto; }

/* "รายการ" sheet */
.nv-ls { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.nv-ls-tabs { position: sticky; top: calc(-1 * var(--sp-2)); z-index: 1; }
.nv-ls-tabs button { flex: 1 1 0; }
.nv-ls-panel { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.nv-ls-sum { display: flex; flex-direction: column; gap: 6px; }
.nv-ls-sum:empty { display: none; }
.nv-ls-fin {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  font-size: var(--fs-sm); line-height: 1.45; min-width: 0;
}
.nv-ls-fin > .ico-tile, .nv-ls-fin > svg { flex: 0 0 auto; margin-top: 1px; }
.nv-ls-fin .min0 { overflow-wrap: anywhere; }
.nv-ls-k { color: var(--ink-2); }
.nv-ls-meta { display: block; color: var(--ink-2); font-size: var(--fs-xs); }
.nv-ls-fin.ok { background: var(--mint-soft); border-color: transparent; }
.nv-ls-fin.ok > svg { color: var(--mint); }
.nv-ls-fin.bad { background: var(--danger-soft); border-color: transparent; }
.nv-ls-fin.bad > svg { color: var(--danger); }
.nv-ls-fin.est { background: var(--surface-sunk); border-color: transparent; }
.nv-ls-fin.est > svg { color: var(--ink-3); }
.nv-tl-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden;
}
.nv-tl-list > li { min-width: 0; }
.nv-tl-list > li + li { border-top: 1px solid var(--line); }
.nv-tl {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%; min-height: 60px; padding: 10px 14px;
  border: 0; background: none; color: var(--ink);
  font: inherit; text-align: left;
  transition: background var(--dur);
}
.nv-tl:active { background: var(--surface-sunk); }
.nv-tl.now { background: color-mix(in srgb, var(--nv-green) 9%, transparent); }
.nv-tl-ico {
  flex: 0 0 auto; width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--nv-tint);
  color: var(--nv-tint-ink);
}
.nv-tl-ico svg { width: 22px; height: 22px; }
.nv-tl.now .nv-tl-ico { background: var(--nv-green); color: var(--nv-on); }
.nv-tl-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.nv-tl-t { font-weight: 400; overflow-wrap: anywhere; }
.nv-tl-t b { font-weight: 700; }
.nv-tl-t .nv-shield { margin-left: 6px; font-size: .8em; vertical-align: .06em; box-shadow: none; border: 1px solid color-mix(in srgb, var(--nv-shield-ink) 30%, transparent); }
.nv-tl-s { display: flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--ink-2); overflow-wrap: anywhere; }
.nv-tl-s svg { flex: 0 0 auto; color: var(--mint); }
.nv-tl-d { flex: 0 0 auto; font-weight: 700; color: var(--ink-2); font-size: var(--fs-sm); white-space: nowrap; }
.nv-st { display: flex; align-items: center; gap: var(--sp-3); padding: 8px 8px 8px 14px; min-height: 60px; }
.nv-st.passed .ico-tile, .nv-st.passed .nv-tl-t { opacity: .55; }
.nv-st .nv-tl-t .badge { vertical-align: .1em; margin-right: 2px; }
.nv-st-btns { flex: 0 0 auto; display: flex; align-items: center; gap: 2px; }
.nv-st-btns .btn.icon { color: var(--ink-2); }
.nv-st-btns .btn.sm.soft { border-radius: var(--r-pill); }
.nv-opts { margin-top: 0; }
.nv-opt { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 12px 14px; min-width: 0; }
.nv-opt + .nv-opt { border-top: 1px solid var(--line); }
.nv-opt-t { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.nv-opt-t > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.nv-opt-t b { font-weight: 700; }
.nv-opt-t small { color: var(--ink-2); font-size: var(--fs-xs); line-height: 1.4; overflow-wrap: anywhere; }
.nv-opt > .btn, .nv-opt > .switch { flex: 0 0 auto; }
.nv-opt > .btn { border-radius: var(--r-pill); }
.nv-empty-row { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: var(--sp-6) var(--sp-4); text-align: center; color: var(--ink-2); font-size: var(--fs-sm); }
.nv-empty-row .ico-tile { margin-bottom: 4px; }
.nv-empty-row b { color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: var(--fs-md); }

/* search along the route sheet */
.nv-sr { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.nv-sr-cats { flex-wrap: wrap; }
.nv-sr-cats .chip svg { width: 17px; height: 17px; }
.nv-sr-out { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.nv-sr-hint { display: flex; align-items: center; gap: var(--sp-3); padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: var(--fs-sm); }
.nv-sr-note { display: flex; align-items: center; gap: 6px; }
.nv-sr-note svg { flex: 0 0 auto; }
.nv-sr-load { display: flex; align-items: center; gap: var(--sp-2); color: var(--ink-2); font-size: var(--fs-sm); font-weight: 400; }
.nv-sr-load .spinner { width: 18px; height: 18px; border-width: 2.5px; }
.nv-sr-sk { height: 60px; border-radius: var(--r-md); }
.nv-sr-btns { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.nv-sr-btns .btn { border-radius: var(--r-pill); }
.nv-sr-out > .callout > svg { color: var(--warn); flex: 0 0 auto; }
.nv-sr-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden;
}
.nv-sr-item { display: flex; align-items: center; gap: 4px; min-width: 0; padding-right: 10px; }
.nv-sr-item + .nv-sr-item { border-top: 1px solid var(--line); }
.nv-sr-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: var(--sp-3); min-height: 60px; padding: 8px 4px 8px 14px; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; }
.nv-sr-item > .btn { flex: 0 0 auto; }
.nv-sr-item > .btn.icon { color: var(--ink-2); }
.nv-sr-item > .btn.sm.soft { border-radius: var(--r-pill); }

/* PiP source video: must exist in the page but never be seen */
.nv-pip-video { position: fixed; left: 0; bottom: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; z-index: -1; }

/* ============ SVG fallback map ============ */
.nv-fallback .nv-fb-svg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.nv-fallback .nv-fb-svg svg { display: inline; }
.nv-fb-note {
  position: absolute; left: var(--sp-3); top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 6px;
  max-width: min(60%, 240px);
  padding: 8px 12px; border-radius: var(--r-sm);
  background: var(--glass-strong); color: var(--ink-2);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  font-size: var(--fs-xs); font-weight: 400;
}
.nv-fb-note svg { flex: 0 0 auto; }

/* ============ larger portrait (iPad): float the pre-start card ============ */
@media (min-width: 700px) and (min-height: 700px) {
  .nv-pre { left: var(--sp-4); right: var(--sp-4); bottom: calc(var(--sp-4) + var(--safe-bottom)); max-height: min(64%, 760px); border-radius: var(--r-xl); }
  .nv-ui { padding: calc(var(--sp-4) + var(--safe-top)) calc(var(--sp-4) + var(--safe-right)) calc(var(--sp-4) + var(--safe-bottom)) calc(var(--sp-4) + var(--safe-left)); gap: var(--sp-3); }
  .nv-fab { width: 52px; height: 52px; }
  .nv-card { border-radius: var(--r-xl); padding: 16px; }
}

/* ============ column layout (landscape) ============ */
@media (orientation: landscape) and (min-aspect-ratio: 13/10) {
  .nv-ui {
    grid-template-columns: clamp(300px, 40vw, 440px) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "top mid" ". mid" "bottom mid";
  }
  .nv-top, .nv-bottom { max-width: none; justify-self: stretch; }
  .nv-mid { flex-direction: row; }
  .nv-root[data-phase="prestart"] .nv-ui { grid-template-columns: minmax(0, 1fr); grid-template-areas: "mid" "mid" "mid"; }
  .nv-pre {
    top: calc(var(--sp-3) + var(--safe-top)); bottom: calc(var(--sp-3) + var(--safe-bottom)); left: calc(var(--sp-3) + var(--safe-left)); right: auto;
    margin: 0;
    width: clamp(310px, 42vw, 450px); max-width: calc(100% - 2 * var(--sp-3) - 64px);
    max-height: none;
    border-radius: var(--r-xl);
    animation: nvSlideIn 320ms var(--ease);
  }
}

/* ============ short screens: tighter ============ */
@media (max-height: 700px) and (orientation: portrait) {
  .nv-pre { max-height: 62%; }
}
@media (max-height: 700px) {
  .nv-banner { padding: 12px 16px 12px 10px; gap: 8px; border-radius: 24px; }
  .nv-arrow { width: 48px; }
  .nv-street { font-size: clamp(1.25rem, 1rem + 1.6vw, 1.6rem); -webkit-line-clamp: 1; }
  .nv-card { padding: 12px; gap: 10px; }
  .nv-pre-head { padding-top: 14px; padding-bottom: 6px; }
  .nv-pre-time .nv-rt { font-size: clamp(1.45rem, 1.25rem + 1.2vw, 1.8rem); }
  .nv-pre-body { gap: var(--sp-3); }
  .nv-pre-foot { gap: 8px; padding-top: 10px; padding-bottom: 12px; }
  .nv-go, .nv-listpill { min-height: 50px; }
  .nv-fabs { gap: 8px; }
  .nv-fab { width: 44px; height: 44px; }
  .nv-speed { width: 54px; height: 54px; }
}
@media (max-height: 520px) {
  .nv-ui { gap: 6px; padding-top: calc(6px + var(--safe-top)); padding-bottom: calc(6px + var(--safe-bottom)); }
  .nv-banner { gap: 6px; border-radius: 20px; padding: 8px 12px 8px 6px; }
  .nv-ban-turn { width: 62px; }
  .nv-arrow { width: 40px; }
  .nv-dist b { font-size: 1.05rem; }
  .nv-act { font-size: .9rem; }
  .nv-street { font-size: 1.15rem; }
  .nv-lanes { padding: 3px; }
  .nv-lane { height: 26px; }
  .nv-lane svg { width: 18px; height: 18px; }
  .nv-then { margin-top: -20px; padding: 18px 12px 5px 10px; font-size: var(--fs-xs); }
  .nv-pill { min-height: 30px; padding-top: 3px; padding-bottom: 3px; font-size: var(--fs-xs); }
  .nv-card { padding: 8px 10px; gap: 8px; border-radius: 22px; }
  .nv-rt { font-size: 1.3rem; }
  .nv-rd { font-size: .88rem; }
  .nv-sum-2 { font-size: var(--fs-xs); margin-top: 2px; }
  .nv-round, .nv-x { width: 44px; height: 44px; }
  .nv-goal { display: none; }
  .nv-acts button > span { display: none; }
  .nv-acts button { min-height: 44px; padding: 4px; }
  .nv-speed { width: 46px; height: 46px; }
  .nv-speed b { font-size: 1.05rem; }
  .nv-recenter { min-height: 44px; padding: 0 14px; }
  .nv-recenter span { display: none; }
  .nv-simbar { padding: 3px; }
  .nv-sim-tag { display: none; }
  .nv-simbar .nv-sel[data-sim="mult"] { flex-basis: 64px; }
  .nv-pre-head { padding-top: 10px; padding-bottom: 4px; }
  .nv-pre-time .nv-rt { font-size: 1.35rem; }
  .nv-pre-foot { padding-top: 8px; padding-bottom: 8px; }
  .nv-go, .nv-listpill { min-height: 46px; height: 46px; font-size: 1.05rem; }
  .nv-arr-card { padding-top: var(--sp-3); }
  .nv-arr-tile .ico-tile { width: 52px; height: 52px; border-radius: 17px; }
  .nv-arr-tile .ico-tile svg { width: 26px; height: 26px; }
  .nv-arr-card h2 { font-size: var(--fs-xl); }
  .nv-fab { width: 44px; height: 44px; }
  .nv-fabs { gap: 6px; }
}
@media (max-width: 380px) {
  .nv-rt { font-size: 1.4rem; }
  .nv-rd { font-size: .86rem; }
  .nv-acts { gap: 6px; }
  .nv-acts button { font-size: .72rem; }
  .nv-card-row { gap: 8px; padding-left: 2px; }
  .nv-next-l { display: none; }
  .nv-round, .nv-x { width: 44px; height: 44px; }
  .nv-pre-head { padding-left: 16px; padding-right: 12px; }
  .nv-pre-btns { gap: 6px; }
  .nv-pre-simrow { gap: 4px; }
  .nv-pre-simrow .btn { gap: 4px; padding-inline: 10px; }
  .nv-pre-simrow .nv-sel { padding-left: 10px; }
  .nv-listpill { padding-inline: 10px; font-size: 1rem; }
  .nv-go { padding-inline: 14px; }
  /* simulation bar: drop the gauge tag so "70 กม./ชม." fits */
  .nv-sim-tag { display: none; }
  .nv-simbar { gap: 4px; }
  .nv-simbar .nv-sel { padding-left: 10px; }
}
/* landscape column is narrow: icons only for the secondary row */
@media (orientation: landscape) and (min-aspect-ratio: 13/10) and (max-width: 1000px) {
  .nv-sim-tag { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .nv-banner[data-state="wait"] .nv-arrow { animation: none; }
  .nv-pre, .nv-arr-card { animation: none; }
}

@keyframes nvPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes nvSheetUp { from { transform: translateY(40px); opacity: 0; } }
@keyframes nvSlideIn { from { transform: translateX(-30px); opacity: 0; } }
