/* Health Monitor DS — color tokens. Dark is the primary theme. */

:root {
  color-scheme: dark;

  /* ---- surfaces (cool blue-black ramp) ---- */
  --bg-0: #0d1117;            /* page */
  --bg-1: #161b22;            /* card / panel */
  --bg-2: #1d2430;            /* raised / hover */
  --bg-3: #252d3b;            /* active / pressed */
  --bg-inset: #0a0e13;        /* wells, code blocks */
  --backdrop: rgba(4, 6, 10, 0.62);

  /* ---- borders ---- */
  --border-1: #222a36;        /* hairline */
  --border-2: #303a4a;        /* emphasized / hover */

  /* ---- text ---- */
  --text-1: #e6edf3;          /* primary */
  --text-2: #9aa5b5;          /* secondary */
  --text-3: #6b7686;          /* tertiary (min AA on bg-1 at 12px bold+) */
  --text-on-accent: #ffffff;
  --text-on-status: #0d1117;

  /* ---- accent (interactive, focus, links) ---- */
  --accent: #3b82f6;
  --accent-hover: #5c95f7;
  --accent-active: #2e6cd9;
  --accent-subtle: rgba(59, 130, 246, 0.13);
  --accent-border: rgba(59, 130, 246, 0.45);

  /* ---- semantic status ---- */
  --status-up: #3fb950;
  --status-down: #f85149;
  --status-degraded: #d29922;
  --status-unknown: #8b949e;

  --status-up-subtle: rgba(63, 185, 80, 0.13);
  --status-down-subtle: rgba(248, 81, 73, 0.13);
  --status-degraded-subtle: rgba(210, 153, 34, 0.14);
  --status-unknown-subtle: rgba(139, 148, 158, 0.13);

  --status-up-border: rgba(63, 185, 80, 0.4);
  --status-down-border: rgba(248, 81, 73, 0.45);
  --status-degraded-border: rgba(210, 153, 34, 0.42);
  --status-unknown-border: rgba(139, 148, 158, 0.4);

  /* ---- charts ---- */
  --chart-line: var(--accent);
  --chart-fill: rgba(59, 130, 246, 0.10);
  --chart-grid: rgba(154, 165, 181, 0.10);

  /* ---- focus ---- */
  --focus-ring: 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent);
}

/* ---- light theme ---- */
[data-theme="light"] {
  color-scheme: light;

  --bg-0: #f6f8fa;
  --bg-1: #ffffff;
  --bg-2: #f0f3f6;
  --bg-3: #e7ebf0;
  --bg-inset: #eef1f4;
  --backdrop: rgba(15, 23, 42, 0.42);

  --border-1: #d8dee6;
  --border-2: #c2cbd6;

  --text-1: #1a2230;
  --text-2: #57616f;
  --text-3: #77818f;
  --text-on-accent: #ffffff;
  --text-on-status: #ffffff;

  --accent: #2563eb;
  --accent-hover: #1d54cf;
  --accent-active: #1747b0;
  --accent-subtle: rgba(37, 99, 235, 0.09);
  --accent-border: rgba(37, 99, 235, 0.4);

  --status-up: #1a8f3c;
  --status-down: #d1322b;
  --status-degraded: #a16a00;
  --status-unknown: #6b7686;

  --status-up-subtle: rgba(26, 143, 60, 0.10);
  --status-down-subtle: rgba(209, 50, 43, 0.10);
  --status-degraded-subtle: rgba(161, 106, 0, 0.12);
  --status-unknown-subtle: rgba(107, 118, 134, 0.10);

  --status-up-border: rgba(26, 143, 60, 0.38);
  --status-down-border: rgba(209, 50, 43, 0.4);
  --status-degraded-border: rgba(161, 106, 0, 0.38);
  --status-unknown-border: rgba(107, 118, 134, 0.36);

  --chart-fill: rgba(37, 99, 235, 0.08);
  --chart-grid: rgba(87, 97, 111, 0.12);

  --focus-ring: 0 0 0 2px var(--bg-1), 0 0 0 4px var(--accent);
}
/* Theme: "Makima" (v2) — control-devil vibe.
   Warm near-black, crimson control accent, gold ringed-eye degraded tone.
   Calm, authoritative, slightly unsettling. Same token contract as dark/light. */

[data-theme="makima"] {
  color-scheme: dark;

  /* warm near-black ramp (dried-blood undertone) */
  --bg-0: #131013;
  --bg-1: #1b1619;
  --bg-2: #251d21;
  --bg-3: #2f2429;
  --bg-inset: #0e0b0d;
  --backdrop: rgba(10, 6, 8, 0.68);

  --border-1: #2e2429;
  --border-2: #443539;

  --text-1: #ece4e2;
  --text-2: #a89a99;
  --text-3: #7a6d6d;
  --text-on-accent: #ffffff;
  --text-on-status: #131013;

  /* crimson — control. Interaction, focus, chart line. */
  --accent: #c33b47;
  --accent-hover: #d5525c;
  --accent-active: #a52e39;
  --accent-subtle: rgba(195, 59, 71, 0.14);
  --accent-border: rgba(195, 59, 71, 0.48);

  /* status — same semantics, warm-shifted */
  --status-up: #8fa86b;             /* calm olive-sage: order, obedience */
  --status-down: #ef4b3f;           /* hot vermillion: violence */
  --status-degraded: #d9a441;       /* ringed-eye gold */
  --status-unknown: #8d8085;

  --status-up-subtle: rgba(143, 168, 107, 0.13);
  --status-down-subtle: rgba(239, 75, 63, 0.13);
  --status-degraded-subtle: rgba(217, 164, 65, 0.14);
  --status-unknown-subtle: rgba(141, 128, 133, 0.13);

  --status-up-border: rgba(143, 168, 107, 0.4);
  --status-down-border: rgba(239, 75, 63, 0.48);
  --status-degraded-border: rgba(217, 164, 65, 0.42);
  --status-unknown-border: rgba(141, 128, 133, 0.4);

  --chart-line: var(--accent);
  --chart-fill: rgba(195, 59, 71, 0.10);
  --chart-grid: rgba(168, 154, 153, 0.10);

  --focus-ring: 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-overlay: 0 16px 48px rgba(0, 0, 0, 0.65);
}

/* ---- flourishes (scoped to the theme) ---- */

/* hairline crimson thread across the very top — quiet authority */
[data-theme="makima"] body::before {
  content: "";
  position: fixed; top: 0; left: 0; right: 0; height: 1px; z-index: 60;
  background: linear-gradient(to right, transparent, var(--accent) 30%, var(--accent) 70%, transparent);
  opacity: 0.7;
  pointer-events: none;
}

/* concentric-ring "control" mark (the ringed eye / scope). Pure CSS circles. */
[data-theme="makima"] .hm-brand-mark {
  background: radial-gradient(circle,
    var(--accent) 0 2px, transparent 2.5px 5px,
    var(--accent-border) 5px 6px, transparent 6.5px 9px,
    var(--accent-border) 9px 10px, transparent 10.5px);
  border-color: var(--accent-border);
  color: transparent;
}
[data-theme="makima"] .hm-brand-mark svg { display: none; }

/* heroes: colder, more command-like */
[data-theme="makima"] .hm-hero {
  background: linear-gradient(to right, var(--status-up-subtle), transparent 55%), var(--bg-1);
}
[data-theme="makima"] .hm-hero[data-status="down"] {
  background:
    linear-gradient(to right, rgba(239, 75, 63, 0.16), transparent 55%),
    radial-gradient(circle at 100% 0%, rgba(195, 59, 71, 0.08), transparent 40%),
    var(--bg-1);
}

/* selection reads as being marked */
[data-theme="makima"] ::selection { background: rgba(195, 59, 71, 0.35); }
/* Health Monitor DS — typography tokens */
:root {
  --font-sans: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* dense-UI scale */
  --text-xs: 11px;     /* tick labels, overlines */
  --text-sm: 12px;     /* meta, badges, table captions */
  --text-md: 13px;     /* base UI text */
  --text-lg: 14px;     /* card titles, inputs */
  --text-xl: 16px;     /* section titles */
  --text-2xl: 20px;    /* panel headers */
  --text-3xl: 28px;    /* hero, big metrics */
  --text-4xl: 40px;    /* hero metric (detail uptime %) */

  --leading-tight: 1.2;
  --leading-normal: 1.45;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --tracking-caps: 0.06em; /* uppercase overlines */
}
/* Health Monitor DS — spacing / radii / shadows / motion */
:root {
  /* 4px scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-full: 999px;

  /* dark-first elevation: border does most of the work, shadow adds depth */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-overlay: 0 16px 48px rgba(0, 0, 0, 0.55);

  --ease: cubic-bezier(0.25, 0.1, 0.25, 1); /* @kind other */
  --dur-fast: 120ms; /* @kind other */
  --dur-med: 200ms; /* @kind other */
  --dur-slow: 320ms; /* @kind other */

  /* layout */
  --touch-target: 44px;
  --container-max: 1280px;
}

[data-theme="light"] {
  --shadow-1: 0 1px 2px rgba(20, 30, 50, 0.08);
  --shadow-2: 0 4px 14px rgba(20, 30, 50, 0.10);
  --shadow-overlay: 0 16px 48px rgba(20, 30, 50, 0.22);
}
/* Health Monitor DS — base resets & element defaults */
* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg-0);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

code, pre, kbd { font-family: var(--font-mono); }

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

::selection { background: var(--accent-subtle); }

/* metrics: always tabular */
.num { font-variant-numeric: tabular-nums; font-family: var(--font-mono); }

/* uppercase overline label */
.overline {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-3);
}

/* thin scrollbars for dense panels */
.scroll-thin { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
.scroll-thin::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-thin::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: var(--radius-full); }
.scroll-thin::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
/* Health Monitor DS — component classes.
   Vanilla-first: these classes ARE the implementation contract; the JSX
   components in components/ are thin wrappers over them. */

/* ============ Buttons ============ */
.hm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 32px; padding: 0 var(--space-3);
  font: var(--weight-medium) var(--text-md)/1 var(--font-sans);
  color: var(--text-1); background: var(--bg-2);
  border: 1px solid var(--border-2); border-radius: var(--radius-md);
  cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.hm-btn:hover { background: var(--bg-3); }
.hm-btn:active { background: var(--bg-3); border-color: var(--border-2); }
.hm-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.hm-btn svg { width: 15px; height: 15px; }

.hm-btn--primary { background: var(--accent); border-color: transparent; color: var(--text-on-accent); }
.hm-btn--primary:hover { background: var(--accent-hover); }
.hm-btn--primary:active { background: var(--accent-active); }

.hm-btn--danger { background: transparent; border-color: var(--status-down-border); color: var(--status-down); }
.hm-btn--danger:hover { background: var(--status-down-subtle); }

.hm-btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.hm-btn--ghost:hover { background: var(--bg-2); color: var(--text-1); }

.hm-btn--lg { min-height: var(--touch-target); padding: 0 var(--space-4); font-size: var(--text-lg); }

.hm-iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; flex: none;
  color: var(--text-2); background: transparent;
  border: 1px solid transparent; border-radius: var(--radius-md); cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.hm-iconbtn:hover { background: var(--bg-2); color: var(--text-1); }
.hm-iconbtn--danger:hover { background: var(--status-down-subtle); color: var(--status-down); }
.hm-iconbtn svg { width: 16px; height: 16px; }

/* ============ Form controls ============ */
.hm-field { display: flex; flex-direction: column; gap: var(--space-1); }
.hm-label { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-2); }
.hm-hint { font-size: var(--text-sm); color: var(--text-3); }
.hm-error-text { font-size: var(--text-sm); color: var(--status-down); display: inline-flex; align-items: center; gap: var(--space-1); }
.hm-error-text svg { width: 13px; height: 13px; }

.hm-input, .hm-select, .hm-textarea {
  width: 100%; min-height: 34px; padding: var(--space-2) var(--space-3);
  font: var(--weight-regular) var(--text-lg)/1.3 var(--font-sans);
  color: var(--text-1); background: var(--bg-inset);
  border: 1px solid var(--border-2); border-radius: var(--radius-md);
  transition: border-color var(--dur-fast) var(--ease);
}
.hm-input::placeholder, .hm-textarea::placeholder { color: var(--text-3); }
.hm-input:hover, .hm-select:hover, .hm-textarea:hover { border-color: var(--text-3); }
.hm-input:focus-visible, .hm-select:focus-visible, .hm-textarea:focus-visible {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); outline: none;
}
.hm-input--invalid, .hm-input--invalid:hover { border-color: var(--status-down); }
.hm-input--invalid:focus-visible { border-color: var(--status-down); box-shadow: 0 0 0 3px var(--status-down-subtle); }
.hm-input--mono { font-family: var(--font-mono); font-size: var(--text-md); }

.hm-select { appearance: none; padding-right: var(--space-8); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239aa5b5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }

/* switch */
.hm-switch { position: relative; display: inline-flex; width: 36px; height: 20px; flex: none; cursor: pointer; }
.hm-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.hm-switch i {
  position: absolute; inset: 0; border-radius: var(--radius-full);
  background: var(--bg-3); border: 1px solid var(--border-2);
  transition: background var(--dur-med) var(--ease);
}
.hm-switch i::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  border-radius: var(--radius-full); background: var(--text-2);
  transition: transform var(--dur-med) var(--ease), background var(--dur-med) var(--ease);
}
.hm-switch input:checked + i { background: var(--status-up); border-color: transparent; }
.hm-switch input:checked + i::after { transform: translateX(16px); background: #fff; }
.hm-switch input:focus-visible + i { box-shadow: var(--focus-ring); }

/* segmented control (also used as tabs) */
.hm-seg {
  display: inline-flex; gap: 2px; padding: 2px;
  background: var(--bg-inset); border: 1px solid var(--border-1); border-radius: var(--radius-md);
}
.hm-seg-btn {
  min-height: 26px; padding: 0 var(--space-3);
  display: inline-flex; align-items: center; gap: var(--space-1);
  font: var(--weight-medium) var(--text-sm)/1 var(--font-sans);
  color: var(--text-2); background: transparent; border: 0; border-radius: var(--radius-sm);
  cursor: pointer; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.hm-seg-btn:hover { color: var(--text-1); }
.hm-seg-btn[aria-selected="true"], .hm-seg-btn[aria-pressed="true"] {
  background: var(--bg-3); color: var(--text-1); box-shadow: var(--shadow-1);
}

/* tag + tag input */
.hm-tag {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: 1px var(--space-2); border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  color: var(--text-2); background: var(--bg-2); border: 1px solid var(--border-1);
}
.hm-tag button { display: inline-flex; padding: 0; margin-right: -2px; border: 0; background: none; color: var(--text-3); cursor: pointer; }
.hm-tag button:hover { color: var(--text-1); }
.hm-tag button svg { width: 11px; height: 11px; }
.hm-taginput { display: flex; flex-wrap: wrap; gap: var(--space-1); align-items: center; min-height: 34px; padding: var(--space-1) var(--space-2); background: var(--bg-inset); border: 1px solid var(--border-2); border-radius: var(--radius-md); cursor: text; }
.hm-taginput:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.hm-taginput input { flex: 1; min-width: 60px; border: 0; background: none; color: var(--text-1); font: var(--weight-regular) var(--text-md) var(--font-sans); outline: none; }

/* form section grouping */
.hm-formsection { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4) 0; border-top: 1px solid var(--border-1); }
.hm-formsection:first-child { border-top: 0; padding-top: 0; }
.hm-formsection > .overline { margin-bottom: var(--space-1); }

/* ============ Status primitives ============ */
.hm-dot { position: relative; display: inline-block; width: 8px; height: 8px; flex: none; border-radius: var(--radius-full); background: var(--status-unknown); }
.hm-dot[data-status="up"] { background: var(--status-up); }
.hm-dot[data-status="down"] { background: var(--status-down); }
.hm-dot[data-status="degraded"] { background: var(--status-degraded); }
.hm-dot--lg { width: 12px; height: 12px; }
.hm-dot--pulse::before {
  content: ""; position: absolute; inset: -4px; border-radius: var(--radius-full);
  background: inherit; opacity: 0.4; animation: hm-pulse 1.6s var(--ease) infinite;
}
@keyframes hm-pulse { 0% { transform: scale(0.5); opacity: 0.5; } 100% { transform: scale(1.4); opacity: 0; } }

.hm-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px var(--space-2); border-radius: var(--radius-full);
  font-size: var(--text-sm); font-weight: var(--weight-semibold); line-height: 1.4;
  color: var(--status-unknown); background: var(--status-unknown-subtle); border: 1px solid var(--status-unknown-border);
}
.hm-badge svg { width: 12px; height: 12px; }
.hm-badge[data-status="up"] { color: var(--status-up); background: var(--status-up-subtle); border-color: var(--status-up-border); }
.hm-badge[data-status="down"] { color: var(--status-down); background: var(--status-down-subtle); border-color: var(--status-down-border); }
.hm-badge[data-status="degraded"] { color: var(--status-degraded); background: var(--status-degraded-subtle); border-color: var(--status-degraded-border); }

/* uptime tick bar (last N checks, newest right) */
.hm-ticks { display: flex; gap: 2px; align-items: stretch; height: 20px; }
.hm-tick { position: relative; flex: 1; max-width: 6px; min-width: 3px; border-radius: 1.5px; background: var(--status-unknown-subtle); }
.hm-tick[data-s="up"] { background: var(--status-up); opacity: 0.85; }
.hm-tick[data-s="down"] { background: var(--status-down); }
.hm-tick[data-s="degraded"] { background: var(--status-degraded); }
.hm-tick:hover { opacity: 1; transform: scaleY(1.15); }
/* tooltip via data-tip */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm);
  background: var(--bg-3); border: 1px solid var(--border-2); box-shadow: var(--shadow-2);
  color: var(--text-1); font: var(--weight-medium) var(--text-xs)/1.3 var(--font-mono);
  white-space: pre; z-index: 50; pointer-events: none;
}

/* live (SSE) indicator */
.hm-live { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-3); }
.hm-live .hm-dot { width: 6px; height: 6px; }
.hm-live[data-state="live"] .hm-dot { background: var(--status-up); }
.hm-live[data-state="reconnecting"] .hm-dot { background: var(--status-degraded); animation: hm-blink 1s steps(2) infinite; }
.hm-live[data-state="polling"] .hm-dot { background: var(--status-unknown); }
@keyframes hm-blink { 50% { opacity: 0.3; } }

/* ============ Surfaces ============ */
.hm-card {
  background: var(--bg-1); border: 1px solid var(--border-1);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-1);
}
.hm-card--hover { transition: border-color var(--dur-fast) var(--ease); cursor: pointer; }
.hm-card--hover:hover { border-color: var(--border-2); }
.hm-card--down { border-color: var(--status-down-border); }

.hm-statcard { padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: 2px; }
.hm-statcard .overline { display: flex; align-items: center; gap: var(--space-1); }
.hm-statcard b { font-size: var(--text-3xl); font-weight: var(--weight-semibold); line-height: var(--leading-tight); font-variant-numeric: tabular-nums; }
.hm-statcard small { font-size: var(--text-sm); color: var(--text-3); }

/* hero status strip */
.hm-hero { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg); border: 1px solid var(--status-up-border); background: linear-gradient(to right, var(--status-up-subtle), transparent 65%), var(--bg-1); }
.hm-hero[data-status="down"] { border-color: var(--status-down-border); background: linear-gradient(to right, var(--status-down-subtle), transparent 65%), var(--bg-1); }
.hm-hero-icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; border-radius: var(--radius-full); color: var(--text-on-status); background: var(--status-up); }
.hm-hero[data-status="down"] .hm-hero-icon { background: var(--status-down); }
.hm-hero-icon svg { width: 22px; height: 22px; }
.hm-hero h1 { margin: 0; font-size: var(--text-2xl); font-weight: var(--weight-semibold); line-height: var(--leading-tight); }
.hm-hero p { margin: 2px 0 0; font-size: var(--text-md); color: var(--text-2); }

/* ============ Table (compact view) ============ */
.hm-table { width: 100%; border-collapse: collapse; font-size: var(--text-md); }
.hm-table th { text-align: left; padding: var(--space-2) var(--space-3); font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--border-1); }
.hm-table td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border-1); vertical-align: middle; }
.hm-table tbody tr { cursor: pointer; transition: background var(--dur-fast) var(--ease); }
.hm-table tbody tr:hover { background: var(--bg-2); }
.hm-table tbody tr[data-status="down"] { background: var(--status-down-subtle); }

/* ============ Incidents ============ */
.hm-incident { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); }
.hm-incident + .hm-incident { border-top: 1px solid var(--border-1); }
.hm-incident-rail { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); padding-top: 5px; }
.hm-incident-rail .line { width: 2px; flex: 1; min-height: 12px; background: var(--border-1); border-radius: 1px; }

/* ============ Toasts ============ */
.hm-toaststack { position: fixed; right: var(--space-4); bottom: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); z-index: 200; width: min(360px, calc(100vw - 32px)); }
.hm-toast {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg);
  background: var(--bg-2); border: 1px solid var(--border-2); box-shadow: var(--shadow-2);
  animation: hm-toast-in var(--dur-slow) var(--ease);
}
.hm-toast svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.hm-toast[data-kind="success"] svg { color: var(--status-up); }
.hm-toast[data-kind="danger"] svg { color: var(--status-down); }
.hm-toast[data-kind="warning"] svg { color: var(--status-degraded); }
.hm-toast[data-kind="info"] svg { color: var(--accent); }
.hm-toast b { display: block; font-size: var(--text-md); font-weight: var(--weight-semibold); }
.hm-toast p { margin: 1px 0 0; font-size: var(--text-sm); color: var(--text-2); }
@keyframes hm-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ Overlays ============ */
.hm-backdrop { position: fixed; inset: 0; background: var(--backdrop); z-index: 100; animation: hm-fade var(--dur-med) var(--ease); }
@keyframes hm-fade { from { opacity: 0; } }

.hm-dialog {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 32px)); z-index: 110;
  background: var(--bg-1); border: 1px solid var(--border-2);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-overlay);
  padding: var(--space-5); animation: hm-pop var(--dur-med) var(--ease);
}
@keyframes hm-pop { from { opacity: 0; transform: translate(-50%, -48%) scale(0.97); } }

.hm-slideover {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 110;
  width: min(560px, 100vw); display: flex; flex-direction: column;
  background: var(--bg-1); border-left: 1px solid var(--border-2); box-shadow: var(--shadow-overlay);
  animation: hm-slide var(--dur-slow) var(--ease);
}
@keyframes hm-slide { from { transform: translateX(40px); opacity: 0; } }
.hm-slideover-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-1); flex: none; }
.hm-slideover-body { flex: 1; overflow-y: auto; padding: var(--space-5); }
.hm-slideover-foot { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border-1); flex: none; }

/* ============ Empty & skeleton ============ */
.hm-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-10) var(--space-5); text-align: center; }
.hm-empty svg { width: 28px; height: 28px; color: var(--text-3); }
.hm-empty b { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
.hm-empty p { margin: 0; max-width: 340px; font-size: var(--text-md); color: var(--text-2); }
.hm-empty .hm-btn { margin-top: var(--space-2); }

.hm-skel { position: relative; overflow: hidden; border-radius: var(--radius-sm); background: var(--bg-2); }
.hm-skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--bg-3), transparent); animation: hm-shimmer 1.4s infinite; }
@keyframes hm-shimmer { 100% { transform: translateX(100%); } }
