:root {
  --ink: #1f2430;
  --muted: #5c6675;
  --line: #dfe3ea;
  --bg: #f6f7f9;
  --card: #ffffff;
  --accent: #2f6f8f;
  --band: #cfe0e8;
  --band-edge: #9fbecd;
  --mean: #2f6f8f;
  --goal: #b4603a;
  --ok: #2e7d5b;
  --warn: #9a6b1f;
  --bad: #a23b3b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.head h1 {
  margin: 0 0 4px;
  font-size: 28px;
  letter-spacing: -0.01em;
}

.sub {
  color: var(--muted);
  margin: 0 0 8px;
}

.dials,
.fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

/* Sticky dials top bar: keeps the levers visible while plots update beneath. */
.dial-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(31, 36, 48, 0.09);
  /* full-bleed out of the centred .page column */
  margin: 0 calc(50% - 50vw) 20px;
  padding: 0 calc(50vw - 50%);
}

.dial-bar-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 6px 20px 4px;
}

.dial-bar .fields {
  margin: 12px 0 2px;
}

.dial-bar .mode-line {
  margin: 0 0 8px;
}

/* Anchored content shouldn't hide beneath the sticky bar. */
.card,
.flow,
.trace {
  scroll-margin-top: 200px;
}

/* Narrow windows: collapse to a normal (non-sticky) stacked bar. */
@media (max-width: 640px) {
  .dial-bar {
    position: static;
    box-shadow: none;
    margin: 0 calc(50% - 50vw) 12px;
  }

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

.dial,
.field {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.field.solved {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #e7f0f5 inset;
}

.field-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.field-top label[for] {
  font-weight: 600;
}

.field .pin {
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.unit {
  color: var(--muted);
  font-weight: 600;
}

.field input[type="range"] {
  width: 100%;
  margin: 12px 0 6px;
  accent-color: var(--accent);
}

.field input[type="range"]:disabled {
  opacity: 0.55;
}

.named {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.named.muted {
  color: var(--muted);
  font-weight: 400;
}

.mode-line {
  color: var(--muted);
  font-size: 13px;
  margin: -8px 0 8px;
}

.tier {
  display: inline-block;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 13px;
  border-radius: 999px;
  padding: 4px 12px;
  margin: 0 0 12px;
  border: 1px solid var(--line);
}

.tier.ok {
  color: var(--ok);
  background: #eef7f1;
  border-color: #cfe7d9;
}

.tier.warn {
  color: var(--warn);
  background: #fbf4e6;
  border-color: #efe0bf;
}

.tier.bad {
  color: var(--bad);
  background: #fbeeee;
  border-color: #efcccc;
}

.derisk-note {
  border: 1px solid #d9dde4;
  background: #eef0f3;
  border-radius: 10px;
  padding: 10px 12px;
  color: #3c414c;
  font-size: 14px;
  margin: 12px 0 0;
}

.eff-note {
  color: var(--warn);
  font-size: 14px;
  margin: 8px 0 0;
}

.beyond {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px dashed var(--band-edge);
  border-radius: 10px;
  background: #f3f7f9;
}

.beyond h3 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.beyond p {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.dial label {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: #eaf2f6;
  border-radius: 999px;
  padding: 2px 8px;
}

.dial input[type="range"] {
  width: 100%;
  margin: 14px 0 6px;
  accent-color: var(--accent);
}

.readout {
  font-variant-numeric: tabular-nums;
  font-size: 20px;
  font-weight: 700;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.plan {
  font-size: 16px;
  margin: 0 0 18px;
}

/* Hero: the uncertainty band. */
.bandwrap {
  margin: 8px 0 4px;
}

.range-bar {
  position: relative;
  height: 46px;
  margin: 10px 0 6px;
}

.range-bar .track {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--line);
  border-radius: 999px;
}

.range-bar .fill {
  position: absolute;
  top: 16px;
  height: 14px;
  background: var(--band);
  border: 1px solid var(--band-edge);
  border-radius: 999px;
}

.marker {
  position: absolute;
  top: 6px;
  width: 3px;
  height: 34px;
  border-radius: 2px;
}

.marker.mean {
  background: var(--mean);
}

.marker.goal {
  background: var(--goal);
}

.marker.goal::after {
  content: "target";
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--goal);
  white-space: nowrap;
}

.band-labels {
  display: flex;
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}

.band-labels .mid {
  font-weight: 700;
  color: var(--mean);
}

.width {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 0;
}

.verdict {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-weight: 600;
}

.verdict.ok {
  color: var(--ok);
  background: #eef7f1;
  border-color: #cfe7d9;
}

.verdict.warn {
  color: var(--warn);
  background: #fbf4e6;
  border-color: #efe0bf;
}

.verdict.bad {
  color: var(--bad);
  background: #fbeeee;
  border-color: #efcccc;
}

.whatif-rows {
  display: grid;
  gap: 10px;
}

.whatif-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}

.whatif-row .wf-label {
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 12px;
  margin: 16px 0;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn:hover {
  filter: brightness(0.98);
}

.decision .outcome {
  font-weight: 700;
  font-size: 16px;
  margin: 0 0 6px;
}

.decision .line {
  color: var(--muted);
  margin: 0;
}

.banner {
  background: #fbeeee;
  border: 1px solid #efcccc;
  color: var(--bad);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 12px 0;
  font-size: 14px;
}

/* Surface & navigation views (terrain / slice / contour). */
.surface-nav {
  margin: 16px 0;
}

.nav-title {
  margin: 0 0 4px;
  font-size: 18px;
}

.view-title {
  margin: 0 0 6px;
  font-size: 15px;
}

.surface-wrap {
  width: 100%;
  overflow-x: auto;
}

.surface-view canvas {
  width: 100%;
  max-width: 720px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.surface-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.legend-bar {
  flex: 0 0 140px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(to right, rgb(236, 242, 246), rgb(19, 78, 100));
}

.legend-cap {
  color: var(--muted);
}

.surface-overlay-legend {
  margin: 10px 0 0;
  display: grid;
  gap: 4px;
}

.surface-overlay-legend .ov {
  margin: 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  padding-left: 20px;
  position: relative;
}

.surface-overlay-legend .ov::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 3px solid currentColor;
}

.surface-overlay-legend .pick {
  color: var(--ok);
}

.surface-overlay-legend .decoy {
  color: var(--warn);
}

/* Under-the-hood technical trace. */
.trace-steps {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.tstep {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fafbfc;
}

.tstep h3 {
  margin: 0 0 6px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tlabel {
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  background: #eef0f3;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}

.tstep .tbody {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.tnote {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 6px;
}

.tnote.muted {
  margin-top: 12px;
}

.probe-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  display: block;
  max-height: 260px;
  overflow-y: auto;
}

.probe-table th,
.probe-table td {
  text-align: left;
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.probe-table th {
  position: sticky;
  top: 0;
  background: #eef0f3;
  color: var(--muted);
  font-weight: 700;
}

.probe-table .row-pick {
  background: #eef7f1;
  font-weight: 700;
}

.probe-table .row-decoy {
  background: #fbf4e6;
}

/* Back-stage flow panel. */
.flow {
  margin-top: 32px;
  border-top: 2px solid var(--line);
  padding-top: 20px;
}

.flow-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

/* One consistent status vocabulary (rendered as a legend in the panel head). */
.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
}

.tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 999px;
  padding: 3px 10px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.tag.proven {
  color: var(--ok);
  background: #eef7f1;
  border-color: #cfe7d9;
}

.tag.built {
  color: var(--accent);
  background: #eef4f7;
  border-color: #cfe0e8;
}

.tag.mocked {
  color: var(--warn);
  background: #fbf4e6;
  border-color: #efe0bf;
}

.tag.parked {
  color: #7a5cad;
  background: #f2eefa;
  border-color: #ddd0ee;
}

.tag.deferred,
.tag.external {
  color: #6b7280;
  background: #f1f3f6;
  border: 1px dashed #c3c9d2;
}

/* Interface map: Inputs -> five functions -> Outputs -> Consumers. */
.map {
  display: grid;
  gap: 16px;
  margin: 16px 0 0;
}

.group-title {
  margin: 4px 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.group-title .group-sub {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

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

.node {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 14px 16px;
}

.node.proven-node {
  border-left-color: var(--ok);
}

/* DEFERRED / NOT-IMPLEMENTED and EXTERNAL: visibly not a working PoC capability. */
.node.greyed {
  opacity: 0.6;
  border-style: dashed;
  border-left-style: dashed;
  border-left-color: #c3c9d2;
  background: #fafbfc;
}

.node-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.node-top h4 {
  margin: 0;
  font-size: 15px;
  flex: 1 1 auto;
}

.node-top .ordinal {
  color: var(--muted);
  font-weight: 400;
}

.node-note {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}

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

.node-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: #f1f3f6;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

.techniques {
  margin-top: 24px;
}

/* Recommendation options menu (W-DEMO-S15). */
.option-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.option {
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  background: #fafbfc;
}

.option.recommended {
  border-left-color: var(--ok);
  background: #f2f9f5;
}

.option-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.option-label {
  font-weight: 700;
  font-size: 15px;
}

.option-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ok);
  background: #eef7f1;
  border: 1px solid #cfe7d9;
  border-radius: 999px;
  padding: 2px 9px;
}

.option-where {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 13px;
}

.option-band {
  margin: 8px 0 4px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.option-proven {
  font-weight: 600;
}

.option-trade {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.live {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  background: #f3f7f9;
  border: 1px solid #e0e9ee;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 8px 0;
}

.live b {
  color: var(--mean);
}

.live-line {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  margin: 8px 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f1f3f6;
  border: 1px solid var(--line);
}

.live-line.gap {
  color: #4a4f5a;
  background: #eef0f3;
}

.live-line.ok {
  color: var(--ok);
  background: #eef7f1;
  border-color: #cfe7d9;
}
