@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=Raleway:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   Audious Mono Yellow — clean rebuild from Audious default
   Same clean architecture as Audious default; Mono Yellow visual identity only.
   ============================================================ */

:root {
  --audious-css-build: "20260824-mono-yellow-rebuild-v1";
  --bg: #0a0a0a;
  --bg-deep: #080808;
  --surface: #181818;
  --surface-2: #151515;
  --surface-3: #202020;
  --surface-soft: rgba(18, 18, 18, 0.88);

  --text: #f5f5f5;
  --muted: rgba(245, 245, 245, 0.64);
  --muted2: rgba(245, 245, 245, 0.40);

  --accent: #ffd84d;
  --accent-strong: #e4b91f;
  --accent-soft: rgba(255, 216, 77, 0.12);
  --accent-soft-2: rgba(255, 216, 77, 0.20);
  --accent-pale: #ffd84d;

  --good: #78c79b;
  --warn: #d6a84a;
  --bad: #d46d65;

  --line: rgba(255, 255, 255, 0.09);
  --line2: rgba(255, 255, 255, 0.17);
  --line3: rgba(255, 255, 255, 0.28);

  --shadow: 0 18px 60px rgba(0, 0, 0, 0.72);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.42);
  --glow: 0 0 0 1px rgba(255, 216, 77, 0.15);
  --glow-strong: 0 0 0 1px rgba(255, 216, 77, 0.30), 0 0 24px rgba(255, 216, 77, 0.08);

  --radius: 6px;
  --radius-sm: 4px;
  --footer-h: 92px;
  --side-pad: clamp(14px, 2.8vw, 40px);

  --mono: 'IBM Plex Mono', ui-monospace, "SF Mono", Menlo, Monaco, monospace;
  --sans: 'Raleway', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --fast: 150ms ease;
  --normal: 220ms ease;

  /* Compatibility for the small amount of inline markup still in JS. */
  --panel: var(--surface);
  --panel2: var(--surface-2);
  --panel-solid: var(--surface);
  --bg0: var(--bg);
  --bg-secondary: var(--surface);
  --border: var(--line2);
}

/* ============================================================
   Base
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background:
    #0a0a0a;
  background-attachment: fixed;
  font-family: var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url('/assets/images/bg-waves.svg') center / cover no-repeat;
  opacity: 0.42;
  mix-blend-mode: normal;
  filter: grayscale(1);
}

body > * {
  position: relative;
  z-index: 1;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
[role="button"] {
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[role="button"]:focus-visible,
[role="link"]:focus-visible {
  outline: 2px solid var(--accent-pale);
  outline-offset: 2px;
}

.hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 50%;
  z-index: 10000;
  transform: translateX(-50%);
  padding: 9px 14px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line2);
  border-radius: 9px;
  font-family: var(--mono);
  font-size: 11px;
  text-decoration: none;
}

.skip-link:focus {
  top: 10px;
}

.fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.fx::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.010) 0 1px, transparent 1px 4px), repeating-linear-gradient(to right, rgba(255, 216, 77, 0.006) 0 1px, transparent 1px 40px);
  opacity: 0.34;
  mix-blend-mode: normal;
}

.app {
  min-height: 100vh;
  padding-bottom: calc(var(--footer-h) + 22px);
}

a {
  color: inherit;
}

/* ============================================================
   Topbar
   ============================================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  min-height: 68px;
  background:
    rgba(24, 24, 24, 0.98);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid #303030;
}

.topbar-inner {
  width: 100%;
  max-width: 1440px;
  min-height: 68px;
  margin-inline: auto;
  padding: 9px var(--side-pad) 7px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 10px;
}

.brand {
  order: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 34px;
  margin-right: auto;
  color: var(--text);
  text-decoration: none;
}

.logo {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  border: 1px solid var(--line2);
  border-radius: 4px;
  background:
    linear-gradient(to top, #111111, #343434) calc(50% - 6px) calc(100% - 5px) / 3px 9px no-repeat, linear-gradient(to top, #111111, #343434) 50% calc(100% - 5px) / 3px 16px no-repeat, linear-gradient(to top, #111111, #343434) calc(50% + 6px) calc(100% - 5px) / 3px 6px no-repeat, linear-gradient(145deg, #ffe66d, #e4b91f);
  box-shadow: 0 0 0 1px rgba(255, 216, 77, 0.08), 0 0 18px rgba(255, 216, 77, 0.08);
  border-color: rgba(255, 216, 77, 0.72);
}

.logo-custom {
  display: block;
  width: auto;
  height: 30px;
  max-width: 140px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(255, 216, 77, 0.16));
}

.brand-text {
  min-width: 0;
}

.brand .title {
  margin: 0;
  font: 800 14px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand .highlight {
  color: #ffffff;
  text-shadow: 0 0 14px rgba(255, 216, 77, 0.20);
}

.nav-wrap {
  order: 2;
  display: flex;
  align-items: center;
  margin-left: auto;
}

nav.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px;
  background: #151515;
  border: 1px solid #303030;
  border-radius: 4px;
}

nav.nav a,
.nav-logout,
.lang-btn {
  min-height: 32px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(245, 245, 245, 0.58);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.055em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--fast), background var(--fast), border-color var(--fast), text-shadow var(--fast);
}

nav.nav a {
  position: relative;
  overflow: visible;
}

nav.nav a:hover,
nav.nav a:focus-visible {
  color: #ffffff;
  background: #242424;
  border-color: #303030;
}

nav.nav a.active,
nav.nav a[aria-current="page"] {
  color: #111111;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
  font-weight: 700;
  text-shadow: none;
}

.nav-logout {
  color: rgba(245, 245, 245, 0.52);
}

.nav-logout:hover,
.nav-logout:focus-visible {
  color: #ffffff;
  background: #242424;
  border-color: #303030;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.lang-btn {
  min-width: 30px;
  padding-inline: 7px;
}

.lang-btn.active {
  color: #111111;
  background: var(--accent);
  border-color: var(--accent);
}

.burger {
  display: none;
  width: 34px;
  height: 34px;
  padding: 0;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}

.burger:hover,
.burger:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.burger-icon {
  width: 15px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.burger-icon span {
  display: block;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--fast), opacity var(--fast);
}

.burger[aria-expanded="true"] .burger-icon span:nth-child(1) {
  transform: rotate(45deg) translate(3px, 3px);
}

.burger[aria-expanded="true"] .burger-icon span:nth-child(2) {
  opacity: 0;
}

.burger[aria-expanded="true"] .burger-icon span:nth-child(3) {
  transform: rotate(-45deg) translate(3px, -3px);
}

/* Search occupies its own row. */
form.search {
  order: 5;
  flex: 1 0 100%;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  overflow: hidden;
  color: var(--text);
  background:
    #111111;
  border: 1px solid #303030;
  border-radius: 4px;
  box-shadow: none;
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}

form.search:hover,
form.search:focus-within {
  border-color: #555555;
  box-shadow: 0 0 0 1px rgba(255, 216, 77, 0.10);
  background: #151515;
}

.search-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--accent);
}

form.search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.02em;
}

form.search input::placeholder {
  color: var(--muted);
}

/* ============================================================
   Header messages / notifications
   ============================================================ */

.msg-wrap,
.notif-wrap {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.msg-wrap {
  order: 3;
}

.notif-wrap {
  order: 4;
}

.msg-button,
.notif-bell-btn,
.msg-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: color var(--fast), background var(--fast), border-color var(--fast);
}

.msg-button:hover,
.msg-button:focus-visible,
.notif-bell-btn:hover,
.notif-bell-btn:focus-visible,
.msg-icon-btn:hover,
.msg-icon-btn:focus-visible {
  color: var(--text);
  background: #242424;
  border-color: #333333;
}

.msg-badge,
.notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  color: #111111;
  background: var(--accent);
  border: 1px solid var(--bg);
  border-radius: 999px;
  font: 700 8px/1 var(--mono);
  border-color: #181818;
}

.notif-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  width: min(430px, 100vw);
  display: flex;
  flex-direction: column;
  color: var(--text);
  background:
    #151515;
  border-left: 1px solid #303030;
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.58);
  transform: translateX(102%);
  visibility: hidden;
  transition: transform 180ms ease, visibility 180ms step-end;
}

.notif-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 180ms ease;
}

.notif-drawer-head {
  min-height: 62px;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  background: #181818;
  border-bottom: 1px solid #303030;
}

.notif-drawer-head > strong {
  min-width: 0;
  flex: 1;
  font: 700 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notif-drawer-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.notif-readall {
  min-height: 32px;
  padding: 0 8px;
  color: var(--accent-pale);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font: 500 10px/1 var(--mono);
  cursor: pointer;
}

.notif-readall:hover,
.notif-readall:focus-visible {
  color: #fff;
  background: var(--accent-soft);
  border-color: var(--line);
}

.notif-list {
  min-height: 0;
  flex: 1 1 auto;
  list-style: none;
  margin: 0;
  padding: 4px 0 calc(12px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.notif-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

.notif-item:hover {
  background: #202020;
}

.notif-item.is-unread {
  background: rgba(255, 216, 77, 0.065);
}

.notif-avatar,
.notif-avatar-ph,
.notif-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.notif-avatar {
  border-radius: 50%;
}

.notif-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.notif-text {
  display: block;
  margin: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.notif-item time {
  flex: 0 0 auto;
  color: var(--muted2);
  font: 500 9px/1 var(--mono);
  white-space: nowrap;
}

.notif-song,
.notif-share-message,
.notif-share-timecode {
  margin-top: 3px;
  color: var(--muted2);
  font: 9px/1.4 var(--mono);
}

.notif-empty,
.notif-loading {
  padding: 24px 14px;
  color: var(--muted2);
  text-align: center;
  font-size: 11px;
}

/* ============================================================
   Tags
   ============================================================ */

.tags-inline {
  order: 6;
  flex: 1 0 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tags-scroll {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0 3px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.tags-scroll::-webkit-scrollbar {
  display: none;
}

.tag-pill {
  height: 30px;
  padding: 0 12px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(245, 245, 245, 0.68);
  background: #151515;
  border: 1px solid #303030;
  border-radius: 3px;
  font: 600 11px/1 var(--sans);
  letter-spacing: 0.015em;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--fast), background var(--fast), border-color var(--fast);
}

.tag-pill:hover,
.tag-pill:focus-visible {
  color: #ffffff;
  background: #242424;
  border-color: #555555;
}

.tag-pill.active,
.tag-pill[aria-pressed="true"] {
  color: #111111;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
}

.tag-pill .count {
  min-width: 18px;
  height: 16px;
  padding-left: 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-left: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 2px;
  font: 600 9px/1 var(--mono);
  padding: 0 5px;
}

.tag-controls {
  flex: 0 0 auto;
  display: flex;
  gap: 3px;
  padding-left: 7px;
  border-left: 1px solid var(--line);
}

.active-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 5px var(--side-pad) 0;
}

.active-tags:empty {
  display: none;
}

.active-tags .chip {
  padding: 6px 9px 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  background: #111111;
  border: 1px solid var(--accent);
  border-radius: 3px;
  box-shadow: none;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.active-tags .chip::after {
  content: "×";
  color: var(--muted);
}

/* ============================================================
   Main layout / shared surfaces
   ============================================================ */

main {
  width: 100%;
  max-width: 1440px;
  margin: 14px auto 0;
  padding: 0 20px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel {
  position: relative;
  width: 100%;
  overflow: hidden;
  background:
    #151515;
  border: 1px solid #262626;
  border-radius: 4px;
  box-shadow: none;
}

.empty {
  padding: 20px;
  color: var(--muted);
  background: #151515;
  border: 1px dashed #333333;
  border-radius: 4px;
  font: 12px/1.5 var(--mono);
  text-align: center;
}

.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  color: var(--muted);
  font: 11px/1 var(--mono);
}

.dot {
  width: 6px;
  height: 6px;
  background: var(--accent-pale);
  border-radius: 50%;
  animation: pulse 1s ease-in-out infinite;
}

.dot:nth-child(2) {
  animation-delay: 120ms;
}

.dot:nth-child(3) {
  animation-delay: 240ms;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn,
.btn-back,
.create-playlist-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: transparent;
  border: 1px solid #414141;
  cursor: pointer;
  transition: transform var(--fast), color var(--fast), background var(--fast), border-color var(--fast), box-shadow var(--fast);
}

.btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 4px;
  font: 600 13px/1 var(--mono);
}

.btn:hover,
.btn:focus-visible,
.btn-back:hover,
.btn-back:focus-visible {
  color: #ffffff;
  background: #292929;
  border-color: #666666;
  box-shadow: none;
}

.btn:active,
.btn-back:active {
  transform: scale(0.96);
}

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

.btn.primary,
.btn.is-on {
  color: #111111;
  background: var(--accent);
  border-color: var(--accent);
}

.btn.tiny {
  width: 27px;
  height: 27px;
  border-radius: 3px;
  font-size: 11px;
}

.btn.song-like {
  width: auto;
  min-width: 46px;
  padding: 0 9px;
  gap: 5px;
}

.btn.song-like strong {
  min-width: 12px;
  font: 700 10px/1 var(--mono);
}

/* Final song-card icon sizing from the legacy override cascade. */
.actions .btn.primary > span {
  font-size: 16px;
  line-height: 1;
}

/* Optical alignment: the Play glyph sits lower than Like.
   Apply only while stopped so the Pause glyph stays centered. */
.song:not(.is-playing) .actions .btn.primary > span {
  transform: translateY(-2px);
}

.actions .btn.song-like > span {
  font-size: 15px;
  line-height: 1;
}

/* Pause is visually heavier than Play. */
.song.is-playing .actions .btn.primary > span {
  font-size: 13px;
  line-height: 1;
}

.btn-back {
  width: auto;
  min-height: 28px;
  padding: 0 9px;
  gap: 5px;
  border-radius: 3px;
  color: var(--muted);
  font: 600 10px/1 var(--mono);
  text-transform: uppercase;
}

/* ============================================================
   Song cards
   ============================================================ */

.song {
  position: relative;
  min-width: 0;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  background: #181818;
  border: 1px solid #242424;
  border-radius: 4px;
  box-shadow: none;
  transition: border-color var(--fast), background var(--fast), box-shadow var(--fast);
}

.song:hover {
  border-color: #333333;
  background: #202020;
}

.song.is-playing {
  background:
    #1d1d1d;
  border-color: #4a4a4a;
  box-shadow: none;
  border-left: 3px solid var(--accent);
}

.song.is-playing .art {
  border-color: var(--accent);
  box-shadow: none;
}

.song--pinned {
  margin-bottom: 8px;
}

.song-pinned-label,
.song-playing-label {
  position: absolute;
  top: 5px;
  left: 6px;
  z-index: 2;
  padding: 2px 5px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.48);
  border-radius: 5px;
  font: 600 8px/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.art {
  width: 88px;
  height: 88px;
  flex: 0 0 auto;
  overflow: hidden;
  background: #151515;
  border: 1px solid #343434;
  border-radius: 3px;
  box-shadow: none;
}

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

.meta {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.meta .title {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song.is-playing .meta .title {
  color: var(--accent);
  text-shadow: none;
}

.meta .line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.meta .artist,
.meta .album,
.meta .dur,
.meta .user-link {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font: 500 10px/1.3 var(--mono);
  letter-spacing: 0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta .artist-link,
.meta .user-link {
  color: var(--accent);
  cursor: pointer;
}

.song-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.song-tag {
  min-height: 20px;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  color: rgba(245, 245, 245, 0.72);
  background: #242424;
  border: 1px solid #383838;
  border-radius: 3px;
  font: 500 9px/1.2 var(--mono);
}

.song-tag--more {
  opacity: 0.70;
}

.actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Song-card controls: compact outlines, readable icons. */
.actions .btn {
  width: 33px;
  height: 33px;
  border-radius: 4px;
  background: transparent;
  border-color: #414141;
}

.actions .btn.song-like {
  min-width: 41px;
  padding-inline: 7px;
  gap: 4px;
}

/* The overflow menu does not need the same visual weight as Play / Like. */
.actions .song-actions-btn {
  width: 28px;
  height: 28px;
  border-radius: 3px;
  font-size: 9px;
  letter-spacing: 0.5px;
}

/* Floating song / playlist menus */
#song-actions-menu,
#pl-actions-menu {
  position: fixed;
  z-index: 9000;
  width: min(218px, calc(100vw - 16px));
  margin: 0;
  padding: 6px;
  overflow: hidden;
  color: var(--text);
  background: #181818;
  border: 1px solid #383838;
  border-radius: 4px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.68);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#song-actions-menu,
#pl-actions-menu {
  animation: song-actions-menu-in 0.14s ease-out both;
}

.song-actions-menu-item,
#pl-actions-menu li {
  width: 100%;
  min-height: 38px;
  padding: 4px 8px;
  align-items: center;
  color: rgba(245, 245, 245, 0.88);
  background: transparent;
  border: 0;
  border-radius: 3px;
  text-align: left;
  cursor: pointer;
}

/* Track actions have an icon column and deliberately compact typography. */
.song-actions-menu-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  font: 600 11.5px/1.2 var(--sans);
  letter-spacing: 0.01em;
  -webkit-appearance: none;
  appearance: none;
}

/* Playlist actions currently contain a single text span, no icon column. */
#pl-actions-menu li {
  display: flex;
  font: 600 11.5px/1.2 var(--sans);
  letter-spacing: 0.01em;
}

.song-actions-menu-item:hover,
.song-actions-menu-item:focus-visible,
#pl-actions-menu li:hover,
#pl-actions-menu li:focus-visible {
  color: #fff;
  background: #292929;
}

.song-actions-menu-icon {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  color: var(--accent);
  background: #202020;
  border: 1px solid #383838;
  border-radius: 3px;
  font: 600 11px/1 var(--mono);
}

.song-actions-menu-label,
#pl-actions-menu li > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-actions-menu-item.is-danger,
#pl-actions-menu li.is-danger,
#pl-actions-menu li[data-action="delete"] {
  color: #f5b0b0;
}

/* ============================================================
   Album / artist / playlist grids
   ============================================================ */

#albums-panel,
#artists-panel,
#playlists-panel {
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.albums-grid,
.playlists-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 10px;
  padding: 2px 0 22px;
}

.album-card,
.artist-card,
.playlist-card {
  position: relative;
  min-width: 0;
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--text);
  background: #181818;
  border: 1px solid #262626;
  border-radius: 4px;
  cursor: pointer;
  transition: transform var(--fast), border-color var(--fast), background var(--fast), box-shadow var(--fast);
  box-shadow: none;
}

.album-card:hover,
.album-card:focus-visible,
.artist-card:hover,
.artist-card:focus-visible,
.playlist-card:hover,
.playlist-card:focus-visible {
  transform: translateY(-1px);
  border-color: #444444;
  box-shadow: none;
  background: #1d1d1d;
}

.album-cover,
.artist-cover,
.playlist-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #151515;
  border: 1px solid #303030;
  border-radius: 3px;
}

.album-cover img,
.artist-cover img,
.playlist-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.artist-cover {
  border-radius: 50%;
}

.album-cover-overlay,
.artist-cover-overlay,
.playlist-cover-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  background: rgba(10, 10, 10, 0.50);
  transition: opacity var(--fast);
}

.album-card:hover .album-cover-overlay,
.album-card:focus-visible .album-cover-overlay,
.artist-card:hover .artist-cover-overlay,
.artist-card:focus-visible .artist-cover-overlay,
.playlist-card:hover .playlist-cover-overlay,
.playlist-card:focus-visible .playlist-cover-overlay {
  opacity: 1;
}

.album-cover-overlay-icon,
.artist-cover-overlay-icon,
.playlist-cover-overlay-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #111111;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 50%;
  box-shadow: none;
  font-size: 11px;
}

.album-info,
.artist-info,
.playlist-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.album-name,
.artist-name,
.playlist-name {
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-artist,
.playlist-owner,
.album-track-count,
.artist-track-count,
.playlist-track-count {
  overflow: hidden;
  color: var(--muted2);
  font: 500 9px/1.2 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-artist,
.playlist-owner {
  font-size: 10px;
}

.playlist-owner {
  color: var(--accent);
  text-decoration: none;
}

.playlist-badge {
  width: max-content;
  margin-top: 2px;
  padding: 2px 4px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 4px;
  font: 600 7px/1 var(--mono);
  text-transform: uppercase;
}

.playlist-badge--public {
  color: var(--good);
}

.playlist-badge--private {
  color: var(--warn);
}

.playlist-actions-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  background: rgba(10, 10, 10, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 3px;
}

/* ============================================================
   User / profile
   ============================================================ */

.profile-card {
  width: 100%;
}

.entity-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 2px 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.entity-avatar,
.user-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #151515;
  border: 1px solid #343434;
  box-shadow: none;
}

.entity-avatar {
  width: 56px;
  height: 56px;
  border-radius: 4px;
}

.entity-avatar--round,
.user-avatar {
  border-radius: 50%;
}

.entity-avatar img,
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.default-avatar {
  --avatar-a: #eeeeee;
  --avatar-b: #555555;
  color: #fff;
  background:
    radial-gradient(circle at 24% 20%, rgba(255, 255, 255, 0.34), transparent 28%),
    linear-gradient(145deg, var(--avatar-a), var(--avatar-b));
}

.default-avatar--v1 { --avatar-a: #f0f0f0; --avatar-b: #555555; }
.default-avatar--v2 { --avatar-a: #d9d9d9; --avatar-b: #3f3f3f; }
.default-avatar--v3 { --avatar-a: #bdbdbd; --avatar-b: #4a4a4a; }
.default-avatar--v4 { --avatar-a: #e6e6e6; --avatar-b: #666666; }
.default-avatar--v5 { --avatar-a: #cccccc; --avatar-b: #333333; }
.default-avatar--v6 { --avatar-a: #f5f5f5; --avatar-b: #777777; }
.default-avatar--v7 { --avatar-a: #d0d0d0; --avatar-b: #505050; }
.default-avatar--v8 { --avatar-a: #e0e0e0; --avatar-b: #444444; }

.user-initials {
  color: #fff;
  font: 800 17px/1 var(--mono);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.entity-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.entity-name-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.entity-name {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
}

.entity-handle,
.user-handle {
  color: var(--accent);
  font: 500 10px/1.2 var(--mono);
}

.entity-bio,
.user-bio {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.entity-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 2px;
}

.entity-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--muted);
}

.entity-stat[data-scroll] {
  cursor: pointer;
}

.entity-stat-value {
  color: var(--text);
  font: 700 11px/1 var(--mono);
}

.entity-stat-label {
  color: var(--muted2);
  font: 500 10px/1 var(--mono);
}

.entity-stat--highlight .entity-stat-value {
  color: var(--accent);
}

.entity-meta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted2);
  font: 500 9px/1.3 var(--mono);
}

.entity-meta svg {
  width: 12px;
  height: 12px;
}

.entity-follow-btn,
.entity-edit-btn {
  min-height: 27px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  font: 600 10px/1 var(--mono);
  cursor: pointer;
}

.entity-follow-btn {
  color: #111111;
  background: var(--accent);
  border: 1px solid var(--accent);
}

.entity-follow-btn.is-following {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.entity-edit-btn {
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
}

.entity-edit-btn:hover,
.entity-edit-btn:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

.profile-body,
.profile-section {
  width: 100%;
}

.user-section {
  margin-top: 24px;
}

.user-section-title {
  margin: 0 0 10px;
  padding-bottom: 7px;
  color: var(--muted2);
  border-bottom: 1px solid var(--line);
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.user-section-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.playlists-carousel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 10px;
}

.users-discover-section {
  padding: 16px;
  background:
    #151515;
  border: 1px solid #262626;
  border-radius: 4px;
}

.users-discover-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.users-discover-head h2 {
  margin: 0;
  font-size: 16px;
}

.users-discover-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.users-discover-count {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  color: #111111;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  font: 700 10px/1 var(--mono);
}

.users-discover-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.user-card {
  min-width: 0;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #181818;
  border: 1px solid #2c2c2c;
  border-radius: 4px;
  cursor: pointer;
}

.user-card:hover,
.user-card:focus-visible {
  background: #202020;
  border-color: #444444;
}

.user-avatar {
  width: 48px;
  height: 48px;
}

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

.user-name {
  margin: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-context {
  margin: 3px 0 0;
  color: var(--muted2);
  font: 500 9px/1.3 var(--mono);
}

.user-bio {
  margin-top: 5px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.user-action .btn {
  width: auto;
  height: 32px;
  padding: 0 11px;
  color: var(--accent-pale);
  font-size: 10px;
}

/* ============================================================
   Footer player
   ============================================================ */

.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  height: var(--footer-h);
  background:
    rgba(24, 24, 24, 0.98);
  border-top: 1px solid #333333;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.footer-inner {
  height: 100%;
  padding: 10px var(--side-pad);
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-art {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line2);
  border-radius: 3px;
  box-shadow: none;
  border-color: #343434;
}

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

.footer-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.footer-title,
.footer-sub {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.footer-sub {
  color: var(--muted);
  font: 500 10px/1.2 var(--mono);
}

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

.timeline span {
  width: 36px;
  color: var(--muted2);
  font: 500 9px/1 var(--mono);
  text-align: center;
}

.timeline input[type="range"] {
  --p: 0%;
  flex: 1;
  height: 4px;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--p), #444444 var(--p), #444444 100%);
  border-radius: 99px;
  cursor: pointer;
}

.timeline input[type="range"]::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--accent-pale);
  border: 0;
  border-radius: 50%;
  box-shadow: var(--glow);
}

.timeline input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--accent-pale);
  border: 0;
  border-radius: 50%;
  box-shadow: var(--glow);
}

.footer-controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Player controls: compact outlines, matching the song-card hierarchy.
   Keep the squarer Sage geometry; icons remain readable. */
.footer-controls .btn {
  width: 33px;
  height: 33px;
  border-radius: 4px;
}

#footer-play-button {
  width: 38px;
  height: 38px;
  border-radius: 4px;
  color: #111111;
  background: var(--accent);
  border-color: var(--accent);
}

.footer-timeline-mobile {
  display: none;
}

/* ============================================================
   Fullscreen player
   ============================================================ */

.fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  place-items: center;
  overflow: hidden;
  background: rgba(10, 10, 10, 0.97);
}

.fullscreen-overlay[aria-hidden="false"] {
  display: grid;
}

.fullscreen-bg {
  position: absolute;
  inset: -40px;
  opacity: 0.24;
  filter: blur(48px) saturate(0.8);
  background-position: center;
  background-size: cover;
}

.fullscreen-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #181818;
  border: 1px solid #383838;
  border-radius: 4px;
  cursor: pointer;
}

.fullscreen-content {
  position: relative;
  z-index: 1;
  width: min(760px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 24px;
}

.fullscreen-artwork {
  width: min(52vh, 430px);
  aspect-ratio: 1;
  overflow: hidden;
  background: #151515;
  border: 1px solid #343434;
  border-radius: 4px;
  box-shadow: none;
}

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

.fullscreen-info {
  width: 100%;
  text-align: center;
}

.fullscreen-title {
  margin: 0;
  color: #fff;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 800;
}

.fullscreen-artist,
.fullscreen-album {
  margin: 5px 0 0;
  color: var(--muted);
  font: 500 12px/1.3 var(--mono);
}

.fullscreen-progress {
  width: min(620px, 100%);
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 10px;
  color: var(--muted2);
  font: 500 9px/1 var(--mono);
}

.fullscreen-progress-bar {
  position: relative;
  height: 5px;
  overflow: hidden;
  background: rgba(255, 216, 77, 0.18);
  border-radius: 99px;
  cursor: pointer;
}

.fullscreen-progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-pale));
}

.fullscreen-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fs-btn {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--text);
  background: rgba(24, 24, 24, 0.52);
  border: 1px solid var(--line2);
  border-radius: 4px;
  cursor: pointer;
}

.fs-btn:hover,
.fs-btn:focus-visible,
.fs-btn.is-on {
  background: var(--accent-soft);
  border-color: var(--line3);
  box-shadow: var(--glow);
}

.fs-btn--play {
  width: 64px;
  height: 64px;
  color: #111111;
  background: var(--accent);
  border-color: var(--accent);
  border-radius: 4px;
}

/* ============================================================
   Recommendation drawer
   ============================================================ */

.reco-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 980;
  opacity: 0;
  visibility: hidden;
  background: rgba(0, 0, 0, 0.48);
  transition: opacity var(--normal), visibility var(--normal);
}

.reco-drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.reco-drawer {
  position: fixed;
  right: 0;
  bottom: var(--footer-h);
  z-index: 990;
  width: min(430px, 100vw);
  max-height: calc(100vh - var(--footer-h) - 80px);
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: #181818;
  border: 1px solid var(--line2);
  border-right: 0;
  border-radius: 6px;
  box-shadow: -18px 0 54px rgba(0, 0, 0, 0.50);
  transform: translateX(102%);
  transition: transform var(--normal);
  border-color: #383838;
}

.reco-drawer.is-open {
  transform: translateX(0);
}

.reco-drawer-header {
  min-height: 48px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.reco-drawer-title {
  flex: 1;
  font: 700 11px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reco-drawer-close {
  width: 30px;
  height: 30px;
}

.reco-drawer-body {
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
}

.reco-drawer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.reco-card {
  min-width: 0;
  padding: 7px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
}

.reco-card:hover {
  background: var(--accent-soft);
  border-color: var(--line2);
}

.reco-card__art {
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 8px;
}

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

.reco-card__play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.28);
}

.reco-card__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.reco-card__title,
.reco-card__artist {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reco-card__title {
  font-size: 11px;
  font-weight: 700;
}

.reco-card__artist {
  color: var(--muted2);
  font-size: 9px;
}

.reco-drawer-loading,
.reco-drawer-empty {
  grid-column: 1 / -1;
  padding: 24px;
  color: var(--muted2);
  text-align: center;
}

/* ============================================================
   Generic modals
   ============================================================ */

.cp-modal,
.atp-modal,
.up-modal,
.ep-modal,
.sh-modal,
#cm-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow-y: auto;
  background: rgba(2, 4, 10, 0.78);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.cp-modal[hidden],
.atp-modal[hidden],
.up-modal[hidden],
.ep-modal[hidden],
.sh-modal[hidden],
#cm-modal[hidden] {
  display: none;
}

.cp-dialog,
.atp-dialog,
.up-dialog,
.ep-dialog,
.sh-dialog,
.cm-dialog {
  position: relative;
  width: min(500px, 100%);
  max-height: min(88vh, 760px);
  overflow-y: auto;
  padding: 18px;
  color: var(--text);
  background:
    radial-gradient(480px 180px at 50% 0, rgba(255, 216, 77, 0.09), transparent 70%),
    rgba(21, 21, 21, 0.985);
  border: 1px solid var(--line2);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.ep-dialog {
  width: min(560px, 100%);
  background: #181818;
  border-color: #383838;
}

.cp-close,
.atp-close,
.up-close,
.ep-close,
.sh-close,
.cm-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 18px;
  cursor: pointer;
}

.cp-close:hover,
.atp-close:hover,
.up-close:hover,
.ep-close:hover,
.sh-close:hover,
.cm-close:hover {
  color: #fff;
  background: var(--accent-soft);
  border-color: var(--line2);
}

.cp-header,
.atp-header,
.up-header,
.ep-header,
.sh-head,
.cm-head {
  margin-bottom: 16px;
  padding-right: 36px;
}

.cp-header h2,
.atp-header h2,
.up-header h2,
.ep-header h2,
.sh-head h2,
.cm-head h2 {
  margin: 0;
  color: var(--text);
  font: 800 16px/1.2 var(--mono);
  letter-spacing: 0.04em;
}

.cp-sub,
.up-sub,
.ep-sub,
.sh-subtitle,
.cm-subtitle,
.atp-song-info {
  margin: 4px 0 0;
  color: var(--muted2);
  font: 500 10px/1.4 var(--mono);
}

.cp-form,
.up-form,
.ep-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.cp-field,
.ep-field,
.sh-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cp-field label,
.cp-field-label,
.ep-field label,
.ep-image-field > label,
.sh-field > label,
.sh-label-row label {
  color: var(--muted);
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cp-field input,
.cp-field textarea,
.ep-field input,
.ep-field textarea,
#sh-user-search,
#sh-message,
.atp-create-row input,
.msg-search-wrap input,
.msg-composer textarea {
  width: 100%;
  color: var(--text);
  background: rgba(21, 21, 21, 0.72);
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}

.cp-field input,
.ep-field input,
#sh-user-search,
.atp-create-row input,
.msg-search-wrap input {
  height: 40px;
  padding: 0 11px;
}

#sh-user-search {
  font-size: 13px;
}

.cp-field textarea,
.ep-field textarea,
#sh-message,
.msg-composer textarea {
  min-height: 78px;
  padding: 10px 11px;
  resize: vertical;
}

#sh-message {
  font-size: 13px;
  line-height: 1.45;
}

.cp-field input:focus,
.cp-field textarea:focus,
.ep-field input:focus,
.ep-field textarea:focus,
#sh-user-search:focus,
#sh-message:focus,
.atp-create-row input:focus,
.msg-search-wrap input:focus,
.msg-composer textarea:focus {
  border-color: var(--line3);
  box-shadow: 0 0 0 3px rgba(255, 216, 77, 0.10);
}

.cp-actions,
.up-actions,
.ep-actions,
.sh-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.cp-btn,
.up-btn,
.ep-btn,
.sh-copy-link,
.sh-send,
.atp-create-row button {
  min-height: 36px;
  padding: 0 14px;
  color: #fff;
  background: rgba(255, 216, 77, 0.16);
  border: 1px solid var(--line2);
  border-radius: 9px;
  font: 700 10px/1 var(--mono);
  cursor: pointer;
}

.cp-btn.ghost,
.up-btn.ghost,
.ep-btn.ghost,
.sh-copy-link {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}

.cp-msg,
.up-msg,
.ep-msg,
.atp-msg,
.sh-feedback,
.cm-msg {
  min-height: 18px;
  color: var(--muted);
  font-size: 11px;
}

.ok,
.cp-msg .ok,
.up-msg .ok,
.ep-msg .ok,
.atp-msg .ok,
.sh-feedback.is-success {
  color: var(--good);
}

.err,
.cp-msg .err,
.up-msg .err,
.ep-msg .err,
.atp-msg .err,
.sh-feedback.is-error {
  color: var(--bad);
}

/* Create playlist */
.cp-visibility-wrap,
.atp-visibility-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.cp-visibility-toggle,
.atp-visibility-row {
  flex-direction: row;
}

.cp-vis-btn,
.atp-vis-btn {
  min-height: 32px;
  padding: 0 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.02em;
  cursor: pointer;
}

.cp-vis-btn.active,
.atp-vis-btn.active {
  color: #fff;
  background: var(--accent-soft);
  border-color: var(--line2);
}

.cp-visibility-hint,
.ep-hint,
.ep-counter {
  color: var(--muted2);
  font-size: 9px;
}

/* Add to playlist */
.atp-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.atp-create-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.atp-create-row input {
  font: 500 12px/1 var(--sans);
}

.atp-list {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.atp-item {
  min-height: 52px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.atp-item:last-child {
  border-bottom: 0;
}

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

.atp-item-name {
  overflow: hidden;
  display: block;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atp-item-meta,
.atp-item-badge {
  color: var(--muted2);
  font: 500 9px/1.3 var(--mono);
}

.atp-item-btn {
  min-height: 30px;
  padding: 0 9px;
  color: var(--accent-pale);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: 600 10px/1 var(--mono);
  cursor: pointer;
}

.atp-list-loading,
.atp-list-empty {
  padding: 20px;
  color: var(--muted2);
  text-align: center;
  font-size: 11px;
}

/* Upload */
.up-drop {
  min-height: 142px;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  background: rgba(12, 12, 12, 0.52);
  border: 1px dashed var(--line2);
  border-radius: 12px;
  cursor: pointer;
}

.up-drop:hover,
.up-drop.dragging {
  color: var(--text);
  background: var(--accent-soft);
  border-color: var(--line3);
}

.up-file {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.up-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.up-icon {
  width: 30px;
  height: 30px;
  color: var(--accent-pale);
}

.up-link {
  color: var(--accent-pale);
}

.up-hint {
  margin-top: 4px;
  color: var(--muted2);
  font-size: 10px;
}

.up-filechip {
  padding: 9px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 10px;
}

.up-filechip.ok {
  color: var(--good);
}

.up-filechip.bad {
  color: var(--bad);
}

.up-progress {
  position: relative;
  height: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.up-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent-pale));
}

.up-pct {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font: 700 9px/1 var(--mono);
}

/* Edit profile */
.ep-image-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ep-image-preview {
  position: relative;
  overflow: hidden;
  background: rgba(12, 12, 12, 0.58);
  border: 1px dashed var(--line2);
  border-radius: 10px;
  cursor: pointer;
}

.ep-image-preview.avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
}

.ep-image-preview.banner {
  width: 100%;
  height: 118px;
}

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

.ep-image-preview input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.ep-image-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  color: var(--muted2);
  font-size: 9px;
  text-align: center;
}

.ep-separator {
  margin: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted2);
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ep-separator::before,
.ep-separator::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

/* ============================================================
   Share modal
   ============================================================ */

.sh-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.sh-target {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.sh-target-cover,
.sh-result-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.sh-target-cover img,
.sh-result-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sh-target-copy,
.sh-result-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sh-target-copy strong,
.sh-target-copy span,
.sh-result-copy strong,
.sh-result-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sh-target-copy strong {
  font-size: 13px;
}

.sh-result-copy strong {
  font-size: 12px;
}

.sh-target-copy span,
.sh-result-copy span {
  color: var(--muted2);
  font-size: 10px;
}

.sh-label-row,
.sh-selected-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sh-chars {
  color: var(--muted2);
  font: 500 9px/1 var(--mono);
}

.sh-results {
  max-height: 220px;
  margin-top: 6px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.sh-result {
  width: 100%;
  min-height: 56px;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}

.sh-result:last-child {
  border-bottom: 0;
}

.sh-result:hover {
  background: var(--accent-soft);
}

.sh-result-pick {
  color: var(--accent-pale);
  font-size: 16px;
}

.sh-selected {
  margin-top: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 11px;
}

.sh-selected-list {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.sh-selected-chip {
  min-height: 28px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
  background: var(--accent-soft);
  border: 1px solid var(--line2);
  border-radius: 999px;
  font-size: 10px;
  cursor: pointer;
}

.sh-timecode {
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

/* ============================================================
   Comments
   ============================================================ */

.cm-dialog {
  display: flex;
  flex-direction: column;
  background: #181818;
  border-color: #383838;
}

.cm-count {
  color: var(--muted2);
  font-weight: 500;
}

.cm-list {
  min-height: 80px;
  max-height: 380px;
  margin: 10px 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.cm-item {
  padding: 9px 2px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border-bottom: 1px solid var(--line);
}

.cm-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.cm-body {
  min-width: 0;
  flex: 1;
}

.cm-head {
  margin: 0 0 2px;
  padding: 0;
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.cm-user {
  color: var(--text);
  font: 700 11px/1 var(--mono);
}

.cm-date {
  color: var(--muted2);
  font-size: 9px;
}

.cm-content {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.cm-delete {
  padding: 2px 4px;
  color: var(--muted2);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.cm-tc-row,
.cm-composer-foot,
.cm-more-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cm-tc-row {
  margin-bottom: 6px;
  color: var(--muted2);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.cm-tc-row strong {
  color: var(--text);
  font-family: var(--mono);
}

.cm-composer {
  margin-top: 12px;
}

.cm-input-wrap {
  display: flex;
}

#cm-input {
  width: 100%;
  min-height: 76px;
  padding: 9px 10px;
  color: var(--text);
  background: rgba(21, 21, 21, 0.72);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
}

.cm-composer-foot {
  justify-content: space-between;
  margin-top: 7px;
}

.cm-tc,
#cm-send,
.cm-more {
  min-height: 30px;
  padding: 0 9px;
  color: var(--accent-pale);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: 600 9px/1 var(--mono);
  cursor: pointer;
}

.cm-chars,
.cm-empty {
  color: var(--muted2);
  font-size: 9px;
}

/* ============================================================
   Private messages
   ============================================================ */

.msg-backdrop,
.notif-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1090;
  background: rgba(2, 4, 10, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.msg-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  width: min(430px, 100vw);
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: #181818;
  border-left: 1px solid var(--line2);
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.58);
  transform: translateX(102%);
  visibility: hidden;
  transition: transform 180ms ease, visibility 180ms step-end;
  border-color: #383838;
}

.msg-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 180ms ease;
}

.msg-head {
  min-height: 62px;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.msg-head strong {
  flex: 1;
  font: 700 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.msg-block-toggle.is-active {
  color: #ffb6bd;
  background: rgba(212, 109, 101, 0.09);
  border-color: rgba(212, 109, 101, 0.22);
}

.msg-inbox,
.msg-thread {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.msg-search-wrap {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.msg-search-results,
.msg-conversations,
.msg-blocked-list {
  overflow-y: auto;
}

.msg-user-result,
.msg-conversation,
.msg-blocked-user {
  width: 100%;
  min-height: 66px;
  padding: 10px 13px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: inherit;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  text-align: left;
}

.msg-user-result,
.msg-conversation {
  cursor: pointer;
}

.msg-user-result:hover,
.msg-conversation:hover {
  background: rgba(255, 216, 77, 0.055);
}

.msg-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  object-fit: cover;
  overflow: hidden;
  color: #f5dede;
  background: rgba(255, 216, 77, 0.12);
  border: 1px solid var(--line);
  border-radius: 50%;
  font: 700 14px/1 var(--mono);
}

.msg-conversation-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.msg-conversation-name {
  font-size: 12px;
  font-weight: 700;
}

.msg-conversation-preview {
  overflow: hidden;
  color: var(--muted2);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-conversation-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.msg-unread {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 10px;
  font: 700 10px/1 var(--mono);
}

.msg-blocked-chip {
  padding: 3px 6px;
  color: #f0b5ba;
  background: rgba(212, 109, 101, 0.07);
  border: 1px solid rgba(212, 109, 101, 0.16);
  border-radius: 6px;
  font: 700 8px/1 var(--mono);
  text-transform: uppercase;
}

.msg-empty,
.msg-loading {
  padding: 30px 18px;
  color: var(--muted2);
  text-align: center;
  font-size: 11px;
}

.msg-messages {
  min-height: 0;
  flex: 1;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.msg-bubble {
  position: relative;
  max-width: 78%;
  align-self: flex-start;
}

.msg-bubble.is-mine {
  align-self: flex-end;
}

.msg-bubble-body {
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 13px 13px 13px 4px;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg-bubble.is-mine .msg-bubble-body {
  background: linear-gradient(135deg, rgba(255, 216, 77, 0.20), rgba(228, 185, 31, 0.12));
  border-color: var(--line2);
  border-radius: 13px 13px 4px 13px;
}

.msg-bubble time {
  margin: 3px 3px 0;
  display: block;
  color: var(--muted2);
  font: 9px/1 var(--mono);
}

.msg-bubble.is-mine time {
  text-align: right;
}

.msg-delete {
  position: absolute;
  top: -5px;
  left: -22px;
  padding: 0;
  color: var(--muted2);
  background: transparent;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.msg-bubble:hover .msg-delete {
  opacity: 1;
}

.msg-deleted {
  color: var(--muted2);
  font-style: italic;
}

.msg-load-older {
  margin: 8px auto 0;
  color: var(--muted2);
  background: transparent;
  border: 0;
  font: 500 10px/1 var(--mono);
  cursor: pointer;
}

.msg-blocked-notice {
  margin: 10px 12px 0;
  padding: 9px 11px;
  color: #f4c8cb;
  background: rgba(212, 109, 101, 0.06);
  border: 1px solid rgba(212, 109, 101, 0.16);
  border-radius: 9px;
  font-size: 11px;
}

.msg-blocked-panel {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
}

.msg-blocked-user > button {
  min-height: 29px;
  padding: 0 9px;
  color: var(--muted);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: 600 9px/1 var(--mono);
  cursor: pointer;
}

.msg-composer {
  padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr 38px;
  gap: 8px;
  border-top: 1px solid var(--line);
}

.msg-composer textarea {
  min-height: 38px;
  max-height: 120px;
  resize: none;
}

.msg-composer button {
  width: 38px;
  height: 38px;
  color: #fff;
  background: rgba(255, 216, 77, 0.18);
  border: 1px solid var(--line2);
  border-radius: 11px;
  cursor: pointer;
}

/* ============================================================
   Toast / floating create button
   ============================================================ */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--footer-h) + 18px);
  z-index: 3000;
  max-width: min(520px, calc(100vw - 28px));
  padding: 9px 13px;
  color: var(--text);
  background: rgba(21, 21, 21, 0.97);
  border: 1px solid var(--line2);
  border-radius: 9px;
  box-shadow: var(--shadow-soft);
  font-size: 11px;
  transform: translate(-50%, 14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--normal), transform var(--normal);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.create-playlist-btn {
  position: fixed;
  right: 18px;
  bottom: calc(var(--footer-h) + 18px);
  z-index: 65;
  min-height: 36px;
  padding: 0 12px;
  gap: 6px;
  color: var(--accent-pale);
  background: rgba(18, 18, 18, 0.92);
  border-color: var(--line2);
  border-radius: 999px;
  box-shadow: var(--shadow-soft), var(--glow);
  font: 700 10px/1 var(--mono);
  display: none;
}

.create-playlist-btn.visible {
  display: inline-flex;
}

.create-playlist-btn svg {
  width: 14px;
  height: 14px;
}

/* ============================================================
   Authentication pages
   Kept here because login/register use the same theme stylesheet.
   ============================================================ */

body.auth-page {
  min-height: 100vh;
  padding: 24px;
  display: grid;
  place-items: center;
}

.auth-card {
  position: relative;
  width: min(380px, 100%);
  padding: 24px 20px 20px;
  overflow: hidden;
  color: var(--text);
  background:
    #181818;
  border: 1px solid var(--line2);
  border-radius: 6px;
  box-shadow: none;
  border-color: #303030;
}

.auth-header {
  margin-bottom: 18px;
  text-align: center;
}

.auth-header .logo {
  margin: 0 auto 10px;
}

.auth-header h1 {
  margin: 0;
  font: 800 16px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-header .sub {
  margin: 6px 0 0;
  color: var(--muted);
  font: 500 10px/1 var(--mono);
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-card .field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-card label {
  color: var(--muted);
  font: 600 9px/1 var(--mono);
}

.auth-card label.row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"] {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(21, 21, 21, 0.86);
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
}

.auth-card input:focus {
  border-color: var(--line3);
  box-shadow: 0 0 0 3px rgba(255, 216, 77, 0.10);
}

.auth-card input:-webkit-autofill,
.auth-card input:-webkit-autofill:hover,
.auth-card input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #151515 inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
}

.auth-card .hint,
.auth-card .foot {
  color: var(--muted2);
  font-size: 9px;
}

.auth-card .btn {
  width: 100%;
  height: 38px;
  color: var(--accent-pale);
  background: var(--accent-soft);
  border-color: var(--line2);
  border-radius: 9px;
}

.auth-card .msg {
  min-height: 18px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.auth-card .msg.error {
  color: var(--bad);
}

.auth-card .msg.ok {
  color: var(--good);
}

.auth-card .foot {
  margin-top: 14px;
  text-align: center;
}

.auth-card .foot a {
  color: var(--accent-pale);
  text-decoration: none;
}

.auth-lang {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 5px;
}


/* Small semantic states used by the current JavaScript. */

.entity-claimed {
  margin-left: 4px;
  color: var(--good);
  font-size: 12px;
}

.entity-stats--line {
  color: var(--muted);
  font: 500 10px/1.4 var(--mono);
}

.atp-item-btn.added {
  color: var(--good);
  background: rgba(120, 199, 155, 0.08);
  border-color: rgba(120, 199, 155, 0.24);
}

.ep-counter.warn,
.warn {
  color: var(--warn);
}

.ep-counter.limit,
.limit {
  color: var(--bad);
}

.sh-empty {
  margin: 0;
  padding: 16px 10px;
  color: var(--muted2);
  text-align: center;
  font-size: 11px;
}

.atp-footer {
  margin-top: 10px;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (min-width: 1441px) {
  /* Mono desktop header: compact first row, dedicated navigation rail,
     then the two taxonomy levels on separate rows. */
  .topbar-inner {
    display: grid;
    grid-template-columns: auto minmax(320px, 1fr) 34px 34px;
    grid-template-areas:
      "brand search messages notifications"
      "navigation navigation navigation navigation"
      "genres genres genres genres"
      "tags tags tags tags";
    align-items: center;
    min-height: 0;
    padding: 10px 20px 8px;
    gap: 8px 10px;
  }

  .topbar .brand {
    grid-area: brand;
    min-width: max-content;
    margin: 0;
    padding-right: 10px;
  }

  .topbar form.search {
    grid-area: search;
    order: initial;
    width: 100%;
    min-width: 0;
    margin: 0;
    flex: none;
  }

  .topbar .msg-wrap {
    grid-area: messages;
    order: initial;
    width: 34px;
    margin: 0;
    justify-self: end;
  }

  .topbar .notif-wrap {
    grid-area: notifications;
    order: initial;
    width: 34px;
    margin: 0;
    justify-self: end;
  }

  .topbar .msg-button,
  .topbar .notif-bell-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
  }

  .topbar .nav-wrap {
    grid-area: navigation;
    order: initial;
    width: 100%;
    margin: 0;
    justify-content: flex-start;
  }

  .topbar nav.nav {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    gap: 2px;
    padding: 6px 0 0;
    overflow-x: auto;
    border: 0;
    border-top: 1px solid #292929;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    scrollbar-width: none;
  }

  .topbar nav.nav::-webkit-scrollbar {
    display: none;
  }

  .topbar nav.nav a,
  .topbar nav.nav .nav-logout {
    flex: 0 0 auto;
    height: 30px;
    min-height: 30px;
    padding: 0 11px;
    color: rgba(245, 245, 245, 0.58);
    background: transparent;
    border: 0;
    border-radius: 3px;
    font: 500 11px/1 var(--sans);
    letter-spacing: 0;
    text-transform: none;
    text-shadow: none;
  }

  .topbar nav.nav a::before,
  .topbar nav.nav a::after {
    display: none;
  }

  .topbar nav.nav a:hover,
  .topbar nav.nav a:focus-visible,
  .topbar nav.nav .nav-logout:hover,
  .topbar nav.nav .nav-logout:focus-visible {
    color: #ffffff;
    background: #2b2b2b;
    border: 0;
    box-shadow: none;
  }

  .topbar nav.nav a.active,
  .topbar nav.nav a[aria-current="page"] {
    color: #111111;
    background: var(--accent);
    border: 0;
    font-weight: 600;
    text-shadow: none;
  }

  .topbar .lang-switcher {
    margin-left: auto;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.10);
  }

  .topbar .lang-btn {
    height: 30px;
    min-width: 30px;
    padding-inline: 7px;
    border-radius: 3px;
    font: 600 10px/1 var(--sans);
    letter-spacing: 0;
  }

  .topbar .lang-btn.active {
    color: #111111;
    background: var(--accent);
    border-color: var(--accent);
  }

  /* Both taxonomy levels inherit .tags-inline at runtime; give each
     its own grid row so they never overlap. */
  .topbar .tags-inline {
    order: initial;
    width: 100%;
    min-width: 0;
    margin: 0;
    flex: none;
    position: relative;
    z-index: 1;
  }

  .topbar #genres-filter-row {
    grid-area: genres;
    margin: 0;
  }

  .topbar #tagsSection {
    grid-area: tags;
    margin: 0;
  }

  .topbar .tags-scroll {
    padding: 0;
  }

  .topbar .tag-pill {
    height: 30px;
    padding-inline: 12px;
    border-radius: 3px;
    font-size: 10px;
  }
}

@media (min-width: 681px) {
  /* Mono identity: large artwork-first cards instead of horizontal rows. */
  .list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    align-items: start;
    gap: 26px 18px;
  }

  .list > .panel,
  .list > .profile-card,
  .list > .entity-header,
  .list > .empty,
  .list > .loader,
  .list > .btn-back,
  .list > .users-discover-section,
  .list > [id$="-panel"] {
    grid-column: 1 / -1;
  }

  .list > .song {
    display: block;
    min-width: 0;
    padding: 0 0 8px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .list > .song:hover,
  .list > .song.is-playing {
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .list > .song .art,
  .list > .song.is-playing .art {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    border: 1px solid #303030;
    border-radius: 4px;
    background: #171717;
    box-shadow: none;
  }

  .list > .song.is-playing .art {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  .list > .song .art img {
    transition: transform 180ms ease, filter 180ms ease;
  }

  .list > .song:hover .art img {
    transform: scale(1.025);
    filter: brightness(0.78);
  }

  .list > .song .meta {
    min-height: 76px;
    padding: 10px 2px 0;
    gap: 5px;
  }

  .list > .song .meta .title {
    font-size: 14px;
    line-height: 1.25;
  }

  .list > .song .meta .line {
    gap: 4px 8px;
  }

  .list > .song .meta .artist,
  .list > .song .meta .album,
  .list > .song .meta .dur {
    font-size: 10px;
  }

  .list > .song .song-tags {
    max-height: 23px;
    margin-top: 1px;
    overflow: hidden;
    flex-wrap: nowrap;
  }

  .list > .song .song-tag {
    flex: 0 0 auto;
    padding: 2px 7px;
    font-size: 9px;
  }

  .list > .song .actions {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 4;
    gap: 5px;
    align-self: auto;
    transition: opacity 160ms ease, transform 160ms ease;
  }

  .list > .song .actions .btn {
    width: 34px;
    height: 34px;
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(10, 10, 10, 0.78);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.30);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .list > .song .actions .btn:hover,
  .list > .song .actions .btn:focus-visible {
    border-color: rgba(255, 255, 255, 0.52);
    background: rgba(28, 28, 28, 0.94);
  }

  .list > .song .actions .btn.primary {
    color: #111111;
    border-color: var(--accent);
    background: var(--accent);
  }

  .list > .song .actions .btn.primary span {
    color: #111111;
  }

  .list > .song .actions .btn.song-like {
    width: auto;
    min-width: 46px;
    padding-inline: 9px;
  }

  /* Albums and playlists follow the same artwork-first rhythm. */
  .albums-grid,
  .playlists-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    align-items: start;
    gap: 26px 18px;
    padding-bottom: 24px;
  }

  .album-card,
  .playlist-card {
    gap: 0;
    padding: 0 0 8px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .album-card:hover,
  .album-card:focus-visible,
  .playlist-card:hover,
  .playlist-card:focus-visible {
    transform: none;
    border-color: transparent;
    box-shadow: none;
  }

  .album-cover,
  .playlist-cover {
    border: 1px solid #303030;
    border-radius: 4px;
    background: #171717;
    box-shadow: none;
  }

  .album-info,
  .playlist-info {
    min-height: 76px;
    padding: 10px 2px 0;
    gap: 5px;
  }

  .album-name,
  .playlist-name {
    font-size: 14px;
    line-height: 1.25;
  }
}

@media (hover: hover) and (min-width: 681px) {
  .list > .song .actions {
    opacity: 0;
    transform: translateY(-4px);
  }

  .list > .song:hover .actions,
  .list > .song:focus-within .actions,
  .list > .song.is-playing .actions {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 1100px) {
  .users-discover-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1700px) {
  .users-discover-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1440px) {
  .topbar-inner {
    min-height: 58px;
    padding-block: 5px;
  }

  .brand {
    flex: 1 1 auto;
  }

  /* Mobile order: messages -> notifications -> burger.
     The burger is intentionally the right-most topbar control. */
  .msg-wrap {
    order: 2;
    margin-left: auto;
  }

  .notif-wrap {
    order: 2;
    margin-left: 0;
  }

  .nav-wrap {
    order: 3;
    margin-left: -8px;
    z-index: 340;
  }

  .burger {
    display: inline-flex;
  }

  .burger[aria-expanded="true"] {
    color: #111111;
    background: var(--accent);
    border: 1px solid var(--accent);
  }

  nav.nav {
    position: fixed;
    inset: 0;
    z-index: 300;
    width: 100vw;
    height: 100dvh;
    padding: calc(64px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom));
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 2px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background:
      linear-gradient(180deg, #111111, #080808);
    border: 0;
    border-radius: 0;
  }

  nav.nav.open {
    display: flex;
  }

  body:has(nav.nav.open) {
    overflow: hidden;
  }

  body:has(nav.nav.open) .brand,
  body:has(nav.nav.open) .burger {
    position: relative;
    z-index: 340;
  }

  body:has(nav.nav.open) .msg-wrap,
  body:has(nav.nav.open) .notif-wrap {
    opacity: 0;
    pointer-events: none;
  }

  body:has(nav.nav.open) form.search,
  body:has(nav.nav.open) .tags-inline {
    visibility: hidden;
    pointer-events: none;
  }

  nav.nav > a:first-of-type {
    margin-top: 0;
  }

  nav.nav a,
  nav.nav .nav-logout {
    width: min(380px, calc(100vw - 28px));
    height: 33px;
    min-height: 33px;
    flex: 0 0 33px;
    align-self: center;
    padding: 0 14px;
    justify-content: center;
    color: rgba(245, 245, 245, 0.72);
    background: transparent;
    border-color: transparent;
    border-radius: 0;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.09em;
    text-align: center;
  }

  nav.nav a:hover,
  nav.nav a:focus-visible {
    color: #ffffff;
    background: #242424;
  }

  nav.nav a.active,
  nav.nav a[aria-current="page"] {
    color: #111111;
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: none;
    border-radius: 3px;
  }

  nav.nav .lang-switcher {
    width: 172px;
    align-self: center;
    margin: 8px auto 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    border: 0;
  }

  nav.nav .lang-btn {
    width: 100%;
    height: 30px;
    min-height: 30px;
    padding: 0 10px;
    justify-content: center;
    color: rgba(245, 245, 245, 0.52);
    background: transparent;
    border: 0;
    border-radius: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
  }

  nav.nav .lang-btn.active{
    color: #111111;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 3px;
  }

  nav.nav .nav-logout {
    width: 42px;
    height: 32px;
    min-height: 32px;
    flex-basis: 32px;
    margin-top: 6px;
    padding: 0;
    color: var(--accent-pale);
    background: transparent;
    border: 0;
  }

}

@media (max-width: 700px) {
  :root {
    --side-pad: 10px;
  }

  .notif-drawer-head {
    padding: 10px 12px;
    font-size: 11px;
  }

  .notif-item {
    gap: 8px;
    padding: 8px 10px;
  }

  .notif-avatar,
  .notif-avatar-ph,
  .notif-thumb {
    width: 34px;
    height: 34px;
  }

  .notif-text {
    font-size: 10.5px;
  }

  .notif-song,
  .notif-share-message,
  .notif-share-timecode {
    font-size: 8.5px;
  }

  .notif-item time {
    font-size: 8.5px;
  }

  #song-actions-menu,
  #pl-actions-menu {
    width: min(210px, calc(100vw - 16px));
    border-radius: 11px;
  }

  .song-actions-menu-item,
  #pl-actions-menu li {
    min-height: 40px;
    font-size: 11px;
  }

  .topbar-inner {
    gap: 5px 8px;
  }

  .logo-custom {
    height: 28px;
    max-width: 120px;
  }

  form.search {
    height: 33px;
    padding: 0 11px;
  }

  form.search input {
    font-size: 11px;
  }

  .tag-controls {
    display: none;
  }

  .tag-pill {
    height: 29px;
    padding: 0 9px;
    font-size: 10px;
  }

  .active-tags {
    padding-top: 4px;
  }

  main {
    margin-top: 7px;
  }

  .list {
    gap: 7px;
  }

  .song {
    padding: 8px;
    gap: 8px;
  }

  .art {
    width: 48px;
    height: 48px;
  }

  .meta .title {
    font-size: 12px;
  }

  .meta .album,
  .song-tags {
    display: none;
  }

  .actions {
    gap: 3px;
  }

  .actions .btn {
    width: 29px;
    height: 29px;
    border-radius: 4px;
    font-size: 11px;
  }

  .actions .btn.song-like {
    min-width: 39px;
    padding-inline: 6px;
  }

  .actions .song-actions-btn {
    width: 25px;
    height: 25px;
    border-radius: 3px;
    font-size: 8px;
    letter-spacing: 0.35px;
  }

  .albums-grid,
  .playlists-grid,
  .playlists-carousel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    padding-bottom: 18px;
  }

  .album-card,
  .artist-card,
  .playlist-card {
    padding: 5px;
    gap: 4px;
    border-radius: 10px;
  }

  .album-cover,
  .artist-cover,
  .playlist-cover {
    border-radius: 7px;
  }

  .artist-cover {
    border-radius: 50%;
  }

  .album-name,
  .artist-name,
  .playlist-name {
    font-size: 9.5px;
  }

  .album-artist,
  .playlist-owner {
    font-size: 8.5px;
  }

  .album-track-count,
  .artist-track-count,
  .playlist-track-count {
    font-size: 8px;
  }

  .entity-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .entity-main {
    min-width: calc(100% - 70px);
  }

  .entity-meta {
    width: 100%;
    padding-left: 70px;
  }

  .users-discover-section {
    padding: 12px;
  }

  .footer {
    --footer-h: 110px;
  }

  .app {
    padding-bottom: calc(110px + 18px);
  }

  .footer-inner {
    padding: 8px var(--side-pad);
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 5px;
  }

  .footer-art {
    display: none;
  }

  .footer-info {
    text-align: center;
  }

  .footer-info .timeline {
    display: none;
  }

  .footer-timeline-mobile {
    width: 100%;
    display: flex;
  }

  .footer-controls {
    justify-content: center;
    gap: 5px;
  }

  .footer-controls .btn {
    width: 29px;
    height: 29px;
    border-radius: 4px;
  }

  #footer-play-button {
    width: 36px;
    height: 36px;
    border-radius: 4px;
  }

  #footer-like-button,
  #footer-shuffle-button,
  #footer-repeat-button {
    display: none;
  }

  .create-playlist-btn {
    right: 12px;
    bottom: 124px;
    width: 36px;
    height: 36px;
    padding: 0;
  }

  .create-playlist-btn span {
    display: none;
  }

  .fullscreen-content {
    padding: 16px;
  }

  .fullscreen-artwork {
    width: min(84vw, 320px);
  }

  .fullscreen-controls {
    gap: 9px;
  }

  .fs-btn {
    width: 42px;
    height: 42px;
    border-radius: 4px;
  }

  .fs-btn--play {
    width: 58px;
    height: 58px;
    color: #111111;
    background: var(--accent);
    border-color: var(--accent);
    border-radius: 4px;
  }

  .reco-drawer {
    bottom: 110px;
    max-height: 65vh;
  }

  .reco-drawer-grid {
    grid-template-columns: 1fr;
  }

  .cp-modal,
  .atp-modal,
  .up-modal,
  .ep-modal,
  .sh-modal,
  #cm-modal {
    padding: 10px;
  }

  .cp-dialog,
  .atp-dialog,
  .up-dialog,
  .ep-dialog,
  .sh-dialog,
  .cm-dialog {
    padding: 16px 14px;
  }

  .msg-drawer,
  .notif-drawer {
    width: 100vw;
  }
}

@media (max-width: 400px) {
  :root {
    --side-pad: 8px;
  }

  .brand .title {
    font-size: 13px;
  }

  .song {
    padding: 7px;
  }

  .art {
    width: 44px;
    height: 44px;
  }

  .actions .btn {
    width: 27px;
    height: 27px;
  }

  .actions .song-actions-btn {
    width: 24px;
    height: 24px;
    font-size: 7.5px;
  }

  .albums-grid,
  .playlists-grid,
  .playlists-carousel {
    gap: 6px;
  }

  .album-name,
  .artist-name,
  .playlist-name {
    font-size: 9px;
  }

  body.auth-page {
    padding: 14px;
  }

  .auth-card {
    padding: 20px 15px 16px;
    background: #181818;
    border-color: #303030;
    border-radius: 6px;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }
}

/* ============================================================
   Visibility utility
   ============================================================ */

[hidden] {
  display: none;
}

/* ============================================================
   Animations
   ============================================================ */

@keyframes song-actions-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulse {
  0%,
  100% { opacity: 0.35; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}
