/* MyAwesomeNovelz AI — Design Tokens & CSS Variables (Ethereal OLED & High-End Agency Tier) */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400..800;1,400..800&family=Outfit:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:ital,wght@0,300..800;1,300..800&display=swap');

:root {
  /* Color Palette - Anti-Slop Premium Deep Slate & Refined Neon Accent */
  --bg-darkest: #07090e;
  --bg-darker: #0B0E17;
  --bg-dark: #0F172A;
  --bg-card: rgba(15, 23, 42, 0.85);
  --bg-card-hover: rgba(30, 41, 59, 0.92);
  --bg-glass: rgba(11, 15, 25, 0.75);
  --bg-input: rgba(15, 23, 42, 0.9);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(6, 182, 212, 0.35);
  --border-accent-glow: rgba(6, 182, 212, 0.65);
  
  /* Primary & Accent System (Single Considered Cyan + Slate Accent) */
  --primary: #06b6d4;
  --primary-hover: #0891b2;
  --primary-light: #38bdf8;
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;

  /* Domain Accent Colors — unique identity per section */
  --domain-story: #06b6d4;
  --domain-visual: #ec4899;
  --domain-audio: #f59e0b;
  --domain-gameplay: #10b981;
  --domain-release: #3b82f6;
  --domain-monetize: #a855f7;

  --grad-primary: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --grad-pink-violet: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
  --grad-amber-orange: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --grad-card-border: linear-gradient(135deg, rgba(6, 182, 212, 0.4), rgba(59, 130, 246, 0.2));

  /* Vendor / Brand Colors */
  --color-nvidia: #76b900;
  --color-google: #4285f4;
  --color-yandex: #ffcc00;
  --color-sber: #21a038;
  --color-telegram: #2aabee;

  /* Semantic Status Colors */
  --color-danger: #ef4444;
  --color-danger-light: #fca5a5;
  --color-warning: #f59e0b;
  --color-warning-light: #fde68a;
  --color-success: #10b981;
  --color-success-light: #6ee7b7;
  --color-info: #3b82f6;

  /* Text Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* High-End Agency Typography Pair */
  --font-heading: 'Outfit', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-code: 'JetBrains Mono', monospace;

  /* Typographic Scale */
  --text-xs: 0.72rem;
  --text-sm: 0.8rem;
  --text-base: 0.88rem;
  --text-md: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-hero: 2.8rem;

  /* Refraction Shadows & Glass */
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --shadow-glow: 0 0 30px rgba(6, 182, 212, 0.35);
  --glass-backdrop: blur(20px);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  /* Theme Transition */
  --theme-transition: background-color 0.4s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Base Anti-Slop Typography & Tactile Interaction Rules */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-darkest);
  color: var(--text-main);
  background-image: 
    radial-gradient(circle at 12% 18%, rgba(6, 182, 212, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 88% 82%, rgba(59, 130, 246, 0.09) 0%, transparent 45%),
    radial-gradient(circle at 50% 30%, rgba(16, 185, 129, 0.06) 0%, transparent 50%);
  background-attachment: fixed;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.025em;
  text-wrap: balance;
  color: #FFFFFF;
}

p {
  max-width: 75ch;
  line-height: 1.55;
}

/* Tactile Active Press Feedback for Buttons */
.btn {
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn:active {
  transform: scale(0.975) translateY(1px);
}

.panel-card, .dash-card, .pricing-card, .lore-card {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* High-End Film Grain / Noise Overlay (Ethereal Tactile Physical Surface) */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY CLASSES — Phase 2 Design System
   Replace inline styles with reusable, themeable classes
   ═══════════════════════════════════════════════════════════════ */

/* Layout Utilities — Zoom-Safe Responsive Wrap */
.grid-2col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; min-width: 0; }
.grid-3col { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; min-width: 0; }
.grid-4col { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; min-width: 0; }
.grid-auto-fill { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; min-width: 0; }
.grid-split-360 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; min-width: 0; }
.flex-center { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; min-width: 0; max-width: 100%; }
.flex-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.flex-wrap { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.gap-xs { gap: 6px; }
.gap-sm { gap: 6px; }
.gap-md { gap: 12px; }
.gap-lg { gap: 20px; }
.gap-xl { gap: 24px; }
.w-full { width: 100%; min-width: 0; }

/* Typography Utilities */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-md { font-size: var(--text-md); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-hero { font-size: var(--text-hero); }
.text-caption { font-size: var(--text-xs); color: var(--text-muted); }
.text-label { font-size: var(--text-sm); color: var(--text-muted); margin-top: 4px; }
.text-dim { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary-light); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.heading-bold { font-family: var(--font-heading); font-weight: 800; }
.heading-section { font-family: var(--font-heading); font-weight: 700; font-size: var(--text-lg); }
.heading-card { font-family: var(--font-heading); font-weight: 700; font-size: var(--text-base); }
.font-heading { font-family: var(--font-heading); }
.font-code { font-family: var(--font-code); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

/* Card Utilities */
.highlight-card {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 16px;
}
.highlight-card--cyan {
  background: rgba(6, 182, 212, 0.08);
  border-color: rgba(6, 182, 212, 0.3);
}
.highlight-card--pink {
  background: rgba(236, 72, 153, 0.08);
  border-color: rgba(236, 72, 153, 0.3);
}
.highlight-card--danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: var(--theme-transition);
}

/* Pill & Badge Utilities — Zoom-Proof Fluid Architecture */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 40px;
  padding: 6px 14px;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
  transition: all 0.2s ease;
}

.btn.pill {
  border-radius: 40px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  box-sizing: border-box !important;
}

.tag-filter-bar {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.pill:hover, .pill.active {
  background: rgba(139, 92, 246, 0.12);
  border-color: var(--border-accent);
  color: var(--primary-light);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot--success { background: var(--color-success); }
.status-dot--danger { background: var(--color-danger); }
.status-dot--warning { background: var(--color-warning); }

/* Vendor Color Utilities */
.text-nvidia { color: var(--color-nvidia); }
.text-google { color: var(--color-google); }
.text-yandex { color: var(--color-yandex); }
.text-sber { color: var(--color-sber); }
.text-telegram { color: var(--color-telegram); }
.border-nvidia { border-color: var(--color-nvidia); }
.border-google { border-color: var(--color-google); }
.border-yandex { border-color: var(--color-yandex); }
.bg-nvidia-soft { background: rgba(118, 185, 0, 0.1); }
.bg-google-soft { background: rgba(66, 133, 244, 0.1); }
.bg-yandex-soft { background: rgba(255, 204, 0, 0.1); }

/* Progress Modal Overlay */
.progress-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(9, 10, 16, 0.94);
  backdrop-filter: blur(12px);
}
.progress-modal-box {
  text-align: center;
  max-width: 480px;
  width: 90%;
}
.progress-modal-icon {
  font-size: var(--text-hero);
  margin-bottom: 16px;
  display: block;
}
.progress-modal-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 800;
  margin-bottom: 24px;
  color: var(--text-main);
}
.progress-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--color-google), var(--accent-pink), var(--primary));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-step-text {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--primary-light);
}
.progress-step-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 8px;
}

/* Spacing Utilities */
.mt-sm { margin-top: 4px; }
.mt-md { margin-top: 8px; }
.mt-lg { margin-top: 16px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 14px; }
.mb-lg { margin-bottom: 20px; }
.p-sm { padding: 8px; }
.p-md { padding: 12px; }
.p-lg { padding: 16px; }


::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(10, 12, 20, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* SVG Icon System */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon svg {
  color: currentColor;
  transition: color 0.2s ease;
}
.sidebar-icon svg {
  opacity: 0.85;
  transition: opacity 0.2s ease, color 0.2s ease;
}
.sidebar-item:hover .sidebar-icon svg,
.sidebar-item.active .sidebar-icon svg {
  opacity: 1;
}
/* MyAwesomeNovelz AI — Layout: Header, Sidebar, Workspace, Navigation */

/* App Header Bar — Smart Fluid Glass Island Architecture */
.app-header {
  min-height: 58px;
  height: auto;
  margin: 8px 12px 6px 12px;
  width: calc(100% - 24px);
  background: rgba(8, 10, 22, 0.88);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 14px;
  z-index: 100;
  gap: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  transition: var(--theme-transition);
  box-sizing: border-box;
  overflow: visible !important;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-width: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
  position: relative;
  overflow: visible !important;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.5px;
  flex-shrink: 0;
  white-space: nowrap;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--bg-card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}

.brand:hover .brand-icon {
  transform: scale(1.06);
  border-color: var(--primary);
}

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

.brand-title span {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Categorized Grouped Navigation Bar - Fluid Glass Pill Container */
.header-center {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 6px;
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex: 0 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.header-center::-webkit-scrollbar {
  display: none;
}

.master-hub-btn {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 5px 10px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#btn-header-user-profile,
#btn-header-export {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

.nav-dropdown-group {
  position: relative;
  flex-shrink: 0;
}

/* 🎯 3-Tier Smart Fluid Header Responsive Breakpoints & Zoom Adaptivity */
@media (max-width: 1550px) {
  .brand-title {
    font-size: 1.05rem;
  }
  .app-header .btn-subtext {
    display: none !important;
  }
  .master-hub-btn {
    padding: 4px 8px;
    font-size: 0.78rem;
  }
}

@media (max-width: 1350px) {
  .brand-title {
    display: none !important;
  }
  .credit-badge {
    padding: 3px 8px;
    font-size: 0.75rem;
  }
  #btn-header-keys {
    padding: 5px 8px;
  }
}

@media (max-width: 1100px) {
  .app-header {
    border-radius: 24px;
    padding: 5px 10px;
    gap: 6px;
  }
  .header-center {
    padding: 2px 4px;
    gap: 3px;
  }
  .master-hub-btn {
    padding: 4px 6px;
    font-size: 0.74rem;
  }
  #btn-cmd-palette .btn-text,
  #btn-header-keys .btn-text {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .app-header {
    flex-wrap: wrap;
    border-radius: 18px;
    padding: 6px 10px;
  }
  .header-center {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    margin-top: 4px;
  }
}

.nav-category-btn {
  padding: 6px 14px;
  border-radius: 20px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.nav-category-btn:hover, .nav-dropdown-group:hover .nav-category-btn {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.nav-category-btn.active {
  background: var(--grad-primary);
  color: white;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.45);
}

/* Master Hub Navigation Pills */
.master-hub-btn {
  border-radius: 30px !important;
  padding: 6px 14px !important;
  font-family: var(--font-heading) !important;
  font-weight: 700 !important;
  transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1) !important;
}
.master-hub-btn.active {
  background: var(--grad-primary) !important;
  color: white !important;
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.5) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

/* Dropdown Menu Popup & Safe-Zone Hover Bridge */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  width: 220px;
  background: rgba(10, 12, 24, 0.96);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-accent);
  border-radius: 18px;
  padding: 8px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.8), var(--shadow-glow);
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 100000;
}


/* Invisible Hover Bridge preventing mouse dropout */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -14px;
  left: -10px;
  right: -10px;
  height: 18px;
  background: transparent;
}

.nav-dropdown-group:hover .dropdown-menu,
.nav-dropdown-group.active .dropdown-menu {
  display: flex !important;
  animation: dropdown-pop 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}


.dropdown-item {
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: normal;
  line-height: 1.3;
}

.dropdown-item:hover {
  background: rgba(139, 92, 246, 0.18);
  color: var(--text-main);
  border-left: 3px solid var(--primary);
  padding-left: 15px;
}

.credit-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid var(--border-accent);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--primary-light);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  white-space: nowrap;
}

.credit-badge:hover {
  border-color: var(--primary);
  background: rgba(139, 92, 246, 0.28);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.35);
  transform: translateY(-1px);
}

.btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.84rem;
  font-family: var(--font-heading);
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn-primary {
  background: var(--grad-primary);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #9366f9 0%, #08c0df 100%);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.btn-accent {
  background: var(--grad-pink-violet);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.btn-accent:hover {
  background: linear-gradient(135deg, #f457a6 0%, #9366f9 100%);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

/* App Main Container */
.app-main {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Grouped Sidebar */
.sidebar {
  width: 210px;
  min-width: 210px;
  background: rgba(12, 14, 22, 0.95);
  backdrop-filter: var(--glass-backdrop);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 12px 10px;
  gap: 12px;
  flex-shrink: 0;
  overflow-y: auto;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
  width: 54px !important;
  min-width: 54px !important;
  padding: 12px 4px !important;
}

.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .project-selector label,
.sidebar.collapsed .project-select-btn span,
.sidebar.collapsed .sidebar-text {
  display: none !important;
}

.sidebar.collapsed .sidebar-item {
  justify-content: center !important;
  padding: 8px 0 !important;
}


.sidebar-accordion-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-selector {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: var(--radius-md);
}

.project-selector label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 4px;
  display: block;
}

.project-select-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.sidebar-section-title {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary-light);
  font-weight: 800;
  margin-bottom: 4px;
  padding: 4px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
}

.sidebar-item {
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.84rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.sidebar-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-item.active {
  color: var(--primary-light);
  background: rgba(139, 92, 246, 0.14);
  border-left: 3px solid var(--primary);
  font-weight: 600;
}

/* Main Viewport Workspace */
.workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.view-panel {
  display: none;
  flex: 1;
  height: 100%;
  overflow-y: auto;
  padding: 20px;
}

.view-panel.active {
  display: flex;
  flex-direction: column;
}

/* Page Header inside Views — Zoom-Safe Responsive Header */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 0 20px 0;
  margin-bottom: 12px;
  min-width: 0;
  max-width: 100%;
}

.view-title-group {
  min-width: 0;
  flex: 1 1 260px;
}

.view-title-group h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
  word-break: break-word;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.view-title-group p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 2px;
  max-width: 760px;
  line-height: 1.5;
}

.view-header .flex-center,
.view-header > div:last-child {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
  max-width: 100%;
}

.view-header .btn {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

/* Inspector Drawer Slide-over */
.inspector-drawer {
  position: fixed;
  top: 76px;
  right: -450px;
  width: 420px;
  max-width: calc(100vw - 20px);
  height: calc(100vh - 90px);
  background: rgba(8, 10, 22, 0.95);
  backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px 0 0 24px;
  box-shadow: -15px 0 45px rgba(0, 0, 0, 0.8), 0 0 30px rgba(139, 92, 246, 0.2);
  z-index: 500;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  transition: right 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.inspector-drawer.active {
  right: 0;
}

.inspector-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
}

.inspector-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* MyAwesomeNovelz AI — Components: Editor, Cards, Forms, Modals, Canvas, Tour */

/* Story Editor Views */
.story-editor-container {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 20px;
  min-height: 620px;
  flex: 1;
}

.panel-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: visible;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  transition: var(--theme-transition);
}

.panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.panel-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-body {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
}

/* Scene Tree / Graph List */
.scene-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scene-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.scene-item.pinned {
  border-color: rgba(245, 158, 11, 0.45) !important;
  background: rgba(245, 158, 11, 0.08) !important;
}

.scene-item.dragging {
  opacity: 0.5;
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

.scene-item.drag-over-above {
  border-top: 2px solid var(--primary-light) !important;
}

.scene-item.drag-over-below {
  border-bottom: 2px solid var(--primary-light) !important;
}

.scene-drag-handle {
  cursor: grab;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
}
.scene-drag-handle:hover {
  color: var(--primary-light);
}

.btn-scene-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-scene-action:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.btn-scene-action.active-pin {
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.15);
}

.scene-item:hover {
  border-color: var(--border-accent);
  background: rgba(139, 92, 246, 0.06);
}

.scene-item.active {
  border-color: var(--primary);
  background: rgba(139, 92, 246, 0.14);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
}

.scene-title {
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scene-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  gap: 10px;
}

/* Timeline / Dialogue Cards */
.timeline-flow {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dialogue-node-card {
  background: rgba(20, 24, 38, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  position: relative;
  transition: all 0.2s ease;
}

.dialogue-node-card:hover {
  border-color: var(--border-accent);
}

.dialogue-node-card.dragging {
  opacity: 0.45;
  border: 2px dashed var(--primary-light) !important;
  transform: scale(0.98);
}

.dialogue-node-card.drag-over-above {
  border-top: 3px solid var(--accent-cyan) !important;
  box-shadow: 0 -4px 12px rgba(6, 182, 212, 0.4);
}

.dialogue-node-card.drag-over-below {
  border-bottom: 3px solid var(--accent-cyan) !important;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

.dlg-drag-handle:hover {
  color: var(--primary-light) !important;
}

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

.speaker-select {
  background: rgba(14, 17, 27, 0.9);
  border: 1px solid var(--border-color);
  color: var(--primary-light);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

.dialogue-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  resize: vertical;
  min-height: 60px;
}

.dialogue-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.choice-options {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.choice-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.choice-input {
  flex: 1;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

/* Ren'Py Script Code Preview */
.code-preview-box {
  background: #06070c;
  color: #a78bfa;
  font-family: var(--font-code);
  font-size: 0.82rem;
  line-height: 1.6;
  padding: 14px;
  border-radius: var(--radius-md);
  height: 100%;
  overflow-y: auto;
  white-space: pre-wrap;
  border: 1px solid var(--border-color);
}

/* AI Studio Views Grid */
.studio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.asset-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.asset-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg);
}

.asset-preview {
  height: 160px;
  background: rgba(10, 12, 20, 0.8);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-preview .character-img {
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}

.asset-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(15, 17, 26, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
}

.asset-details {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.asset-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.98rem;
}

.asset-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.expression-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}

/* AI Generation Form Controls */
.ai-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  transition: var(--theme-transition);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

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

.form-input, .form-select, .form-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 0.86rem;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Live Simulator Frame */
.simulator-container {
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.vn-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #000;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-accent);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 30px rgba(139, 92, 246, 0.2);
}

.vn-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: background-image 0.5s ease-in-out;
}

.vn-sprites {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 100px;
  pointer-events: none;
}

.vn-sprite {
  height: 88%;
  max-width: 48%;
  object-fit: contain;
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.85));
  animation: fluid-sprite-entry 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Fluid Sprite Entrance Motion (Cinema-Tier Kinematics) */
@keyframes fluid-sprite-entry {
  0% {
    filter: blur(14px) drop-shadow(0 10px 20px rgba(0, 0, 0, 0.8));
    transform: scale(0.93) translateY(16px);
    opacity: 0;
  }
  100% {
    filter: blur(0) drop-shadow(0 10px 20px rgba(0, 0, 0, 0.8));
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Floating Glass Quick Menu Capsule HUD */
.renpy-quick-hud {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(6, 8, 20, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  padding: 3px 10px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.renpy-quick-hud .btn {
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-family: var(--font-heading);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.renpy-quick-hud .btn:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: rgba(139, 92, 246, 0.4);
  color: #fff;
}

/* Staggered History Reveal Animation */
@keyframes staggered-fade-up {
  0% {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.history-item-stagger {
  animation: staggered-fade-up 0.4s cubic-bezier(0.32, 0.72, 0, 1) both;
}

.vn-textbox {
  position: absolute;
  bottom: 16px;
  left: 24px;
  right: 24px;
  background: rgba(6, 8, 18, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.45);
  border-radius: 20px;
  padding: 16px 22px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
  cursor: pointer;
}

.vn-speaker {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--primary-light);
  text-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

.vn-text {
  font-size: 0.98rem;
  line-height: 1.5;
  color: #fff;
  min-height: 44px;
}

.vn-choices {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 20;
  width: 60%;
}

.vn-choice-btn {
  background: rgba(18, 22, 38, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-accent);
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.vn-choice-btn:hover {
  background: var(--grad-primary);
  border-color: transparent;
  transform: scale(1.02);
  box-shadow: var(--shadow-glow);
}

.sim-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

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

.modal-content {
  background: var(--bg-dark);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

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

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Pricing Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.pricing-card.featured {
  border-color: var(--primary);
  background: rgba(22, 26, 44, 0.9);
  box-shadow: var(--shadow-glow);
}

.plan-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--grad-primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}

/* 🔥 Animated Shimmering "СКОРО / COMING SOON" Badge & Pulse Effects */
@keyframes soonGradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes soonPulseGlow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6), 0 0 16px rgba(236, 72, 153, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.9), 0 0 28px rgba(139, 92, 246, 0.8);
    transform: scale(1.04);
  }
}

@keyframes soonIconBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-2px) rotate(-10deg); }
  75% { transform: translateY(1px) rotate(10deg); }
}

.badge-soon, .badge-soon-glow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #f59e0b, #ec4899, #8b5cf6, #f59e0b);
  background-size: 250% 250%;
  animation: soonGradientShift 3s ease infinite, soonPulseGlow 2s ease-in-out infinite;
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 0.76rem !important;
  padding: 3px 10px !important;
  border-radius: 20px !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.4);
  letter-spacing: 0.4px;
}

.badge-soon i, .badge-soon .soon-icon {
  display: inline-block;
  animation: soonIconBounce 1.5s ease-in-out infinite;
}

.nav-item-soon {
  position: relative;
  overflow: hidden;
}

.nav-item-soon::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.25), transparent);
  animation: soonShimmer 2.5s infinite;
}

@keyframes soonShimmer {
  100% { left: 100%; }
}

.plan-price {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
}

.plan-price span {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
}

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.plan-features li svg {
  color: var(--accent-emerald);
}

/* Node Map Visual Story Canvas Styling (Unreal Engine Blueprints Style) */
.node-canvas-viewport {
  width: 100%;
  height: calc(100vh - 130px);
  background-color: #0b0d16;
  background-image: 
    radial-gradient(rgba(139, 92, 246, 0.2) 1px, transparent 0),
    radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 0);
  background-size: 28px 28px;
  background-position: 0 0, 14px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  user-select: none;
  cursor: grab;
}

.canvas-transform-wrapper {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}

.node-svg-layer {
  position: absolute;
  inset: 0;
  width: 10000px !important;
  height: 10000px !important;
  overflow: visible !important;
  pointer-events: none !important;
  z-index: 10 !important;
}

.connection-line {
  fill: none;
  stroke: var(--primary-light);
  stroke-width: 2.5px;
  stroke-dasharray: 6;
  animation: dash-flow 20s linear infinite;
  filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.6));
  pointer-events: none;
  transition: all 0.2s ease;
}

.connection-line-hitarea {
  fill: none;
  stroke: transparent;
  stroke-width: 24px;
  cursor: pointer;
  pointer-events: stroke !important;
}

.connection-group:hover .connection-line,
.connection-group.active .connection-line {
  stroke: #ef4444 !important;
  stroke-width: 3.5px !important;
  stroke-dasharray: 4 !important;
  filter: drop-shadow(0 0 12px rgba(239, 68, 68, 0.9)) !important;
}

.wire-delete-badge {
  cursor: pointer;
  pointer-events: all !important;
}

.wire-delete-badge circle {
  transition: r 0.2s cubic-bezier(0.32, 0.72, 0, 1), fill 0.2s ease, stroke 0.2s ease, filter 0.2s ease;
}

.wire-delete-badge text {
  transition: font-size 0.2s cubic-bezier(0.32, 0.72, 0, 1), fill 0.2s ease;
}

.wire-delete-badge:hover circle,
.connection-group:hover .wire-delete-badge circle {
  r: 16px !important;
  fill: #ef4444 !important;
  stroke: #ffffff !important;
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.9));
}

.wire-delete-badge:hover text,
.connection-group:hover .wire-delete-badge text {
  font-size: 14px !important;
  fill: #ffffff !important;
}

.active-wire-drag {
  stroke: var(--accent-cyan) !important;
  stroke-width: 3.5px !important;
  stroke-dasharray: 4 !important;
  filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.9)) !important;
}

@keyframes dash-flow {
  to {
    stroke-dashoffset: -100;
  }
}

.node-cards-layer {
  position: absolute;
  inset: 0;
  z-index: 5 !important;
  pointer-events: none !important;
}

/* Doppelrand Double-Bezel Hardware Architecture for Node Cards */
.node-card {
  position: absolute;
  width: 290px;
  background: rgba(255, 255, 255, 0.05); /* Outer Machined Shell */
  backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 6px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 6;
  pointer-events: auto !important;
}

/* Inner OLED Content Core */
.node-card-inner {
  background: #070814;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
}

/* Role-based Neumorphic Mesh Glow Profiles */
.node-card.role-start {
  box-shadow: 0 0 45px rgba(139, 92, 246, 0.4), 0 0 15px rgba(139, 92, 246, 0.55), 0 20px 45px rgba(0, 0, 0, 0.8);
  border-color: rgba(139, 92, 246, 0.65);
}

.node-card.role-branch {
  box-shadow: 0 0 40px rgba(6, 182, 212, 0.35), 0 0 12px rgba(6, 182, 212, 0.5), 0 20px 45px rgba(0, 0, 0, 0.8);
  border-color: rgba(6, 182, 212, 0.55);
}

.node-card.role-romance {
  box-shadow: 0 0 40px rgba(236, 72, 153, 0.4), 0 0 12px rgba(236, 72, 153, 0.55), 0 20px 45px rgba(0, 0, 0, 0.8);
  border-color: rgba(236, 72, 153, 0.55);
}

.node-card.role-ending {
  box-shadow: 0 0 45px rgba(245, 158, 11, 0.4), 0 0 15px rgba(245, 158, 11, 0.55), 0 20px 45px rgba(0, 0, 0, 0.8);
  border-color: rgba(245, 158, 11, 0.65);
}

/* Eyebrow Micro-Badges */
.eyebrow-badge {
  font-family: var(--font-code);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
  border-radius: 20px;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.node-card:hover {
  transform: translateY(-2px) scale(1.01);
}

.node-card.dragging {
  cursor: grabbing;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 35px rgba(6, 182, 212, 0.6);
}

.node-card-header {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: grab;
}

.node-card-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.node-card-body {
  padding: 12px;
}

.node-card-ports {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(4, 5, 12, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  font-weight: 700;
}

.port {
  padding: 4px 10px;
  border-radius: 12px;
  cursor: crosshair;
  transition: all 0.2s ease;
  user-select: none;
}

.port-input {
  background: rgba(139, 92, 246, 0.2);
  color: var(--primary-light);
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.port-input:hover {
  background: rgba(139, 92, 246, 0.4);
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
}

.port-output {
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.port-output:hover {
  background: rgba(6, 182, 212, 0.4);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.6);
}

/* Crystal Clear Transparent Tour Backdrop Overlay & Tooltip */
.tour-overlay {
  position: fixed;
  inset: 0;
  background: transparent !important;
  backdrop-filter: none !important;
  z-index: 2000;
  display: none;
  pointer-events: none;
}

.tour-overlay.active {
  display: block;
}

.tour-tooltip-box {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 520px;
  background: rgba(15, 18, 30, 0.88) !important;
  backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(139, 92, 246, 0.7);
  border-radius: var(--radius-xl);
  padding: 18px 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 25px rgba(139, 92, 246, 0.4);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
  animation: float-up 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes float-up {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

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

.tour-step-badge {
  background: var(--grad-primary);
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}

.tour-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

.tour-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.tour-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

/* Collapsible Sidebar Styles */
.sidebar.collapsed {
  width: 68px !important;
  min-width: 68px !important;
  padding: 12px 6px !important;
}

.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .project-selector label,
.sidebar.collapsed .project-select-btn span,
.sidebar.collapsed .sidebar-menu li span:not(.sidebar-icon) {
  display: none !important;
}

.sidebar.collapsed .sidebar-menu li {
  justify-content: center !important;
  padding: 10px 0 !important;
  text-align: center !important;
  font-size: 1.1rem !important;
}

/* Nav Quick Pins */
.quick-pin-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-pin-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--border-accent);
}

/* Master Hub Sub-Tab Bar Styles */
.hub-subtabs-container {
  background: rgba(15, 17, 26, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 20px;
}

.hub-subtabs-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
  overflow-x: auto;
}

.hub-title-badge {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--primary-light);
  white-space: nowrap;
  padding: 4px 10px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
}

.hub-pills-list {
  display: flex;
  gap: 6px;
  align-items: center;
}

.hub-pill-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.hub-pill-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  color: #fff;
  border-color: var(--border-accent);
}

.hub-pill-btn.active {
  background: var(--grad-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.4);
}
/* MyAwesomeNovelz AI — Theme Variations: Sakura, Synthwave, Midnight, Light */

/* 🌸 Theme: Sakura Dream (Anime Pink & Plum) */
body.theme-sakura {
  --bg-darker: #150a17;
  --bg-dark: #1f1024;
  --bg-card: rgba(45, 22, 54, 0.85);
  --bg-card-hover: rgba(62, 30, 74, 0.9);
  --bg-glass: rgba(35, 16, 42, 0.7);
  --bg-input: rgba(28, 12, 34, 0.9);

  --text-main: #fce7f3;
  --text-muted: #f472b6;
  --text-dim: #c084fc;

  --border-color: rgba(236, 72, 153, 0.18);
  --border-accent: rgba(236, 72, 153, 0.5);
  --border-accent-glow: rgba(236, 72, 153, 0.8);

  --primary: #ec4899;
  --primary-hover: #db2777;
  --primary-light: #f472b6;

  --grad-primary: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
  --shadow-glow: 0 0 25px rgba(236, 72, 153, 0.4);
}

/* 🌇 Theme: Synthwave 80s (Retro Sunset Orange & Hot Pink) */
body.theme-synthwave {
  --bg-darker: #0e0714;
  --bg-dark: #170c24;
  --bg-card: rgba(38, 16, 56, 0.85);
  --bg-card-hover: rgba(54, 22, 80, 0.9);
  --bg-glass: rgba(28, 12, 42, 0.7);
  --bg-input: rgba(20, 8, 30, 0.9);

  --text-main: #fef08a;
  --text-muted: #f97316;
  --text-dim: #fb7185;

  --border-color: rgba(249, 115, 22, 0.2);
  --border-accent: rgba(255, 78, 80, 0.5);
  --border-accent-glow: rgba(249, 212, 35, 0.8);

  --primary: #ff4e50;
  --primary-hover: #e11d48;
  --primary-light: #f9d423;

  --grad-primary: linear-gradient(135deg, #ff4e50 0%, #f9d423 100%);
  --shadow-glow: 0 0 25px rgba(255, 78, 80, 0.4);
}

/* 🌌 Theme: Midnight Abyss (OLED Pure Black) */
body.theme-midnight {
  --bg-darker: #020204;
  --bg-dark: #07070b;
  --bg-card: rgba(12, 14, 22, 0.9);
  --bg-card-hover: rgba(18, 22, 34, 0.95);
  --bg-glass: rgba(8, 10, 16, 0.8);
  --bg-input: rgba(5, 6, 10, 0.95);

  --text-main: #f8fafc;
  --text-muted: #38bdf8;
  --text-dim: #64748b;

  --border-color: rgba(56, 189, 248, 0.15);
  --border-accent: rgba(56, 189, 248, 0.5);
  --border-accent-glow: rgba(56, 189, 248, 0.8);

  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #38bdf8;

  --grad-primary: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --shadow-glow: 0 0 25px rgba(0, 242, 254, 0.4);
}

/* ☀️ Theme: Editorial Light (Daylight Studio) */
body.theme-light {
  --bg-darker: #f1f5f9;
  --bg-dark: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: #f8fafc;
  --bg-glass: rgba(255, 255, 255, 0.9);
  --bg-input: #f8fafc;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --border-color: rgba(15, 23, 42, 0.12);
  --border-accent: rgba(79, 70, 229, 0.4);
  --border-accent-glow: rgba(79, 70, 229, 0.6);

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #6366f1;

  --grad-primary: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.25);
}

body.theme-light .app-header {
  background: rgba(255, 255, 255, 0.95) !important;
  border-bottom-color: rgba(0, 0, 0, 0.1) !important;
}

body.theme-light .sidebar {
  background: #ffffff !important;
  border-right-color: rgba(0, 0, 0, 0.1) !important;
}

body.theme-light .dropdown-menu {
  background: #ffffff !important;
  border-color: rgba(79, 70, 229, 0.3) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

body.theme-light .dropdown-item {
  color: #334155 !important;
}

body.theme-light .dropdown-item:hover {
  background: rgba(79, 70, 229, 0.1) !important;
  color: #4f46e5 !important;
}
/* MyAwesomeNovelz AI — Responsive: Density, Enhancements, Media Queries */

/* Compact Pro Density Mode (13px fonts, tight padding/gap across all components) */
body.density-compact {
  font-size: 13px !important;
}

body.density-compact .view-panel {
  padding: 10px !important;
}

body.density-compact .ai-form-card {
  padding: 12px 14px !important;
  margin-bottom: 10px !important;
  border-radius: var(--radius-md) !important;
}

body.density-compact .view-header {
  margin-bottom: 10px !important;
  padding-bottom: 6px !important;
}

body.density-compact .view-header h2 {
  font-size: 1.15rem !important;
}

body.density-compact .view-header p {
  font-size: 0.78rem !important;
}

body.density-compact h3 {
  font-size: 0.9rem !important;
  margin-bottom: 8px !important;
}

body.density-compact .scene-item {
  padding: 5px 8px !important;
  font-size: 0.78rem !important;
}

body.density-compact .btn {
  padding: 4px 10px !important;
  font-size: 0.78rem !important;
}

body.density-compact .form-group {
  margin-bottom: 8px !important;
}

body.density-compact .form-label {
  font-size: 0.75rem !important;
  margin-bottom: 3px !important;
}

body.density-compact .form-input,
body.density-compact .form-select,
body.density-compact .form-textarea {
  padding: 5px 8px !important;
  font-size: 0.8rem !important;
}

body.density-compact .hub-subtabs-container {
  padding: 4px 10px !important;
}

body.density-compact .hub-pill-btn {
  padding: 3px 8px !important;
  font-size: 0.75rem !important;
}

body.density-compact .sidebar {
  padding: 8px 6px !important;
  gap: 8px !important;
}

body.density-compact .sidebar-item {
  padding: 5px 8px !important;
  font-size: 0.78rem !important;
}

/* Modern Next-Gen 2026 Visual Enhancements */
.ai-form-card {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}

.ai-form-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 14px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(139, 92, 246, 0.15);
}

.scene-item {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.scene-item:hover {
  transform: translateX(3px);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-light) !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

.btn {
  letter-spacing: -0.01em;
}

/* ==========================================================================
   Adaptive Responsive Design System — Simple Mode & Mobile Support
   ========================================================================== */

.simple-wizard-card {
  width: 100%;
  max-width: 1350px;
  margin: 0 auto;
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.simple-wizard-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.simple-wizard-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.simple-wizard-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.simple-wizard-progress-track {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 8px;
}

.simple-wizard-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  min-width: 56px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.simple-wizard-progress-step:active {
  transform: scale(0.92);
}

/* Wide Monitor Optimization (1440px and higher) */
@media (min-width: 1440px) {
  .simple-wizard-card {
    max-width: 1440px;
    padding: 32px;
  }
}

/* Tablet Screens (under 1024px) */
@media (max-width: 1024px) {
  .simple-wizard-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .simple-wizard-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile Screens (Android & iPhone - under 768px) */
@media (max-width: 768px) {
  body {
    overflow-y: auto !important;
  }

  .view-panel {
    padding: 12px 10px !important;
    overflow-y: auto !important;
  }

  /* App Header Bar Mobile Optimization */
  .app-header {
    height: auto !important;
    min-height: 56px !important;
    padding: 6px 10px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 6px !important;
  }

  .brand-title {
    display: none !important; /* Hide long text title on mobile to save space */
  }

  .header-center {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex-shrink: 0 !important;
  }

  .header-right {
    overflow-x: auto !important;
    flex-shrink: 0 !important;
  }

  /* Universal Responsive Grid & Flex Collapse for All Studios */
  div[style*="grid-template-columns:1fr 340px"],
  div[style*="grid-template-columns: 1fr 340px"],
  div[style*="grid-template-columns:340px 1fr"],
  div[style*="grid-template-columns: 340px 1fr"],
  div[style*="grid-template-columns:380px 1fr"],
  div[style*="grid-template-columns: 380px 1fr"],
  div[style*="grid-template-columns:360px 1fr"],
  div[style*="grid-template-columns: 360px 1fr"],
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns:repeat(3, 1fr)"],
  div[style*="grid-template-columns: repeat(3, 1fr)"],
  div[style*="grid-template-columns:repeat(4, 1fr)"],
  div[style*="grid-template-columns: repeat(4, 1fr)"],
  div[style*="grid-template-columns:repeat(2, 1fr)"],
  div[style*="grid-template-columns: repeat(2, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* View Header Title & Subtitle Mobile Scaling */
  .view-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    margin-bottom: 14px !important;
  }

  .view-header h2 {
    font-size: 1.2rem !important;
    line-height: 1.3 !important;
  }

  .view-header p {
    font-size: 0.8rem !important;
  }

  /* Form Cards & Inputs */
  .ai-form-card, .panel-card {
    padding: 14px !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 12px !important;
  }

  .form-row {
    flex-direction: column !important;
    gap: 10px !important;
  }

  .code-preview-box, pre {
    max-height: 280px !important;
    font-size: 0.75rem !important;
  }

  /* Buttons & Touch Targets */
  .btn {
    min-height: 42px !important;
    font-size: 0.88rem !important;
    padding: 8px 14px !important;
  }

  /* Visual Novel Preview Frames */
  .vn-frame {
    aspect-ratio: 16/9 !important;
    width: 100% !important;
  }

  .simple-wizard-card {
    padding: 14px !important;
    border-radius: var(--radius-md) !important;
  }

  .simple-wizard-grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .simple-wizard-grid-3 {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .simple-wizard-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .simple-wizard-nav-bar {
    flex-direction: column-reverse !important;
    gap: 10px !important;
  }

  .simple-wizard-nav-bar .btn {
    width: 100% !important;
    padding: 14px !important;
    font-size: 0.95rem !important;
  }
}

/* Small Smartphone Screens (under 480px) */
@media (max-width: 480px) {
  .simple-wizard-grid-4 {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .asset-card .asset-preview {
    height: 130px !important;
  }

  /* Bottom Quick Action Bar Mobile Optimization */
  div[style*="position:fixed; bottom:20px; left:50%"] {
    width: 94% !important;
    max-width: 94% !important;
    bottom: 10px !important;
    padding: 4px 6px !important;
    gap: 4px !important;
    justify-content: space-around !important;
  }

  div[style*="position:fixed; bottom:20px; left:50%"] .btn {
    padding: 4px 8px !important;
    font-size: 0.7rem !important;
    min-height: 34px !important;
  }

  /* AI Floating Chat Window Mobile Optimization */
  div[style*="position:fixed; bottom:24px; right:24px"] {
    bottom: 10px !important;
    right: 8px !important;
    left: 8px !important;
  }

  div[style*="position:fixed; bottom:24px; right:24px"] > div[style*="width:380px"] {
    width: 100% !important;
    max-width: 100% !important;
    height: 75vh !important;
    max-height: 75vh !important;
  }

  /* Modal Windows */
  .modal-content, .sub-modal-content {
    width: 94vw !important;
    max-width: 94vw !important;
    padding: 14px !important;
    max-height: 88vh !important;
    overflow-y: auto !important;
  }
}

/* Point-and-Click Detective Scene Inspector */
.point-click-canvas-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  background-size: cover;
  background-position: center;
  user-select: none;
}

.point-click-grid-overlay {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.hotspot-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(7, 8, 20, 0.88);
  backdrop-filter: blur(14px) saturate(180%);
  border: 1.8px solid var(--accent-pink);
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  transition: all 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 10;
}

.hotspot-marker::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px dashed var(--accent-pink);
  opacity: 0.6;
  animation: radar-pulse 3s linear infinite;
}

.hotspot-marker:hover {
  transform: translate(-50%, -50%) scale(1.18);
  border-color: #ffffff;
  box-shadow: 0 0 28px rgba(236, 72, 153, 0.85);
  z-index: 20;
}

.hotspot-marker.type-safe {
  border-color: #ec4899;
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.5);
}
.hotspot-marker.type-safe::before { border-color: #ec4899; }

.hotspot-marker.type-terminal {
  border-color: #06b6d4;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
}
.hotspot-marker.type-terminal::before { border-color: #06b6d4; }

.hotspot-marker.type-clue {
  border-color: #10b981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}
.hotspot-marker.type-clue::before { border-color: #10b981; }

.hotspot-marker.type-item {
  border-color: #f59e0b;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
}
.hotspot-marker.type-item::before { border-color: #f59e0b; }

.hotspot-marker.unlocked {
  border-color: #10b981 !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.6) !important;
}

@keyframes radar-pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 0.3; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.hotspot-tooltip {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(6, 8, 20, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 6px 12px;
  border-radius: 10px;
  white-space: nowrap;
  font-size: 0.78rem;
  color: #ffffff;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hotspot-marker:hover .hotspot-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* Numpad Keypad Lock Interface */
.numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 240px;
  margin: 0 auto;
}

.numpad-btn {
  height: 52px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.numpad-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent-cyan);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(6, 182, 212, 0.3);
}
.numpad-btn:active {
  transform: translateY(1px);
}

/* Ren'Py RPG Inventory Studio & Item Backpack HUD */
.inventory-grid-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.inventory-slot {
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  background: rgba(7, 8, 20, 0.88);
  backdrop-filter: blur(14px) saturate(180%);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.22s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.inventory-slot:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.6);
}

.inventory-slot.selected {
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.6) !important;
  background: rgba(6, 182, 212, 0.12) !important;
}

.inventory-slot.rarity-legendary {
  border-color: #f59e0b;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(7, 8, 20, 0.95));
}

.inventory-slot.rarity-epic {
  border-color: #a855f7;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.35);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(7, 8, 20, 0.95));
}

.inventory-slot.rarity-rare {
  border-color: #3b82f6;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.35);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(7, 8, 20, 0.95));
}

.inventory-slot.rarity-common {
  border-color: rgba(255, 255, 255, 0.14);
}

.item-qty-tag {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.8);
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.item-rarity-dot {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.item-rarity-dot.legendary { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.item-rarity-dot.epic { background: #a855f7; box-shadow: 0 0 8px #a855f7; }
.item-rarity-dot.rare { background: #3b82f6; box-shadow: 0 0 8px #3b82f6; }
.item-rarity-dot.common { background: #9ca3af; }

.filter-tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}
.filter-tab-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}
.filter-tab-btn.active {
  background: rgba(139, 92, 246, 0.2);
  border-color: var(--primary-light);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

/* Interactive Detective Notebook & Journal Studio */
.notebook-binder-container {
  background: radial-gradient(circle at top left, rgba(20, 24, 45, 0.95), rgba(7, 8, 20, 0.98));
  border-radius: 24px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.notebook-binder-container::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(245, 158, 11, 0.4), transparent);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
  pointer-events: none;
}

.suspect-dossier-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 14px;
  transition: all 0.22s ease;
  position: relative;
}
.suspect-dossier-card:hover {
  border-color: rgba(245, 158, 11, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.suspect-status-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.suspect-status-badge.suspect { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }
.suspect-status-badge.alibi { background: rgba(16, 185, 129, 0.2); color: #a7f3d0; border: 1px solid rgba(16, 185, 129, 0.4); }
.suspect-status-badge.guilty { background: rgba(245, 158, 11, 0.2); color: #fde047; border: 1px solid rgba(245, 158, 11, 0.4); }

.quest-status-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
}
.quest-status-tag.active { background: rgba(6, 182, 212, 0.2); color: #67e8f9; }
.quest-status-tag.completed { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.quest-status-tag.failed { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

/* Reader Battle Pass & Leaderboard Studio */
.bp-tier-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: all 0.22s ease;
}
.bp-tier-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.bp-tier-card.unlocked {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.4);
}
.bp-tier-card.claimed {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.bp-gold-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000000;
  font-weight: 900;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
}

.leaderboard-row {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}
.leaderboard-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-accent);
}
.leaderboard-row.rank-1 {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
}
.leaderboard-row.rank-2 {
  background: rgba(156, 163, 175, 0.12);
  border-color: rgba(156, 163, 175, 0.4);
}
.leaderboard-row.rank-3 {
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.4);
}

/* Endings Tree & Completion Studio */
.ending-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 16px;
  position: relative;
  transition: all 0.22s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.ending-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
.ending-card.true { border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.06); }
.ending-card.romance { border-color: rgba(236, 72, 153, 0.4); background: rgba(236, 72, 153, 0.06); }
.ending-card.bad { border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.06); }
.ending-card.secret { border-color: rgba(139, 92, 246, 0.4); background: rgba(139, 92, 246, 0.06); }

.ending-type-tag {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}
.ending-type-tag.true { background: rgba(245, 158, 11, 0.2); color: #fde047; }
.ending-type-tag.romance { background: rgba(236, 72, 153, 0.2); color: #fbcfe8; }
.ending-type-tag.bad { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.ending-type-tag.secret { background: rgba(139, 92, 246, 0.2); color: #c084fc; }

/* Smartphone & Messenger Texting Studio */
.phone-mockup-frame {
  background: #090a14;
  border: 4px solid #1e2438;
  border-radius: 36px;
  padding: 16px 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 24px rgba(139, 92, 246, 0.2);
  height: 600px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.phone-mockup-frame::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 18px;
  background: #1e2438;
  border-radius: 10px;
  z-index: 100;
}

.chat-bubble-item {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.82rem;
  line-height: 1.4;
  position: relative;
  transition: all 0.2s ease;
}
.chat-bubble-item.me {
  align-self: flex-end;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}
.chat-bubble-item.them {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom-left-radius: 4px;
}
.chat-bubble-item.system {
  align-self: center;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #67e8f9;
  font-size: 0.75rem;
  border-radius: 10px;
  text-align: center;
}

/* Cloud Revision History & Rollback Studio */
.revision-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 14px;
  transition: all 0.22s ease;
  position: relative;
}
.revision-item-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.revision-item-card.current {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.4);
}

.diff-tag-added {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
}
.diff-tag-removed {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* RPG Stats & Skill Check Studio */
.stat-card-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}
.stat-card-item:hover {
  border-color: var(--border-accent);
  background: rgba(255, 255, 255, 0.06);
}

.dice-result-badge {
  background: radial-gradient(circle, rgba(139, 92, 246, 0.3), rgba(7, 8, 20, 0.9));
  border: 1.5px solid var(--border-accent);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

/* Character Affection & Romance Studio */
.romance-char-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(236, 72, 153, 0.3);
  border-radius: 20px;
  padding: 16px;
  position: relative;
  transition: all 0.22s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.romance-char-card:hover {
  border-color: rgba(236, 72, 153, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(236, 72, 153, 0.25);
}

.romance-status-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 8px;
}
.romance-status-badge.enemy { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.romance-status-badge.neutral { background: rgba(156, 163, 175, 0.2); color: #e2e8f0; }
.romance-status-badge.friend { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.romance-status-badge.crush { background: rgba(236, 72, 153, 0.2); color: #fbcfe8; }
.romance-status-badge.lover { background: rgba(245, 158, 11, 0.2); color: #fde047; }

/* Timed Choice & Quick Time Events (QTE) Studio */
.qte-event-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 20px;
  padding: 16px;
  position: relative;
  transition: all 0.22s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.qte-event-card:hover {
  border-color: rgba(239, 68, 68, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(239, 68, 68, 0.3);
}

.qte-timer-progress {
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
}

.qte-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #f59e0b);
  box-shadow: 0 0 12px #ef4444;
  transition: width 0.1s linear;
}

.qte-type-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}
.qte-type-badge.countdown { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.qte-type-badge.mash { background: rgba(245, 158, 11, 0.2); color: #fde047; }
.qte-type-badge.sequence { background: rgba(6, 182, 212, 0.2); color: #67e8f9; }

/* World Map & Travel Location Picker Studio */
.map-pin-badge {
  position: absolute;
  transform: translate(-50%, -100%);
  background: rgba(6, 8, 20, 0.92);
  backdrop-filter: blur(12px);
  border: 1.5px solid var(--accent-cyan);
  border-radius: 12px;
  padding: 6px 12px;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  transition: all 0.2s ease;
  white-space: nowrap;
}
.map-pin-badge:hover {
  transform: translate(-50%, -105%) scale(1.08);
  border-color: var(--primary-light);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
  z-index: 100;
}
.map-pin-badge.locked {
  border-color: rgba(239, 68, 68, 0.5);
  opacity: 0.7;
}

.map-grid-overlay {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(6, 182, 212, 0.15) 1px, transparent 0);
  background-size: 24px 24px;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   DYNAMIC DOMAIN ACCENT THEMES & LAYOUT TEMPLATES
   (Loaded & Enforced directly in main.css)
   ═══════════════════════════════════════════════════════════════ */

/* 1. Page Header Spacing & Zoom-Proof Responsive Wrap */
.view-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 14px !important;
  padding: 16px 0 22px 0 !important;
  margin-bottom: 20px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.view-title-group {
  min-width: 0 !important;
  flex: 1 1 260px !important;
}

.view-header .flex-center,
.view-header > div:last-child {
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-left: auto !important;
  max-width: 100% !important;
}

.view-header .btn {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.view-title-group h2 {
  font-family: var(--font-heading) !important;
  font-size: clamp(1.15rem, 1.8vw, 1.6rem) !important;
  font-weight: 800 !important;
  letter-spacing: -0.3px !important;
  margin-bottom: 4px !important;
  word-break: break-word !important;
}

.view-title-group p {
  color: var(--text-muted) !important;
  font-size: 0.88rem !important;
  line-height: 1.5 !important;
  max-width: 760px !important;
  margin-top: 4px !important;
}

/* 2. Dynamic Domain Accents */
body[data-domain="hub-story"] {
  --domain-current: var(--domain-story);
  --border-accent: rgba(6, 182, 212, 0.4);
}
body[data-domain="hub-story"] .view-title-group h2 {
  color: var(--domain-story) !important;
  text-shadow: 0 0 16px rgba(6, 182, 212, 0.35) !important;
}
body[data-domain="hub-story"] .ai-form-card {
  border-top: 2.5px solid rgba(6, 182, 212, 0.7) !important;
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.08) 0%, rgba(15, 18, 30, 0.92) 100%) !important;
}

body[data-domain="hub-visual"] {
  --domain-current: var(--domain-visual);
  --border-accent: rgba(236, 72, 153, 0.4);
}
body[data-domain="hub-visual"] .view-title-group h2 {
  color: var(--domain-visual) !important;
  text-shadow: 0 0 16px rgba(236, 72, 153, 0.35) !important;
}
body[data-domain="hub-visual"] .ai-form-card {
  border-top: 2.5px solid rgba(236, 72, 153, 0.7) !important;
  background: linear-gradient(180deg, rgba(236, 72, 153, 0.08) 0%, rgba(15, 18, 30, 0.92) 100%) !important;
}

body[data-domain="hub-audio"] {
  --domain-current: var(--domain-audio);
  --border-accent: rgba(245, 158, 11, 0.4);
}
body[data-domain="hub-audio"] .view-title-group h2 {
  color: var(--domain-audio) !important;
  text-shadow: 0 0 16px rgba(245, 158, 11, 0.35) !important;
}
body[data-domain="hub-audio"] .ai-form-card {
  border-top: 2.5px solid rgba(245, 158, 11, 0.7) !important;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, rgba(15, 18, 30, 0.92) 100%) !important;
}

body[data-domain="hub-gameplay"] {
  --domain-current: var(--domain-gameplay);
  --border-accent: rgba(16, 185, 129, 0.4);
}
body[data-domain="hub-gameplay"] .view-title-group h2 {
  color: var(--domain-gameplay) !important;
  text-shadow: 0 0 16px rgba(16, 185, 129, 0.35) !important;
}
body[data-domain="hub-gameplay"] .ai-form-card {
  border-top: 2.5px solid rgba(16, 185, 129, 0.7) !important;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, rgba(15, 18, 30, 0.92) 100%) !important;
}

body[data-domain="hub-release"] {
  --domain-current: var(--domain-release);
  --border-accent: rgba(59, 130, 246, 0.4);
}
body[data-domain="hub-release"] .view-title-group h2 {
  color: var(--domain-release) !important;
  text-shadow: 0 0 16px rgba(59, 130, 246, 0.35) !important;
}
body[data-domain="hub-release"] .ai-form-card {
  border-top: 2.5px solid rgba(59, 130, 246, 0.7) !important;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.08) 0%, rgba(15, 18, 30, 0.92) 100%) !important;
}

body[data-domain="hub-monetize"] {
  --domain-current: var(--domain-monetize);
  --border-accent: rgba(168, 85, 247, 0.4);
}
body[data-domain="hub-monetize"] .view-title-group h2 {
  color: var(--domain-monetize) !important;
  text-shadow: 0 0 16px rgba(168, 85, 247, 0.35) !important;
}
body[data-domain="hub-monetize"] .ai-form-card {
  border-top: 2.5px solid rgba(168, 85, 247, 0.7) !important;
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.08) 0%, rgba(15, 18, 30, 0.92) 100%) !important;
}

/* 3. Page Layout Grids */
.layout-story-canvas {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: calc(100vh - 85px) !important;
  padding: 0 8px !important;
}

.layout-hero-inspector {
  display: grid !important;
  grid-template-columns: 1fr 380px !important;
  gap: 24px !important;
  max-width: 1400px !important;
  margin: 0 auto !important;
}
@media (max-width: 1024px) {
  .layout-hero-inspector {
    grid-template-columns: 1fr !important;
  }
}

.layout-masonry-gallery {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  gap: 24px !important;
  max-width: 1400px !important;
  margin: 0 auto !important;
}

.layout-settings-compact {
  display: flex !important;
  flex-direction: column !important;
  gap: 24px !important;
  max-width: 860px !important;
  margin: 0 auto !important;
}

/* 4. Semantic Component Classes */
.stat-card {
  background: rgba(0, 0, 0, 0.35) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  padding: 12px 18px !important;
  text-align: center !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
}
.stat-card:hover {
  border-color: var(--border-accent) !important;
  transform: translateY(-2px) !important;
}
.stat-card-val {
  font-size: 1.3rem !important;
  font-weight: 800 !important;
  color: var(--primary-light) !important;
}
.stat-card-lbl {
  font-size: 0.72rem !important;
  color: var(--text-muted) !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

.setting-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 14px 18px !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 10px !important;
  gap: 16px !important;
  margin-bottom: 12px !important;
  transition: all 0.2s ease !important;
}
.setting-row:hover {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--border-accent) !important;
}
.setting-info {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
}
.setting-title {
  font-weight: 700 !important;
  font-size: 0.9rem !important;
  color: var(--text-main) !important;
}
.setting-desc {
  font-size: 0.78rem !important;
  color: var(--text-muted) !important;
}

.media-preview-card {
  background: #040508 !important;
  padding: 18px !important;
  border: 1px solid var(--border-accent) !important;
  border-radius: 14px !important;
  position: relative !important;
  overflow: hidden !important;
}
.media-viewport-container {
  width: 100% !important;
  aspect-ratio: 16/9 !important;
  position: relative !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: #000 !important;
}

.code-output-card {
  background: rgba(4, 5, 8, 0.95) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  font-family: var(--font-code, monospace) !important;
  font-size: 0.82rem !important;
  color: var(--primary-light) !important;
  position: relative !important;
  max-height: 240px !important;
  overflow-y: auto !important;
}

/* ═══════════════════════════════════════════════════════════════
   PANEL CARD & TOOLBAR FLUID ZOOM-PROOF ARCHITECTURE
   ═══════════════════════════════════════════════════════════════ */
.panel-card,
.panel-card.mb-lg {
  overflow: visible !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.panel-card .flex-between {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.panel-card .flex-center {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.panel-card select.form-select,
.panel-card select.form-input {
  max-width: 100% !important;
  min-width: 0 !important;
  flex-shrink: 1 !important;
}

.panel-card .plan-badge,
.panel-card .eyebrow-badge {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

/* ═══════════════════════════════════════════════════════════════
   ANTI-UI-SLOP: PRO IDE GLASSMORPHISM & TACTILE MICRO-INTERACTIONS
   Unreal Engine / Blender / VS Code inspired high-contrast styling
   ═══════════════════════════════════════════════════════════════ */

/* 1. Ethereal Glassmorphism Panels & Cards */
.panel-card, .ai-form-card, .media-preview-card {
  background: rgba(10, 13, 24, 0.85) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  transition: border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, transform 0.2s ease;
}

.panel-card:hover, .ai-form-card:hover {
  border-color: rgba(139, 92, 246, 0.35) !important;
}

/* 2. Tactile Button Micro-Interactions & State Completeness */
.btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, filter 0.15s ease !important;
  user-select: none;
}

.btn:active {
  transform: scale(0.97) translateY(1px) !important;
}

.btn:focus-visible {
  outline: 2px solid var(--accent-cyan) !important;
  outline-offset: 2px !important;
}

.btn-primary {
  background: linear-gradient(135deg, #8b5cf6, #6366f1) !important;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.btn-accent {
  background: linear-gradient(135deg, #ec4899, #8b5cf6) !important;
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.btn-accent:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

/* 3. Pro IDE Form Controls & Compact Property Rows */
.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 5px;
  letter-spacing: 0.2px;
}

.form-input, .form-select, .form-textarea {
  background: rgba(4, 6, 14, 0.85) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 10px !important;
  color: #fff !important;
  font-size: 0.84rem !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2) !important;
  outline: none !important;
}

/* 4. High-Contrast Code Preview Cards with Syntax Aesthetics */
pre.code-output-card, pre.code-preview-box {
  background: #050711 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  font-family: var(--font-code, 'Fira Code', 'Consolas', monospace) !important;
  font-size: 0.76rem !important;
  line-height: 1.5 !important;
  color: #a7f3d0 !important;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6) !important;
}

/* 5. Custom Slim Smooth Scrollbars */
pre::-webkit-scrollbar,
div::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

pre::-webkit-scrollbar-track,
div::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

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

pre::-webkit-scrollbar-thumb:hover,
div::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* 6. Steam Overlay & Modal Animation Keyframes */
@keyframes steamToastIn {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.92);
  }
  70% {
    opacity: 1;
    transform: translateY(-2px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ═══════════════════════════════════════════════════════════════
   FRONTEND-DESIGN: AMBIENT DOMAIN AURA & EDITORIAL TYPOGRAPHY
   Chromatic mood for 6 Master Hubs + High-Legibility Typography
   ═══════════════════════════════════════════════════════════════ */

/* 1. Header Dynamic Ambient Aura Line */
.app-header {
  position: relative;
}

.app-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--hub-accent-color, #8b5cf6);
  box-shadow: 0 0 14px var(--hub-accent-color, #8b5cf6), 0 0 28px var(--hub-accent-color, #8b5cf6);
  transition: background 0.35s ease, box-shadow 0.35s ease;
  z-index: 100;
}

/* 2. Master Hub Buttons Dynamic Chromatic Feedback */
.master-hub-btn {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.master-hub-btn[data-hub="hub-story"].active {
  border-color: #8b5cf6 !important;
  color: #c4b5fd !important;
  background: rgba(139, 92, 246, 0.18) !important;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.25) !important;
}

.master-hub-btn[data-hub="hub-visual"].active {
  border-color: #06b6d4 !important;
  color: #67e8f9 !important;
  background: rgba(6, 182, 212, 0.18) !important;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.25) !important;
}

.master-hub-btn[data-hub="hub-gameplay"].active {
  border-color: #f59e0b !important;
  color: #fcd34d !important;
  background: rgba(245, 158, 11, 0.18) !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25) !important;
}

.master-hub-btn[data-hub="hub-audio"].active {
  border-color: #ec4899 !important;
  color: #f472b6 !important;
  background: rgba(236, 72, 153, 0.18) !important;
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.25) !important;
}

.master-hub-btn[data-hub="hub-release"].active {
  border-color: #10b981 !important;
  color: #6ee7b7 !important;
  background: rgba(16, 185, 129, 0.18) !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.25) !important;
}

.master-hub-btn[data-hub="hub-monetization"].active {
  border-color: #38bdf8 !important;
  color: #7dd3fc !important;
  background: rgba(56, 189, 248, 0.18) !important;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25) !important;
}

/* 3. Sidebar Contextual Active Indicator */
.sidebar-item.active {
  border-left: 3.5px solid var(--hub-accent-color, var(--primary-light)) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: #fff !important;
}

/* 4. Editorial Typography Disciplines */
h1, h2, h3, .view-title-group h2, .panel-title, .heading-bold {
  font-family: var(--font-heading, 'Outfit', 'Syne', -apple-system, sans-serif) !important;
  letter-spacing: -0.022em !important;
  font-weight: 800 !important;
}

body, .form-input, .btn, .form-label, .sidebar-text, p {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  -webkit-font-smoothing: antialiased;
}











