:root {
  color-scheme: dark;
  --bg: #06111d;
  --bg-soft: #0b1728;
  --panel: rgba(10, 20, 33, 0.92);
  --border: rgba(146, 172, 206, 0.16);
  --text: #e9f1ff;
  --muted: #99a9c3;
  --accent: #67d7ff;
  --accent-2: #90ffcf;
  --danger: #ff7f93;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.32);
  --radius: 22px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(103, 215, 255, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(144, 255, 207, 0.10), transparent 30%),
    linear-gradient(180deg, var(--bg), #03070d 100%);
  color: var(--text);
}

button, input { font: inherit; }
button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease, border-color 120ms ease;
}
button:hover { transform: translateY(-1px); }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.card {
  background: linear-gradient(180deg, rgba(15, 25, 41, 0.96), rgba(7, 14, 25, 0.95));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 26px;
  margin-bottom: 18px;
}
.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  color: var(--accent);
}
.hero h1, .panel h2 {
  margin: 0;
  line-height: 1.08;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 4rem); max-width: 11ch; }
.lede {
  margin: 14px 0 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.05rem;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.transport-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; justify-content: space-between; }
.transport-group { display: flex; gap: 12px; flex-wrap: wrap; }
.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04111b;
  font-weight: 800;
  padding: 14px 18px;
}
.secondary, .ghost {
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 13px 17px;
}
.danger {
  color: #ff6b6b;
  border-color: rgba(255,107,107,0.3);
  background: rgba(255,107,107,0.08);
  padding: 13px 17px;
}
.danger:hover:not(:disabled) { background: rgba(255,107,107,0.16); }
.danger:disabled { opacity: 0.4; }
.ghost { padding: 10px 14px; }
.transport-btn.active { color: var(--accent); border-color: rgba(103, 215, 255, 0.35); background: rgba(103, 215, 255, 0.10); }
.grid {
  display: grid;
  gap: 18px;
}
.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}
.panel { padding: 22px; min-height: 100%; }
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  margin-bottom: 16px;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(103, 215, 255, 0.25);
  background: rgba(103, 215, 255, 0.08);
  color: var(--accent);
  font-size: 0.9rem;
}
.badge[data-tone="idle"] {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}
.badge[data-tone="live"] {
  color: var(--accent-2);
  background: rgba(144, 255, 207, 0.10);
  border-color: rgba(144, 255, 207, 0.24);
}
.badge[data-tone="warn"] {
  color: #ffd891;
  background: rgba(255, 216, 145, 0.10);
  border-color: rgba(255, 216, 145, 0.24);
}
.status-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: end;
}
.status-badges .badge {
  min-width: auto;
}
.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.tag-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.tag-bar.hidden {
  display: none;
}
.tag-chip {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  padding: 9px 13px;
  font-size: 0.88rem;
}
.tag-chip.active {
  color: #04111b;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}
.preset-card {
  position: relative;
  width: 100%;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  color: var(--text);
  padding: 16px 56px 16px 16px;
  text-align: left;
  border-radius: 18px;
  cursor: pointer;
  display: grid;
  gap: 8px;
  align-items: start;
}
.preset-card:focus-visible {
  outline: 2px solid rgba(103, 215, 255, 0.85);
  outline-offset: 2px;
}
.preset-card.active {
  border-color: rgba(103, 215, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(103, 215, 255, 0.1) inset;
  background: linear-gradient(180deg, rgba(103, 215, 255, 0.16), rgba(255,255,255,0.03));
}
.favorite-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: #d9e6f7;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}
.favorite-btn.favorited {
  color: #fff4bd;
  background: rgba(255, 215, 80, 0.18);
  border-color: rgba(255, 215, 80, 0.35);
}
.preset-name { display: block; font-weight: 800; margin-bottom: 8px; }
.preset-desc, .preset-meta { display: block; color: var(--muted); font-size: 0.93rem; line-height: 1.45; }
.preset-meta { margin-top: 8px; color: #b3c7e7; }
.session-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.session-summary > div {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}
.label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}
.session-summary strong { font-size: 1.2rem; }

/* ── Personal stats panel ── */
.stats-panel { display: flex; flex-direction: column; gap: 10px; }
#statsContent { display: flex; flex-direction: column; gap: 10px; }
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}
.stat-label {
  color: var(--muted);
  font-size: 0.88rem;
  flex: 1;
  min-width: 0;
}
.stat-value {
  font-size: 1.05rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.stat-note { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }
.mini-meta {
  display: block;
  margin-top: 8px;
  color: #b3c7e7;
  font-size: 0.88rem;
  line-height: 1.4;
}
.controls {
  display: grid;
  gap: 14px;
}
.controls label {
  display: grid;
  gap: 8px;
  color: var(--text);
}
.controls span { color: var(--muted); font-size: 0.95rem; }
input[type="range"] { width: 100%; }
input[type="text"] {
  width: 100%;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
}
input[type="text"]::placeholder { color: #7890b2; }
output { color: #cfeaff; font-weight: 700; }
.hint {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.auto-start-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(103, 215, 255, 0.12);
  border: 1px solid rgba(103, 215, 255, 0.22);
  color: var(--accent);
  margin: 0 0 10px;
}

.auto-start-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(103, 215, 255, 0.6);
  animation: auto-start-pulse 2s ease-in-out infinite;
}

@keyframes auto-start-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.feature-list, .history-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.feature-list li {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: #d6e2f6;
}
.feature-list li:last-child { border-bottom: 0; }
.history-list { display: grid; gap: 10px; }
.history-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
}
.history-item strong { font-size: 1rem; }
.history-item span { color: var(--muted); font-size: 0.92rem; }
.empty-state {
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,0.16);
  color: var(--muted);
}
.footer {
  padding: 6px 2px 0;
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.footer a {
  color: var(--accent);
  text-decoration: none;
}
.footer a:hover { text-decoration: underline; }

.admin-shell .hero {
  align-items: flex-start;
}
.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.admin-nav {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  margin-top: 6px;
  border-radius: 16px;
  border: 1px solid rgba(103, 215, 255, 0.14);
  background: rgba(7, 17, 31, 0.82);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}
.admin-nav.admin-nav--compact {
  gap: 8px;
  padding: 8px 10px;
  border-color: rgba(103, 215, 255, 0.22);
  background: rgba(7, 17, 31, 0.92);
  flex-wrap: nowrap;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.admin-nav.admin-nav--compact::-webkit-scrollbar {
  display: none;
}
.admin-nav.admin-nav--compact .admin-nav-label {
  display: none;
}
.admin-nav.admin-nav--compact .admin-nav-link {
  flex: 0 0 auto;
  padding: 8px 12px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}
.admin-nav.admin-nav--compact .admin-nav-link.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04111b;
  border-color: transparent;
  box-shadow: 0 0 0 1px rgba(103, 215, 255, 0.12) inset;
}
.admin-nav-label {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.admin-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(103, 215, 255, 0.22);
  background: rgba(103, 215, 255, 0.08);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
}
.admin-nav-link:hover {
  background: rgba(103, 215, 255, 0.16);
  border-color: rgba(103, 215, 255, 0.4);
}
.admin-nav-link:focus-visible {
  outline: 2px solid rgba(103, 215, 255, 0.9);
  outline-offset: 2px;
}
.admin-nav-link.active {
  position: relative;
  background: rgba(103, 215, 255, 0.2);
  border-color: rgba(103, 215, 255, 0.55);
  color: var(--accent);
}
.admin-nav-link.active::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 6px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.admin-nav.admin-nav--compact .admin-nav-link.active::after {
  left: 10px;
  right: 10px;
  bottom: 5px;
}
#users, #add, #remove {
  scroll-margin-top: 110px;
}
.admin-panel {
  margin-top: 18px;
}
.admin-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.admin-summary > div {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.audience-card {
  margin-top: 18px;
}

.audience-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.audience-chart-card {
  padding: 16px;
}

.audience-chart-list {
  display: grid;
  gap: 10px;
}

.audience-chart-row {
  display: grid;
  grid-template-columns: minmax(0, 120px) 1fr auto;
  gap: 10px;
  align-items: center;
}

.audience-chart-label,
.audience-chart-value {
  color: var(--text);
  font-size: 0.9rem;
}

.audience-chart-value {
  color: var(--muted);
  min-width: 28px;
  text-align: right;
}

.audience-chart-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}

.audience-chart-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(103,215,255,0.8), rgba(144,255,207,0.9));
}

.audience-chart-empty {
  padding: 12px 14px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 14px;
}

.audience-section + .audience-section {
  margin-top: 18px;
}

.admin-audience-list {
  display: grid;
  gap: 12px;
}

.audience-user-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  display: grid;
  gap: 8px;
}

.audience-user-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.audience-user-name {
  font-weight: 700;
  color: var(--text);
}

.audience-user-meta,
.audience-user-submeta {
  color: var(--muted);
  font-size: 0.88rem;
}

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

.audience-metric {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}

.audience-metric .label {
  display: block;
  margin-bottom: 4px;
}

.audience-empty {
  padding: 12px 14px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 14px;
}
.admin-list {
  display: grid;
  gap: 12px;
}
.admin-track {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}
.admin-track-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}
.admin-track-title {
  margin: 0;
  font-size: 1.05rem;
}
.admin-track-meta,
.admin-track-desc,
.admin-track-source,
.admin-track-queue {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  word-break: break-word;
}
.admin-track-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: end;
}
.admin-track-status {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  border: 1px solid transparent;
}
.admin-track-status.ok {
  color: #95ffbf;
  background: rgba(149, 255, 191, 0.10);
  border-color: rgba(149, 255, 191, 0.18);
}
.admin-track-status.warn {
  color: #ffd891;
  background: rgba(255, 216, 145, 0.10);
  border-color: rgba(255, 216, 145, 0.20);
}
.admin-track-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-track-tags .tag-chip {
  padding: 7px 10px;
}
.admin-track-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.danger-btn {
  background: rgba(255, 127, 147, 0.12);
  color: #ffd7dd;
  border: 1px solid rgba(255, 127, 147, 0.28);
  padding: 10px 14px;
}
.danger-btn:hover {
  background: rgba(255, 127, 147, 0.18);
}
.danger-btn:disabled {
  opacity: 0.5;
}

@media (max-width: 900px) {
  .hero { flex-direction: column; align-items: stretch; }
  .two-up { grid-template-columns: 1fr; }
  .preset-grid { grid-template-columns: 1fr; }
  .session-summary { grid-template-columns: 1fr; }
  .admin-summary { grid-template-columns: 1fr; }
  .admin-track-head { flex-direction: column; }
  .admin-track-actions { justify-content: start; }
}

/* ── Auth bar ─────────────────────────────────────────────────────────────── */

.auth-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

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

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-size: 13px;
  color: var(--muted);
}

.auth-login-btn,
.auth-logout-btn {
  font-size: 13px;
  padding: 6px 14px;
}

.admin-user-name {
  font-size: 13px;
  color: var(--muted);
}

/* ── Now-playing indicator on active preset card ─────────────────────────── */

.now-playing-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(103, 215, 255, 0.18);
  border: 1px solid rgba(103, 215, 255, 0.35);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 6px;
}
.now-playing-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(103, 215, 255, 0.7);
  animation: now-playing-pulse 1.4s ease-in-out infinite;
}
@keyframes now-playing-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* ── Rating modal ──────────────────────────────────────────────────────────── */

.rating-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 150ms ease;
}

.rating-modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow);
  animation: slideUp 200ms ease;
}

.rating-modal h3 {
  margin: 0 0 20px;
  font-size: 18px;
  text-align: center;
}

.rating-stars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.star-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 18px;
  letter-spacing: 4px;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: background 120ms, border-color 120ms, color 120ms;
}

.star-btn:hover {
  background: rgba(103, 215, 255, 0.08);
  border-color: rgba(103, 215, 255, 0.3);
  color: var(--accent);
}

.star-btn.selected {
  background: rgba(103, 215, 255, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

.rating-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.rating-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 8px;
}

/* ── Admin library list ───────────────────────────────────────────────────── */

.admin-library-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 120ms;
}

.admin-library-row:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border);
}

.admin-library-row input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.admin-lib-title {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-lib-meta {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
  flex-shrink: 0;
}

.admin-lib-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 127, 147, 0.12);
  color: var(--danger);
  border: 1px solid rgba(255, 127, 147, 0.2);
  flex-shrink: 0;
  margin-left: 8px;
}

.admin-batch-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 14px;
  flex-wrap: wrap;
}

/* ── Audit log ─────────────────────────────────────────────────────────────── */

.audit-log-panel {
  margin-top: 16px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.audit-log-panel h4 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
}

.audit-log-list {
  max-height: 300px;
  overflow-y: auto;
}

.audit-entry {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid rgba(146, 172, 206, 0.06);
  font-size: 12px;
  flex-wrap: wrap;
}

.audit-action {
  font-weight: 600;
  color: var(--accent);
  min-width: 120px;
}

.audit-user {
  color: var(--muted);
  min-width: 140px;
}

.audit-ts {
  color: var(--muted);
  font-size: 11px;
  margin-left: auto;
}

.audit-details {
  width: 100%;
  color: var(--muted);
  font-size: 11px;
  word-break: break-all;
}

/* ── Add track form ────────────────────────────────────────────────────────── */

.add-track-form .add-track-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.add-track-form label {
  display: grid;
  gap: 6px;
  color: var(--text);
}

.add-track-form label > span {
  color: var(--muted);
  font-size: 0.88rem;
}

.add-track-form input[type="text"],
.add-track-form input[type="url"],
.add-track-form input[type="number"],
.add-track-form input[type="file"],
.add-track-form textarea,
.add-track-form select {
  width: 100%;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.93rem;
}

.add-track-form input[type="file"] {
  padding: 8px;
}

.add-track-form input[type="checkbox"] {
  accent-color: var(--accent);
}

.add-track-form .atag-selector {
  display: grid;
  gap: 8px;
}

.add-track-form .atag-selector > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.add-track-form .atag-selector label {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  transition: border-color 120ms, background 120ms;
}

.add-track-form .atag-selector label:hover {
  border-color: rgba(103, 215, 255, 0.4);
  background: rgba(103, 215, 255, 0.06);
}

.add-track-form .atag-selector label:has(input:checked) {
  border-color: rgba(103, 215, 255, 0.5);
  background: rgba(103, 215, 255, 0.10);
  color: var(--accent);
}

@media (max-width: 900px) {
  .add-track-form .add-track-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .admin-page {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
  .admin-page .admin-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    top: auto;
    margin-top: 0;
    padding: 8px 10px;
    justify-content: center;
    border-radius: 18px;
  }
  .admin-page .admin-nav.admin-nav--compact {
    justify-content: flex-start;
  }
  .admin-page .admin-nav-label {
    display: none;
  }
  .admin-page .admin-nav-link {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 8px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
  }
  .admin-page .admin-nav.admin-nav--compact .admin-nav-link {
    flex: 0 0 auto;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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