/* ═══════════════════════════════════════════════════════════
   Michael — painel de música
   Tema escuro, sem dependências externas.
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #08080e;
  --bg-2: #0d0d16;
  --surface: #12121d;
  --surface-2: #1a1a28;
  --surface-3: #22222f;
  --border: #262636;
  --border-soft: #1e1e2c;

  --text: #ececf5;
  --text-2: #b6b6c8;
  --muted: #7e7e95;

  --accent: #8b5cf6;
  --accent-2: #c084fc;
  --accent-pink: #ec4899;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.3);
  --ring: 0 0 0 3px rgba(139, 92, 246, 0.35);

  --sidebar-w: 264px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(139, 92, 246, 0.16), transparent 62%),
    radial-gradient(900px 520px at 96% 4%, rgba(236, 72, 153, 0.1), transparent 58%),
    var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, 'Noto Sans', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* Ícones que são silhuetas cheias em vez de contorno. */
.icon,
#toggle-icon,
#btn-previous svg,
#btn-skip svg,
#btn-stop svg,
.nav__item[data-view='player'] svg {
  fill: currentColor;
  stroke: none;
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 8px;
}

.muted {
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: #33334a;
  background-clip: padding-box;
}

/* ─────────────── Boot ─────────────── */

.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
  background: var(--bg);
  z-index: 100;
}
.boot__logo {
  font-size: 46px;
  animation: pulse 1.6s var(--ease) infinite;
}
.boot__bar {
  width: 190px;
  height: 3px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}
.boot__bar span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-pink));
  animation: slide 1.1s var(--ease) infinite;
}
@keyframes slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(360%); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.75; }
}

/* ─────────────── Login ─────────────── */

.login {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login__card {
  width: min(420px, 100%);
  padding: 42px 34px;
  text-align: center;
  background: linear-gradient(180deg, rgba(26, 26, 40, 0.92), rgba(18, 18, 29, 0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.login__logo {
  font-size: 44px;
  margin-bottom: 10px;
}
.login__card h1 {
  font-size: 30px;
  background: linear-gradient(96deg, var(--accent-2), var(--accent-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login__sub {
  margin: 12px 0 26px;
  color: var(--text-2);
  font-size: 14px;
}
.login__note {
  margin-top: 18px;
  font-size: 13px;
  color: var(--warn);
}

/* ─────────────── Layout ─────────────── */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100dvh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px 16px;
  background: linear-gradient(180deg, rgba(18, 18, 29, 0.9), rgba(10, 10, 18, 0.9));
  border-right: 1px solid var(--border-soft);
  backdrop-filter: blur(12px);
  z-index: 30;
}
.sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand__logo {
  font-size: 24px;
}
.brand__name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(96deg, var(--accent-2), var(--accent-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sidebar__close {
  display: none;
}
.sidebar__section {
  display: grid;
  gap: 7px;
}
.sidebar__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}
.user {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}
.user__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  object-fit: cover;
}
.user__name {
  font-size: 13px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav {
  display: grid;
  gap: 4px;
}
.nav__item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
}
.nav__item:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav__item.is-active {
  background: linear-gradient(96deg, rgba(139, 92, 246, 0.22), rgba(236, 72, 153, 0.12));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.32);
}

.sidebar__scrim {
  display: none;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 26px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(8, 8, 14, 0.6);
  backdrop-filter: blur(10px);
}
.topbar__menu {
  display: none;
}
.topbar__title {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.topbar__title h1 {
  font-size: 19px;
}
.topbar__right {
  margin-left: auto;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
}
.chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.chip[data-state='online'] {
  color: var(--ok);
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.08);
}
.chip[data-state='connecting'] {
  color: var(--warn);
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.08);
}

.voice-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
}

.view {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 26px 48px;
  display: grid;
  /* `minmax(0, 1fr)` em vez de `1fr`: sem isso a coluna do grid nunca fica
     menor que o min-content dos filhos, e um único elemento largo (o slider
     de volume) empurrava o painel inteiro para fora da tela no celular. */
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-content: start;
}

/* ─────────────── Player ─────────────── */

.stage {
  position: relative;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(26, 26, 40, 0.72), rgba(16, 16, 26, 0.72));
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.stage__glow {
  position: absolute;
  inset: -45%;
  background-size: cover;
  background-position: center;
  filter: blur(64px) saturate(1.5);
  opacity: 0;
  transform: scale(1.1);
  transition: opacity 0.7s var(--ease), background-image 0.4s;
  pointer-events: none;
}
.stage.has-art .stage__glow {
  opacity: 0.28;
}
.stage > .now {
  position: relative;
  z-index: 1;
}

.now {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  min-width: 0;
}
.now__art {
  position: relative;
  aspect-ratio: 1;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}
.now__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.now__art img.is-loaded {
  display: block;
}
.now__art-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 46px;
  opacity: 0.35;
}
.now__info {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.now__status {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.now__title {
  font-size: clamp(19px, 2.6vw, 27px);
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.now__author {
  color: var(--text-2);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Progresso */

.progress {
  margin-top: 12px;
  cursor: pointer;
  user-select: none;
}
.progress[aria-disabled='true'] {
  cursor: default;
  opacity: 0.55;
}
.progress__track {
  position: relative;
  height: 6px;
  border-radius: 99px;
  background: var(--surface-3);
  transition: height 0.16s var(--ease);
}
.progress:hover .progress__track {
  height: 9px;
}
.progress__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-pink));
}
.progress__knob {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%) scale(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  transition: transform 0.16s var(--ease);
}
.progress:hover .progress__knob,
.progress:focus-visible .progress__knob {
  transform: translate(-50%, -50%) scale(1);
}
.progress__times {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Controles */

/* Duas fileiras centralizadas: transporte em cima, ajustes embaixo.
   Espalhar tudo de ponta a ponta deixava os botões colados nas bordas. */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 18px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}
.controls--secondary {
  margin-top: 10px;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}
.ctrl {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  transition: transform 0.14s var(--ease), background 0.16s, color 0.16s, border-color 0.16s;
}
.ctrl:hover:not(:disabled) {
  background: var(--surface-3);
  color: var(--text);
  transform: translateY(-1px);
}
.ctrl:active:not(:disabled) {
  transform: translateY(0) scale(0.96);
}
.ctrl:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.ctrl--main {
  width: 54px;
  height: 54px;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-pink));
  box-shadow: 0 10px 26px rgba(139, 92, 246, 0.35);
}
.ctrl--main svg {
  width: 24px;
  height: 24px;
}
.ctrl--main:hover:not(:disabled) {
  background: linear-gradient(135deg, #9d6ff8, #f2569f);
}
.ctrl--toggle {
  width: auto;
  padding: 0 13px;
  gap: 7px;
  grid-auto-flow: column;
  font-size: 13px;
  font-weight: 600;
}
.ctrl--toggle.is-on {
  color: var(--accent-2);
  border-color: rgba(139, 92, 246, 0.45);
  background: rgba(139, 92, 246, 0.14);
}
.ctrl--flat {
  border: 0;
  background: transparent;
  width: 34px;
  height: 34px;
}

.volume {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.volume__value {
  font-size: 12px;
  color: var(--muted);
  min-width: 38px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.range {
  -webkit-appearance: none;
  appearance: none;
  /* Curso longo = ajuste fino. Com passo de 1% e curva logarítmica no
     servidor, dá para encostar no volume exato. */
  width: 168px;
  min-width: 0;
  height: 5px;
  border-radius: 99px;
  background: var(--surface-3);
  cursor: pointer;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}

/* ─────────────── Composer / busca ─────────────── */

.composer {
  display: grid;
  gap: 8px;
  position: relative;
}
.composer__box {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 8px 8px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.16s, box-shadow 0.16s;
}
.composer__box:focus-within {
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
}
.composer__box--inline {
  margin-bottom: 14px;
}
.composer__icon {
  color: var(--muted);
}
.composer__input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 8px 0;
  font-size: 14.5px;
}
.composer__input:focus {
  outline: none;
  box-shadow: none;
}
.composer__input::placeholder {
  color: var(--muted);
}
.composer__hint {
  font-size: 12.5px;
  color: var(--muted);
  padding-left: 4px;
}

.results {
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  max-height: 340px;
  overflow-y: auto;
}
.result {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
}
.result:hover {
  background: var(--surface-2);
}
.result__art {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-3);
}
.result__meta {
  min-width: 0;
  flex: 1;
}
.result__title {
  font-size: 14px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.result__sub {
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─────────────── Fila / listas ─────────────── */

.queue,
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(20, 20, 32, 0.7), rgba(14, 14, 23, 0.7));
  padding: 20px 22px 22px;
}
.queue__head,
.panel__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.queue__head h3,
.panel__head h3 {
  font-size: 16px;
}
.queue__count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.queue__actions,
.panel__actions {
  margin-left: auto;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.tracklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
}
.track {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.14s;
  min-width: 0;
}
.track:hover {
  background: var(--surface-2);
}
.track.is-dragging {
  opacity: 0.4;
}
.track.is-drop-target {
  box-shadow: inset 0 2px 0 var(--accent);
}
.track__handle {
  color: var(--muted);
  cursor: grab;
  width: 18px;
  text-align: center;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  flex: none;
}
.track__handle:active {
  cursor: grabbing;
}
.track__art {
  width: 40px;
  height: 40px;
  border-radius: 7px;
  object-fit: cover;
  background: var(--surface-3);
  flex: none;
}
.track__meta {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
.track__title {
  font-size: 14px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track__title a {
  color: inherit;
  text-decoration: none;
}
.track__title a:hover {
  text-decoration: underline;
}
.track__sub {
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track__badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--muted);
}
.track__badge[data-source='spotify'] {
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
}
.track__time {
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex: none;
}
.track__actions {
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.14s;
  flex: none;
}
.track:hover .track__actions,
.track:focus-within .track__actions {
  opacity: 1;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}
.icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}
.icon-btn--danger:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.12);
}
.icon-btn svg {
  width: 17px;
  height: 17px;
}

.empty {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.empty__icon {
  font-size: 30px;
  opacity: 0.6;
}

/* ─────────────── Playlists ─────────────── */

.playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.playlist-card {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: transform 0.16s var(--ease), border-color 0.16s, background 0.16s;
}
.playlist-card:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 92, 246, 0.4);
  background: var(--surface-2);
}
.playlist-card.is-active {
  border-color: rgba(139, 92, 246, 0.6);
  background: rgba(139, 92, 246, 0.1);
}
.playlist-card__icon {
  font-size: 22px;
}
.playlist-card__name {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.playlist-card__meta {
  font-size: 12.5px;
  color: var(--muted);
}

/* ─────────────── Formulários ─────────────── */

.field {
  display: grid;
  gap: 7px;
}
.field__label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.field__row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.field__row .select-wrap {
  flex: 1;
  min-width: 180px;
}

.select-wrap {
  position: relative;
}
.select-wrap::after {
  content: '';
  position: absolute;
  right: 13px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.select,
.input {
  width: 100%;
  padding: 10px 34px 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  appearance: none;
  cursor: pointer;
}
.input {
  padding-right: 13px;
  cursor: text;
}
.select:focus,
.input:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
}

.switch {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 13px 4px;
  cursor: pointer;
  border-top: 1px solid var(--border-soft);
}
.switch:first-of-type {
  border-top: 0;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.switch__track {
  position: relative;
  flex: none;
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  transition: background 0.2s var(--ease), border-color 0.2s;
  margin-top: 2px;
}
.switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.22s var(--ease), background 0.2s;
}
.switch input:checked + .switch__track {
  background: linear-gradient(96deg, var(--accent), var(--accent-pink));
  border-color: transparent;
}
.switch input:checked + .switch__track .switch__thumb {
  transform: translateX(18px);
  background: #fff;
}
.switch input:focus-visible + .switch__track {
  box-shadow: var(--ring);
}
.switch__text {
  display: grid;
  gap: 2px;
}
.switch__text strong {
  font-size: 14px;
  font-weight: 600;
}
.switch__text small {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

/* ─────────────── Botões ─────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.14s var(--ease), background 0.16s, opacity 0.16s;
}
.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}
.btn:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-pink));
  color: #fff;
  box-shadow: 0 8px 22px rgba(139, 92, 246, 0.28);
}
.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-2);
}
.btn--ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}
.btn--danger {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}
.btn--danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.12);
}
.btn--sm {
  padding: 6px 12px;
  font-size: 13px;
}
.btn--lg {
  padding: 13px 24px;
  font-size: 15px;
  width: 100%;
}
.btn.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

/* ─────────────── Modal ─────────────── */

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 60;
  padding: 20px;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 8, 0.72);
  backdrop-filter: blur(4px);
}
.modal__card {
  position: relative;
  width: min(420px, 100%);
  padding: 26px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  animation: pop 0.2s var(--ease);
}
@keyframes pop {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal__text {
  color: var(--text-2);
  font-size: 14px;
}
.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

/* ─────────────── Toasts ─────────────── */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 9px;
  z-index: 80;
  max-width: min(370px, calc(100vw - 40px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(26, 26, 40, 0.96);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  animation: toast-in 0.24s var(--ease);
  backdrop-filter: blur(8px);
}
.toast.is-out {
  animation: toast-out 0.2s var(--ease) forwards;
}
.toast[data-kind='error'] {
  border-color: rgba(239, 68, 68, 0.4);
}
.toast[data-kind='success'] {
  border-color: rgba(34, 197, 94, 0.4);
}
.toast__icon {
  flex: none;
}
@keyframes toast-in {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes toast-out {
  to { transform: translateY(8px); opacity: 0; }
}

/* ─────────────── Responsivo ─────────────── */

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    transform: translateX(-100%);
    transition: transform 0.28s var(--ease);
  }
  .layout.sidebar-open .sidebar {
    transform: translateX(0);
  }
  .layout.sidebar-open .sidebar__scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(4, 4, 8, 0.6);
    z-index: 25;
  }
  .sidebar__close,
  .topbar__menu {
    display: grid;
  }
  .view {
    padding: 18px 16px 40px;
  }
  .topbar {
    padding: 14px 16px;
  }
  .now {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .now__art {
    width: 150px;
  }
  .stage,
  .queue,
  .panel {
    padding: 16px;
    border-radius: var(--radius);
  }
  .volume {
    flex: 1 1 100%;
    min-width: 0;
  }
  .range {
    flex: 1 1 auto;
    width: auto;
  }
}

@media (max-width: 560px) {
  .composer__box {
    flex-wrap: wrap;
  }
  .composer__input {
    flex-basis: 100%;
  }
  .queue__actions,
  .panel__actions {
    width: 100%;
    margin-left: 0;
  }
  .track__time,
  .track__badge {
    display: none;
  }
  /* Em tela estreita os rótulos saem e ficam só os ícones — senão a fileira
     de ajustes transborda. */
  .ctrl--toggle span {
    display: none;
  }
  .ctrl--toggle {
    width: 42px;
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
