/* ==========================================================================
   finalfinal Design System Tokens & Components
   Strict 1:1 Implementation from Figma (Nodes 2423:1247, 2422:77, 2423:1309, 2573:580)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:ital,wght@0,400..700;1,400..700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* Strict Palette Tokens */
  --bg-canvas: #000000;
  --bg-canvas-subtle: #020202;
  --bg-sidebar: #0c0c0c;
  --border-subtle: #1c1c1c;
  --border-card: rgba(255, 255, 255, 0.11);
  --border-card-hover: rgba(255, 255, 255, 0.22);
  --surface-active: #1c1c1c;
  --surface-secondary: #2c2c2d;
  --surface-border: #4c4c4d;

  /* Primary Light & Typography Tokens */
  --text-primary: #EEEEEE; /* NEVER #FFFFFF */
  --color-fg-primary: #EEEEEE;
  --color-bg-primary: #000000;
  --text-secondary: rgba(238, 238, 238, 0.5);
  --text-muted: rgba(238, 238, 238, 0.37);
  --text-placeholder: rgba(238, 238, 238, 0.24);
  --font-main: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Semantic Accents */
  --semantic-green-bg: #012413;
  --semantic-green-accent: #005a29;
  --semantic-red-bg: #570007;
  --semantic-red-accent: #a9000d;

  /* Player & Card Shadows */
  --shadow-player: 0px 4px 16.6px 0px #1c1c1c;
  --shadow-artwork-glow: none;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

a {
  color: var(--text-primary);
  text-decoration: none;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-canvas);
}
::-webkit-scrollbar-thumb {
  background: var(--surface-secondary);
}

/* ==========================================================================
   Button Components (Node 2423:1247)
   ========================================================================== */

.btn-main-big {
  background: #EEEEEE;
  color: #101010;
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 400;
  height: 36px;
  padding: 8px 32px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}
.btn-main-big:hover {
  opacity: 0.9;
}

.btn-main-small {
  background: #EEEEEE;
  color: #101010;
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 400;
  height: 33px;
  padding: 8px 17px;
  border: 0.8px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}
.btn-main-small:hover {
  opacity: 0.9;
}

.btn-second-big {
  background: transparent;
  color: #EEEEEE;
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 400;
  height: 37.6px;
  padding: 8px 32px;
  border: 0.8px solid #EEEEEE;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.btn-second-big:hover {
  background: rgba(238, 238, 238, 0.08);
}

.btn-second-small {
  background: transparent;
  color: #EEEEEE;
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 400;
  height: 34.6px;
  padding: 8px 17px;
  border: 0.8px solid #EEEEEE;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.btn-second-small:hover {
  background: rgba(238, 238, 238, 0.08);
}

.btn-material-big {
  background: #2c2c2d;
  color: #EEEEEE;
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 400;
  height: 38px;
  padding: 8px 32px;
  border: 1px solid #4c4c4d;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.btn-material-big:hover {
  background: #383839;
}

.btn-material-small {
  background: #2c2c2d;
  color: #EEEEEE;
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 400;
  height: 34.6px;
  padding: 8px 17px;
  border: 1px solid #4c4c4d;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.btn-material-small:hover {
  background: #383839;
}

/* ==========================================================================
   Text Input Components (Node 2423:1247)
   ========================================================================== */

.txt-input-material-big {
  background: #2c2c2d;
  border: 1px solid #2c2c2d;
  color: #EEEEEE;
  font-family: var(--font-main);
  font-size: 16px;
  height: 38px;
  padding: 8px 12px;
  outline: none;
}
.txt-input-material-big::placeholder {
  color: var(--text-placeholder);
}
.txt-input-material-big:focus {
  border-color: #4c4c4d;
}

.txt-input-material-small {
  background: #2c2c2d;
  border: 1px solid #2c2c2d;
  color: #EEEEEE;
  font-family: var(--font-main);
  font-size: 11px;
  height: 34.6px;
  padding: 8px 12px;
  outline: none;
}
.txt-input-material-small::placeholder {
  color: var(--text-placeholder);
}
.txt-input-material-small:focus {
  border-color: #4c4c4d;
}

.txt-input-outline-big {
  background: #030303;
  border: 1px solid #1e1e1e;
  color: #EEEEEE;
  font-family: var(--font-main);
  font-size: 16px;
  height: 38px;
  padding: 8px 12px;
  outline: none;
}
.txt-input-outline-big::placeholder {
  color: var(--text-placeholder);
}
.txt-input-outline-big:focus {
  border-color: #333333;
}

.txt-input-outline-small {
  background: #030303;
  border: 1px solid #1e1e1e;
  color: #EEEEEE;
  font-family: var(--font-main);
  font-size: 11px;
  height: 34.6px;
  padding: 8px 12px;
  outline: none;
}
.txt-input-outline-small::placeholder {
  color: var(--text-placeholder);
}
.txt-input-outline-small:focus {
  border-color: #333333;
}

/* ==========================================================================
   Range Slider (Node 2423:1268)
   ========================================================================== */

.ff-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--surface-secondary);
  border-radius: 0;
  outline: none;
}
.ff-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  background: #EEEEEE;
  border-radius: 0;
  cursor: pointer;
  border: none;
}
.ff-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background: #EEEEEE;
  border-radius: 0;
  cursor: pointer;
  border: none;
}

/* ==========================================================================
   App Layout Grid
   ========================================================================== */

.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
  background: var(--bg-canvas);
  overflow: hidden;
}

/* Left Sidebar (236px) */
.app-sidebar {
  width: 236px;
  min-width: 236px;
  height: 100%;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 25px 16px 15px 16px;
  z-index: 100;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 36px;
  width: 100%;
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.sidebar-beta-pill {
  background: rgba(255, 255, 255, 0.23);
  padding: 3px 5px;
  font-size: 7px;
  font-weight: 500;
  color: #EEEEEE;
  line-height: 1;
  letter-spacing: 0.5px;
}

.sidebar-divider {
  width: 100%;
  height: 1px;
  background: var(--border-subtle);
}

.sidebar-animated-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  will-change: transform, opacity;
}

.sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 400;
  text-decoration: none;
  transition: background 0.15s ease;
}

.sidebar-nav-item.active {
  background: #1c1c1c !important;
  color: #EEEEEE !important;
}

.sidebar-nav-item:not(.active):hover {
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-nav-icon {
  width: 13px;
  height: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* User Badge at bottom of Sidebar */
.sidebar-user-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-top: 15px;
  border-top: 1px solid var(--border-subtle);
}

.sidebar-user-left {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sidebar-user-avatar {
  width: 33px;
  height: 33px;
  border-radius: 99px;
  background: #1c1c1c;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.11);
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
}

.sidebar-user-name {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
}

.sidebar-user-handle {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.2;
}

.sidebar-user-options {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main View Area */
.app-main {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  background: var(--bg-canvas-subtle);
  padding: 32px 35px 120px 35px;
}

/* ==========================================================================
   Persistent Floating Audio Bar (724px × 58px)
   ========================================================================== */

.floating-audio-bar {
  position: fixed;
  bottom: 24px;
  left: calc(236px + (100vw - 236px - 724px) / 2);
  width: 724px;
  max-width: calc(100vw - 270px);
  height: 58px;
  background: rgba(28, 28, 28, 0.83);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-player);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  z-index: 999;
}

.audio-bar-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 150px;
  max-width: 200px;
  overflow: hidden;
}

.audio-bar-thumb {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-card);
  object-fit: cover;
  flex-shrink: 0;
  background: #111;
}

.audio-bar-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.audio-bar-title {
  color: var(--text-primary);
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}

.audio-bar-author {
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-bar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: 1;
}

.audio-bar-play-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

/* 40-Bar Waveform Scrubber */
.waveform-bars-container {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
  cursor: pointer;
  user-select: none;
}

.wf-bar {
  width: 2px;
  border-radius: 999px;
  background: var(--text-muted);
  transition: background 0.1s ease;
}

.wf-bar.played {
  background: #EEEEEE;
}

.audio-bar-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.audio-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.audio-bar-control-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.audio-bar-ctrl-btn {
  background: none;
  border: none;
  padding: 6px;
  margin: -6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  opacity: 1;
  transition: opacity 0.15s ease, transform 0.1s ease, color 0.15s ease;
  position: relative;
  user-select: none;
}

.audio-bar-ctrl-btn:hover {
  opacity: 1;
  color: #EEEEEE;
}

.audio-bar-ctrl-btn:active {
  transform: scale(0.95);
}

.audio-bar-ctrl-btn.muted {
  opacity: 0.35;
  color: var(--text-muted);
}

.audio-bar-ctrl-btn.repeat-off {
  opacity: 0.35;
  color: var(--text-muted);
}

.audio-bar-ctrl-btn.repeat-album {
  opacity: 1;
  color: #EEEEEE;
}

.audio-bar-ctrl-btn.repeat-song {
  opacity: 1;
  color: #EEEEEE;
}

.repeat-badge-one {
  position: absolute;
  top: 0px;
  right: -3px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  color: #0c0c0c;
  background: #EEEEEE;
  width: 11px;
  height: 11px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

.audio-bar-ver-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  color: #EEEEEE;
  background: #1c1c1c;
  border: 1px solid var(--border-subtle);
  padding: 0 3px;
  border-radius: 2px;
  line-height: 1.2;
  pointer-events: none;
}

/* Audio Control Popovers */
.audio-ctrl-popover {
  position: absolute;
  bottom: calc(100% + 14px);
  background: #0c0c0c;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.volume-slider-popover {
  right: -10px;
  padding: 10px 14px;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: 150px;
}

.audio-ctrl-popover-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 32px;
  text-align: right;
}

.volume-slider-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: #242424;
  outline: none;
  cursor: pointer;
  border-radius: 2px;
}

.volume-slider-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  background: #EEEEEE;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.volume-slider-range::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

.version-select-popover {
  right: -8px;
  width: 250px;
  max-height: 280px;
  overflow: hidden;
}

.version-popover-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  background: #111111;
}

.version-popover-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.version-popover-subtitle {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
}

.version-popover-list {
  display: flex;
  flex-direction: column;
  max-height: 220px;
  overflow-y: auto;
}

.version-popover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background 0.12s ease;
}

.version-popover-item:last-child {
  border-bottom: none;
}

.version-popover-item:hover {
  background: #1c1c1c;
}

.version-popover-item.active {
  background: #181818;
}

.version-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.version-pill-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: #EEEEEE;
  background: #242424;
  padding: 2px 5px;
  border-radius: 2px;
}

.version-item-label {
  font-size: 12px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.version-item-right {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.version-active-check {
  font-size: 10px;
  color: #EEEEEE;
  font-weight: 700;
}

.audio-ctrl-toast {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: #0c0c0c;
  border: 1px solid var(--border-subtle);
  color: #EEEEEE;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 8px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.8);
  pointer-events: none;
  animation: fadeInOut 1s ease forwards;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translate(-50%, 4px); }
  15% { opacity: 1; transform: translate(-50%, 0); }
  75% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -4px); }
}

/* ==========================================================================
   Modal Dialogs (Zero Emojis, Pure Figma System)
   ========================================================================== */

.ff-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.ff-modal-overlay.open {
  display: flex;
}

.ff-modal-container {
  background: #0c0c0c;
  border: 1px solid var(--border-subtle);
  padding: 24px;
  width: 420px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ff-modal-title {
  font-size: 20px;
  color: var(--text-primary);
  font-weight: 500;
}

/* ==========================================================================
   Three-Dot Button & Universal Context Menu (Figma System)
   ========================================================================== */

.btn-dots-menu {
  background: transparent;
  border: none;
  padding: 6px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.btn-dots-menu:hover {
  opacity: 1;
  background: rgba(238, 238, 238, 0.08);
}

.ff-context-menu {
  position: fixed;
  z-index: 100000;
  background: #1c1c1c;
  border: 1px solid var(--border-card);
  padding: 4px;
  min-width: 160px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ff-context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: #EEEEEE;
  font-family: var(--font-main);
  font-size: 13px;
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s ease;
}

.ff-context-menu-item:hover {
  background: #2c2c2d;
}

.ff-context-menu-item.danger {
  color: var(--semantic-red-accent);
}

.ff-context-menu-item.danger:hover {
  background: var(--semantic-red-bg);
}

.ff-context-menu-item:disabled,
.ff-context-menu-item.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.ff-context-menu-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

/* Drag and Drop Track Reordering Styles */
.track-row.dragging {
  opacity: 0.35;
  border-style: dashed;
}

.track-row.drag-over-top {
  border-top: 2px solid #EEEEEE !important;
}

.track-row.drag-over-bottom {
  border-bottom: 2px solid #EEEEEE !important;
}

.track-row.drop-target {
  border-color: #EEEEEE !important;
  background: #181818 !important;
}

/* ==========================================================================
   Drag & Drop Audio Upload & Progress Indicator (Figma Design System)
   ========================================================================== */

.ff-dropzone-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 2, 2, 0.9);
  backdrop-filter: blur(12px);
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ff-dropzone-overlay.active {
  display: flex;
}

.ff-dropzone-box {
  border: 1.5px dashed #EEEEEE;
  background: #0c0c0c;
  padding: 48px 64px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.95);
  max-width: 500px;
}

.ff-empty-dropzone {
  border: 1px dashed var(--border-card);
  background: #0c0c0c;
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ff-empty-dropzone:hover,
.ff-empty-dropzone.drag-over {
  border-color: #EEEEEE;
  background: #141414;
}

.ff-upload-progress-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #0c0c0c;
  border: 1px solid var(--border-card);
  padding: 16px 20px;
  min-width: 320px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100000;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.95);
}

.ff-upload-progress-track {
  width: 100%;
  height: 4px;
  background: #222222;
  position: relative;
  overflow: hidden;
}

.ff-upload-progress-fill {
  height: 100%;
  background: #EEEEEE;
  width: 0%;
  transition: width 0.15s ease;
}

/* ==========================================================================
   Mobile Top Header (visible only below 768px)
   ========================================================================== */

.mobile-top-header {
  display: none;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: rgba(12, 12, 12, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  z-index: 500;
  flex-shrink: 0;
}

.mobile-top-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-top-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-user-avatar-small {
  width: 28px;
  height: 28px;
  border-radius: 99px;
  object-fit: cover;
  border: 1px solid var(--border-card);
  background: #1c1c1c;
}

/* ==========================================================================
   Mobile Bottom Navigation Bar (visible only below 768px)
   ========================================================================== */

.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(12, 12, 12, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-subtle);
  z-index: 998;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-bottom-bar-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 100%;
  align-items: center;
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 6px 0;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-btn img,
.mobile-nav-btn svg {
  width: 18px;
  height: 18px;
  opacity: 0.45;
  transition: opacity 0.15s ease;
}

.mobile-nav-btn span {
  font-family: var(--font-main);
  font-size: 10px;
  color: #888888;
  transition: color 0.15s ease;
}

.mobile-nav-btn.active img,
.mobile-nav-btn.active svg {
  opacity: 1;
}

.mobile-nav-btn.active span {
  color: #EEEEEE;
}

/* ==========================================================================
   Desktop-only / Mobile-only utility classes
   ========================================================================== */

.desktop-only {
  display: revert;
}

.mobile-only {
  display: none !important;
}

/* ==========================================================================
   Responsive Breakpoint (max-width: 768px)
   ========================================================================== */

@media (max-width: 768px) {
  /* Utility overrides */
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: revert !important;
  }

  /* Show mobile header & bottom bar */
  .mobile-top-header {
    display: flex;
  }

  .mobile-bottom-bar {
    display: block;
  }

  /* Hide desktop sidebar */
  .app-sidebar {
    display: none !important;
  }

  /* App container: vertical column instead of horizontal row */
  .app-container {
    flex-direction: column;
  }

  /* Main content: full width, adjusted padding */
  .app-main {
    padding: 20px 16px 180px 16px;
    width: 100%;
  }

  /* Floating audio bar: full-width on mobile, above bottom nav */
  .floating-audio-bar {
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 10px);
  }

  /* Smaller audio bar elements on mobile */
  .audio-bar-left {
    min-width: 80px;
    max-width: 120px;
  }

  .audio-bar-title {
    font-size: 13px;
  }

  .audio-bar-author {
    font-size: 10px;
  }

  /* Hide waveform bars on small screens, keep it simple */
  .waveform-bars-container {
    display: none;
  }

  .audio-bar-time {
    font-size: 10px;
  }

  /* Audio bar right controls: tighter spacing */
  .audio-bar-right {
    gap: 10px;
  }

  /* Dashboard: responsive project grid */
  .ff-projects-grid {
    gap: 20px !important;
  }

  .ff-project-card {
    width: calc(50% - 10px) !important;
  }

  .ff-project-card-cover {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
  }

  .ff-folder-card-cover {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
  }

  /* Release detail view: stack columns vertically */
  .ff-release-layout {
    flex-direction: column !important;
    gap: 24px !important;
  }

  .ff-release-artwork-col {
    width: 100% !important;
    max-width: 100% !important;
    flex-shrink: 1 !important;
  }

  .ff-release-artwork-col > div:first-child {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
  }

  .ff-release-tracks-col {
    max-width: 100% !important;
  }

  /* Release title smaller on mobile */
  .ff-release-artwork-col h1 {
    font-size: 28px !important;
  }

  /* Modal adjustments */
  .ff-modal-container {
    max-width: 94vw;
    padding: 20px;
  }

  /* NFA modal responsive */
  #nfa-modal-container {
    max-width: 98vw !important;
    max-height: 88vh !important;
  }

  /* Upload toast repositioned above bottom bar on mobile */
  .ff-upload-progress-toast {
    bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 16px);
    right: 12px;
    left: 12px;
    min-width: auto;
    max-width: none;
  }

  /* Context menu responsive */
  .ff-context-menu {
    max-width: calc(100vw - 20px);
  }

  /* Dashboard header responsive */
  .ff-dashboard-header {
    flex-direction: column !important;
    gap: 16px !important;
    align-items: flex-start !important;
  }

  /* Dropzone responsive */
  .ff-dropzone-box {
    padding: 32px 24px;
    max-width: calc(100vw - 32px);
  }

  .ff-empty-dropzone {
    padding: 28px 16px;
  }

  /* Welcome screen responsive */
  .ff-welcome-screen h1 {
    font-size: 28px !important;
  }

  /* Version/Volume popovers on mobile */
  .volume-slider-popover,
  .version-select-popover {
    position: fixed !important;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 68px) !important;
    right: 12px !important;
    left: auto !important;
  }

  /* Scrollbar: hide on mobile (use native momentum) */
  ::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
}

