/* Slipstream - layout and controls. Precision lab instrument: the simulation is
   the hero, the UI floats over it as glass. 8px spacing scale, 12px panels,
   999px pills. */

:root {
  --bg: #07090d;
  --bg-2: #0b0f17;
  --glass: rgba(12, 16, 24, 0.56);
  --glass-strong: rgba(12, 16, 24, 0.78);
  --hair: rgba(255, 255, 255, 0.08);
  --hair-2: rgba(255, 255, 255, 0.14);
  --text: #e8edf5;
  --muted: #8a94a6;
  --faint: rgba(138, 148, 166, 0.6);
  --accent: #3de0ff;
  --accent-08: rgba(61, 224, 255, 0.08);
  --accent-16: rgba(61, 224, 255, 0.16);
  --accent-40: rgba(61, 224, 255, 0.4);
  --warm: #ff7a45;
  --font-ui: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r-panel: 12px;
  --r-pill: 999px;
  --gutter: 16px;
  --rail-w: 304px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 60px -16px rgba(0, 0, 0, 0.7), 0 2px 10px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: radial-gradient(120% 120% at 50% 45%, var(--bg-2) 0%, var(--bg) 70%);
  color: var(--text);
  font: 400 14px/1.4 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2 { margin: 0; font-weight: 600; }
sub { font-size: 0.7em; vertical-align: -0.15em; line-height: 0; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.cap {
  font: 500 11px/1 var(--font-ui);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ stage */

.stage { position: fixed; inset: 0; }
.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
}
.stage canvas.is-grab { cursor: grab; }
.stage canvas.is-grabbing { cursor: grabbing; }

/* ------------------------------------------------------------ glass + entrance */

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--hair);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow);
}
.rise { opacity: 0; transform: translateY(12px); }
body.is-ready .rise {
  opacity: 1;
  transform: none;
  transition: opacity 480ms var(--ease), transform 480ms var(--ease);
  transition-delay: calc(var(--d, 0) * 70ms + 120ms);
}

/* ------------------------------------------------------------ brand */

.brand {
  position: fixed;
  top: var(--gutter);
  left: var(--gutter);
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  z-index: 3;
}
.brand-logo { display: inline-flex; height: 30px; margin-right: 8px; filter: drop-shadow(0 1px 10px rgba(0, 0, 0, 0.55)); }
.brand-logo svg { height: 100%; width: auto; display: block; overflow: visible; }
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--hair);
  font: 500 11px/1 var(--font-mono);
  color: var(--muted);
  white-space: nowrap;
  pointer-events: auto;
}
.status-text { color: var(--text); letter-spacing: 0.12em; }
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(61, 224, 255, 0.55), 0 0 8px var(--accent);
  animation: pulse 2.2s var(--ease) infinite;
}
.status.is-paused .status-dot { background: var(--muted); box-shadow: none; animation: none; }
.status.is-paused .status-text { color: var(--muted); }
.status-sep { width: 1px; height: 12px; background: var(--hair-2); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 224, 255, 0.5), 0 0 8px var(--accent); }
  70% { box-shadow: 0 0 0 7px rgba(61, 224, 255, 0), 0 0 8px var(--accent); }
  100% { box-shadow: 0 0 0 0 rgba(61, 224, 255, 0), 0 0 8px var(--accent); }
}

.notice {
  position: fixed;
  top: 64px;
  left: var(--gutter);
  z-index: 3;
  max-width: 360px;
  padding: 8px 12px;
  border-radius: var(--r-panel);
  background: rgba(255, 122, 69, 0.12);
  border: 1px solid rgba(255, 122, 69, 0.35);
  color: #ffd2bf;
  font-size: 12px;
}

/* ------------------------------------------------------------ right rail */

.rail {
  position: fixed;
  top: var(--gutter);
  right: var(--gutter);
  bottom: var(--gutter);
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  pointer-events: none;
  z-index: 2;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { pointer-events: auto; flex: none; }

/* telemetry */
.telemetry { padding: 16px; }
.tele-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tele-cell { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tele-num {
  font: 500 24px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}
.tele-num--cyan { color: var(--accent); text-shadow: 0 0 18px rgba(61, 224, 255, 0.35); }
.tele-num--warm { color: var(--warm); text-shadow: 0 0 18px rgba(255, 122, 69, 0.3); }
.spark-wrap { margin-top: 16px; }
.spark {
  display: block;
  width: 100%;
  height: 64px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
}
.spark-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font: 500 11px/1 var(--font-mono);
  color: var(--muted);
}
.spark-legend span { display: inline-flex; align-items: center; gap: 6px; }
.spark-meta { margin-left: auto; }
.spark-meta + .spark-meta { margin-left: 0; }
.spark-meta b { color: var(--text); font-weight: 500; }
.key { width: 12px; height: 2px; border-radius: 2px; display: inline-block; }
.key--cyan { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.key--warm { background: var(--warm); opacity: 0.7; }

/* panels */
.panel { padding: 16px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.panel-sub { margin-top: 6px; font-size: 14px; font-weight: 500; color: var(--text); }
.panel-body { margin-top: 16px; display: flex; flex-direction: column; gap: 16px; }
.panel.is-collapsed .panel-body { display: none; }
.panel.is-collapsed [data-collapse] svg { transform: rotate(180deg); }
[data-collapse] svg { transition: transform 300ms var(--ease); }

.preset-picker { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.preset-cats {
  position: relative;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 2px;
  margin: -2px;
}
.preset-cats::-webkit-scrollbar { display: none; }
.preset-cat {
  flex: none;
  height: 26px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font: 500 11.5px/1 var(--font-ui);
  white-space: nowrap;
  transition: color 200ms var(--ease), background 200ms var(--ease), border-color 200ms var(--ease);
}
.preset-cat:hover { color: var(--text); border-color: var(--hair-2); }
.preset-cat.is-active { background: var(--accent-16); border-color: var(--accent-40); color: var(--text); box-shadow: 0 0 14px -6px rgba(61, 224, 255, 0.6); }
.preset-cat:focus-visible { outline-offset: -1px; }
/* scrollers fade softly on any edge that has more content beyond it */
.fade-x { --fs: 0px; --fe: 0px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--fs), #000 calc(100% - var(--fe)), transparent); mask-image: linear-gradient(90deg, transparent, #000 var(--fs), #000 calc(100% - var(--fe)), transparent); }
.fade-y { --fs: 0px; --fe: 0px; -webkit-mask-image: linear-gradient(180deg, transparent, #000 var(--fs), #000 calc(100% - var(--fe)), transparent); mask-image: linear-gradient(180deg, transparent, #000 var(--fs), #000 calc(100% - var(--fe)), transparent); }
.fade-x.fade-start { --fs: 24px; }
.fade-x.fade-end { --fe: 24px; }
.fade-y.fade-start { --fs: 20px; }
.fade-y.fade-end { --fe: 28px; }
.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-content: start;
  gap: 8px;
  max-height: 264px; /* three rows and a peek of the fourth */
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: 2px;
  margin: -2px;
}
.preset-grid::-webkit-scrollbar { display: none; }
.preset[hidden] { display: none; }
.preset {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--hair);
  transition: background 200ms var(--ease), border-color 200ms var(--ease), transform 200ms var(--ease);
  min-width: 0;
}
.preset:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--hair-2); }
.preset:active { transform: scale(0.97); }
.preset.is-active {
  background: var(--accent-08);
  border-color: var(--accent-40);
  box-shadow: inset 0 0 0 1px rgba(61, 224, 255, 0.12), 0 0 18px -6px rgba(61, 224, 255, 0.5);
}
.preset-thumb { display: block; width: 64px; max-width: 100%; aspect-ratio: 64 / 40; }
.preset-thumb canvas { display: block; width: 100%; height: 100%; opacity: 0.82; transition: opacity 200ms; }
.preset:hover .preset-thumb canvas, .preset.is-active .preset-thumb canvas { opacity: 1; }
.preset-name {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.preset.is-active .preset-name { color: var(--text); }

.row { display: flex; gap: 16px; }
.row--dial { align-items: flex-start; }
.stack { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.angle-wrap, .dial-slot { display: flex; flex-direction: column; align-items: center; flex: none; }
.angle-wrap { transition: opacity 250ms var(--ease); }
.angle-wrap.is-disabled { opacity: 0.32; pointer-events: none; }
.dial-caption { margin-top: 4px; font-size: 10.5px; color: var(--faint); text-align: center; max-width: 96px; }
.dial-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* sliders */
.slider { display: flex; flex-direction: column; gap: 8px; }
.slider-top { display: flex; align-items: baseline; justify-content: space-between; }
.slider-val { font-size: 12px; color: var(--text); }
input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --p: 50%;
}
input[type='range']::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent) 0 var(--p), rgba(255, 255, 255, 0.09) var(--p) 100%);
}
input[type='range']::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.09); }
input[type='range']::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #c9d3e0);
  border: 0;
  box-shadow: 0 0 0 3px rgba(61, 224, 255, 0.18), 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: box-shadow 200ms var(--ease);
}
input[type='range']::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; border: 0;
  background: radial-gradient(circle at 35% 30%, #fff, #c9d3e0);
  box-shadow: 0 0 0 3px rgba(61, 224, 255, 0.18), 0 2px 6px rgba(0, 0, 0, 0.5);
}
input[type='range']:hover::-webkit-slider-thumb { box-shadow: 0 0 0 5px rgba(61, 224, 255, 0.22), 0 2px 6px rgba(0, 0, 0, 0.5); }
input[type='range']:focus-visible { outline: none; }
input[type='range']:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
input[type='range']:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
input[type='range']:disabled { opacity: 0.35; cursor: default; }

/* toggles */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  position: relative;
}
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track {
  position: relative;
  width: 32px; height: 18px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--hair);
  transition: background 220ms var(--ease), border-color 220ms var(--ease);
  flex: none;
}
.toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #c3ccd9;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  transition: transform 260ms var(--ease), background 220ms;
}
.toggle input:checked + .toggle-track { background: var(--accent-16); border-color: var(--accent-40); }
.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(14px); background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle:hover .toggle-track { border-color: var(--hair-2); }

/* segmented controls */
.seg {
  position: relative;
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--hair);
}
.seg button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 200ms var(--ease), background 200ms var(--ease);
}
.seg button:hover { color: var(--text); }
.seg button.is-active { color: var(--text); }
.seg-pill {
  position: absolute;
  top: 4px; bottom: 4px; left: 0;
  width: 0;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, rgba(61, 224, 255, 0.2), rgba(61, 224, 255, 0.1));
  border: 1px solid var(--accent-40);
  box-shadow: 0 0 20px -4px rgba(61, 224, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 380ms var(--ease), width 380ms var(--ease);
}
.seg--tools { display: flex; width: 100%; }
.seg--tools button { flex: 1; justify-content: center; padding: 0 8px; font-size: 12px; height: 30px; }
.seg--tools button.is-active { background: var(--accent-16); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent-40); }
.seg--tools svg { width: 14px; height: 14px; }

/* icons + buttons */
svg path, svg circle { vector-effect: non-scaling-stroke; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  padding: 0;
  border-radius: var(--r-pill);
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transition: background 200ms var(--ease), border-color 200ms var(--ease), transform 150ms var(--ease), box-shadow 200ms var(--ease);
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.09); border-color: var(--hair-2); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg, .seg svg, .drop-icon svg, .drop-veil-card svg {
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn--sm { width: 28px; height: 28px; color: var(--muted); }
.icon-btn--sm svg { width: 16px; height: 16px; }
.icon-btn--primary {
  width: 48px; height: 48px;
  background: var(--accent-16);
  border-color: var(--accent-40);
  color: var(--accent);
  box-shadow: 0 0 24px -6px rgba(61, 224, 255, 0.6);
}
.icon-btn--primary:hover { background: rgba(61, 224, 255, 0.24); }
.icon-btn--primary svg { width: 22px; height: 22px; stroke-width: 1.75; }
.icon-btn .i-play { display: none; }
.icon-btn.is-paused .i-play { display: block; }
.icon-btn.is-paused .i-pause { display: none; }
.chip {
  height: 28px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  color: var(--text);
  transition: background 200ms var(--ease), border-color 200ms var(--ease);
}
.chip:hover { background: rgba(255, 255, 255, 0.09); border-color: var(--hair-2); }

/* dropzone */
.dropzone {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-panel);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 220ms var(--ease), background 220ms var(--ease), box-shadow 220ms var(--ease);
}
.dropzone:hover { border-color: rgba(61, 224, 255, 0.45); background: var(--accent-08); }
.dropzone.is-over {
  border-color: var(--accent);
  background: var(--accent-08);
  box-shadow: 0 0 0 4px rgba(61, 224, 255, 0.1), 0 0 32px -6px rgba(61, 224, 255, 0.6);
}
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop-icon {
  display: grid; place-items: center;
  width: 36px; height: 36px; flex: none;
  border-radius: 50%;
  background: var(--accent-08);
  color: var(--accent);
}
.drop-text { flex: 1; min-width: 0; font-size: 13px; color: var(--text); }
.drop-text b { font-weight: 500; }
.drop-text u { text-decoration-color: var(--accent-40); text-underline-offset: 3px; }
.drop-text small { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.dropzone:has(.mask-preview canvas) .drop-text small { display: none; }
.mask-preview {
  flex: none;
  width: 64px; height: 40px;
  border-radius: 6px;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.04) 0 25%, transparent 0 50%) 0 0 / 8px 8px;
  border: 1px solid var(--hair);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.mask-preview:empty { display: none; }
.mask-preview canvas { max-width: 100%; max-height: 100%; display: block; image-rendering: pixelated; }
.image-opts { display: flex; flex-direction: column; gap: 12px; margin-top: -4px; }
.opt-row { display: flex; align-items: center; justify-content: space-between; }

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--hair);
}
.facts div { min-width: 0; }
.facts dt { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.facts dd { margin: 4px 0 0; font-size: 12px; color: var(--text); white-space: nowrap; }

/* ------------------------------------------------------------ console */

.console-dock {
  position: fixed;
  left: var(--gutter);
  right: calc(var(--rail-w) + var(--gutter) * 2);
  bottom: var(--gutter);
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}
.console {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px 24px;
  padding: 12px 24px;
  max-width: 100%;
  border-radius: 20px;
}
.dials { display: flex; align-items: flex-start; gap: 16px; }
.divider { width: 1px; align-self: stretch; margin: 8px 0; background: linear-gradient(180deg, transparent, var(--hair-2), transparent); }
.transport { display: flex; align-items: center; gap: 8px; }

/* ------------------------------------------------------------ overlays */

.toast {
  position: fixed;
  left: 50%;
  top: 72px;
  transform: translate(-50%, -8px);
  z-index: 6;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--hair-2);
  box-shadow: var(--shadow);
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms var(--ease), transform 320ms var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.drop-veil {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  background: rgba(7, 9, 13, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease);
}
.drop-veil::before {
  content: '';
  position: absolute;
  inset: var(--gutter);
  border: 1.5px dashed var(--accent);
  border-radius: 20px;
  box-shadow: inset 0 0 80px -20px rgba(61, 224, 255, 0.5);
}
.drop-veil.is-on { opacity: 1; }
.drop-veil-card {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 24px;
  border-radius: var(--r-pill);
  background: var(--glass-strong);
  border: 1px solid var(--accent-40);
  color: var(--text);
  font-size: 15px;
}
.drop-veil-card svg { color: var(--accent); }

/* mobile bottom sheet (hidden on desktop) */
.sheet { display: none; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 1180px) {
  :root { --rail-w: 284px; }
  .console { padding: 12px 16px; gap: 12px 16px; }
  .seg--modes button { padding: 0 10px; }
}

@media (max-width: 760px) {
  :root { --gutter: 16px; --sheet-top: 54svh; }
  .stage { bottom: auto; height: calc(var(--sheet-top) + 16px); }
  .brand { top: 12px; left: 12px; gap: 8px; }
  .brand-logo { height: 24px; margin-right: 4px; }
  .status { height: 24px; padding: 0 10px; gap: 6px; }
  .status .status-sep:last-of-type, #statusGrid { display: none; }
  .notice { top: 48px; left: 12px; right: 12px; max-width: none; }
  .rail, .console-dock { display: none; }
  .sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    top: var(--sheet-top);
    z-index: 4;
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    backdrop-filter: blur(20px) saturate(140%);
    border-top: 1px solid var(--hair-2);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, 0.8);
    transition: top 380ms var(--ease);
  }
  .sheet.is-expanded { top: 16svh; }
  .sheet-handle {
    flex: none;
    display: grid; place-items: center;
    height: 24px;
    border: 0; background: transparent;
  }
  .sheet-handle span { width: 40px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.22); }
  .sheet-tabs { flex: none; display: flex; gap: 4px; margin: 0 16px; padding: 4px; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--hair); }
  .sheet-tab {
    flex: 1; height: 32px; border: 0; border-radius: var(--r-pill);
    background: transparent; color: var(--muted); font-size: 13px; font-weight: 500;
    transition: background 200ms var(--ease), color 200ms var(--ease);
  }
  .sheet-tab.is-active { background: var(--accent-16); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent-40); }
  .sheet-pane {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .sheet-pane[hidden] { display: none; }
  .sheet .glass {
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  .sheet .panel + .panel { padding-top: 16px; border-top: 1px solid var(--hair); }
  .sheet .rise { opacity: 1; transform: none; }
  .sheet .console { flex-direction: column; gap: 16px; padding: 0; }
  .sheet .dials { justify-content: center; width: 100%; }
  .sheet .divider { display: none; }
  .sheet .seg--modes { width: 100%; }
  .sheet .seg--modes button { flex: 1; justify-content: center; padding: 0 4px; font-size: 12.5px; }
  .sheet .preset-grid { grid-template-columns: repeat(4, 1fr); max-height: 212px; }
  .toast { top: 52px; max-width: calc(100vw - 32px); white-space: normal; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation: none !important; }
  .rise { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------ look (vortex colours) */

.look { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--hair); }
.look-title { margin: 0; font-weight: 600; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 28px; height: 28px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--hair-2);
  background: linear-gradient(135deg, var(--a) 0 50%, var(--b) 50% 100%);
  box-shadow: inset 0 0 0 2px rgba(7, 9, 13, 0.55);
  transition: box-shadow 200ms var(--ease), transform 200ms var(--ease);
}
.swatch:hover { transform: scale(1.08); }
.swatch[aria-checked='true'] { box-shadow: inset 0 0 0 2px rgba(7, 9, 13, 0.55), 0 0 0 2px var(--bg, #07090d), 0 0 0 4px var(--accent); }
.swatch--custom { background: conic-gradient(#ff4fd8, #ffd166, #5cffb1, #3de0ff, #b36bff, #ff4fd8); }
.custom-colours { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.colour-pick { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); cursor: pointer; }
.colour-pick input[type='color'] {
  width: 24px; height: 24px; padding: 0; border: 1px solid var(--hair-2); border-radius: 50%;
  background: none; cursor: pointer; -webkit-appearance: none; appearance: none; overflow: hidden;
}
.colour-pick input[type='color']::-webkit-color-swatch-wrapper { padding: 0; }
.colour-pick input[type='color']::-webkit-color-swatch { border: 0; border-radius: 50%; }
.colour-pick input[type='color']::-moz-color-swatch { border: 0; border-radius: 50%; }
.sheet .look { width: 100%; }
