:root {
  color-scheme:light;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  background:var(--paper);
  color:var(--ink);
  font-synthesis:none;
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
}

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

a:hover {
  text-decoration:underline;
}

button,a,summary {
  touch-action:manipulation;
}

button:focus-visible,a:focus-visible,summary:focus-visible {
  outline:3px solid var(--blue-mid);
  outline-offset:4px;
}

button {
  font:inherit;
  font-weight:600;
  font-size:13px;
  border:1px solid var(--line-strong);
  border-radius:7px;
  background:var(--surface);
  color:var(--ink);
  padding:11px 15px;
  cursor:pointer;
}

button:hover:not(:disabled) {
  background:var(--line);
}

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

button.primary {
  background:var(--ink);
  color:var(--on-ink);
  border-color:var(--ink);
}

button.primary:hover:not(:disabled) {
  background:var(--teal-solid);
}

button.quiet {
  background:transparent;
}

button:disabled:hover {
  background:inherit;
}

button.primary:disabled:hover {
  background:var(--ink);
}

[hidden] {
  display:none!important;
}

.skip-link {
  position:absolute;
  top:-100px;
  left:20px;
  background:var(--surface);
  padding:12px;
  z-index:10;
}

.skip-link:focus {
  top:8px;
}








main {
  max-width:1480px;
  margin:auto;
  padding:35px 24px 24px;
}

.intro {
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:28px;
  margin-bottom:27px;
}

.eyebrow {
  font-size:11px;
  letter-spacing:1.8px;
  font-weight:650;
  color:var(--muted);
  margin:0 0 10px;
}

h1 {
  font-size:clamp(25px,2.7vw,38px);
  font-weight:650;
  letter-spacing:-1.3px;
  margin:0 0 11px;
}

.intro p:not(.eyebrow) {
  font-size:14px;
  line-height:1.7;
  color:var(--muted);
  margin:0;
}

.progress-card {
  min-width:205px;
  max-width:265px;
  text-align:right;
}

.progress-card>span {
  font-size:12px;
  color:var(--muted);
}

.progress-card strong {
  display:block;
  font-size:21px;
  font-variant-numeric:tabular-nums;
  font-weight:600;
  margin:5px 0 10px;
}

.progress-card small {
  display:block;
  color:var(--muted);
  font-size:10px;
  overflow-wrap:anywhere;
  margin-top:7px;
}

.progress-track {
  height:4px;
  background:var(--line);
  overflow:hidden;
  border-radius:4px;
}

.progress-track span {
  display:block;
  height:100%;
  background:var(--world);
  width:0;
}

.run-bar {
  background:var(--line);
  border:1px solid var(--line);
  border-radius:9px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  padding:14px 18px;
  margin-bottom:20px;
}

.run-bar>div:first-child {
  display:flex;
  flex-direction:column;
  gap:6px;
}

.run-bar strong {
  font-size:14px;
}

.run-bar>div:first-child span {
  font-size:11px;
  color:var(--muted);
}

.run-controls {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.error-banner {
  padding:15px 18px;
  border:1px solid var(--red-line);
  color:var(--danger);
  background:var(--orange-soft);
  border-radius:8px;
  margin-bottom:18px;
  font-size:13px;
  overflow-wrap:anywhere;
}

.three-systems {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
  align-items:stretch;
}

.system {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:11px;
  padding:23px 22px 20px;
  border-top-width:4px;
  min-width:0;
}

.world-system {
  border-top-color:var(--world);
}

.sandbox-system {
  border-top-color:var(--sandbox);
}

.agent-system {
  border-top-color:var(--agent);
}

.system-heading {
  display:flex;
  align-items:center;
  gap:13px;
  margin-bottom:16px;
}

.system-number {
  font-size:28px;
  font-weight:400;
  letter-spacing:-1.3px;
  font-variant-numeric:tabular-nums;
  color:var(--faint);
}

.system-heading p {
  font-size:9px;
  letter-spacing:1.9px;
  font-weight:650;
  color:var(--muted);
  margin:0 0 4px;
}

.system-heading h2 {
  font-size:22px;
  letter-spacing:-.6px;
  margin:0;
  font-weight:650;
}

.tag {
  display:inline-block;
  padding:4px 7px;
  font-size:10px;
  border-radius:4px;
  line-height:1.4;
  color:var(--muted);
  background:var(--surface-3);
  vertical-align:middle;
  white-space:nowrap;
}

.world-tag {
  background:var(--green-soft);
  color:var(--world);
}

.sandbox-tag {
  background:var(--blue-soft);
  color:var(--sandbox);
}

.agent-tag {
  background:var(--orange-soft);
  color:var(--agent);
}

.system-description {
  font-size:12px;
  line-height:1.85;
  color:var(--muted);
  min-height:45px;
  margin:13px 0 21px;
}

.world-device {
  padding:20px;
  border:1px solid var(--green-line);
  border-radius:8px;
  background:linear-gradient(135deg,var(--surface-3),var(--surface));
  display:flex;
  flex-direction:column;
  gap:8px;
}

.device-label,.label {
  font-size:11px;
  color:var(--muted);
}

.world-device>strong {
  font-size:32px;
  letter-spacing:-.7px;
  font-weight:550;
  font-variant-numeric:tabular-nums;
  color:var(--world);
  white-space:nowrap;
}

.world-device strong small {
  font-size:13px;
  letter-spacing:0;
  font-weight:400;
}

.world-device>span:last-of-type {
  font-size:11px;
  color:var(--muted);
}

.battery-track {
  height:8px;
  overflow:hidden;
  border-radius:3px;
  background:var(--green-soft);
  margin-top:5px;
}

.battery-track span {
  height:100%;
  display:block;
  background:var(--world);
}

.execution-card {
  padding:17px 0;
  border-bottom:1px solid var(--line);
}

.execution-card>strong {
  display:block;
  font-weight:600;
  font-size:21px;
  margin:7px 0 10px;
  font-variant-numeric:tabular-nums;
}

.execution-card p {
  font-size:11px;
  color:var(--muted);
  line-height:1.5;
  margin:5px 0;
}

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

.metrics dt,.compact-metrics dt {
  font-size:10px;
  color:var(--muted);
  margin-bottom:6px;
}

.metrics dd,.compact-metrics dd {
  margin:0;
  font-size:19px;
  font-weight:550;
  font-variant-numeric:tabular-nums;
  overflow-wrap:anywhere;
}

.metrics small,.compact-metrics small {
  font-size:10px;
  color:var(--muted);
  font-weight:400;
}

.details {
  border-top:1px solid var(--line);
  padding-top:14px;
  margin-top:10px;
}

.details summary {
  font-size:12px;
  color:var(--muted);
  cursor:pointer;
}

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

.compact-metrics dd {
  font-size:15px;
}

.note {
  font-size:11px;
  color:var(--muted);
  line-height:1.8;
  margin:12px 0 0;
}

.model-equations {
  padding:15px;
  background:var(--surface-2);
  border:1px solid var(--blue-line);
  border-radius:7px;
  overflow-wrap:anywhere;
}

.model-equations p:first-child {
  display:flex;
  flex-direction:column;
  gap:6px;
  margin:0 0 15px;
}

.model-equations p:first-child span {
  font-size:10px;
  color:var(--muted);
}

.model-equations strong {
  font-size:13px;
  color:var(--sandbox);
}

.model-equations code {
  display:block;
  font-size:11px;
  line-height:2;
  white-space:nowrap;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  color:var(--blue-fg);
}

.model-equations p:last-child {
  font-size:10px;
  color:var(--muted);
  line-height:1.7;
  margin:12px 0 0;
}

.validation {
  border-left:2px solid var(--blue-line);
  padding:2px 0 2px 12px;
  margin:20px 0;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.validation strong {
  font-size:12px;
  font-weight:600;
}

.validation span,.validation p {
  font-size:10px;
  color:var(--muted);
  line-height:1.7;
  margin:0;
}

.subsection {
  padding-top:16px;
  margin-top:16px;
  border-top:1px solid var(--line);
}

h3 {
  font-size:12px;
  font-weight:650;
  margin:0 0 12px;
}

.subsection-heading {
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
}

.subsection-heading>span {
  font-size:11px;
  color:var(--muted);
  white-space:nowrap;
}

.table-scroll {
  overflow-x:auto;
  overscroll-behavior-inline:contain;
}

table {
  border-collapse:collapse;
  width:100%;
  font-size:12px;
  text-align:left;
  font-variant-numeric:tabular-nums;
}

th,td {
  padding:13px 12px;
  border-bottom:1px solid var(--line);
  white-space:nowrap;
  font-weight:400;
}

thead th {
  font-size:11px;
  font-weight:500;
  color:var(--muted);
  background:var(--surface-2);
}

tbody th {
  font-weight:550;
}

th:first-child,td:first-child {
  padding-left:0;
}

th:last-child,td:last-child {
  padding-right:0;
}

thead th:first-child {
  padding-left:10px;
}

table caption {
  text-align:left;
  color:var(--muted);
  font-size:10px;
  padding:8px 0 12px;
}

.mini-table {
  font-size:10px;
}

.mini-table td,.mini-table th {
  padding:10px 6px;
}

.mini-table td:first-child,.mini-table th:first-child {
  padding-left:0;
  max-width:120px;
  white-space:normal;
  overflow-wrap:anywhere;
}

.mini-table thead th {
  font-size:9px;
  background:transparent;
}

.strategy-list {
  padding:0;
  margin:0;
  list-style:none;
}

.strategy-list li {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:9px 0;
  border-bottom:1px solid var(--line);
  font-size:11px;
}

.strategy-list li>span {
  display:flex;
  align-items:center;
  gap:6px;
  overflow-wrap:anywhere;
}

.strategy-list strong {
  font-size:12px;
  white-space:nowrap;
  font-weight:500;
}

.strategy-list small {
  font-size:9px;
  font-weight:400;
  color:var(--muted);
}

.agent-current {
  border:1px solid var(--orange-line);
  background:var(--orange-soft);
  border-radius:7px;
  padding:17px;
}

.agent-current>strong {
  display:block;
  font-size:21px;
  font-weight:550;
  margin:9px 0 12px;
}

.agent-current p {
  font-size:12px;
  line-height:1.9;
  margin:0 0 12px;
  overflow-wrap:anywhere;
}

.agent-current small {
  font-size:10px;
  line-height:1.7;
  color:var(--muted);
  display:block;
}

.decision-card {
  border-bottom:1px solid var(--line);
  padding:18px 0;
}

.decision-card>strong {
  display:block;
  font-size:15px;
  font-weight:600;
  margin:8px 0;
  overflow-wrap:anywhere;
}

.decision-card p {
  font-size:11px;
  line-height:1.7;
  color:var(--muted);
  margin:5px 0;
}

.decision-card code {
  font-size:10px;
  overflow-wrap:anywhere;
  color:var(--muted);
}

.exchange-flow {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
  margin:12px 0 26px;
}

.flow-item {
  padding:14px 17px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--surface-3);
  position:relative;
}

.flow-item>span {
  font-size:14px;
  letter-spacing:2px;
  font-variant-numeric:tabular-nums;
  color:var(--muted);
}

.flow-item>strong {
  font-size:11px;
  margin-left:12px;
  font-weight:600;
}

.flow-item p {
  font-size:10px;
  color:var(--muted);
  margin:7px 0 0;
}

.panel {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:11px;
  padding:25px;
  margin-bottom:20px;
}

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

.section-heading h2 {
  font-size:22px;
  font-weight:600;
  letter-spacing:-.6px;
  margin:0;
}

.section-heading p:not(.eyebrow) {
  max-width:380px;
  margin:0;
  color:var(--muted);
  font-size:11px;
  line-height:1.8;
}

.section-heading .eyebrow {
  font-size:10px;
  margin-bottom:7px;
}

.outcome-header {
  display:flex;
  flex-wrap:wrap;
  gap:10px 24px;
  align-items:center;
  margin:5px 0 18px;
}

.outcome-header strong {
  font-size:15px;
  font-weight:600;
}

.outcome-header>span {
  font-size:12px;
  color:var(--muted);
}

.outcome-checks {
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:10px;
}

.outcome-checks li {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:6px;
  padding:11px 10px;
  font-size:11px;
}

.confirmed {
  color:var(--world);
  background:var(--green-soft);
}

.warning {
  color:var(--danger)!important;
}

.chart-key {
  display:flex;
  gap:20px;
  align-items:center;
  margin:8px 0 5px;
  font-size:11px;
  color:var(--muted);
}

.chart-key>span {
  display:flex;
  align-items:center;
  gap:7px;
}

.chart-key small {
  margin-left:auto;
  font-size:10px;
}

.measured-dot,.predicted-dot {
  width:16px;
  height:2px;
  background:var(--world);
  display:inline-block;
}

.predicted-dot {
  background:var(--sandbox);
}

.trace-chart {
  display:block;
  width:100%;
  height:auto;
  max-height:280px;
  margin:10px 0;
}

.trace-chart .axis {
  stroke:var(--line);
  stroke-width:1;
}

.trace-chart text {
  fill:var(--muted);
  font-size:10px;
}

.trace-chart polyline {
  fill:none;
  stroke-width:2;
  stroke-linejoin:round;
}

.trace-chart .measured {
  stroke:var(--world);
}

.trace-chart .predicted {
  stroke:var(--sandbox);
  stroke-dasharray:5 4;
}

.trace-chart circle.measured {
  fill:var(--world);
}

.trace-chart circle.predicted {
  fill:var(--sandbox);
}

.records-grid {
  display:grid;
  grid-template-columns:1.3fr 1fr;
  gap:30px;
}

.records-grid>div {
  min-width:0;
}

.records-grid>div>.note {
  margin:0 0 15px;
}

.decision-record {
  border:1px solid var(--line);
  border-radius:7px;
  overflow:hidden;
  margin:10px 0;
  background:var(--surface);
}

.decision-record>summary {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px 14px;
  padding:13px;
  cursor:pointer;
}

.decision-record>summary>span {
  font-size:10px;
  color:var(--agent);
}

.decision-record summary strong {
  font-weight:550;
  font-size:12px;
  overflow-wrap:anywhere;
}

.decision-record summary small {
  font-size:10px;
  color:var(--muted);
  margin-left:auto;
}

.record-body {
  padding:0 14px 14px;
}

.record-body dl {
  margin:3px 0 12px;
}

.record-body dl>div {
  display:flex;
  justify-content:space-between;
  gap:20px;
  font-size:10px;
  padding:6px 0;
}

.record-body dt {
  color:var(--muted);
  white-space:nowrap;
}

.record-body dd {
  margin:0;
  text-align:right;
  overflow-wrap:anywhere;
  line-height:1.6;
}

.record-body summary {
  font-size:10px;
  color:var(--muted);
  cursor:pointer;
}

.record-body pre {
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  font-size:10px;
  line-height:1.7;
  padding:10px;
  background:var(--surface-3);
  border-radius:5px;
}

.event-list {
  list-style:none;
  padding:0;
  margin:0;
}

.event-list li {
  border-left:1px solid var(--line);
  padding:0 0 18px 18px;
  position:relative;
}

.event-list li:before {
  content:"";
  position:absolute;
  left:-3px;
  top:4px;
  width:5px;
  height:5px;
  border-radius:50%;
  background:var(--line-strong);
}

.event-list li>span {
  font-size:10px;
  color:var(--muted);
}

.event-list p {
  font-size:12px;
  line-height:1.8;
  margin:5px 0 0;
  overflow-wrap:anywhere;
}

.loading {
  color:var(--muted);
  font-size:13px;
  padding:40px 0;
}

footer {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:24px;
  color:var(--muted);
  font-size:10px;
  line-height:1.9;
  padding:8px 0 0;
}

footer p {
  margin:0;
}

footer>span {
  white-space:nowrap;
}

.system-overview {
  display:grid;
  grid-template-columns:minmax(0,1fr) 22px minmax(0,1fr) 22px minmax(0,1fr);
  align-items:center;
  gap:8px;
  margin:0 0 20px;
}

.system-overview>a {
  display:flex;
  flex-direction:column;
  gap:5px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:7px;
  background:var(--surface);
  min-width:0;
}

.system-overview>a:hover {
  background:var(--surface-2);
  text-decoration:none;
}

.system-overview small {
  font-size:9px;
  color:var(--muted);
}

.system-overview strong {
  font-size:13px;
  line-height:1.4;
  font-weight:600;
}

.system-overview>span {
  text-align:center;
  font-size:20px;
  color:var(--muted);
}

.overview-world strong {
  color:var(--world);
}

.overview-agent strong {
  color:var(--agent);
}

.overview-sandbox strong {
  color:var(--sandbox);
}

.system {
  scroll-margin-top:15px;
}

.record-body pre {
  max-height:320px;
  overflow:auto;
}

.evolution-card {
  margin:18px 0 0;
  padding:15px;
  border:1px solid var(--blue-line);
  background:var(--surface-2);
  border-radius:7px;
}

.evolution-card h3 {
  margin:0 0 14px;
  font-size:12px;
}

.evolution-card ol {
  list-style:none;
  padding:0;
  margin:0;
}

.evolution-card li {
  display:flex;
  gap:12px;
  padding:0 0 15px;
  margin:0;
  position:relative;
}

.evolution-card li:last-child {
  padding-bottom:0;
}

.evolution-card li:not(:last-child):before {
  content:"";
  position:absolute;
  left:15px;
  top:28px;
  bottom:1px;
  width:1px;
  background:var(--blue-soft);
}

.version-badge {
  display:grid;
  place-items:center;
  flex:0 0 31px;
  height:26px;
  border:1px solid var(--blue-line);
  border-radius:4px;
  font-size:11px;
  font-weight:600;
  color:var(--sandbox);
  background:var(--blue-soft);
}

.evolution-card li strong {
  font-size:11px;
  font-weight:600;
}

.evolution-card li p {
  margin:6px 0;
  font-size:10px;
  line-height:1.5;
  font-variant-numeric:tabular-nums;
}

.evolution-card li small {
  color:var(--muted);
  font-size:9px;
}

.strategy-evolution {
  background:var(--surface-2);
  border-color:var(--orange-line);
}

.strategy-evolution>div {
  border-top:1px solid var(--orange-line);
  padding-top:10px;
  margin-top:10px;
}

.strategy-evolution>div>span {
  display:block;
  font-size:9px;
  color:var(--muted);
  margin-bottom:5px;
}

.strategy-evolution>div>strong {
  display:block;
  font-size:13px;
  font-weight:600;
}

.strategy-evolution>div>small {
  display:block;
  font-size:9px;
  color:var(--muted);
  line-height:1.6;
  margin-top:4px;
}

.economic-outcome {
  margin-top:18px;
  border:1px solid var(--line);
  border-radius:7px;
  padding:15px 17px;
  background:var(--surface-2);
}

.economic-outcome>span {
  display:block;
  font-size:10px;
  color:var(--muted);
  margin-bottom:8px;
}

.economic-outcome>strong {
  display:block;
  font-size:14px;
  font-weight:600;
  line-height:1.6;
}

.economic-outcome p {
  font-size:11px;
  line-height:1.8;
  color:var(--muted);
  margin:9px 0 0;
}

.economic-warning {
  background:var(--orange-soft);
  border-color:var(--orange-line);
}

.economic-warning>strong {
  color:var(--orange-fg);
}

.economic-saving {
  background:var(--green-soft);
  border-color:var(--green-line);
}

.economic-outcome.pending>strong {
  font-size:12px;
  color:var(--muted);
}

@media(min-width:1650px) {
  main {
    padding-left:0;
    padding-right:0;
  }
}

@media(max-width:1150px) {
  .system {
    padding:20px 16px;
  }
  .model-equations {
    padding:12px;
  }
  .model-equations code {
    font-size:9px;
  }
  .outcome-checks {
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .metrics dd {
    font-size:17px;
  }
  .world-device {
    padding:16px;
  }
  .world-device>strong {
    font-size:27px;
  }
  .run-controls button {
    padding:10px;
    font-size:11px;
  }
}

@media(max-width:900px) {
  main {
    padding:26px 18px 20px;
  }
  .three-systems {
    grid-template-columns:1fr;
  }
  .system {
    padding:23px;
  }
  .system-description {
    min-height:0;
  }
  .model-equations code {
    font-size:12px;
  }
  .metrics {
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
  .world-device>strong {
    font-size:32px;
  }
  .run-bar {
    align-items:flex-start;
    flex-direction:column;
    gap:15px;
  }
  .run-controls {
    width:100%;
  }
  .run-controls button {
    font-size:12px;
  }
  .exchange-flow {
    gap:9px;
  }
  .flow-item {
    padding:12px;
  }
  .flow-item>strong {
    display:block;
    margin:6px 0 0;
  }
  .intro {
    align-items:flex-start;
  }
  .progress-card {
    min-width:155px;
  }
  .section-heading {
    align-items:flex-start;
    gap:18px;
    flex-direction:column;
  }
  .section-heading p:not(.eyebrow) {
    max-width:none;
  }
  .records-grid {
    grid-template-columns:1fr;
  }
  .outcome-checks {
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  footer {
    align-items:flex-start;
    flex-direction:column;
    gap:8px;
  }
}

@media(max-width:540px) {
  main {
    padding:23px 12px 16px;
  }
  .intro {
    display:block;
  }
  .intro h1 {
    font-size:26px;
    letter-spacing:-.8px;
  }
  .intro p:not(.eyebrow) {
    font-size:12px;
  }
  .progress-card {
    max-width:none;
    width:100%;
    text-align:left;
    margin-top:19px;
  }
  .progress-card strong {
    font-size:18px;
  }
  .progress-card small {
    font-size:9px;
  }
  .run-bar {
    padding:14px;
  }
  .run-controls button {
    padding:10px 9px;
    font-size:11px;
  }
  .system {
    padding:20px 17px;
  }
  .system-heading h2 {
    font-size:22px;
  }
  .metrics {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .exchange-flow {
    grid-template-columns:1fr;
    gap:7px;
  }
  .flow-item {
    display:grid;
    grid-template-columns:70px 1fr;
    gap:3px 8px;
  }
  .flow-item>strong {
    margin:0;
    align-self:center;
  }
  .flow-item p {
    grid-column:2;
    margin:2px 0 0;
  }
  .panel {
    padding:20px 15px;
  }
  .section-heading h2 {
    font-size:20px;
    line-height:1.5;
  }
  .outcome-checks {
    grid-template-columns:1fr 1fr;
  }
  .outcome-checks li {
    font-size:10px;
  }
  .chart-key {
    flex-wrap:wrap;
    gap:10px;
  }
  .chart-key small {
    width:100%;
    margin:0;
  }
  .trace-chart {
    min-height:150px;
  }
  .records-grid {
    gap:20px;
  }
  .decision-record summary small {
    margin-left:0;
    width:100%;
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior:auto!important;
  }
}

@media(max-width:540px) {
  .progress-card {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:9px 12px;
    margin-top:15px;
  }
  .progress-card strong {
    margin:0;
  }
  .progress-card .progress-track {
    grid-column:1/-1;
  }
  .progress-card small {
    display:none;
  }
  .intro {
    margin-bottom:20px;
  }
}

@media(max-width:380px) {
  .system-overview {
    grid-template-columns:minmax(0,1fr) 14px minmax(0,1fr) 14px minmax(0,1fr);
    gap:4px;
  }
  .system-overview>a {
    padding:9px 5px;
    gap:5px;
  }
  .system-overview small {
    font-size:8px;
    letter-spacing:-.2px;
  }
  .system-overview strong {
    font-size:11px;
  }
  .system-overview>span {
    font-size:16px;
  }
  .model-equations code {
    white-space:normal;
    overflow-wrap:anywhere;
    font-size:11px;
  }
  .outcome-checks {
    grid-template-columns:1fr;
  }
}

/* Each learning event keeps its own evidence and does not imply a new version. */
.recovery-rounds {
  margin-top:20px;
  padding-top:18px;
  border-top:1px solid var(--line);
  min-width:0;
}

.round-flow {
  font-size:11px;
  line-height:1.9;
  color:var(--sandbox);
  overflow-wrap:anywhere;
}

.recovery-rounds>ol {
  padding:0;
  margin:14px 0 0;
  list-style:none;
}

.round-record {
  border:1px solid var(--blue-line);
  border-radius:7px;
  background:var(--surface-2);
  padding:13px;
  margin-top:12px;
  min-width:0;
}

.round-record>header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:9px;
  flex-wrap:wrap;
}

.round-record>header>strong {
  font-size:12px;
  font-weight:600;
  overflow-wrap:anywhere;
}

.round-record p {
  font-size:10px;
  line-height:1.8;
  margin:8px 0;
  overflow-wrap:anywhere;
}

.round-record details {
  margin-top:10px;
  min-width:0;
}

.round-record summary,.surface-model summary {
  font-size:10px;
  line-height:1.6;
  cursor:pointer;
  overflow-wrap:anywhere;
}

.round-record pre,.mini-table pre {
  font:10px/1.7 ui-monospace,SFMono-Regular,Menlo,monospace;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  max-width:100%;
  max-height:240px;
  overflow:auto;
  background:var(--blue-soft);
  padding:9px;
  border-radius:4px;
}

.round-validation {
  padding-top:12px;
  margin-top:12px;
  border-top:1px solid var(--blue-line);
  min-width:0;
}

.round-validation>strong {
  font-size:10px;
  color:var(--sandbox);
}

.round-validation .validation {
  margin:12px 0;
}

.round-record .round-redispatch {
  color:var(--world);
}

.candidate-reason {
  display:block;
  max-width:180px;
  white-space:normal;
  overflow-wrap:anywhere;
  font-size:9px;
  line-height:1.7;
  color:var(--muted);
  margin-top:5px;
}

.mini-table details {
  max-width:190px;
}

.mini-table details summary {
  font-size:9px;
  margin-top:6px;
  cursor:pointer;
}

.surface-model {
  min-width:0;
  max-width:100%;
}

.surface-model>p {
  font-size:10px;
  line-height:1.8;
  margin:10px 0;
  color:var(--blue-fg);
}

.surface-model details {
  margin-top:12px;
}

.surface-grid {
  max-width:100%;
  margin:8px 0;
}

.surface-grid .mini-table {
  min-width:245px;
}

.surface-grid caption {
  white-space:normal;
  line-height:1.7;
  font-size:9px;
}

.evolution-card li>div {
  min-width:0;
  flex:1;
}

.evolution-card .surface-model {
  padding:10px;
  margin:9px 0;
}

.recovery-outcome {
  padding:15px 17px;
  border:1px solid var(--blue-line);
  border-radius:7px;
  background:var(--surface-2);
  margin:18px 0;
}

.recovery-outcome>span {
  display:block;
  font-size:10px;
  color:var(--muted);
  margin-bottom:7px;
}

.recovery-outcome>strong {
  font-size:14px;
  line-height:1.6;
  font-weight:600;
}

.recovery-outcome p {
  font-size:11px;
  line-height:1.8;
  margin:8px 0 0;
}

.scope-history {
  border-left-color:var(--green-line);
}

.scope-history>strong {
  color:var(--world);
}

@media(max-width:380px) {
  .round-record {
    padding:11px;
  }
  .round-record>header>strong {
    font-size:11px;
  }
  .round-flow {
    font-size:10px;
  }
  .surface-model {
    padding:10px;
  }
  .recovery-outcome {
    padding:13px;
  }
  .recovery-outcome>strong {
    font-size:12px;
  }
}

.probe-revisions {
  margin-top:13px;
  padding-top:12px;
  border-top:1px solid var(--blue-line);
  min-width:0;
}

.probe-revisions h4 {
  font-size:11px;
  font-weight:600;
  margin:0 0 10px;
  color:var(--sandbox);
}

.probe-revisions>ol {
  list-style:none;
  padding:0;
  margin:0;
}

.probe-revisions>ol>li {
  border-left:2px solid var(--blue-line);
  padding:0 0 2px 10px;
  margin:12px 0;
  min-width:0;
}

.probe-revisions>ol>li>strong {
  font-size:10px;
  line-height:1.8;
  font-weight:600;
  overflow-wrap:anywhere;
}

/* Phone: the three system cards stack instead of squeezing into narrow columns. */
@media (max-width: 560px) {
  .system-overview { grid-template-columns: 1fr; gap: 4px; }
  .system-overview > span { justify-self: center; transform: rotate(90deg); }
}
