:root {
  color-scheme: dark;
  --surface: #17211f;
  --surface-2: #111a18;
  --line: #30423d;
  --muted: #91a19c;
  --text: #eef4f0;
  --blue: #73b9db;
  --mint: #69d5ae;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  min-height: 100vh;
  color: var(--text);
  background: #0b1211;
  font: 400 13px/1.5 "Inter", system-ui, sans-serif;
}

.shell { display: flex; min-height: 100vh; flex-direction: column; }

header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex-wrap: wrap;
}

header h1 { font: 600 17px "Source Serif 4", serif; }

.eyebrow {
  color: var(--muted);
  font: 500 9px "SFMono-Regular", Consolas, monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.pins { display: flex; flex-direction: column; gap: 3px; text-align: right; }
.pins span { color: var(--muted); font: 400 9px/1.4 "IBM Plex Mono", monospace; }

main { display: flex; flex: 1; min-height: 0; flex-wrap: wrap; }

.stage { display: flex; flex: 1 1 520px; min-width: 320px; flex-direction: column; }

.viewport {
  flex: 1;
  width: 100%;
  min-height: 60vh;
  display: block;
  background: #0d1614;
  touch-action: none;
  cursor: grab;
}

.viewport:active { cursor: grabbing; }

.notice {
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 400 10px/1.5 "IBM Plex Mono", monospace;
  word-break: break-word;
}

.panel {
  width: 320px;
  max-width: 100%;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-left: 1px solid var(--line);
  background: var(--surface);
  overflow-y: auto;
}

.card { padding: 13px; background: var(--surface-2); border: 1px solid var(--line); }

.file { margin-top: 9px; display: block; }
.file span {
  display: block;
  padding: 8px;
  border: 1px dashed rgba(115, 185, 219, .4);
  color: var(--blue);
  text-align: center;
  font: 500 10px "IBM Plex Mono", monospace;
  cursor: pointer;
}
.file input { display: none; }

.scope { margin-top: 8px; color: #66756f; font-size: 9px; line-height: 1.5; }
.scope a { color: var(--blue); }

.facts { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; list-style: none; }
.facts li { color: var(--muted); font: 400 9px/1.4 "IBM Plex Mono", monospace; word-break: break-word; }

.storeys { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; list-style: none; }
.storeys li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.storeys label { display: flex; align-items: center; gap: 6px; font-size: 10px; cursor: pointer; }
.storeys .count { color: #66756f; font: 400 8px "IBM Plex Mono", monospace; }

.guid { margin-top: 8px; color: var(--mint); font: 500 10px/1.4 "IBM Plex Mono", monospace; word-break: break-all; }

.row { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 5px; }

.result-heading { margin-top: 13px; }
.result-tree { margin-top: 7px; display: flex; flex-direction: column; gap: 4px; list-style: none; }
.result-group { display: flex; flex-direction: column; gap: 4px; }
.result-group ul { display: flex; flex-direction: column; gap: 4px; list-style: none; }
.result-specification { color: var(--blue); font: 500 8px/1.4 "IBM Plex Mono", monospace; overflow-wrap: anywhere; }
.result-detail { margin-top: 9px; padding: 8px; border-left: 2px solid var(--mint); background: rgba(105, 213, 174, .05); }
.result-row {
  width: 100%; padding: 7px; display: grid; grid-template-columns: 31px 1fr; gap: 2px 6px;
  color: var(--muted); background: transparent; border: 1px solid rgba(115, 185, 219, .22);
  text-align: left; font: 500 8px/1.35 "IBM Plex Mono", monospace; cursor: pointer;
}
.result-row:hover:not(:disabled), .result-row.on { border-color: var(--mint); color: var(--text); }
.result-row:disabled { opacity: .58; cursor: not-allowed; }
.result-verdict { color: var(--mint); }
.result-guid { grid-column: 2; color: #66756f; overflow-wrap: anywhere; }

.button, .chip {
  padding: 7px 9px;
  color: var(--blue);
  background: transparent;
  border: 1px solid rgba(115, 185, 219, .3);
  font: 500 9px "IBM Plex Mono", monospace;
  letter-spacing: .04em;
  cursor: pointer;
}

.button { margin-top: 10px; width: 100%; }
.button:hover, .chip:hover { border-color: rgba(115, 185, 219, .6); }
.chip.on { color: #0b1211; background: var(--blue); border-color: var(--blue); }

footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 18px;
  border-top: 1px solid var(--line);
  color: #66756f;
  font: 400 9px "IBM Plex Mono", monospace;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .panel { width: 100%; border-left: 0; border-top: 1px solid var(--line); }
  .viewport { min-height: 50vh; }
}
