:root {
  /* Same lab palette as the landing page: engineering paper, graphite ink, one safety-orange accent. */
  --bg: #f4f2ec; --panel: #fbfaf7; --panel2: #eceae2; --line: #d6d2c6; --text: #1b2026; --muted: #555b62;
  --accent: #b93d0b; --ok: #2f6b2f; --bad: #b42318; --warn: #8a5a00; --what: #2b4c7e; --live: #b93d0b;
  --robot: #ea580c; --mover: #2b4c7e; --static: #8b9097; --goal: #2f6b2f; --grid: #dfdbd0;
  --ease: cubic-bezier(.2, 0, 0, 1);
  font-family: "IBM Plex Sans", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; }
h1 { font: 700 18px/1.2 "Space Grotesk", sans-serif; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 14px; margin: 0; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
h3 { font-size: 13px; margin: 14px 0 6px; }
.mono, code, pre, .code { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.hint { color: var(--muted); font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; }
button, select, input { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 9px; }
button { cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:focus-visible, select:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px;
  border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; gap: 10px; align-items: center; }
.logo { font-size: 26px; color: var(--accent); }
.tag { margin: 0; color: var(--muted); font-size: 12px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12px; background: var(--panel2); white-space: nowrap; }
.badge.small { font-size: 11px; padding: 1px 8px; }
.badge.sim { border-color: var(--what); color: var(--what); }
.badge.mode.recorded { border-color: var(--muted); }
.badge.mode.live { border-color: var(--live); color: var(--live); }
.badge.mode.whatif { border-color: var(--what); color: var(--what); }
.badge.up { border-color: var(--ok); color: var(--ok); }
.badge.down { border-color: var(--bad); color: var(--bad); }
.badge.busy { border-color: var(--warn); color: var(--warn); }
.badge.measured { border-color: var(--ok); color: var(--ok); }
.badge.authored { border-color: var(--accent); color: var(--accent); }
.badge.hyp { border-color: var(--what); color: var(--what); }
.banner { background: #4a1d1d; color: #ffd7d5; padding: 8px 18px; border-bottom: 1px solid var(--bad); }

.layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; padding: 14px 18px; }
@media (max-width: 1100px) { .layout { grid-template-columns: minmax(0, 1fr); padding: 12px 16px; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.arenas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 700px) { .arenas { grid-template-columns: minmax(0, 1fr); } }
.arena { margin: 0; min-width: 0; }
.arena figcaption { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.arena figcaption select { flex: 1; min-width: 0; font-size: 12px; }
.side { font-weight: 700; font-size: 12px; text-transform: uppercase; color: var(--muted); width: 48px; }
canvas { width: 100%; height: auto; aspect-ratio: 1; background: var(--panel2); border-radius: 8px; border: 1px solid var(--line); display: block; }
.meta { font-size: 12px; color: var(--muted); margin-top: 4px; min-height: 34px; }
.meta b { color: var(--text); }
.transport { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.transport input[type=range] { flex: 1; min-width: 120px; }
.inline { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; }
.inline.grow { flex: 1; } .inline.grow select { flex: 1; min-width: 0; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.dot.robot { background: var(--robot); } .dot.mover { background: var(--mover); } .dot.static { background: var(--static); }
.dot.goal { border: 2px solid var(--goal); }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); } .what { color: var(--what); }
.note { font-size: 12px; color: var(--muted); margin-top: 6px; }
.note.alert { color: var(--warn); }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; align-items: end; }
.grid-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.grid-form output { font-size: 12px; color: var(--text); }

.col-right { min-width: 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 0; flex-wrap: wrap; }
.tabs button { border: 1px solid transparent; border-bottom: none; border-radius: 8px 8px 0 0; background: transparent; color: var(--muted); }
.tabs button[aria-selected=true] { background: var(--panel); border-color: var(--line); color: var(--text); margin-bottom: -1px; }
.tabpanel { background: var(--panel); border: 1px solid var(--line); border-top: none; border-radius: 0 0 10px 10px; padding: 12px 14px; min-height: 520px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.decision-head { background: var(--panel2); border-radius: 8px; padding: 10px; margin-top: 8px; font-size: 13px; }
.decision-head .act { font-weight: 700; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th, .tbl td { text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 600; }
.tbl tr.sel td { background: rgba(234, 88, 12, .08); }
.tbl tr.sel td:first-child { box-shadow: inset 3px 0 var(--accent); }
.chip { display: inline-block; border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; margin: 1px 2px 1px 0;
  font-family: ui-monospace, Menlo, monospace; font-size: 11px; cursor: pointer; white-space: nowrap; background: var(--panel2); color: var(--text); }
.chip:hover { border-color: var(--accent); }
.chip.fail { border-color: var(--bad); } .chip.pass { border-color: var(--ok); } .chip.hyp { border-color: var(--what); }
.rejected { padding-left: 18px; margin: 4px 0; font-size: 12px; } .rejected li { margin: 3px 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.whatif { margin-top: 12px; border: 1px dashed var(--what); border-radius: 8px; padding: 8px 10px; }
.whatif summary { cursor: pointer; color: var(--what); font-weight: 600; }
.qcard { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: var(--panel2); }
.qcard h4 { margin: 0 0 4px; font-size: 13px; display: flex; justify-content: space-between; }
pre.code { white-space: pre-wrap; word-break: break-word; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px; max-height: 260px; overflow: auto; margin: 6px 0 0; }
#graphWrap { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
#graphSvg { width: 100%; min-height: 460px; display: block; }
#graphSvg text { fill: var(--text); font-size: 11px; font-family: ui-monospace, Menlo, monospace; }
#graphSvg .edge { stroke: var(--line); stroke-width: 1.3; fill: none; }
#graphSvg .edge.SELECTED { stroke: var(--accent); stroke-width: 2.6; }
#graphSvg .edge.REJECTED { stroke: var(--bad); stroke-dasharray: 4 3; }
#graphSvg .elabel { fill: var(--muted); font-size: 9px; }
#graphSvg .node { cursor: pointer; }
.job { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: var(--panel2); font-size: 12px; }
.job .top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.bar { height: 6px; background: var(--bg); border-radius: 4px; overflow: hidden; margin: 6px 0; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.trace { padding-left: 18px; font-size: 12px; } .trace li { margin-bottom: 8px; }
.trace details summary { cursor: pointer; }
.inspector { position: fixed; right: 14px; top: 70px; bottom: 14px; width: min(560px, 92vw); background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px; box-shadow: 0 8px 40px rgba(0,0,0,.4); z-index: 10; display: flex; flex-direction: column; }
.inspector pre { flex: 1; max-height: none; }
.empty { color: var(--muted); font-style: italic; padding: 12px 0; }
.loading::after { content: " …"; }
.restbl td.num { font-variant-numeric: tabular-nums; }
.restbl td:nth-child(2) { white-space: nowrap; }

/* motion and touch: quick press feedback, reduced motion respected */
button, select, input { min-height: 40px; transition: border-color 120ms var(--ease), transform 120ms var(--ease); }
button:active:not(:disabled) { transform: scale(.98); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0ms !important; animation: none !important; } }
canvas { max-width: 100%; height: auto; }
.panel, .arena, figure { min-width: 0; }
.tablewrap, table { max-width: 100%; }
.inline.grow { min-width: 0; max-width: 100%; }
select { max-width: 100%; }
@media (max-width: 700px) { .tbl { display: block; overflow-x: auto; } }
.logo { display: inline-flex; text-decoration: none; }
.hosted-note { margin: 12px 18px 0; padding: 10px 14px; border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 8px; background: var(--panel); font-size: 13px; color: var(--muted); }
.hosted-note strong { color: var(--text); }
button[disabled][title] { cursor: help; }
.grid-form { align-items: start; }

/* 3D arena (web/robot3d.js): recorded states only */
[hidden] { display: none !important; }
.viewtabs { margin-left: auto; display: inline-flex; border: 1px solid var(--line, #d6d2c6); border-radius: 8px; overflow: hidden; }
.viewtabs button { font: 600 12px/1 "IBM Plex Mono", ui-monospace, monospace; padding: 8px 12px; min-height: 32px; border: 0; border-radius: 0;
  background: transparent; color: var(--muted); cursor: pointer; }
.viewtabs button[aria-pressed="true"] { background: var(--text, #1b2026); color: var(--bg, #f4f2ec); }
.stage3d { position: relative; width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--line, #d6d2c6); }
.stage3d canvas { display: block; width: 100%; height: 100%; }

.agent-launch { padding:20px; border:1px solid var(--line); border-radius:10px; margin-bottom:20px; }
.agent-launch a.btn { display:inline-flex; align-items:center; min-height:44px; padding:10px 16px; border:1px solid var(--line); border-radius:8px; text-decoration:none; }
.consent { display:flex; align-items:flex-start; gap:10px; margin:16px 0; font-size:14px; }
.consent input { width:20px; height:20px; flex:none; }

.tag3d { background: var(--ink, #1b2026); color: #fbfaf7; border-left: 3px solid var(--c); }
.physics-film { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--bg); }
