:root {
  --bg:        #0a0a0e;
  --bg-1:      #07070b;
  --panel:     #14141a;
  --panel-2:   #1c1c24;
  --rule:      rgba(232, 232, 240, 0.16);
  --rule-soft: rgba(232, 232, 240, 0.06);
  --pri:       #f4f4f8;
  --pri-dim:   #8e8e98;
  --pri-low:   #3a3a44;
  --ink:       #dcdce2;
  --ink-dim:   #888892;
  --mute:      #555560;
  /* directional accents - used for crash/event scene pills */
  --down:      #ff4d4d;
  --up:        #6cf06c;
  --bar-depth: 22px;
  --row-h:     200px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--pri);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-feature-settings: "tnum" 1, "zero" 1;
  overflow-x: hidden;
}

/* faint scanline + crt vignette so the amber "glows" against the black */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(232, 232, 240, 0.018) 0,
      rgba(232, 232, 240, 0.018) 1px,
      transparent 1px,
      transparent 3px
    ),
    radial-gradient(ellipse at 50% 40%, transparent 50%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
  z-index: 1;
}
body > * { position: relative; z-index: 2; }

/* ─── top bar - brand only, but MASSIVE ──────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  padding: 28px 32px;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px;
}
.made-by {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.32em;
  padding: 6px 12px;
  border: 1px solid var(--rule);
  color: var(--ink-dim);
  background: transparent;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.made-by .mb-label { color: var(--mute); }
.made-by .mb-handle { color: var(--pri); font-weight: 700; }
.made-by:hover {
  border-color: var(--pri);
  color: var(--pri);
  box-shadow: 0 0 14px rgba(232, 232, 240, 0.25);
}
.made-by:hover .mb-label { color: var(--ink-dim); }
@media (max-width: 760px) {
  .topbar { padding: 18px 18px; flex-wrap: wrap; }
  .made-by { font-size: 10px; padding: 4px 10px; letter-spacing: 0.24em; }
}
.brand-mega {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(34px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: var(--pri);
  text-shadow:
    0 0 24px rgba(232, 232, 240, 0.25),
    0 0 60px rgba(232, 232, 240, 0.08);
}
.brand-mega .hash { color: var(--pri-low); font-weight: 500; }
.brand-mega .hashed { font-weight: 700; }
.brand-mega .hashed .sep { color: var(--pri-dim); margin: 0 0.06em; font-weight: 300; }
.brand-mega .brand-tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.32em;
  color: var(--mute);
  margin-left: 14px;
  align-self: end;
  padding-bottom: 6px;
}

@keyframes blink { 50% { opacity: 0.35; } }

/* range pills, right-aligned next to the brand */
.fkeys {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* command bar */
.bar-cmd { gap: 24px; }
.cmd-group { display: flex; align-items: center; gap: 8px; }

.cmd {
  cursor: pointer;
  background: var(--bg);
  border: 1px solid var(--pri-dim);
  color: var(--pri);
  padding: 7px 14px;
  border-radius: 0;
  font: inherit; font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 700;
  transition: all 0.1s ease;
  /* tap feedback — without this, mobile users tapping PLAY see no
     immediate response and think the button is broken */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.cmd:hover {
  background: rgba(232, 232, 240, 0.08);
  border-color: var(--pri);
}
.cmd:active {
  transform: translateY(1px);
  filter: brightness(0.85);
}
.cmd-primary {
  background: var(--pri);
  color: #000;
  border-color: var(--pri);
  box-shadow: 0 0 12px rgba(232, 232, 240, 0.5);
}
.cmd-primary:hover { background: #fff; border-color: #fff; box-shadow: 0 0 14px #fff; }
.cmd-primary:active {
  background: var(--pri);
  filter: brightness(0.8);
  box-shadow: 0 0 6px rgba(232, 232, 240, 0.5);
}

.kv { display: inline-flex; align-items: center; gap: 8px; }
.kv-k {
  color: var(--mute);
  font-size: 10px;
  letter-spacing: 0.18em;
  border-right: 1px solid var(--rule);
  padding-right: 8px;
}
.kv-v { color: var(--pri); font-size: 11px; letter-spacing: 0.1em; min-width: 56px; }

input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  width: 110px;
  height: 16px;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; background: var(--pri-low); border: 1px solid var(--rule);
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 10px; height: 14px;
  background: var(--pri);
  border: 0;
  margin-top: -6px;
  box-shadow: 0 0 6px var(--pri);
}
input[type="range"]::-moz-range-track {
  height: 4px; background: var(--pri-low); border: 1px solid var(--rule);
}
input[type="range"]::-moz-range-thumb {
  width: 10px; height: 14px; background: var(--pri);
  border: 0; box-shadow: 0 0 6px var(--pri);
}

select {
  appearance: none;
  background: var(--bg);
  color: var(--pri);
  border: 1px solid var(--pri-dim);
  border-radius: 0;
  padding: 5px 22px 5px 8px;
  font: inherit; font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background-image: linear-gradient(45deg, transparent 50%, var(--pri) 50%),
                    linear-gradient(135deg, var(--pri) 50%, transparent 50%);
  background-position: calc(100% - 12px) 50%, calc(100% - 8px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

/* range pill button */
.fkey {
  cursor: pointer;
  background: var(--bg);
  border: 1px solid var(--pri-low);
  color: var(--ink-dim);
  padding: 5px 11px;
  border-radius: 0;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  transition: all 0.1s ease;
}
.fkey:hover { border-color: var(--pri); color: var(--pri); }
.fkey.active {
  background: var(--pri);
  border-color: var(--pri);
  color: #000;
  box-shadow: 0 0 10px rgba(232, 232, 240, 0.5), inset 0 0 0 1px #000;
}
/* scene pills get a red accent - historic event, not a duration */
.fkey.scene-2008 {
  border-color: rgba(255, 77, 77, 0.45);
  color: #ff8e8e;
  letter-spacing: 0.14em;
}
.fkey.scene-2008:hover { border-color: var(--down); color: var(--down); }
.fkey.scene-2008.active {
  background: var(--down);
  border-color: var(--down);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
  box-shadow: 0 0 14px rgba(255, 77, 77, 0.6), inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}
/* Oil pill - amber, evoking petroleum / sodium-vapor refinery glow */
.fkey.scene-oil {
  border-color: rgba(255, 168, 64, 0.5);
  color: #ffc080;
  letter-spacing: 0.14em;
}
.fkey.scene-oil:hover { border-color: #ffa840; color: #ffa840; }
.fkey.scene-oil.active {
  background: #ffa840;
  border-color: #ffa840;
  color: #1a0e00;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  box-shadow: 0 0 14px rgba(255, 168, 64, 0.6), inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}
/* select-as-fkey: a dropdown that lives in the range row and shares the
   pill's footprint, used for event scenes (more options than will fit
   as buttons) */
.fkey-select {
  cursor: pointer;
  background: var(--bg);
  color: var(--ink-dim);
  padding: 5px 22px 5px 11px;
  font: inherit; font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  border-radius: 0;
  transition: all 0.1s ease;
}
.fkey-select.scene-other {
  border: 1px solid rgba(255, 77, 77, 0.45);
  color: #ff8e8e;
  letter-spacing: 0.14em;
  background-image:
    linear-gradient(45deg, transparent 50%, #ff8e8e 50%),
    linear-gradient(135deg, #ff8e8e 50%, transparent 50%);
  background-position: calc(100% - 12px) 50%, calc(100% - 8px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.fkey-select.scene-other:hover { border-color: var(--down); color: var(--down); }
.fkey-select.scene-other.active {
  background: var(--down);
  border-color: var(--down);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
  box-shadow: 0 0 14px rgba(255, 77, 77, 0.6), inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  background-image:
    linear-gradient(45deg, transparent 50%, #fff 50%),
    linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: calc(100% - 12px) 50%, calc(100% - 8px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

/* ─── stage ────────────────────────────────────────────────────────────── */
.stage {
  padding: 18px 16px;
  display: grid;
  gap: 8px;
  perspective: 1400px;
  /* contain the cursor-light's blend so it doesn't bleed onto the dock */
  isolation: isolate;
  position: relative;
}

/* moving point light. Translates via CSS vars set on <html> by mousemove.
   plus-lighter additively brightens whatever is underneath, so glass
   bars catch it as a sweeping highlight. */
.cursor-light {
  position: fixed;
  top: 0; left: 0;
  width: 360px; height: 360px;
  margin-left: -180px;
  margin-top: -180px;
  background: radial-gradient(circle,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.18) 28%,
    rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
  z-index: 4;
  mix-blend-mode: plus-lighter;
  transform: translate3d(var(--mouse-x, 50vw), var(--mouse-y, 50vh), 0);
  will-change: transform;
}
.loading {
  text-align: center; color: var(--ink-dim);
  padding: 80px 0; letter-spacing: 0.2em; font-size: 12px;
}
.loading::before { content: ">> "; color: var(--mute); }
.loading::after  { content: " █";   color: var(--pri); animation: blink 1s steps(2) infinite; }

/* ─── row / channel ────────────────────────────────────────────────────── */
.row {
  position: relative;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  padding: 0;
  border-radius: 0;
  background: var(--panel);
  border: 1px solid var(--rule);
  transition: border-color 0.15s ease;
  overflow-x: hidden;
  overflow-x: clip;
  min-width: 0;
  /* paint isolation: each row repaints only its own contents on hit */
  contain: layout paint style;
  /* skip rendering offscreen rows entirely (huge win for tall ranges) */
  content-visibility: auto;
  contain-intrinsic-size: auto 280px;
}
.row.active, .row.playing { border-color: var(--pri); }
.row.playing { box-shadow: inset 0 0 0 1px rgba(232, 232, 240, 0.25); }

/* meta column */
.meta {
  border-right: 1px solid var(--rule);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.meta-rank {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
  font-weight: 500;
  margin-bottom: -2px;
}
.meta-sym {
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  font-size: 30px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--pri);
  text-shadow: 0 0 8px rgba(232, 232, 240, 0.45);
  line-height: 1;
}
.meta-name {
  font-size: 10px; letter-spacing: 0.16em;
  color: var(--ink-dim);
  padding-bottom: 4px;
}
.meta-inst {
  /* per-row instrument override - small select inside the meta panel */
  width: 100%;
  font-size: 10px;
  padding: 4px 22px 4px 8px;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
  border-color: var(--pri-low);
  margin-top: 2px;
  margin-bottom: 4px;
  border-bottom: 1px dashed var(--rule-soft);
  border-bottom-width: 1px;
}
.meta-inst:hover { color: var(--pri); border-color: var(--pri-dim); }

.meta-vol-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 2px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--rule-soft);
  cursor: default;
}
.meta-vol-k {
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--mute);
  min-width: 22px;
}
.meta-vol {
  flex: 1;
  width: auto;
  height: 14px;
}
/* slimmer track than the dock's tempo slider */
.meta-vol::-webkit-slider-runnable-track {
  height: 2px; background: var(--pri-low); border: 0;
}
.meta-vol::-webkit-slider-thumb {
  width: 8px; height: 12px; margin-top: -5px;
  background: var(--pri); box-shadow: 0 0 4px var(--pri);
}
.meta-vol::-moz-range-track {
  height: 2px; background: var(--pri-low); border: 0;
}
.meta-vol::-moz-range-thumb {
  width: 8px; height: 12px;
  background: var(--pri); box-shadow: 0 0 4px var(--pri);
}
.meta-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  row-gap: 3px; column-gap: 10px;
  font-size: 11px;
}
.meta-grid .k {
  color: var(--mute);
  letter-spacing: 0.16em;
  font-size: 10px;
  align-self: center;
}
.meta-grid .v {
  color: var(--ink); text-align: right;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

/* ─── chart ────────────────────────────────────────────────────────────── */
.chart {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: var(--row-h) 30px;
  align-items: stretch;
  padding: 12px 14px 6px;
}
/* axes hidden - we keep the markup so the bars-wrap grid placement still works */
.y-axis, .x-axis, .x-spacer { display: none; }
.y-tick {
  position: absolute;
  right: 8px;
  transform: translateY(50%);
  font-size: 10px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.y-tick::after {
  content: "";
  position: absolute;
  right: -9px; top: 50%;
  width: 6px; height: 1px;
  background: var(--pri-dim);
}

.bars-wrap {
  position: relative;
  grid-row: 1; grid-column: 1;
  overflow: visible;
  min-width: 0;
}
.y-grid { position: absolute; inset: 0; pointer-events: none; }
.y-gridline {
  position: absolute; left: 0; right: 0; height: 1px;
  background: var(--rule-soft);
}

.x-spacer { grid-row: 2; grid-column: 1; }
.x-axis {
  position: relative;
  grid-row: 2; grid-column: 2;
  border-top: 1px solid var(--rule);
}
.x-tick {
  position: absolute;
  top: 22px;          /* leaves room for the disable × buttons above */
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.x-tick::before {
  content: "";
  position: absolute;
  left: 50%; top: -6px;
  width: 1px; height: 4px;
  background: var(--pri-dim);
}

/* ─── bars (rendered by an OffscreenCanvas in renderer.worker.js) ─────
   The canvas overflows below the bars-wrap track so the worker has room
   to draw the date labels and per-bar × buttons in the strip beneath. */
.bars-canvas {
  display: block;
  width: 100%;
  height: calc(var(--row-h) + 36px);
  cursor: pointer;
  touch-action: none; /* allow drag-to-mute on touch without scrolling */
  user-select: none;
  -webkit-user-select: none;
}

/* legacy DOM bar rules (kept for any pre-existing snapshots; the live
   page renders bars on canvas now and these no longer match anything) */
.bars {
  position: relative;
  height: var(--row-h);
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 4px 4px;
}
.bars::after {
  content: "";
  position: absolute;
  left: -6px; right: -6px; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--pri-dim), transparent);
}

.bar {
  position: relative;
  flex: 1 1 0;
  min-width: 4px;
  cursor: pointer;
}
.bar.hit { animation: hit 360ms cubic-bezier(0.2, 0.8, 0.2, 1.4) both; }
@keyframes hit {
  0%   { transform: translateY(0); }
  18%  { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

.bar .face {
  position: absolute;
  background: linear-gradient(180deg, var(--c-top), var(--c-bot));
  pointer-events: none;
}
/* Front face - looks like a tinted piece of glass standing on edge.
   Stack: diagonal sheen → color tint → backdrop-blur the world behind.
   Highlights live in box-shadow (top, rim, bottom-fade). */
.bar .front {
  inset: 0 20.75%;
  border-radius: 3px;
  background:
    linear-gradient(135deg,
      rgba(255, 255, 255, 0.55) 0%,
      rgba(255, 255, 255, 0.05) 38%,
      rgba(255, 255, 255, 0)    62%,
      rgba(255, 255, 255, 0.18) 100%),
    linear-gradient(180deg,
      color-mix(in srgb, var(--c-top) 70%, transparent),
      color-mix(in srgb, var(--c-bot) 78%, transparent));
  backdrop-filter: blur(5px) saturate(1.5);
  -webkit-backdrop-filter: blur(5px) saturate(1.5);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.85),  /* sharp top spec */
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),  /* glass rim */
    inset 0 6px 14px rgba(255, 255, 255, 0.15), /* inner top glow */
    inset 0 -10px 16px rgba(0, 0, 0, 0.30),     /* depth at bottom */
    0 0 10px color-mix(in srgb, var(--c-top) 70%, transparent),
    0 8px 18px rgba(0, 0, 0, 0.45);             /* drop shadow */
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}
.bar:hover .front {
  filter: brightness(1.2);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 0.95),
    inset 0 0 0 1px rgba(255, 255, 255, 0.32),
    inset 0 6px 14px rgba(255, 255, 255, 0.22),
    inset 0 -10px 16px rgba(0, 0, 0, 0.30),
    0 0 18px color-mix(in srgb, var(--c-top) 80%, transparent),
    0 8px 22px rgba(0, 0, 0, 0.5);
}
.bar.hit .front {
  filter: brightness(1.35);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, 1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    inset 0 6px 14px rgba(255, 255, 255, 0.30),
    inset 0 -10px 16px rgba(0, 0, 0, 0.30),
    0 0 26px var(--c-top),
    0 8px 26px rgba(0, 0, 0, 0.55);
}
/* 3D-only faces - hidden in flat mode */
.bar .top, .bar .side { display: none; }

.bar .glow {
  position: absolute;
  left: 50%; bottom: -4px;
  width: 30%; height: 14px;
  transform: translate(-50%, 0);
  background: radial-gradient(ellipse at center, var(--c-top), transparent 65%);
  opacity: 0;
  filter: blur(6px);
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.bar.hit .glow { opacity: 0.85; }

.bar .ring { display: none; }

.bar .pct {
  position: absolute;
  left: 50%;
  top: -18px;
  transform: translate(-50%, 0);
  font-size: 10px;
  letter-spacing: 0.02em;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 0;
  background: #000;
  border: 1px solid currentColor;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  font-variant-numeric: tabular-nums;
}
.bar:hover .pct, .bar.hit .pct, .row:hover .pct { opacity: 1; }
/* badge inherits the bar's heat color via the per-bar CSS variable */
.bar .pct {
  color: var(--c-top);
  border-color: var(--c-top);
}

/* per-bar disable toggle: small × that sits below the bar */
.bar-x {
  position: absolute;
  left: 50%;
  bottom: -18px;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  padding: 0;
  background: var(--bg);
  border: 1px solid var(--pri-low);
  color: var(--pri-dim);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 0;
  opacity: 0.45;
  transition: opacity 0.15s ease, background 0.1s ease, color 0.1s ease, border-color 0.1s ease;
  z-index: 3;
  /* drag-to-mute: prevent touch scroll + accidental selection while dragging */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.row:hover .bar-x { opacity: 0.8; border-color: var(--pri-dim); }
.bar-x:hover {
  opacity: 1;
  background: var(--pri); color: var(--bg); border-color: var(--pri);
}
.bar.disabled .bar-x {
  opacity: 1;
  background: var(--pri); color: var(--bg); border-color: var(--pri);
}
.bar.disabled .front { opacity: 0.16; filter: saturate(0.35); }
.bar.disabled .pct { opacity: 0 !important; }
.bar.disabled { cursor: not-allowed; }

/* row-level mute (click meta to toggle) */
.meta { cursor: pointer; user-select: none; }
.meta::after {
  content: "MUTE ROW";
  display: block;
  margin-top: auto;
  padding-top: 8px;
  font-size: 9px; letter-spacing: 0.18em; color: var(--mute);
  border-top: 1px dashed var(--rule-soft);
}
.meta:hover::after { color: var(--pri); }
.row.disabled .meta::after { content: "ROW MUTED · CLICK TO ENABLE"; color: var(--pri); }
.row.disabled { opacity: 0.42; }
.row.disabled .bar.disabled { /* preserve double-disable readability */ }
.row.disabled .meta-sym { text-shadow: none; }

.playhead {
  position: absolute;
  top: -4px; bottom: -4px;
  left: 0;
  width: 1px;
  margin-left: -1px;
  background: var(--pri);
  box-shadow: 0 0 10px var(--pri), 0 0 22px var(--pri);
  pointer-events: none;
  transform: translateX(0);
  transition: transform 0.08s linear;
  opacity: 0;
  will-change: transform;
}
.row.playing .playhead { opacity: 1; }

/* ─── floating dock ────────────────────────────────────────────────────
   The dock is the page's main visual anchor: a heavy panel suspended
   off the bottom edge with a strong shadow so it reads as "lifted". */
.dock {
  position: fixed;
  left: 24px; right: 24px; bottom: 24px;
  z-index: 100;
  background:
    linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--pri-dim);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 1px 0 rgba(0,0,0,0.6) inset,
    0 30px 80px -10px rgba(0,0,0,0.85),
    0 0 0 1px rgba(0,0,0,0.4),
    0 0 60px rgba(232, 232, 240, 0.04);
  font-family: "IBM Plex Mono", monospace;
}
/* tiny "carry handle" notch above the dock - telegraphs that it's a panel */
.dock-handle {
  position: absolute;
  top: -7px; left: 50%;
  transform: translateX(-50%);
  width: 64px; height: 6px;
  background: var(--pri-dim);
  border: 1px solid var(--pri-dim);
  border-bottom: 0;
}
.dock-row {
  display: flex; align-items: center;
  gap: 22px;
  padding: 16px 22px;
  flex-wrap: wrap;
}
.dock-row + .dock-row { border-top: 1px solid var(--rule); }
.dock-transport { padding-top: 18px; }
.dock-ranges { gap: 14px; }
.dock-label {
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--mute);
  border-right: 1px solid var(--rule);
  padding-right: 12px;
}
.dock .fkeys { flex: 1; justify-content: flex-end; }

/* "over the top" play button: bigger, glowing, the visual hero */
.dock .cmd-primary {
  font-size: 13px;
  padding: 10px 22px;
  letter-spacing: 0.22em;
  box-shadow:
    0 0 18px rgba(232, 232, 240, 0.45),
    0 0 40px rgba(232, 232, 240, 0.15),
    inset 0 0 0 1px rgba(0,0,0,0.4);
}
.dock .cmd { padding: 9px 16px; font-size: 12px; }

/* leave room at the bottom of the page so the stage isn't covered by the dock */
.stage { padding-bottom: 260px; }

/* sysbar lives inside the dock as its top row */
.sysbar {
  justify-content: space-between;
  padding: 8px 18px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  background: var(--bg-1);
}
.sys-left, .sys-right { display: flex; align-items: center; gap: 14px; }
.prompt { color: var(--pri); font-weight: 700; letter-spacing: 0.16em; }
.cursor {
  display: inline-block;
  color: var(--pri);
  animation: blink 1s steps(2) infinite;
}
.hint-cmd { color: var(--mute); font-size: 10px; letter-spacing: 0.18em; }
.sys-stat {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; letter-spacing: 0.12em;
  color: var(--ink-dim);
}
.sys-stat .lbl {
  color: var(--mute);
  border-right: 1px solid var(--rule);
  padding-right: 6px;
  font-size: 9px;
  letter-spacing: 0.18em;
}

/* ─── responsive ──────────────────────────────────────────────────────── */

/* tablet-wide: header gets crowded once INST joins the command bar */
@media (max-width: 1200px) {
  .bar-cmd { flex-wrap: wrap; gap: 14px 18px; }
  .row { grid-template-columns: 220px 1fr; }
}

/* tablet: collapse the brand version, lighten the status row */
@media (max-width: 1000px) {
  .brand-pv .ver { display: none; }
  .status-row { gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
  :root { --row-h: 180px; }
  .chart { padding: 10px 10px 4px; }
}

/* phone: stack meta on top of chart, shrink 3D depth, drop sysbar hint */
@media (max-width: 760px) {
  .bar { padding: 8px 12px; gap: 12px; }
  .bar-status { flex-direction: column; align-items: flex-start; gap: 8px; }
  .status-row { justify-content: flex-start; flex-wrap: wrap; }
  /* let TEMPO / SCALE / INST flow onto multiple lines instead of clipping */
  .cmd-group { flex-wrap: wrap; gap: 10px 12px; }
  .kv { flex-wrap: wrap; }
  .row { grid-template-columns: 1fr; }
  .meta {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 10px 12px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 4px 14px;
    align-items: end;
  }
  .meta-sym  { grid-column: 1; font-size: 22px; }
  .meta-name { grid-column: 2; align-self: end; padding-bottom: 0; border-bottom: 0; }
  .meta-grid {
    grid-column: 1 / 3;
    grid-template-columns: repeat(3, auto 1fr);
    column-gap: 6px;
  }
  .chart { padding: 10px 10px 4px; }
  :root { --row-h: 150px; --bar-depth: 14px; }
  .sysbar .hint-cmd { display: none; }
}

/* small phone */
@media (max-width: 480px) {
  .stage { padding: 10px 8px; gap: 6px; }
  .fkey { padding: 4px 8px; font-size: 10px; }
  .meta-grid { grid-template-columns: repeat(2, auto 1fr); }
  :root { --row-h: 130px; --bar-depth: 12px; }
  .sys-stat { font-size: 9px; }
  input[type="range"] { width: 80px; }
  .dock { left: 12px; right: 12px; bottom: 12px; }
  .stage { padding-bottom: 280px; }
}
