/* GitHubZ CI Infrastructure: design tokens and components.
   Layout: a slim sidebar and a sticky status bar frame one scrolling column;
   summary first (metric strip, hosts), then activity and the runner fleet.
   Deep navy with electric-cyan accents is the default look; [data-theme="light"]
   is the alternative. System fonts only: the dashboard makes no request
   outside its own server. */
:root {
  color-scheme: dark;
  /* The GitHubZ palette: Deep Navy #0F1C2E, Midnight Blue #16263D, Electric
     Cyan #5FE8F2, Bright Aqua #7CF7FF, Soft Ice Blue #CFFBFF, Cool Gray
     #8FA3B8, Off White #F5F9FC. Steps between them are marked "derived". */
  --bg: #0f1c2e;
  --bg-elev: #0b1626; /* derived: the sidebar, a step deeper */
  --surface: #16263d;
  --surface-2: #1c304b; /* derived: raised, hover */
  --surface-3: #26405f; /* derived: tracks */
  --line: rgba(143, 163, 184, 0.15);
  --line-strong: rgba(143, 163, 184, 0.28);
  --ink: #f5f9fc;
  --ink-2: #b9c7d6; /* derived: between Off White and Cool Gray */
  --ink-3: #8fa3b8;
  --title-end: #cffbff;
  /* Electric Cyan: brand, focus and data; Bright Aqua: highlights and glow */
  --brand: #5fe8f2;
  --brand-wash: rgba(95, 232, 242, 0.12);
  --glow: rgba(95, 232, 242, 0.55);
  --data: #5fe8f2;
  --data-2: #7cf7ff;
  --data-wash: rgba(95, 232, 242, 0.12);
  --on-data: #0f1c2e;
  --streak: 1;
  /* states: always shown with an icon or label as well. The green leans
     yellow so that it stays apart from the cyan of running jobs. */
  --good: #86e36a;
  --good-wash: rgba(134, 227, 106, 0.13);
  --warn: #ffb547;
  --warn-wash: rgba(255, 181, 71, 0.13);
  --bad: #ff5c7a;
  --bad-wash: rgba(255, 92, 122, 0.14);
  --idle: #8fa3b8;
  --idle-wash: rgba(143, 163, 184, 0.12);
  --shadow: 0 1px 0 rgba(207, 251, 255, 0.05) inset, 0 14px 34px -14px rgba(2, 8, 18, 0.7);
  --scrim: rgba(8, 14, 24, 0.72);
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --r-lg: 14px;
  --r: 10px;
  --r-sm: 6px;
  --gutter: 28px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f9fc;
  --bg-elev: #eaf2f8;
  --surface: #ffffff;
  --surface-2: #eff6fa;
  --surface-3: #dce8f1;
  --line: rgba(15, 28, 46, 0.1);
  --line-strong: rgba(15, 28, 46, 0.18);
  --ink: #0f1c2e;
  --ink-2: #33475e;
  --ink-3: #5b6f86; /* Cool Gray, darkened to read on white */
  --title-end: #0f1c2e;
  /* Electric Cyan is too light for text and thin lines on white: the same
     hue, darker (derived) */
  --brand: #0a7680;
  --brand-wash: rgba(95, 232, 242, 0.22);
  --glow: rgba(14, 154, 167, 0.3);
  --data: #0e9aa7;
  --data-2: #0a7680;
  --data-wash: rgba(14, 154, 167, 0.12);
  --on-data: #ffffff;
  --streak: 0.4;
  --good: #4a8a1c;
  --good-wash: rgba(74, 138, 28, 0.12);
  --warn: #b26b00;
  --warn-wash: rgba(178, 107, 0, 0.12);
  --bad: #d0344f;
  --bad-wash: rgba(208, 52, 79, 0.1);
  --idle: #5b6f86;
  --idle-wash: rgba(91, 111, 134, 0.1);
  --shadow: 0 1px 2px rgba(15, 28, 46, 0.05), 0 10px 28px -16px rgba(15, 28, 46, 0.25);
  --scrim: rgba(245, 249, 252, 0.8);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r-sm); }
h1, h2, h3 { margin: 0; font-family: var(--font-display); text-wrap: balance; }
.mono { font-family: var(--font-mono); font-size: 0.92em; letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.soft { color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
svg.icon.sm { width: 14px; height: 14px; }

/* --- frame -------------------------------------------------------------- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 24px;
  padding: 20px 14px; background: var(--bg-elev); border-right: 1px solid var(--line); isolation: isolate;
}
/* Speed streaks in the corner: light trails behind a runner. */
.sidebar::after {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: 300px; pointer-events: none;
  opacity: var(--streak);
  background: linear-gradient(145deg, transparent 40%,
    rgba(95, 232, 242, 0) 41%, rgba(95, 232, 242, 0.2) 42%, rgba(95, 232, 242, 0) 43.6%,
    transparent 47%, rgba(124, 247, 255, 0) 47%, rgba(124, 247, 255, 0.55) 47.6%, rgba(124, 247, 255, 0) 48.4%,
    transparent 52%, rgba(95, 232, 242, 0) 52%, rgba(95, 232, 242, 0.32) 53%, rgba(95, 232, 242, 0) 54.6%,
    transparent 58%, rgba(207, 251, 255, 0) 58.6%, rgba(207, 251, 255, 0.4) 59%, rgba(207, 251, 255, 0) 59.5%, transparent 60%);
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 85%);
  mask-image: linear-gradient(to top, #000 10%, transparent 85%);
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 4px 8px; }
/* The cat-and-wordmark logo; each theme shows its own cut. */
.brand-logo { display: block; width: 100%; max-width: 184px; height: auto; }
:root[data-theme="light"] .brand-logo.on-dark, :root:not([data-theme="light"]) .brand-logo.on-light { display: none; }
.brand-sub { font-size: 11.5px; color: var(--ink-3); letter-spacing: 0.01em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px;
  color: var(--ink-2); font-weight: 520;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: linear-gradient(90deg, var(--brand-wash), color-mix(in srgb, var(--brand-wash) 25%, transparent)); color: var(--ink); }
.nav a[aria-current="page"] svg { color: var(--brand); }
.nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: -14px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--brand); box-shadow: 0 0 12px var(--glow);
}
.nav .count { margin-left: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 12px 10px 4px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }
.side-foot .ro { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: 14px; min-height: 56px;
  padding-block: 8px;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.2); backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
/* A glowing accent line along the status bar. */
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--brand) 55%, transparent) 22%, var(--data-2) 50%, color-mix(in srgb, var(--brand) 55%, transparent) 78%, transparent 100%);
  box-shadow: 0 0 10px var(--glow); opacity: 0.7;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink-3); font-size: 13px; }
.crumbs b { color: var(--ink); font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a:hover { color: var(--ink); }
.topbar .spacer { flex: 1; }
.status-cluster { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.tb-item { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; color: var(--ink-2); border: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.tb-item b { color: var(--ink); font-weight: 560; }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { color: var(--ink); background: var(--surface-2); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }

.content {
  width: 100%; max-width: 1480px; margin: 0 auto; display: flex; flex-direction: column; gap: 30px;
  padding-block: 28px 56px;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* --- banners (preview, connection) --------------------------------------- */
.banner { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--ink-2); }
.banner b { color: var(--ink); font-weight: 600; }
.banner.preview { border-color: color-mix(in srgb, var(--warn) 42%, transparent); background: var(--warn-wash); }
.banner.preview svg { color: var(--warn); }
.banner.warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-wash); }
.banner.warn svg { color: var(--warn); }
.banner.bad { border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: var(--bad-wash); }
.banner.bad svg { color: var(--bad); }
.banner .grow { flex: 1 1 280px; min-width: 0; }
.banner > svg { align-self: flex-start; margin-top: 2px; }
.banner .controls { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

/* --- page header --------------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 {
  font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.024em;
  background: linear-gradient(95deg, var(--ink) 45%, var(--title-end)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-sub { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 15px; color: var(--ink-2); flex-wrap: wrap; }
.page-sub .headline { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 560; }
.page-sub .sep { color: var(--ink-3); }
.head-meta { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 14px; flex-wrap: wrap; }

/* --- status dots and pills ---------------------------------------------- */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--idle); vertical-align: middle; }
.dot.lg { width: 10px; height: 10px; }
.dot.good { background: var(--good); box-shadow: 0 0 0 3px var(--good-wash); }
.dot.data { background: var(--data); box-shadow: 0 0 0 3px var(--data-wash); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-wash); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-wash); }
.dot.idle { background: var(--idle); }
.dot.hollow { background: transparent; border: 1.5px solid var(--idle); }
.dot.live { position: relative; box-shadow: 0 0 0 3px var(--good-wash), 0 0 10px color-mix(in srgb, var(--good) 55%, transparent); }
.dot.live::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid currentColor; color: var(--good); opacity: 0; animation: ping 2.4s ease-out infinite; }
@keyframes ping { 0% { transform: scale(0.6); opacity: 0.7; } 80%, 100% { transform: scale(1.5); opacity: 0; } }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 8px; border-radius: 999px; font-size: 12px; font-weight: 560; color: var(--ink); background: var(--idle-wash); white-space: nowrap; }
.pill svg.icon { width: 13px; height: 13px; stroke-width: 2.1; }
.pill.good { background: var(--good-wash); } .pill.good svg { color: var(--good); }
.pill.data { background: var(--data-wash); } .pill.data svg { color: var(--data); }
.pill.warn { background: var(--warn-wash); } .pill.warn svg { color: var(--warn); }
.pill.bad { background: var(--bad-wash); } .pill.bad svg { color: var(--bad); }
.pill.idle svg { color: var(--idle); }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11px; font-weight: 560; letter-spacing: 0.02em; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }

/* --- sections and cards -------------------------------------------------- */
.view { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.section { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.section-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.section-head h2 { font-size: 15px; font-weight: 640; letter-spacing: -0.005em; }
.section-head .meta { font-size: 12.5px; color: var(--ink-3); }
.section-head .link { margin-left: auto; font-size: 12.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; }
.section-head .link:hover { color: var(--ink); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); min-width: 0; }
.eyebrow { font-size: 11px; font-weight: 620; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); }

/* --- metric strip ------------------------------------------------------- */
.strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.metric { display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 16px; min-width: 0; border-left: 1px solid var(--line); }
.metric:first-child { border-left: 0; }
.metric-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.metric-head .eyebrow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.06em; }
.mi {
  width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; flex: none;
  color: var(--brand); background: var(--brand-wash); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 26%, transparent);
}
.mi svg.icon { width: 14px; height: 14px; stroke-width: 2; }
.mi.warn { color: var(--warn); background: var(--warn-wash); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 30%, transparent); }
.mi.bad { color: var(--bad); background: var(--bad-wash); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 30%, transparent); }
.mi.idle { color: var(--ink-3); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.metric .value { display: flex; align-items: baseline; gap: 6px; font: 650 30px/1 var(--font-display); letter-spacing: -0.025em; }
.metric .value .of { font-size: 16px; font-weight: 520; color: var(--ink-3); letter-spacing: 0; }
.metric .value.unknown { color: var(--ink-3); }
.metric .caption { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; min-height: 18px; flex-wrap: wrap; }
.metric .viz { margin-top: auto; height: 24px; display: flex; align-items: flex-end; }
.metric.dim .value { color: var(--ink-3); }
.dots-row { display: flex; gap: 5px; align-items: center; }
.seg { display: flex; gap: 2px; width: 100%; height: 6px; }
.seg i { display: block; height: 100%; border-radius: 2px; background: var(--surface-3); }
.seg i.data { background: var(--data); }
.seg i.good { background: var(--good); }
.seg i.warn { background: var(--warn); }
.seg i.bad { background: var(--bad); }

/* --- meters and slots ---------------------------------------------------- */
.meter { position: relative; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.meter > i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: linear-gradient(90deg, var(--data), var(--data-2)); }
.meter.warn > i { background: var(--warn); }
.meter.bad > i { background: var(--bad); }
.slots { display: flex; gap: 4px; width: 100%; }
.slot { flex: 1 1 0; height: 10px; border-radius: 3px; background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.slot.held { background: var(--data); box-shadow: 0 0 10px -2px var(--glow); }
.slot.cleanup { background: repeating-linear-gradient(135deg, var(--warn) 0 3px, color-mix(in srgb, var(--warn) 45%, transparent) 3px 6px); box-shadow: none; }
.slot.missing { box-shadow: inset 0 0 0 1px var(--bad); background: var(--bad-wash); }
.slots.lg .slot { height: 28px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--ink-3); }
.slots.lg .slot.held { color: var(--on-data); }
.slots.lg .slot.cleanup { color: #0f1c2e; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; box-shadow: inset 0 0 0 1px var(--line-strong); }
.legend i.held { background: var(--data); box-shadow: none; }
.legend i.cleanup { background: repeating-linear-gradient(135deg, var(--warn) 0 2px, color-mix(in srgb, var(--warn) 45%, transparent) 2px 4px); box-shadow: none; }

/* --- sparklines ---------------------------------------------------------- */
svg.spark { display: block; width: 100%; height: 100%; overflow: visible; }
svg.spark .area { fill: var(--data); opacity: 0.12; }
svg.spark .line { fill: none; stroke: var(--data); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
svg.spark .grid { stroke: var(--line); stroke-width: 1; }
svg.spark .end { fill: var(--data); stroke: var(--surface); stroke-width: 2; }
svg.spark .cross { stroke: var(--line-strong); stroke-width: 1; }
svg.spark.warn .area, svg.spark.warn .end { fill: var(--warn); }
svg.spark.warn .line { stroke: var(--warn); }
.spark-wrap { position: relative; width: 100%; height: 100%; cursor: crosshair; }
.spark-wrap > svg.spark { filter: drop-shadow(0 0 4px color-mix(in srgb, var(--glow) 60%, transparent)); }
.spark-end { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--data-2); box-shadow: 0 0 0 2px var(--surface), 0 0 10px var(--glow); transform: translate(-50%, -50%); pointer-events: none; }
.spark-end.warn { background: var(--warn); }
.spark-cross { position: absolute; top: -2px; bottom: 0; width: 1px; background: var(--line-strong); pointer-events: none; }
.spark-none { position: absolute; inset: auto 0 0 0; font-size: 11px; color: var(--ink-3); border-top: 1px solid var(--line-strong); padding-top: 3px; }
.empty-spark { cursor: default; }
.tooltip { position: fixed; z-index: 50; pointer-events: none; padding: 7px 10px; border-radius: 8px; background: var(--surface-3); border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.tooltip b { display: block; color: var(--ink); font-size: 13px; font-weight: 640; font-variant-numeric: tabular-nums; }

/* --- host cards ---------------------------------------------------------- */
.hosts { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.host { display: flex; flex-direction: column; gap: 18px; padding: 18px 20px; color: inherit; transition: border-color 0.15s, transform 0.15s; }
a.host:hover { border-color: color-mix(in srgb, var(--brand) 42%, var(--line)); box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--brand) 18%, transparent), 0 10px 30px -18px var(--glow); }
.host-top { display: flex; align-items: flex-start; gap: 12px; }
.host-glyph { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.host-glyph svg { width: 20px; height: 20px; }
.host-title { min-width: 0; flex: 1; }
.host-title h3 { font-size: 16px; font-weight: 640; letter-spacing: -0.01em; }
.host-title .role { margin-top: 1px; font-size: 13px; color: var(--ink-2); }
.host-title .platform { margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.host-cap { display: flex; flex-direction: column; gap: 8px; }
.host-cap .row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-2); }
.host-cap .row b { color: var(--ink); font-weight: 600; }
.host-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.hm { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hm .k { font-size: 11.5px; color: var(--ink-3); display: flex; justify-content: space-between; gap: 6px; }
.hm .k b { color: var(--ink); font-weight: 600; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.hm .s { height: 26px; }
.host-foot { display: flex; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; }
.host-foot .runners { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.host-foot .go { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); }
.host.listed { background: transparent; box-shadow: none; border-style: dashed; }
.host.listed .host-glyph { background: transparent; }
.host .empty-note { font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.host.stale .host-metrics, .host.stale .host-cap { opacity: 0.55; }
.mini-runners { display: inline-flex; gap: 3px; }
.mini-runners i { width: 6px; height: 14px; border-radius: 2px; background: var(--surface-3); }
.mini-runners i.data { background: var(--data); }
.mini-runners i.good { background: var(--good); }
.mini-runners i.warn { background: var(--warn); }
.mini-runners i.bad { background: var(--bad); }

/* --- job list ------------------------------------------------------------ */
.jobs { display: flex; flex-direction: column; }
.job {
  display: grid; grid-template-columns: 112px minmax(0, 2fr) minmax(0, 1.7fr) minmax(0, 1.3fr) 84px 18px;
  align-items: center; gap: 16px; padding: 13px 18px; border-top: 1px solid var(--line); color: inherit;
}
.job:first-child { border-top: 0; }
a.job:hover { background: var(--surface-2); }
.job .what { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.job .what b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job .what span { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job .branch { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink-2); font-size: 12.5px; }
.job .branch .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job .where { min-width: 0; font-size: 12.5px; color: var(--ink-2); display: flex; flex-direction: column; gap: 1px; }
.job .where span:last-child { color: var(--ink-3); }
.job .dur { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--ink); }
.job .ext { color: var(--ink-3); }
a.job:hover .ext { color: var(--ink); }

/* --- tables -------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 11px; font-weight: 620; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
table.t td.wrap { white-space: normal; }
table.t tr.stale td { opacity: 0.6; }
table.t .sub { display: block; font-size: 12px; color: var(--ink-3); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.select, .search { height: 30px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 13px var(--font-ui); padding: 0 10px; }
.search { min-width: 0; width: 220px; }
.select:hover, .search:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--line-strong)); }

/* --- activity feed ------------------------------------------------------- */
.feed { display: flex; flex-direction: column; }
.ev { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); align-items: start; }
.ev:first-child { border-top: 0; }
.ev .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.ev .ic svg { width: 15px; height: 15px; }
.ev .ic.good { color: var(--good); background: var(--good-wash); }
.ev .ic.data { color: var(--data); background: var(--data-wash); }
.ev .ic.warn { color: var(--warn); background: var(--warn-wash); }
.ev .ic.bad { color: var(--bad); background: var(--bad-wash); }
.ev .txt { min-width: 0; font-size: 13px; color: var(--ink); }
.ev .txt .sub { display: flex; gap: 8px; align-items: center; margin-top: 3px; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
.ev .when { font-size: 12px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* --- layouts ------------------------------------------------------------- */
.split { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2 { font-size: 15px; font-weight: 640; }
.panel-head .meta { font-size: 12.5px; color: var(--ink-3); }
.panel-head .filters { margin-left: auto; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 36px 20px; text-align: center; color: var(--ink-3); font-size: 13px; }
.empty svg { width: 22px; height: 22px; color: var(--ink-3); }
.empty b { color: var(--ink-2); font-weight: 560; }
.kv { display: grid; grid-template-columns: minmax(140px, max-content) minmax(0, 1fr); gap: 10px 24px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.metric-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.mcard { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.mcard .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.mcard .big { font: 650 26px/1 var(--font-display); letter-spacing: -0.02em; }
.mcard .big small { font-size: 13px; color: var(--ink-3); font-weight: 520; letter-spacing: 0; margin-left: 4px; }
.mcard .chart { height: 54px; }
.mcard .foot { font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; gap: 8px; }
.issues { display: flex; flex-direction: column; gap: 8px; }
.prose { max-width: 70ch; color: var(--ink-2); font-size: 14px; line-height: 1.6; display: flex; flex-direction: column; gap: 12px; }
.prose b { color: var(--ink); }
.loading { min-height: 50vh; display: grid; place-items: center; color: var(--ink-3); }
.app.offline-data .content > :not(.banner) { filter: saturate(0.6); opacity: 0.86; }

/* --- Control Center: forms, buttons, menus, dialogs --------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink);
  font: 560 13px/1 var(--font-ui); cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--brand) 50%, var(--line-strong)); background: var(--surface-3); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-data); box-shadow: 0 0 18px -6px var(--glow); }
.btn.primary:hover:not(:disabled) { background: var(--data-2); border-color: var(--data-2); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--bad) 85%, #000); border-color: var(--bad); }
.btn.ghost { background: transparent; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn .spinner { display: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; }
.btn.busy .spinner { display: inline-block; }
.danger-text { color: var(--bad); }
@keyframes spin { to { transform: rotate(360deg); } }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 560; color: var(--ink-2); }
.field-hint { font-size: 12px; color: var(--ink-3); }
.input {
  height: 38px; width: 100%; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg);
  color: var(--ink); font: 14px var(--font-ui); padding: 0 12px;
}
.input.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }
.input:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line-strong)); }
.input:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.form-error { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 9px 12px; border-radius: 8px; font-size: 13px; color: var(--ink); background: var(--bad-wash); border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); }
.form-error svg { color: var(--bad); margin-top: 2px; }
.form-error[hidden] { display: none; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; }
.inline-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.inline-form .field.compact { flex: 0 1 220px; }
.inline-form .input, .inline-form .select { height: 34px; }
.form.settings { max-width: 520px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.op-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-top: 10px; }
.op-grid .btn { justify-content: flex-start; }
.op-output { max-height: 280px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.launch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card-title { font-size: 15px; font-weight: 640; margin-bottom: 14px; }
.panel-foot { display: flex; justify-content: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.panel-foot.center { border-top: 0; }
.kv.roles { margin-top: 16px; font-size: 12.5px; }
.kv.roles dt { font-family: var(--font-mono); }
pre.code { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font: 12.5px/1.5 var(--font-mono); color: var(--ink); overflow-x: auto; white-space: pre; }
.secret { padding: 2px 6px; border-radius: 5px; background: var(--bg); border: 1px solid var(--line-strong); user-select: all; }
.banner.good-note { border-color: color-mix(in srgb, var(--good) 40%, transparent); background: var(--good-wash); }
.banner.good-note svg { color: var(--good); }

.tabs { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.tabs a { padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 560; color: var(--ink-2); }
.tabs a:hover { color: var(--ink); background: var(--surface-2); }
.tabs a[aria-current="page"] { color: var(--ink); background: var(--brand-wash); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 35%, transparent); }

.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.tb-item.user { gap: 8px; }
.tb-item.user .who { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.avatar { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 700; color: var(--on-data); background: linear-gradient(135deg, var(--brand), var(--data-2)); }
.user-menu .menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 190px; padding: 6px;
  border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px;
}
.menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font-size: 13px; text-align: left; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); color: var(--ink); }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background:
  radial-gradient(1200px 600px at 80% -10%, var(--brand-wash), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; padding: 28px 28px 24px; display: flex; flex-direction: column; gap: 16px; }
.auth-card h1 { font-size: 22px; font-weight: 680; letter-spacing: -0.02em; }
.auth-sub { margin: -6px 0 0; color: var(--ink-2); font-size: 13.5px; }
.auth-brand { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.auth-brand .brand-logo { max-width: 200px; }
.auth-steps { font-size: 13px; gap: 8px; }

dialog.dialog { padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); width: min(480px, calc(100vw - 32px)); }
dialog.dialog::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dialog-body { display: flex; flex-direction: column; gap: 14px; padding: 22px 22px 18px; }
.dialog-body h2 { font-size: 17px; font-weight: 660; }
.dialog-body .prose { font-size: 13.5px; gap: 8px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

.toasts { position: fixed; z-index: 60; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 36px)); }
.toast { display: flex; align-items: flex-start; gap: 9px; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow); font-size: 13px; transition: opacity 0.4s, transform 0.4s; }
.toast svg { margin-top: 1px; }
.toast.good svg { color: var(--good); }
.toast.warn svg { color: var(--warn); }
.toast.bad { border-color: color-mix(in srgb, var(--bad) 45%, var(--line-strong)); }
.toast.bad svg { color: var(--bad); }
.toast.out { opacity: 0; transform: translateY(6px); }

/* --- Control Center: hosts --------------------------------------------- */
.head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.host-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.wizard { padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; max-width: 880px; }
.steps { display: flex; gap: 22px; margin: 0; padding: 0; list-style: none; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.steps li { display: flex; align-items: center; gap: 8px; }
.steps .num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 650; border: 1px solid var(--line-strong); }
.steps li.now { color: var(--ink); font-weight: 600; }
.steps li.now .num { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 3px var(--brand-wash); }
.steps li.done .num { background: var(--good); border-color: var(--good); color: var(--on-data); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .field.wide { grid-column: 1 / -1; }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; border: 0; }
.choices legend { margin-bottom: 8px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--bg); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-wash); }
.choice input { margin-top: 3px; accent-color: var(--brand); }
.choice > span { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.secret-box { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: var(--r); border: 1px dashed color-mix(in srgb, var(--brand) 55%, var(--line-strong)); background: var(--bg); }
.secret-box code { flex: 1; min-width: 0; font-size: 11.5px; line-height: 1.5; overflow-wrap: anywhere; word-break: break-all; color: var(--ink-2); user-select: all; max-height: 120px; overflow-y: auto; }
.banner .sub { display: block; margin-top: 4px; font-size: 12px; color: var(--ink-3); }
@media (max-width: 900px) {
  .form-grid, .choices { grid-template-columns: minmax(0, 1fr); }
  .head-side { align-items: flex-start; }
  .host-actions { justify-content: flex-start; }
}

@media (max-width: 1400px) {
  .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric:nth-child(4) { border-left: 0; }
  .metric:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .metric-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .job { grid-template-columns: 110px minmax(0, 2fr) minmax(0, 1.4fr) 84px 20px; }
  .job .where { display: none; }
}
@media (max-width: 900px) {
  :root { --gutter: 16px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 40; inset: auto 0 0 0; height: auto; flex-direction: row; gap: 0; padding: 6px 8px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
    border-right: 0; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  .sidebar .brand, .side-foot, .sidebar::after { display: none; }
  .nav a[aria-current="page"]::before { left: 28%; right: 28%; top: -6px; bottom: auto; width: auto; height: 2px; border-radius: 0 0 3px 3px; }
  .nav { flex-direction: row; justify-content: space-around; width: 100%; }
  .nav a { flex-direction: column; gap: 3px; padding: 6px 4px; font-size: 11px; flex: 1; text-align: center; }
  .nav .count { display: none; }
  .content { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  .topbar .tb-item.refresh { display: none; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(odd) { border-left: 0; }
  .metric:nth-child(4) { border-left: 1px solid var(--line); }
  .metric:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .job { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .job .state { grid-column: 1; }
  .job .what { grid-column: 1 / -1; grid-row: 2; }
  .job .branch { grid-column: 1 / -1; grid-row: 3; }
  .job .dur { grid-column: 2; grid-row: 1; }
  .job .ext { display: none; }
  .host-metrics { gap: 10px; }
  .metric-cards { grid-template-columns: minmax(0, 1fr); }
  .search { width: 100%; }
}
@media (max-width: 520px) {
  .page-head h1 { font-size: 23px; }
  .tb-item.user .who, .tb-item.user .tag { display: none; }
  .toasts { left: 16px; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .hosts { grid-template-columns: minmax(0, 1fr); }
  .metric { padding: 14px 14px 12px; }
  .metric .value { font-size: 26px; }
  .topbar .tb-item.health span.label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .crumbs { display: none; }
  .topbar .spacer { display: none; }
  .status-cluster { width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .slot.held, .seg i.data, .meter > i { forced-color-adjust: none; background: Highlight; }
  .page-head h1 { background: none; color: CanvasText; }
}
