:root {
  color-scheme: dark;
  --bg: #070a12;
  --bg-soft: #0f1422;
  --panel: rgba(17, 24, 39, 0.78);
  --panel-border: rgba(148, 163, 184, 0.2);
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #7c3aed;
  --accent-soft: rgba(124, 58, 237, 0.24);
  --ok: #22c55e;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  overscroll-behavior-y: auto;
  touch-action: auto;
}

html.standalone-mode .tabs,
html.standalone-mode .list-wrap,
html.standalone-mode .artist-suggest {
  overscroll-behavior: contain;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(124, 58, 237, 0.35), transparent 65%),
    radial-gradient(800px 420px at 100% 0%, rgba(14, 165, 233, 0.2), transparent 70%),
    var(--bg);
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(7, 10, 18, 0.88);
  backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

.header-main {
  display: flex;
  align-items: center;
}

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

.logo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
  box-shadow: 0 14px 28px rgba(6, 182, 212, 0.22);
}

.logo-note {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: block;
  color: rgba(255, 255, 255, 0.95);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.brand h1 {
  margin: 0;
  font-size: 18px;
}

.sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.header-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-wrap {
  min-width: min(420px, 65vw);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
}

.search-wrap span {
  color: var(--muted);
  font-size: 13px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-wrap input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
  font-size: 14px;
}

.layout {
  max-width: 1280px;
  margin: 16px auto;
  padding: 0 18px calc(20px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.panel {
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
}

.panel-head {
  padding: 12px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

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

.tab {
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tab span {
  font-size: 12px;
  color: var(--muted);
}

.tab.active {
  border-color: rgba(124, 58, 237, 0.7);
  background: var(--accent-soft);
}

.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.toolbar.playlist-mode .playlist-active {
  order: -1;
  flex: 0 0 auto;
  max-width: 300px;
}

.toolbar.admin-mode .playlist-active {
  order: 0;
  flex: 0 0 auto;
  max-width: 300px;
}

.toolbar.admin-mode .artist-search-wrap {
  order: 1;
}

.toolbar.admin-mode .sort-picker-wrap {
  order: 2;
}

.toolbar.admin-mode .admin-tools {
  order: 3;
}

.playlist-quick {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12px;
}

.admin-tools input[type=checkbox] {
  accent-color: #8b5cf6;
}

.playlist-active {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: 300px;
  min-height: 38px;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid rgba(124, 58, 237, 0.52);
  background: rgba(124, 58, 237, 0.18);
  color: #ddd6fe;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.playlist-active-label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-active-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.playlist-active-icon {
  border: none;
  background: transparent;
  color: #ddd6fe;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}

.playlist-play-toggle {
  position: relative;
  min-width: 18px;
  height: 16px;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
}

.playlist-play-toggle.paused {
  font-size: 0;
}

.playlist-play-toggle.paused::before,
.playlist-play-toggle.paused::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: currentColor;
  transform: translateY(-50%);
}

.playlist-play-toggle.paused::before {
  left: 4px;
}

.playlist-play-toggle.paused::after {
  right: 4px;
}

.playlist-active-icon:hover {
  color: #f5f3ff;
}

.playlist-active.empty {
  border-color: var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: default;
}

.playlist-active.empty .playlist-active-actions {
  display: none;
}

select,
#artistSearch,
#sortPicker,
.btn {
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 8px 11px;
  font-size: 13px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  border-color: var(--panel-border);
  background-color: rgba(255, 255, 255, 0.03);
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(226, 232, 240, 0.9) 50%),
    linear-gradient(135deg, rgba(226, 232, 240, 0.9) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 3px),
    calc(100% - 11px) calc(50% - 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease, transform 120ms ease;
}

select:hover,
#artistSearch:hover,
#sortPicker:hover {
  border-color: rgba(148, 163, 184, 0.42);
  background-color: rgba(255, 255, 255, 0.08);
}

select:focus,
#artistSearch:focus,
#sortPicker:focus {
  outline: none;
  border-color: rgba(167, 139, 250, 0.72);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

#artistSearch {
  min-width: 170px;
  width: 200px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease, transform 120ms ease;
}

.artist-search-wrap {
  position: relative;
  min-width: 170px;
  width: 200px;
}

.sort-picker-wrap {
  min-width: 0;
  width: auto;
  justify-self: start;
}

.artist-search-wrap #artistSearch {
  width: 100%;
}

.artist-search-wrap #sortPicker {
  width: auto;
  cursor: pointer;
  min-width: 10ch;
  padding-right: 30px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(226, 232, 240, 0.9) 50%),
    linear-gradient(135deg, rgba(226, 232, 240, 0.9) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 3px),
    calc(100% - 11px) calc(50% - 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.native-control-hidden {
  display: none !important;
}

.artist-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 18;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  display: grid;
  gap: 4px;
}

.artist-suggest-item {
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
  text-align: left;
  padding: 7px 9px;
  font-size: 12px;
  cursor: pointer;
}

.artist-suggest-item:hover,
.artist-suggest-item.active {
  border-color: rgba(124, 58, 237, 0.48);
  background: rgba(124, 58, 237, 0.2);
}

.btn:focus-visible {
  outline: none;
  border-color: rgba(167, 139, 250, 0.72);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

select option {
  background: #111827;
  color: var(--text);
}

.btn {
  cursor: pointer;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn.primary {
  border-color: rgba(124, 58, 237, 0.55);
  background: rgba(124, 58, 237, 0.22);
}

.btn.primary:hover {
  background: rgba(124, 58, 237, 0.3);
}

.btn.danger {
  border-color: rgba(239, 68, 68, 0.5);
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
}

.btn.icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.connection-icon {
  position: relative;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  font-size: 16px;
}

.connection-icon.connected {
  border-color: rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

.connection-icon.member {
  border-color: rgba(14, 165, 233, 0.6);
  background: rgba(14, 165, 233, 0.16);
  color: #bae6fd;
}

.connection-icon.connected::after {
  content: '';
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 2px solid rgba(2, 6, 23, 0.9);
  background: #22c55e;
}

.connection-icon.member::after {
  background: #0ea5e9;
}

.user-chip {
  min-width: 94px;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(2, 6, 23, 0.18);
}

.user-menu-card {
  position: fixed;
  top: 64px;
  right: 18px;
  width: min(240px, calc(100vw - 20px));
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(10, 14, 24, 0.97);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
}

.user-menu-head {
  display: grid;
  gap: 2px;
  padding: 2px 2px 6px;
}

.user-menu-head strong {
  font-size: 14px;
  color: #f8fafc;
}

.user-menu-head span {
  font-size: 12px;
  color: var(--muted);
}

#adminUsersOpen {
  white-space: nowrap;
}

.btn.favorite-on {
  color: #f5c542;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.panel-stats {
  padding: 10px 12px;
  border-bottom: 1px solid var(--panel-border);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stat {
  background: rgba(2, 6, 23, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  padding: 8px 10px;
}

.stat span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}

.stat strong {
  font-size: 14px;
}

.list-wrap {
  max-height: calc(100vh - 260px);
  overflow: auto;
  padding: 12px;
}

.list {
  display: grid;
  gap: 8px;
}

.load-more-row {
  display: flex;
  justify-content: center;
  padding: 4px 0 2px;
}

.track {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(2, 6, 23, 0.45);
  cursor: pointer;
}

.track:hover {
  background: rgba(30, 41, 59, 0.55);
}

.track.active {
  border-color: rgba(124, 58, 237, 0.7);
  background: rgba(124, 58, 237, 0.2);
}

.art {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.7), rgba(14, 165, 233, 0.55));
  border: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-weight: 700;
}

.art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.track-title {
  font-weight: 700;
  line-height: 1.25;
}

.track-sub,
.track-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-actions {
  display: inline-flex;
  gap: 6px;
}

.admin-track {
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: start;
  cursor: default;
}

.admin-track:hover {
  background: rgba(2, 6, 23, 0.45);
}

.admin-main {
  display: grid;
  gap: 6px;
}

.admin-edit {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 4px;
}

.admin-input {
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 8px 10px;
  font-size: 12px;
  min-width: 0;
}

.admin-issues {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.issue-badge {
  border: 1px solid rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
}

.issue-ok {
  border: 1px solid rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
}

.admin-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.online-search {
  margin-top: 8px;
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 12px;
  background: rgba(76, 29, 149, 0.12);
  padding: 10px;
}

.online-search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}

.online-search-head strong {
  font-size: 12px;
}

.online-search-head span {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.online-search-status {
  border: 1px dashed rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  background: rgba(2, 6, 23, 0.35);
}

.online-search-status.error {
  border-color: rgba(239, 68, 68, 0.45);
  color: #fecaca;
  background: rgba(127, 29, 29, 0.2);
}

.online-search-list {
  display: grid;
  gap: 8px;
}

.online-link {
  color: #c4b5fd;
  text-decoration: none;
}

.online-link:hover {
  text-decoration: underline;
}

.online-track {
  grid-template-columns: 52px minmax(0, 1fr);
  cursor: default;
  align-items: start;
}

.online-track:hover {
  background: rgba(2, 6, 23, 0.45);
}

.online-edit {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 4px;
}

.empty {
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  background: rgba(2, 6, 23, 0.32);
}

.stack {
  display: grid;
  gap: 14px;
}

.now-panel {
  padding: 12px;
}

.now-link {
  display: block;
  color: #c4b5fd;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}

.now-link:hover {
  text-decoration: underline;
}

.now-link.disabled {
  color: var(--muted);
  pointer-events: none;
}

.audio-hidden {
  position: fixed;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0.001;
  pointer-events: none;
}

.now-panel .seek-wrap {
  margin-top: 0;
  gap: 10px;
}

.now-panel .transport {
  margin-top: 8px;
}

.now-hero {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.now-hero-clickable {
  border-radius: 12px;
  padding: 4px;
  margin: -4px -4px 8px;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.now-hero-clickable:hover {
  background: rgba(124, 58, 237, 0.14);
}

.now-hero-clickable:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

.cover {
  width: 84px;
  height: 84px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.9), rgba(14, 165, 233, 0.72));
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 30px;
  font-weight: 800;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.now-meta .label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.now-meta h2 {
  margin: 4px 0 6px;
  font-size: 17px;
  line-height: 1.2;
}

.now-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  word-break: break-word;
}

audio {
  width: 100%;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.55);
}

.transport {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.seek-wrap {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

input[type=range] {
  width: 100%;
  accent-color: #8b5cf6;
}

#seek {
  appearance: none;
  -webkit-appearance: none;
  height: 10px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.28);
  cursor: pointer;
}

#seek::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.85), rgba(124, 58, 237, 0.95));
}

#seek::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -3px;
  border-radius: 50%;
  border: 2px solid #f5f3ff;
  background: #c4b5fd;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

#seek::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.32);
}

#seek::-moz-range-progress {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.9), rgba(124, 58, 237, 0.95));
}

#seek::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #f5f3ff;
  background: #c4b5fd;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

#time {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.quick-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.shortcuts {
  padding: 12px;
}

.shortcuts h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.playlist-create {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
}

.playlist-create input {
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 8px 11px;
  font-size: 13px;
  min-width: 0;
}

.playlist-info {
  margin-top: 8px !important;
  font-size: 12px;
  color: var(--muted);
}

.shortcuts p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

kbd {
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(2, 6, 23, 0.62);
  color: #dbeafe;
  font-size: 11px;
}

.auth-gate {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(8px);
  z-index: 45;
}

.auth-gate.on {
  display: flex;
}

.auth-box {
  width: min(430px, 100%);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.95);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-brand h3 {
  margin: 0;
}

.auth-brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.auth-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-mode .btn.active {
  border-color: rgba(124, 58, 237, 0.75);
  background: rgba(124, 58, 237, 0.2);
}

.auth-form {
  display: grid;
  gap: 8px;
}

.auth-form input {
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 10px 11px;
  font-size: 14px;
}

.auth-error {
  margin: 0;
  color: #fda4af;
  font-size: 12px;
}

.gate {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2, 6, 23, 0.64);
  backdrop-filter: blur(6px);
  z-index: 30;
}

.gate.on {
  display: flex;
}

.gate-box {
  width: min(520px, 100%);
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: rgba(2, 6, 23, 0.94);
  padding: 14px;
}

.gate-box h3 {
  margin: 0 0 6px;
}

.gate-box p {
  margin: 0;
  color: var(--muted);
}

.gate-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.sync-gate {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(6px);
  z-index: 34;
}

.sync-gate.on {
  display: flex;
}

.sync-box {
  width: min(440px, 100%);
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(124, 58, 237, 0.18), transparent 45%),
    rgba(2, 6, 23, 0.96);
  padding: 15px;
  display: grid;
  gap: 11px;
}

.sync-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sync-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sync-head h3 {
  margin: 0;
}

.sync-role {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
}

.sync-role.host {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}

.sync-role.member {
  border-color: rgba(14, 165, 233, 0.55);
  background: rgba(14, 165, 233, 0.18);
  color: #bae6fd;
}

.sync-sub {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.sync-room-card {
  border: 1px solid rgba(124, 58, 237, 0.5);
  background: rgba(124, 58, 237, 0.14);
  border-radius: 12px;
  padding: 10px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sync-label {
  margin: 0 0 3px;
  color: #c4b5fd;
  font-size: 11px;
  letter-spacing: 0.4px;
}

.sync-room-code {
  margin: 0;
  font-size: 26px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 2px;
}

.sync-room-meta {
  margin: 0;
  font-size: 12px;
  color: #d1d5db;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.5);
  border-radius: 10px;
  padding: 7px 10px;
}

.sync-create-row,
.sync-join-row {
  display: grid;
  gap: 8px;
}

.sync-create-row {
  grid-template-columns: minmax(0, 1fr);
}

.sync-join-row {
  grid-template-columns: minmax(0, 1fr) 98px;
}

.sync-create-row .btn,
.sync-join-row .btn,
#syncLeave {
  min-height: 40px;
  width: 100%;
}

#syncCode {
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 8px 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
}

#syncCode:focus {
  outline: none;
  border-color: rgba(167, 139, 250, 0.72);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

.sync-hint {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.lyrics-gate {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(10px);
  z-index: 38;
  pointer-events: none;
}

.lyrics-gate.on {
  display: flex;
  pointer-events: auto;
}

.lyrics-box {
  width: min(760px, 100%);
  max-height: min(94vh, 900px);
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    radial-gradient(120% 90% at 50% -8%, rgba(124, 58, 237, 0.26), transparent 56%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.98));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.lyrics-head {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.lyrics-head-actions {
  display: inline-flex;
  gap: 6px;
}

.lyrics-hero {
  padding: 8px 20px 12px;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.lyrics-cover {
  width: 250px;
  height: 250px;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.9), rgba(14, 165, 233, 0.72));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.38);
  font-size: 58px;
  font-weight: 800;
}

.lyrics-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lyrics-meta {
  min-width: 0;
  text-align: center;
}

.lyrics-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lyrics-meta h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.2;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.lyrics-meta p {
  margin: 7px 0 0;
  color: #cbd5e1;
  font-size: 18px;
}

.lyrics-body {
  min-height: 0;
  padding: 10px 28px 26px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  overflow-x: hidden;
}

.lyrics-state {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.lyrics-state.error {
  color: #fca5a5;
}

.lyrics-lines {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  display: grid;
  gap: 10px;
  padding: 2px 0 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.2) transparent;
}

.lyrics-lines::-webkit-scrollbar {
  width: 4px;
  height: 0;
}

.lyrics-lines::-webkit-scrollbar-track {
  background: transparent;
}

.lyrics-lines::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
}

.lyrics-lines::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.32);
}

.lyrics-line {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #6b7280;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  padding: 2px 0;
  font-size: 22px;
  line-height: 1.5;
  font-weight: 500;
  transition: color 180ms ease, transform 180ms ease;
  word-break: break-word;
  overflow-wrap: anywhere;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
}

.lyrics-line.past {
  color: #4b5563;
}

.lyrics-line.active {
  color: #f8fafc;
  transform: scale(1.02);
  text-shadow: 0 8px 22px rgba(124, 58, 237, 0.44);
}

.lyrics-line.edit-target {
  color: #e9d5ff;
  text-shadow: 0 0 0 transparent;
}

.lyrics-line.edit-target.active {
  color: #f8fafc;
  text-shadow: 0 8px 22px rgba(124, 58, 237, 0.44);
}

.lyrics-line-wrap {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  display: grid;
  gap: 6px;
}

.lyrics-line-wrap.editing {
  grid-template-columns: 50px minmax(0, 1fr) 28px;
}

.lyrics-line-wrap.plain .lyrics-line {
  grid-column: 1 / -1;
}

.lyrics-line-wrap.editing .lyrics-line {
  grid-column: 2;
}

.lyrics-adjust {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  user-select: none;
}

.lyrics-adjust-btn {
  width: 18px;
  height: 14px;
  border: 0;
  padding: 0;
  line-height: 1;
  border-radius: 5px;
  background: transparent;
  color: #cbd5e1;
  font-size: 10px;
  cursor: pointer;
}

.lyrics-adjust-btn:hover:not(:disabled) {
  background: rgba(124, 58, 237, 0.16);
  color: #f8fafc;
}

.lyrics-adjust-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.lyrics-adjust-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.22);
}

.lyrics-adjust-value {
  min-width: 38px;
  text-align: center;
  color: #cbd5e1;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  opacity: 0.92;
}

.lyrics-line-wrap.editing .lyrics-adjust-value {
  color: #ddd6fe;
}

.lyrics-delete-btn {
  width: 22px;
  height: 22px;
  align-self: center;
  justify-self: center;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.lyrics-delete-btn:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.25);
  color: #fee2e2;
}

.lyrics-delete-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: grid;
  gap: 8px;
  z-index: 40;
}

.toast-item {
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.95);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.32);
  padding: 10px 12px;
  min-width: 220px;
  max-width: 420px;
}

.toast-item strong {
  display: block;
  font-size: 13px;
}

.toast-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.hidden {
  display: none !important;
}

.admin-users-page {
  min-height: 100vh;
}

.admin-users-shell {
  max-width: 1280px;
  margin: 24px auto;
  padding: 0 16px 24px;
  display: grid;
  gap: 14px;
}

.admin-users-head {
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(76, 29, 149, 0.35), rgba(15, 23, 42, 0.82));
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-users-head h1 {
  margin: 0;
  font-size: 20px;
}

.admin-users-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.admin-auth-card,
.admin-users-toolbar,
.admin-users-table-wrap,
.admin-global-card {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.74);
  padding: 12px;
}

.admin-auth-card label {
  font-size: 12px;
  color: var(--muted);
}

.admin-auth-row {
  margin-top: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
}

.admin-auth-row input {
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 9px 11px;
  font-size: 14px;
}

.admin-auth-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

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

.admin-toolbar-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 140px;
  gap: 8px;
}

.admin-toolbar-filters input,
.admin-toolbar-filters select,
.admin-create-grid input,
.admin-create-grid select,
.admin-role-select,
.admin-modal-card input {
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 9px 11px;
  font-size: 13px;
}

.admin-users-actions {
  display: inline-flex;
  gap: 8px;
}

.admin-users-metrics,
.admin-global-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-global-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-metric,
.admin-global-card {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.6);
}

.admin-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.admin-metric strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
}

.admin-global-card h3 {
  margin: 0;
  font-size: 14px;
}

.admin-global-card p {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.admin-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.admin-users-table-wrap {
  overflow: auto;
}

.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.admin-users-table th,
.admin-users-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding: 8px 10px;
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}

.admin-users-table th {
  color: #cbd5e1;
  font-size: 12px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.admin-users-table tbody tr:hover {
  background: rgba(124, 58, 237, 0.08);
}

.admin-role-badge,
.admin-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
}

.admin-role-badge.admin {
  border-color: rgba(14, 165, 233, 0.6);
  background: rgba(14, 165, 233, 0.18);
  color: #bae6fd;
}

.admin-role-badge.user {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.admin-status-badge.enabled {
  border-color: rgba(34, 197, 94, 0.58);
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}

.admin-status-badge.disabled {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
}

.admin-row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-row-actions .btn {
  min-height: 30px;
  padding: 6px 8px;
  font-size: 12px;
}

.admin-role-select {
  margin-top: 6px;
  min-width: 88px;
  padding: 5px 8px;
}

.admin-users-table .muted {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.admin-users-empty {
  border: 1px dashed rgba(148, 163, 184, 0.26);
  border-radius: 12px;
  padding: 14px;
  color: var(--muted);
}

.admin-users-summary {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(2, 6, 23, 0.72);
  display: grid;
  place-items: center;
  padding: 20px;
}

.admin-modal-card {
  width: min(420px, 100%);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.95);
  padding: 14px;
}

.admin-modal-card h3 {
  margin: 0;
  font-size: 16px;
}

.admin-modal-card p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-modal-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.admin-users-page .toast {
  right: 16px;
  left: auto;
  bottom: calc(16px + env(safe-area-inset-bottom));
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.92);
  color: var(--text);
  padding: 8px 12px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
  display: block;
}

.admin-users-page .toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1060px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .list-wrap {
    max-height: 56vh;
  }
}

@media (max-width: 760px) {
  .header {
    top: 0;
    padding-top: env(safe-area-inset-top);
  }

  .header-inner {
    grid-template-columns: 1fr;
    position: relative;
    padding: 10px 12px;
    gap: 10px;
  }

  .header-main {
    padding-right: 44px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .sub {
    font-size: 11px;
  }

  .header-controls {
    width: 100%;
    display: block;
  }

  .search-wrap {
    min-width: 0;
    width: 100%;
  }

  .connection-icon {
    position: absolute;
    right: 12px;
    top: calc(10px + env(safe-area-inset-top));
  }

  .user-chip {
    position: absolute;
    right: 54px;
    top: calc(10px + env(safe-area-inset-top));
    min-width: 74px;
    max-width: 110px;
    padding-inline: 9px;
  }

  .user-menu-card {
    width: min(220px, calc(100vw - 16px));
    right: 8px;
  }

  .layout {
    margin-top: 10px;
    padding-inline: 10px;
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
    gap: 10px;
  }

  .panel {
    border-radius: 14px;
    overflow-x: hidden;
  }

  .panel-head {
    padding: 10px;
    align-items: flex-start;
  }

  .tabs {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 7px 10px;
    font-size: 13px;
  }

  .toolbar {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }

  .toolbar > * {
    min-width: 0;
  }

  .admin-tools {
    grid-column: 1 / -1;
  }

  .playlist-active {
    grid-column: 1 / -1;
    max-width: none;
  }

  select,
  #artistSearch,
  #sortPicker,
  .btn {
    min-height: 38px;
  }

  select {
    border-radius: 12px;
    font-size: 13px;
  }

  .artist-search-wrap,
  #artistSearch,
  #clear {
    min-width: 0;
    width: 100%;
  }

  #artistSearch {
    transition: transform 160ms ease, box-shadow 160ms ease;
  }

  #artistSearch:focus {
    transform: scale(1.01);
  }

  .artist-search-wrap:not(.sort-picker-wrap):focus-within {
    grid-column: 1 / -1;
  }

  .sort-picker-wrap,
  #sortPicker {
    width: 100%;
  }

  .sort-picker-wrap {
    grid-column: auto;
  }

  .sort-picker-wrap #sortPicker {
    min-width: 0;
  }

  .artist-suggest {
    max-height: 220px;
  }

  #clear {
    font-size: 12px;
    padding-inline: 7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .panel-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .stat {
    padding: 7px 8px;
  }

  .list-wrap {
    max-height: 56vh;
    overflow-y: auto;
    padding: 10px;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
  }

  .track {
    grid-template-columns: 46px minmax(0, 1fr);
    padding: 9px;
    gap: 8px;
    width: 100%;
  }

  .track-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-top: 2px;
  }

  .btn.icon {
    width: 38px;
    height: 38px;
  }

  .admin-edit {
    grid-template-columns: 1fr;
  }

  .online-edit {
    grid-template-columns: 1fr;
  }

  .playlist-quick {
    width: 100%;
    order: 0;
    display: block;
    grid-column: 1 / -1;
    align-items: center;
  }

  #playlistSelect {
    grid-column: auto;
    min-width: 0;
    width: 100%;
  }

  .toolbar.playlist-mode .playlist-active,
  .toolbar.admin-mode .playlist-active {
    order: -2;
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
  }

  .toolbar.playlist-mode {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  }

  .toolbar.playlist-mode .playlist-quick,
  .toolbar.playlist-mode .artist-search-wrap,
  .toolbar.playlist-mode .sort-picker-wrap {
    grid-column: auto;
    width: 100%;
  }

  .toolbar.playlist-mode .artist-search-wrap:focus-within {
    grid-column: auto;
  }

  .toolbar.admin-mode {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  }

  .toolbar.admin-mode .artist-search-wrap,
  .toolbar.admin-mode .sort-picker-wrap,
  .toolbar.admin-mode .admin-tools {
    grid-column: auto;
    width: 100%;
  }

  .toolbar.admin-mode .artist-search-wrap:focus-within {
    grid-column: auto;
  }

  .toolbar.admin-mode .admin-tools {
    justify-content: center;
    white-space: nowrap;
    padding-inline: 8px;
  }

  .toolbar.favhist-mode {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  }

  .toolbar.favhist-mode .artist-search-wrap,
  .toolbar.favhist-mode .sort-picker-wrap,
  .toolbar.favhist-mode #clear {
    grid-column: auto;
    width: 100%;
  }

  .toolbar.favhist-mode .playlist-active {
    display: inline-flex;
    grid-column: 1 / -1;
  }

  .toolbar.favhist-mode .artist-search-wrap:focus-within {
    grid-column: auto;
  }

  .now-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 36;
    min-height: 0;
    margin: 0;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-radius: 14px 14px 0 0;
    border: 1px solid rgba(148, 163, 184, 0.26);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.35);
    background: rgba(8, 12, 22, 0.96);
    backdrop-filter: blur(8px);
  }

  .now-hero {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 8px;
  }

  .cover {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    font-size: 18px;
  }

  .now-meta .label {
    display: none;
  }

  .now-panel .seek-wrap {
    gap: 8px;
  }

  .now-meta h2 {
    margin: 0 0 2px;
    font-size: 13px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .now-link {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .transport {
    margin-top: 0;
    gap: 6px;
  }

  .transport .btn {
    min-height: 34px;
    padding: 7px 10px;
  }

  .quick-actions {
    grid-template-columns: 1fr 1fr;
  }

  .gate-box {
    padding: 12px;
  }

  .sync-box {
    padding: 12px;
  }

  .sync-room-card {
    padding: 9px 10px;
  }

  .sync-room-code {
    font-size: 23px;
  }

  .lyrics-gate {
    padding: 0;
    align-items: stretch;
  }

  .lyrics-box {
    width: 100%;
    max-height: 100%;
    border-radius: 0;
    border: none;
  }

  .lyrics-head {
    padding: 10px 10px 4px;
  }

  .lyrics-hero {
    padding: 2px 14px 8px;
    gap: 8px;
  }

  .lyrics-cover {
    width: 190px;
    height: 190px;
    border-radius: 20px;
    font-size: 42px;
  }

  .lyrics-meta h2 {
    font-size: 24px;
    margin: 0;
  }

  .lyrics-meta p {
    font-size: 14px;
    margin-top: 4px;
  }

  .lyrics-body {
    padding: 8px 14px calc(10px + env(safe-area-inset-bottom));
  }

  .lyrics-line {
    font-size: 18px;
    padding: 8px 10px;
  }

  .lyrics-line-wrap.editing {
    grid-template-columns: 42px minmax(0, 1fr) 24px;
    gap: 4px;
  }

  .lyrics-adjust-btn {
    width: 16px;
    height: 13px;
  }

  .lyrics-adjust-value {
    min-width: 34px;
    font-size: 9px;
  }

  .lyrics-delete-btn {
    width: 20px;
    height: 20px;
    font-size: 14px;
  }

  .toast {
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .toast-item {
    min-width: 0;
    max-width: none;
  }

  #shortcutsPanel {
    display: none;
  }

  .admin-users-shell {
    margin: 10px auto;
    padding: 0 10px 14px;
  }

  .admin-users-head {
    padding: 12px;
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-auth-row {
    grid-template-columns: 1fr;
  }

  .admin-users-toolbar {
    grid-template-columns: 1fr;
  }

  .admin-toolbar-filters {
    grid-template-columns: 1fr;
  }

  .admin-users-actions {
    justify-content: flex-end;
  }

  .admin-users-metrics,
  .admin-global-grid {
    grid-template-columns: 1fr 1fr;
  }

  .admin-global-grid {
    grid-template-columns: 1fr;
  }

  .admin-create-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .sub {
    display: none;
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
  }

  .toolbar.favhist-mode {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  }

  .toolbar.admin-mode {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  }

  .toolbar.playlist-mode {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  }

  #clear {
    font-size: 11px;
    padding-inline: 6px;
  }

  select,
  #artistSearch,
  #sortPicker {
    min-height: 40px;
    font-size: 12px;
    padding-left: 9px;
  }

  select {
    padding-right: 30px;
    background-position:
      calc(100% - 14px) calc(50% - 3px),
      calc(100% - 9px) calc(50% - 3px);
  }

  .btn {
    min-height: 40px;
  }

  .user-chip {
    max-width: 92px;
    font-size: 12px;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }
}
