/* AI Factory Console
 * Design tokens follow the validated data-viz reference palette (neutral chrome,
 * fixed status palette, blue as the single accent/sequential hue). Dark mode is
 * its own set of selected steps, applied for the OS setting and the theme toggle. */

:root {
  color-scheme: light;
  --page: #f5f5f2;
  --surface: #fcfcfb;
  --surface-2: #f3f2ef;
  --surface-3: #eae9e4;
  --raised: #ffffff;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-3: #6b6a65;
  --axis: #898781;
  --line: #e4e3dc;
  --line-2: #d4d3cb;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;

  --accent: #2a78d6;
  --accent-hover: #256abf;
  --accent-ink: #1c5cab;
  --accent-soft: rgba(42, 120, 214, 0.1);
  --on-accent: #ffffff;

  --good: #0ca30c;
  --good-ink: #006300;
  --good-soft: rgba(12, 163, 12, 0.1);
  --warning: #fab219;
  --warning-ink: #7a5200;
  --warning-soft: rgba(250, 178, 25, 0.16);
  --critical: #d03b3b;
  --critical-ink: #a72b2b;
  --critical-soft: rgba(208, 59, 59, 0.1);
  --running: #2a78d6;
  --running-ink: #1c5cab;
  --running-soft: rgba(42, 120, 214, 0.1);
  --info: #4a3aa7;
  --info-ink: #4a3aa7;
  --info-soft: rgba(74, 58, 167, 0.09);
  --neutral: #898781;
  --neutral-ink: #52514e;
  --neutral-soft: rgba(11, 11, 11, 0.05);

  --series-success: #0ca30c;
  --series-failure: #d03b3b;
  --series-interrupted: #fab219;
  --series-running: #a8a69e;
  --bar: #2a78d6;

  --shadow-1: 0 1px 2px rgba(11, 11, 11, 0.04), 0 1px 1px rgba(11, 11, 11, 0.02);
  --shadow-2: 0 18px 40px -16px rgba(11, 11, 11, 0.28), 0 3px 10px rgba(11, 11, 11, 0.06);
  --focus: 0 0 0 3px rgba(42, 120, 214, 0.35);
  --glass: rgba(245, 245, 242, 0.82);

  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --sidebar: 248px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", "JetBrains Mono", "Fira Code", Menlo,
    Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232322;
    --surface-3: #2c2c2a;
    --raised: #20201f;
    --ink: #f5f5f3;
    --ink-2: #c3c2b7;
    --ink-3: #a09f96;
    --axis: #898781;
    --line: #2c2c2a;
    --line-2: #3a3a37;
    --grid: #2c2c2a;
    --baseline: #45453f;
    --accent: #3987e5;
    --accent-hover: #5598e7;
    --accent-ink: #86b6ef;
    --accent-soft: rgba(57, 135, 229, 0.16);
    --good-ink: #2fc52f;
    --good-soft: rgba(12, 163, 12, 0.16);
    --warning-ink: #fab219;
    --warning-soft: rgba(250, 178, 25, 0.14);
    --critical-ink: #f07a7a;
    --critical-soft: rgba(208, 59, 59, 0.18);
    --running: #3987e5;
    --running-ink: #86b6ef;
    --running-soft: rgba(57, 135, 229, 0.16);
    --info: #9085e9;
    --info-ink: #aaa1f0;
    --info-soft: rgba(144, 133, 233, 0.16);
    --neutral-ink: #c3c2b7;
    --neutral-soft: rgba(255, 255, 255, 0.06);
    --series-running: #6b6a65;
    --bar: #3987e5;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 18px 40px -16px rgba(0, 0, 0, 0.7), 0 3px 10px rgba(0, 0, 0, 0.3);
    --focus: 0 0 0 3px rgba(57, 135, 229, 0.45);
    --glass: rgba(13, 13, 13, 0.8);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232322;
  --surface-3: #2c2c2a;
  --raised: #20201f;
  --ink: #f5f5f3;
  --ink-2: #c3c2b7;
  --ink-3: #a09f96;
  --axis: #898781;
  --line: #2c2c2a;
  --line-2: #3a3a37;
  --grid: #2c2c2a;
  --baseline: #45453f;
  --accent: #3987e5;
  --accent-hover: #5598e7;
  --accent-ink: #86b6ef;
  --accent-soft: rgba(57, 135, 229, 0.16);
  --good-ink: #2fc52f;
  --good-soft: rgba(12, 163, 12, 0.16);
  --warning-ink: #fab219;
  --warning-soft: rgba(250, 178, 25, 0.14);
  --critical-ink: #f07a7a;
  --critical-soft: rgba(208, 59, 59, 0.18);
  --running: #3987e5;
  --running-ink: #86b6ef;
  --running-soft: rgba(57, 135, 229, 0.16);
  --info: #9085e9;
  --info-ink: #aaa1f0;
  --info-soft: rgba(144, 133, 233, 0.16);
  --neutral-ink: #c3c2b7;
  --neutral-soft: rgba(255, 255, 255, 0.06);
  --series-running: #6b6a65;
  --bar: #3987e5;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 18px 40px -16px rgba(0, 0, 0, 0.7), 0 3px 10px rgba(0, 0, 0, 0.3);
  --focus: 0 0 0 3px rgba(57, 135, 229, 0.45);
  --glass: rgba(13, 13, 13, 0.8);
}

/* ---------------------------------------------------------------- base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-ink);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

code,
pre,
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}

code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--radius-xs);
}

[hidden] {
  display: none !important;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  vertical-align: -3px;
}

.muted {
  color: var(--ink-3);
}

.small {
  font-size: 12.5px;
}

.nowrap {
  white-space: nowrap;
}

.truncate {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 50;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
}

.skip-link:focus {
  top: 12px;
}

.eyebrow,
.section-label {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.section-label {
  margin-bottom: 10px;
}

/* ---------------------------------------------------------------- tones */

.tone-good {
  --tone: var(--good);
  --tone-ink: var(--good-ink);
  --tone-soft: var(--good-soft);
}

.tone-critical {
  --tone: var(--critical);
  --tone-ink: var(--critical-ink);
  --tone-soft: var(--critical-soft);
}

.tone-warning {
  --tone: var(--warning);
  --tone-ink: var(--warning-ink);
  --tone-soft: var(--warning-soft);
}

.tone-running {
  --tone: var(--running);
  --tone-ink: var(--running-ink);
  --tone-soft: var(--running-soft);
}

.tone-info {
  --tone: var(--info);
  --tone-ink: var(--info-ink);
  --tone-soft: var(--info-soft);
}

.tone-neutral {
  --tone: var(--neutral);
  --tone-ink: var(--neutral-ink);
  --tone-soft: var(--neutral-soft);
}

/* ---------------------------------------------------------------- layout */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  padding: 18px 12px 14px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 6px;
  color: var(--ink);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  box-shadow: 0 6px 14px -6px rgba(42, 120, 214, 0.6);
}

.brand-mark.large {
  width: 48px;
  height: 48px;
  border-radius: 13px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-text small {
  color: var(--ink-3);
  font-size: 12px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-weight: 520;
}

.nav-item .icon {
  color: var(--ink-3);
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
}

.nav-item.is-active {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 620;
}

.nav-item.is-active .icon {
  color: var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.sidebar-meta {
  padding: 0 10px;
  color: var(--ink-3);
  font-size: 11.5px;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 10px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
}

.topbar-heading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
}

.page-title {
  overflow: hidden;
  font-size: 19px;
  font-weight: 680;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: var(--ink-3);
  font-size: 12.5px;
}

.breadcrumbs .icon {
  width: 14px;
  height: 14px;
}

.breadcrumbs a {
  color: var(--ink-3);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-form {
  display: contents;
}

.topbar .nav-toggle {
  display: none;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 1360px;
  padding: 26px 28px 56px;
  transition: opacity 0.2s ease;
}

.content.is-refreshing {
  opacity: 0.86;
}

.page-intro {
  max-width: 76ch;
  color: var(--ink-2);
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-main-side {
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 28px;
}

/* ---------------------------------------------------------------- buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--raised);
  color: var(--ink);
  font: inherit;
  font-weight: 560;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.button .icon {
  width: 16px;
  height: 16px;
}

.button:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.button:active {
  transform: translateY(1px);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.button-primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 1px 2px rgba(11, 11, 11, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.button-primary:hover {
  background: var(--accent-hover);
}

.button-primary:disabled:hover {
  background: var(--accent);
}

.button-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
  box-shadow: none;
}

.button-ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.button-small {
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.button-large {
  width: 100%;
  height: 46px;
  font-size: 15px;
  border-radius: 10px;
}

.button.danger {
  color: var(--critical-ink);
}

.button.is-on {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}

.icon-button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.link-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.link-button .icon {
  width: 15px;
  height: 15px;
}

.theme-icon {
  display: none;
}

:root:not([data-theme]) .theme-system,
:root[data-theme="light"] .theme-light,
:root[data-theme="dark"] .theme-dark {
  display: block;
}

/* ---------------------------------------------------------------- status */

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.status-chip:hover {
  text-decoration: none;
  background: var(--surface-2);
}

.status-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone);
}

.status-chip[data-state="running"] .status-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--tone);
  opacity: 0;
  animation: ping 1.8s ease-out infinite;
}

.status-chip-extra {
  color: var(--ink-3);
  font-weight: 500;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px 0 7px;
  border-radius: 999px;
  background: var(--tone-soft);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 580;
  white-space: nowrap;
}

.pill-icon {
  width: 15px;
  height: 15px;
  color: var(--tone);
}

.pill.tone-warning .pill-icon {
  color: var(--warning-ink);
}

.pill-large {
  height: 30px;
  padding: 0 13px 0 9px;
  font-size: 13.5px;
}

.pill-large .pill-icon {
  width: 18px;
  height: 18px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 520;
  white-space: nowrap;
}

.tag .icon {
  width: 13px;
  height: 13px;
}

.tag[class*="tone-"] {
  border-color: transparent;
  background: var(--tone-soft);
  color: var(--ink);
}

.tag[class*="tone-"] .icon {
  color: var(--tone-ink);
}

.spin {
  animation: spin 1s linear infinite;
  transform-origin: 50% 50%;
}

/* ---------------------------------------------------------------- cards */

.card {
  min-width: 0;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.card.flush {
  padding: 0;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.card-header.padded {
  margin: 0;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.card-title .icon {
  color: var(--ink-3);
}

.card-subtitle {
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 28px;
  padding: 24px 26px;
  background:
    radial-gradient(120% 140% at 0% 0%, var(--tone-soft) 0%, transparent 55%),
    var(--surface);
}

.hero-main {
  display: flex;
  gap: 18px;
  min-width: 0;
}

.hero-badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: var(--tone-soft);
  color: var(--tone);
}

.hero-badge .icon {
  width: 26px;
  height: 26px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.hero-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-text {
  color: var(--ink-2);
  max-width: 62ch;
}

.hero-actions {
  margin-top: 6px;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.hero-fact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 4px 12px 4px 6px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--raised);
  color: var(--ink-2);
  font-size: 13px;
}

a.hero-fact:hover {
  border-color: var(--line-2);
  color: var(--ink);
  text-decoration: none;
}

.hero-fact .fact-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-3);
}

.hero-fact .fact-icon .icon {
  width: 14px;
  height: 14px;
}

.hero-fact strong {
  color: var(--ink);
  font-weight: 620;
}

.hero-side {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  color: var(--ink-3);
  font-size: 12.5px;
}

.hero-meta .icon {
  width: 15px;
  height: 15px;
}

.current-runs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.current-run {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raised);
  color: var(--ink);
}

.current-run:hover {
  border-color: var(--line-2);
  text-decoration: none;
}

.current-run-repo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-3);
  white-space: nowrap;
}

.current-run-repo .icon,
.current-run-arrow {
  width: 15px;
  height: 15px;
}

.current-run-arrow {
  margin-left: auto;
  color: var(--ink-3);
}

.schedule {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.schedule li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px dashed transparent;
}

.schedule li + li {
  border-top: 1px solid var(--line);
}

.schedule-time {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.schedule-name {
  overflow: hidden;
  color: var(--ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-rel {
  color: var(--ink-3);
  font-size: 12.5px;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- KPIs */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.kpi-label {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 560;
}

.kpi-value {
  font-size: 30px;
  font-weight: 680;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.kpi-delta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 560;
}

.kpi-delta .icon {
  width: 14px;
  height: 14px;
}

.sentiment-good {
  color: var(--good-ink);
}

.sentiment-bad {
  color: var(--critical-ink);
}

.sentiment-neutral {
  color: var(--ink-3);
}

.kpi-hint {
  color: var(--ink-3);
  font-size: 12px;
}

/* ---------------------------------------------------------------- chart */

.chart {
  position: relative;
  margin: 0;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 12.5px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-icon {
  width: 14px;
  height: 14px;
  color: var(--ink-3);
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.chart-frame {
  position: relative;
  display: flex;
}

.chart-axis {
  flex: none;
  overflow: visible;
}

.chart-plot {
  flex: 1;
  min-width: 0;
  overflow: visible;
}

.chart-axis text,
.chart-tick {
  fill: var(--axis);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.chart-tick.is-today {
  fill: var(--ink);
  font-weight: 650;
}

.chart-grid,
.chart-baseline {
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.chart-grid {
  stroke: var(--grid);
}

.chart-baseline {
  stroke: var(--baseline);
}

.chart-hit {
  fill: transparent;
  pointer-events: all;
}

.chart-column {
  outline: none;
  cursor: default;
}

.chart-column:hover .chart-hit,
.chart-column:focus-visible .chart-hit {
  fill: var(--surface-2);
}

.chart-column:focus-visible .chart-hit {
  stroke: var(--accent);
  stroke-width: 1;
}

.series-success {
  fill: var(--series-success);
  background: var(--series-success);
}

.series-failure {
  fill: var(--series-failure);
  background: var(--series-failure);
}

.series-interrupted {
  fill: var(--series-interrupted);
  background: var(--series-interrupted);
}

.series-running {
  fill: var(--series-running);
  background: var(--series-running);
}

.chart-empty {
  position: absolute;
  inset: 0 0 34px 34px;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  font-size: 13px;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 150px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--raised);
  box-shadow: var(--shadow-2);
  pointer-events: none;
  font-size: 12.5px;
}

.tooltip-title {
  margin-bottom: 5px;
  color: var(--ink-2);
  font-weight: 600;
}

.tooltip-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.tooltip-key {
  width: 12px;
  height: 2px;
  border-radius: 1px;
}

.tooltip-row strong {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.tooltip-label {
  color: var(--ink-3);
}

.table-view {
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 12.5px;
}

.table-view summary,
.help summary {
  width: max-content;
  color: var(--ink-3);
  cursor: pointer;
}

.table-view[open] summary {
  margin-bottom: 8px;
}

.duration-bar {
  display: block;
}

.duration-track {
  fill: var(--surface-3);
}

.duration-fill {
  fill: var(--bar);
}

/* ---------------------------------------------------------------- tables */

.table-wrap {
  position: relative; /* contains the visually hidden labels, so they cannot widen the page */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table.compact {
  min-width: 420px;
}

.table th {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table tbody tr:last-child td,
.table tbody tr:last-child th {
  border-bottom: 0;
}

.table tbody th {
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-weight: 560;
}

.table.compact td,
.table.compact th {
  padding: 7px 12px;
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.card:not(.flush) .table th:first-child,
.card:not(.flush) .table td:first-child {
  padding-left: 0;
}

.card:not(.flush) .table th:last-child,
.card:not(.flush) .table td:last-child {
  padding-right: 0;
}

.row-link {
  cursor: pointer;
  transition: background 0.12s ease;
}

.row-link:hover {
  background: var(--surface-2);
}

.cell-main {
  min-width: 0;
  max-width: 420px;
}

.cell-main,
.row-anchor {
  color: var(--ink);
  font-weight: 560;
  overflow-wrap: break-word;
}

.row-anchor:hover {
  color: var(--accent-ink);
}

.cell-sub,
.cell-sub-only {
  display: block;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 450;
}

.cell-sub-only {
  display: table-cell;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.repo-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 12px;
  white-space: nowrap;
}

.repo-state.has-work {
  background: var(--good-soft);
  color: var(--ink);
}

.repo-state.has-problem {
  background: var(--warning-soft);
  color: var(--ink);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}

.filter-count {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 13px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.pagination-info {
  color: var(--ink-3);
  font-size: 13px;
}

/* ---------------------------------------------------------------- lists */

.queue-list,
.event-list,
.issue-list,
.branch-list,
.credential-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.queue-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.queue-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.queue-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-weight: 620;
}

.queue-name .icon {
  width: 16px;
  height: 16px;
  color: var(--ink-3);
}

.count {
  color: var(--ink-3);
  font-size: 12.5px;
  white-space: nowrap;
}

.queue-next {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
}

.queue-next .icon {
  width: 15px;
  height: 15px;
}

.event {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 -10px;
  padding: 10px;
  border-radius: var(--radius);
  color: var(--ink);
}

.event:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.event-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.event-title {
  overflow: hidden;
  font-weight: 580;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-sub {
  overflow: hidden;
  color: var(--ink-3);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-status {
  flex: none;
  min-width: 118px;
}

.event-arrow {
  width: 16px;
  height: 16px;
  color: var(--ink-3);
}

.issue,
.branch,
.credential {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.issue:first-child,
.branch:first-child,
.credential:first-child {
  border-top: 0;
}

.issue.is-muted .issue-title {
  color: var(--ink-3);
}

.issue .pill {
  flex: none;
  min-width: 112px;
}

.issue-main,
.branch-main,
.credential-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.issue-title,
.credential-name {
  font-weight: 580;
  overflow-wrap: anywhere;
}

.issue-sub,
.branch-sub,
.credential-sub {
  color: var(--ink-3);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.branch-name {
  overflow-wrap: anywhere;
}

.branch-icon,
.credential-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--tone-soft, var(--surface-2));
  color: var(--tone, var(--ink-2));
}

.branch-icon .icon,
.credential-icon .icon {
  width: 16px;
  height: 16px;
}

.summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  min-width: 140px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.summary-value {
  font-size: 24px;
  font-weight: 680;
}

.summary-label {
  color: var(--ink-3);
  font-size: 12.5px;
}

/* ledger: intro with a link, reset state, removed entries */

.page-lead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
}

.cell-actions {
  white-space: nowrap;
}

.reset-failure {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  max-width: 300px;
  margin-right: 10px;
  vertical-align: middle;
  overflow-wrap: anywhere; /* error messages carry file paths without spaces */
  white-space: normal;
  text-align: right;
}

.reset-target {
  overflow-wrap: anywhere;
}

.reason {
  max-width: 420px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px 22px;
  margin: 0;
}

.meta-grid dt {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 560;
}

.meta-grid dd {
  margin: 1px 0 0;
  overflow-wrap: anywhere;
}

.meta-grid .wide {
  grid-column: 1 / -1;
}

.repo-card .meta-grid {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

/* ---------------------------------------------------------------- run detail */

.run-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.run-header-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.run-header-main > .pill {
  align-self: flex-start;
}

.run-issue {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ink-2);
}

.run-issue .icon {
  width: 16px;
  height: 16px;
  color: var(--ink-3);
}

.timeline {
  margin: 0;
  padding: 8px 22px 18px;
  list-style: none;
}

.phase {
  position: relative;
  padding: 14px 0 6px 38px;
}

.phase::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 40px;
  bottom: -14px;
  width: 2px;
  border-radius: 1px;
  background: var(--line);
}

.phase:last-child::before {
  display: none;
}

.phase-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 26px;
}

.phase-marker {
  position: absolute;
  left: 0;
  top: 15px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--tone-soft);
  color: var(--tone-ink);
}

.phase-marker .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.6;
}

.phase-title {
  font-size: 14.5px;
  font-weight: 650;
}

.phase-meta {
  color: var(--ink-3);
  font-size: 12.5px;
}

.steps {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raised);
  overflow: hidden;
}

.step + .step {
  border-top: 1px solid var(--line);
}

.step-summary {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) minmax(80px, 180px) 76px 16px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}

.step-summary::-webkit-details-marker {
  display: none;
}

.step-summary:hover {
  background: var(--surface-2);
}

.step-status .icon {
  width: 18px;
  height: 18px;
  color: var(--tone);
}

.step-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  min-width: 0;
}

.step-name .mono {
  overflow-wrap: anywhere;
}

.step-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.step-duration {
  color: var(--ink-2);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.step-chevron {
  width: 16px;
  height: 16px;
  color: var(--ink-3);
  transition: transform 0.15s ease;
}

.step-details[open] .step-chevron {
  transform: rotate(180deg);
}

.step-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 14px 16px 46px;
}

.output-label {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 620;
}

.output {
  max-height: 420px;
  margin: 0;
  padding: 12px 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.output.tone-critical {
  border-color: transparent;
  background: var(--critical-soft);
}

/* ---------------------------------------------------------------- logs */

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.tab {
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--ink-2);
  font-weight: 560;
  white-space: nowrap;
}

.tab:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.tab.is-active {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.log-card {
  display: flex;
  flex-direction: column;
}

.log-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.log-path {
  flex: 1;
  min-width: 160px;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field .icon {
  position: absolute;
  left: 9px;
  width: 15px;
  height: 15px;
  color: var(--ink-3);
  pointer-events: none;
}

.search-field .input {
  padding-left: 30px;
}

.log-view {
  max-height: 560px;
  overflow: auto;
  padding: 8px 0;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
}

.log-view.tall {
  height: calc(100vh - 260px);
  min-height: 320px;
  max-height: none;
}

.log-line {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  padding: 0 14px 0 0;
}

.log-no {
  padding-right: 12px;
  color: var(--axis);
  text-align: right;
  user-select: none;
  font-variant-numeric: tabular-nums;
}

.log-text {
  white-space: pre;
}

.log-view.wrap .log-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.level-info .log-text {
  color: var(--ink-2);
}

.level-runner .log-text {
  color: var(--ink);
}

.level-marker {
  margin-top: 6px;
  background: var(--accent-soft);
}

.level-marker .log-text {
  color: var(--accent-ink);
  font-weight: 650;
}

.level-warn {
  background: var(--warning-soft);
}

.level-error {
  background: var(--critical-soft);
}

.level-error .log-text {
  color: var(--critical-ink);
}

.log-status {
  padding: 8px 14px;
  border-top: 1px solid var(--line);
}

.log-placeholder {
  padding: 16px;
}

/* ---------------------------------------------------------------- forms */

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field.inline {
  min-width: 180px;
}

.field.grow {
  flex: 1;
}

.field-label {
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
}

.field-hint {
  color: var(--ink-3);
  font-size: 12px;
}

.input,
.select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--raised);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder {
  color: var(--axis);
}

.textarea {
  height: auto;
  min-height: 84px;
  padding: 10px 12px;
  line-height: 1.45;
  resize: vertical;
}

.input:focus,
.select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: var(--focus);
}

.input.mono {
  letter-spacing: 0.04em;
}

.input-small {
  height: 30px;
  font-size: 13px;
}

.select {
  padding-right: 34px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23898781' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 10px center;
  background-repeat: no-repeat;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  color: var(--ink-2);
  cursor: pointer;
}

.toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.form.narrow {
  max-width: 440px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.card > .notice,
.card > .form-error {
  margin-bottom: 16px;
}

.card > .form-actions + .form-error {
  margin: 16px 0 0;
}

.help.option .form {
  margin-top: 14px;
}

.session-device .truncate {
  display: block;
  max-width: min(380px, 40vw);
}

.sign-in-method .icon {
  width: 14px;
  height: 14px;
  margin-right: 2px;
  color: var(--ink-3);
}

.inline-add {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.form-error {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--critical-soft);
  color: var(--critical-ink);
  font-size: 13px;
}

.help {
  color: var(--ink-2);
  font-size: 13px;
}

.help p {
  margin-top: 8px;
}

/* ---------------------------------------------------------------- notices, empty states */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius);
  background: var(--tone-soft);
  color: var(--ink);
  font-size: 13.5px;
}

.notice .icon {
  margin-top: 1px;
  color: var(--tone-ink);
}

.notice p {
  overflow-wrap: anywhere;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 36px 20px;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 6px;
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--ink-3);
}

.empty-title {
  font-weight: 620;
}

.empty-text {
  max-width: 44ch;
  color: var(--ink-3);
  font-size: 13px;
}

/* ---------------------------------------------------------------- dialog and toasts */

.dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--raised);
  color: var(--ink);
  box-shadow: var(--shadow-2);
}

.dialog::backdrop {
  background: rgba(11, 11, 11, 0.42);
  backdrop-filter: blur(3px);
}

.dialog-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px;
}

.dialog-body h2 {
  font-size: 18px;
  font-weight: 680;
}

.dialog-body p {
  color: var(--ink-2);
}

.dialog-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--tone-soft);
  color: var(--tone);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 40px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--raised);
  box-shadow: var(--shadow-2);
  animation: toast-in 0.2s ease-out;
}

.toast .icon {
  color: var(--tone);
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* ---------------------------------------------------------------- auth pages */

.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 15% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(700px 500px at 110% 110%, var(--info-soft), transparent 60%),
    var(--page);
}

.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 100vh;
  padding: 32px 16px;
}

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(420px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-2);
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 4px;
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-text {
  color: var(--ink-2);
}

.auth-text a .icon {
  width: 15px;
  height: 15px;
  margin-right: 2px;
}

.auth-actions {
  margin-top: 6px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-3);
  font-size: 12.5px;
}

.error-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.error-code {
  color: var(--accent);
  font-size: 44px;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1;
}

.card .error-page,
.content > .error-page {
  max-width: 520px;
  padding: 40px 0;
}

/* ---------------------------------------------------------------- improvements */

.retro-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
}
.retro-main {
  display: flex;
  flex: 1 1 420px;
  gap: 16px;
  min-width: 0;
}
.retro-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.retro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.finding-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.section-title {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.005em;
}
.section-help {
  margin-top: -6px;
}
.finding-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.finding {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.finding-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.finding-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 16px;
}
.finding-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  font-size: 15px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.finding-id {
  flex: none;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 560;
}
.finding-summary {
  color: var(--ink-2);
}
.finding-verdict,
.finding-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.finding-verdict .icon,
.finding-note .icon {
  flex: none;
  margin-top: 2px;
}
.finding-note {
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 13px;
}
.finding-note[class*="tone-"] {
  background: var(--tone-soft);
}
.finding-note[class*="tone-"] .icon {
  color: var(--tone-ink);
}
.finding-issue summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
}
.finding-issue[open] summary {
  margin-bottom: 8px;
}
.finding-wording {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.finding-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bundle-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  align-items: start;
}
.card-note {
  padding: 14px 22px;
}
.error-example {
  max-width: 60ch;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1180px) {
  .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-main-side {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 920px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(280px, 86vw);
    box-shadow: var(--shadow-2);
    transform: translateX(-102%);
    transition: transform 0.22s ease;
  }

  body.nav-open .sidebar {
    transform: none;
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(11, 11, 11, 0.4);
  }

  .topbar .nav-toggle {
    display: inline-grid;
  }

  .topbar {
    gap: 8px;
    padding: 10px 16px;
  }

  .content {
    padding: 18px 16px 48px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .hero-side {
    padding: 18px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .split {
    grid-template-columns: minmax(0, 1fr);
  }

  .step-summary {
    grid-template-columns: 20px minmax(0, 1fr) 70px 16px;
  }

  .step-bar {
    display: none;
  }

  .step-body {
    padding-left: 14px;
  }
}

@media (max-width: 760px) {
  .chart-tick.tick-alt {
    display: none;
  }
}

@media (max-width: 600px) {
  .status-chip-extra,
  .button-label {
    display: none;
  }

  .topbar-actions .button-primary {
    width: 36px;
    padding: 0;
  }

  .status-chip {
    padding: 0 10px;
  }

  .kpi-row {
    gap: 10px;
  }

  .kpi {
    padding: 14px;
  }

  .kpi-value {
    font-size: 24px;
  }

  .card {
    padding: 16px;
  }

  .card-header.padded {
    padding: 14px 16px 12px;
  }

  .timeline {
    padding: 4px 14px 14px;
  }

  .hero {
    padding: 18px;
  }

  .hero-main {
    gap: 14px;
  }

  .hero-badge {
    width: 42px;
    height: 42px;
  }

  .hero-title {
    font-size: 20px;
  }

  .event-status {
    min-width: 0;
  }

  .issue {
    flex-wrap: wrap;
  }

  .auth-card {
    padding: 24px 20px;
  }

  .filter-count {
    margin-left: 0;
  }

  .inline-add {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ---------------------------------------------------------------- motion */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes ping {
  0% {
    opacity: 0.7;
    transform: scale(0.6);
  }

  80%,
  100% {
    opacity: 0;
    transform: scale(1.6);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

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

@media (forced-colors: active) {
  .pill,
  .tag,
  .status-chip,
  .notice {
    border: 1px solid CanvasText;
  }
}
