/* Tunes — dark, art-first radio player (Apple Music / Spotify-ish) + contributor studio. */

:root {
  --accent: #a78bfa;
  --bg: #0a0a0f;
  --text: #f5f5f7;
  --muted: rgba(245, 245, 247, 0.64);
  --faint: rgba(245, 245, 247, 0.4);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --glass: rgba(22, 22, 30, 0.58);
  --glass-strong: rgba(18, 18, 25, 0.86);
  --field: rgba(255, 255, 255, 0.07);
  --hover: rgba(255, 255, 255, 0.08);
  --danger: #ff5d6c;
  --ok: #4ade80;
  --gold: #fbbf24;
  --radius: 14px;
  --bar-h: 92px;
  --top-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', Inter, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI Variable Display', 'Segoe UI', Inter, Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  display: grid;
  grid-template-rows: var(--top-h) minmax(0, 1fr) var(--bar-h);
  height: 100dvh;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); letter-spacing: -0.01em; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.noscript { position: fixed; inset: auto 0 50% 0; text-align: center; }

/* ---------- icons ---------- */
.icon { display: inline-flex; width: 20px; height: 20px; flex: none; }
.icon svg { width: 100%; height: 100%; display: block; }

/* ---------- living background ---------- */
#bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
.bg-art {
  position: absolute;
  inset: -15%;
  background: center / cover no-repeat;
  filter: blur(70px) saturate(1.6) brightness(0.62);
  transform: scale(1.15);
  opacity: 0;
  transition: opacity 1.4s ease;
  animation: drift 40s ease-in-out infinite alternate;
}
.bg-art.on { opacity: 1; }
.bg-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 0%, transparent 0%, rgba(8, 8, 12, 0.35) 55%, rgba(8, 8, 12, 0.82) 100%),
    linear-gradient(180deg, rgba(8, 8, 12, 0.25), rgba(8, 8, 12, 0.6));
}
body[data-view='studio'] .bg-shade { background: rgba(8, 8, 12, 0.78); }
#viz { position: absolute; inset: 0; width: 100%; height: 100%; mix-blend-mode: screen; transition: opacity 0.6s; pointer-events: none; }
body[data-view='studio'] #viz { opacity: 0.25; }
body[data-visuals='off'] #viz { opacity: 0; }
@keyframes drift {
  from { transform: scale(1.15) translate3d(-2%, -1%, 0) rotate(0deg); }
  to { transform: scale(1.25) translate3d(2%, 2%, 0) rotate(4deg); }
}

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  backdrop-filter: blur(28px) saturate(1.5);
  border: 1px solid var(--line);
}

/* ---------- top bar ---------- */
.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  padding-top: env(safe-area-inset-top);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 20px/1 var(--font-display); letter-spacing: -0.02em; justify-self: start; }
.brand-mark { width: 30px; height: 30px; transition: fill 1s; }
.live-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line);
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
}
#listeners { font-weight: 500; letter-spacing: 0; color: var(--muted); }
#listeners:not(:empty)::before { content: '· '; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #ff3b47; box-shadow: 0 0 0 0 rgba(255, 59, 71, 0.6); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 59, 71, 0.55); } 70% { box-shadow: 0 0 0 8px rgba(255, 59, 71, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 59, 71, 0); } }
.top-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--accent); color: #0b0b10; font-weight: 800; font-size: 15px;
  transition: background 1s;
}
.glass-icon { background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line); color: var(--text); }
.glass-icon:hover { background: rgba(255, 255, 255, 0.18); }
.avatar.static { background: rgba(255, 255, 255, 0.14); color: var(--text); flex: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid transparent; background: rgba(255, 255, 255, 0.1);
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.16); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn .icon { width: 18px; height: 18px; }
.btn.primary { background: var(--text); color: #0b0b10; }
.btn.primary:hover { background: #fff; }
.btn.ghost { background: transparent; border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger.ghost { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn.small { height: 30px; padding: 0 12px; font-size: 13px; }
.btn.wide { width: 100%; height: 44px; }
.glass-btn { background: rgba(255, 255, 255, 0.1); border-color: var(--line); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.icon-btn:hover { color: var(--text); background: var(--hover); }
.icon-btn:disabled { opacity: 0.35; cursor: default; background: transparent; }
.icon-btn.small { width: 28px; height: 28px; }
.icon-btn.small .icon { width: 16px; height: 16px; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 7px; border-radius: 6px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; line-height: 1.5;
  flex: none; white-space: nowrap;
}
.badge.new { background: var(--accent); color: #0b0b10; transition: background 1s; }
.badge.premiere { background: var(--gold); color: #1a1405; }
.badge.request { background: rgba(255, 255, 255, 0.14); color: var(--text); letter-spacing: 0.02em; font-weight: 700; }
.badge.onair { background: rgba(255, 59, 71, 0.16); color: #ff6b75; }
.badge.onair.big { padding: 6px 12px; font-size: 12px; border-radius: 999px; }
.badge.tiny { font-size: 9px; padding: 1px 5px; }

/* ---------- art ---------- */
.art { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: rgba(255, 255, 255, 0.06); }
.art-empty { display: grid; place-items: center; color: var(--faint); background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)); }
.art-empty .icon { width: 40%; height: 40%; }
.art.thumb { width: 44px; height: 44px; border-radius: 6px; flex: none; }
.art.mini { width: 56px; height: 56px; border-radius: 8px; flex: none; }
.art.big { border-radius: 14px; }
.off-air { color: var(--muted); }

/* ---------- main area ---------- */
#view { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent; }

/* ---------- now playing ---------- */
.np {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: clamp(24px, 4vw, 56px);
  max-width: 1320px;
  min-height: 100%;
  margin: 0 auto;
  padding: 12px clamp(16px, 4vw, 48px) 24px;
  align-items: center;
}
.np.panel-closed { grid-template-columns: minmax(0, 1fr); }
.np.panel-closed .np-panel { display: none; }
.np-main { display: flex; flex-direction: column; align-items: center; gap: 28px; min-width: 0; }
.np-art-wrap { position: relative; width: min(56vh, 100%, 600px); }
.np-art { transform: scale(calc(1 + var(--pulse, 0) * 0.03)); will-change: transform; }
.np-art .art.big {
  box-shadow: 0 40px 90px -24px rgba(0, 0, 0, 0.8), 0 0 140px -40px var(--accent);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1.1), box-shadow 1s;
}
.np.paused .np-art .art.big { transform: scale(0.86); box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.7); }
.np-info { width: min(56vh, 100%, 600px); display: flex; flex-direction: column; gap: 6px; text-shadow: 0 1px 14px rgba(0, 0, 0, 0.55); }
.np-badges { display: flex; gap: 8px; min-height: 20px; flex-wrap: wrap; }
.np-title { font-size: clamp(24px, 3.2vw, 34px); font-weight: 750; line-height: 1.15; overflow-wrap: anywhere; }
.np-artist { font-size: clamp(17px, 2vw, 21px); color: var(--muted); font-weight: 500; }
.np-meta { color: var(--faint); font-size: 13.5px; margin-top: 4px; }
.np-notes { color: var(--muted); font-size: 14px; margin-top: 6px; white-space: pre-line; max-height: 7.5em; overflow: auto; }

.tune-in {
  position: absolute; inset: 0;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  border: 0; border-radius: 14px; cursor: pointer;
  background: rgba(8, 8, 12, 0.42);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  font: 700 18px var(--font-display); letter-spacing: 0.01em;
}
.np.blocked .tune-in { display: flex; }
.np.blocked .np-art .art.big { transform: none; }
.tune-in-icon {
  width: 88px; height: 88px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--text); color: #0b0b10;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
  animation: ring 2.2s infinite;
}
.tune-in-icon .icon { width: 40px; height: 40px; margin-left: 5px; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45); } 80%, 100% { box-shadow: 0 0 0 26px rgba(255, 255, 255, 0); } }

.np-panel {
  align-self: stretch;
  max-height: calc(100dvh - var(--top-h) - var(--bar-h) - 36px);
  border-radius: 18px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.tabs { display: flex; gap: 4px; padding: 10px; border-bottom: 1px solid var(--line); }
.tab {
  flex: 1; height: 34px; border: 0; border-radius: 9px; background: transparent;
  color: var(--muted); font-weight: 650; font-size: 13.5px; cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.on { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.rows { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; scrollbar-width: thin; }
.row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; }
.row:hover { background: var(--hover); }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-title { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.row-sub { display: flex; color: var(--muted); font-size: 13px; min-width: 0; white-space: nowrap; }
.row-sub .uploaded { color: var(--faint); flex: none; }
.sep { margin: 0 6px; color: var(--faint); flex: none; }
.row-meta { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--faint); min-width: 0; white-space: nowrap; }
.narrow-only { display: none !important; }
.row-tag { color: var(--gold); font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.row-side { display: flex; align-items: center; gap: 2px; flex: none; }
.row-time { color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.empty { list-style: none; padding: 28px 16px; text-align: center; color: var(--faint); }

/* ---------- bottom bar ---------- */
.bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 560px) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  padding-bottom: env(safe-area-inset-bottom);
  border-width: 1px 0 0;
  border-radius: 0;
  background: rgba(14, 14, 20, 0.72);
}
.bar-now { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bar-text { min-width: 0; }
.bar-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-artist { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body[data-view='player'] .bar-now { visibility: hidden; }
.bar-center { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.bar-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; width: 100%; }
.bar-controls .skip-btn { justify-self: end; }
.bar-controls .live-chip { justify-self: start; }
.play-btn {
  width: 46px; height: 46px; border-radius: 50%; border: 0;
  display: grid; place-items: center;
  background: var(--text); color: #0b0b10; cursor: pointer;
  transition: transform 0.12s;
}
.play-btn:hover { transform: scale(1.06); }
.play-btn:active { transform: scale(0.96); }
.play-btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.play-btn .icon { width: 24px; height: 24px; }
.play-btn:not(.playing) .icon { margin-left: 3px; }
.play-btn.buffering { animation: breathe 1.2s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.6; } }
.live-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; color: var(--muted); }
.live-chip .dot { width: 6px; height: 6px; }
.skip-btn { width: auto; min-width: 38px; padding: 0 9px; border-radius: 999px; gap: 6px; display: inline-flex; align-items: center; }
.skip-btn .icon { width: 20px; height: 20px; }
.skip-label { display: none; font-size: 12.5px; font-weight: 700; }
.skip-btn.armed { background: var(--danger); color: #fff; }
.skip-btn.armed .skip-label { display: inline; }
.bar-progress { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 10px; width: 100%; }
.time { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.time.right { text-align: right; }
.progress { position: relative; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.16); overflow: hidden; }
.fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--text); border-radius: inherit; transition: width 0.25s linear; }
.bar-right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.volume-wrap { display: flex; align-items: center; gap: 4px; }
.no-volume .volume { display: none; }
.volume {
  -webkit-appearance: none; appearance: none;
  width: 110px; height: 4px; border-radius: 4px; cursor: pointer;
  background: linear-gradient(90deg, var(--text) var(--val, 100%), rgba(255, 255, 255, 0.18) var(--val, 100%));
}
.volume::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.volume::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 0; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field small { color: var(--faint); font-size: 12.5px; }
input:not([type='checkbox']):not([type='range']):not([type='file']), select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--field); outline: none;
  transition: border-color 0.15s, background 0.15s;
}
textarea { resize: vertical; min-height: 80px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
select option { background: #1a1a22; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: rgba(255, 255, 255, 0.1); }
input:disabled, textarea:disabled { opacity: 0.6; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-error { color: var(--danger); font-size: 13.5px; min-height: 0; }
.form-error:empty { display: none; }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { position: relative; width: 42px; height: 26px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); flex: none; transition: background 0.2s; }
.switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.switch input:checked + .switch-ui { background: var(--ok); }
.switch input:checked + .switch-ui::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch > span:last-child { display: flex; flex-direction: column; }
.switch small { color: var(--faint); font-size: 12.5px; }

.segmented { display: inline-flex; padding: 3px; border-radius: 11px; background: rgba(255, 255, 255, 0.08); }
.seg { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.seg .icon { width: 17px; height: 17px; }
.seg.on { background: rgba(255, 255, 255, 0.16); color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.chip .chip-check { width: 0; overflow: hidden; transition: width 0.15s; }
.chip.on { background: rgba(255, 255, 255, 0.14); color: var(--text); border-color: transparent; }
.chip.on .chip-check { width: 16px; height: 16px; }

/* ---------- dialogs and toasts ---------- */
dialog.modal {
  width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 32px);
  padding: 0; border: 1px solid var(--line-strong); border-radius: 18px;
  background: var(--glass-strong); color: var(--text);
  -webkit-backdrop-filter: blur(30px) saturate(1.4); backdrop-filter: blur(30px) saturate(1.4);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
dialog.modal.wide { width: min(760px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(0, 0, 0, 0.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog[open] { animation: pop 0.18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.dialog-body { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.dialog-body h2 { font-size: 21px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.dialog-actions.spread { justify-content: space-between; }
.dialog-actions > div { display: flex; gap: 10px; flex-wrap: wrap; }

.toasts { position: fixed; left: 50%; bottom: calc(var(--bar-h) + 16px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 50; pointer-events: none; }
.toast { padding: 10px 18px; border-radius: 999px; background: var(--text); color: #0b0b10; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); animation: pop 0.2s ease-out; transition: opacity 0.4s, transform 0.4s; }
.toast.error { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); }

.spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.2); border-top-color: var(--text); animation: spin 0.8s linear infinite; flex: none; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- invite / reset page ---------- */
.center-page { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.link-card { width: min(440px, 100%); padding: 32px 28px; border-radius: 22px; display: flex; flex-direction: column; gap: 14px; }
.link-card h1 { font-size: 26px; }
.link-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--accent); color: #0b0b10; }
.link-icon .icon { width: 28px; height: 28px; }

/* ---------- studio ---------- */
.studio { max-width: 1120px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px) 40px; }
.studio-tabs { position: sticky; top: 8px; z-index: 2; display: flex; gap: 4px; width: fit-content; max-width: 100%; margin: 8px 0 18px; padding: 5px; border-radius: 999px; overflow-x: auto; scrollbar-width: none; background: rgba(20, 20, 28, 0.72); border: 1px solid var(--line); -webkit-backdrop-filter: blur(24px) saturate(1.5); backdrop-filter: blur(24px) saturate(1.5); }
.studio-tab { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 999px; color: var(--muted); font-weight: 650; white-space: nowrap; }
.studio-tab .icon { width: 18px; height: 18px; }
.studio-tab:hover { color: var(--text); background: var(--hover); }
.studio-tab.on { background: var(--text); color: #0b0b10; }
.studio-body { display: flex; flex-direction: column; gap: 18px; }
.studio-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 6px 0 2px; }
.studio-head h1 { font-size: 30px; font-weight: 750; }
.studio-head p { margin-top: 4px; max-width: 640px; }
.head-actions { display: flex; gap: 10px; }
.card { background: rgba(255, 255, 255, 0.045); border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.card h2 { font-size: 18px; }

.upload-opts { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 2fr); gap: 18px 24px; }
.upload-opts .switch { grid-column: 1 / -1; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 190px; padding: 24px; border-radius: 18px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line-strong); background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.dropzone strong { font-size: 18px; }
.drop-icon { width: 42px; height: 42px; color: var(--accent); margin-bottom: 6px; }
.upload-list, .lib-list, .pl-tracks, .pl-list, .simple-list, .people-list, .pick-list, .pick-tracks { list-style: none; margin: 0; padding: 0; }
.upload-list { display: flex; flex-direction: column; gap: 8px; }
.upload-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); }
.upload-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.upload-name { display: flex; align-items: baseline; gap: 10px; font-weight: 600; min-width: 0; }
.upload-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }
.upload-status .icon { width: 17px; height: 17px; }
.upload-status .ok { color: var(--ok); }
.upload-status .bad { color: var(--danger); }
.upload-item[data-state='failed'] .upload-status, .upload-item[data-state='error'] .upload-status { color: var(--danger); }
.upload-actions { display: flex; gap: 8px; flex: none; }
.meter { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.meter-fill { height: 100%; background: var(--accent); border-radius: inherit; transition: width 0.3s; }
.meter-fill.indeterminate { width: 40% !important; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

.toolbar { display: flex; gap: 10px; }
.toolbar .search { flex: 1; }
.toolbar select { width: auto; min-width: 190px; }
.lib-list { display: flex; flex-direction: column; }
.lib-row, .pl-track {
  display: grid;
  grid-template-columns: 44px minmax(0, 2.2fr) minmax(0, 1.6fr) 56px minmax(0, 0.9fr) auto;
  align-items: center; gap: 14px;
  padding: 8px 10px; border-radius: 12px;
}
.lib-row:hover, .pl-track:hover { background: var(--hover); }
.lib-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lib-uploaded { color: var(--faint); font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-dur { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.lib-pl { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-actions { display: flex; gap: 2px; }
.chip-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.chip-status .spinner { width: 12px; height: 12px; }
.chip-status.bad { color: var(--danger); }
.loading { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 30px; color: var(--muted); }

.pl-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.pl-list { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 64px; }
.pl-item { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; }
.pl-item:hover { background: var(--hover); }
.pl-item.on { background: rgba(255, 255, 255, 0.12); }
.pl-name { display: flex; align-items: center; gap: 8px; font-weight: 650; min-width: 0; }
.pl-editor { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.back-link { display: none; color: var(--muted); font-weight: 600; }
.pl-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.pl-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
input.pl-title { font: 750 28px/1.2 var(--font-display) !important; border-color: transparent !important; background: transparent !important; padding: 2px 6px !important; margin-left: -6px; }
input.pl-desc { border-color: transparent !important; background: transparent !important; color: var(--muted); padding: 2px 6px !important; margin-left: -6px; min-height: 30px !important; }
input.pl-title:hover, input.pl-desc:hover, input.pl-title:focus, input.pl-desc:focus { background: var(--field) !important; }
.pl-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.pl-settings { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.pl-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.pl-tracks { display: flex; flex-direction: column; }
.pl-track { grid-template-columns: 24px 22px 44px minmax(0, 2.2fr) minmax(0, 1.5fr) 56px auto; }
.pl-track.dragging { background: rgba(255, 255, 255, 0.14); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); position: relative; z-index: 1; }
.grip { color: var(--faint); cursor: grab; touch-action: none; display: grid; place-items: center; }
.grip:active { cursor: grabbing; }
.pl-num { color: var(--faint); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }

.pick-list { display: flex; flex-direction: column; gap: 6px; }
.pick { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); cursor: pointer; font-weight: 600; text-align: left; }
.pick span:first-child { display: flex; align-items: center; gap: 8px; }
.pick:hover { background: var(--hover); }
.pick.done { color: var(--ok); cursor: default; }
.pick-tracks { max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; margin: 0 -8px; }
.pick-track { display: grid; grid-template-columns: 20px 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; cursor: pointer; }
.pick-track:hover { background: var(--hover); }
.pick-tracks li.has { opacity: 0.55; }
.pick-track input { width: 18px; height: 18px; accent-color: var(--ok); }

.edit-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; }
.edit-left { display: flex; flex-direction: column; gap: 10px; }
.art-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.edit-right { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: 13px; }
.facts dt { color: var(--faint); }
.facts dd { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.left-actions { display: flex; gap: 10px; }

.invite-form { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto; gap: 10px; }
.link-out { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 12px; background: color-mix(in srgb, var(--ok) 10%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.link-copy { display: flex; gap: 10px; align-items: center; }
.link-copy code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; padding: 8px 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.35); font-size: 13px; }
.simple-list { display: flex; flex-direction: column; gap: 4px; }
.simple-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.simple-list li:last-child { border-bottom: 0; }
.people-list { display: flex; flex-direction: column; gap: 6px; }
.person { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person.off { opacity: 0.55; }
.person-main { flex: 1; min-width: 0; }
.person-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.person-actions select { width: auto; min-height: 30px; height: 30px; padding: 0 30px 0 10px; font-size: 13px; }

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) {
  .lib-row { grid-template-columns: 44px minmax(0, 2fr) minmax(0, 1.4fr) 50px auto; }
  .lib-pl { display: none; }
}

@media (max-width: 899px) {
  :root { --bar-h: 128px; --top-h: 56px; }
  .top { padding: 0 16px; grid-template-columns: auto 1fr auto; }
  .live-pill { justify-self: start; padding: 5px 10px; }
  .top-actions .btn > span:not(.icon) { display: none; }
  .top-actions .btn { width: 38px; padding: 0; }

  .np { grid-template-columns: minmax(0, 1fr); align-items: start; padding-top: 8px; gap: 28px; }
  .np-main { gap: 20px; }
  .np-art-wrap, .np-info { width: min(100%, 52vh, 520px); }
  .np-panel { max-height: none; min-height: 300px; }
  .np.panel-closed .np-panel { display: flex; }

  .bar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 8px 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    align-content: center;
  }
  body[data-view='player'] .bar-now { visibility: visible; }
  .bar-now { grid-column: 1; grid-row: 1; }
  .art.mini { width: 46px; height: 46px; }
  .bar-center { display: contents; }
  .bar-controls { grid-column: 2; grid-row: 1; display: flex; gap: 6px; width: auto; }
  .bar-controls .live-chip { display: none; }
  .bar-progress { grid-column: 1 / -1; grid-row: 2; }
  .bar-right { display: none; }
  .skip-btn.armed .skip-label { display: none; }

  .upload-opts { grid-template-columns: minmax(0, 1fr); }
  .toolbar { flex-direction: column; }
  .toolbar select { width: 100%; }
  .lib-row, .pl-track { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; padding: 8px 4px; }
  .pl-track { grid-template-columns: 24px 44px minmax(0, 1fr) auto; }
  .pl-num, .lib-uploaded, .lib-dur, .lib-pl { display: none; }
  .narrow-only { display: flex !important; }
  .pl-layout { grid-template-columns: minmax(0, 1fr); }
  .pl-layout.has-selection .pl-side { display: none; }
  .pl-layout:not(.has-selection) .pl-editor { display: none; }
  .back-link { display: inline-block; }
  .pl-head { flex-direction: column; }
  input.pl-title { font-size: 24px !important; }
  .edit-grid { grid-template-columns: minmax(0, 1fr); }
  .edit-left { flex-direction: row; align-items: flex-end; }
  .edit-art { width: 120px; flex: none; }
  .invite-form { grid-template-columns: minmax(0, 1fr); }
  .person { flex-wrap: wrap; }
  .person-actions { width: 100%; justify-content: flex-start; padding-left: 48px; }
  .studio-head h1 { font-size: 26px; }
  .dialog-body { padding: 20px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-art { animation: none; }
  .dot, .tune-in-icon, .play-btn.buffering { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
