/* ===================================================================
   🎧 Observer view — header + KPI tiles, sub-tabs Live · Statistics ·
   Antenna test. Built on the tokens in styles.css :root ("fox den at
   night"). Colour tones are set per element with .ov-tone--*, which
   defines --tone; badges, tiles, bars and chips read it. Numbers and
   text always carry the meaning, colour only helps.
   =================================================================== */

.view-observer {
  --obs-card: rgba(42, 31, 61, 0.55);
  --obs-card-line: rgba(62, 47, 87, 0.8);
  --obs-soft: rgba(179, 163, 201, 0.12);
  --tone: var(--sky);
  background: var(--bg);
  overflow-x: hidden;
  overflow-y: auto;
}
.view-observer.active { display: block; }

.ov-tone--sky { --tone: var(--sky); }
.ov-tone--moss { --tone: var(--moss); }
.ov-tone--berry { --tone: var(--berry); }
.ov-tone--sun { --tone: var(--sun); }
.ov-tone--amber { --tone: var(--fox-amber); }
.ov-tone--grape { --tone: var(--grape); }
.ov-tone--ember { --tone: var(--fox-ember); }
.ov-tone--fox { --tone: var(--brand-fox); }
.ov-tone--muted { --tone: var(--muted); }

.ov-root {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px 22px 96px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  min-width: 0;
}
.ov-muted { color: var(--muted); }
.ov-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- header ------------------------------------------------------------------ */
.ov-head {
  position: relative;
  z-index: 20; /* above the panes, so the picker popup can overlap them */
  border-radius: 22px;
  border: 1px solid var(--line);
  padding: 18px 20px;
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(155, 93, 229, 0.28), transparent 55%),
    radial-gradient(90% 140% at 100% 0%, rgba(255, 123, 37, 0.20), transparent 55%),
    var(--bg-2);
  box-shadow: inset 0 0 0 1px rgba(255, 243, 227, 0.06), 0 18px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ov-head__top { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.ov-head__avatar {
  flex: 0 0 auto;
  width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 30px;
  background: var(--grad-fox);
  box-shadow: 0 6px 18px rgba(255, 78, 80, 0.35);
  position: relative;
}
.ov-online .ov-head__avatar::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid var(--moss); opacity: 0.8;
}
@media (prefers-reduced-motion: no-preference) {
  .ov-online .ov-head__avatar::after { animation: ov-ring 2.4s ease-out infinite; }
}
@keyframes ov-ring {
  0% { transform: scale(0.92); opacity: 0.9; }
  100% { transform: scale(1.25); opacity: 0; }
}
.ov-head__main { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ov-head__eyebrow {
  font: 600 12px/1 var(--font-display); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fox-amber);
}
.ov-head__titlerow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.ov-head__meta { font: 12px/1.3 var(--font-mono); color: var(--muted); overflow-wrap: anywhere; }
.ov-head__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ov-iata {
  font: 700 12px/1 var(--font-mono); letter-spacing: 0.08em;
  padding: 5px 8px; border-radius: 8px;
  color: #1b1208; background: var(--sun);
}
.ov-head__status .mm-status { font-size: 12.5px; }

/* The big title is the observer picker. */
.ov-combo { position: relative; min-width: 0; max-width: 100%; }
.ov-combo__btn {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%;
  background: rgba(0, 0, 0, 0.18); color: var(--brand-cream);
  border: 1px solid transparent; border-radius: 12px;
  padding: 4px 12px 4px 10px; cursor: pointer; text-align: left;
  font: 700 28px/1.15 var(--font-display);
  transition: border-color 120ms ease, background 120ms ease;
}
.ov-combo__btn:hover, .ov-combo.open .ov-combo__btn { border-color: var(--brand-fox); background: rgba(255, 123, 37, 0.10); }
.ov-combo__btn:focus-visible { outline: 2px solid var(--brand-fox); outline-offset: 2px; }
.ov-combo__val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-combo__val.placeholder { color: var(--muted); font-weight: 600; }
.ov-combo__caret { font-size: 16px; color: var(--fox-amber); flex: none; transition: transform 120ms ease; }
.ov-combo.open .ov-combo__caret { transform: rotate(180deg); }
.ov-combo__pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 900;
  width: min(420px, calc(100vw - 32px));
  background: rgba(28, 21, 41, 0.98); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  padding: 8px; display: flex; flex-direction: column; gap: 6px;
}
.ov-combo__pop[hidden] { display: none; }
.ov-combo__search {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
  font: 14px var(--font-body);
}
.ov-combo__search:focus { outline: 2px solid var(--brand-fox); outline-offset: 0; }
.ov-combo__list { list-style: none; margin: 0; padding: 0; max-height: min(360px, 55vh); overflow-y: auto; }
.ov-combo__item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-radius: 9px; cursor: pointer; border-left: 3px solid transparent;
}
.ov-combo__item.active, .ov-combo__item:hover { background: var(--bg-3); }
.ov-combo__item.selected { border-left-color: var(--brand-fox); }
.ov-combo__name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-combo__name b { color: var(--fox-amber); }
.ov-combo__mine { color: var(--brand-fox); }
.ov-combo__meta { font: 11.5px var(--font-mono); color: var(--muted); flex: none; }
.ov-combo__empty { padding: 10px; color: var(--muted); text-align: center; }

.ov-btn.on { border-color: var(--brand-fox); background: rgba(255, 123, 37, 0.16); color: var(--brand-cream); }
.ov-btn--mine.on span { color: var(--fox-amber); }

/* KPI tiles */
.ov-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.ov-kpis:empty { display: none; }
.ov-kpi {
  position: relative; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 12px 10px; border-radius: 16px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--tone) 20%, var(--bg-2)) 0%, var(--bg-2) 75%);
  border: 1px solid color-mix(in srgb, var(--tone) 38%, transparent);
  overflow: hidden;
}
.ov-kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--tone); }
.ov-kpi__icon { font-size: 18px; line-height: 1; }
.ov-kpi__value {
  font: 700 28px/1.1 var(--font-display); color: var(--text);
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ov-kpi__value small { font-size: 13px; font-weight: 500; color: var(--muted); }
.ov-kpi__wait { color: var(--muted); }
.ov-kpi__label { font-size: 12px; color: var(--muted); line-height: 1.25; }
.ov-kpi__sub { font-size: 11.5px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-kpi__strip { display: grid; grid-template-columns: repeat(24, 1fr); gap: 1px; height: 8px; margin-top: 4px; }
.ov-kpi__strip i { border-radius: 2px; background: var(--obs-soft); }
.ov-kpi__strip i.on { background: var(--tone); }
.ov-kpi__strip i.untracked { opacity: .25; }

.ov-who {
  background: none; border: none; padding: 0; color: var(--text); cursor: pointer;
  font: inherit; font-weight: 700; text-align: left;
  text-decoration: underline; text-decoration-color: rgba(179, 163, 201, 0.4); text-underline-offset: 3px;
  max-width: 100%; min-width: 0; flex: 0 1 auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom;
}
.ov-who:hover { color: var(--brand-cream); text-decoration-color: currentColor; }
.ov-who:focus-visible, .ov-hop:focus-visible { outline: 2px solid var(--brand-fox); outline-offset: 2px; border-radius: 4px; }
.ov-who--small { font-size: 11.5px; font-weight: 600; color: var(--muted); }

/* --- empty state (no observer picked) ----------------------------------------------- */
.ov-empty-hero {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  padding: 34px 26px; border-radius: 22px;
  border: 1px dashed color-mix(in srgb, var(--brand-fox) 55%, transparent);
  background: radial-gradient(100% 120% at 50% 0%, rgba(255, 123, 37, 0.12), transparent 60%), var(--bg-2);
}
.ov-empty-hero__icon {
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 42px;
  background: var(--grad-aurora); box-shadow: 0 10px 30px rgba(241, 91, 181, 0.3);
}
.ov-empty-hero h2 { font: 700 26px/1.2 var(--font-display); margin: 6px 0 0; color: var(--brand-cream); }
.ov-empty-hero p { max-width: 640px; margin: 0; color: var(--text); }
.ov-empty-hero__hint { color: var(--muted) !important; font-size: 13px; }
.ov-empty-hero__actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

.view-observer.ov-picked .ov-empty-hero { display: none; }
.view-observer:not(.ov-picked) .ov-body,
.view-observer:not(.ov-picked) .ov-head__actions,
.view-observer:not(.ov-picked) .ov-head__meta { display: none; }

.ov-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* --- sub-tabs ------------------------------------------------------------------------- */
.ov-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.ov-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; cursor: pointer;
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line);
  font: 600 14.5px/1 var(--font-display);
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.ov-tab:hover { border-color: var(--brand-cream); }
.ov-tab:focus-visible { outline: 2px solid var(--brand-fox); outline-offset: 2px; }
.ov-tab[aria-selected="true"] {
  background: var(--grad-fox); color: #1b1208; border-color: transparent;
  box-shadow: 0 8px 22px rgba(255, 78, 80, 0.28);
}
.ov-tab__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--fox-ember); box-shadow: 0 0 0 3px rgba(255, 78, 80, 0.25); }
.ov-tab[aria-selected="true"] .ov-tab__dot { background: #1b1208; box-shadow: 0 0 0 3px rgba(27, 18, 8, 0.2); }
@media (prefers-reduced-motion: no-preference) {
  .ov-online .ov-tab__dot { animation: ov-blink 1.6s ease-in-out infinite; }
}
@keyframes ov-blink { 50% { opacity: 0.35; } }
.ov-tab__badge {
  font: 600 11.5px/1 var(--font-mono); padding: 3px 7px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.22); color: inherit;
}
.ov-tab__badge:empty { display: none; }

.ov-banner {
  margin: 0; padding: 10px 14px; border-radius: 14px;
  border: 1px solid rgba(217, 162, 27, 0.5); background: rgba(217, 162, 27, 0.1);
  color: var(--text);
}
.ov-pane[hidden] { display: none !important; }

/* --- cards ------------------------------------------------------------------------------- */
.ov-card {
  background: var(--obs-card); border: 1px solid var(--obs-card-line);
  border-radius: var(--radius-card); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.ov-card__title {
  margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font: 700 16px/1.25 var(--font-display); color: var(--brand-cream);
}
.ov-card__headrow { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ov-card__sub { font: 11.5px var(--font-mono); color: var(--muted); }
.ov-card__explain { margin: -4px 0 2px; color: var(--muted); font-size: 13px; }
.ov-card__foot { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.ov-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ov-card--wide { grid-column: 1 / -1; }
.ov-empty, .ov-chart-empty, .ov-loading, .ov-emptycard {
  color: var(--muted); text-align: center; padding: 18px 8px; font-size: 13px;
}
.ov-chart-empty { border-bottom: 1px solid var(--obs-soft); }
.ov-emptycard { border: 1px dashed var(--obs-card-line); border-radius: var(--radius-card); }
.ov-count {
  font: 600 12px/1 var(--font-mono); padding: 3px 8px; border-radius: 999px;
  background: rgba(111, 227, 165, 0.14); color: var(--moss);
}

.ov-pill, .ov-badge {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 3px 9px; border-radius: 999px;
  font: 600 12px/1.2 var(--font-display); color: var(--text);
  background: color-mix(in srgb, var(--tone) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--tone) 52%, transparent);
}
.ov-badge { max-width: 100%; }
.ov-badge__t { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ov-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.ov-chips .ov-pill { font-size: 13px; padding: 5px 11px; }

/* --- live ----------------------------------------------------------------------------------- */
.ov-live-card { gap: 12px; }
.ov-live-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ov-live-rate {
  display: flex; align-items: flex-end; gap: 12px;
  padding: 8px 14px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(76, 201, 240, 0.18), rgba(111, 227, 165, 0.10));
  border: 1px solid rgba(76, 201, 240, 0.35);
}
.ov-live-rate__num { font: 700 20px/1 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov-live-spark { display: flex; align-items: flex-end; gap: 2px; width: 120px; height: 26px; }
.ov-live-spark i { flex: 1 1 0; min-height: 1px; border-radius: 2px 2px 0 0; background: var(--sky); opacity: 0.9; }
.ov-live-spark i:last-child { background: var(--moss); }
.ov-live-lead { flex: 1 1 260px; margin: 0; }
.ov-live-actions { display: flex; gap: 8px; }
.ov-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ov-filters__sep { width: 1px; align-self: stretch; background: var(--line); margin: 2px 2px; }
.ov-chipbtn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 7px 12px; border-radius: 999px;
  font: 600 13px/1 var(--font-display); color: var(--muted);
  background: transparent; border: 1px dashed var(--line);
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.ov-chipbtn:hover { color: var(--text); border-color: var(--muted); }
.ov-chipbtn:focus-visible { outline: 2px solid var(--brand-fox); outline-offset: 2px; }
.ov-chipbtn.active {
  color: var(--text); border-style: solid;
  background: color-mix(in srgb, var(--tone) 18%, transparent);
  border-color: color-mix(in srgb, var(--tone) 60%, transparent);
}
.ov-chipbtn:not(.active) span[aria-hidden] { filter: grayscale(1); opacity: 0.6; }
.ov-live-count { margin-left: auto; font: 12px var(--font-mono); color: var(--muted); }
.ov-live-paused { margin: 0; padding: 8px 12px; border-radius: 10px; background: rgba(155, 93, 229, 0.14); border: 1px solid rgba(155, 93, 229, 0.4); font-size: 13px; }

.ov-live {
  list-style: none; margin: 0; padding: 0;
  max-height: min(70vh, 900px); overflow-y: auto; overscroll-behavior: contain;
  border-top: 1px solid var(--obs-soft);
  contain: content;
}
.ov-live__empty { padding: 34px 12px; text-align: center; color: var(--muted); font-size: 14px; }
.ov-lrow {
  display: grid;
  grid-template-columns: 98px 148px minmax(0, 1fr) 84px 176px;
  gap: 12px; align-items: center;
  padding: 9px 10px 9px 12px;
  border-bottom: 1px solid rgba(62, 47, 87, 0.45);
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--tone) 70%, transparent);
}
.ov-lrow:hover { background: rgba(255, 255, 255, 0.025); }
.ov-live .ov-lrow { content-visibility: auto; contain-intrinsic-size: auto 56px; }
.ov-lrow.is-direct { background: linear-gradient(90deg, rgba(111, 227, 165, 0.07), transparent 40%); }
@media (prefers-reduced-motion: no-preference) {
  .ov-lrow.is-new { animation: ov-in 900ms ease-out; }
}
@keyframes ov-in {
  0% { background-color: color-mix(in srgb, var(--tone) 22%, transparent); }
  100% { background-color: transparent; }
}
.ov-lrow__time { font: 12px var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov-lrow__type { min-width: 0; }
.ov-lrow__main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ov-lrow__who { min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; }
.ov-lrow__who > .ov-muted { overflow: hidden; text-overflow: ellipsis; }
.ov-lrow__sender { overflow: hidden; text-overflow: ellipsis; }
.ov-chan {
  font: 600 11.5px/1 var(--font-mono); color: var(--moss);
  padding: 2px 6px; border-radius: 6px; background: rgba(111, 227, 165, 0.12);
}
.ov-lrow__msg {
  margin: 0; font-size: 13px; color: var(--brand-cream);
  overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ov-lrow__msg--locked { color: var(--muted); font-size: 12px; }
.ov-path { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; min-width: 0; }
.ov-path__sep { color: var(--muted); font-size: 11px; }
.ov-hop {
  font: 600 11px/1.2 var(--font-display); color: var(--text);
  padding: 2px 7px; border-radius: 6px; cursor: pointer;
  background: rgba(91, 141, 239, 0.16); border: 1px solid rgba(91, 141, 239, 0.4);
  max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ov-hop:hover { border-color: var(--brand-cream); }
.ov-hop--unk, .ov-hop--more { cursor: default; background: var(--obs-soft); border-color: var(--line); color: var(--muted); }
.ov-hop--me { cursor: default; background: rgba(255, 123, 37, 0.18); border-color: rgba(255, 123, 37, 0.5); }
.ov-path__missing { font-size: 11px; color: var(--muted); margin-left: 4px; }
.ov-hops { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.ov-hops__dots { color: var(--grape); letter-spacing: -1px; font-size: 10px; }
.ov-hops b { color: var(--text); font-variant-numeric: tabular-nums; }
.ov-hops--direct {
  color: #0d1e18; background: var(--moss); padding: 3px 8px; border-radius: 999px;
  font: 700 11.5px/1 var(--font-display);
}
.ov-lrow__sig { display: flex; flex-direction: column; gap: 3px; }
.ov-sig { display: grid; grid-template-columns: 34px 1fr 44px; gap: 6px; align-items: center; font-size: 11px; color: var(--muted); }
.ov-sig__k { font: 600 10px/1 var(--font-mono); letter-spacing: 0.02em; }
.ov-sig__bar { height: 6px; border-radius: 3px; background: var(--obs-soft); overflow: hidden; }
.ov-sig__bar i { display: block; height: 100%; border-radius: 3px; background: var(--tone); }
.ov-sig b { font: 600 12px/1 var(--font-mono); color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.ov-sig--none b { color: var(--muted); }

/* --- statistics ---------------------------------------------------------------------- */
.ov-stats { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ov-sec { margin-top: 6px; }
.ov-sec__title { margin: 0; font: 700 20px/1.2 var(--font-display); color: var(--brand-cream); display: flex; gap: 8px; align-items: center; }
.ov-sec__lead { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; max-width: 900px; }

.ov-cols { display: flex; align-items: flex-end; gap: 2px; height: var(--h); border-bottom: 1px solid rgba(179, 163, 201, 0.3); }
.ov-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.ov-col__v { font: 600 10.5px/16px var(--font-mono); color: var(--muted); white-space: nowrap; }
.ov-col__bar { display: block; width: 100%; max-width: 34px; border-radius: 4px 4px 0 0; background: var(--tone); }
.ov-col__bar.is-zero { height: 0 !important; }
.ov-col:hover .ov-col__bar { filter: brightness(1.25); }
.ov-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ov-binaxis { display: grid; font: 10.5px var(--font-mono); color: var(--muted); }
.ov-binaxis__c { text-align: center; }
.ov-legend { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.ov-legend__item { display: inline-flex; align-items: center; gap: 5px; }
.ov-legend__item i { width: 10px; height: 10px; border-radius: 3px; background: var(--tone); display: inline-block; }
.ov-legend__unit { margin-left: auto; font-family: var(--font-mono); }

.ov-hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.ov-hbar { display: grid; grid-template-columns: minmax(0, 12rem) minmax(40px, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.ov-hbar__label { min-width: 0; overflow: hidden; white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.ov-hbar__track { height: 10px; border-radius: 5px; background: var(--obs-soft); overflow: hidden; }
.ov-hbar__fill { display: block; height: 100%; border-radius: 5px; background: var(--tone); }
.ov-hbar__value { font: 600 12.5px var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov-hbar__value small { font-weight: 400; color: var(--muted); }

.ov-up7 { display: flex; flex-direction: column; gap: 3px; }
.ov-up7__row, .ov-up7__axis { display: grid; grid-template-columns: 40px repeat(24, minmax(0, 1fr)); gap: 3px; align-items: center; }
.ov-up7__day { font-size: 11.5px; color: var(--muted); }
.ov-up7__cell { height: 16px; border-radius: 3px; }
.ov-up7__cell.is-on { background: rgba(111, 227, 165, var(--t)); }
.ov-up7__cell.is-off { background: rgba(229, 72, 77, 0.16); box-shadow: inset 0 0 0 1px rgba(229, 72, 77, 0.28); }
.ov-up7__cell.is-void { background: transparent; box-shadow: inset 0 0 0 1px var(--obs-soft); }
.ov-up7__cell:not(.is-void):hover { outline: 1px solid var(--brand-cream); }
.ov-up7__axis { grid-template-columns: 40px repeat(4, minmax(0, 1fr)) 0; font-size: 10.5px; color: var(--muted); }
.ov-up7__axis span:last-child { justify-self: end; }

.ov-dx { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ov-dx__row {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center;
  padding: 7px 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.14);
}
.ov-dx__rank {
  grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font: 700 12px/1 var(--font-display); color: #1b1208; background: var(--fox-amber);
}
.ov-dx__row:first-child .ov-dx__rank { background: var(--grad-fox); }
.ov-dx__name { min-width: 0; overflow: hidden; white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.ov-dx__km { font-size: 12px; color: var(--muted); white-space: nowrap; text-align: right; }
.ov-dx__km b { font: 700 17px/1 var(--font-display); color: var(--text); }
.ov-dx__meta { grid-column: 2 / -1; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 12px; }

.ov-nb { display: flex; flex-direction: column; }
.ov-nb__row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 70px minmax(150px, 1fr) minmax(150px, 1fr) 80px 110px;
  gap: 12px; align-items: center; padding: 8px 4px;
  border-bottom: 1px solid rgba(62, 47, 87, 0.45); font-size: 13px;
}
.ov-nb__row--head { font-size: 11.5px; color: var(--muted); border-bottom-color: var(--line); padding-top: 0; }
.ov-nb__name { min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; }
.ov-nb__n b { font: 700 15px var(--font-display); }
.ov-nb__snr, .ov-nb__rssi { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ov-nb__snr small, .ov-nb__rssi small { color: var(--muted); font-size: 11px; }
.ov-nb__km, .ov-nb__last { font-size: 12.5px; white-space: nowrap; }
.ov-idb { font-weight: 800; flex: none; width: 18px; text-align: center; }
.ov-idb--ok { color: var(--moss); }
.ov-idb--warn { color: var(--sun); }

/* --- antenna test ---------------------------------------------------------------------- */
.ov-howto { background: linear-gradient(135deg, rgba(155, 93, 229, 0.16), rgba(76, 201, 240, 0.08)); }
.ov-howto__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ov-howto__steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.ov-howto__n {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font: 700 14px/1 var(--font-display); color: #1b1208; background: var(--grad-fox);
}
.ov-benchctl { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.ov-benchctl__ant { display: flex; gap: 10px; align-items: flex-end; flex: 1 1 380px; min-width: 0; flex-wrap: wrap; }
.ov-benchctl__opts { display: flex; gap: 12px; align-items: flex-end; }
.ov-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ov-field--grow { flex: 1 1 200px; }
.ov-field--inline { flex-direction: row; align-items: center; gap: 6px; }
.ov-field__label { font: 600 11px/1 var(--font-display); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.ov-field input, .ov-field select {
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; font: 14px var(--font-body); min-width: 0;
}
.ov-field select { padding: 7px 8px; }
.ov-field input:focus, .ov-field select:focus { outline: 2px solid var(--brand-fox); outline-offset: 0; }
.ov-seglist { display: flex; gap: 6px; flex-wrap: wrap; flex-basis: 100%; }
.ov-seglist:empty { display: none; }
.ov-seg { font: 600 12px/1 var(--font-display); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; }
.ov-seg.current { color: #1b1208; background: var(--fox-amber); border-color: var(--fox-amber); }

.ov-benchgrid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 14px; align-items: start; }
.ov-benchcol { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ov-chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.ov-chart-legend .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tone); display: inline-block; }
.ov-chart-legend .dot.big { width: 9px; height: 9px; }
.ov-legend__item--line i { width: 16px; height: 2px; border-radius: 1px; background: var(--brand-cream); }
.ov-legend__item--switch i { width: 0; height: 12px; border-left: 2px dashed var(--brand-fox); background: none; border-radius: 0; }
.ov-chart-wrap { display: flex; gap: 6px; height: 260px; }
.ov-chart-yaxis { display: flex; flex-direction: column; justify-content: space-between; width: 34px; text-align: right; font: 10.5px var(--font-mono); color: var(--muted); padding: 2px 0; }
.ov-chart-plot { position: relative; flex: 1 1 auto; min-width: 0; border-radius: 10px; background: rgba(0, 0, 0, 0.18); }
.ov-chart { width: 100%; height: 100%; display: block; }
.ov-chart .ov-grid { stroke: rgba(179, 163, 201, 0.12); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ov-chart .ov-switch { stroke: var(--brand-fox); stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.ov-chart .ov-pt--direct { fill: var(--moss); opacity: 0.9; }
.ov-chart .ov-pt--relay { fill: var(--sky); opacity: 0.5; }
.ov-chart .ov-pt.is-dim { opacity: 0.08; }
.ov-chart .ov-avg { fill: none; stroke: var(--brand-cream); stroke-width: 2; opacity: 0.85; vector-effect: non-scaling-stroke; }
.ov-chart-marks { position: absolute; inset: 0; pointer-events: none; }
.ov-mark.is-right { transform: translateX(calc(-100% - 4px)); }
.ov-mark {
  position: absolute; top: 4px; transform: translateX(4px);
  font: 600 10.5px/1 var(--font-display); color: #1b1208; background: var(--brand-fox);
  padding: 3px 6px; border-radius: 6px; white-space: nowrap; max-width: 40%; overflow: hidden; text-overflow: ellipsis;
}
.ov-chart-axis { display: flex; justify-content: space-between; font: 10.5px var(--font-mono); color: var(--muted); padding-left: 40px; }

.ov-summary__head { font-size: 13px; color: var(--muted); }
.ov-summary__head b { color: var(--brand-cream); font-family: var(--font-display); font-size: 15px; }
.ov-stats6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.ov-stat {
  display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border-radius: 12px; min-width: 0;
  background: color-mix(in srgb, var(--tone) 12%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 35%, transparent);
}
.ov-stat__v { font: 700 20px/1 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov-stat__l { font-size: 11px; color: var(--muted); }

.ov-neighctl { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.ov-neighctl select { padding: 5px 8px; font-size: 13px; }
.ov-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; }
.ov-toggle input { accent-color: var(--brand-fox); }
.ov-neighlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 560px; overflow-y: auto; }
.ov-neigh {
  background: rgba(0, 0, 0, 0.16); border: 1px solid var(--obs-card-line); border-radius: 12px;
  padding: 8px 11px; cursor: pointer;
}
.ov-neigh:hover { border-color: var(--sky); }
.ov-neigh:focus-visible { outline: 2px solid var(--brand-fox); outline-offset: 1px; }
.ov-neigh.selected { border-color: var(--brand-fox); box-shadow: inset 0 0 0 1px var(--brand-fox); }
.ov-neigh__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ov-neigh__name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.ov-neigh__time { font: 11px var(--font-mono); color: var(--muted); flex: none; }
.ov-neigh__mid { display: flex; align-items: baseline; gap: 14px; margin: 4px 0 2px; }
.ov-neigh__sig b { font: 700 17px/1 var(--font-display); color: var(--tone); font-variant-numeric: tabular-nums; }
.ov-neigh__sig i { font-style: normal; color: var(--muted); font-size: 10.5px; margin-left: 3px; }
.ov-neigh__n { margin-left: auto; color: var(--muted); font-size: 12px; }
.ov-neigh__rel { color: var(--moss); }
.ov-neigh__spark { height: 24px; }
.ov-spark { width: 100%; height: 24px; display: block; }
.ov-spark path { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke: var(--moss); }
.ov-spark--rssi path { stroke: var(--sky); }

.ov-collapse {
  background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 8px;
  width: 28px; height: 28px; cursor: pointer; font-size: 16px; line-height: 1;
}
.ov-collapse:hover { color: var(--text); border-color: var(--text); }
.ov-compare-body { overflow-x: auto; }
.ov-compare-body[hidden] { display: none; }
.ov-cmp { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ov-cmp th, .ov-cmp td { padding: 6px 8px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ov-cmp th:first-child, .ov-cmp td:first-child { text-align: left; }
.ov-cmp th { color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); font-family: var(--font-display); }
.ov-cmp td { border-top: 1px solid rgba(62, 47, 87, 0.35); }
.ov-cmp__name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.ov-cmp__n { color: var(--muted); font-size: 10px; }
.ov-cmp__delta { font-weight: 700; }
.ov-cmp__delta.pos { color: var(--moss); }
.ov-cmp__delta.neg { color: var(--fox-ember); }
.ov-cmp__foot { color: var(--muted); font-size: 11.5px; margin-top: 8px; line-height: 1.4; }

/* --- responsive ---------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .ov-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ov-stats6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ov-nb__row { grid-template-columns: minmax(0, 1.4fr) 60px minmax(130px, 1fr) minmax(130px, 1fr) 70px; }
  .ov-nb__last { display: none; }
}
@media (max-width: 900px) {
  .ov-root { padding: 12px 16px 96px; gap: 12px; }
  .ov-cards, .ov-benchgrid { grid-template-columns: 1fr; }
  .ov-howto__steps { grid-template-columns: 1fr; }
  .ov-lrow {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "time type hops" "main main main" "sig sig sig";
    gap: 6px 10px;
  }
  .ov-lrow__time { grid-area: time; }
  .ov-lrow__type { grid-area: type; }
  .ov-lrow__hops { grid-area: hops; justify-self: end; }
  .ov-lrow__main { grid-area: main; }
  .ov-lrow__sig { grid-area: sig; flex-direction: row; gap: 14px; }
  .ov-lrow__sig .ov-sig { flex: 1 1 0; }
  .ov-nb__row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
  .ov-nb__row--head { display: none; }
  .ov-nb__name { grid-column: 1; }
  .ov-nb__n { grid-column: 2; text-align: right; }
  .ov-nb__snr, .ov-nb__rssi { grid-column: auto; }
  .ov-nb__km { display: none; }
  .ov-live-count { margin-left: 0; flex-basis: 100%; }
  .ov-live { max-height: none; overflow: visible; }
}
@media (max-width: 600px) {
  .ov-head { padding: 12px; border-radius: 18px; gap: 12px; }
  /* The picker popup spans the header card instead of hanging off the title. */
  .ov-combo { position: static; }
  .ov-combo__pop { left: 8px; right: 8px; width: auto; top: auto; margin-top: 6px; }
  .ov-head__top { gap: 10px; }
  .ov-head__avatar { width: 40px; height: 40px; font-size: 20px; }
  .ov-head__main { flex: 1 1 0; }
  .ov-combo__btn { font-size: 21px; padding: 2px 8px 2px 6px; }
  .ov-head__actions { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .ov-head__actions .ov-btn { justify-content: center; padding: 8px 6px; font-size: 12.5px; }
  .ov-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .ov-kpi { padding: 8px 8px 7px; border-radius: 12px; gap: 1px; }
  .ov-kpi__icon { font-size: 14px; }
  .ov-kpi__value { font-size: 20px; }
  .ov-kpi__value small { font-size: 11px; }
  .ov-kpi__label { font-size: 10.5px; }
  .ov-kpi__sub { font-size: 10.5px; }
  .ov-kpi__strip { height: 6px; }
  .ov-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ov-tab { justify-content: center; padding: 10px 8px; font-size: 13.5px; }
  .ov-tab__badge { display: none; }
  .ov-live-top { gap: 10px; }
  .ov-live-lead { display: none; }
  .ov-live-actions { margin-left: auto; }
  .ov-filters__sep { display: none; }
  .ov-chipbtn { padding: 6px 10px; font-size: 12.5px; }
  .ov-hbar { grid-template-columns: minmax(0, 8rem) minmax(30px, 1fr) auto; }
  .ov-stats6 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .ov-stat { padding: 7px 8px; }
  .ov-stat__v { font-size: 17px; }
  .ov-benchctl__opts { width: 100%; }
  .ov-benchctl__opts .ov-field { flex: 1 1 0; }
  .ov-chart-wrap { height: 200px; }
  .ov-nb__snr small, .ov-nb__rssi small { display: none; }
  .ov-up7__row, .ov-up7__axis { grid-template-columns: 30px repeat(24, minmax(0, 1fr)); gap: 2px; }
  .ov-up7__axis { grid-template-columns: 30px repeat(4, minmax(0, 1fr)) 0; }
  .ov-up7__cell { height: 12px; }
}
