/* Numenor console - design tokens + components. No framework, no build step.
   Visual language adapted from the "SquareUp" dark agency template (Figma community, Produce UI):
   near-black surfaces, hairline #262626 cells, lime accent, Barlow. Values are approximations read
   from rendered frames (the canvas could not be inspected numerically). */
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800; font-style: normal; font-display: swap; }

:root {
  /* surfaces (reference: #141414 page, #1A1A1A sections, #262626 hairlines / chips) */
  --bg: #141414;
  --surface: #1a1a1a;
  --surface-2: #1f1f1f;
  --surface-3: #262626;
  --border: #262626;
  --border-strong: #333333;
  /* text (reference: white headings, grey body) */
  --text: #ffffff;
  --text-2: #b3b3b3;
  --text-3: #8c8c8c;
  /* accent: reference lime - branding, primary actions, focus, selected navigation */
  --accent: #caff33;
  --accent-hover: #d6ff66;
  --accent-soft: rgba(202, 255, 51, .1);
  --accent-line: rgba(202, 255, 51, .35);
  --accent-ink: #141414;
  /* semantic - deliberately NOT the accent: red = confirmed incident, amber = uncertain/degraded,
     mint = healthy (a different hue from lime, and always paired with an icon + word) */
  --danger: #ff4d4f;
  --danger-soft: rgba(255, 77, 79, .13);
  --danger-ink: #fff;
  --warn: #ffb020;
  --warn-soft: rgba(255, 176, 32, .12);
  --ok: #5fd4a8;
  --ok-soft: rgba(95, 212, 168, .1);
  --info: #7aa7ff;

  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r-sm: 6px; --r: 8px; --r-lg: 12px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  --shadow: 0 12px 32px rgba(0,0,0,.45);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
  --side: 236px; --side-collapsed: 68px; --head: 60px;
  --ease: cubic-bezier(.2,.7,.2,1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
.mono { font-family: var(--mono); font-feature-settings: normal; }
.muted { color: var(--text-2); } .faint { color: var(--text-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: 0; }
h1 { font-size: 20px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 15px; height: 15px; } .icon.lg { width: 22px; height: 22px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); height: 36px; padding: 0 16px;
  border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font: 500 14px/1 var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.danger-outline { background: var(--danger-soft); border-color: rgba(255,77,79,.45); color: #ffb3b4; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.icon-only { width: 34px; padding: 0; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 13px; } .btn.sm.icon-only { width: 28px; }
.btn[aria-pressed="true"] { background: var(--surface-3); border-color: var(--accent-line); color: var(--accent); }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.input, select.input, textarea.input { width: 100%; height: 38px; padding: 0 12px; border-radius: var(--r);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: 15px var(--font);
  transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.45; resize: vertical; }
.input:hover { border-color: var(--border-strong); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input.sm { height: 30px; font-size: 13px; padding: 0 10px; }
select.input { appearance: none; padding-right: 30px; background-image:
  linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 20px; background: var(--surface-3); border: 1px solid var(--border-strong);
  transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-2); transition: transform .15s, background .15s; }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); background: var(--accent-ink); }
.switch input:focus-visible + span { box-shadow: var(--focus); }

/* ---------------------------------------------------------------- status language (icon + text, never colour alone) */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 500; border: 1px solid var(--border); color: var(--text-2); background: var(--surface-2);
  white-space: nowrap; }
.pill .icon { width: 13px; height: 13px; }
.pill.ok { color: var(--ok); border-color: rgba(95,212,168,.35); background: var(--ok-soft); }
.pill.warn { color: var(--warn); border-color: rgba(255,176,32,.4); background: var(--warn-soft); }
.pill.danger { color: #ff8f90; border-color: rgba(255,77,79,.45); background: var(--danger-soft); }
.pill.accent { color: var(--accent-hover); border-color: var(--accent-line); background: var(--accent-soft); }
.pill.solid-danger { background: var(--danger); color: #fff; border-color: var(--danger); font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

/* ---------------------------------------------------------------- app shell */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; transition: grid-template-columns .2s var(--ease); }
.shell.collapsed { grid-template-columns: var(--side-collapsed) 1fr; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--surface);
  border-right: 1px solid var(--border); overflow: hidden; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; height: var(--head); padding: 0 18px; border-bottom: 1px solid var(--border); }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-weight: 600; font-size: 17px; letter-spacing: .01em; }
.brand-sub { font-size: 11px; color: var(--text-3); letter-spacing: .06em; text-transform: uppercase; margin-top: 1px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: var(--s3) 10px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px; border-radius: var(--r);
  color: var(--text-2); font-weight: 500; position: relative; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--surface-3); color: var(--text); }
.nav a[aria-current="page"] .icon { color: var(--accent); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent); }
.nav .badge-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger);
  color: #fff; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.side-foot { padding: 10px; border-top: 1px solid var(--border); }
.collapsed .brand { padding: 0; justify-content: center; }
.collapsed .brand-text, .collapsed .nav .label-text, .collapsed .side-foot .label-text { display: none; }
.collapsed .nav a { justify-content: center; padding: 0; }
.collapsed .nav .badge-count { position: absolute; top: 3px; right: 6px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
.side-foot .btn { width: 100%; justify-content: flex-start; }
.collapsed .side-foot .btn { justify-content: center; }

.main { display: flex; flex-direction: column; min-width: 0; }
.head { position: sticky; top: 0; z-index: 15; height: var(--head); display: flex; align-items: center; gap: var(--s4);
  padding: 0 var(--s6); background: rgba(20,20,20,.96); border-bottom: 1px solid var(--border); }
.head h1 { white-space: nowrap; }
.head .spacer { flex: 1; }
.head .clock { font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.head .menu-btn { display: none; }
.status-sum { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: var(--r);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-size: 13px; cursor: pointer; }
.status-sum:hover { border-color: #414951; color: var(--text); }
.status-sum.ok { color: var(--ok); } .status-sum.warn { color: var(--warn); border-color: rgba(255,176,32,.4); }
.status-sum.danger { color: #ff8f90; border-color: rgba(255,77,79,.5); }
.content { padding: var(--s6); flex: 1; min-width: 0; }

.acct { position: relative; }
.acct-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 4px; border-radius: var(--r);
  background: transparent; border: 1px solid transparent; color: var(--text); cursor: pointer; font: 500 13px var(--font); }
.acct-btn:hover { background: var(--surface-2); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border-strong);
  display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; padding: 6px; background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--shadow); z-index: 40; }
.menu[hidden] { display: none; }
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0;
  border-radius: var(--r-sm); background: transparent; color: var(--text); font: 13px var(--font); cursor: pointer; text-align: left; }
.menu button:hover, .menu a:hover { background: var(--surface-3); }

/* ---------------------------------------------------------------- generic panels */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.panel-h { display: flex; align-items: center; gap: var(--s3); padding: 14px 18px; border-bottom: 1px solid var(--border); }
.panel-h .spacer { flex: 1; }
.panel-b { padding: 16px; }
.toolbar { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; padding: 2px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border-strong); }
.seg button { height: 28px; min-width: 32px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 6px; background: transparent; color: var(--text-2); cursor: pointer; font: 500 12px var(--font); }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--accent); }
.seg button:hover { color: var(--text); }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  padding: 48px 24px; color: var(--text-2); }
.empty .icon { width: 28px; height: 28px; color: var(--text-3); }
.empty b { color: var(--text); font-weight: 600; }
.banner { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: var(--r-lg); border: 1px solid;
  margin-bottom: var(--s4); }
.banner .icon { margin-top: 1px; }
.banner.warn { background: var(--warn-soft); border-color: rgba(255,176,32,.4); color: #ffd384; }
.banner.danger { background: var(--danger-soft); border-color: rgba(255,77,79,.5); color: #ffb3b4; }
.banner.info { background: var(--surface); border-color: var(--border-strong); color: var(--text-2); }
.banner b { color: var(--text); font-weight: 600; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- live: camera grid */
/* ---------------------------------------------------------------- live: camera grid & desktop activity sidebar */
.live { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); align-items: start; }
/* desktop layout: allocate a dedicated, comfortable width (340px / 380px) and clean scroll behavior */
@media (min-width: 1200px) {
  .live:not(.no-panel) { grid-template-columns: minmax(0, 1fr) 340px; }
  .live:not(.no-panel) .side-panel {
    position: sticky; top: calc(var(--head) + 20px);
    display: flex; flex-direction: column; gap: var(--s3);
    max-height: calc(100vh - var(--head) - 36px);
    overflow-y: auto; overflow-x: hidden;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--surface-3) transparent;
  }
  .live:not(.no-panel) .side-panel::-webkit-scrollbar { width: 5px; }
  .live:not(.no-panel) .side-panel::-webkit-scrollbar-track { background: transparent; }
  .live:not(.no-panel) .side-panel::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }
  .live:not(.no-panel) .side-panel::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

  .live:not(.no-panel) .side-panel > .live-card {
    display: flex; flex-direction: column;
    flex: 0 0 auto;
    overflow: hidden;
  }
}
@media (min-width: 1680px) {
  .live:not(.no-panel) { grid-template-columns: minmax(0, 1fr) 380px; }
}

.grid { display: grid; gap: var(--s4); grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
.cam { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; display: flex;
  flex-direction: column; min-width: 0; container: cam / inline-size; }
.cam.alarm { border-color: rgba(255,77,79,.8); box-shadow: 0 0 0 1px rgba(255,77,79,.45); }
.cam-h { display: flex; align-items: center; gap: 10px; padding: 9px 12px; min-height: 44px; border-bottom: 1px solid var(--border); }
.cam-h .name { font-weight: 600; font-size: 14px; }
.cam-h .spacer { flex: 1; }
.cam-h .pills { display: flex; gap: 6px; flex-wrap: wrap; }
.stage { position: relative; aspect-ratio: 16 / 9; background: #07090a; }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #07090a; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stage .veil { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: var(--text-2); font-size: 13px; background: rgba(7,9,10,.72); text-align: center; padding: 16px; }
.stage .veil .icon { width: 26px; height: 26px; }
.stage .veil[hidden] { display: none; }
.stage .alarm-tag { position: absolute; left: 10px; top: 10px; display: none; z-index: 3; }
.cam.alarm .alarm-tag { display: inline-flex; }
.stage .tools { position: absolute; right: 8px; top: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.stage:hover .tools, .stage:focus-within .tools, .cam.focus .tools { opacity: 1; }
.stage .tools .btn { background: rgba(21,24,27,.85); border-color: rgba(255,255,255,.08); }
.cam-f { display: flex; align-items: center; gap: 12px; padding: 8px 12px; font-size: 12px; color: var(--text-2); flex-wrap: wrap;
  border-top: 1px solid var(--border); min-height: 42px; }
.cam-f .spacer { flex: 1; }
@container cam (max-width: 360px) { .cam-f .pill .txt { display: none; } }
.cam-f b { color: var(--text); font-weight: 600; }
.focus-view { position: fixed; inset: 0; z-index: 60; background: rgba(8,9,10,.96); display: flex; flex-direction: column; padding: 16px; gap: 12px; }
.focus-view .cam { flex: 1; min-height: 0; }
.focus-view .stage { flex: 1; aspect-ratio: auto; }

/* sidebar cards */
.side-panel { display: flex; flex-direction: column; gap: var(--s4); align-items: stretch; }
.side-panel[hidden] { display: none; }
.live-card {
  transition: border-color .15s ease, box-shadow .15s ease;
}
.live-card:hover {
  border-color: var(--border-strong);
}
.live-card .panel-h {
  padding: 10px 14px;
  background: rgba(255,255,255,.015);
  user-select: none;
}
.live-card-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.live-card-title .icon {
  color: var(--accent);
  opacity: .9;
}
.live-card-title h2 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
}
.live-card-toggle {
  transition: transform .2s var(--ease);
  color: var(--text-3);
}
.live-card-toggle:hover {
  color: var(--text);
}
.live-card.is-collapsed .live-card-toggle {
  transform: rotate(-90deg);
}
.live-card.is-collapsed .live-card-body {
  display: none !important;
}
.live-card-body {
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}
.live-card-body::-webkit-scrollbar { width: 4px; }
.live-card-body::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }

.faint-pill {
  font-size: 10.5px !important;
  height: 20px !important;
  padding: 0 6px !important;
  color: var(--text-3) !important;
  border-color: var(--border) !important;
  background: var(--surface-2) !important;
}

.inc-mini { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 9px 12px;
  border-top: 1px solid var(--border); color: var(--text); text-decoration: none; transition: background .12s ease; }
.inc-mini:first-child { border-top: 0; }
.inc-mini:hover { background: var(--surface-2); color: var(--text); }
.thumb { width: 56px; height: 36px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-3); display: block; border: 1px solid var(--border); }
.thumb.none { display: grid; place-items: center; color: var(--text-3); }
.inc-mini .t1 { font-weight: 500; font-size: 12.5px; line-height: 1.35; color: var(--text); }
.inc-mini .t2 { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.now-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border); font-size: 12.5px; transition: background .12s ease; }
.now-row:first-child { border-top: 0; }
.now-row:hover { background: var(--surface-2); }
.now-row .icon { color: var(--text-3); flex: none; }
.now-row.active .icon { color: var(--danger); }
.meter { flex: 0 0 60px; height: 4px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--warn); }
.now-row.active .meter i { background: var(--danger); }

/* ---------------------------------------------------------------- incidents */
.filters { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-end; margin-bottom: var(--s4); }
.filters .field { min-width: 140px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--border);
  white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr:focus-visible { outline: none; box-shadow: inset 3px 0 0 var(--accent); }
.table tbody tr[aria-selected="true"] td { background: var(--surface-3); }
.pager { display: flex; align-items: center; gap: var(--s3); padding: 12px 14px; color: var(--text-2); font-size: 13px; }
.pager .spacer { flex: 1; }
.cards { display: none; }
.drawer-back { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); z-index: 51; background: var(--surface);
  border-left: 1px solid var(--border-strong); display: flex; flex-direction: column; box-shadow: -12px 0 32px rgba(0,0,0,.35);
  animation: slide .18s var(--ease); }
@keyframes slide { from { transform: translateX(24px); opacity: .6; } }
.drawer-h { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.drawer-b { padding: 18px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 18px; }
.drawer-f { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.snapshot { width: 100%; border-radius: var(--r); border: 1px solid var(--border); background: #07090a; aspect-ratio: 16/9; object-fit: contain; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13px; margin: 0; }
.kv dt { color: var(--text-3); } .kv dd { margin: 0; color: var(--text); }
.note { font-size: 12px; color: var(--text-3); line-height: 1.45; }

/* ---------------------------------------------------------------- system */
.sys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s4); }
.sys-card .panel-h .icon { color: var(--text-2); }
.metric-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.metric-row:last-child { border-bottom: 0; }
.metric-row span:first-child { color: var(--text-3); }
.metric-row span:last-child { font-family: var(--mono); font-size: 12.5px; text-align: right; }
.effect { font-size: 13px; color: var(--text-2); margin: 0 0 10px; }

/* ---------------------------------------------------------------- settings */
.set-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s6); align-items: start; }
.set-nav { position: sticky; top: calc(var(--head) + 24px); display: flex; flex-direction: column; gap: 2px; }
.set-nav a { padding: 8px 12px; border-radius: var(--r); color: var(--text-2); font-weight: 500; font-size: 13px; }
.set-nav a:hover { background: var(--surface-2); color: var(--text); }
.set-nav a[aria-current="true"] { background: var(--surface-2); color: var(--text); }
.set-group { margin-bottom: var(--s6); scroll-margin-top: calc(var(--head) + 16px); }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--s5); padding: 14px 16px; border-top: 1px solid var(--border); }
.set-row:first-child { border-top: 0; }
.set-row .lbl { font-weight: 500; }
.set-row .help { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.set-row .ctl { display: flex; flex-direction: column; gap: 6px; align-items: stretch; justify-content: center; }
.set-row.changed { box-shadow: inset 3px 0 0 var(--accent); background: rgba(202,255,51,.035); }
.set-row .err { color: #ff8f90; font-size: 12px; }
.set-row.wide { grid-template-columns: 1fr; }
.savebar { position: sticky; bottom: 0; z-index: 12; display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-top: var(--s4);
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.savebar[hidden] { display: none; }

/* ---------------------------------------------------------------- dialogs & toasts */
dialog.modal { border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: var(--surface); color: var(--text);
  padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog.modal::backdrop { background: rgba(0,0,0,.6); }
.modal-b { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.toasts { position: fixed; right: 20px; top: calc(var(--head) + 12px); z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; gap: 10px; align-items: flex-start; min-width: 260px; max-width: 380px; padding: 12px 14px; border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 13px; }
.toast.ok .icon { color: var(--ok); } .toast.err .icon { color: var(--danger); } .toast.warn .icon { color: var(--warn); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .set-layout { grid-template-columns: 1fr; }
  .set-nav { position: static; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; margin: 0 -4px; padding: 0 4px 6px; }
  .set-nav a { white-space: nowrap; flex: none; }
}
@media (max-width: 900px) {
  .shell, .shell.collapsed { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .2s var(--ease);
    box-shadow: var(--shadow); }
  .shell.nav-open .side { transform: none; }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 19; }
  .collapsed .brand-text, .collapsed .nav .label-text, .collapsed .side-foot .label-text { display: revert; }
  .collapsed .nav a { justify-content: flex-start; padding: 0 12px; }
  .side .collapse-btn { display: none; }
  .head .menu-btn { display: inline-flex; }
  .head { padding: 0 var(--s4); gap: var(--s3); }
  .content { padding: var(--s4); }
  .grid { grid-template-columns: 1fr !important; }
  .side-panel { grid-template-columns: 1fr; }
  .set-row { grid-template-columns: 1fr; }
}
.filter-toggle { display: none; }
@media (max-width: 640px) {
  .filter-toggle { display: inline-flex; margin-bottom: 12px; }
  .filters:not(.open) { display: none; }
  .live .seg[aria-label="Layout"] { display: none; }
  .head .clock, .head .status-label { display: none; }
  .table-wrap { display: none; }
  .cards { display: flex; flex-direction: column; }
  .kv { grid-template-columns: 120px 1fr; }
  .filters .field { min-width: calc(50% - 6px); flex: 1; }
  .acct-btn .uname { display: none; }
}

/* ---------------------------------------------------------------- Assistant */
.asst { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--s4); height: calc(100dvh - var(--head) - 48px); min-height: 480px; }
.asst-hist { display: flex; flex-direction: column; min-height: 0; }
.asst-hist .panel-h h2 { font-size: 15px; margin: 0; }
.asst-list { list-style: none; margin: 0; padding: 6px; overflow: auto; flex: 1; }
.asst-list li { display: flex; align-items: center; gap: 2px; }
.asst-conv { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px;
  border-radius: var(--r); border: 1px solid transparent; background: none; color: var(--text-2); text-align: left; cursor: pointer; font: inherit; }
.asst-conv:hover { background: var(--surface-2); color: var(--text); }
.asst-conv.on { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
.asst-conv-t { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.asst-private { display: flex; gap: 6px; align-items: flex-start; margin: 0; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12px; }
.asst-main { display: flex; flex-direction: column; min-height: 0; }
.asst-top { flex-wrap: wrap; }
.asst-hist-toggle { display: none; }
.asst-thread { flex: 1; overflow: auto; padding: var(--s5); display: flex; flex-direction: column; gap: var(--s4); scroll-padding: 16px; }
.asst-q { align-self: flex-end; max-width: min(640px, 85%); background: var(--surface-3); border: 1px solid var(--border-strong);
  border-radius: var(--r-lg) var(--r-lg) var(--r-sm) var(--r-lg); padding: 10px 14px; }
.asst-q p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.asst-a { align-self: stretch; max-width: 920px; background: var(--bg); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.asst-a.scope, .asst-a.help { border-left-color: var(--text-3); }
.asst-a.clarify { border-left-color: var(--info); }
.asst-a.asst-err { border-left-color: var(--warn); }
.asst-a.withheld { border-left-color: var(--text-3); opacity: .85; }
.asst-a-h { display: flex; gap: 8px; align-items: flex-start; }
.asst-a-h h3 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.asst-a-h .icon { margin-top: 3px; flex: none; color: var(--text-2); }
.asst-note { margin: 0; color: var(--text-2); font-size: 14px; }
.asst-control { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 8px; }
.asst-control-items { margin: 0; padding-left: 18px; font-weight: 600; }
.asst-control-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.asst-control-status { font-size: 13px; }
.asst-reply { margin: 0; font-size: 16px; line-height: 1.5; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.asst-a-h h4, .asst-sub { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-2); }
.asst-sub { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); color: var(--text); }
.asst-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; margin: 0; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.asst-metrics > div { background: var(--surface); padding: 10px 12px; }
.asst-metrics dt { font-size: 12px; color: var(--text-3); }
.asst-metrics dd { margin: 2px 0 0; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.asst-table { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); }
.asst-table .table { font-size: 13px; }
.asst-table tr.link { cursor: pointer; }
.asst-table tr.link:focus-visible { outline: none; box-shadow: inset var(--focus); }
.asst-bars { display: flex; flex-direction: column; gap: 6px; }
.asst-bar { display: grid; grid-template-columns: minmax(70px, 150px) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.asst-bar-l { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asst-bar-t { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.asst-bar-f { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.asst-bar-v { font-variant-numeric: tabular-nums; color: var(--text); min-width: 64px; text-align: right; }
.asst-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.asst-chips .pill { height: auto; min-height: 24px; white-space: normal; }
.asst-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12px; }
.asst-how { border-top: 1px solid var(--border); padding-top: 10px; font-size: 13px; color: var(--text-2); }
.asst-how summary { cursor: pointer; color: var(--text); font-weight: 500; display: flex; align-items: center; }
.asst-how summary:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
.asst-how ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.asst-lim li { color: #ffd384; }
.asst-ids { margin: 0; font-size: 13px; }
.asst-progress { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 14px; }
.asst-progress .spin { width: 14px; height: 14px; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite; }
.asst-empty { margin: auto; max-width: 640px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 0; }
.asst-empty-h { display: flex; align-items: center; gap: 10px; }
.asst-empty-h .icon { width: 26px; height: 26px; color: var(--accent); }
.asst-empty h2 { margin: 0; font-size: 20px; }
.asst-empty p { margin: 0; }
.asst-sugg { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; margin: 0; padding: 0; }
.asst-chip { font: inherit; font-size: 13px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: 999px; padding: 7px 14px; cursor: pointer; text-align: left; }
.asst-chip:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.asst-chip:focus-visible, .asst-conv:focus-visible { outline: none; box-shadow: var(--focus); }
.asst-chip:disabled { opacity: .5; cursor: default; }
.asst-compose { border-top: 1px solid var(--border); padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.asst-compose textarea.input { height: auto; min-height: 42px; max-height: 160px; padding: 10px 12px; resize: none; line-height: 1.4; }
.asst-compose-row { display: flex; align-items: center; gap: 8px; }
.asst-people { list-style: none; margin: 12px 0; padding: 0; max-height: 280px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r); }
.asst-people li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.asst-people li:last-child { border-bottom: 0; }
.asst-people li.inactive > span:first-child { color: var(--text-3); text-decoration: line-through; }
.assign-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 900px) {
  .asst { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - var(--head) - 32px); }
  .asst-hist { display: none; }
  .asst.hist-open .asst-hist { display: flex; position: fixed; inset: var(--head) 0 0 0; z-index: 40; border-radius: 0; }
  .asst-hist-toggle { display: inline-flex; }
  .asst-thread { padding: var(--s3); }
  .asst-top { flex-wrap: nowrap; padding: 8px 10px; gap: 6px; }
  .asst-top .lbl { display: none; }
  .asst-top .btn.sm { padding: 0 8px; }
  #interp { min-width: 0; overflow: hidden; }
  #interp .pill { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: inline-block; line-height: 22px; }
  .asst-q { max-width: 92%; }
  .asst-bar { grid-template-columns: minmax(60px, 90px) 1fr auto; }
}

/* small inline links: keep a comfortable touch target without changing the text layout */
.link-tap { display: inline-block; padding: 6px 4px; margin: -6px -4px; min-height: 28px; line-height: 16px; }

/* the 3D view leaves room to scroll on phones (the canvas takes wheel/touch for orbit + zoom) */
@media (max-width: 720px) { #v3d { height: min(520px, 58vh) !important; } }

/* Incidents: three categories (phone usage | sleep detection | danger zone) */
.inc-tabs { display: flex; gap: 4px; margin-bottom: var(--s4); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: thin; }
.inc-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: -1px; flex: none; white-space: nowrap;
  color: var(--text-2); font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; }
.inc-tabs a:hover { color: var(--text); }
.inc-tabs a[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.inc-tabs .count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--text-2);
  font-size: 12px; font-weight: 600; text-align: center; }
.inc-tabs a[aria-selected="true"] .count { background: var(--accent); color: var(--accent-ink); }
.inc-tabs .count:empty { display: none; }

/* Draw danger zones on a camera picture (ui/static/js/zone_editor.js) */
.zed { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: flex; flex-direction: column; outline: none; }
.zed-h { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.zed-h h2 { font-size: 16px; margin: 0; }
.zed-cam { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.zed-b { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.zed-stage { min-width: 0; overflow: auto; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.zed-wrap { position: relative; width: 100%; max-width: min(100%, calc((100vh - 130px) * 16 / 9)); user-select: none; }
.zed-wrap img { display: block; width: 100%; height: auto; border-radius: 8px; pointer-events: none; }
.zed-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.zed-cap { font-size: 12px; }
.zed-msg { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 60px 20px; text-align: center; }
.zed-side { border-left: 1px solid var(--border); background: var(--surface); overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.zed-side h3 { margin: 6px 0 0; font-size: 15px; }
.zed-help { font-size: 12px; margin: 0; }
.zed-live { font-size: 13px; display: flex; gap: 6px; align-items: center; }
.zed-zone { padding: 10px; display: grid; gap: 6px; cursor: pointer; }
.zed-zone.sel { outline: 1px solid #ff4d4f; }
.zed-zh { display: flex; gap: 6px; align-items: center; }
.zed-zh .input { flex: 1; min-width: 0; }
.zed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.zed-grid label { font-size: 12px; display: grid; gap: 2px; }
.zed-err { color: #ffb020; font-size: 12px; display: flex; gap: 4px; align-items: center; }
.zed-foot { display: flex; gap: 8px; justify-content: flex-end; position: sticky; bottom: -14px; background: var(--surface); padding: 10px 0 2px; }
@media (max-width: 900px) { .zed-b { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 55%) minmax(0, 45%); } .zed-side { border-left: 0; border-top: 1px solid var(--border); } }
@media (max-width: 900px) {
  .zed-h { padding: 8px 12px; gap: 8px; }
  .zed-h h2 { display: none; }
  .zed-wrap { max-width: min(100%, calc((50vh - 30px) * 16 / 9)); }
  .zed-b { grid-template-rows: minmax(0, 50%) minmax(0, 50%); }
}

/* Digital twin page: one centred block, 3D view + a three-tab side panel */
.twin-page { max-width: 1500px; margin-inline: auto; }
.twin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: var(--s4); align-items: start; }
.twin-main, .twin-side { min-width: 0; overflow: hidden; }
.twin-h { flex-wrap: wrap; gap: 8px; }
.twin-edbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--border); }
.twin-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; padding: 8px 12px; min-height: 36px; }
.twin-3d { height: clamp(420px, 68vh, 780px); position: relative; background: #14171a; }
.twin-side { position: sticky; top: calc(var(--head) + 16px); }
.twin-side-b { max-height: calc(clamp(420px, 68vh, 780px) + 60px); overflow: auto; display: grid; gap: 14px; align-content: start; }
.tw-sec h3 { margin: 0 0 8px; font-size: 14px; letter-spacing: .01em; }
.tw-card { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); padding: 10px 12px; margin-bottom: 8px; display: grid; gap: 4px; }
.tw-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0; }
.tw-sec > .tw-row { border-bottom: 1px solid var(--border); }
.tw-sec > .tw-row:last-child { border-bottom: 0; }
.tw-r { margin-left: auto; font-size: 12px; }
.tw-inside { font-size: 13px; padding: 6px 8px; border-radius: var(--r-sm); background: var(--surface); }
.tw-inside.hot { background: var(--danger-soft); color: #ffb3b4; }
@media (max-width: 1100px) { .twin-grid { grid-template-columns: minmax(0, 1fr); } .twin-side { position: static; } .twin-side-b { max-height: none; } .twin-3d { height: clamp(320px, 56vh, 560px); } }

/* Zones & Shifts Panels */
.stat-card {
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.stat-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.zone-card {
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  position: relative;
}
.zone-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
}

.badge-purple { color: #eb2f96; border-color: rgba(235,47,150,0.3); background: rgba(235,47,150,0.08); }
.badge-info { color: #1890ff; border-color: rgba(24,144,255,0.3); background: rgba(24,144,255,0.08); }
.badge-success { color: #52c41a; border-color: rgba(82,196,26,0.3); background: rgba(82,196,26,0.08); }
.badge-danger { color: #ff4d4f; border-color: rgba(255,77,79,0.3); background: rgba(255,77,79,0.08); }

.hero-card {
  border: 1px solid var(--border-strong);
  transition: box-shadow .2s ease;
}
.hero-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

#shift-modal-back {
  display: grid;
  place-items: center;
  z-index: 1000;
  backdrop-filter: blur(6px);
  animation: fadeIn .15s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.timeline-bar div {
  transition: opacity .15s ease, transform .1s ease;
}
.timeline-bar div:hover {
  opacity: .9;
  filter: brightness(1.15);
}

.timeline-container {
  user-select: none;
}



/* ---------------------------------------------------------------- workspaces (per-desk occupancy) */
.ws { display: flex; flex-direction: column; gap: var(--s5); }
.ws-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.ws-field { display: inline-flex; align-items: center; gap: var(--s2); font-size: 13px; color: var(--text-2); }
.ws-field[hidden] { display: none; }
.ws-rule { font-size: 12px; }
.ws-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s5); align-items: start; }
.ws-main > * { min-width: 0; }
@media (max-width: 1100px) { .ws-main { grid-template-columns: minmax(0, 1fr); } }
.ws-cam .stage canvas { pointer-events: none; }
.ws-legend { display: inline-flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--text-2); }
.ws-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.ws-side, .ws-tl-wrap { padding: var(--s4); }
.ws-side-h { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s2); }
.ws-side-h h2 { font-size: 16px; margin: 0; }
.ws-side-h > .faint { font-size: 12px; }
.ws-side-h select.ws-sort { margin-left: auto; width: auto; flex: 0 0 auto; }
.ws-shift { font-size: 12px; margin-bottom: var(--s3); }
.ws-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: var(--s6) var(--s3); text-align: center; }
.ws-none { padding: var(--s4) 0; font-size: 13px; text-align: center; }

/* side panel: state chips (also filters) + desk cards */
.ws-sum { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: var(--s3); }
.ws-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer; }
.ws-chip i { width: 8px; height: 8px; border-radius: 50%; }
.ws-chip b { color: var(--text); font-variant-numeric: tabular-nums; }
.ws-chip:hover:not(:disabled) { border-color: var(--text-3); }
.ws-chip[aria-pressed="true"] { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
.ws-chip:disabled { opacity: .45; cursor: default; }
.ws-chip:focus-visible, .ws-card:focus-visible, .ws-tl-name:focus-visible { outline: none; box-shadow: var(--focus); }
.ws-avg { margin-left: auto; font-size: 12px; color: var(--text-3); }
.ws-avg b { color: var(--text); font-variant-numeric: tabular-nums; }
.ws-list { display: flex; flex-direction: column; gap: 8px; max-height: min(62vh, 640px); overflow-y: auto; padding-right: 2px; }
.ws-card { display: flex; flex-direction: column; gap: 7px; width: 100%; text-align: left; font: inherit; color: var(--text);
  padding: 10px 12px 10px 14px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2);
  box-shadow: inset 3px 0 0 var(--st); cursor: pointer; transition: border-color .12s, background .12s; }
.ws-card:hover, .ws-card.hl { background: var(--surface-3); }
.ws-card.sel { border-color: var(--accent-line); background: var(--surface-3); }
.ws-card-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ws-card-n { font-weight: 600; font-size: 14px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-pill { font-size: 12px; font-weight: 600; }
.ws-card-h .faint { font-size: 11px; white-space: nowrap; }
.ws-split { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--surface); gap: 1px; }
.ws-split i { display: block; min-width: 2px; }
.ws-split i.none { flex: 1; background: var(--surface); }
.ws-card-f { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--text-3); align-items: baseline; }
.ws-card-f b { color: var(--text-2); font-weight: 500; }
.ws-use { margin-left: auto; font-size: 15px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

/* timeline: names fixed on the left, tracks zoom + scroll horizontally */
.ws-zoom { margin-left: auto; min-width: 48px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); font-size: 12px; color: var(--text-2); text-align: center; }
.ws-tl2 { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: var(--s3); }
.ws-tl-names { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ws-tl-axisgap { height: 18px; }
.ws-tl-name { height: 20px; padding: 0 6px; margin: 0; border: 0; border-radius: 4px; background: none; color: var(--text-2); font: inherit;
  font-size: 13px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.ws-tl-name:hover, .ws-tl-name.hl { color: var(--text); background: var(--surface-2); }
.ws-tl-name.sel { color: var(--accent); background: var(--accent-soft); }
.ws-tl-scroll { position: relative; overflow-x: auto; overflow-y: hidden; padding-bottom: 6px; border-radius: 4px; scrollbar-width: thin; }
.ws-tl-inner { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 100%; }
.ws-tl-axis { position: relative; height: 18px; }
.ws-tick { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; color: var(--text-3); font-family: var(--mono); white-space: nowrap; }
.ws-tick:first-child { transform: none; }
.ws-grid { position: absolute; inset: 18px 0 0 0; pointer-events: none; }
.ws-grid i { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.05); }
.ws-track { position: relative; height: 20px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.ws-track.hl { box-shadow: inset 0 0 0 1px var(--border-strong); }
.ws-track.sel { box-shadow: inset 0 0 0 1px var(--accent-line); }
.ws-seg { position: absolute; top: 2px; bottom: 2px; min-width: 1px; border-radius: 2px; }
.ws-brk { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, rgba(255,255,255,.06) 0 4px, transparent 4px 8px); }
.ws-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 1; }
@media (max-width: 640px) { .ws-tl2 { grid-template-columns: 92px minmax(0, 1fr); } .ws-list { max-height: none; } }
