﻿:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  color: #eef2fc;
  background: #101624;
  --surface: #171f30;
  --surface-raised: #1d273a;
  --sidebar: #111827;
  --ink: #eef2fc;
  --muted: #9caec7;
  --line: #2a364b;
  --accent: #d8f776;
  --mist: #7d91ad;
  --route: #79e6cd;
  --radius: 15px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .47; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 5; padding: .65rem 1rem; background: var(--accent); color: #111825; transform: translateY(-160%); }
.skip-link:focus { transform: none; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 207px; z-index: 2;
  display: flex; flex-direction: column; padding: 33px 17px 19px;
  background: var(--sidebar); border-right: 1px solid #253044;
}
.brand { display: flex; gap: 11px; align-items: center; padding-left: 6px; }
.brand strong { display: block; font-size: 1.12rem; letter-spacing: -.055em; font-weight: 750; }
.brand div span, .sidebar-footer div span { display: block; margin-top: 3px; color: var(--muted); font-size: .76rem; }
.brand-mark { position: relative; display: grid; place-items: center; width: 35px; height: 35px; flex: 0 0 35px; background: var(--accent); border-radius: 11px; }
.brand-mark i { position: absolute; width: 3px; border-radius: 3px; background: #192720; transform: rotate(30deg); }
.brand-mark i:nth-child(1) { height: 11px; left: 11px; top: 14px; }
.brand-mark i:nth-child(2) { height: 16px; left: 16px; top: 9px; }
.brand-mark i:nth-child(3) { height: 11px; left: 22px; top: 8px; }
.sidebar nav { margin-top: 48px; display: grid; gap: 7px; }
.sidebar nav a { min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid transparent; color: var(--muted); border-radius: 10px; font-size: .875rem; font-weight: 600; text-decoration: none; }
.sidebar nav a:not([aria-disabled]):hover { background: var(--surface-raised); color: var(--ink); }
.sidebar nav a[aria-current] { background: #252e2e; color: var(--accent); border-color: #394537; }
.sidebar nav a[aria-disabled="true"] { opacity: .5; cursor: default; }
.nav-icon { display: block; width: 15px; height: 15px; flex: 0 0 15px; position: relative; }
.nav-grid { border: 1px solid currentColor; border-radius: 3px; background: linear-gradient(currentColor,currentColor) 50% 0 / 1px 100% no-repeat, linear-gradient(currentColor,currentColor) 0 50% / 100% 1px no-repeat; }
.nav-route::before { content: ""; position: absolute; inset: 3px 4px; border: 1px solid currentColor; border-top: 0; border-bottom: 0; transform: skew(-27deg); }
.nav-route::after { content: ""; position: absolute; inset: 1px 1px auto auto; width: 5px; height: 5px; border: 1px solid currentColor; border-radius: 99px; box-shadow: -8px 8px 0 -1px var(--sidebar), -8px 8px 0 0 currentColor; }
.sidebar-footer { display: flex; align-items: center; gap: 9px; padding: 15px 5px 0; margin-top: auto; border-top: 1px solid #293448; }
.sidebar-footer strong { font-size: .84rem; }
.operator-mark { display: grid; width: 32px; height: 32px; place-items: center; background: #27364d; color: #c9dbf4; border-radius: 10px; font-size: .875rem; font-weight: 700; }

.workspace { margin-left: 207px; max-width: 1900px; padding: 30px 28px 45px; }
.page-intro { min-height: 65px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 21px; }
.page-intro h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.1; font-weight: 730; letter-spacing: -.055em; }
.page-intro p { color: var(--muted); margin-top: 8px; font-size: .94rem; }
.page-actions, .source { display: flex; align-items: center; gap: 10px; }
.source { gap: 8px; font-size: .88rem; color: var(--muted); }
.source select, .refresh { min-height: 39px; border-radius: 9px; font-size: .86rem; font-weight: 650; white-space: nowrap; }
.source select {
  appearance: none; padding: 0 24px 0 9px; color: var(--ink); background: #1b2435;
  background-image: linear-gradient(45deg, transparent 50%, #b2c2da 50%), linear-gradient(135deg, #b2c2da 50%, transparent 50%);
  background-position: right 12px center, right 8px center; background-size: 4px 4px; background-repeat: no-repeat;
  border: 1px solid #344058;
}
.refresh { border: 1px solid var(--accent); background: var(--accent); color: #202916; padding: 0 13px; }
.refresh:hover:not(:disabled) { background: #ebffb0; }
.refresh span { margin-right: 3px; font-size: 1.15rem; line-height: 1; }

.overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 19px; }
.management { margin-bottom: 14px; }
.management summary { padding: 12px 15px; cursor: pointer; font-weight: 650; }
.management summary:hover { color: var(--accent); }
.management-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 15px; padding: 0 15px 15px; }
.management form { display: grid; gap: 8px; align-content: start; padding: 12px; background: #141c2b; border: 1px solid var(--line); border-radius: 10px; }
.management h2 { font-size: 1rem; margin-bottom: 4px; }
.management label, .form-result { color: var(--muted); font-size: .875rem; }
.management input, .management select { min-width: 0; width: 100%; padding: 8px 10px; border: 1px solid #33415a; border-radius: 8px; color: var(--ink); background: #101827; }
.management button { justify-self: start; margin-top: 5px; }
.form-result:empty { display: none; }
.report-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.report-form label { color: var(--muted); font-size: .875rem; }
.report-form input { width: 6rem; min-height: 39px; border: 1px solid #33415a; border-radius: 8px; background: #101827; color: var(--ink); padding: 6px 8px; }
.report-events { padding: 0; margin: 9px 0 0; list-style: none; }
.report-events:empty { display: none; }
.report-events li { padding: 9px; border-top: 1px solid var(--line); }
.report-events p { color: var(--muted); font-size: .875rem; margin-top: 5px; }
.stat { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-height: 89px; padding: 12px 16px; --signal: #9cb6e8; }
.stat span { position: relative; z-index: 1; color: var(--muted); font-size: .875rem; }
.stat strong { display: block; margin-top: 4px; font-size: 1.9rem; font-weight: 680; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.06em; }
.stat-online { --signal: #79e6cd; }
.stat-offline { --signal: #ffb091; }
.stat-unknown { --signal: #a7b6d0; }
.stat-mark { position: absolute; right: 16px; bottom: 15px; width: 27px; height: 27px; border: 1px solid var(--signal); color: var(--signal); border-radius: 8px; }
.stat-mark::after { content: ""; position: absolute; width: 7px; height: 7px; inset: 9px; border: 1px solid currentColor; border-radius: 50%; }
.stat-online .stat-mark::after { background: currentColor; }
.stat-offline .stat-mark::after { width: 10px; height: 0; left: 7px; top: 12px; border-width: 1px 0 0; border-radius: 0; }
.stat-unknown .stat-mark::after { width: 9px; height: 9px; inset: 8px; border-style: dashed; }

.operator-grid { display: grid; grid-template-columns: minmax(224px, 251px) minmax(0, 1fr); align-items: start; gap: 14px; }
.details { min-width: 0; }
.detail-stack { display: grid; grid-template-columns: minmax(0,1fr) minmax(214px, 244px); align-items: start; gap: 14px; }
.devices, .panel { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.devices { min-height: calc(clamp(21rem, 43vh, 33rem) + 6.9rem); }
.devices-header { padding: 15px 12px 11px; }
.devices-title { display: flex; align-items: center; gap: .5rem; margin: 0 2px 13px; }
.devices h2, .history h2, .route-header h2 { font-size: 1.125rem; letter-spacing: -.025em; font-weight: 680; }
.count { margin-left: auto; color: #c2d1e8; background: #29374e; min-width: 26px; padding: 3px 7px; border-radius: 30px; text-align: center; font-size: .78rem; font-variant-numeric: tabular-nums; }
.search-field { position: relative; }
.search-field span { position: absolute; left: 12px; top: 12px; width: 11px; height: 11px; border: 1.5px solid #adbbd0; border-radius: 50%; pointer-events: none; }
.search-field span::after { content: ""; position: absolute; top: 8px; left: 7px; width: 6px; height: 1.5px; background: #adbbd0; transform: rotate(45deg); }
.search-field input { width: 100%; min-height: 37px; padding: 7px 10px 7px 32px; background: #101827; color: var(--ink); border: 1px solid #33415a; border-radius: 8px; font-size: .875rem; }
.search-field input::placeholder { color: var(--muted); }
.filters { display: flex; gap: 5px; margin-top: 11px; }
.filters button { border: 1px solid transparent; background: transparent; padding: 4px 7px; color: var(--muted); font-size: .8rem; border-radius: 7px; font-weight: 620; }
.filters button:hover { background: #202b3e; color: var(--ink); }
.filters button[aria-pressed="true"] { border-color: #3e4d66; background: #27344b; color: var(--ink); }
.device-list { list-style: none; padding: 1px 9px 12px; margin: 0; }
.device-list:empty { padding: 0; }
.device-list li + li { margin-top: 5px; }
.device-button { display: grid; grid-template-columns: 28px minmax(0,1fr); column-gap: 8px; align-items: center; width: 100%; min-width: 0; padding: 8px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink); text-align: left; }
.device-button:hover { background: #202c41; }
.device-button[aria-pressed="true"] { background: #242e39; border-color: #536044; box-shadow: inset 2px 0 var(--accent); }
.device-icon { width: 28px; height: 28px; position: relative; grid-row: span 2; display: block; border-radius: 8px; background: #26364d; color: #a5bbdf; }
.device-icon::before { content: ""; position: absolute; width: 15px; height: 8px; top: 8px; left: 6px; border: 1.2px solid currentColor; border-radius: 2px 4px 2px 2px; box-shadow: inset -5px 0 #213048; }
.device-icon::after { content: ""; position: absolute; left: 8px; top: 15px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; box-shadow: 8px 0 currentColor; }
.device-button[aria-pressed="true"] .device-icon { background: #35443a; color: var(--accent); }
.device-text { min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 1px 7px; }
.device-text strong { font-size: .9rem; line-height: 1.3; overflow-wrap: anywhere; }
.device-text small { color: var(--mist); font-size: .74rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.badge { color: #b6c5da; display: inline-flex; align-items: center; gap: 6px; width: fit-content; white-space: nowrap; font-size: .76rem; font-weight: 650; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge[data-status="online"] { color: #8ae5ce; }
.badge[data-status="offline"] { color: #ffb295; }
.device-button .badge { margin-top: 3px; }
.list-message { padding: 5px 15px 18px; }
.state-text { color: var(--muted); line-height: 1.5; }
.state-text strong { display: block; color: var(--ink); font-size: .94rem; }
.state-text p { margin-top: 6px; font-size: .87rem; }
.detail-message { min-height: 24rem; padding: 20px; display: grid; place-items: center; text-align: center; }

.route-panel { min-width: 0; }
.route-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 15px 12px; }
.route-header p, .history-header p { color: var(--muted); font-size: .82rem; margin-top: 4px; line-height: 1.45; }
.plot-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 11px; font-size: .76rem; color: var(--muted); padding-top: 4px; }
.plot-legend span { display: inline-flex; gap: 5px; align-items: center; }
.plot-legend i { display: inline-block; height: 2px; width: 14px; border-radius: 4px; background: var(--route); }
#current-legend i { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; }
.plot, .route-empty { position: relative; height: clamp(21rem, 43vh, 33rem); background: #111c2c; border-block: 1px solid var(--line); overflow: hidden; }
.route-map { position: absolute; inset: 0; z-index: 0; background: radial-gradient(#324057 1px, transparent 1px), #182335; background-size: 16px 16px; }
.route-map .leaflet-tile-pane { filter: saturate(.72); }
.route-map .leaflet-control-attribution, .route-map .leaflet-control-scale-line { background: #172233; color: #d6e3f5; }
.route-map .leaflet-control-attribution a { color: #9ef1d7; }
.route-map .leaflet-control-scale-line { border-color: #a8bad2; text-shadow: none; }
.map-message { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 1; width: fit-content; padding: 5px 8px; border: 1px solid #41516a; border-radius: 6px; background: #172233; color: #eaf2ff; font-size: .8rem; pointer-events: none; }
.zoom-tools { position: absolute; display: grid; z-index: 2; right: 10px; bottom: 27px; gap: 4px; }
.zoom-tools button { width: 34px; height: 32px; background: #19243a; color: var(--ink); border: 1px solid #42536b; border-radius: 7px; font-size: 1.11rem; }
.zoom-tools button:hover:not(:disabled) { background: #293a54; }
.route-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding: 10px 15px; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.route-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 1rem; text-align: center; background-image: radial-gradient(#314058 1px,transparent 1px); background-size: 16px 16px; }
.route-empty p { font-size: .875rem; color: var(--muted); }
.route-empty-mark { border: 1px dashed #8295b3; border-radius: 100%; width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 6px; }
.route-empty-mark::after { content: ""; width: 8px; height: 8px; border: 1px solid #b6c7df; border-radius: 100%; }

.position { padding: 16px; min-height: 260px; }
.position-header { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; margin-bottom: 16px; }
.position-header h2 { font-size: 1.26rem; letter-spacing: -.04em; overflow-wrap: anywhere; }
.position-header p { color: var(--muted); margin-top: 3px; font-size: .76rem; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.connection .badge { border: 1px solid #35465b; padding: 3px 8px; background: #1d2839; border-radius: 30px; }
.position h3 { font-size: .86rem; margin-bottom: 9px; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; margin: 0; }
.metrics > div { min-width: 0; border: 1px solid #2d3950; border-radius: 9px; padding: 8px; background: #141c2b; }
.metrics .metric-hero { grid-column: 1 / -1; padding: 10px 11px 12px; background: #243132; border-color: #3c5145; }
.metric-hero dd { color: var(--accent); font-size: 1.85rem; letter-spacing: -.055em; }
.metrics .metric-time { grid-column: 1 / -1; }
.metrics dt { color: var(--muted); font-size: .75rem; }
.metrics dd { margin: 3px 0 0; font-size: .9rem; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metrics .metric-hero dd { font-size: 1.8rem; }
.speed-chart { margin-top: 13px; padding: 10px 8px 5px; background: #141c2b; border: 1px solid #2d3950; border-radius: 9px; }
.speed-chart > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.speed-chart h3 { margin: 0; font-size: .76rem; }
.speed-chart span { color: var(--muted); font-size: .73rem; font-variant-numeric: tabular-nums; }
.speed-chart canvas { display: block; width: 100%; height: 47px; margin-top: 4px; }
#last-seen { margin-top: 12px; font-size: .76rem; line-height: 1.45; color: var(--mist); }

.history { grid-column: 1 / -1; min-width: 0; padding: 14px 15px; scroll-margin-top: 14px; }
.history-header { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.table-wrap { overflow: auto; max-height: 21rem; margin-top: 11px; border: 1px solid var(--line); border-radius: 9px; }
.history-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; font-variant-numeric: tabular-nums; }
.history-table th, .history-table td { padding: 9px 10px; white-space: nowrap; border-bottom: 1px solid #273349; }
.history-table th { position: sticky; top: 0; background: #202b3d; color: #b8c9e2; font-weight: 600; }
.history-table td { color: #d8e3f3; }
.history-table tbody tr:nth-child(even) { background: #151e2d; }
.history-table tbody tr:last-child td { border-bottom: 0; }
.point-button { color: var(--route); font-weight: 650; background: transparent; border: 0; border-radius: 4px; padding: 0 3px; margin: 0 -3px; text-align: left; }
.point-button:hover { text-decoration: underline; }
.point-button[aria-pressed="true"] { background: #37314b; color: #e0c9ff; }
.history-table tbody tr:has(.point-button[aria-pressed="true"]) { background: #29253a; }
.history-content-empty { margin-top: 10px; padding: 12px; background: #131b2a; border-radius: 9px; }

@media (max-width: 1240px) {
  .sidebar { width: 173px; padding-inline: 10px; }
  .workspace { margin-left: 173px; padding-inline: 20px; }
  .operator-grid { grid-template-columns: minmax(185px,215px) minmax(0,1fr); }
  .detail-stack { grid-template-columns: minmax(0,1fr) minmax(182px,220px); }
  .position { padding: 13px; }
}
@media (max-width: 1030px) {
  .sidebar { position: static; width: 100%; flex-direction: row; align-items: center; justify-content: space-between; padding: 12px 19px; border: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { margin: 0; display: flex; }
  .sidebar-footer { display: none; }
  .workspace { margin-left: 0; padding-top: 19px; }
}
@media (max-width: 828px) {
  .detail-stack { grid-template-columns: minmax(0,1fr); }
  .position { min-height: 0; }
  .metrics { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .metrics .metric-hero, .metrics .metric-time { grid-column: auto; }
  .metrics .metric-hero { padding: 8px; }
  .metrics .metric-hero dd { font-size: 1.05rem; letter-spacing: -.02em; }
}
@media (max-width: 640px) {
  .sidebar { flex-wrap: wrap; gap: 12px; padding: 11px 14px 7px; }
  .brand { padding-left: 0; }
  .sidebar nav { gap: 3px; }
  .sidebar nav a { padding: 6px; min-height: 33px; font-size: .8rem; }
  .nav-icon { display: none; }
  .workspace { padding: 18px 12px 24px; }
  .page-intro { flex-wrap: wrap; margin-bottom: 14px; gap: 12px; }
  .page-intro p { font-size: .85rem; }
  .page-actions { width: 100%; justify-content: space-between; gap: 6px; }
  .source { gap: 6px; }
  .source select { max-width: min(52vw, 15rem); }
  .overview { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; margin-bottom: 10px; }
  .stat { min-height: 72px; padding: 8px 9px; }
  .stat span { font-size: .8rem; }
  .stat strong { font-size: 1.55rem; }
  .stat-mark { right: 9px; bottom: 9px; opacity: .75; }
  .operator-grid { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .detail-stack { gap: 10px; }
  .devices { min-height: 0; }
  .device-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 3px; }
  .device-list li + li { margin: 0; }
  .device-button { column-gap: 6px; padding: 6px; }
  .device-text small { font-size: .69rem; }
  .plot, .route-empty { height: clamp(230px, 65vw, 350px); }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 380px) {
  .page-actions { flex-wrap: wrap; }
  .source select { max-width: 64vw; }
  .device-list { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  .sidebar nav a, .device-button, .filters button, .refresh { transition: background-color .16s, border-color .16s, color .16s; }
}

.auth-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
}
.auth-card {
  width: min(100%, 28rem);
  padding: clamp(18px, 5vw, 32px);
}
.auth-card .brand { margin-bottom: 26px; }
.auth-card h1 { margin: 0 0 12px; font-size: clamp(1.4rem, 5vw, 1.85rem); }
.auth-card #auth-status:empty { display: none; }
.auth-card #auth-status { margin: 0 0 14px; }
.auth-form { display: grid; gap: 8px; }
.auth-form label { color: var(--muted); font-size: .9rem; }
.auth-form input {
  min-width: 0;
  width: 100%;
  margin-bottom: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-raised);
  color: var(--ink);
}
.auth-form button { margin-top: 4px; }
.fixture-notice { color: var(--accent); font-size: .82rem; }
.auth-card .fixture-notice { margin-bottom: 10px; }
.session-bar {
  display: flex;
  align-items: center;
  gap: 8px 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.session-bar > div { margin-right: auto; min-width: 0; overflow-wrap: anywhere; }
.session-bar > div p { margin-top: 3px; color: var(--muted); font-size: .83rem; }
.session-bar .form-result:empty { display: none; }
.registry-grid {
  display: grid;
  grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  margin-bottom: 14px;
}
.registry-grid > section { padding: 16px; min-width: 0; }
.registry-grid h2 { font-size: 1.1rem; margin-bottom: 10px; }
.registry-grid .form-result:empty { display: none; }
.registry-grid .form-result { margin-bottom: 8px; }
.fleet-tree-list { list-style: none; padding: 0; margin: 5px 0 0; }
.fleet-tree-list .fleet-tree-list { margin-left: .65rem; padding-left: .55rem; border-left: 1px solid var(--line); }
.fleet-tree-button {
  display: block;
  width: 100%;
  padding: 8px 9px;
  margin-top: 3px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  overflow-wrap: anywhere;
}
.fleet-tree-button:hover, .fleet-tree-button[aria-pressed="true"] { background: var(--surface-raised); }
.fleet-tree-button[aria-pressed="true"] { color: var(--accent); border-color: var(--line); }
.vehicle-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 10px;
}
.vehicle-card { min-width: 0; padding: 12px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 9px; overflow-wrap: anywhere; }
.vehicle-card h3 { font-size: 1rem; }
.vehicle-card p, .vehicle-card dt { margin-top: 4px; color: var(--muted); font-size: .83rem; }
.vehicle-card dl { margin: 10px 0 0; }
.vehicle-card dd { margin: 3px 0 0; font-size: .9rem; }
.terminal-link { margin: 3px 4px 0 0; padding: 4px 7px; color: var(--accent); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.terminal-link:hover { border-color: var(--accent); }
.data-origin {
  display: inline-block;
  width: fit-content;
  padding: .3rem .55rem;
  border: 1px solid #406056;
  border-radius: 8px;
  background: #213530;
  color: #a6e9d7;
  font-size: .84rem;
}
.origin-synthetic { border-color: #635180; background: #332640; color: #e1c8fd; }
#demo-origin { margin: 0 0 12px; }
.workbench-panel { margin: 0 0 14px; padding: 16px; min-width: 0; }
.workbench-panel h2 { margin: 0 0 10px; font-size: 1.14rem; }
.workbench-panel p + form, .workbench-panel #connection-enrollment { margin-top: 12px; }
.workbench-status { margin: 8px 0 12px; color: var(--muted); font-size: .88rem; }
.workbench-status:empty { display: none; }
.workbench-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 12px;
}
#operations-metrics { margin-bottom: 14px; }
.workbench-card { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-raised); min-width: 0; }
.workbench-card h3 { margin-bottom: 8px; font-size: 1rem; overflow-wrap: anywhere; }
.workbench-card p { margin: 4px 0; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.workbench-card .issue-note { white-space: pre-wrap; color: var(--ink); }
.workbench-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 2px; }
.workbench-actions .refresh { white-space: normal; }
.workbench-badge {
  display: inline-block; padding: .25rem .5rem; border-radius: 999px; background: #2b3a51; color: #dce7f6;
  font-size: .82rem; font-weight: 650;
}
.workbench-badge:is([data-state="ready"], [data-state="ok"], [data-state="healthy"], [data-state="passed"], [data-state="pass"]) {
  background: #244a3b; color: #b5f4da;
}
.workbench-badge:is([data-state="critical"], [data-state="high"], [data-state="failed"], [data-state="fail"], [data-state="blocked"], [data-state="error"]) {
  background: #542c40; color: #ffc9d7;
}
.workbench-badge:is([data-state="warning"], [data-state="medium"], [data-state="degraded"], [data-state="pending"]) {
  background: #473a26; color: #ffe0a3;
}
.workbench-checks { list-style: none; margin: 8px 0 0; padding: 0; }
.workbench-checks li { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.workbench-checks small { display: block; margin-top: 2px; color: var(--muted); font-size: .78rem; }
.workbench-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.workbench-form label, .issue-dialog label { display: grid; gap: 5px; color: var(--muted); font-size: .88rem; min-width: 0; }
.workbench-form :is(input, select), .issue-dialog textarea {
  width: 100%; min-height: 39px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-raised); color: var(--ink); font: inherit;
}
.workbench-form select { max-width: min(100%, 26rem); }
.workbench-table td { white-space: normal; overflow-wrap: anywhere; }
.workbench-table td:first-child { white-space: nowrap; }
.workbench-table .evidence-selected { outline: 2px solid var(--accent); outline-offset: -2px; }
#trip-archive video { display: block; width: min(100%, 56rem); max-height: 65vh; margin: 8px 0; background: #080c16; }
.issue-dialog { width: min(calc(100% - 28px), 28rem); padding: 18px; color: var(--ink); }
.issue-dialog h2 { margin-bottom: 6px; font-size: 1.2rem; }
.issue-dialog p { margin-bottom: 10px; }
.issue-dialog textarea { margin-top: 4px; resize: vertical; }
.issue-dialog::backdrop { background: #060b14bf; }
.sidebar { overflow-y: auto; }
.case-layout {
  display: grid;
  grid-template-columns: minmax(11rem, 16rem) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}
.case-create summary { cursor: pointer; font-weight: 650; }
.case-create summary:hover { color: var(--accent); }
.case-create form, .case-subsection form, #rule-editor { margin-top: 12px; }
.case-list { display: grid; gap: 5px; }
.case-list-button {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  overflow-wrap: anywhere;
}
.case-list-button:hover, .case-list-button[aria-pressed="true"] { background: var(--surface-raised); }
.case-list-button[aria-pressed="true"] { border-color: var(--line); color: var(--accent); }
.case-list-button small { display: block; margin-top: 3px; font-size: .8rem; color: var(--muted); }
.case-download { display: inline-flex; align-items: center; margin: 8px 0; text-decoration: none; }
.case-subsection { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.case-subsection h3, #rule-editor h3 { font-size: 1rem; }
.case-subsection .table-wrap { margin-top: 8px; }
.case-recordings { display: grid; gap: 6px; margin: 8px 0 0; padding-left: 18px; font-size: .9rem; }
.case-recordings a { color: var(--accent); overflow-wrap: anywhere; }
.case-note-field { flex: 1 1 12rem; }
.case-note-field textarea {
  width: 100%;
  min-height: 39px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--ink);
  font: inherit;
  resize: vertical;
}
.workbench-form .case-checkbox { display: flex; align-items: center; gap: 5px; min-height: 39px; }
.case-checkbox input { width: auto; min-height: auto; }
#service-meta p { margin: 3px 0; }
#service-edit-form, #rule-form { margin-top: 12px; }
#performance-origin { margin-bottom: 10px; }
.coverage-bar { display: flex; gap: 1px; height: 10px; margin: 10px 0; overflow: hidden; border-radius: 5px; background: #303c51; }
.coverage-bar span { flex-basis: 0; }
.coverage-bar [data-state="available"] { background: #65d3b2; }
.coverage-bar [data-state="queued"] { background: #f0c679; }
.coverage-bar [data-state="gap"] { background: #996171; }
.coverage-segments { list-style: none; padding: 0; margin: 0; }
.coverage-segments li { display: grid; gap: 2px; padding: 5px 0; border-top: 1px solid var(--line); font-size: .82rem; }
.coverage-segments li span { color: var(--muted); }
.coverage-segments [data-state="available"] { color: #a6efd8; }
.coverage-segments [data-state="queued"] { color: #ffe0a3; }
.coverage-segments [data-state="gap"] { color: #ffbecd; }
.video-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.video-layout .workbench-panel { margin-bottom: 0; }
.video-downloads { grid-column: 1 / -1; }
.video-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.video-heading h2 { margin: 0; }
#live-video, .video-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #080c16;
}
#live-video { object-fit: contain; max-height: 65vh; }
.video-placeholder { display: grid; place-items: center; padding: 12px; color: var(--muted); text-align: center; }
.video-layout .data-origin { margin: 10px 0 8px; }
.video-layout .table-wrap { margin-top: 10px; }
.video-layout input[type="number"] { width: 76px; }
.video-layout td small { display: block; margin-top: 4px; font-size: .78rem; color: var(--muted); }
.video-layout [data-job-state="done"] { color: #a6efd8; }
.video-layout [data-job-state="failed"] { color: #ffbecd; }
.video-layout [data-job-state="waiting_terminal"] { color: #ffe0a3; }
@media (max-width: 1250px) {
  .video-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .registry-grid { grid-template-columns: minmax(0, 1fr); }
  .sidebar nav { flex-wrap: wrap; }
  .page-intro .workbench-form label { flex-basis: 100%; }
  .case-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
