:root {
  --void: #0a0a0d;
  --panel: rgba(20, 20, 24, 0.5);
  --panel-2: rgba(28, 28, 33, 0.5);
  --line: #303035;
  --line-bright: #4a4a52;
  --text: #e9e9ee;
  --text-dim: #8f8f9a;
  --accent: #f5f5f8;
  --accent-dim: #3d3d44;
  --accent-2: #b0b0bb;
  --accent-2-dim: #45454c;
  --accent-3: #9a9aa5;
  --radius: 2px;
  --font-display: "Chakra Petch", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Consolas, monospace;
  font-size: 15px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
}

html {
  zoom: 0.9;
}

body {
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.22) 1px, transparent 1.6px) 0 0 / 48px 48px,
    repeating-linear-gradient(to right, rgba(255, 255, 255, 0.045) 0, rgba(255, 255, 255, 0.045) 1px, transparent 1px, transparent 48px),
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.045) 0, rgba(255, 255, 255, 0.045) 1px, transparent 1px, transparent 48px),
    var(--void);
}

/* Scanline / vignette atmosphere */
body {
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.018) 0px,
    rgba(255, 255, 255, 0.018) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.55) 100%);
}

a { color: var(--accent); }

::selection { background: var(--accent-2-dim); color: var(--text); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: var(--line-bright); border: 2px solid var(--void); }
* { scrollbar-color: var(--line-bright) var(--void); scrollbar-width: thin; }

/* ---------- Loading ---------- */

.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2em;
  padding: 6em 0;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  position: relative;
  background: conic-gradient(from 0deg, transparent 0deg, var(--accent) 300deg, var(--accent-2) 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  animation: spin 1s linear infinite;
  filter: drop-shadow(0 0 6px rgba(245, 245, 248, 0.6));
}

.spinner::after {
  content: "";
  position: absolute;
  inset: 40%;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px 2px var(--accent);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- App shell ---------- */

.app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5em 2em 4em;
}

.app {
  position: relative;
}

.app:not([hidden]) {
  animation: boot-in 0.6s ease-out;
}

@keyframes boot-in {
  0%   { opacity: 0; }
  15%  { opacity: 1; }
  20%  { opacity: 0.4; }
  28%  { opacity: 1; }
  100% { opacity: 1; }
}

/* ---------- Cut-corner panel shape (shared) ---------- */

.bottom-bar,
.colormap-gallery,
.side-panel,
.brainbrowser .volume-container {
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}

/* ---------- Toolbar controls (live in .bottom-bar) ---------- */

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.6em;
}

.toolbar-actions {
  gap: 0.6em;
}

.toolbar-hint {
  font-family: var(--font-mono);
  font-size: 0.72em;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.toolbar-hint kbd {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--accent);
  border-radius: 3px;
  padding: 0.05em 0.4em;
  font-size: 0.95em;
}

select, input[type="number"], input[type="file"] {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.35em 0.5em;
  font-size: 0.85em;
  font-family: var(--font-mono);
}

select:focus, input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.btn-primary, .btn-secondary, .btn-ghost {
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  border: 1px solid transparent;
  padding: 0.5em 1.1em;
  font-family: var(--font-display);
  font-size: 0.85em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: filter 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary { background: var(--accent); color: var(--void); }
.btn-primary:hover { filter: drop-shadow(0 0 8px rgba(245, 245, 248, 0.7)) brightness(1.08); }

.btn-secondary { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.btn-secondary:hover { border-color: var(--accent-2); color: var(--accent-2); filter: drop-shadow(0 0 6px rgba(176, 176, 187, 0.45)); }

.btn-ghost { background: transparent; border-color: var(--line); color: var(--text-dim); }
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); filter: drop-shadow(0 0 6px rgba(245, 245, 248, 0.35)); }

/* ---------- Switch ---------- */

.switch { display: flex; align-items: center; gap: 0.55em; cursor: pointer; user-select: none; font-family: var(--font-mono); font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }
.switch input { display: none; }
.switch-track {
  width: 34px; height: 19px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line);
  position: relative; transition: background 0.15s, border-color 0.15s;
}
.switch-thumb {
  position: absolute; top: 1px; left: 1px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--text-dim); transition: transform 0.15s, background 0.15s;
}
.switch input:checked + .switch-track { background: var(--accent-dim); border-color: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(15px); background: var(--accent); box-shadow: 0 0 6px 1px var(--accent); }

/* ---------- Bottom bar ---------- */

/* Full-bleed like .brainbrowser, so it visually spans all 4 blocks above
   (patient panel, MRI viewer, gallery, right panel) in one unbroken line. */
.bottom-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5em;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: 0.9em 1em;
  box-sizing: border-box;
  background: var(--panel);
  border: 1px solid var(--line);
  margin-top: 1em;
  overflow-x: auto;
}

/* ---------- BrainBrowser viewer area ---------- */

/* Breaks out to the full viewport width (regardless of .app's own
   max-width) so the side panels can dock at the true left/right edges,
   while the center content stays constrained and centered like before. */
.brainbrowser {
  display: flex;
  align-items: stretch;
  gap: 1em;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: 0 1em;
  box-sizing: border-box;
}

.brainbrowser-center {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  align-items: stretch;
  flex: 1 1 auto;
  min-width: 0;
}

#brainbrowser {
  display: flex;
  flex: 1 1 300px;
  min-width: 280px;
}

/* BrainBrowser wraps each volume's template output in this element */
.brainbrowser .volume-container {
  display: flex !important;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 0.5em;
  flex: 1 1 300px;
  min-width: 280px;
  transition: border-color 0.15s, filter 0.15s;
}

.brainbrowser .volume-container:hover {
  border-color: var(--line-bright);
  filter: drop-shadow(0 0 10px rgba(74, 61, 122, 0.5));
}

/* ---------- Patient panel (3rd panel: details + simulated vitals) ---------- */

/* A normal flex item inside .brainbrowser -- align-items: stretch there
   makes both side panels match the center content's height automatically. */
.side-panel {
  flex: 0 0 520px;
  width: 520px;
  min-width: 0;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 0.75em;
  font-size: 0.82em;
}

.side-panel[hidden] {
  display: none;
}

.patient-panel,
.body-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.9em;
}

.patient-header {
  padding-bottom: 0.7em;
  border-bottom: 1px solid var(--line);
}

.patient-name {
  font-family: var(--font-display);
  font-size: 1.1em;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text);
}

.patient-id {
  margin-top: 0.2em;
  font-family: var(--font-mono);
  font-size: 0.75em;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.brain-mesh {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
  padding-bottom: 0.9em;
  border-bottom: 1px solid var(--line);
}

.brain-mesh-viewer {
  width: 390px;
  height: 390px;
  margin: 0 auto;
  overflow: hidden;
}

.brain-mesh-viewer canvas {
  display: block;
}

.body-mesh-row {
  display: flex;
  align-items: stretch;
  gap: 0.9em;
  width: fit-content;
  margin: 0 auto;
}

.body-mesh-col {
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  width: 200px;
}

.body-mesh-divider {
  width: 1px;
  background: var(--line);
  align-self: stretch;
}

.body-mesh-viewer-wrap {
  position: relative;
}

.body-mesh-viewer-half {
  width: 200px;
  height: 380px;
  overflow: hidden;
}

.body-mesh-viewer-half canvas {
  display: block;
}

.body-mesh-overlay {
  position: absolute;
  top: 0.4em;
  left: 0.4em;
  right: 0.4em;
  max-height: calc(100% - 0.8em);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.64em;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--accent-2);
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

.body-mesh-overlay div {
  white-space: nowrap;
  opacity: 0;
  animation: body-overlay-line-in 0.3s ease-out forwards;
}

@keyframes body-overlay-line-in {
  from { opacity: 0; transform: translateX(-4px); }
  to   { opacity: 1; transform: translateX(0); }
}

.body-mesh-caption {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
  font-family: var(--font-mono);
  font-size: 0.7em;
}

.body-mesh-caption-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.1em;
}

.body-mesh-caption-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6em;
  color: var(--text-dim);
}

.body-mesh-caption-row span:last-child {
  color: var(--text);
}

.signal-panels {
  display: flex;
  flex-direction: column;
  gap: 0.7em;
  padding-bottom: 0.9em;
  border-bottom: 1px solid var(--line);
}

.signal-panel {
  border: 1px solid var(--line);
  padding: 0.6em 0.8em;
}

.signal-panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6em;
  margin-bottom: 0.4em;
}

.signal-panel-label {
  font-family: var(--font-mono);
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.signal-panel-value {
  font-family: var(--font-mono);
  font-size: 0.85em;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.signal-wave-wrap {
  height: 80px;
  overflow: hidden;
}

.signal-wave {
  width: 400px;
  height: 100%;
}

.signal-wave-line {
  fill: none;
  stroke-width: 1.5;
  animation: vital-wave-scroll 3s linear infinite;
}

.signal-wave-sine {
  stroke: var(--accent);
  filter: drop-shadow(0 0 3px rgba(245, 245, 248, 0.5));
}

.signal-wave-pulse {
  stroke: var(--accent-2);
  filter: drop-shadow(0 0 2px rgba(176, 176, 187, 0.4));
  animation-duration: 3.6s;
}

.signal-panel-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.6em;
  margin-top: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.66em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.signal-panel-footer-value {
  color: var(--text);
  text-transform: none;
  margin-left: 0.3em;
}

.region-status {
  display: flex;
  flex-direction: column;
  gap: 0.45em;
  padding-bottom: 0.9em;
  border-bottom: 1px solid var(--line);
}

.region-row {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: 0.76em;
}

.region-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2-dim);
  flex-shrink: 0;
}

.region-dot.is-flagged {
  background: var(--accent);
  box-shadow: 0 0 6px 1px var(--accent);
  animation: region-dot-blink 1.4s ease-in-out infinite;
}

@keyframes region-dot-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.region-name {
  flex: 1;
  color: var(--text-dim);
}

.region-state {
  color: var(--text);
}

.biometric-panel {
  display: flex;
  flex-direction: column;
  gap: 0.7em;
}

.biometric-boxes {
  display: flex;
  gap: 0.5em;
}

.biometric-box {
  display: flex;
  align-items: flex-end;
  flex: 1 1 0;
  min-width: 0;
  height: 46px;
  padding: 0.3em;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.biometric-box-label {
  font-family: var(--font-mono);
  font-size: 0.62em;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.session-clock {
  margin-top: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.78em;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.status-ok {
  font-weight: 700;
  color: var(--accent) !important;
}

.patient-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
  padding-bottom: 0.9em;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.76em;
}

.patient-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 0.8em;
  color: var(--text-dim);
}

.patient-meta-row span:last-child {
  color: var(--text);
  text-align: right;
}

.telemetry {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  padding-bottom: 0.9em;
  border-bottom: 1px solid var(--line);
}

.signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.3em;
  height: 18px;
}

.signal-bars span {
  flex: 1;
  background: var(--line-bright);
  animation: signal-bar-pulse 2.2s ease-in-out infinite;
}

.signal-bars span:nth-child(1) { height: 30%; animation-delay: 0s; }
.signal-bars span:nth-child(2) { height: 50%; animation-delay: 0.15s; }
.signal-bars span:nth-child(3) { height: 70%; animation-delay: 0.3s; }
.signal-bars span:nth-child(4) { height: 90%; animation-delay: 0.45s; }
.signal-bars span:nth-child(5) { height: 100%; animation-delay: 0.6s; }

@keyframes signal-bar-pulse {
  0%, 100% { background: var(--line-bright); }
  50% { background: var(--accent); }
}

.scan-progress {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  padding-bottom: 0.9em;
  border-bottom: 1px solid var(--line);
}

.scan-progress-row {
  display: flex;
  align-items: center;
  gap: 0.7em;
}

.scan-progress-track {
  flex: 1;
  height: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  overflow: hidden;
}

.scan-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--accent-2), var(--accent));
  background-image:
    linear-gradient(to right, var(--accent-2), var(--accent)),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.35) 0, rgba(0, 0, 0, 0.35) 4px, transparent 4px, transparent 8px);
  background-blend-mode: normal, overlay;
  background-size: 100% 100%, 24px 24px;
  animation: scan-progress-stripes 1s linear infinite;
  transition: width 0.6s ease-in-out;
}

@keyframes scan-progress-stripes {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 0 0, 24px 0; }
}

.scan-progress-value {
  font-family: var(--font-mono);
  font-size: 0.78em;
  color: var(--accent);
  min-width: 2.6em;
  text-align: right;
}

.vitals {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
}

.vitals-label {
  font-family: var(--font-mono);
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.vital-block {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
}

.vital-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.vital-row .vital-label {
  font-family: var(--font-mono);
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.vital-value {
  font-family: var(--font-mono);
  font-size: 1.3em;
  font-weight: 600;
  color: var(--accent);
}

.vital-unit {
  margin-left: 0.3em;
  font-family: var(--font-mono);
  font-size: 0.72em;
  color: var(--text-dim);
}

.vital-wave {
  height: 26px;
  overflow: hidden;
}

.vital-wave-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  filter: drop-shadow(0 0 3px rgba(245, 245, 248, 0.5));
  animation: vital-wave-scroll 2.4s linear infinite;
}

@keyframes vital-wave-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-100px); }
}

.neural-activity {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.activity-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.35em;
  height: 60px;
}

.activity-bars span {
  flex: 1;
  min-height: 4px;
  background: linear-gradient(to top, var(--accent-2), var(--accent));
  filter: drop-shadow(0 0 2px rgba(245, 245, 248, 0.35));
  transition: height 0.5s ease-in-out;
}

.system-log {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.log-lines {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  height: 90px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.72em;
  letter-spacing: 0.02em;
}

.log-line {
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: log-line-in 0.4s ease-out;
}

.log-line::before {
  content: "\203A";
  margin-right: 0.5em;
  color: var(--accent-2);
}

.log-line.is-newest { color: var(--accent); }

@keyframes log-line-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .vital-wave-line { animation: none; }
  .signal-bars span { animation: none; }
  .activity-bars span { transition: none; }
  .scan-progress-fill { animation: none; }
  .log-line { animation: none; }
}

/* ---------- Color map gallery (2nd panel: 5 fixed rows, no controls) ---------- */

.colormap-gallery {
  flex: 1 1 300px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.3em;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 0.5em;
}

/* BrainBrowser still wraps each of the 5 rows in its own .volume-container;
   the gallery card itself supplies the framing, so strip the per-row chrome. */
.colormap-gallery .volume-container {
  background: none;
  border: none;
  padding: 0;
  flex: none;
  min-width: 0;
  clip-path: none;
}

.mini-row {
  display: flex;
  flex-direction: column;
  gap: 0.25em;
}

.mini-row-label {
  font-family: var(--font-mono);
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.mini-viewer-display {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.mini-viewer-display canvas.slice-display {
  border-radius: 2px;
}

.volume-viewer-display {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-bottom: 0.25em;
}

canvas.slice-display {
  display: block;
  border-radius: 3px;
  background: #000;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  outline: 2px solid transparent;
  outline-offset: 2px;
}

canvas.slice-display:focus {
  outline-color: var(--accent);
  filter: drop-shadow(0 0 6px rgba(245, 245, 248, 0.6));
}

/* ---------- Panel controls ---------- */

.panel-controls {
  font-size: 0.82em;
  max-width: 100% !important;
  box-sizing: border-box;
  column-count: 2;
  column-gap: 1.5em;
  margin-top: auto;
}

.control-group {
  margin-bottom: 0.3em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--line);
  break-inside: avoid;
}

.control-group:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.control-label {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-dim);
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5em;
}

.range-hint { font-weight: 400; opacity: 0.7; text-transform: none; letter-spacing: 0; }

.coord-row {
  display: flex;
  gap: 0.6em;
  margin-bottom: 0.4em;
}

.coord-row label {
  display: flex;
  align-items: center;
  gap: 0.35em;
  font-family: var(--font-mono);
  font-size: 0.8em;
  color: var(--text-dim);
}

.coord-row input {
  width: 4.5em;
}

.voxel-coords input,
.world-coords input {
  width: 9em;
}

.intensity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.intensity-value {
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 0.15em 0.6em;
  border-radius: var(--radius);
  border: 1px solid var(--line-bright);
  background: var(--panel-2);
  min-width: 2.5em;
  text-align: center;
}

.file-label {
  cursor: pointer;
}

.file-label input[type="file"] {
  display: block;
  width: 100%;
  margin-top: 0.4em;
  font-size: 0.9em;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 0.25em;
}

.slider-tag {
  width: 2.2em;
  flex-shrink: 0;
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 0.8em;
  text-transform: uppercase;
}

.slider {
  flex: 0 1 90px;
  min-width: 0;
  accent-color: var(--accent);
}

.max-threshold-slider,
.brightness-slider {
  accent-color: var(--accent-2);
}

.mini-input {
  width: 5.5em;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.play-label {
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-mono);
  font-size: 0.8em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 0.3em;
}

.btn-row {
  display: flex;
  gap: 0.4em;
  flex-wrap: wrap;
}

.btn-row .btn-ghost {
  padding: 0.4em 0.8em;
  font-size: 0.78em;
}

#color-map-select {
  width: 100%;
}

@media (max-width: 640px) {
  .app { padding: 1em; }
}
