:root {
  color-scheme: dark;
  --bg: #06111d;
  --bg-deep: #030a12;
  --surface: #0a1a2a;
  --surface-2: #0d2135;
  --surface-3: #112941;
  --line: rgba(139, 190, 231, 0.16);
  --line-strong: rgba(139, 190, 231, 0.30);
  --text: #eaf5ff;
  --muted: #87a5bd;
  --faint: #55738a;
  --blue: #3f96ff;
  --blue-2: #75bbff;
  --cyan: #46d8e8;
  --amber: #ffbf55;
  --red: #ff7070;
  --green: #69d6a0;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg-deep); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 84% -12%, rgba(49, 129, 216, .24), transparent 32rem),
    linear-gradient(180deg, #071522 0%, #06111d 56%, #040b13 100%);
}
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 2px; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 68px;
  display: grid;
  grid-template-columns: 270px 1fr 270px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 13, 22, .9);
  backdrop-filter: blur(18px);
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.brand img { width: 40px; height: 40px; filter: drop-shadow(0 0 18px rgba(63, 150, 255, .28)); }
.brand > div { display: flex; flex-direction: column; line-height: 1; }
.brand-family { font-size: 13px; letter-spacing: .15em; font-weight: 800; color: #c8dced; }
.brand-family span { color: var(--blue-2); }
.brand strong { font-size: 16px; letter-spacing: .12em; margin-top: 5px; }
.topbar-center { justify-self: center; display: flex; align-items: center; gap: 12px; }
.system-label { font-size: 11px; letter-spacing: .18em; color: var(--muted); }
.version-pill, .live-tag, .state-tag {
  border: 1px solid var(--line-strong);
  background: rgba(63, 150, 255, .08);
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--blue-2);
  font-size: 10px;
  letter-spacing: .12em;
  font-weight: 800;
}
.system-health { justify-self: end; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.health-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 5px rgba(85, 115, 138, .1); }
.health-dot.good { background: var(--green); box-shadow: 0 0 0 5px rgba(105, 214, 160, .1), 0 0 16px rgba(105, 214, 160, .5); }
.health-dot.bad { background: var(--red); box-shadow: 0 0 0 5px rgba(255, 112, 112, .1); }
.health-dot.pending { animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .35; } }

.primary-nav {
  height: 46px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 17, 29, .94);
  position: sticky;
  top: 68px;
  z-index: 29;
}
.nav-button {
  height: 100%;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 15px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .04em;
  cursor: pointer;
}
.nav-button:hover { color: var(--text); }
.nav-button.active { color: var(--text); border-bottom-color: var(--blue); }
.nav-button.muted { color: var(--faint); cursor: not-allowed; }
.nav-button span { font-size: 8px; border: 1px solid var(--line); border-radius: 4px; padding: 2px 4px; margin-left: 5px; }
.nav-spacer { flex: 1; }
.clock { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; letter-spacing: .08em; }

main { width: 100%; max-width: 1680px; margin: 0 auto; flex: 1; padding: 30px 34px 50px; }
.view { display: none; }
.view.active { display: block; animation: appear .25s ease; }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.eyebrow { color: var(--blue-2); font-size: 10px; font-weight: 850; letter-spacing: .18em; text-transform: uppercase; }

.hero-grid { display: grid; grid-template-columns: 1.55fr .9fr; gap: 28px; min-height: 420px; }
.hero-copy {
  padding: 52px 54px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(105deg, rgba(9, 28, 46, .96), rgba(8, 24, 40, .75)),
    repeating-linear-gradient(90deg, transparent 0 49px, rgba(255,255,255,.02) 50px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero-copy::after {
  content: "";
  position: absolute;
  width: 360px; height: 360px;
  right: -90px; top: -110px;
  border: 1px solid rgba(91, 168, 255, .2);
  border-radius: 50%;
  box-shadow: 0 0 0 50px rgba(63, 150, 255, .025), 0 0 0 100px rgba(63, 150, 255, .018);
}
.hero-copy h1 { font-size: clamp(42px, 5vw, 72px); line-height: .98; letter-spacing: -.055em; margin: 18px 0 22px; max-width: 880px; }
.hero-copy h1 span { color: var(--blue-2); }
.hero-copy p { max-width: 720px; color: #a8c0d2; font-size: 17px; line-height: 1.65; }
.hero-actions { display: flex; gap: 12px; margin-top: 30px; position: relative; z-index: 2; }
.button {
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface-2);
  padding: 10px 14px;
  font-size: 12px;
  letter-spacing: .04em;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(117, 187, 255, .58); }
.button:disabled { opacity: .4; cursor: not-allowed; }
.button.primary { background: linear-gradient(180deg, #358fea, #1769c8); border-color: #5ca8ff; box-shadow: 0 10px 30px rgba(23, 105, 200, .25); }
.button.secondary { background: rgba(63, 150, 255, .12); border-color: rgba(92, 168, 255, .45); color: #cfe8ff; }
.button.ghost { background: rgba(255,255,255,.025); }
.button.large { padding: 14px 19px; font-size: 13px; }
.button.mini { padding: 7px 10px; font-size: 10px; }
.button.pulse { box-shadow: 0 0 0 0 rgba(63, 150, 255, .35); animation: softPulse 2.8s infinite; }
@keyframes softPulse { 70% { box-shadow: 0 0 0 10px rgba(63, 150, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(63, 150, 255, 0); } }

.hero-instrument, .panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 33, 53, .88), rgba(8, 23, 38, .9));
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
.hero-instrument { padding: 24px; }
.instrument-head, .panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #c7dceb; font-size: 10px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.pipeline.vertical { margin-top: 25px; display: flex; flex-direction: column; align-items: stretch; }
.pipe-node { border: 1px solid var(--line); border-radius: 10px; padding: 14px 15px; background: rgba(3,12,21,.42); }
.pipe-node b { color: var(--blue-2); font-family: ui-monospace, monospace; margin-right: 12px; }
.pipe-node span { color: #bdd2e2; font-size: 11px; letter-spacing: .08em; }
.pipe-node.live { border-color: rgba(70, 216, 232, .28); background: linear-gradient(90deg, rgba(70, 216, 232, .06), transparent); }
.pipe-node.future { opacity: .64; border-style: dashed; }
.pipe-link { height: 19px; width: 1px; background: linear-gradient(var(--blue), rgba(63,150,255,.1)); margin-left: 28px; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 46px 2px 18px; }
.section-heading.narrow { margin-top: 8px; }
h2 { font-size: 30px; letter-spacing: -.025em; margin: 7px 0 0; }
.section-heading p { max-width: 620px; text-align: right; color: var(--muted); margin: 0; }
.module-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.module-card {
  min-height: 238px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(13, 34, 54, .94), rgba(6, 19, 31, .95));
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.module-card::after { content: ""; position: absolute; inset: auto -40px -70px auto; width: 140px; height: 140px; border: 1px solid rgba(92,168,255,.12); border-radius: 50%; }
.module-card.available { border-color: rgba(92,168,255,.45); box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 16px 35px rgba(8, 91, 166, .12); }
.module-card.future { opacity: .72; }
.module-head { display: flex; justify-content: space-between; align-items: center; }
.module-number { font-family: ui-monospace, monospace; color: var(--faint); font-size: 12px; }
.module-status { border: 1px solid var(--line); border-radius: 999px; padding: 4px 7px; color: var(--faint); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.module-card.available .module-status { color: var(--green); border-color: rgba(105,214,160,.3); background: rgba(105,214,160,.06); }
.module-card h3 { margin: 24px 0 10px; font-size: 21px; letter-spacing: -.02em; }
.module-card p { margin: 0 0 18px; color: var(--muted); line-height: 1.45; font-size: 13px; }
.module-caps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; margin-bottom: 16px; }
.module-caps span { font-size: 9px; color: #91aec3; border: 1px solid var(--line); padding: 4px 6px; border-radius: 4px; }
.module-card .button { align-self: stretch; position: relative; z-index: 2; }
.principle-strip { margin-top: 24px; border: 1px solid rgba(70,216,232,.25); border-radius: 14px; padding: 20px 24px; display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 22px; background: linear-gradient(90deg, rgba(70,216,232,.07), rgba(63,150,255,.025)); }
.principle-mark { font-size: 28px; font-weight: 900; color: var(--cyan); border-right: 1px solid var(--line-strong); }
.principle-strip h3 { margin: 4px 0 0; font-size: 18px; }
.principle-equation { font-family: ui-monospace, monospace; color: #bee8ee; font-size: 14px; }

.workspace-header { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 20px; }
.workspace-header h1 { margin: 6px 0 7px; font-size: 42px; letter-spacing: -.045em; }
.workspace-header p { color: var(--muted); margin: 0; }
.crumb { border: 0; background: transparent; color: var(--muted); padding: 0; margin-bottom: 15px; font-size: 10px; letter-spacing: .12em; font-weight: 800; cursor: pointer; }
.workspace-actions { display: flex; gap: 9px; }
.status-ribbon { display: grid; grid-template-columns: 1.4fr .8fr 1fr 1fr .7fr; border: 1px solid var(--line); border-radius: 11px; background: rgba(7, 22, 36, .78); margin-bottom: 14px; overflow: hidden; }
.status-ribbon > div { padding: 12px 15px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.status-ribbon > div:last-child { border: 0; }
.status-key { color: var(--faint); font-size: 8px; font-weight: 900; letter-spacing: .16em; }
.status-ribbon strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; letter-spacing: .05em; }
.good { color: var(--green) !important; }
.warn { color: var(--amber) !important; }
.bad { color: var(--red) !important; }
.workspace-tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.workspace-tab { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: 12px 18px; font-size: 10px; font-weight: 900; letter-spacing: .12em; cursor: pointer; }
.workspace-tab.active { color: var(--text); border-bottom-color: var(--blue); }
.workspace-pane { display: none; }
.workspace-pane.active { display: block; }
.workspace-grid { display: grid; grid-template-columns: minmax(420px, 560px) 1fr; gap: 16px; }
.control-column { display: flex; flex-direction: column; gap: 12px; }
.visual-column { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.panel { padding: 18px; }
.panel.compact { padding: 15px 17px 17px; }
.panel-index { color: var(--faint); font-family: ui-monospace, monospace; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.field-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { margin-top: 12px; }
.field span { color: #8eaabf; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.field em { color: var(--faint); font-style: normal; font-weight: 600; text-transform: none; }
.field input, .field select {
  width: 100%; min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(2, 11, 19, .62);
  color: var(--text);
  padding: 9px 10px;
  font-size: 12px;
}
.field input:hover, .field select:hover { border-color: var(--line-strong); }
.field.emphasized input { border-color: rgba(70,216,232,.32); background: rgba(70,216,232,.045); }
.field.critical input { border-color: rgba(255,191,85,.42); background: rgba(255,191,85,.055); color: #ffe0a8; font-weight: 800; }
.upload-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--faint); font-size: 10px; }
.rate-callout { margin-top: 12px; display: flex; justify-content: space-between; gap: 12px; padding: 9px 11px; border-left: 3px solid var(--amber); background: rgba(255,191,85,.055); }
.rate-callout strong { color: #ffdc9f; font-size: 10px; letter-spacing: .04em; }
.rate-callout span { color: var(--muted); font-size: 9px; text-align: right; }
.mini-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.mini-metrics div { border: 1px solid var(--line); border-radius: 7px; padding: 8px; background: rgba(2,11,19,.35); }
.mini-metrics span { display: block; color: var(--faint); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.mini-metrics b { display: block; margin-top: 4px; font-family: ui-monospace, monospace; font-size: 12px; color: #cbe4f6; }

.tunnel-visual-panel { position: relative; min-height: 520px; overflow: hidden; padding-bottom: 42px; }
.tunnel-visual-panel::before { content: ""; position: absolute; inset: 56px 18px 42px; border: 1px solid rgba(117,187,255,.08); pointer-events: none; }
#flowCanvas { width: 100%; height: 430px; display: block; margin-top: 14px; background: radial-gradient(circle at 50% 48%, rgba(28,81,125,.18), transparent 52%); border-radius: 8px; }
.visual-badges { display: flex; gap: 6px; }
.visual-badges span { color: var(--faint); border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px; font-size: 8px; }
.axis-legend { position: absolute; left: 28px; bottom: 15px; display: flex; gap: 16px; font-size: 8px; font-weight: 850; letter-spacing: .09em; }
.axis-x { color: var(--blue-2); }.axis-y { color: var(--cyan); }.axis-z { color: var(--amber); }
.visual-overlay { position: absolute; top: 80px; border: 1px solid var(--line); background: rgba(3,12,21,.72); backdrop-filter: blur(10px); border-radius: 8px; padding: 10px; display: grid; grid-template-columns: auto auto; gap: 4px 10px; }
.visual-overlay.left { left: 30px; }.visual-overlay.right { right: 30px; }
.visual-overlay span { color: var(--faint); font-size: 9px; font-weight: 800; }
.visual-overlay b { font-family: ui-monospace, monospace; color: #d8edfc; font-size: 11px; text-align: right; }
.split-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.readiness-list { display: grid; gap: 8px; margin-top: 15px; }
.readiness-row { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; font-size: 11px; color: #a9c0d1; }
.readiness-icon { width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; background: rgba(105,214,160,.09); color: var(--green); font-size: 9px; }
.readiness-row.warn .readiness-icon { color: var(--amber); background: rgba(255,191,85,.09); }
.readiness-row em { color: var(--faint); font-style: normal; font-size: 9px; }
.panel-copy { color: var(--muted); line-height: 1.5; font-size: 12px; }
.handoff-actions { display: flex; gap: 8px; margin-top: 17px; }
.solver-note { margin-top: 12px; padding: 8px 10px; background: rgba(255,191,85,.055); border: 1px solid rgba(255,191,85,.16); color: #cbb98f; border-radius: 6px; font-size: 9px; line-height: 1.4; }

.result-hero { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding: 10px 2px 20px; }
.result-hero h2 { margin-bottom: 5px; }
.result-hero p { color: var(--muted); margin: 0; }
.result-actions { display: flex; gap: 8px; }
.warning-banner { display: flex; gap: 14px; align-items: center; padding: 11px 15px; border-radius: 8px; border: 1px solid rgba(255,191,85,.25); background: rgba(255,191,85,.055); color: #ccb987; font-size: 11px; margin-bottom: 14px; }
.warning-banner strong { color: var(--amber); letter-spacing: .12em; font-size: 9px; }
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi { border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(180deg, rgba(14,35,56,.9), rgba(7,22,35,.9)); padding: 14px; }
.kpi span { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .1em; }
.kpi b { display: block; margin: 8px 0 4px; font-family: ui-monospace, monospace; font-size: 23px; color: #d9efff; }
.kpi em { color: var(--faint); font-size: 9px; font-style: normal; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.chart-panel canvas { width: 100%; height: 320px; display: block; margin-top: 10px; }
.result-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.matrix { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.matrix.five { grid-template-columns: repeat(5, 1fr); }
.matrix div { background: rgba(2,11,19,.36); border: 1px solid var(--line); border-radius: 7px; padding: 12px; }
.matrix span { display: block; color: var(--faint); font-size: 10px; }
.matrix b { display: block; margin-top: 5px; font-family: ui-monospace, monospace; font-size: 13px; }

.table-panel { padding: 0; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--line); font-size: 11px; }
th { color: var(--faint); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; background: rgba(4,14,23,.42); }
td { color: #acc3d4; }
td code { color: var(--blue-2); }
.status-chip { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 4px 7px; font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.status-chip.completed { color: var(--green); border-color: rgba(105,214,160,.28); }
.status-chip.running, .status-chip.queued { color: var(--amber); border-color: rgba(255,191,85,.28); }
.status-chip.failed { color: var(--red); border-color: rgba(255,112,112,.28); }
.empty-cell { text-align: center; color: var(--faint); padding: 30px; }

.pipeline-intro { display: grid; grid-template-columns: 1.25fr .75fr; gap: 20px; align-items: stretch; margin: 16px 0 26px; }
.pipeline-intro p { color: var(--muted); line-height: 1.6; max-width: 850px; }
.equation-card { border: 1px solid rgba(70,216,232,.25); border-radius: 12px; background: rgba(70,216,232,.05); padding: 22px; display: flex; flex-direction: column; justify-content: center; }
.equation-card span { color: var(--faint); font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.equation-card b { color: #caf4f7; font-family: ui-monospace, monospace; font-size: 17px; margin-top: 10px; line-height: 1.5; }
.pipeline.horizontal { display: grid; grid-template-columns: 1fr 35px 1fr 35px 1fr 35px 1fr 35px 1fr; align-items: center; }
.pipeline.horizontal .pipe-node { min-height: 155px; display: flex; flex-direction: column; gap: 8px; }
.pipeline.horizontal .pipe-node b { margin: 0; }
.pipeline.horizontal .pipe-node strong { font-size: 12px; letter-spacing: .08em; }
.pipeline.horizontal .pipe-node span { line-height: 1.6; font-size: 10px; }
.pipe-arrow { text-align: center; color: var(--blue); font-size: 20px; }
.contract-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
.contract-grid code { display: block; color: #a8c8dc; line-height: 1.8; font-size: 12px; margin-top: 15px; }

footer { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 28px; border-top: 1px solid var(--line); color: var(--faint); font-size: 9px; letter-spacing: .05em; background: rgba(3,10,18,.86); }
.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 8px; width: min(380px, calc(100vw - 36px)); }
.toast { border: 1px solid var(--line-strong); border-left: 3px solid var(--blue); background: rgba(7,22,36,.96); box-shadow: var(--shadow); border-radius: 9px; padding: 12px 14px; color: #c8ddec; font-size: 11px; animation: toastIn .2s ease; }
.toast.error { border-left-color: var(--red); }.toast.success { border-left-color: var(--green); }.toast.warn { border-left-color: var(--amber); }
@keyframes toastIn { from { opacity: 0; transform: translateX(10px); } }
dialog { width: min(1000px, 92vw); height: min(720px, 84vh); border: 1px solid var(--line-strong); border-radius: 12px; background: #071522; color: var(--text); padding: 0; box-shadow: 0 40px 100px rgba(0,0,0,.55); }
dialog::backdrop { background: rgba(0,5,10,.72); backdrop-filter: blur(4px); }
.dialog-head { height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--line); }
.dialog-head button { border: 0; background: transparent; color: var(--muted); font-size: 24px; cursor: pointer; }
dialog pre { margin: 0; padding: 18px; height: calc(100% - 50px); overflow: auto; color: #9dc4dc; font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }

@media (max-width: 1250px) {
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .workspace-grid { grid-template-columns: 460px 1fr; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .pipeline.horizontal { grid-template-columns: 1fr; gap: 8px; }
  .pipe-arrow { transform: rotate(90deg); }
}
@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr auto; padding: 0 16px; }
  .topbar-center { display: none; }
  .primary-nav { padding: 0 12px; overflow-x: auto; }
  main { padding: 20px 15px 40px; }
  .hero-grid, .workspace-grid, .chart-grid, .result-detail-grid, .pipeline-intro { grid-template-columns: 1fr; }
  .hero-copy { padding: 35px 28px; }
  .workspace-header { align-items: flex-start; flex-direction: column; }
  .status-ribbon { grid-template-columns: repeat(2, 1fr); }
  .status-ribbon > div { border-bottom: 1px solid var(--line); }
  .principle-strip { grid-template-columns: 80px 1fr; }
  .principle-equation { grid-column: 1 / -1; }
  .contract-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .system-health { display: none; }
  .topbar { grid-template-columns: 1fr; }
  .module-grid, .split-panels, .kpi-grid { grid-template-columns: 1fr; }
  .field-row, .field-row.three, .field-row.four { grid-template-columns: 1fr 1fr; }
  .hero-copy h1 { font-size: 42px; }
  .hero-actions, .workspace-actions, .result-actions, .handoff-actions { flex-direction: column; width: 100%; }
  .section-heading, .result-hero { align-items: flex-start; flex-direction: column; }
  .section-heading p { text-align: left; }
  .matrix.five { grid-template-columns: repeat(2, 1fr); }
  footer { flex-direction: column; align-items: flex-start; padding: 14px 18px; }
}
