/* ── Usage & billing (js/views/usage.js, charts in js/usage/usageCharts.js) ──
   Every colour the page draws is one of the --ub-* tokens: Day on :root, Night under
   :root:not([data-theme="light"]) as in starman.css. Starman blue (#1EA1ED) leads; the series colours
   s1–s5 are a validated categorical order (adjacent pairs stay apart for colour-blind readers in both
   themes; s1 is a step deeper on Night). Status colours (ok, warn, bad) mean only that and always come
   with an icon or a label. The page lays out by its own width (@container ub), not the window's. */
:root {
  --ub-surface: #ffffff;
  --ub-surface-2: #f8fafc;
  --ub-fill: #f1f5f9;
  --ub-row-hover: #f8fafc;
  --ub-line: #e5e7eb;
  --ub-line-soft: #eef0f3;
  --ub-line-strong: #cbd5e1;
  --ub-grid: #eef0f3;
  --ub-axis-line: #cbd5e1;
  --ub-ink: #0f172a;
  --ub-ink-2: #334155;
  --ub-muted: #64748b;
  --ub-faint: #94a3b8;
  --ub-accent: #1ea1ed;
  --ub-accent-ink: #0a77b8;      /* blue text and links: Starman blue itself is too light to read on white */
  --ub-accent-strong: #0a77b8;   /* filled buttons, white text on them */
  --ub-accent-soft: #e9f6fd;
  --ub-accent-line: #b3def8;
  --ub-accent-ring: rgba(30, 161, 237, 0.22);
  --ub-ok: #16a34a;
  --ub-ok-ink: #15803d;
  --ub-ok-soft: #f0fdf4;
  --ub-warn: #d97706;
  --ub-warn-ink: #b45309;
  --ub-warn-soft: #fffbeb;
  --ub-warn-line: #fde68a;
  --ub-bad: #dc2626;
  --ub-bad-ink: #b91c1c;
  --ub-bad-soft: #fef2f2;
  --ub-bad-line: #fecaca;
  --ub-bad-deep: #991b1b;
  --ub-bad-deep-ink: #7f1d1d;
  --ub-serious: #ea580c;
  --ub-serious-ink: #c2410c;
  --ub-s1: #1ea1ed;
  --ub-s2: #eb6834;
  --ub-s3: #6250d6;
  --ub-s4: #e87ba4;
  --ub-s5: #eda100;
  --ub-series-muted: #a3adbb;    /* the comparison series: last month */
  --ub-seq-lo: #eef7fd;          /* the heatmap's one hue, quiet to busy */
  --ub-seq-hi: #0b5f94;
  --ub-tip-bg: #ffffff;
  --ub-tip-ink: #0f172a;
  --ub-tip-muted: #64748b;
  --ub-tip-line: #e5e7eb;
  --ub-scrim: rgba(15, 23, 42, 0.28);
  --ub-shadow-pop: 0 8px 24px -6px rgba(15, 23, 42, 0.16), 0 2px 6px -2px rgba(15, 23, 42, 0.08);
  --ub-shadow-drawer: -16px 0 40px -18px rgba(15, 23, 42, 0.25);
}
:root:not([data-theme="light"]) {
  --ub-surface: #12161f;
  --ub-surface-2: #161b25;
  --ub-fill: #1c2230;
  --ub-row-hover: #171c27;
  --ub-line: rgba(255, 255, 255, 0.08);
  --ub-line-soft: rgba(255, 255, 255, 0.05);
  --ub-line-strong: rgba(255, 255, 255, 0.16);
  --ub-grid: rgba(255, 255, 255, 0.06);
  --ub-axis-line: rgba(255, 255, 255, 0.16);
  --ub-ink: #f1f5f9;
  --ub-ink-2: #cbd5e1;
  --ub-muted: #94a3b8;
  --ub-faint: #6e7a8d;
  --ub-accent-ink: #5cc0f5;
  --ub-accent-soft: rgba(30, 161, 237, 0.12);
  --ub-accent-line: rgba(30, 161, 237, 0.35);
  --ub-accent-ring: rgba(30, 161, 237, 0.3);
  --ub-ok: #22c55e;
  --ub-ok-ink: #4ade80;
  --ub-ok-soft: rgba(34, 197, 94, 0.12);
  --ub-warn: #f59e0b;
  --ub-warn-ink: #fbbf24;
  --ub-warn-soft: rgba(245, 158, 11, 0.12);
  --ub-warn-line: rgba(245, 158, 11, 0.35);
  --ub-bad: #ef4444;
  --ub-bad-ink: #f87171;
  --ub-bad-soft: rgba(239, 68, 68, 0.12);
  --ub-bad-line: rgba(239, 68, 68, 0.35);
  --ub-bad-deep: #b91c1c;
  --ub-bad-deep-ink: #fca5a5;
  --ub-serious: #f97316;
  --ub-serious-ink: #fb923c;
  --ub-s1: #1a96de;
  --ub-s2: #d95926;
  --ub-s3: #9085e9;
  --ub-s4: #d55181;
  --ub-s5: #c98500;
  --ub-series-muted: #5b6678;
  --ub-seq-lo: #1a2230;
  --ub-seq-hi: #3fb2f2;
  --ub-tip-bg: #1c2230;
  --ub-tip-ink: #f1f5f9;
  --ub-tip-muted: #94a3b8;
  --ub-tip-line: rgba(255, 255, 255, 0.1);
  --ub-scrim: rgba(0, 0, 0, 0.5);
  --ub-shadow-pop: 0 10px 30px -8px rgba(0, 0, 0, 0.6);
  --ub-shadow-drawer: -16px 0 40px -18px rgba(0, 0, 0, 0.7);
}

/* ── The page ── */
.ub-page {
  container: ub / inline-size;
  max-width: 1360px; margin: 0 auto; padding: 0 0 64px;
  font-size: 13px; line-height: 1.45; color: var(--ub-ink);
}
.ub-page *, .ub-drawer-root * { box-sizing: border-box; }
.ub-muted { color: var(--ub-muted); }
.ub-nowrap { white-space: nowrap; }
.ub-mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 11.5px; letter-spacing: -0.01em; }
.ub-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ub-grow { flex: 1 1 auto; }

.ub-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ub-title { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 22px; font-weight: 650; letter-spacing: -0.015em; color: var(--ub-ink); }
.ub-sub { margin: 4px 0 0; font-size: 13px; color: var(--ub-muted); }
.ub-head-actions { display: flex; align-items: center; gap: 10px; }
.ub-updated { font-size: 12px; color: var(--ub-muted); font-variant-numeric: tabular-nums; }

.ub-sample {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px;
  border: 1px solid var(--ub-warn-line); border-radius: 99px; background: var(--ub-warn-soft); color: var(--ub-warn-ink);
  font: inherit; font-size: 11.5px; font-weight: 600; letter-spacing: 0; cursor: pointer;
  transition: transform 120ms var(--ease-out), background-color 150ms ease;
}
.ub-sample:active { transform: scale(0.97); }
.ub-sample:focus-visible { outline: 2px solid var(--ub-accent); outline-offset: 2px; }
.ub-sample-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ub-warn); }
/* The same button once the figures are real: it opens the data sources sheet, so it stays quiet */
.ub-sample.is-sources { border-color: var(--ub-line); background: var(--ub-surface); color: var(--ub-ink-2); }
.ub-sample.is-sources .ub-sample-dot { background: var(--ub-accent); }
@media (hover: hover) and (pointer: fine) { .ub-sample.is-sources:hover { background: var(--ub-fill); } }

/* A figure still on the sample beside real ones (stage 1: Performance & limits): outlined, never filled,
   so it reads as a label and not as a status */
.ub-sample-tag {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border: 1px solid var(--ub-warn-line); border-radius: 99px;
  color: var(--ub-warn-ink); font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; cursor: help;
}
.ub-kpi-label .ub-sample-tag { margin-left: auto; }

/* A line across the top of a tab: what its figures start from, or that they are the sample */
.ub-notice {
  display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; padding: 9px 12px; border: 1px solid var(--ub-line);
  border-radius: 10px; background: var(--ub-surface-2); color: var(--ub-ink-2); font-size: 12.5px; line-height: 1.5;
}
.ub-notice svg { width: 15px; height: 15px; flex: none; margin-top: 1.5px; color: var(--ub-muted); }
.ub-notice.is-sample { border-color: var(--ub-warn-line); background: var(--ub-warn-soft); }
.ub-notice.is-sample svg { color: var(--ub-warn-ink); }

.ub-tabs { display: flex; gap: 22px; margin-top: 14px; border-bottom: 1px solid var(--ub-line); overflow-x: auto; scrollbar-width: none; }
.ub-tabs::-webkit-scrollbar { display: none; }
.ub-tab {
  position: relative; padding: 10px 0 11px; white-space: nowrap; text-decoration: none;
  font-size: 13.5px; font-weight: 500; color: var(--ub-muted); transition: color 150ms ease;
}
@media (hover: hover) and (pointer: fine) { .ub-tab:hover { color: var(--ub-ink); } }
.ub-tab[aria-current="page"] { color: var(--ub-ink); }
.ub-tab[aria-current="page"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ub-accent); }
.ub-tab:focus-visible { outline: 2px solid var(--ub-accent); outline-offset: 2px; border-radius: 4px; }

.ub-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 0 14px; }
.ub-page:not([data-tab="billing"]) [data-only="billing"] { display: none; }
.ub-period { font-size: 12px; color: var(--ub-muted); font-variant-numeric: tabular-nums; }
.ub-custom { display: inline-flex; align-items: center; gap: 6px; color: var(--ub-muted); }
.ub-custom[hidden] { display: none; }
.ub-custom input {
  height: 32px; padding: 0 8px; border: 1px solid var(--ub-line); border-radius: 8px; background: var(--ub-surface);
  color: var(--ub-ink); font: inherit; font-size: 12.5px; color-scheme: inherit;
}
.ub-custom input:focus { outline: none; border-color: var(--ub-accent); box-shadow: 0 0 0 3px var(--ub-accent-ring); }

/* Segmented controls: the date range, a card's toggle */
.ub-seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--ub-fill); }
.ub-seg button {
  height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ub-muted);
  font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background-color 150ms ease, color 150ms ease, transform 120ms var(--ease-out);
}
.ub-seg.is-small button { height: 24px; padding: 0 8px; font-size: 12px; }
@media (hover: hover) and (pointer: fine) { .ub-seg button:hover { color: var(--ub-ink); } }
.ub-seg button:active { transform: scale(0.97); }
.ub-seg button[aria-pressed="true"] { background: var(--ub-surface); color: var(--ub-ink); box-shadow: 0 0 0 1px var(--ub-line), 0 1px 2px rgba(15, 23, 42, 0.06); }
.ub-seg button:focus-visible { outline: 2px solid var(--ub-accent); outline-offset: 1px; }

.ub-select {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 26px 0 10px;
  border: 1px solid var(--ub-line); border-radius: 8px; background: var(--ub-surface); color: var(--ub-muted); font-size: 12.5px;
}
.ub-select::after {
  content: ''; position: absolute; right: 11px; top: 50%; width: 5px; height: 5px; margin-top: -4px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); pointer-events: none;
}
.ub-select select {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: var(--ub-ink);
  font: inherit; font-weight: 500; padding: 0; cursor: pointer; max-width: 220px; text-overflow: ellipsis;
}
.ub-select select:focus { outline: none; }
.ub-select:focus-within { border-color: var(--ub-accent); box-shadow: 0 0 0 3px var(--ub-accent-ring); }
.ub-select.is-inline { height: 28px; }

.ub-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--ub-line); border-radius: 8px; background: var(--ub-surface); color: var(--ub-ink);
  font: inherit; font-size: 12.5px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 150ms ease, transform 120ms var(--ease-out);
}
.ub-btn svg { width: 14px; height: 14px; }
@media (hover: hover) and (pointer: fine) { .ub-btn:hover:not(:disabled) { background: var(--ub-fill); } }
.ub-btn:active:not(:disabled) { transform: scale(0.97); }
.ub-btn:disabled { opacity: 0.4; cursor: default; }
.ub-btn:focus-visible { outline: 2px solid var(--ub-accent); outline-offset: 2px; }
.ub-btn.is-quiet { border-color: transparent; background: transparent; }
.ub-btn.is-primary { border-color: transparent; background: var(--ub-accent-strong); color: #fff; }
@media (hover: hover) and (pointer: fine) { .ub-btn.is-primary:hover:not(:disabled) { background: var(--ub-accent-strong); filter: brightness(1.08); } }
.ub-btn.is-small { height: 26px; padding: 0 8px; font-size: 12px; }

.ub-icon-btn {
  display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: var(--ub-muted); cursor: pointer; transition: background-color 150ms ease, color 150ms ease, transform 120ms var(--ease-out);
}
.ub-icon-btn svg { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) { .ub-icon-btn:hover { background: var(--ub-fill); color: var(--ub-ink); } }
.ub-icon-btn:active { transform: scale(0.94); }
.ub-icon-btn[aria-pressed="true"] { background: var(--ub-fill); color: var(--ub-ink); }
.ub-icon-btn:focus-visible { outline: 2px solid var(--ub-accent); outline-offset: 1px; }

.ub-link-btn { padding: 0 0 0 8px; border: 0; background: none; color: var(--ub-accent-ink); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; }
.ub-link-btn:focus-visible { outline: 2px solid var(--ub-accent); outline-offset: 2px; border-radius: 3px; }
.ub-cell-btn { padding: 0; border: 0; background: none; color: var(--ub-ink); font: inherit; font-weight: 500; text-align: left; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .ub-cell-btn:hover { color: var(--ub-accent-ink); } }
.ub-cell-btn:focus-visible { outline: 2px solid var(--ub-accent); outline-offset: 2px; border-radius: 3px; }
.ub-row-link, .ub-card-sub a { color: var(--ub-accent-ink); font-weight: 500; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .ub-row-link:hover, .ub-card-sub a:hover { text-decoration: underline; text-underline-offset: 2px; } }

/* While new figures load, what is on screen stays, a little faded: no flash, no jump */
.ub-body, .ub-req-results { transition: opacity 160ms ease; }
.ub-body.is-refreshing, .ub-req-results.is-refreshing { opacity: 0.55; }

/* ── Tiles ── */
/* Tiles: a row of 6 (three a row when narrower, two on a phone) or of 4 (two when narrow): never an orphan */
.ub-kpis { --cols: 4; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.ub-kpis.is-6 { --cols: 6; }
.ub-kpi {
  display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 12px 14px 13px;
  border: 1px solid var(--ub-line); border-radius: 12px; background: var(--ub-surface);
}
.ub-kpis.is-inner { margin: 0 0 14px; }
.ub-kpis.is-inner .ub-kpi { background: var(--ub-surface-2); border-color: var(--ub-line-soft); }
.ub-kpi-label { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: var(--ub-muted); }
.ub-kpi-value { display: flex; align-items: baseline; gap: 2px; min-height: 30px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; color: var(--ub-ink); }
.ub-kpi-spark { margin-left: auto; align-self: center; }
.ub-kpi-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-size: 12px; color: var(--ub-muted); min-height: 17px; }
.ub-kpi.is-skel { gap: 10px; }
.ub-unit { margin-left: 5px; font-size: 12.5px; font-weight: 500; letter-spacing: 0; color: var(--ub-muted); }
.ub-dash { color: var(--ub-faint); }
.ub-strong { font-weight: 600; }
.ub-strong.is-ok, .ub-tone.is-good { color: var(--ub-ok-ink); }
.ub-strong.is-warn, .ub-tone.is-warn { color: var(--ub-warn-ink); }
.ub-strong.is-bad, .ub-tone.is-bad { color: var(--ub-bad-ink); }
.ub-tone.is-flat { color: var(--ub-ink-2); }
.ub-tone { font-weight: 600; font-variant-numeric: tabular-nums; }

.ub-delta { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ub-delta.is-good { color: var(--ub-ok-ink); }
.ub-delta.is-bad { color: var(--ub-bad-ink); }
.ub-delta.is-flat { color: var(--ub-muted); }
.ub-vs { color: var(--ub-muted); }
.ub-vs.is-line { flex-basis: 100%; }
.ub-vs strong { color: var(--ub-ink-2); font-weight: 600; }

.ub-info { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; color: var(--ub-faint); cursor: help; }
.ub-info svg { width: 13px; height: 13px; }
.ub-info:focus-visible { outline: 2px solid var(--ub-accent); outline-offset: 1px; }
.ub-na {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border: 1px dashed var(--ub-line-strong); border-radius: 99px;
  color: var(--ub-muted); font-size: 11px; font-weight: 500; white-space: nowrap; cursor: help;
}
.ub-na:focus-visible { outline: 2px solid var(--ub-accent); outline-offset: 1px; }
.ub-pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 99px; background: var(--ub-fill); color: var(--ub-muted); font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.ub-flag {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 6px; border-radius: 99px;
  background: var(--ub-fill); color: var(--ub-ink-2); font-size: 11px; font-weight: 600; white-space: nowrap; vertical-align: 1px;
}
.ub-flag svg { width: 12px; height: 12px; }
.ub-flag.is-bad { background: var(--ub-bad-soft); color: var(--ub-bad-ink); }
.ub-flag.is-warn { background: var(--ub-warn-soft); color: var(--ub-warn-ink); }

.ub-meter { height: 6px; border-radius: 99px; overflow: hidden; background: var(--ub-accent-soft); }
.ub-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--ub-accent); }
.ub-meter.is-warn { background: var(--ub-warn-soft); }
.ub-meter.is-warn > span { background: var(--ub-warn); }
.ub-meter.is-bad { background: var(--ub-bad-soft); }
.ub-meter.is-bad > span { background: var(--ub-bad); }

/* ── Cards ── */
.ub-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.ub-card { grid-column: span 12; min-width: 0; padding: 14px 16px 16px; border: 1px solid var(--ub-line); border-radius: 12px; background: var(--ub-surface); }
.ub-span-4 { grid-column: span 4; }
.ub-span-5 { grid-column: span 5; }
.ub-span-6 { grid-column: span 6; }
.ub-span-7 { grid-column: span 7; }
.ub-span-8 { grid-column: span 8; }
.ub-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ub-card-titles { min-width: 0; }
.ub-card-title { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ub-ink); letter-spacing: -0.005em; }
.ub-card-sub { margin: 2px 0 0; font-size: 12px; color: var(--ub-muted); }
.ub-card-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ub-sub-title { margin: 16px 0 8px; font-size: 12px; font-weight: 600; color: var(--ub-ink-2); }
.ub-sub-title.is-first { margin-top: 0; }
.ub-foot-note { margin: 10px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--ub-muted); }
.ub-filter-note {
  display: flex; align-items: center; gap: 6px; margin: 0 0 12px; padding: 8px 10px; border-radius: 8px;
  background: var(--ub-fill); color: var(--ub-ink-2); font-size: 12px;
}
.ub-filter-note svg { width: 14px; height: 14px; flex: none; color: var(--ub-muted); }

.ub-skel { border-radius: 6px; background: var(--ub-fill); animation: ub-pulse 1.4s ease-in-out infinite; }
.ub-card.is-skel { min-height: 120px; }
@keyframes ub-pulse { 50% { opacity: 0.5; } }

.ub-empty, .ub-error { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 12px; text-align: center; font-size: 12.5px; color: var(--ub-muted); }
.ub-empty p, .ub-error p { margin: 0; max-width: 46ch; }
.ub-empty svg, .ub-error svg { width: 22px; height: 22px; color: var(--ub-faint); }
.ub-error { color: var(--ub-bad-ink); }

/* ── Charts ── */
.ub-chart { position: relative; width: 100%; border-radius: 6px; outline: none; }
.ub-chart:focus-visible { box-shadow: 0 0 0 2px var(--ub-accent-ring); }
.ub-chart.is-table { max-height: 320px; overflow: auto; }
.ub-svg { display: block; overflow: visible; }
.ub-svg .ub-grid { stroke: var(--ub-grid); stroke-width: 1; shape-rendering: crispEdges; }
.ub-svg .ub-base { stroke: var(--ub-axis-line); stroke-width: 1; shape-rendering: crispEdges; }
.ub-svg .ub-axis { fill: var(--ub-faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.ub-svg .ub-line { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.ub-svg .ub-area { opacity: 0.1; }
.ub-svg .ub-dot { stroke: var(--ub-surface); stroke-width: 2; }
.ub-svg .ub-mark { stroke: var(--ub-surface); stroke-width: 2; }
.ub-svg .ub-mark.is-bad { fill: var(--ub-bad); }
.ub-svg .ub-mark.is-warn { fill: var(--ub-warn); }
.ub-svg .ub-ref { stroke: var(--ub-ink-2); stroke-width: 1; stroke-dasharray: 4 4; opacity: 0.7; }
.ub-svg .ub-ref.is-bad { stroke: var(--ub-bad); opacity: 0.9; }
.ub-svg .ub-ref-label { fill: var(--ub-muted); font-size: 11px; font-weight: 500; paint-order: stroke; stroke: var(--ub-surface); stroke-width: 3px; }
.ub-svg .ub-end-label { fill: var(--ub-ink-2); font-size: 11px; font-weight: 600; }
.ub-svg .ub-xhair { stroke: var(--ub-axis-line); stroke-width: 1; shape-rendering: crispEdges; }
.ub-svg .ub-hit { fill: transparent; }
.ub-svg .ub-hit.is-link { cursor: pointer; }
.ub-svg .ub-col { transition: opacity 120ms ease; }
.ub-svg .ub-col.is-partial { opacity: 0.45; }
.ub-chart.is-hovering .ub-col:not(.is-hot) { opacity: 0.38; }
.ub-chart.is-hovering .ub-col.is-partial.is-hot { opacity: 0.6; }

.ub-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 10px; padding: 0; list-style: none; font-size: 12px; color: var(--ub-ink-2); }
.ub-legend li { display: inline-flex; align-items: center; gap: 6px; }
.ub-legend strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.ub-legend.is-outcomes { gap: 6px 18px; margin: 0; }
.ub-key { display: inline-block; flex: none; }
.ub-key.is-bar { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.ub-key.is-line { width: 14px; height: 2px; border-radius: 1px; background: var(--c); }
.ub-key.is-dash { width: 14px; height: 0; border-top: 2px dashed var(--c); }
th .ub-key { margin-right: 6px; vertical-align: 0; }

.ub-spark { display: block; overflow: visible; }
.ub-spark path { fill: none; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }

/* The tooltip: one for the page, on <body>; follows the pointer, so no animation */
.ub-tip {
  position: fixed; top: 0; left: 0; z-index: 3000; pointer-events: none;
  min-width: 150px; max-width: 290px; padding: 8px 10px; border: 1px solid var(--ub-tip-line); border-radius: 8px;
  background: var(--ub-tip-bg); color: var(--ub-tip-ink); box-shadow: var(--ub-shadow-pop);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; font-size: 12px; line-height: 1.4;
}
.ub-tip[hidden] { display: none; }
.ub-tip-title { margin: 0 0 5px; font-weight: 600; }
.ub-tip-row { display: flex; align-items: center; gap: 7px; margin-top: 2px; }
.ub-tip-key { flex: none; width: 12px; height: 2px; border-radius: 1px; background: var(--c); }
.ub-tip-key.is-bar { width: 8px; height: 8px; border-radius: 2px; }
.ub-tip-key.is-dash { height: 0; background: none; border-top: 2px dashed var(--c); }
.ub-tip-key.is-none { background: none; }
.ub-tip-value { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ub-tip-label { color: var(--ub-tip-muted); }
.ub-tip-foot { margin: 5px 0 0; color: var(--ub-tip-muted); }
.ub-tip-title + .ub-tip-foot, .ub-tip > .ub-tip-foot:first-child { margin-top: 0; }

/* ── Lists drawn in HTML: ranked bars, a 100% stack, the services, the heatmap ── */
.ub-bars { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ub-bars li, .ub-bars-link { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(56px, 1fr) auto; align-items: center; gap: 10px; font-size: 12.5px; }
.ub-bars.is-links li { display: block; }
.ub-bars-link { margin: -3px -6px; padding: 3px 6px; border-radius: 6px; color: inherit; text-decoration: none; transition: background-color 120ms ease; }
@media (hover: hover) and (pointer: fine) { .ub-bars-link:hover { background: var(--ub-fill); } }
.ub-bars-link:focus-visible { outline: 2px solid var(--ub-accent); outline-offset: 0; }
.ub-bars-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ub-ink-2); }
.ub-bars-label small { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 11px; color: var(--ub-faint); }
.ub-bars-track { height: 8px; overflow: hidden; border-radius: 4px; background: var(--ub-fill); }
.ub-bars-track > span { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.ub-bars-value { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ub-bars-value .ub-muted { font-weight: 500; margin-left: 4px; }

.ub-stack { display: flex; gap: 2px; height: 12px; margin: 2px 0 10px; }
.ub-stack > span { display: block; height: 100%; border-radius: 3px; }
.ub-stack.is-thin { height: 8px; margin-bottom: 8px; }

.ub-total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 8px; }
.ub-total-value { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.ub-breakdown { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.ub-breakdown li {
  display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; align-items: center; column-gap: 8px; row-gap: 5px;
  padding: 8px 0; border-top: 1px solid var(--ub-line-soft); font-size: 12.5px;
}
.ub-breakdown li:first-child { border-top: 0; }
.ub-breakdown-label { min-width: 0; color: var(--ub-ink-2); }
.ub-breakdown-label small { display: block; margin-top: 1px; font-size: 11px; color: var(--ub-faint); }
.ub-breakdown-value { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.ub-breakdown-share { min-width: 46px; color: var(--ub-muted); font-variant-numeric: tabular-nums; text-align: right; }
.ub-breakdown-bar { grid-column: 2 / -1; height: 4px; overflow: hidden; border-radius: 2px; background: var(--ub-fill); }
.ub-breakdown-bar > span { display: block; height: 100%; border-radius: 2px; }

.ub-facts { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 12px 0 0; }
.ub-facts div { display: flex; flex-direction: column; gap: 2px; }
.ub-facts dt { font-size: 11.5px; color: var(--ub-muted); }
.ub-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.ub-facts dd .ub-muted, .ub-facts dd .ub-delta { font-weight: 500; font-size: 12px; }
.ub-facts.is-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 12px; }

.ub-heat-grid { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); align-items: center; gap: 3px; }
.ub-heat-hour { font-size: 10.5px; color: var(--ub-faint); font-variant-numeric: tabular-nums; }
.ub-heat-day { font-size: 11.5px; color: var(--ub-muted); }
.ub-heat-cell { height: 22px; border-radius: 4px; background: var(--ub-seq-lo); transition: box-shadow 100ms ease; }
.ub-heat-cell.is-empty { background: transparent; box-shadow: inset 0 0 0 1px var(--ub-line-soft); }
.ub-heat-cell.is-hot { box-shadow: 0 0 0 2px var(--ub-ink); }
.ub-heat-legend { display: flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 11.5px; color: var(--ub-muted); }
.ub-heat-legend span:first-child { margin-right: 4px; }
.ub-heat-legend span:last-child { margin-left: 4px; }
.ub-heat-swatch { width: 18px; height: 10px; border-radius: 3px; }

/* ── Overview pieces ── */
.ub-opps { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.ub-opp { display: grid; grid-template-columns: 28px minmax(0, 1fr) 26px; align-items: start; gap: 10px; padding: 10px 0; border-top: 1px solid var(--ub-line-soft); }
.ub-opp:first-child { padding-top: 0; border-top: 0; }
.ub-opp-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--ub-accent-soft); color: var(--ub-accent-ink); }
.ub-opp-icon svg { width: 15px; height: 15px; }
.ub-opp.is-warn .ub-opp-icon { background: var(--ub-warn-soft); color: var(--ub-warn-ink); }
.ub-opp.is-bad .ub-opp-icon { background: var(--ub-bad-soft); color: var(--ub-bad-ink); }
.ub-opp-title { margin: 0; font-size: 12.5px; font-weight: 600; line-height: 1.35; color: var(--ub-ink); }
.ub-opp-detail { margin: 3px 0 0; font-size: 12px; line-height: 1.45; color: var(--ub-muted); }
.ub-opp-link { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; color: var(--ub-muted); transition: background-color 150ms ease, color 150ms ease, transform 120ms var(--ease-out); }
.ub-opp-link svg { width: 15px; height: 15px; }
@media (hover: hover) and (pointer: fine) { .ub-opp-link:hover { background: var(--ub-fill); color: var(--ub-ink); } }
.ub-opp-link:active { transform: scale(0.94); }
.ub-opp-link:focus-visible { outline: 2px solid var(--ub-accent); outline-offset: 1px; }

.ub-diverge { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ub-diverge li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(64px, 1fr) 44px; align-items: center; gap: 10px; font-size: 12px; }
.ub-diverge-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ub-ink-2); }
.ub-diverge-track { position: relative; height: 10px; }
.ub-diverge-track::before { content: ''; position: absolute; top: -3px; bottom: -3px; left: 50%; width: 1px; background: var(--ub-axis-line); }
.ub-diverge-bar { position: absolute; top: 1px; height: 8px; border-radius: 3px; }
.ub-diverge-bar.is-ok { background: var(--ub-ok); }
.ub-diverge-bar.is-warn { background: var(--ub-warn); }
.ub-diverge-bar.is-bad { background: var(--ub-bad); }
.ub-diverge-none { font-size: 11px; color: var(--ub-faint); text-align: center; }
.ub-diverge-val { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; color: var(--ub-muted); }

/* ── Tables ── */
.ub-table-wrap { margin: 0 -16px; overflow-x: auto; } /* rows reach the card's edges; the end cells keep 16px inside */
.ub-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ub-table th {
  padding: 7px 10px; border-bottom: 1px solid var(--ub-line); text-align: left; white-space: nowrap;
  font-size: 11.5px; font-weight: 500; color: var(--ub-muted); background: none; /* over styles.css's th */
}
.ub-table td { padding: 9px 10px; border-bottom: 1px solid var(--ub-line-soft); vertical-align: middle; color: var(--ub-ink); font-size: 12.5px; }
.ub-table tbody tr:last-child td { border-bottom: 0; }
.ub-table th:first-child, .ub-table td:first-child { padding-left: 16px; }
.ub-table th:last-child, .ub-table td:last-child { padding-right: 16px; }
.ub-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ub-table.is-compact td { padding-top: 6px; padding-bottom: 6px; }
.ub-table.is-compare th[scope="row"] { font-size: 12.5px; font-weight: 400; color: var(--ub-ink-2); border-bottom: 1px solid var(--ub-line-soft); }
.ub-table.is-compare tbody tr:last-child th { border-bottom: 0; }
.ub-table tbody tr[data-req], .ub-table tbody tr[data-tool] { cursor: pointer; transition: background-color 120ms ease; }
@media (hover: hover) and (pointer: fine) { .ub-table tbody tr[data-req]:hover, .ub-table tbody tr[data-tool]:hover { background: var(--ub-row-hover); } }
.ub-table tbody tr[data-req]:focus-visible, .ub-table tbody tr[data-tool]:focus-visible { outline: 2px solid var(--ub-accent); outline-offset: -2px; }
.ub-table tr.is-selected td { background: var(--ub-accent-soft); }
.ub-cell-title { display: block; font-weight: 500; color: var(--ub-ink); }
.ub-cell-sub { display: block; margin-top: 1px; font-size: 11.5px; font-weight: 400; color: var(--ub-muted); white-space: normal; }
.ub-table .num .ub-cell-sub { white-space: nowrap; }
.ub-col-bar { width: 90px; }
.ub-inline-bar { display: block; height: 6px; overflow: hidden; border-radius: 3px; background: var(--ub-fill); }
.ub-inline-bar > span { display: block; height: 100%; border-radius: 0 3px 3px 0; background: var(--ub-s1); }

.ub-status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.ub-status svg { width: 14px; height: 14px; flex: none; }
.ub-status.is-success, .ub-status.is-ok { color: var(--ub-ok-ink); }
.ub-status.is-failed, .ub-status.is-bad { color: var(--ub-bad-ink); }
.ub-status.is-bad-deep { color: var(--ub-bad-deep-ink); }
.ub-status.is-incomplete, .ub-status.is-warn { color: var(--ub-warn-ink); }
.ub-status.is-serious { color: var(--ub-serious-ink); }
.ub-status.is-none { color: var(--ub-muted); }

/* The request history */
.ub-req-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.ub-search {
  display: flex; flex: 1 1 260px; align-items: center; gap: 8px; max-width: 420px; height: 32px; padding: 0 10px;
  border: 1px solid var(--ub-line); border-radius: 8px; background: var(--ub-surface); color: var(--ub-muted);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.ub-search:focus-within { border-color: var(--ub-accent); box-shadow: 0 0 0 3px var(--ub-accent-ring); }
.ub-search svg { width: 15px; height: 15px; flex: none; }
.ub-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 12.5px; color: var(--ub-ink); }
.ub-search input::placeholder { color: var(--ub-faint); }
.ub-req-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ub-req-chips:empty { display: none; }
.ub-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 6px 0 10px; border: 1px solid var(--ub-accent-line); border-radius: 99px;
  background: var(--ub-accent-soft); color: var(--ub-accent-ink); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer;
  transition: transform 120ms var(--ease-out);
}
.ub-chip svg { width: 13px; height: 13px; }
.ub-chip:active { transform: scale(0.97); }
.ub-chip:focus-visible { outline: 2px solid var(--ub-accent); outline-offset: 1px; }
.ub-table.is-history .ub-req-cell { width: 34%; max-width: 0; }
.ub-req-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ub-req-mic { display: inline-block; width: 13px; height: 13px; margin-right: 5px; vertical-align: -2px; color: var(--ub-s2); }
.ub-req-id { display: block; margin-top: 1px; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 11px; color: var(--ub-faint); }
.ub-sort {
  display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none;
  font: inherit; font-size: 11.5px; font-weight: 500; color: var(--ub-muted); cursor: pointer;
}
.ub-sort.is-on { color: var(--ub-ink); }
@media (hover: hover) and (pointer: fine) { .ub-sort:hover { color: var(--ub-ink); } }
.ub-sort:focus-visible { outline: 2px solid var(--ub-accent); outline-offset: 2px; border-radius: 3px; }
.ub-sort-ind { font-size: 10px; opacity: 0.8; }
.ub-pager { display: flex; align-items: center; gap: 6px; padding-top: 12px; font-size: 12.5px; color: var(--ub-muted); font-variant-numeric: tabular-nums; }
.ub-pager .ub-btn { width: 32px; padding: 0; }
.ub-pager-page { padding: 0 4px; }

/* Latency, limits */
.ub-bench-cell { white-space: nowrap; }
.ub-bench-form { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px; }
.ub-bench-form input {
  width: 66px; height: 26px; padding: 0 6px; border: 1px solid var(--ub-line-strong); border-radius: 6px;
  background: var(--ub-surface); color: var(--ub-ink); font: inherit; font-size: 12px; text-align: right;
}
.ub-bench-form input:focus { outline: none; border-color: var(--ub-accent); box-shadow: 0 0 0 3px var(--ub-accent-ring); }
.ub-form-error { flex-basis: 100%; font-size: 11.5px; text-align: right; color: var(--ub-bad-ink); white-space: normal; }
.ub-limit-use { min-width: 170px; }
.ub-limit-use { display: flex; align-items: center; gap: 8px; }
.ub-limit-use .ub-meter { flex: 1; }
.ub-limit-use .ub-tone { font-size: 12px; min-width: 64px; }
.ub-table.is-limits td { vertical-align: middle; }
.ub-table.is-limits .ub-cell-sub { max-width: 52ch; }

.ub-reg { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ub-reg-item { padding: 10px 12px; border: 1px solid var(--ub-bad-line); border-radius: 10px; }
.ub-reg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ub-reg-detail { margin: 4px 0 8px; font-size: 12px; color: var(--ub-muted); }
.ub-reg-item .ub-spark { margin-bottom: 6px; width: 100%; }
.ub-rank { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ub-rank ul { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; font-size: 12px; }
.ub-rank li { display: flex; justify-content: space-between; gap: 8px; }
.ub-rank li .ub-cell-btn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ub-rank-title { margin: 0; font-size: 11.5px; color: var(--ub-muted); }
.ub-rank-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; }
.ub-rank-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 6px; }
.ub-rank-list strong { font-variant-numeric: tabular-nums; }
.ub-rank-list .ub-muted { font-size: 11.5px; }
.ub-rush { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 12px; }
.ub-rush li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ub-rush svg { width: 14px; height: 14px; color: var(--ub-warn); }

/* ── Sheets: a request, a tool, the data sources ── */
.ub-drawer-root { position: fixed; inset: 0; z-index: 2500; font-size: 13px; line-height: 1.45; color: var(--ub-ink); font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; }
.ub-scrim { position: absolute; inset: 0; background: var(--ub-scrim); opacity: 0; transition: opacity 200ms ease; }
.ub-drawer {
  position: absolute; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; width: min(620px, 100%);
  border-left: 1px solid var(--ub-line); background: var(--ub-surface); box-shadow: var(--ub-shadow-drawer); outline: none;
  opacity: 0; transform: translateX(24px);
  transition: transform 240ms cubic-bezier(0.32, 0.72, 0, 1), opacity 200ms ease;
}
.ub-drawer.is-wide { width: min(760px, 100%); }
.ub-drawer-root.is-open .ub-scrim { opacity: 1; }
.ub-drawer-root.is-open .ub-drawer { opacity: 1; transform: none; }
.ub-drawer-root.is-closing .ub-drawer, .ub-drawer-root.is-closing .ub-scrim { transition-duration: 160ms; }
.ub-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--ub-line); }
.ub-drawer-titles { min-width: 0; }
.ub-eyebrow { margin: 0 0 4px; font-size: 11.5px; font-weight: 500; color: var(--ub-muted); }
.ub-drawer-title { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.35; color: var(--ub-ink); overflow-wrap: anywhere; }
.ub-drawer-meta { margin: 6px 0 0; font-size: 12px; color: var(--ub-muted); }
.ub-drawer-body { display: flex; flex: 1; flex-direction: column; gap: 18px; padding: 16px 20px 24px; overflow-y: auto; overscroll-behavior: contain; }
.ub-drawer-lead { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--ub-ink-2); }
.ub-drawer-section h3 { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; color: var(--ub-ink); }
.ub-drawer-section .ub-foot-note { margin: -4px 0 10px; }
.ub-drawer-body .ub-table-wrap { margin: 0 -20px; }
.ub-drawer-body .ub-table th:first-child, .ub-drawer-body .ub-table td:first-child { padding-left: 20px; }
.ub-drawer-body .ub-table th:last-child, .ub-drawer-body .ub-table td:last-child { padding-right: 20px; }
.ub-drawer-foot { display: flex; gap: 8px; padding-top: 4px; }
.ub-table.is-sources td { vertical-align: top; line-height: 1.5; font-size: 12px; color: var(--ub-ink-2); }
.ub-table.is-sources td strong { color: var(--ub-ink); font-weight: 600; }

.ub-outcome { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--ub-fill); }
.ub-outcome p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ub-ink-2); }
.ub-outcome.is-ok { background: var(--ub-ok-soft); }
.ub-outcome.is-warn, .ub-outcome.is-serious { background: var(--ub-warn-soft); }
.ub-outcome.is-bad, .ub-outcome.is-bad-deep { background: var(--ub-bad-soft); }

.ub-mini-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ub-mini-kpis > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; border: 1px solid var(--ub-line); border-radius: 10px; }
.ub-mini-kpis span { font-size: 11.5px; color: var(--ub-muted); }
.ub-mini-kpis strong { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.ub-mini-kpis small { font-size: 11px; color: var(--ub-muted); }

.ub-waterfall { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.ub-wf-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.35fr) 64px; align-items: center; gap: 10px; min-height: 26px; font-size: 12px; }
.ub-wf-label { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; white-space: nowrap; color: var(--ub-ink-2); }
.ub-wf-label svg { width: 13px; height: 13px; flex: none; }
.ub-wf-label .ub-status { margin-left: 4px; }
.ub-wf-row.is-step .ub-wf-label { padding-left: 18px; color: var(--ub-muted); }
.ub-wf-track { position: relative; height: 10px; border-radius: 3px; background: var(--ub-fill); }
.ub-wf-bar { position: absolute; top: 0; bottom: 0; min-width: 2px; border-radius: 3px; background: var(--ub-s1); }
.ub-wf-row.is-tool .ub-wf-bar { background: var(--ub-s3); }
.ub-wf-row.is-voice .ub-wf-bar { background: var(--ub-s2); }
.ub-wf-row.is-run .ub-wf-bar { background: var(--ub-s4); }
.ub-wf-row.is-step .ub-wf-bar { background: var(--ub-s4); opacity: 0.55; }
.ub-wf-row.is-failed .ub-wf-bar, .ub-wf-row.is-step.is-failed .ub-wf-bar, .ub-wf-row.is-limit .ub-wf-bar { background: var(--ub-bad); opacity: 1; }
.ub-wf-row.is-step.is-stopped .ub-wf-bar { background: var(--ub-warn); opacity: 1; }
.ub-wf-time { font-variant-numeric: tabular-nums; text-align: right; color: var(--ub-muted); }

@media (prefers-reduced-motion: reduce) {
  .ub-skel { animation: none; }
  .ub-drawer { transform: none; transition: opacity 160ms ease; }
}

/* ── By the page's own width ── */
@container ub (max-width: 1180px) {
  .ub-kpis.is-6 { --cols: 3; }
}
@container ub (max-width: 1120px) {
  .ub-span-4, .ub-span-5, .ub-span-7, .ub-span-8 { grid-column: span 12; }
}
@container ub (max-width: 820px) {
  .ub-kpis { --cols: 2; }
  .ub-kpis.is-6 { --cols: 3; }
  .ub-span-6 { grid-column: span 12; }
  .ub-col-user, .ub-col-type { display: none; }
  .ub-table.is-history .ub-req-cell { width: 46%; }
  .ub-period { flex-basis: 100%; }
}
@container ub (max-width: 560px) {
  .ub-kpis, .ub-kpis.is-6 { --cols: 2; gap: 8px; }
  .ub-kpi-value { font-size: 20px; }
  .ub-kpi-spark { display: none; }
  .ub-facts.is-grid { grid-template-columns: 1fr 1fr; }
  .ub-rank { grid-template-columns: 1fr; }
  .ub-filters .ub-grow { display: none; }
  .ub-search { max-width: none; flex-basis: 100%; }
}
@media (max-width: 640px) {
  .ub-title { font-size: 20px; }
  .ub-head-actions { width: 100%; justify-content: space-between; }
  .ub-card { padding: 12px 12px 14px; }
  .ub-table-wrap { margin: 0 -12px; }
  .ub-table th:first-child, .ub-table td:first-child { padding-left: 12px; }
  .ub-table th:last-child, .ub-table td:last-child { padding-right: 12px; }
  .ub-mini-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ub-drawer-head { padding: 16px 16px 12px; }
  .ub-drawer-body { padding: 14px 16px 20px; }
  .ub-wf-row { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 56px; }
}
