:root {
  color-scheme: dark;
  --bg: #121212;
  --card: #1e1e1e;
  --card-border: #2a2a2a;
  --accent: #1db954;
  --accent-glow: rgba(29, 185, 84, 0.35);
  --text: #f5f5f5;
  --muted: #a0a0a0;
  --danger: #e04b4b;
  --warn: #f5c542;
}

* { box-sizing: border-box; }

html {
  scrollbar-color: #3a3a3a var(--bg);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #4a4a4a; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Doodle background temporarily disabled - uncomment to restore.
  background: linear-gradient(rgba(10, 10, 10, 0.88), rgba(10, 10, 10, 0.88)), url('background.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  */
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

/* Wider variant for admin.html's two-column Pending/Live Queue layout -
   a separate class so index.html and stats.html (plain .container) are
   unaffected. */
.container-wide {
  max-width: 1100px;
}

.admin-columns {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.admin-panel-card {
  flex: 1;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 18px;
}

@media (max-width: 820px) {
  .admin-columns {
    flex-direction: column;
    /* Without this, a column-direction flex item with no explicit width
       shrinks to a content-driven "fit-content" size instead of filling
       the screen - the exact same overflow bug as .page-layout had. */
    align-items: stretch;
  }

  /* On a narrow screen, img + info + two full-size Accept/Decline pills
     can't share one row - .info was shrinking to a few px wide instead of
     wrapping, making the song name/artist/requester unreadable. Wrapping
     the actions onto their own full-width row below fixes that and gives
     the buttons a much bigger, easier-to-tap target too. */
  .card {
    flex-wrap: wrap;
  }
  .card .actions {
    flex-basis: 100%;
    margin-top: 6px;
  }
  .card .actions button {
    flex: 1;
  }
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.panel-header-actions button {
  padding: 7px 16px;
  font-size: 0.82rem;
}

.panel-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.count-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.count-badge.pending {
  background: rgba(245, 197, 66, 0.15);
  color: #f5c542;
  border: 1px solid rgba(245, 197, 66, 0.3);
}

.count-badge.approved {
  background: rgba(29, 185, 84, 0.15);
  color: var(--accent);
  border: 1px solid rgba(29, 185, 84, 0.3);
}

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 40px 20px;
  font-size: 0.9rem;
}

.accent-check {
  color: var(--accent);
  font-weight: 700;
}

.queue-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  animation: fadeIn 0.25s ease;
  transition: border-color 0.15s ease;
}

.queue-row:hover {
  border-color: #3a3a3a;
}

.queue-row.now-playing:hover {
  border-color: var(--accent);
}

.queue-row.now-playing {
  background: #123a1f;
  border-color: var(--accent);
}

.queue-row-art {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.queue-row-info {
  flex: 1;
  min-width: 0;
}

.queue-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.queue-row-right button {
  padding: 5px 14px;
  font-size: 0.78rem;
}

.queue-row-name {
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-row-artist {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.requester-name {
  color: var(--accent);
  font-weight: 600;
}

.queue-position-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.queue-position-badge.now-playing {
  color: var(--accent);
  background: rgba(29, 185, 84, 0.15);
  border: 1px solid rgba(29, 185, 84, 0.4);
  padding: 4px 10px;
  border-radius: 999px;
  animation: badge-glow 1.8s ease-in-out infinite;
}

@keyframes badge-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0.35); }
  50% { box-shadow: 0 0 10px 3px rgba(29, 185, 84, 0.35); }
}

/* Two-column layout used only on the public request page (index.html) -
   scoped with descendant selectors so it never touches admin.html or
   stats.html, which use .container standalone. */
.page-layout {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 64px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
  box-sizing: border-box;
}

.page-layout .container {
  margin: 0;
  padding: 0;
  flex: 1;
  min-width: 0;
}

.sidebar {
  width: 300px;
  flex-shrink: 0;
}

/* Desktop: no toggle bar, sidebar content always visible. */
.sidebar-toggle {
  display: none;
}

@media (max-width: 820px) {
  .page-layout {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .sidebar {
    width: 100%;
  }

  /* .page-layout's align-items:flex-start (set for desktop, so the two
     columns align to the top instead of stretching to equal heights) would
     otherwise carry over here too - without it, a column-direction flex
     item with no explicit width shrinks to a content-driven "fit-content"
     size instead of filling the screen, which is what was cutting content
     off on the right on mobile. */
  .page-layout .container {
    width: 100%;
  }

  /* Collapsed by default on mobile - the request form is the primary task,
     Now Playing/Up Next is secondary and shouldn't cost scroll distance. */
  .sidebar-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 10px 14px;
    text-align: left;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  }

  .sidebar-toggle:hover:not(:disabled) {
    transform: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  }

  .sidebar.expanded .sidebar-toggle {
    border-radius: 14px 14px 0 0;
    border-bottom-color: transparent;
  }

  .toggle-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    background: #2a2a2a;
    flex-shrink: 0;
  }

  .toggle-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }

  .toggle-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 700;
  }

  .toggle-song {
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .toggle-chevron {
    flex-shrink: 0;
    color: var(--muted);
    transition: transform 0.2s ease;
  }

  .sidebar-content {
    display: none;
  }

  .sidebar.expanded .sidebar-content {
    display: block;
    animation: fadeIn 0.2s ease;
  }

  .sidebar.expanded .sidebar-card:first-of-type {
    border-radius: 0 0 14px 14px;
  }

  /* While the sidebar is collapsed, the freed-up space goes toward making
     the actual task (typing a name, searching, picking a song) easier to
     tap on a phone - bigger inputs, buttons and touch targets. */
  body.sidebar-collapsed .container input[type="text"] {
    font-size: 1.05rem;
    padding: 15px 16px;
  }

  body.sidebar-collapsed .container .search-wrap input {
    padding-left: 44px;
  }

  body.sidebar-collapsed .container .send-request-btn {
    padding: 15px 20px;
    font-size: 1.05rem;
  }

  /* The search results list is the opposite case: it's a scrollable list,
     not a one-off tap target, so compact rows that still fit real text
     comfortably beat bigger ones - the goal is seeing more of the list
     without scrolling, not making each row bigger. */
  body.sidebar-collapsed .container .track-row {
    gap: 8px;
    margin-bottom: 6px;
    min-height: 42px;
  }

  body.sidebar-collapsed .container .track-art {
    width: 42px;
    height: 42px;
  }

  body.sidebar-collapsed .container .track-info {
    padding: 8px 4px 8px 0;
  }

  body.sidebar-collapsed .container .track-name {
    font-size: 0.9rem;
  }

  body.sidebar-collapsed .container .track-artist {
    font-size: 0.78rem;
  }

  body.sidebar-collapsed .container .pill-select {
    margin-right: 10px;
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  body.sidebar-collapsed .container h1 {
    font-size: 1.7rem;
  }
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.site-logo {
  display: block;
  height: 72px;
  width: auto;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

.name-badge {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

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

.link-btn {
  background: none;
  border: none;
  padding: 0;
  margin-left: 6px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* button:hover:not(:disabled) below has the exact same specificity as a
   plain .link-btn:hover would, so it wins on source order alone and leaks
   its green glow onto this text link - matching its specificity here
   (element + class + hover + :not) beats it outright, order notwithstanding. */
button.link-btn:hover:not(:disabled) {
  background: none;
  box-shadow: none;
  transform: none;
}

.subtitle {
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 24px;
  font-size: 0.9rem;
}

input[type="text"], input[type="password"], input[type="number"] {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 12px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

input[type="text"]::placeholder, input[type="password"]::placeholder, input[type="number"]::placeholder {
  color: var(--muted);
}

input[type="text"]:hover:not(:focus), input[type="password"]:hover:not(:focus), input[type="number"]:hover:not(:focus) {
  border-color: rgba(255, 255, 255, 0.16);
}

input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(29, 185, 84, 0.06);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35), 0 0 0 3px var(--accent-glow);
}

.quick-request-box {
  margin-top: 16px;
}

.quick-request-toggle {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
  margin-bottom: 8px;
}

/* Same specificity tie as .link-btn above - matching it here (element +
   class + hover + :not) beats the global button:hover rule outright. */
button.quick-request-toggle:hover:not(:disabled) {
  background: transparent;
  box-shadow: none;
  transform: none;
}

.quick-request-chevron {
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.quick-request-box.collapsed .quick-request-chevron {
  transform: rotate(-90deg);
}

.quick-request-box.collapsed .quick-request-list {
  display: none;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 16px 32px;
  color: var(--muted);
  font-size: 0.8rem;
}

.footer-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  /* The source image has a solid black background baked in - since the
     whole page is already near-black, "screen" blend mode makes black
     contribute nothing to the result, so it reads as transparent against
     this dark background instead of showing a hard square edge. */
  mix-blend-mode: screen;
}

button {
  background: var(--accent);
  color: #05230f;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, opacity 0.15s ease, background-color 0.15s ease;
  box-shadow: 0 2px 10px rgba(29, 185, 84, 0.25);
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(29, 185, 84, 0.35);
}

button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(29, 185, 84, 0.25);
}

button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid #444;
  box-shadow: none;
}

button.secondary:hover:not(:disabled) {
  border-color: #666;
  box-shadow: none;
}

button.danger {
  background: var(--danger);
  color: white;
  box-shadow: 0 2px 10px rgba(224, 75, 75, 0.25);
}

button.danger:hover:not(:disabled) {
  box-shadow: 0 4px 16px rgba(224, 75, 75, 0.35);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
  transition: border-color 0.15s ease, transform 0.15s ease;
  animation: fadeIn 0.25s ease;
}

.card:hover {
  border-color: #3a3a3a;
  transform: translateY(-1px);
}

.card img {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.card .info {
  flex: 1;
  min-width: 0;
}

.card .info .name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .info .artist {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.card .played-at {
  flex-shrink: 0;
  white-space: nowrap;
  text-align: right;
}

.banner {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.banner.error { background: #3a1414; color: #ff9d9d; }
.banner.success { background: #123a1f; color: #7be89b; }
.banner.warn { background: #3a2f14; color: #ffcf7b; }

.muted { color: var(--muted); font-size: 0.85rem; }

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tab-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid #333;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: none;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.tab-btn:hover:not(.active) {
  border-color: #555;
  color: var(--text);
  transform: none;
  box-shadow: none;
}

.tab-btn.active {
  background: var(--accent);
  color: #05230f;
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(29, 185, 84, 0.25);
}

.search-wrap {
  position: relative;
  margin-bottom: 16px;
}

.search-wrap input {
  padding-left: 42px;
  margin-bottom: 0;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.45;
  pointer-events: none;
  color: var(--text);
}

.track-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
  background: var(--card);
  border: 2px solid transparent;
  border-radius: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  /* Keeps the row from ever being shorter than the (now fixed-square)
     art, so align-self:center below never has to deal with the art
     overflowing the row's own rounded-corner boundary. */
  min-height: 56px;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  animation: fadeIn 0.25s ease;
}

.track-row:hover {
  border-color: #3a3a3a;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.track-row.selected {
  border-color: var(--accent);
  background: #123a1f;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.track-row.selected:hover {
  transform: none;
}

.track-art {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  /* A fixed square instead of stretching to the row's (usually taller,
     text-driven) height: stretching with object-fit:contain left a small
     letterbox gap top/bottom, and the row's own rounded corner sat partly
     inside that gap and partly biting into the actual image - a real crop
     on the art's corners. A square box matching the source art's aspect
     ratio needs no letterboxing at all, so there's no gap for the rounded
     corner to cut into. */
  object-fit: contain;
  background: #2a2a2a;
  /* Flush against the row's left edge (no padding gap), centered
     vertically - min-height on .track-row keeps this gap at ~0 in the
     common case without forcing the art to stretch out of its own aspect
     ratio when a row happens to be taller. Small radius, not matched to the
     row's own 14px: at this size 14px is a quarter of the box's width, an
     aggressive enough corner-round that it visibly clips into artwork with
     text or detail near the edge - not an actual crop bug, just too much
     rounding for a 56px thumbnail. */
  border-radius: 6px;
  align-self: center;
  transition: box-shadow 0.3s ease;
}

.track-info {
  flex: 1;
  min-width: 0;
  padding: 12px 4px 12px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.track-name {
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill-select {
  flex-shrink: 0;
  align-self: center;
  margin-right: 14px;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid #444;
  background: transparent;
  color: var(--text);
  white-space: nowrap;
  box-shadow: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.pill-select:hover:not(.selected) {
  border-color: var(--accent);
  color: var(--accent);
  transform: none;
  box-shadow: none;
}

.pill-select.selected {
  background: var(--accent);
  color: #05230f;
  border-color: var(--accent);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.send-request-btn {
  width: 100%;
  margin-bottom: 16px;
  text-align: center;
}

.sidebar-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.sidebar-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow:
    0 0 6px 1px var(--accent-glow),
    0 0 14px 4px rgba(29, 185, 84, 0.3);
  animation: pulse 1.4s ease-in-out infinite;
}

.skeleton {
  background: linear-gradient(90deg, #2a2a2a 25%, #333 37%, #2a2a2a 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: 6px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.skeleton-art {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  margin-bottom: 10px;
}

.skeleton-line {
  height: 12px;
  margin-bottom: 8px;
}

.skeleton-queue-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
}

.skeleton-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  flex-shrink: 0;
}

.now-playing-art {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  object-fit: cover;
  background: #2a2a2a;
  margin-bottom: 10px;
  display: block;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  transition: box-shadow 0.3s ease;
  animation: fadeIn 0.3s ease;
}

.now-playing-name {
  font-weight: 700;
  font-size: 1rem;
}

.now-playing-artist {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.progress-track {
  height: 4px;
  background: #333;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 4px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 1s linear;
  box-shadow: 0 0 8px var(--accent-glow);
}

.progress-time {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #2a2a2a;
}

.queue-item:last-child {
  border-bottom: none;
}

.queue-item img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #2a2a2a;
  transition: box-shadow 0.3s ease;
}

.queue-item-info {
  min-width: 0;
  flex: 1;
}

.queue-item-name {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-item-artist {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-item-requester {
  font-size: 0.75rem;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

nav {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

nav a.active { color: var(--text); font-weight: 600; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

th, td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid #2a2a2a;
  font-size: 0.9rem;
}

th button {
  all: unset;
  cursor: pointer;
  color: var(--accent);
}

/* --- Admin panel top-bar shell (brand, tabs, live session badge) --- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 12px 18px;
  margin-bottom: 6px;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  margin-bottom: 14px;
}

.player-controls {
  display: flex;
  gap: 8px;
  margin-left: 4px;
}

.player-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--card-border);
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  line-height: 1;
}

.player-btn:hover:not(:disabled) {
  border-color: #666;
  box-shadow: none;
  transform: none;
  background: var(--card);
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px 2px var(--accent-glow);
  flex-shrink: 0;
}

.topbar-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toptab-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid #333;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: none;
  flex-shrink: 0;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.toptab-btn:hover:not(.active) {
  border-color: #555;
  color: var(--text);
  transform: none;
  box-shadow: none;
}

.toptab-btn.active {
  background: var(--accent);
  color: #05230f;
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(29, 185, 84, 0.25);
}

.topbar-status {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.topbar-status.live {
  background: rgba(29, 185, 84, 0.15);
  color: var(--accent);
  border: 1px solid rgba(29, 185, 84, 0.35);
}

.topbar-status.offline {
  background: rgba(160, 160, 160, 0.12);
  color: var(--muted);
  border: 1px solid #333;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.9rem;
}

.connection-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.connection-device {
  /* Forces this onto its own line within the wrapping flex row, indented
     to sit under the "Playing on" text rather than the dot. */
  flex-basis: 100%;
  margin-left: 19px;
  font-size: 0.95rem;
}

.connection-status.live {
  border-color: rgba(29, 185, 84, 0.3);
}

.connection-status.live .connection-dot {
  background: var(--accent);
  box-shadow: 0 0 8px 2px var(--accent-glow);
  animation: pulse 1.4s ease-in-out infinite;
}

.connection-status.offline, .connection-status.unlinked {
  border-color: rgba(245, 197, 66, 0.25);
  color: var(--muted);
}

.connection-status.offline .connection-dot, .connection-status.unlinked .connection-dot {
  background: var(--warn);
  box-shadow: 0 0 8px 2px rgba(245, 197, 66, 0.3);
}

.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 16px;
}

.settings-row + .settings-row {
  margin-top: 12px;
}

.settings-row-info {
  flex: 1;
  min-width: 200px;
}

.settings-row-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  font-weight: 600;
}

.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--muted);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 0.68rem;
  line-height: 1;
  cursor: pointer;
}

.info-btn:hover, .info-btn:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.info-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  width: max-content;
  max-width: 220px;
  background: #262626;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.settings-row-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  transition: background 0.15s ease;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

@media (max-width: 820px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    /* Without an explicit cap, the column-direction flex container was
       sizing itself to fit its widest child's content (the 5-button tab
       strip) instead of the available screen width, pushing the whole
       card off the right edge instead of letting the tab strip scroll
       internally. */
    max-width: 100%;
  }
  .topbar-tabs {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 4px;
    /* An explicit width (not just min-width:0) forces a definite size to
       shrink the buttons against - relying on flex "stretch" alone left
       this sized to its content's full width, which blew out the whole
       page's width instead of staying within the screen. */
    width: 100%;
    min-width: 0;
  }
  /* Equal-width segments that all shrink together, instead of a scrolling
     strip - every tab stays reachable with one glance, no swiping needed. */
  .toptab-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 7px 4px;
    font-size: 0.66rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Not enough screen real estate on mobile for this, and it duplicates
     what the "Playing on: X" card in Settings already tells the admin. */
  .topbar-status {
    display: none;
  }
  /* Keep text + control sharing one row on mobile (wrapping only if it
     truly doesn't fit) instead of always stacking - that stacked layout
     was burning a full extra row of height per setting for no reason. */
  .admin-panel-card {
    padding: 14px;
  }
  .panel-header {
    margin-bottom: 10px;
  }
  .settings-stack {
    gap: 12px;
  }
  .settings-row {
    padding: 10px 12px;
    gap: 10px;
  }
  .settings-row-info {
    min-width: 110px;
  }
  .settings-row-controls {
    margin-left: auto;
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 28px 24px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.2s ease;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 1.3rem;
  line-height: 1;
}

.modal-close:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

.wizard-step-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.wizard-step h3 {
  margin: 0 0 6px;
}

.wizard-list {
  margin: 12px 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wizard-code {
  margin-top: 8px;
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 0.82rem;
  color: var(--accent);
  white-space: pre-wrap;
  word-break: break-all;
}

.wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
