:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --ink: #16191d;
  --muted: #5d6670;
  --line: #e2e2dc;
  --accent: #2f7d4f;
  --accent-ink: #ffffff;
  --attention: #3a6fd8;
  --ffn: #2f9a62;
  --other: #8a929b;
  --comm: #d4892a;
  --gpu: #3a6fd8;
  --lpu: #d0542a;
  --disaggregated: #8a4fbf;
  --afd: #1f9a96;
  --grid: #ececE6;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111315;
    --surface: #181b1e;
    --ink: #e8eaec;
    --muted: #9aa3ac;
    --line: #2a2f34;
    --accent: #5cc48a;
    --accent-ink: #0d1a12;
    --grid: #22272b;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #111315; --surface: #181b1e; --ink: #e8eaec; --muted: #9aa3ac; --line: #2a2f34;
  --accent: #5cc48a; --accent-ink: #0d1a12; --grid: #22272b; --shadow: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
h1 { font-size: 30px; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 21px; margin: 0 0 6px; }
h3 { font-size: 14px; margin: 0; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
a { color: var(--accent); }

.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-inner { display: flex; gap: 24px; justify-content: space-between; align-items: flex-start; padding-top: 20px; }
.lede { margin: 0; color: var(--muted); max-width: 720px; }
.top-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.pill { font: 500 12px var(--mono); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.pill-wait { color: var(--muted); }
.pill-ok { color: var(--accent); border-color: var(--accent); }
.pill-err { color: var(--lpu); border-color: var(--lpu); }
.link { font-size: 13px; }
.tabs { display: flex; gap: 22px; padding-top: 14px; overflow-x: auto; }
.tabs a { color: var(--muted); text-decoration: none; padding: 6px 0 10px; border-bottom: 2px solid transparent; font-size: 14px; white-space: nowrap; }
.tabs a:hover, .tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }

section { padding: 36px 0 8px; scroll-margin-top: 150px; }
.hint { color: var(--muted); margin: 0 0 16px; max-width: 780px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; box-shadow: var(--shadow); }
.card strong { display: block; margin-bottom: 6px; font-size: 15px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }

.explorer { display: grid; grid-template-columns: 250px 1fr; gap: 16px; align-items: start; }
.controls { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; position: sticky; top: 160px; }
.controls.inline { position: static; flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.controls.inline label { flex: 1 1 120px; }
.controls label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
.controls label.check { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
select, input[type=number] { font: 14px var(--sans); padding: 7px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--ink); width: 100%; }
button { font: 600 14px var(--sans); padding: 9px 14px; border: 0; border-radius: 7px; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
button:disabled { opacity: 0.45; cursor: wait; }
.status { margin: 0; font-size: 12px; color: var(--muted); min-height: 1em; }

.results { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.kpi .v { font: 500 20px var(--mono); }
.kpi .k { font-size: 12px; color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; box-shadow: var(--shadow); min-width: 0; margin-bottom: 14px; }
.results .panel { margin-bottom: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

.chart { width: 100%; height: 380px; margin-top: 8px; }
.chart.tall { height: 460px; }
.chart.short { height: 220px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart text { fill: var(--muted); font: 11px var(--mono); }
.chart .axis line, .chart .axis path { stroke: var(--line); }
.chart .gridline { stroke: var(--grid); }
.chart .lab { fill: var(--ink); font: 500 12px var(--sans); }
.tip { position: fixed; pointer-events: none; background: var(--ink); color: var(--bg); font: 12px var(--mono); padding: 6px 8px; border-radius: 6px; z-index: 20; max-width: 340px; white-space: pre-line; display: none; }

.bar { margin: 10px 0 4px; }
.bar .lbl { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.stack { display: flex; height: 14px; border-radius: 4px; overflow: hidden; background: var(--grid); margin-top: 4px; }
.stack span { height: 100%; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--line); padding: 6px 8px; white-space: nowrap; }
.tbl td { border-bottom: 1px solid var(--line); padding: 6px 8px; vertical-align: top; }
.tbl td.num { font-family: var(--mono); text-align: right; white-space: nowrap; }
.tbl tr.hl td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.scroll { overflow-x: auto; }
.tag { font: 11px var(--mono); padding: 1px 6px; border-radius: 4px; border: 1px solid currentColor; white-space: nowrap; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 12px; flex-wrap: wrap; }
.seg button { background: transparent; color: var(--muted); border-radius: 0; font-weight: 500; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.sla { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.sla input { width: 100%; max-width: 420px; accent-color: var(--accent); }
.callout { margin: 8px 0 0; }
.prose { max-width: 820px; }
.prose p { margin: 0 0 12px; }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; padding-top: 30px; padding-bottom: 40px; }

@media (max-width: 860px) {
  .explorer { grid-template-columns: 1fr; }
  .controls { position: static; }
  .split { grid-template-columns: 1fr; }
  .top { position: static; }
  .top-inner { flex-direction: column; gap: 10px; }
  .top-meta { align-items: flex-start; flex-direction: row; }
  .chart { height: 300px; }
  .chart.tall { height: 360px; }
}
