:root {
  color-scheme: dark;
  --panel-bg: rgba(12, 13, 18, 0.86);
  --line: rgba(255, 255, 255, 0.09);
  --text: #d7dae2;
  --muted: #7f8595;
  --accent: #7fd4c1;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #000;
  overflow: hidden;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text);
}

#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

/* Idle for a few seconds: the cursor is a lit shape parked in the artwork. */
#view.cursor-idle { cursor: none; }

#panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 348px;
  max-height: 100%;
  overflow-y: auto;
  padding: 14px 14px 40px;
  background: var(--panel-bg);
  backdrop-filter: blur(14px);
  border-left: 1px solid var(--line);
  transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}

#panel.hidden {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

/* The slide is the one piece of UI travel on this page; without it the panel
   still appears and disappears, just instantly. */
@media (prefers-reduced-motion: reduce) {
  #panel { transition: none; }
}

.panel-head h1 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.status {
  color: var(--muted);
  margin: 2px 0 12px;
  min-height: 1.4em;
}

.health {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.health[data-state="healthy"] { color: var(--accent); }
.health[data-state="settled"],
.health[data-state="flooding"] { color: #d8c98a; }
.health[data-state="collapsed"],
.health[data-state="frozen"] { color: #ef9a86; }
.health[data-state="paused"] { color: var(--muted); }

.presets {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.presets > select { width: 100%; }

.presets input[type="text"] {
  flex: 1;
  min-width: 0;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 6px;
}

.note {
  color: var(--muted);
  min-height: 1.3em;
  font-size: 11px;
}

.adv-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}

.adv-toggle input { accent-color: var(--accent); width: 15px; height: 15px; }

.section-help {
  color: var(--muted);
  margin: 0 0 8px;
  font-size: 11px;
  line-height: 1.4;
}

/* The two scope legends: a visible seam where the panel changes from what
   travels with the look to what stays with the room. */
.scope-line {
  margin: 14px 0 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

.ctl-wide { margin: 6px 0; }

.looklist {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 190px;
  overflow-y: auto;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.looklist-row {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
}

.looklist-row input { accent-color: var(--accent); width: 14px; height: 14px; }

.events {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 6px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
}

.event {
  white-space: pre-wrap;
  padding: 1px 0;
}

.meter {
  width: 100%;
  height: 58px;
  display: block;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line);
  border-radius: 4px;
}

details {
  border-top: 1px solid var(--line);
  padding: 8px 0 6px;
}

summary {
  cursor: pointer;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10px;
  margin-bottom: 6px;
  user-select: none;
}

.ctl {
  display: grid;
  grid-template-columns: 1fr 108px 42px;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
}

/* Labels wrap rather than truncate: a control nobody can read is a control
   nobody will touch. */
.ctl label {
  color: var(--text);
  line-height: 1.3;
  hyphens: auto;
}

.ctl .val {
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ctl input[type="checkbox"] {
  justify-self: start;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

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

select, button {
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 6px;
}

button { cursor: pointer; }
button:hover, select:hover { background: rgba(255, 255, 255, 0.12); }
/* Down on press, below the resting fill, so a click reads as a push. */
button:active { background: rgba(255, 255, 255, 0.03); }

/* The default ring is a bright blue box — on a surface that lives next to the
   projection, the one loud element on the page. Redrawn dim but above 3:1. */
:focus-visible { outline: 2px solid #3a6f63; outline-offset: 2px; }

.row.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.row.buttons select { flex: 1; }

.hint {
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-bottom: 0;
}

.fatal {
  padding: 40px;
  color: #ff9a8a;
  font-size: 14px;
}
