:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --accent: #38bdf8;
  --muted: #475569;
  --border: #e2e8f0;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: #0f172a;
  overflow: hidden;
}
body.collapsed {
  min-height: 15vh;
}
body.expanded {
  min-height: 40vh;
}
.player-shell {
  height: 100%;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--panel);
  border-top: 1px solid var(--border);
  overflow: hidden;
}
.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
h4,
h5 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 2px;
}
.controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
#progress {
  flex: 1;
  accent-color: #38bdf8;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}
.control-bar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.icon-btn {
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #eef2f7;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.2s ease, background 0.2s ease;
}
.icon-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.14);
}
.icon-btn:active:not(:disabled) {
  transform: translateY(0);
}
.icon-btn.primary {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  border-color: rgba(56, 189, 248, 0.9);
  color: #0b1224;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.35);
}
.icon-btn.primary:hover:not(:disabled) {
  color: #0b1224;
}
.icon-btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: #0f172a;
  box-shadow: none;
  height: 38px;
  width: 38px;
  flex-shrink: 0;
}
.icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.time-readout {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.95rem;
}
.queue {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}
#queue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#queue-list li {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}
#queue-list li.active {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.12);
  box-shadow: 0 10px 30px rgba(56, 189, 248, 0.15);
}
.queue-item-title {
  font-weight: 600;
  color: #0f172a;
}
.queue-item-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 2px;
}
.queue-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.queue-remove {
  border: 1px solid var(--border);
  background: #eef2f7;
  color: #0f172a;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.2s ease, background 0.2s ease;
}
.queue-remove:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.14);
}
.queue-remove:active {
  transform: translateY(0);
}
.queue-play {
  border: 1px solid var(--border);
  background: #eef2f7;
  color: #0f172a;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.2s ease, background 0.2s ease;
}
.queue-play:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.14);
}
.queue-play:active {
  transform: translateY(0);
}
.pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
  font-size: 0.82rem;
  background: #f1f5f9;
}
.status-line {
  min-height: 18px;
  font-size: 0.92rem;
  color: var(--muted);
}
audio {
  display: none;
}
.collapsed .expanded-only {
  display: none;
}
.expanded .collapsed-only {
  display: none;
}
@media (max-width: 640px) {
  .collapsed-only {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
  }
  .collapsed-only .subtitle {
    margin-top: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #title-sm {
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .control-bar {
    grid-template-columns: repeat(4, 1fr);
  }
  .icon-btn {
    height: 30px;
    font-size: 0.95rem;
    border-radius: 10px;
  }
  .icon-btn.ghost {
    height: 32px;
    width: 32px;
  }
  #progress {
    height: 5px;
  }
  .queue-item-meta {
    display: none;
  }
  body.expanded {
    min-height: 50vh;
  }
}
