/* NRT realtime system map — inline fragment and standalone page.
   Everything is scoped under .nrt-sysmap. Layout keys off data-layout
   (wide | narrow — set by nrt-system-map.js from the container width) and
   the state classes is-fullscreen / is-standalone. No media queries: an
   inline map can be a narrow column on a wide screen. */
.nrt-sysmap {
  --color-primary: #053747;          /* overridden inline from display.primary_color */
  --color-bg: #ffffff;
  --color-bg-secondary: #f5f6f8;
  --color-text: #1f1f1f;
  --color-text-muted: #6b6b6b;
  --color-border: #e0e3e7;
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 12px;
  --shadow-md: 0 4px 12px rgba(0,0,0,0.14);
  --transition: all 0.15s ease;
  --min-touch-target: 44px;
  --sheet-peek: 112px;
  --nrt-sysmap-height: 600px;
  position: relative; display: flex; width: 100%; box-sizing: border-box;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.5; color: var(--color-text); background: var(--color-bg);
}
.nrt-sysmap *, .nrt-sysmap *::before, .nrt-sysmap *::after { box-sizing: border-box; }
/* Host-theme proofing: Salient styles buttons, inputs, lists and headings globally. */
.nrt-sysmap button { font: inherit; letter-spacing: normal; text-transform: none; line-height: 1.4; box-shadow: none; margin: 0; }
.nrt-sysmap input[type="search"] { -webkit-appearance: none; appearance: none; margin: 0; box-shadow: none; }
.nrt-sysmap ul { list-style: none; margin: 0; padding: 0; }
.nrt-sysmap h2 { margin: 0; letter-spacing: normal; }
.nrt-sysmap a { box-shadow: none; }
.nrt-sysmap .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.nrt-sysmap .skip-link { position: absolute; top: -40px; left: 0; background: var(--color-primary); color: #fff; padding: 8px 16px; text-decoration: none; z-index: 10000; border-radius: var(--radius-sm); }
.nrt-sysmap .skip-link:focus { top: 8px; left: 8px; }

/* ---------- map block ---------- */
.nrt-sysmap .nrt-sysmap-map-wrap { position: relative; flex: 1; min-width: 0; background: var(--color-bg-secondary); scroll-margin-top: 80px; }
.nrt-sysmap .nrt-sysmap-map { width: 100%; height: 100%; }
.nrt-sysmap .nrt-sysmap-fs {
  position: absolute; top: 12px; right: 12px; z-index: 10; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
  background: #fff; color: #1f1f1f; border: 1px solid var(--color-border); border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.nrt-sysmap .nrt-sysmap-fs svg { width: 20px; height: 20px; pointer-events: none; }
.nrt-sysmap .nrt-sysmap-fs:hover { background: var(--color-bg-secondary); }
.nrt-sysmap .nrt-sysmap-fs:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.nrt-sysmap.is-standalone .nrt-sysmap-fs { display: none; }   /* the iframe wrapper provides one */

/* ---------- wide: side panel ---------- */
.nrt-sysmap[data-layout="wide"] { height: var(--nrt-sysmap-height); flex-direction: row; }
.nrt-sysmap[data-layout="wide"] .nrt-sysmap-panel {
  width: 380px; height: 100%; background: var(--color-bg); border-left: 1px solid var(--color-border);
  display: flex; flex-direction: column; overflow: hidden;
}
.nrt-sysmap[data-layout="wide"] .sheet-handle { display: none; }
.nrt-sysmap[data-layout="wide"] .panel-header { padding: 14px 16px; background: var(--color-primary); display: flex; align-items: center; gap: 10px; }
.nrt-sysmap.is-embedded[data-layout="wide"] .panel-header { padding-right: 68px; }
.nrt-sysmap[data-layout="wide"] .panel-header h2 { font-size: 17px; font-weight: 700; color: #fff; }
.nrt-sysmap[data-layout="wide"] .panel-dates { color: rgba(255,255,255,0.82); }
.nrt-sysmap[data-layout="wide"] .panel-content { flex: 1; overflow-y: auto; }
.nrt-sysmap[data-layout="wide"] .selected-route-header { display: none; }
.nrt-sysmap[data-layout="wide"] .help-toggle { border-color: rgba(255,255,255,0.6); color: #fff; }
.nrt-sysmap[data-layout="wide"] .help-toggle:hover { background: rgba(255,255,255,0.14); }
.nrt-sysmap[data-layout="wide"] .bus-pill { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.55); color: #fff; }
.nrt-sysmap[data-layout="wide"] .bus-pill[aria-pressed="true"] .bus-pill-switch { background: #fff; }
.nrt-sysmap[data-layout="wide"] .bus-pill[aria-pressed="true"] .bus-pill-switch::after { background: var(--color-primary); }

/* ---------- narrow, in the page: map block, then the panel in flow ---------- */
.nrt-sysmap[data-layout="narrow"] { flex-direction: column; }
.nrt-sysmap[data-layout="narrow"] .nrt-sysmap-map-wrap { flex: none; height: var(--nrt-sysmap-height); }
.nrt-sysmap[data-layout="narrow"] .nrt-sysmap-panel { background: var(--color-bg); border-top: 1px solid var(--color-border); display: flex; flex-direction: column; }
.nrt-sysmap[data-layout="narrow"] .sheet-handle { display: none; }
.nrt-sysmap[data-layout="narrow"] .panel-header { padding: 12px 14px 12px 18px; display: flex; align-items: center; gap: 10px; }
.nrt-sysmap[data-layout="narrow"] .panel-header h2 { font-size: 17px; font-weight: 700; line-height: 1.2; color: var(--color-primary); }
.nrt-sysmap[data-layout="narrow"] .panel-dates { color: var(--color-text-muted); }
.nrt-sysmap[data-layout="narrow"] .selected-route-header { display: none; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.nrt-sysmap[data-layout="narrow"] .nrt-sysmap-panel.has-selection .panel-title { display: none; }
.nrt-sysmap[data-layout="narrow"] .nrt-sysmap-panel.has-selection .selected-route-header { display: flex; }
.nrt-sysmap .selected-route-header .route-badge { padding: 4px 10px; border-radius: var(--radius-sm); font-weight: 700; font-size: 14px; flex-shrink: 0; }
.nrt-sysmap .selected-route-header .route-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nrt-sysmap .show-all {
  margin-left: auto; flex-shrink: 0; border: 1px solid var(--color-border); background: var(--color-bg);
  border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--color-primary);
  padding: 5px 10px; cursor: pointer; white-space: nowrap;
}

/* ---------- narrow + fullscreen/standalone: drawer over the map ---------- */
.nrt-sysmap.is-fullscreen[data-layout="narrow"],
.nrt-sysmap.is-standalone[data-layout="narrow"] { display: block; }
.nrt-sysmap.is-fullscreen[data-layout="narrow"] .nrt-sysmap-map-wrap,
.nrt-sysmap.is-standalone[data-layout="narrow"] .nrt-sysmap-map-wrap { height: 100%; }
.nrt-sysmap.is-fullscreen[data-layout="narrow"] .nrt-sysmap-panel,
.nrt-sysmap.is-standalone[data-layout="narrow"] .nrt-sysmap-panel {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20;
  height: var(--sheet-peek); border-top: 0;
  border-top-left-radius: 18px; border-top-right-radius: 18px;
  box-shadow: 0 -6px 24px rgba(5,55,71,0.18);
  transition: height 0.28s cubic-bezier(0.2,0.8,0.2,1);
}
.nrt-sysmap.is-fullscreen[data-layout="narrow"] .nrt-sysmap-panel.dragging,
.nrt-sysmap.is-standalone[data-layout="narrow"] .nrt-sysmap-panel.dragging { transition: none; }
.nrt-sysmap.is-fullscreen[data-layout="narrow"] .nrt-sysmap-panel[data-snap="peek"],
.nrt-sysmap.is-standalone[data-layout="narrow"] .nrt-sysmap-panel[data-snap="peek"] { height: var(--sheet-peek); }
.nrt-sysmap.is-fullscreen[data-layout="narrow"] .nrt-sysmap-panel[data-snap="half"],
.nrt-sysmap.is-standalone[data-layout="narrow"] .nrt-sysmap-panel[data-snap="half"] { height: 52%; }
.nrt-sysmap.is-fullscreen[data-layout="narrow"] .nrt-sysmap-panel[data-snap="full"],
.nrt-sysmap.is-standalone[data-layout="narrow"] .nrt-sysmap-panel[data-snap="full"] { height: 90%; }
.nrt-sysmap.is-fullscreen[data-layout="narrow"] .sheet-handle,
.nrt-sysmap.is-standalone[data-layout="narrow"] .sheet-handle { display: flex; padding: 10px 0 4px; justify-content: center; cursor: grab; touch-action: none; }
.nrt-sysmap.is-fullscreen[data-layout="narrow"] .panel-header,
.nrt-sysmap.is-standalone[data-layout="narrow"] .panel-header { padding: 2px 14px 12px 18px; cursor: pointer; touch-action: none; }
.nrt-sysmap .handle-bar { width: 38px; height: 5px; background: #cfd6db; border-radius: 3px; }
.nrt-sysmap.is-fullscreen[data-layout="narrow"] .panel-content,
.nrt-sysmap.is-standalone[data-layout="narrow"] .panel-content {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  opacity: 0; transition: opacity 0.2s ease;
}
.nrt-sysmap.is-fullscreen[data-layout="narrow"] .nrt-sysmap-panel:not([data-snap="peek"]) .panel-content,
.nrt-sysmap.is-standalone[data-layout="narrow"] .nrt-sysmap-panel:not([data-snap="peek"]) .panel-content,
.nrt-sysmap.is-fullscreen[data-layout="narrow"] .nrt-sysmap-panel.lifting .panel-content,
.nrt-sysmap.is-standalone[data-layout="narrow"] .nrt-sysmap-panel.lifting .panel-content { opacity: 1; }
.nrt-sysmap.is-fullscreen[data-layout="narrow"] .nrt-sysmap-panel[data-snap="peek"]:not(.lifting) .panel-content,
.nrt-sysmap.is-standalone[data-layout="narrow"] .nrt-sysmap-panel[data-snap="peek"]:not(.lifting) .panel-content { pointer-events: none; }

/* ---------- fullscreen (any width) and standalone ---------- */
.nrt-sysmap.is-fullscreen {
  position: fixed !important; inset: 0; margin: 0 !important;
  width: 100vw !important; height: 100vh !important; height: 100dvh !important;
  --nrt-sysmap-height: 100dvh; z-index: 999999; border-radius: 0;
  /* undo the UA [popover] chrome (pseudo mode opens the root as a manual popover) */
  border: 0; padding: 0; max-width: none; max-height: none; overflow: hidden;
}
.nrt-sysmap:fullscreen, .nrt-sysmap:-webkit-full-screen { width: 100% !important; height: 100% !important; }
.nrt-sysmap.is-standalone { height: 100vh; height: 100dvh; --nrt-sysmap-height: 100dvh; }
html.nrt-map-fs-lock, html.nrt-map-fs-lock body { overflow: hidden !important; }

/* ---------- panel header extras, search, legend ---------- */
.nrt-sysmap .panel-title { flex: 1; min-width: 0; }
.nrt-sysmap .panel-dates { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; font-size: 12px; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* ------- Panel header, search, legend (both layouts) -------
   (.panel-title / .panel-dates are already scoped above; not repeated.) */
.nrt-sysmap .bus-pill {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 32px;
  font-family: inherit; font-size: 12px; font-weight: 600; color: var(--color-primary);
  background: var(--color-bg-secondary); border: 1px solid var(--color-border);
  border-radius: 999px; padding: 5px 8px 5px 7px; cursor: pointer;
}
.nrt-sysmap .bus-pill .legend-dot { width: 9px; height: 9px; box-shadow: 0 0 0 3px rgba(213,47,62,0.15); }
.nrt-sysmap .bus-pill-switch {
  position: relative; width: 30px; height: 18px; border-radius: 9px; flex-shrink: 0;
  background: #c8d0d5; transition: background 0.15s ease;
}
.nrt-sysmap .bus-pill-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.3); transition: transform 0.15s ease;
}
.nrt-sysmap .bus-pill[aria-pressed="true"] .bus-pill-switch { background: var(--color-primary); }
.nrt-sysmap .bus-pill[aria-pressed="true"] .bus-pill-switch::after { transform: translateX(12px); }
.nrt-sysmap .bus-pill:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.nrt-sysmap .route-search {
  margin: 12px 14px 10px; display: flex; align-items: center; gap: 8px;
  background: var(--color-bg-secondary); border: 1px solid var(--color-border);
  border-radius: 12px; padding: 8px 12px; color: var(--color-text-muted);
}
.nrt-sysmap .route-search:focus-within { border-color: var(--color-primary); }
.nrt-sysmap .route-search svg { width: 16px; height: 16px; flex-shrink: 0; }
.nrt-sysmap .route-search input { border: 0; background: none; font: inherit; font-size: 14px; color: var(--color-text); flex: 1; min-width: 0; outline: none; }
.nrt-sysmap .route-item.search-hidden, .nrt-sysmap .route-category.search-hidden { display: none; }
.nrt-sysmap .panel-legend { margin: 0 14px 12px; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-bg); }
.nrt-sysmap .panel-legend-title {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 12px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted);
}
.nrt-sysmap .legend-toggle { border: 0; background: none; font: inherit; font-size: 11px; font-weight: 600; color: var(--color-primary); cursor: pointer; padding: 2px 4px; letter-spacing: 0; text-transform: none; }
.nrt-sysmap .legend-body { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; padding: 0 12px 10px; }
.nrt-sysmap .panel-legend.collapsed .legend-body { display: none; }
.nrt-sysmap .legend-item { display: flex; align-items: center; gap: 9px; font-size: 13px; min-height: 24px; }
.nrt-sysmap .legend-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
/* !important: Salient's global image rules (.row .col img:not([srcset]) { width: auto },
   .main-content img { height: auto }, .row .col img { margin-bottom: 15px }) out-specify
   this scoped selector on a WordPress page and blew the icon up to its natural size. */
.nrt-sysmap .legend-icon { width: 22px !important; height: 22px !important; margin: 0 !important; flex-shrink: 0; object-fit: contain; }
/* Hub marker <img>s inside the map pick up the same theme margin; keep them exact. */
.nrt-sysmap .maplibregl-marker img { margin: 0 !important; max-width: none !important; }
.nrt-sysmap .legend-line { width: 26px; height: 4px; border-radius: 2px; flex-shrink: 0; background: var(--color-primary); }
.nrt-sysmap .legend-line.dashed { background: repeating-linear-gradient(90deg, #0077BE 0 6px, transparent 6px 10px); border-radius: 0; }

/* ------- Help ------- */
.nrt-sysmap .help-toggle {
  background: none; border: 1px solid var(--color-text); border-radius: var(--radius-md);
  color: var(--color-text); width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; font-weight: 700; flex-shrink: 0;
  transition: var(--transition);
}
.nrt-sysmap .help-toggle:hover { background: var(--color-bg-secondary); }
.nrt-sysmap .help-section {
  display: none; padding: 12px 16px;
  border-bottom: 1px solid var(--color-border); background: var(--color-bg-secondary);
  font-size: 13px; color: var(--color-text); line-height: 1.5;
}
.nrt-sysmap .help-section.expanded { display: block; }
.nrt-sysmap .help-section ul { list-style: none; padding: 0; margin: 0; }
.nrt-sysmap .help-section li { padding: 4px 0; border-bottom: 1px solid var(--color-border); }
.nrt-sysmap .help-section li:last-child { border-bottom: none; }
.nrt-sysmap .help-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; }

/* ------- Category ------- */
.nrt-sysmap .route-category { border-bottom: 1px solid var(--color-border); }
.nrt-sysmap .category-header {
  width: 100%; padding: 13px 16px; background: none; border: 0;
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 14px; font-weight: 700; color: var(--color-text); text-align: left;
  transition: padding-left 0.18s ease;
}
.nrt-sysmap .category-header:hover { background: var(--color-bg-secondary); }
.nrt-sysmap .category-count { font-weight: 400; color: var(--color-text-muted); font-size: 12px; }
.nrt-sysmap .category-arrow { margin-left: auto; transition: transform 0.2s ease; }
.nrt-sysmap .category-header[aria-expanded="true"] .category-arrow { transform: rotate(180deg); }
.nrt-sysmap .route-category[data-category="niagara_falls"] .category-header { background:#07495f; color:#fff; }
.nrt-sysmap .route-category[data-category="st_catharines"] .category-header { background:#005d72; color:#fff; }
.nrt-sysmap .route-category[data-category="welland"] .category-header { background:#053747; color:#fff; }
.nrt-sysmap .route-category[data-category="fort_erie"] .category-header { background:#042935; color:#fff; }
.nrt-sysmap .route-category[data-category="regional"] .category-header { background:#ffe2a1; color:#000; }
.nrt-sysmap .route-category:not([data-category="regional"]) .category-header .category-count { color: rgba(255,255,255,0.78); }
.nrt-sysmap .route-category[data-category="regional"] .category-header .category-count { color: rgba(0,0,0,0.6); }
.nrt-sysmap .route-category .category-header:hover { padding-left: 24px; }

.nrt-sysmap .route-list { list-style: none; padding: 0; margin: 0; }
.nrt-sysmap .route-list.collapsed { display: none; }

.nrt-sysmap .route-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch; border-bottom: 1px solid var(--color-border);
}
.nrt-sysmap .route-button {
  display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 12px;
  padding: 11px 16px; background: none; border: 0; cursor: pointer;
  text-align: left; min-width: 0; min-height: var(--min-touch-target);
  font: inherit;
}
.nrt-sysmap .route-button:hover { background: var(--color-bg-secondary); }
.nrt-sysmap .route-button.selected { background: rgba(5, 55, 71, 0.08); }
.nrt-sysmap .route-button.interlined {
  background: rgba(0, 119, 190, 0.08);
  border-left: 3px solid #0077BE;
}
.nrt-sysmap .route-badges { display: flex; gap: 4px; flex-shrink: 0; }
.nrt-sysmap .route-number {
  min-width: 36px; padding: 5px 6px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 13px; text-align: center;
  cursor: pointer; transition: opacity 0.15s, transform 0.15s;
}
.nrt-sysmap .route-number:hover { opacity: 0.85; transform: scale(1.05); }
.nrt-sysmap .route-details { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nrt-sysmap .route-name { font-size: 14px; font-weight: 500; color: var(--color-text); }
.nrt-sysmap .route-interlines { font-size: 11px; color: #0077BE; font-weight: 600; }

.nrt-sysmap .route-link {
  padding: 8px 14px; color: var(--color-primary); text-decoration: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 11px; font-weight: 600;
  background: var(--color-bg-secondary); border: 0;
  border-left: 1px solid var(--color-border);
  transition: color 0.15s, background 0.15s;
  min-height: var(--min-touch-target);
}
.nrt-sysmap .route-link:hover { background: rgba(5, 55, 71, 0.1); }

/* ------- Hub popups ------- */
.nrt-sysmap .maplibregl-popup-content {
  padding: 0 !important; border-radius: 8px !important;
  overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,0.14) !important;
  min-width: 200px;
}
.nrt-sysmap .hub-popup-header {
  padding: 12px 30px 12px 14px; color: #fff; background: #042935;
  display: flex; align-items: center; gap: 8px;
}
.nrt-sysmap .hub-popup-name { font-weight: 700; font-size: 15px; line-height: 1.25; }
.nrt-sysmap .hub-popup-category { font-size: 12px; opacity: 0.9; text-transform: capitalize; }
.nrt-sysmap .hub-popup-body { padding: 10px 14px; background: #fff; }
.nrt-sysmap .hub-popup-label {
  font-size: 11px; color: #888; text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 6px; font-weight: 700;
}
.nrt-sysmap .hub-popup-routes { display: flex; flex-wrap: wrap; gap: 4px; }
.nrt-sysmap .hub-popup-route-badge {
  appearance: none; -webkit-appearance: none; font: inherit;
  display: inline-block; padding: 2px 7px; border-radius: 4px;
  font-size: 12px; font-weight: 700; line-height: 1.4; cursor: pointer;
}
.nrt-sysmap .hub-popup-route-badge:hover { opacity: 0.85; }
.nrt-sysmap .hub-popup-route-badge:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.nrt-sysmap .hub-popup-route-badge.no-line { cursor: default; }
.nrt-sysmap .hub-popup-route-badge.no-line:hover { opacity: 1; }
.nrt-sysmap .hub-popup-footer {
  padding: 8px 14px 10px; background: #fff; font-size: 12px; color: #888;
  border-top: 1px solid #eee;
}
.nrt-sysmap .maplibregl-popup-close-button { color: #fff !important; font-size: 18px; right: 4px !important; top: 4px !important; }

/* ------- Live vehicle markers (realtime variant): route badges ------- */
/* No `position` here: the badge is the MapLibre marker element and must
   keep .maplibregl-marker's position:absolute (it is already a containing
   block for the heading). Legend samples set it below. */
.nrt-sysmap .vehicle-badge {
  box-sizing: border-box; width: 28px; height: 28px; border-radius: 50%;
  background: var(--veh-bg, #3f4a5c); color: var(--veh-fg, #fff);
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 12px; line-height: 1; letter-spacing: -.2px;
}
.nrt-sysmap .vehicle-badge-md { width: 30px; height: 30px; letter-spacing: -.6px; }
.nrt-sysmap .vehicle-badge-sm { width: auto; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 15px; }
.nrt-sysmap .vehicle-badge-label { position: relative; z-index: 1; white-space: nowrap; }
/* Heading pointer: a square larger than the disc, rotated about its centre,
   with a route-coloured wedge on its top edge touching the disc's rim. */
.nrt-sysmap .vehicle-badge-heading { position: absolute; inset: -9px; pointer-events: none; }
.nrt-sysmap .vehicle-badge-heading::before {
  content: ""; position: absolute; top: 0; left: 50%; margin-left: -6px;
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-bottom: 9px solid var(--veh-bg, #3f4a5c);
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 .5px #fff);
}
.nrt-sysmap .vehicle-badge.no-bearing .vehicle-badge-heading { display: none; }
.nrt-sysmap .legend-item .vehicle-badge, .nrt-sysmap .vehicle-badge[aria-hidden] { position: relative; cursor: default; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.nrt-sysmap .nrt-sm-veh-popup { min-width: 230px; max-width: 270px; }
.nrt-sysmap .nrt-sm-veh-band { display: flex; align-items: center; gap: 9px; padding: 9px 34px 9px 12px; }
.nrt-sysmap .nrt-sm-veh-num { font-weight: 800; font-size: 17px; letter-spacing: .2px; color: inherit; text-decoration: none; border-radius: 3px; }
.nrt-sysmap .nrt-sm-veh-num:hover { text-decoration: underline; }
.nrt-sysmap .nrt-sm-veh-num:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.nrt-sysmap .nrt-sm-veh-name { font-size: 13px; font-weight: 600; color: inherit; line-height: 1.25; }
.nrt-sysmap .nrt-sm-veh-band-unknown { background: #e9ecef; color: var(--color-text); }
.nrt-sysmap .nrt-sm-veh-body { padding: 10px 12px 12px; background: #fff; }
.nrt-sysmap .nrt-sm-veh-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12.5px; margin-bottom: 10px; }
.nrt-sysmap .nrt-sm-veh-bus { font-weight: 600; color: var(--color-text); }
.nrt-sysmap .nrt-sm-veh-heading { color: var(--color-text-muted); font-size: 12px; white-space: nowrap; }
.nrt-sysmap .nrt-sm-veh-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nrt-sysmap .nrt-sm-veh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; font: inherit; font-size: 12px; font-weight: 600; padding: 7px 10px; border-radius: 6px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.nrt-sysmap .nrt-sm-veh-btn.solid { background: var(--color-primary); color: #fff; border: 1px solid var(--color-primary); }
.nrt-sysmap .nrt-sm-veh-btn.solid:hover { filter: brightness(1.1); }
.nrt-sysmap .nrt-sm-veh-btn.ghost { background: #fff; color: var(--color-text); border: 1px solid #cfd8dc; }
.nrt-sysmap .nrt-sm-veh-btn.ghost:hover { background: #f3f6f7; }
.nrt-sysmap .nrt-sm-veh-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
/* A real close target on the colour band: a 30px translucent-white circle
   with the band's text colour (--veh-close, set per route by the JS). */
.nrt-sysmap .vehicle-popup .maplibregl-popup-close-button {
  color: var(--veh-close, #fff) !important; top: 6px !important; right: 6px !important;
  width: 30px; height: 30px; padding: 0; display: grid; place-items: center;
  border-radius: 50%; background: rgba(255,255,255,.22); font-size: 22px; line-height: 1;
}
.nrt-sysmap .vehicle-popup .maplibregl-popup-close-button:hover { background: rgba(255,255,255,.36); }
.nrt-sysmap .vehicle-popup .maplibregl-popup-close-button:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }
.nrt-sysmap .vehicle-popup .nrt-sm-veh-band { padding-right: 44px; }

@media (prefers-reduced-motion: reduce) {
  .nrt-sysmap *, .nrt-sysmap *::before, .nrt-sysmap *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
