:root {
  --bg: #0b0d10;
  --panel: #12161d;
  --panel-2: #171c25;
  --panel-3: #1d2430;
  --line: #242b37;
  --line-bright: #343d4c;
  --text: #e8ecf3;
  --muted: #8b95a7;
  --muted-2: #626d7f;
  --accent: #8b7cff;
  --accent-strong: #6f5df2;
  --accent-soft: #c7bfff;
  --accent-2: #5eead4;
  --danger: #ff6b6b;
  --warning: #f0b429;
  --radius: 18px;
  --topbar: 64px;
  --sidebar: 300px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1000px 620px at 82% -10%, rgba(57, 44, 145, .28) 0%, transparent 58%),
    radial-gradient(820px 520px at -8% 24%, rgba(18, 78, 76, .18) 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
h1, h2, h3, p { margin: 0; }

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ---------- top bar ---------- */
.topbar {
  height: var(--topbar);
  min-height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(36, 43, 55, .72);
  background: rgba(11, 13, 16, .78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: relative;
  z-index: 70;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-size: 1.06rem;
  font-weight: 750;
  letter-spacing: .015em;
  white-space: nowrap;
}
.brand-name { color: #f2f4f8; }
.mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--accent), #4438b8);
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 7px 22px rgba(139, 124, 255, .34);
}
.tag {
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .13em;
  color: var(--accent-2);
  border: 1px solid #2b4a4a;
  border-radius: 999px;
  padding: 3px 7px;
}
.topbar-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.conn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .72rem;
  white-space: nowrap;
}
.conn::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(240, 180, 41, .1);
}
.conn.ok::before { background: var(--accent-2); box-shadow: 0 0 0 3px rgba(94, 234, 212, .1); }
.conn.bad::before { background: var(--danger); box-shadow: 0 0 0 3px rgba(255, 107, 107, .1); }

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.icon-button:hover { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.icon-button.subtle { width: 34px; height: 34px; }

.profile-wrap { position: relative; }
.profile-button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(23, 28, 37, .78);
  color: var(--text);
  padding: 5px 10px 5px 6px;
  max-width: 220px;
}
.profile-button:hover { border-color: var(--line-bright); background: var(--panel-2); }
.profile-name {
  font-size: .82rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: linear-gradient(145deg, #8b7cff, #4135a6);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.avatar.large { width: 38px; height: 38px; font-size: .86rem; }
.avatar.xlarge { width: 62px; height: 62px; font-size: 1.12rem; }
.chevron { color: var(--muted); flex: 0 0 auto; }

.profile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 248px;
  border: 1px solid var(--line-bright);
  border-radius: 16px;
  background: #141920;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .58);
  padding: 8px;
  z-index: 80;
}
.profile-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 12px;
}
.profile-head-copy { min-width: 0; display: grid; gap: 2px; }
.profile-head-copy strong { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 0; }
.menu-item {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px 10px;
  font-size: .86rem;
}
.menu-item:hover { background: var(--panel-2); }
.menu-item.danger { color: #ff9b9b; }

/* ---------- shell / sidebar ---------- */
.shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  transition: grid-template-columns .22s ease;
}
.app.sidebar-collapsed .shell { grid-template-columns: 0 minmax(0, 1fr); }

.station-sidebar {
  min-width: 0;
  height: calc(100dvh - var(--topbar) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  position: sticky;
  top: var(--topbar);
  overflow: hidden auto;
  padding: 23px 16px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 22, 29, .76), rgba(11, 13, 16, .5));
  transition: opacity .18s ease, padding .22s ease;
}
.app.sidebar-collapsed .station-sidebar {
  opacity: 0;
  visibility: hidden;
  padding-left: 0;
  padding-right: 0;
  border-right: 0;
  pointer-events: none;
}
.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 16px;
}
.sidebar-head h2 { font-size: 1.24rem; line-height: 1.2; letter-spacing: -.015em; }
.eyebrow {
  color: var(--accent-2);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.station-composer {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(139, 124, 255, .10), rgba(23, 28, 37, .72));
}
.composer-label {
  color: var(--text);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .01em;
}
.station-composer textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  font-size: .82rem;
  line-height: 1.45;
}
.composer-actions { display: grid; grid-template-columns: 1.15fr 1fr; gap: 7px; }
.composer-actions .ghost { white-space: nowrap; padding-left: 6px; padding-right: 6px; }
.composer-advanced-toggle { justify-self: start; padding-top: 2px; }
.station-advanced {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 3px;
}
.station-advanced label { display: grid; gap: 5px; font-size: .72rem; }
.station-advanced select { padding: 7px 8px; font-size: .76rem; }
.station-advanced .safe-switch-row { grid-column: 1 / -1; }
.safe-switch-row { padding: 9px 10px; font-size: .76rem; }
.safe-switch-row strong { font-size: .78rem; }
.station-summary {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(139, 124, 255, .09);
  border: 1px solid rgba(139, 124, 255, .22);
  color: var(--text);
  font-size: .84rem;
  line-height: 1.45;
}
.station-name-warning {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 196, 92, .35);
  background: rgba(255, 196, 92, .09);
  color: #ffd48a;
  font-size: .76rem;
  line-height: 1.45;
}
.station-criteria {
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(23, 28, 37, .55);
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.5;
}
.station-criteria strong { color: var(--text); font-weight: 650; }
.station-criteria .criteria-row { display: block; }
.station-criteria .criteria-row + .criteria-row { margin-top: 4px; }
.sidebar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.station-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(23, 28, 37, .74);
  padding: 0 11px;
  color: var(--muted);
}
.station-search:focus-within { border-color: #4b4380; box-shadow: 0 0 0 3px rgba(139, 124, 255, .11); }
.station-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 11px 0;
  color: var(--text);
  font-size: .86rem;
}
.station-list { display: grid; gap: 7px; padding: 12px 0 8px; }
.station-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.5;
  border: 1px dashed var(--line);
  border-radius: 14px;
}
.station-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: stretch;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  transition: background .15s ease, border-color .15s ease;
}
.station-row:hover { background: rgba(23, 28, 37, .82); border-color: var(--line); }
.station-row.active {
  background: linear-gradient(135deg, rgba(139, 124, 255, .18), rgba(23, 28, 37, .86));
  border-color: #3f3879;
}
.station-main {
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 11px 4px 11px 12px;
  text-align: left;
  display: grid;
  gap: 3px;
}
.station-main strong {
  font-size: .89rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.station-main span {
  color: var(--muted);
  font-size: .72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.station-row.active .station-main span { color: #bdb4ff; }
.station-menu-button {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  margin: 5px 4px 5px 0;
}
.station-menu-button:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.station-menu {
  position: absolute;
  right: 4px;
  top: calc(100% - 2px);
  width: 138px;
  z-index: 12;
  border: 1px solid var(--line-bright);
  border-radius: 12px;
  background: #171c25;
  padding: 5px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .55);
}
.station-menu button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 8px 9px;
  font-size: .8rem;
}
.station-menu button:hover { background: rgba(255, 255, 255, .06); }
.station-menu button.danger { color: #ff9b9b; }
.sidebar-foot {
  margin-top: 10px;
  padding-top: 13px;
  border-top: 1px solid rgba(36, 43, 55, .68);
  color: var(--muted-2);
  font-size: .68rem;
  letter-spacing: .02em;
}
.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(5, 7, 10, .58);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* ---------- player ---------- */
.main { min-width: 0; min-height: 0; overflow: auto; }
.player-shell {
  width: 100%;
  max-width: 1420px;
  margin: 0 auto;
  padding: 26px 28px 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 338px;
  gap: 24px;
  align-items: start;
}
.player-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 26px 28px 22px;
  border: 1px solid rgba(36, 43, 55, .9);
  border-radius: 30px;
  background:
    radial-gradient(600px 380px at 50% -15%, rgba(139, 124, 255, .13), transparent 65%),
    linear-gradient(180deg, rgba(23, 28, 37, .94), rgba(17, 21, 28, .96));
  box-shadow: 0 28px 80px rgba(0, 0, 0, .3);
}
.now-topline {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.now-station { min-width: 0; }
.now-station .eyebrow {
  display: block;
  color: var(--muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 56vw;
}
.now-badge {
  align-self: center;
  border: 1px solid #3f3879;
  background: rgba(139, 124, 255, .14);
  color: var(--accent-soft);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.player-card.is-commentary .now-badge {
  border-color: #2b4a4a;
  background: rgba(94, 234, 212, .1);
  color: var(--accent-2);
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px 0 0;
  font-size: .7rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-button:hover { color: var(--text); }

.art {
  width: min(100%, 430px, 44dvh);
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(139, 124, 255, .34), transparent 44%),
    linear-gradient(145deg, #2b2545, #163333);
  color: #b2bac8;
  font-size: 2.7rem;
  font-weight: 700;
  box-shadow: 0 22px 54px rgba(0, 0, 0, .42);
  flex: 0 0 auto;
}
.art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art.announcement {
  background:
    radial-gradient(circle at 28% 22%, rgba(94, 234, 212, .25), transparent 40%),
    radial-gradient(circle at 76% 78%, rgba(139, 124, 255, .26), transparent 44%),
    linear-gradient(145deg, #142630, #241d43);
}
.announcement-art {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  text-align: center;
  padding: 20px;
}
.announcement-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .1);
  color: var(--accent-2);
  font-size: 1.6rem;
}
.announcement-kind {
  font-size: .7rem;
  letter-spacing: .18em;
  font-weight: 800;
  color: var(--accent-soft);
}
.wave {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 32px;
}
.wave i {
  display: block;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  animation: wave 1s ease-in-out infinite;
}
.wave i:nth-child(1) { height: 12px; animation-delay: -.2s; }
.wave i:nth-child(2) { height: 24px; animation-delay: -.5s; }
.wave i:nth-child(3) { height: 32px; animation-delay: -.8s; }
.wave i:nth-child(4) { height: 18px; animation-delay: -.35s; }
.wave i:nth-child(5) { height: 9px; animation-delay: -.65s; }
@keyframes wave {
  0%, 100% { transform: scaleY(.55); opacity: .65; }
  50% { transform: scaleY(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .wave i { animation: none; }
}

.track-copy {
  width: 100%;
  max-width: 650px;
  text-align: center;
  min-height: 105px;
}
.now-title {
  font-size: clamp(1.45rem, 3.2vw, 2.25rem);
  line-height: 1.13;
  letter-spacing: -.035em;
  font-weight: 780;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-wrap: balance;
}
.now-artist {
  color: #b4bcca;
  font-size: .98rem;
  margin-top: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.now-detail {
  color: var(--muted-2);
  font-size: .76rem;
  margin-top: 7px;
  min-height: 1em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.now-detail.commentary {
  color: #b8c4d6;
  font-size: .86rem;
  line-height: 1.5;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.seek-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
}
.seek-row input {
  flex: 1;
  min-width: 0;
  height: 30px;
  accent-color: var(--accent);
  cursor: pointer;
}
.seek-row input:disabled { opacity: .45; cursor: default; }
.seek-time {
  color: var(--muted);
  font-size: .7rem;
  min-width: 36px;
  font-variant-numeric: tabular-nums;
}
.seek-time:last-child { text-align: right; }

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 2px 0 0;
}
.round {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--accent), #5a49d6);
  color: white;
  box-shadow: 0 12px 32px rgba(111, 93, 242, .36);
  transition: transform .12s ease, box-shadow .12s ease;
}
.round:hover { box-shadow: 0 14px 38px rgba(111, 93, 242, .48); }
.round:active { transform: scale(.96); }
.round.secondary {
  width: 48px;
  height: 48px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: none;
}
.round.secondary:hover { background: var(--panel-3); }

.player-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 1px;
}
.status {
  min-width: 0;
  color: var(--muted);
  font-size: .74rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status.error { color: var(--danger); }
.status.good { color: var(--accent-2); }
.volume {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  flex: 0 0 auto;
}
.volume input {
  width: 116px;
  accent-color: var(--accent);
}

/* ---------- up next ---------- */
.upnext-panel {
  border: 1px solid rgba(36, 43, 55, .9);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(23, 28, 37, .92), rgba(17, 21, 28, .94));
  overflow: hidden;
  position: sticky;
  top: 26px;
  max-height: calc(100dvh - var(--topbar) - 52px);
  display: flex;
  flex-direction: column;
}
.upnext-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 17px 17px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}
.upnext-toggle:hover { background: rgba(255, 255, 255, .018); }
.upnext-title { display: grid; gap: 1px; }
.upnext-title .eyebrow { margin: 0; color: var(--muted); font-size: .58rem; }
.upnext-title strong { font-size: .98rem; letter-spacing: -.01em; }
.upnext-count-wrap { display: flex; align-items: center; gap: 8px; }
.queue-count {
  min-width: 25px;
  height: 25px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(139, 124, 255, .14);
  border: 1px solid #3f3879;
  color: var(--accent-soft);
  font-size: .68rem;
  font-weight: 800;
  padding: 0 7px;
}
.upnext-panel.collapsed .queue { display: none; }
.upnext-panel.collapsed .upnext-toggle { padding-bottom: 17px; }
.upnext-panel.collapsed .upnext-toggle .chevron { transform: rotate(-90deg); }
.queue {
  list-style: none;
  margin: 0;
  padding: 0 10px 12px;
  overflow: auto;
  min-height: 0;
}
.queue li {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 9px 7px;
  border-top: 1px solid rgba(36, 43, 55, .55);
  font-size: .82rem;
}
.queue li:first-child { border-top: 0; }
.queue .q-num {
  color: var(--muted-2);
  font-size: .66rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.queue .q-title { min-width: 0; }
.queue .q-title b {
  display: block;
  font-weight: 620;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.queue .q-title span {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}
.queue .q-commentary .q-title b { color: var(--accent-soft); }
.queue .q-commentary .q-num { color: var(--accent-2); font-weight: 800; letter-spacing: .04em; }
.queue .empty {
  display: block;
  border: 0;
  text-align: center;
  color: var(--muted);
  padding: 25px 12px 30px;
}
.queue .badge {
  display: inline-block;
  font-size: .56rem;
  font-weight: 800;
  letter-spacing: .05em;
  padding: 1px 5px;
  border-radius: 5px;
  background: #3a1f29;
  color: #ff9b9b;
  vertical-align: 1px;
}

/* ---------- buttons / forms ---------- */
.primary {
  border: 0;
  border-radius: 11px;
  padding: 10px 14px;
  background: linear-gradient(140deg, var(--accent), #5a49d6);
  color: #fff;
  font-weight: 700;
  font-size: .84rem;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(139, 124, 255, .22);
}
.primary:hover { filter: brightness(1.06); }
.primary:active { transform: scale(.985); }
.primary.small { padding: 7px 10px; font-size: .76rem; border-radius: 8px; box-shadow: none; }
.primary:disabled { opacity: .55; }
.ghost {
  background: rgba(23, 28, 37, .68);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 12px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 600;
}
.ghost:hover { border-color: var(--line-bright); color: var(--text); }
.ghost.small { padding: 5px 9px; font-size: .76rem; border-radius: 8px; }

.form-grid { display: grid; gap: 12px; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
label { color: var(--muted); font-size: .8rem; }
.form-grid label, .field { display: grid; gap: 6px; }
input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0f1319;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
  min-width: 0;
}
input:focus, select:focus, textarea:focus {
  border-color: #4b4380;
  box-shadow: 0 0 0 3px rgba(139, 124, 255, .11);
}
textarea { resize: vertical; line-height: 1.45; }
.form-error { min-height: 1.2em; color: #ef8c8c; font-size: .8rem; line-height: 1.4; }
.form-error.ok { color: var(--accent-2); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 5px 10px;
  font-size: .72rem;
}
.chip:hover { color: var(--text); border-color: var(--line-bright); }

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 7, 10, .76);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.modal-card {
  width: min(760px, 100%);
  max-height: min(86dvh, 900px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-bright);
  border-radius: 20px;
  background: #11151c;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
  overflow: hidden;
}
.modal-card.compact { width: min(580px, 100%); }
.rename-mode .refine-only { display: none !important; }
.modal:not(.rename-mode) .rename-only { display: none !important; }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 19px 15px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 1.12rem; letter-spacing: -.015em; }
.modal-head .eyebrow { color: var(--muted); }
.modal-body { overflow: auto; padding: 18px 19px 20px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}
.modal-actions.left { justify-content: flex-start; }

.account-tabs {
  display: flex;
  gap: 4px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  flex: 0 0 auto;
}
.account-tab {
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  font-size: .78rem;
  font-weight: 650;
  white-space: nowrap;
}
.account-tab:hover { color: var(--text); }
.account-tab.active { color: var(--text); background: var(--panel-2); border-color: var(--line); }
.account-panel { display: grid; gap: 15px; }
.account-hero { display: flex; align-items: center; gap: 13px; }
.account-hero div { display: grid; gap: 3px; }
.account-hero strong { font-size: 1.08rem; }
.account-facts {
  display: grid;
  gap: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.account-facts > div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}
.account-facts > div:first-child { border-top: 0; }
.account-facts dt { color: var(--muted); font-size: .78rem; }
.account-facts dd { margin: 0; font-size: .82rem; overflow-wrap: anywhere; }
.panel-heading h3 { font-size: .98rem; margin-bottom: 3px; }
.small-copy { font-size: .76rem; line-height: 1.5; }
.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(23, 28, 37, .45);
}
.switch-row input { margin-top: 2px; accent-color: var(--accent); }
.switch-row span { display: grid; gap: 2px; }
.switch-row strong { color: var(--text); font-size: .84rem; }

.user-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.user-add input { flex: 1 1 135px; width: auto; }
.inline-check { display: inline-flex; align-items: center; gap: 5px; color: var(--text); white-space: nowrap; }
.user-list { display: grid; gap: 8px; margin-top: 14px; }
.user-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 9px;
}
.user-row strong { min-width: 100px; }
.user-row .muted { margin-right: auto; }
.user-row button { font-size: .72rem; padding: 5px 7px; }

/* ---------- login ---------- */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(680px 400px at 78% -10%, rgba(57, 44, 145, .38), transparent 58%),
    #080a0d;
}
.login-screen[hidden] { display: none; }
.login-card {
  width: min(370px, 100%);
  display: grid;
  gap: 12px;
  background: #15191f;
  border: 1px solid var(--line-bright);
  border-radius: 18px;
  padding: 27px;
  box-shadow: 0 22px 80px rgba(0, 0, 0, .5);
}
.login-brand { color: #f1e8ce; font-size: 1.25rem; font-weight: 700; letter-spacing: .04em; display: flex; align-items: center; gap: 8px; }
.login-card h1 { font-size: 1.55rem; margin: 3px 0 0; }
.login-card label { display: grid; gap: 5px; color: var(--muted); font-size: .82rem; }
.login-card input { width: 100%; }
.muted { color: var(--muted); }
.muted.small-copy { font-size: .78rem; }

/* ---------- responsive ---------- */
@media (max-width: 1120px) {
  .player-shell { grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; padding: 20px; }
  .player-card { padding: 23px 23px 20px; }
}

@media (max-width: 800px) {
  body { overflow: auto; }
  .app { min-height: 100dvh; }
  .topbar { padding: 0 14px; }
  .conn { display: none; }
  .profile-name { display: none; }
  .profile-button { padding-right: 8px; }
  .shell { display: block; }
  .station-sidebar {
    position: fixed;
    inset: auto auto 0 0;
    z-index: 65;
    width: min(86vw, 340px);
    height: calc(100dvh - var(--topbar) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    top: calc(var(--topbar) + env(safe-area-inset-top));
    padding: 18px 15px 20px;
    background: #0f1319;
    border-right: 1px solid var(--line-bright);
    box-shadow: 22px 0 60px rgba(0, 0, 0, .45);
    transform: translateX(-105%);
    transition: transform .22s ease;
    opacity: 1;
    visibility: visible;
  }
  .app.nav-open .station-sidebar { transform: translateX(0); }
  .app.sidebar-collapsed .station-sidebar { opacity: 1; visibility: visible; }
  .main { overflow: visible; }
  .player-shell {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px 14px calc(24px + env(safe-area-inset-bottom));
    gap: 14px;
  }
  .player-card { padding: 18px 17px 16px; border-radius: 24px; gap: 14px; }
  .upnext-panel { position: static; max-height: none; border-radius: 20px; }
  .queue { max-height: 42dvh; }
  .now-station .eyebrow { max-width: 60vw; }
  .art { width: min(100%, 390px); border-radius: 21px; }
  .now-title { font-size: clamp(1.35rem, 6.4vw, 2rem); }
  .track-copy { min-height: 96px; }
}

@media (max-width: 480px) {
  .topbar { gap: 8px; }
  .brand { gap: 7px; }
  .brand .tag { display: none; }
  .mark { width: 29px; height: 29px; border-radius: 9px; }
  .player-card { padding: 16px 14px 14px; }
  .art { border-radius: 18px; }
  .round { width: 58px; height: 58px; }
  .round.secondary { width: 45px; height: 45px; }
  .controls { gap: 14px; }
  .player-footer { align-items: flex-start; gap: 8px; }
  .volume input { width: 86px; }
  .status { font-size: .7rem; }
  .modal { padding: 8px; }
  .modal-card { max-height: 94dvh; border-radius: 16px; }
  .modal-head, .modal-body { padding-left: 14px; padding-right: 14px; }
  .account-facts > div { grid-template-columns: 110px minmax(0, 1fr); }
  .sidebar-actions { grid-template-columns: 1fr; }
  .composer-actions { grid-template-columns: 1fr; }
  .station-advanced { grid-template-columns: 1fr; }
}
