@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #0b0b0b;
  --surface: #141414;
  --surface-raised: #1b1b19;
  --cream: #f5f3eb;
  --acid: #d9ff43;
  --muted: #92928a;
  --line: #373731;
  --red: #ff6d5e;
  --green: #b9f56b;
  --mono: "DM Mono", Consolas, monospace;
  --display: "Space Grotesk", Inter, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--display);
  -webkit-font-smoothing: antialiased;
}

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

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--acid);
  color: var(--bg);
}

[hidden] {
  display: none !important;
}

/* Global layout */

.site-shell {
  overflow: clip;
}

.section-pad,
.topbar,
.footer {
  width: min(1240px, calc(100% - 64px));
  margin-inline: auto;
}

section {
  scroll-margin-top: 24px;
}

/* Navigation */

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

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

.wordmark-mark,
.footer-brand {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -2px;
}

.wordmark-mark .mark-dot,
.footer-brand span {
  color: var(--acid);
}

.wordmark-sub {
  color: #aaa99f;
  font: 9px/1.5 var(--mono);
}

.topbar-right,
.system-state {
  display: flex;
  align-items: center;
  gap: 14px;
}

.edition,
.system-state {
  font: 10px var(--mono);
}

.edition {
  color: var(--muted);
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #777;
}

.status-dot.online,
.status-dot.connected,
.status-dot.success {
  background: var(--acid);
  box-shadow: 0 0 0 3px #d9ff4322;
}

.status-dot.offline,
.status-dot.error,
.status-dot.failed {
  background: var(--red);
  box-shadow: 0 0 0 3px #ff6d5e22;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cream);
  font-size: 20px;
}

.icon-button:hover {
  border-color: var(--acid);
  color: var(--acid);
}

/* Hero */

.hero {
  padding-top: clamp(60px, 8vw, 112px);
}

.hero-kicker,
.eyebrow {
  color: var(--acid);
  font: 10px var(--mono);
  letter-spacing: .13em;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kicker-line {
  width: 28px;
  height: 2px;
  background: var(--acid);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  align-items: center;
  gap: clamp(32px, 7vw, 96px);
  padding: 30px 0 64px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 26px;
  font-size: clamp(68px, 10.4vw, 142px);
  line-height: .79;
  letter-spacing: -.095em;
  font-weight: 700;
}

.accent-text {
  color: var(--acid);
}

.hero-lede {
  max-width: 450px;
  color: #c3c1b7;
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 25px;
  margin-top: 32px;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 18px;
  border: 1px solid transparent;
  font: 10px var(--mono);
  transition: transform .16s ease, background .16s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.button-acid {
  background: var(--acid);
  color: var(--bg);
  border-color: var(--acid);
  font-weight: 500;
}

.button-acid:hover:not(:disabled) {
  background: var(--cream);
  border-color: var(--cream);
}

.button-outline {
  border-color: #55554d;
  background: transparent;
  color: var(--cream);
}

.button-outline:hover:not(:disabled) {
  border-color: var(--cream);
}

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

.text-link {
  color: #c4c2b9;
  font: 10px var(--mono);
}

.text-link span {
  color: var(--acid);
}

/* Conceptual token illustration */

.hero-visual {
  position: relative;
  min-height: 340px;
  padding: 24px;
  background: var(--acid);
  color: var(--bg);
  border: 1px solid var(--acid);
}

.visual-topline,
.visual-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font: 9px var(--mono);
}

.visual-topline {
  padding-bottom: 18px;
  border-bottom: 1px solid #0b0b0b55;
}

.token-label {
  margin: 24px 0 12px;
  font: 10px var(--mono);
}

.token-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.token {
  display: grid;
  place-items: center;
  min-height: 50px;
  border: 1px solid #0b0b0b55;
  font: 18px var(--mono);
}

.token.rejected {
  opacity: .32;
  text-decoration: line-through;
}

.token.accepted {
  background: var(--bg);
  color: var(--acid);
  border-color: var(--bg);
}

.constraint-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 12px;
  background: var(--bg);
  color: var(--cream);
  font: 9px var(--mono);
}

.rule-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  background: var(--acid);
  color: var(--bg);
}

.rule-pass {
  margin-left: auto;
  color: var(--acid);
}

.visual-footer {
  margin-top: 18px;
}

.visual-stamp {
  position: absolute;
  right: -14px;
  bottom: -24px;
  display: grid;
  place-content: center;
  width: 88px;
  height: 88px;
  border: 1px solid var(--acid);
  border-radius: 50%;
  background: var(--bg);
  color: var(--acid);
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  line-height: .9;
  transform: rotate(10deg);
}

.visual-stamp small {
  margin-top: 6px;
  font: 7px/1.3 var(--mono);
}

.hero-bottomline {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: #a7a69d;
  font: 9px var(--mono);
}

/* Mechanism section */

.mechanism {
  padding-top: clamp(90px, 12vw, 155px);
  padding-bottom: clamp(80px, 10vw, 130px);
}

.eyebrow {
  margin-bottom: 22px;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(42px, 7.4vw, 88px);
  line-height: .91;
  letter-spacing: -.075em;
}

.muted-text {
  color: #74746c;
}

.mechanism-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  margin: 34px 0 46px;
}

.mechanism-intro > p:first-child {
  max-width: 500px;
  margin-bottom: 0;
  color: #c4c2b9;
  font-size: 18px;
  line-height: 1.6;
}

.micro-note {
  max-width: 250px;
  margin-bottom: 0;
  color: var(--muted);
  font: 10px/1.6 var(--mono);
}

.pipeline {
  display: grid;
  grid-template-columns: 1fr 35px 1fr 35px 1fr;
  align-items: stretch;
  gap: 12px;
}

.pipeline-step {
  position: relative;
  min-height: 235px;
  padding: 22px;
  border: 1px solid var(--line);
  background: #111;
}

.step-index {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #77776e;
  font: 11px var(--mono);
}

.step-symbol {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 30px;
  border: 1px solid var(--line);
  color: var(--acid);
  font: 25px var(--mono);
}

.pipeline-step h3 {
  margin-bottom: 12px;
  font: 11px var(--mono);
}

.pipeline-step p {
  max-width: 230px;
  margin-bottom: 0;
  color: #9c9b92;
  font-size: 13px;
  line-height: 1.55;
}

.pipeline-arrow {
  display: grid;
  place-items: center;
  color: var(--acid);
  font-size: 22px;
}

.equation-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
  padding: 19px 22px;
  margin-top: 14px;
  background: var(--acid);
  color: var(--bg);
}

.equation-label,
.equation-note {
  font: 10px var(--mono);
}

.equation-strip code {
  font: 22px var(--mono);
}

.equation-note {
  margin-left: auto;
}

/* Workbench */

.workbench {
  width: 100%;
  max-width: none;
  padding: 78px max(32px, calc((100% - 1240px) / 2)) 110px;
  background: var(--cream);
  color: var(--bg);
}

.workbench-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  margin-bottom: 40px;
}

.workbench .eyebrow {
  color: #4e5b1a;
}

.workbench h2 {
  font-size: clamp(48px, 7.5vw, 86px);
}

.workbench-heading-note {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding-bottom: 8px;
}

.workbench-heading-note p {
  margin: 0;
  color: #5d5c54;
  font: 11px/1.7 var(--mono);
}

.live-square {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  background: #799c00;
}

.control-panel,
.telemetry-panel {
  border: 1px solid #c9c7bc;
  background: #eeece3;
}

.panel-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 0 20px;
  border-bottom: 1px solid #c9c7bc;
  font: 10px var(--mono);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid #aaa99e;
  color: #5c5b52;
  font: 9px var(--mono);
  white-space: nowrap;
}

.status-chip.success,
.status-chip.valid,
.status-chip.connected {
  border-color: #647e00;
  color: #405300;
  background: #d9ff4366;
}

.status-chip.error,
.status-chip.invalid,
.status-chip.failed {
  border-color: #b64335;
  color: #9e2e23;
  background: #ff6d5e1a;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 16px;
  padding: 20px 20px 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.field > span,
.field label {
  color: #69685f;
  font: 9px var(--mono);
  letter-spacing: .07em;
}

.field select,
.field textarea,
.stepper input,
input,
select,
textarea {
  border-radius: 0;
}

.field select,
.field textarea,
.stepper input {
  width: 100%;
  color: var(--bg);
  background: #f8f7f1;
  border: 1px solid #c3c1b5;
  outline: none;
}

.field select {
  height: 43px;
  padding: 0 12px;
  font-size: 13px;
}

.field textarea {
  min-height: 84px;
  padding: 12px;
  resize: vertical;
  font: 12px/1.6 var(--mono);
}

.field textarea:focus,
.field select:focus,
.stepper input:focus {
  border-color: #7b9700;
  box-shadow: 0 0 0 1px #7b9700;
}

.field-steps {
  max-width: 220px;
}

.stepper {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  height: 43px;
}

.stepper button {
  border: 1px solid #c3c1b5;
  background: #e3e1d7;
  color: var(--bg);
  font-size: 18px;
}

.stepper button:hover {
  background: var(--acid);
}

.stepper input {
  min-width: 0;
  border-left: 0;
  border-right: 0;
  text-align: center;
  font: 13px var(--mono);
  appearance: textfield;
}

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

.field-full {
  padding: 20px;
}

.schema-editor {
  min-height: 190px !important;
}

.run-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  padding: 17px 20px;
  border-top: 1px solid #c9c7bc;
}

.run-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 400px;
  color: #6b6a61;
  font: 10px/1.6 var(--mono);
}

.run-note-mark {
  display: grid;
  place-items: center;
  flex: 0 0 16px;
  height: 16px;
  border: 1px solid #9c9a8d;
  border-radius: 50%;
}

.run-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.run-actions .button {
  min-height: 43px;
}

/* Telemetry */

.telemetry-panel {
  margin-top: 18px;
  background: #e6e4da;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric {
  min-width: 0;
  padding: 20px;
  border-right: 1px solid #c9c7bc;
}

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

.metric-label,
.metric-unit {
  display: block;
  color: #6a695f;
  font: 9px var(--mono);
}

.metric strong {
  display: block;
  margin: 12px 0 6px;
  font: 700 clamp(23px, 3vw, 34px)/1 var(--display);
  letter-spacing: -.06em;
  overflow-wrap: anywhere;
}

.metric-unit {
  font-size: 9px;
  line-height: 1.5;
}

.meter {
  height: 5px;
  margin-top: 13px;
  background: #c6c4b8;
}

.meter span,
#maskBarFill {
  display: block;
  width: 0;
  height: 100%;
  background: #7a9700;
  transition: width .25s ease;
}

.telemetry-lower {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid #c9c7bc;
}

.telemetry-subpanel {
  min-height: 90px;
  padding: 16px 20px;
}

.telemetry-subpanel + .telemetry-subpanel {
  border-left: 1px solid #c9c7bc;
}

.subpanel-label {
  display: block;
  margin-bottom: 12px;
  color: #6a695f;
  font: 9px var(--mono);
}

.token-samples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.token-samples .token-chip {
  display: inline-block;
  padding: 5px 7px;
  background: #d8d6ca;
  border: 1px solid #c0beb2;
  font: 10px var(--mono);
}

.placeholder,
.grammar-state {
  color: #77766d;
  font: 10px/1.6 var(--mono);
}

/* Side-by-side model outputs */

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

.output-card {
  min-width: 0;
  background: #121212;
  color: var(--cream);
  border: 1px solid #30302a;
}

.output-ice {
  border-top: 4px solid var(--acid);
}

.output-baseline {
  border-top: 4px solid #77776e;
}

.output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 19px 20px 16px;
}

.path-index {
  display: block;
  margin-bottom: 7px;
  color: #a4a398;
  font: 9px var(--mono);
}

.output-head h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -.04em;
}

.output-ice .output-head h3 {
  color: var(--acid);
}

.output-meta,
.output-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  color: #8d8d83;
  font: 9px var(--mono);
  border-top: 1px solid #30302a;
  border-bottom: 1px solid #30302a;
}

.code-output,
#iceOutput,
#baseOutput {
  min-height: 220px;
  max-height: 440px;
  overflow: auto;
  margin: 0;
  padding: 20px;
  background: #0e0e0e;
  color: #e2e0d6;
  font: 12px/1.7 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.output-ice .code-output,
#iceOutput {
  color: #e9f7bd;
}

.output-foot {
  border-top: 0;
  border-bottom: 0;
  color: #9d9c91;
}

.error-banner {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid #b64335;
  background: #ff6d5e15;
  color: #9e2e23;
  font: 11px/1.6 var(--mono);
}

/* Validation report */

.results-section {
  margin-top: 76px;
}

.results-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  margin-bottom: 25px;
}

.results-heading .eyebrow {
  margin-bottom: 12px;
}

.results-heading h3 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: .95;
  letter-spacing: -.06em;
}

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

.result-card {
  min-width: 0;
  border: 1px solid #c9c7bc;
  background: #eeece3;
}

.result-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 17px;
  border-bottom: 1px solid #c9c7bc;
  font: 10px var(--mono);
}

.result-error {
  color: #9e2e23;
  overflow-wrap: anywhere;
}

.checks-list {
  padding: 14px 17px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 0;
  border-bottom: 1px solid #d5d3c9;
  font: 11px/1.5 var(--mono);
}

.check-row:last-child {
  border-bottom: 0;
}

.check-icon {
  display: grid;
  place-items: center;
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  border: 1px solid currentColor;
  font-size: 10px;
}

.check-row.pass .check-icon {
  color: #4f6800;
}

.check-row.fail .check-icon {
  color: #a8392e;
}

.empty-checks {
  margin: 0;
  color: #77766d;
  font: 10px/1.6 var(--mono);
}

.final-text {
  max-height: 240px;
  overflow: auto;
  margin: 0;
  padding: 15px 17px;
  border-top: 1px solid #c9c7bc;
  background: #e6e4da;
  color: #4c4b43;
  font: 10px/1.6 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Architecture */

.architecture {
  padding-top: 100px;
  padding-bottom: 80px;
}

.architecture-intro {
  max-width: 580px;
  margin: 28px 0 34px;
  color: #aaa99f;
  font-size: 15px;
  line-height: 1.7;
}

.architecture-diagram,
#stateDiagram {
  display: grid;
  grid-template-columns: 1fr 30px 1fr 30px 1fr 30px 1fr;
  align-items: center;
  gap: 10px;
}

.diagram-node {
  min-height: 120px;
  padding: 17px;
  border: 1px solid var(--line);
  background: #111;
}

.diagram-node > span {
  display: block;
  margin-bottom: 24px;
  color: #77776e;
  font: 10px var(--mono);
}

.diagram-node b {
  display: block;
  margin-bottom: 7px;
  font: 11px var(--mono);
}

.diagram-node small {
  color: #929188;
  font: 10px/1.5 var(--mono);
}

.diagram-highlight {
  background: var(--acid);
  border-color: var(--acid);
  color: var(--bg);
}

.diagram-highlight > span,
.diagram-highlight small {
  color: #3e471f;
}

.diagram-connector {
  text-align: center;
  color: var(--acid);
  font-size: 20px;
}

.architecture-foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: #8c8b82;
  font: 9px/1.6 var(--mono);
}

/* Footer and notifications */

.footer {
  display: flex;
  align-items: center;
  gap: 25px;
  padding: 24px 0 30px;
  border-top: 1px solid var(--line);
}

.footer-brand {
  font-size: 27px;
}

.footer p {
  margin: 0;
  color: #c4c2b9;
  font: 9px/1.7 var(--mono);
}

.footer p span {
  color: #77776e;
}

.footer-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: #99988f;
  font: 9px var(--mono);
}

.back-top {
  color: var(--acid);
  font: 9px var(--mono);
  white-space: nowrap;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: min(420px, calc(100% - 48px));
  padding: 13px 16px;
  background: var(--acid);
  color: var(--bg);
  box-shadow: 5px 5px 0 #0008;
  font: 11px/1.5 var(--mono);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.visible,
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive layout */

@media (max-width: 900px) {
  .section-pad,
  .topbar,
  .footer {
    width: calc(100% - 40px);
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .hero-visual {
    max-width: 620px;
    width: 100%;
  }

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

  .pipeline-step {
    min-height: auto;
  }

  .pipeline-arrow {
    min-height: 20px;
    transform: rotate(90deg);
  }

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

  .metric:nth-child(3) {
    border-right: 0;
  }

  .metric:nth-child(n+4) {
    border-top: 1px solid #c9c7bc;
  }

  .architecture-diagram,
  #stateDiagram {
    grid-template-columns: 1fr 24px 1fr;
  }

  .footer {
    flex-wrap: wrap;
  }

  .footer-status {
    margin-left: 0;
  }
}

@media (max-width: 620px) {
  .section-pad,
  .topbar,
  .footer {
    width: calc(100% - 32px);
  }

  .topbar {
    min-height: 72px;
  }

  .wordmark-sub,
  .edition {
    display: none;
  }

  .topbar-right {
    gap: 10px;
  }

  .system-state {
    font-size: 8px;
  }

  .hero {
    padding-top: 54px;
  }

  .hero-grid {
    padding-top: 25px;
    padding-bottom: 45px;
  }

  h1 {
    font-size: clamp(64px, 18vw, 100px);
  }

  .hero-visual {
    min-height: 320px;
    padding: 17px;
  }

  .hero-bottomline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    line-height: 1.5;
  }

  .mechanism {
    padding-top: 82px;
    padding-bottom: 75px;
  }

  .mechanism-intro {
    display: block;
    margin: 25px 0 30px;
  }

  .mechanism-intro > p:first-child {
    font-size: 16px;
  }

  .micro-note {
    margin-top: 15px;
  }

  .equation-strip {
    gap: 12px;
    padding: 16px;
  }

  .equation-label {
    width: 100%;
  }

  .equation-note {
    margin-left: 0;
    font-size: 9px;
  }

  .workbench {
    padding: 62px 16px 75px;
  }

  .workbench-heading {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 28px;
  }

  .workbench-heading-note {
    padding: 0;
  }

  .panel-head {
    padding-inline: 13px;
    font-size: 9px;
  }

  .control-grid {
    grid-template-columns: 1fr;
    padding: 16px 13px 0;
  }

  .field-steps {
    max-width: none;
  }

  .field-full {
    padding: 16px 13px;
  }

  .run-row {
    padding: 15px 13px;
    align-items: stretch;
  }

  .run-actions {
    width: 100%;
  }

  .run-actions .button {
    flex: 1;
    padding-inline: 10px;
    gap: 9px;
    font-size: 9px;
  }

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

  .metric {
    padding: 15px 13px;
    border-top: 1px solid #c9c7bc;
  }

  .metric:nth-child(odd) {
    border-right: 1px solid #c9c7bc;
  }

  .metric:nth-child(even) {
    border-right: 0;
  }

  .metric:first-child,
  .metric:nth-child(2) {
    border-top: 0;
  }

  .metric strong {
    font-size: 28px;
  }

  .telemetry-lower {
    grid-template-columns: 1fr;
  }

  .telemetry-subpanel + .telemetry-subpanel {
    border-left: 0;
    border-top: 1px solid #c9c7bc;
  }

  .comparison-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .output-head {
    padding-inline: 14px;
  }

  .output-meta,
  .output-foot {
    padding-inline: 14px;
    font-size: 8px;
  }

  .code-output,
  #iceOutput,
  #baseOutput {
    min-height: 180px;
    padding: 15px;
    font-size: 11px;
  }

  .results-heading {
    display: block;
  }

  .results-heading h3 {
    margin-top: 18px;
  }

  .architecture {
    padding-top: 75px;
    padding-bottom: 60px;
  }

  .architecture-diagram,
  #stateDiagram {
    grid-template-columns: 1fr 20px 1fr;
    gap: 8px;
  }

  .diagram-node {
    padding: 12px;
    min-height: 110px;
  }

  .diagram-node b,
  .diagram-node small {
    font-size: 9px;
  }

  .diagram-node > span {
    margin-bottom: 18px;
  }

  .architecture-foot {
    display: grid;
  }

  .footer {
    gap: 14px;
  }

  .footer p {
    flex: 1;
    min-width: 180px;
  }

  .footer-status {
    order: 3;
  }

  .back-top {
    margin-left: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}


/* ICE grammar trace viewer: readable, aligned rows */
.trace-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  margin-top: 20px;
  overflow-x: auto;
}

.trace-row {
  display: grid;
  grid-template-columns: 48px 76px minmax(180px, 1fr) minmax(180px, 1fr);
  align-items: center;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.025);
  color: #f5f3eb;
  font-size: 12px;
  line-height: 1.5;
}

.trace-row code,
.trace-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.trace-row code {
  color: #d5ff35;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.trace-row .trace-char {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 24px;
  padding: 3px 6px;
  border: 1px solid rgba(213, 255, 53, 0.25);
  color: #d5ff35;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
  overflow-wrap: normal;
}

.trace-row span:nth-child(3),
.trace-row span:nth-child(4) {
  color: #e8e8e2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.trace-row.trace-dead {
  border-color: rgba(255, 104, 104, 0.65);
  background: rgba(255, 70, 70, 0.08);
}

.trace-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 12px;
}

.trace-summary span {
  color: #a5a59e;
}

@media (max-width: 700px) {
  .trace-row {
    grid-template-columns: 36px 62px minmax(150px, 1fr) minmax(150px, 1fr);
    gap: 8px;
    padding: 10px 8px;
  }
}

/* FIX: prevent ICE grammar trace rows from collapsing */
#stateDiagram {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

#stateDiagram .trace-list {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  gap: 8px !important;
  margin-top: 20px !important;
  overflow-x: auto !important;
  box-sizing: border-box !important;
}

#stateDiagram .trace-row {
  display: grid !important;
  grid-template-columns: 48px 80px minmax(180px, 1fr) minmax(180px, 1fr) !important;
  align-items: center !important;
  justify-items: stretch !important;
  width: 100% !important;
  min-width: 600px !important;
  max-width: none !important;
  height: auto !important;
  min-height: 48px !important;
  box-sizing: border-box !important;
  padding: 10px 14px !important;
  gap: 12px !important;
  overflow: visible !important;
  line-height: 1.5 !important;
}

#stateDiagram .trace-row > * {
  display: block !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
  white-space: normal !important;
}

#stateDiagram .trace-row > code {
  color: #caff35 !important;
  font-family: monospace !important;
}

#stateDiagram .trace-row .trace-char {
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  min-height: 28px !important;
  padding: 4px 6px !important;
  color: #caff35 !important;
  border: 1px solid rgba(202, 255, 53, 0.25) !important;
  font-family: monospace !important;
  white-space: pre !important;
}

#stateDiagram .trace-summary {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
  margin-bottom: 12px !important;
}

#stateDiagram .trace-dead {
  border-color: #ff6868 !important;
  background: rgba(255, 70, 70, 0.08) !important;
}

@media (max-width: 700px) {
  #stateDiagram .trace-row {
    grid-template-columns: 36px 65px minmax(160px, 1fr) minmax(160px, 1fr) !important;
    gap: 8px !important;
    padding: 10px 8px !important;
  }
}

/* =========================================================
   ICE — COMPACT GRAMMAR ANALYSIS SUMMARY
   Append to the END of the existing style.css.
   ========================================================= */

/* Hide the old character-by-character trace if it remains. */
#stateDiagram .trace-list,
#stateDiagram .trace-row {
  display: none !important;
}

/* Compact summary panel */
#stateDiagram .ice-trace-summary {
  width: 100%;
  box-sizing: border-box;
  margin: 18px 0 28px;
  padding: 24px;
  color: var(--text, #edf4f6);
  background: var(--panel, #101720);
  border: 1px solid var(--line-strong, rgba(219, 231, 242, 0.19));
  border-radius: 10px;
  overflow-wrap: anywhere;
}

/* Summary heading */
#stateDiagram .ice-trace-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line, rgba(219, 231, 242, 0.11));
}

#stateDiagram .ice-trace-eyebrow {
  margin-bottom: 5px;
  color: var(--muted, #85939e);
  font-family: var(--mono, monospace);
  font-size: 9px;
  letter-spacing: 0.12em;
}

#stateDiagram .ice-trace-heading h3 {
  margin: 0;
  color: var(--text, #edf4f6);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.035em;
}

/* Status indicator */
#stateDiagram .ice-trace-dot {
  display: block;
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

#stateDiagram .ice-trace-dot.success {
  background: var(--green, #83f0bd);
  box-shadow: 0 0 12px rgba(131, 240, 189, 0.3);
}

#stateDiagram .ice-trace-dot.warning {
  background: var(--amber, #f0c77a);
}

/* Three summary metrics */
#stateDiagram .ice-trace-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 20px 0;
}

#stateDiagram .ice-trace-metric {
  min-width: 0;
  padding: 16px;
  background: var(--panel-2, #0d141c);
  border: 1px solid var(--line, rgba(219, 231, 242, 0.11));
  border-radius: 7px;
}

#stateDiagram .ice-trace-metric > span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted, #85939e);
  font-family: var(--mono, monospace);
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 0.07em;
}

#stateDiagram .ice-trace-metric > strong {
  display: block;
  color: var(--green, #83f0bd);
  font-family: var(--mono, monospace);
  font-size: clamp(12px, 1.4vw, 16px);
  font-weight: 500;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

#stateDiagram .ice-trace-note {
  margin: 0;
  color: var(--muted, #85939e);
  font-size: 11px;
  line-height: 1.8;
}

/* Mobile layout */
@media (max-width: 700px) {
  #stateDiagram .ice-trace-summary {
    padding: 17px;
  }

  #stateDiagram .ice-trace-metrics {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  #stateDiagram .ice-trace-metric {
    padding: 13px;
  }
}