/* ember console. Tokens first: every color is a role, defined once per theme. */

:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f3f2ee;
  --surface-3: #ebeae4;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --hairline: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.1);
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 8px 24px rgba(11, 11, 11, 0.06);
  --accent: #e2531c;
  --accent-wash: rgba(226, 83, 28, 0.1);

  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --critical-ink: #b42323;
  --critical-wash: rgba(208, 59, 59, 0.08);

  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #6250d6;
  --series-8: #e34948;
  --parked-wash: rgba(137, 135, 129, 0.12);
  --scrim: rgba(13, 13, 13, 0.28);
  --flame-py: #cfe1f8;
  --flame-native: #f8dccf;
  --flame-kernel: #c9ecde;
  --flame-proc: #e6e5df;
  --flame-ink: #0b0b0b;

  --ansi-0: #0b0b0b; --ansi-1: #c22d2d; --ansi-2: #1f7a1f; --ansi-3: #8f6200;
  --ansi-4: #1f5fbf; --ansi-5: #a23b8a; --ansi-6: #00798a; --ansi-7: #52514e;
  --ansi-8: #6d6c67; --ansi-9: #e34948; --ansi-10: #2f9e44; --ansi-11: #b07c00;
  --ansi-12: #2a78d6; --ansi-13: #c2479f; --ansi-14: #0d93a6; --ansi-15: #0b0b0b;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --radius: 10px;
  --radius-sm: 6px;
  --side: 232px;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #222220;
    --surface-3: #2b2b29;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --hairline: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.45);
    --accent: #f06a35;
    --accent-wash: rgba(240, 106, 53, 0.14);
    --critical-ink: #ef7a7a;
    --critical-wash: rgba(208, 59, 59, 0.16);
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
    --parked-wash: rgba(137, 135, 129, 0.14);
    --scrim: rgba(0, 0, 0, 0.55);
    --flame-py: #1f3d64;
    --flame-native: #59301e;
    --flame-kernel: #164638;
    --flame-proc: #34342f;
    --flame-ink: #f0efec;
    --ansi-0: #6d6c67; --ansi-1: #f07272; --ansi-2: #7bd88f; --ansi-3: #e5c07b;
    --ansi-4: #79a8ff; --ansi-5: #e08ad6; --ansi-6: #6fd3dc; --ansi-7: #c3c2b7;
    --ansi-8: #898781; --ansi-9: #ff8f8f; --ansi-10: #9be8a8; --ansi-11: #f3d58f;
    --ansi-12: #9cc0ff; --ansi-13: #f0a8e8; --ansi-14: #92e4ea; --ansi-15: #f0efec;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #222220;
  --surface-3: #2b2b29;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --hairline: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.45);
  --accent: #f06a35;
  --accent-wash: rgba(240, 106, 53, 0.14);
  --critical-ink: #ef7a7a;
  --critical-wash: rgba(208, 59, 59, 0.16);
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  --parked-wash: rgba(137, 135, 129, 0.14);
  --scrim: rgba(0, 0, 0, 0.55);
  --flame-py: #1f3d64;
  --flame-native: #59301e;
  --flame-kernel: #164638;
  --flame-proc: #34342f;
  --flame-ink: #f0efec;
  --ansi-0: #6d6c67; --ansi-1: #f07272; --ansi-2: #7bd88f; --ansi-3: #e5c07b;
  --ansi-4: #79a8ff; --ansi-5: #e08ad6; --ansi-6: #6fd3dc; --ansi-7: #c3c2b7;
  --ansi-8: #898781; --ansi-9: #ff8f8f; --ansi-10: #9be8a8; --ansi-11: #f3d58f;
  --ansi-12: #9cc0ff; --ansi-13: #f0a8e8; --ansi-14: #92e4ea; --ansi-15: #f0efec;
}

/* Base */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 13px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
code, .mono { font-family: var(--mono); font-size: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-wash); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Shell */

.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 12px 14px;
  border-right: 1px solid var(--hairline);
}
.brand { display: flex; align-items: center; gap: 9px; padding: 2px 10px 18px; font-weight: 650; font-size: 15px; letter-spacing: -0.01em; }
.brand-mark { width: 18px; height: 18px; flex: none; }
.brand-mark .flame { fill: var(--accent); }
.brand-sub { margin-left: auto; font-weight: 450; font-size: 11px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 10px;
  height: 32px; padding: 0 10px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-weight: 500;
}
.nav a svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] svg { color: var(--ink); }
.nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--accent);
}
.nav .count { margin-left: auto; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 4px; }
.search-btn {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--muted); cursor: pointer; text-align: left;
}
.search-btn:hover { color: var(--ink-2); border-color: var(--axis); }
.search-btn svg { width: 14px; height: 14px; }
.search-btn kbd { margin-left: auto; }
.conn { display: flex; align-items: center; gap: 8px; padding: 6px 6px 0; font-size: 12px; color: var(--muted); min-width: 0; }
.conn .where { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.conn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex: none; }
.conn.down .dot { background: var(--critical); }
.conn.down { color: var(--critical-ink); }
.icon-btn {
  display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none;
  border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 15px; height: 15px; }
.conn .icon-btn { margin-left: auto; }

kbd {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px;
  font: 500 11px/1 var(--sans); color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px;
}

main { min-width: 0; }
.page { max-width: 1320px; margin: 0 auto; padding: 28px 40px 56px; }
/* A workload page fits the window, so its log scrolls inside its panel. */
.page.fill { display: flex; flex-direction: column; height: 100vh; min-height: 560px; padding-bottom: 24px; }

/* Page header */

.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.crumbs a:hover { color: var(--ink); }
.head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.head h1 { margin: 0; font-size: 20px; line-height: 1.25; font-weight: 650; letter-spacing: -0.015em; }
.head .sub { margin-top: 4px; color: var(--ink-2); }
.head .tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 32px 0 12px; font-size: 13px; font-weight: 600; }
.section-title .muted { font-weight: 450; }
.section-title a.more { margin-left: auto; font-weight: 450; color: var(--muted); }
.section-title a.more:hover { color: var(--ink); }

/* Inputs and buttons */

.field {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; width: 240px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.field:focus-within { border-color: var(--axis); box-shadow: 0 0 0 3px var(--accent-wash); }
.field svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; height: 100%; }
.field input::placeholder { color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--axis); background: var(--surface-2); }
.btn svg { width: 14px; height: 14px; }
.btn.danger { color: var(--critical-ink); }
.btn.danger.armed { background: var(--critical); border-color: var(--critical); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: default; }
.toggle { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink-2); cursor: pointer; }
.toggle:hover { background: var(--surface-2); color: var(--ink); }
.toggle[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); }
.toggle svg { width: 14px; height: 14px; }
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--surface-2); border-radius: 8px; }
.seg button { height: 26px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--ink-2); cursor: pointer; font-weight: 500; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 0 0 1px var(--border); }

/* Status: a glyph and a word, never color alone */

.status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; color: var(--ink); }
.status .glyph { width: 12px; height: 12px; flex: none; }
.glyph .cut { stroke: var(--surface); }
.status.good .glyph { color: var(--good); }
.status.warning .glyph { color: var(--warning); }
.status.critical .glyph { color: var(--critical); }
.status.critical { color: var(--critical-ink); }
.status.neutral .glyph { color: var(--muted); }
.status.quiet { color: var(--ink-2); }
.status.quiet .glyph { color: var(--muted); }
.status .glyph.spin { animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chip { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; background: var(--surface-2); color: var(--ink-2); font-size: 11px; font-weight: 500; }

/* Tables */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; }
.table th {
  height: 36px; padding: 0 14px; text-align: left; font-size: 12px; font-weight: 500; color: var(--muted);
  border-bottom: 1px solid var(--hairline); white-space: nowrap;
}
.table td { height: 44px; padding: 0 14px; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr.sel td { background: var(--surface-2); }
.table tbody tr.sel td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.table td:first-child, .table th:first-child { padding-left: 18px; }
.table .name { font-weight: 550; }
.table .who { max-width: 0; width: 34%; overflow: hidden; text-overflow: ellipsis; }
.table .id { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; }
.cmd-name { font-family: var(--mono); font-size: 12px; font-weight: 500 !important; }
.table .cmd { font-family: var(--mono); font-size: 12px; color: var(--ink-2); max-width: 0; width: 22%; overflow: hidden; text-overflow: ellipsis; }
.table .r { text-align: right; }
.table td.num, .table th.num { font-variant-numeric: tabular-nums; }

.empty { padding: 48px 24px; text-align: center; color: var(--ink-2); }
.empty h3 { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.empty p { margin: 0 0 14px; }
.cmdline {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 8px 7px 12px;
  font-family: var(--mono); font-size: 12px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.cmdline::before { content: "$"; color: var(--muted); }

/* Stat tiles */

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { padding: 16px 18px 15px; }
.tile .label { color: var(--ink-2); font-weight: 500; }
.tile .value { margin-top: 6px; font-size: 26px; line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; }
.tile .value small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.tile .note { margin-top: 4px; font-size: 12px; color: var(--muted); }

/* GPU cards */

.gpus { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px; }
.gpu { padding: 14px 16px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.gpu-top { display: flex; align-items: baseline; gap: 8px; }
.gpu-top .which { font-weight: 600; }
.gpu-top .where { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gpu-top .util { margin-left: auto; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.gpu-top .util small { font-size: 12px; color: var(--muted); font-weight: 500; }
.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: var(--series-1); transition: width 0.4s ease; }
.meter-row { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.meter-row .v { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.segbar { display: flex; gap: 2px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.segbar > i { height: 100%; flex: none; }
.segbar > i:first-child { border-radius: 3px 0 0 3px; }
.holders { display: flex; flex-direction: column; gap: 4px; min-height: 20px; }
.holder { display: flex; align-items: center; gap: 8px; font-size: 12px; min-width: 0; }
.holder .key { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.holder a { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.holder a:hover { text-decoration: underline; text-underline-offset: 2px; }
.holder .key.hollow { background: none; border: 1.5px solid var(--muted); }
.holder .amt { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.holder .status { margin-left: 10px; font-size: 12px; }
.holder a + .status { margin-left: auto; }
.holder.none { color: var(--muted); }
.spark { display: block; width: 100%; height: 28px; }
.gpu-meta { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }

.node { margin-bottom: 28px; }
.node-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.node-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.node-head .facts { display: flex; gap: 16px; color: var(--ink-2); font-size: 12px; flex-wrap: wrap; }
.node-head .facts span { white-space: nowrap; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.list .item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--hairline); min-width: 0; }
.list .item:last-child { border-bottom: 0; }
.list .item:hover { background: var(--surface-2); }
.list .item .name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .item .age { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; flex: none; }
.list .item .status { flex: none; width: 112px; }

/* Workload */

.w-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.w-title h1 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.w-what { margin-top: 6px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.facts-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0;
  margin: 20px 0 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
}
.facts-grid > div { padding: 12px 16px 12px 0; min-width: 0; }
.facts-grid dt { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.facts-grid dd { margin: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facts-grid dd .sub { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.copy { display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 0; background: none; cursor: pointer; font-family: var(--mono); font-size: 12px; color: var(--ink); }
.copy svg { width: 13px; height: 13px; color: var(--muted); }
.copy:hover svg { color: var(--ink); }

.tabs { display: flex; gap: 22px; margin: 18px 0 0; border-bottom: 1px solid var(--hairline); }
.tabs a { position: relative; padding: 10px 0 11px; color: var(--ink-2); font-weight: 500; display: inline-flex; align-items: center; gap: 7px; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-selected="true"] { color: var(--ink); }
.tabs a[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); border-radius: 2px; }
.tabs kbd { opacity: 0; transition: opacity 0.15s; }
.tabs:hover kbd { opacity: 1; }
.tab-body { flex: 1; display: flex; flex-direction: column; min-height: 0; padding-top: 16px; overflow: auto; }

/* Logs */

.logs { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 280px; overflow: hidden; }
.logs-bar { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 10px; border-bottom: 1px solid var(--hairline); }
.logs-bar .field { width: 260px; height: 28px; background: var(--surface-2); border-color: transparent; }
.logs-bar .state { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); padding: 0 6px; white-space: nowrap; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.live-dot.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.logs-body {
  position: relative; flex: 1; overflow: auto; padding: 10px 0 14px;
  font-family: var(--mono); font-size: 12px; line-height: 20px;
  background: var(--surface); border-radius: 0 0 var(--radius) var(--radius);
}
/* Rows are 20px tall, as ROW_H in logs.js says; only those in view exist. */
.logs-rows { position: relative; min-width: 100%; }
.logs-win { position: absolute; left: 0; top: 0; min-width: 100%; }
.line { display: flex; height: 20px; padding: 0 16px 0 0; min-width: max-content; cursor: pointer; }
.line:hover { background: var(--surface-2); }
.line .n { flex: none; width: 56px; padding-right: 14px; text-align: right; color: var(--muted); opacity: 0.6; user-select: none; font-variant-numeric: tabular-nums; }
.line .t { white-space: pre; }
.logs-detail { flex: none; max-height: 30%; overflow: auto; border-top: 1px solid var(--hairline); background: var(--surface-2); }
.detail-bar { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 0 72px; font: 12px var(--sans); color: var(--muted); }
.detail-text { margin: 0; padding: 4px 16px 10px 72px; font: 12px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.line.sys .t { color: var(--muted); }
.line.sys .t::before { content: "◆ "; color: var(--accent); }
.line mark { background: rgba(250, 178, 25, 0.35); color: inherit; border-radius: 2px; }
.logs-note { padding: 6px 16px 8px 72px; font-family: var(--sans); font-size: 12px; color: var(--muted); }
.logs-empty { padding: 36px 16px 36px 72px; font-family: var(--sans); color: var(--muted); }
.jump {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow);
  font: 500 12px var(--sans); color: var(--ink); cursor: pointer;
}
.jump svg { width: 13px; height: 13px; }
.ansi-b { font-weight: 700; }
.ansi-d { opacity: 0.7; }
.ansi-i { font-style: italic; }
.ansi-u { text-decoration: underline; }
.fg-0 { color: var(--ansi-0); } .fg-1 { color: var(--ansi-1); } .fg-2 { color: var(--ansi-2); } .fg-3 { color: var(--ansi-3); }
.fg-4 { color: var(--ansi-4); } .fg-5 { color: var(--ansi-5); } .fg-6 { color: var(--ansi-6); } .fg-7 { color: var(--ansi-7); }
.fg-8 { color: var(--ansi-8); } .fg-9 { color: var(--ansi-9); } .fg-10 { color: var(--ansi-10); } .fg-11 { color: var(--ansi-11); }
.fg-12 { color: var(--ansi-12); } .fg-13 { color: var(--ansi-13); } .fg-14 { color: var(--ansi-14); } .fg-15 { color: var(--ansi-15); }

/* Profile charts */

.filters { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.filters .note { color: var(--muted); font-size: 12px; }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; transition: opacity 0.2s; }
.charts.stale { opacity: 0.55; }
.chart { padding: 14px 16px 10px; min-width: 0; }
.chart-head { display: flex; align-items: flex-start; gap: 10px; }
.chart-head h3 { margin: 0; font-size: 13px; font-weight: 600; }
.chart-head .sub { color: var(--muted); font-size: 12px; margin-top: 1px; }
.chart-head .now { margin-left: auto; text-align: right; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.chart-head .now small { font-size: 12px; color: var(--muted); font-weight: 500; }
.chart-head .toggle { margin-left: 4px; height: 24px; padding: 0 8px; font-size: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 2px; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 2px; border-radius: 1px; }
.plot { position: relative; margin-top: 8px; }
.plot svg { display: block; width: 100%; overflow: visible; }
.plot .grid line { stroke: var(--hairline); stroke-width: 1; shape-rendering: crispEdges; }
.plot .base { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.plot .tick { fill: var(--muted); font-size: 11px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.plot .ceil { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.plot .ceil-label { fill: var(--muted); font-size: 11px; }
.plot .line-path { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.plot .area-path { opacity: 0.1; }
.plot .parked { fill: var(--parked-wash); }
.plot .parked-label { fill: var(--muted); font-size: 11px; }
.plot .event { stroke: var(--ink-2); stroke-width: 1; opacity: 0.45; shape-rendering: crispEdges; }
.plot .event-mark { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.5; }
.plot .event-tick { stroke: var(--ink-2); stroke-width: 1; shape-rendering: crispEdges; }
.plot .cross { stroke: var(--ink-2); stroke-width: 1; shape-rendering: crispEdges; }
.plot .dot { stroke: var(--surface); stroke-width: 2; }
.tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 150px; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow);
  font-size: 12px; white-space: nowrap;
}
.tip .when { color: var(--muted); margin-bottom: 4px; }
.tip .row { display: flex; align-items: center; gap: 8px; line-height: 1.7; }
.tip .row i { width: 10px; height: 2px; border-radius: 1px; flex: none; }
.tip .row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tip .row span { color: var(--ink-2); }
.tip .ev { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--hairline); color: var(--ink-2); }
.chart-table { max-height: 220px; overflow: auto; margin-top: 8px; }
.chart-table table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.chart-table th, .chart-table td { padding: 4px 8px; text-align: right; border-bottom: 1px solid var(--hairline); }
.chart-table th:first-child, .chart-table td:first-child { text-align: left; }
.chart-table th { position: sticky; top: 0; background: var(--surface); color: var(--muted); font-weight: 500; }
.timeline { margin-top: 12px; }
.timeline .item { display: grid; grid-template-columns: 76px 20px 1fr auto; align-items: center; gap: 8px; padding: 9px 16px; border-bottom: 1px solid var(--hairline); }
.timeline .item:last-child { border-bottom: 0; }
.timeline .item .t { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.timeline .item svg { width: 14px; height: 14px; color: var(--ink-2); }
.timeline .item .took { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.timeline .item.more { display: block; padding: 6px 10px; }
.note-card { padding: 28px 20px; text-align: center; color: var(--ink-2); }
.note-card b { color: var(--ink); font-weight: 600; }

/* Spec */

.spec { margin: 0; padding: 16px 18px; overflow: auto; font-family: var(--mono); font-size: 12px; line-height: 1.6; color: var(--ink-2); white-space: pre; }
.spec .k { color: var(--ink); }
.spec .s { color: var(--ansi-2); }
.spec .n { color: var(--ansi-4); }

/* Command palette, dialogs, toasts */

.scrim { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: flex; align-items: flex-start; justify-content: center; padding-top: 14vh; }
.palette { width: min(600px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.palette .field { width: 100%; height: 48px; border: 0; border-bottom: 1px solid var(--hairline); border-radius: 0; padding: 0 16px; background: none; box-shadow: none; }
.palette .field input { font-size: 14px; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 360px; overflow: auto; }
.palette li { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 7px; cursor: pointer; }
.palette li[aria-selected="true"] { background: var(--surface-2); }
.palette li svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.palette li .label { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette li .hint { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette li .status { margin-left: auto; font-size: 12px; }
.palette .group { padding: 8px 10px 4px; font-size: 11px; color: var(--muted); font-weight: 500; }
.palette .none { padding: 18px; color: var(--muted); text-align: center; }
.dialog { width: min(440px, calc(100vw - 32px)); padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.dialog h2 { margin: 0 0 12px; font-size: 14px; }
.keys { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; font-size: 13px; color: var(--ink-2); }
.keys span:nth-child(even) { display: flex; gap: 4px; justify-content: flex-end; }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--shadow); max-width: 420px; animation: rise 0.18s ease-out; }
.toast.err { border-color: var(--critical); }
.toast svg { width: 15px; height: 15px; flex: none; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.banner { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 10px 14px; border-radius: 9px; background: var(--critical-wash); color: var(--critical-ink); }
.banner svg { width: 15px; height: 15px; flex: none; }

/* Small screens: the sidebar becomes a top bar */

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; z-index: 10; height: auto; flex-direction: row; align-items: center; gap: 4px; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--hairline); background: var(--page); overflow-x: auto; }
  .brand { padding: 0 8px 0 2px; }
  .brand-sub { display: none; }
  .nav { flex-direction: row; }
  .nav a { padding: 0 9px; }
  .nav a[aria-current="page"]::before { left: 9px; right: 9px; top: auto; bottom: -9px; width: auto; height: 2px; }
  .nav .count, .nav a span.label-long { display: none; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; padding: 0; }
  .search-btn kbd, .search-btn span, .conn .where { display: none; }
  .conn { padding: 0; }
  .page { padding: 20px 16px 40px; }
  .page.fill { height: auto; min-height: 0; }
  .logs { height: 70vh; flex: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .charts { grid-template-columns: minmax(0, 1fr); }
  .head { flex-wrap: wrap; }
  .head .tools { margin-left: 0; width: 100%; }
  .field { width: 100%; }
  .hide-sm, .section-title .muted { display: none; }
  .gpus { grid-template-columns: minmax(0, 1fr); }
  .logs-bar .field { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Buttons that start something */

.btn.primary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn.primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn.primary:disabled { background: var(--surface-3); color: var(--muted); border-color: var(--border); }
.btn.primary svg { color: var(--critical); }
.btn.primary:disabled svg { color: var(--muted); }

/* Profile */

.prof { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.prof-controls .filters { margin-bottom: 0; flex-wrap: wrap; }
.prof-progress { height: 2px; background: var(--surface-3); border-radius: 1px; overflow: hidden; margin-top: 10px; }
.prof-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.25s linear; }
.prof-body { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px; align-items: start; }
.prof-list { display: flex; flex-direction: column; gap: 2px; }
.prof-none { color: var(--muted); padding: 8px 10px; }
.prof-item { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; color: var(--ink-2); }
.prof-item:hover { background: var(--surface-2); }
.prof-item.sel { background: var(--surface-3); color: var(--ink); }
.prof-item .k { font-weight: 550; color: var(--ink); }
.prof-item .v { font-variant-numeric: tabular-nums; text-align: right; }
.prof-item .t { grid-column: 1 / -1; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.prof-viewer { padding: 14px 16px 16px; min-width: 0; }
.prof-head { display: flex; align-items: flex-start; gap: 12px; }
.prof-head .seg { margin-left: auto; }
.prof-title { font-weight: 600; }
.prof-head .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.prof-notes { margin: 10px 0 0; padding: 8px 12px 8px 26px; background: var(--surface-2); border-radius: 8px; color: var(--ink-2); font-size: 12px; }
.prof-notes li + li { margin-top: 2px; }
.prof-tools { display: flex; align-items: center; gap: 12px; margin: 12px 0 10px; }
.prof-tools .field { height: 30px; width: 280px; }
.prof-tools .crumb { color: var(--ink-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.prof-tools .toggle { margin-left: auto; }
.flame { position: relative; }
.flame-canvas { display: block; cursor: pointer; border-radius: 4px; }
.flame-tip { max-width: 520px; white-space: normal; }
.tip .tip-name { font-weight: 600; margin-bottom: 2px; overflow-wrap: anywhere; font-family: var(--mono); font-size: 12px; }
.fn-table { max-height: 70vh; overflow: auto; }
.fn-table .table td { height: 32px; }
.fn-table .fn { max-width: 0; width: 55%; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 12px; }
.fn-table .fn .kind { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 8px; vertical-align: 0; }
.fn-table .file { color: var(--muted); font-family: var(--mono); font-size: 12px; max-width: 0; width: 20%; overflow: hidden; text-overflow: ellipsis; }
.fn-table .pct { color: var(--muted); padding-left: 0; }
.fn-table th.sortable { cursor: pointer; }
.fn-table th[aria-sort="descending"] { color: var(--ink); }
.k-py { background: var(--flame-py); } .k-native { background: var(--flame-native); } .k-kernel { background: var(--flame-kernel); }
.k-proc, .k-thread { background: var(--flame-proc); }

/* Requests */

.reqs { display: flex; flex-direction: column; gap: 12px; }
.req-tiles .tile .value { font-size: 20px; }
.req-chart { padding: 14px 16px 10px; }
.req-svg { display: block; margin-top: 6px; }
.req-svg .gridline { stroke: var(--hairline); stroke-width: 1; shape-rendering: crispEdges; }
.req-svg .tick { fill: var(--muted); font-size: 11px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.req-dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 1.5; cursor: pointer; }
.req-dot.warning { fill: var(--warning); }
.req-dot.critical { fill: var(--critical); }
.req-dot.resumed { fill: var(--surface); stroke: var(--series-1); stroke-width: 2; }
.req-dot.sel { stroke: var(--ink); stroke-width: 2.5; }
.req-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.req-split:has(.req-detail:not([hidden])) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.req-table { max-height: 560px; overflow: auto; }
.req-rows td { height: 36px; }
.req-rows .path { max-width: 0; width: 45%; overflow: hidden; text-overflow: ellipsis; }
.req-rows .dur { white-space: nowrap; }
.durbar { position: relative; display: inline-block; width: 64px; height: 6px; margin-right: 8px; border-radius: 3px; background: var(--surface-3); vertical-align: 1px; overflow: hidden; }
.durbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--series-1); border-radius: 3px; }
.durbar i.wait { background: var(--muted); }
.req-detail { padding: 14px 16px; min-width: 0; align-self: start; position: sticky; top: 12px; }
.waterfall { margin: 8px 0 10px; }
.wf-row { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; align-items: center; height: 28px; border-radius: 6px; cursor: pointer; }
.wf-row:hover { background: var(--surface-2); }
.wf-name { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12px; }
.wf-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc, .svc-key, .legend i.svc-key { width: 8px; height: 8px; border-radius: 2px; flex: none; display: inline-block; }
.svc.t-ember, .svc-key.t-ember { background: var(--axis); }
.svc.t-app, .svc-key.t-app { background: var(--series-1); }
.wf-track { position: relative; height: 100%; margin-right: 64px; }
.wf-bar { position: absolute; top: 9px; height: 10px; border-radius: 3px; min-width: 2px; }
.wf-bar.t-ember { background: var(--axis); }
.wf-bar.t-app { background: var(--series-1); }
.wf-bar.err { background: var(--critical); }
.wf-dur { position: absolute; right: -60px; top: 6px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.span-attrs { border-top: 1px solid var(--hairline); padding-top: 10px; }
.span-title { margin-bottom: 6px; }
.span-attrs dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 12px; }
.span-attrs dt { color: var(--muted); }
.span-attrs dd { margin: 0; overflow-wrap: anywhere; }

/* Execution */

.exec { display: flex; flex-direction: column; gap: 12px; }
.gantt { padding: 8px 0 10px; overflow: hidden; }
.gantt-row, .gantt-axis { display: grid; grid-template-columns: minmax(180px, 32%) 1fr; align-items: center; }
.gantt-row { height: 26px; cursor: pointer; }
.gantt-row:hover { background: var(--surface-2); }
.gantt-row.sel { background: var(--surface-3); }
.gantt-axis { height: 24px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.g-label { display: flex; align-items: center; gap: 4px; min-width: 0; padding-right: 12px; }
.g-title { padding-left: 10px; font-weight: 600; font-size: 12px; }
.g-cmd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.g-fold { width: 16px; height: 16px; border: 0; padding: 0; background: none; color: var(--muted); cursor: pointer; font-size: 10px; flex: none; }
.g-fold-pad { width: 16px; flex: none; }
.g-track { position: relative; height: 100%; margin-right: 56px; }
.gantt-axis .g-track span { position: absolute; top: 6px; transform: translateX(-50%); white-space: nowrap; }
.gantt-axis .g-track span.start { transform: none; }
.gantt-axis .g-track span.end { transform: translateX(-100%); }
.g-bar { position: absolute; top: 7px; height: 12px; border-radius: 3px; min-width: 2px; font-style: normal; }
.g-bar.phase { top: 4px; height: 18px; display: flex; align-items: center; overflow: hidden; border-radius: 4px; }
.g-bar.phase span { padding: 0 6px; font-size: 11px; font-weight: 500; color: #fff; white-space: nowrap; }
.g-bar.phase.open { opacity: 0.75; }
.p-queued, .p-stop { background: var(--axis); }
.g-bar.p-queued span, .g-bar.p-stop span { color: var(--ink); }
.p-placement { background: var(--series-4); }
.g-bar.p-placement span { color: #0b0b0b; }
.p-image, .p-build { background: var(--series-7); }
.p-boot { background: var(--series-3); }
.p-run { background: var(--series-1); }
.g-bar.proc.running { background: var(--series-1); }
.g-bar.proc.done { background: var(--axis); }
.g-bar.proc.failed { background: var(--critical); }
.g-end { position: absolute; top: 6px; margin-left: 6px; font-size: 11px; white-space: nowrap; color: var(--muted); }
.g-end.failed { color: var(--critical-ink); font-weight: 600; }
.g-sep { display: flex; gap: 10px; padding: 12px 10px 6px; font-size: 12px; font-weight: 600; border-top: 1px solid var(--hairline); margin-top: 6px; }
.g-sep .muted { font-weight: 400; }
.phase-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--ink-2); padding: 0 4px; }
.phase-legend span { display: inline-flex; align-items: center; gap: 6px; }
.g-key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.exec-detail { padding: 14px 16px 4px; }
.exec-detail .facts-grid { margin-top: 10px; border-bottom: 0; }

@media (max-width: 860px) {
  .prof-body, .req-split:has(.req-detail:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
  .prof-list { flex-direction: row; overflow-x: auto; }
  .gantt-row, .gantt-axis { grid-template-columns: 120px 1fr; }
}

/* Sign-in: the whole window, with no sidebar, until the server accepts a token. */

.signed-out .side { display: none; }
.signed-out .app { grid-template-columns: minmax(0, 1fr); }
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.signin-card { width: min(400px, 100%); padding: 24px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.signin-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.signin-brand svg { width: 16px; height: 16px; color: var(--accent); }
.signin-help { margin: 0; color: var(--ink-2); }
.signin-note { margin: 0; min-height: 1.4em; color: var(--critical-ink); font-size: 12px; }
.signin-card .btn { justify-content: center; }
.signin-card .field { width: 100%; }

/* Where a panel's data is from, and how old (plan M5.10). */
.sources { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; font-size: 12px; }
.src { padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.src.problem { color: var(--critical-ink); background: var(--critical-wash); }
.logs .sources { margin: 0; padding: 6px 10px; border-bottom: 1px solid var(--hairline); }
.logs-bar input[type="datetime-local"] { height: 28px; padding: 0 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); font: inherit; }
.node-history { margin-top: 12px; }
.node-history .filters { margin-top: 12px; }
