/* ATC Enterprise UI — production design system
   Tokens follow uploads/design/06_visual_language.md verbatim. */

:root {
  /* light theme */
  --bg: #FFFFFF;
  --surface: #FAFAFA;
  --surface-2: #F3F4F6;
  --surface-3: #ECEEF1;
  --border: #E5E7EB;
  --border-strong: #D1D5DB;
  --text: #0B0C0F;
  --text-2: #4B5563;
  --text-3: #6B7280;
  --accent: #0B0C0F;
  --accent-fg: #FFFFFF;
  --link: #1D4ED8;

  --pass: #0F7B3E;
  --pass-bg: #E6F4EC;
  --fail: #B42318;
  --fail-bg: #FCEBEA;
  --warn: #B54708;
  --warn-bg: #FBF1DD;
  --info: #1D4ED8;
  --info-bg: #E5EDFD;
  --running: #0E7490;
  --running-bg: #DFF3F7;
  --muted: #6B7280;
  --muted-bg: #EEEFF2;

  --mast-sys: #7C3AED;
  --mast-ia: #0891B2;
  --mast-tv: #CA8A04;
  --mast-pii: #BE185D;
  --mast-unsafe: #DC2626;
  --mast-fab: #EA580C;
  --mast-casc: #A16207;

  /* shadows */
  --shadow-1: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-2: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-3: 0 12px 32px rgba(0,0,0,0.12);

  /* dims */
  --sidebar-w: 220px;
  --sidebar-collapsed-w: 56px;
  --topbar-h: 44px;
  --breadcrumb-h: 40px;

  /* density */
  --row-h: 32px;
  --card-pad: 16px;

  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #0B0C0F;
  --surface: #111317;
  --surface-2: #171A1F;
  --surface-3: #1C2026;
  --border: #1F2329;
  --border-strong: #2A2F36;
  --text: #F3F4F6;
  --text-2: #9CA3AF;
  --text-3: #6B7280;
  --accent: #F3F4F6;
  --accent-fg: #0B0C0F;
  --link: #60A5FA;

  --pass: #34D399;
  --pass-bg: rgba(52,211,153,0.10);
  --fail: #F87171;
  --fail-bg: rgba(248,113,113,0.10);
  --warn: #FBBF24;
  --warn-bg: rgba(251,191,36,0.10);
  --info: #60A5FA;
  --info-bg: rgba(96,165,250,0.10);
  --running: #22D3EE;
  --running-bg: rgba(34,211,238,0.10);
  --muted: #9CA3AF;
  --muted-bg: rgba(156,163,175,0.10);
}

[data-density="comfortable"] {
  --row-h: 44px;
  --card-pad: 24px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
code, pre, .mono { font-family: var(--font-mono); font-feature-settings: 'tnum' 1, 'cv11' 1; }

/* ── app frame ──────────────────────────────────────────── */
.app-frame {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  height: 100vh;
}
[data-sidebar="collapsed"] .app-frame {
  grid-template-columns: var(--sidebar-collapsed-w) 1fr;
}
.topbar { grid-column: 1 / 3; grid-row: 1; }
.sidebar { grid-column: 1; grid-row: 2; }
.main    { grid-column: 2; grid-row: 2; overflow: hidden; min-width: 0; display: flex; flex-direction: column; }
.page    { flex: 1; overflow: auto; min-height: 0; }

/* ── topbar ──────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 8px;
  height: var(--topbar-h);
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.01em;
  padding-right: 12px;
  margin-right: 4px;
  border-right: 1px solid var(--border);
  height: 100%;
  min-width: calc(var(--sidebar-w) - 12px);
}
[data-sidebar="collapsed"] .brand { min-width: calc(var(--sidebar-collapsed-w) - 12px); }
.brand .mark {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: var(--accent);
  color: var(--accent-fg);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}
.brand .name { white-space: nowrap; overflow: hidden; }
[data-sidebar="collapsed"] .brand .name { display: none; }

.switcher {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  transition: background 80ms;
  white-space: nowrap;
}
.switcher:hover { background: var(--surface-2); }
.switcher .label { color: var(--text-3); font-size: 12px; }

.kbar {
  flex: 1;
  display: flex; align-items: center; gap: 8px;
  max-width: 520px;
  min-width: 0;
  margin: 0 auto;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-3);
  font-size: 13px;
  background: var(--surface);
  transition: border-color 80ms;
  white-space: nowrap;
  overflow: hidden;
}
.kbar:hover { border-color: var(--border-strong); }
.kbar > span:first-of-type { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.kbar .kbd { margin-left: auto; flex-shrink: 0; }

.topbar-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--text-2);
  transition: background 80ms, color 80ms;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.active { background: var(--surface-2); color: var(--text); }

.avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── sidebar ──────────────────────────────────────────── */
.sidebar {
  border-right: 1px solid var(--border);
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sidebar nav {
  flex: 1;
  padding: 8px 8px;
  display: flex; flex-direction: column; gap: 1px;
  overflow-y: auto;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  position: relative;
  white-space: nowrap;
  cursor: pointer;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 6px; bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.nav-item .ico { width: 16px; height: 16px; flex-shrink: 0; color: currentColor; }
.nav-item .count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
}
[data-sidebar="collapsed"] .nav-item { justify-content: center; padding: 0; }
[data-sidebar="collapsed"] .nav-item .label,
[data-sidebar="collapsed"] .nav-item .count { display: none; }
.nav-sep {
  height: 1px;
  background: var(--border);
  margin: 8px 6px;
}

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding: 8px;
}
.live-status {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-2);
  width: 100%;
}
.live-status:hover { background: var(--surface-2); color: var(--text); }
.live-status .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--running);
  flex-shrink: 0;
  animation: pulse 1.4s ease-in-out infinite;
}
[data-sidebar="collapsed"] .live-status .label { display: none; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ── breadcrumb / page header bar ──────────────────────────────────────────── */
.breadcrumb {
  height: var(--breadcrumb-h);
  display: flex; align-items: center;
  gap: 8px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  font-size: 13px;
  color: var(--text-2);
  flex-shrink: 0;
}
.breadcrumb .crumb {
  cursor: pointer;
  transition: color 80ms;
}
.breadcrumb .crumb:hover { color: var(--text); }
.breadcrumb .crumb.current { color: var(--text); font-weight: 500; cursor: default; }
.breadcrumb .sep { color: var(--text-3); font-size: 11px; }
.breadcrumb .actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* ── buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  background: var(--bg);
  color: var(--text);
  transition: background 80ms, border-color 80ms;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn.primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.btn.primary:hover { opacity: 0.92; background: var(--accent); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 24px; padding: 0 8px; font-size: 12px; }
.btn.fail { color: var(--fail); border-color: var(--fail-bg); }
.btn .ico { width: 14px; height: 14px; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

.kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-3);
  background: var(--bg);
  min-width: 16px;
  display: inline-flex;
  justify-content: center;
  line-height: 14px;
}

/* ── status pills ──────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1;
}
.pill .glyph { display: inline-flex; align-items: center; justify-content: center; width: 10px; height: 10px; font-size: 10px; }
.pill.pass    { background: var(--pass-bg);    color: var(--pass); }
.pill.fail    { background: var(--fail-bg);    color: var(--fail); }
.pill.warn    { background: var(--warn-bg);    color: var(--warn); }
.pill.info    { background: var(--info-bg);    color: var(--info); }
.pill.running { background: var(--running-bg); color: var(--running); }
.pill.queued  { background: var(--surface-2);  color: var(--text-2); }
.pill.muted   { background: var(--muted-bg);   color: var(--muted); }
.pill.paused  { background: var(--surface-2);  color: var(--text-2); }

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot.pass    { background: var(--pass); }
.dot.fail    { background: var(--fail); }
.dot.warn    { background: var(--warn); }
.dot.info    { background: var(--info); }
.dot.running { background: var(--running); animation: pulse 1.4s ease-in-out infinite; }
.dot.muted   { background: var(--muted); }
.dot.queued  { background: var(--border-strong); }

/* ── cards / surfaces ──────────────────────────────────────────── */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--card-pad);
}
.card-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.card-hd .title { font-size: 13px; font-weight: 500; color: var(--text); letter-spacing: -0.005em; }
.card-hd .sub { font-size: 12px; color: var(--text-3); }

/* ── tables ──────────────────────────────────────────── */
.tbl-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}
table.dt {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.dt thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--surface);
  padding: 0 12px;
  height: 32px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
table.dt thead th .sortable { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
table.dt tbody td {
  padding: 0 12px;
  height: var(--row-h);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
}
table.dt tbody tr:last-child td { border-bottom: 0; }
table.dt tbody tr { transition: background 60ms; }
table.dt tbody tr:hover { background: var(--surface); }
table.dt tbody tr.selected { background: var(--info-bg); }
table.dt tbody tr.focused { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--accent); }
table.dt td.num, table.dt th.num { font-family: var(--font-mono); font-size: 12.5px; }
table.dt td.muted { color: var(--text-3); }
table.dt .chk { width: 28px; padding: 0; padding-left: 12px; }
table.dt .name-cell { font-weight: 500; }
table.dt .name-cell:hover .name-link { color: var(--link); }

/* ── filter chips ──────────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 0;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12.5px;
  background: var(--bg);
  color: var(--text);
}
.chip .field { color: var(--text-3); }
.chip .op { color: var(--text-3); }
.chip .x {
  margin-left: 2px;
  color: var(--text-3);
  width: 14px; height: 14px;
  display: grid; place-items: center;
  border-radius: 3px;
}
.chip .x:hover { background: var(--surface-2); color: var(--text); }
.chip.add {
  border-style: dashed;
  color: var(--text-3);
  cursor: pointer;
}
.chip.add:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface); }

.views-bar {
  display: flex; align-items: center; gap: 2px;
  padding: 4px 0 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.view-tab {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  white-space: nowrap;
}
.view-tab:hover { color: var(--text); }
.view-tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }
.view-tab .badge { color: var(--text-3); font-size: 11px; margin-left: 4px; }

/* ── tabs (entity facets) ──────────────────────────────────────────── */
.tabs {
  display: flex; align-items: center; gap: 4px;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}
.tab {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  font-weight: 500;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab .count { color: var(--text-3); font-size: 11px; margin-left: 4px; font-family: var(--font-mono); }

/* ── drawer ──────────────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.18);
  z-index: 50;
  animation: fade 120ms;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: 560px;
  max-width: 100vw;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  display: flex; flex-direction: column;
  z-index: 51;
  animation: slide-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes slide-in { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.drawer-hd {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 10px;
  flex-shrink: 0;
}
.drawer-hd .meta { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.drawer-hd .title { font-size: 15px; font-weight: 600; margin: 2px 0 6px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px; }
.drawer-ft {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}

/* ── KPI ──────────────────────────────────────────── */
.kpi {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 120ms;
}
.kpi:hover { border-color: var(--border-strong); }
.kpi .label { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.kpi .value { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: 11.5px; margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.kpi .delta.up { color: var(--pass); }
.kpi .delta.down { color: var(--fail); }
.kpi .delta.warn-up { color: var(--fail); }
.kpi .delta.warn-down { color: var(--pass); }
.kpi .delta.flat { color: var(--text-3); }

/* ── command palette ──────────────────────────────────────────── */
.cp-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 60;
  display: grid;
  place-items: start center;
  padding-top: 12vh;
  animation: fade 80ms;
}
.cp {
  width: min(640px, 92vw);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-3);
  overflow: hidden;
}
.cp-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.cp-results { max-height: 60vh; overflow-y: auto; padding: 6px; }
.cp-group { padding: 6px 8px 2px; }
.cp-group .gh {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 4px 6px;
}
.cp-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.cp-row .ico { width: 14px; height: 14px; color: var(--text-3); }
.cp-row .sub { color: var(--text-3); font-size: 12px; margin-left: auto; }
.cp-row.focused { background: var(--surface-2); }
.cp-hint {
  border-top: 1px solid var(--border);
  padding: 8px 12px;
  display: flex; align-items: center; gap: 12px;
  font-size: 11.5px;
  color: var(--text-3);
}

/* ── empty / toast ──────────────────────────────────────────── */
.toast-stack {
  position: fixed; bottom: 16px; right: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 80;
}
.toast {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  box-shadow: var(--shadow-2);
  min-width: 280px;
  display: flex; align-items: center; gap: 10px;
  animation: slide-in 200ms;
}

/* ── conversation viewer ──────────────────────────────────────────── */
.conv {
  display: flex; flex-direction: column; gap: 10px;
}
.turn {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  background: var(--surface);
}
.turn.tester { border-left: 3px solid var(--border-strong); }
.turn.agent  { border-right: 3px solid var(--border-strong); }
.turn.failing { border: 1px solid var(--fail); background: var(--fail-bg); }
.turn .hd {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px;
  color: var(--text-3);
  margin-bottom: 6px;
}
.turn .body { color: var(--text); white-space: pre-wrap; line-height: 1.5; }
.turn .rubric {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--fail);
  border-radius: 6px;
  font-size: 12px;
  color: var(--fail);
}

/* ── stage timeline ──────────────────────────────────────────── */
.stage-tl { display: flex; flex-direction: column; }
.stage {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 10px 0 14px;
  border-left: 2px solid transparent;
  position: relative;
}
.stage .dot-wrap {
  display: flex; flex-direction: column; align-items: center;
}
.stage .dot { margin-top: 4px; width: 12px; height: 12px; border-radius: 50%; }
.stage .line {
  flex: 1;
  width: 1px;
  background: var(--border);
  margin-top: 4px;
  min-height: 16px;
}
.stage:last-child .line { display: none; }
.stage .row {
  display: flex; align-items: center; gap: 12px;
}
.stage .code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
  width: 56px;
}
.stage .name { font-weight: 500; font-size: 13.5px; }
.stage .meta { color: var(--text-3); font-size: 12px; }
.stage .summary { color: var(--text-2); font-size: 12.5px; margin-top: 4px; }
.stage .progress {
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
  width: 100%;
  max-width: 320px;
}
.stage .progress .bar {
  height: 100%;
  background: var(--running);
  transition: width 200ms;
}

/* ── sparkline ──────────────────────────────────────────── */
.spark { display: inline-block; vertical-align: middle; }

/* ── MAST tag ──────────────────────────────────────────── */
.mast {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px;
}
.mast .code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
}
.mast .ext { font-size: 9px; vertical-align: super; color: var(--text-3); margin-left: -2px; }
.mast .swatch { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }

/* ── heatmap ──────────────────────────────────────────── */
.heatmap-cell { transition: opacity 80ms; cursor: pointer; }
.heatmap-cell:hover { opacity: 0.65; }

/* ── compare ──────────────────────────────────────────── */
.cmp-rail {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: var(--bg);
}
.cmp-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
}
.cmp-row:hover { background: var(--surface); }
.cmp-row.active { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.cmp-row .delta { margin-left: auto; font-family: var(--font-mono); font-size: 12px; }

/* misc */
.flex { display: flex; }
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; }
.muted { color: var(--text-2); }
.tertiary { color: var(--text-3); }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; }
.grow { flex: 1; min-width: 0; }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ── loading skeletons ─────────────────────────────────────────── */
.skeleton-bar {
  display: inline-block;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--border) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 3px;
  vertical-align: middle;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.loader-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--info);
  animation: loader-pulse 1.2s ease-in-out infinite;
}
@keyframes loader-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%      { opacity: 1;   transform: scale(1.1); }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
