:root {
  color-scheme: dark;
  --bg: #070a11;
  --surface: rgba(14, 18, 28, 0.94);
  --surface-2: rgba(20, 26, 38, 0.94);
  --surface-3: #0c111d;
  --text: #edf2ff;
  --muted: #9aa8c7;
  --soft: #c8d3ed;
  --line: rgba(125, 146, 190, 0.22);
  --line-strong: rgba(141, 215, 255, 0.44);
  --accent: #8dd7ff;
  --accent-2: #d7a6ff;
  --danger: #ff6b6b;
  --ok: #8dffb4;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.26);
  --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(180deg, #090d15 0%, var(--bg) 58%, #05070c 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, textarea, input, select { font: inherit; }
button, select, textarea, input { color: inherit; }
h1, h2, p { margin-top: 0; }

.shell {
  width: min(1440px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 18px 0 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.eyebrow, .sectionKicker {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 800;
  margin: 0 0 6px;
}

h1 {
  font-size: clamp(2.35rem, 5vw, 4.8rem);
  line-height: 0.94;
  letter-spacing: -0.045em;
  margin: 0 0 8px;
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.subtitle {
  color: var(--muted);
  max-width: 760px;
  font-size: 0.98rem;
  line-height: 1.4;
  margin-bottom: 0;
}

.statusCard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 40px;
  min-width: 40px;
  height: 40px;
  background: rgba(18, 23, 36, 0.78);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0;
  box-shadow: var(--shadow);
}

.statusCard > div {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.statusLabel {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1;
}

#statusDot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 18px currentColor;
  flex: 0 0 auto;
}

#statusDot.playing { background: var(--ok); }
#statusDot.error { background: var(--danger); }

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 10px;
}

.panel, .channel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel { padding: 14px; }
.panelHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.fieldLabel, .rangeLabel {
  display: block;
  color: var(--soft);
  font-weight: 700;
  font-size: 0.9rem;
  margin: 12px 0 7px;
}

.inlineGroup, .buttonGrid, .controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inlineGroup > select { flex: 1 1 auto; min-width: 0; }
.buttonGrid { display: grid; grid-template-columns: 1fr 1fr; }

button, .fileLabel, select, textarea {
  border: 1px solid var(--line);
  background: var(--surface-3);
  border-radius: 8px;
  outline: none;
}

button, .fileLabel, select {
  min-height: 42px;
  padding: 9px 12px;
}

button, .fileLabel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(141, 215, 255, 0.18), rgba(141, 215, 255, 0.08));
  font-weight: 800;
}

.secondaryBtn {
  background: rgba(255, 255, 255, 0.045);
  color: var(--soft);
}

.primaryPlayer {
  border-color: rgba(141, 215, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(141, 215, 255, 0.12), transparent 40%),
    var(--surface);
}

.primaryPanel {
  display: grid;
  gap: 10px;
}

.nowPlaying {
  display: grid;
  gap: 6px;
  min-height: 132px;
  padding: 12px;
  border: 1px solid rgba(141, 215, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.nowPlaying span {
  color: var(--text);
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.nowPlaying strong {
  color: var(--accent);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.playerContext {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.playerContext.ok { color: var(--ok); }
.playerContext.error { color: var(--danger); }

#playerScope {
  width: 100%;
  height: 58px;
  border: 1px solid rgba(141, 215, 255, 0.16);
  border-radius: 6px;
  background:
    linear-gradient(rgba(141,215,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(141,215,255,0.07) 1px, transparent 1px),
    #060a12;
  background-size: 24px 24px, 24px 24px, auto;
}

.playBtn {
  background: linear-gradient(180deg, rgba(141, 255, 180, 0.22), rgba(141, 255, 180, 0.1));
  border-color: rgba(141, 255, 180, 0.42);
}

.mainPlayBtn {
  min-height: 56px;
  font-size: 1.06rem;
  color: #f4fff8;
}

.iconBtn {
  min-height: 48px;
  padding-inline: 10px;
  background: rgba(255, 255, 255, 0.055);
}

.transportIcon {
  position: relative;
  min-width: 0;
  padding: 0;
  color: var(--soft);
  overflow: hidden;
}

.transportIcon::before,
.transportIcon::after {
  content: "";
  position: absolute;
  display: block;
}

.playIcon::before {
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 17px solid currentColor;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.12));
  transform: translateX(3px);
}

.stopIcon::before {
  width: 16px;
  height: 16px;
  background: currentColor;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.pauseIcon::before,
.pauseIcon::after {
  width: 5px;
  height: 21px;
  top: 50%;
  background: currentColor;
  border-radius: 999px;
  transform: translateY(-50%);
}

.pauseIcon::before { left: calc(50% - 8px); }
.pauseIcon::after { right: calc(50% - 8px); }

.previousIcon::before,
.previousIcon::after,
.nextIcon::before,
.nextIcon::after {
  top: 50%;
  transform: translateY(-50%);
}

.previousIcon::before,
.nextIcon::after {
  width: 3px;
  height: 22px;
  background: currentColor;
  border-radius: 999px;
}

.previousIcon::before { left: calc(50% - 13px); }
.nextIcon::after { right: calc(50% - 13px); }

.previousIcon::after,
.nextIcon::before {
  width: 0;
  height: 0;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
}

.previousIcon::after {
  left: calc(50% - 8px);
  border-right: 18px solid currentColor;
}

.nextIcon::before {
  right: calc(50% - 8px);
  border-left: 18px solid currentColor;
}

.randomIcon::before {
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  background: currentColor;
  transform: translate(-50%, -50%);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 3h5v5'/%3E%3Cpath d='M4 20 21 3'/%3E%3Cpath d='M21 16v5h-5'/%3E%3Cpath d='M15 15l6 6'/%3E%3Cpath d='M4 4l5 5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 3h5v5'/%3E%3Cpath d='M4 20 21 3'/%3E%3Cpath d='M21 16v5h-5'/%3E%3Cpath d='M15 15l6 6'/%3E%3Cpath d='M4 4l5 5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.randomIcon::after {
  left: calc(50% - 14px);
  top: calc(50% + 1px);
  width: 28px;
  height: 10px;
  border-bottom: 3px solid currentColor;
  border-right: 3px solid currentColor;
  border-radius: 0 0 7px 0;
  transform: skewX(24deg);
  display: none;
}

.quickActions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.quickActions button {
  min-height: 38px;
  padding: 0;
  font-size: 0.88rem;
}

.actionIcon {
  position: relative;
  color: var(--soft);
}

.actionIcon::before,
.actionIcon::after {
  content: "";
  position: absolute;
  display: block;
}

.favoriteIcon::before,
.shareIcon::before,
.embedIcon::before {
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.favoriteIcon::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 21.35 10.55 20.03C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.08C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 21.35 10.55 20.03C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.08C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.favoriteIcon::after,
.shareIcon::after,
.embedIcon::after {
  display: none;
}

.favoriteIcon.saved {
  color: #ff8fb1;
  border-color: rgba(255, 143, 177, 0.42);
  background: rgba(255, 143, 177, 0.11);
}

.shareIcon::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cpath d='M8.6 10.5 15.4 6.5'/%3E%3Cpath d='M8.6 13.5 15.4 17.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cpath d='M8.6 10.5 15.4 6.5'/%3E%3Cpath d='M8.6 13.5 15.4 17.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.embedIcon::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.35' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m8 8-4 4 4 4'/%3E%3Cpath d='m16 8 4 4-4 4'/%3E%3Cpath d='m14 4-4 16'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.35' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m8 8-4 4 4 4'/%3E%3Cpath d='m16 8 4 4-4 4'/%3E%3Cpath d='m14 4-4 16'/%3E%3C/svg%3E") center / contain no-repeat;
}

.closeIcon {
  position: relative;
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
}

.closeIcon::before,
.closeIcon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.closeIcon::before { transform: translate(-50%, -50%) rotate(45deg); }
.closeIcon::after { transform: translate(-50%, -50%) rotate(-45deg); }

.fullBtn { width: 100%; margin-top: 10px; }

.embedOpenLink {
  display: none;
}

button:hover, .fileLabel:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
button:focus-visible, .fileLabel:focus-within, select:focus, textarea:focus, input[type="range"]:focus-visible, .switch:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(141, 215, 255, 0.12);
}

button:disabled, select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.fileLabel input { display: none; }

select {
  width: 100%;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 19px,
    calc(100% - 12px) 19px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

textarea {
  width: 100%;
  min-height: 82px;
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
}

.embedDialog {
  width: min(560px, calc(100vw - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--text);
  background: transparent;
}

.embedDialog::backdrop {
  background: rgba(2, 5, 10, 0.72);
  backdrop-filter: blur(8px);
}

.embedBox {
  padding: 18px;
  border: 1px solid rgba(141, 215, 255, 0.3);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(141, 215, 255, 0.1), transparent 42%),
    var(--surface);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
}

.embedHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.embedHeader h2 {
  font-size: 1.12rem;
  margin: 0;
}

#embedCode {
  min-height: 142px;
  max-height: 210px;
  color: var(--soft);
  background: #070b13;
  border-color: rgba(141, 215, 255, 0.28);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  resize: none;
}

#embedCode::selection {
  color: #031019;
  background: var(--accent);
}

.embedActions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.copyBtn {
  min-width: 112px;
}

.embedDialog[open] {
  animation: dialogIn 0.16s ease-out;
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.transport {
  display: grid;
  grid-template-columns: 0.82fr 1.08fr 0.82fr 0.82fr 0.82fr 0.82fr;
  margin-top: 10px;
}
.rangeLabel {
  display: grid;
  gap: 10px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.microcopy, .hint {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.42;
  margin: 8px 0 0;
}

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

.switch {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 12px;
  margin-top: 12px;
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switchTrack {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid var(--line);
  position: relative;
  transition: 0.18s ease;
}

.switchTrack::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  left: 3px;
  top: 3px;
  background: var(--muted);
  transition: 0.18s ease;
}

.switch input:checked + .switchTrack {
  background: rgba(141, 215, 255, 0.22);
  border-color: var(--accent);
}

.switch input:checked + .switchTrack::after {
  transform: translateX(20px);
  background: var(--accent);
}

.switch strong { display: block; }
.switch small { display: block; color: var(--muted); margin-top: 1px; line-height: 1.3; }

.meta {
  display: grid;
  gap: 10px;
}

.meta p {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.meta strong { color: var(--soft); }
.meta span { min-width: 0; overflow-wrap: anywhere; }

.mainStage { display: grid; gap: 10px; }

.visualizers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.channel {
  overflow: hidden;
  transition: opacity 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.channel:hover { transform: translateY(-1px); }
.channel.muted {
  opacity: 0.56;
  border-color: rgba(255, 107, 107, 0.58);
}
.channel.wide { grid-column: 1 / -1; }

.channelHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px 10px;
}

.channel h2 { margin: 0 0 5px; }
.channel span, .channel p { color: var(--muted); }

.muteBtn {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.05);
}

.muteBtn[aria-pressed="true"] {
  background: rgba(255, 107, 107, 0.18);
  border-color: var(--danger);
  color: #ffd6d6;
}

canvas {
  display: block;
  width: 100%;
  height: clamp(210px, 24vh, 310px);
  background:
    linear-gradient(rgba(141,215,255,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(141,215,255,0.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(0,0,0,0.08)),
    #060a12;
  background-size: 36px 36px, 36px 36px, auto, auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.channel p {
  padding: 8px 16px 12px;
  margin-bottom: 0;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  font-size: 0.82rem;
}

code {
  background: #070b13;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 1px 5px;
}

body.embedMode {
  min-height: auto;
  background: var(--surface-3);
}

body.embedMode .shell {
  width: 100%;
  max-width: 420px;
  padding: 0;
}

body.embedMode .topbar,
body.embedMode .primaryPanel,
body.embedMode .viewPanel,
body.embedMode .mainStage,
body.embedMode .quickActions {
  display: none;
}

body.embedMode .workspace,
body.embedMode .sidebar {
  display: block;
}

body.embedMode .sidebar {
  position: static;
}

body.embedMode .primaryPlayer {
  min-height: 100vh;
  border-radius: 0;
  border: 0;
  box-shadow: none;
}

body.embedMode .nowPlaying {
  min-height: 112px;
}

body.embedMode #playerScope {
  height: 52px;
}

body.embedMode .transport {
  gap: 7px;
}

body.embedMode .transport button {
  min-height: 42px;
}

body.embedMode .embedOpenLink {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  min-height: 24px;
  margin-top: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  text-decoration: none;
  text-transform: uppercase;
}

body.embedMode .embedOpenLink:hover,
body.embedMode .embedOpenLink:focus-visible {
  border-color: rgba(141, 215, 255, 0.28);
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  outline: none;
  box-shadow: 0 0 0 3px rgba(141, 215, 255, 0.12);
}

@media (max-width: 1120px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .primaryPlayer { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .shell {
    width: 100%;
    padding: 8px 8px 32px;
  }

  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
  }

  .brandBlock {
    min-width: 0;
  }

  .eyebrow {
    display: none;
  }

  h1 {
    font-size: 1.7rem;
    line-height: 1;
    margin-bottom: 0;
    letter-spacing: -0.025em;
  }

  .subtitle {
    display: none;
  }

  .statusCard {
    width: 34px;
    min-width: 34px;
    height: 34px;
  }

  #statusDot {
    width: 14px;
    height: 14px;
  }

  .workspace {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .sidebar {
    display: contents;
  }

  .primaryPlayer { order: 1; }
  .mainStage { order: 2; }
  .primaryPanel { order: 3; }
  .viewPanel { order: 4; }

  .panel {
    padding: 10px;
    width: 100%;
    min-width: 0;
  }

  .panelHeader {
    margin-bottom: 7px;
  }

  .primaryPlayer .panelHeader {
    display: none;
  }

  .nowPlaying {
    min-height: 58px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 10px;
    padding: 9px 10px;
  }

  .nowPlaying span {
    font-size: 0.98rem;
  }

  .nowPlaying strong {
    justify-self: end;
    font-size: 0.78rem;
  }

  .playerContext {
    grid-column: 1 / -1;
    font-size: 0.66rem;
  }

  #playerScope {
    grid-column: 1 / -1;
    height: 30px;
  }

  .mainStage {
    width: 100%;
    min-width: 0;
  }

  .visualizers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .channel.wide {
    grid-column: 1 / -1;
  }

  .buttonGrid { grid-template-columns: 1fr; }
  .transport {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
  }

  .transport button {
    min-width: 0;
    min-height: 40px;
    padding: 0;
  }

  .mainPlayBtn {
    min-height: 42px;
  }

  .playIcon::before {
    border-top-width: 9px;
    border-bottom-width: 9px;
    border-left-width: 15px;
  }

  .stopIcon::before {
    width: 14px;
    height: 14px;
  }

  .pauseIcon::before,
  .pauseIcon::after {
    width: 4px;
    height: 18px;
  }

  .previousIcon::before,
  .nextIcon::after {
    height: 19px;
    width: 3px;
  }

  .previousIcon::after,
  .nextIcon::before {
    border-top-width: 10px;
    border-bottom-width: 10px;
  }

  .previousIcon::after {
    border-right-width: 15px;
  }

  .nextIcon::before {
    border-left-width: 15px;
  }

  .randomIcon::before,
  .randomIcon::after {
    width: 21px;
    height: 21px;
  }

  .randomIcon::after {
    display: none;
  }

  .quickActions {
    display: grid;
    gap: 6px;
    margin-top: 8px;
  }

  .quickActions button {
    min-height: 34px;
  }

  .fieldLabel,
  .rangeLabel {
    margin: 8px 0 5px;
    font-size: 0.82rem;
  }

  button,
  .fileLabel,
  select {
    min-height: 38px;
  }

  .channelHead {
    min-height: 44px;
    padding: 8px 9px 7px;
    align-items: center;
  }

  .channel h2 {
    font-size: 0.9rem;
    margin-bottom: 2px;
  }

  .channel span {
    display: none;
  }

  .muteBtn {
    min-height: 28px;
    padding: 4px 7px;
    font-size: 0.72rem;
  }

  canvas,
  .channel[data-channel="3"] canvas {
    height: 82px;
  }

  .channel p {
    min-height: 26px;
    padding: 5px 8px 7px;
    font-size: 0.68rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* UX polish: clearer hierarchy, stronger active states, and a more readable noise channel. */
.statusCard, .panel, .channel {
  backdrop-filter: blur(18px);
}

.panelHeader h2,
.channelHead h2 {
  letter-spacing: -0.025em;
}

.viewPanel {
  border-color: var(--line);
  background: var(--surface);
}

.viewPanel .microcopy {
  padding: 9px 11px;
  border: 1px solid rgba(141, 215, 255, 0.18);
  border-radius: 12px;
  background: rgba(141, 215, 255, 0.055);
}

.channel[data-channel="3"] {
  border-color: var(--line);
  background: var(--surface);
}

.channel[data-channel="3"] canvas {
  background:
    linear-gradient(rgba(215,166,255,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(215,166,255,0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(0,0,0,0.1)),
    #070812;
  background-size: 30px 30px, 30px 30px, auto, auto;
}

.visualizers {
  align-items: stretch;
}

.channel p {
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  background: rgba(255, 255, 255, 0.018);
}

button:active,
.fileLabel:active {
  transform: translateY(1px);
}

@media (min-width: 1121px) {
  .mainStage {
    min-width: 0;
  }

  .visualizers {
    gap: 16px;
  }
}


.channel[data-channel="3"] {
  box-shadow: var(--shadow);
}

.channel[data-channel="3"] .channelHead h2::after {
  content: "";
}

canvas {
  height: clamp(210px, 24vh, 310px);
}

.channel[data-channel="3"] canvas {
  height: clamp(210px, 24vh, 310px);
}

@media (max-width: 820px) {
  canvas,
  .channel[data-channel="3"] canvas {
    height: 78px;
  }

  .channelHead {
    min-height: 38px;
    padding: 7px 8px 6px;
  }

  .channel p {
    min-height: 22px;
    padding: 4px 7px 5px;
  }
}
