body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body > main {
  flex: 1 0 auto;
}

.app-header {
  position: relative;
  z-index: 50;
  background: #101828;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.app-header-inner {
  display: flex;
  align-items: center;
  gap: clamp(.75rem, 2vw, 1.5rem);
  min-height: 3.65rem;
}
.app-brand {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.app-brand:hover, .app-brand:focus { color: #fff; }
.app-primary { display: flex; align-items: center; gap: .2rem; min-width: 0; }
.app-nav-link {
  display: block;
  padding: .55rem .7rem;
  border-radius: .4rem;
  color: #d0d5dd;
  text-decoration: none;
  white-space: nowrap;
}
.app-nav-link:hover, .app-nav-link:focus { color: #fff; background: #344054; }
.app-nav-link.active { color: #fff; background: #344054; font-weight: 700; }
.app-header-actions {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-left: auto;
}
.alert-channel-status {
  display: inline-block;
  padding: .2rem .5rem;
  border: 1px solid #98a2b3;
  border-radius: 999px;
  color: #fff;
  font-size: .78rem;
  white-space: nowrap;
}
.alert-channel-status.is-disconnected { border-color: #fda29b; background: #7a271a; }
.alert-channel-status.is-polling { border-color: #fdb022; background: #7a2e0e; }
.app-nav-menu { position: relative; }
.app-nav-menu > summary {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .42rem .72rem;
  border: 1px solid #667085;
  border-radius: .4rem;
  color: #fff;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}
.app-nav-menu > summary::-webkit-details-marker { display: none; }
.app-nav-menu > summary:hover, .app-nav-menu > summary:focus-visible,
.app-nav-menu[open] > summary { background: #344054; border-color: #98a2b3; }
.app-nav-panel {
  position: absolute;
  top: calc(100% + .55rem);
  right: 0;
  width: min(20rem, calc(100vw - 2rem));
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
  padding: .65rem;
  border: 1px solid #475467;
  border-radius: .55rem;
  background: #182230;
  box-shadow: 0 14px 32px rgba(16,24,40,.32);
}
.app-nav-panel nav { display: grid; gap: .12rem; }
.app-nav-panel .app-nav-link { white-space: normal; }
.app-menu-heading {
  padding: .7rem .65rem .2rem;
  color: #98a2b3;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.app-menu-heading:first-child { padding-top: .2rem; }
.app-menu-primary { display: none; }
.app-menu-account {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  margin-top: .65rem;
  padding: .8rem .65rem .35rem;
  border-top: 1px solid #475467;
  color: #fff;
  overflow-wrap: anywhere;
}
.app-menu-logout {
  width: 100%;
  padding: .5rem .65rem;
  border: 0;
  border-radius: .4rem;
  background: transparent;
  color: #fff;
  text-align: left;
}
.app-menu-logout:hover, .app-menu-logout:focus-visible { background: #344054; }
@media (max-width: 1000px) {
  .app-primary { display: none; }
  .app-menu-primary { display: block; }
}
@media (max-width: 520px) {
  .app-header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .35rem .75rem;
    padding-top: .55rem;
    padding-bottom: .55rem;
  }
  .app-brand { grid-column: 1; grid-row: 1; }
  .app-header-actions { display: contents; }
  .app-nav-menu { grid-column: 2; grid-row: 1; justify-self: end; }
  .app-nav-panel { top: calc(100% + 2.75rem); }
  .alert-channel-status { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
}
.index-group { font-size: 1.05rem; font-weight: 600; color: #475467; margin: 1.5rem 0 .75rem; }
.index-group:first-of-type { margin-top: 0; }

/* the build the server runs (utils/build_info.py), at the foot of every page */
.app-footer {
  margin-top: 1.5rem;
  padding: .6rem 0 .9rem;
  border-top: 1px solid #e4e7ec;
  color: #98a2b3;
  font-size: .8rem;
}

.page-header {
  padding: 2.25rem 0 2rem;
}

.page-header.compact {
  padding-top: 1rem;
}

.page-header h1 {
  margin: 0 0 .5rem;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.page-header p {
  margin: 0;
  max-width: 760px;
  color: #667085;
  font-size: 1.05rem;
}

.action-grid {
  align-items: stretch;
}

.action-card {
  display: flex;
  min-height: 230px;
  flex-direction: column;
  justify-content: center;
  gap: .75rem;
  padding: 2rem;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  box-shadow: 0 10px 28px rgba(16,24,40,.06);
}

.action-card:hover {
  border-color: #0d6efd;
  text-decoration: none;
  transform: translateY(-1px);
}

.action-title {
  display: block;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.15;
}

.action-text {
  display: block;
  color: #667085;
}

.upload-panel {
  max-width: 760px;
  padding: 1.5rem;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #fff;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.metric {
  padding: 1rem;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #fff;
}

.metric span {
  display: block;
  margin-bottom: .35rem;
  color: #667085;
  font-size: .92rem;
}

.metric strong {
  display: block;
  color: #101828;
  font-size: 1.35rem;
  line-height: 1.2;
}

.plot-card h2,
.card h2 {
  margin-top: 0;
  font-size: 1.15rem;
}

.plot-card img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #edf0f3;
  border-radius: 6px;
}

.download-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin: 1rem 0;
}

.plot-frame {
  width: 100%;
  min-height: 560px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #fff;
}

.muted-text {
  color: #667085;
}

.json-preview {
  max-height: 260px;
  overflow: auto;
  padding: 1rem;
  border: 1px solid #edf0f3;
  border-radius: 6px;
  background: #f8fafc;
  color: #101828;
  white-space: pre-wrap;
}

@media (max-width: 640px) {
  .action-card { min-height: 180px; }
}

/* ---- Training menu helpers ---- */
.class-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e4e7ec;
  background: #f8fafc;
}

.badge-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-drone { background: #fdecea; color: #b42318; }
.badge-noise { background: #eef2f6; color: #475467; }

/* ---- transitions-dev :root (panel reveal, success check, error shake) ---- */
:root {
  --panel-open-dur: 400ms;
  --panel-close-dur: 350ms;
  --panel-blur: 2px;
  --panel-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --check-opacity-dur: 550ms;
  --check-rotate-dur: 550ms;
  --check-rotate-from: 80deg;
  --check-bob-dur: 450ms;
  --check-y-amount: 40px;
  --check-blur-dur: 500ms;
  --check-blur-from: 10px;
  --check-path-dur: 550ms;
  --check-path-delay: 80ms;
  --check-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --check-ease-opacity: cubic-bezier(0.22, 1, 0.36, 1);
  --check-ease-rotate: cubic-bezier(0.22, 1, 0.36, 1);
  --check-ease-bob: cubic-bezier(0.34, 1.35, 0.64, 1);
  --check-ease-path: cubic-bezier(0.22, 1, 0.36, 1);
  --shake-distance: 6px;
  --shake-overshoot: 4px;
  --shake-dur-a: 80ms;
  --shake-dur-b: 60ms;
  --shake-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --revert-hold: 3000ms;
  --revert-dur: 280ms;
}

/* Panel reveal adapted to also collapse form height (max-height). */
.drone-reveal {
  max-height: 0;
  opacity: 0;
  filter: blur(var(--panel-blur));
  overflow: hidden;
  pointer-events: none;
  transition:
    max-height var(--panel-close-dur) var(--panel-ease),
    opacity    var(--panel-close-dur) var(--panel-ease),
    filter     var(--panel-close-dur) var(--panel-ease);
  will-change: max-height, opacity, filter;
}
.drone-reveal[data-open="true"] {
  max-height: 820px;
  opacity: 1;
  filter: blur(0);
  pointer-events: auto;
  transition:
    max-height var(--panel-open-dur) var(--panel-ease),
    opacity    var(--panel-open-dur) var(--panel-ease),
    filter     var(--panel-open-dur) var(--panel-ease);
}
@media (prefers-reduced-motion: reduce) {
  .drone-reveal { transition: none !important; }
}

/* Success check (verbatim from transitions-dev). */
.t-success-check {
  display: inline-block;
  transform-origin: center;
  opacity: 0;
  will-change: transform, opacity, filter;
}
.t-success-check svg { display: block; overflow: visible; }
.t-success-check svg path {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
}
.t-success-check[data-state="in"] {
  animation:
    t-check-fade   var(--check-opacity-dur) var(--check-ease-opacity) forwards,
    t-check-rotate var(--check-rotate-dur)  var(--check-ease-rotate)  forwards,
    t-check-blur   var(--check-blur-dur)    var(--check-ease-out)     forwards,
    t-check-bob    var(--check-bob-dur)     var(--check-ease-bob)     forwards;
}
.t-success-check[data-state="in"] svg path {
  animation: t-check-draw var(--check-path-dur) var(--check-ease-path) var(--check-path-delay, 0ms) forwards;
}
@keyframes t-check-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes t-check-rotate { from { transform: rotate(var(--check-rotate-from)); } to { transform: rotate(0deg); } }
@keyframes t-check-blur { from { filter: blur(var(--check-blur-from)); } to { filter: blur(0); } }
@keyframes t-check-bob { from { translate: 0 var(--check-y-amount); } to { translate: 0 0; } }
@keyframes t-check-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .t-success-check { animation: none !important; opacity: 1; }
  .t-success-check svg path { animation: none !important; stroke-dashoffset: 0 !important; }
}

/* Error state shake (verbatim from transitions-dev) + local colors. */
.t-input {
  transition: border-color 150ms ease-out;
  will-change: transform;
  border: 1px solid transparent;
  border-radius: 8px;
}
.t-input.is-error {
  transition: border-color var(--revert-dur, 280ms) ease-out;
  border-color: #d92d20;
}
.t-error-msg {
  opacity: 0;
  visibility: hidden;
  color: #b42318;
  font-size: 13px;
  margin: 4px 0 0;
  transition:
    opacity    var(--revert-dur, 280ms) ease-out,
    visibility 0s linear var(--revert-dur, 280ms);
}
.t-input-wrap.is-error .t-error-msg {
  opacity: 1;
  visibility: visible;
  transition:
    opacity    var(--revert-dur, 280ms) ease-out,
    visibility 0s linear 0s;
}
.t-input.is-shaking {
  animation: t-input-shake calc(var(--shake-dur-a) * 2 + var(--shake-dur-b) * 2) linear;
}
@keyframes t-input-shake {
  0%      { transform: translateX(0);                                animation-timing-function: var(--shake-ease); }
  28.57%  { transform: translateX(var(--shake-distance));            animation-timing-function: var(--shake-ease); }
  57.14%  { transform: translateX(calc(var(--shake-distance) * -1)); animation-timing-function: var(--shake-ease); }
  78.57%  { transform: translateX(var(--shake-overshoot));           animation-timing-function: var(--shake-ease); }
  100%    { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .t-input { animation: none !important; transform: none !important; }
}

/* Operator overview */
.ops-heading, .replay-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin: .3rem 0 1.4rem; }
.ops-eyebrow { margin: 0 0 .25rem; color: #175cd3; font-size: .85rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ops-heading h1, .replay-heading h1 { margin: 0 0 .35rem; color: #101828; font-size: clamp(1.9rem, 3vw, 2.7rem); font-weight: 750; }
.ops-heading p:last-child, .replay-heading p:last-child { margin: 0; color: #475467; font-size: 1rem; }
.ops-heading-actions, .replay-heading-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.ops-heading-actions span { color: #475467; font-size: .9rem; white-space: nowrap; }
.ops-error { padding: .8rem 1rem; margin-bottom: 1rem; border: 1px solid #fda29b; border-radius: 10px; background: #fef3f2; color: #b42318; font-weight: 600; }
.ops-error[hidden] { display: none; }
.ops-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; margin-bottom: 1rem; }
.ops-stat { display: flex; flex-direction: column; padding: 1rem 1.15rem; min-height: 8.3rem; border: 1px solid #d0d7de; border-radius: 12px; background: #fff; color: #101828; text-decoration: none; }
.ops-stat:hover, .ops-stat:focus-visible { border-color: #175cd3; text-decoration: none; box-shadow: 0 3px 12px #10182816; }
.ops-stat > span { color: #475467; font-weight: 600; }
.ops-stat strong { font-size: 2.6rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ops-stat small { margin-top: auto; color: #667085; }
.ops-stat-ok strong { color: #067647; }
.ops-stat-attention strong { color: #b54708; }
.ops-stat-events strong { color: #175cd3; }
.ops-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(19rem, 1fr); gap: 1rem; margin-bottom: 1rem; }
.ops-panel { min-width: 0; padding: 1rem 1.15rem; border: 1px solid #d0d7de; border-radius: 12px; background: #fff; }
.ops-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .8rem; }
.ops-panel-head h2 { margin: 0 0 .15rem; color: #101828; font-size: 1.25rem; font-weight: 700; }
.ops-panel-head p { margin: 0; color: #667085; font-size: .9rem; }
.ops-panel-head > a { white-space: nowrap; font-size: .9rem; font-weight: 600; }
.ops-tenant-label { display: flex; align-items: center; gap: .45rem; color: #475467; font-size: .9rem; }
.ops-tenant-label select { width: auto; min-width: 10rem; }
.ops-map-wrap { position: relative; min-height: 420px; border: 1px solid #e4e7ec; border-radius: 8px; background: #f8fafc; overflow: hidden; }
.ops-map { display: block; width: 100%; height: 420px; }
.ops-grid-line { stroke: #e7edf4; stroke-width: 1; }
.ops-north { fill: #344054; font-size: 18px; font-weight: 700; }
.ops-map-point { cursor: pointer; }
.ops-map-point circle { stroke: white; stroke-width: 3; fill: #067647; }
.ops-map-point text { fill: #344054; font-size: 14px; font-weight: 700; paint-order: stroke; stroke: #f8fafc; stroke-width: 3; }
.ops-map-point:focus-visible circle { stroke: #101828; stroke-width: 4; }
.ops-map-warn circle { fill: #b54708; }
.ops-map-alarm circle { fill: #b42318; }
.ops-map-unknown circle { fill: #667085; }
.ops-map-note { fill: #475467; font-size: 14px; }
.ops-map-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 2rem; color: #475467; text-align: center; font-weight: 600; pointer-events: none; }
.ops-map-empty[hidden] { display: none; }
.ops-map-legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: .7rem; color: #475467; font-size: .85rem; }
.ops-map-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.ops-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; background: #667085; }
.ops-dot-ok { background: #067647; } .ops-dot-warn { background: #b54708; } .ops-dot-alarm { background: #b42318; }
.ops-map-caption { margin: .5rem 0 0; color: #667085; font-size: .82rem; }
.ops-list { display: flex; flex-direction: column; gap: .55rem; }
.ops-list-empty { margin: 1rem 0; color: #475467; }
.ops-attention-row { display: flex; flex-direction: column; gap: .2rem; padding: .7rem .8rem; border: 1px solid #e4e7ec; border-left: 4px solid #b54708; border-radius: 8px; color: #101828; }
.ops-attention-row:hover, .ops-attention-row:focus-visible { background: #f8fafc; text-decoration: none; }
.ops-row-alarm { border-left-color: #b42318; }
.ops-row-top { display: flex; justify-content: space-between; gap: .5rem; }
.ops-row-top span { color: #475467; white-space: nowrap; }
.ops-row-reason { color: #344054; }
.ops-attention-row small, .ops-list-more { color: #667085; }
.ops-events { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .65rem; }
.ops-events > .ops-list-empty { grid-column: 1 / -1; }
.ops-event-row { display: flex; flex-direction: column; gap: .3rem; padding: .75rem .85rem; border: 1px solid #e4e7ec; border-radius: 8px; color: #101828; overflow-wrap: anywhere; }
.ops-event-row:hover, .ops-event-row:focus-visible { border-color: #175cd3; background: #f8fafc; text-decoration: none; }
.ops-event-type { color: #175cd3; font-size: .8rem; font-weight: 700; text-transform: uppercase; }
.ops-event-alarm { border-left: 4px solid #b42318; } .ops-event-alarm .ops-event-type { color: #b42318; }
.ops-event-row time { color: #667085; font-size: .85rem; }
.ops-tools { margin-top: 1rem; color: #475467; }
.ops-tools summary { cursor: pointer; }
.ops-tools nav { display: flex; gap: 1rem; flex-wrap: wrap; padding: .5rem 0; }

/* Tracking: large plane, visible timeline and an uncluttered target readout. */
.replay-heading { margin-bottom: 1rem; }
.replay-live-state { padding: .4rem .7rem; border: 1px solid #fda29b; border-radius: 999px; background: #fef3f2; color: #b42318; font-weight: 700; white-space: nowrap; }
.replay-live-state[hidden] { display: none; }
.replay { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 1100px) { .replay { grid-template-columns: minmax(0, 1fr) minmax(340px, 375px); } }
.replay-main { min-width: 0; }
.replay-stage-header { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .65rem .85rem; border: 1px solid #d0d7de; border-bottom: 0; border-radius: 10px 10px 0 0; background: #fff; }
.replay-stage-header strong { overflow-wrap: anywhere; }
.replay-stage-header span { color: #475467; font-variant-numeric: tabular-nums; white-space: nowrap; }
.replay-stage { position: relative; border: 1px solid #d0d7de; background: #f8fafc; overflow: hidden; }
.replay-stage canvas { display: block; width: 100%; height: clamp(400px, 64vh, 750px); cursor: grab; touch-action: none; }
.replay-stage canvas:active { cursor: grabbing; }
.replay-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 2rem; background: #f8fafcd9; color: #344054; text-align: center; font-size: 1.05rem; font-weight: 600; pointer-events: none; }
.replay-empty[hidden] { display: none; }
.replay-visible-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; padding: .65rem .8rem; border: 1px solid #d0d7de; border-top: 0; border-radius: 0 0 10px 10px; background: #fff; color: #475467; font-size: .9rem; }
.replay-visible-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.replay-visible-legend i { display: inline-block; width: 1.2rem; height: 0; border-top: 3px solid #111827; }
.replay-visible-legend .replay-legend-target { width: .7rem; height: .7rem; border: 0; border-radius: 50%; background: #dc2626; }
.replay-visible-legend .replay-legend-ray { border-color: #2563eb; }
.replay-visible-legend .replay-legend-error { width: .7rem; height: .7rem; border: 1px solid #dc2626; border-radius: 50%; }
.replay-controls { display: flex; align-items: center; gap: .55rem; margin-top: .9rem; flex-wrap: wrap; }
.replay-btn { min-height: 2.5rem; padding: .4rem .85rem; font-size: 1rem; }
.replay-btn[hidden] { display: none; }
.replay-btn:disabled, .replay-slider:disabled { opacity: .5; cursor: default; }
.replay-speed-label { margin-left: auto; color: #475467; }
.replay-speed { width: auto; }
.replay-select { padding: .45rem .6rem; font-size: 1rem; }
.replay-timeline { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .65rem; margin-top: .75rem; color: #344054; font-size: .95rem; font-variant-numeric: tabular-nums; }
.replay-slider { width: 100%; min-width: 80px; accent-color: #175cd3; }
.replay-check { display: flex; align-items: center; gap: .55rem; margin: .8rem 0; font-size: 1rem; }
.replay-check input { width: 1.1rem; height: 1.1rem; }
.replay-hint { color: #667085; font-size: .88rem; margin: .65rem 0 0; }
.replay-panel { border: 1px solid #d0d7de; border-radius: 10px; padding: 1rem 1.1rem; background: #fff; }
.replay-panel-title { margin: 0 0 .65rem; font-size: 1.15rem; font-weight: 700; }
.replay-panel .form-label { font-size: .95rem; font-weight: 600; }
#replay-source { width: 100%; }
.replay-source-help { margin: .5rem 0; color: #667085; font-size: .88rem; }
.replay-subtitle { padding-top: .8rem; margin: 1rem 0 .45rem; border-top: 1px solid #e4e7ec; font-size: 1.08rem; font-weight: 700; }
.replay-readout { display: grid; grid-template-columns: minmax(7rem, auto) minmax(0, 1fr); gap: .4rem .7rem; margin: .5rem 0 0; font-size: .96rem; }
.replay-readout dt { font-weight: 400; color: #667085; }
.replay-readout dd { margin: 0; color: #101828; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.replay-bearings { list-style: none; padding: 0; margin: 0; font-size: .95rem; }
.replay-bearings .text-muted { color: #667085; }
.replay-bearings li { margin: .38rem 0; }
.replay-dot { display: inline-block; width: .75rem; height: .75rem; border-radius: 50%; vertical-align: -1px; }
.replay-note { color: #667085; font-size: .88rem; line-height: 1.45; margin: .8rem 0 0; }
.replay-advanced { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid #e4e7ec; }
.replay-advanced summary { cursor: pointer; color: #175cd3; font-weight: 600; }
.replay-advanced .form-label { margin-top: .6rem; }
.replay-advanced #replay-geometry-opts[hidden] { display: none; }
@media (max-width: 900px) { .ops-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ops-layout { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .ops-heading, .replay-heading, .ops-panel-head { flex-direction: column; align-items: flex-start; }
  .ops-stat { min-height: 7rem; padding: .7rem; } .ops-stat strong { font-size: 2rem; }
  .ops-map-wrap { min-height: 320px; overflow-x: auto; } .ops-map { height: 320px; min-width: 600px; }
  .replay-stage canvas { height: 400px; }
  .replay-timeline { font-size: .8rem; gap: .3rem; }
  .replay-speed-label { margin-left: 0; }
}

/* administration (/admin) */
.admin-panel { border: 1px solid #d0d7de; border-radius: 8px; background: #fff; padding: 1rem 1.1rem; margin-bottom: 1.25rem; }
.admin-panel h2 { font-size: 1.35rem; margin: 0 0 .75rem; }
.admin-panel h3 { font-size: 1.05rem; margin: 1rem 0 .5rem; }
.admin-table { font-size: .9rem; }
.admin-table td { vertical-align: top; }
.admin-actions { display: flex; flex-wrap: wrap; gap: .3rem; }
.admin-actions .btn { padding: .15rem .45rem; font-size: .8rem; }
.admin-token { flex-basis: 100%; font-size: .8rem; color: #475467; }
.admin-actions .admin-danger { color: #b42318; border-color: #b42318; }
.admin-actions .admin-danger:hover { color: #fff; background: #b42318; }
.admin-link { padding: 0 .2rem !important; font-size: .8rem; text-decoration: underline; background: none; border: 0; color: #175cd3; }
.admin-disabled td { color: #98a2b3; }
.admin-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: .6rem; }
.admin-row label { display: flex; flex-direction: column; font-size: .88rem; gap: .2rem; }
.admin-roles { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: .4rem 0; }
.admin-check { font-size: .88rem; display: inline-flex; align-items: center; gap: .3rem; }
.admin-note { color: #667085; font-size: .85rem; }
.admin-pick { position: relative; font-size: .88rem; min-width: 10rem; }
.admin-pick > summary { list-style: none; cursor: pointer; border: 1px solid #ced4da; border-radius: .25rem; padding: .25rem 1.4rem .25rem .5rem; background: #fff; max-width: 24rem; }
.admin-pick > summary::-webkit-details-marker { display: none; }
.admin-pick > summary::after { content: "\25BE"; position: absolute; right: .5rem; top: .25rem; color: #667085; }
.admin-pick-panel { position: absolute; z-index: 20; left: 0; margin-top: .2rem; min-width: 20rem; max-height: 22rem; overflow: auto; background: #fff; border: 1px solid #d0d7de; border-radius: 6px; padding: .5rem; box-shadow: 0 6px 18px rgba(16,24,40,.15); }
.admin-pick-list { display: flex; flex-direction: column; gap: .15rem; margin: .4rem 0; }
.admin-pick-group { font-weight: 600; color: #475467; margin-top: .4rem; }
.admin-pick-item[hidden] { display: none; }
.admin-pick-extra { margin-top: .4rem; }
.admin-chain { font-size: .9rem; color: #067647; }
.admin-chain.admin-broken { color: #b42318; font-weight: 700; }
.admin-switch { flex-direction: row !important; align-items: center; gap: .4rem !important; font-weight: 600; }
.admin-audit td { white-space: nowrap; }
.admin-audit .admin-detail { white-space: normal; font-family: ui-monospace, monospace; font-size: .78rem; color: #475467; }
.admin-dialog { border: 1px solid #d0d7de; border-radius: 8px; padding: 1.1rem; max-width: 30rem; width: calc(100% - 2rem); }
.admin-dialog::backdrop { background: rgba(16,24,40,.45); }
.admin-dialog input:not([type=checkbox]) { margin-bottom: .5rem; }
.totp-secret { font-size: 1.25rem; letter-spacing: .08em; user-select: all; }
.totp-uri { word-break: break-all; font-size: .8rem; }

/* stations (/stations): the state of every station from its last heartbeat */
.st-help { margin: -.45rem 0 1rem; color: #475467; font-size: .86rem; }
.st-help summary { cursor: pointer; width: fit-content; }
.st-help p { max-width: 56rem; margin: .45rem 0 0; }
.st-summary { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.st-card { display: flex; flex-direction: column; align-items: flex-start; min-width: 7.5rem; padding: .45rem .7rem; border: 1px solid #d0d7de; border-radius: 8px; background: #fff; color: #101828; cursor: pointer; text-align: left; }
.st-card:hover { border-color: #98a2b3; }
.st-card.st-active { border-color: #175cd3; box-shadow: 0 0 0 2px rgba(23,92,211,.18); }
.st-card .st-num { font-size: 1.4rem; font-weight: 700; line-height: 1.1; }
.st-card .st-label { font-size: .78rem; color: #667085; }
.st-card.st-online .st-num { color: #067647; }
.st-card.st-late .st-num, .st-card.st-warn .st-num { color: #b54708; }
.st-card.st-lost .st-num, .st-card.st-alarm .st-num { color: #b42318; }
.st-card.st-never .st-num { color: #667085; }
.st-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .5rem; font-size: .85rem; color: #667085; }
.st-toolbar .btn { margin-left: auto; }
.st-toolbar .btn + .btn { margin-left: 0; }
.st-toolbar .st-tenant-label { margin-left: auto; white-space: nowrap; }
.st-toolbar #st-tenant { width: auto; min-width: 10rem; padding: .3rem .6rem; border: 1px solid #98a2b3; border-radius: 6px; background: #fff; color: #101828; }
.st-toolbar .st-view-switch { display: inline-flex; padding: 2px; border: 1px solid #d0d7de; border-radius: 8px; background: #f2f4f7; }
.st-view-switch .btn { margin: 0; border: 0; color: #475467; background: transparent; }
.st-view-switch .st-view-active { color: #101828; background: #fff; box-shadow: 0 1px 3px #10182820; }
.st-status.st-error { color: #b42318; font-weight: 600; }
.st-overview { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.st-station-card { display: flex; flex-direction: column; gap: .42rem; min-height: 10.5rem; padding: .8rem .95rem; text-align: left; border: 1px solid #d0d7de; border-left: 5px solid #12b76a; border-radius: 10px; background: #fff; color: #101828; cursor: pointer; }
.st-station-card:hover, .st-station-card:focus-visible { border-color: #175cd3; box-shadow: 0 2px 10px #10182820; }
.st-station-card.st-level-alarm { border-left-color: #d92d20; }
.st-station-card.st-level-warn { border-left-color: #f79009; }
.st-station-card.st-level-info { border-left-color: #2e90fa; }
.st-station-top, .st-station-metrics { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.st-station-top strong { font-size: 1.1rem; }
.st-station-tenant { color: #667085; font-size: .77rem; }
.st-station-seen { font-size: .88rem; font-variant-numeric: tabular-nums; }
.st-station-metrics { font-size: .78rem; color: #475467; flex-wrap: wrap; }
.st-station-problem { margin-top: auto; font-size: .78rem; font-weight: 600; }
.st-station-card.st-level-alarm .st-station-problem { color: #b42318; }
.st-station-card.st-level-warn .st-station-problem { color: #b54708; }
.st-overview[hidden], .st-wrap[hidden] { display: none; }
@media (max-width: 720px) {
  .st-toolbar .st-tenant-label { margin-left: 0; }
  .st-overview { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
}
.btn-sm { padding: .35rem .7rem; font-size: .85rem; border-radius: 6px; }
.btn-outline-secondary { color: #475467; border-color: #98a2b3; background: #fff; }
.btn-outline-secondary:hover { color: #101828; background: #f2f4f7; text-decoration: none; }
.container-wide { max-width: 1720px; padding-left: 1.5rem; padding-right: 1.5rem; }
.st-wrap { overflow-x: auto; border: 1px solid #e4e7ec; border-radius: 8px; background: #fff; }
.st-table { font-size: .82rem; margin-bottom: 0; }
.st-table th, .st-table td { padding: .3rem .4rem; }
.st-table td { white-space: nowrap; }
.st-table td.st-wrap-cell { white-space: normal; min-width: 14rem; }
.st-table th { white-space: nowrap; vertical-align: bottom; }
.st-table th.st-sortable { cursor: pointer; user-select: none; }
.st-table th.st-sortable:hover { color: #175cd3; }
.st-table .st-arrow { font-size: .7rem; color: #175cd3; }
.st-table th.st-filter { padding: .15rem .25rem; }
.st-table th.st-filter input { min-width: 3.2rem; width: 100%; font-size: .76rem; padding: .1rem .3rem; height: auto; border-radius: 4px; }
.st-table .st-num-col { text-align: right; font-variant-numeric: tabular-nums; }
.st-table td { vertical-align: middle; }
.st-row { cursor: pointer; }
.st-row.st-level-alarm td:first-child { box-shadow: inset 4px 0 0 #d92d20; }
.st-row.st-level-warn td:first-child { box-shadow: inset 4px 0 0 #f79009; }
.st-row.st-level-ok td:first-child { box-shadow: inset 4px 0 0 #12b76a; }
.st-row.st-level-info td:first-child { box-shadow: inset 4px 0 0 #2e90fa; }
.st-badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.st-badge.st-online { background: #ecfdf3; color: #067647; }
.st-badge.st-late { background: #fffaeb; color: #b54708; }
.st-badge.st-lost { background: #fef3f2; color: #b42318; }
.st-badge.st-never { background: #f2f4f7; color: #475467; }
.st-problems { display: flex; flex-wrap: wrap; gap: .25rem; }
.st-problem { display: inline-block; padding: .05rem .45rem; border-radius: 4px; font-size: .76rem; white-space: nowrap; }
.st-problem.st-alarm { background: #fef3f2; color: #b42318; }
.st-problem.st-warn { background: #fffaeb; color: #b54708; }
.st-problem.st-info { background: #eff8ff; color: #175cd3; }
.st-details td { background: #f8fafc; cursor: default; white-space: normal; padding: .5rem .6rem .7rem; }
.st-details .st-panel { position: sticky; left: 0; max-width: calc(100vw - 4.5rem); }   /* stays in view while the table scrolls */
.st-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: .75rem 1.5rem; }
.st-block h3 { font-size: .9rem; margin: 0 0 .3rem; color: #344054; }
.st-block dl { display: grid; grid-template-columns: minmax(9rem, auto) minmax(0, 1fr); gap: .1rem .6rem; margin: 0; font-size: .8rem; }
.st-block dt { font-weight: 400; color: #667085; }
.st-block dd { margin: 0; overflow-wrap: anywhere; }
.st-raw { margin: .6rem 0 0; font-size: .8rem; }
.st-raw pre { margin: .4rem 0 0; max-height: 24rem; overflow: auto; font-size: .74rem; background: #fff; border: 1px solid #e4e7ec; border-radius: 6px; padding: .5rem; }
.st-empty { color: #667085; }
