/* ============================
   AUDIO-SOAPBOX – CYBER-HUD UI
   ============================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800;900&display=swap');

:root {
  /* CYBER-HUD Palette */
  --bg-primary: #0A0A0A;
  --bg-secondary: #141414;
  --bg-surface: rgba(255, 255, 255, 0.05);
  --bg-surface-subtle: rgba(255, 255, 255, 0.02);
  --surface: #1A1A1A;
  --surface-glass: rgba(17, 17, 22, 0.7);
  --surface-glass-heavy: rgba(17, 17, 22, 0.95);
  --border-subtle: rgba(255, 255, 255, 0.15);
  --border-hud: rgba(234, 179, 8, 0.4);
  /* Acid Yellow dim */

  /* Cyber Accents */
  --primary: #f97316;
  /* Neon Orange */
  --primary-glow: #eab308;
  /* Acid Yellow */
  --primary-glow-rgb: 234, 179, 8;
  --accent-green: #22c55e;
  --accent-cyan: #06b6d4;
  --accent-red: #ef4444;
  --accent-purple: #a855f7;

  /* Typography Colors */
  --text-primary: #FFFFFF;
  --text-secondary: #a1a1aa;
  --text-tertiary: #52525b;
  --text-muted: rgba(255, 255, 255, 0.4);

  /* Radii (Removed for HUD aesthetic) */
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  --radius-xl: 0px;
  --radius-full: 0px;

  /* Shadow -> Glow */
  --shadow-soft: 0 0 15px rgba(234, 179, 8, 0.1);
  --shadow-hard: inset 0 0 0 1px var(--border-subtle);

  /* Fonts */
  --font-inter: 'Inter', sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
  --font-tech: 'Rajdhani', sans-serif;

  /* Mechanical Transition */
  --transition: 0.15s steps(2);
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========== PREMIUM LIGHT MODE (SLATE & INDIGO) ========== */
body.light-mode {
  --bg-primary: #F3F4F6; /* Athens Gray */
  --bg-secondary: #FFFFFF;
  --bg-surface: rgba(15, 23, 42, 0.05); /* Slate 900 base */
  --bg-surface-subtle: rgba(15, 23, 42, 0.02);
  --surface: #FFFFFF;
  --surface-glass: rgba(255, 255, 255, 0.95);
  --surface-glass-heavy: #FFFFFF;
  --border-subtle: #E2E8F0; /* Slate 200 */
  --border-hud: transparent;

  --primary: #4F46E5; /* Indigo 600 */
  --primary-glow: #6366F1; /* Indigo 500 */
  --primary-glow-rgb: 99, 102, 241;
  --accent-green: #10B981; /* Emerald 500 */
  --accent-cyan: #06B6D4; /* Cyan 500 */
  --accent-red: #EF4444; /* Red 500 */
  --accent-purple: #8B5CF6; /* Violet 500 */

  --text-primary: #0F172A; /* Slate 900 */
  --text-secondary: #475569; /* Slate 600 */
  --text-tertiary: #64748B; /* Slate 500 */
  --text-muted: #94A3B8; /* Slate 400 */

  --shadow-soft: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-hard: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
}

body.light-mode .bg-ambience,
body.light-mode .bg-waveform,
body.light-mode .glow-orb,
body.light-mode .hud-scanline,
body.light-mode .hud-scanner-bar { display: none !important; }


/* Force waveform to be DARK even in light mode for maximum visibility */
body.light-mode .waveform-container {
  background: #050505 !important;
  border-color: rgba(0,0,0,0.1) !important;
}

/* Light Mode Status Badge Fixes */
body.light-mode .badge {
  text-shadow: none !important;
  box-shadow: none !important;
}

body.light-mode .icon-placeholder {
  color: #FFFFFF !important;
  background: var(--primary) !important;
  border: 1px solid rgba(0,0,0,0.05) !important;
}

body.light-mode .icon-btn {
  background: rgba(0, 0, 0, 0.05); /* Make circular buttons visible */
}

body:not(.light-mode) .icon-placeholder {
  background: rgba(var(--primary-glow-rgb), 0.1) !important;
  color: var(--primary-glow) !important;
}

body.light-mode .waveform-time {
  color: var(--text-secondary) !important;
}

body.light-mode {
  background-image: none !important; /* Remove cyber grid */
  background-color: var(--bg-primary);
}

body.light-mode .system-top-bar {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

body.light-mode .user-name-glow { 
  color: var(--text-primary) !important; 
  text-shadow: none !important; 
  font-family: var(--font-inter);
}

/* Help Trigger Standard Spacing */
.help-trigger {
  margin-right: 4px;
  flex-shrink: 0;
}

body.light-mode .glass-panel,
body.light-mode .control-group,
body.light-mode .card,
body.light-mode .track-card,
body.light-mode .history-card,
body.light-mode .brief-section {
  background: #FFFFFF !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
  clip-path: none !important;
}

body.light-mode .btn-primary {
  background: var(--primary) !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: var(--radius-md) !important;
  box-shadow: none !important;
  font-family: var(--font-inter) !important;
  font-weight: 600 !important;
  text-shadow: none !important;
  transition: transform 0.1s;
}

body.light-mode .btn-primary:active {
  transform: scale(0.98);
  opacity: 0.9;
}

body.light-mode .btn-ghost {
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-md) !important;
  color: var(--primary) !important;
  background: transparent !important;
  font-weight: 600 !important;
}

body.light-mode #bottom-nav {
  background: #FFFFFF !important;
  border-top: 1px solid var(--border-subtle) !important;
  box-shadow: 0 -1px 4px rgba(0,0,0,0.05) !important;
}

body.light-mode .nav-item.active .nav-label { color: var(--primary) !important; }
body.light-mode .nav-item.active .material-symbols-outlined { color: var(--primary) !important; text-shadow: none !important; }

body.light-mode .logo-glitch { 
  color: var(--primary) !important; 
  text-shadow: none !important; 
  font-family: var(--font-inter); 
  letter-spacing: -1px;
}
body.light-mode .logo-tagline { color: var(--text-secondary) !important; font-family: var(--font-inter); }

body.light-mode .hud-corner,
body.light-mode .hud-corner::before,
body.light-mode .hud-corner::after { display: none !important; }

body.light-mode input,
body.light-mode textarea,
body.light-mode select {
  background: #F0F2F5 !important;
  color: var(--text-primary) !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius-md) !important;
  padding: 12px !important;
}

body.light-mode input:focus {
  border-color: var(--primary) !important;
  background: #FFFFFF !important;
}

body.light-mode .badge { 
  color: #FFFFFF !important; 
  background: var(--accent-red) !important; 
  border: none !important; 
  border-radius: var(--radius-md) !important;
}
body.light-mode .badge-blue { 
  color: #FFFFFF !important; 
  background: var(--primary) !important; 
  border: none !important; 
  border-radius: var(--radius-md) !important;
}

body.light-mode #brief-section {
  border-left: 4px solid var(--primary) !important;
  background: #EEF2FF !important; /* Indigo 50 */
  border-radius: var(--radius-md);
  color: var(--text-primary) !important;
}

body.light-mode #brief-title,
body.light-mode #brief-text {
  color: var(--text-primary) !important;
}

body.light-mode .mode-card {
  background: #FFFFFF !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-md) !important;
}

body.light-mode .mode-card.active {
  background: #EEF2FF !important; /* Indigo 50 */
  border-color: var(--primary) !important;
  box-shadow: none !important;
}

body.light-mode .mode-card h4 { color: var(--text-primary) !important; }
body.light-mode .mode-card p,
body.light-mode .mode-card li { color: var(--text-secondary) !important; }
body.light-mode .mode-card .material-symbols-outlined { color: var(--primary) !important; }

body.light-mode .help-trigger {
  background: #F1F5F9 !important; /* Slate 100 */
  border: none !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
}

body.light-mode .help-trigger:hover {
  background: #E2E8F0 !important; /* Slate 200 */
  color: var(--text-primary) !important;
  transform: scale(1.05);
}

body.light-mode #tutorial-advisor {
  background: rgba(255, 255, 255, 0.55) !important;
  backdrop-filter: blur(24px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(200%) !important;
  border-left: 6px solid var(--primary) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 12px 28px rgba(0,0,0,0.2) !important;
  animation: none !important;
}

body.light-mode .tutorial-ping {
  animation: none !important;
  outline: 4px solid var(--primary) !important;
  box-shadow: 0 0 20px rgba(24, 119, 242, 0.3) !important;
}

body.light-mode .video-container,
body.light-mode .ph-card::before,
body.light-mode .ph-card::after,
body.light-mode .waveform-container,
body.light-mode .app-shell,
body.light-mode .app-container {
  clip-path: none !important;
  border-radius: var(--radius-md) !important;
}

body.light-mode .video-container {
  background: #000 !important;
  border: 1px solid var(--border-subtle) !important;
  box-shadow: var(--shadow-hard) !important;
}

body.light-mode .waveform-container {
  background: #F0F2F5 !important;
}

body.light-mode #editable-job-name {
  border-bottom-color: var(--border-subtle) !important;
}

body.light-mode .cover-option,
body.light-mode .soap-color {
  background: #F0F2F5 !important;
  border-radius: var(--radius-md) !important;
}

body.light-mode .cover-option:hover {
  background: #E4E6EB !important;
}

body.light-mode .modal-content, 
body.light-mode [style*="clip-path: var(--hud-clip-tab)"] {
  clip-path: none !important;
  border-radius: var(--radius-md) !important;
}

body.light-mode .processing-spinner,
body.light-mode .word-spinner,
body.light-mode .hud-scanline {
  color: var(--primary) !important;
  border-top-color: transparent !important;
}

body.light-mode #selection-toolbar {
  background: #FFFFFF !important;
  border: 1px solid var(--border-subtle) !important;
  box-shadow: var(--shadow-hard) !important;
}

body.light-mode .tb-btn:hover {
  background: #F0F2F5 !important;
  border-radius: var(--radius-sm);
}

body.light-mode .ph-card:hover {
  background: #F0F2F5 !important;
  border-color: var(--primary) !important;
}
/* ========== END LIGHT MODE ========== */
/* ========== END LIGHT MODE ========== */


.system-top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(32px + env(safe-area-inset-top, 0px));
  background: var(--surface-glass-heavy);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-end; /* Align to bottom of the taller bar */
  justify-content: space-between;
  padding: 0 16px 6px; /* Extra bottom padding for notch space */
  z-index: 1000;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.user-name-glow {
  font-family: var(--font-tech);
  font-size: 11px;
  color: #fff !important;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 0 8px var(--primary-glow), 0 0 12px var(--primary-glow);
  font-weight: 700;
}

.user-profile-hud {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: 24px;
  padding: 4px 0;
  height: 32px;
}

.theme-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--primary-glow);
  transition: var(--transition-smooth);
}

.theme-toggle:hover {
  text-shadow: 0 0 8px var(--primary-glow);
}

.system-clock {
  letter-spacing: 1px;
}

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

html,
body {
  width: 100%;
  max-width: 100vw;
  font-family: var(--font-inter);
  background-color: var(--bg-primary);
  /* Cyber HUD Grid Background */
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-y: hidden;
  /* Prevent body scroll, use app-shell/page-container */
  position: relative;

  /* Responsive Typography Fixes */
  word-wrap: break-word;
  overflow-wrap: break-word;
  user-select: none; /* Prevent accidental text selection in HUD */
}

/* Global Mobile Zoom Prevention & Input Styling */
input, textarea, select, [contenteditable="true"] {
  user-select: text; /* Re-enable for inputs */
  font-size: 16px !important; /* Prevents auto-zoom on iOS */
}

/* Ensure material icons don't shrink */
.material-symbols-outlined {
  flex-shrink: 0;
}

* {
  box-sizing: border-box;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
div {
  max-width: 100%;
}

.text-wrap {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Ensure containers don't overflow viewport */
.app-shell > *,
.page-container > * {
  max-width: 100%;
}

/* Spin animation for loading indicators */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.spin {
  animation: spin 1s linear infinite;
  display: inline-block;
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Scrollbar - Webkit */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Scrollbar - Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* ---- Background Ambience (Layer 1) ---- */
.hud-scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(to bottom,
      transparent 50%,
      var(--border-subtle) 51%,
      transparent 51%);
  background-size: 100% 4px;
  opacity: 0.15;
}

@keyframes scanSweep {
  0% {
    transform: translateY(-100%);
  }

  100% {
    transform: translateY(100vh);
  }
}

.hud-scanner-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 20vh;
  background: linear-gradient(to bottom, transparent, var(--border-hud), transparent);
  opacity: 0.2;
  pointer-events: none;
  z-index: 1;
  animation: scanSweep 8s linear infinite;
}

/* ---- App Shell ---- */
.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-primary);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  overflow-x: hidden;
  margin: 0 auto;
  transition: max-width 0.3s ease;
  padding-top: calc(32px + env(safe-area-inset-top, 0px));
  overflow: hidden;
  /* Contain children */
}

/* ---- App Container (New) ---- */
.app-container {
  width: 100%;
  max-width: 600px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  background-color: var(--bg-secondary);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  touch-action: pan-y;
  padding-top: 32px;
}

/* Mode Cards in Guide */
.mode-card {
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.mode-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--primary-glow);
}

.mode-card.active {
  background: rgba(234, 179, 8, 0.05);
  border-color: var(--primary-glow);
  box-shadow: 0 0 15px rgba(234, 179, 8, 0.1);
}

.mode-card.active h4 {
  color: var(--primary-glow) !important;
}

@media (min-width: 768px) {
  .app-shell {
    max-width: min(800px, 100vw);
    border-left: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
  }
}

.page-container {
  flex: 1;
  padding-bottom: 24px;
  /* Reduced since nav is no longer overlapping */
  position: relative;
  background: var(--bg-primary);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
}


/* ---- Bottom Nav ---- */
.bottom-nav {
  position: relative;
  /* Changed from fixed to flow with app-shell */
  background: var(--surface-glass-heavy);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-around;
  padding: 12px 8px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  /* Don't squash the nav */
}

@media (min-width: 768px) {
  .bottom-nav {
    max-width: 800px;
    /* Match app-shell max-width */
  }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  width: 64px;
}

.nav-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon-wrap .material-symbols-outlined {
  font-size: 26px;
  color: var(--text-tertiary);
  font-weight: 300;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-item.active .nav-icon-wrap .material-symbols-outlined {
  color: var(--primary-glow);
  font-weight: 500;
  text-shadow: 0 0 12px rgba(14, 165, 233, 0.5);
  transform: scale(1.1);
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  transition: all 0.2s;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.nav-item.active .nav-label {
  color: var(--primary-glow);
  text-shadow: 0 0 8px rgba(14, 165, 233, 0.3);
}

/* ---- Data Panel / Card Container ---- */
.glass-panel {
  background: var(--surface-glass);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

/* Following Border for Clipped Elements */
.glass-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  /* Border thickness */
  background: var(--border-subtle);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 5;
}

/* Crosshair Accents for HUD Containers */
.hud-corner {
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
  z-index: 2;
}

.hud-corner::before,
.hud-corner::after {
  content: '';
  position: absolute;
  background: var(--border-hud);
}

.hud-corner-tl {
  top: 0;
  left: 0;
}

.hud-corner-tr {
  top: 0;
  right: 0;
}

.hud-corner-bl {
  bottom: 0;
  left: 0;
}

.hud-corner-br {
  bottom: 0;
  right: 0;
}

.hud-corner-tl::before,
.hud-corner-tr::before {
  width: 15px;
  height: 2px;
  top: 0;
}

.hud-corner-bl::before,
.hud-corner-br::before {
  width: 15px;
  height: 2px;
  bottom: 0;
}

.hud-corner-tl::after,
.hud-corner-bl::after {
  width: 2px;
  height: 100%;
  left: 0;
}

.hud-corner-tr::after,
.hud-corner-br::after {
  width: 2px;
  height: 100%;
  right: 0;
}

/* ---- Buttons ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #000;
  border: 1px solid var(--primary-glow);
  padding: 0 24px;
  height: 48px;
  font-family: var(--font-tech);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background var(--transition-smooth);
}

.btn-primary:hover {
  background: var(--primary-glow);
  animation: hudGlitch 0.2s cubic-bezier(.25, .46, .45, .94) both infinite;
  text-shadow: 2px 0 var(--accent-red), -2px 0 var(--accent-cyan);
  box-shadow: 0 0 15px var(--primary-glow);
}

.btn-primary:active {
  transform: translateY(2px);
  filter: brightness(0.8);
}

.btn-secondary {
  background: rgba(0, 122, 255, 0.1);
  color: var(--primary);
}

.btn-secondary:active {
  transform: scale(0.96);
  opacity: 0.8;
}

.btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--primary);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.btn-ghost:active {
  opacity: 0.6;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; /* Increased for mobile */
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.transcript-word {
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0 4px;
  border-radius: 4px;
  border: 1px solid transparent;
  display: inline-block;
  white-space: nowrap; /* Prevent internal vertical stacking on mobile */
  position: relative;
}

.icon-btn:hover {
  animation: hudGlitch 0.2s cubic-bezier(.25, .46, .45, .94) both infinite;
  color: var(--primary-glow);
  border-color: var(--primary-glow);
}

.icon-btn:active {
  transform: scale(0.9);
}

/* ---- Header ---- */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 48px 20px 12px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface-glass-heavy);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-bottom 0.2s;
}

.screen-header.scrolled {
  border-bottom: 1px solid var(--border-subtle);
}

.screen-header h1 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.4px;
  line-height: 1.2;
}


/* ---- Tags / Badges / Data Stickers ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 0;
  border-left: 2px solid currentColor;
}

.badge--green {
  background: rgba(34, 197, 94, 0.1);
  color: var(--accent-green);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-left: 3px solid var(--accent-green);

}

.badge--red {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-left: 3px solid var(--accent-red);
}

.badge--amber {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-left: 3px solid var(--accent-amber);
}

.badge--purple {
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-purple);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-left: 3px solid var(--accent-purple);
}

.badge--blue {
  background: rgba(43, 108, 238, 0.1);
  color: var(--primary);
  border: 1px solid rgba(43, 108, 238, 0.3);
  border-left: 3px solid var(--primary);
}

.badge--gray {
  background: rgba(100, 116, 139, 0.1);
  color: var(--text-secondary);
  border: 1px solid rgba(100, 116, 139, 0.2);
  border-left: 3px solid var(--text-secondary);
}

.badge--teal {
  background: rgba(20, 184, 166, 0.1);
  color: #0d9488;
  border: 1px solid rgba(20, 184, 166, 0.3);
  border-left: 3px solid #0d9488;
}

/* Header HUD Styles */
.stats-mini-hud div {
  line-height: 1.2;
}

.stats-mini-hud .stat-value {
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ---- Format Tags ---- */
.format-tag {
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---- Progress Bar & Scanner ---- */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.progress-bar__fill {
  height: 100%;
  border-radius: 0;
  width: 100%;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.4s var(--transition-smooth);
}

.progress-bar__fill--blue {
  background: var(--primary-glow);
  box-shadow: 0 0 10px var(--primary-glow);
}

.progress-bar__fill--amber {
  background: var(--accent-amber);
  box-shadow: 0 0 10px var(--accent-amber);
}

.progress-bar__fill--green {
  background: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
}

/* ---- Animations ---- */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.slide-in-right {
  animation: slideInRight 0.35s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.slide-up {
  animation: slideUp 0.35s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.fade-in {
  animation: fadeIn 0.25s ease forwards;
}

/* ---- New Logo Aesthetics ---- */
@keyframes logoFlicker {

  0%,
  19.999%,
  22%,
  62.999%,
  64%,
  64.999%,
  70%,
  100% {
    opacity: 1;
    filter: brightness(1);
  }

  20%,
  21.999%,
  63%,
  63.999%,
  65%,
  69.999% {
    opacity: 0.4;
    filter: brightness(0.7) blur(1px);
  }
}

.logo-flicker-active {
  animation: logoFlicker 0.4s steps(1) forwards;
}

.logo-tagline {
  font-family: var(--font-mono);
  font-size: 8px;
  color: #fff;
  /* White as requested */
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 2px;
  opacity: 0.9;
}

@keyframes textGlowPulse {

  0%,
  100% {
    text-shadow: 0 0 5px var(--primary-glow), 0 0 10px var(--primary-glow);
    opacity: 1;
  }

  50% {
    text-shadow: 0 0 15px var(--primary-glow), 0 0 25px var(--primary-glow);
    opacity: 0.8;
  }
}

.text-glow-heavy {
  color: var(--primary-glow) !important;
  animation: textGlowPulse 1.5s infinite ease-in-out;
  font-weight: bold;
}

/* Long press visual indicator */
@keyframes longPressCircle {
  0% { transform: scale(0); opacity: 0.5; }
  100% { transform: scale(2.5); opacity: 0; }
}

.long-press-ripple {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--primary-glow);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  animation: longPressCircle 0.6s ease-out forwards;
}

/* ---- Segmented Control ---- */
.segmented-control {
  display: flex;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0;
  padding: 2px;
  border: 1px dashed var(--border-subtle);
}

.segmented-control__btn {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 10px 0;
  font-family: var(--font-tech);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.segmented-control__btn.active {
  background: var(--primary);
  color: #000;
  border: 1px solid var(--primary-glow);
}

/* ---- Chip / Tag ---- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  cursor: default;
}

.chip__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: none;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  cursor: pointer;
  color: white;
  font-size: 12px;
}

.chip__remove:active {
  background: var(--accent-red);
}

/* ---- Slider ---- */
.slider-track {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0;
  cursor: pointer;
}

.slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--primary);
  border-radius: 0;
}

.slider-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 24px;
  border-radius: 0;
  background: var(--primary);
  border: 2px solid #000;
  cursor: grab;
  transition: transform 0.1s;
}

.slider-thumb:active {
  transform: translate(-50%, -50%) scale(0.9);
}

/* ---- Cards & Grouped Sections ---- */
.apple-card {
  background: var(--surface);
  border-radius: 0;
  border: 1px solid var(--border-subtle);
  padding: 24px;
  margin-bottom: 24px;
  transition: transform 0.2s var(--transition-smooth);
}

.apple-card:active {
  transform: scale(0.98);
}

/* ---- Action Elements & Grouping ---- */
.grouped-section {
  background: var(--surface);
  border-radius: 0;
  border: 1px dashed var(--border-subtle);
  clip-path: var(--hud-clip-inverse);
  overflow: hidden;
  position: relative;
  z-index: 10;
}

.info-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-primary);
  border-radius: 0;
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--border-hud);
  margin-bottom: 20px;
}

/* ---- Card ---- */
.card {
  background: var(--bg-secondary);
  border-radius: 0;
  border: 1px solid var(--border-subtle);
  padding: 16px;
  position: relative;
}

.card--active {
  border: 1px solid var(--primary);
  background: rgba(249, 115, 22, 0.04);
}


/* ---- Export Format Selector ---- */
.format-select {
  display: flex;
  gap: 12px;
}

.format-option {
  flex: 1;
  background: var(--surface);
  border: none;
  border-radius: 0;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  clip-path: var(--hud-clip-btn);
}

.format-option::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  background: var(--border-subtle);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.format-option.active::after {
  background: var(--accent-cyan);
}

.format-option:hover {
  border-color: rgba(6, 182, 212, 0.3);
  background: rgba(6, 182, 212, 0.05);
}

.format-option.active {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.15);
}

.format-option .check-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  display: none;
  align-items: center;
  justify-content: center;
}

.format-option.active .check-badge {
  display: flex;
}

.format-option h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.format-option p {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---- Typography ---- */
.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: clamp(32px, 8vw, 48px);
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.1;
}

.page-subtitle {
  font-size: clamp(14px, 4vw, 16px);
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.section-title {
  font-size: clamp(20px, 6vw, 24px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* ---- Waveform ---- */
.waveform-container {
  position: relative;
  width: 100%;
  height: 120px;
  background: var(--surface);
  border-radius: 0;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.waveform-grid {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-image: linear-gradient(var(--border-hud) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-hud) 1px, transparent 1px);
  background-size: 20px 20px;
}

.waveform-bars {
  position: absolute;
  inset: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
}

.waveform-bars .bar {
  width: 3px;
  border-radius: 0;
  transition: height 0.3s ease;
}

.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--primary-glow);
  box-shadow: 0 0 8px var(--primary-glow);
  z-index: 5;
}

.playhead::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: var(--primary-glow);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
}

.waveform-time {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: #000;
  background: var(--primary-glow);
  padding: 2px 6px;
  border-radius: 0;
  border: 1px solid #000;
}

/* ---- Utility ---- */
.text-gradient {
  color: var(--text-primary);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.gap-4 {
  gap: 16px;
}

.text-xs {
  font-size: 11px;
}

.text-sm {
  font-size: 13px;
}

.font-medium {
  font-weight: 500;
}

.font-bold {
  font-weight: 700;
}

.text-wrap {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes btnShake {
  0% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-4px) rotate(-1deg);
  }

  50% {
    transform: translateX(4px) rotate(1deg);
  }

  75% {
    transform: translateX(-4px) rotate(-1deg);
  }

  100% {
    transform: translateX(0);
  }
}

.btn-searching {
  animation: btnShake 0.4s infinite;
  background: var(--primary-glow) !important;
  color: black !important;
  box-shadow: 0 0 20px var(--primary-glow) !important;
}

/* ---- Super Cool Animations ---- */
@keyframes hudGlitch {
  0% {
    transform: translate(0)
  }

  20% {
    transform: translate(-2px, 1px)
  }

  40% {
    transform: translate(-1px, -1px)
  }

  60% {
    transform: translate(1px, 2px)
  }

  80% {
    transform: translate(2px, -1px)
  }

  100% {
    transform: translate(0)
  }
}

@keyframes textFlicker {
  0% {
    opacity: 1;
  }

  3% {
    opacity: 0.4;
  }

  6% {
    opacity: 1;
  }

  7% {
    opacity: 0.4;
  }

  8% {
    opacity: 1;
  }

  9% {
    opacity: 1;
  }

  10% {
    opacity: 0.8;
  }

  11% {
    opacity: 1;
  }

  100% {
    opacity: 1;
  }
}

/* Digital Glitch Effect for Logo */
.logo-glitch {
  position: relative;
  display: inline-block;
  animation: logo-glitch-main 20s infinite steps(1);
}

.logo-glitch::before,
.logo-glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  clip: rect(0, 0, 0, 0);
}

.logo-glitch::before {
  left: 0.5px;
  text-shadow: -1px 0 var(--accent-red);
  animation: logo-glitch-split 4s infinite linear alternate-reverse;
}

.logo-glitch::after {
  left: -0.5px;
  text-shadow: -1px 0 var(--accent-cyan);
  animation: logo-glitch-split 6s infinite linear alternate-reverse;
}

@keyframes logo-glitch-main {
  0% {
    transform: translate(0);
    text-shadow: none;
  }

  1% {
    transform: translate(1px, -0.5px);
    text-shadow: 1px 0 var(--accent-red);
  }

  2% {
    transform: translate(-0.5px, 1px);
    text-shadow: -1px 0 var(--accent-cyan);
  }

  3% {
    transform: translate(0);
    text-shadow: none;
  }

  98% {
    transform: translate(0);
  }

  99% {
    transform: translate(-1px, 0.5px);
  }

  100% {
    transform: translate(0);
  }
}

@keyframes logo-glitch-split {
  0% {
    clip: rect(10px, 9999px, 5px, 0);
  }

  5% {
    clip: rect(30px, 9999px, 25px, 0);
  }

  10% {
    clip: rect(15px, 9999px, 60px, 0);
  }

  15% {
    clip: rect(80px, 9999px, 5px, 0);
  }

  20% {
    clip: rect(45px, 9999px, 40px, 0);
  }

  25% {
    clip: rect(10px, 9999px, 90px, 0);
  }

  30% {
    clip: rect(55px, 9999px, 15px, 0);
  }

  35% {
    clip: rect(5px, 9999px, 50px, 0);
  }

  40% {
    clip: rect(95px, 9999px, 80px, 0);
  }

  45% {
    clip: rect(20px, 9999px, 35px, 0);
  }

  50% {
    clip: rect(70px, 9999px, 45px, 0);
  }

  55% {
    clip: rect(15px, 9999px, 10px, 0);
  }

  60% {
    clip: rect(40px, 9999px, 65px, 0);
  }

  65% {
    clip: rect(60px, 9999px, 25px, 0);
  }

  70% {
    clip: rect(5px, 9999px, 85px, 0);
  }

  75% {
    clip: rect(85px, 9999px, 40px, 0);
  }

  80% {
    clip: rect(30px, 9999px, 5px, 0);
  }

  85% {
    clip: rect(15px, 9999px, 70px, 0);
  }

  90% {
    clip: rect(50px, 9999px, 15px, 0);
  }

  95% {
    clip: rect(25px, 9999px, 95px, 0);
  }

  100% {
    clip: rect(10px, 9999px, 5px, 0);
  }
}

.text-flicker {
  animation: textFlicker 6s infinite random;
}

.glitch-hover:hover {
  animation: hudGlitch 0.2s cubic-bezier(.25, .46, .45, .94) both infinite;
  color: var(--primary-glow);
  text-shadow: 2px 0 var(--accent-red), -2px 0 var(--accent-cyan);
}

.anim-pulse-glow {
  animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 10px var(--primary-glow);
  }

  100% {
    box-shadow: 0 0 30px var(--primary-glow);
  }
}

.mode-card {
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  overflow: hidden;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  border: none !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mode-card::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  background: var(--border-subtle);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.mode-card.active::after {
  background: var(--primary-glow);
}

.mode-card:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  transform: translateY(-2px);
}

.mode-card.active {
  box-shadow: inset 0 0 20px rgba(234, 179, 8, 0.05);
}

.mode-card h4 {
  font-size: 11px;
  letter-spacing: 1px;
  font-weight: 800;
}

@keyframes shimmerBarber {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

.animate-shimmer {
  background-image: repeating-linear-gradient(45deg,
      rgba(255, 255, 255, 0) 25%,
      rgba(255, 255, 255, 0.2) 25%,
      rgba(255, 255, 255, 0.2) 50%,
      rgba(255, 255, 255, 0) 50%,
      rgba(255, 255, 255, 0) 75%,
      rgba(255, 255, 255, 0.2) 75%,
      rgba(255, 255, 255, 0.2) 100%) !important;
  background-size: 40px 40px !important;
  animation: shimmerBarber 2s linear infinite !important;
}

@keyframes pulseRing {
  0% {
    transform: scale(0.8);
    box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(234, 179, 8, 0);
  }

  100% {
    transform: scale(0.8);
    box-shadow: 0 0 0 0 rgba(234, 179, 8, 0);
  }
}

.animate-pulse-ring {
  animation: pulseRing 1.5s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes borderGlowPulse {
  0% {
    border-color: rgba(234, 179, 8, 0.2);
    box-shadow: inset 0 0 10px rgba(234, 179, 8, 0.05);
  }

  50% {
    border-color: rgba(234, 179, 8, 0.8);
    box-shadow: inset 0 0 20px rgba(234, 179, 8, 0.15), 0 0 15px rgba(234, 179, 8, 0.3);
  }

  100% {
    border-color: rgba(234, 179, 8, 0.2);
    box-shadow: inset 0 0 10px rgba(234, 179, 8, 0.05);
  }
}

.processing-active-card {
  animation: borderGlowPulse 2s infinite ease-in-out;
}

/* ---- HUD MODAL SYSTEM ---- */
.hud-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  /* Controlled by JS */
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.hud-modal-overlay.active {
  display: flex;
}

.hud-modal-content {
  width: 100%;
  max-width: 440px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  position: relative;
  padding: 32px 24px;
  animation: modalEnter 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  clip-path: var(--hud-clip-card);
}

.hud-modal-content::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  background: var(--border-subtle);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.hud-modal-title {
  font-family: var(--font-tech);
  font-size: 20px;
  color: var(--accent-red);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hud-modal-body {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.hud-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.captcha-frame-container {
  width: 100%;
  height: 200px;
  border: 1px solid var(--border-subtle);
  background: black;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ---- MOBILE OPTIMIZATION ENHANCEMENTS ---- */
@media (max-width: 768px) {

  /* Prevent iOS auto-zoom on focus by ensuring font-size >= 16px */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  textarea {
    font-size: 16px !important;
  }

  /* Responsive Logo Scaling */
  .logo-glitch {
    font-size: 32px !important;
    letter-spacing: 1px !important;
  }

  .logo-tagline {
    font-size: 11px !important;
  }

  /* Optimize layout for smaller screens */
  .page-title {
    font-size: clamp(20px, 8vw, 28px) !important;
  }

  .system-top-bar {
    padding: 0 8px;
  }

  .user-name-glow {
    font-size: 10px;
  }

  .user-profile-hud {
    margin-right: 12px;
  }

  /* Prevent overflow in boxes */
  .glass-panel,
  .mode-card,
  .info-card {
    padding: 12px !important;
    word-break: break-word;
  }

  .mode-card h4 {
    font-size: clamp(9px, 3vw, 11px) !important;
  }

  .logo-glitch {
    font-size: clamp(24px, 10vw, 32px) !important;
  }
}

/* ========== GLOBAL RESPONSIVE FIXES ========== */
/* Prevent horizontal overflow on all devices */

/* Ensure images are responsive */
img {
  max-width: 100%;
  height: auto;
}

/* Prevent text from overflowing */
p, span, a, label {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Fix for producer hub button groups - allow wrapping on small screens */
.screen-header {
  flex-wrap: wrap;
  gap: 8px;
}

/* Mobile-specific fixes */
@media (max-width: 768px) {
  /* Ensure all containers respect viewport width */
  .page-container,
  .screen-header,
  main,
  section {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* Ensure header content wraps on narrow screens */
  .screen-header > div {
    flex-wrap: wrap;
  }
}

/* DELETE MODAL STYLES */
.delete-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.delete-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.delete-modal-content {
  width: 90%;
  max-width: 400px;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.delete-modal-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-red);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.delete-modal-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.delete-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.delete-option-btn {
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.delete-option-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.delete-option-btn .btn-title {
  font-weight: 600;
  font-size: 15px;
}

.delete-option-btn .btn-desc {
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.8;
}

.delete-option-btn.btn--everywhere:hover {
  border-color: var(--accent-red);
  background: rgba(239, 68, 68, 0.05);
}

.delete-modal-close {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
}

/* HUB CSS */
.custom-select-container {
  position: relative;
  flex: 1;
}
.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  text-transform: uppercase;
  padding: 12px;
  border-radius: 4px;
  height: 44px;
}
.custom-select-trigger.minimal {
  background: transparent;
  border: none;
  padding: 4px 0;
  height: auto;
}
.custom-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface-glass-heavy);
  border: 1px solid var(--primary-glow);
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  z-index: 1000;
  display: none;
  flex-direction: column;
  backdrop-filter: blur(10px);
  border-radius: 4px;
  overflow: hidden;
}
.custom-select-menu.open { display: flex; }
.custom-select-search {
  background: rgba(0,0,0,0.5);
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px 12px;
  outline: none;
  width: 100%;
}
.custom-select-options {
  max-height: 200px;
  overflow-y: auto;
}
.custom-select-option {
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.1s;
}
.custom-select-option:hover {
  background: rgba(234,179,8,0.1);
  color: var(--primary-glow);
}
.custom-select-option.selected {
  color: var(--primary-glow);
  background: rgba(234,179,8,0.05);
}
.custom-select-option.add-new {
  border-top: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
}

/* RESULTS CSS */
@keyframes scan {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.transcript-word.active-word {
  background: #eab308 !important; /* Force Bright Gold */
  color: #000 !important; /* Force Black Text for contrast */
  font-weight: 900;
  border-radius: 4px;
  padding: 2px 8px;
  box-shadow: 0 0 25px rgba(234, 115, 22, 0.8), 0 0 10px #fff;
  transform: scale(1.15) translateY(-1px);
  display: inline-block;
  transition: all 0.05s ease-out;
  z-index: 100;
  position: relative;
}
.transcript-word.flagged.active-word {
  background: rgba(239, 68, 68, 0.35) !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
  color: #ff6666;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}
.mode-badge {
  background: rgba(var(--primary-glow-rgb), 0.1);
  border: 1px solid rgba(var(--primary-glow-rgb), 0.2);
  color: var(--primary-glow);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 1px;
  font-weight: 700;
  text-transform: uppercase;
}
#cover-art-trigger:hover .hover-overlay-photo { opacity: 1 !important; }