/* ZEE — iPhone-first OP-Z–inspired jam UI (original CSS; no TE assets) */

:root {
  --bg: #1a1a1c;
  --bg-panel: #222226;
  --bg-raised: #2a2a2e;
  --charcoal: #0e0e10;
  --ink: #e8e6e2;
  --muted: #7a7874;
  --muted-2: #4a4844;
  --accent: #c4a574;
  --playhead: #f0e6d0;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --font: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --track-kick: #c45c4a;
  --track-snare: #d4784a;
  --track-hat: #c4a04a;
  --track-perc: #7a9e4a;
  --track-bass: #4a8e7a;
  --track-lead: #4a7ab0;
  --track-arp: #6a6ab0;
  --track-chord: #9a5a9a;
  --track-samp1: #a87858;
  --track-samp2: #b86848;
  --track-bass2: #3a7a6a;
  --track-lead2: #3a6aa0;
  --track-noise: #6a6a5a;
  --track-click: #8a8a7a;
  --track-chord2: #8a4a8a;
  --track-send: #5a5a62;
  --radius-btn: 10px;
  --radius-pad: 6px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.25;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body {
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100dvh;
  padding:
    calc(4px + var(--safe-top))
    calc(6px + var(--safe-right))
    calc(4px + var(--safe-bottom))
    calc(6px + var(--safe-left));
  gap: 4px;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* —— Transport —— */
.topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  height: 36px;
  min-width: 0;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.22em;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}

.transport {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.transport::-webkit-scrollbar { display: none; }

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

.status-dot.is-on {
  background: #6ab06a;
  box-shadow: 0 0 6px rgba(106, 176, 106, 0.55);
}

.btn {
  appearance: none;
  border: none;
  background: var(--bg-raised);
  color: var(--ink);
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 10px;
  min-width: 34px;
  height: 34px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: transform 0.08s ease, background 0.12s ease, opacity 0.12s;
}

.btn:active { transform: scale(0.94); }

.btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.12);
}

.btn--accent {
  background: var(--accent);
  color: var(--charcoal);
  border-color: transparent;
}

.btn--sm {
  min-width: 0;
  padding: 0 9px;
  font-size: 10px;
}

.btn--xs {
  min-width: 0;
  height: 26px;
  padding: 0 7px;
  font-size: 9px;
  border-radius: 7px;
}

.btn-icon {
  font-size: 12px;
  letter-spacing: 0;
  min-width: 34px;
}

.btn.is-playing {
  background: var(--track-kick);
  color: #fff;
  border-color: transparent;
}

.btn:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.btn.is-active {
  background: var(--accent);
  color: var(--charcoal);
  border-color: transparent;
}

.bpm-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.bpm-label {
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

#bpm {
  width: 44px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--charcoal);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  -moz-appearance: textfield;
}

#bpm::-webkit-outer-spin-button,
#bpm::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* —— Pattern / track banks —— */
.banks {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-shrink: 0;
  min-height: 28px;
}

.pattern-bank,
.track-bank {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.pattern-bank.is-flash,
.step-grid.is-flash {
  animation: clipFlash 0.22s ease;
}

@keyframes clipFlash {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  40% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

#btn-pat-cpy.has-clip,
#btn-pat-pst.has-clip {
  border-color: color-mix(in srgb, var(--accent) 55%, rgba(255,255,255,0.12));
  color: var(--accent);
}

#btn-pat-pst.has-clip:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

#btn-pat-cpy.has-track-clip::after,
#btn-pat-pst.has-track-clip::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--track-lead, #7ec8e3);
  box-shadow: 0 0 6px color-mix(in srgb, var(--track-lead, #7ec8e3) 60%, transparent);
}

#btn-pat-cpy,
#btn-pat-pst,
#btn-pat-next,
#btn-clear {
  position: relative;
}

#btn-pat-cpy.is-flash,
#btn-pat-pst.is-flash,
#btn-pat-next.is-flash,
#btn-clear.is-flash {
  animation: btnFlash 0.2s ease;
}

@keyframes btnFlash {
  0%, 100% { filter: brightness(1); }
  40% { filter: brightness(1.55); background: color-mix(in srgb, var(--accent) 35%, transparent); }
}

/* —— Track strip —— */
.tracks {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
  flex-shrink: 0;
}

.track {
  background: var(--bg-panel);
  color: var(--muted);
  border-radius: var(--radius-btn);
  padding: 5px 2px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 1.5px solid transparent;
  min-height: 40px;
  position: relative;
}

.track-select {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  touch-action: manipulation;
}

.track-select:active { transform: scale(0.96); }

.track.is-active {
  border-color: var(--track-color, var(--accent));
  background: var(--bg-raised);
  color: var(--ink);
}

.track.is-muted .track-dot {
  opacity: 0.25;
}

.track.is-muted .track-name {
  opacity: 0.4;
  text-decoration: line-through;
}

.track-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--track-color, var(--muted));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.track.is-active .track-dot {
  box-shadow: 0 0 8px color-mix(in srgb, var(--track-color) 55%, transparent);
}

.track-name {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

.track-mute {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.track.is-muted .track-mute {
  color: var(--muted);
}

/* —— Main: step grid + params —— */
.main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.step-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 5px;
  padding: 4px;
  background: var(--bg-panel);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.step {
  appearance: none;
  border: none;
  background: var(--charcoal);
  border-radius: var(--radius-pad);
  cursor: pointer;
  touch-action: manipulation;
  position: relative;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: background 0.08s ease, box-shadow 0.08s ease, transform 0.06s ease;
  overflow: hidden;
}

.step:active { transform: scale(0.96); }

.step::after {
  content: attr(data-n);
  position: absolute;
  bottom: 3px;
  left: 4px;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted-2);
  pointer-events: none;
}

.step.is-on {
  background: color-mix(in srgb, var(--track-color, var(--accent)) 72%, #111);
  border-color: color-mix(in srgb, var(--track-color, var(--accent)) 40%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 10px color-mix(in srgb, var(--track-color, var(--accent)) 28%, transparent);
}

.step.is-on::after {
  color: rgba(255, 255, 255, 0.45);
}

.step.is-playhead {
  outline: 2px solid var(--playhead);
  outline-offset: -2px;
  box-shadow:
    inset 0 0 0 1px rgba(240, 230, 208, 0.35),
    0 0 14px rgba(240, 230, 208, 0.35);
}

.step.is-playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: var(--playhead);
  border-radius: 2px 0 0 2px;
  pointer-events: none;
}

.step.is-beat:not(.is-on) {
  background: #141416;
  border-color: rgba(255, 255, 255, 0.08);
}

.step-prob-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.35);
  border-radius: 3px;
  padding: 1px 3px;
  pointer-events: none;
  line-height: 1.1;
}

.step.has-prob.is-on {
  opacity: calc(0.45 + var(--step-prob, 1) * 0.55);
}

/* —— Param knobs —— */
.params {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  flex-shrink: 0;
  padding: 5px 4px;
  background: var(--bg-panel);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.param {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.param-label {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.knob {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 26px;
  background: transparent;
  margin: 0;
  touch-action: none;
}

.knob::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: var(--muted-2);
}

.knob::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--charcoal);
  margin-top: -5.5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.knob::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: var(--muted-2);
  border: none;
}

.knob::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--charcoal);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* —— Punch-in FX bar (scrollable) —— */
.fx-bar {
  display: flex;
  flex-direction: row;
  gap: 5px;
  flex-shrink: 0;
  padding-top: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x;
}

.fx-bar::-webkit-scrollbar { display: none; }

.fx-btn {
  appearance: none;
  border: none;
  height: 42px;
  min-width: 64px;
  flex: 0 0 auto;
  border-radius: var(--radius-btn);
  background: var(--bg-raised);
  color: var(--muted);
  font: inherit;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: background 0.1s ease, color 0.1s ease, border-color 0.1s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}

.fx-btn-label {
  position: relative;
  z-index: 1;
}

.fx-amt-meter {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: color-mix(in srgb, var(--accent) 70%, #fff);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, width 0.08s ease;
}

.fx-btn.amt-partial .fx-amt-meter {
  opacity: 0.85;
}

.fx-btn:active,
.fx-btn.is-held,
.fx-btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--charcoal);
  border-color: transparent;
}

.fx-btn.is-held .fx-amt-meter,
.fx-btn[aria-pressed="true"] .fx-amt-meter {
  background: var(--charcoal);
  opacity: 0.35;
}

.fx-btn.is-latched {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 50%, transparent);
}

/* —— Overlay sheets —— */
.sheet-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 8px calc(52px + var(--safe-bottom));
  animation: fadeIn 0.12s ease;
}

.sheet-overlay[hidden] {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.sheet {
  width: 100%;
  max-width: 360px;
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px 14px 12px 12px;
  padding: 14px 14px 12px;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheet-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.sheet-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.sheet-sublabel {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.sheet-head--sub {
  margin-top: 2px;
}

.sheet-pct {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.sheet-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 36px;
  background: transparent;
  margin: 0;
  touch-action: none;
}

.sheet-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 4px;
  background: var(--muted-2);
}

.sheet-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--charcoal);
  margin-top: -10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.sheet-slider::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: var(--muted-2);
  border: none;
}

.sheet-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--charcoal);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.sheet-presets {
  display: flex;
  gap: 6px;
  justify-content: space-between;
}

.sheet-presets .btn {
  flex: 1;
}

.sheet-done {
  width: 100%;
  height: 40px;
}

@media (max-width: 360px) {
  .brand { display: none; }
  .track-name { font-size: 6px; }
  .fx-btn { font-size: 8px; height: 38px; min-width: 56px; }
}

/* —— FX pages —— */
.fx-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 2px;
}

.fx-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 22px;
}

.fx-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.fx-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
}

.fx-dot.is-on {
  background: var(--accent);
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 50%, transparent);
}

.fx-bar {
  display: flex;
  flex-direction: row;
  gap: 5px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x;
  min-height: 42px;
}

/* —— Step component badge —— */
.step.has-comp::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 5px color-mix(in srgb, var(--accent) 60%, transparent);
  pointer-events: none;
  z-index: 1;
}

.step.is-playhead.has-comp::before {
  /* playhead uses ::before for bar — use outline dot via box-shadow instead */
  content: none;
}

.step.has-comp .step-comp-dot {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 2;
}

/* —— Component sheet —— */
.sheet--tall {
  max-height: min(78dvh, 560px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.comp-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.comp-row {
  display: grid;
  grid-template-columns: 72px 1fr 28px;
  align-items: center;
  gap: 6px;
}

.comp-lock {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.comp-lock input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.comp-val {
  font-size: 9px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  text-align: right;
}

.sheet-slider--sm {
  height: 28px;
}

.sheet-slider--sm::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -6px;
}

.sheet-slider--sm::-moz-range-thumb {
  width: 20px;
  height: 20px;
}

.sheet-hint {
  margin: 0;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.35;
}

.sheet-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sheet-select {
  width: 100%;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--charcoal);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  padding: 0 8px;
}

/* —— Song scenes —— */
.song-scenes {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.song-scene {
  display: grid;
  grid-template-columns: 1fr 72px 28px;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  background: var(--bg-raised);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.song-scene.is-current {
  border-color: var(--accent);
}

.song-scene select,
.song-scene input[type="number"] {
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--charcoal);
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  padding: 0 6px;
}

.song-scene .btn {
  height: 28px;
  min-width: 28px;
  padding: 0;
}

#btn-song.is-active {
  background: var(--accent);
  color: var(--charcoal);
  border-color: transparent;
}

/* —— Cam preview —— */
.cam-preview-wrap {
  min-height: 72px;
  background: var(--charcoal);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.cam-preview {
  display: block;
  width: 100%;
  height: auto;
  max-height: 140px;
  object-fit: contain;
}

.file-btn {
  display: inline-flex;
  cursor: pointer;
}

@media (max-width: 360px) {
  .comp-row {
    grid-template-columns: 64px 1fr 24px;
  }
}


/* —— v6 sequencing feel —— */
.btn-swg {
  min-width: 44px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  padding: 0 6px;
}
.btn-swg.is-active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, rgba(255,255,255,0.12));
}

.seq-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  min-height: 26px;
  padding: 0 2px;
}
.seq-tools-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 2px;
}

.step.is-pulse {
  animation: stepPulse 0.18s ease-out;
}
@keyframes stepPulse {
  0% { filter: brightness(1.55); transform: scale(1.03); }
  100% { filter: brightness(1); transform: scale(1); }
}

.step.is-playhead {
  outline: 2px solid var(--playhead);
  outline-offset: -2px;
  box-shadow:
    inset 0 0 0 1px rgba(240, 230, 208, 0.45),
    0 0 16px rgba(240, 230, 208, 0.42),
    0 0 4px rgba(240, 230, 208, 0.55);
}
.step.is-playhead.is-on {
  box-shadow:
    inset 0 0 0 1px rgba(240, 230, 208, 0.35),
    0 0 18px color-mix(in srgb, var(--track-color, var(--accent)) 35%, rgba(240,230,208,0.4));
}

.step.has-ratchet .step-prob-badge {
  color: #ffe6a8;
}

.pattern-bank.is-pat-flash,
.step-grid.is-pat-flash {
  animation: patFlash 0.3s ease;
}
.pattern-bank.is-pat-pending {
  outline: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
}
@keyframes patFlash {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); filter: brightness(1.2); }
  35% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; filter: brightness(1); }
}

.track-mute.is-pending {
  outline: 1px dashed var(--accent);
  color: var(--accent);
}

/* Keep playhead bar; comp uses dedicated dot element */
.step.has-comp::before {
  /* suppressed — playhead also uses ::before; .step-comp-dot carries the amber mark */
  content: none;
}
.step.is-playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: var(--playhead);
  border-radius: 2px 0 0 2px;
  pointer-events: none;
  z-index: 3;
}
.step.has-comp .step-comp-dot {
  top: 4px;
  left: 5px;
}

.step-prob-badge {
  max-width: calc(100% - 6px);
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
  z-index: 2;
}
