/* Simulator hub design system: tokens (light + dark), layout shell, components. No external assets. */

:root {
  color-scheme: light;
  --bg: #f3f3f1; --surface: #fcfcfb; --surface-2: #f0efec; --surface-3: #e7e6e2; --line: #e2e1dc; --line-2: #d2d1cb;
  --text: #0b0b0b; --text-2: #52514e; --text-3: #7a7974;
  --accent: #2a78d6; --accent-2: #1c5cab; --accent-soft: #e3eefb; --on-accent: #fff;
  --good: #0ca30c; --good-ink: #006300; --good-soft: #e3f4e3;
  --warn: #fab219; --warn-ink: #8a5a00; --warn-soft: #fdf1d6;
  --serious: #ec835a; --serious-ink: #a8461f;
  --crit: #d03b3b; --crit-ink: #b52d2d; --crit-soft: #fbe5e5;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.06);
  --radius: 10px; --radius-sm: 7px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, sans-serif;
  --sidebar-w: 216px; --console-h: 46px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #121211; --surface: #1a1a19; --surface-2: #232322; --surface-3: #2c2c2a; --line: #333331; --line-2: #45453f;
    --text: #f0efec; --text-2: #c3c2b7; --text-3: #8f8e86;
    --accent: #3987e5; --accent-2: #6da7ec; --accent-soft: #1b2b40; --on-accent: #fff;
    --good-ink: #4cc24c; --good-soft: #142a14; --warn-ink: #fab219; --warn-soft: #33290f;
    --serious-ink: #ec835a; --crit-ink: #f07070; --crit-soft: #3a1a1a;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211; --surface: #1a1a19; --surface-2: #232322; --surface-3: #2c2c2a; --line: #333331; --line-2: #45453f;
  --text: #f0efec; --text-2: #c3c2b7; --text-3: #8f8e86;
  --accent: #3987e5; --accent-2: #6da7ec; --accent-soft: #1b2b40; --on-accent: #fff;
  --good-ink: #4cc24c; --good-soft: #142a14; --warn-ink: #fab219; --warn-soft: #33290f;
  --serious-ink: #ec835a; --crit-ink: #f07070; --crit-soft: #3a1a1a;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--sans); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
h1 { font-size: 20px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0; }
h3 { font-size: 12px; margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; }
.muted { color: var(--text-2); } .faint { color: var(--text-3); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.hide { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; } svg.i.lg { width: 22px; height: 22px; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 10px; gap: 2px; z-index: 6; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.brand b { display: block; font-size: 14px; line-height: 1.2; } .brand span { font-size: 11.5px; color: var(--text-3); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; position: relative; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.sel { background: var(--accent-soft); color: var(--accent); }
.nav a .badge { margin-left: auto; }
.nav kbd { margin-left: auto; font: 11px var(--mono); color: var(--text-3); }
.nav a .badge + kbd { margin-left: 6px; }
.sidebar .spacer { flex: 1; }
.sidebar .foot { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 10px 22px; flex-wrap: wrap; }
.topbar .title { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.menu-btn { display: none; }
.content { padding: 20px 22px calc(var(--console-h) + 28px); max-width: 1480px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head p { margin: 2px 0 0; color: var(--text-2); max-width: 760px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- surfaces ---------- */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.grid.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); }
.span-all { grid-column: 1 / -1; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-head .right { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card p:first-child { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.divider { height: 1px; background: var(--line); margin: 14px 0; border: 0; }

/* ---------- controls ---------- */
.btn { font: inherit; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 13px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); cursor: pointer;
  min-height: 34px; white-space: nowrap; transition: background .12s, border-color .12s, opacity .12s; }
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text-3); }
.btn:focus-visible, .nav a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .tile:focus-visible, .chip-btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { color: var(--crit-ink); }
.btn.danger:hover:not(:disabled) { background: var(--crit-soft); border-color: var(--crit); }
.btn.solid-danger { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); border-color: transparent; }
.btn.sm { min-height: 28px; padding: 3px 9px; font-size: 13px; }
.btn.lg { min-height: 42px; padding: 9px 18px; font-size: 15px; }
.btn.busy { pointer-events: none; opacity: .75; }
.btn.busy::before { content: ""; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
input, select, textarea { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 6px 9px; min-height: 34px; max-width: 100%; }
textarea { width: 100%; font: 12.5px/1.45 var(--mono); min-height: 70px; resize: vertical; }
select option { background: var(--surface); color: var(--text); }
input[type=checkbox], input[type=radio] { min-height: 0; width: 16px; height: 16px; accent-color: var(--accent); }
input[type=range] { padding: 0; border: 0; accent-color: var(--accent); min-height: 0; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--text-3); }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg button { font: inherit; border: 0; background: transparent; color: var(--text-2); padding: 5px 11px; cursor: pointer; min-height: 30px; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 34px; height: 20px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-3); transition: transform .15s, background .15s; }
.switch input:checked + .track { background: var(--crit); border-color: var(--crit); }
.switch input:checked + .track::after { transform: translateX(14px); background: #fff; }
.switch.ok input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:disabled + .track { opacity: .5; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- status vocabulary (always icon + label, never colour alone) ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; cursor: default; }
button.pill { font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
button.pill:hover { border-color: var(--text-3); }
.dev-pick { font: inherit; font-size: 12.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; max-width: 46vw; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.pill.good { color: var(--good-ink); background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 35%, transparent); } .pill.good .dot { background: var(--good); }
.pill.warn { color: var(--warn-ink); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 45%, transparent); } .pill.warn .dot { background: var(--warn); }
.pill.crit { color: var(--crit-ink); background: var(--crit-soft); border-color: color-mix(in srgb, var(--crit) 40%, transparent); } .pill.crit .dot { background: var(--crit); }
.pill.info { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); } .pill.info .dot { background: var(--accent); }
.pill.live .dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.badge { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 6px; border-radius: 10px; font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.badge.crit { background: var(--crit); color: #fff; } .badge.warn { background: var(--warn); color: #3a2800; } .badge.info { background: var(--accent); color: #fff; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.tag.crit { color: var(--crit-ink); border-color: color-mix(in srgb, var(--crit) 40%, transparent); background: var(--crit-soft); }
.tag.warn { color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); }
.tag.good { color: var(--good-ink); border-color: color-mix(in srgb, var(--good) 35%, transparent); background: var(--good-soft); }
.tag.info { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); }
.outcome { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.outcome.PASS { color: var(--good-ink); } .outcome.FAIL, .outcome.ERROR, .outcome.XPASS { color: var(--crit-ink); }
.outcome.XFAIL { color: var(--warn-ink); } .outcome.SKIP { color: var(--text-3); }
.trend { display: inline-flex; gap: 3px; align-items: center; }
.trend i { width: 9px; height: 16px; border-radius: 3px; background: var(--surface-3); display: inline-block; cursor: pointer; }
.trend i.PASS { background: var(--good); } .trend i.FAIL, .trend i.ERROR, .trend i.XPASS { background: var(--crit); }
.trend i.XFAIL { background: var(--warn); } .trend i.SKIP { background: var(--line-2); }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 14px; min-width: 0; }
.kpi .label { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 6px; font-weight: 500; }
.kpi .value { font-size: 22px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .value small { font-size: 13px; font-weight: 500; color: var(--text-2); margin-left: 3px; }
.kpi .sub { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.crit { border-color: color-mix(in srgb, var(--crit) 50%, var(--line)); } .kpi.crit .value { color: var(--crit-ink); }
.kpi.good .value { color: var(--good-ink); } .kpi.warn .value { color: var(--warn-ink); }

/* ---------- hero (home) ---------- */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; padding: 22px; border-radius: 14px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%); border: 1px solid var(--line); }
.hero h1 { font-size: 23px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero p { margin: 6px 0 0; color: var(--text-2); }
.hero .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.device-pick { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.device-pick label { border: 1.5px solid var(--line-2); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; display: flex; gap: 11px; align-items: flex-start; background: var(--surface); }
.device-pick label:hover { border-color: var(--text-3); }
.device-pick input { position: absolute; opacity: 0; pointer-events: none; }
.device-pick label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.device-pick label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.device-pick b { display: block; } .device-pick span { font-size: 12.5px; color: var(--text-2); }
.device-pick .ic { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); flex: none; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.steps li { display: flex; gap: 11px; align-items: flex-start; padding: 8px 6px; border-radius: 8px; }
.steps .n { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--text-3); flex: none; }
.steps li.done .n { background: var(--good); border-color: var(--good); color: #fff; }
.steps li.now .n { border-color: var(--accent); color: var(--accent); }
.steps b { display: block; font-weight: 600; } .steps span { font-size: 12.5px; color: var(--text-2); }
details.adv summary { cursor: pointer; color: var(--text-2); font-weight: 500; padding: 4px 0; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details.adv summary::-webkit-details-marker { display: none; }
details.adv[open] summary svg { transform: rotate(90deg); }
details.adv summary svg { transition: transform .15s; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); margin-top: 10px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; }
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); color: var(--text); }
.notice.warn svg { color: var(--warn-ink); }
.notice.crit { background: var(--crit-soft); border-color: color-mix(in srgb, var(--crit) 40%, transparent); }
.notice.crit svg { color: var(--crit-ink); }
.notice.good { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.notice.good svg { color: var(--good-ink); }
.notice.info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.notice.info svg { color: var(--accent); }

/* ---------- device tiles ---------- */
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.tiles.t8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.tiles.t6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1360px) { .tiles.t8 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tiles.t6 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px 8px; cursor: pointer; text-align: left; font: inherit; color: inherit; min-width: 0; transition: border-color .12s, box-shadow .12s; }
.tile:hover { border-color: var(--text-3); box-shadow: var(--shadow); }
.tile .t-head { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.tile .t-head .right { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.tile .t-val { font-size: 21px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 2px 0 0; line-height: 1.25; }
.tile .t-val small { font-size: 12px; font-weight: 500; color: var(--text-2); margin-left: 2px; }
.tile .t-sub { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 16px; }
.tile svg.spark { width: 100%; height: 26px; display: block; margin-top: 4px; }
.tile.fault { border-color: var(--crit); box-shadow: inset 0 0 0 1px var(--crit); }
.tile.mismatch { border-color: var(--warn); }
.tile.charted::after { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--tile-color, var(--accent)); }
.led { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; color: var(--text-3); letter-spacing: .03em; }
.led::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--line-2); }
.led.on { color: var(--good-ink); } .led.on::before { background: var(--good); border-color: var(--good); box-shadow: 0 0 6px color-mix(in srgb, var(--good) 60%, transparent); }
.bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .4s; }

/* ---------- charts ---------- */
.chart { position: relative; }
.chart svg.plot { width: 100%; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-text { fill: var(--text-3); font-size: 11px; font-family: var(--sans); }
.chart .end-label { font-size: 11px; font-weight: 600; fill: var(--text-2); font-family: var(--sans); }
.chart .hair { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow); padding: 7px 10px; font-size: 12px; min-width: 120px; z-index: 3; }
.chart .tip .tt { color: var(--text-3); margin-bottom: 3px; }
.chart .tip .tr { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.chart .tip .tr b { font-variant-numeric: tabular-nums; min-width: 52px; }
.chart .tip .tr i, .legend i { width: 14px; height: 2.5px; border-radius: 2px; display: inline-block; flex: none; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart .empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 13px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -2px; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-variant-numeric: tabular-nums; }
th { font-size: 12px; font-weight: 600; color: var(--text-3); background: var(--surface); position: sticky; top: 0; z-index: 1; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
tr.clickable { cursor: pointer; }
tr.expanded td { background: var(--surface-2); }
td.detail { background: var(--surface-2); padding: 4px 14px 14px; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty-state { text-align: center; padding: 30px 16px; color: var(--text-3); }
.empty-state svg { width: 34px; height: 34px; stroke: var(--text-3); margin-bottom: 6px; }

/* ---------- cases ---------- */
.cases { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.case { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.case.na { opacity: .55; }
.case .c-title { display: flex; gap: 8px; align-items: flex-start; }
.case .c-title b { font-size: 14.5px; flex: 1; }
.case .expect { font-size: 13px; padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-sm); }
.case .expect b { color: var(--text-2); font-weight: 600; font-size: 12px; display: block; }
.case ol { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--text-2); }
.case .c-foot { margin-top: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.case .last { font-size: 12px; color: var(--good-ink); display: flex; align-items: center; gap: 5px; }

/* ---------- logs / console ---------- */
pre.log { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0;
  overflow: auto; white-space: pre-wrap; word-break: break-word; font: 12px/1.5 var(--mono); max-height: 560px; color: var(--text); }
.log .l-pass { color: var(--good-ink); font-weight: 700; } .log .l-fail { color: var(--crit-ink); font-weight: 700; } .log .l-warn { color: var(--warn-ink); font-weight: 600; }
.log .l-head { color: var(--accent); font-weight: 600; }
.console { position: fixed; left: var(--sidebar-w); right: 0; bottom: 0; z-index: 8; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(0,0,0,.06); }
.console .c-head { display: flex; align-items: center; gap: 10px; padding: 7px 18px; cursor: pointer; min-height: var(--console-h); flex-wrap: wrap; }
.console .c-head .c-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50vw; }
.console .progress { height: 2px; background: var(--accent); position: absolute; top: -1px; left: 0; width: 30%; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { left: -30%; } 100% { left: 100%; } }
.console pre.log { border: 0; border-radius: 0; border-top: 1px solid var(--line); height: 40vh; max-height: 40vh; padding: 10px 18px; }
.console.closed pre.log { display: none; }
.stream { height: 360px; overflow: auto; font: 12px/1.55 var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 0; }
.stream div { padding: 0 12px; white-space: nowrap; }
.stream div:hover { background: var(--surface-3); }
.stream .ev { color: var(--accent); } .stream .bad { color: var(--crit-ink); } .stream .seq { color: var(--text-3); margin-right: 8px; }

/* ---------- overlays ---------- */
dialog { border: 1px solid var(--line-2); border-radius: 14px; padding: 0; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3); width: min(480px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10,10,10,.45); }
dialog .d-body { padding: 20px 22px 8px; } dialog .d-body h2 { font-size: 17px; margin-bottom: 6px; }
dialog .d-body p { color: var(--text-2); margin: 0; white-space: pre-wrap; }
dialog .d-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 18px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: -10px 0 40px rgba(0,0,0,.15); z-index: 12; transform: translateX(100%); transition: transform .2s ease; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer .dr-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer .dr-head h2 { font-size: 16px; margin-right: auto; }
.drawer .dr-body { padding: 16px 18px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.scrim { position: fixed; inset: 0; background: rgba(10,10,10,.3); z-index: 11; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.fault-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.fault-opt .fo-text { flex: 1; } .fault-opt .fo-text b { display: block; font-size: 13.5px; } .fault-opt .fo-text span { font-size: 12px; color: var(--text-3); }
.fault-opt input[type=number] { width: 84px; }
.toasts { position: fixed; right: 16px; top: 64px; z-index: 30; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; font-size: 13px; animation: tin .18s ease; }
.toast svg { margin-top: 1px; } .toast .msg { flex: 1; white-space: pre-wrap; word-break: break-word; }
.toast.err { border-left: 4px solid var(--crit); } .toast.err svg { color: var(--crit-ink); }
.toast.ok { border-left: 4px solid var(--good); } .toast.ok svg { color: var(--good-ink); }
.toast.info { border-left: 4px solid var(--accent); } .toast.info svg { color: var(--accent); }
@keyframes tin { from { transform: translateY(-6px); opacity: 0; } }
.popover { position: absolute; z-index: 20; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); padding: 14px; width: min(340px, calc(100vw - 24px)); }
.kbd-help { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13px; }
kbd.k { font: 12px var(--mono); padding: 1px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 380px; }
.login .card { padding: 26px; box-shadow: var(--shadow); }
.login .brand { padding: 0 0 18px; }

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; transform: translateX(-100%); transition: transform .2s; box-shadow: 10px 0 40px rgba(0,0,0,.2); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .console { left: 0; }
  .topbar { padding: 8px 14px; }
  .content { padding: 16px 16px calc(var(--console-h) + 24px); }
  .hero { grid-template-columns: 1fr; padding: 18px; }
  .hero .actions { justify-content: flex-start; }
  .topbar .pill .lbl { display: none; }
  .nav kbd { display: none; }
}
@media (max-width: 560px) {
  .tiles, .tiles.t8, .tiles.t6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .console .c-head .c-title { max-width: 46vw; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (forced-colors: active) { .pill .dot, .led::before, .trend i { forced-color-adjust: none; } }
