/* SNPSuite Portal visual theme. Loaded AFTER the Helix Bootstrap CSS (see
   app/layout.tsx) so these overrides win. Pure CSS + Bootstrap variable overrides, so it
   restyles every screen (buttons, tables, badges, cards, forms) without touching each one. */

/* Self-hosted Othram Sans 1.0: use the supplied static weights. */
@font-face {
  font-family: "Othram Sans";
  src: url("/brand/fonts/othram-sans-1.0/OthramSans-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Othram Sans";
  src: url("/brand/fonts/othram-sans-1.0/OthramSans-Medium.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Othram Sans";
  src: url("/brand/fonts/othram-sans-1.0/OthramSans-SemiBold.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Othram Sans";
  src: url("/brand/fonts/othram-sans-1.0/OthramSans-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  /* Othram brand anchors from othram-site-style-guide.md */
  --brand: #a700fe;
  --brand-700: #8f00e0;
  --brand-300: #b72eff;
  --brand-text: #dd9aff;
  --accent: #b72eff;
  --accent-600: #8f00e0;
  --page-bg: #09090b;
  --surface: #18181b;
  --surface-subtle: #111113;
  --surface-hover: #242429;
  --line: #323238;
  --line-strong: #4a4a53;
  --ink: #ffffff;
  --ink-soft: #c8c8c8;
  --muted-brand: #8f8f8f;
  --muted: #a3a3a3;
  --focus-ring: rgba(183, 46, 255, 0.38);
  --shadow-surface: 0 16px 42px rgba(0, 0, 0, 0.24);
  --shadow-float: 0 24px 64px rgba(0, 0, 0, 0.52);
  --tooltip-bg: #242429;
  --tooltip-ink: #ffffff;

  /* Semantic state colors remain distinct from brand purple. */
  --ok: #28a745;      --ok-ink: #6ed987; --ok-bg: rgba(40, 167, 69, 0.16);
  --warn: #f0c24b;    --warn-bg: rgba(240, 194, 75, 0.14);
  --bad: #ff6b81;     --bad-bg: rgba(255, 107, 129, 0.14);
  --info: #6ea8fe;    --info-bg: rgba(110, 168, 254, 0.14);
  --neutral: #c8c8c8; --neutral-bg: rgba(200, 200, 200, 0.1);

  /* Bootstrap variable overrides (cascade app-wide) */
  --bs-primary: var(--brand);
  --bs-primary-rgb: 167, 0, 254;
  --bs-link-color: var(--brand-text);
  --bs-link-color-rgb: 221, 154, 255;
  --bs-link-hover-color: var(--ink);
  --bs-body-bg: var(--page-bg);
  --bs-body-color: var(--ink-soft);
  --bs-body-color-rgb: 200, 200, 200;
  --bs-emphasis-color: var(--ink);
  --bs-emphasis-color-rgb: 255, 255, 255;
  --bs-secondary-bg: var(--surface);
  --bs-tertiary-bg: var(--surface-subtle);
  --bs-border-color: var(--line);
  --bs-border-radius: 0.5rem;
  --bs-border-radius-sm: 0.375rem;
  --bs-secondary-color: var(--muted);
  --bs-secondary-color-rgb: 163, 163, 163;
  --bs-tertiary-color: var(--muted);
  --bs-body-font-family: "Othram Sans", -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

html {
  background: var(--page-bg);
  color-scheme: dark;
}
body.app-body {
  background:
    radial-gradient(circle at 50% -18rem, rgba(167, 0, 254, 0.08), transparent 38rem),
    var(--page-bg);
  color: var(--ink-soft);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Bootstrap tooltips explicitly name the legacy font rather than inheriting it. */
.tooltip { font-family: var(--bs-body-font-family); }

button, input, select, textarea { font: inherit; }
a, button, .form-control, .form-select { transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease; }
a { color: var(--brand-text); }
a:hover { color: var(--ink); }
h1, h2, h3, h4, h5, h6 { color: var(--ink); }
code { color: #d380ff; }
::selection { background: rgba(167, 0, 254, 0.42); color: var(--ink); }
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--brand-300);
  outline-offset: 2px;
}

/* ---------- top app bar ---------- */
.skip-link {
  position: fixed;
  top: 0.55rem;
  left: 0.75rem;
  z-index: 1000;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--brand-300);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
.app-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: clamp(0.85rem, 2vw, 1.65rem);
  min-height: 68px;
  padding: 0.65rem clamp(1rem, 3vw, 2rem);
  background: rgba(17, 17, 19, 0.94);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand-mark {
  width: 31px; height: 31px; flex: none;
  color: #fff;
  display: grid; place-items: center;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-wordmark { display: block; width: 96px; height: auto; flex: none; }
.brand-divider { width: 1px; height: 28px; flex: none; background: var(--line); }
.brand-name { line-height: 1.05; }
.brand-name b { color: var(--ink); font-size: 0.98rem; font-weight: 500; letter-spacing: -0.01em; }

.app-nav { display: flex; align-self: stretch; gap: 0.2rem; }
.app-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  padding: 0.55rem 0.78rem; border-radius: 7px;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.88rem;
  transition: background 0.15s, color 0.15s;
}
.app-nav a:hover { color: var(--ink-soft); background: var(--surface-hover); }
.app-nav a.active { color: var(--ink); background: transparent; }
.app-nav a.active::after {
  content: '';
  position: absolute;
  right: 0.75rem;
  bottom: 0.08rem;
  left: 0.75rem;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}
.app-nav a i { width: 1rem; color: var(--muted); font-size: 0.78rem; text-align: center; }
.app-nav-label { display: block; line-height: 1.05; transform: translateY(1px); }
.app-nav a.active i { color: var(--brand-text); }

.user-chip { display: flex; align-items: center; gap: 0.55rem; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  border: 1px solid var(--line-strong);
  background: var(--surface-hover);
  color: #fff; font-weight: 700; font-size: 0.85rem; display: grid; place-items: center;
}
.user-meta { line-height: 1.1; text-align: right; }
.user-meta b { font-size: 0.82rem; color: var(--ink); font-weight: 500; }
.user-meta span { display: block; font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.btn-ghost {
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink-soft);
  border-radius: 7px; padding: 0.38rem 0.72rem; font-size: 0.82rem; font-weight: 500;
}
.btn-ghost:hover { color: var(--ink); border-color: var(--brand-300); background: var(--surface-hover); }
.account-menu { position: relative; }
.account-menu > summary {
  display: flex;
  align-items: center;
  gap: 0.58rem;
  min-width: 0;
  padding: 0.28rem 0.42rem;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--ink-soft);
  cursor: pointer;
  list-style: none;
}
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary:hover,
.account-menu[open] > summary {
  border-color: var(--line);
  background: var(--surface-hover);
}
.account-menu-chevron { color: var(--muted); font-size: 0.65rem; transition: transform 0.16s ease; }
.account-menu[open] .account-menu-chevron { transform: rotate(180deg); }
.account-menu-panel {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: 0;
  z-index: 180;
  width: min(310px, calc(100vw - 1.5rem));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow-float);
}
.account-menu-identity { display: grid; gap: 0.18rem; padding: 1rem; border-bottom: 1px solid var(--line); }
.account-menu-identity strong { overflow: hidden; color: var(--ink); font-size: 0.86rem; text-overflow: ellipsis; }
.account-menu-identity > span:last-child { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.account-menu-label { color: var(--muted); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.account-menu-panel form { margin: 0; }
.account-menu-action {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.65rem;
  padding: 0.78rem 1rem;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.84rem;
  text-align: left;
}
.account-menu-action:hover { background: var(--surface-hover); color: var(--ink); }
.account-menu-action i { width: 1rem; color: var(--muted); text-align: center; }

/* ---------- page + cards ---------- */
.page { max-width: 1400px; margin: 0 auto; padding: 2.5rem clamp(1rem, 3vw, 2rem) 5rem; }
.page-header { margin-bottom: 1.35rem; }
.page-header h1 { font-size: clamp(1.65rem, 2.6vw, 2.15rem); font-weight: 500; letter-spacing: -0.035em; line-height: 1.12; margin: 0; }
.page-header p { color: var(--ink-soft); max-width: 680px; font-size: 0.94rem; line-height: 1.55; margin: 0.38rem 0 0; }
.page-header-composed { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; }
.page-header-composed.is-compact { margin-bottom: 1rem; }
.page-header-actions { display: flex; flex: none; align-items: center; gap: 0.6rem; }
.page-header-actions .btn { display: inline-flex; align-items: center; gap: 0.48rem; min-height: 40px; padding-right: 1rem; padding-left: 1rem; }
.page-header-actions .btn > i:first-child { margin-right: 0; }
.page-eyebrow {
  display: block;
  margin-bottom: 0.38rem;
  color: var(--brand-text);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.105em;
  text-transform: uppercase;
}
.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  color: var(--muted);
  font-size: 0.78rem;
}
.breadcrumb-item { display: inline-flex; align-items: center; gap: 0.45rem; }
.breadcrumb-item + .breadcrumb-item::before { display: none; }
.breadcrumb-item i { color: var(--line-strong); font-size: 0.54rem; }
.page-breadcrumb a { color: var(--brand-text); text-decoration: none; }
.page-breadcrumb a:hover { color: var(--ink); text-decoration: underline; }

.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-surface);
  padding: clamp(1rem, 2.5vw, 1.4rem);
}
.card { background: var(--surface); border-color: var(--line); border-radius: 10px; box-shadow: var(--shadow-surface); }

/* ---------- tables ---------- */
.table {
  --bs-table-color: var(--ink-soft);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--line);
  --bs-table-striped-color: var(--ink-soft);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.025);
  --bs-table-hover-color: var(--ink);
  --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
}
.table > thead th {
  text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.05em;
  color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line);
}
.table > tbody td { border-color: var(--line); vertical-align: middle; }
.table-hover > tbody > tr:hover > * { background: rgba(255, 255, 255, 0.05); }

/* ---------- badges as pills ---------- */
.badge {
  border-radius: 999px; font-weight: 500; letter-spacing: 0.02em;
  padding: 0.4em 0.7em; font-size: 0.72rem;
}

/* ---------- buttons ---------- */
.btn { border-radius: 7px; font-weight: 500; letter-spacing: 0; }
.btn > i:first-child { margin-right: 0.35rem; }
.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--brand-700);
  --bs-btn-hover-border-color: var(--brand-700);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--brand-700);
  --bs-btn-active-border-color: var(--brand-300);
  --bs-btn-disabled-color: var(--muted);
  --bs-btn-disabled-bg: var(--surface-hover);
  --bs-btn-disabled-border-color: var(--line);
}
.btn-outline-primary {
  --bs-btn-color: var(--brand-text);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--brand-700);
  --bs-btn-active-border-color: var(--brand-700);
}
.btn-outline-secondary {
  --bs-btn-color: var(--ink-soft);
  --bs-btn-border-color: var(--line-strong);
  --bs-btn-hover-color: var(--ink);
  --bs-btn-hover-bg: var(--surface-hover);
  --bs-btn-hover-border-color: var(--muted);
}
.btn-outline-danger {
  --bs-btn-color: var(--bad);
  --bs-btn-border-color: var(--bad);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #b42d43;
  --bs-btn-hover-border-color: #b42d43;
}

/* ---------- forms ---------- */
.form-control, .form-select {
  border-color: var(--line-strong);
  border-radius: 0.5rem;
  background-color: #202024;
  color: var(--ink);
}
.form-control::placeholder { color: var(--ink-soft); opacity: 1; }
.form-control:disabled, .form-select:disabled {
  border-color: var(--line);
  background-color: var(--surface-subtle);
  color: var(--muted);
  opacity: 1;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-300); background-color: #202024; color: var(--ink);
  box-shadow: 0 0 0 0.2rem var(--focus-ring);
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px var(--surface-hover) inset;
  caret-color: var(--ink);
}

/* ---------- list groups ---------- */
.list-group-item { border-color: var(--line); background: var(--surface); color: var(--ink-soft); }
.list-group-item-action:hover, .list-group-item-action:focus { background: var(--surface-hover); color: var(--ink); }
.list-group-item:first-child { border-top-left-radius: 12px; border-top-right-radius: 12px; }
.list-group-item:last-child { border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; }

/* ---------- monitor tabs ---------- */
.nav-tabs { border-bottom: 1px solid var(--line); }
.nav-tabs .nav-link { color: var(--muted); border: none; font-weight: 500; }
.nav-tabs .nav-link:hover { color: var(--ink-soft); }
.nav-tabs .nav-link.active { color: var(--ink); background: transparent; border-bottom: 2px solid var(--brand); }

/* ---------- calm semantic messages ---------- */
.alert {
  --bs-alert-color: var(--ink-soft);
  --bs-alert-bg: var(--surface-subtle);
  --bs-alert-border-color: var(--line);
  position: relative;
  padding-left: 2.4rem;
  border: 1px solid var(--line);
  border-left-width: 3px;
  background: var(--surface-subtle);
  box-shadow: none;
  color: var(--ink-soft);
}
.alert::before {
  content: "i";
  position: absolute;
  top: 50%;
  left: 0.78rem;
  color: var(--neutral);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-50%);
}
.alert-danger { border-left-color: var(--bad); }
.alert-danger::before { content: "×"; color: var(--bad); }
.alert-warning { border-left-color: var(--warn); }
.alert-warning::before { content: "!"; color: var(--warn); }
.alert-success { border-left-color: var(--ok); }
.alert-success::before { content: "✓"; color: var(--ok); }
.alert-info { border-left-color: var(--info); }
.alert-info::before { content: "i"; color: var(--info); }
.alert a { font-weight: 700; }

/* ---------- section label ---------- */
.section-label { text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }

/* ---------- empty state ---------- */
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.state-panel {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  text-align: center;
  color: var(--muted);
  padding: clamp(2rem, 5vw, 3.5rem) 1.25rem;
}
.state-panel-compact { padding: 1.5rem 1rem; }
.state-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--neutral-bg);
  color: var(--neutral);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}
.state-panel h2, .state-panel h3 {
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0;
}
.state-panel p { max-width: 460px; font-size: 0.86rem; margin: 0; }
.state-error .state-icon { background: var(--bad-bg); color: var(--bad); }

/* ---------- loading skeletons ---------- */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  background: var(--neutral-bg);
  color: transparent;
  pointer-events: none;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
  animation: skeleton-sweep 1.45s ease-in-out infinite;
}
.skeleton-line { display: block; width: 100%; height: 0.72rem; }
.skeleton-line-sm { width: 42%; }
.skeleton-line-md { width: 68%; }
.skeleton-pill { display: inline-block; width: 92px; height: 1.65rem; }
.skeleton-button { display: inline-block; width: 88px; height: 2rem; }
.skeleton-block { display: block; width: 100%; height: 5.5rem; border-radius: 12px; }
.skeleton-row td { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.skeleton-stack { display: grid; gap: 0.7rem; }
.skeleton-list-item {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 11px;
}
@keyframes skeleton-sweep { to { transform: translateX(100%); } }

/* ---------- accessible information hints ---------- */
.info-hint {
  display: inline-flex;
  flex: none;
  align-items: center;
  vertical-align: middle;
}
.info-hint-button {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-subtle);
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 0.7rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  cursor: help;
}
.info-hint-button:hover,
.info-hint-button:focus-visible {
  border-color: var(--brand-300);
  background: var(--surface-hover);
  color: var(--brand-text);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}
.info-tooltip {
  position: fixed;
  z-index: 2100;
  display: block;
  padding: 0.62rem 0.72rem;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--tooltip-bg);
  box-shadow: var(--shadow-float);
  color: var(--tooltip-ink);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  white-space: normal;
  overflow-wrap: anywhere;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
}
.info-tooltip::after {
  content: '';
  position: absolute;
  left: var(--hint-arrow-left);
  width: 9px;
  height: 9px;
  background: var(--tooltip-bg);
  transform: translateX(-50%) rotate(45deg);
}
.info-tooltip[data-side='bottom']::after { top: -5px; }
.info-tooltip[data-side='top']::after { bottom: -5px; }
.info-tooltip.is-open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

/* ---------- login ---------- */
.login-hero {
  position: relative;
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; overflow: hidden; padding: 1.5rem;
  background:
    radial-gradient(circle at 18% 16%, rgba(167, 0, 254, 0.13), transparent 34rem),
    var(--page-bg);
}
.login-motif {
  position: absolute;
  right: max(-5rem, -5vw);
  bottom: -7rem;
  width: min(38vw, 440px);
  aspect-ratio: 52 / 63;
  background: var(--brand-300);
  opacity: 0.08;
  -webkit-mask: url('/brand/incomplete-hexagons.svg') center / contain no-repeat;
  mask: url('/brand/incomplete-hexagons.svg') center / contain no-repeat;
  pointer-events: none;
}
.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 420px); box-sizing: border-box; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-float); padding: 2.5rem 2.2rem; text-align: center;
}
.login-wordmark { display: block; width: 150px; height: auto; margin: 0 auto 1.25rem; }
.login-card h1 { font-size: 1.45rem; font-weight: 500; letter-spacing: -0.02em; margin: 0 0 1.5rem; }
.login-actions {
  display: grid;
  gap: 0.75rem;
}
.login-actions form { width: 100%; margin: 0; }
.login-provider-button {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
}
.login-provider-button-google {
  background: #fff;
  border-color: #fff;
  color: #1f1f1f;
}
.login-provider-button-google:hover {
  background: #f2f2f2;
  border-color: #f2f2f2;
  color: #1f1f1f;
}
.login-provider-button-cognito {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.login-provider-button-cognito:hover {
  background: var(--brand-700);
  border-color: var(--brand-700);
  color: #fff;
}
.login-preview {
  display: inline-block;
  margin-top: 1.25rem;
  font-size: 0.875rem;
}
.login-foot { margin-top: 1.5rem; font-size: 0.75rem; color: var(--muted); }

/* ============================================================================
   Runs table (one row per run, expandable) + run detail panel, Stripe-style.
   ============================================================================ */

/* ---------- runs table ---------- */
.runs-toolbar {
  position: sticky;
  top: 68px;
  z-index: 20;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: -0.4rem -0.4rem 1rem;
  padding: 0.65rem 0.4rem;
  background: rgba(24, 24, 27, 0.97);
  border-bottom: 1px solid var(--line);
}
.runs-search { min-width: min(100%, 220px); }
.runs-count { margin-left: auto; color: var(--muted); font-size: 0.78rem; font-weight: 500; }
.runs-table > tbody > tr > td { border-color: var(--line); }
.run-row > td { border-top: 1px solid var(--line); padding-top: 0.82rem; padding-bottom: 0.82rem; transition: background-color 0.16s ease; }
.run-row:hover > td { background: rgba(255, 255, 255, 0.045); }
.run-row.is-open > td {
  background: rgba(167, 0, 254, 0.1);
  box-shadow: inset 3px 0 0 var(--brand);
}
.run-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.58rem;
  max-width: 100%;
  padding: 0.28rem 0.36rem;
  margin: -0.28rem -0.36rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-weight: 500;
  text-align: left;
}
.run-toggle:hover { color: var(--ink); background: var(--surface-hover); }
.run-toggle:focus-visible { outline: 2px solid var(--brand-300); outline-offset: 1px; }
.run-link {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0.38rem;
  margin: -0.3rem -0.38rem;
  border-radius: 7px;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}
.run-link span { overflow-wrap: anywhere; }
.run-link i { color: var(--muted); font-size: 0.68rem; opacity: 0; transform: translateX(-4px); transition: opacity 0.16s ease, transform 0.16s ease; }
.run-link:hover { background: var(--surface-hover); color: var(--ink); }
.run-link:hover i, .run-link:focus-visible i { opacity: 1; transform: translateX(0); }
.chevron { display: inline-block; flex: none; color: var(--muted); font-size: 0.78rem; transition: transform 0.16s ease; }
.chevron.down { transform: rotate(90deg); }
.run-label { font-weight: 500; color: var(--ink); }
.detail-row > td {
  background: var(--surface-subtle);
  border-top: none;
  padding: 1.2rem clamp(0.85rem, 3vw, 1.4rem);
  box-shadow: inset 3px 0 0 var(--brand);
}
.detail-reveal { animation: detail-reveal 0.2s ease-out both; }
.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  margin: -0.3rem;
  padding: 0.3rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.sort-button:hover { color: var(--ink); background: var(--surface-hover); }
.sort-arrow { color: var(--brand-text); font-size: 0.65rem; }
@keyframes detail-reveal {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- status pill (with a leading dot) ---------- */
.status-cell { display: inline-flex; align-items: center; gap: 0.5rem; }
.status-prog { font-size: 0.72rem; }
.status-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.25rem 0.55rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface-subtle); color: var(--ink-soft);
  font-size: 0.74rem; font-weight: 500; white-space: nowrap;
}
.status-pill.st-green { border-color: rgba(40, 167, 69, 0.35); background: var(--ok-bg); color: var(--ok-ink); }
.status-pill.st-amber { border-color: rgba(240, 194, 75, 0.35); background: var(--warn-bg); color: #f6d67d; }
.status-pill.st-red { border-color: rgba(255, 107, 129, 0.35); background: var(--bad-bg); color: #ff9aaa; }
.status-pill.st-blue { border-color: rgba(110, 168, 254, 0.35); background: var(--info-bg); color: #9bc2ff; }
.status-pill.st-grey { background: var(--neutral-bg); color: var(--ink-soft); }
.st-dot { width: 8px; height: 8px; flex: none; box-sizing: border-box; }
.st-green .st-dot { border-radius: 50%; background: var(--ok); }
.st-amber .st-dot { border-radius: 1px; background: var(--warn); transform: rotate(45deg); }
.st-red .st-dot { border-radius: 2px; background: var(--bad); }
.st-blue .st-dot {
  border: 2px solid var(--info);
  border-radius: 50%;
  background: transparent;
  animation: pulse 1.4s ease-in-out infinite;
}
.st-grey .st-dot { border: 1.5px solid var(--neutral); border-radius: 50%; background: transparent; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- run detail panel ---------- */
.run-detail { padding: 0.1rem 0 0.25rem; }
.run-detail > section, .input-section { padding-top: 0; padding-bottom: 0; }
.detail-h {
  display: flex; align-items: center; gap: 0.38rem;
  font-size: 0.73rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted); font-weight: 700; margin: 0 0 0.68rem;
}

/* status banner: the one clear answer */
.banner {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  padding: clamp(1rem, 2.5vw, 1.25rem);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface-subtle);
  box-shadow: none;
}
.banner-title-row { display: flex; align-items: center; gap: 0.4rem; }
.banner-title { color: var(--ink); font-weight: 500; font-size: clamp(1.08rem, 2vw, 1.24rem); letter-spacing: -0.02em; line-height: 1.2; }
.banner-sub { color: var(--ink-soft); font-size: 0.88rem; margin-top: 0.2rem; }
.banner-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--neutral-bg);
  color: var(--neutral);
  font-size: 0.68rem;
  font-weight: 700;
}
.banner-green { border-left-color: var(--ok); }
.banner-green .banner-icon { background: var(--ok-bg); color: var(--ok-ink); }
.banner-amber { border-left-color: var(--warn); }
.banner-amber .banner-icon { background: var(--warn-bg); color: var(--warn); }
.banner-red { border-left-color: var(--bad); }
.banner-red .banner-icon { background: var(--bad-bg); color: var(--bad); }
.banner-blue { border-left-color: var(--info); }
.banner-blue .banner-icon {
  border: 2px solid var(--line-strong);
  border-top-color: var(--info);
  background: var(--surface-subtle);
  animation: spin 0.9s linear infinite;
}
.banner-grey { border-left-color: var(--neutral); }
.banner-grey .banner-icon { background: var(--neutral-bg); color: var(--neutral); }
.banner-body { flex: 1; min-width: 0; }
.banner-action { flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- step checklist (stepper) ---------- */
.stepper { display: flex; flex-wrap: wrap; padding-top: 0.15rem; }
.step { flex: 1 1 0; min-width: 88px; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; }
.step::before { content: ''; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.step:first-child::before { display: none; }
.step-completed::before, .step-running::before, .step-failed::before { background: var(--ok); }
.step-node { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 0.78rem; font-weight: 700; color: #fff; background: var(--line-strong); z-index: 1; }
.step-label-row { display: flex; align-items: center; justify-content: center; gap: 0.28rem; margin-top: 7px; min-height: 20px; }
.step-label { font-size: 0.72rem; font-weight: 500; color: var(--muted); }
.step .info-hint-button { width: 20px; height: 20px; font-size: 0.62rem; }
.step-completed .step-node { background: var(--ok); }
.step-completed .step-node,
.step-running .step-node,
.step-failed .step-node { color: #000; }
.step-running .step-node { background: var(--info); animation: pulse 1.4s ease-in-out infinite; }
.step-running .step-label { color: var(--info); }
.step-failed .step-node { background: var(--bad); }
.step-failed .step-label { color: var(--bad); }

/* ---------- deliverables: per-sample list with a format picker ---------- */
.profile-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface-subtle); }
.profile-row { display: flex; align-items: center; gap: 1rem; padding: 0.7rem 0.95rem; border-top: 1px solid var(--line); }
.profile-row:first-child { border-top: none; }
.profile-main { flex: 1; min-width: 0; }
.profile-sample { font-weight: 500; font-size: 0.88rem; color: var(--ink); word-break: break-all; }
.profile-missing { color: var(--warn); font-size: 0.76rem; margin-top: 0.15rem; }
.profile-controls { display: flex; align-items: center; gap: 0.55rem; flex: none; }
.profile-select { width: auto; min-width: 210px; }

/* ---------- other files (secondary track list) ---------- */
.track-list { list-style: none; margin: 0; padding: 0; }
.track { display: flex; align-items: center; gap: 0.75rem; padding: 0.68rem 0.85rem; border-top: 1px solid var(--line); }
.track:first-child { border-top: none; }
.track-main { flex: 1; min-width: 0; }
.track-title { font-size: 0.85rem; font-weight: 500; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.track-meta { color: var(--muted); font-size: 0.72rem; margin-top: 2px; word-break: break-all; }
.track-sample { color: var(--muted); font-weight: 500; }
.dl-btn { flex: none; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.13rem 0.43rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-hover);
  color: var(--neutral);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.tag-green { background: var(--surface-subtle); color: var(--ink-soft); }
.tag-green::before {
  content: '';
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--ok);
}
.tag-grey { background: var(--surface-subtle); color: var(--neutral); }
.tag.st-red { border-color: var(--bad); background: var(--surface-subtle); color: var(--bad); }
.tag.st-red::before {
  content: '';
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 1px;
  background: var(--bad);
}
.tag-with-hint { display: inline-flex; align-items: center; gap: 0.25rem; }

/* ---------- notice / disclosure / detail list / log ---------- */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--ink-soft);
}
.notice-body { min-width: 0; flex: 1; }
.notice-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: var(--neutral-bg);
  color: var(--neutral);
  font-size: 0.72rem;
}
.notice-amber { border-left-color: var(--warn); }
.notice-amber .notice-icon { background: var(--warn-bg); color: var(--warn); }
.notice-amber ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.notice-red { border-left-color: var(--bad); }
.notice-red .notice-icon { background: var(--bad-bg); color: var(--bad); }
.notice-blue { border-left-color: var(--brand-300); }
.notice-blue .notice-icon { background: rgba(167, 0, 254, 0.12); color: var(--brand-text); }
.notice-title { display: block; color: var(--ink); font-weight: 700; margin-bottom: 0.15rem; }
.disclosure { display: inline-flex; align-items: center; gap: 0.38rem; background: none; border: none; border-radius: 6px; padding: 0.2rem 0.25rem; margin-left: -0.25rem; color: var(--brand-text); font-weight: 500; font-size: 0.85rem; cursor: pointer; }
.disclosure:hover { color: var(--ink); background: var(--surface-hover); }
.disclosure-glyph { width: 0.8rem; color: var(--muted); }
.detail-dl { display: grid; grid-template-columns: 120px 1fr; gap: 0.35rem 1rem; font-size: 0.85rem; margin: 0; }
.detail-dl dt { display: flex; align-items: center; gap: 0.35rem; color: var(--muted); font-weight: 500; }
.detail-dl dd { margin: 0; }
.log-pane { min-height: 220px; max-height: 360px; overflow: auto; white-space: pre-wrap; background: var(--page-bg); color: var(--ink-soft); border: 1px solid var(--line); border-radius: 8px; padding: 0.9rem; font-size: 0.75rem; line-height: 1.55; margin: 0; }
.log-state { min-height: 120px; display: grid; align-content: center; color: var(--muted); }
.log-state .btn { justify-self: start; }
.log-loading { min-height: 180px; align-content: center; }
.log-loading .skeleton { background: var(--surface-hover); }
.log-loading .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent); }

/* ============================================================================
   Inputs browse, date-grouped expandable rows (reuses the runs-table styles).
   ============================================================================ */
.inputs-table { margin-bottom: 0.5rem; }
.group-head > td {
  border-top: none; padding: 0.9rem 0.5rem 0.35rem;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 700;
}
.inputs-table .run-row:first-child > td { border-top: none; }
.input-actions { width: 1%; white-space: nowrap; }
.input-detail { padding: 0.15rem 0.1rem; }
.input-section + .input-section { margin-top: 2rem; padding-top: 1.7rem; border-top: 1px solid var(--line); }
.input-section-head { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.7rem; }
.input-section-head h2 { margin: 0; }
.input-actions-group { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 0.45rem; }
.action-with-hint { display: inline-flex; align-items: center; gap: 0.3rem; }
.input-status { display: inline-flex; align-items: center; gap: 0.35rem; }
.sample-table { font-size: 0.8rem; }
.sample-table th { color: var(--muted); font-weight: 500; text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.03em; }
.sample-table code { font-size: 0.76rem; }
.file-list { list-style: none; margin: 0; padding: 0; columns: 2; font-size: 0.78rem; }
.file-list li { margin-bottom: 0.15rem; break-inside: avoid; }

/* ---------- guided onboarding ---------- */
.onboarding-app-bar { background: var(--surface-subtle); }
.onboarding-page { width: 100%; max-width: 1040px; margin-right: auto; margin-left: auto; }
.onboarding-page-header { margin-bottom: 1.75rem; text-align: center; }
.onboarding-page-header p { margin-right: auto; margin-left: auto; color: var(--muted); }
.onboarding-surface {
  padding: clamp(1.35rem, 4vw, 3rem);
  border-color: var(--surface-hover);
  background: var(--surface-subtle);
  box-shadow: none;
}
.onboarding-wizard { max-width: 820px; margin: 0 auto; }
.run-monitor-demo-page { max-width: 1480px; }
.run-monitor-demo-layout {
  display: grid;
  grid-template-columns: minmax(235px, 280px) minmax(0, 1fr);
  align-items: start;
  gap: 1.25rem;
}
.run-monitor-demo-badge { flex: none; }
.run-monitor-demo-nav {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding: 1rem;
}
.run-monitor-demo-nav section + section {
  margin-top: 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}
.run-monitor-demo-nav h2 {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.run-monitor-demo-nav nav { display: grid; gap: 0.25rem; }
.run-monitor-demo-scenario {
  display: grid;
  gap: 0.13rem;
  padding: 0.55rem 0.62rem;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--ink-soft);
  text-decoration: none;
}
.run-monitor-demo-scenario:hover {
  border-color: var(--line);
  background: var(--surface-hover);
  color: var(--ink);
}
.run-monitor-demo-scenario.is-active {
  border-color: var(--brand-300);
  background: var(--surface-hover);
  color: var(--ink);
  box-shadow: inset 2px 0 0 var(--brand);
}
.run-monitor-demo-scenario strong {
  font-size: 0.78rem;
  font-weight: 600;
}
.run-monitor-demo-scenario span {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
}
.run-monitor-demo-preview { min-width: 0; }
.run-monitor-demo-selection {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.run-monitor-demo-selection h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 600;
}
.run-monitor-demo-selection p {
  margin: 0.22rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.run-monitor-demo-selection code {
  flex: none;
  color: var(--muted);
  font-size: 0.7rem;
}
.run-monitor-demo-surface {
  padding: clamp(1rem, 2.5vw, 1.5rem);
  overflow: hidden;
}
.wizard-stepper {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  max-width: 650px;
  margin: 0 auto 2.5rem;
}
.wizard-stepper::before {
  position: absolute;
  top: 17px;
  right: 10%;
  left: 10%;
  height: 1px;
  background: var(--line);
  content: "";
}
.wizard-step {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  color: var(--muted-brand);
  text-align: center;
}
.wizard-step-marker {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}
.wizard-step-label { font-size: 0.74rem; font-weight: 500; }
.wizard-step.is-active { color: var(--ink); }
.wizard-step.is-active .wizard-step-marker {
  border-color: var(--brand-300);
  color: var(--ink);
}
.wizard-step.is-complete .wizard-step-marker {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.wizard-panel { min-height: 390px; }
.wizard-panel h2 {
  margin: 0.25rem 0 0.8rem;
  color: var(--ink);
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.wizard-panel > p { max-width: 660px; color: var(--ink-soft); }
.wizard-kicker {
  display: block;
  color: var(--muted-brand);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.wizard-welcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  column-gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
}
.wizard-welcome-copy { align-self: center; }
.wizard-welcome .wizard-actions { grid-column: 1 / -1; }
.wizard-brand-motif {
  display: block;
  width: 165px;
  aspect-ratio: 1;
  justify-self: end;
  background: var(--brand);
  opacity: 0.2;
  -webkit-mask: url('/brand/dna-helix2.svg') center / contain no-repeat;
  mask: url('/brand/dna-helix2.svg') center / contain no-repeat;
}
.wizard-requirements { margin: 0; padding: 0; list-style: none; }
.wizard-requirements li {
  position: relative;
  padding: 0.4rem 0 0.4rem 1.7rem;
  color: var(--ink-soft);
}
.wizard-requirements li::before {
  position: absolute;
  top: 0.42rem;
  left: 0;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--brand-text);
  content: "✓";
  font-size: 0.68rem;
  font-weight: 700;
}
.wizard-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1.35rem 0;
}
.wizard-choice-card {
  display: grid;
  align-content: start;
  gap: 0.45rem;
  min-height: 148px;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
}
.wizard-choice-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}
.wizard-choice-card.is-selected {
  border-color: var(--brand-300);
  background: rgba(167, 0, 254, 0.09);
  box-shadow: inset 3px 0 0 var(--brand);
}
.wizard-choice-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.wizard-choice-title { color: var(--ink); font-size: 0.96rem; font-weight: 600; }
.wizard-choice-description { color: var(--ink-soft); font-size: 0.84rem; line-height: 1.45; }
.wizard-choice-examples { margin-top: auto; color: var(--muted); font-size: 0.74rem; }
.wizard-availability {
  flex: none;
  padding: 0.18rem 0.42rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.2;
}
.wizard-availability.is-live {
  border-color: rgba(40, 167, 69, 0.55);
  background: var(--ok-bg);
  color: var(--ok-ink);
}
.wizard-availability.is-preview {
  background: var(--neutral-bg);
}
.wizard-oauth-action {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.wizard-oauth-action span { color: var(--muted); font-size: 0.8rem; }
.wizard-scope-options {
  display: grid;
  gap: 0.7rem;
  margin: 1.25rem 0;
  padding: 0;
  border: 0;
}
.wizard-radio-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}
.wizard-radio-option:has(input:checked) {
  border-color: var(--brand-300);
  background: rgba(167, 0, 254, 0.07);
}
.wizard-radio-option input { margin-top: 0.25rem; accent-color: var(--brand); }
.wizard-radio-option span { display: grid; gap: 0.15rem; }
.wizard-radio-option b { color: var(--ink); font-size: 0.88rem; }
.wizard-radio-option small { color: var(--muted); font-size: 0.77rem; }
.wizard-reassurance {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.wizard-lock-icon {
  display: inline-block;
  width: 21px;
  height: 21px;
  flex: none;
  background: var(--brand-text);
  -webkit-mask: url('/brand/lock.svg') center / contain no-repeat;
  mask: url('/brand/lock.svg') center / contain no-repeat;
}
.wizard-checklist {
  padding: 1rem 1.1rem;
  border-left: 2px solid var(--brand);
  background: rgba(167, 0, 254, 0.055);
}
.wizard-checklist ul { margin-bottom: 0; padding-left: 1.15rem; }
.wizard-checklist li + li, .wizard-instructions li + li { margin-top: 0.45rem; }
.wizard-instructions { padding-left: 1.2rem; color: var(--ink-soft); line-height: 1.55; }
.wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.75rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--surface-hover);
}
.wizard-confirmation {
  display: grid;
  gap: 0.28rem;
  padding: 1rem 1.1rem;
  border-left: 2px solid var(--ok);
  background: var(--surface);
}
.wizard-confirmation b { color: var(--ink); }
.wizard-confirmation span { color: var(--ink-soft); }
.wizard-note, .wizard-success, .wizard-waiting {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border-left: 2px solid var(--brand);
  background: var(--surface);
}
.wizard-note { display: grid; gap: 0.18rem; }
.wizard-note b, .wizard-success b, .wizard-waiting b { color: var(--ink); }
.wizard-note span, .wizard-success span { color: var(--ink-soft); font-size: 0.86rem; }
.wizard-note.is-warning { border-left-color: var(--warn); }
.wizard-waiting { align-items: flex-start; }
.wizard-waiting p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.86rem; }
.wizard-waiting-mark {
  width: 14px;
  height: 14px;
  flex: none;
  margin-top: 0.25rem;
  border: 2px solid var(--line-strong);
  border-top-color: var(--brand-300);
  border-radius: 50%;
  animation: wizard-spin 0.9s linear infinite;
}
@keyframes wizard-spin { to { transform: rotate(360deg); } }
.wizard-success { display: grid; gap: 0.18rem; border-left-color: var(--ok); }
.wizard-details {
  padding: 0.75rem 0;
  border-top: 1px solid var(--surface-hover);
  border-bottom: 1px solid var(--surface-hover);
}
.wizard-details summary { color: var(--ink-soft); font-size: 0.85rem; cursor: pointer; }
.wizard-details summary:hover { color: var(--ink); }
.wizard-details summary span {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
}
.wizard-footnote { margin: 1rem 0 0; color: var(--muted); font-size: 0.8rem; }
.wizard-notice {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}
.wizard-complete-mark {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 0.85rem;
  place-items: center;
  border: 2px solid var(--ok);
  border-radius: 50%;
  color: var(--ok-ink);
  font-size: 1.4rem;
  font-weight: 700;
}

/* ---------- submit flow ---------- */
.run-flow-page.run-review-page { max-width: 860px; }
.run-review-heading { margin-bottom: 1.5rem; }
.run-review-heading-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.15rem; color: var(--muted); font-size: 0.75rem; }
.run-review-heading-nav a { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--muted); text-decoration: none; padding: 0.4rem 0; }
.run-review-heading-nav a:hover { color: var(--ink); }
.run-review-heading-nav a:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 4px; border-radius: 3px; }
.run-review-heading-nav i { font-size: 0.65rem; }
.run-review-heading h1 { margin: 0; font-size: clamp(1.5rem, 2.4vw, 1.85rem); font-weight: 500; letter-spacing: -0.035em; line-height: 1.2; }
.run-selection-page .input-section-head { margin-bottom: 1.1rem; }
.run-selection-page .input-section-head h2 { color: var(--ink-soft) !important; font-size: 0.94rem; font-weight: 500; text-transform: none !important; }
.run-selection-page .ds-landing { margin-top: 0; }
.run-selection-page .inputs-table { width: 100%; }
.workspace-run-name { color: var(--ink-soft); font-size: 0.88rem; font-weight: 500; overflow-wrap: anywhere; }
.run-selection-page .workspace-run-name code { color: inherit; font: inherit; white-space: normal; overflow-wrap: anywhere; }
.run-selection-page .inputs-table .group-head > td { padding: 0.7rem 0 0.65rem; background: transparent; color: var(--muted); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; border: 0; }
.run-selection-page .inputs-table .run-row > td { padding: 1.05rem 0.5rem; border-bottom: 1px solid rgba(255, 255, 255, 0.07); background: transparent; }
.run-selection-page .inputs-table .run-row > td:first-child { padding-left: 0; }
.run-selection-page .inputs-table .run-row > td:last-child { padding-right: 0; }
.run-selection-page .inputs-table .run-row:last-child > td { border-bottom: 0; }
.run-selection-page .inputs-table .run-row:hover > td { background: rgba(255, 255, 255, 0.02); }
.run-selection-page .run-toggle, .run-selection-page .ds-link-button.run-link { color: var(--ink-soft); font-size: 0.88rem; font-weight: 500; gap: 0.65rem; }
.run-selection-page .run-toggle code { color: inherit; font: inherit; }
.run-selection-page .run-toggle:hover, .run-selection-page .ds-link-button.run-link:hover { color: var(--ink); }
.run-selection-page .run-row .fa-chevron-right, .run-selection-page .run-row .fa-chevron-down, .run-selection-page .run-row .chevron { color: var(--muted); font-size: 0.6rem; }
.run-selection-page .run-row .btn-outline-primary { display: inline-flex; align-items: center; justify-content: center; gap: 0.65rem; min-height: 36px; padding: 0.45rem 0.7rem; border-color: rgba(255, 255, 255, 0.12); border-radius: 7px; color: var(--ink-soft); background: transparent; font-size: 0.76rem; font-weight: 500; white-space: nowrap; }
.run-selection-page .run-row .btn-outline-primary:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.04); }
.run-selection-page .run-row .btn i { font-size: 0.65rem; }
.run-selection-page .input-section + .input-section { margin-top: 1.2rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.run-source-notice { display: flex; align-items: center; gap: 0.85rem; }
.run-source-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 9px; color: var(--muted); background: rgba(255, 255, 255, 0.035); font-size: 0.9rem; }
.run-source-notice h3 { margin: 0; color: var(--ink-soft); font-size: 0.85rem; font-weight: 500; }
.run-source-notice p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.75rem; }
.run-source-notice a { display: inline-flex; align-items: center; gap: 0.6rem; margin-left: auto; color: var(--muted); font-size: 0.76rem; text-decoration: none; }
.run-source-notice a:hover { color: var(--ink); }
.run-source-notice a i { font-size: 0.65rem; }
.run-selection-help { margin-top: 1.1rem; text-align: right; }
.run-selection-help a { display: inline-flex; gap: 0.5rem; align-items: center; color: var(--muted); font-size: 0.76rem; text-decoration: none; }
.run-selection-help a:hover { color: var(--ink); }
@media (max-width: 540px) {
  .run-selection-page .inputs-table > tbody { display: block; }
  .run-selection-page .inputs-table .run-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 0.5rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
  .run-selection-page .inputs-table .run-row > td { padding: 0; border: 0; }
  .run-selection-page .inputs-table .run-row > td:first-child { grid-column: 1; }
  .run-selection-page .inputs-table .run-row > td:nth-child(2) { grid-column: 1; margin: 0.3rem 0 0; font-size: 0.7rem; }
  .run-selection-page .inputs-table .run-row > td:last-child { grid-column: 2; grid-row: 1 / 3; align-self: center; }
  .run-selection-page .run-toggle, .run-selection-page .ds-link-button.run-link { white-space: normal; overflow-wrap: anywhere; font-size: 0.8rem; text-align: left; }
  .run-source-notice { flex-wrap: wrap; }
}
.run-review-page .run-flow-surface { padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 16px; background: linear-gradient(145deg, rgba(255, 255, 255, 0.018), transparent 65%), var(--surface); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.025); }
.run-review-header { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.run-review-header > div { min-width: 0; }
.run-review-header h2 { margin: 0; font-size: clamp(1.2rem, 2.2vw, 1.55rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.3; overflow-wrap: anywhere; }
.run-review-metadata { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin: 2rem 0 1.65rem; }
.run-review-metadata > div + div { border-left: 1px solid rgba(255, 255, 255, 0.07); padding-left: 1.5rem; }
.run-review-metadata dt { color: var(--muted); font-size: 0.76rem; font-weight: 400; }
.run-review-metadata dd { margin: 0.5rem 0 0; color: var(--ink); font-size: 0.94rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.run-review-metadata small { display: block; color: var(--muted); font-size: 0.7rem; font-weight: 400; margin-top: 0.25rem; }
.run-review-upload { display: inline-flex; gap: 0.45rem; align-items: center; }
.run-review-upload.is-complete { color: var(--ok-ink); }
.run-review-upload.is-pending { color: var(--warn); }
.run-review-upload i { font-size: 0.8rem; }
.run-review-sheet { border-top: 1px solid rgba(255, 255, 255, 0.08); border-bottom: 1px solid rgba(255, 255, 255, 0.08); padding: 0.55rem 0; }
.run-review-sheet summary, .run-review-file-unavailable { display: flex; align-items: center; gap: 0.85rem; }
.run-review-sheet summary { cursor: pointer; list-style: none; padding: 0.65rem 0.75rem; margin: 0 -0.75rem; border-radius: 9px; transition: background 150ms ease; }
.run-review-sheet summary:hover { background: rgba(255, 255, 255, 0.035); }
.run-review-sheet summary:focus-visible, .run-review-footer .btn:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 4px; }
.run-review-sheet summary::-webkit-details-marker { display: none; }
.run-review-file-icon { display: grid; place-items: center; width: 38px; height: 42px; flex: none; color: var(--ink-soft); background: rgba(255, 255, 255, 0.025); border: 1px solid rgba(255, 255, 255, 0.065); border-radius: 8px; font-size: 1rem; }
.run-review-file-copy { display: grid; gap: 0.2rem; min-width: 0; }
.run-review-file-copy > span { color: var(--muted); font-size: 0.72rem; }
.run-review-file-copy strong { color: var(--ink-soft); font-size: 0.85rem; font-weight: 500; overflow-wrap: anywhere; }
.run-review-file-action { display: inline-flex; align-items: center; gap: 0.75rem; margin-left: auto; padding-left: 0.5rem; color: var(--muted); font-size: 0.75rem; }
.run-review-file-action i { font-size: 0.6rem; transition: transform 150ms ease; }
.run-review-hide-label, .run-review-sheet[open] .run-review-show-label { display: none; }
.run-review-sheet[open] .run-review-hide-label { display: inline; }
.run-review-sheet summary:hover .run-review-file-action { color: var(--ink); }
.run-review-sheet[open] .run-review-file-action i { transform: rotate(180deg); }
.run-review-sheet .sample-sheet-preview { margin: 0.5rem 0 0.65rem; border-color: rgba(255, 255, 255, 0.07); padding: 1rem; line-height: 1.8; }
.run-review-file-unavailable { padding-top: 1.2rem; padding-bottom: 1.2rem; }
.run-review-notices:empty { display: none; }
.run-review-notices { display: grid; gap: 0.75rem; margin-top: 1.25rem; }
.run-review-notices > * { margin: 0; }
.run-review-advanced { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.run-review-advanced > summary { color: var(--muted); font-size: 0.8rem; cursor: pointer; }
.run-review-footer { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-top: 1.5rem; }
.run-review-footer p { margin: 0; color: var(--muted); font-size: 0.76rem; line-height: 1.5; max-width: 420px; }
.run-review-footer .btn { display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 1rem; margin-left: auto; min-height: 44px; padding: 0.7rem 1.25rem; font-size: 0.86rem; border-radius: 8px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 2px 5px rgba(0, 0, 0, 0.12); }
.run-review-footer .btn i { font-size: 0.7rem; transition: transform 150ms ease; }
.run-review-footer .btn:hover:not(:disabled) i { transform: translateX(2px); }
@media (prefers-reduced-motion: reduce) {
  .run-review-sheet summary, .run-review-file-action i, .run-review-footer .btn i { transition: none; }
}
@media (max-width: 540px) {
  .run-review-header { align-items: flex-start; gap: 1rem; }
  .run-review-metadata { gap: 1rem; }
  .run-review-metadata > div + div { padding-left: 1rem; }
  .run-review-metadata dd { font-size: 0.8rem; }
  .run-review-footer { flex-wrap: wrap; gap: 1rem; }
  .run-review-footer .btn { width: 100%; }
}
.submit-grid { --bs-gutter-x: 2rem; }
.flow-step {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
}
.flow-step-number {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 0.72rem;
}
.submit-list .list-group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0.72rem 0.85rem;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 500;
}
.submit-list .list-group-item.active {
  z-index: 0;
  border-color: var(--brand);
  border-left: 3px solid var(--brand);
  background: rgba(167, 0, 254, 0.1);
  color: var(--ink);
}
.submit-list .list-group-item.active .fa-check { color: var(--brand-text); }
.submit-review {
  min-height: 250px;
  padding-left: 1.8rem;
  border-left: 1px solid var(--line);
}
.review-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-subtle);
}
.field-label { display: inline-flex; align-items: center; gap: 0.35rem; }
.setting-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1.3fr);
  gap: 0.75rem 1rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--line);
}
.setting-row:first-child { border-top: 0; padding-top: 0; }
.setting-row:last-child { padding-bottom: 0; }
.setting-name { color: var(--ink); font-size: 0.84rem; font-weight: 500; }
.setting-value { color: var(--ink-soft); font-size: 0.84rem; }
.advanced-settings {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
}
.advanced-settings summary { color: var(--brand-text); font-size: 0.85rem; font-weight: 500; cursor: pointer; }
.helper-copy { color: var(--muted); font-size: 0.78rem; line-height: 1.5; }
.sample-sheet-preview {
  max-height: 260px;
  overflow: auto;
  margin: 0.75rem 0 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--page-bg);
  color: var(--ink-soft);
  font-size: 0.74rem;
  white-space: pre-wrap;
}

/* ============================================================================
   Settings workspace
   ============================================================================ */
.settings-page { width: 100%; max-width: 1240px; margin: 0 auto; }
.settings-page-header {
  margin-bottom: 1.8rem;
  padding-bottom: 1.45rem;
  border-bottom: 1px solid var(--line);
}
.settings-page-header h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.7rem, 2.8vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.035em;
}
.settings-page-header p { max-width: 680px; margin: 0.42rem 0 0; color: var(--ink-soft); font-size: 0.94rem; }
.settings-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: clamp(1.5rem, 3vw, 2.5rem); align-items: start; }
.settings-sidebar { position: sticky; top: 92px; }
.settings-nav { display: grid; gap: 0.35rem; }
.settings-nav a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.72rem 0.78rem;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--ink-soft);
  text-decoration: none;
}
.settings-nav a:hover { border-color: var(--line); background: var(--surface-subtle); color: var(--ink); }
.settings-nav a.active {
  border-color: rgba(183, 46, 255, 0.32);
  background: rgba(167, 0, 254, 0.09);
  box-shadow: inset 2px 0 0 var(--brand);
  color: var(--ink);
}
.settings-nav-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
}
.settings-nav a.active .settings-nav-icon { border-color: rgba(183, 46, 255, 0.35); color: var(--brand-text); }
.settings-nav strong { display: block; color: inherit; font-size: 0.84rem; font-weight: 600; }
.settings-nav small { display: block; margin-top: 0.08rem; color: var(--muted); font-size: 0.69rem; line-height: 1.35; }
.settings-mobile-nav { display: none; }
.settings-mobile-nav label {
  display: block;
  margin-bottom: 0.38rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.settings-content { min-width: 0; }
.settings-content-header { margin-bottom: 1.25rem; }
.settings-content-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  font-weight: 500;
  letter-spacing: -0.025em;
}
.settings-content-header p { max-width: 700px; margin: 0.35rem 0 0; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.55; }
.settings-panel {
  padding: clamp(1.1rem, 2.5vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-surface);
}
.settings-panel-spacious { padding: clamp(1.25rem, 3vw, 2rem); }
.settings-overview-grid { display: grid; gap: 0.8rem; }
.settings-overview-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 24px;
  gap: 1rem;
  align-items: center;
  padding: 1.05rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  color: var(--ink-soft);
  text-decoration: none;
}
.settings-overview-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: var(--ink-soft);
  transform: translateY(-1px);
}
.settings-overview-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-subtle);
  color: var(--brand-text);
}
.settings-overview-copy { display: flex; min-width: 0; align-items: center; gap: 0.8rem 1rem; flex-wrap: wrap; }
.settings-overview-title { width: 100%; color: var(--ink); font-size: 0.94rem; font-weight: 600; }
.settings-overview-description { flex: 1 1 320px; color: var(--ink-soft); font-size: 0.82rem; line-height: 1.45; }
.settings-overview-arrow { color: var(--muted); font-size: 0.72rem; transition: transform 0.16s ease; }
.settings-overview-card:hover .settings-overview-arrow { color: var(--brand-text); transform: translateX(3px); }
.settings-security-note {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-subtle);
}
.settings-security-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: none;
  place-items: center;
  border-radius: 8px;
  background: rgba(167, 0, 254, 0.12);
  color: var(--brand-text);
  font-size: 0.72rem;
}
.settings-security-note strong { color: var(--ink); font-size: 0.82rem; }
.settings-security-note p { margin: 0.16rem 0 0; color: var(--muted); font-size: 0.77rem; line-height: 1.45; }

/* ---------- data connection cards ---------- */
.connection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.85rem; }
.connection-grid > .skeleton-block { min-height: 230px; height: auto; }
.connection-card {
  display: flex;
  min-height: 230px;
  flex-direction: column;
  gap: 1rem;
  padding: 1.05rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.17);
}
.connection-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.65rem; }
.connection-card-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-subtle);
  color: var(--brand-text);
}
.connection-card h3 { margin: 0 0 0.32rem; color: var(--ink); font-size: 0.95rem; font-weight: 600; }
.connection-card p { margin: 0; color: var(--ink-soft); font-size: 0.8rem; line-height: 1.5; }
.connection-card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
  color: var(--brand-text);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}
.connection-card-action:hover { color: var(--ink); }
.connection-card-action i { font-size: 0.68rem; transition: transform 0.16s ease; }
.connection-card-action:hover i { transform: translateX(3px); }

/* ---------- settings forms and lists ---------- */
.settings-section-stack { display: grid; gap: 1.5rem; }
.settings-section + .settings-section { padding-top: 1.5rem; border-top: 1px solid var(--line); }
.settings-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.settings-section-header h3 { margin: 0; color: var(--ink); font-size: 0.96rem; font-weight: 600; letter-spacing: -0.01em; }
.settings-section-header p { max-width: 660px; margin: 0.25rem 0 0; color: var(--muted); font-size: 0.8rem; line-height: 1.48; }
.settings-metadata {
  margin-bottom: 1.2rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-subtle);
}
.role-checks { display: flex; flex-wrap: wrap; gap: 0.55rem 1rem; }
.role-checks .form-check-input { background-color: var(--surface-subtle); border-color: var(--line-strong); }
.role-checks .form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.role-checks .form-check-label { color: var(--ink-soft); font-size: 0.8rem; }
.settings-table { min-width: 820px; }
.settings-table > tbody > tr > td { padding-top: 0.9rem; padding-bottom: 0.9rem; }
.settings-table > tbody > tr:last-child > td { border-bottom: 0; }
.retention-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.65rem; }
.retention-option {
  position: relative;
  display: grid;
  min-height: 86px;
  place-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-subtle);
  color: var(--ink-soft);
}
.retention-option:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.retention-option.is-selected {
  border-color: var(--brand-300);
  background: rgba(167, 0, 254, 0.09);
  box-shadow: inset 0 0 0 1px rgba(167, 0, 254, 0.16);
  color: var(--ink);
}
.retention-option-value { font-size: 1.35rem; font-weight: 600; line-height: 1; }
.retention-option-unit { margin-top: 0.25rem; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.retention-option i { position: absolute; top: 0.65rem; right: 0.65rem; color: var(--brand-text); font-size: 0.68rem; }
.settings-empty-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.9rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.82rem;
}
.settings-empty-row i { color: var(--muted); }
.hold-list { display: grid; gap: 0.55rem; margin: 0; padding: 0; list-style: none; }
.hold-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.78rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-subtle);
}
.hold-list-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: none;
  place-items: center;
  border-radius: 8px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 0.68rem;
}
.hold-list strong { display: block; color: var(--ink); font-size: 0.82rem; font-weight: 600; }
.hold-list small { display: block; margin-top: 0.12rem; color: var(--muted); font-size: 0.72rem; }

/* ============================================================================
   Unified new-run flow
   ============================================================================ */
.run-flow-page { width: 100%; max-width: 1180px; margin: 0 auto; }
.run-flow-steps { margin: -0.15rem 0 1.15rem; }
.run-flow-steps ol {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.run-flow-steps li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.run-flow-steps li + li::before {
  width: 32px;
  height: 1px;
  flex: none;
  margin-right: 0.2rem;
  background: var(--line);
  content: "";
}
.run-flow-marker {
  display: grid;
  width: 25px;
  height: 25px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 0.68rem;
}
.run-flow-steps li.is-active { color: var(--ink); }
.run-flow-steps li.is-active .run-flow-marker { border-color: var(--brand-300); color: var(--ink); box-shadow: 0 0 0 3px var(--focus-ring); }
.run-flow-steps li.is-complete .run-flow-marker { border-color: var(--brand); background: var(--brand); color: #fff; }
.run-flow-surface { padding: clamp(1rem, 2.8vw, 1.6rem); }
.sample-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.sample-panel-header h3 { margin-bottom: 0.2rem; }
.sample-panel-header p { max-width: 720px; margin: 0; color: var(--muted); font-size: 0.78rem; line-height: 1.45; }
.sample-toolbar { margin-bottom: 0.75rem; padding: 0; border: 0; background: transparent; }
.sample-operations-table { border: 1px solid var(--line); border-radius: 10px; }
.sample-operations-table th {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}
.sample-operations-table td { color: var(--ink-soft); font-size: 0.79rem; }
.sample-token { display: block; max-width: 260px; overflow: hidden; color: var(--ink); font-size: 0.8rem; text-overflow: ellipsis; white-space: nowrap; }
.sample-failure-summary { display: block; max-width: 360px; margin-top: 0.2rem; color: var(--bad); line-height: 1.35; }
.sample-progress {
  display: grid;
  min-width: 0;
  gap: 0.5rem;
}
.sample-progress-detail {
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-subtle);
}
.sample-progress-detail .detail-h { margin-bottom: 0.7rem; }
.sample-progress-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.35rem;
}
.sample-progress-current {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sample-progress-source {
  display: inline-flex;
  flex: none;
  align-items: center;
  padding: 0.08rem 0.36rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--neutral);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}
.sample-progress-source.source-exact {
  border-color: var(--ok);
  color: var(--ok-ink);
}
.sample-progress-source.source-estimated {
  border-color: var(--warn);
  color: var(--ink-soft);
}
.sample-progress-timeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(50px, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}
.sample-progress-cell {
  position: relative;
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 0.18rem;
  color: var(--muted);
  text-align: center;
}
.sample-progress-cell::before {
  position: absolute;
  top: 9px;
  right: 50%;
  left: -50%;
  height: 2px;
  background: var(--line);
  content: '';
}
.sample-progress-cell:first-child::before { display: none; }
.sample-progress-node {
  z-index: 1;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--neutral);
  font-size: 0.68rem;
  font-weight: 700;
}
.sample-progress-stage {
  overflow: hidden;
  width: 100%;
  color: currentColor;
  font-size: 0.61rem;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sample-progress-completed .sample-progress-node {
  border-color: var(--ok);
  background: var(--ok);
  color: #000;
}
.sample-progress-processing .sample-progress-node {
  border-color: var(--info);
  background: var(--info);
  color: #000;
}
.sample-progress-processing { color: var(--info); }
.sample-progress-failed .sample-progress-node {
  border-color: var(--bad);
  background: var(--bad);
  color: #000;
}
.sample-progress-failed { color: var(--bad); }
.sample-progress-warning { color: var(--warn); margin: 0; font-size: 0.72rem; }
.sample-progress-warning .sample-progress-node { border-color: var(--warn); color: var(--warn); }
.sample-progress-cell:last-child::before { background: transparent; border-top: 1px dashed var(--line-strong); }
.sample-progress-stage { white-space: normal; overflow-wrap: anywhere; }
.sample-progress-source.source-exact { border-color: var(--line-strong); color: var(--ink-soft); }
.progress-task-history { min-width: 0; color: var(--muted); font-size: 0.72rem; line-height: 1.45; }
.progress-history-heading { display: flex; align-items: center; gap: 0.25rem; color: var(--ink-soft); font-weight: 600; }
.progress-task-history p { margin: 0.4rem 0; }
.progress-icon { flex: none; vertical-align: middle; }
.progress-icon-spin { animation: sample-progress-spin 1.5s linear infinite; }
.sample-progress-cell { align-content: start; padding-inline: 0.15rem; }
.sample-progress-state { font-size: 0.65rem; line-height: 1.3; }
.sample-progress-queued, .sample-progress-waiting { color: var(--info); }
.sample-progress-queued .sample-progress-node, .sample-progress-waiting .sample-progress-node { border-color: var(--info); color: var(--info); }
.sample-progress-canceled .sample-progress-node { border-color: var(--neutral); color: var(--neutral); }
.progress-activity { display: inline-flex; align-items: center; gap: 0.25rem; }
.sample-progress-meta .progress-activity-running, .sample-progress-meta .progress-activity-queued, .sample-progress-meta .progress-activity-waiting { color: var(--info); }
.sample-progress-meta .progress-activity-completed { color: var(--ok); }
.sample-progress-meta .progress-activity-warning { color: var(--warn); }
.sample-progress-meta .progress-activity-failed { color: var(--bad); }
.progress-error-note { color: var(--warn); font-size: 0.72rem; }
.sample-progress-cell.is-current .sample-progress-node {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}
.sample-progress-cell.is-current .sample-progress-stage {
  color: var(--ink);
  font-weight: 700;
}
.sample-progress-parallel {
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.sample-progress-meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 0.2rem 0.7rem;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.35;
}
.sample-progress-meta > span:first-child {
  font-weight: 700;
}
.sample-progress-compact { min-width: 390px; max-width: 560px; }
.sample-progress-compact .sample-progress-heading { gap: 0.25rem; }
.sample-progress-compact .sample-progress-current { max-width: 150px; font-size: 0.7rem; }
.sample-progress-compact .sample-progress-meta { font-size: 0.59rem; }
@keyframes sample-progress-spin {
  to { transform: rotate(360deg); }
}
.sample-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
}
.sample-metrics > div { padding: 0.85rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-subtle); }
.sample-metrics dt { color: var(--muted); font-size: 0.67rem; font-weight: 700; letter-spacing: 0.045em; text-transform: uppercase; }
.sample-metrics dd { margin: 0.25rem 0 0; color: var(--ink); font-size: 0.94rem; font-weight: 600; overflow-wrap: anywhere; }
.attempt-list { overflow: clip; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; list-style: none; }
.attempt-list li { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 0.8rem 0.9rem; }
.attempt-list li + li { border-top: 1px solid var(--line); }
.attempt-list li > div { display: grid; min-width: 0; gap: 0.12rem; }
.attempt-list strong { color: var(--ink); font-size: 0.82rem; }
.attempt-list span { color: var(--ink-soft); font-size: 0.76rem; }
.attempt-list small { color: var(--bad); font-size: 0.72rem; }
.attempt-run-link { width: fit-content; color: var(--brand-text); font-size: 0.74rem; text-decoration: none; }
.attempt-run-link:hover { color: var(--ink); text-decoration: underline; }
.resource-surface { padding: clamp(1rem, 2.8vw, 1.65rem); }
.resource-template-list { display: grid; gap: 0.85rem; }
.resource-template {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-subtle);
}
.resource-template-pending { background: transparent; }
.resource-template-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--brand-text);
}
.resource-template-copy h3 { margin: 0; color: var(--ink); font-size: 0.96rem; }
.resource-template-copy p { margin: 0.28rem 0 0; color: var(--ink-soft); font-size: 0.84rem; line-height: 1.5; }
.resource-template-copy ul { margin: 0.55rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.78rem; line-height: 1.55; }
.resource-template > .btn,
.resource-template > .tag { align-self: center; white-space: nowrap; }
.merge-wizard { min-height: 360px; }
.merge-review-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.merge-review-header h2 { margin: 0; color: var(--ink); font-size: 1.2rem; }
.merge-review-header p { max-width: 680px; margin: 0.28rem 0 0; color: var(--ink-soft); font-size: 0.86rem; line-height: 1.5; }
.merge-name-input { max-width: 560px; }
.library-picker-list,
.merge-selected-list { list-style: none; margin: 0; padding: 0; }
.library-picker-list { border: 1px solid var(--line); border-radius: 10px; overflow: clip; }
.library-picker-list li + li { border-top: 1px solid var(--line); }
.library-picker-list label {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin: 0;
  padding: 0.9rem 1rem;
  cursor: pointer;
}
.library-picker-list label:hover { background: var(--surface-hover); }
.library-picker-list label.is-disabled { cursor: not-allowed; opacity: 0.58; }
.library-picker-list input { margin-top: 0.22rem; flex: none; }
.library-picker-copy { display: grid; min-width: 0; gap: 0.15rem; }
.library-picker-copy strong { color: var(--ink); font-size: 0.86rem; word-break: break-word; }
.library-picker-copy span { color: var(--ink-soft); font-size: 0.78rem; }
.library-picker-copy small { color: var(--muted); font-size: 0.72rem; }
.library-picker-copy small.quality-missing,
.merge-selected-list small.quality-missing { color: var(--warn); }
.merge-selected-list { border: 1px solid var(--line); border-radius: 10px; overflow: clip; }
.merge-selected-list li { display: flex; gap: 0.8rem; align-items: center; padding: 0.75rem 0.9rem; }
.merge-selected-list li + li { border-top: 1px solid var(--line); }
.merge-selected-list input[type="radio"] { flex: none; }
.merge-selected-list li > span:last-child { display: grid; min-width: 0; gap: 0.1rem; }
.merge-selected-list strong { color: var(--ink); font-size: 0.82rem; word-break: break-word; }
.merge-selected-list small { color: var(--muted); font-size: 0.74rem; }
.merge-code-preview {
  display: block;
  margin: 0.3rem 0;
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}
.merge-selected-order {
  display: grid;
  width: 26px;
  height: 26px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
}
.flow-section-title {
  margin: 0 0 0.85rem;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}
.runs-surface { overflow: clip; }
.run-detail-surface { padding: clamp(1.1rem, 2.8vw, 1.65rem); }

/* ---------- run monitor summary hierarchy ---------- */
.run-status-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.75rem 0.85rem;
  padding: clamp(1rem, 3vw, 1.45rem);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.025), transparent 55%),
    var(--surface-subtle);
}
.run-status-hero .banner-icon { margin-top: 0.12rem; }
.run-hero-metrics {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 0.35rem 0 0;
  padding: 0.85rem 0 0;
  border-top: 1px solid var(--line);
}
.run-hero-metric {
  min-width: 0;
  padding: 0 0.75rem;
  border-left: 1px solid var(--line);
}
.run-hero-metric:first-child { padding-left: 0; border-left: 0; }
.run-hero-metric dt {
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.run-hero-metric dd {
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
}
.run-monitor-section {
  margin-top: 1.55rem;
  padding-top: 1.45rem !important;
  border-top: 1px solid var(--line);
}
.run-stage-section {
  margin-top: 1.25rem;
  padding-top: 0 !important;
  border-top: 0;
}
.run-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.run-section-heading .detail-h { margin-bottom: 0.18rem; }
.run-section-heading p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}
.run-subsection-title {
  margin: 0 0 0.55rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
}

/* Observed stage activity; intentionally no percent-complete or ETA treatment. */
.run-stage-timeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.run-stage {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 178px;
  flex-direction: column;
  gap: 0.38rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-top: 2px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface-subtle);
}
.run-stage-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}
.run-stage-node {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--neutral);
  font-size: 0.67rem;
  font-weight: 700;
}
.run-stage-index {
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.run-stage-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.22rem;
}
.run-stage-title-row strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.run-stage-title-row .info-hint-button {
  width: 19px;
  height: 19px;
  flex: none;
  font-size: 0.58rem;
}
.run-stage-state {
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 700;
}
.run-stage-tasks,
.run-stage-compute,
.run-stage-duration {
  color: var(--muted);
  font-size: 0.61rem;
  line-height: 1.38;
}
.run-stage-duration { margin-top: auto; color: var(--ink-soft); font-weight: 600; }
.run-stage-completed { border-top-color: var(--ok); }
.run-stage-completed .run-stage-node { border-color: var(--ok); background: var(--ok); color: #000; }
.run-stage-running { border-top-color: var(--info); background: linear-gradient(180deg, var(--info-bg), var(--surface-subtle) 42%); }
.run-stage-running .run-stage-node { border-color: var(--info); background: var(--info); color: #000; }
.run-stage-running .run-stage-state { color: #9bc2ff; }
.run-stage-failed { border-top-color: var(--bad); background: linear-gradient(180deg, var(--bad-bg), var(--surface-subtle) 42%); }
.run-stage-failed .run-stage-node { border-color: var(--bad); background: var(--bad); color: #000; }
.run-stage-failed .run-stage-state { color: #ff9aaa; }
.run-stage-canceled { border-top-color: var(--neutral); }
.run-stage-canceled .run-stage-node { border-color: var(--neutral); color: var(--ink-soft); }
.run-stage-warning { border-top-color: var(--warn); }
.run-stage-warning .run-stage-node { border-color: var(--warn); color: var(--warn); }
.run-stage-warning .run-stage-state { color: var(--warn); }
.run-stage-title-row strong { white-space: normal; }
.run-stage .progress-task-history { margin-top: auto; }
.run-stage-queued, .run-stage-waiting { border-top-color: var(--info); }
.run-stage-queued .run-stage-node, .run-stage-waiting .run-stage-node { border-color: var(--info); color: var(--info); }
.run-stage-queued .run-stage-state, .run-stage-waiting .run-stage-state { color: var(--info); }

/* Structured run outcome and gated evidence. */
.run-outcome-section { display: grid; gap: 0.85rem; }
.failure-card {
  overflow: hidden;
  border: 1px solid rgba(255, 107, 129, 0.36);
  border-radius: 10px;
  background: var(--surface-subtle);
}
.failure-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, var(--bad-bg), transparent 68%);
}
.failure-card-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--bad-bg);
  color: var(--bad);
}
.failure-card-heading > div > span {
  color: #ff9aaa;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.failure-card-heading h3 { margin: 0.1rem 0 0; font-size: 1rem; font-weight: 600; }
.failure-card-heading p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.75rem; }
.failure-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.failure-card-grid > div { padding: 0.9rem 1rem; border-left: 1px solid var(--line); }
.failure-card-grid > div:first-child { border-left: 0; }
.failure-card-grid h4 {
  margin: 0 0 0.28rem;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.failure-card-grid p { margin: 0; color: var(--ink-soft); font-size: 0.77rem; line-height: 1.5; }
.failure-card-grid .failure-card-action { background: rgba(167, 0, 254, 0.055); }
.failure-card-grid .failure-card-action h4 { color: var(--brand-text); }
.failure-technical { border-top: 1px solid var(--line); }
.failure-technical summary {
  padding: 0.65rem 1rem;
  color: var(--brand-text);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}
.failure-technical dl { display: grid; gap: 0.6rem; margin: 0; padding: 0 1rem 1rem; }
.failure-technical dl > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 0.75rem; }
.failure-technical dt { color: var(--muted); font-size: 0.68rem; font-weight: 600; }
.failure-technical dd { min-width: 0; margin: 0; color: var(--ink-soft); font-size: 0.72rem; overflow-wrap: anywhere; }
.failure-batch-id { display: block; width: fit-content; margin-bottom: 0.18rem; }
.run-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-subtle);
}
.run-action-bar h3 { margin: 0; font-size: 0.82rem; font-weight: 600; }
.run-action-bar p { margin: 0.12rem 0 0; color: var(--muted); font-size: 0.7rem; }
.run-action-buttons { display: flex; flex: none; flex-wrap: wrap; justify-content: flex-end; gap: 0.45rem; }

/* Launch attempt history. */
.run-attempt-timeline { position: relative; display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.run-attempt {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0 0 1rem;
}
.run-attempt:last-child { padding-bottom: 0; }
.run-attempt::before {
  position: absolute;
  top: 10px;
  bottom: -10px;
  left: 9px;
  width: 1px;
  background: var(--line-strong);
  content: '';
}
.run-attempt:last-child::before { display: none; }
.run-attempt-marker {
  z-index: 1;
  width: 19px;
  height: 19px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: var(--neutral);
  box-shadow: 0 0 0 1px var(--line-strong);
}
.run-attempt-green .run-attempt-marker { background: var(--ok); }
.run-attempt-blue .run-attempt-marker { background: var(--info); }
.run-attempt-red .run-attempt-marker { background: var(--bad); }
.run-attempt-body { min-width: 0; padding: 0.8rem 0.9rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-subtle); }
.run-attempt-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 0.42rem; }
.run-attempt-heading strong { margin-right: auto; color: var(--ink); font-size: 0.85rem; }
.run-attempt-times {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0.7rem 0 0;
}
.run-attempt-times > div { min-width: 0; }
.run-attempt-times dt { color: var(--muted); font-size: 0.59rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.run-attempt-times dd { overflow: hidden; margin: 0.14rem 0 0; color: var(--ink-soft); font-size: 0.7rem; text-overflow: ellipsis; white-space: nowrap; }
.run-attempt-failure { margin: 0.65rem 0 0; color: var(--bad); font-size: 0.7rem; }
.run-other-files { margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.run-file-groups { display: grid; gap: 0.5rem; }
.run-file-group { min-width: 0; border: 1px solid var(--line); border-radius: 9px; }
.run-file-group > summary { display: flex; align-items: center; gap: 0.55rem; padding: 0.7rem 0.8rem; border-radius: 9px; color: var(--ink); background: var(--surface-subtle); font-size: 0.85rem; font-weight: 600; cursor: pointer; list-style: none; }
.run-file-group > summary::-webkit-details-marker { display: none; }
.run-file-group > summary::before { content: ''; width: 0.4rem; height: 0.4rem; flex-shrink: 0; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); }
.run-file-group[open] > summary::before { transform: rotate(45deg); }
.run-file-group > summary:hover { background: var(--surface-hover); }
.run-file-group > summary:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 2px; }
.run-file-group-count { margin-left: auto; flex-shrink: 0; color: var(--muted); font-size: 0.75rem; font-weight: 400; }
.run-file-group-content { padding: 0.8rem; }
.run-file-group-description { margin: 0 0 0.65rem; color: var(--muted); font-size: 0.8rem; }
.run-file-group .track-list { margin-bottom: 0; }
.run-file-group .track-meta { overflow-wrap: anywhere; }
.run-file-libraries { display: grid; gap: 0.25rem; }
.run-file-library { min-width: 0; border-bottom: 1px solid var(--line); }
.run-file-library:last-child { border-bottom: none; }
.run-file-library > summary { display: flex; align-items: center; gap: 0.6rem; padding: 0.65rem 0.4rem; cursor: pointer; list-style: none; font-size: 0.83rem; font-weight: 500; }
.run-file-library > summary::-webkit-details-marker { display: none; }
.run-file-library > summary::before { content: ''; width: 0.35rem; height: 0.35rem; flex-shrink: 0; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); }
.run-file-library[open] > summary::before { transform: rotate(45deg); }
.run-file-library > summary:hover { background: var(--surface-hover); }
.run-file-library > summary:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 2px; }
.run-file-library-name { min-width: 0; overflow-wrap: anywhere; }
.run-file-library > .track-list { padding-left: 0.75rem; }
.run-technical-disclosures { display: grid; gap: 0.65rem; }
.run-technical-disclosures .detail-reveal { padding: 0.8rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-subtle); }
.run-reviewer-note { color: var(--muted); font-size: 0.72rem; }

/* Run-wide sample status and operational detail. */
.sample-count-summary { display: grid; min-width: 100px; justify-items: end; }
.sample-count-summary strong { color: var(--ink); font-size: 1.05rem; line-height: 1; }
.sample-count-summary span,
.sample-count-summary small { color: var(--muted); font-size: 0.64rem; }
.sample-count-summary small { margin-top: 0.12rem; color: var(--brand-text); }
.sample-status-chips { display: flex; flex-wrap: wrap; gap: 0.42rem; margin-bottom: 0.8rem; }
.sample-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.36rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 0.68rem;
  cursor: pointer;
}
.sample-status-chip strong {
  display: grid;
  min-width: 20px;
  height: 20px;
  padding: 0 0.3rem;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-hover);
  color: var(--ink);
  font-size: 0.64rem;
}
.sample-status-chip:hover { border-color: var(--line-strong); color: var(--ink-soft); }
.sample-status-chip.is-active { border-color: var(--brand-300); color: var(--ink); box-shadow: 0 0 0 2px rgba(183, 46, 255, 0.12); }
.sample-status-green strong { color: var(--ok-ink); }
.sample-status-blue strong { color: #9bc2ff; }
.sample-status-amber strong { color: #f6d67d; }
.sample-status-red strong { color: #ff9aaa; }
.sample-operations-table tbody tr { border-left: 2px solid transparent; }
.sample-operations-table tbody tr.sample-row-attention { border-left-color: var(--bad); background: rgba(255, 107, 129, 0.025); }
.sample-summary-row > td { padding-top: 0.8rem; padding-bottom: 0.8rem; }
.sample-summary-row .profile-controls { flex-wrap: wrap; gap: 0.45rem; }
.sample-summary-row .profile-select { min-width: 170px; width: auto; max-width: 440px; }
.sample-detail-action { white-space: nowrap; }
.sample-expanded-row > td { padding: 0.85rem 1rem 1rem; background: var(--surface-subtle); }
.sample-expanded-details { display: flex; flex-wrap: wrap; align-items: start; gap: 1.25rem 2rem; }
.sample-expanded-details > div { min-width: 0; }
.sample-expanded-details > .sample-progress-column { flex: 1 1 400px; }
.sample-expanded-details h4 { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.run-profile-downloads > summary { cursor: pointer; }
.run-profile-downloads[open] > summary { margin-bottom: 0.65rem; }
.sample-progress-column { min-width: 400px; }
.sample-attempt-summary,
.sample-quality-summary,
.sample-profile-summary { display: grid; gap: 0.1rem; min-width: 108px; }
.sample-attempt-summary strong,
.sample-profile-summary strong { color: var(--ink); font-size: 0.72rem; }
.sample-attempt-summary span { width: fit-content; color: var(--brand-text); font-size: 0.64rem; font-weight: 600; }
.sample-tracking-id { max-width: 230px; overflow-wrap: anywhere; }
.sample-attempt-summary small,
.sample-profile-summary small,
.sample-quality-summary span { color: var(--muted); font-size: 0.64rem; line-height: 1.35; }
.sample-quality-summary span:first-child { color: var(--ink-soft); }
.sample-progress-current { display: grid; gap: 0.04rem; }
.sample-progress-current > span { color: var(--muted); font-size: 0.52rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.sample-progress-current > strong { overflow: hidden; color: var(--ink); font-size: 0.7rem; text-overflow: ellipsis; white-space: nowrap; }

/* Readable processing activity with raw lines kept in Advanced. */
.log-view { display: grid; gap: 0.7rem; }
.log-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 0.8rem; }
.log-attempt-select { display: grid; gap: 0.22rem; min-width: min(290px, 100%); }
.log-attempt-select > span { color: var(--muted); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.log-severity-filter { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; }
.log-severity-filter button {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.48rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.66rem;
}
.log-severity-filter button span { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.log-severity-filter button:hover { background: var(--surface-hover); color: var(--ink-soft); }
.log-severity-filter button.is-active { border-color: var(--brand-300); background: rgba(167, 0, 254, 0.1); color: var(--ink); }
.log-activity-feed {
  max-height: 380px;
  overflow: auto;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--page-bg);
  list-style: none;
}
.log-activity-item { display: grid; gap: 0.28rem; padding: 0.72rem 0.8rem; border-left: 2px solid var(--line-strong); }
.log-activity-item + .log-activity-item { border-top: 1px solid var(--line); }
.log-activity-warning { border-left-color: var(--warn); background: rgba(240, 194, 75, 0.025); }
.log-activity-error { border-left-color: var(--bad); background: rgba(255, 107, 129, 0.035); }
.log-activity-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem; color: var(--muted); font-size: 0.6rem; }
.log-severity { padding: 0.07rem 0.3rem; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink-soft); font-weight: 700; text-transform: uppercase; }
.log-activity-warning .log-severity { border-color: rgba(240, 194, 75, 0.45); color: #f6d67d; }
.log-activity-error .log-severity { border-color: rgba(255, 107, 129, 0.45); color: #ff9aaa; }
.log-context { color: var(--brand-text); }
.log-activity-item p { margin: 0; color: var(--ink-soft); font-size: 0.76rem; line-height: 1.48; overflow-wrap: anywhere; }
.log-advanced { border-top: 1px solid var(--line); padding-top: 0.55rem; }
.log-advanced summary { width: fit-content; color: var(--brand-text); font-size: 0.7rem; font-weight: 600; cursor: pointer; }
.log-raw-pane { min-height: 160px; margin-top: 0.55rem; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

/* ---------- responsive behavior ---------- */
@media (max-width: 1080px) {
  .connection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .run-stage-timeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 899px) {
  .user-meta { display: none !important; }
  .settings-layout { grid-template-columns: 1fr; gap: 1.2rem; }
  .settings-sidebar { position: static; }
  .settings-nav { display: none; }
  .settings-mobile-nav { display: block; }
  .run-monitor-demo-layout { grid-template-columns: 1fr; }
  .run-monitor-demo-nav { position: static; max-height: none; }
  .run-monitor-demo-nav nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .app-bar { gap: 0.55rem; min-height: 62px; padding: 0.5rem 0.75rem; flex-wrap: nowrap; }
  .brand-wordmark { width: 78px; }
  .brand-divider { height: 24px; }
  .app-nav { align-self: stretch; }
  .app-nav a { padding: 0.48rem 0.58rem; }
  .page { padding-top: 1.5rem; }
  .surface { border-radius: 9px; }
  .runs-toolbar { position: static; margin-top: -0.35rem; }
  .runs-count { width: 100%; margin-left: 0; }
  .runs-search { flex: 1 1 100%; width: 100% !important; }
  .banner { align-items: flex-start; flex-wrap: wrap; }
  .banner-action { width: 100%; }
  .run-hero-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem 0; }
  .run-hero-metric { padding-left: 0.7rem; }
  .run-hero-metric:nth-child(odd) { padding-left: 0; border-left: 0; }
  .failure-card-grid { grid-template-columns: 1fr; }
  .failure-card-grid > div { border-top: 1px solid var(--line); border-left: 0; }
  .failure-card-grid > div:first-child { border-top: 0; }
  .run-action-bar { align-items: stretch; flex-direction: column; }
  .run-action-buttons { justify-content: flex-start; }
  .run-attempt-times { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .log-toolbar { align-items: stretch; flex-direction: column; }
  .log-attempt-select { width: 100%; }
  .submit-review { min-height: 0; padding-top: 1.5rem; padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .setting-row { grid-template-columns: 1fr; gap: 0.28rem; }
  .connection-grid { grid-template-columns: 1fr; }
  .connection-card { min-height: 0; }
}

@media (max-width: 640px) {
  .login-hero { padding: 1rem; }
  .login-card { padding: 2.25rem 1.35rem; }
  .login-motif { width: 70vw; opacity: 0.055; }
  .onboarding-page-header { text-align: left; }
  .onboarding-page-header p { margin-left: 0; }
  .onboarding-surface { padding: 1.2rem; }
  .run-monitor-demo-badge { display: none; }
  .run-monitor-demo-nav nav { grid-template-columns: 1fr; }
  .run-monitor-demo-selection { align-items: flex-start; flex-direction: column; }
  .run-monitor-demo-surface { padding: 1rem; }
  .wizard-stepper { margin-bottom: 1.75rem; }
  .wizard-step-label { display: none; }
  .wizard-choice-grid { grid-template-columns: 1fr; }
  .wizard-choice-card { min-height: 0; }
  .wizard-oauth-action { align-items: stretch; flex-direction: column; }
  .wizard-welcome { grid-template-columns: 1fr; }
  .wizard-brand-motif { display: none; }
  .wizard-panel { min-height: 0; }
  .wizard-actions { flex-direction: column-reverse; }
  .wizard-actions .btn { width: 100%; }
  .file-list { columns: 1; }
  .brand-divider, .brand-name { display: none; }
  .user-meta { display: none !important; }
  .account-menu > summary { padding: 0.22rem; }
  .account-menu-chevron { display: none; }
  .page-header-composed { align-items: stretch; flex-direction: column; gap: 0.9rem; }
  .page-header-actions { width: 100%; }
  .page-header-actions .btn { width: 100%; justify-content: center; }
  .settings-page-header { margin-bottom: 1.25rem; padding-bottom: 1.1rem; }
  .settings-overview-card { grid-template-columns: 40px minmax(0, 1fr); padding: 0.9rem; }
  .settings-overview-icon { width: 40px; height: 40px; }
  .settings-overview-arrow { display: none; }
  .settings-section-header { align-items: stretch; flex-direction: column; }
  .retention-options { gap: 0.45rem; }
  .retention-option { min-height: 76px; }
  .run-flow-steps li + li::before { width: 24px; }
  .resource-template { grid-template-columns: 40px minmax(0, 1fr); }
  .resource-template-icon { width: 40px; height: 40px; }
  .resource-template > .btn,
  .resource-template > .tag { grid-column: 2; justify-self: start; }
  .merge-review-header { flex-direction: column; }
  .sample-panel-header { flex-direction: column; }
  .sample-count-summary { justify-items: start; }
  .run-stage-timeline { grid-template-columns: 1fr; }
  .run-stage { min-height: 0; }
  .failure-technical dl > div { grid-template-columns: 1fr; gap: 0.12rem; }
  .run-action-buttons .btn { width: 100%; }
  .sample-toolbar .form-select { width: 100% !important; }
  .sample-operations-table { overflow: visible; border: 0; }
  .sample-operations-table table,
  .sample-operations-table tbody,
  .sample-operations-table tr,
  .sample-operations-table td { display: block; width: 100%; }
  .sample-operations-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .sample-operations-table tbody { display: grid; gap: 0.65rem; }
  .sample-operations-table tbody tr {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-left: 2px solid transparent;
    border-radius: 9px;
    background: var(--surface-subtle);
  }
  .sample-operations-table tbody tr.sample-row-attention { border-left-color: var(--bad); }
  .sample-operations-table td {
    display: grid;
    grid-template-columns: minmax(92px, 0.32fr) minmax(0, 1fr);
    gap: 0.65rem;
    align-items: start;
    padding: 0.62rem 0.7rem;
    border-top: 1px solid var(--line);
  }
  .sample-operations-table td:first-child { border-top: 0; }
  .sample-operations-table td::before {
    color: var(--muted);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    text-transform: uppercase;
    content: attr(data-label);
  }
  .sample-progress-column { min-width: 0; grid-template-columns: 1fr !important; }
  .sample-progress-column::before { margin-bottom: 0.2rem; }
  .sample-progress-compact { min-width: 0; max-width: none; }
  .sample-progress-compact .sample-progress-timeline { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 0.7rem; }
  .sample-progress-compact .sample-progress-cell:nth-child(4)::before { display: none; }
  .sample-progress-compact .sample-progress-stage { font-size: 0.52rem; }
  .sample-detail-action .btn { width: fit-content; }
  .sample-operations-table tbody tr.sample-expanded-row { margin-top: -0.65rem; border-top: 0; border-radius: 0 0 9px 9px; }
  .sample-operations-table .sample-expanded-row > td { display: block; }
  .sample-expanded-row > td::before { display: none; }
  .sample-expanded-details { gap: 1rem; }
  .sample-expanded-details > .sample-progress-column { flex-basis: 100%; }
  .sample-summary-row .profile-controls { align-items: center; }
  .sample-summary-row .profile-select { min-width: 0; width: 100%; max-width: none; flex-basis: 100%; }
  .sample-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sample-progress:not(.sample-progress-compact) .sample-progress-timeline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 0.8rem;
  }
  .sample-progress:not(.sample-progress-compact) .sample-progress-cell:nth-child(4)::before {
    display: none;
  }
  .track { align-items: flex-start; flex-wrap: wrap; }
  .track .dl-btn { margin-left: auto; }
  .profile-row { flex-wrap: wrap; align-items: flex-start; }
  .profile-controls { width: 100%; }
  .profile-select { flex: 1; min-width: 0; }
  .step { min-width: 33.333%; margin-bottom: 0.9rem; }
  .step:nth-child(4)::before { display: none; }
  .detail-dl { grid-template-columns: 1fr; gap: 0.12rem; }
  .detail-dl dd { margin-bottom: 0.55rem; }
  .input-actions { white-space: normal; }
  .input-actions-group { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- administrator uploads ---------- */
.uploads-content { display: grid; gap: 1.25rem; }
.upload-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.upload-section-heading h2 { margin: 0; color: var(--ink); font-size: 1rem; font-weight: 500; letter-spacing: -0.015em; }
.upload-section-heading p { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.upload-private-note { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--muted); font-size: 0.75rem; flex-shrink: 0; }
.upload-folder-picker { display: flex; align-items: center; gap: 1rem; padding: 1.5rem; border: 1px dashed var(--line-strong); border-radius: 9px; background: var(--surface-subtle); }
.upload-folder-picker.has-selection { border-style: solid; border-color: var(--brand-300); }
.upload-folder-icon { display: grid; place-items: center; flex-shrink: 0; width: 46px; height: 46px; border-radius: 10px; background: var(--surface-hover); color: var(--brand-text); font-size: 1.2rem; }
.upload-folder-copy { min-width: 0; flex: 1; }
.upload-folder-copy strong, .upload-list-copy strong { display: block; color: var(--ink); font-size: 0.9rem; font-weight: 500; overflow-wrap: anywhere; }
.upload-folder-copy p, .upload-list-copy p { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.8rem; }
.upload-folder-picker > .btn { flex-shrink: 0; }
.upload-transfer-footer { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-top: 1.15rem; }
.upload-help { display: flex; align-items: baseline; gap: 0.5rem; max-width: 510px; margin: 0; color: var(--muted); font-size: 0.78rem; line-height: 1.55; }
.upload-help i { flex-shrink: 0; }
.upload-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.upload-transfer-footer > .upload-actions { flex-shrink: 0; }
.upload-progress-block { margin-top: 1.35rem; }
.upload-progress-heading { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; font-size: 0.78rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.upload-progress { display: block; appearance: none; width: 100%; height: 6px; overflow: hidden; border: 0; border-radius: 99px; background: var(--surface-hover); color: var(--brand); }
.upload-progress::-webkit-progress-bar { background: var(--surface-hover); border-radius: 99px; }
.upload-progress::-webkit-progress-value { background: var(--brand); border-radius: 99px; }
.upload-progress::-moz-progress-bar { background: var(--brand); border-radius: 99px; }
.upload-status-message { margin-top: 0.65rem; color: var(--ink-soft); font-size: 0.8rem; overflow-wrap: anywhere; }
.upload-history > .upload-section-heading { margin-bottom: 0; }
.upload-list { list-style: none; margin: 1.2rem 0 0; padding: 0; }
.upload-list-item { display: flex; align-items: flex-start; gap: 0.85rem; padding: 1.1rem 0; border-top: 1px solid var(--line); }
.upload-list-item:last-child { padding-bottom: 0; }
.upload-list-icon { color: var(--muted); padding-top: 0.1rem; }
.upload-list-copy { flex: 1; min-width: 0; }
.upload-location { margin-top: 0.6rem; font-size: 0.73rem; color: var(--muted); }
.upload-location summary { cursor: pointer; width: fit-content; }
.upload-location code { display: block; margin-top: 0.4rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.upload-list-controls { display: flex; align-items: flex-end; flex-direction: column; gap: 0.7rem; }
.upload-list-controls > .btn { display: inline-flex; align-items: center; gap: 0.5rem; }
.upload-history-footer { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; text-align: center; }
.upload-loading { padding: 3rem 1rem; text-align: center; color: var(--muted); font-size: 0.85rem; }
@media (max-width: 767px) {
  .upload-section-heading, .upload-transfer-footer { align-items: flex-start; flex-direction: column; gap: 0.85rem; }
  .upload-folder-picker { flex-wrap: wrap; padding: 1.15rem; }
  .upload-folder-picker > .btn { width: 100%; }
  .upload-transfer-footer > .upload-actions { width: 100%; }
  .upload-transfer-footer > .upload-actions > .btn { flex: 1; }
  .upload-list-item { flex-wrap: wrap; }
  .upload-list-copy { flex-basis: calc(100% - 2rem); }
  .upload-list-controls { align-items: flex-start; padding-left: 1.85rem; width: 100%; }
}

/* Evidence-based stage indicators */
.stage-work-progress { --work-color: var(--info); color: var(--work-color); }
.stage-work-completed { --work-color: var(--ok-ink); }
.stage-work-failed { --work-color: var(--bad); }
.stage-work-warning { --work-color: var(--warn); }
.stage-work-waiting, .stage-work-blocked, .stage-work-canceled { --work-color: var(--muted); }
.stage-work-linear { display: grid; gap: 9px; margin-top: auto; padding-top: 16px; }
.stage-work-value { color: var(--ink-soft); font-size: 12px; font-variant-numeric: tabular-nums; }
.stage-work-linear > .stage-work-track { display: block; height: 5px; overflow: hidden; border-radius: 8px; background: var(--line-strong); }
.stage-work-linear .stage-work-fill { display: block; height: 100%; background: var(--work-color); border-radius: inherit; transition: width 200ms ease-out; }
.stage-work-linear > .stage-work-indeterminate { background: repeating-linear-gradient(110deg, var(--line-strong) 0 7px, var(--info-bg) 7px 14px); }
.sample-work-timeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px 10px; list-style: none; padding: 8px 0 0; margin: 0; max-width: 740px; }
.sample-work-stage { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; min-width: 0; }
.sample-work-stage > strong { color: var(--ink); font-size: 11px; line-height: 1.4; font-weight: 600; }
.stage-work-state { color: var(--muted); font-size: 10px; line-height: 1.4; }
.stage-work-warning > .stage-work-state { color: var(--warn); }
.stage-work-failed > .stage-work-state { color: var(--bad); }
.sample-work-stage > small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.stage-work-ring { position: relative; flex: none; width: 48px; height: 48px; margin-bottom: 3px; }
.stage-work-ring svg { display: block; overflow: visible; fill: none; stroke-width: 3; }
.stage-work-ring .stage-work-track { stroke: var(--line-strong); }
.stage-work-ring .stage-work-fill { stroke: var(--work-color); stroke-linecap: round; }
.stage-work-check { stroke: var(--work-color); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.stage-work-ring-value { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ink-soft); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stage-work-ring-value small { font-size: 8px; margin-left: 1px; }

.stage-work-spin { transform-origin: 24px 24px; animation: stage-work-rotate 1.4s linear infinite; }
.stage-work-linear > .stage-work-indeterminate { background: repeating-linear-gradient(110deg, var(--line-strong) 0 7px, var(--info-bg) 7px 14px); background-size: 200% 100%; animation: stage-work-slide 3s linear infinite; }
@keyframes stage-work-rotate { to { transform: rotate(360deg); } }
@keyframes stage-work-slide { to { background-position: 100% 0; } }
.run-stage-timeline { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.run-hero-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) { .sample-expanded-details > .sample-progress-column { flex-basis: 100%; } }
@media (max-width: 1080px) { .run-stage-timeline { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .run-stage-timeline { grid-template-columns: 1fr; }
  .run-hero-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sample-work-timeline { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 8px; }
}
@media (prefers-reduced-motion: reduce) { .stage-work-spin, .stage-work-indeterminate { animation: none !important; } .stage-work-fill { transition: none !important; } }

/* Standalone merges start from mapped libraries and have four processing stages. */
@media (min-width: 1081px) {
  .run-stage-timeline[data-run-kind="merge"],
  .sample-work-timeline[data-run-kind="merge"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Full raw processing-log copy action. */
.log-copy-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.log-copy-feedback { color: var(--muted); font-size: 0.85rem; }
.log-copy-button { display: inline-flex; align-items: center; gap: 0.5rem; flex-shrink: 0; margin-left: auto; }

.run-file-group .track-title > span { min-width: 0; overflow-wrap: anywhere; }

/* Flat supporting-file collection, scoped to the run detail table. */
.supporting-files { min-width: 0; }
.supporting-files-header { display: flex; align-items: baseline; gap: .8rem; margin-bottom: 1rem; }
.supporting-files-header h3 { font-size: 1.15rem; font-weight: 600; margin: 0; }
.supporting-files-header > span { color: var(--muted); font-size: .8rem; }
.supporting-files-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.supporting-files-filters button { display: inline-flex; gap: .5rem; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: .4rem .65rem; background: transparent; color: var(--ink-soft); font-size: .8rem; }
.supporting-files-filters button span { color: var(--muted); font-size: .72rem; }
.supporting-files-filters button[aria-pressed="true"] { border-color: var(--brand-text); background: var(--surface-subtle); color: var(--ink); }
.supporting-files-filters button:hover { background: var(--surface-hover); }
.supporting-files-scroll { position: relative; overflow-x: auto; border-top: 1px solid var(--line); }
.supporting-files-table { width: 100%; min-width: 690px; border-collapse: collapse; font-size: .82rem; }
.supporting-files-table th, .supporting-files-table td { padding: .85rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.supporting-files-table thead th { color: var(--muted); font-size: .73rem; font-weight: 500; white-space: nowrap; }
.supporting-files-table tbody th { font-weight: 500; width: 40%; }
.supporting-files-table tbody tr:hover { background: var(--surface-subtle); }
.supporting-file-name { display: flex; align-items: center; gap: .65rem; }
.supporting-file-name > i { color: var(--muted); flex-shrink: 0; }
.supporting-file-name > span { overflow-wrap: anywhere; min-width: 0; }
.supporting-files-table td { color: var(--ink-soft); overflow-wrap: anywhere; }
.supporting-file-type { font-size: .75rem; color: var(--muted); }
.supporting-files-table .file-size { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.supporting-files-table .file-action { text-align: right; white-space: nowrap; }
.supporting-files-table .file-action a { display: inline-flex; align-items: center; gap: .4rem; font-size: .75rem; }
.supporting-files :focus-visible { outline: 2px solid var(--brand-text); outline-offset: 3px; }

.workspace-setup-form { display: grid; gap: 1rem; text-align: left; }
.workspace-setup-form label { display: grid; gap: .4rem; }
.workspace-setup-form input { width: 100%; padding: .65rem; border: 1px solid #64748b; border-radius: .4rem; background: #fff; color: #111827; }
.workspace-setup-form button:disabled { opacity: .55; cursor: wait; }
