/* HV Navigator — Australian road-sign design language.
   Guide sign green + white for direction, amber/black for warnings, red for restrictions.
   Mobile-first: full-screen map, bottom sheet; >= 900px: floating left panel. */

/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: light;
  --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-cond: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', 'Helvetica Neue', system-ui, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;

  --sign: #0b6b3a;
  --sign-strong: #08572f;
  --sign-soft: #e2f2e8;
  --sign-text: #0b6b3a;
  --sign-ink: #ffffff;

  --warn: #ffc20e;
  --warn-ink: #111111;
  --warn-soft: #fff4cc;
  --warn-text: #5c4300;
  --danger: #c8102e;
  --danger-ink: #ffffff;
  --danger-soft: #fde7ea;
  --danger-text: #9b0c23;
  --ok: #16a34a;
  --ok-soft: #e3f6e9;
  --ok-text: #0f6a31;
  --info: #1d6fd8;
  --info-soft: #e5effc;
  --info-soft-strong: #bcd6f7;

  --bg: #e7ebe9;
  --surface: #ffffff;
  --surface-2: #f2f5f3;
  --surface-3: #e3e9e6;
  --text: #111614;
  --text-2: #38423d;
  --muted: #5a6560;
  --border: #d0d8d4;
  --border-strong: #8d9993;
  --input-bg: #ffffff;
  --link: #0a5c9e;
  --focus: #1a56db;
  --focus-halo: rgba(26, 86, 219, 0.28);
  --hud-bg: #ffffff;
  --hud-ink: #0e1311;
  --toast-bg: #1b2320;
  --toast-ink: #f4f7f5;
  --sil-bg: #f4f6f5;
  --map-bg: #dfe5e2;
  --seg-on-ring: #08572f;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-2: 0 10px 30px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-lg: 18px;
  --panel-w: 400px;
  --topbar-h: 56px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --sign-strong: #0d7d44;
    --sign-soft: #10301f;
    --sign-text: #5ad38c;
    --warn-soft: #3a2f05;
    --warn-text: #ffd866;
    --danger-soft: #3b0d15;
    --danger-text: #ff9aa8;
    --ok-soft: #0e2e1b;
    --ok-text: #6ee7a0;
    --info-soft: #0f2340;
    --info-soft-strong: #1f4f8f;
    --bg: #0b100e;
    --surface: #141b18;
    --surface-2: #1a231f;
    --surface-3: #24302b;
    --text: #edf2ef;
    --text-2: #c3cec8;
    --muted: #8f9d96;
    --border: #2a3631;
    --border-strong: #50605a;
    --input-bg: #0f1513;
    --link: #7cc0ff;
    --focus: #ffd34d;
    --focus-halo: rgba(255, 211, 77, 0.3);
    --hud-bg: #0e1412;
    --hud-ink: #f6f8f7;
    --toast-bg: #26302c;
    --sil-bg: #e9eeeb;
    --map-bg: #1b2320;
    --seg-on-ring: #edf2ef;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 10px 30px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --sign-strong: #0d7d44;
  --sign-soft: #10301f;
  --sign-text: #5ad38c;
  --warn-soft: #3a2f05;
  --warn-text: #ffd866;
  --danger-soft: #3b0d15;
  --danger-text: #ff9aa8;
  --ok-soft: #0e2e1b;
  --ok-text: #6ee7a0;
  --info-soft: #0f2340;
  --info-soft-strong: #1f4f8f;
  --bg: #0b100e;
  --surface: #141b18;
  --surface-2: #1a231f;
  --surface-3: #24302b;
  --text: #edf2ef;
  --text-2: #c3cec8;
  --muted: #8f9d96;
  --border: #2a3631;
  --border-strong: #50605a;
  --input-bg: #0f1513;
  --link: #7cc0ff;
  --focus: #ffd34d;
  --focus-halo: rgba(255, 211, 77, 0.3);
  --hud-bg: #0e1412;
  --hud-ink: #f6f8f7;
  --toast-bg: #26302c;
  --sil-bg: #e9eeeb;
  --map-bg: #1b2320;
  --seg-on-ring: #edf2ef;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 10px 30px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* ------------------------------------------------------------------ base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--link);
}

img,
svg {
  display: block;
}

p {
  overflow-wrap: anywhere;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -80px;
  z-index: 300;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--sign);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: calc(8px + var(--safe-t));
}

.icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  line-height: 0;
}

.icon svg {
  width: 22px;
  height: 22px;
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-3);
}

/* ------------------------------------------------------------------ app shell */
.app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--map-bg);
}

/* The map ends where opaque bottom UI begins (the phone sheet, the navigation trip bar), so the
   provider's logo and Terms / attribution in its bottom corners always stay visible (Google Maps
   Platform and OSM terms). app.js sets --map-inset-bottom from the measured UI. */
.map {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--map-inset-bottom, 0px);
  z-index: 0;
  background: var(--map-bg);
}

/* No map could be loaded: a neutral hatched background (the notice explains why). */
.map-unavailable {
  background:
    repeating-linear-gradient(45deg, transparent 0 18px, rgba(127, 127, 127, 0.08) 18px 36px),
    var(--map-bg);
}

.app.is-choosing .map,
.app.is-choosing .map * {
  cursor: crosshair !important;
}

/* Minimal chrome while driving: the HUD has its own overview/re-centre controls.
   (Map attribution stays visible.) */
.app[data-step='navigate'] .leaflet-control-zoom,
.app[data-step='navigate'] .gm-bundled-control,
.app[data-step='navigate'] .gm-fullscreen-control {
  display: none !important;
}

/* ------------------------------------------------------------------ top bar */
.topbar {
  position: absolute;
  z-index: 22;
  top: calc(8px + var(--safe-t));
  left: calc(8px + var(--safe-l));
  right: calc(8px + var(--safe-r));
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.topbar > * {
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 16px 0 12px;
  border-radius: 10px;
  background: var(--sign);
  color: var(--sign-ink);
  box-shadow: inset 0 0 0 2px var(--sign), inset 0 0 0 3.5px rgba(255, 255, 255, 0.92), var(--shadow-1);
  min-width: 0;
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-name {
  margin: 0;
  font: 700 21px/1 var(--font-cond);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.topbar-btn {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-1);
}

.topbar-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

/* Logged-in account button: the user's initial on a guide-sign disc. */
.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--sign);
  color: var(--sign-ink);
  font: 700 19px/1 var(--font-cond);
  box-shadow: inset 0 0 0 2px var(--sign), inset 0 0 0 3.5px rgba(255, 255, 255, 0.9);
  user-select: none;
}

.avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 28px;
  box-shadow: inset 0 0 0 3px var(--sign), inset 0 0 0 5px rgba(255, 255, 255, 0.9);
}

/* ------------------------------------------------------------------ overlays above the map */
.overlay-top {
  position: absolute;
  z-index: 30;
  top: var(--overlay-top, calc(72px + var(--safe-t)));
  left: var(--overlay-left, 0px);
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 calc(12px + var(--safe-r)) 0 calc(12px + var(--safe-l));
  pointer-events: none;
}

.overlay-top > * {
  pointer-events: auto;
  width: 100%;
  max-width: 560px;
}

.toasts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Persistent notices sit above the map but below the sheet, so an expanded sheet is never covered —
   except on short screens, where the Google limit banner and the resume offer would otherwise hide
   behind it (see the max-height media queries below). */
.notices {
  position: absolute;
  z-index: 18;
  top: var(--overlay-top, calc(72px + var(--safe-t)));
  left: var(--overlay-left, 0px);
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 calc(12px + var(--safe-r)) 0 calc(12px + var(--safe-l));
  pointer-events: none;
}

.notices > * {
  width: 100%;
  max-width: 560px;
  pointer-events: auto;
}

.toasts {
  pointer-events: none;
}

.toasts > * {
  pointer-events: auto;
}

/* While navigating only the notices that matter on the road stay visible (offline, the map failed
   to load: class notice-drive). The Google limit banner and the rest (storage, resume…) wait until
   the drive ends, so nothing else covers the map under the guide sign. */
.app[data-step='navigate'] .notices > :not(.notice-drive) {
  display: none !important;
}

.map-hint {
  width: auto !important;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 18px;
  border-radius: 999px;
  background: var(--sign);
  color: #fff;
  font: 700 18px/1.2 var(--font-cond);
  box-shadow: var(--shadow-2);
}

.map-status {
  position: absolute;
  z-index: 15;
  left: var(--overlay-left, 0px);
  right: 0;
  bottom: var(--overlay-bottom, 40%);
  width: max-content;
  max-width: calc(100% - 24px);
  margin: 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--toast-bg);
  color: var(--toast-ink);
  font: 600 15px/1.3 var(--font);
  box-shadow: var(--shadow-1);
  pointer-events: none;
  text-align: center;
}

.app[data-step='route'] .map-status,
.app[data-step='vehicle'] .map-status {
  display: none !important;
}

/* ------------------------------------------------------------------ toasts + notices */
.toast,
.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px 8px 14px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.35;
  box-shadow: var(--shadow-2);
  animation: drop-in 0.2s var(--ease);
}

.toast {
  background: var(--toast-bg);
  color: var(--toast-ink);
}

.toast-success .toast-icon {
  color: #5ee08f;
}

.toast-warn {
  background: var(--warn);
  color: var(--warn-ink);
}

.toast-error {
  background: var(--danger);
  color: var(--danger-ink);
}

.toast-msg,
.notice-msg {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 4px 0;
}

.toast-action,
.notice-action {
  flex: none;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.16);
  font-weight: 700;
}

.notice-action {
  background: var(--surface-3);
  color: var(--text);
}

.notice-action.is-primary {
  background: var(--sign);
  color: var(--sign-ink);
}

/* Google limit banner ("you're on OpenStreetMap"): text beside the icon and the close button, the
   Subscribe button below the text, so a long sentence never squeezes into a narrow column. */
.notice-limit {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    'icon msg close'
    '. action action';
  align-items: start;
  column-gap: 10px;
  row-gap: 2px;
}

.notice-limit .notice-icon {
  grid-area: icon;
  margin-top: 6px;
}

.notice-limit .notice-msg {
  grid-area: msg;
  font-weight: 600;
}

.notice-limit .notice-action {
  grid-area: action;
  justify-self: start;
  margin: 2px 0 4px;
}

.notice-limit .notice-close {
  grid-area: close;
}

.toast-close,
.notice-close {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  opacity: 0.85;
}

.toast-close svg,
.notice-close svg {
  width: 20px;
  height: 20px;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s, transform 0.2s;
}

.notice {
  background: var(--surface);
  color: var(--text);
  border-left: 6px solid var(--info);
}

.notice-icon {
  color: var(--info);
}

.notice-warn {
  border-left-color: var(--warn);
}

.notice-warn .notice-icon {
  color: var(--warn-text);
}

.notice-error {
  border-left-color: var(--danger);
}

.notice-error .notice-icon {
  color: var(--danger);
}

@keyframes drop-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* ------------------------------------------------------------------ buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font: 600 17px/1.1 var(--font);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 0.15s, border-color 0.15s, transform 0.08s;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--sign);
  color: var(--sign-ink);
}

.btn-primary:hover:not(:disabled) {
  background: var(--sign-strong);
}

.btn-primary:focus-visible,
.btn-go:focus-visible,
.btn-danger:focus-visible {
  outline-color: var(--focus);
  box-shadow: 0 0 0 6px var(--focus-halo);
}

.btn-go {
  min-height: 64px;
  border-radius: 14px;
  background: var(--sign);
  color: #fff;
  font: 700 30px/1 var(--font-cond);
  letter-spacing: 0.12em;
  box-shadow: inset 0 0 0 3px var(--sign), inset 0 0 0 5.5px #fff;
}

.btn-go .icon svg {
  width: 26px;
  height: 26px;
}

.btn-go:hover:not(:disabled) {
  background: var(--sign-strong);
  box-shadow: inset 0 0 0 3px var(--sign-strong), inset 0 0 0 5.5px #fff;
}

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
}

.btn-outline:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn-ghost {
  background: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn-ghost-light {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 0;
}

.btn-danger {
  background: var(--danger);
  color: var(--danger-ink);
}

.btn-warn {
  background: var(--warn);
  color: var(--warn-ink);
}

/* Settings → "Download the Android app (APK)": the red download button (website only). */
.btn-apk {
  background: var(--danger);
  color: var(--danger-ink);
  font-weight: 700;
  text-decoration: none;
  /* The label wraps on narrow phones instead of being cut off. */
  white-space: normal;
  text-align: center;
  line-height: 1.25;
  min-height: 52px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.btn-apk:hover {
  filter: brightness(1.08);
}

.settings-apk .hint {
  margin-top: 8px;
}

.btn-danger-text {
  color: var(--danger-text);
}

.btn-sm {
  min-height: 44px;
  padding: 0 12px;
  font-size: 15px;
  border-radius: 10px;
}

.btn-sm::after {
  content: '';
  position: absolute;
  inset: -2px 0;
}

.btn-icon {
  width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 50%;
}

.btn-block {
  width: 100%;
}

.btn-grow {
  flex: 1 1 auto;
  min-width: 0;
}

.btn-grow .btn-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn.is-busy {
  cursor: progress;
}

.btn-spin {
  display: inline-grid;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--link);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-tool {
  flex: 1 1 auto;
  min-height: 48px;
  padding: 0 12px;
  font-size: 15px;
  background: var(--surface-2);
  border-color: var(--border);
}

.btn-tool.is-active {
  background: var(--sign);
  border-color: var(--sign);
  color: #fff;
}

.link-ext {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--link);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.link-ext .icon svg {
  width: 15px;
  height: 15px;
}

.spinner {
  display: inline-block;
  flex: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: 0.85;
  vertical-align: middle;
  animation: spin 0.8s linear infinite;
}

.spinner-light {
  color: #fff;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------------ bottom sheet / panel */
.sheet {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--sheet-h, 52%);
  max-height: calc(100% - var(--safe-t) - 16px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.22);
  transition: height 0.26s var(--ease);
  overflow: hidden;
  outline: none;
}

.sheet.is-dragging {
  transition: none;
}

.app[data-step='boot'] .sheet {
  visibility: hidden;
}

.sheet-grab {
  flex: none;
  touch-action: none;
  padding: 0 0 2px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

/* 44 px tall tap target (gloves, a moving cab); the visible bar stays small and centred. */
.sheet-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: grab;
}

.sheet-handle-bar {
  width: 46px;
  height: 5px;
  border-radius: 3px;
  background: var(--border-strong);
}

.stepper ol {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0 calc(10px + var(--safe-r)) 0 calc(10px + var(--safe-l));
  list-style: none;
}

.stepper li {
  flex: 1 1 0;
  min-width: 0;
  position: relative;
}

.stepper-btn {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 2px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: 600 15px/1 var(--font-cond);
  letter-spacing: 0.02em;
}

.stepper-btn::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 3px;
  border-radius: 2px;
  background: transparent;
}

.stepper-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid currentColor;
  font: 700 13px/1 var(--font-cond);
}

.stepper-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stepper-btn.is-current {
  color: var(--text);
}

.stepper-btn.is-current .stepper-num {
  background: var(--sign);
  border-color: var(--sign);
  color: #fff;
}

.stepper-btn.is-current::after {
  background: var(--sign);
}

.stepper-btn.is-done {
  color: var(--sign-text);
}

.stepper-btn.is-done:hover {
  background: var(--surface-2);
}

.stepper-btn:disabled {
  cursor: default;
  opacity: 0.6;
}

.sheet-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 6px calc(16px + var(--safe-r)) 16px calc(16px + var(--safe-l));
}

.sheet-actions {
  flex: none;
  padding: 10px calc(16px + var(--safe-r)) calc(10px + var(--safe-b)) calc(16px + var(--safe-l));
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.actions-hint {
  margin: 0;
  font-size: 14px;
  color: var(--text-2);
}

.actions-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger-text);
  font-size: 15px;
  line-height: 1.35;
}

.actions-error-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.disclaimer {
  margin-top: 28px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--muted);
}

.disclaimer p {
  margin: 0 0 6px;
}

/* ------------------------------------------------------------------ step common */
.step-title {
  margin: 8px 0 4px;
  font: 700 25px/1.12 var(--font-cond);
  letter-spacing: 0.005em;
  outline: none;
}

.step-intro,
.crumbs {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
}

/* Route step: "not a government app" + official NHVR source link (Play government-information rule). */
.source-note {
  margin: -6px 0 12px;
  color: var(--muted);
  font-size: 13.5px;
}

.step-head {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.step-head .btn-icon {
  margin-top: 4px;
  margin-left: -8px;
}

.step-head-text {
  flex: 1;
  min-width: 0;
}

.section-title {
  margin: 20px 0 8px;
  font: 700 15px/1.2 var(--font-cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.section-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 12px;
  color: var(--muted);
}

.list-count {
  margin: 0 0 8px;
  color: var(--muted);
  font: 600 15px var(--font-cond);
}

.hint {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.warn-hint {
  color: var(--warn-text);
}

.input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--text);
  font-size: 17px;
}

.input:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-halo);
}

.search-wrap {
  position: relative;
  margin: 4px 0 12px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.input-search {
  padding-left: 44px;
}

.state-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 12px;
  text-align: center;
}

.state-icon svg {
  width: 32px;
  height: 32px;
}

.state-error .state-icon {
  color: var(--danger);
}

.state-title {
  margin: 0;
  font-weight: 700;
  font-size: 17px;
}

.state-text {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text-2);
}

.state-block .state-text {
  display: block;
}

.state-text.ok {
  color: var(--ok-text);
  font-weight: 600;
}

.state-text.empty {
  padding: 16px 0;
}

.state-spin {
  width: 28px;
  height: 28px;
  color: var(--sign-text);
}

.state-inline {
  flex-direction: row;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--danger-soft);
  text-align: left;
}

.state-inline .state-text {
  color: var(--danger-text);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font: 600 14.5px/1.2 var(--font-cond);
  white-space: nowrap;
}

.chip b {
  color: var(--text);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1.5px solid currentColor;
  border-radius: 6px;
  font: 700 12.5px/1.25 var(--font-cond);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-state {
  color: var(--text-2);
}

.badge-flag {
  border-color: var(--sign);
  background: var(--sign-soft);
  color: var(--sign-text);
}

.badge-commodity {
  border-color: var(--warn);
  background: var(--warn-soft);
  color: var(--warn-text);
}

.badge-transition {
  border-color: var(--info);
  background: var(--info-soft);
  color: var(--text);
  text-transform: none;
  letter-spacing: 0.01em;
  white-space: normal;
}

.badge-ok {
  color: var(--ok-text);
}

.badge-danger {
  color: var(--danger-text);
}

.callout {
  display: flex;
  gap: 10px;
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  line-height: 1.4;
}

.callout p {
  margin: 0 0 6px;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-icon svg {
  width: 26px;
  height: 26px;
}

.callout-title {
  font-weight: 700;
  font-size: 17px;
}

.callout-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: inset 0 0 0 2px var(--danger), inset 0 0 0 4px rgba(255, 255, 255, 0.9);
}

.callout-warn {
  background: var(--warn-soft);
  color: var(--text);
  border-left: 6px solid var(--warn);
}

.callout-warn .callout-icon {
  color: var(--warn-text);
}

.callout-info {
  background: var(--info-soft);
  color: var(--text);
}

.callout-info .callout-icon {
  color: var(--info);
}

.skel {
  border-radius: 14px;
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}

.skel-card {
  height: 112px;
}

.skel-row {
  height: 96px;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ------------------------------------------------------------------ silhouettes */
.sil {
  display: inline-flex;
  align-items: flex-end;
  max-width: 100%;
  height: 38px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--sil-bg);
  overflow: hidden;
  flex: none;
}

.sil img {
  flex: 0 1 auto;
  min-width: 0;
  height: 28px;
  width: auto;
  object-fit: contain;
  object-position: 50% 100%;
}

.sil-sm {
  height: 30px;
  padding: 3px 6px;
}

.sil-sm img {
  height: 22px;
}

.sil-lg {
  height: 48px;
}

.sil-lg img {
  height: 38px;
}

.sil-empty {
  align-items: center;
  color: #5a6560;
}

/* ------------------------------------------------------------------ route step */
.route-fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pf {
  position: relative;
}

.pf-label {
  display: block;
  margin: 0 0 3px 30px;
  font: 700 13px/1.2 var(--font-cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pf-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pf-dot {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 4px solid var(--sign);
  background: var(--surface);
}

.pf-dot-via {
  border-color: #b7791f;
}

.pf-dot-destination {
  border: 0;
  border-radius: 4px;
  background: var(--danger);
  box-shadow: inset 0 0 0 4px var(--danger), inset 0 0 0 6px #fff;
}

.pf-box {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: 52px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-bg);
  transition: border-color 0.15s;
}

.pf-box:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-halo);
}

.pf.is-resolved .pf-box {
  border-color: var(--border-strong);
}

.pf-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 500 17px/1.2 var(--font);
  text-overflow: ellipsis;
}

.pf-input:focus {
  outline: none;
}

.pf-input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.pf-spin {
  margin-right: 10px;
  color: var(--sign-text);
}

.pf-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}

.pf-btn:hover {
  color: var(--text);
}

.pf-locate,
.pf-remove {
  width: 48px;
  height: 48px;
  background: var(--surface-2);
  color: var(--text);
}

.pf-locate {
  color: var(--sign-text);
}

/* Submit-only geocoders (OpenStreetMap / Geocoding fallback): explicit Search button. */
.pf-search {
  width: 48px;
  height: 48px;
  color: var(--sign-text);
}

.pf-opt-hint {
  color: var(--text-2);
}

.pf-opt-hint .pf-opt-label {
  font-weight: 500;
  font-size: 15px;
}

.pf-list {
  margin: 6px 0 4px 28px;
  padding: 4px;
  list-style: none;
  max-height: min(50vh, 380px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-2);
}

.pf-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 6px 10px;
  border-radius: 9px;
  cursor: pointer;
}

.pf-opt:hover,
.pf-opt[aria-selected='true'] {
  background: var(--surface-3);
}

.pf-opt[aria-selected='true'] {
  box-shadow: inset 4px 0 0 var(--sign);
}

.pf-opt[aria-disabled='true'] {
  cursor: default;
  background: none;
  box-shadow: none;
  color: var(--muted);
}

.pf-opt-icon {
  color: var(--muted);
}

.pf-opt-current .pf-opt-icon {
  color: var(--sign-text);
}

.pf-opt-retry .pf-opt-icon {
  color: var(--danger-text);
}

.pf-opt-text {
  flex: 1;
  min-width: 0;
}

.pf-opt-label {
  display: block;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.pf-opt-sub {
  display: block;
  font-size: 14px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.pf-msg {
  margin: 4px 0 2px 30px;
  font-size: 14px;
  color: var(--muted);
}

.pf-msg[data-type='warn'] {
  color: var(--warn-text);
}

.pf-msg[data-type='error'] {
  color: var(--danger-text);
}

.route-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 8px;
}

.choose-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  padding: 6px 6px 6px 12px;
  border-radius: var(--radius);
  background: var(--sign-soft);
  color: var(--text);
  font-weight: 600;
}

.choose-banner .choose-text {
  flex: 1;
  min-width: 0;
}

.choose-banner .icon {
  color: var(--sign-text);
}

/* ------------------------------------------------------------------ vehicle step */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
  gap: 10px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  min-height: 112px;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition: border-color 0.15s, background-color 0.15s;
}

.cat-card:hover {
  border-color: var(--sign);
}

.cat-name {
  font: 700 18px/1.15 var(--font-cond);
  overflow-wrap: anywhere;
}

.cat-meta {
  margin-top: auto;
  font-size: 14px;
  color: var(--muted);
}

.cat-card.is-unpublished {
  border-style: dashed;
}

.cat-card.is-unpublished .cat-meta {
  font-style: italic;
}

.section-trip {
  color: var(--sign-text);
}

.section-sub {
  margin: 12px 0 6px;
  font-size: 13.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.list-note {
  margin: 0 0 10px;
}

.veh-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.veh-row {
  width: 100%;
  display: grid;
  grid-template-areas: 'sil end' 'main end';
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
  min-height: 64px;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition: border-color 0.15s, background-color 0.15s;
}

.veh-row:hover {
  border-color: var(--sign);
}

.veh-row > .sil {
  grid-area: sil;
  justify-self: start;
}

.veh-row > .veh-main {
  grid-area: main;
  min-width: 0;
}

.veh-row > .icon {
  grid-area: end;
  color: var(--muted);
}

.veh-row-compact {
  grid-template-areas: 'sil main end';
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.veh-row.is-selected {
  border-color: var(--sign);
  background: var(--sign-soft);
}

.veh-row.is-selected > .icon {
  color: var(--sign-text);
}

.veh-name {
  display: block;
  font: 700 18px/1.2 var(--font-cond);
  overflow-wrap: anywhere;
}

.veh-desc {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  color: var(--muted);
}

.veh-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 0;
}

/* ------------------------------------------------------------------ networks step */
.veh-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 6px 0 4px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-2);
}

.veh-summary-main {
  flex: 1 1 160px;
  min-width: 0;
}

.veh-summary-name {
  margin: 0;
  font: 700 19px/1.2 var(--font-cond);
}

.inst-list,
.net-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.inst {
  padding: 10px 12px;
  border-left: 5px solid var(--sign);
  border-radius: 8px;
  background: var(--surface-2);
}

.inst.is-expired {
  border-left-color: var(--danger);
}

.inst-name {
  font-weight: 700;
}

.inst-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-2);
}

.net-row {
  padding: 2px 12px 12px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 0.15s;
}

.net-row.is-selected {
  border-color: var(--sign);
}

/* A network the preview's coverage hint pointed at (highlighted, never ticked for the driver). */
.net-row.is-suggested {
  border-color: var(--info);
  box-shadow: 0 0 0 2px var(--info-soft);
}

.badge-suggested {
  border-color: var(--info);
  background: var(--info-soft);
  color: var(--text);
  text-transform: none;
  letter-spacing: 0.01em;
}

.net-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 52px;
  padding: 10px 0;
  cursor: pointer;
}

.net-cb {
  flex: none;
  width: 26px;
  height: 26px;
  margin: 1px 0 0;
  accent-color: var(--sign);
  cursor: pointer;
}

.net-text {
  flex: 1;
  min-width: 0;
}

.net-name {
  display: block;
  font: 700 18px/1.2 var(--font-cond);
  overflow-wrap: anywhere;
}

.net-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--muted);
}

.net-doc {
  overflow-wrap: anywhere;
}

.net-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.net-size {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

/* The import pill stays on the right even when no size is shown. */
.net-actions .pill-slot {
  margin-left: auto;
}

.net-guide {
  margin-top: 4px;
}

.net-guide summary,
.route-options summary,
.directions summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  font-weight: 700;
  color: var(--text-2);
  cursor: pointer;
}

.net-guide p {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text-2);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: 700 15.5px/1 var(--font-cond);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pill-missing {
  border-color: var(--border-strong);
}

.pill-missing:hover {
  background: var(--surface-3);
}

.pill-busy {
  border-color: var(--info);
  background: linear-gradient(90deg, var(--info-soft-strong) var(--pct, 0%), var(--surface-2) var(--pct, 0%));
}

.pill-ready {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok-text);
}

.pill-error {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger-text);
}

.pill-none,
.pill-unknown {
  color: var(--muted);
}

.pill-spin {
  width: 15px;
  height: 15px;
  border-width: 2px;
}

.net-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 16px 0 4px;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  cursor: pointer;
  font-weight: 600;
}

.switch-input {
  position: absolute;
  opacity: 0;
  width: 52px;
  height: 30px;
  margin: 0;
  cursor: pointer;
}

.switch-track {
  position: relative;
  flex: none;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background-color 0.2s;
}

.switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s var(--ease);
}

.switch-input:checked + .switch-track {
  background: var(--sign);
}

.switch-input:checked + .switch-track::after {
  transform: translateX(22px);
}

.switch-input:focus-visible + .switch-track {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.switch-input:disabled + .switch-track {
  opacity: 0.5;
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 4px;
  padding: 0;
  list-style: none;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

.legend-label {
  min-width: 0;
}

.legend-val {
  margin-left: auto;
  color: var(--text-2);
  font: 600 15px var(--font-cond);
  white-space: nowrap;
}

.legend-inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 14px;
}

.legend-inline li {
  font-size: 14px;
}

.swatch {
  flex: none;
  width: 20px;
  height: 8px;
  border-radius: 4px;
  background: var(--c);
}

.swatch-dashed {
  background: repeating-linear-gradient(90deg, var(--c) 0 5px, transparent 5px 8px);
}

.route-options {
  margin-top: 18px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

/* Gross vehicle mass (networks step): weight icon + labelled decimal field. */
.mass-field {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  margin: 10px 0 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.mass-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-top: 26px;
  border-radius: 10px;
  background: var(--sign-soft);
  color: var(--sign-text);
}

.mass-main {
  min-width: 0;
}

.mass-main .input {
  max-width: 220px;
  font: 600 20px var(--font-cond);
  letter-spacing: 0.02em;
}

@media (max-width: 380px) {
  .mass-field {
    grid-template-columns: minmax(0, 1fr);
  }

  .mass-icon {
    display: none;
  }
}

/* The vehicle's load (networks step): mass, height and the dangerous-goods switch, stacked. */
.load-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 4px;
}

.load-fields > .mass-field {
  margin: 0;
}

.dg-field .mass-icon {
  margin-top: 4px;
}

.dg-field .field-hint {
  margin-top: 2px;
}

.dg-switch {
  min-height: 48px;
}

.dg-field:has(.switch-input:checked) {
  border-color: var(--warn);
  background: var(--warn-soft);
}

.dg-field:has(.switch-input:checked) .mass-icon {
  background: var(--warn);
  color: var(--warn-ink);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  cursor: pointer;
}

.check-row input {
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--sign);
}

/* ------------------------------------------------------------------ preview step */
.preview-vehicle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 4px 0 6px;
}

.preview-vehicle-name {
  font: 700 17px/1.2 var(--font-cond);
  min-width: 0;
  overflow-wrap: anywhere;
}

.preview-vehicle-nets {
  font-size: 14px;
  color: var(--muted);
}

.chip-mass {
  gap: 5px;
  background: var(--sign-soft);
  color: var(--sign-text);
}

.chip-mass.is-missing {
  background: var(--warn-soft);
  color: var(--warn-text);
}

.chip-icon svg {
  width: 16px;
  height: 16px;
}

.chip-dg {
  background: var(--warn-soft);
  color: var(--warn-text);
}

/* Route options: one card per route (Fastest first), radio-group semantics. */
.route-opts-title {
  margin-top: 14px;
}

.route-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.route-opt {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  padding: 12px 14px 12px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}

.route-opt:hover {
  border-color: var(--border-strong);
}

.route-opt[aria-checked='true'] {
  border-color: var(--sign);
  background: var(--sign-soft);
  box-shadow: inset 0 0 0 1px var(--sign);
}

.route-opt:focus-visible {
  outline-offset: 3px;
}

/* Radio dot: an empty ring, filled guide-sign green when selected. */
.route-opt-dot {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
}

.route-opt[aria-checked='true'] .route-opt-dot {
  border-color: var(--sign);
  background: radial-gradient(circle, var(--sign) 0 5.5px, var(--surface) 6px);
}

.route-opt-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.route-opt-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 10px;
}

.route-opt-label {
  font: 700 14px/1.2 var(--font-cond);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-2);
}

.route-opt[aria-checked='true'] .route-opt-label {
  color: var(--sign-text);
}

.route-opt-figs {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.route-opt-time {
  font: 700 25px/1 var(--font-cond);
}

.route-opt-dist {
  font: 600 17px/1 var(--font-cond);
  color: var(--text-2);
}

.route-opt-delta {
  font-size: 13.5px;
  color: var(--muted);
}

.route-opt-via {
  font-size: 14.5px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-opt .route-opt-bar {
  height: 6px;
  margin: 3px 0 1px;
  border-radius: 3px;
  gap: 1px;
}

.route-opt-badge {
  display: flex;
  margin-top: 2px;
}

/* Restriction badges of an option (SPEC-RESTRICTIONS): the red "Uses a restricted road" headline,
   then one badge per dimension. */
.route-opt-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.rs-headline {
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* "Recommended — avoids restricted roads": guide-sign green with a tick. */
.route-opt-rec {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  max-width: 100%;
  padding: 2px 10px 2px 6px;
  border-radius: 999px;
  background: var(--sign);
  color: var(--sign-ink);
  font: 700 14.5px/1.25 var(--font-cond);
}

.route-opt-rec-icon svg {
  width: 16px;
  height: 16px;
}

.route-opt.is-recommended:not([aria-checked='true']) {
  border-color: var(--sign);
}

.avoid-slot:empty {
  display: none;
}

.callout-avoid {
  margin: 6px 0 10px;
}

.route-opts-hint {
  margin-top: 6px;
}

.route-opts-none {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 2px;
}

.route-opts-none .icon svg {
  width: 18px;
  height: 18px;
}

/* Search along approved roads (SPEC-NETWORK-ROUTING): a card and, under it, "Find a route that avoids
   this" on an option with a restriction; the search's status line above the options; the route it
   found marked on its card; the amber local-roads note. */
.route-opt-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.route-opt-actions {
  display: flex;
  padding-left: 34px;
}

.route-opt-find {
  gap: 6px;
  white-space: normal;
  text-align: left;
}

.route-opt-find .icon svg {
  width: 18px;
  height: 18px;
}

.callout-danger .route-opt-find {
  border-color: #fff;
  background: #fff;
  color: #9b0c23;
}

.callout-danger .route-opt-find:hover:not(:disabled) {
  background: #fde7ea;
}

.callout-actions {
  margin-top: 8px;
}

.callout-reason {
  font-weight: 600;
}

.green-status {
  outline-offset: 3px;
}

.green-status-line {
  margin: 4px 0 10px;
  line-height: 1.35;
}

.green-status-line .icon svg {
  width: 20px;
  height: 20px;
}

.green-status-line[data-tone='warn'] {
  color: var(--warn-text);
}

.route-opt-label-icon {
  display: inline-flex;
  vertical-align: -3px;
  margin-right: 4px;
}

.route-opt-label-icon svg {
  width: 17px;
  height: 17px;
}

.route-opt.is-network-guided .route-opt-label {
  color: var(--sign-text);
}

.local-badge {
  white-space: normal;
}

.callout-local .callout-icon svg {
  width: 26px;
  height: 26px;
}

.confirm-local {
  padding: 10px 12px;
  border-left: 5px solid var(--warn);
  border-radius: 8px;
  background: var(--warn-soft);
  color: var(--text);
}

.confirm-local .confirm-local-title {
  margin: 0 0 4px;
  font-weight: 700;
  color: var(--warn-text);
}

@media (forced-colors: active) {
  .route-opt-find,
  .confirm-local {
    border: 2px solid ButtonText;
  }
}

/* Bridge badge: red = over the limit / not permitted, amber = to check, neutral otherwise (never
   green: no published limit is not a guarantee). */
.bridge-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 10px 3px 7px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font: 600 14.5px/1.25 var(--font-cond);
}

.bridge-badge .icon svg {
  width: 17px;
  height: 17px;
}

.bridge-badge[data-tone='danger'] {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.bridge-badge[data-tone='warn'] {
  border-color: var(--warn);
  background: var(--warn-soft);
  color: var(--warn-text);
}

.bridge-badge[data-tone='muted'] {
  color: var(--muted);
}

.bridge-badge-spin {
  width: 15px;
  height: 15px;
}

.summary-label {
  margin: 0 0 4px;
  font: 700 14px/1.2 var(--font-cond);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--sign-text);
}

.summary {
  padding: 4px 0 6px;
}

.summary-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}

.summary-time {
  font: 700 36px/1 var(--font-cond);
  color: var(--sign-text);
}

.summary-dist {
  font: 600 24px/1 var(--font-cond);
  color: var(--text-2);
}

.summary-eta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0;
  color: var(--text-2);
}

.summary-eta .icon svg {
  width: 18px;
  height: 18px;
}

.summary-via {
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.summary-ends {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.summary-ends .icon svg {
  width: 16px;
  height: 16px;
}

.access-bar {
  display: flex;
  gap: 2px;
  height: 16px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-3);
}

.access-seg {
  flex-basis: 0;
  min-width: 3px;
  background: var(--c);
}

.access-seg.is-dashed {
  background: repeating-linear-gradient(90deg, var(--c) 0 8px, transparent 8px 12px), var(--surface-3);
}

.warn-list,
.hz-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.warn-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 56px;
  padding: 11px 12px 11px 14px;
  border: 1px solid var(--border);
  border-left: 7px solid var(--c);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

button.warn-item:hover {
  background: var(--surface-2);
}

.warn-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.warn-title {
  font: 700 18px/1.2 var(--font-cond);
}

.warn-restricted .warn-title,
.warn-noaccess .warn-title {
  color: var(--danger-text);
}

.warn-dist {
  font: 600 15px var(--font-cond);
  color: var(--text-2);
  white-space: nowrap;
}

.warn-road {
  font-weight: 600;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.warn-desc {
  font-size: 14.5px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.warn-conds {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
  color: var(--text-2);
}

.hz-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.hz-item:hover {
  background: var(--surface-2);
}

/* Australian warning sign: yellow diamond, black border. */
.hz-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: 5px;
  border: 2px solid #111;
  border-radius: 5px;
  background: var(--warn);
  color: #111;
  transform: rotate(45deg);
}

.hz-icon .icon {
  transform: rotate(-45deg);
}

.hz-icon svg {
  width: 17px;
  height: 17px;
}

.hz-title {
  display: block;
  font: 700 17px/1.2 var(--font-cond);
  overflow-wrap: anywhere;
}

.hz-meta {
  display: block;
  font-size: 14px;
  color: var(--text-2);
}

.hz-desc {
  display: block;
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.hz-badge {
  border-color: var(--c);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--c);
  text-transform: none;
  letter-spacing: 0;
}

.hz-item.hz-area {
  grid-template-columns: minmax(0, 1fr) auto;
  border-left: 5px solid var(--c);
}

.areas {
  margin-top: 12px;
}

.areas summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  font-weight: 700;
  color: var(--text-2);
  cursor: pointer;
}

.areas .hint {
  margin: 0 0 8px;
}

/* ------------------------------------------------------------------ bridge weight check */
.callout-bridge .callout-icon svg {
  width: 28px;
  height: 28px;
}

.callout-compact {
  margin: 4px 0 12px;
}

.callout-compact .btn {
  margin-top: 8px;
}

.br-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.br-item {
  --c: var(--border-strong);
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-left: 6px solid var(--c);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
}

button.br-item:hover {
  background: var(--surface-2);
}

.br-over {
  --c: var(--danger);
}

.br-check {
  --c: var(--warn);
}

.br-unknown {
  --c: var(--muted);
}

.br-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--surface-3);
  color: var(--text-2);
}

.br-icon svg {
  width: 22px;
  height: 22px;
}

.br-over .br-icon {
  background: var(--danger);
  color: #fff;
}

.br-check .br-icon {
  background: var(--warn);
  color: #111;
}

.br-main {
  min-width: 0;
}

.br-title {
  display: block;
  font: 700 17px/1.2 var(--font-cond);
  overflow-wrap: anywhere;
}

.br-reason {
  display: block;
  margin-top: 2px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-2);
}

.br-over .br-reason {
  color: var(--danger-text);
}

.br-check .br-reason {
  color: var(--warn-text);
}

.br-meta {
  display: block;
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--text-2);
}

.br-desc {
  display: block;
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.br-tag {
  border-color: var(--c);
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}

/* A structure with long conditions: the item, then its full conditions right below it. */
.br-item-wrap {
  display: flex;
  flex-direction: column;
}

.br-item-wrap > .br-item {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.br-details {
  padding: 0 12px 10px 18px;
  border: 1px solid var(--border);
  border-top: 0;
  border-left: 6px solid var(--border-strong);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface);
}

.br-over + .br-details {
  border-left-color: var(--danger);
}

.br-check + .br-details {
  border-left-color: var(--warn);
}

.br-details summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text-2);
  cursor: pointer;
}

.br-details .br-desc-full {
  margin: 0;
  font-size: 14px;
  color: var(--text-2);
  white-space: pre-line;
}

.br-more {
  margin-top: 10px;
}

.br-more summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  font-weight: 700;
  color: var(--text-2);
  cursor: pointer;
}

.bridges .state-text .icon svg {
  width: 20px;
  height: 20px;
}

/* ------------------------------------------------------------------ restriction check */
.callout-restriction .callout-icon svg,
.callout-avoid .callout-icon svg {
  width: 28px;
  height: 28px;
}

.restrictions .state-text .icon svg {
  width: 20px;
  height: 20px;
}

.rs-group {
  margin: 10px 0 4px;
}

.rs-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font: 700 16px/1.25 var(--font-cond);
  letter-spacing: 0.02em;
  color: var(--text);
}

.rs-group-icon svg {
  width: 20px;
  height: 20px;
}

.rs-group-sub {
  font-weight: 600;
  color: var(--text-2);
}

.rs-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface-3);
  font: 700 14px/1 var(--font-cond);
}

.rs-group:has(.rs-over) .rs-count {
  background: var(--danger);
  color: var(--danger-ink);
}

.rs-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.rs-note .state-text {
  margin: 0;
}

.rs-bridges .btn-link {
  margin-left: 6px;
}

.rs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rs-item {
  --c: var(--border-strong);
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-left: 6px solid var(--c);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
}

button.rs-item:hover {
  background: var(--surface-2);
}

.rs-over {
  --c: var(--danger);
}

.rs-check {
  --c: var(--warn);
}

.rs-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--surface-3);
  color: var(--text-2);
}

.rs-icon svg {
  width: 22px;
  height: 22px;
}

.rs-over .rs-icon {
  background: var(--danger);
  color: var(--danger-ink);
}

.rs-check .rs-icon {
  background: var(--warn);
  color: var(--warn-ink);
}

.rs-main {
  min-width: 0;
}

.rs-title {
  display: block;
  font: 700 17px/1.2 var(--font-cond);
  overflow-wrap: anywhere;
}

.rs-reason {
  display: block;
  margin-top: 2px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-2);
}

.rs-over .rs-reason {
  color: var(--danger-text);
}

.rs-check .rs-reason {
  color: var(--warn-text);
}

.rs-meta {
  display: block;
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--text-2);
}

.rs-desc {
  display: block;
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* A restriction with a long published rule: the item, then the full rule right below it. */
.rs-item-wrap {
  display: flex;
  flex-direction: column;
}

.rs-item-wrap > .rs-item {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.rs-details {
  padding: 0 12px 10px 18px;
  border: 1px solid var(--border);
  border-top: 0;
  border-left: 6px solid var(--border-strong);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface);
}

.rs-over + .rs-details {
  border-left-color: var(--danger);
}

.rs-check + .rs-details {
  border-left-color: var(--warn);
}

.rs-details summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text-2);
  cursor: pointer;
}

.rs-details .rs-desc-full {
  margin: 0;
  font-size: 14px;
  color: var(--text-2);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.rs-tag {
  border-color: var(--c);
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}

/* The GO confirmation's restriction list: one paragraph per restriction, the note last. */
.confirm-restrictions p {
  margin: 0 0 8px;
}

.confirm-restrictions .confirm-closing {
  font-weight: 600;
  color: var(--text);
}

.confirm-restrictions .confirm-note {
  margin-bottom: 0;
  font-size: 14px;
  color: var(--muted);
}

.progress-block .state-text {
  margin-bottom: 8px;
}

.progress {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--info);
  transition: width 0.4s var(--ease);
}

.progress-fill.is-indeterminate {
  animation: indeterminate 1.3s ease-in-out infinite;
}

@keyframes indeterminate {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(340%);
  }
}

.directions {
  margin-top: 18px;
  border-top: 1px solid var(--border);
}

.dir-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dir-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.dir-icon {
  color: var(--sign-text);
}

.dir-icon svg {
  width: 30px;
  height: 30px;
}

.dir-text {
  overflow-wrap: anywhere;
}

.dir-at {
  font: 600 14px var(--font-cond);
  color: var(--muted);
  white-space: nowrap;
}

.seg {
  display: inline-flex;
  flex: none;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface-3);
}

/* Selected option: a filled guide-sign green chip with a ring, >= 3:1 against the track in both
   themes (a white chip on a pale track, or a shadow on a dark one, was nearly invisible). */
.seg-radio:checked + .seg-opt-face {
  background: var(--sign);
  color: #fff;
  box-shadow: inset 0 0 0 2px var(--seg-on-ring);
}

@media (max-width: 420px) {
  .hide-xs {
    display: none;
  }

  /* Back is an icon-only button next to GO on narrow phones (still a 48 px target). */
  #actions-preview .btn-ghost {
    width: 48px;
    padding: 0;
  }

  /* Narrow phones: tighter gaps, but never a target below 44 px wide / 48 px tall. */
  .seg {
    gap: 0;
    padding: 2px;
  }

  .route-opt {
    gap: 10px;
    padding: 10px 12px 10px 10px;
  }

  .route-opt-time {
    font-size: 23px;
  }
}

/* ------------------------------------------------------------------ navigation HUD */
.hud {
  position: absolute;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  color: var(--hud-ink);
}

.hud > *,
.hud-top > * {
  pointer-events: auto;
}

.hud-top {
  position: absolute;
  top: calc(8px + var(--safe-t));
  left: calc(8px + var(--safe-l));
  right: calc(8px + var(--safe-r));
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none !important;
}

.sign {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 104px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--sign);
  color: #fff;
  box-shadow: inset 0 0 0 3px var(--sign), inset 0 0 0 5.5px rgba(255, 255, 255, 0.95), var(--shadow-2);
}

.sign-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  color: #fff;
}

.sign-icon svg {
  width: 66px;
  height: 66px;
}

.sign-body {
  min-width: 0;
}

.sign-dist {
  font: 700 46px/0.95 var(--font-cond);
  letter-spacing: -0.01em;
}

.sign-verb {
  margin-top: 2px;
  font: 600 19px/1.15 var(--font-cond);
  opacity: 0.95;
}

.sign-verb:empty {
  display: none;
}

.sign-road {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font: 700 27px/1.08 var(--font-cond);
  overflow-wrap: anywhere;
}

.sign-then {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.24);
  font: 700 14px/1 var(--font-cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.then-icon svg {
  width: 36px;
  height: 36px;
}

.sign.is-offroute {
  background: var(--warn);
  color: #111;
  box-shadow: inset 0 0 0 3px var(--warn), inset 0 0 0 5.5px #111, var(--shadow-2);
}

.sign.is-offroute .sign-icon {
  color: #111;
}

/* Not on the route yet (yard / depot start): neutral dark sign, the route is ahead. */
.sign.is-approach {
  background: #26302c;
  box-shadow: inset 0 0 0 3px #26302c, inset 0 0 0 5.5px rgba(255, 255, 255, 0.95), var(--shadow-2);
}

.sign.is-offroute .sign-dist,
.sign.is-approach .sign-dist {
  font-size: 38px;
}

.sign-warn-icon svg {
  width: 56px;
  height: 56px;
}

.sign:focus {
  outline: none;
}

.sign:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* Reroute in progress: a compact chip in the sign's top-right corner. The distance and manoeuvre
   underneath stay readable for the whole request. */
.sign-reroute {
  position: absolute;
  top: -10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font: 700 15px/1.1 var(--font-cond);
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-1);
}

.sign-reroute .spinner {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.ribbon {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--hud-bg);
  color: var(--hud-ink);
  box-shadow: var(--shadow-1);
  font: 700 17px/1.15 var(--font-cond);
  overflow: hidden;
}

.ribbon-swatch {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: #16a34a;
}

.ribbon-label {
  flex: none;
  white-space: nowrap;
}

.ribbon-desc {
  flex: 1;
  min-width: 0;
  font: 500 14.5px/1.2 var(--font);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.92;
}

.ribbon[data-access='conditions'] {
  background: var(--warn);
  color: #111;
}

.ribbon[data-access='conditions'] .ribbon-swatch {
  background: #111;
}

.ribbon[data-access='offnetwork'] {
  background: #1d4ed8;
  color: #fff;
}

.ribbon[data-access='offnetwork'] .ribbon-swatch {
  background: repeating-linear-gradient(90deg, #fff 0 4px, transparent 4px 6px);
}

.ribbon[data-access='restricted'] {
  background: var(--danger);
  color: #fff;
}

.ribbon[data-access='noaccess'] {
  background: #7f1d1d;
  color: #fff;
  box-shadow: inset 0 0 0 2px #fff, var(--shadow-1);
}

.ribbon[data-access='restricted'] .ribbon-swatch,
.ribbon[data-access='noaccess'] .ribbon-swatch {
  background: #fff;
}

/* Access not known (off route, not joined yet, waiting for GPS): neutral, never "Approved" green. */
.ribbon[data-access='unknown'] {
  background: #3b4441;
  color: #fff;
}

.ribbon[data-access='unknown'] .ribbon-swatch {
  background: repeating-linear-gradient(45deg, #fff 0 3px, transparent 3px 6px);
  box-shadow: inset 0 0 0 1.5px #fff;
}

.hud-hazard {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 2px solid #111;
  border-radius: 10px;
  background: var(--warn);
  color: #111;
  font: 700 18px/1.15 var(--font-cond);
  box-shadow: var(--shadow-1);
}

.hud-hazard[data-access='restricted'],
.hud-hazard[data-access='noaccess'] {
  background: var(--danger);
  color: #fff;
  border-color: #fff;
}

/* A bridge over the vehicle's published limit — or a restriction 'over' finding (restricted road or
   tunnel, low clearance, dangerous-goods ban) — gets a double white rule, like a regulatory sign. */
.hud-hazard[data-kind='bridge'][data-access='restricted'],
.hud-hazard[data-kind='restriction'][data-access='restricted'] {
  box-shadow: inset 0 0 0 2px var(--danger), inset 0 0 0 4px #fff, var(--shadow-1);
}

.hud-hazard-icon svg {
  width: 26px;
  height: 26px;
}

.hud-hazard-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-hazard-dist {
  font-size: 22px;
  white-space: nowrap;
}

.hud-alerts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hud-alerts:empty {
  display: none;
}

.hud-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--hud-bg);
  color: var(--hud-ink);
  box-shadow: var(--shadow-1);
  font: 600 16px/1.3 var(--font);
  animation: drop-in 0.2s var(--ease);
}

.hud-alert-warn {
  background: var(--warn);
  color: #111;
}

.hud-alert-danger {
  background: var(--danger);
  color: #fff;
}

.hud-alert-icon svg {
  width: 20px;
  height: 20px;
}

/* Bottom HUD parts sit above the trip bar plus a 28 px strip for the map's logo / attribution
   (--hud-bottom-h = measured trip bar height, set by app.js). */
.hud-side {
  position: absolute;
  right: calc(10px + var(--safe-r));
  bottom: calc(var(--hud-bottom-h, calc(76px + var(--safe-b))) + 28px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.hud-btn {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: var(--hud-bg);
  color: var(--hud-ink);
  box-shadow: var(--shadow-2);
}

.hud-btn svg {
  width: 27px;
  height: 27px;
}

.hud-btn.is-off {
  color: var(--danger);
}

.hud-btn-recenter {
  width: auto;
  display: flex;
  gap: 8px;
  padding: 0 20px 0 16px;
  border-radius: 29px;
  background: var(--sign);
  color: #fff;
  font: 700 18px var(--font-cond);
}

.hud-speed {
  position: absolute;
  left: calc(10px + var(--safe-l));
  bottom: calc(var(--hud-bottom-h, calc(76px + var(--safe-b))) + 28px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: var(--hud-bg);
  color: var(--hud-ink);
  box-shadow: var(--shadow-2);
}

.speed-val {
  font: 700 32px/1 var(--font-cond);
}

.speed-unit {
  font: 700 12px/1 var(--font-cond);
  letter-spacing: 0.06em;
  opacity: 0.75;
}

.hud-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px calc(12px + var(--safe-r)) calc(10px + var(--safe-b)) calc(12px + var(--safe-l));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--hud-bg);
  color: var(--hud-ink);
  box-shadow: 0 -4px 22px rgba(0, 0, 0, 0.22);
}

.trip {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: space-around;
  gap: 6px;
}

.trip-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.trip-cell b {
  font: 700 27px/1.05 var(--font-cond);
  white-space: nowrap;
}

.trip-cell span {
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  opacity: 0.75;
}

.trip-eta {
  color: var(--sign-text);
}

.btn-end {
  flex: none;
  min-height: 56px;
  padding: 0 16px;
  border-radius: 14px;
  background: var(--danger);
  color: #fff;
  font: 700 19px/1 var(--font-cond);
  letter-spacing: 0.04em;
}

.hud-card {
  position: absolute;
  z-index: 2;
  left: calc(12px + var(--safe-l));
  right: calc(12px + var(--safe-r));
  bottom: calc(var(--hud-bottom-h, calc(76px + var(--safe-b))) + 28px);
  max-width: 460px;
  margin: 0 auto;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-2);
  animation: drop-in 0.2s var(--ease);
}

.arrival-flag {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--sign);
  color: #fff;
  box-shadow: inset 0 0 0 2px var(--sign), inset 0 0 0 4px #fff;
}

.arrival-flag svg {
  width: 30px;
  height: 30px;
}

.card-title {
  margin: 10px 0 4px;
  font: 700 27px/1.1 var(--font-cond);
  outline: none;
}

.card-text {
  margin: 0 0 6px;
  font-size: 17px;
}

.card-stats {
  margin: 0 0 14px;
  color: var(--text-2);
}

.card-icon {
  color: var(--danger);
}

.card-icon svg {
  width: 32px;
  height: 32px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.hud.has-card .hud-side,
.hud.has-card .hud-speed {
  display: none;
}

/* ------------------------------------------------------------------ dialogs */
.dialog {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-2);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.dialog-fallback {
  position: fixed;
  inset: 0;
  z-index: 200;
  height: fit-content;
  margin: auto;
}

body.has-fallback-dialog::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(0, 0, 0, 0.55);
}

.dialog-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 10px 6px 20px;
  background: var(--surface);
}

.dialog-title {
  margin: 0;
  font: 700 24px/1.15 var(--font-cond);
}

/* Headings receive focus only programmatically (to announce a new dialog state): no focus ring. */
.dialog-title[tabindex='-1']:focus,
.forgot-title[tabindex='-1']:focus {
  outline: none;
}

.dialog-body {
  padding: 14px 20px 16px;
}

.dialog-head + .dialog-body {
  padding-top: 0;
}

.dialog-text {
  margin: 8px 0 0;
  color: var(--text-2);
  font-size: 16px;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 4px 20px 20px;
}

.dialog-actions .btn {
  flex: 1 1 auto;
}

.dialog-confirm[data-tone='warn'] .dialog-title::before,
.dialog-confirm[data-tone='danger'] .dialog-title::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 10px;
  border: 2px solid #111;
  border-radius: 3px;
  background: var(--warn);
  transform: rotate(45deg) translateY(-2px);
}

.dialog-confirm[data-tone='danger'] .dialog-title::before {
  background: var(--danger);
  border-color: #fff;
  box-shadow: 0 0 0 1.5px var(--danger);
}

.settings-body .field {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.settings-body .field:first-child,
.seg-field {
  border-top: 0;
}

.field-label {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  font: 700 14px/1.2 var(--font-cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.field-text {
  margin: 0 0 6px;
}

.seg-field {
  margin: 0;
  padding: 4px 0 14px;
  border: 0;
  min-width: 0;
}

.seg-radios {
  display: flex;
  width: 100%;
}

.seg-opt {
  position: relative;
  flex: 1;
}

.seg-radio {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.seg-opt-face {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 10px;
  border-radius: 9px;
  font-weight: 600;
  color: var(--text-2);
  pointer-events: none;
}

.seg-opt-face .icon svg {
  width: 18px;
  height: 18px;
}

.seg-radio:focus-visible + .seg-opt-face {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

.disclaimer-text {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--text-2);
}

.settings-about-link {
  margin: 12px 0 0;
}

/* About & help, Privacy Policy, Terms of Service: wraps between the links, never inside one, and
   each link is a comfortable tap target (the Android app has no address bar to fall back on). */
.settings-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 20px;
}

.settings-legal .link-ext {
  min-height: 36px;
}

/* ------------------------------------------------------------------ forms (account dialog) */
.acc-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-weight: 700;
  font-size: 15.5px;
}

.form-optional {
  font-weight: 500;
  color: var(--muted);
}

.field-hint {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}

.field-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--danger-text);
}

.field-error::before {
  content: '!';
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--danger);
  color: var(--danger-ink);
  font: 800 13px/1 var(--font);
}

.input[aria-invalid='true'] {
  border-color: var(--danger);
}

.input[aria-invalid='true']:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.25);
}

.pw-wrap {
  position: relative;
}

.pw-wrap .input {
  padding-right: 56px;
}

/* Show/hide password: a 52 px square inside the field's right edge. */
.pw-toggle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 52px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: transparent;
  color: var(--muted);
}

.pw-toggle:hover {
  color: var(--text);
}

.pw-toggle[aria-pressed='true'] {
  color: var(--sign-text);
}

.pw-toggle:focus-visible {
  outline-offset: -5px;
}

.form-error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 10px 12px;
  border-left: 5px solid var(--danger);
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger-text);
  font-weight: 600;
  line-height: 1.35;
}

.form-error-icon svg {
  width: 20px;
  height: 20px;
}

.form-error-text {
  flex: 1 1 180px;
  min-width: 0;
}

.form-error-action {
  color: inherit;
}

/* ------------------------------------------------------------------ account dialog */
.dialog-account {
  width: min(480px, calc(100vw - 24px));
}

.account-body {
  padding-bottom: 22px;
}

.acc-intro {
  margin: 0 0 14px;
  font-size: 15px;
  color: var(--text-2);
}

.acc-banner {
  margin: 0 0 14px;
}

.acc-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-3);
}

.acc-tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font: 700 17px/1.1 var(--font);
}

.acc-tab[aria-selected='true'] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-1), inset 0 -3px 0 var(--sign);
}

.acc-tab:focus-visible {
  outline-offset: -3px;
}

.acc-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: -4px 0 0;
  font-size: 15px;
  color: var(--text-2);
}

.acc-switch .btn-link {
  padding: 0 4px;
}

.acc-form .hint {
  margin: 0;
}

.acc-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
}

.acc-who {
  flex: 1;
  min-width: 0;
}

.acc-name {
  margin: 0;
  font: 700 21px/1.2 var(--font-cond);
  overflow-wrap: anywhere;
}

.acc-email {
  margin: 2px 0 0;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.acc-plan {
  padding: 12px 14px;
  border-left: 6px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.acc-plan.is-ok {
  border-left-color: var(--sign);
}

.acc-plan.is-warn {
  border-left-color: var(--warn);
}

.acc-plan .field-label {
  margin-bottom: 4px;
}

.acc-plan-name {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font: 700 21px/1.2 var(--font-cond);
}

.acc-plan-icon {
  color: var(--sign-text);
}

.acc-plan-icon svg {
  width: 20px;
  height: 20px;
}

.acc-plan-detail {
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--text-2);
}

.acc-plan.is-warn .acc-plan-detail {
  color: var(--warn-text);
  font-weight: 600;
}

.acc-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.acc-pitch {
  margin: 0;
  font-size: 15px;
  color: var(--text-2);
}

.acc-more {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* "Delete your account": the privacy policy's steps (a link, not an action: nothing is deleted here) */
.acc-delete {
  margin: 0;
  text-align: center;
}

.acc-delete .link-ext {
  min-height: 36px;
  font-size: 15px;
}

.acc-pw-form {
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.acc-row-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.acc-row-btns .btn {
  flex: 1 1 auto;
}

/* "Forgot your password?" (login tab) and the reset-link form (login tab + reset dialog) */
.acc-forgot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: -6px 0 -4px;
}

.acc-forgot-link {
  padding-left: 0;
}

.acc-forgot-note {
  margin: 0;
}

.forgot {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.forgot-title {
  margin: 0;
  font: 700 21px/1.2 var(--font-cond);
}

.forgot-intro {
  margin: 0;
  font-size: 15px;
  color: var(--text-2);
}

.forgot-unavailable {
  margin: 0;
}

.forgot-sent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-left: 6px solid var(--ok);
  border-radius: var(--radius);
  background: var(--ok-soft);
  color: var(--text);
  line-height: 1.4;
}

.forgot-sent-icon {
  flex: none;
  color: var(--ok-text);
}

.forgot-sent-icon svg {
  width: 26px;
  height: 26px;
}

.forgot-sent-body {
  flex: 1;
  min-width: 0;
}

.forgot-sent-body p {
  margin: 0 0 6px;
}

.forgot-sent-text {
  font-weight: 700;
  font-size: 16px;
}

.forgot-sent-to {
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.forgot-sent .hint {
  margin: 0;
}

.forgot-sent .btn-link {
  padding-left: 0;
}

.forgot-back {
  align-self: flex-start;
  gap: 4px;
  padding-left: 0;
}

.forgot-back svg {
  width: 18px;
  height: 18px;
}

/* Email verified ✓ / Not verified · Resend (logged-in account sheet) */
.acc-verify {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 700;
}

.acc-verify.is-ok {
  color: var(--ok-text);
}

.acc-verify.is-warn {
  color: var(--warn-text);
}

.acc-verify-dot {
  flex: none;
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--warn-text);
}

.acc-verify-sep {
  white-space: pre;
}

.acc-verify-hint,
.acc-verify-msg {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
}

/* A resend that is running or resting keeps focus (aria-disabled), but looks inactive. */
.acc-resend[aria-disabled='true'] {
  color: var(--muted);
  text-decoration: none;
  cursor: default;
}

/* "Confirm your email to subscribe — Resend link" (account sheet + paywall subscribe path) */
.verify-banner {
  position: relative;
  align-items: flex-start;
  margin: 0;
  padding-right: 52px;
}

.verify-banner .callout-icon {
  flex: none;
  margin-top: 2px;
}

.verify-banner .callout-icon svg {
  width: 24px;
  height: 24px;
}

.verify-banner-body {
  flex: 1;
  min-width: 0;
}

.verify-banner .verify-banner-text {
  margin: 0;
  line-height: 1.35;
}

/* Inline "Resend" links sit in running text: a compact line box, with the 44 px touch target kept
   by an invisible extension of the hit area. */
.verify-banner-text .btn-link,
.acc-verify .btn-link {
  position: relative;
  min-height: 30px;
  padding: 0 2px;
  vertical-align: baseline;
}

.verify-banner-text .btn-link::after,
.acc-verify .btn-link::after {
  content: '';
  position: absolute;
  inset: -7px -4px;
}
.verify-banner .verify-banner-msg {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-2);
}

.acc-verify-msg.is-ok,
.verify-banner-msg.is-ok {
  color: var(--ok-text);
}

.acc-verify-msg.is-warn,
.verify-banner-msg.is-warn {
  color: var(--warn-text);
}

.acc-verify-msg.is-error,
.verify-banner-msg.is-error {
  color: var(--danger-text);
}

.verify-banner-close {
  position: absolute;
  top: 2px;
  right: 2px;
}

.paywall-verify {
  margin-top: 18px;
}

/* ------------------------------------------------------------------ Sign in with Google */
/* Google's own button (public/js/google-signin.js) above the log-in / sign-up forms and on the
   account-required screen, with an "or" rule before the email form. */
.acc-google {
  margin: 4px 0 14px;
}

.acc-google-btn,
.wall-google {
  display: flex;
  justify-content: center;
  min-height: 44px;
}

.acc-google.is-busy .acc-google-btn {
  opacity: 0.5;
  pointer-events: none;
}

.acc-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.acc-or::before,
.acc-or::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

.acc-pw-none {
  margin: 0;
}

.wall-google {
  margin-top: 18px;
}

.wall-google + .wall-actions {
  margin-top: 10px;
}

/* ------------------------------------------------------------------ account-required screen */
/* Once the free days are used up (register-prompt.js): can't be closed; the account dialog opens on top. */
.dialog-wall {
  width: min(460px, calc(100vw - 24px));
  border-top: 8px solid var(--sign);
}

.dialog-wall .dialog-title:focus {
  outline: none;
}

/* Browsers without showModal(): the screen sits under the account dialog it opens (200), above the
   backdrop (199, painted before it). */
.dialog-wall.dialog-fallback {
  z-index: 199;
}

.wall-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.wall-links {
  margin: 16px 0 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}

/* ------------------------------------------------------------------ reset-password dialog */
.dialog-reset {
  width: min(460px, calc(100vw - 24px));
  border-top: 8px solid var(--sign);
}

.reset-body {
  padding-bottom: 22px;
}

.reset-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reset-intro {
  margin: 0;
  font-size: 15px;
  color: var(--text-2);
}

.reset-problem-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.reset-problem-text {
  margin: 6px 0 0;
  font-size: 16px;
  color: var(--text-2);
}

.reset-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Settings: plan + account */
.settings-plan {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.settings-plan-icon {
  color: var(--sign-text);
}

.settings-plan-icon svg {
  width: 18px;
  height: 18px;
}

.settings-plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* A Google limit that only moved address search (the Google map still shows): under its own label. */
.settings-search-limit {
  margin-top: 16px;
}

.settings-account {
  max-width: 100%;
}

.settings-account span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------------------------------------------ subscribe screen (paywall dialog) */
.dialog-paywall {
  width: min(460px, calc(100vw - 24px));
  border-top: 8px solid var(--sign);
}

/* Australian warning sign: yellow diamond, black border. */
.warn-diamond {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  margin: 6px;
  border-radius: 6px;
  background: var(--warn);
  color: var(--warn-ink);
  box-shadow: inset 0 0 0 2px var(--warn), inset 0 0 0 4px #111;
  transform: rotate(45deg);
}

/* The symbol stays upright inside the diamond. */
.warn-diamond .icon {
  transform: rotate(-45deg);
}

.warn-diamond svg {
  width: 22px;
  height: 22px;
}

/* Guide-sign green square with a white star (Pro). */
.paywall-sign {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--sign);
  color: var(--sign-ink);
  box-shadow: inset 0 0 0 2px var(--sign), inset 0 0 0 3.5px rgba(255, 255, 255, 0.9);
}

.paywall-sign svg {
  width: 22px;
  height: 22px;
}

.paywall-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 10px 0 18px;
}

.paywall-brand {
  flex: 1;
  margin: 0;
  font: 700 14px/1.2 var(--font-cond);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
}

.paywall-body {
  padding-top: 10px;
  padding-bottom: 20px;
}

.paywall-title {
  font-size: 27px;
}

.paywall-text {
  margin: 8px 0 0;
  font-size: 17px;
}

/* The limit the user ran into (when the screen was opened from the warning banner). */
.paywall-context {
  margin: 12px 0 0;
  font-size: 15px;
  font-weight: 600;
}

.paywall-context .callout-icon svg {
  width: 22px;
  height: 22px;
}

.paywall-note {
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--warn-text);
  font-weight: 600;
}

.paywall-perks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.paywall-perks li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 15px;
  color: var(--text-2);
}

.paywall-perks .icon {
  margin-top: 1px;
  color: var(--sign-text);
}

.paywall-perks svg {
  width: 20px;
  height: 20px;
}

.paywall-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.paywall-actions .btn {
  white-space: normal;
  text-align: center;
}

/* The one fair-use line (the only usage figure users see). */
.paywall-fine {
  margin: 14px 0 0;
  font-size: 13.5px;
  color: var(--muted);
  text-align: center;
}

/* ------------------------------------------------------------------ boot screen */
.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  transition: opacity 0.25s;
}

.boot.is-done {
  opacity: 0;
  pointer-events: none;
}

.boot-card {
  max-width: 440px;
  text-align: center;
}

.boot-sign {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 36px 18px;
  border-radius: 14px;
  background: var(--sign);
  color: #fff;
  box-shadow: inset 0 0 0 4px var(--sign), inset 0 0 0 7px #fff, var(--shadow-2);
}

.boot-sign-top {
  font: 700 52px/1 var(--font-cond);
  letter-spacing: 0.04em;
}

.boot-sign-name {
  font: 600 20px/1 var(--font-cond);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-right: -0.3em;
}

.boot-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 22px 0 0;
  color: var(--text-2);
}

.boot-slow {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.boot-error {
  display: none;
  margin-top: 20px;
}

.boot.is-error .boot-error {
  display: block;
}

.boot.is-error .boot-status,
.boot.is-error .boot-slow {
  display: none;
}

.boot-error-title {
  margin: 0 0 6px;
  font: 700 22px var(--font-cond);
}

.boot-msg {
  margin: 0 0 16px;
  color: var(--text-2);
}

.boot-about {
  margin: 14px 0 0;
  font-size: 15px;
}

/* Without JavaScript: what the site is, and the way to the About page. */
.boot-noscript h2 {
  margin: 22px 0 8px;
  font: 700 26px/1.15 var(--font-cond);
}

.boot-noscript p {
  margin: 0 0 12px;
  color: var(--text-2);
}

.boot-noscript a {
  font-weight: 600;
}

/* ------------------------------------------------------------------ wide screens: left panel */
@media (min-width: 900px) {
  :root {
    --panel-w: min(420px, 42vw);
  }

  .topbar {
    top: 12px;
    left: 12px;
    right: auto;
    width: var(--panel-w);
    height: 60px;
    padding: 0 6px 0 14px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--sign);
    color: #fff;
    box-shadow: var(--shadow-2);
    pointer-events: auto;
  }

  .brand {
    height: auto;
    padding: 0;
    background: none;
    box-shadow: none;
  }

  .brand-name {
    font-size: 23px;
  }

  .topbar-btn {
    background: transparent;
    color: #fff;
    box-shadow: none;
  }

  .topbar-btn:hover {
    background: rgba(255, 255, 255, 0.14);
  }

  /* On the green panel header the initial is a white disc with a green letter. */
  .topbar-btn .avatar {
    background: #fff;
    color: var(--sign);
    box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3.5px var(--sign);
  }

  .topbar :focus-visible {
    outline-color: #ffd34d;
  }

  /* bottom: 40px keeps the map's bottom-left corner (Google logo) clear of the panel. */
  .sheet {
    top: 72px;
    left: 12px;
    bottom: 40px;
    right: auto;
    width: var(--panel-w);
    height: auto;
    max-height: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-2);
    transition: none;
  }

  .sheet-grab {
    touch-action: auto;
    padding-top: 6px;
  }

  .sheet-handle {
    display: none;
  }

  .overlay-top {
    top: 16px;
  }

  .hud-top {
    top: 16px;
    left: 16px;
    right: auto;
    width: min(470px, calc(100vw - 140px));
  }

  /* The trip bar floats 40 px up so the map's logo stays visible below it. */
  .hud-bottom {
    left: 16px;
    right: auto;
    bottom: 40px;
    width: min(470px, calc(100vw - 140px));
    padding: 10px 12px;
    border-radius: var(--radius-lg);
  }

  .hud-speed {
    left: 16px;
    bottom: 136px;
  }

  .hud-side {
    right: 16px;
    bottom: 32px;
  }

  .hud-card {
    left: 16px;
    right: auto;
    width: min(460px, calc(100vw - 140px));
    margin: 0;
    bottom: 136px;
  }
}

/* Short landscape phones: keep the map visible between the HUD parts. */
@media (max-height: 520px) and (orientation: landscape) and (max-width: 899px) {
  /* The open sheet leaves almost no map below the header here, so the Google limit banner (which
     can be dismissed) shows over the sheet's top instead of hiding behind it — still under the
     header. Not while navigating: the banner is hidden then, and the notices that stay (offline,
     map failed) keep their usual layer under the HUD. */
  .app:not([data-step='navigate']) .notices:has(.notice-limit) {
    z-index: 21;
  }

  .hud-top {
    right: auto;
    width: min(52vw, 440px);
  }

  .sign {
    min-height: 84px;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    padding: 8px 12px;
  }

  .sign-icon,
  .sign-icon svg {
    width: 54px;
    height: 54px;
  }

  .sign-dist {
    font-size: 36px;
  }

  .sign-road {
    font-size: 22px;
    -webkit-line-clamp: 1;
  }

  /* The trip bar stays full width: the map is inset by its height (logo / Terms above it). */
  .hud-speed {
    bottom: calc(var(--hud-bottom-h, calc(64px + var(--safe-b))) + 28px);
    width: 64px;
    height: 64px;
  }

  .speed-val {
    font-size: 26px;
  }

  .hud-side {
    flex-direction: row;
    align-items: flex-end;
    bottom: calc(var(--hud-bottom-h, calc(64px + var(--safe-b))) + 28px);
  }
}

/* Short phone screens (under 420 px tall, any orientation): the expanded sheet reaches up to the
   header, so the resume offer ("Resume navigation to …?" and its progress / retry notices) shows
   over the sheet's top instead of hiding behind it — still under the header. Not while navigating
   (the resume notice is gone by then). */
@media (max-height: 419.98px) and (max-width: 899px) {
  .app:not([data-step='navigate']) .notices:has(.notice-resume) {
    z-index: 21;
  }
}

/* Very narrow phones (360 px and below) */
@media (max-width: 380px) {
  .sign {
    grid-template-columns: 60px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 12px;
  }

  .sign-icon,
  .sign-icon svg {
    width: 58px;
    height: 58px;
  }

  .sign-dist {
    font-size: 40px;
  }

  .sign-road {
    font-size: 24px;
  }

  .trip-cell b {
    font-size: 23px;
  }

  .btn-end {
    padding: 0 12px;
  }

  .btn-end .icon {
    display: none;
  }

  .stepper-btn {
    gap: 4px;
    font-size: 14px;
  }

  .stepper-num {
    width: 22px;
    height: 22px;
  }

  .brand-name {
    font-size: 19px;
  }
}

/* ------------------------------------------------------------------ motion + contrast preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .spinner {
    animation: spin 1.6s linear infinite !important;
    animation-iteration-count: infinite !important;
    animation-duration: 1.6s !important;
  }
}

@media (forced-colors: active) {
  .sign,
  .btn-go,
  .brand,
  .callout-danger {
    border: 3px solid CanvasText;
  }

  .switch-track {
    border: 2px solid CanvasText;
  }

  .notice-action.is-primary {
    border: 2px solid ButtonText;
  }

  .acc-tab[aria-selected='true'] {
    border: 2px solid Highlight;
  }

  .avatar {
    border: 2px solid CanvasText;
  }
}
