:root {
  color-scheme: dark;
  --bg-primary: #040507;
  --bg-secondary: #0a0d16;
  --panel: rgba(8, 12, 20, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --shadow: rgba(4, 6, 12, 0.6);
  --fg-primary: #f1f4ff;
  --fg-muted: #8c92af;
  --accent: #7f8dff;
  --panel-size-reference: 720px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: 0.02em;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2rem) clamp(1.2rem, 4vw, 3rem);
  padding-top: calc(env(safe-area-inset-top, 0px) + clamp(1rem, 4vw, 2rem));
  background: var(--bg-primary);
  color: var(--fg-primary);
}

main.column {
  width: auto;
  max-width: 1280px;
  display: inline-block;
  padding: clamp(1.8rem, 4vw, 3rem);
  background: transparent;
  border-radius: 22px;
  border: none;
  box-shadow: none;
}

.intro {
  display: grid;
  gap: 0.8rem;
}

.intro h1 {
  font-size: clamp(1.35rem, 3.4vw, 1.62rem);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.intro p {
  font-size: clamp(0.88rem, 2.6vw, 0.98rem);
  color: var(--fg-muted);
  line-height: 1.6;
}

.controls {
  display: grid;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--fg-muted);
}

.slider-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
}

.slider-row label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.slider-row input[type="range"] {
  width: 100%;
}
.slider-row span {
  font-variant-numeric: tabular-nums;
  color: var(--fg-primary);
}

.cloud-toggles {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.cloud-toggles label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.dashboard {
  display: inline-grid;
  grid-template-columns: minmax(320px, 1fr) minmax(448px, 1.4fr);
  gap: clamp(1.8rem, 3vw, 2.6rem);
  align-items: start;
  width: auto;
  max-width: 1000px;
}

@media (max-width: 900px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
}

.dashboard-left {
  display: grid;
  gap: clamp(1.4rem, 3vw, 2rem);
  align-content: start;
}

.panel {
  padding: 0;
  display: grid;
  place-items: center;
  min-height: 0;
  width: 100%;
}

.panel-space {
  position: relative;
}


.spectrum-strip {
  width: 100%;
  margin-top: clamp(0.55rem, 1.5vw, 0.85rem);
  display: grid;
  gap: 0;
}

.spectrum-strip canvas {
  width: 100%;
  aspect-ratio: 8 / 1;
  min-height: 32px;
  max-height: 80px;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  touch-action: none;
}

.spectrum-strip-axis {
  width: 100%;
  min-height: 0;
}

.spectrum-strip-axis svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

#spaceCanvas {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  display: block;
  cursor: grab;
  touch-action: none;
}

#spaceCanvas:active {
  cursor: grabbing;
}

.panel-chromaticity {
  position: relative;
}

.chart-container {
  position: relative;
  width: 100%;
  max-width: none;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}

.chart-container svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-container canvas {
  position: absolute;
  display: block;
  cursor: pointer;
  pointer-events: all;
  touch-action: none;
}

.chromaticity-label {
  position: absolute;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--fg-primary);
  pointer-events: none;
  transform: translate(6px, -18px);
  white-space: nowrap;
}

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

.axis path,
.axis line {
  stroke: rgba(255, 255, 255, 0.25);
}

.axis text {
  fill: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
}

.strip-axis-marker--hover text {
  fill: var(--accent);
  font-weight: 500;
}

.strip-axis-marker--hover line {
  stroke: var(--accent);
}

.strip-axis-marker--active text {
  fill: #fff;
  font-weight: 600;
}

.strip-axis-marker--active line {
  stroke: #fff;
}

.grid {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.axis-label {
  fill: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
