:root {
  color-scheme: dark;
  --bg: #000000;
  --fg: #ccc6b9;
  --muted: #847e70;
  --line: #2a2822;
  --accent: #7d8f5c;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.55;
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.back {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  text-decoration: none;
}

.back:hover { color: var(--accent); }

.trial-heading {
  margin: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

.note {
  max-width: var(--note-width, 34rem);
  margin: .35rem 0 0;
  color: var(--muted);
  font-size: 14.5px;
}

.panel {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 10;
  display: flex;
  width: 16.5rem;
  max-height: min(78vh, 40rem);
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(0, 0, 0, .93);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .02em;
  text-transform: lowercase;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem .7rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.panel-head .title {
  flex: 1;
  color: var(--accent);
}

.panel button {
  appearance: none;
  padding: .18rem .45rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.panel button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.panel-body {
  overflow-y: auto;
  padding: .5rem .7rem .8rem;
}

.panel[data-folded] .panel-body { display: none; }

.group {
  margin: .7rem 0 .35rem;
  color: var(--muted);
  font-size: inherit;
  font-weight: 400;
  letter-spacing: .14em;
  line-height: inherit;
  opacity: .65;
}

.group:first-child { margin-top: .2rem; }

.ctrl { margin-bottom: .55rem; }

.ctrl[data-disabled] { opacity: .42; }

.ctrl .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  color: var(--fg);
}

.ctrl output {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.ctrl input[type="range"] {
  width: 100%;
  height: 1rem;
  margin: .1rem 0 0;
  -webkit-appearance: none;
  appearance: none;
  background: none;
  cursor: pointer;
}

.ctrl input[type="range"]::-webkit-slider-runnable-track {
  height: 1px;
  background: var(--line);
}

.ctrl input[type="range"]::-moz-range-track {
  height: 1px;
  background: var(--line);
}

.ctrl input[type="range"]::-webkit-slider-thumb {
  width: 9px;
  height: 9px;
  margin-top: -4px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 50%;
  background: var(--accent);
}

.ctrl input[type="range"]::-moz-range-thumb {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
}

.ctrl input[type="color"] {
  width: 100%;
  height: 1.4rem;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: none;
  cursor: pointer;
}

.ctrl input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.ctrl input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 1px; }

.ctrl input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.ctrl input[type="text"] {
  width: 3.2rem;
  padding: .15rem 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: none;
  color: var(--accent);
  font: inherit;
  text-align: center;
  text-transform: none;
}

:where(a, button, input):focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

@media (max-width: 46rem) {
  .trial-heading { font-size: 32px; }

  .panel {
    right: .75rem;
    bottom: .75rem;
    left: .75rem;
    width: auto;
    max-height: 45vh;
  }
}
