/* ==========================================================================
   LANFACTORY.COM THEME STYLESHEET — FACESHIFT AI STUDIO
   Colors: Obsidian Black (#0a0a0f), Electric Crimson Red (#ff202e), Stark White (#ffffff)
   Typography: Chakra Petch, Rajdhani, Orbitron, Inter, JetBrains Mono
   Est. 1929 · Glasgow, KY
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,400;0,600;0,700;1,700&family=Inter:wght@300;400;500;600;700&family=Rajdhani:wght@500;600;700&family=Orbitron:wght@700;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Brand Theme Colors */
  --bg-main: #0a0a0f;
  --bg-surface: #121218;
  --bg-card: #181822;
  --bg-card-hover: #20202e;
  --bg-elevated: #262638;
  --bg-input: #101017;
  --bg-glass: rgba(18, 18, 24, 0.75);
  --bg-glass-active: rgba(255, 32, 46, 0.14);

  --red-primary: #ff202e;
  --red-hover: #ff4754;
  --red-deep: #b80d19;
  --red-glow: rgba(255, 32, 46, 0.45);
  --red-subtle: rgba(255, 32, 46, 0.12);
  --red-border: rgba(255, 32, 46, 0.3);

  --white-pure: #ffffff;
  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* Status Colors */
  --status-online: #10b981;
  --status-warning: #f59e0b;
  --status-error: #ff202e;

  /* Typography */
  --font-display: 'Chakra Petch', 'Orbitron', sans-serif;
  --font-heading: 'Rajdhani', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #ff202e 0%, #b80d19 100%);
  --gradient-brand-hover: linear-gradient(135deg, #ff4754 0%, #ff202e 100%);
  --gradient-accent: linear-gradient(135deg, #ff202e 0%, #ffffff 100%);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 20px var(--red-glow);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(255, 32, 46, 0.10) 0%, transparent 60%),
    radial-gradient(circle at 10% 40%, rgba(255, 32, 46, 0.04) 0%, transparent 40%),
    linear-gradient(to bottom, #0a0a0f, #050508);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Ambient glow accents */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}
.glow-1 {
  width: 500px;
  height: 500px;
  background: rgba(255, 32, 46, 0.12);
  top: -100px;
  right: -100px;
}
.glow-2 {
  width: 450px;
  height: 450px;
  background: rgba(184, 13, 25, 0.15);
  bottom: -50px;
  left: -50px;
}
.glow-3 {
  width: 350px;
  height: 350px;
  background: rgba(255, 71, 84, 0.08);
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--red-primary);
}

/* Container */
.container {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   LANFACTORY NAVIGATION HEADER
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 1.25rem;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--white-pure);
  flex-shrink: 0;
}

.logo-img-badge {
  width: 36px !important;
  height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  border-radius: 50%;
  object-fit: cover;
  filter: drop-shadow(0 0 8px rgba(255, 32, 46, 0.5));
  transition: transform 0.3s ease;
  flex-shrink: 0;
  display: block;
}

.logo-brand:hover .logo-img-badge {
  transform: scale(1.08) rotate(4deg);
}

.logo-text-group {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--white-pure);
  line-height: 1.1;
}

.logo-title span {
  color: var(--red-primary);
  text-shadow: 0 0 10px var(--red-glow);
}

.logo-sub {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Header Nav */
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  border: 1px solid transparent;
}

.nav-link:hover {
  color: var(--white-pure);
  background: var(--bg-card);
  border-color: var(--border-subtle);
}

.nav-link.active {
  color: var(--white-pure);
  background: var(--red-subtle);
  border-color: var(--red-border);
  box-shadow: 0 0 10px rgba(255, 32, 46, 0.2);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Server Selector & Status */
.server-config-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  padding: 4px 12px;
}

.server-ip-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.server-ip-select {
  background: transparent;
  border: none;
  color: var(--red-hover);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.server-ip-select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.custom-ip-input {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--red-primary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 3px 8px;
  width: 180px;
  outline: none;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.status-badge.online {
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
  background: rgba(16, 185, 129, 0.08);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-badge.online .status-dot {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

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

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.25); }
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--gradient-brand);
  color: var(--white-pure);
  border-color: var(--red-primary);
  box-shadow: 0 0 18px rgba(255, 32, 46, 0.4);
}

.btn-primary:hover:not(:disabled) {
  background: var(--gradient-brand-hover);
  box-shadow: 0 0 25px var(--red-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card-hover);
  color: var(--white-pure);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  color: var(--white-pure);
  border: 1px solid var(--border-strong);
}

.btn-outline:hover {
  background: var(--red-subtle);
  border-color: var(--red-primary);
  box-shadow: 0 0 15px var(--red-glow);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-generate {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1.15rem;
  font-family: var(--font-display);
  letter-spacing: 1px;
  margin-top: 10px;
}

.btn-generate:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   PASSWORD / CLEARANCE AUTHENTICATION GATE
   ========================================================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 10, 15, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface);
  border: 1px solid var(--red-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 32, 46, 0.25);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-brand);
}

.auth-icon-wrap {
  width: 68px;
  height: 68px;
  margin: 0 auto 1.25rem;
  background: var(--red-subtle);
  border: 1px solid var(--red-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 0 20px rgba(255, 32, 46, 0.35);
  animation: pulse-glow 2.5s infinite;
}

.auth-badge {
  display: inline-block;
  padding: 4px 14px;
  background: var(--red-subtle);
  border: 1px solid var(--red-border);
  color: var(--red-hover);
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.85rem;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--white-pure);
  margin-bottom: 0.5rem;
}

.auth-title span {
  color: var(--red-primary);
  text-shadow: 0 0 10px var(--red-glow);
}

.auth-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
  line-height: 1.45;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-input-group {
  position: relative;
  text-align: left;
}

.auth-input-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  padding: 0.85rem 1.15rem;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--white-pure);
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 2px;
  outline: none;
  transition: var(--transition);
  box-sizing: border-box;
}

.auth-input:focus {
  border-color: var(--red-primary);
  box-shadow: 0 0 15px var(--red-glow);
}

.auth-error {
  background: rgba(255, 32, 46, 0.15);
  border: 1px solid var(--red-primary);
  color: #ff6b75;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.auth-notice {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ==========================================================================
   BANNER INTRO SECTION
   ========================================================================== */
.hero-showcase {
  padding: 24px 0 12px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-header h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--white-pure);
}

.gradient-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px var(--red-glow);
}

.hero-header p {
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
  font-size: 1rem;
}

/* ==========================================================================
   STUDIO LAYOUT & PANELS
   ========================================================================== */
.studio-section {
  padding: 16px 0 60px;
  position: relative;
  z-index: 1;
}

.studio-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 1024px) {
  .studio-grid {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

/* Steps */
.step-card {
  margin-bottom: 24px;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--gradient-brand);
  color: var(--white-pure);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px var(--red-glow);
}

.step-title-wrap h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--white-pure);
}

.step-title-wrap p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--red-border);
  border-radius: var(--radius-md);
  padding: 30px 20px;
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--red-primary);
  background: var(--red-subtle);
  box-shadow: inset 0 0 20px rgba(255, 32, 46, 0.2);
}

.upload-icon-anim {
  font-size: 42px;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 10px var(--red-glow));
}

.upload-idle h4 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.highlight-link {
  color: var(--red-primary);
  text-decoration: underline;
}

.upload-subtext {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 320px;
  margin: 0 auto 16px;
}

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

.upload-preview {
  position: relative;
  max-width: 240px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  border: 1px solid var(--red-border);
}

.upload-preview img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.preview-overlay-controls {
  position: absolute;
  top: 8px;
  right: 8px;
}

.btn-glass {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-strong);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s ease;
}

.btn-glass:hover {
  background: var(--red-primary);
  border-color: var(--red-primary);
}

.preview-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Gender Conditioning Selector */
.gender-selector-wrap {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.gender-selector-wrap:hover {
  border-color: var(--border-strong);
}

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

.gender-title-label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gender-active-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--red-hover);
  background: rgba(255, 32, 46, 0.1);
  border: 1px solid rgba(255, 32, 46, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.gender-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.btn-gender {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-gender:hover {
  border-color: var(--red-primary);
  color: var(--white-pure);
  background: var(--bg-card);
}

.btn-gender.active {
  background: var(--red-subtle);
  border-color: var(--red-primary);
  color: var(--white-pure);
  box-shadow: 0 0 12px rgba(255, 32, 46, 0.25), inset 0 0 8px rgba(255, 32, 46, 0.15);
}

.btn-gender-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.btn-gender-text {
  font-size: 0.78rem;
}

.gender-hint {
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 8px;
  line-height: 1.35;
}

@media (max-width: 540px) {
  .gender-buttons {
    grid-template-columns: 1fr;
  }
}

/* Themes Grid */
.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.theme-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.theme-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--red-border);
  transform: translateY(-2px);
}

.theme-card.active {
  background: var(--red-subtle);
  border-color: var(--red-primary);
  box-shadow: 0 0 16px rgba(255, 32, 46, 0.3);
}

.theme-icon {
  font-size: 26px;
  margin-bottom: 8px;
}

.theme-info h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  color: var(--white-pure);
}

.theme-info p {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.theme-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--red-primary);
  color: var(--white-pure);
  font-size: 11px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px var(--red-glow);
}

.theme-card.active .theme-check {
  display: flex;
}

.custom-prompt-container {
  margin-top: 14px;
}

.custom-prompt-container label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  color: var(--red-hover);
}

.custom-prompt-container textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  padding: 10px 14px;
  font-size: 0.85rem;
  resize: vertical;
}

.custom-prompt-container textarea:focus {
  outline: none;
  border-color: var(--red-primary);
  box-shadow: 0 0 10px var(--red-glow);
}

/* Settings Card */
.settings-details {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.settings-summary {
  padding: 12px 16px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.summary-arrow {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

details[open] .summary-arrow {
  transform: rotate(180deg);
}

.settings-content {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
}

.setting-item {
  margin-bottom: 18px;
}

.setting-item:last-child {
  margin-bottom: 0;
}

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

.setting-label-row label, .setting-item > label {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.setting-val {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--red-hover);
}

.setting-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.cyber-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--white-pure);
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 9px 12px;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
  margin-top: 4px;
}

.cyber-select:focus {
  border-color: var(--red-primary);
  box-shadow: 0 0 12px var(--red-glow);
}

.cyber-select optgroup {
  background: var(--bg-surface);
  color: var(--red-hover);
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.cyber-select option {
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-body);
  padding: 8px 12px;
}

/* Sliders */
input[type="range"] {
  width: 100%;
  accent-color: var(--red-primary);
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
}

/* Megapixel buttons */
.mp-buttons {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 6px;
}

.btn-mp {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 2px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-mp:hover {
  background: var(--bg-card-hover);
  color: var(--white-pure);
  border-color: var(--border-strong);
}

.btn-mp.active {
  background: var(--red-subtle);
  border-color: var(--red-primary);
  color: var(--red-hover);
  box-shadow: 0 0 10px rgba(255, 32, 46, 0.25);
  font-weight: 700;
}

.res-preview-indicator {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.res-preview-indicator strong {
  color: var(--red-hover);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.ratio-buttons {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.btn-ratio {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ratio.active {
  background: var(--red-subtle);
  border-color: var(--red-primary);
  color: var(--white-pure);
}

/* ==========================================================================
   RESULTS & PROGRESS PANEL
   ========================================================================== */
.result-panel {
  display: flex;
  flex-direction: column;
}

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

.result-header h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--white-pure);
}

.badge-glow {
  background: var(--red-subtle);
  border: 1px solid var(--red-border);
  color: var(--red-hover);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.result-placeholder {
  min-height: 420px;
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.2);
}

.placeholder-graphic {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.7;
}

.result-placeholder h4 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.result-placeholder p {
  font-size: 0.85rem;
  max-width: 320px;
}

/* Progress State */
.progress-display {
  min-height: 420px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}

.progress-spinner {
  width: 54px;
  height: 54px;
  border: 4px solid var(--red-subtle);
  border-top-color: var(--red-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

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

.progress-display h4 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.progress-timer {
  font-family: var(--font-mono);
  color: var(--red-hover);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.progress-bar-container {
  width: 100%;
  max-width: 380px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 24px;
}

.progress-bar-fill {
  height: 100%;
  width: 25%;
  background: var(--gradient-brand);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
  box-shadow: 0 0 10px var(--red-glow);
}

.progress-steps {
  list-style: none;
  font-size: 0.85rem;
  text-align: left;
  max-width: 320px;
  width: 100%;
}

.progress-steps li {
  padding: 6px 0;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-steps li::before {
  content: "○";
  color: var(--text-muted);
}

.progress-steps li.step-active {
  color: var(--red-hover);
  font-weight: 600;
}

.progress-steps li.step-active::before {
  content: "◉";
  color: var(--red-primary);
}

.progress-steps li.step-done {
  color: #34d399;
}

.progress-steps li.step-done::before {
  content: "✓";
  color: #34d399;
}

/* Comparison Slider */
.comparison-container, .result-comparison-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  user-select: none;
  background: #000;
  border: 1px solid var(--border-subtle);
}

.comp-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.comparison-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  z-index: 2;
  border-right: 2px solid var(--red-primary);
}

.comparison-overlay .comp-img {
  width: 100%;
  height: 100%;
  max-width: none;
}

.comparison-slider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: transparent;
  transform: translateX(-50%);
  z-index: 10;
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--red-primary);
  border: 2px solid var(--white-pure);
  box-shadow: 0 0 15px var(--red-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white-pure);
  font-size: 10px;
  gap: 2px;
  pointer-events: none;
}

.image-label {
  position: absolute;
  top: 14px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  color: var(--white-pure);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 5;
}

.label-before {
  left: 14px;
  border-left: 2px solid var(--red-primary);
}

.label-after {
  right: 14px;
  border-right: 2px solid var(--white-pure);
}

/* Result Presentation */
.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.result-actions .btn {
  flex: 1;
}

.result-meta-box {
  margin-top: 18px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.meta-label {
  color: var(--text-muted);
}

.meta-val {
  color: var(--red-hover);
  font-family: var(--font-mono);
  font-weight: 600;
}

.meta-prompt-row {
  flex-direction: column;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.meta-prompt-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 4px;
}

/* History Gallery */
.history-gallery-wrap {
  margin-top: 30px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 20px;
}

.history-gallery-wrap h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.history-thumb {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
}

.history-thumb:hover {
  border-color: var(--red-primary);
  transform: scale(1.05);
  box-shadow: 0 0 10px var(--red-glow);
}

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

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
}

.modal-content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
}

.modal-content img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: var(--radius-md);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.95);
  border: 1px solid var(--border-strong);
}

.modal-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--red-primary);
  color: var(--white-pure);
  font-size: 16px;
  font-weight: 800;
  border: 2px solid var(--white-pure);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   LANFACTORY SITE FOOTER
   ========================================================================== */
.site-footer {
  background: #060609;
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 860px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.75rem;
  max-width: 420px;
  line-height: 1.5;
}

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--white-pure);
  margin-bottom: 1rem;
}

.footer-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-links-list a:hover {
  color: var(--red-primary);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==========================================================================
   LM Studio Prompt Enhancer Styling
   ========================================================================== */
.custom-prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.custom-prompt-header label {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-bottom: 0;
}

.prompt-enhance-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.likeness-badge {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-enhance {
  background: linear-gradient(135deg, rgba(255, 32, 46, 0.25) 0%, rgba(180, 10, 25, 0.4) 100%);
  color: var(--white-pure);
  border: 1px solid var(--red-primary);
  font-size: 0.78rem;
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
  box-shadow: 0 0 10px rgba(255, 32, 46, 0.2);
}

.btn-enhance:hover:not(:disabled) {
  background: var(--gradient-brand);
  box-shadow: 0 0 16px var(--red-glow);
  transform: translateY(-1px);
}

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

.btn-enhance.enhancing {
  animation: pulseGlow 1.2s infinite alternate;
}

@keyframes pulseGlow {
  from { box-shadow: 0 0 6px var(--red-glow); }
  to { box-shadow: 0 0 18px var(--red-glow); }
}

.btn-icon-only {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  transition: var(--transition);
}

.btn-icon-only:hover {
  color: var(--white-pure);
  border-color: var(--red-primary);
}

.btn-theme-enhance-shortcut {
  width: 100%;
  background: rgba(255, 32, 46, 0.08);
  border: 1px dashed rgba(255, 32, 46, 0.35);
  border-radius: var(--radius-sm);
  color: var(--red-hover);
  padding: 7px 12px;
  font-size: 0.82rem;
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  margin-top: 8px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-theme-enhance-shortcut:hover {
  background: rgba(255, 32, 46, 0.16);
  border-color: var(--red-primary);
  color: var(--white-pure);
  box-shadow: 0 0 12px rgba(255, 32, 46, 0.25);
}

.prompt-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 8px 0;
}

.chips-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.chip-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.74rem;
  padding: 3px 9px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
}

.chip-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--red-primary);
  color: var(--white-pure);
  box-shadow: 0 0 8px rgba(255, 32, 46, 0.2);
}

.textarea-wrap {
  position: relative;
}

.enhance-toast {
  position: absolute;
  bottom: 8px;
  right: 10px;
  background: rgba(0, 200, 83, 0.2);
  border: 1px solid rgba(0, 200, 83, 0.6);
  color: #00e676;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  pointer-events: none;
  animation: fadeInOut 3s ease forwards;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(4px); }
  15% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-4px); }
}

.llm-settings-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 10px;
  margin-bottom: 8px;
}

.llm-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 6px;
}

@media (max-width: 640px) {
  .llm-settings-grid {
    grid-template-columns: 1fr;
  }
}

.llm-field label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.input-with-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cyber-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--white-pure);
  font-family: var(--font-body);
  font-size: 0.82rem;
  padding: 7px 10px;
  outline: none;
  transition: var(--transition);
}

.cyber-input:focus {
  border-color: var(--red-primary);
  box-shadow: 0 0 10px var(--red-glow);
}

/* Clear Storage & Purge Files Controls */
.result-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-clean-files {
  font-size: 0.76rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 32, 46, 0.08);
  border: 1px solid rgba(255, 32, 46, 0.3);
  color: var(--text-secondary);
  transition: var(--transition);
}

.btn-clean-files:hover {
  background: rgba(255, 32, 46, 0.2);
  border-color: var(--red-primary);
  color: var(--white-pure);
  box-shadow: 0 0 10px rgba(255, 32, 46, 0.3);
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.history-header h4 {
  margin-bottom: 0;
}

.btn-clear-history {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-family: var(--font-heading);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-clear-history:hover {
  border-color: var(--red-primary);
  color: var(--red-hover);
  background: rgba(255, 32, 46, 0.08);
}

/* ==========================================================================
   VOICEFORGE STUDIO — AI VOICE CLONING & TTS EXTENSION
   ========================================================================== */

/* Studio Nav Switcher */
.studio-switcher {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
  margin: 0 auto 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.studio-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.studio-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.studio-tab.active {
  background: var(--gradient-brand);
  color: var(--white-pure);
  box-shadow: 0 0 16px var(--red-glow);
}

/* Audio Source Tabs */
.audio-source-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
}

.audio-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.audio-tab-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.audio-tab-btn.active {
  background: rgba(255, 32, 46, 0.15);
  border-color: var(--red-primary);
  color: var(--white-pure);
  box-shadow: 0 0 10px rgba(255, 32, 46, 0.25);
}

/* Mic Recorder Interface */
.mic-record-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: var(--bg-input);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: center;
  gap: 1rem;
}

.mic-btn-main {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--red-primary);
  color: var(--red-primary);
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 0 15px rgba(255, 32, 46, 0.2);
}

.mic-btn-main:hover {
  transform: scale(1.06);
  background: rgba(255, 32, 46, 0.15);
  box-shadow: 0 0 25px var(--red-glow);
}

.mic-btn-main.recording {
  background: var(--red-primary);
  color: var(--white-pure);
  animation: pulse-mic 1.2s infinite;
}

@keyframes pulse-mic {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 32, 46, 0.7); }
  70% { transform: scale(1.08); box-shadow: 0 0 0 18px rgba(255, 32, 46, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 32, 46, 0); }
}

.record-timer {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--red-primary);
  letter-spacing: 1px;
}

/* Reference Audio Active Card */
.audio-active-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.2rem;
  background: var(--bg-surface);
  border: 1px solid var(--red-border);
  border-radius: var(--radius-md);
  margin-top: 1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.audio-active-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 32, 46, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--red-primary);
  flex-shrink: 0;
}

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

.audio-active-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--white-pure);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-active-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.badge-mode {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-mode-icl {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-mode-xvec {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

/* Inspiration Chips */
.phrase-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.phrase-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
}

.phrase-chip:hover {
  color: var(--white-pure);
  border-color: var(--red-border);
  background: rgba(255, 32, 46, 0.12);
}

/* Master Cloned Speech Audio Player */
.speech-player-widget {
  background: linear-gradient(145deg, #161622, #0e0e16);
  border: 1px solid var(--red-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 32, 46, 0.15);
  margin-bottom: 1.5rem;
}

.speech-player-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.speech-player-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 32, 46, 0.15);
  border: 1px solid var(--red-primary);
  color: var(--red-primary);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.speech-visualizer {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 28px;
  padding: 0 4px;
}

.viz-bar {
  width: 4px;
  height: 6px;
  background: var(--red-primary);
  border-radius: 2px;
  transition: height 0.1s ease;
}

.speech-visualizer.playing .viz-bar {
  animation: dance-bar 0.8s ease-in-out infinite alternate;
}

.speech-visualizer.playing .viz-bar:nth-child(2) { animation-delay: 0.15s; }
.speech-visualizer.playing .viz-bar:nth-child(3) { animation-delay: 0.3s; }
.speech-visualizer.playing .viz-bar:nth-child(4) { animation-delay: 0.45s; }
.speech-visualizer.playing .viz-bar:nth-child(5) { animation-delay: 0.2s; }
.speech-visualizer.playing .viz-bar:nth-child(6) { animation-delay: 0.35s; }
.speech-visualizer.playing .viz-bar:nth-child(7) { animation-delay: 0.5s; }
.speech-visualizer.playing .viz-bar:nth-child(8) { animation-delay: 0.25s; }

@keyframes dance-bar {
  0% { height: 4px; opacity: 0.4; }
  100% { height: 26px; opacity: 1; box-shadow: 0 0 6px var(--red-glow); }
}

.player-main-controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.btn-player-play {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--gradient-brand);
  border: none;
  color: var(--white-pure);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 0 20px var(--red-glow);
  flex-shrink: 0;
}

.btn-player-play:hover {
  transform: scale(1.08);
  box-shadow: 0 0 30px var(--red-glow);
}

.player-track-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.player-scrubber {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-elevated);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.player-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--red-primary);
  cursor: pointer;
  box-shadow: 0 0 10px var(--red-glow);
  transition: var(--transition);
}

.player-scrubber::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.player-time-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* History audio item */
.history-audio-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  transition: var(--transition);
}

.history-audio-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

.history-audio-play {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 32, 46, 0.15);
  border: 1px solid var(--red-border);
  color: var(--red-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 0.85rem;
  transition: var(--transition);
}

.history-audio-play:hover {
  background: var(--red-primary);
  color: var(--white-pure);
}

.history-audio-text {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Voice Presets Grid & Cards */
.presets-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.preset-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  transition: var(--transition);
}

.preset-card:hover {
  border-color: var(--red-border);
  background: var(--bg-card-hover);
}

.preset-card.active-preset {
  border-color: var(--red-primary);
  background: rgba(255, 32, 46, 0.08);
  box-shadow: 0 0 12px rgba(255, 32, 46, 0.2);
}

.preset-play-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 32, 46, 0.12);
  border: 1px solid var(--red-border);
  color: var(--red-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
  font-size: 0.85rem;
}

.preset-play-btn:hover {
  background: var(--red-primary);
  color: var(--white-pure);
}

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

.preset-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--white-pure);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preset-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.btn-use-preset {
  background: var(--gradient-brand);
  border: none;
  color: var(--white-pure);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-use-preset:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 10px var(--red-glow);
}

.btn-del-preset {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition);
}

.btn-del-preset:hover {
  border-color: var(--red-primary);
  color: var(--red-hover);
  background: rgba(255, 32, 46, 0.1);
}

/* Modal Overlay & Backdrop */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hidden {
  display: none !important;
}
