:root {
  --bg: #0b0f14;
  --panel: #121821;
  --line: #2a3a4d;
  --text: #d7e2ee;
  --muted: #8aa0b5;
  --cyan: #3ecfcf;
  --amber: #f0a202;
  --green: #7cdb6e;
  --red: #e05d5d;
  --adsb: #7cdb6e;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font: 14px/1.45 ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex; align-items: center; gap: 1.2rem;
  padding: 0.7rem 1rem; border-bottom: 1px solid var(--line);
  background: #0e141c;
}
.brand { display: flex; flex-direction: column; min-width: 8rem; }
.logo { font-weight: 700; letter-spacing: 0.04em; color: var(--adsb); }
.sub { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; }
.clocks { display: flex; gap: 1.4rem; flex: 1; }
.clocks .k { display: block; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.clocks .v { font-size: 22px; font-weight: 600; letter-spacing: 0.04em; }
.status { display: flex; align-items: center; gap: 0.45rem; color: var(--muted); }
.dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #555; }
.dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.warn { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.dot.off { background: var(--red); }
.logout { color: var(--muted); font-size: 12px; margin-left: 0.6rem; }
.family {
  display: flex; gap: 1.2rem; align-items: baseline; flex-wrap: wrap;
  padding: 0.5rem 1rem 0.6rem; border-bottom: 1px solid var(--line); background: #0e141c;
}
.family a, .family .on {
  letter-spacing: 0.14em; font-size: 12px; text-transform: uppercase;
  padding-bottom: 3px; text-decoration: none;
}
.family .on { color: var(--text); font-weight: 700; border-bottom: 1px solid var(--text); }
.family a { color: var(--muted); }
.family a:hover { color: var(--cyan); }
.views {
  display: flex; gap: 1.2rem; padding: 0.5rem 1rem 0;
  border-bottom: 1px solid var(--line);
}
.views button {
  background: transparent; color: var(--muted); border: 0;
  border-bottom: 1px solid transparent;
  letter-spacing: 0.14em; text-transform: uppercase; font-size: 12px;
  padding: 0.35rem 0 0.45rem; cursor: pointer;
}
.views button.on { color: var(--text); font-weight: 700; border-bottom-color: var(--text); }
.admin-note { margin: 0.5rem 1rem 0; color: var(--muted); font-size: 12px; }
.stage {
  flex: 1; min-height: 0; padding: 0.7rem 1rem 1rem;
  display: grid; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); gap: 0.8rem;
}
.stage.has-detail {
  grid-template-columns: minmax(0, 1fr) min(24rem, 38vw);
}
.view { display: none !important; height: 100%; min-height: 0; }
.view.on { display: flex !important; flex-direction: column; min-height: 0; grid-column: 1; }
#view-radar.view.on { align-items: center; justify-content: center; }
#radar {
  width: min(100%, calc(100dvh - 10rem));
  max-width: 900px;
  height: auto;
  aspect-ratio: 1;
  background: #0b1016;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}
#map {
  flex: 1; min-height: 420px; border: 1px solid var(--line); border-radius: 10px; background: #0b1016;
}
#frame {
  position: relative; flex: 1; min-height: 420px;
  background: #05070a; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
#frame-photo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.frame-idle {
  margin: 0; position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; font-size: 13px;
}
.frame-plate {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 3.2rem 1.6rem 1.2rem;
  background: linear-gradient(transparent, rgba(5, 7, 10, 0.94) 42%);
}
.frame-call { margin: 0; font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 700; color: var(--adsb); }
.frame-type, .frame-route, .frame-stats { margin: 0.2rem 0 0; color: var(--text); }
.frame-route { color: var(--cyan); letter-spacing: 0.04em; }
.ac-card {
  grid-column: 2; grid-row: 1; min-height: 0; overflow: auto;
  border: 1px solid var(--line); background: var(--panel); border-radius: 12px;
}
.ac-card[hidden] { display: none; }
.ac-hero { display: block; width: 100%; max-height: 220px; object-fit: cover; background: #05070a; }
.ac-hero.empty {
  display: grid; place-items: center; min-height: 140px; color: var(--muted); font-size: 12px;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.ac-body { padding: 0.85rem 1rem 1rem; }
.ac-body .call { font-size: 22px; font-weight: 700; color: var(--adsb); }
.ac-type, .ac-route { margin: 0.15rem 0 0.6rem; color: var(--muted); }
.ac-body dl {
  display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.2rem 0.6rem; margin: 0;
}
.ac-body dt { color: var(--muted); }
.ac-body dd { margin: 0; }
.ac-links { margin: 0.8rem 0 0; }
.ac-links a { color: var(--cyan); }
.ac-credit { margin: 0.5rem 0 0; color: var(--muted); font-size: 11px; }
.ac { width: 100%; border-collapse: collapse; font-size: 13px; }
.ac th, .ac td { text-align: left; padding: 0.35rem 0.45rem; border-bottom: 1px solid var(--line); }
.ac th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.ac tbody tr { cursor: pointer; }
.ac tbody tr:hover, .ac tbody tr.on { background: var(--panel); }
.ac tbody tr.no-fix td, .ac tbody tr.beyond td { color: var(--muted); }
.ac tbody tr.beyond td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.hint { color: var(--muted); font-size: 12px; margin: 0.6rem 0 0; }
footer {
  padding: 0.7rem 1rem 0.9rem; color: var(--muted); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; border-top: 1px solid var(--line);
}
.leaflet-container { background: #0b1016; font: inherit; }
.login { display: grid; place-items: center; }
.login-card {
  width: min(28rem, 92vw); padding: 2rem; border: 1px solid var(--line);
  background: var(--panel); border-radius: 14px;
}
.plate { letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); font-size: 11px; }
.login-card h1 { margin: 0.2rem 0 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; }
.google {
  display: inline-block; margin-top: 1rem; padding: 0.6rem 1rem;
  background: var(--cyan); color: #06210f; text-decoration: none; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; border-radius: 8px;
}
@media (max-width: 860px) {
  .clocks .v { font-size: 16px; }
  #map, #frame { min-height: 280px; }
  .stage.has-detail { grid-template-columns: 1fr; }
  .ac-card { grid-column: 1; grid-row: 2; }
}
body.kiosk .topbar,
body.kiosk .family,
body.kiosk .views,
body.kiosk .admin-note,
body.kiosk footer { display: none; }
body.kiosk { background: #05070a; }
body.kiosk .stage { padding: 0; }
body.kiosk #view-frame { display: flex !important; }
body.kiosk #frame { min-height: 100dvh; border: 0; border-radius: 0; }
@media (prefers-reduced-motion: reduce) {
  #radar { box-shadow: none; }
}
