:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #27233a;
  --muted: #6c6880;
  --line: #d9d7e4;
  --paper: #f7f7fb;
  --accent: #4ebfa7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background: #ececf4;
}

.labHeader {
  min-height: 68px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.96);
}

.labHeader h1 {
  margin: 1px 0 0;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: 0;
}

.labEyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 850;
}

.labBack,
.labIconBtn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}

.labCommand {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #8cd6c7;
  border-radius: 6px;
  background: #d8f6ef;
  color: #174f43;
  font-weight: 800;
}

.labMain { min-width: 0; }

.labToolbar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.labToolbar label {
  display: grid;
  gap: 4px;
  min-width: 112px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.labToolbar label:first-child { min-width: min(340px, 100%); }

.labToolbar input[type="range"] { width: 100%; }

.labToolbar select {
  min-height: 34px;
  padding: 4px 26px 4px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: white;
  color: var(--ink);
}

.labToolbar output { color: var(--ink); }

.labEquipment { padding-top: 8px; padding-bottom: 8px; background: #fff; }
.labEquipment label:first-child { min-width: 112px; }

.labCheck {
  min-width: 70px !important;
  min-height: 34px;
  grid-template-columns: 18px auto;
  align-items: center;
  align-content: center;
}

.labCheck input { width: 18px; height: 18px; accent-color: var(--accent); }

.labStage {
  position: relative;
  min-height: calc(100dvh - 190px);
  display: grid;
  place-items: center;
  padding: 14px;
  overflow: auto;
  background: #151827;
}

#labCanvas {
  display: block;
  width: min(1280px, 100%);
  height: auto;
  aspect-ratio: 1280 / 760;
  border: 1px solid rgba(255,255,255,0.16);
  background: white;
}

.labStatus {
  position: absolute;
  left: 22px;
  bottom: 20px;
  padding: 5px 8px;
  border-radius: 4px;
  background: rgba(18,21,34,0.76);
  color: white;
  font: 11px ui-monospace, SFMono-Regular, Consolas, monospace;
  pointer-events: none;
}

@media (max-width: 720px) {
  .labHeader { padding-inline: 10px; }
  .labToolbar { padding-inline: 10px; }
  .labToolbar label:first-child { min-width: 100%; }
  .labStage { padding: 6px; min-height: 48dvh; }
}
