:root {
  color-scheme: dark;
  --bg: #0a0d10;
  --surface: #10151a;
  --surface-2: #151b21;
  --line: #26313a;
  --line-soft: #1c252d;
  --text: #e6edf3;
  --muted: #87939f;
  --faint: #5d6a75;
  --green: #37c978;
  --red: #ff5f66;
  --amber: #e9b949;
  --cyan: #55c7e8;
  --blue: #7aa2f7;
  --shadow: rgba(0, 0, 0, 0.32);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-width: 1180px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(880px, 1fr);
  align-items: start;
}

.rail {
  border-right: 1px solid var(--line);
  background: #0d1116;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #141b22;
  color: var(--cyan);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.eyebrow,
.subtle,
small {
  color: var(--muted);
}

.stage-nav {
  display: grid;
  gap: 8px;
}

.stage {
  min-height: 54px;
  border: 1px solid var(--line-soft);
  background: transparent;
  color: var(--muted);
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  text-align: left;
  padding: 0 12px;
}

.stage span {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.stage b {
  font-size: 13px;
  font-weight: 650;
}

.stage b small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 500;
  color: var(--faint);
}

.nav-section-label {
  margin: 14px 0 2px;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0;
}

.trading-system-nav {
  display: grid;
  gap: 8px;
}

.stage.active {
  border-color: rgba(85, 199, 232, 0.55);
  background: rgba(85, 199, 232, 0.08);
  color: var(--text);
}

.stage:not(.locked) {
  cursor: pointer;
}

.stage.locked {
  opacity: 0.55;
}

.side-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 14px;
}

.side-panel h2,
.panel h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.side-panel ul,
.compact-list,
.issue-box ul {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.side-panel li,
.compact-list li,
.issue-box li {
  border-top: 1px solid var(--line-soft);
  padding: 10px 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
}

.workspace {
  padding: 22px;
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.topbar,
.command-band,
.panel,
.metric-grid article {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 18px 42px var(--shadow);
}

.topbar {
  min-height: 54px;
  height: 54px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: none;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.date-strip {
  display: flex;
  align-items: end;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

input,
button {
  font: inherit;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: #141b22;
  color: var(--text);
  cursor: pointer;
}

.review-accordion {
  border: 1px solid var(--line);
  background: transparent;
}

.view-page {
  display: none;
  min-width: 0;
}

.view-page.active {
  display: block;
}

.db-legacy-section {
  display: none;
}

.review-accordion summary {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 16px;
  background: var(--surface);
  cursor: pointer;
  list-style: none;
}

.review-accordion summary::-webkit-details-marker {
  display: none;
}

.review-accordion summary::before {
  content: "▾";
  color: var(--cyan);
  font-size: 14px;
}

.review-accordion:not([open]) summary::before {
  content: "▸";
}

.summary-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex: 1;
}

.summary-title b {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.summary-title em {
  color: var(--text);
  font-style: normal;
  font-weight: 700;
}

.summary-meta {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
}

.summary-meta i {
  font-style: normal;
}

.summary-meta b {
  color: var(--text);
}

.review-content {
  display: grid;
  gap: 14px;
  padding-top: 14px;
}

.command-band {
  min-height: 58px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.command-band > div:first-child {
  display: flex;
  gap: 10px;
  align-items: center;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: var(--amber);
}

.status-dot.ready {
  background: var(--green);
}

.status-dot.blocked {
  background: var(--red);
}

.status-dot.gaps {
  background: var(--amber);
}

.contract-meta {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
}

.contract-meta b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.metric-grid article {
  min-height: 92px;
  padding: 14px;
}

.metric-grid span,
.quality-bars span {
  color: var(--muted);
  font-size: 12px;
}

.metric-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.role-section {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  padding: 16px;
  background: #0b1015;
}

.ai-role-section {
  border-color: rgba(85, 199, 232, 0.45);
  background: linear-gradient(180deg, rgba(85, 199, 232, 0.07), rgba(10, 13, 16, 0));
}

.system-role-section {
  border-color: rgba(135, 147, 159, 0.28);
  background: #0a0f13;
}

.role-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.role-heading h2 {
  margin: 0;
  font-size: 22px;
}

.role-badge {
  border: 1px solid var(--line);
  background: #111820;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--muted);
}

.role-badge.ai {
  border-color: rgba(85, 199, 232, 0.5);
  color: var(--cyan);
}

.role-badge.ai.empty {
  border-color: rgba(233, 185, 73, 0.55);
  color: var(--amber);
}

.role-badge.system {
  color: var(--muted);
}

.ai-source {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 260px;
}

.ai-source small {
  max-width: 520px;
  color: var(--faint);
  font-size: 12px;
  text-align: right;
  line-height: 1.4;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.75fr);
  gap: 14px;
}

.panel {
  padding: 16px;
  min-width: 0;
}

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

.thesis {
  color: var(--text);
  line-height: 1.65;
  margin: 0;
  font-size: 15px;
}

.body-copy {
  color: var(--muted);
  line-height: 1.6;
}

h3 {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--text);
}

.divider {
  border-top: 1px solid var(--line-soft);
  margin: 16px 0 0;
}

.pill {
  border: 1px solid var(--line);
  background: #111820;
  color: var(--cyan);
  padding: 5px 9px;
  font-size: 12px;
}

.quality-bars {
  display: grid;
  gap: 14px;
}

.quality-bars div {
  display: grid;
  grid-template-columns: 76px 56px 1fr;
  gap: 12px;
  align-items: center;
}

.quality-bars b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.quality-bars i {
  height: 7px;
  background: #0c1014;
  border: 1px solid var(--line-soft);
  display: block;
  overflow: hidden;
}

.quality-bars em {
  height: 100%;
  display: block;
  background: var(--cyan);
  width: 0;
}

.issue-box {
  margin-top: 16px;
  border-top: 1px solid var(--line-soft);
  padding-top: 4px;
}

.sector-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 12px;
}

.sector-card {
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
  min-height: 220px;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.sector-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.sector-card h3 {
  margin: 0;
  font-size: 16px;
}

.sector-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
  font-size: 13px;
}

.empty-state,
.empty-cell {
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.015);
  color: var(--muted);
  padding: 18px;
  line-height: 1.5;
}

.empty-cell {
  text-align: center;
}

.mini-list {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.mini-list span {
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  width: 100%;
  min-width: 0;
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  position: sticky;
  top: 0;
  background: #121920;
  color: var(--muted);
  z-index: 1;
}

th,
td {
  border-bottom: 1px solid var(--line-soft);
  padding: 10px 11px;
  text-align: left;
  vertical-align: top;
}

td {
  color: var(--text);
}

td.reason {
  color: var(--muted);
  min-width: 360px;
  line-height: 1.45;
}

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

.database-layout {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.database-layout > * {
  min-width: 0;
}

.database-hero {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(560px, 1.2fr);
  gap: 20px;
  align-items: center;
}

.database-hero h2 {
  font-size: 22px;
}

.database-hero p {
  color: var(--muted);
  margin: 10px 0 0;
}

.database-kpis {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.database-kpis div {
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
  padding: 12px;
}

.database-kpis dt {
  color: var(--muted);
  font-size: 12px;
}

.database-kpis dd {
  margin: 8px 0 0;
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.tradability-panel {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) 260px;
  gap: 20px;
  align-items: center;
  border-color: rgba(55, 201, 120, 0.55);
}

.tradability-panel.blocked {
  border-color: rgba(255, 95, 102, 0.62);
}

.tradability-panel h2 {
  color: var(--green);
  font-size: 24px;
}

.tradability-panel.blocked h2,
.tradability-panel.blocked .tradability-side strong {
  color: var(--red);
}

.tradability-panel p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.tradability-side {
  border-left: 1px solid var(--line-soft);
  padding-left: 18px;
}

.tradability-side strong,
.tradability-side span {
  display: block;
}

.tradability-side strong {
  color: var(--green);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}

.tradability-side span {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.requirement-table {
  max-height: 460px;
}

.requirement-table td {
  min-width: 120px;
}

.requirement-table td.reason {
  min-width: 300px;
}

.freshness-table {
  max-height: 520px;
}

.freshness-table td {
  min-width: 128px;
}

.freshness-table th.realtime-heading {
  color: var(--red);
  font-size: 15px;
}

.freshness-table th.automation-heading {
  color: var(--red);
  font-size: 15px;
}

.freshness-table td.realtime-cell {
  min-width: 150px;
}

.freshness-table td.realtime-time {
  min-width: 150px;
  color: var(--text);
  font-weight: 700;
}

.realtime-cell b,
.realtime-cell small,
.automation-cell b,
.automation-cell small {
  display: block;
}

.realtime-cell b,
.automation-cell b {
  font-size: 13px;
}

.realtime-cell small,
.automation-cell small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.realtime-cell.ok b {
  color: var(--green);
}

.realtime-cell.warn b {
  color: var(--amber);
}

.realtime-cell.bad b {
  color: var(--red);
}

.realtime-cell.neutral b {
  color: var(--muted);
}

.automation-cell {
  min-width: 120px;
}

.automation-cell.ok b {
  color: var(--green);
}

.automation-cell.warn b {
  color: var(--amber);
}

.automation-cell.bad b {
  color: var(--red);
}

.automation-cell.neutral b {
  color: var(--muted);
}

.freshness-table td.reason {
  min-width: 380px;
}

.blocking-mark,
.ok-mark {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
}

.blocking-mark {
  color: var(--red);
}

.ok-mark {
  color: var(--green);
}

.req-status {
  display: inline-block;
  min-width: 72px;
  text-align: center;
  border: 1px solid var(--line);
  padding: 4px 8px;
  font-size: 12px;
}

.req-status.ok {
  color: var(--green);
}

.req-status.warn {
  color: var(--amber);
}

.req-status.bad {
  color: var(--red);
}

.history-quality {
  display: block;
  margin-top: 7px;
  max-width: 150px;
  color: var(--amber);
  font-size: 10px;
  line-height: 1.35;
}

.history-quality.robust_ready,
.history-quality.preferred_ready {
  color: var(--green);
}

.db-truth-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 12px;
}

.truth-card {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 14px;
  min-height: 132px;
}

.source-health-rule {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.source-health-table {
  min-width: 1180px;
}

.source-health-table td:nth-child(1) {
  min-width: 190px;
}

.source-health-table td:nth-child(2),
.source-health-table td:nth-child(3) {
  min-width: 220px;
}

.source-health-table td:nth-child(4),
.source-health-table td:nth-child(5) {
  min-width: 180px;
}

.source-state {
  display: inline-block;
  border: 1px solid var(--line);
  padding: 3px 7px;
  margin-bottom: 5px;
  color: var(--green);
  font-size: 11px;
}

.source-state.backup_active,
.source-state.crosscheck_active {
  color: var(--amber);
  border-color: color-mix(in srgb, var(--amber) 45%, var(--line));
}

.source-state.source_missing,
.source-state.unhealthy,
.source-state.unknown {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 45%, var(--line));
}

.source-health-row.source_missing {
  background: color-mix(in srgb, var(--red) 5%, transparent);
}

.source-health-row.backup_active {
  background: color-mix(in srgb, var(--amber) 4%, transparent);
}

.source-capability-note {
  display: block;
  margin-top: 5px;
  color: var(--amber);
}

.source-failure-detail {
  min-width: 300px;
  max-width: 420px;
}

.source-failure-detail details summary {
  cursor: pointer;
  color: var(--amber);
}

.source-failure-detail details small {
  display: block;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  overflow-wrap: anywhere;
}

.truth-card span,
.truth-card p {
  color: var(--muted);
}

.truth-card span {
  font-size: 12px;
}

.truth-card b {
  display: block;
  margin-top: 8px;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.truth-card p {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

.fact-card {
  box-shadow: none;
}

.final-facts-card {
  border-color: rgba(122, 162, 247, 0.34);
}

.realtime-facts-card {
  border-color: rgba(85, 199, 232, 0.48);
}

.realtime-facts-card .panel-head h2 {
  color: var(--cyan);
}

.final-facts-card .panel-head h2 {
  color: #b8c7ff;
}

.backfill-panel {
  display: grid;
  gap: 14px;
}

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

.control-button {
  min-width: 104px;
  height: 34px;
  border: 1px solid rgba(85, 199, 232, 0.5);
  background: rgba(85, 199, 232, 0.12);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.control-button.secondary {
  border-color: var(--line);
  background: #121820;
  color: var(--muted);
}

.control-button.danger {
  border-color: rgba(255, 95, 102, 0.55);
  background: rgba(255, 95, 102, 0.1);
  color: var(--red);
}

.control-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.backfill-message {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.backfill-target-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 10px;
}

.backfill-target-grid article {
  border: 1px solid rgba(85, 199, 232, 0.22);
  background: rgba(85, 199, 232, 0.055);
  padding: 14px;
  min-height: 104px;
}

.backfill-target-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.backfill-target-grid strong {
  display: block;
  color: var(--text);
  font-size: 28px;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}

.backfill-target-grid small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.35;
}

.backfill-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 10px;
}

.backfill-grid article {
  border: 1px solid var(--line-soft);
  background: #0d1217;
  padding: 14px;
  min-height: 94px;
}

.backfill-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.backfill-grid strong {
  display: block;
  color: var(--text);
  font-size: 22px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.backfill-grid small {
  display: block;
  margin-top: 8px;
  line-height: 1.35;
}

.failure-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.failure-summary span {
  border: 1px solid var(--line-soft);
  background: #0d1217;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
}

.failure-summary b {
  color: var(--text);
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

.stage-usage {
  display: grid;
  grid-template-columns: repeat(5, minmax(170px, 1fr));
  gap: 10px;
}

.stage-usage article {
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
  padding: 12px;
  min-height: 112px;
}

.stage-usage b,
.stage-usage span {
  display: block;
}

.stage-usage b {
  font-size: 13px;
}

.stage-usage span {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

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

.database-group header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.database-group p {
  color: var(--muted);
  margin: 10px 0 14px;
  line-height: 1.55;
}

.db-table-list {
  display: grid;
  border-top: 1px solid var(--line-soft);
}

.db-table-list div {
  min-height: 52px;
  display: grid;
  grid-template-columns: 150px 1fr 76px;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
}

.db-table-list b {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.db-table-list span {
  color: var(--muted);
  font-size: 12px;
}

.db-table-list i {
  justify-self: end;
  border: 1px solid var(--line);
  padding: 4px 7px;
  color: var(--amber);
  font-style: normal;
  font-size: 12px;
}

.db-table-list i.ok {
  color: var(--green);
}

.compact-table {
  max-height: 420px;
}

.repair-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
}

.repair-list li {
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 0;
  color: var(--muted);
  line-height: 1.45;
}

.repair-list li:first-child {
  border-top: 1px solid var(--line-soft);
}

.repair-list b {
  color: var(--text);
}

.repair-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.repair-line span {
  border: 1px solid var(--line-soft);
  padding: 3px 7px;
  font-size: 12px;
}

.repair-severity {
  color: var(--amber);
}

.repair-severity.bad {
  color: var(--red);
}

.repair-category {
  color: var(--cyan);
}

.repair-scope {
  color: var(--muted);
}

.repair-list strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}

.repair-list p {
  margin: 7px 0 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.repair-status-panel {
  border-color: rgba(55, 201, 120, 0.22);
}

.live-repair-list .repair-ok {
  border: 1px solid rgba(55, 201, 120, 0.28);
  background: rgba(55, 201, 120, 0.045);
  padding: 14px;
}

.repair-live-ok {
  color: var(--green);
  border-color: rgba(55, 201, 120, 0.35) !important;
}

.pos {
  color: var(--red);
}

.neg {
  color: var(--green);
}

.trading-system-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}

.trading-system-layout > * {
  min-width: 0;
}

.system-overview-band,
.system-status-strip,
.system-band {
  border: 1px solid var(--line);
  background: var(--surface);
}

.system-overview-band {
  min-height: 126px;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 30px;
  align-items: center;
  border-color: rgba(85, 199, 232, 0.38);
}

.system-overview-band h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.system-overview-band > div > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
  max-width: 980px;
}

.system-live-summary {
  display: grid;
  gap: 7px;
  justify-items: end;
  text-align: right;
}

.system-live-summary span,
.system-live-summary small {
  color: var(--muted);
  font-size: 12px;
}

.system-live-summary strong {
  color: var(--amber);
  font-size: 18px;
}

.operational-health-band {
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) minmax(420px, 1.85fr);
  border: 1px solid rgba(55, 201, 120, 0.5);
  background: var(--surface);
  min-width: 0;
}

.operational-health-band.blocked {
  border-color: rgba(255, 95, 102, 0.62);
}

.operational-health-band.waiting {
  border-color: rgba(229, 181, 74, 0.5);
}

.operational-health-main {
  padding: 16px 18px;
  display: grid;
  align-content: center;
  gap: 5px;
  border-right: 1px solid var(--line-soft);
  min-width: 0;
}

.operational-health-main span,
.operational-health-main small,
.operational-health-facts span {
  color: var(--muted);
  font-size: 10px;
}

.operational-health-main strong {
  color: var(--green);
  font-size: 22px;
}

.operational-health-band.blocked .operational-health-main strong {
  color: var(--red);
}

.operational-health-band.waiting .operational-health-main strong {
  color: var(--green);
}

.operational-health-main p {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.operational-health-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
}

.operational-health-facts > div {
  padding: 14px 12px;
  display: grid;
  align-content: center;
  gap: 6px;
  border-right: 1px solid var(--line-soft);
  min-width: 0;
}

.operational-health-facts > div:last-child {
  border-right: 0;
}

.operational-health-facts strong {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.operational-health-checks {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid var(--line-soft);
}

.operational-health-checks > div {
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-right: 1px solid var(--line-soft);
  min-width: 0;
}

.operational-health-checks > div:last-child {
  border-right: 0;
}

.operational-health-checks b {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--red);
}

.operational-health-checks .passed b {
  background: var(--green);
}

.operational-health-checks span {
  font-size: 10px;
  overflow-wrap: anywhere;
}

.decision-console {
  display: grid;
  grid-template-columns: minmax(320px, 1.5fr) minmax(220px, 0.8fr) minmax(240px, 0.8fr);
  border: 1px solid rgba(255, 95, 102, 0.55);
  background: var(--surface);
}

.decision-console.waiting,
.decision-console.holding {
  border-color: rgba(55, 201, 120, 0.55);
}

.decision-console > div {
  min-height: 134px;
  padding: 20px;
  border-right: 1px solid var(--line-soft);
  display: grid;
  align-content: center;
  gap: 9px;
  min-width: 0;
}

.decision-console > div:last-child {
  border-right: 0;
}

.decision-console span,
.decision-console small {
  color: var(--muted);
  font-size: 12px;
}

.decision-console strong {
  font-size: 21px;
  overflow-wrap: anywhere;
}

.decision-command strong {
  color: var(--red);
  font-size: 32px;
}

.decision-console.waiting .decision-command strong,
.decision-console.holding .decision-command strong {
  color: var(--green);
}

.decision-command p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.selection-pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 14px;
  border: 1px solid var(--line-soft);
}

.pipeline-stage {
  min-height: 126px;
  padding: 15px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  border-right: 1px solid var(--line-soft);
}

.pipeline-stage:last-child {
  border-right: 0;
}

.pipeline-stage > span {
  color: var(--faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.pipeline-stage small {
  color: var(--red);
  font-size: 10px;
}

.pipeline-stage.building small {
  color: var(--amber);
}

.pipeline-stage.ready small {
  color: var(--green);
}

.pipeline-stage h3 {
  margin: 8px 0 0;
  font-size: 14px;
}

.pipeline-stage p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.selection-evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.market-evidence,
.mainline-ranking-panel,
.leader-ranking-panel,
.divergence-evidence-panel,
.buy-trigger-panel,
.exit-trigger-panel {
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
  padding: 14px;
  min-width: 0;
}

.divergence-evidence-panel {
  grid-column: 1 / -1;
}

.market-evidence {
  grid-column: 1 / -1;
}

.buy-trigger-panel {
  grid-column: 1 / -1;
}

.exit-trigger-panel {
  grid-column: 1 / -1;
}

.exit-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.exit-metrics div {
  min-width: 0;
  padding: 9px;
  background: var(--surface);
  border-top: 2px solid var(--cyan);
}

.exit-metrics span,
.exit-metrics strong {
  display: block;
}

.exit-metrics span {
  color: var(--muted);
  font-size: 10px;
}

.exit-metrics strong {
  margin-top: 5px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.trigger-checks {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.trigger-checks div {
  min-height: 52px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 8px;
  border-left: 2px solid var(--amber);
  background: var(--surface);
}

.trigger-checks div.passed {
  border-left-color: var(--green);
}

.trigger-checks span {
  color: var(--amber);
  font-size: 10px;
}

.trigger-checks .passed span {
  color: var(--green);
}

.trigger-checks strong {
  font-size: 11px;
}

.divergence-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 10px;
  border: 1px solid var(--line-soft);
}

.divergence-metrics div {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 9px;
  border-right: 1px solid var(--line-soft);
}

.divergence-metrics div:last-child {
  border-right: 0;
}

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

.divergence-metrics strong {
  font-size: 13px;
}

.evidence-title {
  min-height: 32px;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
}

.evidence-title span {
  color: var(--muted);
  font-size: 12px;
}

.evidence-title strong {
  color: var(--amber);
  text-align: right;
  font-size: 15px;
}

.score-components {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line-soft);
  margin-top: 10px;
}

.score-components div {
  min-height: 78px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 9px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 0;
}

.score-components div:last-child {
  border-right: 0;
}

.score-components span,
.score-components strong {
  font-size: 12px;
}

.score-components span,
.score-components strong {
  display: grid;
  gap: 5px;
}

.score-components strong {
  max-width: 62%;
  color: var(--amber);
  text-align: right;
}

.score-components small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.35;
}

.score-components span {
  color: var(--muted);
}

.evidence-reasons {
  margin: 11px 0 0;
  padding: 0;
  list-style: none;
}

.evidence-reasons li {
  padding: 6px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  border-top: 1px solid var(--line-soft);
}

.mainline-ranking {
  margin-top: 10px;
  display: grid;
}

.mainline-ranking article {
  min-height: 56px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 9px;
  border-top: 1px solid var(--line-soft);
}

.mainline-ranking article > span {
  color: var(--faint);
  font-size: 11px;
}

.mainline-ranking article div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.mainline-ranking article strong {
  font-size: 13px;
}

.mainline-ranking article small {
  color: var(--muted);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.mainline-ranking article > b {
  color: var(--cyan);
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.system-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.system-workspace-grid.position-only {
  grid-template-columns: minmax(0, 1fr);
}

.position-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
  border: 1px solid var(--line-soft);
}

.position-detail-grid > div {
  min-height: 76px;
  padding: 12px;
  display: grid;
  align-content: center;
  gap: 6px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.position-detail-grid > div:nth-child(2n) {
  border-right: 0;
}

.position-detail-grid > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.position-detail-grid span,
.position-detail-grid small {
  color: var(--muted);
  font-size: 11px;
}

.position-detail-grid strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.position-state-audit {
  margin-top: 14px;
  border: 1px solid var(--line-soft);
}

.position-state-head {
  min-height: 62px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.position-state-head > div {
  display: grid;
  gap: 4px;
}

.position-state-head span,
.position-state-head small,
.position-transition-list span,
.position-transition-list small {
  color: var(--muted);
  font-size: 10px;
}

.position-state-head strong {
  color: var(--cyan);
  font-size: 17px;
}

.position-state-path {
  min-height: 52px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line-soft);
}

.position-state-path b {
  white-space: nowrap;
  color: var(--text-soft);
  font-size: 10px;
}

.position-state-path i {
  color: var(--faint);
  font-style: normal;
}

.position-transition-list > div:not(.empty-operational-state) {
  min-height: 52px;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: 150px 220px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line-soft);
}

.position-transition-list > div:first-child {
  border-top: 0;
}

.position-transition-list strong {
  color: var(--text);
  font-size: 11px;
}

.position-transition-list .empty-operational-state {
  min-height: 80px;
  padding: 12px;
}

.system-event-list {
  margin-top: 14px;
  display: grid;
  gap: 7px;
}

.system-event {
  min-height: 54px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-left: 2px solid var(--cyan);
  background: var(--surface-2);
  padding: 8px 10px;
}

.system-event.buy {
  border-left-color: var(--red);
}

.system-event.sell {
  border-left-color: var(--green);
}

.system-event div {
  display: grid;
  gap: 4px;
}

.system-event small,
.system-event span {
  color: var(--muted);
  font-size: 11px;
}

.instruction-center {
  border-color: rgba(85, 199, 232, 0.46);
}

.instruction-center-head {
  align-items: center;
}

.instruction-head-status {
  display: grid;
  justify-items: end;
  gap: 5px;
  text-align: right;
}

.instruction-head-status strong {
  color: var(--cyan);
  font-size: 13px;
}

.instruction-head-status span {
  color: var(--muted);
  font-size: 11px;
}

.instruction-current-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  border: 1px solid var(--line-soft);
  margin-top: 14px;
}

.instruction-current-grid > section {
  padding: 15px;
  min-width: 0;
}

.instruction-current-grid > section:first-child {
  border-right: 1px solid var(--line-soft);
}

.instruction-current-summary {
  display: grid;
  align-content: start;
  gap: 7px;
}

.instruction-current-summary > span,
.instruction-current-summary > small,
.instruction-current-detail span,
.instruction-event-body section > span {
  color: var(--muted);
  font-size: 11px;
}

.instruction-current-summary > strong {
  color: var(--text);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.instruction-meta-grid,
.instruction-event-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line-soft);
  margin-top: 7px;
}

.instruction-meta-grid > div,
.instruction-event-facts > div {
  min-height: 58px;
  padding: 9px;
  display: grid;
  align-content: center;
  gap: 4px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.instruction-meta-grid > div:nth-child(2n),
.instruction-event-facts > div:nth-child(2n) {
  border-right: 0;
}

.instruction-meta-grid > div:nth-last-child(-n + 2),
.instruction-event-facts > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.instruction-meta-grid span,
.instruction-event-facts span {
  color: var(--muted);
  font-size: 10px;
}

.instruction-meta-grid strong,
.instruction-event-facts strong {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.instruction-current-detail {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
}

.capital-arbitration {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  border: 1px solid rgba(85, 199, 232, 0.28);
  margin-top: 12px;
  background: rgba(85, 199, 232, 0.035);
}

.capital-arbitration.conflict {
  border-color: rgba(255, 184, 77, 0.55);
  background: rgba(255, 184, 77, 0.035);
}

.capital-arbitration > div:first-child {
  min-width: 0;
  padding: 13px;
  display: grid;
  align-content: center;
  gap: 5px;
  border-right: 1px solid var(--line-soft);
}

.capital-arbitration span,
.capital-arbitration small {
  color: var(--muted);
  font-size: 10px;
}

.capital-arbitration > div:first-child strong {
  color: var(--cyan);
  font-size: 14px;
}

.capital-arbitration small {
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.capital-arbitration-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.capital-arbitration-facts > div {
  min-height: 68px;
  padding: 10px;
  display: grid;
  align-content: center;
  gap: 5px;
  border-right: 1px solid var(--line-soft);
}

.capital-arbitration-facts > div:last-child {
  border-right: 0;
}

.capital-arbitration-facts strong {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.instruction-current-detail ul,
.instruction-event-body ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.6;
}

.instruction-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.instruction-checks > div {
  min-height: 42px;
  padding: 7px 8px;
  display: grid;
  gap: 3px;
  border: 1px solid var(--line-soft);
}

.instruction-checks > div.passed {
  border-color: rgba(55, 201, 120, 0.38);
}

.instruction-checks > div.waiting {
  border-color: rgba(229, 181, 74, 0.34);
}

.instruction-checks span {
  color: var(--muted);
  font-size: 9px;
}

.instruction-checks strong {
  font-size: 11px;
  overflow-wrap: anywhere;
}

.instruction-history-head {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.instruction-history-head > div {
  display: grid;
  gap: 3px;
}

.instruction-history-head span,
.instruction-history-head small {
  color: var(--muted);
  font-size: 11px;
}

.instruction-history-head strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.instruction-event {
  display: block;
  padding: 0;
  min-height: 0;
  scroll-margin-top: 16px;
}

.instruction-event.deep-link-focus {
  border-color: rgba(255, 184, 77, 0.72);
  box-shadow: inset 3px 0 0 var(--amber);
}

.instruction-event.buy_expired > summary > b,
.instruction-event.buy_cancelled > summary > b {
  color: var(--amber);
}

.instruction-event > summary {
  min-height: 62px;
  padding: 9px 11px;
  display: grid;
  grid-template-columns: minmax(104px, 130px) minmax(170px, 1fr) minmax(150px, auto) minmax(112px, auto);
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

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

.instruction-event > summary > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.instruction-event > summary > b,
.instruction-event > summary > div strong,
.instruction-event > summary > span,
.instruction-event > summary > em {
  overflow-wrap: anywhere;
}

.instruction-event > summary > span,
.instruction-event > summary small {
  color: var(--muted);
  font-size: 11px;
}

.notification-state {
  justify-self: end;
  font-style: normal;
  font-size: 10px;
  color: var(--amber);
}

.notification-state.sent {
  color: var(--green);
}

.notification-state.failed {
  color: var(--red);
}

.instruction-event-body {
  padding: 0 12px 14px;
  border-top: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: minmax(230px, 0.8fr) minmax(200px, 0.7fr) minmax(240px, 1fr);
  gap: 14px;
}

.instruction-event-body > * {
  margin-top: 12px;
  min-width: 0;
}

.instruction-frozen-context > div {
  margin-top: 8px;
  display: grid;
  gap: 7px;
}

.instruction-frozen-context p {
  margin: 0;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.instruction-frozen-context b {
  display: inline-block;
  min-width: 38px;
  margin-right: 5px;
  color: var(--muted);
}

.strategy-review-center {
  border-color: rgba(85, 199, 232, 0.34);
}

.review-status-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line-soft);
  margin-top: 14px;
}

.review-status-strip > div {
  min-height: 98px;
  padding: 13px;
  display: grid;
  align-content: center;
  gap: 6px;
  border-right: 1px solid var(--line-soft);
}

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

.review-status-strip span,
.review-status-strip small,
.review-section-title span,
.review-section-title small,
.review-policy span,
.review-proposal-list span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.review-status-strip strong {
  color: var(--cyan);
  font-size: 16px;
}

.signal-funnel-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.signal-funnel-strip > div:nth-child(3n) {
  border-right: 0;
}

.signal-funnel-strip > div:nth-child(n + 4) {
  border-top: 1px solid var(--line-soft);
}

.review-window-section {
  margin-top: 16px;
}

.missed-opportunity-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.missed-opportunity-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.missed-opportunity {
  min-width: 0;
  padding: 11px 12px;
  border-left: 2px solid var(--cyan);
  background: var(--surface-2);
}

.missed-opportunity.favorable {
  border-left-color: var(--green);
}

.missed-opportunity.protected {
  border-left-color: var(--amber);
}

.missed-opportunity.waiting {
  border-left-color: var(--cyan);
}

.missed-opportunity.incomplete {
  border-left-color: var(--red);
}

.missed-opportunity-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.missed-opportunity-head > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.missed-opportunity-head span,
.missed-opportunity p,
.missed-opportunity dt,
.missed-opportunity dd {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.missed-opportunity-head b {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.missed-opportunity-head strong {
  max-width: 42%;
  color: var(--cyan);
  font-size: 11px;
  line-height: 1.4;
  text-align: right;
}

.missed-opportunity.favorable .missed-opportunity-head strong {
  color: var(--green);
}

.missed-opportunity.protected .missed-opportunity-head strong {
  color: var(--amber);
}

.missed-opportunity.incomplete .missed-opportunity-head strong {
  color: var(--red);
}

.missed-opportunity p {
  margin: 8px 0;
}

.missed-opportunity dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 12px;
  margin: 0;
}

.missed-opportunity dl > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 5px;
}

.missed-opportunity dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.review-cadence-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 8px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.review-cadence-strip > div {
  min-height: 52px;
  padding: 9px 11px;
  display: grid;
  align-content: center;
  gap: 4px;
  border-right: 1px solid var(--line-soft);
}

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

.review-cadence-strip span {
  color: var(--cyan);
  font-size: 10px;
}

.review-cadence-strip strong {
  font-size: 11px;
}

.review-section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 9px;
}

.review-section-title > div {
  display: grid;
  gap: 4px;
}

.review-section-title strong {
  font-size: 14px;
}

.review-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
}

.review-window-table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
  table-layout: fixed;
}

.review-window-table th,
.review-window-table td {
  padding: 10px 8px;
  text-align: right;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.review-window-table th:first-child,
.review-window-table td:first-child {
  text-align: left;
}

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

.review-window-table tbody tr:last-child td {
  border-bottom: 0;
}

.review-window-table th {
  color: var(--muted);
  font-weight: 500;
  background: var(--surface-2);
}

.review-window-table td small {
  display: block;
  color: var(--amber);
  margin-top: 3px;
}

.review-window-table tr.sufficient td small {
  color: var(--green);
}

.review-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 22px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.review-head-actions {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.review-head-actions span {
  color: var(--muted);
  font-size: 11px;
}

.review-head-actions a {
  color: var(--cyan);
  border-bottom: 1px solid rgba(85, 199, 232, 0.45);
  font-size: 11px;
  text-decoration: none;
}

.strategy-lifecycle-path {
  display: grid;
  grid-template-columns: repeat(8, minmax(90px, 1fr));
  margin-top: 12px;
  border: 1px solid var(--line-soft);
}

.strategy-lifecycle-path > div {
  min-height: 62px;
  padding: 9px;
  display: grid;
  align-content: center;
  gap: 5px;
  border-right: 1px solid var(--line-soft);
}

.strategy-lifecycle-path > div:last-child {
  border-right: 0;
}

.strategy-lifecycle-path span {
  color: var(--faint);
  font-size: 9px;
}

.strategy-lifecycle-path strong {
  color: var(--muted);
  font-size: 11px;
}

.strategy-lifecycle-path .completed strong {
  color: var(--green);
}

.strategy-lifecycle-path .current {
  background: rgba(85, 199, 232, 0.06);
  box-shadow: inset 0 -2px 0 var(--cyan);
}

.strategy-lifecycle-path .current strong {
  color: var(--cyan);
}

.review-trade-list,
.review-proposal-list {
  display: grid;
  gap: 7px;
}

.review-trade {
  min-height: 76px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  border-left: 2px solid var(--green);
  background: var(--surface-2);
}

.review-trade.negative {
  border-left-color: var(--red);
}

.review-trade > div,
.review-trade > strong {
  display: grid;
  gap: 3px;
}

.review-trade > strong {
  justify-items: end;
  color: var(--green);
}

.review-trade.negative > strong {
  color: var(--red);
}

.review-trade small,
.review-trade p {
  color: var(--muted);
  font-size: 10px;
}

.review-trade p {
  grid-column: 1 / -1;
  margin: 0;
  line-height: 1.4;
}

.review-policy {
  min-height: 76px;
  padding: 11px;
  display: grid;
  align-content: center;
  gap: 6px;
  border-left: 2px solid var(--cyan);
  background: var(--surface-2);
  margin-bottom: 8px;
}

.review-proposal-list article {
  min-height: 54px;
  padding: 9px;
  display: grid;
  gap: 5px;
  border-top: 1px solid var(--line-soft);
}

.empty-operational-state.compact {
  min-height: 74px;
}

.empty-operational-state {
  min-height: 112px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 7px;
  color: var(--muted);
}

.empty-operational-state strong {
  color: var(--text);
}

.system-drawer {
  border: 1px solid var(--line);
  background: var(--surface);
}

.system-drawer > summary {
  min-height: 70px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  cursor: pointer;
  list-style: none;
}

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

.system-drawer > summary::after {
  content: "+";
  color: var(--cyan);
  font-size: 20px;
}

.system-drawer[open] > summary::after {
  content: "−";
}

.system-drawer > summary > div {
  display: grid;
  gap: 6px;
}

.system-drawer > summary span,
.system-drawer > summary small {
  color: var(--muted);
  font-size: 12px;
}

.system-drawer > summary strong {
  font-size: 15px;
}

.system-drawer > summary > small {
  margin-left: auto;
}

.drawer-content {
  padding: 0 18px 18px;
  border-top: 1px solid var(--line-soft);
}

.fact-input-grid {
  padding-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.fact-input-grid .fact-connection {
  min-width: 0;
  max-width: none;
}

.fact-connection .fact-contract {
  color: #405268;
  font-weight: 700;
}

.fact-connection .fact-contract.final {
  color: #315f8f;
}

.fact-connection .fact-contract.realtime {
  color: #8a5424;
}

.compact-progress {
  padding: 16px 0 4px;
}

.system-progress-summary {
  display: grid;
  gap: 8px;
}

.system-progress-summary span,
.system-progress-summary small {
  color: var(--muted);
  font-size: 12px;
}

.system-progress-summary strong {
  font-size: 30px;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.system-progress-track {
  height: 7px;
  background: #080b0e;
  border: 1px solid var(--line-soft);
  overflow: hidden;
}

.system-progress-track i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--amber);
  transition: width 180ms ease;
}

.system-status-strip {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  border-color: rgba(255, 95, 102, 0.45);
}

.system-status-strip.ready {
  border-color: rgba(55, 201, 120, 0.45);
}

.system-status-strip > div {
  min-height: 94px;
  padding: 16px;
  border-right: 1px solid var(--line-soft);
  display: grid;
  align-content: center;
  gap: 6px;
}

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

.system-status-strip span,
.system-status-strip small {
  color: var(--muted);
  font-size: 12px;
}

.system-status-strip strong {
  color: var(--red);
  font-size: 18px;
}

.system-status-strip.ready strong {
  color: var(--green);
}

.system-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 10px;
}

.system-metrics article {
  min-height: 104px;
  padding: 15px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: grid;
  align-content: center;
  gap: 7px;
}

.system-metrics span,
.system-metrics small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.system-metrics strong {
  font-size: 19px;
  letter-spacing: 0;
}

.system-band {
  padding: 18px;
}

.system-band-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.system-band-head h2 {
  margin: 0;
  font-size: 18px;
}

.system-band-head > span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.logic-step-list {
  display: grid;
}

.logic-step {
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
}

.logic-step:last-child {
  border-bottom: 0;
}

.logic-step header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
}

.logic-step-title {
  display: flex;
  gap: 13px;
  min-width: 0;
}

.logic-step-title > span {
  width: 42px;
  flex: 0 0 42px;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  padding-top: 3px;
}

.logic-step.pending .logic-step-title > span {
  color: var(--faint);
}

.logic-step.in-progress .logic-step-title > span {
  color: var(--amber);
}

.logic-step-title h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.logic-step-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.logic-step-state {
  min-width: 126px;
  display: grid;
  justify-items: end;
  gap: 5px;
}

.logic-step-state b,
.logic-step-state em {
  font-size: 12px;
  font-style: normal;
}

.logic-step.completed .logic-step-state b {
  color: var(--green);
}

.logic-step.in-progress .logic-step-state b {
  color: var(--amber);
}

.logic-step.pending .logic-step-state b {
  color: var(--red);
}

.logic-step-state em {
  color: var(--muted);
}

.logic-step-body {
  margin: 13px 0 0 55px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.7fr;
  gap: 18px;
}

.logic-step-body span {
  color: var(--faint);
  font-size: 11px;
}

.logic-step-body p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.fact-connections {
  margin: 12px 0 0 55px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.fact-connection {
  min-width: 210px;
  max-width: 350px;
  border-left: 2px solid var(--green);
  background: #0c1210;
  padding: 7px 9px;
  display: grid;
  gap: 3px;
}

.fact-connection b,
.fact-connection span,
.fact-connection small {
  font-size: 11px;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
}

.fact-connection b {
  color: var(--green);
}

.fact-connection span,
.fact-connection small {
  color: var(--muted);
}

.fact-connection.waiting {
  border-left-color: var(--cyan);
  background: #0b1115;
}

.fact-connection.waiting b {
  color: var(--cyan);
}

.fact-connection.bad {
  border-left-color: var(--red);
  background: #160d0f;
}

.fact-connection.bad b {
  color: var(--red);
}

.fact-connection.history-warning {
  border-left-color: var(--amber);
  background: #151208;
}

.fact-connection.history-warning b {
  color: var(--amber);
}

.fact-connection .fact-detail {
  padding-top: 3px;
  border-top: 1px solid var(--line-soft);
  line-height: 1.45;
}

.fact-connection.neutral {
  border-left-color: var(--faint);
  background: #0d1115;
}

.fact-connection.neutral b {
  color: var(--muted);
}

.state-machine-row {
  min-height: 88px;
  display: grid;
  grid-template-columns: repeat(11, auto);
  justify-content: start;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
}

.state-machine-row b {
  white-space: nowrap;
  font-size: 12px;
  border-bottom: 2px solid var(--cyan);
  padding: 9px 2px 7px;
}

.state-machine-row i {
  color: var(--faint);
  font-style: normal;
}

.boundary-band {
  border-color: rgba(233, 185, 73, 0.3);
}

.boundary-band > p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

@media (max-width: 900px) {
  body {
    min-width: 0;
  }

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

  .rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px 12px;
    gap: 8px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand strong {
    font-size: 13px;
  }

  .brand small {
    display: none;
  }

  .workspace {
    padding: 10px;
    gap: 8px;
    overflow-x: hidden;
  }

  .database-hero,
  .tradability-panel,
  .db-truth-grid,
  .backfill-panel {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .database-kpis dd {
    font-size: 18px;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  #dbRepairCount {
    font-size: 14px;
    line-height: 1.45;
  }

  .tradability-side {
    border-left: 0;
    border-top: 1px solid var(--line-soft);
    padding-left: 0;
    padding-top: 14px;
  }

  .database-layout .table-wrap {
    width: 100%;
    max-width: 100%;
  }

  .rail .side-panel {
    display: none;
  }

  .stage-nav {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }

  .stage-nav > .stage {
    grid-column: 1;
  }

  .stage-nav .nav-section-label {
    display: none;
  }

  .trading-system-nav {
    grid-column: 2;
    grid-row: 1;
  }

  .stage {
    min-height: 40px;
  }

  .system-overview-band {
    display: none;
  }

  .system-overview-band,
  .operational-health-band,
  .system-status-strip,
  .system-metrics,
  .logic-step-body,
  .decision-console,
  .selection-pipeline,
  .selection-evidence-grid,
  .system-workspace-grid,
  .fact-input-grid {
    grid-template-columns: 1fr;
    width: 100%;
    min-width: 0;
  }

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

  .score-components div {
    border-right: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
  }

  .score-components div:nth-child(2n) {
    border-right: 0;
  }

  .score-components div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .operational-health-main {
    padding: 11px 12px;
    gap: 3px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .operational-health-main strong {
    font-size: 20px;
  }

  .operational-health-main p {
    line-height: 1.35;
  }

  .operational-health-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .operational-health-facts > div:nth-child(2n) {
    border-right: 0;
  }

  .operational-health-facts > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line-soft);
  }

  .operational-health-facts > div {
    padding: 9px 10px;
    gap: 4px;
  }

  .operational-health-checks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .operational-health-checks > div {
    padding: 5px 8px;
    border-right: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
  }

  .operational-health-checks > div:nth-child(2n) {
    border-right: 0;
  }

  .operational-health-checks > div:last-child {
    border-bottom: 0;
  }

  .operational-health-checks > div:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    border-right: 0;
  }

  .review-status-strip,
  .review-detail-grid,
  .review-cadence-strip,
  .instruction-current-grid,
  .instruction-current-detail,
  .instruction-event-body,
  .capital-arbitration {
    grid-template-columns: 1fr;
  }

  .capital-arbitration > div:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .capital-arbitration-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .capital-arbitration-facts > div:nth-child(2n) {
    border-right: 0;
  }

  .capital-arbitration-facts > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line-soft);
  }

  .instruction-current-grid > section:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .instruction-head-status {
    justify-items: start;
    text-align: left;
  }

  .review-head-actions {
    justify-items: start;
  }

  .strategy-lifecycle-path {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strategy-lifecycle-path > div {
    border-right: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
  }

  .strategy-lifecycle-path > div:nth-child(2n) {
    border-right: 0;
  }

  .strategy-lifecycle-path > div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .instruction-history-head {
    align-items: start;
    flex-direction: column;
  }

  .instruction-event > summary {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .instruction-event > summary > b {
    grid-column: 1;
    overflow-wrap: anywhere;
  }

  .instruction-event > summary > div,
  .instruction-event > summary > span {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .instruction-event > summary > em {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .review-status-strip > div {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .review-status-strip > div:last-child {
    border-bottom: 0;
  }

  .review-cadence-strip > div {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .review-cadence-strip > div:last-child {
    border-bottom: 0;
  }

  .review-section-title {
    align-items: start;
    flex-direction: column;
  }

  .missed-opportunity-list,
  .missed-opportunity dl {
    grid-template-columns: 1fr;
  }

  .missed-opportunity-head {
    display: grid;
  }

  .missed-opportunity-head strong {
    max-width: none;
    text-align: left;
  }

  .system-live-summary {
    justify-items: start;
    text-align: left;
  }

  .decision-console > div,
  .pipeline-stage {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .decision-console > div {
    min-height: 76px;
    padding: 9px 12px;
    gap: 4px;
  }

  .decision-console > div:last-child,
  .pipeline-stage:last-child {
    border-bottom: 0;
  }

  .decision-command strong {
    font-size: 24px;
  }

  .system-drawer > summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .system-drawer > summary > small {
    margin-left: 0;
    max-width: calc(100% - 32px);
  }

  .system-band-head {
    align-items: start;
    flex-direction: column;
  }

  .system-band-head > span {
    text-align: left;
  }

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

  .trigger-checks,
  .exit-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .divergence-metrics div:nth-child(2) {
    border-right: 0;
  }

  .divergence-metrics div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line-soft);
  }

  .system-status-strip > div {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .system-status-strip > div:last-child {
    border-bottom: 0;
  }

  .logic-step-body,
  .fact-connections {
    margin-left: 0;
  }

  .fact-connection {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .state-machine-row {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 7px;
    overflow-x: visible;
  }

  .position-state-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .position-transition-list > div:not(.empty-operational-state) {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .state-machine-row i {
    transform: rotate(90deg);
    margin-left: 18px;
  }
}
.deployment-mode {
  color: var(--cyan);
  border-color: color-mix(in srgb, var(--cyan) 45%, transparent);
}

.public-readonly .backfill-actions .control-button {
  display: none;
}
