:root {
  --ink: #17211e;
  --ink-soft: #33413c;
  --muted: #68756f;
  --muted-strong: #52605a;
  --line: #d7dfdb;
  --line-strong: #bcc9c3;
  --surface: #ffffff;
  --surface-subtle: #f3f6f4;
  --surface-muted: #e9efec;
  --page: #eef2f0;
  --accent: #087f73;
  --accent-dark: #075e57;
  --accent-soft: #dcefeb;
  --pool: #2789a4;
  --pool-soft: #dcecf0;
  --amber: #a76821;
  --amber-soft: #f3e7d6;
  --danger: #b84040;
  --danger-soft: #f4dfdf;
  --success: #387a50;
  --success-soft: #deebdf;
  --charcoal: #26322e;
  --focus: #1f70b7;
  --radius: 6px;
  --shadow-low: 0 1px 2px rgb(23 33 30 / 8%);
  --shadow-float: 0 12px 36px rgb(23 33 30 / 14%);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  min-width: 320px;
  background: var(--page);
  scroll-behavior: auto;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-size: 14px;
}

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

button,
select,
input[type="checkbox"] {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button,
input,
select,
textarea {
  border-radius: var(--radius);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgb(31 112 183 / 24%);
  outline-offset: 2px;
  border-color: var(--focus);
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 9px 12px;
  border: 1px solid var(--charcoal);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 140ms ease;
}

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

.app-shell {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand-lockup,
.header-actions,
.workspace-nav,
.tab-list,
.connection-state,
.launch-actions,
.viewer-actions,
.status-legend,
.artifact-filters,
.candidate-heading {
  display: flex;
  align-items: center;
}

.brand-lockup {
  min-width: 0;
  gap: 10px;
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.brand-lockup:hover .brand-name,
.brand-lockup:focus-visible .brand-name {
  color: var(--accent-strong);
}

.brand-lockup:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.brand-mark {
  display: grid;
  width: auto;
  height: auto;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, 5px);
  grid-template-rows: repeat(3, 5px);
  gap: 2px;
  padding: 4px;
  border-radius: 4px;
  background: #edf6f1;
}

.brand-mark span {
  width: 5px;
  height: 5px;
  border-radius: 0;
  background: var(--accent);
}

.brand-mark span:nth-child(1) { grid-area: 1 / 1; }
.brand-mark span:nth-child(2) { grid-area: 1 / 2; }
.brand-mark span:nth-child(3) { grid-area: 2 / 1; }
.brand-mark span:nth-child(4) { grid-area: 3 / 1; }
.brand-mark span:nth-child(5) {
  grid-area: 3 / 2;
  background: #e65b45;
}

.brand-name {
  font-size: 16px;
  font-weight: 760;
}

.brand-divider {
  width: 1px;
  height: 18px;
  background: var(--line-strong);
}

.product-name {
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 14px;
  text-overflow: ellipsis;
}

.header-actions {
  min-width: 0;
  justify-content: flex-end;
  gap: 10px;
}

.connection-state,
.experiment-reference {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  color: var(--muted-strong);
  font-size: 12px;
  white-space: nowrap;
}

.connection-state {
  gap: 7px;
}

.connection-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--amber);
}

.connection-state.is-online .connection-dot {
  background: var(--success);
}

.connection-state.is-offline .connection-dot {
  background: var(--muted);
}

.experiment-reference {
  display: flex;
  max-width: 220px;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-nav {
  position: sticky;
  top: 64px;
  z-index: 40;
  min-height: 48px;
  padding: 0 28px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 96%);
  scrollbar-width: none;
}

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

.tab-list {
  min-width: max-content;
  align-self: stretch;
  gap: 4px;
}

.tab-button {
  position: relative;
  display: flex;
  min-width: 112px;
  height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 680;
}

.tab-button::after {
  position: absolute;
  right: 12px;
  bottom: -1px;
  left: 12px;
  height: 3px;
  background: transparent;
  content: "";
}

.tab-button:hover {
  color: var(--ink);
  background: var(--surface-subtle);
}

.tab-button.is-active {
  color: var(--accent-dark);
}

.tab-button.is-active::after {
  background: var(--accent);
}

.tab-index {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.tab-button.is-active .tab-index {
  color: var(--accent);
}

.tab-count {
  min-width: 20px;
  height: 20px;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-muted);
  color: var(--muted-strong);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 18px;
  text-align: center;
}

.workspace {
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: 28px;
}

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

.panel-heading {
  display: flex;
  min-height: 86px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-strong);
}

.panel-heading-compact {
  min-height: 72px;
  align-items: center;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-size: 25px;
  font-weight: 735;
}

h2 {
  font-size: 17px;
  font-weight: 720;
}

h3 {
  font-size: 15px;
  font-weight: 720;
}

.run-equation {
  display: grid;
  min-width: 470px;
  grid-template-columns: auto 18px auto 18px auto 18px auto;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.run-equation > div {
  min-width: 72px;
}

.run-equation > span {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.run-equation dt,
.metric-strip dt,
.inspector-data dt,
.artifact-details dt {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

.run-equation dd {
  margin: 1px 0 0;
  color: var(--ink);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

.run-equation .equation-total {
  min-width: 94px;
  padding-left: 12px;
  border-left: 2px solid var(--accent);
}

.run-equation .equation-total dd {
  color: var(--accent-dark);
}

.configuration-block {
  padding: 26px 0 8px;
  border-bottom: 1px solid var(--line);
}

.setup-mode-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  margin-top: 22px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.setup-mode-button {
  min-height: 38px;
  padding: 7px 14px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 720;
}

.setup-mode-button:hover {
  color: var(--ink);
}

.setup-mode-button.is-active {
  background: var(--surface);
  color: var(--accent-dark);
  box-shadow: var(--shadow-low);
}

.setup-mode-button:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.setup-mode-button small {
  display: block;
  margin-top: 1px;
  color: var(--accent-dark);
  font-size: 8px;
  line-height: 1;
  text-transform: uppercase;
}

.setup-lane {
  padding-bottom: 24px;
}

.reference-fields {
  display: grid;
  grid-template-columns: minmax(180px, 0.85fr) minmax(145px, 0.62fr) minmax(220px, 1fr) minmax(240px, 1.1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-low);
}

.reference-fields .field-cell + .field-cell {
  border-left: 1px solid var(--line);
}

.reference-fields .field-cell,
.byoh-fields .field-cell {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 78px;
}

.field-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
  text-transform: uppercase;
}

.credential-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.byoh-fields {
  display: grid;
  grid-template-columns: minmax(240px, 0.55fr) minmax(0, 1.45fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-low);
}

.pairing-state {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  border-left: 1px solid var(--line);
}

.pairing-state > div {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
  padding: 12px 14px;
}

.pairing-state > div + div {
  border-left: 1px solid var(--line);
}

.pairing-state strong {
  overflow: hidden;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#pairingCode {
  color: var(--accent-dark);
  font: 760 16px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.public-submission-notice {
  display: grid;
  grid-template-columns: minmax(120px, 0.22fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px solid #d6aa73;
  border-radius: var(--radius);
  background: #fff9ed;
}

.public-submission-notice strong {
  color: #7b481c;
  font-size: 12px;
}

.public-submission-notice p,
.account-claim-note {
  margin: 0;
  color: var(--muted-strong);
  font-size: 11px;
  line-height: 1.55;
}

.account-claim-note {
  margin-top: 11px;
}

.account-claim-note strong {
  color: var(--ink);
}

.agent-handoff {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--charcoal);
  color: #edf6f2;
}

.agent-handoff-heading {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-bottom: 1px solid rgb(255 255 255 / 14%);
}

.agent-handoff-heading > div:first-child {
  display: grid;
  gap: 4px;
}

.agent-handoff .field-label {
  color: #9bb0a7;
}

.agent-handoff-actions {
  display: flex;
  gap: 7px;
}

.agent-handoff-actions .button {
  border-color: rgb(255 255 255 / 24%);
  background: rgb(255 255 255 / 7%);
  color: #edf6f2;
}

.agent-handoff pre {
  min-height: 70px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: #c8e8de;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.topic-pack {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-low);
  list-style: none;
}

.topic-pack li {
  display: grid;
  min-width: 0;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
}

.topic-pack li + li {
  border-left: 1px solid var(--line);
}

.topic-pack .topic-hidden-summary {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  border-left: 0;
  background: var(--surface-subtle);
}

.topic-pack li > span {
  color: var(--accent-dark);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

.topic-pack li > div {
  min-width: 0;
}

.topic-pack strong {
  display: block;
  font-size: 12px;
}

.topic-pack p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.block-heading,
.section-toolbar,
.inventory-heading,
.viewer-toolbar,
.ballot-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.block-heading {
  margin-bottom: 14px;
}

.block-heading p,
.section-toolbar p,
.workspace-empty p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.block-count,
.blind-badge,
.status-badge {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.model-table,
.topic-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-low);
}

.model-table-header,
.model-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(150px, 0.9fr) minmax(220px, 1.25fr) minmax(220px, 1.25fr);
}

.topic-table-header,
.topic-row {
  display: grid;
  grid-template-columns: 52px minmax(230px, 0.85fr) minmax(400px, 2fr);
}

.model-table-header,
.topic-table-header {
  min-height: 36px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 10px;
  font-weight: 740;
  text-transform: uppercase;
}

.model-table-header span,
.topic-table-header span {
  padding: 0 13px;
}

.model-row,
.topic-row {
  min-height: 72px;
  align-items: stretch;
}

.model-row + .model-row,
.topic-row + .topic-row {
  border-top: 1px solid var(--line);
}

.model-row > *,
.topic-row > * {
  min-width: 0;
  border-right: 1px solid var(--line);
}

.model-row > *:last-child,
.topic-row > *:last-child {
  border-right: 0;
}

.slot-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
}

.slot-cell > span:last-child {
  display: grid;
  gap: 2px;
}

.slot-cell strong {
  font-size: 13px;
}

.slot-cell small {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.slot-badge {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 780;
}

.slot-a {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.slot-b {
  background: var(--pool-soft);
  color: #1e667a;
}

.slot-c {
  background: var(--amber-soft);
  color: #805018;
}

.field-cell {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  margin: 0;
  padding: 11px 12px;
}

.field-cell input,
.field-cell select,
.field-cell textarea,
.artifact-filters select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field-cell input,
.field-cell select,
.artifact-filters select {
  height: 39px;
  padding: 0 11px;
}

.field-cell select,
.artifact-filters select {
  padding-right: 30px;
}

.field-cell textarea {
  min-height: 50px;
  max-height: 120px;
  padding: 8px 11px;
  line-height: 1.35;
  resize: vertical;
}

.field-cell input:hover,
.field-cell select:hover,
.field-cell textarea:hover,
.artifact-filters select:hover {
  border-color: #8d9d95;
}

.field-cell input::placeholder {
  color: #8b9792;
}

.field-cell.has-error input,
.field-cell.has-error select,
.field-cell.has-error textarea {
  border-color: var(--danger);
  background: #fffafa;
}

.mobile-field-label {
  display: none;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.topic-index {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

.topics-block {
  padding-bottom: 26px;
}

.launch-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, auto) auto;
  align-items: center;
  gap: 24px;
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 96%);
  box-shadow: var(--shadow-float);
}

.variant-control {
  display: flex;
  align-items: center;
  gap: 14px;
}

.control-label {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 680;
}

.stepper {
  display: grid;
  width: 122px;
  height: 38px;
  grid-template-columns: 38px 46px 38px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.stepper button,
.stepper input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
}

.stepper button {
  color: var(--ink-soft);
  font-size: 18px;
}

.stepper button:hover:not(:disabled) {
  background: var(--surface-muted);
}

.stepper input {
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  appearance: textfield;
}

.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.launch-summary {
  display: grid;
  justify-items: end;
  line-height: 1.3;
}

.launch-summary strong {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.launch-summary span {
  color: var(--muted);
  font-size: 11px;
}

.launch-actions {
  gap: 8px;
}

.button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.header-actions .button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.button:active:not(:disabled),
.vote-button:active:not(:disabled) {
  transform: translateY(1px);
}

.button-primary {
  border-color: var(--charcoal);
  background: var(--charcoal);
  color: #ffffff;
}

.button-primary:hover:not(:disabled) {
  border-color: #111916;
  background: #111916;
}

.button-secondary {
  border-color: var(--accent);
  background: var(--surface);
  color: var(--accent-dark);
}

.button-secondary:hover:not(:disabled) {
  background: var(--accent-soft);
}

.button-quiet {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
}

.button-quiet:hover:not(:disabled) {
  border-color: #91a098;
  background: var(--surface-subtle);
}

.agent-handoff-actions .button.button-quiet:hover:not(:disabled) {
  border-color: #91a89e;
  background: #34453e;
  color: #ffffff;
}

.button-small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.form-error {
  margin: 12px 0 0;
  padding: 9px 11px;
  border-left: 3px solid var(--danger);
  background: var(--danger-soft);
  color: #7d2828;
  font-size: 12px;
}

.status-badge {
  min-width: 88px;
  text-align: center;
}

.status-idle {
  background: var(--surface-subtle);
}

.status-queued,
.status-running {
  border-color: #d1b17d;
  background: var(--amber-soft);
  color: #7a4a14;
}

.status-completed,
.status-succeeded,
.status-complete {
  border-color: #a9c8af;
  background: var(--success-soft);
  color: #2b6540;
}

.status-failed,
.status-error {
  border-color: #ddb1b1;
  background: var(--danger-soft);
  color: #8d2e2e;
}

.submission-receipt {
  display: grid;
  grid-template-columns: .8fr 1.15fr 1.15fr 1.7fr .9fr;
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
}

.submission-receipt > div {
  min-width: 0;
  padding: 12px 20px;
  border-right: 1px solid var(--line);
}

.submission-receipt > div:last-child {
  border-right: 0;
}

.submission-receipt dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
  text-transform: uppercase;
}

.submission-receipt dd {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submission-receipt .model-receipt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 10px;
}

.model-receipt dt,
.model-receipt dd {
  min-width: 0;
}

.model-receipt dd {
  display: flex;
  align-items: center;
  gap: 7px;
}

.model-receipt dd > :first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-correction-badge {
  flex: 0 0 auto;
  border: 1px solid #a7c8b0;
  border-radius: 3px;
  padding: 2px 5px;
  background: var(--success-soft);
  color: #2b6540;
  font-size: 9px;
  font-weight: 760;
  text-transform: uppercase;
}

.model-correction-button {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  min-height: 28px;
  border: 1px solid var(--line-strong);
  padding: 4px 8px;
  background: var(--surface);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 730;
}

.model-correction-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.model-correction-dialog {
  width: min(520px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-float);
}

.model-correction-dialog::backdrop {
  background: rgb(20 30 26 / 52%);
}

.model-correction-dialog form {
  display: grid;
}

.model-correction-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 20px 22px;
}

.dialog-close {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  padding: 0;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 22px;
  line-height: 1;
}

.dialog-close:hover {
  background: var(--surface-subtle);
}

.model-correction-fields {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: 14px;
  padding: 22px;
}

.model-correction-fields label {
  display: grid;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 700;
}

.model-correction-fields label:last-child {
  grid-column: 1 / -1;
}

.model-correction-fields small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
}

.model-correction-fields input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  padding: 8px 10px;
  background: var(--surface);
}

.model-correction-error {
  margin: 0 22px;
}

.model-correction-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 16px 22px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(105px, 0.7fr)) minmax(260px, 1.7fr);
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.metric-strip > div {
  min-width: 0;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.metric-strip > div:last-child {
  border-right: 0;
}

.metric-strip dd {
  margin: 2px 0 0;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

.metric-strip .metric-progress dd {
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.progress-track {
  display: block;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--surface-muted);
}

.progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 220ms ease;
}

.progress-section {
  padding: 24px 0 0;
}

.section-toolbar {
  margin-bottom: 12px;
}

.status-legend {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted-strong);
  font-size: 11px;
}

.status-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-legend i {
  width: 9px;
  height: 9px;
  border: 1px solid transparent;
  border-radius: 2px;
}

.legend-pending {
  border-color: var(--line-strong) !important;
  background: var(--surface-muted);
}

.legend-running {
  border-color: #d1a25f !important;
  background: var(--amber-soft);
}

.legend-complete {
  border-color: #78a883 !important;
  background: var(--success);
}

.legend-error {
  border-color: var(--danger) !important;
  background: var(--danger-soft);
}

.progress-grid-shell {
  min-height: 350px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-low);
}

.progress-grid {
  display: grid;
  min-width: 980px;
  grid-template-columns: 150px repeat(4, minmax(190px, 1fr));
}

.progress-grid-row {
  display: contents;
}

.grid-corner,
.grid-topic-header,
.grid-model-header,
.run-cell {
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.grid-topic-header:nth-child(5),
.run-cell:nth-child(5n) {
  border-right: 0;
}

.grid-corner,
.grid-topic-header {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 82px;
  background: var(--surface-subtle);
}

.grid-corner {
  left: 0;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  padding: 13px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 740;
  text-transform: uppercase;
}

.grid-topic-header {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px 14px;
}

.grid-topic-header span {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-transform: uppercase;
}

.grid-topic-header strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 12px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.grid-model-header {
  position: sticky;
  left: 0;
  z-index: 3;
  display: flex;
  min-height: 86px;
  align-items: center;
  gap: 9px;
  padding: 13px;
  background: var(--surface);
}

.grid-model-header > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.grid-model-header strong,
.grid-model-header small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grid-model-header strong {
  font-size: 12px;
}

.grid-model-header small {
  color: var(--muted);
  font-size: 10px;
}

.run-cell {
  display: grid;
  min-height: 86px;
  align-content: center;
  padding: 12px;
  background: var(--surface);
}

.run-tile-grid {
  display: grid;
  grid-template-columns: repeat(var(--variant-count, 4), minmax(30px, 1fr));
  gap: 7px;
}

.run-tile {
  position: relative;
  display: grid;
  aspect-ratio: 1;
  min-height: 34px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--muted-strong);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 780;
}

.run-tile:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.run-tile.is-running {
  border-color: #c99750;
  background: var(--amber-soft);
  color: #754815;
  animation: run-pulse 1.2s ease-in-out infinite;
}

.run-tile.is-complete,
.run-tile.is-completed,
.run-tile.is-succeeded {
  border-color: var(--success);
  background: var(--success);
  color: #ffffff;
}

.run-tile.is-error,
.run-tile.is-failed {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: #8d2d2d;
}

.run-tile.is-selected {
  outline: 3px solid rgb(8 127 115 / 22%);
  outline-offset: 2px;
}

@keyframes run-pulse {
  0%,
  100% {
    background: var(--amber-soft);
  }
  50% {
    background: #ead3b1;
  }
}

.run-inspector {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(480px, 2fr);
  align-items: center;
  gap: 26px;
  margin-top: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.inspector-title h2 {
  font-size: 15px;
}

.inspector-data {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  margin: 0;
}

.inspector-data > div {
  padding: 2px 16px;
  border-left: 1px solid var(--line);
}

.inspector-data dd,
.artifact-details dd {
  margin: 3px 0 0;
  font-size: 13px;
  font-weight: 670;
}

.inspector-error {
  grid-column: 1 / -1;
  margin: 0;
  padding: 9px 11px;
  border-left: 3px solid var(--danger);
  background: var(--danger-soft);
  color: #7d2828;
  font-size: 12px;
}

.workspace-empty {
  display: grid;
  min-height: 220px;
  place-content: center;
  justify-items: center;
  padding: 28px;
  color: var(--muted-strong);
  text-align: center;
}

.compact-empty {
  min-height: 348px;
}

.empty-mark {
  position: relative;
  display: block;
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-subtle);
}

.empty-mark::before,
.empty-mark::after {
  position: absolute;
  background: var(--line-strong);
  content: "";
}

.empty-mark::before {
  top: 10px;
  right: 10px;
  bottom: 10px;
  width: 1px;
}

.empty-mark::after {
  right: 10px;
  bottom: 10px;
  left: 10px;
  height: 1px;
}

.artifact-filters {
  gap: 8px;
}

.artifact-filters label {
  display: grid;
  grid-template-columns: auto minmax(130px, 180px);
  align-items: center;
  gap: 7px;
}

.artifact-filters label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.artifact-filters select {
  height: 34px;
  padding: 0 28px 0 9px;
  font-size: 12px;
}

.artifact-browser {
  display: grid;
  min-height: 650px;
  grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-low);
}

.artifact-inventory {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: var(--surface-subtle);
}

.inventory-heading {
  min-height: 57px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.inventory-heading h2 {
  font-size: 14px;
}

.inventory-heading span {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.artifact-list {
  max-height: 680px;
  overflow-y: auto;
}

.artifact-list-item {
  display: grid;
  width: 100%;
  min-height: 72px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.artifact-list-item:hover {
  background: var(--surface-muted);
}

.artifact-list-item.is-active {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.artifact-thumbnail {
  position: relative;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
}

.artifact-thumbnail::before,
.artifact-thumbnail::after {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  content: "";
}

.artifact-thumbnail::before {
  top: 7px;
  left: 7px;
  background: var(--pool);
  box-shadow: 10px 10px 0 var(--amber);
}

.artifact-thumbnail::after {
  top: 7px;
  right: 6px;
  background: var(--success);
}

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

.artifact-list-copy strong,
.artifact-list-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-list-copy strong {
  font-size: 12px;
}

.artifact-list-copy span {
  color: var(--muted);
  font-size: 10px;
}

.artifact-variant {
  color: var(--muted-strong);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

.viewer-panel {
  display: grid;
  min-width: 0;
  grid-template-rows: auto minmax(480px, 1fr) auto auto;
}

.viewer-toolbar {
  min-height: 64px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.viewer-kicker {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
  text-transform: uppercase;
}

.viewer-toolbar h2 {
  max-width: 600px;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-actions {
  gap: 9px;
}

.toggle-control {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}

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

.toggle-control > span {
  position: relative;
  display: block;
  width: 30px;
  height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.toggle-control > span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--muted-strong);
  content: "";
  transition: transform 140ms ease, background 140ms ease;
}

.toggle-control input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.toggle-control input:checked + span::after {
  background: var(--accent);
  transform: translateX(12px);
}

.toggle-control input:focus-visible + span {
  outline: 3px solid rgb(31 112 183 / 24%);
  outline-offset: 2px;
}

.viewer-stage,
.ballot-viewer {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #dfe8e4;
  touch-action: none;
}

.viewer-stage {
  min-height: 480px;
}

.replay-controls {
  display: grid;
  grid-template-columns: auto auto minmax(120px, 1fr) 42px auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.replay-controls output {
  color: var(--muted-strong);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.replay-timeline {
  display: flex;
  min-width: 0;
}

.replay-timeline input {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.replay-timeline input:disabled {
  cursor: default;
}

.replay-speed {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
}

.replay-speed select {
  width: 66px;
  min-height: 32px;
  padding: 5px 8px;
  font-size: 11px;
}

.viewer-stage canvas,
.ballot-viewer canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  cursor: grab;
}

.viewer-stage canvas:active,
.ballot-viewer canvas:active {
  cursor: grabbing;
}

.viewer-empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  color: #52615a;
  pointer-events: none;
}

.voxel-placeholder {
  position: relative;
  display: block;
  width: 80px;
  height: 58px;
  margin-bottom: 12px;
}

.voxel-placeholder i {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1px solid rgb(23 33 30 / 18%);
  border-radius: 3px;
  background: rgb(255 255 255 / 60%);
}

.voxel-placeholder i:nth-child(1) {
  bottom: 4px;
  left: 3px;
}

.voxel-placeholder i:nth-child(2) {
  bottom: 4px;
  left: 27px;
  background: rgb(39 137 164 / 32%);
}

.voxel-placeholder i:nth-child(3) {
  right: 3px;
  bottom: 4px;
}

.voxel-placeholder i:nth-child(4) {
  bottom: 28px;
  left: 27px;
  background: rgb(56 122 80 / 30%);
}

.voxel-placeholder i:nth-child(5) {
  right: 3px;
  bottom: 28px;
  background: rgb(167 104 33 / 28%);
}

.artifact-details {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr);
  gap: 20px;
  padding: 13px 15px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.artifact-details dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  margin: 0;
}

.artifact-details dl > div {
  min-width: 0;
  padding-right: 12px;
}

.artifact-details dd {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-block {
  min-width: 0;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.palette-block > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.palette-swatches {
  display: flex;
  min-height: 22px;
  align-items: center;
  gap: 5px;
  overflow: hidden;
}

.palette-swatch {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  border: 1px solid rgb(23 33 30 / 22%);
  border-radius: 3px;
}

.review-stat {
  display: grid;
  justify-items: end;
}

.review-stat span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
  text-transform: uppercase;
}

.review-stat strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.review-empty {
  min-height: 520px;
  border-bottom: 1px solid var(--line);
}

.ballot-workspace {
  padding-top: 22px;
}

.ballot-heading {
  min-height: 58px;
  align-items: flex-start;
  padding-bottom: 15px;
}

.ballot-heading h2 {
  max-width: 1000px;
  font-size: 17px;
  font-weight: 670;
}

.blind-badge {
  border-color: var(--line-strong);
  background: var(--surface-subtle);
}

.candidate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.candidate-panel {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-low);
}

.candidate-heading {
  min-height: 50px;
  justify-content: space-between;
  padding: 8px 13px;
  border-bottom: 1px solid var(--line);
}

.candidate-heading > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.candidate-heading h3 {
  color: var(--ink);
}

.ballot-viewer {
  height: clamp(300px, 45vh, 500px);
}

.vote-bar {
  display: grid;
  grid-template-columns: 1fr 0.62fr 1fr 0.62fr;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-low);
}

.vote-button {
  min-height: 45px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 720;
}

.vote-left,
.vote-right {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.vote-left:hover:not(:disabled),
.vote-right:hover:not(:disabled) {
  background: var(--accent-soft);
}

.vote-tie:hover:not(:disabled),
.vote-skip:hover:not(:disabled) {
  background: var(--surface-muted);
}

.vote-status {
  min-height: 22px;
  margin: 8px 0 0;
  color: var(--muted-strong);
  font-size: 12px;
  text-align: center;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: grid;
  width: min(360px, calc(100vw - 36px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  color: var(--ink-soft);
  font-size: 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  border-left-color: var(--danger);
}

@media (max-width: 1120px) {
  .app-header {
    padding-right: 20px;
    padding-left: 20px;
  }

  .workspace-nav {
    padding-right: 20px;
    padding-left: 20px;
  }

  .workspace {
    padding: 24px 20px;
  }

  .connection-state {
    display: none;
  }

  .model-table-header,
  .model-row {
    grid-template-columns: 150px 145px minmax(190px, 1fr) minmax(190px, 1fr);
  }

  .reference-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reference-fields .field-cell:nth-child(3) {
    border-left: 0;
  }

  .reference-fields .field-cell:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .topic-pack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topic-pack li:nth-child(3) {
    border-left: 0;
  }

  .topic-pack li:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .launch-bar {
    grid-template-columns: 1fr auto;
  }

  .launch-summary {
    display: none;
  }

  .artifact-browser {
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  }

  .artifact-details {
    grid-template-columns: 1fr;
  }

  .palette-block {
    padding-top: 10px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 900px) {
  .app-header {
    min-height: 58px;
  }

  .workspace-nav {
    top: 58px;
  }

  .experiment-reference {
    display: none;
  }

  .panel-heading {
    display: grid;
    gap: 18px;
  }

  .panel-heading-compact {
    display: flex;
  }

  .run-equation {
    width: 100%;
    min-width: 0;
  }

  .byoh-fields {
    grid-template-columns: 1fr;
  }

  .pairing-state {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .model-table-header,
  .topic-table-header {
    display: none;
  }

  .model-table,
  .topic-table {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .model-row {
    grid-template-columns: minmax(130px, 0.8fr) minmax(150px, 1fr) minmax(220px, 1.4fr);
    margin-bottom: 8px;
    overflow: hidden;
    border: 1px solid var(--line) !important;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-low);
  }

  .model-row .slot-cell {
    grid-row: span 2;
  }

  .model-row .key-field {
    grid-column: 2 / -1;
    border-top: 1px solid var(--line);
  }

  .model-row > :nth-child(3) {
    border-right: 0;
  }

  .mobile-field-label {
    display: block;
    margin-bottom: 5px;
  }

  .field-cell {
    display: grid;
    align-content: center;
  }

  .topic-row {
    grid-template-columns: 48px minmax(170px, 0.8fr) minmax(290px, 1.5fr);
    margin-bottom: 8px;
    overflow: hidden;
    border: 1px solid var(--line) !important;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-low);
  }

  .metric-strip {
    grid-template-columns: repeat(4, 1fr);
  }

  .metric-strip .metric-progress {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }

  .run-inspector {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .inspector-data > div:first-child {
    border-left: 0;
  }

  .artifact-browser {
    grid-template-columns: 1fr;
  }

  .artifact-inventory {
    order: 2;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .artifact-list {
    display: grid;
    max-height: 330px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .artifact-list-item:nth-child(odd) {
    border-right: 1px solid var(--line);
  }

  .viewer-panel {
    order: 1;
  }

  .viewer-stage {
    min-height: 430px;
  }
}

@media (max-width: 680px) {
  .app-header {
    gap: 12px;
    padding: 0 14px;
  }

  .brand-divider,
  .product-name {
    display: none;
  }

  .brand-name {
    font-size: 14px;
  }

  .header-actions {
    gap: 6px;
  }

  .button-small {
    padding-right: 8px;
    padding-left: 8px;
  }

  .workspace-nav {
    padding: 0 8px;
  }

  .tab-button {
    min-width: 98px;
    padding: 0 9px;
  }

  .tab-index {
    display: none;
  }

  .workspace {
    padding: 20px 14px;
  }

  .panel-heading {
    min-height: 0;
    padding-bottom: 18px;
  }

  .panel-heading-compact {
    align-items: flex-start;
  }

  h1 {
    font-size: 22px;
  }

  .run-equation {
    grid-template-columns: 1fr 12px 1fr 12px 1fr 12px 1.2fr;
    gap: 3px;
  }

  .run-equation > div {
    min-width: 0;
  }

  .run-equation dt {
    font-size: 9px;
  }

  .run-equation dd {
    font-size: 18px;
  }

  .run-equation .equation-total {
    min-width: 0;
    padding-left: 7px;
  }

  .setup-mode-switch {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .setup-mode-button {
    min-width: 0;
    padding-right: 8px;
    padding-left: 8px;
  }

  .reference-fields,
  .topic-pack {
    grid-template-columns: 1fr;
  }

  .reference-fields .field-cell + .field-cell,
  .reference-fields .field-cell:nth-child(3),
  .topic-pack li + li,
  .topic-pack li:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .pairing-state {
    grid-template-columns: 1fr;
  }

  .public-submission-notice {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .pairing-state > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .agent-handoff-heading {
    display: grid;
  }

  .agent-handoff-actions {
    width: 100%;
  }

  .agent-handoff-actions .button {
    flex: 1;
  }

  .model-row {
    grid-template-columns: 1fr 1fr;
  }

  .model-row .slot-cell {
    grid-column: 1 / -1;
    grid-row: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .model-row > :nth-child(3) {
    border-right: 0;
  }

  .model-row .key-field {
    grid-column: 1 / -1;
  }

  .topic-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .topic-row .topic-index {
    grid-row: span 2;
  }

  .topic-row > :nth-child(2) {
    border-right: 0;
  }

  .topic-row > :last-child {
    grid-column: 2;
    border-top: 1px solid var(--line);
  }

  .launch-bar {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 18px;
  }

  .variant-control {
    justify-content: space-between;
  }

  .launch-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .launch-actions .button {
    min-width: 0;
    white-space: normal;
  }

  .metric-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .submission-receipt {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .submission-receipt > div:nth-child(even) {
    border-right: 0;
  }

  .submission-receipt > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .submission-receipt > div:last-child {
    grid-column: 1 / -1;
  }

  .model-correction-fields {
    grid-template-columns: 1fr;
  }

  .model-correction-fields label:last-child {
    grid-column: auto;
  }

  .metric-strip > div {
    padding: 13px 14px;
  }

  .metric-strip > div:nth-child(2) {
    border-right: 0;
  }

  .metric-strip > div:nth-child(3),
  .metric-strip > div:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .metric-strip .metric-progress {
    grid-column: 1 / -1;
  }

  .section-toolbar {
    display: grid;
  }

  .status-legend {
    justify-content: flex-start;
  }

  .inspector-data {
    grid-template-columns: repeat(2, 1fr);
  }

  .inspector-data > div {
    padding: 7px 10px;
    border-left: 1px solid var(--line);
  }

  .inspector-data > div:nth-child(odd) {
    border-left: 0;
  }

  .artifact-filters {
    display: grid;
    width: 100%;
  }

  .artifact-filters label {
    grid-template-columns: 50px 1fr;
  }

  .artifact-browser {
    margin-top: 14px;
  }

  .viewer-toolbar {
    display: grid;
    gap: 10px;
  }

  .viewer-actions {
    justify-content: space-between;
  }

  .viewer-stage {
    min-height: 360px;
  }

  .artifact-details dl {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 0;
  }

  .artifact-list {
    display: block;
  }

  .artifact-list-item:nth-child(odd) {
    border-right: 0;
  }

  .candidate-grid {
    grid-template-columns: 1fr;
  }

  .ballot-viewer {
    height: 300px;
  }

  .vote-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Copy-first connector */
.connector-toolbar .experiment-reference,
.connector-toolbar #judgeLink,
.connector-toolbar #downloadDatasetButton,
body:not(.connector-results) .workspace-nav,
#setupPanel > .panel-heading,
.experience-choice,
.setup-mode-switch,
#referenceSetup,
#byohSetup > .block-heading,
#byohSetup > .byoh-fields,
#byohSetup > .town-composer,
#byohSetup > .public-submission-notice,
#benchmarkTopicsBlock,
.launch-bar {
  display: none !important;
}

.simple-connect {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 28px 48px;
  max-width: 1080px;
  margin: 26px auto 0;
  padding: 34px 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow-low);
}

.simple-connect-copy h1 {
  max-width: 720px;
  margin: 8px 0 12px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.02;
}

.simple-connect-lede {
  max-width: 680px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.6;
}

.simple-connect-steps {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.simple-connect-steps li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.simple-connect-steps li > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--charcoal);
  color: #fff;
  font-weight: 800;
}

.simple-connect-steps p {
  margin: 3px 0 0;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.45;
}

.simple-connect-details {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr);
  gap: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.public-theme-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.public-theme-list li {
  border: 1px solid var(--line-strong);
  padding: 6px 9px;
  background: var(--surface-subtle);
  font-size: 11px;
  font-weight: 720;
}

.simple-connect-details > p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

#byohSetup {
  max-width: 1080px;
  margin: 14px auto 40px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#agentHandoff {
  margin-top: 0;
}

#copyAgentPromptButton {
  min-width: 150px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.result-actions[hidden] {
  display: none;
}

.completion-dock {
  display: grid;
  grid-template-columns: minmax(220px, .75fr) minmax(0, 1.25fr);
  gap: 10px 28px;
  max-width: 1180px;
  margin: 18px auto 0;
  padding: 18px 24px;
  border-block: 1px solid var(--line);
  background: var(--surface);
}

.completion-dock[hidden] {
  display: none;
}

.completion-dock-heading {
  display: grid;
  align-content: center;
  gap: 4px;
}

.completion-dock-heading strong {
  font-size: 16px;
}

.completion-dock .result-actions {
  align-items: center;
  justify-content: flex-end;
  margin-top: 0;
}

.completion-dock .claim-cta {
  grid-column: 1 / -1;
  margin-top: 8px;
}

@media (max-width: 760px) {
  .replay-controls {
    grid-template-columns: auto auto minmax(80px, 1fr) 38px;
  }

  .replay-speed {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .completion-dock {
    grid-template-columns: 1fr;
    margin-top: 10px;
    padding: 16px 20px;
  }

  .completion-dock .result-actions {
    justify-content: flex-start;
  }

  .simple-connect {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 12px;
    padding: 24px 18px;
  }

  .simple-connect-details {
    grid-template-columns: 1fr;
  }

  .agent-handoff-heading {
    align-items: stretch;
    flex-direction: column;
  }

  #copyAgentPromptButton {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .brand-mark {
    width: auto;
    height: auto;
  }

  .header-actions .button {
    max-width: 108px;
    white-space: normal;
  }

  .tab-button {
    min-width: 91px;
  }

  .tab-count {
    display: none;
  }

  .block-heading {
    align-items: flex-start;
  }

  .field-cell {
    padding: 9px;
  }

  .launch-actions {
    grid-template-columns: 1fr;
  }

  .viewer-stage {
    min-height: 320px;
  }

  .ballot-viewer {
    height: 270px;
  }

  .vote-bar {
    padding: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* Post-completion claim call-to-action */
.claim-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 14px 18px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--accent-soft);
}

.claim-cta strong {
  display: block;
  color: var(--ink);
}

.claim-cta span {
  color: var(--muted-strong);
  font-size: 14px;
}

.claim-cta .button {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent);
}

.claim-cta .button:hover,
.claim-cta .button:focus-visible {
  background: var(--accent-dark);
}

.account-claim-note a {
  color: var(--accent);
  font-weight: 600;
}

.result-claim-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: clamp(28px, 6vw, 88px);
  align-items: start;
  margin-top: 32px;
  padding: 32px 0 8px;
  border-top: 1px solid var(--line-strong);
}

.result-claim-copy {
  max-width: 650px;
}

.result-claim-copy h2 {
  margin: 4px 0 10px;
  font-size: 32px;
  line-height: 1.1;
}

.result-claim-copy > p:last-of-type {
  max-width: 600px;
  margin: 0;
  color: var(--muted-strong);
  font-size: 16px;
}

.claim-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 20px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.claim-benefits span::before {
  margin-right: 7px;
  color: var(--success);
  content: "\2713";
}

.result-claim-access {
  min-width: 0;
}

.claim-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.claim-mode {
  min-height: 42px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.claim-mode.is-active {
  border-bottom-color: var(--accent);
  color: var(--ink);
}

.result-claim-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.result-claim-form label {
  display: grid;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.result-claim-form input[type="text"],
.result-claim-form input[type="email"],
.result-claim-form input[type="password"] {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.result-claim-form .claim-terms,
.result-claim-form .result-claim-bot,
.result-claim-form .button {
  grid-column: 1 / -1;
}

.result-claim-bot {
  min-height: 65px;
  overflow: hidden;
}

.result-claim-form .claim-terms {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-weight: 500;
}

.claim-terms input {
  margin: 3px 0 0;
}

.claim-terms a {
  color: var(--accent-dark);
}

.result-claim-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted-strong);
  font-size: 13px;
}

.result-claim-message.is-error {
  color: var(--danger);
}

.result-claim-success {
  align-self: center;
}

.result-claim-success strong {
  display: block;
  margin-bottom: 4px;
  color: var(--success);
  font-size: 20px;
}

.result-claim-success p {
  margin: 0 0 16px;
  color: var(--muted-strong);
}

.result-claim-success > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 800px) {
  .result-claim-band {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 520px) {
  .result-claim-copy h2 {
    font-size: 28px;
  }
}

/* Town / benchmark path selection */
.experience-choice {
  padding: 24px 0 22px;
  border-bottom: 1px solid var(--line);
}

.experience-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.experience-button {
  display: grid;
  min-height: 72px;
  align-content: center;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted-strong);
  text-align: left;
}

.experience-button:hover {
  border-color: #8d9d95;
  color: var(--ink);
}

.experience-button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  box-shadow: inset 3px 0 0 var(--accent);
}

.experience-button strong {
  color: inherit;
  font-size: 14px;
}

.experience-button span {
  font-size: 11px;
}

.town-composer {
  margin-top: 14px;
}

.town-new-lot {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(340px, 1.25fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-low);
}

.district-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 14px;
  border: 0;
  border-right: 1px solid var(--line);
}

.district-picker legend {
  grid-column: 1 / -1;
  width: 100%;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
  text-transform: uppercase;
}

.district-picker label {
  min-width: 0;
  cursor: pointer;
}

.district-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.district-option {
  display: grid;
  min-height: 62px;
  grid-template-columns: 12px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  gap: 1px 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
}

.district-picker input:checked + .district-option {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.district-picker input:focus-visible + .district-option {
  outline: 3px solid rgb(31 112 183 / 24%);
  outline-offset: 2px;
}

.district-option b,
.district-option small {
  min-width: 0;
}

.district-option b {
  font-size: 12px;
}

.district-option small {
  grid-column: 2;
  color: var(--muted);
  font-size: 10px;
}

.district-swatch {
  width: 10px;
  height: 10px;
  grid-row: 1 / 3;
  align-self: center;
  border: 1px solid rgb(23 33 30 / 18%);
  border-radius: 2px;
}

.swatch-commons { background: #e8b84a; }
.swatch-waterfront { background: #38a9bd; }
.swatch-greenway { background: #5c9a62; }
.swatch-arts { background: #d96f68; }

.town-brief-fields {
  display: grid;
  grid-template-rows: auto 1fr;
}

.town-brief-fields .field-cell {
  display: grid;
  align-content: center;
  gap: 6px;
}

.town-brief-fields .field-cell + .field-cell {
  border-top: 1px solid var(--line);
}

.town-brief-fields textarea {
  min-height: 86px;
  max-height: 180px;
}

.field-hint {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.field-cell textarea::placeholder {
  color: #8b9792;
}

.joined-lot {
  padding: 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.joined-lot-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.joined-lot-topline strong {
  color: var(--accent-dark);
  font: 740 12px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.joined-lot h3 {
  margin: 9px 0 4px;
  font-size: 17px;
}

.joined-lot > p {
  max-width: 760px;
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

.joined-lot dl {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 12px 0 0;
}

.joined-lot dl div {
  display: grid;
  gap: 1px;
}

.joined-lot dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 720;
  text-transform: uppercase;
}

.joined-lot dd {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}

.inline-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 900px) {
  .town-new-lot {
    grid-template-columns: 1fr;
  }

  .district-picker {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 680px) {
  .experience-switch,
  .district-picker {
    grid-template-columns: 1fr;
  }

  .experience-button {
    min-height: 62px;
  }

  .joined-lot-topline {
    align-items: flex-start;
    flex-direction: column;
  }
}

.connector-toolbar {
  position: static;
  top: auto;
  min-height: 50px;
  justify-content: flex-end;
  border-top: 0;
  background: var(--surface-subtle);
  padding-top: 6px;
  padding-bottom: 6px;
}

.connector-toolbar .header-actions {
  width: 100%;
  justify-content: flex-end;
}

.workspace-nav {
  top: 78px;
}

@media (max-width: 1040px) {
  .workspace-nav {
    top: 70px;
  }
}

@media (max-width: 680px) {
  .connector-toolbar {
    min-height: 46px;
  }

  .connector-toolbar .header-actions {
    width: 100%;
  }
}
