/* ===================== workspace ===================== */

.workspace { position: absolute; inset: 0; background: var(--bg); }

.stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 35%, #877f6f 0, #6a6456 75%);
}

/* The camera image is the background, shown exactly as the sensor gives it:
   no vignette, tint, gradient, blur or contrast curve of any kind. */
.stage-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  opacity: 0;
  transition: opacity 900ms var(--ease-out);
}
.stage-video.is-live { opacity: 1; }

.stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.stage-hit {
  position: absolute;
  inset: 0;
  touch-action: none;
}
.workspace[data-mode='perform'] .stage-hit { pointer-events: none; }
.stage-hit[data-cursor='grab'] { cursor: grab; }
.stage-hit[data-cursor='grabbing'] { cursor: grabbing; }
.stage-hit[data-cursor='resize'] { cursor: nwse-resize; }

/* ---------- toolbar ---------- */

.toolbar {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 16px;
  z-index: 40;
  max-width: calc(100vw - 36px);
  transition: opacity 420ms var(--ease-out), transform 480ms var(--ease-out);
}
.toolbar > * { flex: none; white-space: nowrap; }
.workspace[data-mode='perform'] .toolbar { opacity: 0.74; }
.workspace[data-mode='perform'] .toolbar:hover,
.workspace[data-mode='perform'] .toolbar:focus-within { opacity: 1; }

.project-title {
  min-width: 84px;
  max-width: 230px;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
  border: 1px solid transparent;
  text-overflow: ellipsis;
  transition: background 200ms var(--ease-out), border-color 200ms var(--ease-out);
  cursor: text;
}
.project-title:hover { background: var(--surface); }
.project-title:focus {
  background: var(--field-focus);
  border-color: var(--line-strong);
  outline: none;
}

.save-status {
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  min-width: 58px;
  transition: color 300ms var(--ease-out), opacity 300ms var(--ease-out);
  white-space: nowrap;
}
.save-status[data-state='saving'] { color: var(--ink-2); }
.save-status[data-state='error'] { color: var(--danger); }

.segmented {
  display: flex;
  padding: 3px;
  border-radius: 11px;
  background: var(--field);
  border: 1px solid var(--line);
  position: relative;
}
.segmented button {
  position: relative;
  z-index: 1;
  height: 26px;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink-3);
  transition: color 260ms var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.segmented button .icon { width: 13px; height: 13px; }
.segmented button.is-on { color: var(--on-accent); }
.segmented-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 8px;
  background: var(--accent-fill);
  box-shadow: 0 4px 14px -6px rgb(var(--accent-rgb) / 1);
  transition: transform 480ms var(--ease-out), width 480ms var(--ease-out);
  z-index: 0;
}

/* ---------- floating panels ---------- */

.panel {
  position: absolute;
  border-radius: var(--radius-l);
  z-index: 45;
  padding: 16px;
  width: 300px;
  animation: panel-in 380ms var(--ease-out) both;
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.panel.is-right { top: 74px; right: 18px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.panel.is-scroll {
  display: flex;
  flex-direction: column;
  max-height: 62vh;
  padding: 0;
  overflow: hidden;
}
.panel.is-scroll .panel-head {
  flex: none;
  position: sticky;
  top: 0;
  z-index: 1;
  margin-bottom: 0;
  padding: 16px 16px 14px;
  background: var(--panel-bg);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
}
.panel-body {
  overflow-y: auto;
  padding: 0 16px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgb(var(--ink-rgb) / 0.18) transparent;
}
.panel-body::-webkit-scrollbar { width: 6px; }
.panel-body::-webkit-scrollbar-track { background: transparent; }
.panel-body::-webkit-scrollbar-thumb {
  background: rgb(var(--ink-rgb) / 0.18);
  border-radius: 99px;
}
.panel-body::-webkit-scrollbar-thumb:hover { background: rgb(var(--ink-rgb) / 0.27); }
.panel-close {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 7px;
  color: var(--ink-3);
  transition: color 200ms var(--ease-out), background 200ms var(--ease-out);
}
.panel-close:hover { color: var(--ink); background: var(--surface); }

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 7px;
}
.field-value { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: rgb(var(--ink-rgb) / 0.18);
  cursor: pointer;
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--accent-ink);
  box-shadow: 0 0 0 1px rgb(var(--accent-rgb) / 0.54), 0 3px 8px -2px rgb(var(--shadow-rgb) / 0.27);
  transition: transform 200ms var(--ease-out);
}
input[type='range']:hover::-webkit-slider-thumb { transform: scale(1.18); }
input[type='range']::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--accent-ink);
}

.choice-row { display: flex; gap: 6px; }
.choice {
  flex: 1;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-3);
  display: grid;
  place-items: center;
  transition: all 220ms var(--ease-out);
}
.choice:hover { color: var(--ink); border-color: var(--line-strong); }
.choice.is-on { color: var(--on-accent); background: var(--accent-fill); border-color: rgb(var(--accent-rgb) / 0.7); }

.slider-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--panel-ink-dim);
}

.field-hint {
  margin-top: 6px;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--panel-ink-dim);
}

.field-hint.is-error { color: var(--danger); }

/* ---------- custom sample controls ---------- */

.sample-section {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--panel-line);
  background: rgb(var(--ink-rgb) / 0.02);
}
.sample-section > .field-row { margin-bottom: 9px; }
.sample-section > .btn { height: 30px; }

.file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  padding: 6px 4px 6px 10px;
  border-radius: 9px;
  background: var(--field);
  border: 1px solid var(--panel-line);
}
.file-name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--panel-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-remove { height: 24px; padding: 0 6px; }
.file-remove .icon { width: 13px; height: 13px; }

.btn-row { display: flex; gap: 6px; margin-top: 10px; }

/* ---------- custom sample: drop zone, recording, waveform ---------- */

.sample-section {
  border-radius: 12px;
  margin: 0 -6px 14px;
  padding: 6px;
  border: 1px dashed transparent;
  transition: border-color 200ms var(--ease-out), background 200ms var(--ease-out);
}
.sample-section.is-dropping {
  border-color: rgb(var(--accent-rgb) / 0.81);
  background: rgb(var(--accent-rgb) / 0.08);
}
.drop-hint {
  margin-top: 6px;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--panel-ink-dim);
}
.sample-section.is-dropping .drop-hint { color: var(--accent-ink); }

.record-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}
.record-btn.is-recording {
  color: var(--danger);
  border-color: rgb(var(--danger-rgb) / 0.55);
  background: rgb(var(--danger-rgb) / 0.1);
}
.record-btn.is-recording .record-dot {
  background: var(--danger);
  opacity: 1;
  animation: pulse-dot 1.2s ease-in-out infinite;
}
.record-elapsed { font-variant-numeric: tabular-nums; min-width: 34px; text-align: left; }

.waveform-row { display: flex; align-items: stretch; gap: 6px; margin-top: 10px; }
.waveform { flex: 1; min-width: 0; }
.waveform-surface {
  position: relative;
  height: 64px;
  border-radius: 8px;
  background: var(--field);
  border: 1px solid var(--panel-line);
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.waveform-surface.is-dragging { cursor: ew-resize; }
.waveform-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.waveform-handle {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--accent-ink);
  pointer-events: none;
}
.waveform-handle::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 8px; height: 22px;
  margin: -11px 0 0 -4px;
  border-radius: 3px;
  background: var(--paper);
  border: 1px solid var(--accent-ink);
}
.waveform-readout {
  margin-top: 5px;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--panel-ink-dim);
}
.waveform-play { width: 34px; padding: 0; justify-content: center; height: 64px; flex: none; }

.btn-row .btn { flex: 1; justify-content: center; height: 30px; }
.btn[disabled] { opacity: 0.4; cursor: default; pointer-events: none; }

.panel-note {
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--ink-3);
}

/* ---------- chord builder dock ---------- */

/* Tool surfaces override the translucent shared .glass treatment: over a live
   camera feed they must stay readable whatever the image behind them. */
.dock, .panel, .toolbar, .circle-badge, .perform-hint {
  background: var(--panel-bg);
  border-color: var(--panel-line);
  box-shadow: 0 26px 64px -22px rgb(var(--shadow-rgb) / 0.29), var(--edge-light);
  color: var(--panel-ink);
}
.dock .label-xs, .panel .label-xs { color: var(--panel-label); font-weight: 600; }
.panel .field-value { color: var(--panel-ink); font-weight: 500; font-size: 11.5px; }
.panel .panel-note { color: var(--panel-ink-dim); }
.panel .panel-close { color: var(--panel-ink-dim); }
.panel .panel-close:hover { color: var(--ink); background: rgb(var(--ink-rgb) / 0.1); }

.panel .choice {
  color: var(--panel-ink);
  border-color: rgb(var(--ink-rgb) / 0.12);
  background: rgb(var(--ink-rgb) / 0.04);
  font-weight: 500;
}
.panel .choice:hover {
  color: var(--ink);
  background: rgb(var(--ink-rgb) / 0.11);
  border-color: rgb(var(--ink-rgb) / 0.27);
}
.panel .choice.is-on {
  color: var(--on-accent);
  background: var(--accent-fill);
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 5px 16px -8px rgb(var(--accent-rgb) / 1);
}

.dock {
  position: absolute;
  left: 50%;
  bottom: 20px;
  z-index: 44;
  width: min(760px, calc(100vw - 40px));
  border-radius: var(--radius-l);
  padding: 14px 16px 15px;
  /* --magnet rises from 0 to 1 as a dragged chord approaches. */
  --magnet: 0;
  transform: translateX(-50%) scale(calc(1 + var(--magnet) * 0.018));
  transition: opacity 380ms var(--ease-out), transform 320ms var(--ease-out),
              border-color 320ms var(--ease-out), box-shadow 320ms var(--ease-out);
}
.dock.is-magnetic {
  border-color: rgb(var(--danger-rgb) / 0.42);
  box-shadow: var(--shadow-lift), 0 0 46px -16px rgb(var(--danger-rgb) / 0.55),
              var(--edge-light);
}

.workspace[data-mode='perform'] .dock {
  opacity: 0;
  transform: translateX(-50%) translateY(24px) scale(0.97);
  pointer-events: none;
}

.dock-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: stretch;
}

.dock-controls { display: flex; flex-direction: column; gap: 13px; }

.dock-field { display: flex; flex-direction: column; gap: 7px; }

.dock-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--panel-label);
}

.dock-root { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chip-row-accidental {
  padding-left: 12px;
  border-left: 1px solid var(--panel-line);
}

.chip-row { display: flex; flex-wrap: wrap; gap: 5px; }

/* Extensions and Transpose share one row; Transpose sits at the far right. */
.dock-row { display: flex; align-items: flex-start; gap: 18px; }
.dock-transpose { margin-left: auto; }

/* ---------- transpose stepper: a tiny utility, same idiom as the chips ---------- */

.stepper { display: flex; align-items: center; gap: 4px; }
.chip-step { min-width: 30px; padding: 0 6px; font-size: 13px; line-height: 1; }
.chip-step:disabled { opacity: 0.32; cursor: default; transform: none; }
.chip-step:disabled:hover { background: rgb(var(--ink-rgb) / 0.04); border-color: rgb(var(--ink-rgb) / 0.1); color: var(--panel-ink); }
.stepper-value {
  min-width: 30px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--panel-ink-dim);
}
.stepper-value.is-active { color: var(--accent-ink); }

/* ---------- chips: four clearly separated states ---------- */

.chip {
  height: 30px;
  min-width: 36px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--panel-ink);
  background: rgb(var(--ink-rgb) / 0.04);
  border: 1px solid rgb(var(--ink-rgb) / 0.1);
  transition: color 160ms var(--ease-out), background 160ms var(--ease-out),
              border-color 160ms var(--ease-out), transform 300ms var(--ease-out),
              box-shadow 200ms var(--ease-out);
}
.chip:hover {
  color: var(--ink);
  background: rgb(var(--ink-rgb) / 0.12);
  border-color: rgb(var(--ink-rgb) / 0.27);
  transform: translateY(-1px);
}
.chip:active { transform: translateY(0) scale(0.94); }
.chip.is-on {
  color: var(--on-accent);
  background: var(--accent-fill);
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 0 0 1px rgb(var(--accent-rgb) / 0.47), 0 6px 18px -8px rgb(var(--accent-rgb) / 1);
  transform: translateY(-1px);
}
.chip.is-on:hover { background: var(--accent-fill-hover); }

.chip-accidental { font-size: 15px; min-width: 40px; line-height: 1; }

/* ---------- assembled chord pill ---------- */

.dock-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 186px;
  padding-left: 20px;
  border-left: 1px solid var(--panel-line);
}

.chord-socket {
  display: grid;
  place-items: center;
  min-width: 132px;
  min-height: 58px;
  padding: 5px;
  border-radius: 17px;
  border: 1px dashed transparent;
  transition: border-color 260ms var(--ease-out), background 260ms var(--ease-out);
}
/* While the chord is in flight the socket reads as an empty slot. */
.dock.is-lifted .chord-socket {
  border-color: rgb(var(--accent-rgb) / 0.47);
  background: rgb(var(--accent-rgb) / 0.07);
}
.dock.is-lifted .chord-block { opacity: 0; transform: scale(0.9); pointer-events: none; }

.dock-hint {
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  color: var(--panel-ink-dim);
  max-width: 168px;
}

/* ---------- the chord block: a tactile object ---------- */

.chord-block {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 116px;
  height: 52px;
  padding: 0 20px;
  border-radius: 14px;
  background: linear-gradient(170deg, #f7f0e4 0%, #efe5d3 60%, #e5d8c0 100%);
  border: 1px solid rgb(var(--accent-rgb) / 0.75);
  color: var(--ink);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.005em;
  cursor: grab;
  user-select: none;
  touch-action: none;
  white-space: nowrap;
  box-shadow:
    0 12px 28px -12px rgb(var(--shadow-rgb) / 0.28),
    var(--edge-light),
    inset 0 -1px 0 rgb(var(--ink-rgb) / 0.05);
  transition: transform 420ms var(--ease-out), box-shadow 320ms var(--ease-out),
              border-color 320ms var(--ease-out), opacity 260ms var(--ease-out);
}
.chord-block.is-wide { font-size: 16px; }
.chord-block::after {
  content: '';
  position: absolute;
  inset: 1px 1px 55% 1px;
  border-radius: 13px 13px 20px 20px;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.3), rgb(255 255 255 / 0));
  pointer-events: none;
}
.chord-block:hover {
  transform: translateY(-4px);
  border-color: rgb(var(--accent-rgb) / 1);
  box-shadow: 0 20px 40px -14px rgb(var(--shadow-rgb) / 0.28), 0 0 30px -8px rgb(var(--accent-rgb) / 0.74),
              var(--edge-light);
}
.chord-block.is-pressed { transform: translateY(-1px) scale(0.96); }
.chord-block:active { cursor: grabbing; }

/* ---------- while flying ---------- */

.chord-block.is-flying {
  position: fixed;
  /* Anchor to the viewport origin. Without top/left a fixed element resolves
     against its static position — the bottom of <body> — so the transform would
     carry it off-screen and the drag avatar would never be seen. */
  top: 0;
  left: 0;
  /* Above the tutorial overlay (z-index 500, see tutorial.css) too, so a
     chord being dragged never dims as it crosses outside the spotlight. */
  z-index: 550;
  pointer-events: none;
  cursor: grabbing;
  transition: none;
  will-change: transform;
  border-color: rgb(var(--accent-rgb) / 1);
  box-shadow: 0 34px 64px -20px rgb(var(--shadow-rgb) / 0.3), 0 0 52px -12px rgb(var(--accent-rgb) / 0.81),
              var(--edge-light);
}
.chord-block.is-flying.will-land {
  border-color: var(--accent);
  box-shadow: 0 34px 64px -20px rgb(var(--shadow-rgb) / 0.3), 0 0 62px -10px rgb(var(--accent-rgb) / 1);
}
.chord-block.is-flying.will-remove {
  border-color: rgb(var(--danger-rgb) / 0.85);
  box-shadow: 0 30px 58px -20px rgb(var(--shadow-rgb) / 0.3), 0 0 46px -12px rgb(var(--danger-rgb) / 0.6);
}


/* ---------- circle badge ---------- */

.circle-badge {
  position: absolute;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 11px;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms var(--ease-out);
}
.circle-badge.is-visible { opacity: 1; pointer-events: auto; }
.circle-badge button {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 8px;
  color: var(--ink-3);
  transition: color 200ms var(--ease-out), background 200ms var(--ease-out);
}
.circle-badge button:hover { color: var(--ink); background: var(--surface-strong); }
.circle-badge button.is-danger:hover { color: var(--danger); background: rgb(var(--danger-rgb) / 0.12); }
.circle-badge .icon { width: 13px; height: 13px; }

.circle-badge .badge-name {
  padding: 0 9px 0 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--panel-ink);
  white-space: nowrap;
}
.circle-badge .badge-divider {
  width: 1px;
  align-self: stretch;
  margin: 4px 2px;
  background: var(--panel-line);
}
.circle-badge .badge-auto {
  width: auto;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 500;
}
.circle-badge .badge-auto.is-on {
  color: var(--on-accent);
  background: var(--accent-fill);
}
.circle-badge .badge-auto.is-on:hover { background: var(--accent-fill-hover); }
.circle-badge button { font-size: 14px; line-height: 1; }

/* ---------- camera state overlay ---------- */

.stage-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 60;
  background: var(--scrim);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: panel-in 400ms var(--ease-out) both;
}
.stage-state-card {
  width: min(420px, calc(100vw - 48px));
  padding: 30px 30px 26px;
  border-radius: var(--radius-l);
  text-align: center;
}
.stage-state-icon {
  width: 44px; height: 44px;
  margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: 13px;
  border: 1px solid var(--line);
  color: var(--accent-ink);
  background: rgb(var(--accent-rgb) / 0.08);
}
.stage-state-icon .icon { width: 20px; height: 20px; }
.stage-state h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.stage-state p {
  margin: 0 0 20px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-2);
}
.stage-state-actions { display: flex; gap: 8px; justify-content: center; }

.spinner {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgb(var(--accent-rgb) / 0.4);
  border-top-color: var(--accent);
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- perform-mode hint ---------- */

.perform-hint {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--ink-2);
  opacity: 0;
  transition: opacity 600ms var(--ease-out);
  pointer-events: none;
}
.workspace[data-mode='perform'] .perform-hint { opacity: 1; }
.perform-hint.is-hidden { opacity: 0 !important; }
.perform-hint .icon { width: 14px; height: 14px; color: var(--sage-ink); }

.hint-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--sage);
  animation: pulse-dot 2.6s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

/* ---------- chord dissipation ---------- */

.chord-dust {
  position: fixed;
  top: 0;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgb(var(--accent-rgb) / 1);
  filter: blur(1.5px);
  pointer-events: none;
  z-index: 199;
}

/* ---------- narrow screens ---------- */

@media (max-width: 1000px) {
  /* The toolbar can be wider than the window: scroll it, don't clip it. */
  .toolbar {
    left: 12px;
    right: 12px;
    top: 12px;
    transform: none;
    max-width: none;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .toolbar::-webkit-scrollbar { display: none; }
}

@media (max-width: 720px) {
  /* Stack the chord block under the controls so it stays reachable to drag. */
  .dock { bottom: 12px; width: calc(100vw - 24px); padding: 12px; }
  .dock-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .dock-controls { gap: 9px; }
  .dock-row { flex-wrap: wrap; gap: 10px 18px; }
  .chip-row-accidental { padding-left: 0; border-left: 0; }
  .dock-stage {
    width: auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 0 0;
    border-left: 0;
    border-top: 1px solid var(--panel-line);
  }
  .chord-socket { min-height: 0; padding: 0; }
  .dock-hint { max-width: none; text-align: left; }
}
