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

html, body {
  background: #07090a;
  color: #e9e9e9;
  font-family: ui-sans-serif, system-ui, sans-serif;
  overflow: hidden;
  height: 100%;
}

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: block;
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Panel (TD-COMP-custom-page style) ────────────────────────────────── */
#panel {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 280px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: rgba(18, 20, 24, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 12px 8px;
  font-size: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  z-index: 10;
}

#panel.collapsed section,
#panel.collapsed .readout { display: none; }

#panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

#panel h1 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #cfd3d8;
}

#panel-toggle {
  background: rgba(255, 255, 255, 0.06);
  color: #e9e9e9;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  width: 22px; height: 22px;
  font-size: 14px; line-height: 1;
  cursor: pointer;
}
#panel-toggle:hover { background: rgba(255, 255, 255, 0.14); }

#panel section {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 0 6px;
}
#panel section:first-of-type { border-top: 0; }

#panel h2 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8a94a0;
  margin-bottom: 6px;
}

#panel label {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 11px;
  color: #c4c8cd;
}

#panel label > span[data-v] {
  font-variant-numeric: tabular-nums;
  color: #9aa4b0;
  font-size: 10px;
  min-width: 32px;
  text-align: right;
}

#panel input[type="range"] {
  grid-column: 1 / span 2;
  width: 100%;
  accent-color: #6aa3c4;
  margin-top: 2px;
}

#panel input[type="color"] {
  width: 40px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

#panel select {
  grid-column: 1 / span 2;
  background: rgba(255, 255, 255, 0.05);
  color: #e9e9e9;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 11px;
}

#panel input[type="checkbox"] {
  accent-color: #6aa3c4;
  justify-self: start;
}

.readout {
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  color: #8a94a0;
  line-height: 1.6;
  white-space: pre-line;
}
