:root {
  color-scheme: dark;
  --bg-app: #0b0d0e;
  --bg-elevated: #111416;
  --bg-control: #171a1c;
  --border: #2a2e31;
  --border-strong: #3a4044;
  --text: #f2f4f4;
  --text-muted: #92999d;
  --teal: #5bc4c3;
  --warning: #d6a55d;
  font-family: "Open Sans", Inter, system-ui, sans-serif;
  background: var(--bg-app);
  color: var(--text);
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-width: 1100px;
  min-height: 100%;
  background: var(--bg-app);
}

button,
input { font: inherit; }

.mono,
kbd,
dd { font-family: "SFMono-Regular", Consolas, monospace; }

.topbar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}

.identity,
.run-state {
  display: flex;
  align-items: center;
  gap: 10px;
}

.monogram {
  color: var(--teal);
  font-family: Georgia, serif;
  font-size: 22px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-dot.loading { background: var(--warning); }
.status-dot.ready { background: var(--teal); }
.status-dot.error { background: #d36c6c; }

.evidence {
  min-height: 148px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 48px;
  padding: 24px 32px 28px;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--text-muted);
  font: 600 11px/1.2 "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.12em;
}

h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 780px;
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
}

.source-link {
  color: var(--teal);
  text-decoration: none;
  white-space: nowrap;
  font-size: 13px;
}

.workspace {
  display: grid;
  grid-template-columns: 250px minmax(560px, 1fr) 270px;
  min-height: calc(100vh - 196px);
}

.rail,
.inspector {
  background: var(--bg-app);
  padding: 24px 20px;
}

.rail { border-right: 1px solid var(--border); }
.inspector { border-left: 1px solid var(--border); }

.rail-block,
.mode-group,
.control-group,
.assessment {
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.facts { margin: 0; }

.facts div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 12px;
}

.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; text-align: right; }

.controls-copy p:not(.eyebrow) {
  margin: 8px 0;
  color: var(--text-muted);
  font-size: 11px;
}

kbd {
  padding: 2px 5px;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  color: var(--text);
  background: var(--bg-control);
}

.stage {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  background: #080a0b;
}

#stage-canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: 0;
  cursor: grab;
}

#stage-canvas:active { cursor: grabbing; }

.stage-header,
.stage-footer {
  position: absolute;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  color: var(--text-muted);
  font-size: 11px;
}

.stage-header { top: 15px; }
.stage-footer { bottom: 15px; }

.button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.mode-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.mode-note {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.5;
}

button {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-control);
  color: var(--text);
  cursor: pointer;
}

button:hover,
button.active {
  border-color: var(--teal);
  color: var(--teal);
}

.control-group { margin-top: 26px; }

.toggle-row,
.slider-row {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.toggle-row input { accent-color: var(--teal); }

.slider-row output {
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, monospace;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

.assessment {
  border-bottom: 0;
  margin-bottom: 0;
}

.assessment p:last-child {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 1200px) {
  .workspace { grid-template-columns: 220px minmax(560px, 1fr) 250px; }
}
