/* ============================================================= buttons */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 560;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--fast) var(--ease-out), background var(--fast) linear,
    border-color var(--fast) linear, color var(--fast) linear, box-shadow var(--fast) linear;
}

.btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn:hover {
  color: var(--ink);
  border-color: var(--hairline-strong);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.04));
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn-small {
  padding: 5px 9px;
  font-size: 11px;
}

.btn-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--ink-mute);
}

.btn-quiet:hover {
  background: rgba(255, 255, 255, 0.06);
}

.btn-icon {
  padding: 6px;
  width: 28px;
  height: 28px;
  justify-content: center;
  border-radius: var(--r-sm);
}

.btn-icon svg {
  width: 14px;
  height: 14px;
  transition: transform var(--base) var(--ease-out);
}

.btn-accent {
  color: #04121a;
  border-color: transparent;
  background: linear-gradient(180deg, #6ff0f6, #29c3cd);
  box-shadow: 0 6px 18px rgba(77, 224, 232, 0.28);
  font-weight: 680;
}

.btn-accent:hover {
  color: #04121a;
  background: linear-gradient(180deg, #86f6fb, #33d2dc);
}

.btn-primary {
  color: #12040f;
  border-color: transparent;
  background: linear-gradient(135deg, #7ceef4, #f79ce0);
  box-shadow: 0 8px 26px rgba(243, 123, 216, 0.28);
  font-weight: 700;
  padding: 9px 16px;
}

.btn-primary:hover {
  filter: brightness(1.08);
  color: #12040f;
}

.btn-toggle.is-on {
  color: #04121a;
  border-color: transparent;
  background: linear-gradient(180deg, #9df3a8, #55cf74);
  box-shadow: 0 6px 20px rgba(124, 247, 176, 0.26);
  font-weight: 680;
}

.file-btn {
  position: relative;
  overflow: hidden;
}

.file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.segmented {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: rgba(0, 0, 0, 0.26);
}

.seg-btn {
  padding: 5px 11px;
  border: 0;
  border-radius: calc(var(--r-md) - 3px);
  background: transparent;
  color: var(--ink-mute);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--fast) linear, color var(--fast) linear;
}

.seg-btn:hover {
  color: var(--ink);
}

.seg-btn.is-active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.11);
  box-shadow: var(--inner-top);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--ink-mute);
  cursor: pointer;
}

.check input {
  appearance: none;
  width: 30px;
  height: 17px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--hairline);
  position: relative;
  cursor: pointer;
  transition: background var(--base) var(--ease-out);
}

.check input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ink-soft);
  transition: transform var(--base) var(--ease-spring), background var(--base) linear;
}

.check input:checked {
  background: rgba(124, 247, 176, 0.34);
  border-color: rgba(124, 247, 176, 0.5);
}

.check input:checked::after {
  transform: translateX(13px);
  background: var(--good);
}

/* ============================================================== meters */

.meter {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.07);
}

.meter-fill {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--good) 0%, #cfe86a 62%, var(--warn) 84%, var(--danger) 100%);
  transition: transform 70ms linear;
}

.master-meter .meter-fill {
  height: 2px;
}

.master-slider {
  appearance: none;
  width: 84px;
  height: 3px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
}

.master-slider::-webkit-slider-thumb {
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  cursor: grab;
}

/* =============================================================== queue */

.queue-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px 9px;
  border-bottom: 1px solid var(--hairline);
}

.queue-title h2 {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.queue-stats {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--ink-faint);
}

.queue-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.queue-scroll {
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.queue-scroll::-webkit-scrollbar {
  width: 9px;
}

.queue-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: var(--r-pill);
  border: 3px solid transparent;
  background-clip: content-box;
}

.queue-list {
  display: grid;
  gap: 4px;
}

/* The title gets every pixel that is left over: the fixed columns are kept lean and
   the row actions float above the right edge instead of reserving space. */
.q-row {
  position: relative;
  display: grid;
  grid-template-columns: 10px 22px 38px minmax(0, 1fr) 28px 42px;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.028);
  cursor: grab;
  transition: background var(--fast) linear, border-color var(--fast) linear,
    transform var(--base) var(--ease-out), opacity var(--base) linear;
}

.q-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--hairline);
}

.q-row[data-dragging="true"] {
  opacity: 0.32;
  border-style: dashed;
  border-color: var(--hairline-strong);
}

.q-row[data-played="true"] {
  opacity: 0.46;
}

.q-row[data-deck="A"] {
  border-color: rgba(77, 224, 232, 0.42);
  background: linear-gradient(90deg, rgba(77, 224, 232, 0.14), rgba(255, 255, 255, 0.02));
}

.q-row[data-deck="B"] {
  border-color: rgba(243, 123, 216, 0.42);
  background: linear-gradient(90deg, rgba(243, 123, 216, 0.14), rgba(255, 255, 255, 0.02));
}

.q-row[data-status="missing"] {
  opacity: 0.6;
  border-style: dashed;
  border-color: rgba(255, 180, 87, 0.4);
}

.q-row[data-status="analysing"] .q-spark,
.q-row[data-status="pending"] .q-spark {
  animation: pulse 1.4s var(--ease-out) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.32; }
  50%      { opacity: 0.72; }
}

.q-grip {
  display: grid;
  gap: 2px;
  opacity: 0.34;
  /* The grip owns the drag gesture so the rest of the row can still scroll. */
  touch-action: none;
}

.q-grip i {
  display: block;
  width: 10px;
  height: 1px;
  background: var(--ink-soft);
}

.q-row:hover .q-grip {
  opacity: 0.7;
}

.q-index {
  font-size: 10.5px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.q-spark {
  width: 38px;
  height: 18px;
  border-radius: 3px;
}

.q-meta {
  min-width: 0;
  display: grid;
}

.q-title {
  font-size: 12.5px;
  font-weight: 580;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.q-artist {
  font-size: 10.5px;
  line-height: 1.3;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.q-artist[hidden] {
  display: none;
}

.q-bpm,
.q-dur {
  font-size: 11px;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.q-row[data-confident="false"] .q-bpm {
  opacity: 0.55;
}

.q-actions {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: flex;
  gap: 3px;
  padding-left: 26px;
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, transparent, rgba(17, 22, 32, 0.95) 26%);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--fast) linear;
}

.q-row:hover .q-actions,
.q-row:focus-within .q-actions {
  pointer-events: auto;
}

.q-row:hover .q-actions,
.q-row:focus-within .q-actions {
  opacity: 1;
}

.q-load,
.q-remove {
  width: 21px;
  height: 21px;
  border-radius: var(--r-sm);
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-mute);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--fast) linear;
}

.q-load-a:hover {
  color: #04121a;
  background: var(--deck-a);
  border-color: transparent;
}

.q-load-b:hover {
  color: #12040f;
  background: var(--deck-b);
  border-color: transparent;
}

.q-remove:hover {
  color: #12040f;
  background: var(--danger);
  border-color: transparent;
}

.queue-empty {
  padding: 26px 18px;
  text-align: center;
  border: 1px dashed var(--hairline);
  border-radius: var(--r-md);
  margin: 8px 2px;
}

.queue-empty .drop-title {
  font-size: 13px;
}

.queue-empty .drop-sub {
  font-size: 11px;
  line-height: 1.5;
}

.empty-add {
  margin-top: 13px;
  min-height: 40px;
  justify-content: center;
}

.queue-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--hairline);
}

.queue-next {
  font-size: 10.5px;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================================================================ deck */

.deck {
  position: relative;
  display: grid;
  /* The waveform row carries a floor: without it a tall EQ panel on a short screen
     squeezes the row to zero and the two canvases end up drawn on top of each other. */
  grid-template-rows: auto minmax(116px, 1fr) auto auto;
  min-height: 0;
  padding: 10px 14px 12px;
  overflow: hidden;
  --deck-accent: var(--deck-a);
  --deck-level: 0;
  transition: border-color var(--base) linear, box-shadow var(--base) linear;
}

.deck[data-deck="B"] {
  --deck-accent: var(--deck-b);
}

.deck-glow {
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 160%;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--deck-accent) 26%, transparent), transparent 62%);
  opacity: calc(0.1 + var(--deck-level) * 0.55);
  transition: opacity 90ms linear;
}

.deck[data-live="true"] {
  border-color: color-mix(in srgb, var(--deck-accent) 42%, transparent);
  box-shadow: var(--lift), var(--inner-top),
    0 0 0 1px color-mix(in srgb, var(--deck-accent) 18%, transparent),
    0 0 42px color-mix(in srgb, var(--deck-accent) 14%, transparent);
}

.deck[data-drop-target="true"] {
  border-color: color-mix(in srgb, var(--deck-accent) 74%, transparent);
  box-shadow: var(--lift), 0 0 0 2px color-mix(in srgb, var(--deck-accent) 44%, transparent),
    0 0 60px color-mix(in srgb, var(--deck-accent) 26%, transparent);
}

.deck-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 14px;
  padding-bottom: 9px;
}

.deck-id {
  display: grid;
  justify-items: center;
  gap: 3px;
}

.deck-letter {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 800;
  color: var(--deck-accent);
  background: color-mix(in srgb, var(--deck-accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--deck-accent) 34%, transparent);
  box-shadow: inset 0 0 14px color-mix(in srgb, var(--deck-accent) 18%, transparent);
}

.deck-role {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

.deck[data-live="true"] .deck-role {
  color: var(--deck-accent);
}

.deck-titles {
  min-width: 0;
}

.deck-title {
  font-size: 17px;
  font-weight: 640;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deck-sub {
  margin-top: 1px;
  font-size: 11.5px;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deck-stats {
  display: flex;
  gap: 16px;
}

.stat {
  display: grid;
  justify-items: end;
  gap: 1px;
}

.stat-value {
  font-size: 15px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.stat-value[data-estimate="true"] {
  color: var(--ink-mute);
}

.stat-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.13em;
  color: var(--ink-faint);
}

.deck[data-warn="true"] .stat-remain .stat-value {
  color: var(--warn);
  animation: blink 1s steps(2) infinite;
}

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

.deck-meter {
  width: 74px;
  height: 4px;
}

.deck-expand svg {
  transform: rotate(180deg);
}

.deck[data-expanded="false"] .deck-expand svg {
  transform: rotate(0deg);
}

/* ---------------------------------------------------------- waveforms */

.wave-stack {
  position: relative;
  display: grid;
  grid-template-rows: minmax(72px, 1fr) 38px;
  gap: 5px;
  min-height: 116px;
}

.wave {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: rgba(6, 9, 14, 0.5);
  touch-action: none;
}

.wave-detail {
  cursor: grab;
  min-height: 72px;
}

.wave-stack[data-scrubbing="true"] .wave-detail {
  cursor: grabbing;
  border-color: color-mix(in srgb, var(--deck-accent) 52%, transparent);
}

.wave-overview {
  cursor: pointer;
}

.wave-playhead {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: calc(100% - 43px);
  transform: translateX(-50%);
  pointer-events: none;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--deck-accent) 65%, transparent), transparent);
  filter: blur(3px);
  opacity: 0.85;
}

.scrub-badge {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translate(-50%, -4px);
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: rgba(8, 11, 17, 0.9);
  border: 1px solid var(--hairline-strong);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--fast) linear, transform var(--fast) var(--ease-out);
}

.scrub-badge[data-visible="true"] {
  opacity: 1;
  transform: translate(-50%, 0);
}

.wave-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: rgba(8, 11, 17, 0.86);
  border: 1px solid var(--hairline);
  font-size: 11px;
  color: var(--ink-mute);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--base) linear;
}

.wave-hint[data-visible="true"] {
  opacity: 1;
}

/* ---------------------------------------------------------- transport */

.deck-transport {
  display: flex;
  gap: 6px;
  padding-top: 9px;
  flex-wrap: wrap;
}

.tbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: var(--r-sm);
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 560;
  cursor: pointer;
  transition: all var(--fast) linear;
}

.tbtn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
}

.tbtn svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.tbtn .i-pause {
  display: none;
  fill: none;
}

.deck[data-playing="true"] .tbtn-play .i-play { display: none; }
.deck[data-playing="true"] .tbtn-play .i-pause { display: inline; }

.tbtn-play {
  color: #04121a;
  border-color: transparent;
  background: color-mix(in srgb, var(--deck-accent) 88%, white);
  font-weight: 700;
  min-width: 82px;
}

.tbtn-play:hover {
  color: #04121a;
  filter: brightness(1.1);
  background: color-mix(in srgb, var(--deck-accent) 88%, white);
}

.deck[data-playing="true"] .tbtn-play {
  box-shadow: 0 0 22px color-mix(in srgb, var(--deck-accent) 42%, transparent);
}

.tbtn-eject {
  margin-left: auto;
  color: var(--ink-faint);
}

.tbtn-eject:hover {
  color: var(--danger);
}

/* --------------------------------------------------------- deck extra */

/* Collapsed with max-height rather than the 0fr grid trick: this block has two
   children, and 0fr would only ever collapse the first of them. */
.deck-extra {
  display: grid;
  max-height: 240px;
  overflow: hidden;
  opacity: 1;
  transition: max-height var(--slow) var(--ease-out), opacity var(--base) linear;
}

.deck[data-expanded="false"] .deck-extra {
  max-height: 0;
  opacity: 0;
}

.deck-extra > * {
  min-height: 0;
}

.knob-row {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  padding: 8px 2px 4px;
}

.knob {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 54px;
  cursor: ns-resize;
  --knob-angle: 0deg;
  --knob-fill: 0.5;
  --knob-accent: var(--deck-accent);
}

.knob::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: conic-gradient(from 225deg,
    color-mix(in srgb, var(--knob-accent) 85%, transparent) calc(var(--knob-fill) * 270deg),
    rgba(255, 255, 255, 0.07) 0 270deg,
    transparent 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
  opacity: 0.9;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--knob-accent) 42%, transparent));
  pointer-events: none;
}

.knob[data-centered="true"]::before {
  filter: none;
  opacity: 0.55;
}

.knob-dial {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 28%, #33405a, #141a26 68%),
    #10151f;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -6px 12px rgba(0, 0, 0, 0.6),
    0 6px 14px rgba(0, 0, 0, 0.5);
  transform: rotate(var(--knob-angle));
  transition: transform 60ms linear;
}

.knob[data-active="true"] .knob-dial {
  transition: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -6px 12px rgba(0, 0, 0, 0.6),
    0 6px 20px color-mix(in srgb, var(--knob-accent) 38%, transparent);
}

.knob-pointer {
  position: absolute;
  top: 4px;
  left: 50%;
  width: 2px;
  height: 11px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: var(--knob-accent);
  box-shadow: 0 0 8px var(--knob-accent);
}

.knob-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}

.knob-value {
  font-size: 10px;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}

.deck-fader-wrap {
  display: grid;
  justify-items: center;
  gap: 5px;
  margin-left: 4px;
}

.deck-fader {
  appearance: none;
  writing-mode: vertical-lr;
  direction: rtl;
  width: 6px;
  height: 58px;
  border-radius: var(--r-pill);
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.16));
  cursor: ns-resize;
}

.deck-fader::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 11px;
  border-radius: 3px;
  background: linear-gradient(180deg, #f2f6fb, #9fb0c6);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), 0 0 12px color-mix(in srgb, var(--deck-accent) 40%, transparent);
  cursor: grab;
}

.cue-readout {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding-bottom: 2px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.035);
  font-size: 10.5px;
}

.chip em {
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  font-size: 8.5px;
}

.chip b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.chip-hint {
  border-color: transparent;
  background: transparent;
  color: var(--ink-faint);
}

/* =============================================================== mixer */

.mixer {
  display: grid;
  gap: 6px;
  padding: 10px 16px 11px;
}

.mixer-live {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.live-block {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.live-block strong {
  font-size: 16px;
  font-weight: 640;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-block span:not(.micro-label) {
  font-size: 11.5px;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-next {
  justify-items: end;
  text-align: right;
}

.live-count {
  font-size: 30px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: color var(--base) linear, font-size var(--base) var(--ease-out);
}

.live-count[data-warn="true"] {
  color: var(--warn);
  text-shadow: 0 0 24px rgba(255, 180, 87, 0.45);
}

/* One row: transport, then the crossfader taking the slack, then the fade settings.
   Keeping it to a single row leaves the height for the waveforms. */
.mixer-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 2px 0 4px;
}

/* Prev / play / next — the three controls reached for most, so they are the
   largest hit targets on the desk and always in the same place. */
.transport-primary {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tbig-wrap {
  display: grid;
  justify-items: center;
  gap: 3px;
}

.tbig {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--hairline-strong);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03));
  color: var(--ink);
  cursor: pointer;
  transition: transform var(--fast) var(--ease-out), background var(--fast) linear,
    box-shadow var(--fast) linear, filter var(--fast) linear;
}

.tbig svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  stroke: none;
}

.tbig:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.tbig:active {
  transform: translateY(0) scale(0.95);
}

.tbig-play {
  width: 62px;
  height: 62px;
  color: #08131c;
  border-color: transparent;
  background: linear-gradient(135deg, #7ceef4, #f79ce0);
  box-shadow: 0 12px 32px rgba(124, 238, 244, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.tbig-play:hover {
  color: #08131c;
  background: linear-gradient(135deg, #90f3f8, #fbb0e8);
  filter: brightness(1.04);
}

.tbig-play svg {
  width: 23px;
  height: 23px;
}

.tbig-play .i-pause {
  display: none;
}

body[data-live-playing="true"] .tbig-play .i-play { display: none; }
body[data-live-playing="true"] .tbig-play .i-pause { display: block; }

body[data-live-playing="true"] .tbig-play {
  box-shadow: 0 12px 38px rgba(124, 238, 244, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.tbig-label {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}

.tbig-wrap:hover .tbig-label {
  color: var(--ink-soft);
}

.mixer-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mixer-secondary .seg-btn {
  padding: 4px 9px;
}

.mixer-secondary .fade-len {
  padding: 4px 9px;
}

.fade-len {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: rgba(0, 0, 0, 0.22);
}

.fade-len input {
  appearance: none;
  width: 76px;
  height: 3px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
}

.fade-len input::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.45);
  cursor: grab;
}

.fade-len-value {
  font-size: 11px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  min-width: 34px;
}

.crossfade-rig {
  flex: 1 1 260px;
  min-width: 220px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
}

.xf-end {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.xf-a { color: var(--deck-a); }
.xf-b { color: var(--deck-b); }

.xf-track {
  position: relative;
  height: 26px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid var(--hairline);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.xf-fill {
  --xf: 0;
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--deck-a) 34%, transparent),
      transparent 42%,
      transparent 58%,
      color-mix(in srgb, var(--deck-b) 34%, transparent));
}

.xf-fill::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--xf) * 100%);
  width: 76px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center,
    color-mix(in srgb, color-mix(in srgb, var(--deck-a), var(--deck-b) calc(var(--xf) * 100%)) 46%, transparent),
    transparent 70%);
  filter: blur(4px);
}

#crossfader {
  appearance: none;
  position: relative;
  width: 100%;
  height: 100%;
  background: transparent;
  cursor: grab;
}

#crossfader:active {
  cursor: grabbing;
}

#crossfader::-webkit-slider-thumb {
  appearance: none;
  width: 30px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(180deg, #f4f8fd, #9dadc3);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6), 0 0 18px rgba(255, 255, 255, 0.28);
  cursor: grab;
}

#crossfader::-moz-range-thumb {
  width: 30px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: linear-gradient(180deg, #f4f8fd, #9dadc3);
}

.mixer-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.mixer-status {
  flex: 1 1 200px;
  min-width: 0;
  font-size: 11.5px;
  color: var(--ink-faint);
}

/* ======================================================= touch and phone */

/* No hover means the row actions can never be revealed, so they stay visible.
   Without this, a phone has no way at all to load a track onto a deck. */
@media (hover: none) {
  .q-actions {
    position: static;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    padding-left: 0;
    background: none;
  }

  .q-load,
  .q-remove {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .tbig:hover,
  .btn:hover {
    transform: none;
  }
}

@media (max-width: 780px) {
  .q-row {
    grid-template-columns: 24px minmax(0, 1fr) auto auto;
    gap: 8px;
    padding: 7px 8px;
    min-height: 46px;
  }

  .q-index,
  .q-spark,
  .q-bpm {
    display: none;
  }

  .q-grip {
    height: 34px;
    align-content: center;
    opacity: 0.5;
  }

  .q-title { font-size: 13px; }
  .q-dur { font-size: 11px; }

  /* Also unconditional at phone width, not just on `hover: none` — a narrow window
     on a laptop otherwise gets rows whose only load control is invisible. */
  .q-actions {
    position: static;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    padding-left: 0;
    background: none;
    gap: 5px;
  }

  .q-load,
  .q-remove {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .queue-head { padding: 9px 10px; }
  .queue-foot { padding: 7px 10px; }

  .queue-scroll {
    padding: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .queue-empty { padding: 20px 14px; }
}

/* Fade in flight: the crossfader track lights up. */
body[data-fading="true"] .xf-track {
  border-color: rgba(243, 123, 216, 0.44);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 26px rgba(243, 123, 216, 0.22);
}
