@font-face {
  font-family: "Google Sans";
  src: url("../public/fonts/google-sans-400.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Google Sans";
  src: url("../public/fonts/google-sans-500.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Google Sans";
  src: url("../public/fonts/google-sans-700.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("../public/fonts/dm-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "DM Sans";
  src: url("../public/fonts/dm-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: "DM Sans";
  src: url("../public/fonts/dm-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: "DM Sans";
  src: url("../public/fonts/dm-sans-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
}

:root {
  --paper: #f2eee8;
  --paper-deep: #e4ddd3;
  --surface: #fffaf2;
  --ink: #191217;
  --muted: #625961;
  --line: #c9beb2;
  --line-strong: #77696f;
  --plum: #4a1238;
  --plum-soft: #eadde5;
  --coral: #ff6e4d;
  --teal: #008c7e;
  --teal-soft: #d8f0ec;
  --amber: #ad7224;
  --amber-soft: #f3dfbb;
  --red: #c33d35;
  --red-soft: #f6d5d1;
  --shadow: none;
  --radius: 0px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "tnum" 1, "ss01" 1;
  line-height: 1.4;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.app {
  min-height: 100vh;
  padding: 0;
}

.workbench {
  width: 100vw;
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  overflow-anchor: none;
  background: rgba(255, 250, 243, 0.88);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.simulator-layout {
  display: grid;
  grid-template-columns: minmax(380px, 420px) minmax(0, 1fr);
  height: 100vh;
  min-height: 100vh;
  transition: grid-template-columns 220ms ease;
}

.workbench.sidebar-collapsed .simulator-layout {
  grid-template-columns: 56px minmax(0, 1fr);
}

.settings-sidebar {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: rgba(255, 250, 243, 0.82);
}

.settings-top {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 58px;
  padding: var(--space-3);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 243, 0.94);
}

.settings-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.settings-title strong {
  font-size: 14px;
  line-height: 1.1;
  font-weight: 850;
}

.settings-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.settings-toggle {
  flex: 0 0 auto;
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 250, 243, 0.9);
  color: var(--plum);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.settings-toggle:hover {
  border-color: var(--plum);
}

.settings-collapsed-label {
  display: none;
  margin-top: var(--space-4);
  color: var(--plum);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  justify-self: center;
}

.workbench.sidebar-collapsed .settings-title,
.workbench.sidebar-collapsed .settings-body,
.workbench.sidebar-collapsed .baseline-control {
  display: none;
}

.workbench.sidebar-collapsed .settings-top {
  justify-content: center;
  padding: var(--space-2);
}

.workbench.sidebar-collapsed .settings-toggle {
  width: 38px;
}

.workbench.sidebar-collapsed .settings-collapsed-label {
  display: block;
}

.simulator-workspace {
  position: relative;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-anchor: none;
  background:
    linear-gradient(90deg, rgba(74, 31, 61, 0.06) 1px, transparent 1px),
    var(--paper-deep);
  background-size: 80px 100%;
}

.simulator-workspace.live-flow-active {
  padding-bottom: 72px;
}

.simulator-workspace.books-open .pipeline-wrap,
.simulator-workspace.books-open .live-flow-clock,
.simulator-workspace.books-open .trace {
  display: none;
}

.workbench.is-insolvent .settings-sidebar,
.workbench.is-insolvent .command-bar,
.workbench.is-insolvent .pipeline-wrap,
.workbench.is-insolvent .finance-books,
.workbench.is-insolvent .live-flow-clock,
.workbench.is-insolvent .trace {
  pointer-events: none;
  filter: saturate(0.2);
}

.control-deck {
  display: grid;
  grid-template-columns: minmax(220px, 0.58fr) minmax(610px, 1.38fr) minmax(310px, 0.92fr);
  gap: var(--space-5);
  padding: var(--space-5);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 243, 0.76);
}

.section-label {
  margin: 0 0 var(--space-2);
  color: var(--plum);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scenario-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.12;
  font-weight: 800;
}

.scenario-copy {
  max-width: 420px;
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font-size: 13px;
}

.scale-note {
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: var(--space-3);
}

.control-card {
  display: grid;
  gap: var(--space-2);
  min-height: 124px;
  padding: var(--space-3);
  background: rgba(255, 250, 243, 0.74);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.control-card label {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.control-card output {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--plum);
}

.range-with-number {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  align-items: center;
  gap: var(--space-2);
}

.hours-input {
  width: 100%;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 250, 243, 0.9);
  color: var(--ink);
  padding: 4px 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.mix-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.scale-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.difficulty-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.difficulty-options + .promise-readout,
#startingDifficultyReadout {
  margin-top: var(--space-3);
}

.mix-option,
.scale-preset {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 243, 0.82);
  color: var(--muted);
  padding: 7px 9px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.scale-preset {
  display: grid;
  gap: 2px;
  border-radius: 6px;
  text-align: left;
  line-height: 1.1;
}

.scale-preset strong {
  color: inherit;
  font-size: 11px;
}

.scale-preset span {
  color: inherit;
  opacity: 0.78;
  font-size: 10px;
  font-weight: 800;
}

.mix-option:hover,
.scale-preset:hover {
  transform: translateY(-1px);
  border-color: var(--plum);
  color: var(--plum);
}

.mix-option.active,
.scale-preset.active {
  background: var(--plum);
  border-color: var(--plum);
  color: var(--surface);
}

.control-hint {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.capacity-total {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid rgba(33, 24, 31, 0.08);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.number-row,
.capacity-row {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.number-stepper {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: stretch;
  gap: var(--space-2);
}

.number-stepper button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 250, 243, 0.86);
  color: var(--plum);
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
}

.number-stepper input,
.capacity-field input,
.hours-only-input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 250, 243, 0.9);
  color: var(--ink);
  padding: 6px 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.unit-input {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 250, 243, 0.9);
  overflow: hidden;
}

.unit-input input {
  box-sizing: border-box;
  min-width: 0;
  min-height: 34px;
  border: 0;
  background: transparent;
  padding: 6px 4px 6px 8px;
}

.unit-input span {
  padding-right: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.unit-input.compact span {
  color: var(--ink);
}

.unit-input.derived {
  background: color-mix(in oklch, var(--teal-soft) 38%, var(--surface));
}

.unit-input.derived strong {
  min-width: 0;
  padding: 6px 4px 6px 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.capacity-row {
  padding: var(--space-3) 0;
  border-top: 1px solid rgba(33, 24, 31, 0.08);
}

.capacity-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.capacity-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  min-width: 0;
}

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

.capacity-field span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.role-live-status {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.fixed-team-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-2);
  align-items: start;
  padding: 9px 10px;
  border: 1px solid rgba(21, 127, 114, 0.24);
  border-radius: 6px;
  background: color-mix(in oklch, var(--teal-soft) 46%, var(--surface));
  cursor: pointer;
}

.fixed-team-control[hidden] {
  display: none;
}

.fixed-team-control input {
  margin-top: 2px;
  accent-color: var(--plum);
}

.fixed-team-control span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.fixed-team-control strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.15;
  font-weight: 850;
}

.fixed-team-control small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  font-weight: 700;
}

.strategy-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  align-items: start;
  align-content: start;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-anchor: none;
  padding: var(--space-3);
  background: rgba(255, 250, 243, 0.52);
}

.baseline-control {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 0;
  border-top: 1px solid color-mix(in oklch, var(--plum) 24%, var(--line));
  border-radius: 0;
  background: var(--surface);
}

.baseline-control-top {
  display: grid;
  gap: 4px;
}

.baseline-control-top span,
.settings-mode-label {
  color: var(--plum);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.baseline-control-top strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 850;
}

.baseline-control-top p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.32;
  font-weight: 750;
}

.baseline-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.baseline-control.single-action .baseline-actions {
  grid-template-columns: 1fr;
}

.baseline-action {
  min-height: 34px;
  border: 1px solid var(--plum);
  border-radius: 6px;
  background: var(--plum);
  color: var(--surface);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}

.baseline-action.secondary {
  background: rgba(255, 250, 243, 0.72);
  color: var(--plum);
}

.baseline-action:disabled {
  border-color: var(--line);
  background: rgba(255, 250, 243, 0.44);
  color: var(--muted);
  cursor: not-allowed;
}

.settings-group {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.settings-mode-label {
  padding: 7px 2px 2px;
}

.workbench.baseline-locked .baseline-settings {
  display: none;
}

.strategy-card {
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 250, 243, 0.74);
  overflow: hidden;
}

.strategy-card.wide {
  grid-column: auto;
}

.settings-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  cursor: pointer;
  list-style: none;
  padding: 11px 12px;
}

.settings-section summary::-webkit-details-marker {
  display: none;
}

.settings-section summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--plum);
  font-size: 15px;
  font-weight: 900;
}

.settings-section[open] summary {
  border-bottom: 1px solid rgba(33, 24, 31, 0.08);
}

.settings-section[open] summary::after {
  content: "-";
}

.settings-summary {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.settings-section-title {
  color: var(--plum);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.settings-summary strong {
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.15;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-content {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3);
}

.scenario-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.12;
  font-weight: 800;
}

.card-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: 0;
}

.card-heading-row h2 {
  margin-bottom: 0;
}

.slider-stack {
  display: grid;
  gap: var(--space-3);
}

.promise-readout {
  display: grid;
  gap: var(--space-2);
  padding: 10px 11px;
  border: 1px solid color-mix(in oklch, var(--plum) 18%, var(--line));
  border-radius: 6px;
  background: rgba(255, 250, 243, 0.78);
}

.promise-readout.hot {
  border-color: color-mix(in oklch, var(--danger) 42%, var(--line));
  background: color-mix(in oklch, var(--danger) 8%, var(--surface));
}

.promise-readout.good {
  border-color: color-mix(in oklch, var(--good) 42%, var(--line));
  background: color-mix(in oklch, var(--good) 8%, var(--surface));
}

.promise-readout strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.18;
  font-weight: 850;
}

.promise-readout span,
.promise-readout small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 750;
}

.slider-row {
  display: grid;
  gap: 5px;
}

.slider-row.residual {
  opacity: 0.8;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.slider-label strong {
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.slider-label .inline-readout {
  display: none;
}

.slider-label em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.objective-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.goal-list {
  display: grid;
  gap: var(--space-2);
}

.goal-option {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 250, 243, 0.82);
  color: var(--ink);
  padding: 10px 11px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.goal-option:hover {
  transform: translateY(-1px);
  border-color: var(--plum);
}

.goal-option.active {
  background: var(--plum);
  border-color: var(--plum);
  color: var(--surface);
}

.goal-option strong {
  color: inherit;
  font-size: 12px;
  line-height: 1.15;
  font-weight: 850;
}

.goal-option span {
  color: inherit;
  opacity: 0.76;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 700;
}

.difficulty-option {
  min-height: 84px;
}

.family-list {
  display: grid;
  gap: var(--space-2);
}

.family-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 6px 2px 1px;
}

.family-group-heading strong,
.family-group-heading span {
  color: var(--plum);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.family-group-heading span {
  color: var(--muted);
}

.family-row {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 250, 243, 0.72);
  overflow: hidden;
}

.family-row summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
  align-items: stretch;
  cursor: pointer;
  list-style: none;
  padding: 10px;
}

.family-row summary::-webkit-details-marker {
  display: none;
}

.family-title-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  align-items: start;
  min-width: 0;
}

.family-name {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.family-edit-cue {
  flex: 0 0 auto;
  color: var(--plum);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.family-logic {
  display: grid;
  gap: var(--space-1);
  padding: 7px 8px;
  border: 1px solid color-mix(in oklch, var(--line) 84%, var(--ink));
  background: rgba(255, 250, 243, 0.56);
  min-width: 0;
}

.family-logic-line {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: none;
  overflow-wrap: anywhere;
}

.family-assumption-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: rgba(246, 238, 227, 0.54);
}

.family-assumption {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 5px 6px;
  border-right: 1px solid var(--line);
}

.family-assumption:last-child {
  border-right: 0;
}

.family-assumption strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
}

.family-assumption em {
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}

.family-summary-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  min-width: 0;
}

.family-name strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.15;
  font-weight: 850;
}

.family-name span,
.family-field span,
.family-select span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.family-field,
.family-select {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.family-field input,
.family-select select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 250, 243, 0.92);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 7px;
}

.family-advanced {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  padding: 0 10px 10px;
  min-width: 0;
}

.family-mix-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid color-mix(in oklch, var(--line) 86%, var(--ink));
  border-radius: 5px;
  background: rgba(255, 250, 243, 0.48);
  min-width: 0;
}

.family-mix-panel > strong {
  color: var(--ink);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.family-mix-stack {
  display: grid;
  gap: 7px;
}

.family-mix-row {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.family-mix-row input[type="range"] {
  width: 100%;
  min-width: 0;
}

.family-mix-row.residual {
  opacity: 0.72;
}

.family-target-list {
  display: grid;
  gap: var(--space-2);
}

.demand-gen-panel {
  display: grid;
  grid-template-columns: minmax(138px, 1fr) minmax(118px, auto);
  gap: var(--space-2);
  align-items: end;
  padding: 9px 10px;
  border: 1px solid var(--ink);
  background: rgba(255, 250, 243, 0.9);
}

.demand-gen-action {
  min-height: 36px;
  border: 1px solid var(--ink);
  background: var(--plum);
  color: #fffaf3;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  padding: 8px 10px;
  cursor: pointer;
}

.demand-gen-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.hiring-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  grid-column: 1 / -1;
}

.hiring-panel {
  align-items: stretch;
}

.hiring-panel-readout {
  border-color: rgba(21, 127, 114, 0.28);
  background: color-mix(in oklch, var(--teal-soft) 42%, var(--surface));
}

.hiring-panel-title {
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(33, 24, 31, 0.08);
}

.demand-gen-action.secondary {
  background: transparent;
  color: var(--plum);
}

.demand-gen-readout {
  display: grid;
  gap: 2px;
  min-width: 0;
  grid-column: 1 / -1;
}

.demand-gen-readout span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1.15;
  text-transform: uppercase;
}

.demand-gen-readout strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.15;
  font-weight: 850;
}

.demand-gen-readout small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  font-weight: 700;
}

.auto-accept-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px 10px;
  border: 1px solid color-mix(in oklch, var(--teal) 55%, var(--line));
  border-radius: 6px;
  background: rgba(220, 246, 241, 0.58);
  cursor: pointer;
}

.auto-accept-panel input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--plum);
}

.auto-accept-panel span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.auto-accept-panel strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.12;
  font-weight: 850;
}

.auto-accept-panel small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  font-weight: 700;
}

.family-target-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(84px, 92px);
  gap: var(--space-2);
  align-items: end;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 250, 243, 0.72);
}

.family-target-row.price-risk {
  border-color: rgba(194, 71, 60, 0.44);
  background: rgba(253, 231, 226, 0.62);
}

.family-target-row strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.15;
  font-weight: 850;
}

.family-target-row small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  font-weight: 700;
}

.family-target-row .price-risk-copy {
  color: var(--red);
}

.promise-actions {
  justify-content: stretch;
}

.promise-actions .mix-option {
  flex: 1 1 0;
}

.segmented-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 243, 0.72);
}

.segmented-toggle .mix-option {
  border: 0;
  padding: 6px 9px;
}

.command-bar {
  position: sticky;
  top: 0;
  z-index: 9;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: var(--space-3);
  align-items: stretch;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklch, var(--paper-deep) 86%, var(--surface));
}

.command-item,
.command-change {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 250, 243, 0.78);
}

.command-change {
  grid-column: 1 / -1;
  min-height: 48px;
}

.command-item.hot,
.command-change.hot {
  background: var(--red-soft);
  border-color: rgba(184, 75, 66, 0.35);
}

.command-item.good,
.command-change.good {
  background: var(--teal-soft);
  border-color: rgba(21, 127, 114, 0.28);
}

.command-item span,
.command-change span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.command-item strong,
.command-change strong {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.05;
  font-weight: 850;
}

.command-change strong {
  font-size: 13px;
}

.command-item small,
.command-change small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.command-change small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.readout-toggle,
.dashboard-close {
  border: 1px solid var(--plum);
  border-radius: 6px;
  background: var(--plum);
  color: var(--surface);
  cursor: pointer;
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.readout-toggle {
  min-width: 126px;
  align-self: stretch;
}

.readout-toggle[aria-expanded="true"] {
  background: var(--surface);
  color: var(--plum);
}

.system-dashboard {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: 20;
  width: min(620px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(51, 35, 28, 0.18);
  overflow: hidden;
  transform: translateX(calc(100% + 48px));
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms ease, opacity 180ms ease;
}

.workbench.dashboard-open .system-dashboard {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.dashboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklch, var(--paper) 84%, var(--surface));
}

.dashboard-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.12;
  font-weight: 850;
}

.dashboard-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.dashboard-close {
  min-width: 34px;
  min-height: 34px;
  padding: 6px 10px;
}

.dashboard-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  height: calc(100% - 71px);
  padding: var(--space-4);
  overflow-y: auto;
}

.dashboard-panel {
  display: grid;
  gap: var(--space-3);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.dashboard-metric,
.danger-card,
.trade-card {
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 250, 243, 0.78);
}

.dashboard-metric span,
.danger-card span,
.trade-card span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-metric strong,
.danger-card strong,
.trade-card strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  line-height: 1.1;
}

.danger-card {
  border-color: rgba(184, 75, 66, 0.28);
  background: var(--red-soft);
}

.danger-card.low {
  border-color: rgba(21, 127, 114, 0.25);
  background: var(--teal-soft);
}

.danger-list,
.trade-list {
  display: grid;
  gap: var(--space-3);
}

.assumption-panel {
  max-width: 1540px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 243, 0.72);
}

.assumption-panel summary {
  cursor: pointer;
  padding: var(--space-4) var(--space-5);
  color: var(--plum);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assumption-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: var(--space-3);
  padding: 0 var(--space-5) var(--space-5);
}

.assumption-item {
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 250, 243, 0.78);
}

.assumption-item span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assumption-item strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.15;
}

.readout {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1fr);
  gap: var(--space-3);
}

.bottleneck-card,
.why-card {
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 250, 243, 0.74);
}

.bottleneck-card {
  display: grid;
  gap: var(--space-2);
}

.bottleneck-label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bottleneck-name {
  margin: 0;
  color: var(--plum);
  font-size: 25px;
  line-height: 1.03;
  font-weight: 800;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.metric {
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  line-height: 1.1;
}

.why-card {
  display: grid;
  gap: var(--space-2);
  background: var(--plum-soft);
  border-color: rgba(74, 31, 61, 0.18);
}

.why-card h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.why-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.trace {
  display: none;
}

.trace-step {
  position: relative;
  display: grid;
  gap: 2px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 250, 243, 0.72);
}

.trace-step.active {
  border-color: rgba(21, 127, 114, 0.35);
  background: var(--teal-soft);
}

.trace-step.hot {
  border-color: rgba(184, 75, 66, 0.35);
  background: var(--red-soft);
}

.trace-step span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trace-step strong {
  font-size: 13px;
  line-height: 1.15;
}

.board-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 243, 0.84);
}

.board-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.board-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.operating-rail {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(360px, 390px) auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-4);
  border: 1px solid rgba(21, 127, 114, 0.28);
  border-radius: var(--radius);
  background: color-mix(in oklch, var(--surface) 78%, var(--teal-soft));
}

.rail-title {
  margin: 0;
  font-size: 15px;
  font-weight: 850;
}

.rail-copy {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.rail-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  gap: var(--space-2);
  justify-self: start;
  width: min(520px, 100%);
}

.rail-metric {
  padding: 9px 10px;
  border: 1px solid rgba(21, 127, 114, 0.2);
  border-radius: 10px;
  background: rgba(255, 250, 243, 0.72);
}

.rail-metric span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rail-metric strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.15;
}

.rail-action {
  justify-self: start;
}

.state-chip {
  display: none;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 10px;
  background: var(--amber-soft);
  border: 1px solid rgba(180, 118, 44, 0.28);
  border-radius: 999px;
  color: #70430c;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.state-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--amber);
}

.state-chip.after {
  background: var(--teal-soft);
  border-color: rgba(21, 127, 114, 0.28);
  color: #0d574f;
}

.state-chip.after::before {
  background: var(--teal);
}

.pipeline-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  overflow-anchor: none;
  min-height: calc(100vh - 88px);
  padding-bottom: 72px;
  background:
    linear-gradient(90deg, rgba(74, 31, 61, 0.06) 1px, transparent 1px),
    var(--paper-deep);
  background-size: 80px 100%;
}

.board-rail-shell {
  min-width: 2700px;
  padding: var(--space-4) var(--space-4) 0;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(9, minmax(300px, 1fr));
  gap: var(--space-3);
  align-items: start;
  min-width: 2700px;
  padding: var(--space-3) var(--space-4) var(--space-4);
}

.stage {
  --stage-surface: rgba(255, 250, 243, 0.9);
  --stage-rule-color: rgba(74, 31, 61, 0.055);
  --stage-rule-row: 26px;
  --stage-rule-offset: 0px;
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto auto auto 1fr;
  gap: 8px;
  min-height: 314px;
  padding: 10px;
  background: var(--stage-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 240ms ease, background 240ms ease, transform 240ms ease;
  contain: layout paint;
}

.stage.hot {
  --stage-surface: var(--red-soft);
  --stage-rule-color: rgba(184, 75, 66, 0.08);
  border-color: rgba(184, 75, 66, 0.42);
}

.stage.warm {
  --stage-surface: var(--amber-soft);
  --stage-rule-color: rgba(180, 118, 44, 0.08);
  border-color: rgba(180, 118, 44, 0.38);
}

.stage.agented {
  --stage-surface: var(--teal-soft);
  --stage-rule-color: rgba(21, 127, 114, 0.08);
  border-color: rgba(21, 127, 114, 0.35);
}

.stage.fieldwork {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(74, 31, 61, 0.06),
      rgba(74, 31, 61, 0.06) 8px,
      rgba(255, 250, 243, 0.72) 8px,
      rgba(255, 250, 243, 0.72) 16px
    );
  border-style: dashed;
  border-color: var(--line-strong);
}

.stage.fieldwork.warm {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(180, 118, 44, 0.16),
      rgba(180, 118, 44, 0.16) 8px,
      rgba(255, 250, 243, 0.72) 8px,
      rgba(255, 250, 243, 0.72) 16px
    );
  border-color: rgba(180, 118, 44, 0.5);
}

.stage.fieldwork.hot {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(184, 75, 66, 0.18),
      rgba(184, 75, 66, 0.18) 8px,
      rgba(255, 250, 243, 0.72) 8px,
      rgba(255, 250, 243, 0.72) 16px
    );
  border-color: rgba(184, 75, 66, 0.52);
}

.stage.target {
  transform: translateY(-2px);
}

.stage.constraint-peer {
  box-shadow: 0 0 0 1px rgba(74, 31, 61, 0.12);
}

.stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 22px;
}

.stage-name {
  margin: 0;
  font-size: 13px;
  line-height: 1.12;
  font-weight: 800;
}

.stage-index {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.stage-purpose {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.18;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stage-action {
  display: grid;
  gap: 3px;
  align-content: start;
  min-height: 0;
}

.agent-fit {
  min-height: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.inline-agent,
.inactive-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 30px;
  height: 30px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.inline-agent {
  border: 1px solid var(--plum);
  border-radius: 6px;
  background: var(--plum);
  color: var(--surface);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.inline-agent:hover {
  transform: translateY(-1px);
}

.inline-agent[aria-pressed="true"] {
  background: var(--teal);
  border-color: var(--teal);
}

.inactive-action {
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: rgba(117, 106, 114, 0.76);
}

.inactive-action.active {
  border-style: solid;
  border-color: rgba(21, 127, 114, 0.34);
  background: rgba(223, 241, 236, 0.72);
  color: var(--teal);
}

.util-row {
  display: grid;
  gap: 4px;
  align-content: center;
  min-height: 32px;
}

.util-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.util-value {
  color: var(--ink);
  font-size: 12px;
  text-transform: none;
  white-space: nowrap;
}

.unit-grid {
  display: grid;
  gap: 3px;
  padding: 4px 0;
  border-top: 1px solid rgba(33, 24, 31, 0.08);
  border-bottom: 1px solid rgba(33, 24, 31, 0.08);
}

.unit-row {
  display: flex;
  min-height: 16px;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.unit-row strong {
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  text-align: right;
}

.meter {
  height: 9px;
  overflow: hidden;
  background: rgba(33, 24, 31, 0.08);
  border-radius: 999px;
}

.meter-fill {
  width: var(--fill);
  height: 100%;
  border-radius: 999px;
  background: var(--teal);
  transition: width 280ms ease, background 280ms ease;
}

.stage.hot .meter-fill {
  background: var(--red);
}

.stage.warm .meter-fill {
  background: var(--amber);
}

.delta {
  min-height: 0;
  line-height: 13px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.delta:empty {
  display: none;
}

.delta.good {
  color: var(--teal);
}

.delta.hot {
  color: var(--red);
}

.driver-stack {
  display: grid;
  gap: 6px;
}

.driver-note {
  padding: 6px 8px;
  border: 1px solid rgba(33, 24, 31, 0.08);
  border-radius: 6px;
  background: rgba(255, 250, 243, 0.58);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.28;
}

.driver-note strong {
  color: var(--ink);
  font-weight: 800;
}

.driver-note.hot {
  border-color: rgba(184, 75, 66, 0.22);
  background: rgba(248, 225, 220, 0.5);
}

.driver-note.good {
  border-color: rgba(21, 127, 114, 0.18);
  background: rgba(223, 241, 236, 0.56);
}

.queue {
  display: grid;
  gap: var(--space-2);
  align-content: start;
  min-height: 66px;
  padding-top: var(--space-1);
}

.queue-strip {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
  min-height: 24px;
  align-items: stretch;
}

.queue-strip.empty {
  border: 1px solid rgba(33, 24, 31, 0.08);
  border-radius: 4px;
  background: rgba(255, 250, 243, 0.48);
}

.queue-block {
  min-height: 24px;
  border: 1px solid rgba(33, 24, 31, 0.08);
  border-radius: 4px;
  background: rgba(33, 24, 31, 0.1);
  animation: cardIn 180ms ease both;
}

.queue-block.hot {
  background: rgba(184, 75, 66, 0.32);
  border-color: rgba(184, 75, 66, 0.22);
}

.queue-block.good {
  background: rgba(21, 127, 114, 0.2);
  border-color: rgba(21, 127, 114, 0.18);
}

.work-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 82px;
  padding: 4px 0 4px;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(var(--stage-rule-row) - 1px),
      var(--stage-rule-color) calc(var(--stage-rule-row) - 1px),
      var(--stage-rule-color) var(--stage-rule-row)
    );
  background-position: 0 var(--stage-rule-offset);
  isolation: isolate;
}

.work-stack.empty {
  min-height: 34px;
  border: 1px solid rgba(33, 24, 31, 0.08);
  background: rgba(255, 250, 243, 0.48);
}

.work-card,
.work-overflow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-self: start;
  width: var(--work-width, 100%);
  min-height: 18px;
  padding: 2px 6px;
  border: 1px solid rgba(33, 24, 31, 0.14);
  background: rgba(255, 250, 243, 0.82);
  color: var(--ink);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.01em;
  box-shadow: 2px 2px 0 rgba(33, 24, 31, 0.12);
  transform: none;
  transform-origin: 50% 50%;
  transition: background 180ms ease, border-color 180ms ease, opacity 180ms ease, box-shadow 180ms ease, transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
  animation: none;
  will-change: transform;
}

.work-card {
  appearance: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.work-card:hover,
.work-card:focus-visible {
  border-color: color-mix(in oklch, var(--plum) 72%, var(--ink));
  outline: none;
}

.work-card:not(.is-moving):hover,
.work-card:not(.is-moving):focus-visible {
  transform: translate3d(0, -3px, 0);
  box-shadow: 5px 7px 0 rgba(33, 24, 31, 0.18);
}

.work-card.selected {
  border-color: rgba(33, 24, 31, 0.22);
  outline: none;
  box-shadow: 4px 4px 0 rgba(33, 24, 31, 0.18);
}

.work-card.is-moving {
  z-index: 50;
}

.work-card.entering {
  animation: workCardIn 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.work-card.exiting {
  animation: workCardOut 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.work-card-expanded {
  grid-template-columns: 1fr;
  gap: 7px;
  width: 100%;
  min-height: 124px;
  padding: 10px;
}

.expanded-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.expanded-card-family,
.expanded-card-origin,
.expanded-card-copy,
.expanded-card-next {
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  line-height: 1.25;
}

.expanded-card-family {
  color: var(--ink);
  font-weight: 900;
}

.expanded-card-origin {
  color: var(--plum);
  font-weight: 860;
}

.expanded-card-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.expanded-card-stats strong {
  padding: 6px;
  border: 1px solid rgba(33, 24, 31, 0.13);
  background: rgba(255, 250, 243, 0.58);
  color: var(--ink);
  font-size: 9px;
  font-weight: 900;
  line-height: 1.12;
}

.expanded-card-next {
  padding-top: 2px;
  border-top: 1px solid rgba(33, 24, 31, 0.12);
}

.work-card + .work-card,
.work-card + .work-overflow {
  margin-top: 0;
}

.work-stack.compact .work-card + .work-card,
.work-stack.compact .work-card + .work-overflow {
  margin-top: 0;
}

.work-stack.crushed .work-card + .work-card,
.work-stack.crushed .work-card + .work-overflow {
  margin-top: 0;
}

.work-card-label,
.work-overflow strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-card-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.work-card-state::before {
  content: "";
  width: 5px;
  height: 5px;
  border: 1px solid currentColor;
  background: currentColor;
}

.work-card.active,
.work-card.in-field,
.work-card.on-schedule {
  border-color: rgba(21, 127, 114, 0.32);
  background: rgba(223, 241, 236, 0.72);
}

.work-card.active .work-card-state,
.work-card.in-field .work-card-state,
.work-card.on-schedule .work-card-state {
  color: var(--teal);
}

.work-card.waiting,
.work-card.at-risk {
  border-color: rgba(215, 159, 64, 0.42);
  background: rgba(250, 229, 189, 0.78);
}

.work-card.waiting .work-card-state,
.work-card.at-risk .work-card-state {
  color: #8b5a12;
}

.work-card.blocked,
.work-card.outside-promise {
  border-color: rgba(184, 75, 66, 0.42);
  background: rgba(248, 225, 220, 0.84);
}

.work-card.blocked .work-card-state,
.work-card.outside-promise .work-card-state {
  color: var(--red);
}

.work-overflow {
  grid-template-columns: 1fr;
  gap: 2px;
  width: 100%;
  border-style: dashed;
  border-color: rgba(33, 24, 31, 0.18);
  background: rgba(255, 250, 243, 0.68);
  color: var(--muted);
  box-shadow: none;
}

.work-overflow span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.work-stack.hot .work-overflow {
  border-color: rgba(184, 75, 66, 0.36);
  background: rgba(248, 225, 220, 0.66);
}

.live-flow-clock {
  position: fixed;
  left: calc(420px + (100vw - 420px) / 2);
  bottom: 10px;
  z-index: 60;
  display: grid;
  grid-template-columns: 42px auto 42px;
  gap: 0;
  align-items: center;
  width: max-content;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: 0 8px 22px rgba(33, 24, 31, 0.12);
  transform: translateX(-50%);
}

.workbench.sidebar-collapsed .live-flow-clock {
  left: calc(56px + (100vw - 56px) / 2);
  width: max-content;
}

.live-flow-clock[hidden] {
  display: none !important;
}

.live-flow-toggle,
.live-flow-calendar,
.live-flow-sound-toggle {
  min-height: 48px;
  border: 1px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  font-weight: 900;
}

.live-flow-toggle,
.live-flow-sound-toggle {
  cursor: pointer;
}

.live-flow-toggle,
.live-flow-sound-toggle {
  position: relative;
  width: 42px;
  min-width: 42px;
  height: 48px;
  padding: 0;
  font-size: 0;
}

.live-flow-toggle {
  border-right: 0;
  background: var(--ink);
  color: var(--surface);
}

.live-flow-toggle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 9px solid currentColor;
  transform: translate(-38%, -50%);
}

.live-flow-toggle.is-playing::before {
  width: 12px;
  height: 12px;
  border: 0;
  background: linear-gradient(90deg, currentColor 0 35%, transparent 35% 65%, currentColor 65% 100%);
  transform: translate(-50%, -50%);
}

.live-flow-sound-toggle {
  border-left: 0;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--surface);
}

.sound-icon {
  display: none;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 2;
}

.live-flow-sound-toggle .sound-off {
  display: block;
}

.live-flow-sound-toggle.is-on .sound-off {
  display: none;
}

.live-flow-sound-toggle.is-on .sound-on {
  display: block;
}

.live-flow-calendar {
  position: relative;
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 0;
  height: 48px;
  min-width: 164px;
  padding: 9px 13px 8px;
  overflow: hidden;
}

.live-flow-calendar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--plum);
}

.live-flow-calendar strong {
  font-size: 12px;
  line-height: 1.1;
  font-weight: 900;
}

.live-flow-calendar span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-flow-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.why-stage {
  min-height: 0;
  padding: 8px;
  background: rgba(255, 250, 243, 0.5);
  border: 1px solid rgba(33, 24, 31, 0.08);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.28;
}

.why-stage strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
  margin-bottom: 2px;
}

.queue-count {
  padding-top: var(--space-2);
  border-top: 1px solid rgba(33, 24, 31, 0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.field-family-stack {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(33, 24, 31, 0.08);
  background: rgba(255, 250, 243, 0.48);
}

.field-family-stack-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 900;
}

.field-family-stack-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-family-stack-head span {
  color: var(--teal);
  white-space: nowrap;
}

.field-family-row {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) minmax(52px, auto) minmax(52px, auto);
  gap: 6px;
  align-items: center;
  padding: 4px 0 0;
  border: 0;
  border-top: 1px solid rgba(33, 24, 31, 0.08);
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  font-weight: 760;
}

.field-family-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-family-row .slack {
  color: var(--teal);
  font-weight: 900;
  text-align: right;
}

.field-family-row.hot .slack {
  color: var(--red);
}

.field-family-row.hot strong,
.field-family-stack:has(.field-family-row.hot) .field-family-stack-head span {
  color: var(--red);
}

.field-family-more {
  padding-top: 4px;
  border-top: 1px solid rgba(33, 24, 31, 0.08);
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

/* V33 visual system: sharp control-room UI */
button,
input,
select,
textarea,
.strategy-card,
.baseline-control,
.goal-option,
.mix-option,
.family-card,
.promise-readout,
.command-item,
.command-change,
.readout-toggle,
.readout-lens-switch,
.readout-lens-button,
.dashboard-close,
.system-dashboard,
.dashboard-metric,
.dashboard-panel,
.operating-rail,
.rail-metric,
.stage,
.inline-agent,
.inactive-action,
.driver-note,
.why-stage,
.queue-strip.empty,
.queue-block,
.work-card,
.work-overflow,
.live-flow-clock,
.live-flow-toggle,
.live-flow-sound-toggle,
.live-flow-reset,
.live-flow-speed,
.live-flow-speed button,
.live-flow-scrubber,
.field-family-row,
.book-shell,
.book-tabs,
.book-tabs button,
.book-close,
.book-metric,
.book-trend-line span,
.book-sparkline,
.book-chart,
.meter,
.meter-fill,
.state-chip,
.settings-toggle,
.segmented-toggle {
  border-radius: 0 !important;
  box-shadow: none !important;
}

.work-card {
  box-shadow: 2px 2px 0 rgba(33, 24, 31, 0.12) !important;
}

.work-card:not(.is-moving):hover,
.work-card:not(.is-moving):focus-visible {
  box-shadow: 5px 7px 0 rgba(33, 24, 31, 0.18) !important;
}

.work-card.selected {
  box-shadow: 4px 4px 0 rgba(33, 24, 31, 0.18) !important;
}

.work-overflow {
  box-shadow: none !important;
}

.live-flow-clock {
  box-shadow: 0 8px 22px rgba(33, 24, 31, 0.12) !important;
}

.workbench {
  background: var(--paper);
}

.settings-sidebar,
.settings-top,
.settings-body {
  background: var(--surface);
}

.settings-sidebar {
  border-right-color: var(--ink);
}

.settings-top {
  min-height: 56px;
  border-bottom-color: var(--ink);
}

.settings-title strong {
  font-size: 13px;
  font-weight: 700;
}

.settings-title span {
  font-size: 11px;
  font-weight: 700;
}

.settings-toggle {
  min-width: 32px;
  min-height: 32px;
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.baseline-control {
  position: relative;
  z-index: 8;
  border-color: var(--ink);
  background: var(--surface);
}

.baseline-control-top span,
.settings-mode-label,
.settings-section-title,
.section-label,
.command-item span,
.command-change span,
.rail-metric span,
.agent-fit,
.util-label,
.unit-row {
  letter-spacing: 0.08em;
  font-weight: 700;
}

.baseline-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
  font-weight: 700;
}

.baseline-action.secondary {
  background: var(--surface);
  color: var(--ink);
}

.strategy-card {
  border-color: var(--line);
  background: color-mix(in oklch, var(--surface) 94%, var(--paper));
}

.settings-section summary {
  border-bottom-color: color-mix(in oklch, var(--line) 80%, transparent);
}

.goal-option,
.mix-option {
  border-color: var(--line);
  background: var(--surface);
}

.goal-option.active,
.mix-option.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.goal-option.active span,
.mix-option.active span {
  color: color-mix(in oklch, var(--surface) 72%, var(--line));
}

.command-bar {
  --command-cell-min: 96px;
  grid-template-columns: repeat(6, minmax(var(--command-cell-min), 1fr));
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--ink);
  background: color-mix(in oklch, var(--paper) 82%, var(--plum-soft));
}

.command-bar.setup-command {
  grid-template-columns: repeat(6, minmax(var(--command-cell-min), 1fr));
}

.command-item,
.command-change {
  align-content: center;
  min-height: 62px;
  padding: 7px 10px;
  border: 0;
  border-right: 1px solid var(--line);
  background: color-mix(in oklch, var(--surface) 92%, var(--paper));
}

.command-item.hot,
.command-change.hot {
  background: color-mix(in oklch, var(--red-soft) 78%, var(--surface));
  border-color: var(--red);
}

.command-item.good,
.command-change.good {
  background: color-mix(in oklch, var(--teal-soft) 74%, var(--surface));
  border-color: var(--teal);
}

.command-item strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.command-change {
  grid-column: 1 / -1;
  min-height: 44px;
  border-top: 1px solid var(--line);
  border-right: 0;
  background: var(--surface);
}

.command-change strong {
  font-size: 13px;
  font-weight: 700;
}

.command-bar.plan-command {
  grid-template-columns: repeat(6, minmax(var(--command-cell-min), 1fr));
  grid-auto-rows: minmax(62px, auto);
}

.command-bar.plan-command .command-item {
  min-height: 62px;
  padding: 6px 9px;
  gap: 2px;
  align-content: center;
  overflow: visible;
}

.command-bar.setup-command .command-item {
  min-height: 62px;
  padding: 6px 9px;
  gap: 2px;
  align-content: center;
  overflow: hidden;
}

.command-bar.setup-command .command-item span {
  font-size: 8px;
  letter-spacing: 0.065em;
}

.command-bar.setup-command .command-item strong {
  font-size: 13px;
  line-height: 1.02;
}

.command-bar.setup-command .command-item small {
  display: -webkit-box;
  overflow: hidden;
  color: color-mix(in oklch, var(--muted) 94%, var(--ink));
  font-size: 8px;
  line-height: 1.08;
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.command-bar.plan-command .command-item span {
  font-size: 8px;
  letter-spacing: 0.065em;
}

.command-bar.plan-command .command-item strong {
  font-size: 13px;
  line-height: 1.02;
}

.command-bar.plan-command .command-item small {
  display: -webkit-box;
  overflow: hidden;
  color: color-mix(in oklch, var(--muted) 94%, var(--ink));
  font-size: 8px;
  line-height: 1.08;
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.command-bar.plan-command .command-change {
  min-height: 32px;
  padding: 6px 10px;
}

.readout-toggle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  min-width: 42px;
  width: 42px;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--ink);
  background: var(--plum);
  color: var(--surface);
  font-size: 0;
}

.readout-toggle::before {
  content: "▦";
  font-size: 22px;
  line-height: 1;
}

.readout-toggle[aria-expanded="true"] {
  background: var(--surface);
  color: var(--plum);
}

.readout-toggle[aria-expanded="true"]::before {
  content: "▨";
}

.readout-lens-switch {
  grid-column: -2 / -1;
  grid-row: 1;
  justify-self: stretch;
  align-self: stretch;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  min-width: 0;
  height: 62px;
  min-height: 62px;
  margin: 0;
  border: 1px solid var(--ink);
  background: var(--surface);
}

.readout-lens-button {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0 5px;
  border: 0;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: var(--surface);
  color: var(--plum);
  font-size: 7px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}

.readout-lens-button:nth-child(2n),
.readout-lens-button:last-child {
  border-right: 0;
}

.readout-lens-button:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.readout-lens-button[aria-pressed="true"] {
  background: var(--plum);
  color: var(--surface);
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.22);
}

.readout-lens-button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: -3px;
}

.books-lens-switch {
  grid-row: 2;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: 1fr;
}

.books-lens-switch .readout-lens-button {
  padding: 0 5px;
  font-size: 7px;
  letter-spacing: 0.045em;
  line-height: 1.05;
  text-align: center;
  white-space: normal;
  border-right: 1px solid var(--ink);
  border-bottom: 0;
}

.books-lens-switch .readout-lens-button:nth-child(2n) {
  border-right: 1px solid var(--ink);
}

.books-lens-switch .readout-lens-button:last-child {
  border-right: 0;
}

.finance-books {
  padding: 24px;
}

.finance-books[hidden] {
  display: none;
}

.insolvency-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 32px;
  background: color-mix(in oklch, var(--paper-deep) 78%, transparent);
  backdrop-filter: blur(2px);
}

.insolvency-overlay[hidden] {
  display: none;
}

.insolvency-card {
  width: min(760px, calc(100vw - 64px));
  border: 2px solid var(--ink);
  background: var(--surface);
  box-shadow: 14px 14px 0 rgba(74, 31, 61, 0.16);
}

.insolvency-card .section-label {
  display: block;
  padding: 18px 22px 0;
  color: var(--red);
}

.insolvency-card h2 {
  margin: 4px 22px 0;
  font-size: 44px;
  line-height: 0.95;
}

.insolvency-card p {
  margin: 12px 22px 20px;
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 750;
  line-height: 1.25;
}

.insolvency-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.insolvency-stats div {
  min-height: 108px;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
  background: var(--red-soft);
}

.insolvency-stats div:last-child {
  border-right: 0;
}

.insolvency-stats span,
.insolvency-stats small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.insolvency-stats span {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.insolvency-stats strong {
  display: block;
  margin: 7px 0 4px;
  font-size: 26px;
  line-height: 1;
}

.insolvency-reset {
  width: 100%;
  min-height: 58px;
  border: 0;
  background: var(--plum);
  color: var(--surface);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.book-shell {
  min-height: calc(100vh - 140px);
  border: 1px solid var(--ink);
  background: color-mix(in oklch, var(--surface) 94%, var(--paper));
}

.book-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  padding: 20px;
  border-bottom: 1px solid var(--ink);
  background: color-mix(in oklch, var(--paper) 86%, var(--plum-soft));
}

.book-header h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1;
}

.book-header p {
  margin: 6px 0 0;
  max-width: 520px;
  color: var(--muted);
  font-weight: 700;
}

.book-header strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 13px;
}

.book-actions {
  display: grid;
  gap: 10px;
  min-width: 360px;
}

.book-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--ink);
}

.book-tabs button,
.book-close {
  height: 44px;
  border: 0;
  border-right: 1px solid var(--ink);
  background: var(--surface);
  color: var(--plum);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.book-tabs button:last-child {
  border-right: 0;
}

.book-tabs button[aria-pressed="true"],
.book-close {
  background: var(--plum);
  color: var(--surface);
}

.book-close {
  border: 1px solid var(--ink);
}

.book-warning {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--red);
  background: var(--red-soft);
  color: var(--red);
}

.book-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--ink);
}

.book-summary div {
  min-height: 82px;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.book-summary div:last-child {
  border-right: 0;
}

.book-summary span,
.book-metric span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.book-summary strong,
.book-metric strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.02;
}

.book-section {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.book-section h3 {
  margin: 0 0 12px;
  color: var(--plum);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.book-metric {
  display: grid;
  align-content: start;
  min-height: 396px;
  padding: 18px 20px 16px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklch, var(--surface) 94%, var(--paper));
  text-align: left;
  cursor: pointer;
}

.book-metric.good {
  background: color-mix(in oklch, var(--teal-soft) 76%, var(--surface));
}

.book-metric.hot {
  background: color-mix(in oklch, var(--red-soft) 80%, var(--surface));
}

.book-trend-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 9px;
}

.book-trend-line span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 243, 0.72);
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}

.book-trend-line span.good {
  border-color: color-mix(in oklch, var(--teal) 36%, var(--line));
  background: color-mix(in oklch, var(--teal-soft) 74%, var(--surface));
  color: var(--teal);
}

.book-trend-line span.hot {
  border-color: color-mix(in oklch, var(--red) 38%, var(--line));
  background: color-mix(in oklch, var(--red-soft) 74%, var(--surface));
  color: var(--red);
}

.book-trend-line b {
  color: inherit;
  font-weight: 950;
}

.book-chart {
  display: block;
  width: 100%;
  height: 232px;
  margin-top: 16px;
  border: 1px solid rgba(33, 24, 31, 0.08);
  background: rgba(255, 250, 243, 0.54);
}

.book-chart.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.book-chart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.book-chart .grid-line,
.book-chart .x-tick {
  stroke: rgba(33, 24, 31, 0.08);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.book-chart .x-tick {
  stroke-dasharray: 2 4;
}

.book-chart .axis {
  stroke: rgba(33, 24, 31, 0.28);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.book-chart .zero-line {
  stroke: rgba(33, 24, 31, 0.42);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.book-chart .axis-label {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
}

.book-chart .chart-context {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.book-chart .y-label {
  text-anchor: end;
  dominant-baseline: middle;
}

.book-chart .x-label {
  text-anchor: middle;
}

.book-chart .chart-area {
  fill: color-mix(in oklch, var(--plum) 16%, transparent);
}

.book-chart .chart-line {
  fill: none;
  stroke: var(--plum);
  stroke-linecap: square;
  stroke-linejoin: bevel;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.book-chart .chart-point,
.book-chart .chart-last-point {
  fill: var(--plum);
  stroke: color-mix(in oklch, var(--surface) 82%, white);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.book-metric.good .book-chart .chart-area {
  fill: color-mix(in oklch, var(--teal) 17%, transparent);
}

.book-metric.good .book-chart .chart-line,
.book-metric.good .book-chart .chart-point,
.book-metric.good .book-chart .chart-last-point {
  stroke: var(--teal);
  fill: var(--teal);
}

.book-metric.hot .book-chart .chart-area {
  fill: color-mix(in oklch, var(--red) 17%, transparent);
}

.book-metric.hot .book-chart .chart-line,
.book-metric.hot .book-chart .chart-point,
.book-metric.hot .book-chart .chart-last-point {
  stroke: var(--red);
  fill: var(--red);
}

.book-metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.book-footer {
  padding: 14px 20px 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pipeline-wrap {
  background:
    linear-gradient(90deg, rgba(25, 18, 23, 0.07) 1px, transparent 1px),
    var(--paper-deep);
  background-size: 80px 100%;
}

.board-rail-shell {
  --stage-w: 300px;
  --handoff-gap: 12px;
  --board-grid-width: 2796px;
  padding: var(--space-3) var(--space-4) var(--space-2);
  min-width: calc(var(--board-grid-width) + 32px);
}

.operating-rail {
  --pressure-blue: oklch(0.64 0.13 247);
  --pressure-green: oklch(0.61 0.13 174);
  --pressure-yellow: oklch(0.76 0.13 88);
  --pressure-orange: oklch(0.68 0.16 48);
  --pressure-red: oklch(0.58 0.17 27);
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: var(--space-2);
  width: var(--board-grid-width);
  min-height: 58px;
  padding: 0;
  border: 0;
  background: transparent;
}

.pressure-head {
  position: sticky;
  left: var(--space-4);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  width: fit-content;
  max-width: min(980px, max(320px, calc(100vw - 468px)), var(--board-grid-width));
  padding: 0 var(--space-3) var(--space-1) 0;
  background: color-mix(in oklch, var(--paper-deep) 92%, transparent);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.15;
}

.workbench.sidebar-collapsed .pressure-head {
  max-width: min(980px, max(320px, calc(100vw - 104px)));
}

.pressure-label {
  flex: 0 0 auto;
  color: var(--plum);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pressure-status {
  min-width: 0;
  color: var(--ink);
  font-weight: 700;
  max-width: 76ch;
}

.pressure-row {
  position: relative;
  display: block;
  width: var(--board-grid-width);
  min-width: var(--board-grid-width);
}

.pm-pressure-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 26px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--plum);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}

.pm-pressure-toggle.is-disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.pm-pressure-toggle[aria-pressed="true"] {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--surface);
}

.pm-pressure-toggle:focus-visible {
  outline: 2px solid var(--plum);
  outline-offset: 2px;
}

.pressure-track {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 1px;
  min-width: 0;
  width: var(--board-grid-width);
  height: 16px;
  border: 1px solid color-mix(in oklch, var(--ink) 24%, transparent);
  background: color-mix(in oklch, var(--paper-deep) 76%, var(--ink));
  overflow: hidden;
}

.pressure-segment {
  --pressure-a: var(--pressure-blue);
  --pressure-b: color-mix(in oklch, var(--pressure-blue) 72%, var(--surface));
  position: relative;
  min-width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--pressure-a), var(--pressure-b), var(--pressure-a));
  background-size: 180% 100%;
  overflow: hidden;
  animation: pressureFlow 4.8s linear infinite;
}

.pressure-segment::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 250, 242, 0.34), transparent);
  opacity: 0.36;
  transform: translateX(-100%);
  animation: pressureSweep var(--flow-speed, 3.8s) linear infinite;
}

.pressure-segment.cold {
  --pressure-a: var(--pressure-blue);
  --pressure-b: color-mix(in oklch, var(--pressure-blue) 44%, var(--teal-soft));
  --flow-speed: 4.6s;
}

.pressure-segment.flow {
  --pressure-a: var(--pressure-green);
  --pressure-b: color-mix(in oklch, var(--pressure-green) 48%, var(--teal-soft));
  --flow-speed: 3.8s;
}

.pressure-segment.tight {
  --pressure-a: var(--pressure-yellow);
  --pressure-b: color-mix(in oklch, var(--pressure-yellow) 58%, var(--amber-soft));
  --flow-speed: 3.2s;
}

.pressure-segment.congested {
  --pressure-a: var(--pressure-orange);
  --pressure-b: color-mix(in oklch, var(--pressure-orange) 56%, var(--amber-soft));
  --flow-speed: 2.6s;
}

.pressure-segment.blocked {
  --pressure-a: var(--pressure-red);
  --pressure-b: color-mix(in oklch, var(--pressure-red) 64%, var(--red-soft));
  --flow-speed: 2s;
  animation: pressurePulse 1.8s ease-in-out infinite;
}

.pipeline {
  position: relative;
  grid-template-columns: repeat(9, var(--stage-w, 300px));
  gap: var(--handoff-gap, 12px);
  width: var(--board-grid-width, 2796px);
  min-width: var(--board-grid-width, 2796px);
}

.rail-metric {
  border-color: var(--line);
  background: var(--surface);
}

.stage {
  border-color: var(--line);
  --stage-surface: color-mix(in oklch, var(--surface) 94%, var(--paper));
  --stage-rule-color: rgba(74, 31, 61, 0.055);
}

.stage.hot {
  border-color: var(--red);
  --stage-surface: color-mix(in oklch, var(--red-soft) 72%, var(--surface));
  --stage-rule-color: rgba(184, 75, 66, 0.1);
}

.stage.warm {
  border-color: var(--amber);
  --stage-surface: color-mix(in oklch, var(--amber-soft) 72%, var(--surface));
  --stage-rule-color: rgba(180, 118, 44, 0.1);
}

.stage.agented {
  border-color: var(--teal);
  --stage-surface: color-mix(in oklch, var(--teal-soft) 74%, var(--surface));
  --stage-rule-color: rgba(21, 127, 114, 0.1);
}

.stage.target {
  transform: none;
  border-width: 2px;
  outline: 2px solid color-mix(in oklch, var(--red) 35%, transparent);
  outline-offset: 2px;
}

.stage-name {
  font-size: 14px;
  font-weight: 700;
}

.inline-agent {
  border-color: var(--plum);
  background: var(--plum);
  color: var(--surface);
  font-weight: 700;
  text-align: center;
}

.inline-agent[aria-pressed="true"] {
  background: var(--teal);
  border-color: var(--teal);
}

.inactive-action {
  justify-content: center;
  border-color: var(--line-strong);
  background: transparent;
}

.meter {
  height: 8px;
  background: color-mix(in oklch, var(--line) 52%, transparent);
}

.driver-note,
.why-stage,
.field-family-stack {
  border-color: color-mix(in oklch, var(--line) 72%, transparent);
  background: color-mix(in oklch, var(--surface) 82%, transparent);
}

.field-family-stack .field-family-row {
  background: transparent;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes workCardIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes workCardOut {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
  to {
    opacity: 0;
    transform: translate3d(38px, -4px, 0) rotate(0.8deg);
  }
}

@keyframes pressureFlow {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 180% 50%;
  }
}

@keyframes pressureSweep {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(110%);
  }
}

@keyframes pressurePulse {
  0%,
  100% {
    opacity: 0.92;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pressure-segment,
  .pressure-segment::after,
  .work-card,
  .work-overflow {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 1420px) {
  .control-deck {
    grid-template-columns: 1fr;
  }

  .input-grid,
  .readout,
  .trace,
  .assumption-grid,
  .dashboard-body {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }

  .command-bar {
    grid-template-columns: repeat(4, minmax(110px, 1fr));
  }

  .readout-lens-switch {
    grid-column: -2 / -1;
  }

  .command-bar.plan-command {
    grid-template-columns: repeat(4, minmax(104px, 1fr));
  }

  .command-bar.setup-command {
    grid-template-columns: repeat(4, minmax(110px, 1fr));
  }

  .strategy-shell {
    grid-template-columns: 1fr;
  }

  .strategy-card.wide {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .app {
    padding: 0;
  }

  .control-deck,
  .trace,
  .board-head,
  .operating-rail,
  .command-bar {
    padding: var(--space-4);
  }

  .command-bar {
    position: relative;
    grid-template-columns: 1fr;
    padding: var(--space-4);
  }

  .command-bar.setup-command {
    grid-template-columns: 1fr;
  }

  .command-bar.plan-command {
    grid-template-columns: 1fr;
  }

  .readout-lens-switch {
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
    min-width: 0;
    margin: 0 0 var(--space-2);
  }

  .system-dashboard {
    top: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-4);
    width: calc(100vw - 32px);
  }

  .simulator-layout,
  .workbench.sidebar-collapsed .simulator-layout {
    grid-template-columns: 1fr;
  }

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

  .family-summary-fields,
  .family-assumption-strip,
  .family-advanced,
  .family-target-row,
  .capacity-field-grid {
    grid-template-columns: 1fr;
  }

  .workbench.sidebar-collapsed .settings-body {
    display: grid;
  }

  .workbench.sidebar-collapsed .settings-title {
    display: grid;
  }

  .workbench.sidebar-collapsed .settings-collapsed-label {
    display: none;
  }

  .operating-rail {
    display: grid;
  }

  .rail-metrics {
    grid-template-columns: 1fr;
  }

  .pipeline {
    padding: var(--space-4);
  }

  .live-flow-clock {
    grid-template-columns: 42px auto 42px;
    width: max-content;
    left: 50%;
    margin: 0;
  }

  .workbench.sidebar-collapsed .live-flow-clock {
    left: 50%;
    width: max-content;
  }

  .live-flow-status {
    position: absolute;
  }
}
