/* The web app's look (frontend/src/app/globals.css tokens), light and dark. */
:root {
  color-scheme: light dark;
  --background: #fbfbfd;
  --foreground: #1a1c24;
  --raised: #f4f5f9;
  --surface: #eceef5;
  --line: #e1e4ec;
  --muted: #5b6072;
  --accent: #2b3a8c;
  --accent-soft: #e6e9f8;
  --danger: #b42318;
  --success: #15803d;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #12141c;
    --foreground: #e8e9f0;
    --raised: #171a24;
    --surface: #1f2331;
    --line: #2a2e3d;
    --muted: #9da1b3;
    --accent: #a3aef5;
    --accent-soft: #252b4d;
    --danger: #f97066;
    --success: #4ade80;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
main {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (min-width: 640px) { main { padding-inline: 24px; } }
h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
p { margin: 0; }
.intro { display: flex; flex-direction: column; gap: 4px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.danger { color: var(--danger); }
.stack { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
svg { flex-shrink: 0; }

.card { border: 1px solid var(--line); border-radius: 16px; background: var(--raised); padding: 12px 16px; }
.empty { padding: 24px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.button {
  display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 12px;
  border: 0; border-radius: 999px; background: transparent; color: var(--accent);
  font: inherit; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--surface); }
.button.outlined { padding: 0 16px; color: var(--foreground); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.link { color: var(--accent); }

.runs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin-bottom: 8px; }
.title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.title strong { font-weight: 600; }
.pill { border-radius: 999px; padding: 2px 8px; background: var(--surface); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.pill.running { background: var(--accent-soft); color: var(--accent); }
.pill.ok { color: var(--success); }
.pill.error { color: var(--danger); }
.user { font-size: 12px; color: var(--muted); font-family: ui-monospace, "Cascadia Code", Consolas, monospace; overflow-wrap: anywhere; }
.segmented { display: inline-flex; align-self: flex-start; gap: 2px; padding: 2px; border-radius: 999px; background: var(--surface); }
.segment {
  height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.segment[aria-pressed="true"] { background: var(--background); color: var(--foreground); box-shadow: 0 1px 2px rgb(0 0 0 / 0.12); }
.actions { display: flex; flex-wrap: wrap; margin-right: -8px; }

.grid { display: grid; grid-template-columns: minmax(7rem, 38%) 1fr; align-items: center; }
.axis { font-size: 12px; color: var(--muted); }
.ticks { display: flex; justify-content: space-between; border-left: 1px solid var(--line); padding-left: 4px; font-variant-numeric: tabular-nums; }
.rows { list-style: none; margin: 0; padding: 0; }
.row { min-height: 32px; font-size: 13px; }
.name { display: flex; align-items: center; gap: 4px; min-width: 0; padding-right: 8px; }
.name span, .fold span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name .kind { flex-shrink: 0; color: var(--danger); overflow: visible; }
.fold {
  display: flex; align-items: center; gap: 4px; min-width: 0; min-height: 32px; margin-left: -4px; padding: 0 4px;
  border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: inherit; text-align: left; cursor: pointer;
}
.fold:hover { background: var(--surface); color: var(--foreground); }
.lane { position: relative; height: 32px; border-left: 1px solid var(--line); }
.bar { position: absolute; top: 10px; height: 12px; border-radius: 3px; }
.bar.running, .swatch.running { background: var(--accent); }
.bar.ok, .swatch.ok { background: var(--success); }
.bar.error, .swatch.error { background: var(--danger); }
.bar.folded { opacity: 0.6; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; font-size: 12px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
