/*
 * Truck Route Planner - shared design tokens and components.
 *
 * Quiet neutral surfaces with a single blue accent, so the data - routes,
 * times and costs - is what stands out. Every colour lives in the tokens
 * below; components only ever reference tokens.
 *
 * created by Gabor Gasko
 */

:root {
  /* Brand blues: the header, the splash and the primary actions. */
  --brand-900: #0b1e45;
  --brand-800: #10306f;
  --brand-700: #164393;
  --brand-600: #1f5fd0;
  --brand-500: #3b7ae6;
  --grad-header: linear-gradient(100deg, #0f2a62 0%, #164393 55%, #1f5fd0 100%);

  /* Surfaces and lines: cool, slightly blue-tinted neutrals. */
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f8;
  --line: #dfe6ef;
  --line-strong: #c9d4e3;

  /* Text */
  --ink: #0f1f3a;
  --ink-soft: #33465f;
  --muted: #61738c;
  --muted-2: #93a3b8;

  /* Accent (royal blue) and its tints */
  --accent: #1f5fd0;
  --accent-hover: #174dae;
  --accent-soft: #e8f0fd;
  --accent-line: #b5cdf5;
  --on-accent: #ffffff;

  /* Secondary hues used for the stat tiles and highlights */
  --teal: #0e9f8e;    --teal-bg: #e6f7f4;   --teal-line: #a8e3da;
  --violet: #6b5bd6;  --violet-bg: #efedfb; --violet-line: #cdc7f2;

  /* Status: text / tinted background / border */
  --ok: #0f8a5f;       --ok-bg: #e9f8f1;     --ok-line: #a9e4c8;
  --warn: #b86e00;     --warn-bg: #fff6e5;   --warn-line: #fbd98a;
  --danger: #c73a3a;   --danger-bg: #fdefef; --danger-line: #f6c2c2;

  /* Solid marker colours (white text on top). */
  --ok-solid: #16a36b;
  --danger-solid: #e5484d;
  --warn-solid: #f2a615;

  /* Aliases kept for older rules and the light-only map popups. */
  --blue-900: var(--brand-900);
  --blue-800: var(--brand-800);
  --blue-700: var(--brand-700);
  --blue-600: var(--accent);
  --blue-500: var(--brand-500);
  --blue-100: var(--accent-soft);
  --blue-050: #f4f8fe;
  --yellow-600: #b86e00;
  --yellow-500: #d98c0a;
  --yellow-400: #f2a615;
  --yellow-200: #fbd98a;
  --yellow-100: #fff6e5;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 4px 8px -2px rgba(16, 24, 40, .08), 0 2px 4px -2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 16px -4px rgba(16, 24, 40, .10), 0 4px 6px -2px rgba(16, 24, 40, .04);
  --focus: 0 0 0 4px rgba(31, 95, 208, .20);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --header-h: 56px;
  color-scheme: light;
}

[data-theme="dark"] {
  --grad-header: linear-gradient(100deg, #0a1a3d 0%, #10306f 55%, #164393 100%);
  --bg: #0b1220;
  --surface: #111a2e;
  --surface-2: #152039;
  --surface-3: #1b2842;
  --line: #24334f;
  --line-strong: #324565;
  --ink: #eef3fb;
  --ink-soft: #c6d2e6;
  --muted: #8a9bb8;
  --muted-2: #62748f;
  --accent: #5b8ff0;
  --accent-hover: #7aa6ff;
  --accent-soft: rgba(91, 143, 240, .16);
  --accent-line: rgba(91, 143, 240, .42);
  --teal: #3ec9b6;   --teal-bg: rgba(62, 201, 182, .14);   --teal-line: rgba(62, 201, 182, .40);
  --violet: #a094f0; --violet-bg: rgba(160, 148, 240, .14); --violet-line: rgba(160, 148, 240, .40);
  --ok: #4ade80;     --ok-bg: rgba(74, 222, 128, .12);     --ok-line: rgba(74, 222, 128, .35);
  --warn: #fbbf24;   --warn-bg: rgba(251, 191, 36, .12);   --warn-line: rgba(251, 191, 36, .35);
  --danger: #f87171; --danger-bg: rgba(248, 113, 113, .12); --danger-line: rgba(248, 113, 113, .35);
  --blue-050: rgba(91, 143, 240, .08);
  --yellow-100: rgba(251, 191, 36, .12);
  --yellow-200: rgba(251, 191, 36, .35);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .40);
  --shadow: 0 1px 3px rgba(0, 0, 0, .50), 0 1px 2px rgba(0, 0, 0, .30);
  --shadow-md: 0 4px 10px -2px rgba(0, 0, 0, .50);
  --shadow-lg: 0 14px 24px -6px rgba(0, 0, 0, .60);
  --focus: 0 0 0 4px rgba(91, 143, 240, .30);
  color-scheme: dark;
}

/* ----------------------------------------------------------------- base */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.unit { font-size: .55em; font-weight: 500; color: var(--muted); letter-spacing: .02em; }
.flag { font-size: 1.05em; }

/* Inline SVG icons (see js/core/icons.js and the static copies in HTML). */
.icon { display: inline-block; flex: none; vertical-align: middle; }

:focus-visible { outline: none; box-shadow: var(--focus); }

/* ------------------------------------------------------------ app header */

.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: var(--header-h);
  background: var(--grad-header);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 2px 12px rgba(11, 30, 69, .25);
  position: relative;
  z-index: 30;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand > div { min-width: 0; }

/* White tile with the blue truck: reads as a logo against the blue bar. */
.brand__mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: #fff;
  color: var(--brand-700);
  display: grid; place-items: center;
  flex: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}
.brand__mark svg { width: 19px; height: 19px; }

.brand__title { font-size: 15px; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.brand__tagline {
  font-size: 12px; color: rgba(255, 255, 255, .72);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.header-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .14); color: #fff;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.chip--sm { height: 20px; padding: 0 7px; font-size: 11px; background: var(--surface-3); color: var(--ink-soft); }

/* Shared look for the small header controls: translucent on the blue bar. */
.icon-btn, .link-btn, .lang-select {
  height: 34px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.icon-btn:hover, .link-btn:hover, .lang-select:hover {
  background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .45); color: #fff;
}

.icon-btn { width: 34px; padding: 0; display: grid; place-items: center; }
.icon-btn svg { width: 17px; height: 17px; }

.link-btn { display: inline-flex; align-items: center; padding: 0 12px; text-decoration: none; white-space: nowrap; }

.lang-select { padding: 0 8px; width: auto; }
.lang-select option { color: var(--ink); background: var(--surface); }

/* ------------------------------------------------- author credit / link */

/*
 * The author credit is a link to the author's profile, styled as a quiet
 * pill in the app's own palette. On the blue header it turns translucent
 * white; on light surfaces it is a tinted blue chip.
 */
.author-link {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 13px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--brand-700);
  font-size: 12.5px; font-weight: 500;
  text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.author-link:hover { background: var(--accent-line); color: var(--brand-800); }
.author-link:focus-visible { outline: none; box-shadow: var(--focus); }
/* A small "opens elsewhere" arrow, so the pill reads as a link. */
.author-link::after { content: "\2197"; font-size: 11px; opacity: .7; margin-left: 1px; }

.author-link__label { opacity: .85; }
.author-link__name { font-weight: 600; }

.app-header .author-link {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .32);
  color: #fff;
}
.app-header .author-link:hover { background: rgba(255, 255, 255, .24); border-color: rgba(255, 255, 255, .5); color: #fff; }

/* Larger variant for the splash, the mobile Info tab and the guide hero. */
.author-link--lg { height: 40px; padding: 0 17px; font-size: 14px; gap: 8px; }

/* ----------------------------------------------------------- app footer */

.app-footer {
  padding: 12px 20px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  border-top: 1px solid var(--line);
}
.app-footer strong { color: var(--ink-soft); font-weight: 600; }
.app-footer .spacer { margin-left: auto; }

/* --------------------------------------------------------------- inputs */

.field { margin-bottom: 14px; position: relative; }
.field > label {
  display: block; font-size: 12.5px; font-weight: 500;
  color: var(--ink-soft); margin-bottom: 6px;
}

input[type="text"], input[type="number"], input[type="datetime-local"], select, textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 12px; }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:hover, select:hover, textarea:hover { border-color: var(--muted-2); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus);
}
input[disabled], select[disabled] { opacity: .6; cursor: not-allowed; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row--3 { grid-template-columns: 1fr 1fr 1fr; }

.checkbox { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-soft); cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }

/* Address autocomplete */
.suggest {
  position: absolute; z-index: 40; left: 0; right: 0; top: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 260px; overflow-y: auto;
  margin-top: 6px; padding: 4px;
}
.suggest[hidden] { display: none; }
.suggest__item {
  padding: 8px 10px; font-size: 13px; cursor: pointer;
  border-radius: var(--radius-xs); line-height: 1.35;
}
.suggest__item:hover, .suggest__item.is-active { background: var(--surface-3); }
.suggest__item strong { display: block; color: var(--ink); font-weight: 500; }
.suggest__item span { color: var(--muted); font-size: 12px; }

/* -------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  width: 100%;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

.btn--primary {
  background: linear-gradient(180deg, var(--brand-500), var(--accent));
  color: var(--on-accent);
  box-shadow: 0 1px 2px rgba(11, 30, 69, .25), 0 4px 12px rgba(31, 95, 208, .22);
}
.btn--primary:hover:not(:disabled) { background: linear-gradient(180deg, var(--accent), var(--accent-hover)); }

/* Secondary action: quiet, bordered. */
.btn--accent { background: var(--surface); color: var(--ink-soft); border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.btn--accent:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }

.btn--ghost { background: transparent; color: var(--muted); }
.btn--ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--ink); }

.btn-row { display: grid; gap: 8px; }
.btn-row--2 { grid-template-columns: 1fr 1fr; }

/* ------------------------------------------------------------- progress */

.progress { margin-top: 14px; }
.progress[hidden] { display: none; }
.progress__bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress__fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--teal)); border-radius: 999px; transition: width .25s ease; }
.progress__text { margin-top: 8px; font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.card__title {
  font-size: 13.5px; font-weight: 600; color: var(--brand-700);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
[data-theme="dark"] .card__title { color: var(--accent); }

/* ---------------------------------------------------- route heading/stats */

.route-heading { margin-bottom: 16px; }
.route-heading__row { display: flex; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 6px; font-weight: 500; }
.route-heading__meta { font-size: 12.5px; color: var(--muted); margin-left: 34px; }

.pill {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; color: #fff; flex: none;
}
.pill--origin { background: var(--ok-solid); }
.pill--dest { background: var(--danger-solid); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
/* Each tile carries a coloured top edge; the key figures get a tinted fill. */
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent-line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.stat--accent { background: var(--accent-soft); border-color: var(--accent-line); border-top-color: var(--accent); }
.stat--toll { background: var(--warn-bg); border-color: var(--warn-line); border-top-color: var(--warn-solid); }
.stat__label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat__value {
  font-size: 22px; font-weight: 600; margin: 4px 0 2px;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink);
}
.stat__sub { font-size: 12px; color: var(--muted); }

/* --------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.data-table thead th {
  font-size: 12px; font-weight: 500; color: var(--muted);
  background: var(--surface-2);
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tfoot th { border-top: 1px solid var(--line-strong); border-bottom: 0; font-weight: 600; background: var(--surface-2); }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table .row--warn { background: var(--warn-bg); }
.data-table .row--warn:hover { background: var(--warn-bg); }

/* --------------------------------------------------------------- badges */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
  border: 1px solid transparent;
}
.badge--secure { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.badge--standard { background: var(--surface-3); color: var(--muted); }
.badge--warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }

/* ------------------------------------------------------------- timeline */

.tl { list-style: none; margin: 0; padding: 0 0 0 6px; }
.tl__item { display: flex; gap: 14px; padding: 0 0 18px 22px; border-left: 2px solid var(--line); position: relative; }
.tl__item:last-child { border-left-color: transparent; padding-bottom: 0; }
.tl__icon {
  position: absolute; left: -15px; top: -3px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--line-strong);
  color: var(--muted);
  display: grid; place-items: center; font-size: 12px;
}
.tl__icon svg { width: 14px; height: 14px; }
.tl__item--drive  .tl__icon { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.tl__item--break  .tl__icon { background: var(--warn-bg);   border-color: var(--warn-line);   color: var(--warn); }
.tl__item--rest   .tl__icon { background: var(--ink);       border-color: var(--ink);         color: var(--surface); }
.tl__item--depart .tl__icon { background: var(--ok-bg);     border-color: var(--ok-line);     color: var(--ok); }
.tl__item--arrive .tl__icon { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
.tl__item--swap   .tl__icon { background: var(--violet-bg); border-color: var(--violet-line); color: var(--violet); }
.tl__body { display: flex; flex-direction: column; gap: 2px; }
.tl__title { font-size: 13.5px; font-weight: 500; color: var(--ink); }
.tl__meta { font-size: 12px; color: var(--muted); }

/* --------------------------------------------------------- stops/parking */

.stop-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 12px; background: var(--surface);
}
.stop-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.stop-card__head h4 { margin: 0; font-size: 14px; font-weight: 600; }
.stop-card__no {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: none;
}
.pk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pk { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; border: 1px solid var(--line); }
.pk__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; font-weight: 500; }
.pk__meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.pk__facilities { margin-top: 8px; display: flex; gap: 4px; flex-wrap: wrap; }

/* ---------------------------------------------------------- regulations */

.reg {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 10px; background: var(--surface);
}
.reg > summary { cursor: pointer; font-size: 13.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; list-style: none; }
.reg > summary::-webkit-details-marker { display: none; }
.reg > summary::after {
  content: ""; margin-left: auto; width: 7px; height: 7px; flex: none;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg); transition: transform .15s;
}
.reg[open] > summary::after { transform: rotate(-135deg); }
.reg__list { margin: 10px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.reg__list li { margin-bottom: 5px; }
.reg--baseline { background: var(--surface-2); }

.reg__list--articles { list-style: none; padding-left: 0; }
.reg__list--articles li { margin-bottom: 8px; }
.reg__list--articles .chip--sm {
  background: var(--accent-soft); color: var(--accent);
  font-weight: 600; margin-right: 4px;
}

/* ------------------------------------------------------------- messages */

.note {
  margin-top: 10px; font-size: 12.5px; color: var(--muted);
  border-left: 2px solid var(--line-strong); padding-left: 10px; line-height: 1.55;
}
.warn-box {
  background: var(--warn-bg); border: 1px solid var(--warn-line);
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--ink-soft); margin-top: 12px; line-height: 1.55;
}
.warn-box strong { color: var(--warn); }
.warn-list { margin: 0; padding-left: 20px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.55; }
.warn-list li { margin-bottom: 4px; }

.empty-state { text-align: center; color: var(--muted); padding: 56px 20px; }
.empty-state__icon {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--surface-3); color: var(--muted);
  display: grid; place-items: center; font-size: 26px;
}
.empty-state__icon svg { width: 26px; height: 26px; }
.empty-state p { font-size: 14px; max-width: 38ch; margin: 0 auto; line-height: 1.55; }

/* ---------------------------------------------------------------- toast */

.toast-host {
  position: fixed; z-index: 5000; left: 50%; transform: translateX(-50%);
  bottom: 22px; display: flex; flex-direction: column; gap: 8px;
  width: min(520px, calc(100% - 32px)); pointer-events: none;
}
.toast {
  background: #101828; color: #fff;
  border-radius: var(--radius-sm); padding: 11px 14px;
  font-size: 13px; box-shadow: var(--shadow-lg);
  border-left: 3px solid var(--blue-500);
  animation: toast-in .2s ease;
}
[data-theme="dark"] .toast { background: #1f2734; border: 1px solid var(--line-strong); border-left-width: 3px; }
.toast--error { border-left-color: var(--danger-solid); }
.toast--warn { border-left-color: var(--warn-solid); }
.toast--ok { border-left-color: var(--ok-solid); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------ report textarea */

.report {
  width: 100%; min-height: 380px;
  font-family: var(--mono); font-size: 12px; line-height: 1.5;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px; resize: vertical; white-space: pre;
}

/* ---------------------------------------------------------- map overlays */

.map-shell { position: relative; width: 100%; height: 100%; min-height: 320px; }
.map-canvas { position: absolute; inset: 0; border-radius: var(--radius); overflow: hidden; background: var(--surface-3); }

.trp-marker { background: none; border: 0; }
.trp-marker span {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; border-radius: 50%;
  color: #fff; font-weight: 700; font-size: 12px;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(16, 24, 40, .35);
}
.trp-marker--origin span { background: var(--ok-solid); }
.trp-marker--dest span { background: var(--danger-solid); }
.trp-marker--stop span { background: #2563eb; }
.trp-marker--park span { background: #667085; font-size: 10px; }
.trp-marker--park-secure span { background: #101828; font-size: 10px; }

/* Popups and floating panels stay light in both themes, so these are
   literal values rather than theme tokens. */
.mapx {
  background: rgba(255, 255, 255, .98);
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  box-shadow: 0 12px 16px -4px rgba(16, 24, 40, .12), 0 4px 6px -2px rgba(16, 24, 40, .06);
  padding: 10px 12px;
  font-size: 12.5px;
  max-width: 275px;
  color: #101828;
}
.mapx__title { font-size: 12px; font-weight: 600; color: #101828; margin-bottom: 6px; }
.mapx__kv { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px solid #f0f2f5; }
.mapx__kv--total { background: #eef4ff; border: 1px solid #b9d0fb; border-radius: 6px; padding: 5px 7px; margin-top: 6px; font-weight: 600; }
.mapx__table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 11.5px; }
.mapx__table th, .mapx__table td { padding: 3px 4px; border-bottom: 1px solid #f0f2f5; text-align: left; }
.mapx__table th { color: #667085; font-weight: 500; }
.mapx__foot { margin-top: 8px; font-size: 10.5px; color: #667085; text-align: right; }
.mapx__toggle {
  width: 100%; border: 1px solid #e4e7ec; cursor: pointer; font: inherit; font-weight: 600; font-size: 12.5px;
  background: #fff; color: #101828; border-radius: 6px; padding: 6px 8px;
  display: flex; justify-content: space-between; align-items: center;
}
.mapx__toggle:hover { background: #f8f9fb; }
.mapx__chev { display: inline-flex; color: #667085; }
.mapx__chev svg { width: 14px; height: 14px; }
.mapx__body { max-height: 44vh; overflow: auto; margin-top: 8px; }
.mapx__title + .mapx__body { margin-top: 0; }
.mapx--collapsed { padding: 6px 8px; }
.mapx--compact { max-width: 46vw; font-size: 11.5px; padding: 7px 8px; }
.mapx--compact .mapx__body { max-height: 38vh; }
.mapx--compact .mapx__toggle { padding: 5px 7px; font-size: 11.5px; }
.mapx__reg-title { font-weight: 600; color: #101828; margin-top: 8px; font-size: 12px; }
.mapx__reg ul { margin: 3px 0 0; padding-left: 16px; }
.mapx__reg li { margin-bottom: 3px; }
.mapx__warn { background: #fffaeb; border: 1px solid #fedf89; padding: 6px 8px; border-radius: 6px; font-size: 11px; margin-top: 8px; color: #344054; }
.mapx__muted { color: #667085; }
.popup-list { margin: 4px 0 0; padding-left: 16px; }
.popup-list .icon { width: 12px; height: 12px; vertical-align: -1px; margin-right: 2px; }
.popup-facilities { color: #667085; font-size: 11px; }

/* Floating map buttons sit on top of tiles, so they need a solid ground. */
.map-floating-actions .btn--ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.map-floating-actions .btn--ghost:hover:not(:disabled) { background: var(--surface-2); }

/* ------------------------------------------------------- legal stop plan */

.ls-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ls {
  display: flex; gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--surface);
}
.ls__icon {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent);
  display: grid; place-items: center; font-size: 15px;
}
.ls__icon svg { width: 15px; height: 15px; }
.ls__body { min-width: 0; flex: 1; }
.ls__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.ls__meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.ls__alt { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; line-height: 1.5; }
.ls__alt em { color: var(--accent); font-style: normal; font-weight: 600; }

/* ---------------------------------------------------------------- print */

@media print {
  .app-header, .app-footer, .sidebar, .tabs, .bottom-nav, .btn, .toast-host { display: none !important; }
  .card { break-inside: avoid; box-shadow: none; }
  body { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
