
/* Hero empty state (linked, nothing playing) — hide the cover + controls, show a note. */
.sp-now-empty { display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 22px 0; width: 100%; color: var(--text-dim, #8b91a1); }
.sp-now-empty-ico { display: inline-flex; opacity: 0.4; }
.sp-now-empty-ico svg { width: 26px; height: 26px; }
.sp-now-empty-lbl { font-size: 0.76rem; font-weight: 600; }
/* Action button in the empty state: Play (Spotify open → resume) or Open Spotify. */
.sp-now-empty-btn {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 4px;
  padding: 8px 16px; border-radius: 999px; cursor: pointer; font: inherit;
  font-size: 0.8rem; font-weight: 800; color: #06210f; background: var(--sp-green);
  border: 0; box-shadow: 0 4px 14px rgba(30,215,96,0.35);
  transition: background 0.15s ease, transform 0.06s ease, box-shadow 0.15s ease;
}
.sp-now-empty-btn:hover:not(:disabled) { background: #24e56a; box-shadow: 0 6px 18px rgba(30,215,96,0.45); }
.sp-now-empty-btn:active:not(:disabled) { transform: scale(0.96); }
.sp-now-empty-btn:disabled { opacity: 0.6; cursor: default; }
.sp-now-empty-btn[hidden] { display: none; }
.sp-now-empty-btn-ico { display: inline-flex; }
.sp-now-empty-btn-ico svg { width: 16px; height: 16px; }
/* Guidance under the button when no Connect device is available (app open but idle). */
.sp-now-empty-hint { max-width: 30ch; margin-top: 2px; font-size: 0.68rem; font-weight: 500; line-height: 1.4; text-align: center; opacity: 0.7; }
.sp-now-empty-hint[hidden] { display: none; }
.sp-now.is-empty { flex-direction: row; align-items: center; justify-content: center; }
.sp-now.is-empty .sp-now-art, .sp-now.is-empty .sp-now-panel { display: none; }
.sp-now.is-empty .sp-now-empty { display: flex; }

/* ── Internal tabs ──────────────────────────────────────────────── */
.sp-tabs {
  position: relative; z-index: 1; flex: 0 0 auto;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  padding: 3px; border-radius: 11px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
}
.sp-tab {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 30px; padding: 5px 8px; border-radius: 8px; cursor: pointer;
  font: inherit; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.01em;
  color: var(--text-dim, #8b91a1); background: transparent; border: 0;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sp-tab:hover:not(.is-active) { color: var(--text, #e7e9ee); background: rgba(255,255,255,0.04); }
.sp-tab.is-active { color: #06210f; background: var(--sp-green); box-shadow: 0 2px 8px rgba(30,215,96,0.35); }

/* ── Tab body / panels ──────────────────────────────────────────── */
.sp-body { position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; display: flex; }
.sp-wrap.sp-off .sp-body, .sp-wrap.sp-off .sp-tabs { opacity: 0.45; pointer-events: none; }
.sp-panel {
  flex: 1 1 auto; min-width: 0; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 5px; padding-right: 4px;
  scrollbar-width: thin; scrollbar-color: rgba(30,215,96,0.5) transparent;
}
.sp-panel[hidden] { display: none; }
.sp-panel > * { flex: 0 0 auto; }
.sp-panel::-webkit-scrollbar { width: 6px; }
.sp-panel::-webkit-scrollbar-thumb { background: rgba(30,215,96,0.5); border-radius: 999px; }
.sp-panel::-webkit-scrollbar-thumb:hover { background: rgba(30,215,96,0.75); }
.sp-panel::-webkit-scrollbar-track { background: transparent; }

/* ── Track rows (Up Next) ───────────────────────────────────────── */
.sp-track {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 6px 8px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06); background: rgba(255,255,255,0.03);
}
.sp-track-art {
  width: 36px; height: 36px; flex: 0 0 auto; border-radius: 7px;
  background: rgba(255,255,255,0.07) center / cover no-repeat;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
.sp-track-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.sp-track-name { font-size: 0.8rem; font-weight: 700; color: var(--text, #e7e9ee); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-track-artist { font-size: 0.7rem; font-weight: 600; color: var(--text-dim, #8b91a1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* A row you can press. Deliberately the same affordance as a playlist row — the
   green tint on hover and the play disc that grows in — because it is the same
   act: tap a thing, that thing plays. A row Spotify gave us no uri for is left a
   plain div, so it never looks pressable without being. */
.sp-track.is-playable {
  cursor: pointer; text-align: left; font: inherit; color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.sp-track.is-playable:hover:not(:disabled) { background: var(--sp-green-soft); border-color: rgba(30,215,96,0.35); }
.sp-track.ok { border-color: rgba(30,215,96,0.6); }
.sp-track.err { border-color: rgba(237,66,69,0.65); }
.sp-track-play {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; color: #06210f; background: var(--sp-green);
  opacity: 0; transform: scale(0.8); transition: opacity 0.15s ease, transform 0.15s ease;
}
.sp-track-play svg { width: 13px; height: 13px; margin-left: 1px; }
.sp-track.is-playable:hover .sp-track-play { opacity: 1; transform: scale(1); }
/* Touchscreens have no hover: on the Edge the disc is simply always there, at a
   lower weight so it reads as available rather than as the thing in focus. */
@media (hover: none) {
  .sp-track.is-playable .sp-track-play { opacity: 0.85; transform: scale(1); }
}

/* ── Playlists ──────────────────────────────────────────────────── */
.sp-pl {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 6px 8px; border-radius: 10px; cursor: pointer; text-align: left; font: inherit;
  border: 1px solid rgba(255,255,255,0.06); background: rgba(255,255,255,0.03);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.sp-pl:hover:not(:disabled) { background: var(--sp-green-soft); border-color: rgba(30,215,96,0.35); }
.sp-pl.ok { border-color: rgba(30,215,96,0.6); }
.sp-pl.err { border-color: rgba(237,66,69,0.65); }
.sp-pl-art { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 7px; background: rgba(255,255,255,0.07) center / cover no-repeat; box-shadow: 0 2px 6px rgba(0,0,0,0.35); }
.sp-pl-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.sp-pl-name { font-size: 0.82rem; font-weight: 700; color: var(--text, #e7e9ee); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-pl-count { font-size: 0.68rem; font-weight: 600; color: var(--text-dim, #8b91a1); }
.sp-pl-play {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; color: #06210f; background: var(--sp-green);
  opacity: 0; transform: scale(0.8); transition: opacity 0.15s ease, transform 0.15s ease;
}
.sp-pl-play svg { width: 15px; height: 15px; margin-left: 1px; }
.sp-pl:hover .sp-pl-play { opacity: 1; transform: scale(1); }

/* ── Devices ────────────────────────────────────────────────────── */
.sp-dev {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: 10px; cursor: pointer; text-align: left; font: inherit;
  border: 1px solid rgba(255,255,255,0.06); background: rgba(255,255,255,0.03);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.sp-dev:hover:not(.is-active):not(:disabled) { background: var(--sp-green-soft); border-color: rgba(30,215,96,0.35); }
.sp-dev.is-active { border-color: rgba(30,215,96,0.5); background: rgba(30,215,96,0.14); cursor: default; }
.sp-dev.ok { border-color: rgba(30,215,96,0.6); }
.sp-dev.err { border-color: rgba(237,66,69,0.65); }
.sp-dev-ico { display: inline-flex; flex: 0 0 auto; color: var(--text-dim, #8b91a1); }
.sp-dev.is-active .sp-dev-ico { color: var(--sp-green); }
.sp-dev-ico svg { width: 19px; height: 19px; }
.sp-dev-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.sp-dev-name { font-size: 0.82rem; font-weight: 700; color: var(--text, #e7e9ee); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-dev.is-active .sp-dev-name { color: #7ff0a6; }
.sp-dev-sub { font-size: 0.68rem; font-weight: 600; color: var(--text-dim, #8b91a1); }
.sp-dev-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--sp-green); box-shadow: 0 0 0 3px rgba(30,215,96,0.22); }

/* ── Empty / not-linked states ──────────────────────────────────── */
.sp-empty { font-size: 0.8rem; opacity: 0.6; padding: 6px 2px; }
/* Up Next disclaimer when playback has no playlist/album context — Spotify's queue
   is only an autoplay guess there, so this reads as a soft caption, not a row. */
.sp-queue-note {
  font-size: 0.68rem; font-weight: 600; line-height: 1.35;
  color: var(--text-dim, #8b91a1);
  padding: 4px 8px 8px; margin-bottom: 2px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sp-empty-state {
  flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 18px; text-align: center; color: var(--text-dim, #8b91a1);
}
.sp-empty-ico { display: inline-flex; opacity: 0.4; }
.sp-empty-ico svg { width: 30px; height: 30px; }
.sp-empty-lbl { font-size: 0.8rem; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .sp-ctl, .sp-play, .sp-pl-play, .sp-range::-webkit-slider-thumb { transition: none; }
}

/* ── Responsive hero layouts ────────────────────────────────────────────────
   Placed LAST so these container-query overrides win over the base rules above
   (equal specificity → later source order takes precedence). The hero reflows
   purely from the tile's own size — no JS measuring. */

/* Portrait tiles (taller than wide) → big-cover COLUMN player, cover centred on top. */
@container spw (max-aspect-ratio: 0.95) {
  .sp-now { flex-direction: column; align-items: stretch; gap: 13px; padding: 15px; }
  .sp-now-art { align-self: center; width: min(76cqw, 48cqh, 320px); border-radius: 16px; }
  .sp-now-head { justify-content: center; }
  .sp-now-info { flex: 0 1 auto; text-align: center; align-items: center; }
  .sp-now-title { font-size: 1.08rem; }
  .sp-now-sub { font-size: 0.8rem; }
  .sp-transport { justify-content: center; gap: 9px; }
  .sp-seek, .sp-vol { padding: 0 2px; }
}
/* Portrait & not tall enough for a queue below → the widget IS the player: the
   immersive cover fills the whole tile. Tabs + list return once it's tall enough. */
@container spw (max-aspect-ratio: 0.95) and (max-height: 540px) {
  .sp-now { flex: 1 1 auto; min-height: 0; justify-content: center; }
  .sp-tabs, .sp-body { display: none; }
}

/* Short WIDE/SQUARE tiles → drop the volume slider (least essential — the device
   chip and the Media tile cover volume) and tighten spacing so the cover +
   transport + tabs never clip. */
@container spw (min-aspect-ratio: 0.95) and (max-height: 300px) {
  .sp-wrap { gap: 7px; padding: 10px 13px; }
  .sp-now { padding: 10px; gap: 11px; }
  .sp-vol { display: none; }
  .sp-now-panel { gap: 7px; }
}
