/* emit cloud — "Spectral", as the design boards have it (Foundations). emit is an emission
   spectrum: a dark ground, thin lines of colour, one sodium accent. Status is never colour alone:
   a 3px line and a word. Regions are separated by rules, not boxed in cards; corners are 4px.
   Tokens live here; components read them as var(--...) from remix/ui's css() (the rmx layer).
   The fonts are linked from the document head, next to their preconnects.
   Page rules (@layer app, below) live here too, not in a stylesheet of the page's own: a <link> only
   a page's head adds is inserted by a soft navigation in the same commit as the body, and the page
   paints unstyled until it loads. This one sheet is in every document's head, loaded once. */

@layer base, rmx, app;

@layer base {
  /* Each colour is light-dark(light, dark): the preference picks, and data-theme (the gallery's previews) forces one. */
  :root {
    color-scheme: light dark;
    --bg: light-dark(#f5f3ee, #0b0c0f);
    --panel: light-dark(#ffffff, #111318);
    --rule: light-dark(#e2dfd7, #20232b);
    --rule2: light-dark(#cbc7bd, #2e323c);
    --text: light-dark(#15161a, #ece9e2);
    --muted: light-dark(#54575e, #9ea1a9);
    --faint: light-dark(#686b73, #7e828b);
    --accent: light-dark(#9a5600, #ffb454); /* dark: sodium D, 589 nm */
    --on-accent: light-dark(#ffffff, #1a1204);
    --pending: light-dark(#1f6fcc, #4c9bf0);
    --running: light-dark(#a87400, #ffb454);
    --completed: light-dark(#0b8f7a, #2fb5a0);
    --failed: light-dark(#d1243b, #ff5c64);
    --on-failed: light-dark(#ffffff, #1d0d10);
    --cancelled: light-dark(#686b73, #8a8f98);
    --strip: #07080a; /* the Line's ground: dark in both themes */
    --strip-rule: #15171c;
    --font-display: 'Funnel Display', 'Funnel Sans', system-ui, sans-serif;
    --font-body: 'Funnel Sans', system-ui, sans-serif;
    --font-mono: 'Spline Sans Mono', ui-monospace, Menlo, monospace;
    --radius: 4px;
    --gutter: 32px;
    --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  }
  :root[data-theme='light'] { color-scheme: light; }
  :root[data-theme='dark'] { color-scheme: dark; }

  @media (max-width: 720px) {
    :root {
      --gutter: 16px;
    }
  }

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

  html {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  body {
    margin: 0;
    min-height: 100vh;
  }

  h1, h2 {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0;
  }

  p {
    margin: 0;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  a:hover {
    color: var(--accent);
  }

  button, input {
    font: inherit;
    color: inherit;
    margin: 0;
  }

  button {
    cursor: pointer;
  }

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

  /* The Line: the strip is always the dark ground, whatever the theme, and it keeps the dark
     spectrum colours (the light theme's darker ones are for ink on a light ground). */
  .strip {
    --text: #ece9e2;
    --muted: #9ea1a9;
    --faint: #7e828b;
    --rule: #20232b;
    --rule2: #2e323c;
    --accent: #ffb454;
    --pending: #4c9bf0;
    --running: #ffb454;
    --completed: #2fb5a0;
    --failed: #ff5c64;
    --cancelled: #8a8f98;
    background: var(--strip);
    color: var(--text);
  }

  .line-track {
    position: absolute;
    inset: 0 auto 0 0;
    width: 200%;
    animation: line-drift 60s linear infinite;
    will-change: transform;
  }

  .line-track svg {
    display: block;
    width: 100%;
    height: 100%;
  }

  @keyframes line-drift {
    to { transform: translateX(-50%); }
  }

  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
  }

  @keyframes status-text-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.72; }
  }

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

  .pulse {
    animation: pulse 1.6s ease-in-out infinite;
  }

  .status-text-pulse {
    animation: status-text-pulse 1.6s ease-in-out infinite;
  }

  @media (prefers-reduced-motion: reduce) {
    .line-track {
      animation: none;
      will-change: auto;
    }
    .pulse, .status-text-pulse {
      animation: none;
      opacity: 1;
    }
  }
}

@layer app {
  .button-state-icon {
    opacity: 1;
    transition: opacity 160ms var(--ease-out);
    @starting-style { opacity: 0; }
  }
}

/* A sheet: a native modal <dialog> that slides in from the right edge, full height (the whole screen on a phone). A head, a
   body that scrolls, and a foot of actions that stays put; rules between them, as regions are drawn everywhere else. */
@layer app {
  .sheet { position: fixed; inset: 0 0 0 auto; width: min(480px, 100vw); height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; border-left: 1px solid var(--rule2); background: var(--bg); color: var(--text); translate: 100% 0; transition: translate 320ms var(--ease-out), overlay 320ms allow-discrete, display 320ms allow-discrete; }
  .sheet[open] { translate: 0 0; @starting-style { translate: 100% 0; } }
  .sheet::backdrop { background: rgb(0 0 0 / 0); transition: background-color 320ms var(--ease-out), overlay 320ms allow-discrete, display 320ms allow-discrete; }
  .sheet[open]::backdrop { background: rgb(0 0 0 / .55); @starting-style { background: rgb(0 0 0 / 0); } }
  .sheet-frame { height: 100%; display: flex; flex-direction: column; }
  .sheet-head { display: flex; flex-direction: column; gap: 6px; padding: 28px 28px 22px; border-bottom: 1px solid var(--rule); }
  .sheet-head h2 { font-size: 24px; overflow-wrap: anywhere; }
  .sheet-head h2:focus-visible { box-shadow: none; } /* (focused by script when the secret is shown, not a stop on the way) */
  .sheet-head p { color: var(--muted); font-size: 13px; }
  .sheet-cap, .sheet-field, .sheet-facts dt { color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
  /* A made thing is said as a status is: a 3px completed line and the words. */
  .sheet-made { display: inline-flex; align-items: center; gap: 8px; }
  .sheet-made::before { content: ""; width: 3px; height: 14px; background: var(--completed); }
  .sheet-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 22px; padding: 24px 28px; }
  .sheet-foot { display: flex; align-items: center; gap: 12px; padding: 16px 28px; border-top: 1px solid var(--rule); }
  .sheet-error { padding: 12px 14px; border: 1px solid var(--rule2); border-left: 3px solid var(--failed); border-radius: var(--radius); background: var(--panel); font-size: 13px; }
  .sheet-field { display: flex; flex-direction: column; gap: 8px; }
  .sheet-field input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--rule2); border-radius: var(--radius); background: transparent; color: var(--text); font-family: var(--font-body); font-size: 13px; letter-spacing: 0; text-transform: none; }
  .sheet-field input::placeholder { color: var(--faint); opacity: .8; }
  .sheet-field small { color: var(--faint); font-family: var(--font-body); font-size: 12px; letter-spacing: 0; text-transform: none; }
  .sheet-scopes { min-width: 0; margin: 0; padding: 0; border: 0; }
  .sheet-scopes legend { padding: 0 0 8px; }
  .sheet-scopes label { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 0; border-top: 1px solid var(--rule); cursor: pointer; }
  .sheet-scopes label:last-child { border-bottom: 1px solid var(--rule); }
  .sheet-scopes input { width: 16px; height: 16px; flex: none; accent-color: var(--accent); }
  .sheet-scopes span { display: flex; flex-direction: column; gap: 2px; }
  .sheet-scopes strong { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--muted); }
  .sheet-scopes label:has(input:checked) strong { color: var(--text); }
  .sheet-scopes small { color: var(--muted); font-size: 12px; }
  .sheet-facts { margin: 0; border-top: 1px solid var(--rule); }
  .sheet-facts div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; min-height: 44px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .sheet-facts dd { margin: 0; font-family: var(--font-mono); font-size: 13px; text-align: right; overflow-wrap: anywhere; }
  .sheet-facts dd small { display: block; margin-top: 4px; font-family: var(--font-body); font-size: 12px; color: var(--muted); }
  @media (max-width: 720px) { .sheet-head, .sheet-body, .sheet-foot { padding-left: 20px; padding-right: 20px; } }
  @media (prefers-reduced-motion: reduce) { .sheet, .sheet::backdrop { transition: none; } }
}

/* The form that makes a cluster, at product scale: rules, not cards; 44px controls; the boards' caps. */
@layer app {
  .cluster-create { display: flex; gap: 32px; align-items: flex-start; }
  .cluster-create-main { flex: 1 1 0; min-width: 0; max-width: 760px; }
  .cluster-create h1 { font-size: 34px; }
  .cluster-create-lede { max-width: 560px; margin: 10px 0 28px; color: var(--muted); font-size: 14px; }
  .cluster-create-section { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 24px; padding: 22px 0; border-top: 1px solid var(--rule); }
  .cluster-create-section-head { display: flex; align-items: baseline; gap: 12px; }
  .cluster-create-section-head > span { color: var(--faint); font-family: var(--font-mono); font-size: 11px; }
  .cluster-create-section-head h2 { font-size: 20px; }
  .cluster-create-field { display: flex; flex-direction: column; gap: 8px; }
  .cluster-create-field label, .cluster-create-cap { color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
  select { background-color: var(--bg); }
  option { background: var(--bg); color: var(--text); }
  .cluster-create-field input, .cluster-create-field select { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--rule2); border-radius: var(--radius); background: var(--bg); color: var(--text); font-size: 13px; }
  .cluster-create-field input::placeholder { color: var(--faint); opacity: .8; }
  .cluster-create-field small { color: var(--muted); font-size: 13px; }
  .cluster-create-options { min-width: 0; margin: 0; padding: 0; border: 0; border-top: 1px solid var(--rule); }
  .cluster-create-options legend, .cluster-create-counts legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .cluster-create-option { position: relative; display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 10px 0; border-bottom: 1px solid var(--rule); cursor: pointer; }
  .cluster-create-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
  /* The choice is a radio: a ring, filled with the accent once chosen. */
  .cluster-create-option-line { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 1px solid var(--rule2); background: transparent; transition: border-color 140ms ease, box-shadow 140ms ease; }
  .cluster-create-option:hover .cluster-create-option-line { border-color: var(--muted); }
  .cluster-create-option:has(input:checked) .cluster-create-option-line { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 4px var(--bg); }
  .cluster-create-option:has(input:focus-visible) { box-shadow: var(--focus); }
  .cluster-create-option-copy { min-width: 0; flex: 1 1 0; display: flex; flex-direction: column; gap: 4px; }
  .cluster-create-option-copy strong { font-size: 14px; font-weight: 500; }
  .cluster-create-option-copy > span { color: var(--muted); font-size: 13px; }
  .cluster-create-option-price { text-align: right; white-space: nowrap; }
  .cluster-create-option-price strong { display: block; font-family: var(--font-display); font-size: 20px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
  .cluster-create-option-price small { color: var(--muted); font-size: 12px; }
  .cluster-create-submit { display: flex; align-items: center; gap: 16px; padding-top: 22px; }
  .cluster-create-submit small, .cluster-create-options > small { color: var(--muted); font-size: 13px; }
  .cluster-create-options > small { display: block; padding-top: 12px; }
  .cluster-create-summary { width: 320px; flex: none; position: sticky; top: 24px; display: flex; flex-direction: column; gap: 10px; padding-left: 24px; border-left: 1px solid var(--rule); }
  .cluster-create-summary dl { margin: 0; }
  .cluster-create-summary dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; min-height: 48px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
  .cluster-create-summary dt { color: var(--muted); font-size: 13px; }
  .cluster-create-summary dd { margin: 0; text-align: right; font-size: 13px; overflow-wrap: anywhere; }
  .cluster-create-summary dd code { display: block; color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
  .cluster-create-summary dd strong { font-family: var(--font-display); font-size: 20px; font-weight: 500; }
  .cluster-create-summary > a { color: var(--muted); font-size: 13px; }

  @media (max-width: 960px) {
    .cluster-create { flex-direction: column; }
    .cluster-create-summary { width: auto; position: static; align-self: stretch; padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); padding-top: 16px; }
  }
  @media (max-width: 720px) {
    .cluster-create-section { grid-template-columns: 1fr; gap: 12px; }
    .cluster-create-submit { flex-direction: column; align-items: stretch; }
  }

  /* Dedicated-only sections show when dedicated is chosen: no script needed. */
  .cluster-create:has(input[name="kind"]:not([value="dedicated"]):checked) .cluster-create-dedicated { display: none; }
  .cluster-create-counts { display: flex; gap: 12px; margin: 0; padding: 0; border: 0; flex-wrap: wrap; }
  .cluster-create-count { position: relative; flex: 1 1 120px; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--rule2); border-radius: var(--radius); cursor: pointer; }
  .cluster-create-count input { position: absolute; width: 1px; height: 1px; opacity: 0; }
  .cluster-create-count strong { font-family: var(--font-display); font-size: 24px; font-weight: 500; }
  .cluster-create-count small { color: var(--muted); font-size: 12px; }
  .cluster-create-count:has(input:checked) { border-color: var(--accent); }
  .cluster-create-count[aria-disabled], .cluster-create-option[aria-disabled] { opacity: .45; cursor: default; }
  .cluster-create-count:has(input:focus-visible) { box-shadow: var(--focus); }
}

@layer app {
  .home-page {
    --home-gutter: clamp(24px, 5vw, 76px);
    --home-code-key: light-dark(#355e9d, #a9c8f5);
    --home-code-string: light-dark(#875121, #e7b77f);
    overflow-x: clip;
    background: var(--bg);
    color: var(--text);
  }

  .home-skip {
    position: absolute;
    top: -60px;
    left: 16px;
    z-index: 10;
    padding: 10px 14px;
    background: var(--accent);
    color: var(--on-accent);
  }
  .home-skip:focus { top: 12px; }

  .home-header {
    max-width: 1600px;
    height: 78px;
    margin: 0 auto;
    padding: 0 var(--home-gutter);
    display: flex;
    align-items: center;
    gap: 32px;
    border-bottom: 1px solid var(--rule);
  }
  .home-brand { display: inline-flex; align-items: center; flex: none; }
  .home-nav { display: flex; align-items: center; justify-content: center; gap: clamp(22px, 3vw, 46px); flex: 1; }
  .home-nav a, .home-header-cta { font-size: 13px; font-weight: 500; white-space: nowrap; }
  .home-nav a { color: var(--muted); }
  .home-nav a:hover { color: var(--text); }
  .home-header-cta { display: inline-flex; align-items: center; gap: 12px; flex: none; }
  .home-header-cta span { color: var(--accent); }

  .home-hero {
    max-width: 1600px;
    min-height: 680px;
    margin: 0 auto;
    padding: clamp(84px, 9vw, 144px) var(--home-gutter) clamp(100px, 11vw, 160px);
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(340px, .82fr);
    align-items: center;
    gap: clamp(38px, 6vw, 108px);
  }
  .home-request-head, .home-hero-protocols {
    font-family: var(--font-mono);
    font-size: 11px;
  }
  .home-hero h1 {
    margin-top: 0;
    font-size: clamp(60px, 7.1vw, 112px);
    font-weight: 500;
    letter-spacing: -.065em;
    line-height: .96;
  }
  .home-hero h1 em { color: var(--accent); font-style: normal; }
  .home-lede { max-width: 560px; margin-top: 32px; color: var(--muted); font-size: clamp(17px, 1.55vw, 20px); line-height: 1.5; }
  .home-hero-actions { margin-top: 36px; display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
  .home-text-link { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; border-bottom: 1px solid var(--rule2); font-size: 13px; font-weight: 500; }
  .home-text-link span { color: var(--accent); }
  .home-text-link:hover { border-bottom-color: var(--accent); }
  .home-hero-protocols { margin-top: 37px; color: var(--faint); }
  .home-hero-protocols span { padding: 0 7px; color: var(--rule2); }

  .home-request { min-width: 0; border: 1px solid var(--rule2); background: var(--panel); }
  .home-request-head { height: 44px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--faint); border-bottom: 1px solid var(--rule); }
  .home-request-path { min-width: 0; padding: 22px 24px 18px; display: flex; align-items: center; gap: 12px; }
  .home-request-path span { padding: 6px 8px; border: 1px solid var(--rule2); color: var(--accent); font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; }
  .home-request-path code { min-width: 0; overflow: auto; font-family: var(--font-mono); font-size: 12px; white-space: nowrap; }
  .home-request-auth { padding: 0 24px 12px; color: var(--faint); font-family: var(--font-mono); font-size: 10px; }
  .home-request pre { margin: 0; padding: 2px 24px 27px; overflow-x: auto; color: var(--muted); font-family: var(--font-mono); font-size: 12px; line-height: 1.75; tab-size: 2; }
  .home-request code { font-family: inherit; }
  .home-syntax-key { color: var(--home-code-key); }
  .home-syntax-string { color: var(--home-code-string); }
  .home-request-foot { min-height: 51px; padding: 13px 24px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--rule); color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
  .home-request-check { color: var(--completed); font-family: var(--font-body); font-size: 15px; font-weight: 600; }

  .home-line { border-top: 1px solid var(--strip-rule); border-bottom: 1px solid var(--strip-rule); }
  .home-line .strip { width: 100%; }

  .home-section { max-width: 1600px; margin: 0 auto; padding: 112px var(--home-gutter) 124px; scroll-margin-top: 24px; }
  .home-section-intro { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: clamp(38px, 6vw, 100px); align-items: end; margin-bottom: 62px; }
  .home-section h2 { font-size: clamp(44px, 5.2vw, 76px); font-weight: 500; line-height: 1.03; letter-spacing: -.045em; }
  .home-section-intro p { max-width: 480px; color: var(--muted); font-size: 17px; line-height: 1.5; }

  .home-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
  .home-step { min-width: 0; min-height: 206px; padding: 28px 30px 34px; border-left: 1px solid var(--rule); }
  .home-step:first-child { border-left: 0; padding-left: 0; }
  .home-step:last-child { padding-right: 0; }
  .home-step h3 { margin: 6px 0 13px; font-family: var(--font-display); font-size: 30px; font-weight: 500; letter-spacing: -.025em; }
  .home-step p { max-width: 360px; color: var(--muted); font-size: 14px; line-height: 1.58; }

  .home-why { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr); gap: clamp(50px, 7vw, 116px); border-top: 1px solid var(--rule); }
  .home-why-copy > p { max-width: 610px; margin-top: 28px; color: var(--muted); font-size: 17px; line-height: 1.55; }
  .home-why-copy > p + p { margin-top: 20px; }
  .home-benchmark { align-self: start; padding: 31px 34px 30px; border: 1px solid var(--rule2); background: var(--panel); }
  .home-benchmark-label { color: var(--muted); font-size: 13px; }
  .home-benchmark-number { margin-top: 36px; font-family: var(--font-display); font-size: clamp(83px, 8vw, 118px); font-weight: 500; letter-spacing: -.07em; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .home-benchmark-number span { color: var(--muted); font-size: .34em; letter-spacing: -.03em; }
  .home-benchmark-main { max-width: 410px; margin-top: 17px; font-size: 16px; line-height: 1.5; }
  .home-benchmark-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 38px; padding-top: 22px; border-top: 1px solid var(--rule2); }
  .home-benchmark-stats > div { display: flex; flex-direction: column; gap: 4px; }
  .home-benchmark-stats strong { font-family: var(--font-display); font-size: 23px; font-weight: 500; font-variant-numeric: tabular-nums; }
  .home-benchmark-stats span { color: var(--muted); font-size: 12px; line-height: 1.4; }
  .home-benchmark-note { margin-top: 29px; color: var(--muted); font-family: var(--font-mono); font-size: 11px; line-height: 1.55; }

  .home-pricing { border-top: 1px solid var(--rule); }
  .home-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
  .home-plan { min-height: 280px; padding: 26px 27px 25px; display: flex; flex-direction: column; border: 1px solid var(--rule2); background: var(--panel); }
  .home-plan[data-featured] { border-color: color-mix(in srgb, var(--accent) 45%, var(--rule2)); }
  .home-plan-top { min-height: 2lh; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; color: var(--muted); font-size: 12px; }
  .home-plan-recommended { color: var(--accent); text-align: right; white-space: nowrap; }
  .home-plan h3 { margin-top: 29px; font-family: var(--font-display); font-size: 29px; font-weight: 500; letter-spacing: -.025em; }
  .home-plan > p { max-width: 310px; margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.55; }
  .home-plan-price { display: flex; align-items: baseline; gap: 7px; margin-top: auto; padding-top: 34px; }
  .home-plan-price strong { font-family: var(--font-display); font-size: 39px; font-weight: 500; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
  .home-plan-price span { color: var(--muted); font-size: 13px; }
  .home-usage { margin-top: 27px; border-top: 1px solid var(--rule); }
  .home-usage-head, .home-usage-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
  .home-usage-head { min-height: 59px; color: var(--muted); }
  .home-usage-head h3 { color: var(--text); font-family: var(--font-display); font-size: 21px; font-weight: 500; }
  .home-usage-head > span { font-size: 13px; }
  .home-usage-pending { padding: 17px 0 22px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 14px; line-height: 1.5; }
  .home-usage-row { min-height: 85px; padding: 18px 0; border-top: 1px solid var(--rule); }
  .home-usage-row > div { display: flex; flex-direction: column; gap: 4px; }
  .home-usage-row > div strong { font-size: 15px; font-weight: 500; }
  .home-usage-row > div span { color: var(--muted); font-size: 13px; }
  .home-usage-row > p { flex: none; font-size: 13px; white-space: nowrap; }
  .home-usage-row > p strong { font-family: var(--font-display); font-size: 27px; font-weight: 500; letter-spacing: -.03em; }
  .home-usage-row > p span { color: var(--muted); }
  .home-pricing-end { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-top: 35px; }
  .home-pricing-end p { max-width: 500px; color: var(--muted); font-size: 13px; line-height: 1.5; }

  .home-footer { max-width: 1600px; min-height: 112px; margin: 0 auto; padding: 25px var(--home-gutter); display: flex; align-items: center; gap: 22px; border-top: 1px solid var(--rule); }
  .home-footer > span { color: var(--muted); font-size: 12px; }
  .home-footer > nav { margin-left: auto; display: flex; gap: 20px; }
  .home-footer > nav a { color: var(--muted); font-size: 12px; }
  .home-footer > nav a:hover { color: var(--text); }
  .home-nav a[aria-current] { color: var(--text); }

  /* The terms and the privacy policy (legal-page.tsx): one column of prose, the docs' measure. */
  .legal { max-width: calc(740px + 2 * var(--home-gutter)); margin: 0 auto; padding: clamp(56px, 8vw, 104px) var(--home-gutter) 112px; }
  .legal-cap { color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
  .legal h1 { margin-top: 14px; font-size: clamp(40px, 6vw, 64px); letter-spacing: -.045em; }
  .legal-lede { max-width: 640px; margin-top: 18px; color: var(--muted); font-size: 17px; line-height: 1.5; }
  .legal-updated { margin-top: 22px; padding-bottom: 28px; border-bottom: 1px solid var(--rule); color: var(--faint); font-family: var(--font-mono); font-size: 12px; }
  .legal-body { margin-top: 32px; font-size: 15px; line-height: 1.7; }
  .legal-body > * + * { margin-top: 14px; }
  .legal-body h2 { margin-top: 48px; font-size: 24px; }
  .legal-body ul { margin-bottom: 0; padding-left: 20px; }
  .legal-body li + li { margin-top: 8px; }
  .legal-body strong { font-weight: 500; }
  .legal-body a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); text-underline-offset: 3px; }
  .legal-short { padding: 16px 0 16px 18px; box-shadow: inset 3px 0 0 var(--accent); }

  @media (max-width: 1080px) {
    .home-hero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 85px; padding-bottom: 80px; }
    .home-hero h1 { font-size: clamp(66px, 8vw, 96px); }
    .home-request { width: min(100%, 620px); }
    .home-why { grid-template-columns: minmax(0, 1fr); }
    .home-benchmark { width: min(100%, 620px); }
  }

  @media (max-width: 760px) {
    .home-line .caption { height: auto; min-height: 56px; padding: 9px 16px 11px; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; }
    .home-line .caption > span:last-child { grid-column: 2; grid-row: 1; }
    .home-line .legend { display: flex; grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; gap: 5px 12px; font-size: 10px; }
    .home-header { height: auto; min-height: 69px; flex-wrap: wrap; gap: 0; padding-top: 17px; }
    .home-header-cta { margin-left: auto; }
    .home-nav { order: 3; width: 100%; flex: none; justify-content: space-between; height: 45px; margin-top: 15px; border-top: 1px solid var(--rule); }
    .home-nav a { font-size: 12px; }
    .home-hero { padding-top: 72px; }
    .home-section { padding-top: 80px; padding-bottom: 86px; }
    .home-section-intro { grid-template-columns: 1fr; gap: 18px; margin-bottom: 43px; }
    .home-steps { grid-template-columns: 1fr; }
    .home-step, .home-step:first-child, .home-step:last-child { min-height: 0; padding: 25px 0 29px; border-left: 0; border-top: 1px solid var(--rule); }
    .home-step:first-child { border-top: 0; }
    .home-step h3 { margin-top: 0; }
    .home-step p { max-width: 620px; }
  }

  @media (max-width: 520px) {
    .home-hero { gap: 62px; padding-top: 62px; padding-bottom: 69px; }
    .home-hero h1 { font-size: clamp(45px, 12.2vw, 64px); letter-spacing: -.06em; }
    .home-lede { margin-top: 26px; font-size: 16px; }
    .home-hero-actions { gap: 16px 22px; margin-top: 30px; }
    .home-hero-protocols { font-size: 10px; }
    .home-request-path, .home-request-auth, .home-request pre { padding-left: 18px; padding-right: 18px; }
    .home-request-foot { padding-left: 18px; padding-right: 18px; }
    .home-section h2 { font-size: clamp(39px, 10vw, 52px); }
    .home-section-intro p, .home-why-copy > p { font-size: 15px; }
    .home-benchmark { padding: 27px 23px; }
    .home-benchmark-number { font-size: clamp(72px, 20vw, 98px); }
    .home-benchmark-stats { gap: 12px; }
    .home-benchmark-stats strong { font-size: 20px; }
    .home-usage-head > span { max-width: 180px; text-align: right; }
    .home-usage-row { align-items: flex-start; flex-direction: column; gap: 7px; }
    .home-pricing-end { align-items: flex-start; flex-direction: column; }
    .home-footer { flex-wrap: wrap; gap: 12px 16px; }
    .home-footer > span { order: 3; width: 100%; }
  }
}

/* A space's jobs and one job (app/actions/app/jobs-page.tsx, public/jobs-live.tsx): the boards' table and caps; status is a line and a word. */
@layer app {
  .jobs-filter { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
  .jobs-filter label { display: flex; flex-direction: column; gap: 8px; flex: 0 1 360px; color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
  .jobs-filter input { height: 44px; padding: 0 12px; border: 1px solid var(--rule2); border-radius: var(--radius); background: transparent; color: var(--text); font-family: var(--font-body); font-size: 13px; letter-spacing: 0; text-transform: none; }
  .jobs-filter input::placeholder { color: var(--faint); }

  .jobs-list { display: flex; flex-direction: column; gap: 16px; }
  .jobs-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
  .jobs-counts { display: flex; gap: 8px; flex-wrap: wrap; }
  .jobs-counts a { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border: 1px solid var(--rule2); border-radius: var(--radius); color: var(--muted); font-family: var(--font-mono); font-size: 12px; }
  .jobs-counts a[aria-current] { border-color: var(--accent); color: var(--text); }
  .jobs-counts b { font-weight: 400; color: var(--text); font-variant-numeric: tabular-nums; }
  .jobs-counts .swatch { width: 2px; height: 10px; }
  .jobs-chip { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
  .jobs-chip .light { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
  .jobs-chip[data-state="live"] .light { background: var(--accent); }
  .jobs-chip[data-state="connecting"] .light { background: var(--running); }
  .jobs-chip .why { letter-spacing: 0; text-transform: none; color: var(--muted); }

  /* The rows open their job: the name's link covers the row (the verbs sit above it), the row lights on hover and focus, a chevron ends it. */
  .jobs-table { display: flex; flex-direction: column; }
  .jobs-table .head, .jobs-table .row { display: flex; align-items: center; gap: 16px; padding: 0 12px; border-bottom: 1px solid var(--rule); font-size: 13px; }
  .jobs-table .head { height: 32px; color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
  .jobs-table .row { min-height: 56px; }
  .jobs-table .row:has(.stretch) { position: relative; cursor: pointer; }
  .jobs-table .row:has(.stretch):hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
  .jobs-table .row:has(.stretch:focus-visible) { box-shadow: var(--focus); }
  .jobs-table .stretch::after { content: ''; position: absolute; inset: 0; }
  .jobs-table .stretch:focus-visible { box-shadow: none; }
  .jobs-table .row form { position: relative; z-index: 1; }
  .jobs-table .go { flex: none; font-size: 20px; line-height: 1; color: var(--faint); }
  .jobs-table .row:hover .go, .jobs-table .row:has(.stretch:focus-visible) .go { color: var(--accent); }
  .jobs-table .row:hover .job .name, .jobs-table .row:has(.stretch:focus-visible) .job .name { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
  .jobs-table .job { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: inherit; }
  .jobs-table .row .job .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .jobs-table .row .job .id { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); font-family: var(--font-mono); font-size: 12px; }
  .jobs-table .status { width: 120px; flex: none; }
  .jobs-table .took, .jobs-table .attempt, .jobs-table .created { flex: none; font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
  .jobs-table .took { width: 84px; }
  .jobs-table .progress { width: 104px; flex: none; display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
  .jobs-table .head .progress { font-size: 11px; }
  .jobs-table .progress .bar { width: 48px; height: 3px; flex: none; background: var(--rule); overflow: hidden; }
  .jobs-table .progress .bar > span { display: block; height: 100%; background: var(--running); transition: width 300ms var(--ease-out); }
  .jobs-table .status .percent { display: none; margin-left: 8px; font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
  .jobs-table .attempt { width: 72px; }
  .jobs-table .created { width: 96px; }
  .jobs-table .head .took, .jobs-table .head .attempt, .jobs-table .head .created { font-size: 11px; }
  .jobs-table .actions { width: 88px; flex: none; display: flex; justify-content: flex-end; }
  .jobs-table .empty { color: var(--muted); }
  .jobs-pages { display: flex; gap: 12px; align-items: center; }
  .jobs-pages .searched { font-size: 13px; color: var(--muted); }
  @media (max-width: 720px) {
    .jobs-table .took, .jobs-table .attempt, .jobs-table .actions, .jobs-table .progress, .jobs-table .row .job .id { display: none; }
    .jobs-table .row .job .name { white-space: normal; overflow-wrap: normal; word-break: normal; } /* (breaks only at the <wbr> after _ and -, else the ellipsis) */
    .jobs-table .status { width: 96px; }
    .jobs-table .status .percent { display: inline; }
  }

  .jobs-id { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: -10px; }
  .jobs-id code { font-family: var(--font-mono); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }

  .jobs-job { display: flex; flex-direction: column; gap: 22px; }
  .jobs-progress { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; background: var(--panel); border: 1px solid var(--rule2); }
  .jobs-progress .top { display: flex; align-items: center; gap: 16px; }
  .jobs-progress .big { flex: 1 1 0; font-family: var(--font-display); font-size: 22px; font-weight: 500; }
  .jobs-progress .big .status-mark i { height: 24px; }
  .jobs-progress .percent { font-family: var(--font-display); font-size: 22px; font-variant-numeric: tabular-nums; }
  .jobs-progress .bar { height: 4px; background: var(--rule); overflow: hidden; }
  .jobs-progress .bar > span { display: block; height: 100%; background: var(--accent); transition: width 300ms var(--ease-out); }
  .jobs-progress .message { color: var(--muted); font-size: 13px; }
  /* A job that stopped: the outcome in words, its error, and what the worker last reported folded away under them. */
  .jobs-progress .said { font-size: 14px; }
  .jobs-progress .error { margin: 0; padding: 12px 14px; border-left: 3px solid var(--failed); background: color-mix(in srgb, var(--failed) 8%, transparent); font-family: var(--font-mono); font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
  .jobs-progress .before { margin-top: 4px; }
  .jobs-progress .before summary { cursor: pointer; list-style: disclosure-closed; color: var(--muted); font-size: 13px; }
  .jobs-progress .before summary:hover { color: var(--text); }
  .jobs-progress .before[open] summary { list-style: disclosure-open; margin-bottom: 10px; }
  .jobs-progress .stages { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
  .jobs-progress .stages li { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 13px; }
  .jobs-progress .stages .n { font-family: var(--font-mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
  .jobs-progress .stages .bar, .jobs-progress .stages .message { grid-column: 1 / -1; }
  .jobs-progress .stages .bar > span { background: var(--muted); }

  .jobs-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 24px; margin: 0; }
  .jobs-facts > div { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--rule); min-width: 0; }
  .jobs-facts dt { color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
  .jobs-facts dd { margin: 0; font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .jobs-facts dd small { font-family: var(--font-body); font-size: 12px; color: var(--muted); }

  .jobs-json { position: relative; }
  .jobs-json .summary { display: flex; align-items: center; gap: 12px; height: 44px; margin: 0; padding-right: 144px; border-top: 1px solid var(--rule); list-style: none; }
  .jobs-json summary { cursor: pointer; }
  .jobs-json summary::-webkit-details-marker { display: none; }
  .jobs-json .cap { color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
  .jobs-json .size { color: var(--faint); font-family: var(--font-mono); font-size: 11px; }
  .jobs-json .toggle::after { content: 'Expand'; color: var(--accent); font-size: 13px; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
  .jobs-json summary:hover .toggle::after { text-decoration-style: solid; }
  .jobs-json details[open] .toggle::after { content: 'Collapse'; }
  .jobs-json pre { margin: 0 0 4px; padding: 14px 16px; max-height: 480px; overflow: auto; background: var(--panel); border: 1px solid var(--rule2); font-family: var(--font-mono); font-size: 12px; line-height: 1.6; }
  .jobs-json > span { position: absolute; top: 0; right: 0; }
  .jobs-json > span button { height: 36px; margin-top: 4px; }
  .jobs-callback { display: flex; flex-direction: column; gap: 8px; }
  .jobs-callback .jobs-facts { grid-template-columns: minmax(0, 1fr); }
  .jobs-header { display: block; }
  .jobs-callback small { display: block; margin-top: 6px; color: var(--muted); font-family: var(--font-body); font-size: 12px; }

  .jobs-tabs [role="tablist"] { display: flex; gap: 28px; border-bottom: 1px solid var(--rule); }
  .jobs-tabs [role="tab"] { height: 44px; padding: 0; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); }
  .jobs-tabs [role="tab"][aria-selected="true"] { border-bottom-color: var(--accent); color: var(--text); font-weight: 500; }
  .jobs-tabs [role="tab"] b { margin-left: 6px; font-weight: 400; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
  .jobs-events, .jobs-lines { list-style: none; margin: 0; padding: 0; }
  .jobs-events li { padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .jobs-events pre { margin: 0; font-family: var(--font-mono); font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
  .jobs-lines li { display: grid; grid-template-columns: 72px 48px minmax(0, 1fr); gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--rule); font-family: var(--font-mono); font-size: 12px; }
  .jobs-lines time { color: var(--faint); font-variant-numeric: tabular-nums; }
  .jobs-lines .level { color: var(--muted); }
  .jobs-lines [data-level="warn"] .level { color: var(--running); }
  .jobs-lines [data-level="error"] .level, .jobs-lines [data-level="fatal"] .level { color: var(--failed); }
  .jobs-lines .text { overflow-wrap: anywhere; white-space: pre-wrap; }
  .jobs-lines .source, .jobs-lines code { color: var(--muted); }
  .jobs-events .older, .jobs-lines .older { display: block; padding: 12px 0; }
  .jobs-events .empty, .jobs-lines .empty { display: block; padding: 12px 0; color: var(--muted); font-family: var(--font-body); font-size: 13px; }
}

/* Workflow runs (app/actions/app/runs-page.tsx, public/run-live.tsx): the list by version, and a run's page: what it does now,
   then its timeline (a row a step, a fan-out one row, a waterfall against the run's clock, a minimap). Status is a line and a word;
   waiting is pending's line, dim. */
@layer app {
  .status-mark { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
  .status-mark i { width: 3px; height: 14px; flex: none; }
  .status-mark[data-big] { font-family: var(--font-display); font-size: 20px; font-weight: 500; letter-spacing: -.01em; }
  .status-mark[data-big] i { height: 24px; }
  .wf-page { display: flex; flex-direction: column; gap: 22px; }
  .wf-page h1 { font-family: var(--font-mono); letter-spacing: -.01em; font-size: 34px; }
  .wf-title { position: relative; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .wf-title h1 { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
  .wf-title .status-mark[data-big] { font-size: 22px; flex: none; }
  /* Cancel: the details' summary is the danger button (a button inside a summary would take the click). */
  .wf-cancel { list-style: none; display: inline-flex; align-items: center; height: 44px; padding: 0 17px; border: 1px solid var(--rule2); border-radius: var(--radius); color: var(--failed); font-size: 13px; font-weight: 500; cursor: pointer; user-select: none; white-space: nowrap; }
  .wf-cancel::-webkit-details-marker { display: none; }
  .wf-cancel:hover { border-color: var(--muted); background: var(--panel); }
  .wf-cancel:focus-visible { box-shadow: var(--focus); }
  .wf-id { align-items: center; color: var(--muted); font-size: 13px; }
  .wf-id time { font-variant-numeric: tabular-nums; }
  .wf-fine summary { cursor: pointer; color: var(--faint); font-size: 12px; list-style: none; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
  .wf-fine summary::-webkit-details-marker { display: none; }
  .wf-fine[open] summary { display: none; }
  .wf-fine span { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
  .wf-confirm summary { list-style: none; display: inline-flex; }
  .wf-confirm summary::-webkit-details-marker { display: none; }
  .wf-confirm .confirm { position: absolute; right: 0; top: 100%; z-index: 2; width: min(420px, calc(100vw - 2 * var(--gutter))); margin-top: 8px; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; background: var(--panel); border: 1px solid var(--rule2); border-left: 3px solid var(--failed); border-radius: var(--radius); font-size: 13px; }
  .wf-confirm .confirm b { font-weight: 500; }
  .wf-confirm .verbs { display: flex; gap: 10px; flex-wrap: wrap; }

  /* Now: what the run waits for, or why it is stuck, before anything else. */
  .wf-now { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; background: var(--panel); border: 1px solid var(--rule2); }
  .wf-now > .status-mark[data-big] { font-size: 22px; }
  .wf-wait { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 15px; }
  .wf-wait .status-mark { font-family: var(--font-display); font-size: 20px; font-weight: 500; letter-spacing: -.01em; }
  .wf-wait .status-mark i { height: 22px; }
  .wf-wait .verb, .wf-detail .verb { color: var(--accent); font-size: 13px; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; white-space: nowrap; }
  .wf-wait .verb:hover, .wf-detail .verb:hover { text-decoration-style: solid; }
  .wf-wait .bar { display: flex; width: 100%; height: 4px; background: var(--rule); overflow: hidden; }
  .wf-wait .bar i { display: block; height: 100%; }
  .wf-stuck { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-left: 3px solid var(--failed); background: color-mix(in srgb, var(--failed) 8%, transparent); font-size: 14px; }
  .wf-stuck .status-mark[data-big] { font-size: 22px; }
  .wf-stuck .status-mark i { display: none; }
  .wf-stuck code { font-family: var(--font-mono); font-size: 12px; padding: 1px 5px; background: color-mix(in srgb, var(--text) 8%, transparent); border-radius: 3px; overflow-wrap: anywhere; }
  .wf-stuck .do b { font-weight: 500; }
  .wf-now .error { margin: 0; padding: 12px 14px; border-left: 3px solid var(--failed); background: color-mix(in srgb, var(--failed) 8%, transparent); font-family: var(--font-mono); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }

  /* The filters: a search, then the counts by status (each a filter), and the feed's chip. */
  .wf-bar { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
  .wf-bar .find { flex: 0 1 380px; min-width: 0; }
  .wf-bar .find input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--rule2); border-radius: var(--radius); background: transparent; color: var(--text); font-family: var(--font-body); font-size: 13px; }
  .wf-bar .find input::placeholder { color: var(--faint); }
  .wf-bar .counts { display: flex; gap: 8px; flex-wrap: wrap; }
  .wf-bar .counts a, .wf-bar .counts button { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border: 1px solid var(--rule2); border-radius: var(--radius); color: var(--muted); font-family: var(--font-mono); font-size: 12px; white-space: nowrap; }
  .wf-bar .counts a[aria-current], .wf-bar .counts button[aria-current] { border-color: var(--accent); color: var(--text); }
  .wf-bar .counts button { background: transparent; cursor: pointer; }
  .wf-bar .counts a.stuck { color: var(--failed); }
  .wf-bar .counts b { font-weight: 400; color: var(--text); font-variant-numeric: tabular-nums; }
  .wf-bar .counts i { width: 2px; height: 10px; }
  .wf-bar .clear { color: var(--accent); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
  .wf-bar .jobs-chip { margin-left: auto; }

  /* A: the timeline. Columns: #, status, the step (indented by depth), the waterfall, took. */
  .wf-timeline { display: flex; flex-direction: column; }
  .wf-table { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 24px; gap: 0 12px; }
  .wf-main { min-width: 0; }
  .wf-sticky { position: sticky; top: 0; z-index: 2; background: var(--bg); padding-top: 8px; display: flex; flex-direction: column; gap: 12px; }
  .wf-table > div:has(> .wf-minimap) { position: sticky; top: 8px; align-self: start; }
  .wf-head, .wf-row { display: grid; grid-template-columns: 64px 112px minmax(0, 1fr) 24% 120px 24px; align-items: center; gap: 14px; padding: 0 12px; border-bottom: 1px solid var(--rule); font-size: 13px; }
  .wf-head { height: 32px; background: var(--bg); color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
  .wf-head .name small { font-family: var(--font-body); font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--faint); margin-left: 8px; }
  .wf-head .bar { display: flex; justify-content: space-between; letter-spacing: 0; text-transform: none; }
  .wf-rows { --row-h: 44px; position: relative; min-width: 0; }
  .wf-row { height: var(--row-h); color: inherit; text-decoration: none; box-sizing: border-box; }
  .wf-row .go { font-size: 20px; line-height: 1; color: var(--faint); text-align: right; }
  .wf-row .name .open { flex: none; margin-left: auto; padding-right: 8px; font-size: 12px; color: var(--accent); white-space: nowrap; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
  .wf-row.group:hover .name .open { text-decoration-style: solid; }
  .wf-row:hover .go { color: var(--accent); }
  .wf-row[data-stuck] { background: color-mix(in srgb, var(--failed) 8%, transparent); box-shadow: inset 3px 0 var(--failed); }
  .wf-row[data-stuck] .detail { color: var(--failed); }
  .wf-row:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
  .wf-row:hover .name b { color: var(--accent); }
  .wf-row:focus-visible { box-shadow: var(--focus); z-index: 1; }
  .wf-row[data-status="pending"] .name b { color: var(--muted); }
  .wf-row[data-surfaced] { background: color-mix(in srgb, var(--failed) 5%, transparent); }
  .wf-row .seq, .wf-row .took, .wf-head .took { font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
  .wf-row .took, .wf-head .took { text-align: right; }
  .wf-row .mark { min-width: 0; font-family: var(--font-mono); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wf-row .name { min-width: 0; display: flex; align-items: baseline; gap: 10px; padding-left: calc(var(--depth, 0) * 22px); }
  .wf-row .name b { font-weight: 500; white-space: nowrap; }
  .wf-row .name .label, .wf-row .name .kind, .wf-row .name .times { font-weight: 400; color: var(--muted); font-family: var(--font-mono); font-size: 12px; }
  .wf-row .detail { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
  .wf-row .detail[data-error] { color: var(--failed); font-family: var(--font-mono); }
  .wf-row .bar { position: relative; height: 100%; min-height: 20px; border-left: 1px solid var(--rule); background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), var(--rule) calc(25% - 1px) 25%); }
  .wf-row .bar i { position: absolute; top: 50%; height: 6px; margin-top: -3px; min-width: 2px; display: flex; overflow: hidden; }
  .wf-row .bar.stacked i { height: 10px; margin-top: -5px; }
  .wf-row .bar.stacked b { display: block; height: 100%; }
  .wf-row.group { background: color-mix(in srgb, var(--text) 3%, transparent); }
  .wf-more { padding: 12px; color: var(--muted); font-size: 13px; }
  .wf-row.note .mark { color: var(--faint); }
  .wf-cut { padding: 10px 12px; border-bottom: 1px solid var(--rule); color: var(--text); }
  .wf-cut a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
  .wf-aside { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
  .wf-row.note .name .text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: italic; }
  .wf-row.note:hover { background: none; }
  .wf-minimap { position: relative; height: min(70vh, 640px); width: 24px; padding-top: 20px; }
  .wf-minimap .cap { position: absolute; top: 0; left: 0; width: 100%; text-align: center; font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
  .wf-minimap .cells { position: relative; display: flex; flex-direction: column; height: 100%; }
  .wf-minimap .cells i { display: block; flex: 1 1 0; min-height: 1px; width: 10px; margin-left: 7px; }
  .wf-minimap .window { position: absolute; left: 3px; right: 3px; border: 1px solid var(--text); border-radius: 2px; background: color-mix(in srgb, var(--text) 8%, transparent); }
  .wf-minimap[data-live] { cursor: pointer; }

  /* One node's details (the sheet). */
  .wf-detail { display: flex; flex-direction: column; gap: 18px; }
  .wf-detail header { display: flex; flex-direction: column; gap: 8px; }
  .wf-detail .kind { color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
  .wf-detail h2 { font-family: var(--font-mono); font-size: 24px; letter-spacing: -.01em; overflow-wrap: anywhere; }
  .wf-detail .error { margin: 0; padding: 12px 14px; border-left: 3px solid var(--failed); background: color-mix(in srgb, var(--failed) 8%, transparent); font-family: var(--font-mono); font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
  .wf-detail .progress { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
  .wf-detail .progress .bar { height: 4px; background: var(--rule); overflow: hidden; }
  .wf-detail .progress .bar i { display: block; height: 100%; background: var(--running); }
  .wf-detail .notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
  .wf-detail .notes li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-top: 1px solid var(--rule); font-size: 13px; }
  .wf-detail .notes time { color: var(--faint); font-family: var(--font-mono); font-size: 11px; font-variant-numeric: tabular-nums; }
  .wf-sheet .sheet-body { padding-top: 28px; }
  .sheet-field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--rule2); border-radius: var(--radius); background: transparent; color: var(--text); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0; text-transform: none; resize: vertical; }
  .sheet-field input[list] { font-family: var(--font-mono); }

  /* The runs list: versions side by side, then the runs. */
  .wf-runs { display: flex; flex-direction: column; gap: 22px; }
  .wf-versions, .wf-list { display: flex; flex-direction: column; }
  .wf-versions .head, .wf-list .head, .wf-versions .row, .wf-list .row { display: flex; align-items: center; gap: 16px; padding: 0 12px; border-bottom: 1px solid var(--rule); font-size: 13px; }
  .wf-versions .head, .wf-list .head { height: 32px; color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
  .wf-versions .head .help { font-family: var(--font-body); font-size: 13px; letter-spacing: 0; text-transform: none; margin-left: auto; }
  .wf-versions .row, .wf-list .row { min-height: 56px; color: inherit; }
  .wf-versions .row:hover, .wf-list .row:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
  .wf-versions .row[aria-current] { box-shadow: inset 3px 0 var(--accent); }
  .wf-versions .name { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
  .wf-versions .name b { font-family: var(--font-mono); font-weight: 500; font-size: 15px; }
  .wf-versions .name .version { color: var(--accent); }
  .wf-versions .name .verdict { font-size: 13px; color: var(--muted); }
  .wf-versions .name .verdict[data-clear] { color: var(--completed); }
  .wf-versions .n { width: 120px; flex: none; display: flex; flex-direction: column; font-family: var(--font-mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
  .wf-versions .n b { font-weight: 400; color: var(--text); font-size: 15px; }
  .wf-versions .n[data-zero] b { color: var(--muted); }
  .wf-versions .n small { font-size: 11px; }
  .wf-versions .last { width: 260px; flex: none; color: var(--muted); font-family: var(--font-mono); font-size: 12px; text-align: right; }
  .wf-list .run { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .wf-list .run b { font-family: var(--font-mono); font-weight: 500; overflow-wrap: anywhere; }
  .wf-list .run .id { color: var(--faint); font-family: var(--font-mono); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wf-list .status { width: 110px; flex: none; }
  .wf-list .wait { width: 34%; flex: none; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .wf-list .wait[data-stuck] { color: var(--failed); }
  .wf-list .started { width: 90px; flex: none; color: var(--muted); font-family: var(--font-mono); font-size: 12px; }
  .wf-list .go { flex: none; font-size: 20px; line-height: 1; color: var(--faint); }
  .wf-list .row:hover .go { color: var(--accent); }
  .wf-list .row:hover .run b { color: var(--accent); }
  .wf-list .empty, .wf-versions .empty { color: var(--muted); }

  @media (max-width: 720px) {
    .wf-head, .wf-row { grid-template-columns: 84px minmax(0, 1fr) 62px 12px; grid-template-rows: auto auto; gap: 0 8px; padding: 0 4px; }
    .wf-row .bar, .wf-head .bar, .wf-head .seq { display: none; }
    .wf-row .seq { grid-column: 1; grid-row: 2; font-size: 11px; }
    .wf-row .mark { grid-column: 1; grid-row: 1; align-self: end; }
    .wf-row .name { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; align-items: flex-start; gap: 2px; padding-left: calc(var(--depth, 0) * 12px); }
    .wf-row .name b { white-space: normal; line-height: 1.2; }
    .wf-row .name .detail, .wf-row.note .name .text { max-width: 100%; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
    .wf-row .took { grid-column: 3; grid-row: 1 / span 2; font-size: 11px; white-space: normal; text-align: right; }
    .wf-row .go { grid-column: 4; grid-row: 1 / span 2; }
    .wf-row .name .open { margin-left: 0; padding: 0; }
    .wf-rows { --row-h: 76px; }
    .wf-row { padding: 6px 4px; align-content: center; }
    .wf-title h1 { flex-basis: 100%; }
    .wf-sticky { position: static; }
    .wf-head { grid-template-rows: auto; }
    .wf-head .name small { display: none; }
    .wf-table { grid-template-columns: minmax(0, 1fr); }
    .wf-minimap, .wf-table > div:has(> .wf-minimap) { display: none; }
    .wf-wait { font-size: 14px; }
    .wf-wait .status-mark { font-size: 17px; }
    .wf-versions .last, .wf-versions .n:nth-of-type(2) { display: none; }
    .wf-versions .head { height: auto; flex-wrap: wrap; padding: 8px 12px; gap: 4px; }
    .wf-versions .head .help { flex-basis: 100%; margin: 0; font-size: 12px; }
    .wf-versions .n { width: 84px; }
    .wf-versions .name .verdict { white-space: normal; }
    .wf-list .started, .wf-list .run .id { display: none; }
    .wf-list .wait { width: 40%; white-space: normal; font-size: 12px; }
    .wf-list .status { width: 84px; }
    .wf-bar .find { flex-basis: 100%; }
    .wf-confirm .confirm { position: static; width: auto; margin-top: 12px; }
  }
}
