/*
 * Review Tools design system.
 *
 * One accent, semantic colour reserved for state, machine values demoted to
 * monospace references. Light and dark are both first-class: each token is
 * declared once as `light-dark(light, dark)` so the two palettes cannot drift
 * apart, and `color-scheme` on the root element is the single switch between
 * them. The switch itself is server-rendered from a cookie, so the first paint
 * is already correct and no script runs before the document is right.
 */

:root {
  /* No pinned choice: follow the operating system. */
  color-scheme: light dark;

  /* Surfaces */
  --canvas: light-dark(#f6f7f9, #0b0c11);
  --canvas-accent: light-dark(#eef0fb, #14162080);
  --surface: light-dark(#ffffff, #14161d);
  --surface-raised: light-dark(#ffffff, #191c24);
  --surface-sunken: light-dark(#f1f2f6, #101218);
  --line: light-dark(#e3e5ec, #262a35);
  --line-soft: light-dark(#edeef3, #1e2129);
  --line-strong: light-dark(#d3d6e0, #333846);

  /* Ink */
  --ink: light-dark(#15171e, #edeff5);
  --ink-muted: light-dark(#5c6274, #a3a9bb);
  --ink-faint: light-dark(#868c9d, #7b8296);
  --ink-on-accent: light-dark(#ffffff, #0e0b22);

  /* Accent */
  --accent: light-dark(#4f37e3, #a394ff);
  --accent-hover: light-dark(#4029c6, #b4a8ff);
  --accent-ink: light-dark(#4429cb, #b7abff);
  --accent-soft: light-dark(#eeebfd, #1e1c33);
  --accent-line: light-dark(#d6cffa, #322e58);

  /* State: settled, in flight, needs attention, blocked, superseded */
  --ok: light-dark(#007578, #59d3c1);
  /* Review Tools product decision; see packages/ui/README.md. */
  --success-bg: #e7f5f3;
  --ok-soft: light-dark(#e7f5f3, #0f2926);
  --ok-line: light-dark(#b9e0da, #1e4841);
  --run: light-dark(#2050bf, #8fb2ff);
  --run-soft: light-dark(#e8eefd, #131b30);
  --run-line: light-dark(#c6d5f7, #253352);
  --warn: light-dark(#855400, #f0c473);
  --warn-soft: light-dark(#fdf1dd, #2a2113);
  --warn-line: light-dark(#f0d8a8, #4a3a1c);
  --danger: light-dark(#b4331c, #ff9a83);
  --danger-soft: light-dark(#fdedea, #2f1712);
  --danger-line: light-dark(#f5cbc1, #55291f);
  --idle: light-dark(#666c7d, #9aa1b4);
  --idle-soft: light-dark(#eff0f4, #1a1d25);
  --idle-line: light-dark(#dfe1e9, #2a2e39);

  /* Tool identity */
  --argos: light-dark(#5b34d6, #a795ff);
  --argos-soft: light-dark(#f0ebfd, #1d1a33);
  --argos-line: light-dark(#dbd0f8, #332e59);
  --janus: light-dark(#0a6f8a, #63cfe6);
  --janus-soft: light-dark(#e5f3f8, #0e2530);
  --janus-line: light-dark(#bbdeea, #1d4453);

  /* Space */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s7: 28px;
  --s8: 32px;
  --s10: 40px;
  --s12: 48px;

  /* Shape */
  --r1: 7px;
  --r2: 11px;
  --r3: 16px;
  --r-pill: 999px;

  /* Elevation */
  --shadow-1: 0 1px 2px rgba(18, 20, 32, 0.05), 0 1px 1px rgba(18, 20, 32, 0.03);
  --shadow-2: 0 8px 24px -12px rgba(18, 20, 32, 0.16), 0 2px 6px -3px rgba(18, 20, 32, 0.08);
  --shadow-3: 0 24px 60px -28px rgba(18, 20, 32, 0.3);
  --ring: 0 0 0 3px rgba(79, 55, 227, 0.28);

  /* Type */
  --font: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Layout */
  --rail-w: 248px;
  --content-w: 1180px;
}

/*
 * The pinned choices. `color-scheme` is what `light-dark()` reads, so switching
 * it rethemes every token above without repeating a single colour. Elevation is
 * the exception: the dark shadows are softer and spread further, not the same
 * shadow in another ink, so it is the one layer declared twice — once for the
 * operating system's preference, once for the pinned choice.
 */
:root[data-theme="light"] {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 10px 30px -16px rgba(0, 0, 0, 0.7);
    --shadow-3: 0 30px 70px -30px rgba(0, 0, 0, 0.8);
    --ring: 0 0 0 3px rgba(163, 148, 255, 0.35);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 10px 30px -16px rgba(0, 0, 0, 0.7);
  --shadow-3: 0 30px 70px -30px rgba(0, 0, 0, 0.8);
  --ring: 0 0 0 3px rgba(163, 148, 255, 0.35);
}

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

html {
  min-width: 320px;
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 15px / 1.55 var(--font);
  font-synthesis: none;
}

/* The authenticated shell: rail plus one scrolling content column. */
body.app {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  align-items: start;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button,
summary {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--accent-ink);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: underline;
}

code,
.mono,
.ref {
  font-family: var(--mono);
  font-size: 0.855em;
  font-variant-ligatures: none;
}

img,
svg {
  max-width: 100%;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

:focus-visible {
  border-radius: var(--r1);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.014em;
  line-height: 1.18;
}

h1 {
  font-size: clamp(1.5rem, 1.1rem + 1.1vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 1.0625rem;
  font-weight: 660;
}

h3 {
  font-size: 0.9375rem;
  font-weight: 660;
}

p {
  margin: 0;
}

ul,
ol,
dl,
dd {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

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

.faint {
  color: var(--ink-faint);
}

.small {
  font-size: 13px;
}

.micro {
  font-size: 11.5px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 640;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.eyebrow-argos {
  color: var(--argos);
}

.eyebrow-janus {
  color: var(--janus);
}

/* A count beside a card title: the number is the information, not a status. */
.card-count {
  color: var(--ink-faint);
  font-size: 12.5px;
  font-weight: 560;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* A quiet in-copy link with a trailing chevron. */
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--accent-ink);
  font-size: 12.5px;
  font-weight: 620;
}

.text-link svg {
  transition: transform 120ms ease;
}

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

.text-link:hover svg {
  transform: translateX(2px);
}

/* The closing line of a card: a note or a link, separated by a hairline. */
.card-foot {
  display: flex;
  align-items: center;
  gap: var(--s2) var(--s4);
  margin-top: var(--s4);
  padding-top: var(--s3);
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

.numeric {
  font-variant-numeric: tabular-nums;
}

.stack-2 > * + * {
  margin-top: var(--s2);
}

.stack-3 > * + * {
  margin-top: var(--s3);
}

.stack-4 > * + * {
  margin-top: var(--s4);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: var(--s2);
  left: var(--s2);
  padding: var(--s2) var(--s3);
  border-radius: var(--r1);
  background: var(--ink);
  color: var(--canvas);
  font-size: 13px;
  font-weight: 640;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------------------------------------------------------------- rail ---- */

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--s1) var(--s2);
  color: var(--ink);
}

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

.brand-mark {
  flex: none;
  color: var(--accent);
}

.brand-mark-plate {
  fill: var(--accent-soft);
  stroke: var(--accent-line);
}

.brand-copy {
  display: grid;
  line-height: 1.2;
}

.brand-name {
  font-size: 14px;
  font-weight: 680;
  letter-spacing: -0.015em;
}

.brand-note {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rail-nav {
  display: grid;
  gap: 2px;
}

.rail-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px var(--s2) 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--r2);
  color: var(--ink-muted);
}

.rail-nav a:hover {
  background: var(--surface-sunken);
  color: var(--ink);
  text-decoration: none;
}

.rail-nav a[aria-current="page"] {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.nav-icon {
  display: grid;
  flex: none;
  place-items: center;
  color: currentColor;
  opacity: 0.9;
}

.nav-copy {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.nav-label {
  font-size: 13.5px;
  font-weight: 620;
}

.nav-hint {
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-nav a[aria-current="page"] .nav-hint {
  color: var(--accent-ink);
  opacity: 0.75;
}

.rail-foot {
  display: grid;
  gap: var(--s2);
  margin-top: auto;
  padding-top: var(--s4);
  border-top: 1px solid var(--line-soft);
}

.viewer {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--s2);
  padding: 0 var(--s2);
}

.viewer-copy {
  display: grid;
  min-width: 0;
  color: var(--ink-faint);
  font-size: 11.5px;
  line-height: 1.25;
}

.viewer-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sign-out {
  justify-content: flex-start;
}

.avatar {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--line-strong);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  object-fit: cover;
}

/* -------------------------------------------------------- account menu ---- */

/*
 * Identity, appearance and leaving live behind the portrait. A `details`
 * element, so opening, closing, focus order and the Escape key are the
 * browser's job rather than ours.
 */
.account {
  position: relative;
}

.account-trigger {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--s2);
  padding: 5px var(--s2);
  border: 1px solid transparent;
  border-radius: var(--r2);
  cursor: pointer;
  list-style: none;
}

.account-trigger::-webkit-details-marker {
  display: none;
}

.account-trigger:hover {
  background: var(--surface-sunken);
}

.account-trigger:focus-visible {
  box-shadow: var(--ring);
  outline: none;
}

.account[open] > .account-trigger {
  border-color: var(--line);
  background: var(--surface-sunken);
}

.account-caret {
  display: grid;
  margin-left: auto;
  place-items: center;
  color: var(--ink-faint);
}

.account[open] .account-caret {
  transform: rotate(180deg);
}

.account-panel {
  position: absolute;
  z-index: 40;
  right: 0;
  bottom: calc(100% + var(--s2));
  left: 0;
  display: grid;
  min-width: 236px;
  gap: var(--s3);
  padding: var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  background: var(--surface-raised);
  box-shadow: var(--shadow-3);
}

/* The portrait alone is the trigger on narrow viewports; the name moves here. */
.account-identity {
  display: none;
  min-width: 0;
  align-items: center;
  gap: var(--s2);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--line-soft);
}

.account-heading {
  margin: 0;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.account-appearance {
  display: grid;
  gap: var(--s2);
  margin: 0;
}

.theme-switch {
  display: grid;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface-sunken);
  gap: 2px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.theme-choice {
  display: grid;
  justify-items: center;
  padding: 7px 4px;
  border: 1px solid transparent;
  border-radius: calc(var(--r2) - 3px);
  background: none;
  color: var(--ink-muted);
  font: inherit;
  font-size: 11.5px;
  font-weight: 560;
  cursor: pointer;
  gap: 3px;
}

.theme-choice:hover {
  color: var(--ink);
}

.theme-choice:focus-visible {
  box-shadow: var(--ring);
  outline: none;
}

.theme-choice[aria-pressed="true"] {
  border-color: var(--accent-line);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  color: var(--accent-ink);
}

.theme-choice-icon {
  display: grid;
  place-items: center;
}

.account-actions {
  display: grid;
  padding-top: var(--s2);
  border-top: 1px solid var(--line-soft);
  gap: 2px;
}

.account-action {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 8px var(--s2);
  border-radius: var(--r1);
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 560;
}

.account-action:hover {
  background: var(--surface-sunken);
  color: var(--ink);
  text-decoration: none;
}

.account-action-icon {
  display: grid;
  place-items: center;
  color: var(--ink-faint);
}

.account-action-leave:hover,
.account-action-leave:hover .account-action-icon {
  color: var(--danger);
}

/* ---------------------------------------------------------------- main ---- */

main {
  min-width: 0;
}

main:focus {
  outline: none;
}

.shell,
.shell-narrow {
  width: 100%;
  max-width: var(--content-w);
  margin: 0 auto;
  padding: var(--s8) var(--s8) var(--s12);
}

.shell-narrow {
  max-width: 800px;
}

/* --------------------------------------------------------- page header ---- */

.page-head {
  display: grid;
  gap: var(--s4);
  margin-bottom: var(--s6);
}

.page-head-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s6);
  flex-wrap: wrap;
}

.page-head-copy {
  min-width: 0;
}

.page-title {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
}

.page-lead {
  max-width: 78ch;
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 14px;
}

.page-actions,
.button-row,
.filter-row {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
}

.page-head-main > .page-actions {
  margin-left: auto;
}

.title-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
}

.detail-meta {
  display: flex;
  align-items: center;
  max-width: 92ch;
  gap: var(--s2) var(--s4);
  margin-top: var(--s3);
  color: var(--ink-muted);
  font-size: 12.5px;
  flex-wrap: wrap;
}

.detail-meta > * {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.detail-meta strong {
  color: var(--ink);
  font-weight: 620;
}

.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-faint);
  font-size: 12.5px;
  flex-wrap: wrap;
}

.breadcrumb li + li::before {
  margin-right: 6px;
  content: "/";
  color: var(--line-strong);
}

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

.breadcrumb [aria-current="page"] {
  color: var(--ink);
}

/* ---------------------------------------------------- tabs and segments ---- */

.tabs {
  display: flex;
  gap: var(--s1);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tabs a {
  padding: 9px var(--s3);
  border-bottom: 2px solid transparent;
  color: var(--ink-muted);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

.tabs a:hover {
  color: var(--ink);
  text-decoration: none;
}

.tabs a[aria-current="page"] {
  border-bottom-color: var(--accent);
  color: var(--ink);
}

.segmented {
  display: inline-flex;
  max-width: 100%;
  padding: 3px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface-sunken);
  gap: 2px;
  scrollbar-width: none;
}

.segmented::-webkit-scrollbar {
  display: none;
}

.segmented a {
  padding: 5px 11px;
  border-radius: 8px;
  color: var(--ink-muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.segmented a:hover {
  color: var(--ink);
  text-decoration: none;
}

.segmented a[aria-current="true"] {
  background: var(--surface);
  box-shadow: var(--shadow-1);
  color: var(--ink);
}

.segmented-count {
  display: inline-block;
  min-width: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--line-soft);
  color: var(--ink-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 18px;
  text-align: center;
}

.segmented a[aria-current="true"] .segmented-count {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

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

.card {
  padding: var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.card-quiet {
  background: var(--surface-sunken);
  box-shadow: none;
}

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

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s4);
  margin-bottom: var(--s4);
}

.card-flush .card-head {
  margin: 0;
  padding: var(--s5) var(--s5) var(--s4);
}

.card-head-copy {
  min-width: 0;
}

.card-head-copy .muted {
  margin-top: 4px;
}

.grid {
  display: grid;
  gap: var(--s4);
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
}

.grid > * {
  grid-column: span 12;
}

.span-3 {
  grid-column: span 3;
}

.span-4 {
  grid-column: span 4;
}

.span-5 {
  grid-column: span 5;
}

.span-6 {
  grid-column: span 6;
}

.span-7 {
  grid-column: span 7;
}

.span-8 {
  grid-column: span 8;
}

.span-9 {
  grid-column: span 9;
}

.span-12 {
  grid-column: span 12;
}

/* --------------------------------------------------------------- pills ---- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 8px;
  border: 1px solid var(--idle-line);
  border-radius: var(--r-pill);
  background: var(--idle-soft);
  color: var(--idle);
  font-size: 11.5px;
  font-weight: 640;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.pill-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.pill-neutral {
  border-color: var(--idle-line);
  background: var(--idle-soft);
  color: var(--idle);
}

.pill-success {
  border-color: var(--ok-line);
  background: var(--ok-soft);
  color: var(--ok);
}

.pill-danger {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: var(--danger);
}

.pill-warning {
  border-color: var(--warn-line);
  background: var(--warn-soft);
  color: var(--warn);
}

.pill-running {
  border-color: var(--run-line);
  background: var(--run-soft);
  color: var(--run);
}

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

.pill-violet {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.pill-argos {
  border-color: var(--argos-line);
  background: var(--argos-soft);
  color: var(--argos);
}

.pill-janus {
  border-color: var(--janus-line);
  background: var(--janus-soft);
  color: var(--janus);
}

.pill-stale {
  border-color: var(--line-strong);
  border-style: dashed;
  background: transparent;
  color: var(--ink-faint);
}

@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pill-running .pill-dot {
    animation: none;
  }
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r2);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 620;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

/* `display` on the class beats the user-agent rule, so state it explicitly. */
.button[hidden] {
  display: none;
}

.button:hover {
  border-color: var(--ink-faint);
  background: var(--surface-sunken);
  text-decoration: none;
}

.button-icon {
  display: grid;
  place-items: center;
  margin-left: -2px;
}

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

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

.button-danger {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: var(--danger);
}

.button-danger:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.button-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-muted);
}

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

.button-small {
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--r1);
  font-size: 12.5px;
}

.button[disabled],
.button[aria-disabled="true"] {
  border-color: var(--line);
  background: var(--surface-sunken);
  color: var(--ink-faint);
  cursor: not-allowed;
}

.button-primary[disabled],
.button-primary[aria-disabled="true"] {
  background: var(--surface-sunken);
}

.icon-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--r1);
  background: transparent;
  color: var(--ink-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

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

/* ---------------------------------------------------------------- form ---- */

.field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.field label {
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 620;
}

.field input,
.field select {
  width: 100%;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r2);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
}

.field select {
  padding-right: var(--s6);
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 15px,
    calc(100% - 11px) 15px;
  background-size:
    4px 4px,
    4px 4px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.field input::placeholder {
  color: var(--ink-faint);
}

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

.field-invalid input {
  border-color: var(--danger);
}

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

.field-error {
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
}

.field-grid {
  display: grid;
  gap: var(--s4);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  color: var(--ink-muted);
  font-size: 13px;
  cursor: pointer;
}

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

/* A toggle that sits among toolbar controls: same height, same border, and the
   checked state is the whole chip rather than a small box beside a label. */
.checkbox-chip {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r2);
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 600;
  user-select: none;
}

.checkbox-chip:hover {
  color: var(--ink);
}

.checkbox-chip:has(input:checked) {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.checkbox-chip:has(input:focus-visible) {
  border-color: var(--accent);
  box-shadow: var(--ring);
}

.checkbox-chip input {
  width: 14px;
  height: 14px;
}

/* A compact GET form: controls and their submit on one line. */
.filters {
  display: flex;
  align-items: flex-end;
  gap: var(--s2);
  flex-wrap: wrap;
}

/* Toolbar: search plus scoping controls on one line. */
.toolbar {
  display: flex;
  align-items: flex-end;
  gap: var(--s3);
  flex-wrap: wrap;
}

.toolbar .field {
  flex: 1 1 260px;
}

.toolbar .field-select {
  flex: 0 1 170px;
}

/* --------------------------------------------------------------- tiles ---- */

.tiles {
  display: grid;
  gap: var(--s3);
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.tile {
  display: grid;
  gap: 2px;
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.tile-value {
  color: var(--ink);
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

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

.tile-note {
  color: var(--ink-faint);
  font-size: 11.5px;
}

.tile-action {
  color: inherit;
  transition:
    border-color 120ms ease,
    background-color 120ms ease;
}

.tile-action:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  text-decoration: none;
}

.tile-action[aria-current="true"] {
  border-color: var(--accent);
  box-shadow:
    var(--shadow-1),
    inset 0 0 0 1px var(--accent);
}

.tile-danger .tile-value {
  color: var(--danger);
}

.tile-running .tile-value {
  color: var(--run);
}

.tile-success .tile-value {
  color: var(--ok);
}

.tile-warning .tile-value {
  color: var(--warn);
}

/* -------------------------------------------------------------- meters ---- */

.meter {
  display: grid;
  gap: 6px;
}

.meter + .meter {
  margin-top: var(--s4);
}

.meter-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
}

.meter-label {
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 600;
}

.meter-value {
  color: var(--ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.meter-note {
  color: var(--ink-faint);
  font-size: 11.5px;
}

progress {
  display: block;
  width: 100%;
  height: 8px;
  border: none;
  border-radius: var(--r-pill);
  appearance: none;
  background: var(--surface-sunken);
  color: var(--accent);
}

progress::-webkit-progress-bar {
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
}

progress::-webkit-progress-value {
  border-radius: var(--r-pill);
  background: var(--accent);
  transition: width 240ms ease;
}

progress::-moz-progress-bar {
  border-radius: var(--r-pill);
  background: var(--accent);
}

.meter-success::-webkit-progress-value {
  background: var(--ok);
}

.meter-success::-moz-progress-bar {
  background: var(--ok);
}

.meter-danger::-webkit-progress-value {
  background: var(--danger);
}

.meter-danger::-moz-progress-bar {
  background: var(--danger);
}

.meter-warning::-webkit-progress-value {
  background: var(--warn);
}

.meter-warning::-moz-progress-bar {
  background: var(--warn);
}

.meter-janus::-webkit-progress-value {
  background: var(--janus);
}

.meter-janus::-moz-progress-bar {
  background: var(--janus);
}

/* ------------------------------------------------------------ progress ---- */

.progress-block {
  display: grid;
  gap: 7px;
}

.progress-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
  color: var(--ink-muted);
  font-size: 13px;
}

.progress-copy span:first-child {
  color: var(--ink);
  font-weight: 620;
}

.progress-copy span:last-child {
  font-family: var(--mono);
  font-size: 12px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
}

.progress-indeterminate span {
  display: block;
  width: 34%;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--accent);
  animation: slide 1.4s ease-in-out infinite;
}

@keyframes slide {
  from {
    transform: translateX(-105%);
  }
  to {
    transform: translateX(400%);
  }
}

.spinner-label {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  color: var(--ink-muted);
  font-size: 12.5px;
  font-weight: 600;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

.skeleton-group {
  display: grid;
  gap: var(--s2);
}

.skeleton {
  display: block;
  height: 12px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--surface-sunken), var(--line), var(--surface-sunken));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.skeleton-1 {
  width: 100%;
}

.skeleton-2 {
  width: 82%;
}

.skeleton-3 {
  width: 64%;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner,
  .skeleton,
  .progress-indeterminate span {
    animation: none;
  }
}

/* --------------------------------------------------- key/value evidence ---- */

.kv {
  display: grid;
  gap: var(--s3) var(--s5);
}

.kv-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.kv-rows {
  gap: 0;
}

.kv-entry {
  min-width: 0;
}

.kv-rows .kv-entry {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s4);
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}

.kv-rows .kv-entry:last-child {
  border-bottom: none;
}

.kv dt {
  color: var(--ink-faint);
  font-size: 11.5px;
  font-weight: 620;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.kv dd {
  color: var(--ink);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.kv-rows dd {
  text-align: right;
}

.ref {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-sunken);
  color: var(--ink-muted);
  font-size: 11.5px;
  vertical-align: baseline;
}

.ref-path {
  overflow-wrap: anywhere;
  white-space: normal;
}

/* --------------------------------------------------------- disclosures ---- */

.disclosure {
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface);
}

.disclosure + .disclosure {
  margin-top: var(--s2);
}

.disclosure > summary {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 10px var(--s4);
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 620;
  cursor: pointer;
  list-style: none;
}

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

.disclosure > summary::before {
  border: 4px solid transparent;
  border-left-color: var(--ink-faint);
  content: "";
  transition: transform 120ms ease;
}

.disclosure[open] > summary::before {
  transform: rotate(90deg) translateX(-1px);
}

.disclosure > summary:hover {
  color: var(--ink);
}

.disclosure-note {
  margin-left: auto;
  color: var(--ink-faint);
  font-size: 11.5px;
  font-weight: 500;
}

.disclosure-body {
  padding: 0 var(--s4) var(--s4);
}

/* ------------------------------------------------------------- notices ---- */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: var(--s3) var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface-sunken);
  color: var(--ink-muted);
  font-size: 13px;
}

.notice strong {
  color: var(--ink);
  font-weight: 640;
}

.notice p {
  margin-top: 2px;
}

.notice ul {
  margin-top: var(--s2);
  display: grid;
  gap: 4px;
  list-style: disc;
  padding-left: var(--s4);
}

.notice-mark {
  width: 6px;
  height: 6px;
  flex: none;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
}

.notice-success {
  border-color: var(--ok-line);
  background: var(--ok-soft);
}

.notice-success .notice-mark {
  background: var(--ok);
}

.notice-warning {
  border-color: var(--warn-line);
  background: var(--warn-soft);
}

.notice-warning .notice-mark {
  background: var(--warn);
}

.notice-danger {
  border-color: var(--danger-line);
  background: var(--danger-soft);
}

.notice-danger .notice-mark {
  background: var(--danger);
}

.callout {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface-sunken);
  font-size: 13px;
}

.callout strong {
  color: var(--ink);
}

.callout p {
  margin-top: 3px;
  color: var(--ink-muted);
}

.callout-mark {
  display: grid;
  width: 24px;
  height: 24px;
  flex: none;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
}

/* -------------------------------------------------------- empty states ---- */

.empty-state {
  display: grid;
  justify-items: center;
  gap: var(--s3);
  padding: var(--s12) var(--s6);
  text-align: center;
}

.empty-state p {
  max-width: 56ch;
  color: var(--ink-muted);
  font-size: 13.5px;
}

.empty-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface-sunken);
  color: var(--ink-faint);
}

.empty-state-danger .empty-mark {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: var(--danger);
}

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

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.responsive-table th {
  padding: 0 var(--s4) var(--s2);
  border-bottom: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 11.5px;
  font-weight: 620;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.responsive-table td {
  padding: 11px var(--s4);
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
  vertical-align: middle;
}

.responsive-table tbody tr:last-child td {
  border-bottom: none;
}

.responsive-table tbody tr:hover {
  background: var(--surface-sunken);
}

.card-flush .responsive-table th:first-child,
.card-flush .responsive-table td:first-child {
  padding-left: var(--s5);
}

.card-flush .responsive-table th:last-child,
.card-flush .responsive-table td:last-child {
  padding-right: var(--s5);
}

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

.table-title {
  display: block;
  color: var(--ink);
  font-weight: 640;
}

.table-subtitle {
  display: block;
  color: var(--ink-faint);
  font-size: 12px;
}

/* --------------------------------------------------------------- toast ---- */

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  max-width: 420px;
  padding: var(--s3) var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface-raised);
  box-shadow: var(--shadow-2);
  font-size: 13px;
}

.toast p {
  margin-top: 2px;
  color: var(--ink-muted);
}

.toast-icon {
  display: grid;
  width: 20px;
  height: 20px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--idle-soft);
  color: var(--idle);
  font-size: 11px;
  font-weight: 700;
}

.toast-success .toast-icon {
  background: var(--ok-soft);
  color: var(--ok);
}

.toast-danger .toast-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

/* --------------------------------------------------------------- modal ---- */

.modal {
  width: min(520px, calc(100vw - var(--s8)));
  padding: var(--s6);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  background: var(--surface-raised);
  box-shadow: var(--shadow-3);
  color: var(--ink);
}

.modal::backdrop {
  background: rgba(9, 10, 16, 0.55);
  backdrop-filter: blur(2px);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s4);
  margin-bottom: var(--s3);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s2);
  margin-top: var(--s5);
}

/* ------------------------------------------------------------ timeline ---- */

.timeline {
  display: grid;
  gap: 0;
}

.timeline-item {
  display: grid;
  gap: 2px var(--s3);
  grid-template-columns: 14px minmax(0, 1fr) auto;
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--line-soft);
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-dot {
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border: 2px solid var(--idle);
  border-radius: 50%;
  background: var(--surface);
}

.timeline-item[data-state="success"] .timeline-dot {
  border-color: var(--ok);
  background: var(--ok);
}

.timeline-item[data-state="failed"] .timeline-dot {
  border-color: var(--danger);
  background: var(--danger);
}

.timeline-item[data-state="active"] .timeline-dot {
  border-color: var(--run);
  background: var(--run-soft);
}

.timeline-item[data-state="cancelled"] .timeline-dot,
.timeline-item[data-state="pending"] .timeline-dot {
  border-color: var(--line-strong);
  background: var(--surface);
}

.timeline-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.timeline-copy strong {
  font-size: 13.5px;
  font-weight: 620;
}

.timeline-copy span {
  color: var(--ink-muted);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

time {
  color: var(--ink-faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* -------------------------------------------------------- login screen ---- */

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: var(--s6);
  background:
    radial-gradient(80% 60% at 15% 0%, var(--accent-soft), transparent 70%),
    radial-gradient(70% 60% at 100% 100%, var(--janus-soft), transparent 65%), var(--canvas);
}

.login-page {
  width: 100%;
  max-width: 980px;
}

.login-shell {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r3);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
}

.login-card {
  display: grid;
  align-content: center;
  gap: var(--s3);
  padding: var(--s10);
}

.login-card h1 {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 1.9rem);
}

.login-card .muted {
  max-width: 42ch;
  font-size: 13.5px;
}

.login-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--s4);
  color: var(--ink);
  font-size: 14px;
  font-weight: 680;
}

.login-card .button-row {
  margin-top: var(--s2);
}

.login-card .button-primary {
  min-height: 40px;
  padding: 0 var(--s5);
  font-size: 14px;
}

.login-visual {
  display: grid;
  align-content: center;
  gap: var(--s3);
  padding: var(--s10) var(--s8);
  border-left: 1px solid var(--line);
  background: var(--surface-sunken);
}

.login-visual h2 {
  font-size: 1.25rem;
  line-height: 1.3;
}

.login-visual p {
  color: var(--ink-muted);
  font-size: 13.5px;
}

.login-flow {
  display: grid;
  gap: var(--s2);
  margin-bottom: var(--s4);
}

.login-step {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 10px var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface);
  font-size: 13px;
}

.login-step-mark {
  display: grid;
  width: 22px;
  height: 22px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
}

.login-step-argos .login-step-mark {
  background: var(--argos-soft);
  color: var(--argos);
}

.login-step-janus .login-step-mark {
  background: var(--janus-soft);
  color: var(--janus);
}

.login-step strong {
  font-weight: 620;
}

.login-step span {
  color: var(--ink-faint);
  font-size: 12px;
}

.github-mark {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: currentColor;
  color: inherit;
  font-size: 9px;
  font-weight: 800;
}

/* ------------------------------------------------------ preview banner ---- */

.demo-banner {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 8px var(--s3);
  margin-bottom: var(--s5);
  border: 1px dashed var(--accent-line);
  border-radius: var(--r2);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  flex-wrap: wrap;
}

.demo-banner strong {
  font-weight: 660;
}

.demo-mark {
  display: inline-grid;
  padding: 2px 7px;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--ink-on-accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.demo-banner a {
  margin-left: auto;
  font-weight: 620;
}

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

@media (max-width: 1080px) {
  :root {
    --rail-w: 210px;
  }

  .shell,
  .shell-narrow {
    padding: var(--s6) var(--s5) var(--s10);
  }

  .nav-hint {
    display: none;
  }

  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-9 {
    grid-column: span 12;
  }
}

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

  .rail {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    height: auto;
    gap: var(--s2) var(--s3);
    padding: 10px var(--s4);
    border-right: none;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand nav foot";
    align-items: center;
    backdrop-filter: blur(10px);
  }

  .brand {
    grid-area: brand;
  }

  .rail-nav {
    display: flex;
    justify-content: center;
    gap: 2px;
    overflow-x: auto;
    grid-area: nav;
    scrollbar-width: none;
  }

  .rail-nav::-webkit-scrollbar {
    display: none;
  }

  .rail-foot {
    grid-area: foot;
  }

  .brand-note {
    display: none;
  }

  .rail-nav a {
    padding: 7px 10px;
  }

  .rail-foot {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    border: none;
  }

  /* The portrait alone carries the menu; the name reappears inside the panel. */
  .viewer-copy,
  .sign-out .button-icon {
    display: none;
  }

  .account-panel .viewer-copy {
    display: grid;
  }

  .account-identity {
    display: flex;
  }

  .account-trigger {
    padding: 4px;
  }

  .account-panel {
    top: calc(100% + 10px);
    right: 0;
    bottom: auto;
    left: auto;
  }

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

  .login-visual {
    border-top: 1px solid var(--line);
    border-left: none;
  }

  .login-card,
  .login-visual {
    padding: var(--s6);
  }
}

@media (max-width: 640px) {
  /* The navigation earns its own row instead of competing with the identity. */
  .rail {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "brand foot" "nav nav";
  }

  .rail-nav {
    justify-content: flex-start;
  }

  .rail-foot {
    justify-content: flex-end;
  }
}

@media (max-width: 560px) {
  .shell,
  .shell-narrow {
    padding: var(--s5) var(--s4) var(--s8);
  }

  .card {
    padding: var(--s4);
  }

  .nav-label {
    font-size: 12.5px;
  }

  .tiles {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .tile-value {
    font-size: 20px;
  }

  .toolbar .field,
  .toolbar .field-select,
  .toolbar .button {
    flex: 1 1 100%;
  }
}

/*
 * Dashboard compositions.
 *
 * The design system in packages/ui owns the vocabulary; this file owns the
 * screens built from it — the review queue, the verdict surfaces, the run
 * evidence, and the states the progressive scripts drive.
 */

.page-body > * + * {
  margin-top: var(--s5);
}

.card-body-pad {
  padding: 0 var(--s5) var(--s5);
}

/* Sits under the failure card it explains, quiet enough to stay out of the way
 * of a reader who only wants to retry. */
.api-failure {
  margin-top: var(--s4);
  text-align: center;
}

.bullets {
  display: grid;
  gap: 4px;
  padding-left: var(--s4);
  list-style: disc;
  color: var(--ink-muted);
  font-size: 13px;
}

/* --------------------------------------------------------- review queue ---- */

.dashboard-refresh-status {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.38rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dashboard-refresh-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}

.dashboard-refresh-status[data-refresh-state="delayed"] i {
  background: var(--warn);
}

.dashboard-refresh-status[data-refresh-state="stale"] {
  color: var(--danger);
}

.dashboard-refresh-status[data-refresh-state="stale"] i {
  background: var(--danger);
}

.dashboard-refresh-status [data-dashboard-refresh-message] {
  color: var(--danger);
  white-space: normal;
}

.dashboard-refresh-now {
  border: 0;
  border-bottom: 1px solid currentColor;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.dashboard-refresh-now:disabled {
  cursor: wait;
  opacity: 0.7;
}

.argos-activity {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r3);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.argos-activity-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s4) var(--s5) var(--s3);
}

.argos-activity-head h2 {
  margin-top: 2px;
  font-size: 1rem;
}

.argos-activity-head .small {
  margin-top: 3px;
}

.argos-activity-now {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s2) var(--s4);
  color: var(--ink-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}

.argos-activity-now span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.argos-activity-now strong {
  color: var(--ink);
  font-size: 13px;
}

.argos-activity-key {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--idle);
}

.argos-activity-key-queued {
  background: var(--warn);
}

.argos-activity-key-running {
  background: var(--run);
}

.argos-activity-plot {
  padding: 0 var(--s5) var(--s3);
}

.argos-activity-plot svg {
  display: block;
  width: 100%;
  height: 118px;
  overflow: visible;
}

.argos-activity-grid line {
  stroke: var(--line-soft);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.argos-activity-grid .argos-activity-capacity {
  stroke: var(--line);
  stroke-dasharray: 4 5;
}

.argos-activity-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.argos-activity-line-queued {
  stroke: var(--warn);
}

.argos-activity-line-running {
  stroke: var(--run);
}

.argos-activity-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--ink-faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* Toolbar and list are one panel: they load together on a live search. */
.queue {
  display: grid;
  gap: var(--s5);
}

@media (max-width: 680px) {
  .argos-activity-head {
    display: grid;
  }

  .argos-activity-now {
    justify-content: flex-start;
  }

  .argos-activity-plot svg {
    height: 96px;
  }
}

.queue-toolbar {
  display: grid;
  gap: var(--s3);
}

.queue-controls {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
}

.queue-controls .field {
  flex: 0 1 200px;
}

.queue-controls .field-select select {
  min-width: 0;
}

.queue-search {
  position: relative;
  flex: 1 1 280px;
  min-width: 200px;
}

.queue-search .field {
  flex: 1 1 auto;
}

.queue-search input {
  padding-left: 34px;
}

.queue-search input::-webkit-search-cancel-button {
  cursor: pointer;
}

.queue-search-icon {
  position: absolute;
  top: 50%;
  left: 11px;
  display: inline-flex;
  color: var(--ink-faint);
  transform: translateY(-50%);
  pointer-events: none;
}

.queue-search:focus-within .queue-search-icon {
  color: var(--accent);
}

/* The submit is the no-script path: once the enhancement listens to the
   fields, the queue follows them and a button would only add a second way to
   do the same thing. */
:root[data-progressive="ready"] .queue-submit {
  display: none;
}

.queue-toolbar .segmented {
  justify-self: start;
}

.queue-group + .queue-group {
  margin-top: var(--s6);
}

.queue-group-head {
  display: flex;
  align-items: baseline;
  gap: var(--s3);
  margin-bottom: var(--s3);
  padding: 0 var(--s1);
  flex-wrap: wrap;
}

.queue-group-head h2 {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: 0.9375rem;
}

.queue-group-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--idle);
}

.queue-group-dot-danger {
  background: var(--danger);
}

.queue-group-dot-running {
  background: var(--run);
}

.queue-group-dot-success {
  background: var(--ok);
}

.queue-group-dot-warning {
  background: var(--warn);
}

.queue-group-count {
  color: var(--ink-faint);
  font-size: 13px;
  font-weight: 560;
  font-variant-numeric: tabular-nums;
}

.queue-group-head p {
  flex: 1 1 auto;
}

.queue-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s4);
  margin-top: var(--s5);
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.queue-pagination a {
  color: var(--accent);
  font-weight: 650;
}

.queue-pagination [aria-disabled="true"] {
  color: var(--ink-faint);
}

.queue-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r3);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.queue-item {
  position: relative;
  display: grid;
  align-items: center;
  gap: var(--s3) var(--s5);
  padding: 13px var(--s5);
  border-bottom: 1px solid var(--line-soft);
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.queue-item:last-child {
  border-bottom: none;
}

.queue-item:hover {
  background: var(--surface-sunken);
}

.queue-main {
  min-width: 0;
}

.queue-title {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 620;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* One semantic destination per row, with the title link retaining the entire
   row's pointer target and a visible full-row keyboard focus indicator. */
.queue-title::after {
  position: absolute;
  z-index: 1;
  content: "";
  inset: 0;
}

.queue-title:focus-visible {
  outline: none;
}

.queue-title:focus-visible::after {
  border-radius: var(--r3);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.queue-meta {
  display: flex;
  align-items: center;
  gap: var(--s1) var(--s3);
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 12px;
  flex-wrap: wrap;
}

.queue-repo {
  color: var(--ink-muted);
  font-weight: 600;
}

.queue-number {
  color: var(--ink-faint);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Row qualifiers: quiet text, one shade up from the meta line. */
.flag {
  color: var(--ink-muted);
  font-weight: 600;
}

.flag-stale {
  color: var(--warn);
}

.finding-counts {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}

.finding-counts .count {
  color: var(--ink-muted);
  font-weight: 600;
}

.finding-counts .count-danger {
  color: var(--danger);
}

.finding-counts .count-warning {
  color: var(--warn);
}

.finding-counts .dot {
  color: var(--ink-faint);
}

.pair {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-faint);
  font-size: 11.5px;
}

.pair-arrow {
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1;
}

.queue-lanes {
  display: flex;
  /* Lane names share one baseline even when only one lane has a detail. */
  align-items: flex-start;
  gap: var(--s4);
}

.lane {
  display: grid;
  gap: 3px;
  justify-items: start;
}

.lane-name {
  color: var(--ink-faint);
  font-size: 10.5px;
  font-weight: 620;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lane-detail {
  max-width: 180px;
  color: var(--ink-faint);
  font-size: 11.5px;
}

.queue-open {
  display: grid;
  width: 30px;
  height: 30px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r1);
  color: var(--ink-faint);
  pointer-events: none;
}

.queue-item:hover .queue-open,
.queue-item:focus-within .queue-open {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.rerun-unavailable {
  max-width: 34rem;
  margin: 2px 0 0;
  flex-basis: 100%;
}

/* ------------------------------------------------------------- verdicts ---- */

/* Title-side qualifiers of a pull request: open/closed, draft, outdated. */
.title-flags {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pair-meta-label {
  color: var(--ink-faint);
  font-size: 12px;
}

.pair-meta .pair {
  font-size: 12px;
}

.verdict {
  display: grid;
  gap: var(--s2);
  align-content: start;
  border-left: 3px solid var(--idle);
}

.verdict-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}

.verdict-head .eyebrow {
  margin: 0;
}

.verdict-line {
  font-size: 1.0625rem;
  font-weight: 640;
  letter-spacing: -0.012em;
  line-height: 1.35;
}

.verdict-detail {
  color: var(--ink-muted);
  font-size: 13px;
}

.verdict-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2) var(--s4);
  margin-top: var(--s2);
  padding-top: var(--s3);
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
  flex-wrap: wrap;
}

.verdict-foot .text-link {
  margin-left: auto;
}

.verdict-ok {
  border-left-color: var(--ok);
}

.verdict-blocked {
  border-left-color: var(--danger);
}

.verdict-blocked .verdict-line {
  color: var(--danger);
}

.verdict-attention {
  border-left-color: var(--warn);
}

.verdict-busy {
  border-left-color: var(--run);
}

/* ------------------------------------------------------------- findings ---- */

.findings,
.scenarios {
  display: grid;
}

.finding {
  display: grid;
  align-items: start;
  gap: var(--s3) var(--s4);
  padding: var(--s4) 0 var(--s4) var(--s4);
  border-bottom: 1px solid var(--line-soft);
  border-left: 3px solid var(--line);
  grid-template-columns: minmax(0, 1fr) auto;
}

.finding:last-child {
  border-bottom: none;
}

.finding-blocking {
  border-left-color: var(--danger);
}

.finding-advisory {
  border-left-color: var(--warn);
}

.finding-waived {
  border-left-color: var(--line-strong);
}

.finding-resolved {
  border-left-color: var(--ok);
  background: var(--ok-soft);
}

.finding-body {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.finding-head {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
}

.finding-head strong {
  font-size: 14px;
  font-weight: 650;
}

.finding-waived .finding-head,
.finding-resolved .finding-head {
  color: var(--ink-muted);
}

.finding-explanation {
  color: var(--ink-muted);
  font-size: 13px;
}

.scenario {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}

.scenario:last-child {
  border-bottom: none;
}

.scenario-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.scenario-copy strong {
  font-size: 13.5px;
  font-weight: 620;
}

/* -------------------------------------------------------- run evidence ---- */

/* Progress and identity of a run share one card: what is happening on the
   left, what exactly is running on the right. */
.run-overview {
  display: grid;
  gap: var(--s5) var(--s7);
  grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr);
}

.run-overview-progress {
  min-width: 0;
}

.run-overview-facts {
  display: grid;
  align-content: start;
  gap: var(--s3);
  padding-left: var(--s6);
  border-left: 1px solid var(--line-soft);
}

.run-overview-facts .kv-rows .kv-entry:first-child {
  padding-top: 0;
}

.run-progress-terminal {
  display: grid;
  gap: 2px;
  padding: var(--s3) var(--s4);
  border: 1px solid var(--line-soft);
  border-radius: var(--r2);
  background: var(--surface-sunken);
}

.run-stream-state {
  margin-top: var(--s3);
  font-variant-numeric: tabular-nums;
}

.run-diagnostic {
  border-color: var(--danger-line);
  background: var(--danger-soft);
}

.run-diagnostic .kv-entry {
  padding: var(--s3);
  border: 1px solid var(--danger-line);
  border-radius: var(--r2);
  background: var(--surface);
}

.record-list {
  display: grid;
  gap: var(--s3);
}

.record {
  display: grid;
  gap: var(--s3);
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface-sunken);
}

.record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s4);
}

.record-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.record-copy strong {
  font-size: 13.5px;
  font-weight: 640;
}

.record-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
}

.record-foot-copy {
  display: grid;
  gap: 3px;
}

.record-error {
  color: var(--danger);
  font-size: 12px;
}

.record-link {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.record .kv-grid {
  gap: var(--s2) var(--s4);
}

.record .kv-rows {
  padding: 0;
}

/* ------------------------------------------------------------- QA proof ---- */

.qa-evidence {
  display: grid;
  gap: var(--s4);
}

.qa-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s4);
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--line-soft);
}

.qa-summary h3 {
  max-width: 70ch;
}

.qa-scenarios {
  display: grid;
  gap: var(--s3);
}

.qa-scenario {
  display: grid;
  gap: var(--s3);
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r2);
}

.qa-steps {
  display: grid;
  gap: 2px;
}

.qa-step {
  display: grid;
  gap: var(--s3);
  padding: var(--s3);
  border-radius: var(--r2);
  background: var(--surface-sunken);
  grid-template-columns: 22px minmax(0, 1fr);
}

.qa-step[data-outcome="failed"] {
  background: var(--danger-soft);
}

.qa-step[data-outcome="skipped"] {
  background: var(--warn-soft);
}

.qa-step-index {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
}

.qa-step-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
  font-size: 13px;
}

.qa-step-copy .title-row {
  gap: var(--s2);
}

.qa-step-copy code {
  overflow-wrap: anywhere;
  color: var(--ink-muted);
}

.qa-step-copy p {
  color: var(--ink);
}

.qa-step-copy .muted {
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------ artifacts ---- */

.artifact-summary {
  margin-bottom: var(--s4);
}

.artifact-grid {
  display: grid;
  gap: var(--s3);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: start;
}

.artifact-card {
  display: grid;
  gap: var(--s3);
  align-content: start;
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface-sunken);
}

.artifact-card .button {
  justify-self: start;
}

.artifact-proof {
  display: grid;
  gap: 6px;
  margin: 0;
  justify-items: start;
}

.artifact-proof img {
  width: 100%;
  max-width: 480px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface);
}

.artifact-proof figcaption {
  color: var(--ink-faint);
  font-size: 11.5px;
}

/* -------------------------------------------------- design system canvas --- */

.component-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
}

.component-row + .component-row,
.component-row + .skeleton-group,
.field-grid + .checkbox,
.tiles + .grid,
.kv + .disclosure {
  margin-top: var(--s4);
}

.quota-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s4);
}

.quota-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s3);
}

[data-codex-recheck-status]:empty {
  display: none;
}

.quota-recheck-help,
[data-codex-recheck-status] {
  margin-bottom: var(--s4);
}

.quota-slot {
  min-width: 0;
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--surface-sunken);
}

.quota-slot-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s4);
}

@media (max-width: 900px) {
  .quota-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .quota-panel .card-head {
    flex-direction: column;
  }

  .quota-actions button {
    min-height: 44px;
  }

  .quota-slots {
    grid-template-columns: 1fr;
  }
}

.component-measures {
  margin-top: var(--s4);
}

.swatch-grid {
  display: grid;
  gap: var(--s3);
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.swatch {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.swatch-chip {
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: var(--r1);
}

.swatch-copy {
  display: grid;
  min-width: 0;
}

.swatch-accent {
  background: var(--accent);
}

.swatch-ok {
  background: var(--ok);
}

.swatch-run {
  background: var(--run);
}

.swatch-warn {
  background: var(--warn);
}

.swatch-danger {
  background: var(--danger);
}

.swatch-idle {
  background: var(--idle);
}

.swatch-argos {
  background: var(--argos);
}

.swatch-janus {
  background: var(--janus);
}

/* --------------------------------------------------- progressive states ---- */

.navigation-progress {
  position: fixed;
  z-index: 60;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
}

.navigation-progress[hidden] {
  display: none;
}

.navigation-progress::after {
  display: block;
  width: 38%;
  height: 100%;
  background: var(--accent);
  content: "";
  animation: navigation-progress 900ms ease-in-out infinite;
}

@keyframes navigation-progress {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(365%);
  }
}

.navigation-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s3) var(--s4);
  margin-bottom: var(--s4);
  border: 1px solid var(--danger-line);
  border-radius: var(--r2);
  background: var(--danger-soft);
  font-size: 13px;
}

.navigation-error p {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 12px;
}

[data-navigation-state="loading"] .queue-list,
[data-navigation-state="loading"] .queue[aria-busy="true"] .empty-state,
[data-navigation-state="loading"] .card[aria-busy="true"] {
  opacity: 0.72;
  transition: opacity 160ms ease 120ms;
}

.run-secondary-pending {
  grid-column: 1 / -1;
  padding: var(--s2) 0;
}

.run-secondary-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  min-height: 96px;
  border-color: var(--danger-line);
  background: var(--danger-soft);
}

.run-secondary-error p {
  margin-top: var(--s1);
  color: var(--ink-muted);
}

.codex-report,
.codex-trace pre {
  max-height: 36rem;
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface-sunken);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.codex-trace {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding-left: 1.5rem;
}

.codex-trace-disclosure > summary {
  cursor: pointer;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface-sunken);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.codex-trace-disclosure[open] > summary {
  margin-bottom: 1rem;
}

.codex-trace summary {
  cursor: pointer;
  overflow-wrap: anywhere;
}

.codex-trace-sequence {
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

/* Below-fold evidence panels keep their server markup and semantics while the
   browser defers layout and paint until they approach the viewport. */
.grid[data-run-secondary] > section:nth-child(n + 3) {
  content-visibility: auto;
  contain-intrinsic-size: auto 320px;
}

/* Secondary evidence regions replace themselves locally; the core pull
   document above them is never re-rendered by an evidence outcome. */
.evidence-pending {
  display: grid;
  gap: var(--s3);
  justify-items: start;
}

.evidence-error {
  display: grid;
  gap: var(--s2);
  justify-items: start;
  margin-top: var(--s3);
}

.evidence-error p {
  color: var(--ink-muted);
  font-size: 12px;
}

.evidence-region[data-evidence-state="loading"] {
  border-style: dashed;
}

.responsive-table .mono,
.responsive-table .ref {
  overflow-wrap: anywhere;
  white-space: normal;
}

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

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

  .run-overview-facts {
    padding-top: var(--s4);
    padding-left: 0;
    border-top: 1px solid var(--line-soft);
    border-left: none;
  }

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

  .queue-lanes {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .queue-title {
    white-space: normal;
  }

  .qa-summary,
  .record-head,
  .record-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s3);
  }

  .record-link {
    justify-items: start;
  }

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

  .finding .button {
    justify-self: start;
  }
}

@media (max-width: 640px) {
  /* The row title is already the link; the chevron stops earning its space. */
  .queue-open {
    display: none;
  }

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

  .queue-search {
    flex-basis: 100%;
  }
}

@media (max-width: 560px) {
  .queue-item {
    padding: var(--s4);
  }

  .queue-lanes {
    gap: var(--s3);
    flex-wrap: wrap;
  }
}
