/* =========================================================
   DUET KARAOKE MAKER - ULTRA-LITE & PREMIUM STYLING
   ========================================================= */

:root {
  --bg-primary: #0a0c10;
  --bg-secondary: #10141e;
  --bg-card: #131722;
  --bg-card-hover: #181e2c;
  --border-subtle: #22293a;
  --border-focus: #38bdf8;

  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-faint: #94a3b8;

  /* Duet Accent Colors */
  --singer-1: #ffff00;
  --singer-2: #ff00ff;
  --singer-3: #ff0000;
  --brand-cyan: #38bdf8;
  --brand-purple: #0284c7;

  --accent-primary: #0284c7;
  --accent-gradient: #0284c7;
  --accent-glow: 0 0 12px rgba(14, 165, 233, 0.25);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* App Container */
.app-container {
  max-width: 1680px;
  margin: 0 auto;
  padding: 16px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Modern App Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: rgba(15, 20, 32, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px -4px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(56, 189, 248, 0.06);
  position: relative;
  z-index: 50;
  gap: 16px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.app-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 30px;
  right: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.4), rgba(168, 85, 247, 0.4), transparent);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: rgba(15, 23, 42, 0.7);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  overflow: hidden;
  padding: 3px;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
}

.brand:hover .brand-icon {
  transform: scale(1.08);
  box-shadow: 0 0 24px rgba(14, 165, 233, 0.45);
  border-color: rgba(56, 189, 248, 0.35);
}


.brand-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-text h1 {
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f8fafc;
  line-height: 1.2;
}

.brand-badge {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(168, 85, 247, 0.18));
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  text-transform: uppercase;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.2;
}

/* Modern Top Navigation Bar */
.app-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.25);
  padding: 3px 5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-sans);
}

.nav-link:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.07);
}

.nav-link.active {
  color: #ffffff;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

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



/* Workspace Grid: 2-Column Top (Audio Left, Styling Right) + Full-Width Center (Lyrics Studio) + Full-Width Bottom (Canvas Preview) */
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.audio-panel {
  grid-column: 1;
}

.settings-panel {
  grid-column: 2;
}

.lyrics-panel {
  grid-column: 1 / -1;
  width: 100%;
}

.workspace-preview-row {
  grid-column: 1 / -1;
  width: 100%;
  margin: 14px 0 8px 0;
}

.btn-preview-full {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 28px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 40%, #0f172a 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-lg, 14px);
  color: #ffffff;
  font-family: var(--font-main, 'Outfit', sans-serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.btn-preview-full::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: 0.6s;
}

.btn-preview-full:hover::before {
  left: 100%;
}

.btn-preview-full:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 45%, #1e293b 100%);
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 10px 28px rgba(14, 165, 233, 0.45), 0 0 15px rgba(56, 189, 248, 0.3);
}

.btn-preview-full:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.3);
}

.btn-preview-full svg {
  color: #38bdf8;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.6));
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.btn-preview-full:hover svg {
  transform: scale(1.15);
  color: #ffffff;
}

/* ==========================================
   3RD IMAGE: REAL-TIME LIVE CANVAS PREVIEW
   ========================================== */
.preview-panel {
  grid-column: 1 / -1;
  width: 100%;
  margin: 28px 0 36px 0;
  padding: 40px 48px 36px 48px;
  border-radius: 24px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: radial-gradient(circle at 50% 0%, rgba(14, 165, 233, 0.05) 0%, rgba(19, 23, 34, 0.98) 75%), var(--bg-card);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

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

.preview-title-box h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.preview-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.canvas-stage-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 18px;
  overflow: hidden;
  margin: 18px 0 24px 0;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

#karaoke-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Live Preview Diagonal Overlay (Anti-Screen-Recording) */
.preview-diagonal-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-25deg);
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.1rem, 2.8vw, 2.2rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.22);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 8;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.canvas-overlay-guide {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.guide-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
  display: flex;
  justify-content: flex-end;
}

.guide-line span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.6);
  padding: 0 4px;
}

.guide-slot {
  position: absolute;
  left: 10px;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.canvas-control-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 8px 10px 4px 10px;
  margin-top: 6px;
  flex-wrap: wrap;
  gap: 12px;
}

.toggle-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.slot-indicator {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Anti-Screen-Recording Security Badge */
.anti-record-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: help;
  user-select: none;
  transition: all 0.2s ease;
}

.anti-record-badge:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
}

.shield-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: shieldPulseAnim 2s infinite ease-in-out;
}

@keyframes shieldPulseAnim {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Active Screen Recording Interception Alert Overlay */
.canvas-record-alert {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 20, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 24px;
  animation: fadeInRecordAlert 0.25s ease-out;
}

@keyframes fadeInRecordAlert {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.record-alert-content {
  background: #0f172a;
  border: 1px solid rgba(239, 68, 68, 0.45);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 460px;
  text-align: center;
}

.record-alert-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.record-alert-content h4 {
  font-size: 1.15rem;
  color: #f87171;
  font-weight: 700;
  margin-bottom: 8px;
}

.record-alert-content p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

.record-alert-note {
  font-size: 0.78rem;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 16px;
  border-left: 3px solid var(--accent);
  text-align: left;
}

/* =========================================================
   CANVAS STAGE FULLSCREEN & THEATER MODE (ZERO PERMISSIONS CRASH)
   ========================================================= */
.canvas-stage-wrapper:fullscreen,
.canvas-stage-wrapper:-webkit-full-screen,
.canvas-stage-wrapper.theater-fullscreen-active {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  z-index: 999999 !important;
  background: #000000 !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}

.canvas-stage-wrapper:fullscreen #karaoke-canvas,
.canvas-stage-wrapper:-webkit-full-screen #karaoke-canvas,
.canvas-stage-wrapper.theater-fullscreen-active #karaoke-canvas {
  width: auto !important;
  height: auto !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  aspect-ratio: 16 / 9;
  object-fit: contain !important;
  margin: auto !important;
}

body.theater-mode-open {
  overflow: hidden !important;
}

/* Floating Exit Fullscreen Button on Stage */
.btn-stage-exit-fs {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #f8fafc;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 10px;
  padding: 8px 18px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 1000001;
  display: none;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  transition: all 0.2s ease;
}

.btn-stage-exit-fs:hover {
  background: rgba(2, 132, 199, 0.95);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.canvas-stage-wrapper:fullscreen .btn-stage-exit-fs,
.canvas-stage-wrapper:-webkit-full-screen .btn-stage-exit-fs,
.canvas-stage-wrapper.theater-fullscreen-active .btn-stage-exit-fs {
  display: inline-flex !important;
}

/* Download Section (After Preview Window) */
.download-panel {
  grid-column: 1 / -1;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.download-header-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 14px;
}

.download-header-row h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}

.download-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.download-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 0 4px 0;
}

.download-main-btn {
  width: 100%;
  max-width: 600px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 28px;
  font-size: 1.15rem;
  font-weight: 700;
  border-radius: var(--radius-lg, 14px);
  background: linear-gradient(135deg, #059669 0%, #0d9488 45%, #0284c7 100%);
  border: 1px solid rgba(52, 211, 153, 0.35);
  box-shadow: 0 8px 24px rgba(5, 150, 105, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: #ffffff;
  cursor: pointer;
}

.download-main-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #10b981 0%, #14b8a6 45%, #0ea5e9 100%);
  border-color: rgba(52, 211, 153, 0.6);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.45), 0 0 18px rgba(20, 184, 166, 0.3);
}

.download-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

@media (max-width: 1100px) {
  .workspace-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .audio-panel,
  .settings-panel,
  .lyrics-panel,
  .workspace-preview-row,
  .preview-panel,
  .download-panel {
    grid-column: 1;
  }
}

/* Panels */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #0284c7;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-title-row h2 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.hint-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: auto;
  font-family: var(--font-mono);
}

/* YouTube Duet Importer Card */
.youtube-importer-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
}

.yt-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.yt-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--text-main);
}

.yt-toggle-key-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.2s ease;
}

.yt-toggle-key-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.25);
}

.yt-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.35;
}

.yt-input-group {
  display: flex;
  gap: 8px;
}

.yt-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-main);
  font-size: 0.84rem;
  transition: border-color 0.2s;
}

.yt-input:focus {
  outline: none;
  border-color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

.btn-yt-fetch {
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 0.15s, transform 0.15s;
}

.btn-yt-fetch:hover:not(:disabled) {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-yt-fetch:disabled {
  background: #1f2937;
  color: #6b7280;
  cursor: not-allowed;
}

.yt-key-drawer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.yt-key-inner {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.yt-key-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.yt-key-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.72rem;
}

.yt-key-link:hover {
  text-decoration: underline;
}

.yt-key-input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.yt-key-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.yt-key-hint {
  font-size: 0.68rem;
  color: var(--text-faint);
}

.yt-status-box {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--accent-primary);
}

.yt-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 242, 254, 0.2);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.or-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 10px 0;
  color: var(--text-faint);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1px;
}

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

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

/* Audio Dropzone */
.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(10, 12, 20, 0.4);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-primary);
  background: rgba(0, 242, 254, 0.05);
}

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

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.upload-icon {
  color: var(--accent-primary);
}

.dropzone-text {
  font-size: 0.92rem;
  color: var(--text-main);
}

.dropzone-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.audio-loaded-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0, 255, 255, 0.08);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: var(--radius-sm);
}

.audio-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.audio-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: #fff;
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-duration {
  font-size: 0.75rem;
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

/* Audio Player Bar (Positioned Below Preview Screen) */
.audio-player-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(13, 17, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px 22px;
  border-radius: var(--radius-lg, 14px);
  border: 1px solid rgba(56, 189, 248, 0.22);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  margin: 6px 0 22px 0;
  width: 100%;
}

.player-btn {
  background: var(--accent-gradient);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #050b14;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}

.player-btn:hover {
  transform: scale(1.06);
  box-shadow: var(--accent-glow);
}

.time-display {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 110px;
  text-align: center;
}

.scrubber-container {
  flex: 1;
  display: flex;
  align-items: center;
}

.scrubber {
  width: 100%;
  accent-color: var(--accent-primary);
  cursor: pointer;
  height: 6px;
}

.speed-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}
/* Duet Colors Grid */
.duet-colors-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.color-card {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  background: rgba(10, 12, 20, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
  overflow: hidden;
}

.color-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(15, 20, 32, 0.85);
}

.color-header {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.color-tag-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.color-tag-pill.tag-1 { background: rgba(255, 255, 0, 0.2); color: #ffff00; }
.color-tag-pill.tag-2 { background: rgba(255, 0, 255, 0.2); color: #ff00ff; }
.color-tag-pill.tag-3 { background: rgba(255, 0, 0, 0.2); color: #ff0000; }

.color-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.color-input-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  width: 30px;
  height: 30px;
  min-width: 30px;
  max-width: 30px;
  border-radius: 6px;
  cursor: pointer;
  background: none;
  flex-shrink: 0;
  padding: 0;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
}

.hex-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 5px 6px;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.5px;
}

.hex-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 8px rgba(0, 242, 254, 0.3);
}

/* Font Size Slider */
.font-size-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 12, 20, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.font-size-row input[type="range"] {
  accent-color: var(--accent-primary);
  width: 180px;
  cursor: pointer;
}

/* Lyrics Section & Header Controls */
.lyrics-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  padding-bottom: 4px;
}

.studio-fullwidth-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 2px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
}

.lyrics-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}

.btn-fullscreen-lyrics {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.btn-fullscreen-lyrics:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

/* Fullscreen Immersive Studio Mode (100vw x 100vh) */
.lyrics-panel.fullscreen-active {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  z-index: 99999 !important;
  border-radius: 0 !important;
  border: none !important;
  background: radial-gradient(circle at 50% 0%, #0d1527 0%, #060913 100%) !important;
  padding: 24px 36px 48px !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
}

/* Sticky Floating Audio Bar in Fullscreen Mode */
.lyrics-fullscreen-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  margin-bottom: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 16px rgba(56, 189, 248, 0.15);
  align-items: center;
  gap: 16px;
}

.lyrics-panel.fullscreen-active .lyrics-fullscreen-bar {
  display: flex;
}

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

.fs-play-btn {
  width: 38px;
  height: 38px;
  font-size: 0.95rem;
}

.fs-time-display {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: #38bdf8;
  min-width: 140px;
}

.fs-scrubber-box {
  flex: 1;
  display: flex;
  align-items: center;
}

.fs-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fs-shortcut-hint {
  font-size: 0.74rem;
  color: var(--text-faint);
}

.fs-shortcut-hint strong {
  color: #e2e8f0;
}

.fs-exit-btn {
  border-color: rgba(244, 63, 94, 0.4);
  color: #f43f5e;
  font-weight: 700;
  font-size: 0.76rem;
  padding: 5px 12px;
}

.fs-exit-btn:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: #f43f5e;
  color: #ffffff;
}

.mode-toggles {
  display: flex;
  background: rgba(0, 0, 0, 0.5);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mode-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}

.mode-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(14, 165, 233, 0.35));
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

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

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

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

.tag-insert-btn {
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.15s;
}

.tag-1-btn { color: #ffff00; border-color: rgba(255, 255, 0, 0.3); }
.tag-2-btn { color: #ff00ff; border-color: rgba(255, 0, 255, 0.3); }
.tag-3-btn { color: #ff0000; border-color: rgba(255, 0, 0, 0.3); }

.tag-insert-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.syntax-info {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
}

.lyrics-input {
  width: 100%;
  background: rgba(7, 9, 15, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  padding: 12px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.lyrics-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.15);
}

.lyrics-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.count-badge {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: #10b981;
}

/* =========================================================
   INTERACTIVE LYRIC LINE BUILDER & TIMING ADJUSTER
   ========================================================= */

.btn-builder-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(14, 165, 233, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-builder-toggle:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.3), rgba(14, 165, 233, 0.4));
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

/* Line Builder Panel */
.line-builder-panel {
  background: rgba(16, 20, 32, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transition: all 0.25s ease;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.builder-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.builder-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.builder-badge-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #38bdf8;
  color: #070d18;
  font-size: 0.85rem;
  font-weight: 800;
}

.builder-title-group h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.2px;
}

.builder-live-clock {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.builder-live-clock .clock-label {
  font-size: 0.7rem;
  color: var(--text-faint);
}

.builder-live-clock .clock-val {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: #38bdf8;
}

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

.builder-field-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.voice-pills-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.voice-pill {
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-faint);
  transition: all 0.15s ease;
}

.voice-pill.voice-male {
  border-color: rgba(255, 255, 0, 0.3);
  color: #ffff00;
}
.voice-pill.voice-male.active {
  background: rgba(255, 255, 0, 0.18);
  border-color: #ffff00;
  box-shadow: 0 0 10px rgba(255, 255, 0, 0.25);
}

.voice-pill.voice-female {
  border-color: rgba(255, 0, 255, 0.3);
  color: #ff00ff;
}
.voice-pill.voice-female.active {
  background: rgba(255, 0, 255, 0.18);
  border-color: #ff00ff;
  box-shadow: 0 0 10px rgba(255, 0, 255, 0.25);
}

.voice-pill.voice-duet {
  border-color: rgba(255, 0, 0, 0.3);
  color: #ff0000;
}
.voice-pill.voice-duet.active {
  background: rgba(255, 0, 0, 0.18);
  border-color: #ff0000;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.25);
}

.builder-text-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.builder-input-line {
  width: 100%;
  background: rgba(10, 14, 24, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.builder-input-line:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.builder-times-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 500px) {
  .builder-times-grid {
    grid-template-columns: 1fr;
  }
}

.builder-time-card {
  background: rgba(12, 16, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.time-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.time-card-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.btn-sync-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-sync-time:hover {
  background: rgba(56, 189, 248, 0.28);
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.time-card-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
}

.btn-nudge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 5px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  line-height: 1;
}

.btn-nudge:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: var(--border-focus);
}

.time-val-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  text-align: center;
  background: rgba(6, 9, 16, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 5px 4px;
  outline: none;
  box-sizing: border-box;
}

.time-val-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.builder-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
  width: 100%;
}

.builder-audition-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dur-presets {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dur-label {
  font-size: 0.7rem;
  color: var(--text-faint);
}

.btn-dur-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-faint);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 3px;
  cursor: pointer;
}

.btn-dur-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.btn-submit-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #00f2fe, #0072ff);
  color: #070d18;
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 114, 255, 0.3);
}

.btn-submit-line:hover {
  background: linear-gradient(135deg, #38f9d7, #00c6ff);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.4);
  transform: translateY(-1px);
}

@media (max-width: 480px) {
  .builder-footer-row {
    flex-direction: column;
    align-items: stretch;
  }
  .builder-audition-actions {
    justify-content: space-between;
    width: 100%;
  }
  .btn-submit-line {
    width: 100%;
    justify-content: center;
  }
}

/* Lyrics Box Wrapper */
.lyrics-box-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgba(7, 9, 15, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 8px;
}

.lyrics-box-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(16, 20, 32, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.lyrics-box-label {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-corner-add-line {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-corner-add-line:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #ffffff;
}

.lyrics-box-wrapper .lyrics-input {
  border: none;
  border-radius: 0;
  background: transparent;
  min-height: 280px;
}

.lyrics-footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-toggle-lines-mgr {
  font-size: 0.74rem;
  padding: 3px 10px;
}

/* Line-by-Line Timing & Text Adjuster Studio Panel */
.line-manager-panel {
  background: rgba(14, 18, 28, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.line-manager-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.line-manager-header h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.line-manager-header p {
  font-size: 0.76rem;
  color: var(--text-faint);
  line-height: 1.4;
  margin: 0;
}

.line-manager-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 440px;
  overflow-y: auto;
  padding-right: 4px;
}

.line-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 24, 38, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  transition: all 0.18s ease;
  width: 100%;
  box-sizing: border-box;
}

.line-item-row:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(22, 30, 48, 0.95);
}

.line-index-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-faint);
  min-width: 26px;
  text-align: center;
  flex-shrink: 0;
}

.line-voice-select {
  background: #090e18;
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
}

.line-time-group {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.line-time-input-sm {
  width: 68px;
  background: #080c14;
  border: 1px solid var(--border-subtle);
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 4px;
  text-align: center;
  border-radius: 3px;
}

.line-time-input-sm:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.3);
}

.line-btn-mini {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 5px;
  border-radius: 3px;
  cursor: pointer;
  line-height: 1;
}

.line-btn-mini:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #ffffff;
}

.line-dur-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.line-text-input-main {
  flex: 1 1 200px;
  min-width: 140px;
  background: #080c14;
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  font-size: 0.84rem;
  padding: 6px 10px;
  border-radius: 4px;
  outline: none;
}

.line-text-input-main:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.line-btn-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.line-btn-action:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #ffffff;
}

.line-btn-delete:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.15);
}

.line-manager-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Tap to Sync Mode */
.tap-sync-helper {
  background: rgba(10, 12, 20, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tap-sync-helper p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.tap-sync-action-bar {
  display: flex;
  gap: 10px;
}

.tap-sync-lines-list {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}

.tap-line-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.tap-line-item.active {
  border-color: var(--singer-1);
  background: rgba(0, 255, 255, 0.08);
}

.tap-line-item.synced {
  border-color: #10b981;
}

/* Right Column: Live Canvas Preview */
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-title-box h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.preview-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.canvas-stage-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 18px;
  overflow: hidden;
  margin: 18px 0 24px 0;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

#karaoke-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Live Preview Diagonal Overlay (Anti-Screen-Recording) */
.preview-diagonal-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-25deg);
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.1rem, 2.8vw, 2.2rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.22);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 8;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.canvas-overlay-guide {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.guide-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
  display: flex;
  justify-content: flex-end;
}

.guide-line span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.6);
  padding: 0 4px;
}

.guide-slot {
  position: absolute;
  left: 10px;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.canvas-control-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0 4px;
  flex-wrap: wrap;
  gap: 8px;
}

.toggle-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.slot-indicator {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Anti-Screen-Recording Security Badge */
.anti-record-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: help;
  user-select: none;
  transition: all 0.2s ease;
}

.anti-record-badge:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
}

.shield-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: shieldPulseAnim 2s infinite ease-in-out;
}

@keyframes shieldPulseAnim {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Active Screen Recording Interception Alert Overlay */
.canvas-record-alert {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 20, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 24px;
  animation: fadeInRecordAlert 0.25s ease-out;
}

@keyframes fadeInRecordAlert {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.record-alert-content {
  background: #0f172a;
  border: 1px solid rgba(239, 68, 68, 0.45);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 460px;
  text-align: center;
}

.record-alert-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.record-alert-content h4 {
  font-size: 1.15rem;
  color: #f87171;
  font-weight: 700;
  margin-bottom: 8px;
}

.record-alert-content p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

.record-alert-note {
  font-size: 0.78rem;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 16px;
  text-align: left;
}

.export-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.badge-rec {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.badge-clean {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

/* Export Hub */
.export-hub {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(10, 12, 20, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
}

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

.export-title-row h3 {
  font-size: 0.98rem;
  font-weight: 600;
}

.badge-fast {
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.export-actions-single {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0 8px 0;
  width: 100%;
}

.export-main-btn {
  width: 100%;
  padding: 15px 24px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #00f2fe 0%, #0072ff 100%);
  color: #070d18;
  font-family: var(--font-sans);
  border: 1px solid rgba(0, 242, 254, 0.5);
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 4px 22px rgba(0, 242, 254, 0.32);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.export-main-btn:hover {
  background: linear-gradient(135deg, #38f9d7 0%, #00c6ff 100%);
  box-shadow: 0 8px 30px rgba(0, 242, 254, 0.55);
  transform: translateY(-2px);
  color: #030712;
}

.export-main-btn:active {
  transform: translateY(0);
}

.export-buttons-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.export-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  gap: 16px;
}

.export-card-info h4 {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.export-card-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 500px;
}

.primary-export {
  background: #141b2b;
  border-color: var(--border-focus);
}

.compatibility-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.compat-tag {
  font-size: 0.7rem;
  font-weight: 600;
  background: #1b2336;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #050b14;
  padding: 10px 18px;
  font-size: 0.88rem;
  box-shadow: 0 4px 14px rgba(0, 242, 254, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.4);
}

.pulse-glow {
  animation: pulseGlow 1.8s infinite ease-in-out;
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 4px 14px rgba(0, 242, 254, 0.3);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 8px 26px rgba(0, 242, 254, 0.7);
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 4px 14px rgba(0, 242, 254, 0.3);
    transform: scale(1);
  }
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 8px 14px;
  font-size: 0.82rem;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 8px 14px;
  font-size: 0.82rem;
}

.btn-outline:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 12px 22px;
  font-size: 0.95rem;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  border-radius: 4px;
}

.btn-icon:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Progress Card */
.render-progress-card {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeIn 0.2s ease;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 600;
}

.progress-bar-bg {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  transition: width 0.1s linear;
}

.progress-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Download Banner */
.download-banner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  animation: fadeIn 0.3s ease;
}

.download-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.download-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.success-icon {
  font-size: 1.8rem;
}

.download-info strong {
  color: #10b981;
  font-size: 0.96rem;
}

.download-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.rendered-video-wrapper {
  width: 100%;
  max-width: 640px;
  margin: 4px auto 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  background: #000;
}

.rendered-video-wrapper video {
  width: 100%;
  display: block;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 580px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

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

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.syntax-example-box {
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-sm);
  padding: 10px;
  border: 1px solid var(--border-subtle);
}

.syntax-example-box h4 {
  font-size: 0.82rem;
  color: #fff;
  margin-bottom: 4px;
}

.syntax-example-box code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #38bdf8;
}

.syntax-example-box ul {
  padding-left: 20px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
}

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

/* =========================================================
   AUDIO SOURCE & DIARIZATION STUDIO
   ========================================================= */

.autopilot-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.autopilot-badge-row,
.autopilot-desc {
  display: none !important;
}

.autopilot-source-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  padding: 3px;
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.source-tab {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.source-tab.active {
  background: #0284c7;
  color: #ffffff;
  font-weight: 700;
}

.source-pane {
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.source-pane.active {
  display: block;
}

.btn-autopilot {
  width: 100%;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
  background: #0284c7;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-autopilot:hover:not(:disabled) {
  background: #0369a1;
  transform: translateY(-1px);
}

.btn-autopilot:disabled {
  background: #1f2937;
  color: #6b7280;
  cursor: not-allowed;
  transform: none;
}

.autopilot-options-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.autopilot-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  color: #d1d9e6;
  font-weight: 500;
}

.autopilot-check-label input {
  accent-color: var(--brand-cyan);
  width: 16px;
  height: 16px;
}

/* Stepper tracker */
.autopilot-stepper {
  background: rgba(8, 10, 16, 0.7);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.stepper-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-cyan);
}

.stepper-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
}

.stepper-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.stepper-item.active {
  color: #fff;
  font-weight: 600;
}

.stepper-item.done {
  color: #38ef7d;
}

.stepper-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.stepper-item.active .stepper-icon {
  animation: pulse 1s infinite alternate;
}

.stepper-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.stepper-bar-fill {
  height: 100%;
  width: 0%;
  background: #0284c7;
  transition: width 0.4s ease;
}

.detected-lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
  margin-left: 8px;
}

/* =========================================================
   MOBILE & TABLET RESPONSIVE PERFECTION
   Optimized for iPhones, iPads, Android Phones, Tabs & Laptops
   ========================================================= */

@media (max-width: 1024px) {
  .app-container {
    padding: 12px 14px 28px;
    gap: 14px;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .panel {
    padding: 18px 16px;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 14px;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
  }

  .app-container {
    padding: 8px 8px 24px;
    gap: 12px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .preview-panel {
    padding: 14px 10px;
    border-radius: 16px;
    margin: 10px 0 16px 0;
    width: 100%;
    box-sizing: border-box;
  }

  /* Compact Touch Header */
  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
  }

  .brand {
    justify-content: space-between;
    width: 100%;
  }

  .brand-text h1 {
    font-size: 1.12rem;
  }

  .brand-sub {
    font-size: 0.68rem;
  }

  /* Scrollable touch navigation bar */
  .app-nav {
    display: flex;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 3px;
    gap: 4px;
    justify-content: flex-start;
  }

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

  .nav-link {
    padding: 6px 10px;
    font-size: 0.72rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .header-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 8px;
  }

  .user-auth-bar {
    width: 100%;
    justify-content: space-between;
  }

  .btn-auth-trigger {
    width: 100%;
    justify-content: center;
    min-height: 40px;
    font-size: 0.84rem;
  }

  .user-profile-chip {
    width: 100%;
    justify-content: space-between;
  }
  .system-chip {
    padding: 4px 8px;
    font-size: 0.7rem;
  }

  .btn-sm {
    padding: 6px 10px;
    font-size: 0.75rem;
    min-height: 36px;
  }

  /* Panels */
  .panel {
    padding: 14px 10px;
    border-radius: var(--radius-md);
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .section-title-row {
    flex-wrap: wrap;
    gap: 6px;
  }

  .section-title-row h2 {
    font-size: 0.96rem;
  }

  .studio-fullwidth-badge {
    display: none;
  }

  /* Step 1: 1-Click Studio */
  .autopilot-hero-card {
    padding: 12px 10px;
    gap: 10px;
  }

  .autopilot-desc {
    font-size: 0.78rem;
  }

  .autopilot-source-tabs {
    display: flex;
    width: 100%;
    gap: 6px;
  }

  .source-tab {
    flex: 1;
    padding: 8px 6px;
    font-size: 0.74rem;
    min-height: 44px;
    text-align: center;
    justify-content: center;
  }

  .source-tab-pill {
    display: none;
  }

  .yt-speed-advisory {
    font-size: 0.74rem;
    padding: 8px 10px;
  }

  .yt-input-group {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .yt-input {
    font-size: 16px !important; /* Prevents auto-zoom on iOS */
    padding: 10px 12px;
    width: 100%;
    box-sizing: border-box;
  }

  #btn-fetch-yt {
    width: 100%;
    min-height: 42px;
    justify-content: center;
    font-size: 0.85rem;
  }

  .dropzone {
    padding: 18px 12px;
    min-height: 120px;
  }

  .dropzone-text {
    font-size: 0.85rem;
  }

  .dropzone-sub {
    font-size: 0.72rem;
  }

  .btn-autopilot {
    padding: 12px 14px;
    font-size: 0.88rem;
    min-height: 48px;
    width: 100%;
  }

  /* Step 2: Duet Colors Grid */
  .duet-colors-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  .color-card {
    padding: 6px 5px;
    gap: 5px;
  }

  .color-header {
    gap: 2px;
  }

  .color-tag-pill {
    font-size: 0.65rem;
    padding: 1px 3px;
  }

  .color-label {
    font-size: 0.68rem;
  }

  .color-input-wrapper {
    gap: 4px;
    width: 100%;
  }

  input[type="color"] {
    width: 28px;
    height: 28px;
    min-width: 28px;
    max-width: 28px;
    border-radius: 4px;
  }

  .hex-input {
    font-size: 16px !important; /* iOS zoom prevention */
    padding: 4px 2px;
    letter-spacing: 0;
    width: 100%;
  }

  .font-size-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }

  .font-size-slider-wrap {
    width: 100%;
  }

  /* Step 3: Lyrics Studio Header & Tabs */
  .lyrics-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .lyrics-header-actions {
    width: 100%;
    margin-left: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .mode-toggles {
    width: 100%;
    display: flex;
    gap: 3px;
    background: rgba(0, 0, 0, 0.45);
    padding: 3px;
  }

  .mode-btn {
    flex: 1;
    text-align: center;
    justify-content: center;
    padding: 8px 4px;
    font-size: 0.72rem;
    min-height: 40px;
    white-space: nowrap;
  }

  .btn-fullscreen-lyrics {
    width: 100%;
    justify-content: center;
    min-height: 38px;
    font-size: 0.78rem;
  }

  .quick-tags-bar {
    flex-wrap: wrap;
    gap: 5px;
  }

  .tag-insert-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
    min-height: 36px;
    flex: 1 1 calc(25% - 5px);
    text-align: center;
    justify-content: center;
  }

  .lyrics-input {
    font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
    padding: 10px;
    min-height: 180px;
    width: 100%;
    box-sizing: border-box;
  }

  .lyrics-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  /* Interactive Line Builder Panel (Touch Optimizations) */
  .line-builder-panel {
    padding: 12px 10px;
    gap: 10px;
  }

  .builder-panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .builder-voice-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
  }

  .voice-pills-group {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .voice-pill {
    flex: 1 1 calc(33.33% - 4px);
    min-width: 85px;
    text-align: center;
    justify-content: center;
    padding: 8px 4px;
    font-size: 0.72rem;
    min-height: 38px;
  }

  .builder-text-row {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 100%;
  }

  .builder-input-line {
    font-size: 16px !important; /* Prevents iOS auto-zoom */
    padding: 10px 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .builder-times-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
  }

  .builder-time-card {
    padding: 10px 10px;
  }

  .time-val-input {
    font-size: 16px !important;
    height: 38px;
    width: 75px;
  }

  .btn-nudge {
    min-width: 44px;
    min-height: 38px;
    font-size: 0.82rem;
  }

  .btn-sync-time {
    padding: 6px 10px;
    font-size: 0.74rem;
    min-height: 34px;
  }

  .builder-footer-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
  }

  .builder-audition-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }

  #btn-audition-range {
    width: 100%;
    min-height: 40px;
    justify-content: center;
  }

  .dur-presets {
    justify-content: space-between;
    width: 100%;
  }

  .btn-dur-chip {
    flex: 1;
    min-height: 34px;
    padding: 4px 6px;
    font-size: 0.75rem;
    text-align: center;
    justify-content: center;
  }

  .btn-submit-line {
    width: 100%;
    min-height: 46px;
    font-size: 0.92rem;
    justify-content: center;
  }

  /* Line-by-Line Studio List Rows (Responsive Card Layout for Mobile) */
  .line-manager-panel {
    padding: 10px 6px;
  }

  .line-manager-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .line-manager-list {
    max-height: 520px;
    padding-right: 2px;
    gap: 10px;
  }

  .line-item-row {
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 8px;
    border-radius: var(--radius-md);
    background: rgba(14, 20, 32, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.09);
  }

  .line-index-badge {
    min-width: 22px;
    font-size: 0.72rem;
  }

  .line-voice-select {
    font-size: 16px !important;
    padding: 4px 6px;
    height: 34px;
  }

  .line-time-group {
    gap: 2px;
  }

  .line-time-input-sm {
    width: 58px;
    font-size: 16px !important;
    height: 32px;
    padding: 2px;
  }

  .line-btn-mini {
    min-width: 28px;
    min-height: 32px;
    padding: 4px 4px;
    font-size: 0.72rem;
  }

  .line-dur-badge {
    font-size: 0.68rem;
    padding: 2px 5px;
  }

  .line-text-input-main {
    order: 10;
    width: 100% !important;
    min-width: 100% !important;
    font-size: 16px !important; /* Critical for iOS keyboard focus */
    padding: 9px 10px;
    border-radius: 6px;
    margin-top: 4px;
    background: #060a12;
  }

  .line-btn-action {
    padding: 6px 10px;
    min-height: 34px;
    min-width: 34px;
    font-size: 0.8rem;
  }

  /* Tap to Sync Mobile Mode */
  .tap-sync-action-bar {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  #btn-tap-sync-action {
    width: 100%;
    min-height: 54px;
    font-size: 1.05rem;
  }

  #btn-tap-sync-reset {
    width: 100%;
    min-height: 40px;
  }

  /* Live Preview Screen (16:9 Responsive Canvas) */
  .preview-panel {
    padding: 14px 10px;
    border-radius: 16px;
    margin: 10px 0 16px 0;
    width: 100%;
    box-sizing: border-box;
  }

  .preview-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .preview-title-box h2 {
    font-size: 1.05rem;
  }

  .canvas-stage-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    margin: 12px 0 16px 0;
  }

  #karaoke-canvas {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    display: block;
  }

  .canvas-control-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 6px 2px;
  }

  .canvas-control-strip > div,
  .canvas-control-strip > label {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* Mobile Audio Player Bar */
  .audio-player-bar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 10px;
    border-radius: 12px;
    margin: 6px 0 16px 0;
  }

  .player-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  .time-display {
    font-size: 0.72rem;
    min-width: 95px;
  }

  .scrubber-container {
    order: 3;
    width: 100%;
    min-width: 100%;
    margin-top: 4px;
  }

  .scrubber {
    height: 12px;
  }

  .speed-select {
    font-size: 16px !important;
    height: 34px;
  }

  /* Download & Video Export Area */
  .download-panel {
    padding: 14px 10px;
  }

  .download-action-card {
    padding: 14px 10px;
  }

  .download-main-btn {
    width: 100%;
    min-height: 52px;
    font-size: 0.94rem;
    padding: 12px 14px;
    justify-content: center;
  }

  .download-note {
    font-size: 0.74rem;
    text-align: center;
  }

  .download-banner {
    padding: 12px 10px;
  }

  .download-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  #btn-download-video {
    width: 100%;
    min-height: 48px;
    font-size: 0.92rem;
    justify-content: center;
  }

  #rendered-video-player {
    max-height: 220px;
    width: 100%;
  }

  /* Modals on Mobile */
  .modal-card {
    width: 95% !important;
    max-width: 95% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    padding: 18px 14px !important;
    margin: 8px !important;
  }

  .modal-body {
    font-size: 0.84rem;
  }
}

/* Very narrow mobile devices (320px - 480px) */
@media (max-width: 480px) {
  .app-container {
    padding: 6px 6px 20px;
  }

  .duet-colors-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .color-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
  }

  .color-input-wrapper {
    width: auto;
    max-width: 140px;
  }

  .hex-input {
    width: 80px;
  }

  .autopilot-source-tabs {
    flex-direction: column;
  }

  .voice-pill {
    flex: 1 1 100%;
  }

  .dur-presets {
    flex-wrap: wrap;
    gap: 4px;
  }

  .btn-dur-chip {
    flex: 1 1 calc(33.33% - 4px);
  }

  .line-item-row {
    padding: 8px 6px;
  }
}

/* =========================================================
   USER AUTH & FREE CREDIT SYSTEM STYLES
   ========================================================= */

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

.btn-auth-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-auth-trigger:hover {
  background: var(--bg-card-hover);
  border-color: #38bdf8;
  color: #38bdf8;
}

.badge-free-trial {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.user-profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(18, 24, 38, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 6px 4px 5px;
  border-radius: 9999px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  font-size: 0.82rem;
}

.credits-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.credits-pill.good {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(3, 105, 161, 0.25));
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.15);
}

.credits-pill.good:hover {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(3, 105, 161, 0.35));
  border-color: rgba(56, 189, 248, 0.75);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.3);
  transform: translateY(-1px);
}

.credits-pill.low {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(217, 119, 6, 0.25));
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.15);
}

.credits-pill.zero {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(185, 28, 28, 0.3));
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.5);
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.2);
  animation: pulse-zero 2s infinite;
}

@keyframes pulse-zero {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(0.98); }
}

.token-coin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  flex-shrink: 0;
}

.credits-count {
  font-size: 0.88rem;
  font-weight: 800;
  color: #38bdf8;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
}

.credits-pill.low .credits-count {
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.35);
}

.credits-pill.zero .credits-count {
  color: #f87171;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.35);
}

.credits-label {
  color: #94a3b8;
  font-size: 0.74rem;
  font-weight: 600;
}

.credits-recharge-btn {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 9999px;
  letter-spacing: 0.03em;
  margin-left: 2px;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.4);
  transition: all 0.15s ease;
}

.credits-pill:hover .credits-recharge-btn {
  filter: brightness(1.15);
  transform: scale(1.04);
}

.user-identity-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
}

.user-avatar-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #8b5cf6 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.user-email-text {
  color: #e2e8f0;
  font-weight: 500;
  font-size: 0.78rem;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-sans);
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.55);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

.btn-admin-nav {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-admin-nav:hover {
  background: rgba(0, 242, 254, 0.12);
  border-color: rgba(0, 242, 254, 0.35);
  color: var(--brand-cyan);
}

.admin-nav-icon {
  font-size: 0.85rem;
}

/* Modals Customization */
.auth-modal-box {
  max-width: 440px !important;
}

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

.auth-icon-badge {
  font-size: 1.8rem;
}

.auth-modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.auth-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
  margin-bottom: 18px;
  border: 1px solid var(--border-subtle);
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

.btn-auth-submit {
  margin-top: 6px;
  padding: 12px;
  font-weight: 600;
  border-radius: var(--radius-md);
}

.auth-notice-banner {
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.35);
  color: #00f2fe;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.4;
  margin-bottom: 14px;
}

.auth-error-banner {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.4;
  margin-bottom: 14px;
}

/* =========================================================
   TOKEN RECHARGE & UPI PAYMENT MODAL
   ========================================================= */
.recharge-modal-box {
  max-width: 520px !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8) !important;
  border-radius: var(--radius-lg) !important;
}

.recharge-header-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.contact-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 10px 14px 20px 14px;
}

/* User Account & Current Balance */
.recharge-account-card {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.recharge-acc-left, .recharge-acc-right {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-card-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  font-weight: 600;
}

.account-card-email {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

.recharge-balance-pill {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.25);
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* Section Title */
.recharge-section-title {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
  font-weight: 700;
  color: #ffffff;
}

.rate-tag {
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
}

/* Packages Grid */
.token-packages-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
}

.token-pkg-card {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.token-pkg-card:hover {
  background: #171d2b;
  border-color: var(--border-focus);
}

.token-pkg-card.active {
  background: #152238;
  border: 1.5px solid var(--accent);
  box-shadow: none;
}

.pkg-tokens {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-main);
}

.pkg-videos {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pkg-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--success);
  margin-top: 2px;
}

.pkg-badge-popular {
  position: absolute;
  top: -8px;
  right: 10px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pkg-badge-value {
  position: absolute;
  top: -8px;
  right: 10px;
  background: var(--success);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Custom Stepper */
.custom-tokens-stepper {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 14px;
}

.stepper-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

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

.btn-stepper {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: #1c2333;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-stepper:hover {
  background: #252e42;
  border-color: var(--border-focus);
}

.stepper-input {
  width: 64px;
  text-align: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 4px;
  font-family: var(--font-mono);
}

.stepper-input:focus {
  outline: none;
  border-color: var(--accent);
}

.stepper-hint {
  font-size: 0.72rem;
  color: var(--text-faint);
}

/* Summary Card */
.recharge-summary-card {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.summary-val {
  font-size: 0.88rem;
  color: var(--text-main);
  font-weight: 600;
}

.text-cyan {
  color: var(--accent);
}

.summary-divider {
  width: 100%;
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

.total-line {
  padding-top: 2px;
}

.total-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.summary-total-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--success);
  text-shadow: none;
}

/* UPI Payment Box */
.upi-payment-box {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upi-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.upi-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.upi-id-code {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--accent);
  font-weight: 700;
  background: rgba(2, 132, 199, 0.12);
  border: 1px dashed rgba(2, 132, 199, 0.4);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  word-break: break-all;
}

.btn-copy-chip {
  background: #1e2638;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-copy-chip:hover {
  background: #28334b;
  border-color: var(--border-focus);
}

.btn-upi-intent {
  display: block;
  text-align: center;
  background: #182030;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 12px;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-upi-intent:hover {
  background: #202b40;
  color: #ffffff;
}

/* WhatsApp CTA */
.contact-actions-grid {
  width: 100%;
}

.btn-whatsapp-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 18px;
  background: #16a34a;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  border: 1px solid #15803d;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-whatsapp-cta:hover {
  background: #15803d;
  border-color: #166534;
}

.contact-footer-note {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  text-align: center;
}

/* Header Credits Pill Enhancements */
.credits-pill {
  cursor: pointer;
}

/* Logout Button In Header */
.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.logout-icon {
  font-size: 0.85rem;
}

/* 1. Initial Session Loader */
.auth-gate-loader {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: #080a12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: opacity 0.25s ease;
}

.gate-spinner-glow {
  position: relative;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gate-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: gate-spin 0.85s linear infinite;
}

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

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

.gate-loader-icon {
  font-size: 1.6rem;
  animation: gate-pulse 1.5s ease-in-out infinite;
}

.gate-loader-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-main);
}

.gate-loading-text {
  font-size: 0.86rem;
  color: var(--text-muted);
  font-weight: 500;
}

@keyframes gate-pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.05); opacity: 1; }
}

/* 2. Full-Screen Auth Portal (Single-Page & Mobile Responsive) */
.auth-gate-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 12px;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.auth-gate-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.auth-gate-backdrop-grid {
  display: none;
}

.auth-gate-glow-orb {
  display: none;
}

/* 3. Auth Gate Card */
.auth-gate-card {
  position: relative;
  z-index: 2;
  margin: auto;
  width: 100%;
  max-width: 430px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-sizing: border-box;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
}

/* Brand inside card */
.auth-gate-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.gate-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  overflow: hidden;
  padding: 2px;
}

.gate-brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gate-brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
  margin: 0;
}

.gate-brand-sub {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: 2px 0 0;
}

/* Segmented Tabs */
.gate-tabs {
  display: flex;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
  margin-bottom: 12px;
}

.gate-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: calc(var(--radius-sm) - 2px);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  min-height: 32px;
}

.gate-tab:hover {
  color: var(--text-main);
}

.gate-tab.active {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

/* Gate Form Fields */
.gate-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gate-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.gate-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.gate-field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.gate-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.gate-input {
  width: 100%;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 34px 7px 10px;
  color: var(--text-main);
  font-size: 0.86rem;
  font-family: inherit;
  height: 36px;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.gate-input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.gate-input::placeholder {
  color: var(--text-faint);
  font-size: 0.82rem;
}

.btn-toggle-pwd {
  position: absolute;
  right: 6px;
  background-color: transparent;
  border: none;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  text-transform: uppercase;
}

.btn-toggle-pwd:hover {
  color: var(--text-main);
}

/* Consent Group */
.consent-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 2px 0 4px;
  padding: 7px 9px;
  background-color: #0d121d;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.consent-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1.3;
}

.consent-checkbox-label input[type="checkbox"] {
  margin-top: 1px;
  width: 13px;
  height: 13px;
  accent-color: #0284c7;
  cursor: pointer;
  flex-shrink: 0;
}

.inline-legal-link {
  background: none;
  border: none;
  padding: 0;
  color: #38bdf8;
  font-size: inherit;
  font-family: inherit;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
  display: inline;
}

.inline-legal-link:hover {
  color: #7dd3fc;
}

/* Submit Button */
.btn-gate-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 2px;
  padding: 8px 14px;
  background-color: var(--primary);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 700;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  height: 38px;
  box-sizing: border-box;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-gate-submit:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-gate-submit:active {
  transform: none;
}

.btn-gate-submit.accent {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.btn-gate-submit.accent:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-gate-submit:disabled {
  background-color: #1e2638;
  border-color: var(--border-subtle);
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-arrow {
  font-size: 1rem;
  transition: transform 0.15s ease;
}

.btn-gate-submit:hover .btn-arrow {
  transform: translateX(3px);
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: gate-spin 0.8s linear infinite;
  display: inline-block;
}

/* Unified Card Footer */
.gate-card-footer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.gate-whatsapp-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--text-main);
  background-color: #141c2a;
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.gate-whatsapp-link:hover {
  background-color: #1c273a;
  border-color: var(--border-focus);
}

.gate-whatsapp-link svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}

.gate-legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--text-faint);
}

.gate-legal-link {
  background: none;
  border: none;
  padding: 2px 3px;
  color: var(--text-muted);
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease;
}

.gate-legal-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.gate-legal-dot {
  color: var(--text-faint);
  user-select: none;
  font-size: 0.65rem;
}

/* Mobile Responsiveness (< 480px) */
@media (max-width: 480px) {
  .auth-gate-screen {
    padding: 10px 8px;
  }
  .auth-gate-card {
    padding: 14px 12px;
    border-radius: var(--radius-sm);
  }
  .gate-field-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .gate-brand-title {
    font-size: 1.05rem;
  }
  .gate-brand-sub {
    font-size: 0.72rem;
  }
  .gate-input {
    font-size: 0.85rem;
    height: 36px;
  }
  .btn-gate-submit {
    height: 38px;
    font-size: 0.85rem;
  }
}

/* Compact Landscape & Short Viewports (< 620px height) */
@media (max-height: 620px) {
  .auth-gate-screen {
    padding: 6px;
  }
  .auth-gate-card {
    padding: 10px 14px;
  }
  .auth-gate-brand {
    margin-bottom: 6px;
  }
  .gate-brand-icon {
    width: 28px;
    height: 28px;
  }
  .gate-tabs {
    margin-bottom: 6px;
  }
  .gate-tab {
    padding: 4px 6px;
    min-height: 26px;
    font-size: 0.76rem;
  }
  .gate-form {
    gap: 5px;
  }
  .gate-input {
    height: 32px;
    padding-top: 5px;
    padding-bottom: 5px;
  }
  .btn-gate-submit {
    height: 34px;
  }
  .gate-card-footer {
    margin-top: 6px;
    padding-top: 5px;
    gap: 4px;
  }
}

/* 3. Fee Transparency Card */
.fee-transparency-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 14px 0;
  padding: 12px 14px;
  background-color: #0d121c;
  border: 1px solid #1e293b;
  border-radius: var(--radius-sm);
}

.transparency-pill {
  padding: 3px 8px;
  background-color: #0369a1;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 4px;
  white-space: nowrap;
}

.transparency-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

/* 4. Accessible App Footer */
.app-footer {
  margin-top: 48px;
  padding: 36px 0 24px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1.3fr 1.3fr 1.4fr;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-col-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-brand-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.footer-brand-logo-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.footer-desc {
  font-size: 0.85rem;
  color: var(--text-faint);
  line-height: 1.5;
  max-width: 380px;
}

.footer-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

.footer-info-item {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.footer-info-item strong {
  color: var(--text-main);
}

.footer-link {
  color: #38bdf8;
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
  color: #7dd3fc;
}

.footer-code {
  background-color: #10141e;
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #f8fafc;
}

.footer-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  margin: 0;
}

.footer-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.84rem;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s ease;
}

.footer-link-btn:hover {
  color: #38bdf8;
  text-decoration: underline;
}

.footer-links-list a.footer-link {
  font-size: 0.84rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-links-list a.footer-link:hover {
  color: #38bdf8;
  text-decoration: underline;
}

.footer-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid #181e2c;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-faint);
  line-height: 1.5;
  max-width: 900px;
  margin: 0;
}

.footer-cookie-btn {
  background-color: #131722;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.footer-cookie-btn:hover {
  background-color: #1e293b;
  border-color: #38bdf8;
  color: #ffffff;
}

/* 5. Legal & Privacy Modal */
.legal-modal-box {
  width: 92%;
  max-width: 820px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background-color: #131722;
  border: 1px solid #22293a;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.legal-modal-header-info h3 {
  font-size: 1.25rem;
  color: var(--text-main);
  margin-bottom: 2px;
}

.legal-header-sub {
  font-size: 0.82rem;
  color: var(--text-faint);
}

.legal-tabs-nav {
  display: flex;
  background-color: #0c0f17;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.legal-nav-tab {
  flex: 1;
  min-width: 130px;
  padding: 12px 14px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-faint);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.legal-nav-tab:hover {
  color: var(--text-main);
  background-color: #10141e;
}

.legal-nav-tab.active {
  color: #38bdf8;
  background-color: #131722;
  border-bottom-color: #38bdf8;
}

.legal-modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: 65vh;
}

.legal-pane {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.legal-section h4 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.legal-section p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 8px;
}

.legal-badge {
  display: inline-block;
  padding: 3px 8px;
  background-color: #0369a1;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 4px;
  margin-bottom: 8px;
}

.legal-list {
  margin: 8px 0 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.legal-list strong {
  color: var(--text-main);
}

.license-code-block {
  background-color: #0c0f17;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.license-code-block strong {
  color: var(--text-main);
}

.legal-action-box {
  margin-top: 14px;
  padding: 14px;
  background-color: #0c0f17;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

/* 6. Data Deletion Modal */
.deletion-modal-box {
  width: 90%;
  max-width: 540px;
  background-color: #131722;
  border: 1px solid #dc2626;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.deletion-header-sub {
  font-size: 0.8rem;
  color: #ef4444;
  margin-top: 2px;
}

.deletion-notice-card {
  padding: 12px 14px;
  background-color: #2b1216;
  border: 1px solid #7f1d1d;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.deletion-notice-card p {
  font-size: 0.84rem;
  color: #fca5a5;
  line-height: 1.45;
  margin: 0;
}

.deletion-notice-card strong {
  color: #ffffff;
}

.deletion-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.btn-danger-solid {
  background-color: #dc2626;
  color: #ffffff;
  border: 1px solid #ef4444;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-danger-solid:hover {
  background-color: #b91c1c;
  border-color: #f87171;
}

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

.del-ticket-box {
  padding: 14px;
  background-color: #0d1e16;
  border: 1px solid #059669;
  border-radius: var(--radius-sm);
  color: #a7f3d0;
}

.del-ticket-box h4 {
  color: #34d399;
  font-size: 1rem;
  margin-bottom: 6px;
}

.del-ticket-box p {
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 6px;
}

.del-ticket-box strong {
  color: #ffffff;
}

/* 7. Cookie Consent Banner */
.cookie-banner {
  position: fixed;
  bottom: 16px;
  left: 20px;
  right: 20px;
  max-width: 960px;
  margin: 0 auto;
  z-index: 99999;
  background-color: #10141e;
  border: 1px solid #38bdf8;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85);
  animation: cookieSlideUp 0.25s ease-out;
}

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

.cookie-banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
}

.cookie-banner-icon {
  color: #38bdf8;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.cookie-banner-text {
  flex: 1;
}

.cookie-banner-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.cookie-banner-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-cookie-action {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-cookie-action.accept {
  background-color: #0284c7;
  color: #ffffff;
  border: 1px solid #0284c7;
}

.btn-cookie-action.accept:hover {
  background-color: #0369a1;
  border-color: #38bdf8;
}

.btn-cookie-action.learn {
  background-color: #181e2c;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.btn-cookie-action.learn:hover {
  background-color: #222b40;
  color: #ffffff;
  border-color: #38bdf8;
}

.btn-cookie-action.dismiss {
  background: none;
  border: 1px solid transparent;
  color: var(--text-faint);
  font-size: 1rem;
  padding: 6px 10px;
}

.btn-cookie-action.dismiss:hover {
  color: var(--text-main);
  background-color: #181e2c;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .cookie-banner-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .cookie-banner-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 560px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .footer-bottom-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .cookie-banner {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
  .cookie-banner-actions {
    flex-wrap: wrap;
  }
}

/* Client-Side Upload Encouragement */
.source-tab-pill {
  display: inline-block;
  padding: 2px 7px;
  background-color: #0369a1;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 4px;
  margin-left: 6px;
  letter-spacing: 0.02em;
}

.yt-speed-advisory {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background-color: #10141e;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.yt-speed-advisory strong {
  color: var(--text-main);
}

/* Cashfree Automated Instant Checkout */
.cashfree-checkout-box {
  margin: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-cashfree-pay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #06b6d4 0%, #2563eb 50%, #4f46e5 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md, 8px);
  font-family: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.45);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-cashfree-pay:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.65);
  background: linear-gradient(135deg, #0891b2 0%, #1d4ed8 50%, #4338ca 100%);
}

.btn-cashfree-pay:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-cf-sub {
  font-size: 0.74rem;
  font-weight: 500;
  opacity: 0.92;
  margin-top: 0.25rem;
  letter-spacing: 0.02em;
}

.cashfree-status-msg {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm, 6px);
  font-size: 0.85rem;
  line-height: 1.45;
  text-align: center;
}

.cashfree-status-msg.info {
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(37, 99, 235, 0.3);
  color: #93c5fd;
}

.cashfree-status-msg.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.cashfree-status-msg.warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

.cashfree-status-msg.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}



