:root,
html[data-theme="dark"] {
  --bg: #07060c;
  --bg-main: #12101a;
  --bg-elevated: #1b1826;
  --bg-highlight: #2a2540;
  --bg-hover: #1a1626;
  --green: #8b5cf6;
  --green-hover: #a78bfa;
  --on-accent: #fff;
  --text: #f5f3ff;
  --muted: #b4adc8;
  --subtle: #7c7594;
  --danger: #f15e6c;
  --main-wash: linear-gradient(180deg, #4c3d7a 0%, var(--bg-main) 240px);
  --player-bg: #07060c;
  --modal: #241f33;
  --field: #322c45;
  --border: #3d3654;
  --track: #4a445c;
  --play-bg: #fff;
  --play-icon: #8b5cf6;
  --logo-sq: #14081f;
  --sidebar: 244px;
  --player: 92px;
  --radius: 8px;
  --font: "DM Sans", system-ui, sans-serif;
}

html[data-theme="light"] {
  --bg: #ece8f6;
  --bg-main: #ffffff;
  --bg-elevated: #f6f3fc;
  --bg-highlight: #ebe4f8;
  --bg-hover: #f3effa;
  --green: #7c3aed;
  --green-hover: #6d28d9;
  --on-accent: #fff;
  --text: #1a1228;
  --muted: #5c5470;
  --subtle: #8a8299;
  --danger: #dc3d4e;
  --main-wash: linear-gradient(180deg, #ddd6fe 0%, var(--bg-main) 240px);
  --player-bg: #ffffff;
  --modal: #ffffff;
  --field: #f4f0fb;
  --border: #d8d0ea;
  --track: #d4cce3;
  --play-bg: #7c3aed;
  --play-icon: #fff;
  --logo-sq: #1a1028;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-optical-sizing: auto;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.app {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  grid-template-rows: 1fr var(--player);
  height: 100%;
  gap: 8px;
  padding: 8px;
}

.app-admin {
  grid-template-rows: 1fr auto;
}

.sidebar {
  grid-row: 1;
  background: var(--bg-main);
  border-radius: 12px;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px 12px;
}

.rail-head h2 {
  margin: 0;
  font-size: 1rem;
}

.rail-pl {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
}

.rail-pl:hover,
.rail-pl.active {
  background: var(--bg-highlight);
}

.rail-pl strong {
  display: block;
}

.rail-pl p {
  margin: 4px 0 0;
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  margin-bottom: 20px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.profile-photo {
  position: relative;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
}

.profile-photo img,
.profile-photo .avatar-fallback {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  font-size: 2rem;
  object-fit: cover;
}

.profile-photo span.change-hint {
  position: absolute;
  inset: auto 0 0;
  padding: 6px 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-photo input {
  display: none;
}

.admin-profile h2 {
  margin: 0 0 4px;
  font-size: 1.4rem;
}

.admin-profile .name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-profile .name-row input {
  font-size: 1.2rem;
  font-weight: 700;
  padding: 6px 10px;
  max-width: 280px;
  background: var(--field);
  border: 0;
  color: var(--text);
  border-radius: 6px;
}

.profile-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.admin-actions .btn.active {
  background: var(--green);
  color: var(--on-accent);
  border-color: transparent;
}

.admin-actions .btn.active:hover {
  background: var(--green-hover);
  border-color: transparent;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 4px 12px 16px;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  position: relative;
}

.nav-close {
  display: none;
  width: 36px;
  height: 36px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--bg-highlight);
  color: var(--text);
  place-items: center;
  flex-shrink: 0;
}

.brand img,
.brand svg,
.brand-mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 8px;
}

.brand-sq {
  fill: var(--logo-sq);
}

.brand-disc {
  fill: var(--green);
}

.brand-wave {
  stroke: var(--logo-sq);
  fill: none;
}

[hidden] {
  display: none !important;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
  text-align: left;
}

.nav-btn svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.nav-btn:hover,
.nav-btn.active {
  color: var(--text);
  background: var(--bg-highlight);
}

a.nav-btn:focus {
  outline: none;
  background: transparent;
  color: var(--muted);
}

a.nav-btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px;
  color: var(--subtle);
  font-size: 0.72rem;
  line-height: 1.4;
}

.main {
  grid-row: 1;
  background: var(--main-wash);
  border-radius: 12px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

.pill[hidden],
.pill.is-hidden {
  display: none !important;
}

.pill.warn {
  background: rgba(255, 200, 80, 0.12);
  color: #ffd789;
}

.pill.guest {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.pill.visitors {
  background: rgba(139, 92, 246, 0.16);
  color: var(--text);
}

.visitor-home {
  margin: -8px 0 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.visitor-home strong {
  color: var(--green);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  color: var(--text);
}

.visitor-admin {
  margin-bottom: 20px;
  max-width: 560px;
}

.grant-admin-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.grant-admin-form input[type="email"] {
  flex: 1;
  min-width: 200px;
  background: var(--field);
  border: 0;
  color: var(--text);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.95rem;
}

.admin-email-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.people-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.grant-admin-form input[type="number"] {
  width: 120px;
  flex: 0 0 auto;
  min-width: 120px;
  background: var(--field);
  border: 0;
  color: var(--text);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.95rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-highlight);
  color: var(--text);
  display: grid;
  place-items: center;
}

.theme-toggle:hover {
  background: var(--green);
  color: var(--on-accent);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  grid-area: 1 / 1;
}

html:not([data-theme="light"]) .icon-moon {
  display: none;
}

html[data-theme="light"] .icon-sun {
  display: none;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #535353;
  object-fit: cover;
  display: block;
}

.avatar-fallback {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green);
  color: var(--on-accent);
  font-size: 0.8rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

img.people-avatar,
.avatar-fallback.people-avatar {
  width: 40px;
  height: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-primary:hover {
  transform: scale(1.03);
  background: #f2f2f2;
}

.btn-green {
  background: var(--green);
  color: var(--on-accent);
}

.btn-green:hover {
  background: var(--green-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--text);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.content {
  flex: 1;
  overflow: auto;
  overflow-x: hidden;
  padding: 8px 24px 32px;
}

.app-admin .content {
  width: 100%;
  max-width: 880px;
}

.content h1 {
  margin: 8px 0 20px;
  font-size: 1.85rem;
  letter-spacing: -0.03em;
}

.section-title {
  margin: 28px 0 12px;
  font-size: 1.15rem;
}

.song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 14px;
  transition: background 0.15s;
  position: relative;
}

.card:hover {
  background: var(--bg-highlight);
}

.cover {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
  background: #333;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.cover-sm {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.cover-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #3a3a3a, #1f1f1f);
}

.card h3 {
  margin: 12px 0 4px;
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card p,
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.play-fab {
  position: absolute;
  right: 22px;
  top: 118px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(8px);
  transition: 0.15s;
}

.card:hover .play-fab,
.card:focus-within .play-fab {
  opacity: 1;
  transform: translateY(0);
}

.play-fab svg {
  width: 22px;
  height: 22px;
}

.card-actions {
  position: absolute;
  top: 20px;
  right: 20px;
  opacity: 0;
}

.card:hover .card-actions {
  opacity: 1;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  color: var(--text);
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.track-table {
  width: 100%;
  border-collapse: collapse;
}

.track-table th {
  text-align: left;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-bottom: 1px solid #2a2a2a;
}

.track-table td {
  padding: 10px 12px;
  font-size: 0.9rem;
  border-radius: 4px;
}

.track-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.06);
}

.track-table tbody tr.playing td {
  color: var(--green);
}

.track-mini {
  display: flex;
  align-items: center;
  gap: 12px;
}

.track-mini img,
.track-mini .cover-fallback {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  flex-shrink: 0;
  font-size: 1rem;
}

.empty {
  color: var(--muted);
  padding: 48px 8px;
  text-align: center;
}

.player {
  grid-column: 1 / -1;
  background: var(--player-bg);
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 12px;
  height: var(--player);
  border-top: 1px solid var(--border);
}

.now-playing {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
}

.now-playing img,
.now-playing .cover-fallback {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  flex-shrink: 0;
  font-size: 1.2rem;
  object-fit: cover;
}

#np-cover-img {
  display: none;
}

#np-cover-img.is-on {
  display: block;
}

#np-cover-fallback.is-off {
  display: none;
}

.now-playing h4 {
  margin: 0 0 2px;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.control-row button {
  color: var(--muted);
  display: grid;
  place-items: center;
}

.control-row button:hover {
  color: var(--text);
}

.control-row .play-main,
.control-row .play-main:hover,
.control-row .play-main:focus {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--play-bg);
  color: var(--play-icon);
  display: grid;
  place-items: center;
}

.play-main svg {
  grid-area: 1 / 1;
  fill: var(--play-icon);
  color: var(--play-icon);
}

.play-main .icon-pause {
  display: none;
}

.play-main.is-playing .icon-play {
  display: none;
}

.play-main.is-playing .icon-pause {
  display: block;
}

.control-row .play-main:hover {
  transform: scale(1.06);
  background: var(--play-bg);
  color: var(--play-icon);
}

.seek {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 560px;
  color: var(--subtle);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.seek input[type="range"],
.volume input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  flex: 1;
  vertical-align: middle;
}

.seek input[type="range"]::-webkit-slider-runnable-track,
.volume input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--green) var(--fill, 0%), var(--track) var(--fill, 0%));
}

.seek input[type="range"]::-moz-range-track,
.volume input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: var(--track);
}

.seek input[type="range"]::-moz-range-progress,
.volume input[type="range"]::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--green);
}

.seek input[type="range"]::-webkit-slider-thumb,
.volume input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

.seek input[type="range"]::-moz-range-thumb,
.volume input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

.volume {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
}

.volume input {
  width: 96px;
}

.vol-btn {
  color: var(--muted);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
}

.vol-btn:hover {
  color: var(--text);
}

.vol-btn .vol-icon {
  display: none;
  grid-area: 1 / 1;
}

.vol-btn[data-level="mute"] #vol-mute,
.vol-btn[data-level="low"] #vol-low,
.vol-btn[data-level="high"] #vol-high {
  display: block;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  place-items: center;
  z-index: 50;
  padding: 16px;
}

.modal-backdrop.open {
  display: grid;
}

.modal {
  background: var(--modal);
  border-radius: 12px;
  padding: 24px;
  width: min(440px, 100%);
}

.modal h2 {
  margin: 0 0 16px;
  font-size: 1.3rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-size: 0.78rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  background: var(--field);
  border: 0;
  color: var(--text);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.95rem;
}

.field input[type="file"] {
  padding: 8px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.toast {
  position: fixed;
  bottom: calc(var(--player) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--green);
  color: var(--on-accent);
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 60;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: var(--danger);
  color: #fff;
}

.playlist-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  border-radius: 8px;
}

.playlist-row:hover {
  background: var(--bg-highlight);
}

.pl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 20px;
}

.playlist-art {
  width: 64px;
  height: 64px;
  border-radius: 4px;
  background: linear-gradient(135deg, #3f3f3f, #1c1c1c);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green);
}

.admin-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 8px;
}

.panel {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 1.1rem;
}

.song-admin-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.admin-foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  background: var(--bg-main);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.song-admin-item img,
.song-admin-item .cover-fallback {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  font-size: 1rem;
}

.grow {
  flex: 1;
  min-width: 0;
}

.check-list {
  max-height: 220px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.check-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--muted);
}

.nav-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .app,
  .app-admin {
    grid-template-columns: 1fr;
    padding: 0;
    gap: 0;
  }

  .nav-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(16, 10, 28, 0.55);
  }

  .sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 82vw);
    z-index: 40;
    border-radius: 0;
    padding: 0 10px calc(12px + env(safe-area-inset-bottom));
    gap: 2px;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.28);
    border-right: 1px solid var(--border);
  }

  .sidebar.open {
    display: flex;
  }

  .nav-close {
    display: grid;
    width: 40px;
    height: 40px;
    background: transparent;
    color: var(--muted);
  }

  .nav-close:hover {
    background: var(--bg-highlight);
    color: var(--text);
  }

  .brand {
    justify-content: flex-start;
    margin: 0 -10px 8px;
    padding: calc(10px + env(safe-area-inset-top)) 12px 12px 16px;
    border-bottom: 1px solid var(--border);
  }

  .nav-btn {
    padding: 11px 14px;
    border-radius: 10px;
  }

  .menu-toggle {
    display: grid;
    place-items: center;
    background: var(--bg-highlight);
    color: var(--text);
  }

  .main,
  .admin-foot {
    border-radius: 0;
  }

  .topbar {
    padding: 10px 12px;
    padding-top: calc(10px + env(safe-area-inset-top));
  }

  .user-name,
  .hide-sm,
  .pill.guest {
    display: none;
  }

  .content {
    padding: 8px 14px 24px;
  }

  .content h1 {
    margin: 4px 0 14px;
    font-size: 1.45rem;
  }

  .song-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .admin-profile {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    gap: 14px;
  }

  .admin-profile .name-row {
    width: 100%;
  }

  .admin-profile .name-row input {
    flex: 1;
    min-width: 0;
    max-width: none;
    font-size: 16px;
  }

  .admin-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .admin-actions .btn {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  .panel {
    padding: 16px;
  }

  .field input,
  .field select,
  .field textarea,
  .modal input,
  .modal select {
    font-size: 16px;
  }

  .song-admin-item {
    flex-wrap: wrap;
  }

  .song-admin-item .btn {
    min-height: 36px;
  }

  .pl-actions {
    width: 100%;
  }

  .pl-actions .btn {
    flex: 1;
  }

  .track-table th:nth-child(3),
  .track-table td:nth-child(3) {
    display: none;
  }

  .modal {
    padding: 18px 16px;
    width: 100%;
    max-height: calc(100dvh - 32px);
    overflow: auto;
  }

  .player {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    height: auto;
    min-height: 0;
    border-top: 1px solid var(--border);
  }

  .now-playing {
    width: 100%;
    justify-content: center;
    min-width: 0;
  }

  .now-playing img,
  .now-playing .cover-fallback,
  #np-cover-img.is-on,
  .now-playing .muted,
  .seek {
    display: none;
  }

  .now-playing h4 {
    margin: 0;
    font-size: 0.92rem;
    text-align: center;
  }

  .controls {
    width: 100%;
    flex-direction: row;
    justify-content: center;
  }

  .control-row {
    gap: 22px;
  }

  .control-row button {
    width: 36px;
    height: 36px;
    color: var(--text);
  }

  .control-row .play-main,
  .control-row .play-main:hover,
  .control-row .play-main:focus {
    width: 48px;
    height: 48px;
  }

  .volume {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: none;
    min-width: 0;
    justify-content: center;
  }

  .volume .vol-btn {
    display: none;
  }

  .volume input {
    width: 100%;
    max-width: 280px;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-foot {
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    font-size: 0.75rem;
    text-align: center;
  }

  .play-fab {
    opacity: 1;
    transform: none;
    top: auto;
    bottom: 64px;
  }
}

@media (max-width: 520px) {
  .admin-actions {
    grid-template-columns: 1fr;
  }

  .track-table th:nth-child(4),
  .track-table td:nth-child(4) {
    display: none;
  }
}

.now-view {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 70;
  flex-direction: column;
  align-items: center;
  padding: calc(14px + env(safe-area-inset-top)) 22px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #4c3d7a 0%, #1b1628 48%, #0b0812 100%);
  color: #fff;
}

.now-view.open {
  display: flex;
}

.now-view-top,
.now-meta,
.now-seek,
.now-controls,
.now-vol {
  width: min(100%, 440px);
}

.now-view-top {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  margin-bottom: 12px;
}

.now-view-top button,
.now-controls button {
  color: #fff;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}

.now-from {
  text-align: center;
}

.now-from p {
  margin: 0;
}

#now-from-label {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.62);
}

#now-from-name {
  font-size: 0.95rem;
  font-weight: 700;
}

.now-art {
  width: min(72vw, 380px);
  aspect-ratio: 1;
  margin: auto 0 22px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(160deg, #6d28d9, #1e1633);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.4);
  flex-shrink: 1;
}

.now-art img,
.now-art .cover-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  font-size: 4rem;
}

.now-meta {
  margin-bottom: 16px;
}

.now-meta h2 {
  margin: 0 0 4px;
  font-size: clamp(1.2rem, 4vw, 1.7rem);
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-meta p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
}

.now-bar {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.now-bar::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--green) var(--fill, 0%),
    rgba(255, 255, 255, 0.22) var(--fill, 0%)
  );
}

.now-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

.now-bar::-moz-range-track {
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.now-bar::-moz-range-progress {
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
}

.now-bar::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

.now-times {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.6);
  font-variant-numeric: tabular-nums;
}

.now-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin: 16px 0 20px;
}

.now-play-lg,
.now-play-lg:hover,
.now-play-lg:focus {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #fff;
  color: #16101f;
}

.now-play-lg svg {
  fill: #16101f;
  color: #16101f;
}

.now-vol {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: auto;
}

.now-vol .now-bar {
  flex: 1;
}

body.now-open {
  overflow: hidden;
}

@media (min-width: 901px) {
  .now-art {
    width: min(36vw, 400px);
    margin-bottom: 28px;
  }

  .now-controls {
    gap: 36px;
  }
}

@media (max-width: 520px) {
  .now-view {
    padding-left: 18px;
    padding-right: 18px;
  }

  .now-art {
    width: min(78vw, 300px);
    margin-bottom: 16px;
  }

  .now-controls {
    gap: 22px;
    margin: 12px 0 16px;
  }

  .now-play-lg,
  .now-play-lg:hover,
  .now-play-lg:focus {
    width: 64px;
    height: 64px;
  }
}
