:root {
  --bg-main: #090d16;
  --bg-gradient: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #090d16 75%);
  --card-bg: rgba(22, 28, 45, 0.85);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover: rgba(30, 41, 67, 0.95);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --btn-gradient: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
  --btn-gradient-hover: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background: var(--bg-main);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
  line-height: 1.5;
}

.app-container {
  width: 100%;
  max-width: 680px;
  padding: 16px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 6px;
  gap: 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 10px;
  flex-shrink: 0;
}

.header-tools {
  display: inline-flex;
  align-items: center;
  flex-direction: row;
  gap: 8px;
  flex-shrink: 0;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.logo-area:hover {
  opacity: 0.92;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--btn-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
}

.logo-icon svg {
  width: 22px;
  height: 22px;
}

.logo-text h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-status {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.3);
}

.btn-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.btn-icon:hover {
  background: var(--card-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon svg {
  width: 22px;
  height: 22px;
}

/* Cards */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition-smooth);
}

.section-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: block;
}

.section-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.btn-select-all {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

/* Upload Card */
.upload-card {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  cursor: pointer;
  text-align: center;
  padding: 30px 16px;
  transition: var(--transition-smooth);
}

.upload-card:hover, .upload-card.drag-over {
  border-color: var(--accent-purple);
  background: rgba(30, 27, 75, 0.3);
}

.file-input-hidden {
  display: none;
}

.upload-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.15);
  color: var(--accent-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.upload-icon-circle svg {
  width: 30px;
  height: 30px;
}

.upload-placeholder h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.upload-placeholder p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.file-types-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Preview */
.preview-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.media-frame {
  width: 100%;
  max-height: 360px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-frame video, .media-frame img {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.media-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}

.media-info {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.85rem;
}

.media-filename {
  font-weight: 600;
  color: var(--text-primary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-size {
  color: var(--text-muted);
}

.btn-text-danger {
  background: none;
  border: none;
  color: var(--accent-rose);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

/* AI Assistant Box */
.ai-assist-box {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12) 0%, rgba(37, 99, 235, 0.08) 100%);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-assist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-assist-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-quick-style-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
}

.quick-style-label {
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
}

.quick-ai-select {
  background: transparent !important;
  border: none !important;
  color: #f8fafc !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  outline: none !important;
  cursor: pointer;
  padding: 2px 4px !important;
  width: auto !important;
}

.quick-ai-select option {
  background: #1e1b4b;
  color: #f8fafc;
}

.btn-ai-subgear {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #c4b5fd;
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-ai-subgear:hover {
  background: rgba(139, 92, 246, 0.35);
  color: #fff;
  border-color: #a855f7;
  transform: rotate(30deg);
}

.title-ai-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.btn-title-ai {
  background: rgba(124, 58, 237, 0.18);
  border: 1px solid rgba(139, 92, 246, 0.45);
  color: #c4b5fd;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition-smooth);
}

.btn-title-ai:hover {
  background: rgba(124, 58, 237, 0.38);
  border-color: #a855f7;
  color: #fff;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

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

.btn-title-revert {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition-smooth);
}

.btn-title-revert:hover {
  background: rgba(239, 68, 68, 0.32);
  border-color: #f87171;
  color: #fff;
}

.ai-hint {
  font-size: 0.73rem;
  color: var(--text-muted);
}

.ai-assist-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: #c4b5fd;
}

.sparkle-icon {
  font-size: 1.1rem;
}

.btn-ai-magic {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.35);
  transition: var(--transition-smooth);
}

.btn-ai-magic:hover {
  background: linear-gradient(135deg, #8b5cf6 0%, #c084fc 100%);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.5);
  transform: translateY(-1px);
}

.btn-ai-magic:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-ai-magic.btn-ai-locked {
  background: rgba(30, 41, 59, 0.85);
  border: 1px dashed rgba(168, 85, 247, 0.55);
  color: #d8b4fe;
  box-shadow: none;
}

.btn-ai-magic.btn-ai-locked:hover {
  background: rgba(124, 58, 237, 0.22);
  border-color: #c084fc;
  color: #fff;
  box-shadow: 0 2px 14px rgba(168, 85, 247, 0.25);
  transform: translateY(-1px);
}

.ai-hint {
  font-size: 0.73rem;
  color: var(--text-muted);
}

.ai-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Format Pills */
.format-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.format-pill {
  cursor: pointer;
  user-select: none;
}

.format-pill input {
  display: none;
}

.pill-content {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

.format-pill input:checked + .pill-content {
  background: rgba(124, 58, 237, 0.18);
  border-color: var(--accent-purple);
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.25);
}

.pill-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.pill-text strong {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

/* Input Fields */
.meta-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.input-header label, .input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.char-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* All Inputs & Form Controls - Global Rule to ensure crisp light text */
input,
textarea,
select {
  color: #f8fafc !important;
  font-family: inherit;
  caret-color: #a855f7 !important;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea,
select {
  width: 100%;
  background: rgba(11, 15, 25, 0.85);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: #f8fafc !important;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-smooth);
  caret-color: #a855f7 !important;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
  color: #ffffff !important;
  background: rgba(11, 15, 25, 0.95);
}

/* Placeholder styling across all browsers */
input::placeholder,
textarea::placeholder {
  color: #64748b !important;
  opacity: 1 !important;
}

input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
  color: #64748b !important;
}

input::-moz-placeholder,
textarea::-moz-placeholder {
  color: #64748b !important;
  opacity: 1 !important;
}

/* Browser Autofill fix (prevent white background / black text in Chrome and Firefox) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: #ffffff !important;
  -webkit-box-shadow: 0 0 0 1000px #0b0f19 inset !important;
  box-shadow: 0 0 0 1000px #0b0f19 inset !important;
  transition: background-color 5000s ease-in-out 0s;
  caret-color: #ffffff !important;
}

input:autofill {
  color: #ffffff !important;
  filter: none !important;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

.hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.section-subhint {
  font-size: 0.76rem;
  color: #94a3b8;
  margin-top: 3px;
  font-weight: 500;
}

/* Platforms Grid */
.platforms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.platform-item {
  cursor: pointer;
  display: flex;
  height: 100%;
}

.platform-item input {
  display: none;
}

.platform-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition-smooth);
  width: 100%;
  height: 60px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

/* Individual Progress Bar at bottom of each platform button */
.platform-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  overflow: hidden;
  z-index: 5;
}

.platform-progress-track.active {
  opacity: 1;
}

.platform-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa, #93c5fd);
  background-size: 200% 100%;
  border-radius: 0 2px 2px 0;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.7);
}

.platform-progress-track.publishing .platform-progress-fill {
  width: 100% !important;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899, #3b82f6);
  background-size: 300% 100%;
  animation: platform-bar-shimmer 1.4s linear infinite;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.85);
}

.platform-progress-track.success .platform-progress-fill {
  width: 100% !important;
  background: linear-gradient(90deg, #10b981, #34d399) !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.85) !important;
  animation: none !important;
}

.platform-progress-track.error .platform-progress-fill {
  width: 100% !important;
  background: linear-gradient(90deg, #ef4444, #f87171) !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.85) !important;
  animation: none !important;
}

@keyframes platform-bar-shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.platform-item input:checked + .platform-box {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(59, 130, 246, 0.6);
}

.platform-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.platform-logo svg {
  width: 22px;
  height: 22px;
}

.yt-logo { background: #FF0000; color: #FFF; }
.tg-logo { background: #24A1DE; color: #FFF; }
.rutube-logo { background: #002D5B; color: #FFF; }
.vk-logo { background: #0077FF; color: #FFF; }
.dzen-logo { background: #181818; color: #FF4422; }
.insta-logo { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%); color: #FFF; }
.ok-logo { background: #EE8208; color: #FFF; }
.max-logo { background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%); color: #FFF; }

.platform-item.disabled {
  opacity: 0.38;
  pointer-events: none;
  cursor: not-allowed;
  filter: grayscale(0.8);
}


.platform-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.platform-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.platform-counter {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 22px;
  text-align: center;
  line-height: 1.4;
  letter-spacing: 0.5px;
  user-select: none;
}

.btn-platform-gear {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #64748b;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  padding: 0;
}

.btn-platform-gear svg {
  pointer-events: none;
  transition: transform 0.22s ease;
}

.btn-platform-gear:hover {
  transform: rotate(45deg) scale(1.1);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-platform-gear.configured {
  color: #10b981 !important;
  background: rgba(16, 185, 129, 0.14) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25) !important;
}

.btn-platform-gear.configured:hover {
  color: #34d399 !important;
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: #34d399 !important;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.5) !important;
}

.platform-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.platform-status-tag {
  display: none !important;
}

/* Publish Button */
.publish-action-area {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 6px;
}

.btn-publish-all {
  width: 100%;
  background: var(--btn-gradient);
  border: none;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.4);
  transition: var(--transition-smooth);
}

.btn-publish-all:hover {
  background: var(--btn-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.5);
}

.btn-publish-all:active {
  transform: translateY(1px);
}

.btn-publish-all:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-icon-rocket svg {
  width: 22px;
  height: 22px;
}

/* Progress bar */
.upload-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-bar-track {
  display: none !important;
}

.progress-bar-fill {
  display: none !important;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #94a3b8;
  padding: 6px 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

/* Results Section */
.results-card {
  border-color: rgba(124, 58, 237, 0.3);
}

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

.result-row {
  background: rgba(11, 15, 25, 0.6);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.result-row.success {
  border-color: rgba(16, 185, 129, 0.4);
}

.result-row.error {
  border-color: rgba(244, 63, 94, 0.4);
}

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

.result-platform-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.result-status-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.result-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-blue);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.15);
}

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

/* Mobile Scroll Lock when Modal is Open */
body.modal-open {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
  touch-action: none !important;
  -webkit-overflow-scrolling: auto !important;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  touch-action: none;
  overscroll-behavior: contain;
}

.modal-card {
  background: #111726;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  touch-action: auto;
  overscroll-behavior: contain;
}

.modal-card > form,
.modal-card form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-header {
  flex-shrink: 0;
  padding: 18px 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.tabs-nav {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.2);
  scrollbar-width: none;
  touch-action: pan-x;
  overscroll-behavior: contain;
}

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

.tab-btn {
  background: none;
  border: none;
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: var(--transition-smooth);
}

.tab-btn.active {
  color: var(--accent-purple);
  border-bottom-color: var(--accent-purple);
}

.modal-body {
  flex: 1;
  min-height: 0;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  touch-action: pan-y;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.tab-pane.active {
  display: flex;
}

.form-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-toggle-row strong {
  display: block;
  font-size: 0.9rem;
}

.subtext {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.switch-checkbox {
  width: 44px;
  height: 24px;
  accent-color: var(--accent-purple);
  cursor: pointer;
}

.test-action-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.btn-test, .btn-oauth-google {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  transition: var(--transition-smooth);
}

.btn-test:hover, .btn-oauth-google:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-oauth-google {
  background: #ea4335;
  color: #fff;
  border: none;
}

.btn-oauth-google:hover {
  background: #d93025;
}

.test-feedback-box {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.4;
}

.test-feedback-box.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
}

.test-feedback-box.error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
}

.modal-footer {
  flex-shrink: 0;
  padding: 14px 20px;
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #111726;
  position: relative;
  z-index: 2;
}

.btn-secondary {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--btn-gradient);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

/* Spinner */
.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  background: #1e293b;
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.hidden {
  display: none !important;
}

/* User Profile Header */
.user-area {
  display: flex;
  align-items: center;
}

.btn-auth-trigger {
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-auth-trigger svg {
  width: 16px;
  height: 16px;
}

.btn-auth-trigger:hover {
  background: rgba(124, 58, 237, 0.25);
  color: #fff;
  border-color: var(--accent-purple);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 30px;
  padding: 4px 10px 4px 5px;
}

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

.user-name {
  font-size: 0.82rem;
  font-weight: 600;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.btn-logout:hover {
  color: var(--accent-rose);
}

.btn-logout svg {
  width: 15px;
  height: 15px;
}

/* Label With Help Button (?) */
.label-with-help {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-help-tip {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #93c5fd;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  padding: 0;
  line-height: 1;
}

.btn-help-tip:hover {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
  transform: scale(1.1);
}

/* Auth Modal */
.auth-card {
  max-width: 440px;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 14px;
}

.social-login-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.btn-social {
  padding: 10px 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-social svg {
  width: 22px;
  height: 22px;
}

.btn-soc-tg:hover { background: rgba(36, 161, 222, 0.2); border-color: #24A1DE; }
.btn-soc-vk:hover { background: rgba(0, 119, 255, 0.2); border-color: #0077FF; }
.btn-soc-google:hover { background: rgba(234, 67, 53, 0.2); border-color: #ea4335; }

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin: 12px 0 16px;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--card-border);
}

.auth-divider span {
  padding: 0 10px;
}

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

.auth-submit-btn {
  width: 100%;
  padding: 12px;
  margin-top: 4px;
}

.auth-toggle-box {
  text-align: center;
  margin-top: 10px;
}

.btn-text-link {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

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

/* Help Modal / Instructions */
.help-card {
  max-width: 520px;
}

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

.help-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-blue);
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #cbd5e1;
}

.help-step-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px;
}

.help-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--btn-gradient);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.help-text {
  flex: 1;
}

.help-text strong {
  color: #fff;
}

.help-code-pill {
  display: inline-block;
  background: rgba(11, 15, 25, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: monospace;
  color: #38bdf8;
  font-size: 0.82rem;
  margin: 4px 0;
  user-select: all;
}

.help-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #60a5fa;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 4px;
}

.help-link-btn:hover {
  text-decoration: underline;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
  .app-container {
    padding: 10px 10px 36px;
  }
  .platforms-grid {
    grid-template-columns: 1fr;
  }
  .format-pills {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .pill-content {
    padding: 10px 4px;
    gap: 5px;
  }
  .pill-icon {
    font-size: 1.1rem;
  }
  .pill-text strong {
    font-size: 0.82rem;
  }
  .modal-card {
    max-height: 95vh;
  }
}

/* ================= LUXURY PASSWORDLESS & MULTI-AUTH MODAL ================= */
.modal-card.auth-card {
  width: 100%;
  max-width: 440px !important;
  margin: auto;
  background: linear-gradient(170deg, #111827 0%, #0b0f19 100%) !important;
  border: 1px solid rgba(139, 92, 246, 0.25) !important;
  border-radius: 24px !important;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.85), 0 0 35px rgba(124, 58, 237, 0.15) !important;
  position: relative;
  overflow: hidden;
}

.modal-card.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc, #f472b6);
  z-index: 10;
}

.auth-header-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(59, 130, 246, 0.2));
  border: 1px solid rgba(139, 92, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a78bfa;
}

.auth-body {
  padding: 22px 24px 28px;
}

.auth-subtitle {
  color: #94a3b8;
  font-size: 0.88rem;
  margin-bottom: 20px;
  text-align: center;
  line-height: 1.45;
}

/* 4 Interactive Method Tabs */
.auth-methods-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px;
  border-radius: 14px;
  margin-bottom: 22px;
}

.auth-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 4px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.auth-tab-btn svg {
  width: 20px;
  height: 20px;
  transition: transform 0.22s ease;
}

.auth-tab-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.auth-tab-btn:hover svg {
  transform: scale(1.1);
}

.auth-tab-btn.active {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
}

.auth-method-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: authFadeIn 0.25s ease-out;
}

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

/* Modern Input Groups with Icons */
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrap .input-icon {
  position: absolute;
  left: 14px;
  color: #64748b;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-input-wrap input {
  padding-left: 44px !important;
  height: 48px;
  font-size: 0.95rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #ffffff !important;
  caret-color: #a855f7 !important;
  transition: all 0.2s ease;
  width: 100%;
}

.auth-input-wrap input:focus {
  border-color: #8b5cf6 !important;
  background: rgba(15, 23, 42, 0.95) !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25) !important;
  color: #ffffff !important;
}

/* 4-Digit OTP Boxes */
.otp-sent-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(139, 92, 246, 0.12));
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  color: #cbd5e1;
}

.otp-boxes-grid {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 8px 0 6px;
}

.otp-digit-cell {
  width: 56px !important;
  height: 62px !important;
  font-size: 26px !important;
  font-weight: 800 !important;
  text-align: center !important;
  background: rgba(15, 23, 42, 0.8) !important;
  border: 2px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 14px !important;
  color: #fff !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0 !important;
  caret-color: #a855f7;
}

.otp-digit-cell:focus {
  border-color: #8b5cf6 !important;
  background: rgba(124, 58, 237, 0.12) !important;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.45) !important;
  transform: scale(1.06);
  outline: none;
}

.otp-digit-cell.filled {
  border-color: rgba(139, 92, 246, 0.6) !important;
  color: #a78bfa !important;
}

/* VK Official & Direct Brand Buttons */
.btn-vk-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #0077ff 0%, #005ce6 100%);
  color: #ffffff;
  height: 50px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.22s ease;
  width: 100%;
  box-shadow: 0 6px 20px rgba(0, 119, 255, 0.38);
}

.btn-vk-login:hover {
  background: linear-gradient(135deg, #1a85ff 0%, #0066ff 100%);
  box-shadow: 0 8px 28px rgba(0, 119, 255, 0.55);
  transform: translateY(-2px);
}

.btn-vk-login:active {
  transform: translateY(0);
}

.auth-submit-btn {
  height: 48px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.35);
  transition: all 0.2s ease;
}

.auth-submit-btn:hover {
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.5);
  transform: translateY(-1px);
}

.auth-divider-text {
  display: flex;
  align-items: center;
  text-align: center;
  color: #64748b;
  font-size: 12px;
  margin: 6px 0;
}

.auth-divider-text::before, .auth-divider-text::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-divider-text span {
  padding: 0 10px;
}

.btn-text-sm {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-text-sm:hover {
  text-decoration: underline;
}

.otp-actions-row {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.btn-resend-otp {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #94a3b8;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.btn-resend-otp:not(:disabled) {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.4);
  background: rgba(124, 58, 237, 0.12);
}

.btn-resend-otp:not(:disabled):hover {
  color: #c4b5fd;
  border-color: #a78bfa;
  background: rgba(124, 58, 237, 0.22);
  transform: translateY(-1px);
}

/* ================= ADMIN PANEL DASHBOARD ================= */
.modal-card.admin-card {
  max-width: 1480px !important;
  width: 96% !important;
  max-height: 94vh !important;
  background: linear-gradient(175deg, #0e1424 0%, #080c16 100%) !important;
  border: 1px solid rgba(139, 92, 246, 0.3) !important;
  border-radius: 20px !important;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.85), 0 0 40px rgba(124, 58, 237, 0.15) !important;
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.admin-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-shield-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.5));
}

.admin-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-title-row h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #f8fafc;
}

.badge-admin-master {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 9px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(99, 102, 241, 0.35));
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.4);
}

.admin-subtitle {
  color: #94a3b8;
  font-size: 0.82rem;
  display: block;
  margin-top: 2px;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px !important;
  font-size: 0.82rem !important;
  border-radius: 8px !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-modal-body {
  flex: 1;
  min-height: 0;
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Stat Cards Grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 768px) {
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.admin-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.admin-stat-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateY(-2px);
}

.admin-stat-icon {
  font-size: 1.7rem;
  line-height: 1;
}

.admin-stat-data {
  display: flex;
  flex-direction: column;
}

.admin-stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.admin-stat-label {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 1px;
}

.stat-card-warning .admin-stat-num {
  color: #f87171;
}

/* Toolbar */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-search-wrap {
  flex: 1;
  min-width: 240px;
  position: relative;
  display: flex;
  align-items: center;
}

.admin-search-wrap svg {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: #64748b;
  pointer-events: none;
}

.admin-search-wrap input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 38px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #f8fafc;
  font-size: 0.88rem;
  transition: all 0.2s;
}

.admin-search-wrap input:focus {
  background: rgba(255, 255, 255, 0.07);
  border-color: #8b5cf6;
  outline: none;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.25);
}

.admin-select {
  height: 40px;
  padding: 0 14px;
  background: #151b2e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}

/* Users Table */
.admin-users-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.4);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
}

.admin-table th {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
  color: #cbd5e1;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.admin-table tr.user-row-blocked td {
  background: rgba(239, 68, 68, 0.05);
}

/* User Identity Cell */
.user-identity-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.user-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #cbd5e1;
  font-size: 0.85rem;
}

.user-names-wrap {
  display: flex;
  flex-direction: column;
}

.user-display-name {
  font-weight: 600;
  color: #f1f5f9;
}

.user-sub-email {
  font-size: 0.75rem;
  color: #64748b;
}

.auth-provider-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  margin-top: 3px;
  width: fit-content;
}

/* Platform Badges */
.admin-platforms-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
}

.plat-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  white-space: nowrap;
}

.plat-badge-pill.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.plat-badge-empty {
  color: #64748b;
  font-size: 0.78rem;
  font-style: italic;
}

/* AI badge */
.ai-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Action Buttons */
.btn-action-block {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-action-block:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fff;
  transform: translateY(-1px);
}

.btn-action-unblock {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-action-unblock:hover {
  background: rgba(34, 197, 94, 0.3);
  color: #fff;
  transform: translateY(-1px);
}

.btn-action-delete {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-action-delete:hover {
  background: rgba(244, 63, 94, 0.35);
  border-color: #f43f5e;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.35);
}

.admin-actions-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.plat-badge-link {
  text-decoration: none !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.plat-badge-link:hover {
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: #34d399 !important;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.3);
}

.user-link {
  text-decoration: none !important;
  color: #f1f5f9;
  transition: color 0.2s;
}

.user-link:hover {
  color: #a855f7 !important;
  text-decoration: underline !important;
}

.admin-diag-collapse {
  width: 100%;
}

.admin-diag-collapse details {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.admin-diag-collapse details[open] {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(168, 85, 247, 0.45);
}

.admin-diag-collapse summary {
  cursor: pointer;
  padding: 12px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #f8fafc;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  list-style: none;
  user-select: none;
  word-break: break-word;
  white-space: normal;
  line-height: 1.35;
  transition: all 0.2s ease;
}

.admin-diag-collapse summary::-webkit-details-marker {
  display: none;
}

.admin-diag-collapse summary::after {
  content: '▾';
  font-size: 1.15rem;
  color: #c084fc;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.admin-diag-collapse details[open] summary::after {
  transform: rotate(180deg);
}

.admin-diag-collapse summary:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.admin-diag-inner {
  padding: 0 14px 14px 14px;
}

/* Desktop defaults for semantic labels */
.admin-cell-label {
  display: none;
}

.admin-dates-wrap {
  font-size: 0.8rem;
  line-height: 1.4;
}

.admin-mobile-row {
  display: block;
}

/* ================= MOBILE ADAPTATION FOR ADMIN PANEL ================= */
@media (max-width: 768px) {
  /* Admin Modal Container */
  .modal-backdrop#adminDashboardModal {
    padding: 6px !important;
    align-items: flex-start !important;
    overflow-y: auto !important;
  }

  .modal-card.admin-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100vh - 12px) !important;
    border-radius: 14px !important;
    margin: 0 auto !important;
  }

  /* Admin Header */
  .admin-modal-header {
    padding: 12px 14px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .admin-header-title-wrap {
    width: 100% !important;
    gap: 8px !important;
  }

  .admin-shield-icon {
    font-size: 1.4rem !important;
  }

  .admin-title-row {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
  }

  .admin-title-row h2 {
    font-size: 1.05rem !important;
    line-height: 1.25 !important;
  }

  .badge-admin-master {
    font-size: 0.65rem !important;
    padding: 2px 7px !important;
  }

  .admin-subtitle {
    font-size: 0.74rem !important;
    line-height: 1.3 !important;
  }

  .admin-header-actions {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
    padding-top: 8px !important;
  }

  /* Admin Modal Body */
  .admin-modal-body {
    padding: 12px 10px !important;
    gap: 12px !important;
  }

  /* Stats Grid */
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .admin-stat-card {
    padding: 8px 10px !important;
    border-radius: 10px !important;
    gap: 8px !important;
  }

  .admin-stat-icon {
    font-size: 1.35rem !important;
  }

  .admin-stat-num {
    font-size: 1.15rem !important;
  }

  .admin-stat-label {
    font-size: 0.64rem !important;
    line-height: 1.2 !important;
  }

  /* Toolbar Search & Filter */
  .admin-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .admin-search-wrap,
  .admin-filter-wrap {
    width: 100% !important;
    min-width: 0 !important;
  }

  .admin-search-wrap input {
    height: 38px !important;
    font-size: 0.82rem !important;
  }

  .admin-select {
    width: 100% !important;
    height: 38px !important;
    font-size: 0.82rem !important;
  }

  /* Table to Card View Transformation */
  .admin-users-table-wrap {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    overflow-x: visible !important;
  }

  .admin-table {
    display: block !important;
    width: 100% !important;
  }

  .admin-table thead {
    display: none !important;
  }

  .admin-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .admin-table tr {
    display: flex !important;
    flex-direction: column !important;
    gap: 9px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    transition: all 0.2s ease !important;
  }

  .admin-table tr.user-row-blocked {
    background: rgba(239, 68, 68, 0.08) !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
  }

  .admin-table td {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  .admin-td-user {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    padding-bottom: 9px !important;
  }

  .user-identity-cell {
    min-width: 0 !important;
    width: 100% !important;
  }

  .admin-cell-label {
    display: inline-block !important;
    font-size: 0.7rem !important;
    color: #94a3b8 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.4px !important;
    min-width: 65px !important;
    flex-shrink: 0 !important;
  }

  .admin-mobile-row {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    width: 100% !important;
  }

  .admin-dates-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    font-size: 0.78rem !important;
  }

  .admin-platforms-cell {
    max-width: 100% !important;
    flex: 1 !important;
  }

  .plat-badge-pill {
    font-size: 0.72rem !important;
    padding: 2px 7px !important;
  }

  .admin-actions-cell {
    display: flex !important;
    width: 100% !important;
    gap: 8px !important;
    padding-top: 8px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
  }

  .btn-action-block,
  .btn-action-unblock,
  .btn-action-delete {
    flex: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 38px !important;
    font-size: 0.8rem !important;
    padding: 8px 10px !important;
  }

  /* Admin Auth Modal on Mobile */
  .modal-card.auth-card {
    width: 95% !important;
    max-width: 100% !important;
  }

  /* Diagnostics on Mobile */
  .admin-diag-collapse {
    width: 100% !important;
    margin: 4px 0 !important;
  }

  .admin-diag-collapse summary {
    font-size: 0.84rem !important;
    padding: 10px 12px !important;
    line-height: 1.35 !important;
    color: #f8fafc !important;
    font-weight: 600 !important;
    white-space: normal !important;
    word-break: break-word !important;
  }

  /* Feedback Modal on Mobile */
  #feedbackModal .modal-card {
    max-height: 94vh !important;
    width: 96% !important;
    border-radius: 14px !important;
  }

  #feedbackModal .modal-body {
    padding: 14px !important;
    gap: 12px !important;
  }

  #feedbackModal .modal-footer {
    padding: 10px 14px !important;
  }
}

@media (max-width: 480px) {
  .admin-header-title-wrap {
    flex-direction: row !important;
  }

  .admin-title-row h2 {
    font-size: 0.95rem !important;
  }

  .admin-stat-num {
    font-size: 1.05rem !important;
  }

  .admin-stat-icon {
    font-size: 1.2rem !important;
  }
}

/* Password visibility toggle eye */
.password-wrap,
.auth-input-wrap.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-wrap input {
  width: 100%;
  padding-right: 44px !important;
}

.auth-input-wrap.password-wrap input {
  padding-left: 44px !important;
  padding-right: 44px !important;
}

.btn-toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  padding: 0;
  width: 34px;
  height: 34px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: #f1f5f9;
  border-radius: 8px;
  transition: all 0.2s ease;
  z-index: 10;
}

.btn-toggle-password svg {
  width: 20px !important;
  height: 20px !important;
  display: block;
  stroke: currentColor;
  fill: none;
  pointer-events: none;
}

.btn-toggle-password:hover {
  color: #ffffff;
  background: rgba(168, 85, 247, 0.3);
  border-color: #a855f7;
}

.btn-toggle-password.active {
  color: #c084fc;
  border-color: #c084fc;
  background: rgba(168, 85, 247, 0.25);
}

/* AI Vision Keyframes Bar */
.ai-vision-bar {
  margin-top: 10px;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.3s ease;
}

.ai-vision-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #e2e8f0;
}

.ai-vision-icon {
  font-size: 1rem;
}

.ai-vision-badge {
  background: rgba(168, 85, 247, 0.25);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #d8b4fe;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.ai-vision-frames {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.ai-vision-thumb {
  width: 72px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.ai-vision-thumb:hover {
  transform: scale(1.08);
  border-color: #c084fc;
}

/* ==========================================================================
   Audio Mixing & Soundscape Engine Styles (Premium Glassmorphic Edition)
   ========================================================================== */

.audio-card {
  background: linear-gradient(145deg, rgba(24, 24, 46, 0.95) 0%, rgba(13, 17, 30, 0.98) 100%) !important;
  border: 1.5px solid rgba(139, 92, 246, 0.4) !important;
  border-radius: 22px !important;
  padding: 24px !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.7), 0 0 35px rgba(124, 58, 237, 0.18) !important;
  backdrop-filter: blur(20px) !important;
  transition: all 0.35s ease !important;
  margin-bottom: 24px !important;
}

.audio-card::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.25) 0%, rgba(0, 0, 0, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.audio-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.audio-title-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.audio-badge-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
  flex-shrink: 0;
  position: relative;
}

.audio-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.audio-title {
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  margin: 0 !important;
  letter-spacing: -0.02em;
}

.audio-tag-badge {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(236, 72, 153, 0.3));
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #e9d5ff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.audio-subtitle {
  font-size: 0.85rem !important;
  color: #a5b4fc !important;
  margin: 4px 0 0 0 !important;
}

/* Mode Segmented Selector */
.audio-mode-segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

@media (max-width: 768px) {
  .audio-mode-segmented {
    grid-template-columns: 1fr;
  }
}

.audio-mode-option {
  position: relative;
  background: rgba(15, 23, 42, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 13px 15px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  display: block;
}

.audio-mode-option input[type="radio"] {
  display: none;
}

.audio-mode-option:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(168, 85, 247, 0.45);
  transform: translateY(-2px);
}

.audio-mode-option.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22) 0%, rgba(139, 92, 246, 0.3) 100%) !important;
  border-color: #a855f7 !important;
  box-shadow: 0 0 0 1.5px #a855f7, 0 8px 24px rgba(139, 92, 246, 0.35) !important;
}

.audio-mode-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.94rem;
  font-weight: 700;
  color: #f8fafc;
}

.mode-badge {
  margin-left: auto;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 12px;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.mode-desc {
  display: block;
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 6px;
  line-height: 1.35;
}

.audio-mode-option.active .mode-desc {
  color: #cbd5e1;
}

/* Audio Panel */
.audio-panel {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeIn 0.3s ease;
}

/* Action Bar: strictly 1 row on all devices */
.audio-action-bar {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 10px !important;
  background: rgba(15, 23, 42, 0.55) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  padding: 8px 10px !important;
  align-items: center !important;
}

.btn-audio-action-tab {
  background: rgba(30, 41, 59, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 10px 8px !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  transition: all 0.2s ease !important;
  width: 100% !important;
}

.btn-audio-action-tab:hover {
  background: rgba(51, 65, 85, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
}

.btn-audio-action-tab.btn-upload-music {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%) !important;
  border-color: rgba(168, 85, 247, 0.5) !important;
  color: #ffffff !important;
  box-shadow: 0 3px 12px rgba(139, 92, 246, 0.35) !important;
}

.btn-audio-action-tab.btn-upload-music:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%) !important;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.55) !important;
}

@media (max-width: 480px) {
  .audio-action-bar {
    gap: 6px !important;
    padding: 6px 8px !important;
  }
  .btn-audio-action-tab {
    padding: 8px 4px !important;
    font-size: 0.76rem !important;
    gap: 4px !important;
  }
}

/* Grid Header */
.audio-grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.grid-section-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #f1f5f9;
}

.grid-duration-info {
  font-size: 0.8rem;
  color: #c084fc;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
}

/* Tracks Grid */
.audio-tracks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.audio-track-card {
  background: rgba(15, 23, 42, 0.72) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: 16px !important;
  padding: 16px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  gap: 12px !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
  backdrop-filter: blur(10px) !important;
}

.audio-track-card:hover {
  background: rgba(30, 41, 59, 0.85) !important;
  border-color: rgba(168, 85, 247, 0.5) !important;
  transform: translateY(-3px) !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45) !important;
}

.audio-track-card.active {
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.35) 0%, rgba(67, 56, 202, 0.4) 100%) !important;
  border-color: #a855f7 !important;
  box-shadow: 0 0 0 1.5px #a855f7, 0 10px 26px rgba(139, 92, 246, 0.4) !important;
}

.audio-track-card.active::before {
  content: '✓ Выбран';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.25);
  border: 1px solid rgba(16, 185, 129, 0.5);
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: 0.02em;
}

.audio-track-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.audio-track-icon {
  font-size: 1.7rem;
  line-height: 1;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.audio-track-meta {
  flex: 1;
  min-width: 0;
}

.audio-track-title {
  font-size: 0.96rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 20px;
}

.audio-track-label {
  font-size: 0.78rem;
  color: #c4b5fd;
  font-weight: 600;
  margin-top: 2px;
}

.audio-track-desc {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.35;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.audio-track-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
}

.audio-track-time {
  font-size: 0.76rem;
  color: #94a3b8;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.audio-track-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-track-play {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.95rem !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.btn-track-play:hover {
  background: #8b5cf6 !important;
  border-color: #c084fc !important;
  transform: scale(1.1) !important;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.6) !important;
}

.btn-track-play.playing {
  background: #10b981 !important;
  border-color: #34d399 !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.7) !important;
}

.btn-track-like {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.12) !important;
  color: #94a3b8 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1rem !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.btn-track-like:hover {
  color: #f43f5e !important;
  border-color: rgba(244, 63, 94, 0.5) !important;
  background: rgba(244, 63, 94, 0.18) !important;
  transform: scale(1.1) !important;
}

.btn-track-like.liked {
  color: #ffffff !important;
  border-color: #f43f5e !important;
  background: linear-gradient(135deg, #f43f5e, #fb7185) !important;
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.6) !important;
}

/* Soundwave bars */
.track-soundwave {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 14px;
  margin-left: 6px;
}

.track-soundwave span {
  width: 2.5px;
  background: #10b981;
  border-radius: 2px;
  animation: wavePulse 0.8s infinite ease-in-out alternate;
}

.track-soundwave span:nth-child(1) { height: 5px; animation-delay: 0.1s; }
.track-soundwave span:nth-child(2) { height: 13px; animation-delay: 0.3s; }
.track-soundwave span:nth-child(3) { height: 8px; animation-delay: 0.2s; }
.track-soundwave span:nth-child(4) { height: 14px; animation-delay: 0.4s; }

/* Audio Bottom Bar: Volume & Preview */
.audio-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 16px 20px;
  flex-wrap: wrap;
  gap: 18px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.video-audio-bar {
  margin-top: 14px;
  background: linear-gradient(135deg, rgba(20, 24, 44, 0.95) 0%, rgba(13, 17, 32, 0.98) 100%) !important;
  border: 1.5px solid rgba(139, 92, 246, 0.45) !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.6), 0 0 24px rgba(124, 58, 237, 0.2) !important;
}

.audio-volume-wrap {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.audio-vol-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
  color: #cbd5e1;
}

.vol-label-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vol-value {
  color: #c084fc;
  font-size: 0.94rem;
  font-weight: 700;
}

.audio-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.16);
  outline: none;
  cursor: pointer;
  accent-color: #8b5cf6;
  transition: all 0.2s ease;
}

.vol-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #64748b;
}

.audio-preview-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-audio-preview {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 14px !important;
  padding: 12px 22px !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
  cursor: pointer !important;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.45) !important;
  transition: all 0.25s ease !important;
}

.btn-audio-preview:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.65) !important;
}

.btn-audio-preview.playing {
  background: linear-gradient(135deg, #0d9488 0%, #059669 100%) !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.75), 0 4px 14px rgba(0, 0, 0, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
}


.preview-btn-label {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.25;
}

.preview-btn-title {
  font-weight: 800;
  font-size: 0.95rem;
}

.preview-btn-sub {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.85;
}

.btn-audio-revert {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #cbd5e1 !important;
  border-radius: 12px !important;
  padding: 12px 18px !important;
  font-size: 0.86rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.btn-audio-revert:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  color: #ffffff !important;
}

.audio-tip-banner {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(99, 102, 241, 0.15) 100%);
  border-left: 3.5px solid #a855f7;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.82rem;
  color: #e2e8f0;
  line-height: 1.45;
}

/* Favorites Modal */
.audio-fav-card {
  max-width: 560px;
  width: 92%;
  background: #1e293b;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.audio-fav-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  margin-top: 16px;
}

.audio-fav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 16px;
  gap: 14px;
  transition: all 0.2s ease;
}

.audio-fav-item:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(168, 85, 247, 0.45);
}

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

.audio-fav-item-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: #f8fafc;
}

.audio-fav-item-sub {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 2px;
}

.audio-fav-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Toggle checkbox: Enable audio overlay */
.audio-enable-toggle-wrap {
  margin-top: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 10px 16px;
  transition: all 0.25s ease;
}

.audio-enable-toggle-wrap:hover {
  border-color: rgba(139, 92, 246, 0.45);
  background: rgba(20, 28, 50, 0.85);
}

.audio-enable-label {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
  width: 100%;
}

.audio-enable-checkbox {
  display: none;
}

.audio-custom-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  transition: background 0.25s ease, box-shadow 0.25s ease;
  flex-shrink: 0;
}

.audio-custom-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
}

.audio-enable-checkbox:checked + .audio-custom-switch {
  background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.55);
}

.audio-enable-checkbox:checked + .audio-custom-switch::after {
  transform: translateX(20px);
}

.audio-enable-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.audio-enable-text strong {
  font-size: 0.94rem;
  color: #f8fafc;
  font-weight: 700;
}

.audio-enable-text small {
  font-size: 0.76rem;
  color: #94a3b8;
}

/* Track Selector Button Under Preview */
.audio-track-selector-bar {
  margin-top: 12px;
  width: 100%;
}

.btn-open-music-modal {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 1.5px solid rgba(139, 92, 246, 0.45);
  border-radius: 14px;
  padding: 10px 18px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.btn-open-music-modal:hover {
  background: linear-gradient(135deg, rgba(49, 46, 129, 0.6) 0%, rgba(30, 27, 75, 0.85) 100%);
  border-color: #a855f7;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35);
}

.open-music-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.music-pill-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 3px 10px rgba(139, 92, 246, 0.4);
  flex-shrink: 0;
}

.btn-select-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.2px;
}

.btn-select-arrow {
  color: #a855f7;
  font-size: 1.15rem;
  transition: transform 0.2s ease;
}

.btn-open-music-modal:hover .btn-select-arrow {
  transform: translateX(4px);
  color: #c084fc;
}

/* Modal dialog for audio tracks */
.audio-modal-card {
  max-width: 680px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  border: 1.5px solid rgba(139, 92, 246, 0.35);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(139, 92, 246, 0.2);
  overflow: hidden;
}

.audio-modal-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.audio-modal-icon {
  font-size: 1.5rem;
}

.audio-modal-sub {
  font-size: 0.82rem;
  color: #94a3b8;
  margin: 2px 0 0 0;
}

.audio-modal-body {
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
}

.audio-modal-footer {
  padding: 14px 20px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Media Meta Bar */
.media-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
  gap: 10px;
}

.media-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.media-format-badge {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(168, 85, 247, 0.3) 100%);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #c084fc;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.media-meta-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-text-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-text-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.btn-text-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-text-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: #ffffff;
}

/* 3 Horizontal Modes */
.audio-horizontal-modes {
  display: flex;
  gap: 10px;
  width: 100%;
}

.audio-mode-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  background: rgba(30, 41, 59, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: #94a3b8;
  outline: none;
}

.audio-mode-tab:hover {
  background: rgba(51, 65, 85, 0.7);
  border-color: rgba(148, 163, 184, 0.3);
  color: #f1f5f9;
  transform: translateY(-1px);
}

.audio-mode-tab.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(168, 85, 247, 0.25) 100%);
  border-color: #818cf8;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25), inset 0 0 12px rgba(129, 140, 248, 0.15);
}

.mode-tab-icon {
  font-size: 1.6rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.mode-tab-label {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* Generator & Style wrap */
.audio-gen-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: opacity 0.2s ease;
}

.audio-gen-wrap.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.audio-style-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.audio-field-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.audio-select-container {
  position: relative;
  width: 100%;
}

.styled-music-select {
  width: 100%;
  padding: 11px 14px;
  background: #1e293b;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #f8fafc;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.styled-music-select:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.styled-music-select option {
  background: #0f172a;
  color: #f8fafc;
  padding: 10px;
}

.audio-prompt-field {
  width: 100%;
}

.audio-prompt-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.styled-prompt-input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #f8fafc;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.styled-prompt-input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.styled-prompt-input::placeholder {
  color: #64748b;
}

.audio-duration-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 12px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 10px;
  color: #a5b4fc;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Actions Row */
.audio-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-audio-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-audio-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
}

.btn-audio-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: #e2e8f0;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-audio-secondary:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.btn-audio-fav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: 10px;
  color: #fda4af;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.2s ease;
}

.btn-audio-fav-link:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: #f43f5e;
  color: #ffffff;
}

/* Single-row tracks section */
.audio-tracks-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.audio-tracks-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}

.tracks-list-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.tracks-list-sub {
  font-size: 0.75rem;
  color: #64748b;
}

.audio-single-tracks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Strict 1-row Track item */
.audio-track-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 12px;
}

.audio-track-row:hover {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateX(2px);
}

.audio-track-row.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.12) 100%);
  border-color: #818cf8;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25);
}

.track-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.track-row-icon {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
}

.track-row-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.track-row-dur {
  font-size: 0.78rem;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 2px;
}

.track-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-track-row-action {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-track-row-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.btn-track-play.playing {
  background: rgba(99, 102, 241, 0.25);
  border-color: #818cf8;
  color: #a5b4fc;
}

.btn-track-like.liked {
  background: rgba(244, 63, 94, 0.2);
  border-color: #f43f5e;
  color: #f43f5e;
}

.btn-track-delete:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #f87171;
}

.audio-empty-hint {
  text-align: center;
  padding: 18px 10px;
  color: #64748b;
  font-size: 0.85rem;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

/* Header Music Button */
.btn-header-music {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
  border: 1.5px solid rgba(6, 182, 212, 0.4);
  border-radius: 10px;
  color: #67e8f9;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-header-music:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.35) 0%, rgba(99, 102, 241, 0.35) 100%);
  border-color: #22d3ee;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.25);
}
.open-music-text-group {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 2px;
}
.btn-select-sub {
  font-size: 0.74rem;
  color: #94a3b8;
  font-weight: 400;
}

/* Studio Music Catalog & URL Buttons */
.btn-audio-studio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 15px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25) 0%, rgba(59, 130, 246, 0.25) 100%);
  border: 1.5px solid rgba(6, 182, 212, 0.4);
  border-radius: 10px;
  color: #67e8f9;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-audio-studio:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.4) 0%, rgba(59, 130, 246, 0.4) 100%);
  border-color: #22d3ee;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.btn-audio-url {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: #93c5fd;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-audio-url:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: #60a5fa;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Studio Catalog Modal Layout */
.audio-catalog-card {
  width: 100%;
  max-width: 680px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 90vh;
}

.audio-catalog-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  max-height: calc(90vh - 140px);
}

/* Top Switcher Tabs */
.catalog-top-nav {
  display: flex;
  gap: 8px;
  padding: 4px;
  background: rgba(30, 41, 59, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.catalog-nav-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.catalog-nav-tab.active {
  background: #1e293b;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.catalog-nav-tab:hover:not(.active) {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.04);
}

/* Search & Refresh */
.catalog-search-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.catalog-search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: border-color 0.2s ease;
}
.catalog-search-wrap:focus-within {
  border-color: #22d3ee;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.catalog-search-icon {
  font-size: 0.95rem;
  color: #64748b;
}

.catalog-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-size: 0.88rem;
}
.catalog-search-input::placeholder {
  color: #64748b;
}

.btn-search-clear {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.btn-search-clear:hover {
  color: #ffffff;
}

.btn-catalog-refresh {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-catalog-refresh:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #ffffff;
  transform: rotate(45deg);
}

/* Category Pills Bar (Horizontal Scroll) */
.catalog-categories-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.catalog-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}
.catalog-cat-pill:hover {
  background: rgba(51, 65, 85, 0.7);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.18);
}
.catalog-cat-pill.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
  border-color: #22d3ee;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.2);
}

/* Tracks List */
.catalog-tracks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Track Card */
.catalog-track-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  transition: all 0.2s ease;
}
.catalog-track-card:hover {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.catalog-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.catalog-card-btn-play {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 0.95rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.catalog-card-btn-play:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: #22d3ee;
  transform: scale(1.08);
}
.catalog-card-btn-play.playing {
  background: rgba(6, 182, 212, 0.3);
  border-color: #22d3ee;
  color: #67e8f9;
}

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

.catalog-card-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.catalog-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.catalog-card-badge {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #67e8f9;
  font-weight: 600;
  white-space: nowrap;
}

.catalog-card-desc {
  display: none !important;
}

.catalog-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-catalog-select-track {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(16, 185, 129, 0.16);
  border: 1.5px solid rgba(16, 185, 129, 0.4);
  border-radius: 10px;
  color: #34d399;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}
.btn-catalog-select-track:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #34d399;
  color: #ffffff;
  transform: translateY(-1px) scale(1.06);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
.btn-catalog-select-track .check-svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

/* URL Import Card */
.url-import-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}

.url-import-info {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  background: rgba(30, 41, 59, 0.5);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.url-info-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.url-import-info h4 {
  margin: 0 0 4px 0;
  font-size: 0.9rem;
  color: #f8fafc;
  font-weight: 600;
}
.url-import-info p {
  margin: 0;
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.45;
}

.url-import-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.url-field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.url-field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5e1;
}

.url-actions-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.url-status-msg {
  font-size: 0.82rem;
  color: #94a3b8;
}

.catalog-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 10px;
  color: #94a3b8;
  font-size: 0.88rem;
}

.spinner-circle {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #22d3ee;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.hidden {
  display: none !important;
}

/* Header Mobile Responsive */
@media (max-width: 640px) {
  .app-header {
    padding: 10px 4px;
    gap: 8px;
  }
  .header-actions {
    gap: 6px;
    flex-shrink: 0;
  }
  .header-tools {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }
  .btn-header-music {
    padding: 0 !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    justify-content: center !important;
    border-radius: 12px !important;
  }
  .btn-header-music .btn-music-text {
    display: none !important;
  }
  .btn-header-music .btn-music-icon {
    font-size: 1.15rem !important;
    line-height: 1 !important;
    margin: 0 !important;
  }
  .btn-icon {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 12px !important;
  }
  .btn-icon svg {
    width: 20px !important;
    height: 20px !important;
  }
  .btn-auth-trigger {
    padding: 7px 10px !important;
    font-size: 0.8rem !important;
  }
}

@media (max-width: 420px) {
  .logo-text h1 {
    font-size: 1.12rem !important;
  }
  .logo-icon {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
  }
  .logo-icon svg {
    width: 18px !important;
    height: 18px !important;
  }
  .badge-status {
    display: none !important;
  }
  .btn-auth-trigger span {
    display: none !important;
  }
  .btn-auth-trigger {
    padding: 0 !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    justify-content: center !important;
    border-radius: 12px !important;
  }
}
