/* The tapped bus (P2.22 step 4): docs/design.md "A tapped bus" and the
   passed-stop rule. Moved out of unified.css and redrawn from the canvas's
   Bus_* boards (their .bd-* rules). The layout shell it sits in
   (.sb-body.vehicle-mode) is shell.css's; the delay chip (.veh-chip) stays
   in unified.css with the status-chip contrast cascade.

   --veh-color is the route colour and --veh-ink the text colour that reads
   on it (white, or dark on a light route colour: textOn, P2.18); both are
   set inline on the header by vehicle-sheet.js. */

/* ── Header: a block in the route colour ─────────────────────────────── */
.veh-header {
  padding: 16px; background: var(--veh-color, var(--navy));
  color: var(--veh-ink, #fff);
}
.veh-top { display: flex; align-items: center; gap: 8px; }
.veh-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 24px; padding: 0 8px; flex-shrink: 0;
  border-radius: var(--radius-pill); font-size: 13px; font-weight: 800;
  background: color-mix(in srgb, var(--veh-ink, #fff) 22%, transparent);
  color: var(--veh-ink, #fff);
}
.veh-hs {
  flex: 1; min-width: 0; font-size: 14px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Track: the ink colour as the button (white on most routes), the route
   colour as its text — the canvas's white "Track" on the blue header. */
.veh-track {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 16px; flex-shrink: 0;
  border: none; border-radius: var(--radius-pill); cursor: pointer;
  background: var(--veh-ink, #fff); color: var(--veh-color, var(--navy));
  font-family: inherit; font-size: 13px; font-weight: 800;
}
/* Tracking now: green, with a small pulsing stop square. #15803d is the
   darker green (white on it is 5.0:1; --live-dot's #16a34a is 3.3:1). */
.veh-track[aria-pressed="true"] { background: #15803d; color: #fff; }
.veh-track[aria-pressed="true"]::before {
  content: ''; width: 9px; height: 9px; margin-right: 8px;
  background: #fff; border-radius: 2px;
  animation: veh-track-rec 1.4s ease-in-out infinite;
}
@keyframes veh-track-rec { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) {
  .veh-track[aria-pressed="true"]::before { animation: none; }
}
.veh-close {
  width: 44px; height: 44px; flex-shrink: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: var(--radius-pill); cursor: pointer;
  background: color-mix(in srgb, var(--veh-ink, #fff) 16%, transparent);
  color: var(--veh-ink, #fff);
}
.veh-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  margin-top: 8px; font-size: 12px;
}
.veh-next-in { font-weight: 700; }

/* ── The trip's stops ────────────────────────────────────────────────── */
.veh-stops { background: transparent; }
.veh-stop-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px; min-height: 44px; box-sizing: border-box;
  border-radius: 10px; font-size: 13px; color: var(--ink);
  cursor: pointer;
}
.veh-stop-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--veh-color, var(--navy));
}
.veh-stop-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.veh-stop-time { font-size: 13px; color: var(--ink-secondary); white-space: nowrap; }
.veh-stop-time .eta-pred { font-weight: 700; color: var(--ink); }
.veh-stop-time .eta-pred.row-due { color: var(--due); }
.veh-stop-time .eta-struck {
  color: var(--ink-muted); font-size: 11px; text-decoration: line-through; margin-left: 4px;
}

/* The next stop: the route colour at 7%, bold name. */
.veh-stop-row.next {
  background: color-mix(in srgb, var(--veh-color, var(--navy)) 7%, transparent);
}
.veh-stop-row.next .veh-stop-name { font-weight: 700; }

/* A stop the bus has probably passed (docs/design.md): ink-muted text, a
   neutral dot and a "passed" chip. Never faded with opacity — that would
   drop the text under 4.5:1. */
.veh-stop-row.passed,
.veh-stop-row.passed .veh-stop-time { color: var(--ink-muted); }
.veh-stop-row.passed .veh-stop-dot { background: var(--stop-dot); }
.veh-passed-chip {
  display: inline-flex; align-items: center; flex-shrink: 0;
  padding: 4px 12px; border-radius: var(--radius-pill);
  background: var(--chip-neutral-bg); color: var(--chip-neutral-ink);
  font-size: 11px; font-weight: 700; white-space: nowrap;
}

/* ── The tapped bus on the map: scaled to 1.1 (docs/design.md "Bus icon").
   The SVG's own origin is the bus's anchor, so scale around it. ───────── */
.bus-sel svg { transform: scale(1.1); transform-origin: 0 0; }
