.vehicle-entry, .vehicle-dialog-head, .vehicle-live-foot, .vehicle-chooser, .vehicle-device-row, .vehicle-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.vehicle-entry {
  margin: 24px 0;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.vehicle-entry h2, .vehicle-dialog-head h2 { margin: 0; }
.vehicle-actions { justify-content: flex-start; flex-wrap: wrap; }
.vehicle-dialog {
  width: min(720px, calc(100% - 24px));
  max-height: 90vh;
  max-height: 90dvh;
  margin: auto;
  padding: clamp(18px, 4vw, 30px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  background: #fff;
}
.vehicle-dialog::backdrop { background: rgb(18 30 57 / 58%); }
body:has(.vehicle-dialog[open]) { overflow: hidden; }
.vehicle-dialog-head { margin-bottom: 20px; }
.vehicle-chooser { justify-content: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.vehicle-chooser select, .vehicle-pairing input, .vehicle-commands select {
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  color: inherit;
  background: #fff;
  min-width: 0;
  min-height: 42px;
  padding: 7px 10px;
}
.vehicle-chooser select { flex: 1; }
.vehicle-screen {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #d8e1f2;
  background: #101a2a;
  border-radius: 12px;
  text-align: center;
}
.vehicle-screen img, .vehicle-screen video, .vehicle-screen canvas { display: block; width: 100%; height: auto; min-height: 0; object-fit: contain; }
.vehicle-stage { min-width: 0; }
.vehicle-live-screen {
  --media-limit: 52vh;
  --media-limit: 52dvh;
  margin-inline: auto;
  border-radius: 0;
  min-width: 0;
}
.vehicle-live-screen:has(> p[hidden]) {
  width: min(100%, calc(var(--media-limit) * var(--display-ratio, 1)));
  aspect-ratio: var(--display-ratio, 1);
}
.vehicle-live-screen > :is(img, canvas) {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--paint-width, 100%);
  max-width: none;
  height: auto;
  transform: translate(-50%, -50%) rotate(var(--turn-angle, 0deg));
}
.vehicle-dialog[data-view="live"] {
  --monitor-height: 100vh;
  --monitor-height: 100dvh;
  width: 100%;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: #0a1019;
}
.vehicle-dialog[data-view="live"] > .vehicle-dialog-head { display: none; }
.vehicle-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: var(--monitor-height);
  background: #0a1019;
  color: white;
  overflow: hidden;
}
.vehicle-stage:focus-visible { outline: 2px solid #9fc4ff; outline-offset: -2px; }
.vehicle-camera-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--camera-cols, 1), minmax(0, 1fr));
  grid-template-rows: repeat(var(--camera-rows, 1), minmax(0, 1fr));
  grid-auto-flow: row;
  gap: 2px;
  background: #405064;
}
.vehicle-camera-tile { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #0a1119; container-type: size; }
.vehicle-camera-tile[data-zoomable="true"] { touch-action: none; }
.vehicle-camera-tile .vehicle-lens-picture {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--lens-width,100%);
  height: var(--lens-height,100%);
  object-fit: contain;
  transform: translate(-50%, -50%) rotate(var(--lens-turn,0deg));
}
/* Keep the receiver rendering during negotiation so the first presented
   frame can be confirmed before switching away from the JPEG canvas. */
.vehicle-camera-tile .vehicle-rtc-picture{pointer-events:none}
.vehicle-camera-tile .vehicle-rtc-picture.is-negotiating{opacity:0}
.vehicle-stage {
  --zoom-amber: #ffcf87;
  --zoom-ink: #f7f8fa;
  --zoom-muted: #bbc1c8;
  --zoom-hairline: rgb(230 236 244 / 19%);
  --zoom-dock: rgb(19 24 31 / 91%);
  --zoom-safe-bottom: max(58px, calc(48px + env(safe-area-inset-bottom)));
}
.vehicle-optics {
  --zoom-dock-bottom: var(--zoom-safe-bottom);
  position: absolute;
  z-index: 1;
  inset-inline-start: max(12px, env(safe-area-inset-left));
  bottom: var(--zoom-dock-bottom);
  display: none;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 24px);
  color: var(--zoom-ink);
  font-variant-numeric: tabular-nums;
}
.vehicle-camera-tile[data-dock-row="inner"] .vehicle-optics { --zoom-dock-bottom: 12px; }
.vehicle-live-screen:has(.vehicle-overlay:not([hidden])) .vehicle-optics:not([hidden]),
.vehicle-camera-tile.zoom-open .vehicle-optics:not([hidden]),
.vehicle-optics:focus-within:not([hidden]) { display: inline-flex; }
.vehicle-zoom-bar, .vehicle-center-focus {
  border: 1px solid var(--zoom-hairline);
  background: var(--zoom-dock);
  box-shadow: 0 2px 7px rgb(0 0 0 / 26%);
  border-radius: 999px;
}
.vehicle-zoom-bar, .vehicle-zoom-quick { display: inline-flex; align-items: center; }
.vehicle-zoom-bar { padding: 2px; }
.vehicle-zoom-quick:empty { display: none; }
.vehicle-zoom-bar button, .vehicle-center-focus, .vehicle-zoom-panel button {
  appearance: none;
  color: inherit;
  font: inherit;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.vehicle-zoom-bar button, .vehicle-zoom-panel button { border: 0; background: transparent; }
.vehicle-zoom-value { font-variant-numeric: tabular-nums; }
.vehicle-zoom-preset, .vehicle-lens-zoom, .vehicle-zoom-stop, .vehicle-center-focus, .vehicle-zoom-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.vehicle-zoom-bar .vehicle-zoom-preset, .vehicle-zoom-bar .vehicle-lens-zoom {
  min-width: 41px;
  height: 37px;
  padding-inline: 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.vehicle-zoom-preset[aria-pressed="true"], .vehicle-zoom-stop[aria-pressed="true"] {
  color: var(--zoom-amber);
  background: rgb(255 207 135 / 14%);
}
.vehicle-zoom-bar .vehicle-lens-zoom { gap: 6px; min-width: 38px; cursor: ew-resize; touch-action: none; }
.vehicle-zoom-quick:not([hidden]):not(:empty) + .vehicle-lens-zoom { position: relative; margin-inline-start: 4px; }
.vehicle-zoom-quick:not([hidden]):not(:empty) + .vehicle-lens-zoom::before {
  content: "";
  position: absolute;
  inset-inline-start: -3px;
  height: 15px;
  width: 1px;
  background: var(--zoom-hairline);
}
.vehicle-zoom-bar.has-preset .vehicle-zoom-value { display: none; }
.vehicle-lens-zoom[aria-expanded="true"] { color: var(--zoom-amber); }
/* Aperture ring and needle identify the precision control even when a preset shows the value. */
.vehicle-zoom-icon {
  position: relative;
  width: 17px;
  height: 15px;
  display: inline-block;
  flex: none;
}
.vehicle-zoom-icon::before {
  content: "";
  position: absolute;
  inset: 1px 0 auto;
  height: 13px;
  border: 1.6px solid currentColor;
  border-bottom-color: transparent;
  border-radius: 50%;
}
.vehicle-zoom-icon::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 8px;
  width: 2px;
  height: 7px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(36deg);
  transform-origin: 50% 100%;
}
.vehicle-center-focus { position: relative; width: 41px; height: 41px; padding: 0; cursor: crosshair; }
.vehicle-center-focus::before, .vehicle-center-focus::after { position: absolute; content: ""; }
.vehicle-center-focus::before {
  width: 17px;
  height: 17px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  mask: conic-gradient(from -22deg, transparent 44deg, #000 45deg 89deg, transparent 90deg 134deg,
    #000 135deg 179deg, transparent 180deg 224deg, #000 225deg 269deg, transparent 270deg 314deg, #000 315deg);
}
.vehicle-center-focus::after { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.vehicle-camera-tile.zoom-open .vehicle-lens-badge {
  color: var(--zoom-amber);
  box-shadow: inset 2px 0 var(--zoom-amber);
}
/* One panel belongs to the stage, so a narrow or rotated tile cannot clip its controls. */
.vehicle-zoom-panel {
  --zoom-panel-width: min(324px, calc(100% - 24px));
  position: absolute;
  z-index: 3;
  left: clamp(calc(var(--zoom-panel-width) / 2 + 12px), var(--zoom-anchor-x, 50%),
    calc(100% - var(--zoom-panel-width) / 2 - 12px));
  bottom: clamp(var(--zoom-safe-bottom), var(--zoom-anchor-bottom, 110px), max(12px, calc(100% - 238px)));
  transform: translateX(-50%);
  width: var(--zoom-panel-width);
  max-height: calc(100% - var(--zoom-safe-bottom) - 12px);
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--zoom-ink);
  color-scheme: dark;
  border: 1px solid rgb(228 233 240 / 23%);
  border-radius: 20px;
  padding: 12px 16px 15px;
  text-align: start;
  font: inherit;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(145deg, #282d35, #171b22 76%);
  box-shadow: 0 10px 36px rgb(0 0 0 / 44%), inset 0 1px rgb(255 255 255 / 5%);
}
.vehicle-zoom-heading {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto 34px;
  align-items: center;
  column-gap: 10px;
  min-height: 40px;
}
.vehicle-zoom-title {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #e5e8eb;
  font-size: 13px;
  font-weight: 600;
}
.vehicle-zoom-readout {
  color: var(--zoom-amber);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.055em;
  line-height: 1;
}
.vehicle-zoom-panel .vehicle-zoom-close {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 7%);
  color: #e5e8eb;
  font-size: 21px;
  font-weight: 400;
}
.vehicle-zoom-stops {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 3px;
  margin: 9px -3px 0;
}
.vehicle-zoom-panel .vehicle-zoom-stop {
  min-width: 43px;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  background: rgb(255 255 255 / 7%);
  font-size: 13px;
  font-weight: 600;
}
.vehicle-zoom-panel .vehicle-zoom-stop[aria-pressed="true"] {
  background: rgb(255 207 135 / 15%);
  color: var(--zoom-amber);
  box-shadow: inset 0 0 0 1px rgb(255 207 135 / 50%);
}
/* Engraved short and long ticks share the same inset as the range thumb's travel. */
.vehicle-zoom-scale { position: relative; display: grid; align-items: center; height: 46px; }
.vehicle-zoom-scale::before {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: 50% 8px auto;
  height: 12px;
  transform: translateY(-50%);
  background:
    repeating-linear-gradient(90deg, #b0b4bb 0 1px, transparent 1px 28px) left center / 100% 12px no-repeat,
    repeating-linear-gradient(90deg, #777e87 0 1px, transparent 1px 7px) left center / 100% 6px no-repeat;
}
.vehicle-zoom-scale::after {
  content: "";
  position: absolute;
  inset: 50% 8px auto;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(to right, rgb(255 207 135 / 55%) var(--zoom-progress,0%), transparent var(--zoom-progress,0%));
}
.vehicle-zoom-range {
  position: relative;
  appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  accent-color: var(--zoom-amber);
  cursor: ew-resize;
  touch-action: pan-y;
}
.vehicle-zoom-range::-webkit-slider-runnable-track { height: 2px; border-radius: 2px; background: transparent; }
.vehicle-zoom-range::-moz-range-track { height: 2px; border-radius: 2px; background: transparent; }
.vehicle-zoom-range::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 28px;
  margin-top: -13px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(var(--zoom-amber), var(--zoom-amber)) center / 4px 24px no-repeat;
  filter: drop-shadow(0 1px 2px #101216);
}
.vehicle-zoom-range::-moz-range-thumb {
  width: 16px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(var(--zoom-amber), var(--zoom-amber)) center / 4px 24px no-repeat;
}
.vehicle-zoom-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 18px;
  padding-inline: 4px;
  color: var(--zoom-muted);
  font-size: 11px;
  line-height: 1.35;
}
.vehicle-zoom-status { font-size: 12px; text-align: center; }
.vehicle-zoom-panel.is-pending .vehicle-zoom-status,
.vehicle-zoom-status.is-pending { color: var(--zoom-amber); }
.vehicle-optics :focus-visible, .vehicle-zoom-panel :focus-visible {
  outline: 2px solid var(--zoom-amber);
  outline-offset: 1px;
}
@media (hover: hover) {
  .vehicle-optics button:not(:disabled):hover, .vehicle-zoom-panel button:not(:disabled):hover {
    background-color: rgb(255 255 255 / 16%);
  }
}
@media (pointer: coarse) {
  .vehicle-zoom-bar .vehicle-zoom-preset, .vehicle-zoom-bar .vehicle-lens-zoom,
  .vehicle-center-focus, .vehicle-zoom-panel .vehicle-zoom-stop, .vehicle-zoom-panel .vehicle-zoom-close {
    min-height: 44px; min-width: 44px;
  }
  .vehicle-zoom-heading { grid-template-columns: minmax(0,1fr) auto 44px; }
}
@container (max-width: 285px) {
  .vehicle-zoom-quick { display: none; }
  .vehicle-zoom-bar.has-preset .vehicle-zoom-value { display: inline; }
  .vehicle-zoom-quick:not([hidden]):not(:empty) + .vehicle-lens-zoom { margin-inline-start: 0; }
  .vehicle-zoom-quick:not([hidden]):not(:empty) + .vehicle-lens-zoom::before { display: none; }
  .vehicle-optics { inset-inline-start: 6px; max-width: calc(100% - 12px); gap: 3px; }
}
@container (max-width: 155px) {
  .vehicle-optics:has(.vehicle-zoom-bar:not([hidden])) .vehicle-center-focus {
    position: absolute;
    inset: auto auto calc(100% + 4px) 0;
  }
  .vehicle-optics:has(.vehicle-zoom-bar:not([hidden])) .vehicle-center-focus:not(:focus-visible) {
    clip-path: inset(100%);
    pointer-events: none;
  }
  .vehicle-lens-zoom .vehicle-zoom-icon { display: none; }
  .vehicle-lens-zoom .vehicle-zoom-value::after { content: "⌄"; margin-left: 3px; color: var(--zoom-muted); }
}
@media (max-width: 620px) and (orientation: portrait) {
  .vehicle-zoom-panel {
    --zoom-panel-width: min(364px, calc(100% - max(16px, env(safe-area-inset-left)) - max(16px, env(safe-area-inset-right))));
    left: 50%;
    bottom: var(--zoom-safe-bottom);
  }
}
@media (max-height: 330px) {
  .vehicle-zoom-panel { padding-block: 7px; bottom: 4px; max-height: calc(100% - 8px); }
  .vehicle-zoom-stops { margin-top: 2px; }
}
@media (prefers-reduced-motion: no-preference) {
  .vehicle-zoom-panel:not([hidden]) { animation: vehicle-zoom-reveal .14s ease-out; }
  @keyframes vehicle-zoom-reveal { from { opacity: 0; translate: 0 4px; } }
}
@media (forced-colors: active) {
  .vehicle-zoom-bar, .vehicle-center-focus, .vehicle-zoom-panel { border-color: ButtonText; }
  .vehicle-zoom-preset[aria-pressed="true"], .vehicle-zoom-stop[aria-pressed="true"] { outline: 1px solid Highlight; }
  .vehicle-zoom-range { appearance: auto; }
}
.vehicle-focus-reticle {
  position: absolute; z-index: 1; transform: translate(-50%, -50%);
  width: 38px; height: 38px; border: 1.5px solid #ffeaa0; border-radius: 8px;
  pointer-events: none; box-shadow: 0 0 2px #182330;
}
.vehicle-focus-reticle[data-status="applied"] { border-color: #83ecc7; }
.vehicle-focus-reticle:is([data-status="failed"],[data-status="expired"]) { border-color: #ffc2ab; }
.vehicle-lens-badge,.vehicle-lens-stats { position: absolute; z-index: 1; color: #f3f7fc; font-size: 11px; background: rgb(10 19 30 / 68%); border-radius: 3px; padding: 2px 6px; max-width: 80%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vehicle-lens-badge { top: 6px; left: 6px; }
.vehicle-lens-stats { right: 6px; bottom: 6px; display: none; }
.vehicle-live-screen:has(.vehicle-overlay:not([hidden])) .vehicle-lens-stats:not(:empty) { display: block; bottom: 45px; }
.vehicle-live-screen:has(.vehicle-overlay:not([hidden])) [data-dock-head="first"] .vehicle-lens-badge {
  top: max(48px, calc(45px + env(safe-area-inset-top)));
}
.vehicle-live-screen:has(.vehicle-overlay:not([hidden])) [data-dock-row="inner"] .vehicle-lens-stats { bottom: 12px; }
@container (max-width: 560px) {
  .vehicle-live-screen:has(.vehicle-overlay:not([hidden])) .vehicle-camera-tile .vehicle-lens-stats {
    inset: 7px 6px auto auto;
    max-width: min(62%, 185px);
  }
  .vehicle-live-screen:has(.vehicle-overlay:not([hidden])) .vehicle-camera-tile[data-dock-head="first"] .vehicle-lens-stats {
    top: max(48px, calc(45px + env(safe-area-inset-top)));
  }
}
@container (max-width: 155px) {
  .vehicle-live-screen:has(.vehicle-overlay:not([hidden])) .vehicle-camera-tile .vehicle-lens-stats {
    display: none;
  }
}
.vehicle-lens-hint { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: #bac9d8; padding: 8px; }
.vehicle-lenses { border-bottom: 1px solid #495568; padding: 0 0 10px; margin: 0 0 5px; }
.vehicle-lenses-head, .vehicle-lens-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vehicle-lenses-head h4 { margin: 0; font-size: 14px; }
.vehicle-lenses button { border: 1px solid #5a6d83; color: #f3f7fc; background: #233145; border-radius: 5px; padding: 4px 8px; min-height: 30px; }
.vehicle-lens-row { margin-top: 5px; }
.vehicle-lens-row label { display: flex; align-items: center; gap: 9px; min-height: 32px; cursor: pointer; overflow-wrap: anywhere; }
.vehicle-lens-row input { height: 18px; width: 18px; accent-color: #76c9ff; }
.vehicle-stage .vehicle-live-screen { --media-limit: var(--monitor-height); }
.vehicle-stage .vehicle-live-screen {
  width: min(100%, calc(var(--media-limit) * var(--display-ratio, 1.7778)));
  aspect-ratio: var(--display-ratio, 16 / 9);
  container-type: inline-size;
  isolation: isolate;
}
/* The grid is sized by the viewing window. Every feed fits its own cell. */
.vehicle-stage .vehicle-live-screen:is([data-mosaic="true"], [data-fit="cover"]) {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  container-type: size;
}
.vehicle-live-screen[data-fit="cover"] > :is(img, canvas),
.vehicle-live-screen[data-fit="cover"] .vehicle-lens-picture {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
/* A quarter-turned single feed fills the window with its two axes exchanged. */
.vehicle-live-screen[data-fit="cover"][data-sideways="true"] > :is(img, canvas),
.vehicle-live-screen[data-fit="cover"][data-sideways="true"] .vehicle-lens-picture {
  width: 100cqh;
  height: 100cqw;
}
.vehicle-live-screen .vehicle-camera-grid .vehicle-lens-picture[data-quarter-turn="true"] {
  width: 100cqh;
  height: 100cqw;
}
.vehicle-overlay {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  pointer-events: none;
  text-align: start;
  color: #fff;
  font: inherit;
}
/* Listening keeps its controls at the same positions as the video player. */
.vehicle-audio-scene:not([hidden]) {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 13px;
  background: radial-gradient(ellipse at center, #202b34, #10161c 70%);
  color: #c9d7df;
  font-size: 14px;
  letter-spacing: .04em;
  pointer-events: none;
}
.vehicle-audio-mark {
  display: grid;
  place-items: center;
  width: clamp(56px, 15cqw, 76px);
  aspect-ratio: 1;
  border: 1px solid #ffffff20;
  border-radius: 50%;
  background: #ffffff06;
}
.vehicle-audio-mark svg { width: 45%; }
#vehicle-picture-toggle[aria-pressed="true"] { color: #b8dee4; }
.vehicle-live-screen[data-audio-only="true"] :is(#vehicle-start-here, #vehicle-switch, #vehicle-orientation) { display: none; }
.vehicle-player-head, .vehicle-player-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding-inline: clamp(4px, 2cqw, 20px);
  text-shadow: 0 1px 4px rgb(0 0 0 / 74%);
}
.vehicle-player-head {
  padding-top: 2px;
  padding-bottom: clamp(5px, 2cqw, 18px);
  background: linear-gradient(180deg, rgb(0 0 0 / 67%), transparent);
}
.vehicle-player-bar {
  grid-row: 3;
  align-self: end;
  padding-top: clamp(12px, 4cqw, 40px);
  padding-bottom: clamp(2px, 1cqw, 10px);
  background: linear-gradient(0deg, rgb(0 0 0 / 80%), rgb(0 0 0 / 46%) 54%, transparent);
}
.vehicle-command {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 38px;
  min-height: 42px;
  padding: 0 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-shadow: inherit;
  touch-action: manipulation;
  pointer-events: auto;
}
.vehicle-command svg {
  display: block;
  flex: none;
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 55%));
}
.vehicle-command:focus-visible { outline: 2px solid #b6e6ff; outline-offset: -2px; }
.vehicle-command:active { background: rgb(255 255 255 / 24%); }
@media (hover: hover) {
  .vehicle-command:hover { background: rgb(255 255 255 / 15%); }
}
.vehicle-command .vehicle-active-icon,
.vehicle-command[aria-pressed="true"] .vehicle-default-icon { display: none; }
.vehicle-command[aria-pressed="true"] .vehicle-active-icon { display: block; }
.vehicle-command-name { white-space: nowrap; font-size: 13px; line-height: 1.1; }
.vehicle-air { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; }
.vehicle-air i { width: 7px; height: 7px; border-radius: 50%; background: #ff625d; }
.vehicle-player-spacer { flex: 1; }
.vehicle-talk-end {
  position: absolute; z-index: 1; top: max(7px, env(safe-area-inset-top)); right: 9px;
  border: 1px solid #e7a5a0; border-radius: 6px; background: #7b2521; color: #fff;
  padding: 5px 10px; min-height: 34px; font: inherit; font-size: 13px; cursor: pointer;
}
.vehicle-live-screen:has(.vehicle-overlay:not([hidden])) .vehicle-talk-end { display: none; }
#vehicle-talk[aria-pressed="true"] { color: #ffbcb5; }
.vehicle-start-here {
  position: absolute; inset: auto auto 22% 50%; z-index: 1; transform: translateX(-50%);
  pointer-events: auto; color: white; background: #263747; border: 1px solid #8394a6;
  border-radius: 6px; padding: 8px 14px; font: inherit; margin: 4px;
}
.vehicle-settings-panel {
  position: absolute;
  z-index: 2;
  inset: 0 0 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(100%, 310px);
  padding: 0 12px 6px;
  overflow: hidden;
  background: rgb(15 22 31 / 96%);
  color: white;
  pointer-events: auto;
  text-align: start;
  overscroll-behavior: contain;
}
.vehicle-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vehicle-sheet-head h3 { font-size: 15px; margin: 0; }
.vehicle-settings-body { min-height: 0; overflow-y: auto; scrollbar-width: thin; overscroll-behavior: contain; }
.vehicle-settings-fields { display: grid; gap: 2px; }
.vehicle-settings-fields label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 13px; min-height: 42px; color: #d4dce7;
}
.vehicle-settings-fields select, .vehicle-settings-actions .button {
  border: 1px solid #4a5769;
  border-radius: 6px;
  background: #263244;
  color: white;
  font: inherit;
  font-size: 13px;
  min-height: 36px;
  padding: 5px 8px;
}
.vehicle-settings-fields select { width: min(73%, 175px); }
.vehicle-settings-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.vehicle-settings-body .vehicle-monitor-status {
  margin: 6px 0;
  padding: 0; color: #c0cada; font-size: 12px; line-height: 1.5;
}
.vehicle-photo-choices button {
  display:block; width:100%; margin:8px 0; border:1px solid #526074;
  border-radius:6px; min-height:42px; color:white; background:#263244; font:inherit;
}
.vehicle-monitor-status span:not(:empty) + span:not(:empty)::before { content: " · "; }
@container (max-width: 500px) {
  .vehicle-player-bar :is(#vehicle-switch, #vehicle-orientation) .vehicle-command-name { display: none; }
}
@container (max-width: 410px) {
  .vehicle-player-bar { gap: 1px; }
  .vehicle-player-bar .vehicle-command { padding-inline: 5px; }
}
@container (max-width: 345px) {
  .vehicle-command { min-width: 36px; }
  .vehicle-command-name { display: none; }
}
@container (max-width: 220px) {
  .vehicle-player-bar { padding-inline: 1px; gap: 0; justify-content: space-between; }
  .vehicle-player-bar .vehicle-command { min-width: 28px; padding-inline: 2px; }
  .vehicle-command svg { width: 18px; height: 18px; }
}
.vehicle-dialog[data-view="live"][data-expanded="true"], .vehicle-stage:fullscreen {
  --monitor-height: 100vh;
  --monitor-height: 100dvh;
  width: 100%;
  max-width: none;
  height: var(--monitor-height);
  max-height: none;
  margin: auto;
  background: #0a1019;
}
.vehicle-player-head, .vehicle-player-bar {
  padding-left: max(clamp(4px, 2cqw, 20px), env(safe-area-inset-left));
  padding-right: max(clamp(4px, 2cqw, 20px), env(safe-area-inset-right));
}
.vehicle-player-head { padding-top: max(2px, env(safe-area-inset-top)); }
.vehicle-player-bar { padding-bottom: max(clamp(2px, 1cqw, 10px), env(safe-area-inset-bottom)); }
.vehicle-settings-panel {
  padding-top: env(safe-area-inset-top);
  padding-right: max(12px, env(safe-area-inset-right));
  padding-bottom: max(6px, env(safe-area-inset-bottom));
}
/* Replay always fits the entire decoded frame, including camera orientation metadata. */
.vehicle-dialog[data-view="playback"] {
  box-sizing: border-box;
  width: min(1200px, calc(100% - 16px));
  height: min(840px, calc(100vh - 16px));
  height: min(840px, calc(100dvh - 16px));
  max-height: none; padding: 0; overflow: hidden;
}
.vehicle-dialog[data-view="playback"] > .vehicle-dialog-head { display: none; }
.vehicle-dialog[data-view="playback"][open] { display: flex; flex-direction: column; }
#vehicle-playback-view:not([hidden]) {
  display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; overflow: hidden;
  box-sizing: border-box; background: white; color: #182337;
  padding: 0 max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
}
.record-header {
  display: flex; flex: none; align-items: center; justify-content: space-between;
  gap: 10px; padding-block: max(4px, env(safe-area-inset-top)) 4px;
}
.record-header > div { min-width: 0; }
.record-header h2 { margin: 0; font-size: 18px; }
.record-header #vehicle-playback-dismiss { flex: none; min-height: 40px; }
.record-header .vehicle-filename { font-size: 12px; line-height: 1.4; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#vehicle-player {
  display: grid; flex: 1 1 0; min-height: 0; min-width: 0; overflow: hidden;
  grid-template-rows: minmax(0, 1fr) auto; align-items: stretch; justify-items: stretch;
  border-radius: 0;
  background: #080d13;
}
#vehicle-player > :is(img, video) {
  display: block; width: 100%; height: 100%; min-height: 0; min-width: 0;
  object-fit: contain; object-position: center center;
}
#vehicle-playback-view:fullscreen { width: 100%; height: 100%; }
#vehicle-playback-status { flex: none; font-size: 13px; }
#vehicle-playback-status:empty { display: none; }
@media (max-width:640px), (orientation:landscape) and (max-height:600px) {
  .vehicle-dialog[data-view="playback"] { width:100%; height:100vh; height:100dvh; max-width:none; border:0; border-radius:0; }
}
.vehicle-screen p { padding: 12px; }
.vehicle-live-foot { margin-top: 14px; }
.vehicle-help, #vehicle-playback-status, .vehicle-dialog .notice { margin-top: 12px; }
.vehicle-list { list-style: none; padding: 0; margin: 12px 0; }
.vehicle-device-row { border-top: 1px solid var(--border); padding: 10px 0; flex-wrap: wrap; }
.vehicle-device-row span { word-break: break-word; }
.vehicle-startup[aria-checked="true"]:enabled { border-color: var(--blue); }
.vehicle-pairing { margin-top: 16px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; }
.vehicle-pairing label { display: block; margin: 10px 0 4px; font-size: 13px; }
.vehicle-pairing input { display: block; width: 100%; font-size: 16px; }
.vehicle-pairing .vehicle-actions, .vehicle-pairing .muted { margin-top: 10px; }
.vehicle-filename { margin-bottom: 10px; overflow-wrap: anywhere; }
.file-actions { flex-wrap: wrap; }
@media (max-width: 560px) {
  .vehicle-entry { align-items: flex-start; flex-direction: column; padding: 16px; }
  .vehicle-chooser, .vehicle-live-foot { gap: 8px; }
  .vehicle-chooser label { width: 100%; }
}

.record-timeline { flex: none; padding: 8px 12px 6px; text-align:start; color: #f2f4f9; background: #172331; }
.record-toolbar, .record-marker-legend, .record-event, .record-jump {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.record-toolbar { gap: 6px; }
.record-command {
  min-height: 40px; padding: 4px 10px; border: 0; background: transparent;
  color: white; font: inherit; font-size: 14px; cursor: pointer;
}
.record-command:hover, .record-command:focus-visible { background: #31475f; border-radius: 4px; }
.record-toolbar .record-time { margin-left: auto; }
.record-details { flex: none; color: #182337; min-width: 0; }
.record-details summary { padding: 6px 0; font-weight: 600; cursor: pointer; }
.record-offset { color: #48596f; }
.record-scrubber { position: relative; height: 36px; padding: 0; margin: 0 2px; }
.record-marker-rail {
  z-index: 1; position: absolute; inset: 0 9px; pointer-events: none;
}
.record-pin-lane { position: absolute; inset: 0; pointer-events: none; }
.record-mark {
  position: absolute; top: 0;
  width: 12px; height: 17px; transform: translateX(-50%); padding: 0;
  border: none; background: transparent; pointer-events: auto; cursor: pointer; touch-action: none;
}
.record-mark::after {
  position: absolute; inset: 1px 2px 0; content: ""; background: var(--marker-color);
  border: 1px solid white; clip-path: polygon(0 0,100% 0,100% 58%,50% 100%,0 58%);
}
.record-mark[data-side="below"]::after { transform: rotate(180deg); }
.record-mark[data-kind="vibration"], .record-chip[data-kind="vibration"] { --marker-color: #c04128; }
.record-mark[data-kind="motion"], .record-chip[data-kind="motion"] { --marker-color: #1567be; }
.record-mark[data-kind="sound"], .record-chip[data-kind="sound"] { --marker-color: #8750aa; }
.record-mark[data-kind="manual"], .record-chip[data-kind="manual"] { --marker-color: #187863; }
.record-range {
  position: absolute; top: 50%; left: 0; transform: translateY(-50%); margin: 0; padding: 0; width: 100%; height: 36px;
  background: transparent; accent-color: #58c6f6; cursor: pointer; touch-action: pan-y;
}
.record-marker-legend { font-size: 12px; margin-top: 6px; }
.record-chip { display: inline-flex; align-items: center; gap: 4px; }
.record-chip::before { content: ""; height: 9px; width: 9px; border-radius: 50%; background: var(--marker-color); }
.record-time, .record-wall-time, .record-offset { font-variant-numeric: tabular-nums; }
.record-time { font-size: 12px; }
.record-event-list {
  max-height: min(24vh, 220px); max-height: min(24dvh, 220px);
  overflow: auto; overscroll-behavior: contain; margin: 4px 0 0; padding: 0; list-style: none;
}
@media (max-height:500px) {
  .record-header { padding-block: 1px; }
  .record-header h2 { font-size: 15px; }
  .record-header #vehicle-playback-dismiss { min-height: 32px; padding: 2px 10px; }
  .record-timeline { padding-block: 0; }
  .record-command { min-height: 30px; }
  .record-details summary { padding: 2px 0; }
  .record-marker-legend { display: none; }
  .record-event-list { max-height: min(18vh, 76px); max-height: min(18dvh, 76px); }
}
.record-event { border-top: 1px solid #d5dfed; justify-content: space-between; }
.record-jump { min-height: 42px; background: transparent; border: none; text-align: left; color: inherit; font: inherit; font-size: 13px; padding: 4px 2px; }
.record-jump:hover, .record-jump:focus-visible { text-decoration: underline; }
