/* Transight Device Test Server — GUI styles (Appendix L.4).
   Transight's colours (v1.19.1): the wine accent #860A2D of transight.com (a rose of it in the dark theme), warm greys,
   the brand black top bar with a crimson line, and status colours ok / info / warn / error, each with a light and a dark
   value. The accent stays clear of the error red (OKLab distance >= 11 in both themes).
   System fonts only; monospace for IMEIs, hex and wire text; table rows 32 px; no web fonts, no external files. */

/* ------------------------------------------------------------------------------------------------- tokens */
:root {
  color-scheme: light;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, "DejaVu Sans Mono", Menlo, monospace;
  --topbar-h: 52px;
  --nav-w: 216px;
  --nav-w-collapsed: 56px;
  --row-h: 32px;
  --radius: 8px;

  --brand-black: #020202;   /* transight.com's background */
  --brand-crimson: #af0838; /* its glow and progress line */
  --brand-wine: #860a2d;    /* its buttons */

  --bg: #f6f4f5;
  --surface: #ffffff;
  --surface-2: #f9f8f8;
  --surface-3: #f0eeef;
  --border: #e0dcde;
  --border-soft: #edeaeb;
  --border-strong: #c8c1c4;
  --text: #241d20;
  --text-2: #564d51;
  --text-3: #6e6669;
  --row-hover: #f8f6f7;
  --skeleton: #e9e6e7;

  --accent: #860a2d;
  --accent-bg: #860a2d;
  --accent-bg-hover: #6c0824;
  --accent-soft: #f9ecf0;
  --accent-lit: #f2d0da;
  --on-accent: #ffffff;
  --focus: #af0838;
  --danger-bg: #b42318;
  --danger-bg-hover: #96190f;

  --ok: #1a7f37;      --ok-soft: #e4f4e9;
  --info: #0b69a3;    --info-soft: #e2f0f9;
  --warn: #8a5a00;    --warn-soft: #fff2d3;
  --error: #c42b1c;   --error-soft: #fde8e5;
  --neutral: #6b6467; --neutral-soft: #f0eeef;
  --mock: #8a5a00;    --mock-soft: #fff2d3;
  --offline: #6b6467; --offline-soft: #f0eeef;

  --mock-bg: #f5bd3f;
  --mock-text: #271a00;
  --outage-bg: #b42318;
  --outage-text: #ffffff;

  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948;
  --chart-error: #d03b3b; --chart-warn: #f0a81a; --chart-info: #6c9fd8;
  --grid: #ebe8e9;
  --axis: #cdc8ca;
  --band-warn: rgb(240 168 26 / 0.22);
  --band-error: rgb(196 43 28 / 0.13);
  --band-info: rgb(11 105 163 / 0.11);
  --band-ok: rgb(26 127 55 / 0.11);
  --band-neutral: rgb(107 100 103 / 0.12);
  --band-mock: rgb(240 168 26 / 0.22);
  --band-accent: rgb(134 10 45 / 0.10);

  --shadow: 0 1px 2px rgb(36 20 26 / 0.06), 0 2px 6px rgb(36 20 26 / 0.06);
  --shadow-lg: 0 4px 10px rgb(36 20 26 / 0.10), 0 16px 32px rgb(36 20 26 / 0.14);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #131011; --surface: #1e191b; --surface-2: #241f21; --surface-3: #2f282b;
    --border: #393235; --border-soft: #2e272a; --border-strong: #4e4549;
    --text: #ede9eb; --text-2: #c4bdc0; --text-3: #a0979b; --row-hover: #272023; --skeleton: #322b2e;
    --accent: #e887b6; --accent-bg: #9b0e39; --accent-bg-hover: #b0123f; --accent-soft: #2e1520; --accent-lit: #4d1d30;
    --on-accent: #ffffff; --focus: #e887b6; --danger-bg: #c4352a; --danger-bg-hover: #d24337;
    --ok: #57c97b; --ok-soft: #13291b; --info: #64b5ec; --info-soft: #0f2536; --warn: #f2b84b; --warn-soft: #2f2410;
    --error: #f7845f; --error-soft: #361a14; --neutral: #b1aaad; --neutral-soft: #2f282b; --mock: #f2b84b;
    --mock-soft: #2f2410; --offline: #b1aaad; --offline-soft: #2f282b;
    --mock-bg: #e0a52a; --mock-text: #1d1300; --outage-bg: #b42318; --outage-text: #ffffff;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
    --chart-error: #e0544c; --chart-warn: #f0b429; --chart-info: #5c8fd0;
    --grid: #2f282b; --axis: #494145;
    --band-warn: rgb(240 180 41 / 0.17); --band-error: rgb(247 132 95 / 0.15); --band-info: rgb(100 181 236 / 0.13);
    --band-ok: rgb(87 201 123 / 0.12); --band-neutral: rgb(177 170 173 / 0.12); --band-mock: rgb(240 180 41 / 0.17);
    --band-accent: rgb(232 135 182 / 0.13);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4); --shadow-lg: 0 8px 28px rgb(0 0 0 / 0.5);
  }
}

/* The top bar is always the brand black, so it takes the dark values in both themes. */
:root[data-theme="dark"], .topbar {
  color-scheme: dark;
  --bg: #131011; --surface: #1e191b; --surface-2: #241f21; --surface-3: #2f282b;
  --border: #393235; --border-soft: #2e272a; --border-strong: #4e4549;
  --text: #ede9eb; --text-2: #c4bdc0; --text-3: #a0979b; --row-hover: #272023; --skeleton: #322b2e;
  --accent: #e887b6; --accent-bg: #9b0e39; --accent-bg-hover: #b0123f; --accent-soft: #2e1520; --accent-lit: #4d1d30;
  --on-accent: #ffffff; --focus: #e887b6; --danger-bg: #c4352a; --danger-bg-hover: #d24337;
  --ok: #57c97b; --ok-soft: #13291b; --info: #64b5ec; --info-soft: #0f2536; --warn: #f2b84b; --warn-soft: #2f2410;
  --error: #f7845f; --error-soft: #361a14; --neutral: #b1aaad; --neutral-soft: #2f282b; --mock: #f2b84b;
  --mock-soft: #2f2410; --offline: #b1aaad; --offline-soft: #2f282b;
  --mock-bg: #e0a52a; --mock-text: #1d1300; --outage-bg: #b42318; --outage-text: #ffffff;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  --chart-error: #e0544c; --chart-warn: #f0b429; --chart-info: #5c8fd0;
  --grid: #2f282b; --axis: #494145;
  --band-warn: rgb(240 180 41 / 0.17); --band-error: rgb(247 132 95 / 0.15); --band-info: rgb(100 181 236 / 0.13);
  --band-ok: rgb(87 201 123 / 0.12); --band-neutral: rgb(177 170 173 / 0.12); --band-mock: rgb(240 180 41 / 0.17);
  --band-accent: rgb(232 135 182 / 0.13);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4); --shadow-lg: 0 8px 28px rgb(0 0 0 / 0.5);
}

.tone-ok { --tone: var(--ok); --tone-soft: var(--ok-soft); }
.tone-info { --tone: var(--info); --tone-soft: var(--info-soft); }
.tone-warn { --tone: var(--warn); --tone-soft: var(--warn-soft); }
.tone-error { --tone: var(--error); --tone-soft: var(--error-soft); }
.tone-neutral { --tone: var(--neutral); --tone-soft: var(--neutral-soft); }
.tone-mock { --tone: var(--mock); --tone-soft: var(--mock-soft); }
.tone-offline { --tone: var(--offline); --tone-soft: var(--offline-soft); }

/* ------------------------------------------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; }
h3 { font-size: 13px; margin: 14px 0 8px; color: var(--text-2); font-weight: 600; }
code, kbd, .mono { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
p { margin: 0 0 8px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--text-3); }
.icon { flex: none; display: inline-block; vertical-align: middle; }
[hidden] { display: none !important; }
.boot { padding: 40px; color: var(--text-3); text-align: center; }
kbd {
  display: inline-block; min-width: 18px; text-align: center; font-size: 11px; line-height: 16px;
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px;
  background: var(--surface-2); color: var(--text-2); margin-right: 3px;
}

/* ------------------------------------------------------------------------------------------------ shell */
.app-shell { display: grid; grid-template-rows: var(--topbar-h) auto minmax(0, 1fr); height: 100vh; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 0 12px 0 16px; min-width: 0;
  background: var(--brand-black); color: var(--text); border-bottom: 2px solid var(--brand-crimson); position: relative; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 12px; color: #ffffff; font-weight: 600; font-size: 14px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; flex: none; }
.brand-name { color: var(--text-2); padding-left: 12px; border-left: 1px solid var(--border-strong); line-height: 20px; }
.env-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
  padding: 2px 8px; border-radius: 4px; color: var(--accent); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.topbar-spacer { flex: 1; }
.topbar-tools { display: flex; align-items: center; gap: 8px; }
.search { position: relative; flex: 0 1 340px; min-width: 150px; margin-left: 6px; }
.search-input {
  width: 100%; height: 32px; padding: 0 30px 0 32px; border-radius: 6px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font: inherit;
}
.search-input:focus { outline: 2px solid var(--focus); outline-offset: -1px; background: var(--surface); }
.search-input::-webkit-search-cancel-button { display: none; }
.search-icon { position: absolute; left: 10px; top: 8px; color: var(--text-3); pointer-events: none; }
.search-kbd { position: absolute; right: 6px; top: 7px; pointer-events: none; }
.search-input:focus ~ .search-kbd, .search-input:not(:placeholder-shown) ~ .search-kbd { display: none; }
.search-results {
  position: absolute; top: 38px; left: 0; width: max(100%, 380px); z-index: 50; list-style: none; margin: 0; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg);
  max-height: 60vh; overflow: auto;
}
.search-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.search-item[aria-selected="true"], .search-item:hover { background: var(--accent-soft); }
.search-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.search-meta { color: var(--text-3); font-size: 12px; }
.search-empty { padding: 8px; color: var(--text-3); }
.dot { width: 8px; height: 8px; border-radius: 4px; flex: none; display: inline-block; }
.dot-ok { background: var(--ok); }
.dot-off { border: 1.5px solid var(--text-3); }

.live-indicator {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px;
  border: 1px solid transparent; background: var(--tone-soft); color: var(--tone); font: inherit; font-size: 12px;
  font-weight: 600; cursor: pointer; white-space: nowrap;
}
.utc-toggle {
  height: 28px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-2); font: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0.03em; cursor: pointer;
}
.utc-toggle[aria-pressed="true"] { background: var(--accent-bg); border-color: var(--accent-bg); color: var(--on-accent); }
.automation-count {
  font-size: 12px; color: var(--text-2); background: var(--surface-3); padding: 3px 9px; border-radius: 10px; white-space: nowrap;
}
.automation-count:hover { text-decoration: none; color: var(--text); }
/* M35 (DTS-TRC-09): "Tracing N" while device traces run, linked to #/traces */
.trace-count {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--info);
  background: var(--info-soft); padding: 3px 9px; border-radius: 10px; white-space: nowrap;
}
.trace-count:hover { text-decoration: none; }

.mock-banner {
  display: flex; align-items: center; gap: 10px; padding: 6px 14px; min-height: 40px; z-index: 25;
  background: var(--mock-bg); color: var(--mock-text); font-weight: 500; font-size: 13px;
}
.mock-banner.is-outage { background: var(--outage-bg); color: var(--outage-text); }
.banner-icon { display: inline-flex; }
.banner-label { font-weight: 800; letter-spacing: 0.04em; white-space: nowrap; }
.banner-items { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.banner-item { overflow-wrap: anywhere; }
a.banner-item { color: inherit; text-decoration: underline; }
.banner-sep { opacity: 0.6; }
.banner-countdown { font-weight: 700; font-size: 12.5px; }
.banner-storage { font-weight: 800; }
.banner-storage a { color: inherit; text-decoration: underline; }
.banner-spacer { flex: 1; }
.banner-stop, .banner-stop-alt { background: var(--mock-text); color: var(--mock-bg); border-color: var(--mock-text); font-weight: 700; }
.banner-stop:hover, .banner-stop-alt:hover { background: var(--mock-text); filter: brightness(1.3); }
.mock-banner.is-outage .banner-stop, .mock-banner.is-outage .banner-stop-alt { background: #ffffff; color: #8a1c13; border-color: #ffffff; }

.app-body { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 0; }
/* fixed rows: a hidden banner (display: none) is not a grid item, and without these the body would move into the
   banner's auto row and stop short of the window's bottom on short pages */
.app-shell > .topbar { grid-row: 1; }
.app-shell > .mock-banner { grid-row: 2; }
.app-shell > .app-body { grid-row: 3; }
.app-shell[data-nav="collapsed"] .app-body { grid-template-columns: var(--nav-w-collapsed) minmax(0, 1fr); }
.sidenav { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.nav-scroll { overflow-y: auto; flex: 1; padding: 8px; }
.nav-group + .nav-group { margin-top: 8px; }
.nav-group-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-3);
  padding: 6px 10px 3px;
}
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: 6px;
  color: var(--text-2); white-space: nowrap; overflow: hidden;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent-bg); }
.nav-label { overflow: hidden; text-overflow: ellipsis; }
.nav-collapse {
  display: flex; align-items: center; gap: 10px; margin: 6px 8px 10px; height: 32px; padding: 0 10px; border: 0;
  border-radius: 6px; background: transparent; color: var(--text-3); cursor: pointer; font: inherit; font-size: 13px;
}
.nav-collapse:hover { background: var(--surface-3); color: var(--text); }
.app-shell[data-nav="collapsed"] .nav-label { display: none; }
.app-shell[data-nav="collapsed"] .nav-group-label { font-size: 0; height: 1px; padding: 0; margin: 8px 6px; background: var(--border); }
.app-shell[data-nav="collapsed"] .nav-item, .app-shell[data-nav="collapsed"] .nav-collapse { justify-content: center; padding: 0; }
.app-shell[data-nav="collapsed"] .nav-collapse .icon { transform: scaleX(-1); }
.main { overflow: auto; min-width: 0; padding: 18px 24px 48px; }
.main:focus { outline: none; }
@media (max-width: 1100px) { .main { padding: 16px; } }
.topbar .search-btn { display: none; }
/* M30: a phone-width window: the menu shows its icons only and the top bar the essentials (nothing scrolls sideways) */
@media (max-width: 600px) {
  .app-body, .app-shell[data-nav="collapsed"] .app-body { grid-template-columns: var(--nav-w-collapsed) minmax(0, 1fr); }
  .nav-label { display: none; }
  .nav-group-label { font-size: 0; height: 1px; padding: 0; margin: 8px 6px; background: var(--border); }
  .nav-item, .nav-collapse { justify-content: center; padding: 0; }
  .topbar { gap: 6px; padding: 0 8px; }
  .topbar .env-badge, .topbar .theme-switch, .topbar .utc-toggle, .topbar .automation-count, .topbar .search-kbd { display: none; }
  .topbar .search:not(.is-open) { display: none; }
  .topbar .search.is-open { position: absolute; left: 8px; right: 8px; top: 9px; z-index: 40; margin: 0; }
  .topbar .search-btn { display: inline-flex; }
  .topbar .topbar-spacer { flex: 1; }
  .topbar .topbar-tools { gap: 4px; }
  .topbar .who-chip { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0; }
  .topbar .who-chip::after { content: attr(data-short); font-size: 12px; }
  .topbar .trace-count { padding: 3px 7px; }
  .topbar .trace-count .tc-word { display: none; }
}
@media (max-width: 960px) { .brand-name { display: none; } }

/* ------------------------------------------------------------------------------------------ page layout */
.page-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { font-size: 20px; margin: 0; font-weight: 650; }
.page-sub { color: var(--text-3); margin: 0; font-size: 13px; }
.live-skip { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; padding: 4px 10px; border-radius: 6px;
  background: var(--warn-soft); color: var(--warn); font-size: 13px; width: fit-content; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.card-head { display: flex; align-items: baseline; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); min-height: 42px; }
.card-head h2 { font-size: 14px; margin: 0; font-weight: 650; }
.card-hint { color: var(--text-3); font-size: 12px; }
.card-link { margin-left: auto; font-size: 12px; white-space: nowrap; }
.card-body { padding: 12px 14px; min-width: 0; }
.card-body-flush { padding: 0; }
.card-pad { padding: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
@media (max-width: 1250px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.row-wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }

/* ------------------------------------------------------------------------------------------------ tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(188px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile {
  display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; min-height: 94px; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); position: relative;
}
a.tile:hover { border-color: var(--accent-bg); text-decoration: none; }
.tile.tone-warn, .tile.tone-error, .tile.tone-mock, .tile.tone-ok { box-shadow: inset 3px 0 0 var(--tone); }
.tile-label { font-size: 12px; color: var(--text-2); }
.tile-value { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 650; line-height: 1.2; min-height: 30px; }
.tile-num { font-variant-numeric: tabular-nums; }
.tile-of { font-size: 15px; color: var(--text-3); font-weight: 500; margin-left: -6px; }
.tile-sub { font-size: 12px; color: var(--text-3); margin-top: auto; }
.tile-icon { color: var(--tone, var(--text-3)); }
.tile-link { display: inline-flex; align-items: center; gap: 5px; color: var(--tone); }
.tile-link:hover { text-decoration: underline; }
.tile .status-chip { font-size: 13px; height: 26px; }

/* --------------------------------------------------------------------------------------- buttons, fields */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 6px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit;
  font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn-primary { background: var(--accent-bg); border-color: var(--accent-bg); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-bg-hover); }
.btn-danger { background: var(--danger-bg); border-color: var(--danger-bg); color: #ffffff; }
.btn-danger:hover { background: var(--danger-bg-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-sm { height: 26px; padding: 0 8px; font-size: 12px; }
.btn:disabled, .icon-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none;
  border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.icon-btn-sm { width: 24px; height: 24px; }
.input {
  height: 32px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface);
  color: var(--text); font: inherit; min-width: 0; width: 100%;
}
textarea.input { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.4; }
.input:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: var(--focus); }
.input.mono { font-family: var(--mono); font-size: 12.5px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-inline { flex-direction: row; align-items: center; gap: 8px; }
.field-label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field-hint { font-size: 12px; color: var(--text-3); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent-bg); }
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; background: var(--surface); width: max-content; }
.seg-btn {
  border: 0; background: transparent; color: var(--text-2); height: 30px; padding: 0 10px; display: inline-flex;
  align-items: center; gap: 6px; cursor: pointer; font: inherit; font-size: 13px;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--border); }
.seg-btn:hover { background: var(--surface-3); }
.seg-btn[aria-checked="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.seg-btn:focus-visible { outline-offset: -2px; }
.seg-sm .seg-btn { height: 26px; padding: 0 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-tag {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 4px 0 9px; border-radius: 12px;
  background: var(--surface-3); color: var(--text); font-size: 12px;
}
.chip-remove {
  border: 0; background: transparent; color: var(--text-3); width: 18px; height: 18px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.chip-remove:hover { background: var(--border); color: var(--text); }
.tag-input { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; height: auto; min-height: 32px; padding: 3px 6px; cursor: text; }
.tag-input-chips { display: contents; }
.tag-input-box { border: 0; outline: none; background: transparent; color: var(--text); font: inherit; flex: 1; min-width: 80px; height: 24px; }
.tag-input:focus-within { outline: 2px solid var(--focus); outline-offset: -1px; }
.input-with-btn { display: flex; gap: 4px; align-items: center; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; align-items: start; }

/* ------------------------------------------------------------------------------------- chips, tags, badges */
.status-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px 0 6px; border-radius: 11px;
  font-size: 12px; font-weight: 600; background: var(--tone-soft); color: var(--tone); white-space: nowrap;
  vertical-align: middle; max-width: 100%; overflow: hidden;
}
.status-chip > span { overflow: hidden; text-overflow: ellipsis; }
.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 4px; background: var(--surface-3);
  font-size: 12px; color: var(--text-2); white-space: nowrap;
}
.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--tone-soft); color: var(--tone); font-size: 11px; font-weight: 700;
}

/* ----------------------------------------------------------------------------------------------- tables */
.dt { display: flex; flex-direction: column; min-width: 0; }
.dt-toolbar { display: flex; align-items: center; gap: 10px; padding: 0 0 8px; min-height: 34px; }
.dt-tools { flex: 1; display: flex; gap: 8px; align-items: center; min-width: 0; }
.dt-count { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dt-scroll { overflow: auto; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); position: relative; }
.dt-scroll:focus { outline: none; }
.card-body-flush .dt-scroll { border: 0; border-radius: 0 0 var(--radius) var(--radius); }
.dt-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: 100%; font-variant-numeric: tabular-nums; }
.dt-table th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2); height: var(--row-h); padding: 0 10px;
  text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none;
}
.dt-table th.is-sorted { color: var(--text); }
.dt-table th.is-drop { box-shadow: inset 2px 0 0 var(--accent-bg); }
.dt-table th.is-dragging { opacity: 0.5; }
.dt-table td {
  height: var(--row-h); padding: 0 10px; border-bottom: 1px solid var(--border-soft); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
}
.dt-compact .dt-table td, .dt-compact .dt-table th { padding: 0 12px; }
.dt-sort {
  all: unset; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; max-width: 100%; border-radius: 3px;
}
.dt-sort:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.dt-th-label { overflow: hidden; text-overflow: ellipsis; }
.dt-sort-icon { color: var(--text-3); }
.is-sorted .dt-sort-icon { color: var(--accent); }
.align-right { text-align: right !important; }
.align-center { text-align: center !important; }
.align-right .dt-sort { flex-direction: row-reverse; }
.dt-row:hover td { background: var(--row-hover); }
.dt-row[tabindex] { cursor: pointer; }
.dt-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.dt-row.is-selected td { background: var(--accent-soft); }
.dt-row.is-active td:first-child { box-shadow: inset 3px 0 0 var(--accent-bg); }
.dt-table td.is-empty { color: var(--text-3); }
.dt-table td.dt-select, .dt-table th.dt-select { padding: 0; text-align: center; }
.dt-spacer td { padding: 0; border: 0; }
.dt-row:last-child td { border-bottom-color: transparent; }
.dt-empty td { height: auto; padding: 8px; white-space: normal; }
.dt-skeleton td .sk-bar { height: 10px; }
.dt-table .status-chip { height: 20px; }
.cell-link { display: inline-flex; gap: 8px; align-items: baseline; max-width: 100%; overflow: hidden; }
.cell-sub { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.num-link { color: var(--text); }
.simple-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.simple-table th, .simple-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border-soft); }
.simple-table th { color: var(--text-2); font-weight: 500; width: 40%; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ----------------------------------------------------------------------------------------------- charts */
.chart { position: relative; min-width: 0; }
.chart-legend { display: flex; align-items: center; gap: 12px; min-height: 20px; margin-bottom: 6px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.chart-ylabel { color: var(--text-3); }
.legend-items { display: flex; gap: 6px 14px; flex-wrap: wrap; margin-left: auto; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-area { position: relative; }
.chart-plot { position: relative; outline: none; border-radius: 4px; }
.chart-plot:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.chart-svg { display: block; overflow: visible; }
.chart-grid line { stroke: var(--grid); stroke-width: 1; }
.chart-grid line.chart-baseline, .chart-grid line.chart-tickmark { stroke: var(--axis); }
.chart-tick { fill: var(--text-3); font: 11px var(--font); font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dots { stroke: var(--surface); stroke-width: 1.5; }
.chart-marker-line { stroke-width: 1; opacity: 0.55; }
.chart-marker { stroke: var(--surface); stroke-width: 1; }
.chart-marker-x { fill: none; stroke-width: 2; stroke-linecap: round; }
.chart-yband-edge { stroke-width: 1; opacity: 0.45; }
.chart-guide { stroke: var(--text-3); stroke-width: 1; }
.chart-hover-dot { stroke: var(--surface); stroke-width: 2; }
.chart-hit { fill: transparent; cursor: crosshair; }
.chart-svg.has-hover .chart-bar:not(.is-hover) { opacity: 0.45; }
.chart-empty {
  display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 13px; text-align: center;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 6px; padding: 0 16px;
}
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 6px; box-shadow: var(--shadow-lg); padding: 6px 9px; font-size: 12px; min-width: 150px; max-width: 340px;
}
.tip-title { color: var(--text-2); margin-bottom: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tip-row { display: flex; align-items: center; gap: 7px; line-height: 1.55; }
.tip-val { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.tip-name { color: var(--text-2); overflow-wrap: anywhere; }
.tip-time { color: var(--text-3); margin-left: auto; padding-left: 8px; white-space: nowrap; }
.tip-total { border-top: 1px solid var(--border-soft); margin-top: 2px; padding-top: 2px; }
.tip-band .tip-name, .tip-marker .tip-name { color: var(--text); }
.tip-key { display: inline-block; width: 12px; flex: none; }
.tip-key-line { height: 3px; border-radius: 2px; }
.tip-key-rect { height: 10px; border-radius: 2px; }
.tip-key-svg { flex: none; }

/* ----------------------------------------------------------------------------------------------- hex view */
.hexview {
  font-family: var(--mono); font-size: 12.5px; line-height: 21px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; overflow-x: auto; max-height: 420px; overflow-y: auto;
}
.hx-row { display: flex; gap: 16px; white-space: nowrap; width: max-content; }
.hx-head { color: var(--text-3); border-bottom: 1px solid var(--border); margin-bottom: 3px; position: sticky; top: -6px; background: var(--surface-2); }
.hx-head .hx-off, .hx-head .hx-ascii { font-family: var(--font); font-size: 11px; }
.hx-off { color: var(--text-3); min-width: 6ch; }
.hx-bytes { display: inline-flex; width: calc(16 * 2.7ch + 1ch); flex: none; }
.hx-b { display: inline-block; width: 2.7ch; text-align: center; border-radius: 2px; cursor: default; }
.hx-mid { margin-left: 1ch; }
.hx-ascii { display: inline-flex; }
.hx-a { display: inline-block; width: 1ch; text-align: center; cursor: default; }
.hx-np { color: var(--text-3); }
.hexview .is-lit { background: var(--accent-lit); color: var(--text); }
.hexview .hx-b.is-lit:not(.is-lit-end) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.hexview .hx-b.is-lit:not(.is-lit-start) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.hx-empty, .hx-more { color: var(--text-3); padding: 6px 0; font-family: var(--font); }
.hex-demo { display: grid; grid-template-columns: max-content minmax(220px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .hex-demo { grid-template-columns: minmax(0, 1fr); } }
.field-spans { list-style: none; margin: 0 0 10px; padding: 0; }
.field-spans li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 8px; border-radius: 4px; cursor: default; }
.field-spans li:hover, .field-spans li:focus, .field-spans li.is-lit { background: var(--accent-lit); outline: none; }
.hover-out { display: block; color: var(--text-2); font-size: 12px; min-height: 18px; }

/* --------------------------------------------------------------------------------- drawer, modal, popover */
.drawer {
  position: fixed; top: var(--topbar-h); right: 0; bottom: 0; z-index: 40; background: var(--surface);
  border-left: 1px solid var(--border); box-shadow: -10px 0 28px rgb(0 0 0 / 0.14); display: flex; flex-direction: column;
}
.drawer-head { display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--border); }
.drawer-titles { flex: 1; min-width: 0; }
.drawer-title { font-size: 15px; margin: 2px 0 0; overflow-wrap: anywhere; }
.drawer-sub { color: var(--text-3); font-size: 12px; overflow-wrap: anywhere; }
.drawer-sub:empty { display: none; }
.drawer-actions { display: flex; gap: 6px; align-items: center; }
.drawer-body { overflow: auto; padding: 14px 16px; flex: 1; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgb(8 12 18 / 0.48); display: flex; align-items: flex-start;
  justify-content: center; padding-top: 12vh;
}
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
  max-height: 76vh; display: flex; flex-direction: column;
}
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 12px 6px 18px; }
.modal-title { font-size: 16px; margin: 0; flex: 1; }
.modal-icon { display: inline-flex; color: var(--info); }
.modal.tone-danger .modal-icon { color: var(--error); }
.modal-body { padding: 4px 18px 10px; overflow: auto; color: var(--text-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 18px 16px; }
.confirm-list { margin: 4px 0 0; padding-left: 20px; }
.popover {
  position: fixed; z-index: 70; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow-lg); padding: 10px 14px 12px; min-width: 250px; max-width: 360px; font-size: 13px;
}
.popover p { color: var(--text-2); }
.popover-title { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); margin: 6px 0 6px; }
.popover-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.popover-hint { color: var(--text-3) !important; font-size: 12px; margin: 8px 0 0; }
.colmenu-list { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow: auto; }
.colmenu-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 1px 0; }
.colmenu-move { display: inline-flex; }
.shortcuts { display: grid; grid-template-columns: max-content 1fr; gap: 5px 12px; margin: 0; align-items: center; }
.shortcuts dd { margin: 0; color: var(--text-2); }

/* ------------------------------------------------------------------------------------------------ toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 8px 10px 12px; pointer-events: auto;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--tone); border-radius: 8px;
  box-shadow: var(--shadow-lg);
}
.toast-icon { color: var(--tone); display: inline-flex; padding-top: 1px; }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 650; }
.toast-msg { color: var(--text-2); overflow-wrap: anywhere; }
.toast-count { font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--text-2); border-radius: 8px; padding: 0 6px; margin-top: 2px; }
.toast-close { width: 24px; height: 24px; }

/* -------------------------------------------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  border: 0; background: transparent; padding: 8px 12px; font: inherit; color: var(--text-2); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap;
}
.tab:hover:not(:disabled) { color: var(--text); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent-bg); font-weight: 600; }
.tab:disabled { opacity: 0.45; cursor: not-allowed; }
.tab:focus-visible { outline-offset: -2px; }
.tab-count { font-size: 11px; background: var(--surface-3); border-radius: 9px; padding: 0 6px; color: var(--text-2); font-weight: 600; }
.tab-panel { padding: 12px 0 0; }
.tab-panel:focus { outline: none; }

/* --------------------------------------------------------------------------------- empty, skeleton, misc */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 28px 16px; color: var(--text-2); }
.empty-compact { padding: 18px 12px; }
.empty-icon { color: var(--text-3); display: inline-flex; }
.empty-title { font-weight: 650; color: var(--text); }
.empty-hint { font-size: 13px; color: var(--text-3); max-width: 440px; }
.empty-action { margin-top: 6px; }
.empty-error .empty-icon { color: var(--error); }
.skeleton { display: flex; flex-direction: column; gap: 10px; padding: 6px 0; }
.sk-bar, .sk-block { display: block; background: var(--skeleton); border-radius: 4px; }
.sk-block { width: 100%; border-radius: 6px; margin-top: 10px; }
@media (prefers-reduced-motion: no-preference) {
  .sk-bar, .sk-block { animation: sk-pulse 1.6s ease-in-out infinite; }
}
@keyframes sk-pulse { 50% { opacity: 0.5; } }
.progress { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; margin: 6px 0 4px; }
.progress-bar { height: 100%; background: var(--accent-bg); }

/* ---------------------------------------------------------------------------------------- overview lists */
.event-list { list-style: none; margin: 0; padding: 0; max-height: 448px; overflow: auto; }
.event-row {
  display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; align-items: center; gap: 2px 8px;
  padding: 6px 14px; border-bottom: 1px solid var(--border-soft); font-size: 13px;
}
.event-row:last-child { border-bottom: 0; }
.event-time { color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 12px; }
.event-kind { justify-self: start; max-width: 100%; }
.event-imei { font-size: 12px; }
.event-msg { grid-column: 1 / -1; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.run-head { display: flex; align-items: center; gap: 8px; }
.run-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-meta { font-size: 12px; color: var(--text-3); }

/* ----------------------------------------------------------------------- M14 mock, test-run and device views */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.m-card { margin-bottom: 16px; }
.grid-2 > .m-card, .grid-3 > .m-card { margin-bottom: 0; }
.card-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.cell-actions { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.subnav { display: flex; gap: 4px; margin: -4px 0 16px; border-bottom: 1px solid var(--border); }
.subnav a { padding: 6px 12px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a[aria-current="page"] { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.crumbs { margin: 0 0 4px; font-size: 13px; color: var(--text-3); }
.form-error { color: var(--error); background: var(--error-soft); padding: 7px 10px; border-radius: 6px; font-size: 13px; white-space: pre-wrap; }
.drawer-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 0 4px; border-top: 1px solid var(--border-soft); margin-top: 12px; }
.linkish { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.cd { font-variant-numeric: tabular-nums; }
.m-small { font-size: 12.5px; }
.m-small td, .m-small th { padding: 4px 8px; }
details > summary { cursor: pointer; }
/* behaviour editor and lists */
.bh-head { display: grid; grid-template-columns: minmax(220px, 1.4fr) minmax(130px, 0.6fr) minmax(180px, 1fr); gap: 12px; align-items: end; }
.bh-scope { padding: 6px 0; }
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0; }
.bh-group { border: 1px solid var(--border-soft); border-radius: 6px; margin-bottom: 8px; background: var(--surface-2); }
.bh-group > summary { padding: 8px 12px; font-weight: 600; }
.bh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px 16px; padding: 4px 12px 12px; }
.bh-param { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 4px 6px; border-radius: 6px; }
.bh-param.is-set { background: var(--mock-soft); box-shadow: inset 3px 0 0 var(--mock); }
.bh-param.is-bool { justify-content: flex-start; }
.bh-err { color: var(--error); font-size: 12px; }
.bh-foot { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.bh-preview { flex: 1; min-width: 0; color: var(--text-2); overflow-wrap: anywhere; }
.bh-list { list-style: none; margin: 0; padding: 0; }
.bh-item { display: flex; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border-soft); }
.bh-item:last-child { border-bottom: 0; }
.bh-item-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.bh-params { overflow-wrap: anywhere; }
.bh-meta { flex-basis: 100%; font-size: 12px; color: var(--text-3); }
/* outages, runs, targets */
.out-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name ctl" "state ctl"; gap: 4px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.out-row:last-child { border-bottom: 0; }
.out-row.is-out { background: var(--error-soft); margin: 0 -14px; padding: 8px 14px; }
.out-name { grid-area: name; display: flex; flex-wrap: wrap; gap: 0 8px; align-items: baseline; min-width: 0; }
.out-name .muted { font-size: 12px; }
.out-state { grid-area: state; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.out-ctl { grid-area: ctl; display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.out-ctl .input { width: auto; height: 26px; font-size: 12px; padding: 0 6px; }
.run-actions { display: flex; gap: 6px; margin-top: 6px; }
.tp-list { max-height: 190px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; margin: 6px 0; display: flex; flex-direction: column; gap: 4px; }
.tp-item { gap: 10px; }
.tp-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 10px; }
.tp-boxes { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.tp-count { white-space: nowrap; font-size: 12px; }
.adm { margin-bottom: 12px; }
.adm .tp-boxes { flex-direction: column; }
.range-picker { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.range-custom { display: inline-flex; gap: 6px; align-items: center; }
.range-custom .input { width: auto; }
.tab-toolbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.rule-out { margin-top: 4px; }
.dry-out { border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; background: var(--surface-2); }
/* scenarios editor */
.sc-steps-head { display: flex; align-items: baseline; gap: 12px; }
.sc-step { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: var(--surface-2); }
.sc-step-head { display: grid; grid-template-columns: 28px minmax(0, 1fr) 110px auto; gap: 10px; align-items: end; }
.sc-step-no { font-weight: 700; color: var(--text-3); padding-bottom: 6px; }
.sc-step-body { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 10px; margin-top: 8px; }
.sc-outage { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; align-items: start; }
.sc-json { margin: 10px 0; }
.sc-json textarea { margin: 6px 0; }
/* server and listeners */
.srv-section { margin-bottom: 18px; }
.srv-section > h2, .srv-section-head h2 { font-size: 15px; margin: 0 0 8px; }
.srv-section-head { display: flex; align-items: center; gap: 10px; }
.srv-section-head .btn { margin-left: auto; margin-bottom: 8px; }
.coming { border-style: dashed; padding: 16px; }
.coming h3 { margin: 0 0 4px; color: var(--text); font-size: 14px; }
.coming-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 12px; opacity: 0.6; }
.coming-card { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: 8px; }
.m-table-wrap { overflow-x: auto; }
.m-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.m-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.m-table td { padding: 6px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.m-table tr { cursor: pointer; }
.m-table tr.is-selected td { background: var(--accent-soft); }
.pf-cell { display: inline-flex; gap: 6px; align-items: center; }
.pf-cell .input { width: auto; min-width: 220px; }
.pf-settings tr.is-diff th, .pf-settings tr.is-diff td:nth-child(2) { color: var(--warn); font-weight: 600; }
/* test runs */
.stat-row { display: flex; flex-wrap: wrap; gap: 10px 26px; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat.tone-error .stat-num, .stat.tone-warn .stat-num, .stat.tone-ok .stat-num { color: var(--tone); }
.stat-label { font-size: 12px; color: var(--text-3); }
.tr-crit th { width: auto; }
.tr-crit .input { width: 130px; }
.tr-steps { margin: 0; padding-left: 20px; }
.tr-preview { margin-bottom: 16px; }
.tr-preview > summary { list-style: none; }
.tr-report { width: 100%; height: 640px; border: 0; border-top: 1px solid var(--border); background: #ffffff; }
/* FOTA files */
.up-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px; border: 2px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-2); cursor: pointer; text-align: center; }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dl-prog { display: flex; flex-direction: column; gap: 0; font-size: 11px; }
.dl-prog .progress { margin: 2px 0; }
.dt-row.is-running td { background: var(--info-soft); }
/* device tabs */
.tl-summary { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tl-card { margin-bottom: 12px; }
.tl-events .event-list { max-height: 260px; }
.trk-plot { border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.trk-svg { display: block; width: 100%; height: auto; max-height: 560px; }
.trk-line { fill: none; stroke: var(--series-1); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.trk-rest { opacity: 0.25; }
.trk-jump { fill: none; stroke: var(--warn); stroke-width: 2.5; stroke-dasharray: 6 4; }
.trk-cur { fill: var(--accent-bg); stroke: var(--surface); stroke-width: 2; }
.trk-start circle { fill: var(--ok); }
.trk-end rect { fill: var(--error); }
.trk-start text, .trk-end text { fill: #ffffff; font-size: 11px; font-weight: 700; }
.trk-scale path { fill: none; stroke: var(--text); stroke-width: 2; }
.trk-scale text { fill: var(--text); font-size: 12px; }
.trk-scale-bg { fill: var(--surface); opacity: 0.85; }
.trk-controls { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.trk-slider { flex: 1; accent-color: var(--accent-bg); }
.trk-info { margin-top: 6px; font-size: 13px; color: var(--text-2); }
.hl-pick { position: relative; }
.hl-pick > summary { padding: 4px 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); }
.hl-pop { position: absolute; right: 0; z-index: 20; width: 300px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 8px; }
.hl-list { max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.hl-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .hl-charts, .up-grid, .sc-step-body, .bh-head { grid-template-columns: minmax(0, 1fr); } }

/* -------------------------------------------------------------------------------------------- placeholder */
.placeholder-head { display: flex; gap: 14px; align-items: flex-start; color: var(--text-2); margin-bottom: 8px; }
.placeholder-head h2 { font-size: 16px; margin: 0 0 4px; color: var(--text); }
.src-list { list-style: none; padding: 0; margin: 0 0 14px; }
.src-row { display: flex; gap: 10px; align-items: center; padding: 3px 0; }

/* ---------------------------------------------------------------------------------------------- sign-in */
.signin {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(90% 60% at 50% 100%, rgb(134 10 45 / 0.55), rgb(134 10 45 / 0) 70%), var(--brand-black);
}
.signin-preview { min-height: 0; padding: 24px 16px; background: transparent; }
.signin-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 24px; }
.signin:not(.signin-preview) .signin-card { border-top: 3px solid var(--brand-crimson); }
.signin-brand { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; margin-bottom: 20px; color: var(--text); }
.signin-title { font-weight: 650; font-size: 16px; }
.signin-sub { color: var(--text-3); font-size: 13px; }
.signin-form { display: flex; flex-direction: column; gap: 8px; }
.signin-error { color: var(--error); background: var(--error-soft); padding: 7px 10px; border-radius: 6px; font-size: 13px; }
.signin-submit { margin-top: 8px; justify-content: center; height: 36px; }
.signin-help { color: var(--text-3); font-size: 12px; margin: 16px 0 0; }
.signin-frame { border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }

/* ---------------------------------------------------------------------------------------------- gallery */
.gallery-section { margin-bottom: 16px; }
.gallery-meta { margin-bottom: 6px; }
.icon-row { gap: 4px; }
.icon-cell { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; width: 76px; padding: 6px 0; font-size: 10px; color: var(--text-3); border-radius: 6px; }
.icon-cell .icon { color: var(--text); }

@media (forced-colors: active) {
  .status-chip, .live-indicator, .tile-link, .nav-item[aria-current="page"] { border: 1px solid CanvasText; }
}
