/* LensGrid control plane — technical dark console theme (rose accent).
   Near-black surfaces, hairline borders, sharp corners, uppercase tracked
   labels, ghost buttons, solid status chips, monospace data boxes. */

:root {
  color-scheme: dark;

  /* Surfaces (near-black neutral grays) */
  --canvas: hsl(0 0% 4.3%);          /* app canvas */
  --sidebar: hsl(0 0% 5.5%);         /* nav rail */
  --surface-100: hsl(0 0% 7.5%);     /* cards / panels */
  --surface-200: hsl(0 0% 10.2%);    /* raised / hover / thead */
  --surface-300: hsl(0 0% 13%);
  --control: hsl(0 0% 9%);           /* inputs */
  --control-hover: hsl(0 0% 12.5%);
  --overlay: hsl(0 0% 10.2%);

  /* Borders (hairline) */
  --border: hsl(0 0% 15.5%);
  --border-muted: hsl(0 0% 11%);
  --border-strong: hsl(0 0% 20%);
  --border-control: hsl(0 0% 24%);

  /* Foreground */
  --fg: hsl(0 0% 92%);
  --fg-light: hsl(0 0% 65%);
  --fg-lighter: hsl(0 0% 59%);
  --fg-muted: hsl(0 0% 47%);

  /* Brand — ROSE */
  --brand: #dd6f93;          /* dots / accents */
  --brand-hover: #c85c80;
  --brand-link: #ef9fb8;     /* link / hover text */
  --brand-bg: hsl(340 45% 15%);
  --brand-border: hsl(340 42% 34%);

  /* Warning (amber) */
  --warning: #d99a2b;
  --warning-bg: hsl(38 70% 13%);
  --warning-border: hsl(38 55% 28%);

  /* Success / live connection */
  --success: hsl(151 68% 54%);
  --success-fg: hsl(151 42% 68%);

  /* SomaStacks tracking evidence */
  --tracking-left: #41d3dc;
  --tracking-left-muted: rgba(65, 211, 220, 0.18);
  --tracking-right: #e5a83a;
  --tracking-right-muted: rgba(229, 168, 58, 0.18);
  --camera-geometry: #82909d;

  /* Supply lineage selection */
  --lineage-context-node-opacity: 0.86;
  --lineage-context-edge-opacity: 0.08;

  /* Destructive / blocked (rose-toned) */
  --destructive: #d96a8a;
  --destructive-fg: #eaa6ba;
  --destructive-bg: hsl(342 42% 16%);
  --destructive-border: hsl(342 42% 34%);

  /* Info / neutral processing chip */
  --info-bg: hsl(0 0% 13%);
  --info-border: hsl(0 0% 22%);

  --mono: "Source Code Pro", "Office Code Pro", ui-monospace, Menlo, Monaco, monospace;
  --radius: 10px;
  --radius-md: 6px;
  --radius-sm: 3px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.34), 0 10px 30px rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--fg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

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

button,
input,
select {
  font: inherit;
}

/* ---------- Buttons ---------- */
/* Primary action = brand (rose) */
/* Primary + secondary buttons = ghost outline, uppercase, tracked */
button,
.secondary-button {
  align-items: center;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--fg-light);
  cursor: pointer;
  display: inline-flex;
  font-size: 11px;
  font-weight: 600;
  justify-content: center;
  letter-spacing: 0.07em;
  min-height: 34px;
  padding: 0 14px;
  text-transform: uppercase;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
  white-space: nowrap;
}

button:hover,
.secondary-button:hover {
  background: var(--surface-200);
  border-color: var(--border-control);
  color: var(--fg);
}

button:active,
.secondary-button:active {
  background: var(--surface-300);
}

button:focus-visible,
.secondary-button:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

button:disabled,
.secondary-button[aria-disabled="true"] {
  background: transparent;
  border-color: var(--border-muted);
  color: var(--fg-muted);
  cursor: not-allowed;
}

/* Table action (e.g. View details) = small bordered button, title case */
.secondary-link {
  align-items: center;
  background: var(--surface-200);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--fg-light);
  display: inline-flex;
  font-size: 12px;
  font-weight: 500;
  min-height: 30px;
  padding: 0 12px;
  white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.secondary-link:hover {
  background: var(--surface-300);
  border-color: var(--border-control);
  color: var(--fg);
}

.action-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.action-grid .secondary-link {
  justify-content: center;
  min-height: 44px;
}

/* ---------- Layout ---------- */
.app-frame {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border-muted);
  color: var(--fg-light);
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100vh;
  min-height: 100vh;
  overflow-y: auto;
  padding: 16px 12px;
  position: sticky;
  top: 0;
}

.brand-lockup {
  align-items: center;
  display: flex;
  gap: 10px;
  min-height: 40px;
  padding: 2px 6px;
}

.brand-lockup strong {
  color: var(--fg);
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.1;
}

.brand-lockup small {
  color: var(--fg-lighter);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.brand-logo,
.auth-logo {
  background: transparent;
  display: block;
  flex: none;
  height: 34px;
  width: 34px;
}

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

.primary-nav p {
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin: 16px 6px 6px;
  text-transform: uppercase;
}

.primary-nav p:first-child {
  margin-top: 0;
}

.nav-item {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--fg-light);
  display: flex;
  gap: 9px;
  font-size: 13px;
  min-height: 32px;
  padding: 0 8px;
  transition: background-color 120ms ease, color 120ms ease;
}

.nav-item:hover {
  background: var(--surface-200);
  color: var(--fg);
}

.nav-item.active {
  background: var(--surface-200);
  border: 1px solid var(--border);
  color: var(--fg);
}

.muted-nav {
  color: var(--fg-lighter);
}

.nav-icon {
  align-items: center;
  color: var(--fg-lighter);
  display: inline-flex;
  flex: none;
  height: 18px;
  justify-content: center;
  width: 18px;
}

.nav-icon svg {
  height: 18px;
  width: 18px;
}

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

.sidebar-foot {
  align-items: center;
  border-top: 1px solid var(--border-muted);
  color: var(--fg-lighter);
  display: flex;
  gap: 8px;
  font-size: 12px;
  margin-top: auto;
  padding: 14px 6px 2px;
}

.workspace {
  min-width: 0;
}

.topbar {
  align-items: center;
  background: rgba(20, 20, 20, 0.8);
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  gap: 14px;
  justify-content: flex-start;
  min-height: 56px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.topbar-title {
  align-items: center;
  color: var(--fg);
  display: inline-flex;
  font-size: 15px;
  font-weight: 600;
  gap: 10px;
}

.topbar-grid-icon {
  color: var(--fg);
  height: 18px;
  width: 18px;
}

.topbar-sep {
  color: var(--fg-muted);
  font-size: 16px;
  margin: 0 -4px;
}

.env-badge {
  align-items: center;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--fg);
  display: inline-flex;
  font-size: 13px;
  font-weight: 500;
  gap: 8px;
  min-height: 36px;
  min-width: 174px;
  padding: 0 12px;
}

.env-dot {
  background: var(--brand);
  border-radius: 999px;
  flex: none;
  height: 7px;
  width: 7px;
}

.env-name {
  color: var(--fg);
}

.pulse,
.health-dot {
  background: var(--brand);
  border-radius: 999px;
  display: inline-block;
  height: 7px;
  width: 7px;
}

.system-status {
  color: var(--fg-lighter);
  font-size: 14px;
  margin-left: 4px;
  margin-right: auto;
}

.actor {
  color: var(--fg-light);
  font-size: 13px;
  font-weight: 500;
}

.logout-form {
  margin: 0;
}

.shell {
  margin: 0 auto;
  max-width: 1420px;
  padding: 20px 24px 24px;
}

.somastacks-page .shell {
  max-width: none;
}

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

.breadcrumb {
  color: var(--fg-lighter);
  font-size: 12px;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

h1,
h2,
p,
dl,
dd {
  margin: 0;
}

h1 {
  color: var(--fg);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

h2 {
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
}

.page-head p,
.panel-heading p,
.row-meta,
.metric-card em {
  color: var(--fg-lighter);
}

.page-head p {
  font-size: 14px;
  margin-top: 4px;
}

/* ---------- Integrated control sheet ---------- */
.control-sheet {
  background: var(--canvas);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.control-sheet > .page-head {
  margin-bottom: 0;
  padding: 18px 18px 8px;
}

.control-sheet-head {
  border-bottom: 1px solid var(--border-muted);
}

.control-sheet-grid {
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr);
}

.supplier-sheet-grid {
  grid-template-columns: 270px minmax(0, 1fr);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: clip;
}

.panel {
  background: var(--surface-100);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric-card {
  align-items: baseline;
  column-gap: 9px;
  display: grid;
  grid-template-areas:
    "eyebrow eyebrow"
    "num     label";
  grid-template-columns: auto 1fr;
  padding: 13px 18px 14px;
}

.metric-card + .metric-card {
  border-left: 1px solid var(--border-muted);
}

.metric-card small {
  color: var(--fg-lighter);
  font-size: 11px;
  font-weight: 600;
  grid-area: eyebrow;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.metric-card span {
  color: var(--fg);
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  grid-area: num;
  line-height: 1;
}

.metric-card em {
  font-size: 12px;
  font-style: normal;
  grid-area: label;
}

/* ---------- Grids ---------- */
.ops-grid {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 280px;
}

.supplier-grid {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 300px;
}

.control-pane {
  border-right: 1px solid var(--border-strong);
  box-shadow: inset -1px 0 0 var(--border-muted);
  overflow: hidden;
}

.control-pane-head {
  border-bottom: 1px solid var(--border-muted);
  padding: 14px 18px;
}

.control-pane-head h2 {
  font-size: 15px;
}

.control-pane-head p {
  color: var(--fg-lighter);
  font-family: var(--mono);
  font-size: 12px;
  margin-top: 4px;
}

.control-group {
  border-bottom: 1px solid var(--border-muted);
  padding: 15px 18px;
}

.control-group:last-child {
  border-bottom: 0;
}

.control-group-label {
  color: var(--fg-lighter);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.control-group .endpoint-list,
.control-group .audit-list {
  padding: 0;
}

.editor-toolbar {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 18px;
}

.editor-toolbar-actions {
  align-items: center;
  display: inline-flex;
  gap: 12px;
}

.editor-toolbar-actions form {
  margin: 0;
}

.editor-tab {
  align-items: center;
  color: var(--fg);
  display: inline-flex;
  font-size: 13px;
  font-weight: 600;
  gap: 8px;
}

.editor-tab svg {
  color: var(--brand-link);
  height: 16px;
  width: 16px;
}

.editor-toolbar-meta {
  color: var(--fg-lighter);
  font-family: var(--mono);
  font-size: 12px;
}

.compact-layout .shell {
  max-width: none;
  padding: 12px 16px 16px;
}

.compact-layout .page-head {
  margin-bottom: 6px;
  padding-block: 8px 4px;
}

.compact-layout .page-head .breadcrumb,
.compact-layout .page-head p,
.compact-layout .control-pane,
.compact-layout .panel-heading p {
  display: none;
}

.compact-layout h1 {
  font-size: 18px;
  font-weight: 650;
}

.compact-layout .control-sheet-grid,
.compact-layout .supplier-sheet-grid {
  grid-template-columns: 1fr;
}

.compact-layout .control-sheet > .page-head {
  padding-inline: 18px;
}

.compact-layout .metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-layout .metric-card {
  padding-block: 9px 10px;
}

.compact-layout .metric-card span {
  font-size: 20px;
}

.editor-main {
  min-width: 0;
  overflow: hidden;
}

.panel {
  overflow: hidden;
}

.panel-heading {
  align-items: center;
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  justify-content: space-between;
  min-height: 56px;
  padding: 14px 18px;
}

.panel-heading p {
  font-size: 13px;
  margin-top: 4px;
}

.compact-panel {
  padding: 18px;
}

.compact-panel h2 {
  margin-bottom: 14px;
}

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

/* ---------- Tables ---------- */
table {
  border-collapse: collapse;
  width: 100%;
}

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

.somastacks-batches-table {
  min-width: 100%;
}

.somastacks-batches-table th,
.somastacks-page time {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.job-counts {
  white-space: nowrap;
}

.table-link,
.back-link {
  color: var(--brand-link);
  font-family: var(--mono);
  font-size: 12px;
}

.table-link:hover,
.back-link:hover {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.job-counts + .table-link {
  display: inline-block;
  margin-top: 5px;
}

/* ---------- Supplier-to-processor lineage ---------- */
.supply-lineage-panel {
  margin-bottom: 16px;
}

.lineage-panel-heading {
  align-items: flex-start;
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 82px;
  padding: 16px 18px;
}

.lineage-panel-heading h2 {
  font-size: 17px;
  letter-spacing: -0.01em;
  margin-top: 3px;
}

.lineage-panel-heading p {
  color: var(--fg-lighter);
  font-size: 12px;
  margin-top: 5px;
  max-width: 720px;
}

.lineage-kicker,
.lineage-node-label {
  color: var(--fg-lighter);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lineage-heading-status {
  align-items: flex-end;
  display: grid;
  flex: none;
  gap: 5px;
  justify-items: end;
}

.lineage-heading-status small {
  color: var(--fg-lighter);
  font-family: var(--mono);
  font-size: 10px;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lineage-projection-status {
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--fg-light);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  padding: 4px 8px;
  text-transform: uppercase;
}

.lineage-projection-status.status-ready {
  border-color: hsl(156 20% 30%);
  color: hsl(156 24% 66%);
}

.lineage-projection-status.status-error {
  border-color: var(--destructive-border);
  color: var(--destructive-fg);
}

.batch-state-filters {
  background: var(--border-muted);
  border-bottom: 1px solid var(--border-muted);
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.batch-state-filters button {
  align-items: center;
  background: var(--surface-100);
  border: 0;
  border-radius: 0;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 52px;
  padding: 9px 14px;
  text-align: left;
  text-transform: none;
}

.batch-state-filters button:hover {
  background: var(--surface-200);
}

.batch-state-filters button[aria-pressed="true"] {
  background: var(--brand-bg);
  box-shadow: inset 0 -2px 0 var(--brand);
}

.batch-state-filters span {
  color: var(--fg-lighter);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.batch-state-filters button[aria-pressed="true"] span {
  color: var(--fg);
}

.batch-state-filters strong {
  color: var(--fg-light);
  font-family: var(--mono);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.batch-filter-status {
  background: hsl(0 0% 6.7%);
  border-bottom: 1px solid var(--border-muted);
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 9px;
  margin: 0;
  padding: 6px 18px;
}

.batch-accounting-details {
  border-bottom: 1px solid var(--border-muted);
}

.batch-accounting-details > summary {
  color: var(--fg-lighter);
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  min-height: 38px;
  padding: 11px 18px;
  text-transform: uppercase;
}

.batch-accounting-details > summary:hover,
.batch-accounting-details[open] > summary {
  background: var(--surface-200);
  color: var(--fg-light);
}

.batch-accounting-details .lineage-accounting-note {
  border-top: 1px solid var(--border-muted);
}

.batch-accounting-details .lineage-accounting {
  border-bottom: 0;
}

.lineage-accounting-note {
  background: hsl(0 0% 7.4%);
  border-bottom: 1px solid var(--border-muted);
  color: var(--fg-muted);
  font-size: 10px;
  margin: 0;
  padding: 8px 18px;
}

.lineage-accounting {
  border-bottom: 1px solid var(--border-muted);
  display: grid;
  grid-template-columns: repeat(9, minmax(128px, 1fr));
  overflow-x: auto;
}

.lineage-accounting > div {
  display: grid;
  gap: 5px;
  min-height: 62px;
  padding: 11px 18px;
}

.lineage-accounting > div + div {
  border-left: 1px solid var(--border-muted);
}

.lineage-accounting span {
  color: var(--fg-lighter);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.07em;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.lineage-accounting strong {
  color: var(--fg-light);
  font-family: var(--mono);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  line-height: 1;
}

.lineage-accounting small {
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lineage-accounting-success strong {
  color: hsl(156 24% 66%);
}

.lineage-accounting-queued strong {
  color: hsl(42 72% 68%);
}

.lineage-accounting-failed strong {
  color: var(--destructive-fg);
}

.lineage-accounting-excluded strong {
  color: var(--fg-muted);
}

.lineage-membership-breakdown {
  align-items: baseline;
  color: var(--fg-lighter);
  display: flex;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 9px;
  gap: 5px 8px;
}

.lineage-membership-breakdown strong {
  color: var(--fg-light);
  font-size: 10px;
  font-weight: 500;
}

.lineage-membership-breakdown code {
  color: var(--fg-muted);
  font-size: 9px;
}

.lineage-scope-bar {
  align-items: center;
  background: hsl(0 0% 6.7%);
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 48px;
  padding: 7px 18px;
}

.lineage-scope-bar p {
  color: var(--fg-muted);
  font-size: 11px;
}

.lineage-scope-button {
  background: var(--surface-100);
  border-color: var(--border-strong);
  display: grid;
  gap: 2px;
  justify-items: start;
  min-height: 34px;
  padding: 5px 10px;
  text-align: left;
  text-transform: none;
}

.lineage-scope-button span {
  color: var(--fg-lighter);
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.lineage-scope-button code {
  color: var(--fg-light);
  font-size: 11px;
}

.lineage-merge-toolbar {
  align-items: center;
  background: var(--brand-bg);
  border-bottom: 1px solid var(--brand-border);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 10px 18px;
}

.lineage-merge-selection {
  display: grid;
  gap: 2px;
}

.lineage-merge-selection strong {
  color: var(--fg);
  font-size: 13px;
  font-weight: 600;
}

.lineage-merge-selection strong span,
.lineage-merge-selection small {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.lineage-merge-selection small {
  color: var(--fg-lighter);
  font-size: 10px;
}

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

.lineage-merge-actions button,
.lineage-merge-dialog-actions button,
.lineage-merge-dialog-close {
  min-height: 44px;
}

.lineage-merge-notice {
  background: hsl(151 30% 10%);
  border-bottom: 1px solid hsl(151 35% 24%);
  display: grid;
  gap: 3px;
  padding: 10px 18px;
}

.lineage-merge-notice[data-tone="error"] {
  background: var(--destructive-bg);
  border-color: var(--destructive-border);
}

.lineage-merge-notice > strong {
  color: var(--success-fg);
  font-size: 12px;
  font-weight: 600;
}

.lineage-merge-notice[data-tone="error"] > strong {
  color: var(--destructive-fg);
}

.lineage-merge-notice > p {
  color: var(--fg-light);
  font-family: var(--mono);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.lineage-merge-notice-recovery {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 5px;
}

.lineage-merge-notice-recovery > span {
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 2px;
  padding: 7px 8px;
}

.lineage-merge-notice-recovery b {
  color: var(--fg-light);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lineage-merge-notice-recovery small {
  color: var(--fg-lighter);
  font-size: 10px;
}

.lineage-merge-dialog {
  background: var(--overlay);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  color: var(--fg);
  margin: auto;
  max-height: calc(100vh - 32px);
  max-width: min(680px, calc(100vw - 32px));
  overflow: auto;
  padding: 0;
  width: 680px;
}

.lineage-merge-dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.lineage-merge-dialog-head {
  align-items: flex-start;
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 16px 18px;
}

.lineage-merge-dialog-head h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 3px;
}

.lineage-merge-dialog-head p {
  color: var(--fg-lighter);
  font-size: 11px;
  margin-top: 4px;
}

.lineage-merge-dialog-body {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
}

.lineage-merge-preview-state {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  border-radius: var(--radius-sm);
  color: var(--fg-light);
  font-size: 11px;
  padding: 9px 10px;
}

.lineage-merge-preview-state[data-tone="ready"] {
  border-color: hsl(151 35% 24%);
  color: var(--success-fg);
}

.lineage-merge-preview-state[data-tone="warning"] {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning);
}

.lineage-merge-preview-state[data-tone="error"] {
  background: var(--destructive-bg);
  border-color: var(--destructive-border);
  color: var(--destructive-fg);
}

.lineage-merge-metrics {
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.lineage-merge-metrics > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
}

.lineage-merge-metrics > div + div {
  border-left: 1px solid var(--border-muted);
}

.lineage-merge-metrics span,
.lineage-merge-accounting dt {
  color: var(--fg-muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lineage-merge-metrics strong {
  color: var(--fg);
  font-family: var(--mono);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.lineage-merge-accounting {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.lineage-merge-accounting > div {
  background: var(--surface-100);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 3px;
  padding: 8px 10px;
}

.lineage-merge-accounting dd {
  color: var(--fg-light);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.lineage-merge-behavior {
  border-top: 1px solid var(--border-muted);
  padding-top: 11px;
}

.lineage-merge-behavior strong {
  color: var(--fg-light);
  font-size: 11px;
}

.lineage-merge-behavior p {
  color: var(--fg-lighter);
  font-size: 11px;
  margin-top: 4px;
}

.lineage-merge-force,
.lineage-merge-select {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 9px;
}

.lineage-merge-force {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-sm);
  min-height: 52px;
  padding: 8px 10px;
}

.lineage-merge-force input,
.lineage-merge-select input {
  accent-color: var(--brand);
  height: 18px;
  margin: 0;
  width: 18px;
}

.lineage-merge-force span {
  display: grid;
  gap: 2px;
}

.lineage-merge-force strong {
  color: var(--warning);
  font-size: 11px;
}

.lineage-merge-force small {
  color: var(--fg-lighter);
  font-size: 10px;
}

.lineage-merge-dialog-actions {
  align-items: center;
  border-top: 1px solid var(--border-muted);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 18px;
}

.lineage-projection-error {
  align-items: baseline;
  background: var(--destructive-bg);
  border-bottom: 1px solid var(--destructive-border);
  color: var(--destructive-fg);
  display: flex;
  gap: 10px;
  padding: 9px 18px;
}

.lineage-projection-error strong {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.lineage-projection-error span {
  color: var(--fg-light);
  font-size: 11px;
}

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

.lineage-map {
  min-width: 1180px;
}

.lineage-lane-head,
.lineage-bundle-summary-grid,
.lineage-bundle-grid {
  display: grid;
  gap: 92px;
  grid-template-columns: minmax(300px, 1fr) minmax(260px, 0.76fr) minmax(300px, 1fr);
}

.lineage-lane-head {
  background: hsl(0 0% 6.3%);
  border-bottom: 1px solid var(--border-muted);
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.09em;
  padding: 8px 18px;
  text-transform: uppercase;
}

.lineage-lane-head span:nth-child(2) {
  text-align: center;
}

.lineage-lane-head span:last-child {
  text-align: right;
}

.lineage-bundle {
  background: hsl(0 0% 7.1%);
  isolation: isolate;
  min-height: 180px;
  position: relative;
  transition: opacity 150ms ease;
}

.lineage-bundle-summary {
  background: hsl(0 0% 7.1%);
  border-bottom: 1px solid var(--border);
}

.lineage-bundle-summary:nth-child(even) {
  background: hsl(0 0% 7.7%);
}

.batch-summary-lifecycle {
  align-items: center;
  background: hsl(0 0% 6.5% / 0.9);
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 44px;
  padding: 8px 18px;
}

.batch-summary-state,
.batch-summary-accounting {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.batch-business-state {
  font-size: 9px;
  padding: 4px 7px;
}

.batch-business-state.status-accumulating {
  border-color: var(--warning-border);
  color: var(--warning);
}

.batch-business-state.status-processing {
  border-color: hsl(206 28% 34%);
  color: hsl(206 42% 70%);
}

.batch-business-state.status-reprocessable {
  border-color: var(--destructive-border);
  color: var(--destructive-fg);
}

.batch-business-state.status-final {
  border-color: hsl(156 18% 27%);
  color: hsl(156 22% 65%);
}

.batch-trigger-mode {
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 9px;
}

.batch-action-required {
  color: var(--destructive-fg);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.batch-summary-accounting {
  justify-content: flex-end;
}

.batch-summary-accounting span {
  color: var(--fg-lighter);
  font-family: var(--mono);
  font-size: 9px;
  white-space: nowrap;
}

.batch-summary-accounting span + span::before {
  color: var(--border-control);
  content: "/";
  margin-right: 7px;
}

.lineage-bundle-summary-grid {
  align-items: stretch;
  padding: 14px 18px 10px;
}

.lineage-summary-card {
  align-content: start;
  min-height: 84px;
}

.lineage-inclusion-panel {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  border-left: 2px solid var(--success-fg);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 8px;
  margin-top: 9px;
  padding: 8px 9px;
}

.lineage-inclusion-label {
  color: var(--success-fg);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lineage-inclusion-entry {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.lineage-inclusion-entry + .lineage-inclusion-entry {
  border-top: 1px solid var(--border-muted);
  padding-top: 8px;
}

.lineage-inclusion-entry strong {
  color: var(--fg);
  font-size: 10px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.lineage-inclusion-entry p,
.lineage-inclusion-entry span,
.lineage-inclusion-entry code {
  color: var(--fg-lighter);
  font-size: 9px;
  line-height: 1.45;
  margin: 0;
  overflow-wrap: anywhere;
}

.lineage-inclusion-entry code,
.lineage-inclusion-accounting {
  font-family: var(--mono);
}

.lineage-accumulation-panel {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 3px;
  margin-top: 9px;
  padding: 7px 8px;
}

.lineage-accumulation-panel strong {
  color: var(--warning);
  font-size: 10px;
  font-weight: 600;
}

.lineage-accumulation-panel span,
.lineage-accumulation-panel small {
  color: var(--fg-lighter);
  font-size: 9px;
  line-height: 1.4;
}

.lineage-accumulation-panel small {
  font-family: var(--mono);
}

.lineage-summary-issue {
  background: var(--destructive-bg);
  border: 1px solid var(--destructive-border);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 3px;
  margin-top: 9px;
  padding: 7px 8px;
}

.lineage-summary-issue strong {
  color: var(--destructive-fg);
  font-size: 10px;
  font-weight: 600;
}

.lineage-summary-issue span,
.lineage-summary-issue small {
  color: var(--fg-lighter);
  font-size: 9px;
  line-height: 1.4;
}

.lineage-summary-issue small {
  font-family: var(--mono);
}

.lineage-summary-issue.is-carried {
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.lineage-summary-issue.is-carried strong {
  color: var(--warning);
}

.lineage-submission-action {
  background: var(--surface-200);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 5px;
  margin-top: 9px;
  padding: 7px 8px;
}

.lineage-submission-action strong {
  color: var(--fg-light);
  font-size: 10px;
  font-weight: 600;
}

.lineage-submission-action p {
  color: var(--fg-lighter);
  font-size: 9px;
  line-height: 1.45;
  margin: 0;
}

.lineage-submit-button {
  justify-self: start;
  margin-top: 3px;
  min-height: 40px;
}

.lineage-submit-status {
  color: var(--success-fg);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.4;
  min-height: 13px;
  overflow-wrap: anywhere;
}

.lineage-submit-status.is-error {
  color: var(--destructive-fg);
}

.lineage-summary-actions {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  padding: 0 18px 12px;
}

.lineage-summary-actions small {
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 9px;
}

.lineage-merge-select {
  color: var(--fg-light);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-right: auto;
  min-height: 44px;
  padding: 0 6px;
  text-transform: uppercase;
}

.lineage-merge-select:hover {
  color: var(--fg);
}

.lineage-superseded-link {
  color: var(--brand-link);
  font-family: var(--mono);
  font-size: 9px;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.lineage-expand-button {
  min-width: 190px;
}

.lineage-bundle-detail:empty {
  display: none;
}

.lineage-bundle-detail > .lineage-bundle {
  border-top: 1px solid var(--border-strong);
}

.lineage-detail-state {
  color: var(--fg-lighter);
  font-family: var(--mono);
  font-size: 10px;
  padding: 18px;
  text-align: center;
}

.lineage-detail-error {
  background: var(--destructive-bg);
  color: var(--destructive-fg);
}

.lineage-detail-pagination {
  align-items: center;
  background: hsl(0 0% 7.2% / 0.98);
  border-top: 1px solid var(--border-strong);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(130px, auto) 1fr minmax(130px, auto);
  padding: 10px 18px;
}

.lineage-detail-pagination span {
  color: var(--fg-lighter);
  font-family: var(--mono);
  font-size: 10px;
  text-align: center;
}

.lineage-detail-pagination button:last-child {
  justify-self: end;
}

.lineage-pagination {
  align-items: center;
  background: hsl(0 0% 6.3% / 0.98);
  border-top: 1px solid var(--border-strong);
  bottom: 0;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 10px 18px;
  position: sticky;
  z-index: 5;
}

.lineage-pagination span {
  color: var(--fg-lighter);
  font-family: var(--mono);
  font-size: 10px;
}

.lineage-bundle + .lineage-bundle {
  border-top: 1px solid var(--border);
}

.lineage-bundle:nth-child(even) {
  background: hsl(0 0% 7.7%);
}

.lineage-bundle-grid {
  align-items: stretch;
  padding: 16px 18px 18px;
  position: relative;
  z-index: 2;
}

.lineage-edges {
  inset: 0;
  overflow: visible;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.lineage-edge {
  fill: none;
  opacity: 0.25;
  stroke: hsl(210 8% 48%);
  stroke-linecap: round;
  stroke-width: 1.15;
  transition: opacity 150ms ease, stroke 150ms ease, stroke-width 150ms ease;
  vector-effect: non-scaling-stroke;
}

.lineage-edge-result.result-succeeded {
  stroke: hsl(156 22% 49%);
}

.lineage-edge-result.result-failed {
  stroke: hsl(342 34% 54%);
}

.lineage-edge-result.result-active {
  stroke: hsl(39 22% 52%);
}

.lineage-edge-result.result-queued,
.lineage-edge-result.result-awaiting {
  stroke: hsl(206 36% 56%);
}

.lineage-edge-result.result-excluded {
  stroke: hsl(28 28% 52%);
}

.lineage-lane {
  min-width: 0;
  transition: opacity 150ms ease;
}

.lineage-processing-lane {
  align-items: stretch;
  display: flex;
  justify-content: center;
}

.lineage-lane-card {
  background: hsl(0 0% 9.2% / 0.96);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--fg-light);
  display: grid;
  min-width: 0;
  padding: 10px 12px;
  text-align: left;
  transition: background-color 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

button.lineage-lane-card {
  min-height: 0;
  text-transform: none;
  white-space: normal;
  width: 100%;
}

button.lineage-lane-card:hover,
.lineage-scope-button:hover {
  background: var(--surface-200);
  border-color: var(--border-control);
}

.lineage-card-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-width: 0;
}

.lineage-card-heading strong {
  color: var(--fg-light);
  flex: none;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
}

.lineage-card-identity {
  color: var(--fg-light);
  display: block;
  font-size: 11px;
  margin-top: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lineage-card-time {
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 9px;
  margin-top: 4px;
}

.lineage-file-list {
  display: grid;
  gap: 3px;
  margin-top: 8px;
}

.lineage-file-node {
  align-items: center;
  background: hsl(0 0% 8.5% / 0.97);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  color: var(--fg-light);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 50px;
  min-width: 0;
  padding: 7px 9px;
  transition: background-color 120ms ease, border-color 120ms ease, opacity 150ms ease;
}

button.lineage-file-node {
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
  white-space: normal;
  width: 100%;
}

button.lineage-file-node:hover {
  background: var(--surface-200);
  border-color: var(--border-control);
}

.lineage-file-identity {
  display: grid;
  min-width: 0;
}

.lineage-file-identity strong {
  color: var(--fg-light);
  font-size: 11px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lineage-file-identity code,
.lineage-file-identity small {
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 9px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lineage-file-facts,
.lineage-result-status {
  align-items: flex-end;
  display: grid;
  flex: none;
  gap: 4px;
  justify-items: end;
}

.lineage-file-facts small {
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 9px;
}

.lineage-status {
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--fg-lighter);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1;
  padding: 3px 5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.lineage-status.status-succeeded,
.lineage-status.status-ready,
.lineage-status.status-passed {
  border-color: hsl(156 18% 27%);
  color: hsl(156 22% 65%);
}

.lineage-status.status-failed,
.lineage-status.status-cancelled,
.lineage-status.status-source-ineligible,
.lineage-status.status-needs-attention {
  border-color: var(--destructive-border);
  color: var(--destructive-fg);
}

.lineage-status.status-processing,
.lineage-status.status-running,
.lineage-status.status-submitted,
.lineage-status.status-not-submitted,
.lineage-status.status-retry-requested,
.lineage-status.status-retry-wait,
.lineage-status.status-submitted-untracked {
  border-color: hsl(39 22% 29%);
  color: hsl(39 24% 65%);
}

.lineage-processing-card {
  align-content: start;
  background: hsl(0 0% 10% / 0.98);
  min-height: 164px;
  padding: 12px;
  width: 100%;
}

.lineage-issue-panel {
  background: hsl(14 33% 10% / 0.9);
  border: 1px solid var(--destructive-border);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 9px;
  margin-top: 11px;
  min-width: 0;
  padding: 10px;
}

.lineage-issue-panel.is-carried {
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.lineage-issue-panel.is-carried .lineage-issue-title {
  color: var(--warning);
}

.lineage-issue-panel.is-carried .lineage-issue-facts {
  border-color: var(--warning-border);
}

.lineage-issue-panel.is-carried .lineage-retry-status {
  color: var(--fg-lighter);
}

.lineage-issue-title {
  color: var(--destructive-fg);
  font-size: 11px;
  font-weight: 650;
  margin: 0;
}

.lineage-issue-message,
.lineage-recovery-option p {
  color: var(--fg-light);
  font-size: 10px;
  line-height: 1.45;
  margin: 0;
  overflow-wrap: anywhere;
}

.lineage-issue-facts {
  border-bottom: 1px solid var(--destructive-border);
  border-top: 1px solid var(--destructive-border);
  display: grid;
  gap: 5px;
  padding: 7px 0;
}

.lineage-issue-fact {
  align-items: baseline;
  display: grid;
  gap: 8px;
  grid-template-columns: 52px minmax(0, 1fr);
}

.lineage-issue-fact span {
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lineage-issue-fact strong,
.lineage-issue-fact code {
  color: var(--fg-lighter);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.lineage-recovery-grid {
  display: grid;
  gap: 9px;
}

.lineage-recovery-option {
  display: grid;
  gap: 5px;
}

.lineage-recovery-option > strong {
  color: var(--fg-light);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lineage-retry-button {
  justify-self: start;
  margin-top: 3px;
  min-height: 40px;
  white-space: normal;
}

.lineage-retry-status {
  color: var(--success-fg);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.4;
  min-height: 13px;
  overflow-wrap: anywhere;
}

.lineage-retry-status.is-error {
  color: var(--destructive-fg);
}

.lineage-attempt-list {
  display: grid;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.lineage-attempt {
  align-items: center;
  display: grid;
  gap: 7px;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  min-height: 35px;
  position: relative;
}

.lineage-attempt + .lineage-attempt::before {
  background: var(--border-strong);
  content: "";
  height: 18px;
  left: 3px;
  position: absolute;
  top: -9px;
  width: 1px;
}

.lineage-attempt-marker {
  background: var(--fg-muted);
  border: 2px solid hsl(0 0% 10%);
  border-radius: 999px;
  height: 7px;
  position: relative;
  width: 7px;
  z-index: 1;
}

.lineage-attempt-detail {
  display: grid;
  min-width: 0;
}

.lineage-attempt-detail strong,
.lineage-attempt-detail code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lineage-attempt-detail strong {
  color: var(--fg-light);
  font-size: 10px;
  font-weight: 550;
}

.lineage-attempt-detail code {
  color: var(--fg-muted);
  font-size: 8px;
  margin-top: 1px;
}

.lineage-attempt-status {
  font-size: 7px;
}

.lineage-attempt-empty {
  grid-template-columns: 8px minmax(0, 1fr);
}

.lineage-processing-coverage {
  border-top: 1px solid var(--border-muted);
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 9px;
  margin-top: 9px;
  padding-top: 8px;
}

.lineage-preview-link {
  margin-top: 10px;
  width: 100%;
}

.lineage-result-card {
  min-height: 69px;
}

.lineage-result-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 8px;
}

.lineage-result-breakdown span {
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 9px;
}

.lineage-result-breakdown .result-succeeded {
  color: hsl(156 22% 61%);
}

.lineage-result-breakdown .result-failed {
  color: var(--destructive-fg);
}

.lineage-result-breakdown .result-queued,
.lineage-result-breakdown .result-awaiting {
  color: var(--brand-link);
}

.lineage-result-breakdown .result-excluded {
  color: var(--warning);
}

.lineage-result-node.result-succeeded {
  border-right-color: hsl(156 22% 38%);
}

.lineage-result-node.result-failed {
  border-right-color: var(--destructive-border);
}

.lineage-result-node.result-queued,
.lineage-result-node.result-awaiting {
  border-right-color: var(--brand-border);
}

.lineage-result-node.result-excluded {
  border-right-color: var(--warning-border);
}

.lineage-empty {
  align-items: center;
  color: var(--fg-lighter);
  display: grid;
  gap: 5px;
  justify-items: center;
  min-height: 170px;
  padding: 30px;
  text-align: center;
}

.lineage-empty strong {
  color: var(--fg-light);
  font-size: 12px;
}

.lineage-empty span {
  font-size: 11px;
}

.supply-lineage-panel.has-lineage-selection .lineage-file-node.is-muted,
.supply-lineage-panel.has-lineage-selection .lineage-lane-card.is-muted,
.supply-lineage-panel.has-lineage-selection .lineage-scope-button.is-muted {
  opacity: var(--lineage-context-node-opacity);
}

.supply-lineage-panel.has-lineage-selection .lineage-edge.is-muted {
  opacity: var(--lineage-context-edge-opacity);
}

.supply-lineage-panel.has-lineage-selection .lineage-edge.is-related {
  opacity: 0.92;
  stroke: var(--brand);
  stroke-width: 1.65;
}

.supply-lineage-panel.has-lineage-selection .lineage-file-node.is-related,
.supply-lineage-panel.has-lineage-selection .lineage-lane-card.is-related,
.supply-lineage-panel.has-lineage-selection .lineage-scope-button.is-related {
  background: hsl(340 18% 11%);
  border-color: var(--brand-border);
}

.supply-lineage-panel.has-lineage-selection .lineage-bundle,
.supply-lineage-panel.has-lineage-selection .lineage-lane {
  opacity: 1;
}

/* ---------- Supplier source monitor ---------- */
.supplier-source-monitor-panel {
  margin-bottom: 16px;
}

.source-monitor-heading {
  align-items: flex-start;
  gap: 20px;
}

.source-monitor-heading h2 {
  font-size: 16px;
  margin-top: 4px;
}

.source-monitor-kicker {
  align-items: center;
  color: var(--fg-lighter);
  display: inline-flex;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  gap: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.monitor-live-dot {
  background: var(--fg-muted);
  border-radius: 999px;
  display: inline-block;
  height: 7px;
  width: 7px;
}

.monitor-live-dot.is-live {
  animation: source-monitor-pulse 2.4s cubic-bezier(0.23, 1, 0.32, 1) infinite;
  background: var(--brand);
}

@keyframes source-monitor-pulse {
  0%,
  100% {
    opacity: 0.62;
    transform: scale(0.9);
  }

  45% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.source-monitor-actions {
  align-items: center;
  display: flex;
  flex: none;
  gap: 12px;
}

.source-monitor-actions form {
  margin: 0;
}

.source-monitor-rail {
  align-items: stretch;
  background: var(--surface-100);
  border-bottom: 1px solid var(--border-muted);
  display: grid;
  grid-template-columns:
    minmax(160px, 1fr) 32px
    minmax(160px, 1fr) 32px
    minmax(160px, 1fr) 32px
    minmax(160px, 1fr);
}

.source-monitor-stage {
  min-width: 0;
  padding: 18px;
}

.source-monitor-stage > span {
  color: var(--fg-lighter);
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.source-monitor-stage > strong {
  color: var(--fg);
  display: block;
  font-family: var(--mono);
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-top: 11px;
}

.source-monitor-stage > small {
  color: var(--fg-lighter);
  display: block;
  font-size: 11px;
  margin-top: 8px;
}

.source-monitor-stage > small b {
  color: var(--fg-light);
  font-family: var(--mono);
  font-weight: 600;
}

.source-monitor-stage-final {
  background: var(--surface-200);
}

.source-monitor-stage-final > strong,
.source-monitor-stage-final > span {
  color: var(--brand-link);
}

.source-monitor-link {
  align-self: center;
  background: var(--border-strong);
  height: 1px;
  position: relative;
}

.source-monitor-link::after {
  background: var(--surface-100);
  border: 1px solid var(--border-control);
  border-radius: 999px;
  content: "";
  height: 7px;
  position: absolute;
  right: -1px;
  top: -4px;
  width: 7px;
}

.source-monitor-error {
  background: var(--destructive-bg);
  border-bottom: 1px solid var(--destructive-border);
  color: var(--destructive-fg);
  display: grid;
  gap: 3px;
  padding: 11px 18px 12px;
}

.source-monitor-error[hidden] {
  display: none;
}

.source-monitor-error strong {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.source-monitor-error span,
.source-monitor-error small {
  font-size: 12px;
}

.source-monitor-error small {
  color: var(--fg-light);
}

.source-monitor-timing {
  border-bottom: 1px solid var(--border-muted);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.source-monitor-timing > div {
  min-width: 0;
  padding: 12px 18px 13px;
}

.source-monitor-timing > div + div {
  border-left: 1px solid var(--border-muted);
}

.source-monitor-timing dt {
  color: var(--fg-lighter);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.source-monitor-timing dd {
  color: var(--fg-light);
  font-family: var(--mono);
  font-size: 11px;
  margin-top: 7px;
  min-height: 17px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-monitor-submissions-head {
  padding: 13px 18px;
}

.source-monitor-submissions-head h3 {
  color: var(--fg);
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}

.source-monitor-submissions-head p {
  color: var(--fg-lighter);
  font-size: 12px;
  margin-top: 3px;
}

.supplier-submissions-table {
  border-top: 1px solid var(--border-muted);
  min-width: 1180px;
}

.supplier-submissions-table td {
  vertical-align: middle;
}

.source-submission-identity {
  display: grid;
  gap: 4px;
  min-width: 280px;
}

.source-submission-identity strong {
  color: var(--fg);
  font-size: 12px;
  font-weight: 600;
}

.source-submission-identity code {
  color: var(--fg-lighter);
  font-size: 11px;
}

.source-blocking-reason {
  color: var(--fg-lighter);
  display: block;
  font-size: 11px;
  margin-top: 4px;
}

.status-running,
.status-verified,
.status-succeeded,
.status-passed,
.status-ready {
  color: var(--brand-link);
}

.status-disabled,
.status-not-run,
.status-unverified {
  color: var(--fg-lighter);
}

.status-stopped,
.status-failed,
.status-blocked,
.status-ineligible,
.status-invalid,
.status-missing {
  color: var(--destructive-fg);
}

.back-link {
  display: inline-block;
  margin-bottom: 8px;
}

.somastacks-detail-page .panel + .panel {
  margin-top: 16px;
}

.retry-status-panel {
  border-color: var(--warning-border);
}

.exception-summary-heading {
  gap: 24px;
}

.exception-summary-heading button {
  min-height: 44px;
}

.batch-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.batch-summary-grid > div {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 14px 18px;
}

.batch-summary-grid > div + div {
  border-left: 1px solid var(--border-muted);
}

.summary-label {
  color: var(--fg-lighter);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.somastacks-exceptions-table {
  min-width: 1480px;
}

.somastacks-exceptions-table th,
.somastacks-exceptions-table td {
  vertical-align: top;
}

.somastacks-exceptions-table time {
  white-space: nowrap;
}

.somastacks-exceptions-table .status-failed {
  color: var(--destructive-fg);
}

.source-path {
  min-width: 260px;
}

.diagnostic-cell {
  color: var(--fg-light);
  min-width: 260px;
}

.artifact-list {
  display: grid;
  gap: 3px;
  min-width: 220px;
}

.artifact-list span,
.muted-value {
  color: var(--fg-lighter);
  font-size: 12px;
}

.processing-groups-panel,
.attempt-context-panel,
.somastacks-group-detail-page .panel + .panel {
  margin-top: 16px;
}

.processing-groups-table {
  min-width: 1540px;
}

.processing-groups-table td {
  vertical-align: middle;
}

.batch-identity {
  display: grid;
  gap: 4px;
  min-width: 250px;
}

.batch-identity:hover code {
  color: var(--brand-link);
}

.batch-preview-link {
  display: inline-block;
  margin-top: 8px;
}

button.batch-preview-link,
button.batch-preview-link:hover {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--fg-muted);
  cursor: not-allowed;
  font-weight: 400;
  letter-spacing: 0;
  min-height: 0;
  padding: 0;
  text-transform: none;
}

.batch-identity span,
.coverage-meta {
  color: var(--fg-lighter);
  font-family: var(--mono);
  font-size: 11px;
}

.coverage-value,
.coverage-meta {
  display: block;
  white-space: nowrap;
}

.coverage-value {
  color: var(--fg);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.coverage-meta {
  margin-top: 4px;
}

.status-ready {
  color: var(--brand-link);
}

.status-processing {
  color: var(--fg-light);
}

.status-needs-attention {
  color: var(--warning);
}

.status-blocked,
.status-ineligible {
  color: var(--destructive-fg);
}

.group-actions {
  flex-wrap: nowrap;
}

.group-coverage-panel {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
}

.group-coverage-hero {
  align-items: flex-start;
  border-right: 1px solid var(--border-muted);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 18px;
}

.group-coverage-hero strong {
  color: var(--fg);
  display: block;
  font-family: var(--mono);
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-top: 9px;
}

.group-coverage-hero p {
  color: var(--fg-lighter);
  font-size: 12px;
  margin-top: 8px;
}

.group-summary-grid {
  align-content: stretch;
  grid-template-columns: repeat(2, minmax(250px, 1fr));
}

.group-summary-grid > div:nth-child(n + 3) {
  border-top: 1px solid var(--border-muted);
}

.group-summary-grid > div:nth-child(3) {
  border-left: 0;
}

.accounting-errors-panel {
  border-color: var(--destructive-border);
}

.accounting-errors {
  color: var(--destructive-fg);
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 16px 18px 18px 36px;
}

.attempt-lineage {
  list-style: none;
  margin: 0;
  padding: 6px 18px 18px;
}

.attempt-node {
  display: grid;
  gap: 14px;
  grid-template-columns: 28px minmax(0, 1fr);
  padding-top: 14px;
  position: relative;
}

.attempt-node:not(:last-child)::before {
  background: var(--border-strong);
  content: "";
  left: 13px;
  position: absolute;
  top: 42px;
  bottom: -14px;
  width: 1px;
}

.attempt-marker {
  align-items: center;
  background: var(--surface-200);
  border: 1px solid var(--brand-border);
  border-radius: 50%;
  color: var(--brand-link);
  display: flex;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  height: 28px;
  justify-content: center;
  position: relative;
  width: 28px;
  z-index: 1;
}

.attempt-node article {
  background: var(--surface-200);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.attempt-heading {
  align-items: flex-start;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.attempt-heading h3 {
  color: var(--fg);
  font-size: 16px;
  line-height: 1.2;
  margin: 3px 0 5px;
}

.attempt-kicker {
  color: var(--fg-lighter);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.attempt-facts {
  color: var(--fg-light);
  display: grid;
  font-size: 12px;
  gap: 6px 20px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.attempt-facts time {
  white-space: nowrap;
}

.attempt-exceptions-link {
  display: inline-block;
  margin-top: 12px;
}

.package-ledger-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.package-ledger-row > div {
  display: grid;
  gap: 7px;
  padding: 14px 18px;
}

.package-ledger-row > div + div {
  border-left: 1px solid var(--border-muted);
}

.batch-table {
  table-layout: fixed;
}

.batch-table th:nth-child(1),
.batch-table td:nth-child(1) {
  width: 26%;
}

.batch-table th:nth-child(2),
.batch-table td:nth-child(2) {
  width: 35%;
}

.batch-table th:nth-child(3),
.batch-table td:nth-child(3) {
  width: 22%;
}

.batch-table th:nth-child(4),
.batch-table td:nth-child(4) {
  width: 17%;
}

.supplier-sheet .batch-table {
  table-layout: auto;
}

.supplier-sheet .batch-table th:nth-child(n),
.supplier-sheet .batch-table td:nth-child(n) {
  width: auto;
}

.managed-upload-table {
  min-width: 1040px;
  table-layout: auto;
}

.managed-upload-table th:nth-child(n),
.managed-upload-table td:nth-child(n) {
  width: auto;
}

.managed-upload-table td code {
  white-space: nowrap;
}

th,
td {
  border-top: 1px solid var(--border-muted);
  padding: 9px 12px;
  text-align: left;
  vertical-align: middle;
}

thead th {
  background: color-mix(in srgb, var(--surface-200) 62%, transparent);
  border-top: 0;
  border-bottom: 1px solid var(--border-muted);
  color: var(--fg-lighter);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.batch-table th,
.batch-table td {
  border-right: 1px solid var(--border-muted);
}

.batch-table th:last-child,
.batch-table td:last-child {
  border-right: 0;
}

.batch-table tbody tr {
  transition: background-color 120ms ease;
}

.batch-table tbody tr:hover {
  background: color-mix(in srgb, var(--surface-200) 56%, transparent);
}

.batch-link {
  color: var(--fg);
  display: inline-block;
  font-weight: 600;
}

.batch-link:hover {
  color: var(--brand-link);
}

.row-meta {
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

code {
  background: var(--surface-200);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  color: var(--fg-light);
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 2px 6px;
}

time[data-local-time] {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.upload-target-table {
  border-bottom: 1px solid var(--border-muted);
}

.upload-workbench {
  border-bottom: 1px solid var(--border-muted);
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  padding: 14px 18px;
}

.upload-workbench-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(160px, 0.7fr) minmax(220px, 1.1fr) minmax(220px, 1fr) auto;
}

.upload-workbench-form label {
  color: var(--fg-lighter);
  display: grid;
  font-size: 11px;
  font-weight: 600;
  gap: 6px;
  letter-spacing: 0.04em;
  min-width: 0;
  text-transform: uppercase;
}

.upload-workbench-form input {
  background: var(--control);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-md);
  color: var(--fg);
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  width: 100%;
}

.upload-workbench-form select {
  background: var(--control);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-md);
  color: var(--fg);
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  width: 100%;
}

.upload-workbench-form input[type="file"] {
  overflow: hidden;
  padding: 8px 10px;
}

.upload-workbench-form button {
  min-height: 38px;
  white-space: nowrap;
}

.upload-progress {
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.upload-progress strong {
  color: var(--fg-lighter);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.upload-progress-bar {
  background: var(--surface-200);
  border: 1px solid var(--border-muted);
  height: 8px;
  overflow: hidden;
}

.upload-progress-bar span {
  background: var(--brand-link);
  display: block;
  height: 100%;
  transition: width 160ms ease;
  width: 0;
}

.uploaded-object-table td:nth-child(2),
.uploaded-object-table td:nth-child(3),
.uploaded-object-table td:nth-child(4) {
  color: var(--fg-lighter);
  font-family: var(--mono);
  font-size: 12px;
}

.target-module {
  border-bottom: 1px solid var(--border-muted);
}

.target-form {
  align-items: end;
  border-bottom: 1px solid var(--border-muted);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 0.5fr) minmax(140px, 0.45fr) auto;
  padding: 16px 18px;
}

.batch-create-form {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
}

.target-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.target-form span {
  color: var(--fg-lighter);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.target-form input,
.target-form select {
  background: var(--control);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-md);
  color: var(--fg);
  min-height: 38px;
  padding: 0 10px;
  width: 100%;
}

.target-form input:focus,
.target-form select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(221, 111, 147, 0.3);
  outline: none;
}

.target-table td {
  vertical-align: top;
}

.target-table th:nth-child(3),
.target-table td:nth-child(3) {
  min-width: 94px;
}

.target-table td:nth-child(3) code {
  white-space: nowrap;
}

.object-meta-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.object-meta-list li {
  display: grid;
  gap: 4px;
}

.object-meta-list span {
  color: var(--fg-lighter);
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.inventory-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.inventory-sheet-grid {
  grid-template-columns: 270px minmax(0, 1fr);
}

.inventory-main {
  display: grid;
  gap: 0;
}

.inventory-module {
  border-bottom: 1px solid var(--border-muted);
  min-width: 0;
}

.inventory-split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.inventory-split .inventory-module:first-child {
  border-right: 1px solid var(--border-muted);
}

.inventory-table {
  table-layout: auto;
}

.inventory-table th,
.inventory-table td {
  border-right: 1px solid var(--border-muted);
  vertical-align: top;
}

.inventory-table th:last-child,
.inventory-table td:last-child {
  border-right: 0;
}

.inventory-table code {
  max-width: 100%;
  overflow-wrap: normal;
  white-space: nowrap;
}

.inventory-table td:first-child code,
.object-inventory-table td:first-child code {
  display: block;
  overflow-wrap: anywhere;
  white-space: normal;
}

.empty-row td {
  color: var(--fg-lighter);
  font-family: var(--mono);
  font-size: 12px;
  height: 48px;
}

.rail-form {
  display: grid;
  gap: 10px;
}

.rail-form label {
  color: var(--fg-lighter);
  display: grid;
  font-size: 11px;
  font-weight: 600;
  gap: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rail-form input {
  background: var(--control);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-md);
  color: var(--fg);
  min-height: 36px;
  padding: 0 10px;
}

.rail-form button {
  margin-top: 2px;
}

/* ---------- Account management ---------- */
.account-sheet-grid {
  display: block;
}

.account-sheet-grid .editor-main,
.account-module {
  overflow: visible;
}

.account-module {
  border-bottom: 1px solid var(--border-muted);
  scroll-margin-top: 72px;
}

.module-heading {
  align-items: center;
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  justify-content: space-between;
  min-height: 58px;
  padding: 14px 18px;
}

.module-heading h2 {
  font-size: 15px;
}

.module-heading p {
  color: var(--fg-lighter);
  font-family: var(--mono);
  font-size: 12px;
  margin-top: 4px;
}

.account-form {
  align-items: end;
  border-bottom: 1px solid var(--border-muted);
  display: grid;
  gap: 12px;
  grid-template-columns:
    minmax(160px, 0.8fr)
    minmax(150px, 0.7fr)
    minmax(160px, 0.8fr)
    minmax(190px, 0.9fr)
    minmax(220px, 1fr)
    auto;
  padding: 16px 22px;
}

.account-form label,
.inline-reset-form {
  min-width: 0;
}

.account-form label {
  display: grid;
  gap: 6px;
}

.account-form span {
  color: var(--fg-lighter);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.account-form input,
.account-form select,
.inline-reset-form input {
  background: color-mix(in srgb, var(--control) 86%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--fg);
  height: 38px;
  min-height: 38px;
  padding: 0 10px;
  width: 100%;
}

.account-table input,
.account-table select {
  background: color-mix(in srgb, var(--control) 86%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--fg);
  width: 100%;
}

.account-form input:focus,
.account-form select:focus,
.inline-reset-form input:focus,
.account-table input:focus,
.account-table select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(221, 111, 147, 0.3);
  outline: none;
}

.account-table input,
.account-table select {
  height: 30px;
  min-height: 30px;
  padding-left: 9px;
  padding-right: 9px;
}

.account-form button {
  min-height: 38px;
}

.account-table {
  table-layout: fixed;
}

.account-table th,
.account-table td {
  padding-left: 22px;
  padding-right: 22px;
}

.account-table tbody td {
  padding-bottom: 12px;
  padding-top: 12px;
  vertical-align: middle;
}

.account-table th,
.account-table td {
  border-right: 1px solid var(--border-muted);
}

.account-table th:last-child,
.account-table td:last-child {
  border-right: 0;
}

.account-table th:nth-child(1),
.account-table td:nth-child(1) {
  width: 22%;
}

.account-table th:nth-child(2),
.account-table td:nth-child(2) {
  width: 14%;
}

.account-table th:nth-child(3),
.account-table td:nth-child(3) {
  width: 38%;
}

.account-table th:nth-child(4),
.account-table td:nth-child(4) {
  width: 10%;
}

.account-table th:nth-child(5),
.account-table td:nth-child(5) {
  width: 16%;
}

.prefix-editor {
  display: grid;
  gap: 7px;
  grid-template-columns: minmax(130px, 0.75fr) minmax(180px, 1fr);
}

.inline-reset-form {
  align-items: center;
  display: flex;
  gap: 8px;
}

.account-name {
  color: var(--fg);
  display: inline;
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-line,
.grant-line {
  align-items: baseline;
  display: flex;
  gap: 10px;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
}

.account-line .row-meta {
  flex: none;
  margin-top: 0;
}

.account-technical-id {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-pill {
  color: var(--fg-light);
  font-size: 13px;
  text-transform: capitalize;
  white-space: nowrap;
}

.account-action-row {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  white-space: normal;
}

.account-action-row form {
  margin: 0;
  width: 100%;
}

.account-action-row button {
  width: 100%;
}

.account-action-row .approval-form {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.approval-form select {
  min-width: 0;
  width: 100%;
}

.account-edit-trigger {
  align-items: center;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--brand-link);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
}

.account-edit-trigger:hover {
  background: var(--surface-200);
  border-color: var(--brand-border);
  color: var(--brand);
}

.grant-uri,
.grant-permission {
  color: var(--fg-lighter);
  display: inline;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.35;
  margin-top: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grant-permission {
  color: var(--fg-muted);
  flex: none;
  margin-top: 0;
}

.inline-reset-form button {
  flex: none;
}

.status-active {
  color: var(--brand-link);
}

.status-frozen {
  color: var(--warning);
}

.status-pending_approval {
  color: var(--warning);
}

.compact-empty {
  padding: 22px 18px;
}

.account-dialog {
  background: var(--surface-100);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  color: var(--fg);
  margin: auto;
  max-width: min(560px, calc(100vw - 32px));
  padding: 0;
  width: 560px;
}

.account-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.dialog-head {
  align-items: center;
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  justify-content: space-between;
  padding: 16px 18px;
}

.dialog-head h2 {
  font-size: 15px;
}

.dialog-head p {
  color: var(--fg-lighter);
  font-size: 12px;
  margin-top: 3px;
}

.icon-button {
  font-size: 13px;
  min-height: 30px;
  padding: 0 10px;
  text-transform: none;
}

.dialog-form {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 16px 18px;
}

.dialog-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.dialog-form span {
  color: var(--fg-lighter);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dialog-form input,
.dialog-form select {
  background: var(--control);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-md);
  color: var(--fg);
  height: 38px;
  min-height: 38px;
  padding: 0 10px;
  width: 100%;
}

.dialog-form input:focus,
.dialog-form select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(221, 111, 147, 0.3);
  outline: none;
}

.dialog-form button {
  align-self: end;
}

.password-dialog-form {
  border-top: 1px solid var(--border-muted);
  padding-top: 14px;
}

/* ---------- Status (plain cell text, monospace) ---------- */
.status {
  display: inline-flex;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.status-raw-uploading,
.status-intake-qc-passed,
.status-output-qc-passed,
.status-curated-ready {
  color: var(--fg-light);
}

.status-package-ready {
  color: var(--warning);
}

.status-r2-published {
  color: #e6a3b8;
}

.status-r2-publish-blocked,
.status-intake-qc-failed {
  color: #eaa6ba;
}

/* ---------- Stage rail (minimal line + dots) ---------- */
.stage-rail {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(5, minmax(30px, 1fr));
  list-style: none;
  margin: 0;
  min-width: 240px;
  padding: 0;
}

.stage {
  color: var(--fg-lighter);
  position: relative;
  text-align: center;
}

.stage small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.02em;
  margin-top: 6px;
}

.stage.done,
.stage.active {
  color: var(--fg-light);
}

.stage:not(:last-child)::after {
  background: var(--border-strong);
  content: "";
  height: 1px;
  left: calc(50% + 4px);
  position: absolute;
  right: calc(-50% + 4px);
  top: 5px;
}

.stage.done:not(:last-child)::after {
  background: color-mix(in srgb, var(--brand) 76%, var(--border-strong));
}

.stage span {
  background: var(--border-strong);
  border-radius: 999px;
  display: block;
  height: 9px;
  margin: 0 auto;
  position: relative;
  width: 9px;
  z-index: 1;
}

.stage.done span,
.stage.active span {
  background: var(--brand);
  box-shadow: 0 0 0 2px rgba(221, 111, 147, 0.14);
}

.actions {
  min-width: 96px;
  text-align: left;
  white-space: nowrap;
}

.actions form {
  margin: 0;
}

.actions button,
.actions .secondary-link {
  background: var(--surface-100);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--brand-link);
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  justify-content: center;
  letter-spacing: 0;
  min-height: 30px;
  padding: 0 11px;
  text-transform: none;
}

.actions button:hover,
.actions .secondary-link:hover {
  background: var(--surface-200);
  border-color: var(--brand-border);
  color: var(--brand);
}

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

.inline-actions form {
  margin: 0;
}

.package-download-panel {
  margin-bottom: 16px;
}

/* ---------- Empty state ---------- */
.empty-state {
  color: var(--fg-lighter);
  padding: 34px 20px;
}

.empty-state strong {
  color: var(--fg);
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

/* ---------- Endpoint boxes ---------- */
.endpoint-list {
  display: grid;
  gap: 13px;
  padding: 0;
}

.endpoint-list div {
  display: grid;
  gap: 6px;
}

.endpoint-list dt {
  color: var(--fg);
  font-size: 12px;
  font-weight: 600;
}

.endpoint-list dd code {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--fg-light);
  display: block;
  overflow-wrap: anywhere;
  padding: 0;
  width: 100%;
}

/* ---------- Audit posture / events ---------- */
.audit-list,
.events {
  display: grid;
  gap: 9px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.audit-list li,
.events li {
  color: var(--fg-light);
  font-size: 12px;
  line-height: 1.45;
}

.events li strong {
  color: var(--fg);
  font-weight: 600;
}

.audit-list .health-dot {
  display: none;
}

.events {
  padding: 16px 18px 18px;
}

/* ---------- Auth ---------- */
.auth-page {
  background: var(--canvas);
  min-height: 100vh;
}

.auth-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-card {
  background: var(--surface-100);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 400px;
  padding: 30px;
  width: 100%;
}

.auth-logo {
  height: 40px;
  margin-bottom: 22px;
  width: 40px;
}

.auth-card h1 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.auth-card p {
  color: var(--fg-lighter);
  line-height: 1.55;
  margin-bottom: 24px;
}

.auth-error {
  background: var(--destructive-bg);
  border: 1px solid var(--destructive-border);
  border-radius: var(--radius-md);
  color: var(--destructive-fg);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  padding: 10px 12px;
}

.auth-success {
  background: var(--brand-bg);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  color: var(--brand-link);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  padding: 10px 12px;
}

.sso-actions {
  display: grid;
  gap: 10px;
}

.sso-button {
  align-items: center;
  background: var(--brand-link);
  border: 1px solid var(--brand-link);
  border-radius: var(--radius-md);
  color: #fff;
  display: flex;
  font-size: 13px;
  font-weight: 600;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  text-align: center;
  text-decoration: none;
}

.sso-button:hover {
  background: var(--brand);
  border-color: var(--brand);
}

.sso-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(221, 111, 147, 0.32);
  outline: none;
}

.auth-divider {
  align-items: center;
  color: var(--fg-muted);
  display: flex;
  font-size: 11px;
  gap: 10px;
  margin: 20px 0;
  text-transform: uppercase;
}

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

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form label {
  color: var(--fg-lighter);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.auth-form input {
  background: var(--control);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-md);
  color: var(--fg);
  min-height: 40px;
  padding: 0 12px;
}

.auth-form input::placeholder {
  color: var(--fg-muted);
}

.auth-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(221, 111, 147, 0.3);
  outline: none;
}

.auth-form button {
  margin-top: 8px;
  min-height: 40px;
  width: 100%;
}

.auth-switch {
  font-size: 13px;
  margin: 18px 0 0;
}

.auth-switch a {
  color: var(--brand-link);
  font-weight: 600;
}

/* ---------- SomaStacks preview inspector ---------- */
.somastacks-preview-page .shell {
  padding-bottom: 32px;
}

.preview-page-head {
  align-items: flex-end;
}

.preview-legend {
  align-items: center;
  color: var(--fg-lighter);
  display: flex;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11px;
  gap: 16px;
}

.preview-legend > span {
  align-items: center;
  display: inline-flex;
  gap: 7px;
}

.preview-hand-dot {
  border-radius: 50%;
  display: inline-block;
  height: 7px;
  width: 7px;
}

.preview-hand-dot-left {
  background: var(--tracking-left);
  box-shadow: 0 0 0 3px var(--tracking-left-muted);
}

.preview-hand-dot-right {
  background: var(--tracking-right);
  box-shadow: 0 0 0 3px var(--tracking-right-muted);
}

.preview-audio-badge {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--fg-light);
  min-height: 24px;
  padding: 3px 8px;
  text-transform: uppercase;
}

.preview-inspector {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(248px, 288px) minmax(0, 1fr);
  min-height: calc(100vh - 170px);
}

.preview-queue,
.preview-focus {
  background: var(--surface-100);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
  min-width: 0;
  overflow: hidden;
}

.preview-queue {
  align-self: start;
  max-height: calc(100vh - 170px);
  position: sticky;
  top: 66px;
}

.preview-queue-head {
  align-items: center;
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 12px 14px;
}

.preview-queue-head h2,
.preview-focus-identity h2,
.preview-facts-head h3,
.quality-timeline-head h3,
.preview-layer-head h3 {
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
  margin: 2px 0 0;
}

.preview-queue-count {
  color: var(--fg);
  font-family: var(--mono);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.preview-queue-list {
  max-height: calc(100vh - 235px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.preview-queue-placeholder {
  align-items: center;
  color: var(--fg-lighter);
  display: flex;
  font-size: 12px;
  gap: 8px;
  min-height: 72px;
  padding: 16px 14px;
}

.preview-loading-mark {
  animation: preview-pulse 900ms cubic-bezier(0.23, 1, 0.32, 1) infinite alternate;
  background: var(--brand);
  border-radius: 50%;
  display: block;
  height: 7px;
  width: 7px;
}

@keyframes preview-pulse {
  from { opacity: 0.28; }
  to { opacity: 1; }
}

.preview-queue-item {
  align-items: start;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-muted);
  border-radius: 0;
  color: var(--fg-light);
  display: grid;
  gap: 5px;
  justify-items: start;
  min-height: 78px;
  padding: 11px 14px;
  text-align: left;
  text-transform: none;
  width: 100%;
}

.preview-queue-item:hover {
  background: var(--surface-200);
  border-color: var(--border-muted);
}

.preview-queue-item[aria-selected="true"] {
  background: var(--surface-200);
  box-shadow: inset 2px 0 0 var(--brand);
}

.preview-queue-item:focus-visible {
  border-color: var(--brand);
  box-shadow: inset 2px 0 0 var(--brand), inset 0 0 0 1px var(--brand);
}

.preview-queue-item strong {
  color: var(--fg);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.35;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-queue-item > span:not(.status) {
  color: var(--fg-lighter);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
}

.preview-focus {
  align-self: start;
}

.preview-focus-head {
  align-items: center;
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  min-height: 64px;
  padding: 10px 16px;
}

.preview-focus-identity {
  min-width: 0;
}

.preview-focus-identity h2 {
  font-family: var(--mono);
  max-width: min(72vw, 880px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-focus-identity p {
  color: var(--fg-lighter);
  font-size: 11px;
  margin-top: 3px;
}

.preview-focus-actions {
  align-items: center;
  display: flex;
  flex: none;
  gap: 10px;
}

.preview-inline-notice {
  background: var(--surface-200);
  border-bottom: 1px solid var(--border-muted);
  color: var(--fg-light);
  font-size: 12px;
  min-height: 38px;
  padding: 10px 16px;
}

.preview-inline-notice[data-tone="working"] {
  color: var(--brand-link);
}

.preview-inline-notice[data-tone="warning"] {
  color: var(--warning);
}

.preview-inline-notice[data-tone="error"] {
  color: var(--destructive-fg);
}

.preview-inline-notice[data-tone="ready"] {
  color: var(--tracking-left);
}

.preview-tabs {
  align-items: center;
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  gap: 2px;
  min-height: 42px;
  overflow-x: auto;
  padding: 0 12px;
}

.preview-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--fg-lighter);
  min-height: 42px;
  padding: 0 12px;
}

.preview-tab:hover {
  background: transparent;
  border-color: transparent;
  color: var(--fg);
}

.preview-tab.is-active {
  border-bottom-color: var(--brand);
  color: var(--fg);
}

.preview-tab:focus-visible {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.preview-tab-panel[hidden] {
  display: none;
}

.preview-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
}

.preview-visual-column {
  min-width: 0;
  padding: 14px;
}

.preview-view-switch {
  align-items: center;
  background: var(--control);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  display: inline-flex;
  gap: 2px;
  margin-bottom: 12px;
  padding: 3px;
}

.preview-view-option {
  border-color: transparent;
  border-radius: var(--radius-sm);
  color: var(--fg-lighter);
  letter-spacing: 0;
  min-height: 44px;
  min-width: 96px;
  padding-inline: 16px;
  text-transform: none;
}

.preview-view-option:hover {
  border-color: transparent;
}

.preview-view-option.is-active {
  background: var(--surface-300);
  border-color: var(--border-strong);
  color: var(--fg);
}

.preview-view-option:active:not(:disabled) {
  transform: scale(0.97);
  transition: transform 100ms ease-out;
}

.keyframe-browser {
  min-width: 0;
}

.keyframe-browser-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.keyframe-browser-head h3 {
  color: var(--fg);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 3px 0 0;
}

.keyframe-browser-head p {
  color: var(--fg-lighter);
  font-size: 11px;
  margin-top: 5px;
}

.keyframe-control-bar {
  align-items: end;
  border-bottom: 1px solid var(--border-muted);
  border-top: 1px solid var(--border-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 0;
}

.keyframe-control-group {
  border: 0;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.keyframe-control-group legend {
  color: var(--fg-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.keyframe-segmented {
  align-items: center;
  background: var(--control);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  display: inline-flex;
  gap: 2px;
  padding: 3px;
}

.keyframe-segmented button {
  border-color: transparent;
  border-radius: var(--radius-sm);
  letter-spacing: 0;
  min-height: 44px;
  padding-inline: 12px;
  text-transform: none;
}

.keyframe-segmented button:hover {
  border-color: transparent;
}

.keyframe-segmented button[aria-pressed="true"] {
  background: var(--surface-300);
  border-color: var(--border-strong);
  color: var(--fg);
}

.keyframe-segmented button:active {
  transform: scale(0.97);
  transition: transform 100ms ease-out;
}

.keyframe-generate-button {
  background: var(--brand);
  border-color: var(--brand);
  color: #140b0e;
  min-height: 44px;
  margin-left: auto;
}

.keyframe-generate-button:hover {
  background: var(--brand-link);
  border-color: var(--brand-link);
  color: #140b0e;
}

.keyframe-generate-button:active:not(:disabled) {
  background: var(--brand-hover);
  transform: scale(0.97);
  transition: transform 100ms ease-out;
}

.keyframe-feedback {
  color: var(--fg-lighter);
  font-size: 11px;
  margin: 9px 0;
  min-height: 16px;
}

.keyframe-feedback[data-tone="working"] {
  color: var(--brand-link);
}

.keyframe-feedback[data-tone="ready"] {
  color: var(--tracking-left);
}

.keyframe-feedback[data-tone="error"] {
  color: var(--destructive-fg);
}

.keyframe-empty {
  align-items: center;
  background:
    linear-gradient(var(--border-muted) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-muted) 1px, transparent 1px),
    #070707;
  background-size: 64px 64px;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  color: var(--fg-lighter);
  display: flex;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
  min-height: clamp(360px, 62vh, 680px);
  padding: 24px;
  text-align: center;
}

.keyframe-empty strong {
  color: var(--fg-light);
  font-size: 13px;
  font-weight: 600;
}

.keyframe-empty span:last-child {
  font-size: 11px;
  max-width: 380px;
}

.keyframe-viewport {
  background: #050505;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  height: clamp(360px, 66vh, 760px);
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.keyframe-viewport:focus-visible {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
  outline: none;
}

.keyframe-canvas {
  min-width: 0;
  position: relative;
}

.keyframe-page {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(var(--keyframe-columns), minmax(0, 1fr));
  grid-template-rows: repeat(var(--keyframe-columns), minmax(0, 1fr));
  left: 0;
  padding: 0;
  position: absolute;
  right: 0;
}

.keyframe-tile {
  background: #070707;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-rows: minmax(0, 1fr) 28px;
  letter-spacing: 0;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  text-transform: none;
}

.keyframe-tile:hover {
  background: #070707;
  border-color: var(--border-control);
}

.keyframe-tile:active {
  transform: scale(0.985);
  transition: transform 100ms ease-out;
}

.keyframe-tile img {
  background: #050505;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  display: block;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  width: 100%;
}

.keyframe-tile time {
  align-items: center;
  background: var(--control);
  color: var(--fg-light);
  display: flex;
  font-family: var(--mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  justify-content: flex-start;
  padding-inline: 8px;
}

.keyframe-tile[data-image-error="true"] {
  color: var(--destructive-fg);
  grid-template-rows: minmax(44px, 1fr) 28px;
}

.keyframe-tile[data-image-error="true"]::before {
  align-items: center;
  content: "Image unavailable";
  display: flex;
  font-size: 10px;
  justify-content: center;
}

.keyframe-tile[data-image-error="true"] img {
  display: none;
}

.keyframe-tile-skeleton {
  animation: preview-pulse 900ms cubic-bezier(0.23, 1, 0.32, 1) infinite alternate;
  background: var(--surface-200);
  grid-template-rows: 1fr;
  pointer-events: none;
}

.preview-player-shell {
  aspect-ratio: 4 / 3;
  background: #050505;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  max-height: min(66vh, 780px);
  overflow: hidden;
  position: relative;
}

.preview-player-shell video {
  background: #050505;
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.preview-player-empty {
  align-items: center;
  background:
    linear-gradient(var(--border-muted) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-muted) 1px, transparent 1px),
    #070707;
  background-size: 64px 64px;
  color: var(--fg-lighter);
  display: flex;
  flex-direction: column;
  gap: 5px;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: absolute;
  text-align: center;
}

.preview-player-empty[hidden] {
  display: none;
}

.preview-player-empty strong {
  color: var(--fg-light);
  font-size: 13px;
  font-weight: 600;
}

.preview-player-empty span:not(.preview-frame-corners) {
  font-size: 11px;
  max-width: 360px;
}

.preview-frame-corners {
  border: 1px solid var(--camera-geometry);
  height: 44px;
  margin-bottom: 8px;
  opacity: 0.45;
  position: relative;
  transform: rotate(45deg);
  width: 44px;
}

.preview-frame-corners::before,
.preview-frame-corners::after {
  background: #070707;
  content: "";
  inset: 8px -2px;
  position: absolute;
}

.preview-frame-corners::after {
  inset: -2px 8px;
}

.preview-transport-meta {
  color: var(--fg-lighter);
  display: flex;
  font-family: var(--mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  justify-content: space-between;
  padding: 8px 2px 0;
}

.quality-timeline {
  border-top: 1px solid var(--border-muted);
  margin-top: 12px;
  padding-top: 12px;
}

.quality-timeline-head,
.preview-layer-head {
  align-items: flex-start;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.quality-timeline-head > span,
.preview-layer-head p {
  color: var(--fg-lighter);
  font-size: 11px;
}

.quality-track-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 42px minmax(0, 1fr);
  margin-top: 9px;
}

.quality-track-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.quality-track-label-left {
  color: var(--tracking-left);
}

.quality-track-label-right {
  color: var(--tracking-right);
}

.quality-track {
  background: var(--control);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  display: block;
  height: 26px;
  overflow: hidden;
  width: 100%;
}

.quality-track rect {
  cursor: pointer;
  transition: opacity 120ms ease;
}

.quality-track rect:hover,
.quality-track rect:focus {
  opacity: 0.72;
  outline: none;
  stroke: var(--fg);
  stroke-width: 2;
}

.quality-frame-scrubber {
  accent-color: var(--brand);
  display: block;
  margin: 9px 0 0 50px;
  width: calc(100% - 50px);
}

.quality-frame-scrubber:focus-visible {
  outline: 1px solid var(--brand);
  outline-offset: 3px;
}

.quality-timeline-empty {
  color: var(--fg-muted);
  font-size: 11px;
  margin: 8px 0 0 50px;
}

.preview-facts {
  border-left: 1px solid var(--border-muted);
  min-width: 0;
  padding: 14px;
}

.preview-facts-head {
  border-bottom: 1px solid var(--border-muted);
  padding-bottom: 10px;
}

.preview-facts-list {
  display: grid;
}

.preview-facts-list > div {
  border-bottom: 1px solid var(--border-muted);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(88px, 0.8fr) minmax(0, 1.2fr);
  padding: 9px 0;
}

.preview-facts-list dt {
  color: var(--fg-lighter);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.preview-facts-list dd {
  color: var(--fg-light);
  font-family: var(--mono);
  font-size: 10px;
  overflow-wrap: anywhere;
  text-align: right;
}

.preview-hand-summary {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
  margin-top: 12px;
}

.preview-hand-card {
  background: var(--control);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  min-width: 0;
  padding: 10px;
}

.preview-hand-card span,
.preview-hand-card small {
  color: var(--fg-lighter);
  display: block;
  font-size: 9px;
}

.preview-hand-card strong {
  display: block;
  font-family: var(--mono);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  margin: 5px 0;
}

.preview-hand-card-left strong {
  color: var(--tracking-left);
}

.preview-hand-card-right strong {
  color: var(--tracking-right);
}

.preview-warning-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.preview-warning-list p {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-md);
  color: var(--warning);
  font-size: 10px;
  padding: 8px;
}

.preview-warning-list p[data-error="true"] {
  background: var(--destructive-bg);
  border-color: var(--destructive-border);
  color: var(--destructive-fg);
}

.preview-3d-panel,
.preview-artifacts-panel {
  padding: 14px;
}

.preview-layer-head {
  margin-bottom: 12px;
}

.preview-layer-head p {
  margin-top: 4px;
}

.rerun-viewer-shell {
  background: #050505;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  height: min(72vh, 780px);
  min-height: 480px;
  overflow: hidden;
  position: relative;
}

.rerun-viewer {
  height: 100%;
  position: relative;
  width: 100%;
}

.rerun-viewer > canvas {
  display: block;
  height: 100%;
  width: 100%;
}

.rerun-placeholder {
  align-items: center;
  color: var(--fg-lighter);
  display: flex;
  flex-direction: column;
  gap: 6px;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: absolute;
  text-align: center;
}

.rerun-placeholder[hidden] {
  display: none;
}

.rerun-placeholder strong {
  color: var(--fg-light);
  font-size: 13px;
}

.rerun-placeholder span {
  font-size: 11px;
}

.rerun-build-button {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  margin-top: 10px;
  min-height: 44px;
  padding-inline: 18px;
}

.rerun-build-button:hover {
  background: var(--brand-link);
  border-color: var(--brand-link);
  color: #fff;
}

.preview-layer-error {
  color: var(--destructive-fg);
  font-size: 11px;
  margin-top: 8px;
}

.preview-artifacts-table {
  min-width: 820px;
}

.preview-checksum {
  color: var(--fg-lighter);
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.status-ready-2d,
.status-ready {
  color: var(--tracking-left);
}

.status-queued,
.status-importing,
.status-building,
.status-loading {
  color: var(--brand-link);
}

.status-not-built,
.status-not-ready,
.status-empty {
  color: var(--fg-lighter);
}

.status-stale {
  color: var(--warning);
}

/* ---------- Responsive ---------- */
/* ---------- Cross-page supply chain ---------- */
.chain-kicker {
  color: var(--brand-link);
  display: block;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.11em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.chain-map {
  background: var(--surface-100);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}

.chain-map-heading {
  align-items: center;
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  justify-content: space-between;
  min-height: 68px;
  padding: 14px 18px;
}

.chain-map-heading h2 {
  font-size: 16px;
}

.chain-map-heading p {
  color: var(--fg-light);
  font-size: 12px;
  margin-top: 4px;
}

.chain-contract-chip,
.panel-count {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--fg-light);
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 8px;
  white-space: nowrap;
}

.chain-stage-scroll {
  overflow-x: auto;
}

.chain-stage-map {
  display: grid;
  grid-template-columns: repeat(8, minmax(172px, 1fr));
  list-style: none;
  margin: 0;
  min-width: 1376px;
  padding: 0;
}

.chain-stage {
  min-width: 0;
  position: relative;
}

.chain-stage + .chain-stage {
  border-left: 1px solid var(--border-muted);
}

.chain-stage a {
  display: grid;
  gap: 10px;
  grid-template-columns: 24px minmax(0, 1fr);
  min-height: 116px;
  padding: 15px 14px;
  transition: background-color 140ms ease, color 140ms ease;
}

.chain-stage a:hover,
.chain-stage a:focus-visible {
  background: var(--surface-200);
  outline: none;
}

.chain-stage-index,
.contract-step,
.quality-gate-index {
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--fg-light);
  display: inline-flex;
  font-family: var(--mono);
  font-size: 10px;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.chain-stage-ready .chain-stage-index {
  border-color: var(--brand-border);
  color: var(--brand-link);
}

.chain-stage-attention .chain-stage-index {
  border-color: var(--warning-border);
  color: var(--warning);
}

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

.chain-stage-copy small {
  color: var(--fg-light);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  min-height: 28px;
}

.chain-stage-copy strong {
  color: var(--fg);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  font-weight: 620;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 6px 0 8px;
}

.chain-stage-copy em {
  color: var(--fg-lighter);
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operations-queue-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.queue-cell {
  background: var(--surface-100);
  border-block: 1px solid var(--border);
  display: grid;
  min-height: 112px;
  padding: 15px 18px;
  transition: background-color 140ms ease;
}

.queue-cell:first-child {
  border-left: 1px solid var(--border);
  border-radius: var(--radius) 0 0 var(--radius);
}

.queue-cell:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
  border-right: 1px solid var(--border);
}

.queue-cell + .queue-cell {
  border-left: 1px solid var(--border-muted);
}

.queue-cell:hover,
.queue-cell:focus-visible {
  background: var(--surface-200);
  outline: none;
}

.queue-cell span {
  color: var(--fg-light);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.queue-cell strong {
  color: var(--fg);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-block: 8px;
}

.queue-cell small {
  color: var(--fg-lighter);
}

.queue-cell.has-attention strong {
  color: var(--warning);
}

.operations-exceptions,
.legacy-batch-sheet,
.intake-submissions-panel,
.managed-upload-panel,
.source-asset-ledger,
.quality-explanation,
.quality-exception-panel,
.delivery-table-panel {
  margin-top: 16px;
}

.processor-connection-panel {
  margin-bottom: 16px;
}

.processor-connection-overview {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(0, 2.25fr);
}

.processor-connection-heading {
  border-right: 1px solid var(--border-muted);
  padding: 14px 18px;
}

.processor-connection-title-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 5px;
}

.processor-connection-title-row h2 {
  font-size: 15px;
  margin: 0;
}

.processor-connection-heading p {
  color: var(--fg-lighter);
  font-size: 11px;
  margin-top: 5px;
}

.processor-connection-state {
  align-items: center;
  color: var(--fg-lighter);
  display: inline-flex;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  gap: 7px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.processor-connection-dot {
  background: var(--fg-muted);
  border-radius: 999px;
  display: inline-block;
  height: 8px;
  width: 8px;
}

.processor-connection-state[data-state="live"] {
  color: var(--success-fg);
}

.processor-connection-state[data-state="live"] .processor-connection-dot {
  animation: processor-connection-breathe 2.2s cubic-bezier(0.23, 1, 0.32, 1) infinite;
  background: var(--success);
}

.processor-connection-state[data-state="issue"] {
  color: var(--destructive-fg);
}

.processor-connection-state[data-state="issue"] .processor-connection-dot {
  background: var(--destructive);
}

.processor-connection-facts {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(100px, 1fr));
  margin: 0;
  min-width: 0;
}

.processor-connection-facts > div {
  display: grid;
  min-width: 0;
  padding: 13px 16px;
}

.processor-connection-facts > div + div {
  border-left: 1px solid var(--border-muted);
}

.processor-connection-facts dt {
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.processor-connection-facts dd {
  align-self: end;
  color: var(--fg-light);
  font-size: 11px;
  margin: 7px 0 0;
  min-width: 0;
}

.processor-connection-facts dd > small {
  color: var(--fg-muted);
  display: block;
  font-size: 9px;
  margin-top: 3px;
}

.processor-connection-facts code {
  display: block;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.processor-connection-error {
  border-left: 0 !important;
  border-top: 1px solid var(--border-muted);
  grid-column: 1 / -1;
}

.processor-connection-error dd {
  color: var(--destructive-fg);
  overflow-wrap: anywhere;
}

@keyframes processor-connection-breathe {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.82);
  }

  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

.processor-connection-state[data-state="offline"] {
  color: var(--fg-muted);
}

.somastacks-workspace-tabs {
  --indicator-color: transparent;
  --track-color: transparent;
  --track-width: 0;

  display: block;
  margin-bottom: 16px;
}

.somastacks-workspace-tabs::part(nav) {
  background: var(--surface-100);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-width: 100%;
  padding: 3px;
  width: fit-content;
}

.somastacks-workspace-tabs::part(tabs) {
  gap: 2px;
}

.somastacks-workspace-tabs wa-tab::part(base) {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--fg-lighter);
  font-size: 12px;
  gap: 8px;
  min-height: 34px;
  padding: 0 11px;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.somastacks-workspace-tabs wa-tab:hover::part(base) {
  color: var(--fg);
}

.somastacks-workspace-tabs wa-tab[active]::part(base) {
  background: var(--surface-300);
  border-color: var(--border-strong);
  color: var(--fg);
}

.somastacks-tab-meta {
  background: var(--surface-200);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg-lighter);
  font-family: var(--mono);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 17px;
  padding: 0 5px;
  white-space: nowrap;
  text-transform: uppercase;
}

.somastacks-workspace-tabs wa-tab[active] .somastacks-tab-meta {
  background: var(--brand-bg);
  border-color: var(--brand-border);
  color: var(--brand-link);
}

.somastacks-tab-unread {
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  color: var(--canvas);
  font-family: var(--mono);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 17px;
  min-width: 19px;
  padding: 0 5px;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.somastacks-workspace-tabs wa-tab-panel {
  --padding: 12px 0 0;
}

.somastacks-workspace-tabs:not(:defined) {
  display: block;
}

.somastacks-workspace-tabs:not(:defined) > wa-tab {
  color: var(--fg-lighter);
  display: inline-flex;
  min-height: 40px;
  padding: 0 12px;
}

.somastacks-workspace-tabs:not(:defined) > wa-tab[active] {
  color: var(--fg);
}

.somastacks-workspace-tabs wa-tab-panel:not([active]) {
  display: none;
}

.somastacks-page .processing-groups-panel {
  margin-top: 0;
}

.retry-pool {
  margin-bottom: 12px;
  scroll-margin-top: 72px;
}

.retry-pool-heading,
.selection-packages-heading {
  align-items: flex-start;
  gap: 20px;
}

.retry-pool-heading h2,
.selection-packages-heading h2 {
  font-size: 16px;
  margin-top: 3px;
}

.retry-pool-heading p,
.selection-packages-heading p {
  max-width: 760px;
}

.retry-pool-actions {
  display: flex;
  flex: none;
  gap: 8px;
}

.retry-pool-actions form {
  margin: 0;
}

.retry-pool-summary {
  border-bottom: 1px solid var(--border-muted);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.retry-pool-summary > div {
  display: grid;
  gap: 4px;
  padding: 12px 18px;
}

.retry-pool-summary > div + div {
  border-left: 1px solid var(--border-muted);
}

.retry-pool-summary span {
  color: var(--fg-lighter);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.retry-pool-summary strong {
  font-family: var(--mono);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.retry-source-batch-picker {
  border-bottom: 1px solid var(--border-muted);
}

.retry-source-batch-list {
  max-height: 320px;
  overflow: auto;
}

.retry-source-batch-list > label {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(220px, 1fr) auto auto;
  min-height: 52px;
  padding: 8px 18px;
}

.retry-source-batch-list > label + label {
  border-top: 1px solid var(--border-muted);
}

.retry-source-batch-list > label:hover {
  background: var(--surface-200);
}

.retry-source-batch-list input,
.retry-source-batch-select-all input {
  accent-color: var(--brand);
  height: 16px;
  margin: 0;
  width: 16px;
}

.retry-source-batch-identity {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.retry-source-batch-identity code {
  overflow-wrap: anywhere;
}

.retry-source-batch-identity small,
.retry-source-batch-facts > span:not(.status),
.retry-source-batch-footer > span {
  color: var(--fg-lighter);
  font-size: 10px;
}

.retry-source-batch-facts {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.retry-source-batch-footer {
  align-items: center;
  border-top: 1px solid var(--border-muted);
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  padding: 10px 18px;
}

.retry-source-batch-select-all {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 7px;
  margin-right: auto;
}

.retry-source-batch-empty {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 14px 18px;
}

.retry-contract-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.retry-contract {
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.retry-contract[data-ready="true"] {
  border-color: hsl(151 25% 30%);
}

.retry-contract-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 12px 14px 8px;
}

.retry-contract-head h3,
.package-mode-card h3 {
  font-size: 14px;
  margin: 2px 0 0;
}

.retry-contract-head code {
  color: var(--fg-muted);
  display: block;
  font-size: 10px;
  margin-top: 3px;
}

.retry-duration {
  display: grid;
  gap: 7px;
  padding: 2px 14px 10px;
}

.retry-duration > div {
  align-items: baseline;
  display: flex;
  gap: 9px;
}

.retry-duration strong {
  font-family: var(--mono);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.retry-duration span,
.retry-contract-facts,
.package-mode-card p {
  color: var(--fg-lighter);
  font-size: 11px;
}

.retry-duration progress {
  accent-color: var(--success);
  background: var(--surface-200);
  border: 0;
  border-radius: 999px;
  height: 5px;
  overflow: hidden;
  width: 100%;
}

.retry-contract-facts {
  border-top: 1px solid var(--border-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 9px 14px;
}

.retry-contract details {
  border-top: 1px solid var(--border-muted);
}

.retry-contract summary,
.retry-blocked summary,
.retry-ineligible summary,
.retry-batch-history summary,
.processing-history summary {
  color: var(--fg-light);
  cursor: pointer;
  font-size: 11px;
  min-height: 40px;
  padding: 12px 14px;
}

.retry-candidate-list {
  border-top: 1px solid var(--border-muted);
  max-height: 320px;
  overflow: auto;
}

.retry-candidate-list label {
  align-items: flex-start;
  border-bottom: 1px solid var(--border-muted);
  cursor: pointer;
  display: flex;
  gap: 10px;
  min-height: 44px;
  padding: 9px 14px;
}

.retry-candidate-list label:hover {
  background: var(--surface-200);
}

.retry-candidate-list input,
.package-candidate-toolbar input,
.package-candidate-scroll input,
.package-artifact-options input {
  accent-color: var(--brand);
  flex: none;
  height: 16px;
  margin: 2px 0 0;
  width: 16px;
}

.retry-candidate-list span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.retry-candidate-list code {
  overflow-wrap: anywhere;
}

.retry-candidate-list small {
  color: var(--fg-lighter);
  font-size: 10px;
}

.manual-selection-footer {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 10px 14px;
}

.manual-selection-footer span {
  color: var(--fg-lighter);
  font-family: var(--mono);
  font-size: 11px;
}

.retry-force-action {
  align-items: center;
  background: var(--warning-bg);
  border-top: 1px solid var(--warning-border);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 10px 14px;
}

.retry-force-action > span {
  color: var(--fg-light);
  font-size: 11px;
  line-height: 1.45;
}

.force-button {
  border-color: var(--warning-border);
  color: var(--warning);
  flex: none;
}

.force-button:hover {
  background: color-mix(in srgb, var(--warning-bg) 70%, var(--surface-200));
  border-color: var(--warning);
  color: var(--fg);
}

.retry-blocked,
.retry-ineligible,
.retry-batch-history,
.processing-history {
  border-top: 1px solid var(--border-muted);
}

.retry-blocked ul,
.retry-ineligible ul {
  border-top: 1px solid var(--border-muted);
  list-style: none;
  margin: 0;
  padding: 0;
}

.retry-blocked li,
.retry-ineligible li {
  display: grid;
  gap: 4px;
  padding: 10px 14px;
}

.retry-blocked li + li,
.retry-ineligible li + li {
  border-top: 1px solid var(--border-muted);
}

.retry-blocked li span {
  color: var(--destructive-fg);
  font-size: 11px;
}

.retry-ineligible li span,
.retry-batch-history > p,
.processing-history > p {
  color: var(--fg-lighter);
  font-size: 11px;
}

.retry-ineligible li span {
  color: var(--warning);
}

.retry-batch-history > p,
.processing-history > p {
  margin: 0;
  padding: 0 14px 12px;
}

.retry-current-empty {
  border-top: 1px solid var(--border-muted);
}

.retry-batch-ledger {
  border-top: 1px solid var(--border-muted);
}

.retry-pool-empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  display: grid;
  gap: 4px;
  padding: 18px;
}

.retry-pool-empty span {
  color: var(--fg-lighter);
  font-size: 12px;
}

.selection-packages-panel {
  min-width: 0;
}

.package-mode-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
}

.package-mode-card {
  min-width: 0;
  padding: 16px 18px;
}

.package-mode-card + .package-mode-card {
  border-left: 1px solid var(--border-muted);
}

.package-mode-card > div:first-child {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.package-candidate-toolbar {
  align-items: center;
  border: 1px solid var(--border);
  border-bottom: 0;
  display: flex;
  justify-content: space-between;
  min-height: 40px;
  padding: 8px 10px;
}

.package-candidate-toolbar label {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 11px;
  gap: 8px;
}

.package-candidate-toolbar span {
  color: var(--fg-lighter);
  font-family: var(--mono);
  font-size: 10px;
}

.package-candidate-scroll {
  border: 1px solid var(--border);
  max-height: 390px;
  overflow: auto;
}

.package-candidate-scroll table {
  min-width: 720px;
}

.package-candidate-scroll td {
  vertical-align: top;
}

.package-candidate-scroll td:nth-child(2) {
  display: grid;
  gap: 4px;
}

.package-candidate-scroll td:nth-child(2) small {
  color: var(--fg-lighter);
  font-size: 10px;
}

.package-artifact-options {
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 12px 0;
  padding: 0;
}

.package-artifact-options legend {
  color: var(--fg-lighter);
  font-size: 10px;
  letter-spacing: 0.06em;
  margin-bottom: 7px;
  text-transform: uppercase;
}

.package-artifact-options label {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-family: var(--mono);
  font-size: 10px;
  gap: 7px;
  min-height: 28px;
}

.automatic-package-form {
  display: grid;
  gap: 12px;
}

.automatic-package-form > label,
.package-filter-row label {
  color: var(--fg-lighter);
  display: grid;
  font-size: 10px;
  font-weight: 600;
  gap: 6px;
  letter-spacing: 0.05em;
  min-width: 0;
  text-transform: uppercase;
}

.automatic-package-form input[type="text"],
.automatic-package-form input[type="date"],
.automatic-package-form input[type="number"] {
  background: var(--control);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-md);
  color: var(--fg);
  min-height: 40px;
  padding: 0 10px;
  width: 100%;
}

.automatic-package-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
  outline: 0;
}

.package-filter-row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.selection-package-history {
  border-top: 1px solid var(--border-muted);
}

.selection-package-history table,
.retry-batch-ledger table,
.retry-batch-history table {
  min-width: 900px;
}

.processing-history-table {
  min-width: 760px;
}

.retry-disposition-panel .panel-heading {
  align-items: flex-start;
  gap: 18px;
}

.retry-source-list {
  display: grid;
}

.retry-source-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.retry-source-list > div {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(240px, 1fr) auto;
  min-height: 44px;
  padding: 8px 18px;
}

.retry-source-list > div + div {
  border-top: 1px solid var(--border-muted);
}

.retry-source-list small {
  color: var(--destructive-fg);
  grid-column: 2 / -1;
}

.retry-linked-batch {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 44px;
  padding: 8px 18px;
}

.retry-linked-batch + .retry-linked-batch {
  border-top: 1px solid var(--border-muted);
}

.retry-linked-batch > div {
  align-items: center;
  display: flex;
  gap: 10px;
}

.retry-linked-batch > span {
  color: var(--fg-lighter);
  font-size: 11px;
}

.batch-unread-events {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.batch-unread-event {
  background: var(--surface-200);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  display: inline-flex;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.05em;
  line-height: 18px;
  padding: 0 6px;
  text-transform: uppercase;
  white-space: nowrap;
}

.batch-unread-event-new {
  background: var(--brand-bg);
  border-color: var(--brand-border);
  color: var(--brand-link);
}

.batch-unread-event-ready {
  border-color: var(--success-fg);
  color: var(--success-fg);
}

.somastacks-page .supply-lineage-panel .lineage-scroll,
.somastacks-page .processing-groups-panel .somastacks-table-scroll {
  max-height: calc(100vh - 360px);
  min-height: 420px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.somastacks-page .processing-groups-panel .processing-history .somastacks-table-scroll {
  max-height: 420px;
  min-height: 0;
}

.somastacks-page .lineage-lane-head,
.somastacks-page .processing-groups-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
}

.subsection-label {
  align-items: baseline;
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  gap: 12px;
  padding: 12px 18px;
}

.subsection-label span {
  color: var(--fg-lighter);
  font-size: 11px;
}

/* ---------- Contract registry ---------- */
.registry-main {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.contract-registry {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.contract-lane {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  min-width: 900px;
  padding: 0;
}

.contract-lane li {
  display: grid;
  min-height: 192px;
  padding: 15px;
  position: relative;
}

.contract-lane li + li {
  border-left: 1px solid var(--border-muted);
}

.contract-lane small {
  color: var(--fg-lighter);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  margin-top: 14px;
  text-transform: uppercase;
}

.contract-lane strong {
  color: var(--fg);
  font-size: 13px;
  line-height: 1.35;
  margin: 7px 0;
}

.contract-lane code {
  color: var(--brand-link);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.contract-lane em {
  align-self: end;
  color: var(--fg-lighter);
  font-size: 11px;
  font-style: normal;
  line-height: 1.4;
  margin-top: 12px;
}

.contract-lane .contract-gap {
  background: rgba(217, 154, 43, 0.04);
}

.contract-gap .contract-step {
  border-color: var(--warning-border);
  color: var(--warning);
}

/* ---------- Supplier intake ---------- */
.source-contract-hero {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(220px, 0.7fr) minmax(360px, 1.25fr);
  margin-bottom: 16px;
}

.source-contract-identity,
.source-contract-health,
.source-contract-endpoint {
  min-width: 0;
  padding: 18px;
}

.source-contract-health,
.source-contract-endpoint {
  border-left: 1px solid var(--border-muted);
}

.source-contract-identity h2 {
  font-size: 18px;
  margin-bottom: 8px;
}

.source-contract-identity > code {
  color: var(--brand-link);
}

.source-contract-identity p {
  color: var(--fg-light);
  font-size: 12px;
  margin-top: 12px;
}

.source-contract-health {
  align-items: center;
  display: flex;
  gap: 12px;
}

.source-contract-health small,
.source-contract-health strong,
.source-contract-health em {
  display: block;
}

.source-contract-health small,
.source-contract-health em {
  color: var(--fg-lighter);
  font-size: 11px;
  font-style: normal;
}

.source-contract-health strong {
  color: var(--fg);
  font-size: 17px;
  margin-block: 3px;
}

.source-contract-endpoint {
  display: grid;
  gap: 8px;
}

.source-contract-endpoint > div,
.evidence-list > div,
.monitor-clock > div,
.inventory-boundary-card dl > div,
.delivery-contract-banner dl > div {
  display: grid;
  gap: 12px;
  grid-template-columns: 120px minmax(0, 1fr);
}

.source-contract-endpoint dt,
.evidence-list dt,
.monitor-clock dt,
.inventory-boundary-card dt,
.delivery-contract-banner dt {
  color: var(--fg-lighter);
  font-size: 11px;
}

.source-contract-endpoint dd,
.evidence-list dd,
.monitor-clock dd,
.inventory-boundary-card dd,
.delivery-contract-banner dd {
  color: var(--fg-light);
  font-size: 11px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.intake-contract-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.evidence-list {
  display: grid;
  gap: 10px;
  padding: 16px 18px 18px;
}

.intake-accounting {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.intake-accounting > div {
  display: grid;
  min-height: 100px;
  padding: 14px;
}

.intake-accounting > div + div {
  border-left: 1px solid var(--border-muted);
}

.intake-accounting small,
.intake-accounting em {
  color: var(--fg-lighter);
  font-size: 10px;
  font-style: normal;
}

.intake-accounting strong {
  color: var(--fg);
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin: 7px 0;
}

.intake-accounting .attention strong {
  color: var(--warning);
}

.monitor-clock {
  border-top: 1px solid var(--border-muted);
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 12px 14px;
}

.monitor-clock > div {
  grid-template-columns: 1fr;
  gap: 3px;
}

.contract-specific-note {
  line-height: 1.5;
  margin-bottom: 12px;
}

/* ---------- Inventory boundaries ---------- */
.inventory-boundary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inventory-boundary-card {
  border-bottom: 1px solid var(--border);
  min-width: 0;
  padding: 18px;
}

.inventory-boundary-card + .inventory-boundary-card {
  border-left: 1px solid var(--border-muted);
}

.inventory-boundary-card > strong {
  color: var(--fg);
  display: block;
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin: 14px 0 8px;
}

.inventory-boundary-card > p {
  color: var(--fg-light);
  font-size: 12px;
  line-height: 1.5;
  min-height: 55px;
}

.inventory-boundary-card dl {
  border-top: 1px solid var(--border-muted);
  display: grid;
  gap: 7px;
  margin-top: 14px;
  padding-top: 12px;
}

.inventory-boundary-card dl > div {
  grid-template-columns: 130px minmax(0, 1fr);
}

.source-asset-ledger {
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
}

/* ---------- Quality ---------- */
.quality-gate-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quality-gate-card {
  background: var(--surface-100);
  border-block: 1px solid var(--border);
  display: grid;
  gap: 14px;
  grid-template-columns: 28px minmax(0, 1fr);
  min-height: 220px;
  padding: 17px;
}

.quality-gate-card:first-child {
  border-left: 1px solid var(--border);
  border-radius: var(--radius) 0 0 var(--radius);
}

.quality-gate-card:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
  border-right: 1px solid var(--border);
}

.quality-gate-card + .quality-gate-card {
  border-left: 1px solid var(--border-muted);
}

.quality-gate-heading small {
  color: var(--brand-link);
  font-family: var(--mono);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.quality-gate-heading h2 {
  font-size: 15px;
  margin: 8px 0 6px;
}

.quality-gate-heading p {
  color: var(--fg-light);
  font-size: 12px;
  line-height: 1.5;
}

.quality-gate-accounting {
  align-self: end;
  border-top: 1px solid var(--border-muted);
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 12px;
}

.quality-gate-accounting > div {
  display: grid;
}

.quality-gate-accounting span {
  color: var(--fg-lighter);
  font-size: 10px;
  text-transform: uppercase;
}

.quality-gate-accounting strong {
  color: var(--fg);
  font-size: 23px;
  font-variant-numeric: tabular-nums;
}

.quality-gate-accounting .quality-blocked strong {
  color: var(--warning);
}

.quality-rule-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quality-rule-row > div {
  display: grid;
  gap: 6px;
  min-height: 96px;
  padding: 14px 18px;
}

.quality-rule-row > div + div {
  border-left: 1px solid var(--border-muted);
}

.quality-rule-row span {
  color: var(--fg-light);
  font-size: 12px;
}

/* ---------- Delivery ---------- */
.delivery-contract-banner {
  align-items: center;
  background: var(--surface-100);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  min-height: 110px;
  padding: 18px;
}

.delivery-contract-banner.is-missing {
  border-color: var(--warning-border);
}

.delivery-contract-banner h2 {
  font-size: 17px;
}

.delivery-contract-banner p {
  color: var(--fg-light);
  font-size: 12px;
  margin-top: 6px;
}

.delivery-contract-banner dl {
  display: grid;
  gap: 8px;
  margin-left: 24px;
  min-width: 340px;
}

.delivery-contract-banner dl > div {
  grid-template-columns: 130px minmax(0, 1fr);
}

.delivery-accounting {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr) 28px minmax(0, 1fr);
  margin-top: 16px;
}

.delivery-accounting > div {
  background: var(--surface-100);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: grid;
  min-height: 102px;
  padding: 14px 16px;
}

.delivery-accounting > span {
  color: var(--fg-muted);
  text-align: center;
}

.delivery-accounting small,
.delivery-accounting em {
  color: var(--fg-lighter);
  font-size: 10px;
  font-style: normal;
  text-transform: uppercase;
}

.delivery-accounting strong {
  color: var(--fg);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-block: 8px;
}

@media (max-width: 1320px) {
  .intake-accounting {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .intake-accounting > div:nth-child(4) {
    border-left: 0;
  }

  .intake-accounting > div:nth-child(n + 4) {
    border-top: 1px solid var(--border-muted);
  }

  .preview-workbench {
    grid-template-columns: 1fr;
  }

  .preview-facts {
    border-left: 0;
    border-top: 1px solid var(--border-muted);
  }

  .preview-facts-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .preview-facts-list > div {
    display: block;
    padding: 9px 10px;
  }

  .preview-facts-list dd {
    margin-top: 4px;
    text-align: left;
  }
}

@media (max-width: 1000px) {
  .package-mode-grid {
    grid-template-columns: 1fr;
  }

  .package-mode-card + .package-mode-card {
    border-left: 0;
    border-top: 1px solid var(--border-muted);
  }

  .preview-inspector {
    grid-template-columns: 1fr;
  }

  .preview-queue {
    max-height: 286px;
    position: static;
  }

  .preview-queue-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    max-height: 220px;
  }

  .preview-queue-item {
    border-right: 1px solid var(--border-muted);
  }
}

@media (max-width: 1100px) {
  .topbar {
    flex-wrap: wrap;
    padding-block: 10px;
  }

  .system-status {
    margin-right: 0;
  }

  .ops-grid,
  .supplier-grid,
  .control-sheet-grid,
  .inventory-split {
    grid-template-columns: 1fr;
  }

  .inventory-split .inventory-module:first-child {
    border-right: 0;
  }

  .control-pane {
    border-right: 0;
    border-bottom: 1px solid var(--border-muted);
  }

  .account-form {
    grid-template-columns: 1fr 1fr;
  }

  .context-panel {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .upload-workbench,
  .upload-workbench-form,
  .target-form {
    grid-template-columns: 1fr;
  }

  .group-coverage-panel {
    grid-template-columns: 1fr;
  }

  .group-coverage-hero {
    border-bottom: 1px solid var(--border-muted);
    border-right: 0;
  }

  .attempt-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-monitor-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-monitor-link {
    display: none;
  }

  .source-monitor-stage:nth-of-type(2),
  .source-monitor-stage:nth-of-type(4) {
    border-left: 1px solid var(--border-muted);
  }

  .source-monitor-stage:nth-of-type(n + 3) {
    border-top: 1px solid var(--border-muted);
  }

  .source-monitor-timing {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-monitor-timing > div:nth-child(3) {
    border-left: 0;
  }

  .source-monitor-timing > div:nth-child(n + 3) {
    border-top: 1px solid var(--border-muted);
  }

  .source-contract-hero {
    grid-template-columns: 1fr 1fr;
  }

  .source-contract-endpoint {
    border-left: 0;
    border-top: 1px solid var(--border-muted);
    grid-column: 1 / -1;
  }

  .intake-contract-grid,
  .inventory-boundary-grid {
    grid-template-columns: 1fr;
  }

  .inventory-boundary-card + .inventory-boundary-card {
    border-left: 0;
    border-top: 1px solid var(--border-muted);
  }

  .operations-queue-grid,
  .quality-gate-grid,
  .quality-rule-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .queue-cell:nth-child(n),
  .quality-gate-card:nth-child(n) {
    border: 1px solid var(--border-muted);
    border-radius: 0;
  }

  .quality-rule-row > div:nth-child(3) {
    border-left: 0;
  }

  .quality-rule-row > div:nth-child(n + 3) {
    border-top: 1px solid var(--border-muted);
  }
}

@media (max-width: 860px) {
  .batch-state-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .batch-state-filters button:first-child {
    grid-column: 1 / -1;
  }

  .lineage-map {
    min-width: 0;
  }

  .lineage-lane-head {
    display: none;
  }

  .lineage-bundle-summary-grid {
    gap: 10px;
    grid-template-columns: minmax(0, 1fr);
  }

  .lineage-summary-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .lineage-expand-button {
    min-width: 0;
    width: 100%;
  }

  .lineage-bundle-detail > .lineage-bundle {
    min-width: 1180px;
  }

  .exception-summary-heading,
  .retry-pool-heading,
  .selection-packages-heading,
  .retry-disposition-panel .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .retry-pool-actions {
    flex-wrap: wrap;
  }

  .retry-pool-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .retry-pool-summary > div:nth-child(odd) {
    border-left: 0;
  }

  .retry-pool-summary > div:nth-child(n + 3) {
    border-top: 1px solid var(--border-muted);
  }

  .app-frame {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    min-height: auto;
    overflow-y: visible;
    position: static;
  }

  .primary-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .primary-nav p {
    grid-column: 1 / -1;
  }

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding: 12px 18px;
  }

  .system-status {
    margin-right: 0;
  }

  .shell {
    padding: 18px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .chain-map-heading,
  .delivery-contract-banner {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .operations-queue-grid,
  .quality-gate-grid,
  .quality-rule-row {
    grid-template-columns: 1fr;
  }

  .quality-rule-row > div:nth-child(n) {
    border-left: 0;
  }

  .quality-rule-row > div + div {
    border-top: 1px solid var(--border-muted);
  }

  .source-contract-hero,
  .intake-accounting,
  .monitor-clock {
    grid-template-columns: 1fr;
  }

  .source-contract-health,
  .source-contract-endpoint,
  .intake-accounting > div:nth-child(n) {
    border-left: 0;
  }

  .intake-accounting > div:nth-child(n + 2) {
    border-top: 1px solid var(--border-muted);
  }

  .source-contract-endpoint {
    grid-column: auto;
  }

  .delivery-contract-banner dl {
    margin-left: 0;
    min-width: 0;
    width: 100%;
  }

  .delivery-accounting {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .delivery-accounting > span {
    display: none;
  }

  .processor-connection-overview {
    grid-template-columns: 1fr;
  }

  .processor-connection-heading {
    border-bottom: 1px solid var(--border-muted);
    border-right: 0;
  }

  .metrics,
  .inventory-metrics,
  .context-panel {
    grid-template-columns: 1fr;
  }

  .metric-card + .metric-card {
    border-left: 0;
    border-top: 1px solid var(--border-muted);
  }

  .batch-table,
  .batch-table tbody,
  .batch-table tr,
  .batch-table td {
    display: block;
    width: 100%;
  }

  .batch-table th:nth-child(n),
  .batch-table td:nth-child(n) {
    width: 100%;
  }

  .batch-table thead {
    display: none;
  }

  .batch-table tr {
    border-top: 1px solid var(--border-muted);
    padding: 16px 18px;
  }

  .batch-table td {
    border-top: 0;
    border-right: 0;
    padding: 8px 0;
  }

  .managed-upload-table {
    min-width: 0;
  }

  .managed-upload-table td code {
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .stage-rail {
    min-width: 0;
  }

  .actions {
    min-width: 0;
  }

  .actions button,
  .actions .secondary-link {
    width: 100%;
  }

  .account-form {
    grid-template-columns: 1fr;
  }

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

  .prefix-editor {
    grid-template-columns: 1fr;
  }

  table:not(.batch-table) {
    display: block;
    overflow-x: auto;
  }

  .account-table,
  .account-table tbody,
  .account-table tr,
  .account-table td {
    display: block;
    width: 100%;
  }

  .account-table {
    overflow: visible;
  }

  .account-table thead {
    display: none;
  }

  .account-table tr {
    border-top: 1px solid var(--border-muted);
    padding: 10px 18px;
  }

  .account-table td {
    border-right: 0;
    padding: 8px 0;
  }

  .account-table td:nth-child(n) {
    width: 100%;
  }

  .account-table td::before {
    color: var(--fg-muted);
    content: attr(data-label);
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
    text-transform: uppercase;
  }

  .account-table .account-action-row {
    max-width: 280px;
  }

  .group-summary-grid,
  .package-ledger-row {
    grid-template-columns: 1fr;
  }

  .group-summary-grid > div + div,
  .package-ledger-row > div + div {
    border-left: 0;
    border-top: 1px solid var(--border-muted);
  }

  .source-monitor-heading,
  .source-monitor-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .lineage-panel-heading,
  .lineage-scope-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .lineage-heading-status {
    align-items: start;
    justify-items: start;
  }

  .lineage-scope-bar {
    gap: 8px;
  }

  .preview-page-head {
    align-items: flex-start;
  }

  .preview-focus-head,
  .quality-timeline-head,
  .preview-layer-head {
    align-items: stretch;
    flex-direction: column;
  }

  .preview-focus-actions {
    justify-content: space-between;
  }

  .preview-facts-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preview-player-shell {
    max-height: none;
  }

  .rerun-viewer-shell {
    min-height: 420px;
  }
}

@media (max-width: 560px) {
  .batch-summary-lifecycle {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    padding-inline: 14px;
  }

  .batch-summary-accounting {
    justify-content: flex-start;
  }

  .batch-state-filters button,
  .batch-filter-status,
  .batch-accounting-details > summary {
    padding-inline: 14px;
  }

  .lineage-detail-pagination {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lineage-detail-pagination span {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .lineage-detail-pagination button {
    justify-self: stretch;
    width: 100%;
  }

  .lineage-merge-toolbar,
  .lineage-merge-dialog-head,
  .lineage-merge-dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .lineage-merge-actions,
  .lineage-merge-actions button,
  .lineage-merge-dialog-actions button {
    width: 100%;
  }

  .lineage-merge-metrics,
  .lineage-merge-notice-recovery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lineage-merge-metrics > div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--border-muted);
  }

  .lineage-merge-metrics > div:nth-child(4) {
    border-top: 1px solid var(--border-muted);
  }

  .lineage-merge-accounting {
    grid-template-columns: 1fr;
  }

  .retry-pool {
    scroll-margin-top: 170px;
  }

  .exception-summary-heading form,
  .exception-summary-heading button,
  .retry-pool-actions,
  .retry-pool-actions form,
  .retry-pool-actions button,
  .retry-source-batch-footer,
  .retry-source-batch-footer button,
  .retry-force-action,
  .retry-force-action button,
  .manual-selection-footer,
  .manual-selection-footer button {
    width: 100%;
  }

  .retry-source-batch-list > label {
    align-items: start;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .retry-source-batch-facts,
  .retry-source-batch-list > label > .table-link {
    grid-column: 2;
  }

  .retry-source-batch-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .retry-source-batch-footer button,
  .retry-source-batch-select-all {
    min-height: 44px;
    margin-right: 0;
  }

  .retry-pool-summary {
    grid-template-columns: 1fr;
  }

  .retry-pool-summary > div:nth-child(n) {
    border-left: 0;
  }

  .retry-pool-summary > div + div {
    border-top: 1px solid var(--border-muted);
  }

  .retry-contract-head,
  .retry-duration > div,
  .retry-force-action,
  .manual-selection-footer,
  .retry-linked-batch,
  .retry-linked-batch > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .package-filter-row {
    grid-template-columns: 1fr;
  }

  .retry-source-list > div {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .retry-source-list > div > span:nth-of-type(2),
  .retry-source-list small {
    grid-column: 2;
  }

  .retry-source-list > .retry-source-row-with-statuses {
    align-items: start;
    grid-template-columns: minmax(0, 1fr);
  }

  .retry-source-list > .retry-source-row-with-statuses > span:nth-of-type(2),
  .retry-source-list > .retry-source-row-with-statuses small {
    grid-column: 1;
  }

  .subsection-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .primary-nav {
    grid-template-columns: 1fr;
  }

  .somastacks-tab-unit {
    display: none;
  }

  .somastacks-tab-meta {
    display: none;
  }

  .somastacks-tab-unread {
    border-radius: 999px;
    height: 8px;
    min-width: 8px;
    padding: 0;
    width: 8px;
  }

  .somastacks-tab-unread > span {
    display: none;
  }

  .somastacks-workspace-tabs wa-tab::part(base) {
    gap: 6px;
    padding-inline: 9px;
  }

  .processor-connection-facts {
    grid-template-columns: 1fr;
  }

  .processor-connection-facts > div + div {
    border-left: 0;
    border-top: 1px solid var(--border-muted);
  }

  .somastacks-page .supply-lineage-panel .lineage-scroll,
  .somastacks-page .processing-groups-panel .somastacks-table-scroll {
    max-height: 65vh;
    min-height: 320px;
  }

  h1 {
    font-size: 19px;
  }

  .metric-card {
    min-height: 92px;
  }

  .attempt-facts {
    grid-template-columns: 1fr;
  }

  .source-monitor-rail,
  .source-monitor-timing {
    grid-template-columns: 1fr;
  }

  .source-monitor-stage:nth-of-type(n),
  .source-monitor-timing > div + div {
    border-left: 0;
    border-top: 1px solid var(--border-muted);
  }

  .lineage-panel-heading {
    padding: 14px;
  }

  .lineage-accounting > div {
    padding-inline: 14px;
  }

  .preview-legend {
    gap: 10px;
  }

  .preview-visual-column,
  .preview-facts,
  .preview-3d-panel,
  .preview-artifacts-panel {
    padding: 10px;
  }

  .preview-facts-list,
  .preview-hand-summary {
    grid-template-columns: 1fr;
  }

  .preview-transport-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .preview-view-switch {
    display: flex;
    width: 100%;
  }

  .preview-view-option {
    flex: 1;
    min-width: 0;
  }

  .keyframe-browser-head {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .keyframe-control-group,
  .keyframe-generate-button {
    margin-left: 0;
    width: 100%;
  }

  .keyframe-segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .keyframe-segmented button {
    min-width: 0;
    padding-inline: 8px;
    width: 100%;
  }

  .keyframe-viewport {
    height: 64vh;
    min-height: 360px;
  }

  .keyframe-tile time {
    justify-content: center;
    padding-inline: 3px;
  }

  .quality-track-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .quality-frame-scrubber,
  .quality-timeline-empty {
    margin-left: 44px;
    width: calc(100% - 44px);
  }

  .rerun-viewer-shell {
    min-height: 360px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .preview-loading-mark,
  .keyframe-tile-skeleton {
    animation: none;
  }

  .preview-view-option,
  .keyframe-segmented button,
  .keyframe-generate-button,
  .keyframe-tile {
    transition: none;
  }

  .quality-track rect {
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .monitor-live-dot.is-live,
  .processor-connection-state[data-state="live"] .processor-connection-dot {
    animation: none;
  }
}
