:root {
  color-scheme: dark;
  --bg: #11110f;
  --surface: #1a1b18;
  --surface-2: #23251f;
  --surface-3: #2d3027;
  --text: #f4f1e8;
  --muted: #aaa697;
  --line: #3b3e34;
  --accent: #7ecb92;
  --accent-strong: #a7e3b4;
  --warm: #f0b35b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(126, 203, 146, 0.12), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  color: var(--text);
}

button {
  border: 1px solid var(--line);
  background: var(--surface-2);
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: var(--accent);
}

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

.transport button:disabled {
  opacity: 0.24;
}

.transport .round-button.primary:disabled {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--muted);
}

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

.icon-sprite {
  display: none;
}

.app-shell {
  display: flex;
  flex-direction: column;
  width: min(1180px, calc(100% - 32px));
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  padding: 28px 0 24px;
}

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

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-bar h1,
.top-bar p,
.track-copy p,
.track-copy h2,
.section-heading h2 {
  margin: 0;
}

.brand-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.top-bar h1 {
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1;
}

.system-link {
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.top-bar p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.top-bar p[data-tone="busy"] {
  color: var(--warm);
}

.top-bar p[data-tone="success"] {
  color: var(--accent);
}

.top-bar p[data-tone="error"] {
  color: #ff7878;
}

.icon-button,
.round-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
}

.now-playing-panel {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) auto;
  gap: 18px 30px;
  align-items: center;
  min-height: 168px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #1c1e19, #151613);
  box-shadow: var(--shadow);
}

.album-art {
  width: 118px;
  aspect-ratio: 1;
  border-radius: 8px;
  background-color: var(--surface-3);
  background-position: center;
  background-size: cover;
  border: 1px solid var(--line);
}

.album-art[data-empty="true"]::after {
  content: "SONOS";
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
}

.track-copy {
  min-width: 0;
}

#active-group {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
}

#track-title {
  margin-top: 8px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: clamp(1.8rem, 4vw, 3.25rem);
  font-weight: 700;
  line-height: 0.98;
}

#next-track {
  overflow-wrap: anywhere;
  color: var(--muted);
}

#track-meta {
  margin-top: 12px;
  overflow-wrap: anywhere;
  font-size: 1.05rem;
  font-weight: 500;
}

.artist-name {
  color: var(--text);
}

.meta-separator,
.album-name {
  color: var(--muted);
}

.metadata-link {
  min-height: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}

.metadata-link:hover,
.metadata-link:focus-visible {
  color: var(--accent);
  text-decoration-color: currentColor;
  outline: none;
}

.metadata-link.artist-name {
  color: var(--text);
}

.metadata-link.album-name {
  color: var(--muted);
}

.next-artist-link {
  color: var(--warm);
}

#next-track {
  margin-top: 6px;
  color: var(--warm);
}

.playback-controls {
  --playback-control-width: 274px;

  display: grid;
  width: var(--playback-control-width);
  gap: 16px;
  align-self: end;
  justify-self: end;
}

.transport {
  display: grid;
  grid-template-columns: 44px 44px 58px 44px 44px;
  gap: 10px;
  align-items: center;
  width: var(--playback-control-width);
}

.transport[hidden],
.tv-controls[hidden] {
  display: none;
}

.tv-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  width: var(--playback-control-width);
}

.tv-mode-button {
  width: 100%;
  min-width: 0;
  padding: 0 14px;
  font-size: 0.88rem;
  font-weight: 600;
}

.tv-mode-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-mode-button[data-pending="true"] {
  opacity: 0.72;
}

.round-button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0d120f;
}

.round-button.primary:hover:not(:disabled) {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.play-toggle-button {
  width: 58px;
  height: 58px;
}

.play-toggle-button svg {
  width: 29px;
  height: 29px;
}

.mode-button {
  position: relative;
}

.mode-button[data-active="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.spotify-trigger {
  overflow: hidden;
  border-color: var(--line);
  border-radius: 999px;
  background-color: var(--surface-2);
  background-image: url("/img/spotify.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 70px 70px;
  padding: 0;
}

.spotify-trigger:hover:not(:disabled),
.spotify-trigger:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.repeat-badge {
  position: absolute;
  right: 7px;
  bottom: 6px;
  display: grid;
  width: 14px;
  height: 14px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #0d120f;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
}

.repeat-badge[hidden] {
  display: none;
}

.volume-control {
  display: grid;
  grid-template-columns: 44px 32px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.volume-control output {
  color: var(--text);
  text-align: right;
}

.volume-control .icon-button[data-muted="true"] {
  border-color: var(--warm);
  color: var(--warm);
}

.volume-control input {
  width: 100%;
  accent-color: var(--accent);
}

.workspace {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 18px;
  min-height: 0;
  flex: 1;
}

.groups-panel,
.queue-panel {
  min-width: 0;
  min-height: 0;
}

.groups-panel {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.queue-panel,
.spotify-view {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.heading-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.panel-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
}

.panel-tab,
.spotify-subtabs button {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.panel-tab[aria-selected="true"],
.spotify-subtabs button[aria-selected="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.section-heading h2 {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.count-pill {
  display: grid;
  min-width: 32px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
}

.queue-search {
  display: grid;
  grid-template-columns: auto minmax(120px, 220px) 34px;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.queue-search label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.queue-search input {
  width: 100%;
  height: 34px;
  min-width: 0;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.queue-search input:focus {
  border-color: rgba(126, 203, 146, 0.72);
}

.queue-search input::-webkit-search-cancel-button {
  appearance: none;
}

.queue-search-clear {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.queue-search-clear:hover,
.queue-search-clear:focus-visible {
  border-color: rgba(126, 203, 146, 0.72);
  color: var(--text);
  outline: none;
}

.queue-search-clear svg {
  width: 17px;
  height: 17px;
}

.queue-search-clear[hidden] {
  display: none;
}

.groups-list,
.queue-list,
.spotify-content {
  display: grid;
  gap: 10px;
}

.queue-view,
.spotify-view {
  flex: 1;
  min-height: 0;
}

.queue-view {
  display: flex;
}

.queue-list {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  align-content: start;
  grid-auto-rows: max-content;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.spotify-view {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
}

.spotify-view[hidden],
.queue-view[hidden],
.queue-search[hidden] {
  display: none;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 18;
  display: flex;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, background 180ms ease;
}

.drawer-backdrop[data-open="true"] {
  background: rgba(0, 0, 0, 0.38);
  opacity: 1;
  pointer-events: auto;
}

.drawer-backdrop[hidden] {
  display: none;
}

.spotify-drawer {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  width: min(720px, calc(100vw - 28px));
  height: 100dvh;
  padding: 22px;
  border-left: 1px solid var(--line);
  background: rgba(17, 17, 15, 0.98);
  box-shadow: -24px 0 80px rgba(0, 0, 0, 0.42);
  transform: translateX(100%);
  transition: transform 180ms ease;
}

.drawer-backdrop[data-open="true"] .spotify-drawer {
  transform: translateX(0);
}

.drawer-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  background: rgba(35, 37, 31, 0.86);
}

.spotify-drawer .spotify-view {
  height: 100%;
  padding-top: 2px;
}

.spotify-drawer .spotify-topline {
  padding-right: 54px;
}

.spotify-topline,
.spotify-search-row,
.spotify-subtabs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.spotify-topline {
  justify-content: space-between;
  color: var(--muted);
}

.spotify-topline strong {
  display: block;
  color: var(--text);
  font-weight: 600;
}

.spotify-topline span {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  margin-top: 2px;
  font-size: 0.8rem;
}

.spotify-login-link {
  display: inline;
  border: 0;
  color: var(--accent);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}

.spotify-login-link[hidden] {
  display: none;
}

.spotify-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.spotify-search-row[hidden] {
  display: none;
}

.spotify-search-row input {
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

.spotify-search-row input:focus {
  border-color: rgba(126, 203, 146, 0.72);
}

.spotify-search-button,
.spotify-play-button,
.spotify-open-button,
.spotify-back-button {
  min-height: 38px;
  border-radius: 999px;
  background: var(--accent);
  border-color: var(--accent);
  color: #0d120f;
  padding: 0 14px;
  font-weight: 600;
}

.spotify-send-split {
  position: relative;
  display: grid;
  grid-template-columns: auto 34px;
  justify-self: end;
}

.spotify-item-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

.spotify-send-split .spotify-play-button {
  border-radius: 999px 0 0 999px;
}

.spotify-send-menu-button {
  display: grid;
  width: 34px;
  min-height: 38px;
  place-items: center;
  border-left: 1px solid rgba(13, 18, 15, 0.28);
  border-radius: 0 999px 999px 0;
  background: var(--accent);
  border-color: var(--accent);
  color: #0d120f;
}

.spotify-send-menu-button svg {
  width: 16px;
  height: 16px;
}

.spotify-send-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 4;
  display: grid;
  min-width: 224px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #171915;
  box-shadow: var(--shadow);
}

.spotify-send-menu[hidden] {
  display: none;
}

.spotify-send-menu button {
  min-height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 0 12px;
  text-align: left;
}

.spotify-send-menu button:hover,
.spotify-send-menu button:focus-visible {
  background: rgba(126, 203, 146, 0.12);
  color: var(--accent);
  outline: none;
}

.spotify-open-button,
.spotify-back-button {
  justify-self: end;
  background: transparent;
  color: var(--accent);
}

.spotify-back-button {
  justify-self: start;
  min-height: 34px;
  padding: 0 12px;
}

.spotify-detail-notice {
  color: var(--warm);
}

.spotify-subtabs {
  overflow-x: auto;
  padding-bottom: 2px;
}

.spotify-content {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  align-content: start;
}

.spotify-section {
  display: grid;
  gap: 8px;
}

.spotify-section h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
}

.spotify-results {
  display: grid;
  gap: 8px;
}

.spotify-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 66px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(26, 27, 24, 0.9);
}

.spotify-item[data-clickable="true"] {
  cursor: pointer;
}

.spotify-item[data-clickable="true"]:hover,
.spotify-item[data-clickable="true"]:focus-visible {
  border-color: rgba(126, 203, 146, 0.72);
  outline: none;
}

.spotify-detail {
  display: grid;
  gap: 12px;
}

.spotify-detail-hero {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(26, 27, 24, 0.92);
}

.spotify-detail-art {
  width: 108px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: var(--surface-3);
  background-position: center;
  background-size: cover;
}

.spotify-detail-art[data-empty="true"]::after {
  content: "SP";
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.spotify-detail-copy {
  min-width: 0;
}

.spotify-detail-copy span,
.spotify-detail-copy p,
.spotify-detail-copy a {
  overflow-wrap: anywhere;
}

.spotify-detail-copy span {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
}

.spotify-detail-copy h3 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.04;
}

.spotify-detail-copy p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.spotify-detail-copy a {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 500;
  text-underline-offset: 3px;
}

.spotify-detail-actions {
  justify-self: end;
}

.spotify-art {
  width: 48px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: var(--surface-3);
  background-position: center;
  background-size: cover;
}

.spotify-art[data-empty="true"]::after {
  content: "SP";
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.spotify-item strong,
.spotify-item span,
.spotify-item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spotify-item strong {
  font-weight: 600;
}

.spotify-title-link {
  display: inline;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spotify-item span,
.spotify-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
}

.spotify-item .metadata-link,
.queue-item .metadata-link,
.spotify-detail-copy .metadata-link {
  color: inherit;
  font-size: inherit;
}

.spotify-item .metadata-link:hover,
.spotify-item .metadata-link:focus-visible,
.queue-item .metadata-link:hover,
.queue-item .metadata-link:focus-visible,
.spotify-detail-copy .metadata-link:hover,
.spotify-detail-copy .metadata-link:focus-visible {
  color: var(--accent);
}

.group-card,
.queue-item,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(26, 27, 24, 0.9);
}

.group-card {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.group-card[data-active="true"] {
  border-color: rgba(126, 203, 146, 0.8);
  background: rgba(35, 43, 34, 0.92);
}

.group-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.group-header strong,
.queue-item strong {
  display: block;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.group-header small,
.queue-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.volume-pill {
  display: grid;
  min-width: 44px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--accent);
  font-weight: 600;
}

.member-list {
  display: grid;
  gap: 6px;
}

.member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 34%) 34px;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background 140ms ease, outline-color 140ms ease;
}

.member-row:hover,
.member-row:focus-visible {
  background: rgba(255, 255, 255, 0.055);
  outline: 1px solid rgba(126, 203, 146, 0.55);
  outline-offset: 0;
}

.member-row span {
  min-width: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.member-row small {
  margin-left: 6px;
  color: var(--warm);
  font-size: 0.72rem;
}

.member-volume-control {
  display: grid;
  grid-template-columns: 28px 34px minmax(110px, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.member-mute-button {
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--muted);
}

.member-mute-button svg {
  width: 16px;
  height: 16px;
}

.member-mute-button[data-muted="true"] {
  border-color: var(--warm);
  color: var(--warm);
}

.member-volume-control output {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: right;
}

.member-volume-control input {
  width: 100%;
  min-width: 0;
  accent-color: var(--accent);
}

.remove-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  justify-self: end;
  color: var(--muted);
}

.remove-button svg {
  width: 16px;
  height: 16px;
  display: block;
}

.group-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 44px auto;
  gap: 8px;
  align-items: center;
}

.add-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.group-actions select {
  appearance: none;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: var(--surface-2);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 26px) 19px,
    calc(100% - 18px) 19px;
  background-repeat: no-repeat;
  background-size: 8px 8px, 8px 8px;
  padding: 0 46px 0 12px;
}

.everywhere-button {
  grid-auto-flow: column;
  gap: 8px;
  width: auto;
  min-width: 124px;
  padding: 0 14px;
  font-weight: 600;
}

.everywhere-button span {
  line-height: 1;
}

.queue-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px;
  scroll-margin-block: 16px;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, opacity 140ms ease;
}

.queue-item:hover,
.queue-item:focus-visible {
  border-color: rgba(126, 203, 146, 0.65);
  background: rgba(35, 43, 34, 0.74);
  outline: none;
}

.queue-item[data-busy="true"] {
  opacity: 0.64;
  pointer-events: none;
}

.queue-item[data-current="true"] {
  border-color: rgba(126, 203, 146, 0.9);
  background: rgba(35, 43, 34, 0.92);
}

.queue-item[data-current="true"] > span {
  background: var(--accent);
  color: #0d120f;
}

.queue-item > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  color: var(--accent);
  font-weight: 600;
  text-align: center;
}

.empty-state {
  min-height: 44px;
  padding: 12px;
  color: var(--muted);
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.8);
    opacity: 0.65;
  }

  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(14px);
}

.modal-backdrop[hidden] {
  display: none;
}

.system-modal {
  display: grid;
  gap: 18px;
  width: min(760px, 100%);
  max-height: min(820px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #171915;
  box-shadow: var(--shadow);
  padding: 18px;
}

.modal-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.modal-heading p,
.modal-heading h2,
.system-modal h3 {
  margin: 0;
}

.modal-heading p {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
}

.modal-heading h2 {
  margin-top: 4px;
  font-size: 1.35rem;
  font-weight: 600;
}

.room-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 4px;
}

.room-title-row h2 {
  margin-top: 0;
}

.room-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 500;
}

.summary-pill span {
  color: var(--muted);
  font-weight: 600;
}

.system-details {
  display: grid;
  gap: 16px;
}

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

.info-tile,
.system-device {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.info-tile {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.info-tile[data-variant="wide"] {
  grid-column: span 2;
}

.info-tile span,
.system-facts dt,
.system-device span,
.system-device small {
  color: var(--muted);
}

.info-tile strong {
  font-size: 1.1rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.system-facts {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.system-facts dt {
  font-weight: 600;
}

.system-facts dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.system-modal h3 {
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
}

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

.system-device {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 10px 12px;
}

.system-device strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
}

.system-device > span,
.system-device div span {
  font-size: 0.82rem;
}

.system-device dl {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 3px 8px;
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.25;
}

.system-device dt {
  color: var(--muted);
}

.system-device dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.room-modal {
  gap: 14px;
}

.room-modal .system-details {
  gap: 12px;
}

.room-facts {
  grid-template-columns: 92px minmax(0, 1fr) 92px minmax(0, 1fr);
  gap: 6px 12px;
  padding: 10px 0 2px;
  font-size: 0.9rem;
}

.room-devices {
  align-items: start;
}

.room-device {
  padding: 0;
  overflow: hidden;
}

.room-device summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 26px;
  gap: 10px;
  align-items: center;
  min-height: 66px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.room-device summary::-webkit-details-marker {
  display: none;
}

.room-device summary::after {
  content: "+";
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
}

.room-device[open] summary::after {
  content: "-";
}

.room-device summary:hover,
.room-device summary:focus-visible {
  background: rgba(255, 255, 255, 0.04);
  outline: none;
}

.room-device summary > span {
  min-height: 1em;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.room-device-details {
  border-top: 1px solid var(--line);
  padding: 10px 12px 12px;
}

.room-device-details dl {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 4px 10px;
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.25;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 20px, 620px);
    padding: 18px 0 20px;
  }

  .now-playing-panel,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .now-playing-panel {
    align-items: start;
  }

  .album-art {
    width: min(42vw, 148px);
  }

  .playback-controls {
    justify-self: start;
    width: min(100%, var(--playback-control-width));
  }

  .transport {
    width: 100%;
    grid-template-columns: 44px 44px 58px 44px 44px;
  }

  .tv-controls {
    width: 100%;
  }

  .volume-control {
    grid-template-columns: 44px 32px minmax(0, 1fr);
  }

  .group-actions {
    grid-template-columns: auto minmax(0, 1fr) 44px;
  }

  .member-row {
    grid-template-columns: minmax(0, 1fr) 34px;
  }

  .member-volume-control {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: 28px 34px minmax(0, 1fr);
  }

  .remove-button {
    grid-column: 2;
    grid-row: 1;
  }

  .queue-panel .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .queue-search {
    grid-template-columns: auto minmax(0, 1fr) 34px;
  }

  .spotify-search-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .spotify-item {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .spotify-detail-hero {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .spotify-detail-art {
    width: 78px;
  }

  .spotify-detail-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  .spotify-send-split {
    grid-column: 1 / -1;
    width: 100%;
  }

  .spotify-item-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr;
    justify-self: stretch;
  }

  .spotify-open-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .spotify-send-split .spotify-play-button {
    width: 100%;
  }

  .spotify-drawer {
    width: 100vw;
    padding: 18px;
  }

  .everywhere-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .system-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-facts,
  .system-devices,
  .system-device {
    grid-template-columns: 1fr;
  }

  .room-facts {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .room-device summary {
    grid-template-columns: minmax(0, 1fr) 26px;
  }

  .room-device summary > span {
    grid-column: 1 / -1;
    grid-row: 2;
    white-space: normal;
  }
}
