/* ============================================================
   ZOLO CREATE — Master Stylesheet
   Bubbly, playful browser IDE vibe
   ============================================================ */

/* ========================= VARIABLES ========================= */
:root {
  /* Bubbly candy palette */
  --accent: #ff6ec7;          /* bubblegum pink */
  --accent2: #9b7bff;         /* soft purple */
  --accent3: #5cf1ff;         /* teal */
  --accent4: #ffd46b;         /* sunshine yellow */
  --accent5: #ff9a6c;         /* coral */
  --accent-glow: rgba(255,110,199,0.28);
  --accent-gradient: linear-gradient(135deg, #ff6ec7 0%, #9b7bff 50%, #5cf1ff 100%);
  --accent-gradient-warm: linear-gradient(135deg, #ffd46b 0%, #ff9a6c 50%, #ff6ec7 100%);
  --rainbow: linear-gradient(90deg,#ff6ec7,#9b7bff,#5cf1ff,#7bffb3,#ffd46b,#ff9a6c,#ff6ec7);

  /* Surfaces — deep plum/navy base, not pure black */
  --bg:  #15122e;
  --bg2: #1d1a3d;
  --bg3: #2a2550;
  --panel:  #1d1a3d;
  --panel2: #2a2550;
  --panel3: #362f66;

  --border: rgba(255,255,255,0.08);
  --border-bright: rgba(255,255,255,0.16);

  --text: #f4eefc;
  --text-dim: #b4a9d6;
  --text-muted: #7e719f;

  --danger:  #ff6b9a;
  --success: #7bffb3;
  --warning: #ffd46b;
  --info:    #5cf1ff;

  --glass: rgba(255,255,255,0.06);
  --glass-border: rgba(255,255,255,0.14);

  --toolbar-h: 52px;
  --sidebar-w: 252px;

  --editor-font: 'JetBrains Mono', monospace;
  --ui-font: 'Fredoka', 'Rajdhani', sans-serif;
  --display-font: 'Fredoka', 'Rajdhani', sans-serif;

  /* Chunky, rounded — the whole point of "bubbly" */
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --radius-pill: 999px;

  /* Softer drop shadows, not neon glow */
  --shadow:    0 10px 30px rgba(13,5,40,0.35), 0 2px 6px rgba(13,5,40,0.2);
  --shadow-md: 0 14px 40px rgba(13,5,40,0.4), 0 3px 10px rgba(13,5,40,0.25);
  --shadow-lg: 0 24px 70px rgba(13,5,40,0.5), 0 4px 16px rgba(13,5,40,0.3);
  --shadow-bubble: 0 8px 20px rgba(255,110,199,0.35), inset 0 2px 0 rgba(255,255,255,0.35);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.8, 0.5, 1);
  --ease-bounce: cubic-bezier(0.68, -0.6, 0.32, 1.6);
  --transition: 0.22s var(--ease);
  --transition-slow: 0.45s var(--ease-out);
}

/* Themes — all keep the bubbly feel, just different base moods */
.light-theme {
  --bg: #fff4fb; --bg2: #ffeaf5; --bg3: #ffe0f0;
  --panel: #ffffff; --panel2: #fff6fc; --panel3: #ffe9f5;
  --border: rgba(155,123,255,0.18);
  --border-bright: rgba(155,123,255,0.32);
  --text: #2b1b54; --text-dim: #6a5b9a; --text-muted: #b4a9d6;
  --glass: rgba(255,255,255,0.75); --glass-border: rgba(155,123,255,0.2);
  --shadow:    0 10px 30px rgba(155,123,255,0.18), 0 2px 6px rgba(155,123,255,0.1);
  --shadow-md: 0 14px 40px rgba(155,123,255,0.2),  0 3px 10px rgba(155,123,255,0.12);
  --shadow-lg: 0 24px 70px rgba(155,123,255,0.25), 0 4px 16px rgba(155,123,255,0.15);
}
.midnight-theme {
  --bg: #0b0725; --bg2: #130d33; --bg3: #1d1442;
  --accent: #c67dff; --accent2: #ff7bd0; --accent3: #7bc7ff;
  --accent-glow: rgba(198,125,255,0.28);
  --accent-gradient: linear-gradient(135deg, #c67dff, #ff7bd0, #7bc7ff);
  --panel: #130d33; --panel2: #1d1442; --panel3: #281955;
  --border: rgba(198,125,255,0.14);
}
.forest-theme {
  --bg: #081e18; --bg2: #0c2a21; --bg3: #10382c;
  --accent: #7bffb3; --accent2: #5cf1ff; --accent3: #ffd46b;
  --accent-glow: rgba(123,255,179,0.3);
  --accent-gradient: linear-gradient(135deg, #7bffb3, #5cf1ff, #ffd46b);
  --panel: #0c2a21; --panel2: #10382c; --panel3: #154839;
  --border: rgba(123,255,179,0.14);
}

/* ========================= RESET ========================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--ui-font); background: var(--bg); color: var(--text);
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  font-weight: 400;
  background-image:
    radial-gradient(circle at 10% 0%,  rgba(255,110,199,0.12) 0%, transparent 40%),
    radial-gradient(circle at 90% 10%, rgba(155,123,255,0.14) 0%, transparent 45%),
    radial-gradient(circle at 50% 100%,rgba(92,241,255,0.10)  0%, transparent 50%);
}
a { color: var(--accent); text-decoration: none; cursor: pointer; transition: color var(--transition); }
a:hover { color: var(--text); }
button {
  cursor: pointer; border: none; background: none;
  font-family: var(--ui-font); font-size: 14px; color: var(--text);
  font-weight: 500;
}
input, select, textarea {
  font-family: var(--ui-font); color: var(--text); background: var(--bg3);
  border: 2px solid var(--border-bright); border-radius: var(--radius);
  padding: 10px 14px; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  font-weight: 500;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow);
}
::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--accent2), var(--accent3)); }
.hidden { display: none !important; }

/* ========================= KEYFRAME ANIMATIONS ========================= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px var(--accent-glow); }
  50% { box-shadow: 0 0 40px var(--accent-glow), 0 0 80px rgba(0,212,255,0.1); }
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes blink {
  50% { opacity: 0; }
}
@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes modalOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.95); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(100px) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100px); }
}
@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}
@keyframes spotlightPulse {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(0,0,0,0.82), 0 0 0 3px var(--accent), 0 0 30px var(--accent-glow); }
  50% { box-shadow: 0 0 0 9999px rgba(0,0,0,0.82), 0 0 0 4px var(--accent), 0 0 50px var(--accent-glow); }
}
@keyframes borderGlow {
  0%, 100% { border-color: var(--border); }
  50% { border-color: var(--accent); }
}
@keyframes particleDrift {
  0% { transform: translate(0, 0) scale(1); opacity: 0.3; }
  50% { opacity: 0.6; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ========================= SCROLL ANIMATIONS ========================= */
.reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.visible {
  opacity: 1; transform: translateY(0);
}
.reveal-left { opacity: 0; transform: translateX(-40px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
.reveal-left.visible { opacity: 1; transform: translateX(0); }
.reveal-right { opacity: 0; transform: translateX(40px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
.reveal-right.visible { opacity: 1; transform: translateX(0); }
.reveal-scale { opacity: 0; transform: scale(0.9); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-spring); }
.reveal-scale.visible { opacity: 1; transform: scale(1); }

/* Stagger children */
.stagger-children .reveal:nth-child(1) { transition-delay: 0s; }
.stagger-children .reveal:nth-child(2) { transition-delay: 0.08s; }
.stagger-children .reveal:nth-child(3) { transition-delay: 0.16s; }
.stagger-children .reveal:nth-child(4) { transition-delay: 0.24s; }
.stagger-children .reveal:nth-child(5) { transition-delay: 0.32s; }
.stagger-children .reveal:nth-child(6) { transition-delay: 0.4s; }

/* ========================= BUTTONS ========================= */
.btn-primary {
  background: var(--accent-gradient);
  background-size: 200% 200%;
  color: #fff; padding: 12px 28px;
  border-radius: var(--radius-pill); font-weight: 600; font-size: 15px;
  display: inline-flex; align-items: center; gap: 10px;
  transition: transform 0.25s var(--ease-spring), box-shadow var(--transition), background-position 0.6s var(--ease);
  position: relative; overflow: hidden;
  box-shadow: 0 8px 24px var(--accent-glow), inset 0 2px 0 rgba(255,255,255,0.35);
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.btn-primary::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.22), transparent 55%);
  border-radius: inherit; pointer-events: none;
}
.btn-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 14px 36px var(--accent-glow), inset 0 2px 0 rgba(255,255,255,0.45);
  background-position: 100% 50%;
}
.btn-primary:active { transform: translateY(-1px) scale(0.97); }
.btn-primary.btn-xl { padding: 16px 38px; font-size: 17px; }
.btn-primary.btn-full { width: 100%; justify-content: center; margin-top: 12px; }
.btn-primary.btn-sm { padding: 8px 18px; font-size: 13px; }

.btn-outline {
  border: 2px solid var(--border-bright); color: var(--text); padding: 10px 24px;
  border-radius: var(--radius-pill); font-weight: 600;
  display: inline-flex; align-items: center; gap: 10px; background: var(--glass);
  transition: all 0.25s var(--ease-spring);
  backdrop-filter: blur(10px);
}
.btn-outline:hover {
  border-color: var(--accent); color: var(--accent);
  transform: translateY(-2px) scale(1.03);
  background: rgba(255,110,199,0.08);
  box-shadow: 0 8px 22px var(--accent-glow);
}
.btn-outline.btn-sm { padding: 8px 18px; font-size: 13px; }

.btn-ghost {
  color: var(--text-dim); padding: 10px 22px; border-radius: var(--radius-pill);
  font-weight: 600; display: inline-flex; align-items: center; gap: 8px;
  transition: all 0.25s var(--ease-spring);
}
.btn-ghost:hover {
  color: var(--text); background: var(--glass);
  transform: translateY(-1px);
}
.btn-ghost.btn-xl { padding: 14px 32px; font-size: 16px; }

.btn-danger {
  background: var(--danger); color: #fff; padding: 10px 24px;
  border-radius: var(--radius); font-weight: 700;
  display: inline-flex; align-items: center; gap: 8px;
  transition: opacity var(--transition);
}
.btn-danger:hover { opacity: 0.85; }

/* Ripple effect */
.ripple {
  position: absolute; border-radius: 50%; background: rgba(255,255,255,0.3);
  transform: scale(0); animation: ripple 0.6s linear; pointer-events: none;
}

/* ========================= LANDING PAGE ========================= */
#landing-page {
  height: 100vh; overflow-y: auto; overflow-x: hidden;
  background: var(--bg); scroll-behavior: smooth;
}

/* Nav */
.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 40px; position: sticky; top: 16px; z-index: 100;
  background: rgba(29,26,61,0.65); backdrop-filter: blur(24px) saturate(180%);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-pill);
  margin: 16px 24px 0;
  box-shadow: var(--shadow-md);
  animation: fadeInDown 0.6s var(--ease-out);
}
.light-theme .landing-nav { background: rgba(255,255,255,0.75); }
.nav-brand { display: flex; align-items: center; gap: 12px; }
.nav-logo {
  height: 40px; transition: transform 0.4s var(--ease-spring);
  filter: drop-shadow(0 4px 12px var(--accent-glow));
}
.nav-logo:hover { transform: scale(1.12) rotate(-6deg); }
.nav-brand-text {
  font-family: var(--display-font); font-weight: 600; font-size: 20px;
  background: var(--accent-gradient); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
  letter-spacing: -0.01em;
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  color: var(--text-dim); font-weight: 500; padding: 10px 18px;
  border-radius: var(--radius-pill);
  transition: all 0.25s var(--ease-spring);
  font-size: 14px; display: inline-flex; align-items: center; gap: 8px;
}
.nav-links a:hover {
  color: var(--text); background: var(--glass);
  transform: translateY(-2px);
}

/* Hero */
.hero {
  min-height: calc(100vh - 61px); display: flex; align-items: center;
  padding: 60px 48px; gap: 64px; position: relative; overflow: hidden;
}

/* Hero backgrounds */
.hero-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
  background-size: 50px 50px; pointer-events: none;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black, transparent);
}
.hero-glow {
  position: absolute; width: 700px; height: 700px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,212,255,0.06) 0%, transparent 65%);
  top: -200px; right: -150px; pointer-events: none; animation: pulse 6s ease-in-out infinite;
}
.hero-glow-2 {
  position: absolute; width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.05) 0%, transparent 65%);
  bottom: -150px; left: -100px; pointer-events: none; animation: pulse 8s ease-in-out infinite 1s;
}

/* Particles container */
.hero-particles {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.particle {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: var(--accent); opacity: 0;
  animation: particleDrift 8s linear infinite;
}

.hero-content {
  flex: 1; z-index: 2; max-width: 580px;
  animation: fadeInUp 0.8s var(--ease-out);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--accent); padding: 6px 18px; border-radius: 40px;
  font-size: 13px; font-weight: 600; margin-bottom: 28px;
  backdrop-filter: blur(10px);
  animation: fadeInUp 0.8s var(--ease-out) 0.1s both;
}
.hero-badge i { font-size: 12px; }
.hero-title {
  font-family: var(--display-font);
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  font-weight: 900; line-height: 1.08; margin-bottom: 24px;
  animation: fadeInUp 0.8s var(--ease-out) 0.2s both;
}
.gradient-text {
  background: var(--accent-gradient); background-size: 200% 200%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; animation: gradientShift 4s ease infinite;
}
.hero-sub {
  color: var(--text-dim); font-size: 17px; max-width: 500px;
  margin-bottom: 36px; line-height: 1.7;
  animation: fadeInUp 0.8s var(--ease-out) 0.3s both;
}
.hero-cta {
  display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 48px;
  animation: fadeInUp 0.8s var(--ease-out) 0.4s both;
}
.hero-cta .btn-primary { animation: glow 3s ease-in-out infinite; }
.hero-stats {
  display: flex; gap: 36px;
  animation: fadeInUp 0.8s var(--ease-out) 0.5s both;
}
.stat { text-align: center; }
.stat span {
  font-family: var(--display-font); font-size: 2rem;
  font-weight: 900; color: var(--accent); display: block;
}
.stat label { color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; }

/* IDE Mockup */
.hero-visual {
  flex: 1; z-index: 2;
  animation: slideInRight 1s var(--ease-out) 0.3s both;
}
.ide-mockup {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,0.5), 0 0 0 1px var(--border), inset 0 1px 0 rgba(255,255,255,0.04);
  animation: float 5s ease-in-out infinite;
  backdrop-filter: blur(10px);
}
.mockup-bar {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  background: rgba(0,0,0,0.3); border-bottom: 1px solid var(--border);
}
.dot { width: 12px; height: 12px; border-radius: 50%; transition: transform var(--transition); }
.dot:hover { transform: scale(1.2); }
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }
.mockup-title { color: var(--text-muted); font-size: 12px; margin-left: auto; font-family: var(--editor-font); }
.mockup-body { display: flex; min-height: 220px; }
.mockup-sidebar {
  width: 160px; padding: 12px 8px; border-right: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
}
.mock-file {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-radius: var(--radius-sm); font-family: var(--editor-font);
  font-size: 12px; color: var(--text-dim); margin-bottom: 2px;
  transition: background var(--transition);
}
.mock-file:hover { background: var(--glass); }
.mock-file.active { background: rgba(0,212,255,0.08); color: var(--accent); }
.mock-file.linked { color: var(--success); }
.chain-icon { color: var(--success); font-size: 10px; }
.mock-folder { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-family: var(--editor-font); font-size: 12px; color: var(--warning); }
.mockup-code {
  padding: 16px 20px; flex: 1; font-family: var(--editor-font);
  font-size: 12.5px; line-height: 1.9; background: rgba(0,0,0,0.1);
}
.code-line { color: var(--text-dim); }
.code-line.pl2 { padding-left: 20px; }
.code-line.pl4 { padding-left: 40px; }
.code-line.pl6 { padding-left: 60px; }
.c-tag { color: #ff7b7b; }
.c-attr { color: #79b8ff; }
.c-str { color: #a5d6ff; }
.cursor-line { background: rgba(0,212,255,0.04); border-left: 2px solid var(--accent); }
.cursor-blink { animation: blink 1s step-end infinite; color: var(--accent); font-weight: 700; }

/* Features */
.features-section {
  padding: 100px 48px; text-align: center;
  border-top: 1px solid var(--border); position: relative;
}
.features-section h2 {
  font-family: var(--display-font); font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 16px;
}
.features-section > p { color: var(--text-dim); margin-bottom: 56px; font-size: 16px; }
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px; max-width: 1100px; margin: 0 auto;
}
.feature-card {
  background: var(--glass); border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg); padding: 36px 28px; text-align: left;
  backdrop-filter: blur(12px);
  transition: all 0.4s var(--ease-spring);
  position: relative; overflow: hidden;
}
.feature-card::after {
  content: ''; position: absolute; top: -60%; left: -20%; right: -20%; height: 80%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.08), transparent 60%);
  pointer-events: none;
}
.feature-card:hover {
  border-color: var(--accent);
  transform: translateY(-10px) rotate(-0.5deg);
  box-shadow: var(--shadow-lg);
}
.feature-card > i, .feature-card > .feature-icon {
  font-size: 1.8rem; color: #fff; margin-bottom: 22px; display: flex;
  width: 64px; height: 64px; align-items: center; justify-content: center;
  background: var(--accent-gradient); border-radius: 22px;
  box-shadow: var(--shadow-bubble);
  transition: transform 0.5s var(--ease-spring);
}
.feature-card:nth-child(2) > i { background: linear-gradient(135deg, #5cf1ff, #9b7bff); box-shadow: 0 8px 20px rgba(92,241,255,0.35), inset 0 2px 0 rgba(255,255,255,0.35); }
.feature-card:nth-child(3) > i { background: linear-gradient(135deg, #ffd46b, #ff9a6c); box-shadow: 0 8px 20px rgba(255,154,108,0.35), inset 0 2px 0 rgba(255,255,255,0.35); }
.feature-card:nth-child(4) > i { background: linear-gradient(135deg, #9b7bff, #ff6ec7); box-shadow: 0 8px 20px rgba(155,123,255,0.35), inset 0 2px 0 rgba(255,255,255,0.35); }
.feature-card:nth-child(5) > i { background: linear-gradient(135deg, #7bffb3, #5cf1ff); box-shadow: 0 8px 20px rgba(123,255,179,0.35), inset 0 2px 0 rgba(255,255,255,0.35); }
.feature-card:nth-child(6) > i { background: linear-gradient(135deg, #ff9a6c, #ffd46b); box-shadow: 0 8px 20px rgba(255,212,107,0.35), inset 0 2px 0 rgba(255,255,255,0.35); }
.feature-card:hover > i, .feature-card:hover > .feature-icon {
  transform: scale(1.15) rotate(-8deg);
}
.feature-card h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 10px; }
.feature-card p { color: var(--text-dim); font-size: 14px; line-height: 1.7; }

/* How It Works */
.how-section {
  padding: 100px 48px; text-align: center;
  border-top: 1px solid var(--border);
}
.how-section h2 {
  font-family: var(--display-font); font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 56px;
}
.steps-row {
  display: flex; justify-content: center; gap: 32px;
  max-width: 900px; margin: 0 auto; position: relative;
}
.steps-row::before {
  content: ''; position: absolute; top: 40px;
  left: 15%; right: 15%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  z-index: 0;
}
.step-card {
  flex: 1; text-align: center; position: relative; z-index: 1;
}
.step-number {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent-gradient);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display-font); font-size: 1.4rem;
  font-weight: 900; color: #fff; margin: 0 auto 20px;
  box-shadow: 0 8px 30px var(--accent-glow);
  transition: transform 0.3s var(--ease-spring);
}
.step-card:hover .step-number { transform: scale(1.12); }
.step-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.step-card p { color: var(--text-dim); font-size: 14px; line-height: 1.6; }

/* Pricing / Free Section */
.pricing-section {
  padding: 100px 48px; text-align: center;
  border-top: 1px solid var(--border);
}
.pricing-section h2 { font-family: var(--display-font); font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 16px; }
.pricing-section > p { color: var(--text-dim); margin-bottom: 48px; font-size: 16px; }
.pricing-card {
  max-width: 400px; margin: 0 auto; padding: 40px 32px;
  background: var(--glass); border: 1px solid var(--accent);
  border-radius: var(--radius-lg); text-align: center;
  box-shadow: 0 20px 60px rgba(0,212,255,0.08), inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(10px);
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease);
}
.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 80px rgba(0,212,255,0.12);
}
.pricing-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-gradient); color: #fff;
  padding: 4px 16px; border-radius: 20px; font-size: 12px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 20px;
}
.pricing-price {
  font-family: var(--display-font); font-size: 3.5rem;
  font-weight: 900; margin-bottom: 8px;
}
.pricing-price span { font-size: 1rem; color: var(--text-dim); font-weight: 400; }
.pricing-features {
  list-style: none; text-align: left; margin: 24px 0;
  display: flex; flex-direction: column; gap: 10px;
}
.pricing-features li {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--text-dim);
}
.pricing-features li i { color: var(--success); font-size: 13px; }

/* Pricing grid — 3 columns on desktop */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto 40px;
  align-items: start;
}
.pricing-grid .pricing-card { max-width: none; margin: 0; }

/* Free plan card */
.pricing-card-free {
  border-color: rgba(92,241,255,0.25);
}
.pricing-badge-free {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

/* Premium Pro card */
.pricing-card-premium {
  border-color: rgba(255,110,199,0.45);
  box-shadow: 0 20px 60px rgba(255,110,199,0.10), inset 0 1px 0 rgba(255,255,255,0.04);
}
.pricing-card-premium:hover {
  box-shadow: 0 30px 80px rgba(255,110,199,0.18);
}
.pricing-badge-premium {
  background: linear-gradient(135deg, #ff6ec7, #9b7bff);
}

/* Premium button */
.btn-premium {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: var(--radius); border: none;
  background: linear-gradient(135deg, #ff6ec7, #9b7bff);
  color: #fff; font-family: var(--display-font); font-weight: 700;
  font-size: 1rem; cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}
.btn-premium:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-premium.btn-xl { padding: 16px 32px; font-size: 1.05rem; }

/* pricing-sub */
.pricing-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 4px; }
.pricing-fine { font-size: 11px; color: var(--text-muted); margin-top: 10px; }
.pricing-also { color: var(--text-dim); font-size: 14px; margin-top: 8px; }
.pricing-also a { color: var(--accent3); text-decoration: none; }

/* Footer */
.landing-footer {
  padding: 40px 48px; text-align: center; border-top: 1px solid var(--border);
  color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 13px;
}
.landing-footer img { height: 32px; opacity: 0.5; transition: opacity var(--transition); }
.landing-footer img:hover { opacity: 0.8; }

/* ========================= AUTH MODAL ========================= */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(13,5,40,0.65); backdrop-filter: blur(16px);
  animation: fadeIn 0.25s ease;
}
.modal-box {
  background: var(--panel2); border: 2px solid var(--glass-border);
  border-radius: var(--radius-xl); padding: 40px; min-width: 400px;
  max-width: 90vw; position: relative;
  box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto;
  animation: modalIn 0.45s var(--ease-spring);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(255,110,199,0.1), transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(155,123,255,0.1), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(92,241,255,0.08), transparent 40%);
}
.modal-box.wide { min-width: min(760px, 90vw); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.modal-header h2 {
  font-family: var(--display-font); font-size: 1.15rem;
  display: flex; align-items: center; gap: 10px;
}
.modal-close {
  color: var(--text-muted); font-size: 18px; width: 36px; height: 36px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.modal-close:hover { background: var(--bg3); color: var(--text); transform: rotate(90deg); }
.modal-logo { width: 64px; display: block; margin: 0 auto 20px; }
.modal-tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.modal-tab {
  flex: 1; padding: 12px; border-radius: var(--radius-pill);
  border: 2px solid var(--border); color: var(--text-dim); font-weight: 500;
  transition: all 0.3s var(--ease-spring); font-size: 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.modal-tab.active {
  background: var(--accent-gradient);
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 18px var(--accent-glow);
  transform: translateY(-1px);
}
.modal-tab:hover:not(.active) {
  border-color: var(--accent); background: var(--glass);
  transform: translateY(-1px);
}

/* Google Sign-In */
.google-btn-wrap { margin-bottom: 20px; display: flex; justify-content: center; }
.google-btn-wrap > div { width: 100% !important; }
.google-btn-wrap iframe { border-radius: var(--radius) !important; }
.auth-divider {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
  color: var(--text-muted); font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Form */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px;
}
.form-group input { width: 100%; padding: 10px 14px; font-size: 14px; }
.auth-error {
  background: rgba(255,68,102,0.08); border: 1px solid rgba(255,68,102,0.3);
  color: var(--danger); padding: 10px 14px; border-radius: var(--radius-sm);
  margin-bottom: 16px; font-size: 13px;
  animation: shake 0.4s ease;
}

/* ========================= WORKSPACE ========================= */
#workspace { display: flex; flex-direction: column; height: 100vh; }

/* Toolbar */
#toolbar {
  height: var(--toolbar-h); background: var(--panel);
  border-bottom: 2px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; z-index: 500; flex-shrink: 0; gap: 6px;
  box-shadow: 0 4px 20px rgba(13,5,40,0.15);
}
.toolbar-left { display: flex; align-items: center; gap: 4px; }
.toolbar-logo {
  height: 32px; margin-right: 10px;
  filter: drop-shadow(0 3px 8px var(--accent-glow));
  transition: transform 0.4s var(--ease-spring);
}
.toolbar-logo:hover { transform: rotate(-10deg) scale(1.1); }
.toolbar-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
  border-radius: var(--radius-pill); color: var(--text-dim); font-size: 13px;
  font-weight: 500; transition: all 0.25s var(--ease-spring); white-space: nowrap;
}
.toolbar-btn:hover {
  background: var(--glass); color: var(--text);
  transform: translateY(-1px);
}
.toolbar-btn.accent { color: var(--accent); }
.toolbar-btn.active {
  background: var(--accent-gradient); color: #fff;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.toolbar-btn kbd {
  font-size: 10px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 2px 6px;
}
.toolbar-center { display: flex; align-items: center; gap: 12px; flex: 1; justify-content: center; font-size: 13px; }
.project-indicator, .file-indicator { display: flex; align-items: center; gap: 6px; color: var(--text-dim); }
.project-indicator i { color: var(--accent); }
.unsaved-dot { color: var(--warning); animation: pulse 1.5s ease-in-out infinite; }
.toolbar-right { display: flex; align-items: center; gap: 4px; }
.user-btn { gap: 8px; }
.user-menu-wrap { position: relative; }
.user-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--accent); object-fit: cover;
}

/* Dropdown Menus */
.menu-item { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 10px); left: 0; min-width: 230px;
  background: var(--panel2); border: 2px solid var(--border-bright);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  z-index: 1000; overflow: hidden;
  padding: 8px;
  animation: fadeInDown 0.25s var(--ease-spring);
  backdrop-filter: blur(20px);
}
.dropdown-menu::before {
  content: ''; position: absolute; top: -2px; left: 0; right: 0; height: 60%;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), transparent);
  pointer-events: none; border-radius: var(--radius) var(--radius) 0 0;
}
#user-menu { right: 0; left: auto; }
.dropdown-menu a {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  font-size: 14px; color: var(--text-dim); cursor: pointer;
  transition: all 0.2s var(--ease-spring);
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.dropdown-menu a:hover {
  background: var(--accent-gradient); color: #fff;
  transform: translateX(3px);
  box-shadow: 0 4px 14px var(--accent-glow);
}
.dropdown-menu a:hover i { color: #fff !important; }
.dropdown-menu a.danger { color: var(--danger); }
.dropdown-menu a.danger:hover {
  background: linear-gradient(135deg, #ff6b9a, #ff9a6c);
  color: #fff;
}
.dropdown-menu hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }
.dropdown-menu kbd {
  margin-left: auto; font-size: 10px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 2px 6px; color: var(--text-dim);
}
.dropdown-menu a:hover kbd {
  background: rgba(255,255,255,0.2); color: #fff; border-color: transparent;
}

/* ========================= WORKSPACE BODY ========================= */
#workspace-body { flex: 1; display: flex; overflow: hidden; flex-direction: column; }

/* Sidebar */
.sidebar-panel {
  width: var(--sidebar-w); border-right: 2px solid var(--border);
  background: var(--panel); display: flex; flex-direction: column;
  flex-shrink: 0; overflow: hidden;
  position: absolute; left: 0; top: 0; bottom: 0; z-index: 100;
  transition: transform 0.35s var(--ease-out), opacity 0.3s var(--ease);
}
.sidebar-panel.hidden {
  transform: translateX(-100%); opacity: 0;
  pointer-events: none;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 2px solid var(--border);
  font-size: 12px; font-weight: 600;
  color: var(--text); flex-shrink: 0;
}
.panel-header span i { color: var(--accent); }
.panel-actions { display: flex; gap: 6px; }
.panel-actions button {
  color: var(--text-muted); width: 30px; height: 30px; border-radius: 50%;
  font-size: 13px; transition: all 0.25s var(--ease-spring);
  display: flex; align-items: center; justify-content: center;
}
.panel-actions button:hover {
  color: #fff; background: var(--accent-gradient);
  transform: scale(1.15) rotate(-8deg);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* File Tree */
.file-tree { overflow-y: auto; flex: 1; padding: 10px 8px; }
.tree-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: var(--radius); cursor: pointer; font-size: 13.5px;
  color: var(--text-dim); position: relative; user-select: none;
  transition: all 0.2s var(--ease-spring);
  margin-bottom: 2px; font-weight: 500;
}
.tree-item > i:first-child {
  width: 26px; height: 26px; display: inline-flex;
  align-items: center; justify-content: center;
  border-radius: 10px; font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.tree-item:hover {
  background: var(--glass); color: var(--text);
  transform: translateX(3px);
}
.tree-item.active {
  background: var(--accent-gradient); color: #fff;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.tree-item.active > i:first-child { background: rgba(255,255,255,0.18) !important; color: #fff !important; }
.tree-item.drag-over {
  outline: 2px dashed var(--accent); outline-offset: -2px;
  background: var(--accent-glow);
}
.tree-item .item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-item .item-badge { font-size: 10px; }
.tree-folder > .tree-children { padding-left: 18px; }
.chain-badge {
  color: #fff; font-size: 10px; margin-left: auto;
  background: linear-gradient(135deg, #7bffb3, #5cf1ff);
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(123,255,179,0.45);
  animation: chainBob 2.4s ease-in-out infinite;
}
@keyframes chainBob {
  0%,100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-2px) rotate(8deg); }
}
.tree-item.linked-file { color: var(--success); }

/* Bubbly file-type icon backgrounds */
.tree-item > i.fa-html5          { background: linear-gradient(135deg,#ff9a6c,#ff6b4d); color:#fff; }
.tree-item > i.fa-css3-alt       { background: linear-gradient(135deg,#5cf1ff,#6e9bff); color:#fff; }
.tree-item > i.fa-js             { background: linear-gradient(135deg,#ffd46b,#ffb347); color:#3a2a00; }
.tree-item > i.fa-php            { background: linear-gradient(135deg,#9b7bff,#6e59d6); color:#fff; }
.tree-item > i.fa-image          { background: linear-gradient(135deg,#ff6ec7,#c67dff); color:#fff; }
.tree-item > i.fa-file-lines     { background: linear-gradient(135deg,#b4a9d6,#7e719f); color:#fff; }
.tree-item > i.fa-database       { background: linear-gradient(135deg,#ffd46b,#ff9a6c); color:#fff; }
.tree-item > i.fa-shield-halved  { background: linear-gradient(135deg,#ff6b9a,#ff4466); color:#fff; }
.tree-item > i.fa-folder         { background: linear-gradient(135deg,#ffd46b,#ff9a6c); color:#fff; }
.tree-item > i.fa-file           { background: linear-gradient(135deg,#b4a9d6,#7e719f); color:#fff; }

/* Editor Area */
#editor-preview-wrap {
  display: flex; flex: 1; overflow: hidden;
  margin-left: var(--sidebar-w); transition: margin-left 0.3s var(--ease-out);
}
#editor-area {
  display: flex; flex-direction: column; flex: 1; overflow: hidden;
  min-width: 200px; background: var(--bg);
}

/* Editor Tabs */
.editor-tabs {
  display: flex; overflow-x: auto; background: var(--panel);
  border-bottom: 2px solid var(--border); flex-shrink: 0;
  padding: 6px 6px 0;
}
.editor-tabs::-webkit-scrollbar { height: 0; }
.editor-tab {
  display: flex; align-items: center; gap: 8px; padding: 9px 16px;
  font-size: 13px; color: var(--text-dim); cursor: pointer; white-space: nowrap;
  transition: all 0.2s var(--ease-spring);
  flex-shrink: 0; position: relative; font-weight: 500;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-right: 2px;
}
.editor-tab:hover {
  background: var(--glass); color: var(--text);
  transform: translateY(-1px);
}
.editor-tab.active {
  background: var(--bg); color: var(--text);
  box-shadow: 0 -3px 0 0 var(--accent) inset, 0 -8px 20px rgba(255,110,199,0.08);
}
.editor-tab .tab-close {
  margin-left: 4px; font-size: 11px; opacity: 0; padding: 2px 3px;
  border-radius: 3px; transition: opacity var(--transition), background var(--transition);
}
.editor-tab:hover .tab-close { opacity: 0.5; }
.editor-tab .tab-close:hover { opacity: 1; color: var(--danger); background: rgba(255,68,102,0.1); }
.tab-unsaved { color: var(--warning); font-size: 10px; animation: pulse 1.5s ease-in-out infinite; }

/* Code Editor */
#editor-container { flex: 1; display: flex; overflow: hidden; position: relative; }
#line-numbers {
  width: 48px; min-width: 48px; background: var(--panel);
  border-right: 1px solid var(--border); padding: 12px 8px;
  text-align: right; font-family: var(--editor-font);
  font-size: 13px; line-height: 1.6; color: var(--text-muted);
  overflow: hidden; user-select: none;
}
#code-editor {
  flex: 1; resize: none; border: none; border-radius: 0;
  background: var(--bg); color: var(--text);
  font-family: var(--editor-font); font-size: 14px;
  line-height: 1.6; padding: 12px 16px; tab-size: 4; overflow: auto;
}
#code-editor:focus { box-shadow: none; border: none; }

/* Find/Replace */
.find-replace-bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: var(--panel2); border-bottom: 1px solid var(--border);
  flex-shrink: 0; animation: fadeInDown 0.2s var(--ease-out);
}
.find-replace-bar input { flex: 1; max-width: 200px; font-size: 13px; }
.find-replace-bar button {
  padding: 5px 10px; background: var(--bg3); border-radius: var(--radius-sm);
  font-size: 12px; transition: background var(--transition), color var(--transition);
}
.find-replace-bar button:hover { background: var(--accent); color: #fff; }

/* Autocomplete */
.autocomplete-dropdown {
  position: absolute; background: var(--panel2); border: 1px solid var(--border-bright);
  border-radius: var(--radius); min-width: 240px; max-height: 200px;
  overflow-y: auto; z-index: 200; box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.15s var(--ease);
}
.ac-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px;
  font-family: var(--editor-font); font-size: 13px; cursor: pointer;
  transition: background var(--transition);
}
.ac-item:hover, .ac-item.selected { background: var(--accent-glow); }
.ac-icon { width: 18px; text-align: center; font-size: 11px; }
.ac-label { flex: 1; }
.ac-type { color: var(--text-muted); font-size: 11px; }

/* Status Bar */
.status-bar {
  display: flex; align-items: center; gap: 16px; padding: 3px 12px;
  background: var(--panel); border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-dim); flex-shrink: 0;
}

/* Splitter */
.splitter {
  width: 8px; background: var(--bg2); cursor: col-resize; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.25s var(--ease);
  position: relative;
}
.splitter::before {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 4px; height: 40px; transform: translate(-50%,-50%);
  background: var(--border-bright); border-radius: var(--radius-pill);
  transition: all 0.25s var(--ease);
}
.splitter:hover::before, .splitter.dragging::before {
  background: var(--accent-gradient); height: 60px;
  box-shadow: 0 0 20px var(--accent-glow);
}
.splitter-handle { display: none; }

/* Preview Area */
#preview-area { display: flex; flex-direction: column; flex: 1; min-width: 200px; overflow: hidden; }
.preview-header {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: var(--panel); border-bottom: 2px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text); flex-shrink: 0;
}
.preview-header > span:first-child i { color: var(--accent3); }
.preview-controls { display: flex; gap: 4px; margin-left: auto; }
.preview-controls button {
  padding: 4px 8px; color: var(--text-dim); border-radius: var(--radius-sm);
  font-size: 13px; transition: color var(--transition), background var(--transition);
}
.preview-controls button:hover { color: var(--accent); background: var(--glass); }
.device-frames { display: flex; gap: 3px; }
.dev-btn {
  padding: 4px 8px; color: var(--text-muted); border-radius: var(--radius-sm);
  font-size: 13px; transition: all var(--transition);
}
.dev-btn.active { color: var(--accent); background: var(--accent-glow); }
.preview-frame-wrap {
  flex: 1; overflow: hidden; display: flex; align-items: center;
  justify-content: center; background: #f4f5f7;
  transition: all 0.3s var(--ease);
  position: relative;
}
.preview-frame-wrap.device-desktop { background: #fff; }
.preview-frame-wrap.device-desktop #preview-frame { background: #fff; }
.preview-loader {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 20;
  animation: preview-loader-fade 0.2s var(--ease);
}
.preview-loader.hidden { display: none; }
.preview-loader-ring {
  width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid rgba(0,0,0,0.08);
  border-top-color: var(--accent, #6366f1);
  border-right-color: var(--accent, #6366f1);
  animation: preview-loader-spin 0.8s linear infinite;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.preview-loader-text {
  font-size: 12px; font-weight: 500; letter-spacing: 0.3px;
  color: #555; font-family: system-ui, sans-serif;
}
@keyframes preview-loader-spin { to { transform: rotate(360deg); } }
@keyframes preview-loader-fade { from { opacity: 0; } to { opacity: 1; } }
/* Realistic device mockup backgrounds — a soft, neutral workbench instead of
   the pure-black IDE chrome. Looks like an actual product render. */
.preview-frame-wrap.device-mobile,
.preview-frame-wrap.device-tablet {
  padding: 30px 20px;
  background:
    radial-gradient(800px 400px at 50% 0%, rgba(99,102,241,0.06), transparent 60%),
    linear-gradient(180deg, #eef0f4 0%, #dde1e8 100%);
}
.preview-frame-wrap.device-mobile::before,
.preview-frame-wrap.device-tablet::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  mask-image: radial-gradient(circle at 50% 50%, rgba(0,0,0,0.6), transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, rgba(0,0,0,0.6), transparent 75%);
}
#preview-frame { width: 100%; height: 100%; border: none; }
.preview-frame-wrap.device-mobile #preview-frame {
  width: 375px; height: 760px; max-height: 90%;
  border-radius: 32px;
  background: #fff;
  box-shadow:
    0 0 0 10px #1b1d22,
    0 0 0 12px #2a2d35,
    0 30px 70px rgba(0,0,0,0.55),
    0 0 40px rgba(0,212,255,0.08);
  position: relative; z-index: 1;
}
.preview-frame-wrap.device-tablet #preview-frame {
  width: 820px; max-width: 90%; height: 90%;
  border-radius: 22px;
  background: #fff;
  box-shadow:
    0 0 0 8px #1b1d22,
    0 0 0 10px #2a2d35,
    0 30px 70px rgba(0,0,0,0.55),
    0 0 40px rgba(155,123,255,0.08);
  position: relative; z-index: 1;
}

/* Bottom Panels */
#bottom-panels {
  flex-shrink: 0; height: 200px; border-top: 1px solid var(--border);
  background: var(--bg); display: flex; flex-direction: column;
}
.bottom-tabs {
  display: flex; align-items: center; background: var(--panel);
  border-bottom: 1px solid var(--border); padding: 0 8px; flex-shrink: 0;
}
.bottom-tab {
  padding: 8px 14px; font-size: 12px; font-weight: 700;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.bottom-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.bottom-tab:hover:not(.active) { color: var(--text-dim); }
.close-bottom { margin-left: auto; color: var(--text-dim); font-size: 14px; transition: color var(--transition); }
.close-bottom:hover { color: var(--danger); }
.bottom-panel { flex: 1; overflow-y: auto; padding: 8px; }
.terminal-output { font-family: var(--editor-font); font-size: 13px; }
.term-line { padding: 2px 4px; color: #aaa; }
.term-line.error { color: var(--danger); }
.term-line.info { color: var(--info); }
.term-line.success { color: var(--success); }
.term-prompt { color: var(--accent); margin-right: 8px; }
.terminal-input-row {
  display: flex; align-items: center; gap: 8px; padding: 8px;
  border-top: 1px solid var(--border);
}
.terminal-input-row input {
  flex: 1; background: transparent; border: none;
  font-family: var(--editor-font); font-size: 13px; color: var(--text);
}

/* Context Menu */
.context-menu {
  position: fixed; background: var(--panel2); border: 1px solid var(--border-bright);
  border-radius: var(--radius); min-width: 190px; z-index: 3000;
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: scaleIn 0.15s var(--ease-out);
  backdrop-filter: blur(20px);
}
.context-menu ul { list-style: none; }
.context-menu li a {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  font-size: 13px; color: var(--text-dim); cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.context-menu li a:hover { background: var(--glass); color: var(--text); }
.context-menu li a.danger { color: var(--danger); }
.context-menu li a.danger:hover { background: rgba(255,68,102,0.08); }
.context-menu li hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* Project Manager */
.pm-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.pm-toolbar input { flex: 1; }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.project-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 16px; cursor: pointer;
  text-align: center; position: relative;
  transition: all 0.3s var(--ease);
}
.project-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.3); }
.project-card.active-project { border-color: var(--accent); background: var(--accent-glow); }
.project-card i { font-size: 2.5rem; color: var(--accent); margin-bottom: 12px; display: block; }
.project-card h4 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.project-card p { font-size: 12px; color: var(--text-dim); }
.project-card .card-actions { position: absolute; top: 8px; right: 8px; display: none; gap: 4px; }
.project-card:hover .card-actions { display: flex; }
.card-actions button {
  padding: 5px 7px; font-size: 12px; border-radius: var(--radius-sm);
  color: var(--text-dim); transition: color var(--transition), background var(--transition);
}
.card-actions button:hover { color: var(--danger); background: rgba(255,68,102,0.1); }

/* Settings */
.settings-list { display: flex; flex-direction: column; gap: 12px; }
.setting-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.setting-row label { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.setting-row input[type="range"] { flex: 1; max-width: 120px; accent-color: var(--accent); }
.setting-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.setting-row input[type="color"] { width: 40px; height: 32px; padding: 2px; border-radius: var(--radius-sm); }
.setting-row select { min-width: 120px; }

/* Shortcuts */
.shortcuts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shortcut-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px;
  background: var(--bg3); border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.shortcut-row:hover { background: var(--glass); }
.shortcut-row kbd {
  font-family: var(--editor-font); font-size: 12px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 3px 8px; white-space: nowrap;
}
.shortcut-row span { font-size: 13px; color: var(--text-dim); }

/* Edit Mode Panel */
.edit-mode-panel {
  position: fixed; right: 16px; top: 56px; background: var(--panel2);
  border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 18px; z-index: 600; min-width: 220px;
  box-shadow: 0 16px 50px rgba(0,212,255,0.1);
  animation: slideInRight 0.3s var(--ease-out);
  backdrop-filter: blur(10px);
}
.emp-header { font-weight: 700; font-size: 13px; margin-bottom: 14px; color: var(--accent); display: flex; align-items: center; gap: 8px; }
.emp-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.emp-row label { flex: 1; color: var(--text-dim); }
.emp-row input[type="color"] { width: 36px; height: 28px; padding: 1px; border-radius: 4px; }
.emp-row input[type="range"] { flex: 1; accent-color: var(--accent); }

/* ========================= TUTORIAL OVERLAY ========================= */
.tutorial-overlay {
  position: fixed; inset: 0; z-index: 5000;
  background: transparent;
  pointer-events: none; transition: opacity 0.3s var(--ease);
}
.tutorial-overlay:not(.hidden) { pointer-events: all; }
/* Dim everything EXCEPT the spotlight region by painting the dim as a huge
   box-shadow on the spotlight — this creates a real transparent hole so the
   highlighted element stays crisp and visible. No backdrop-blur on the page. */
.tutorial-overlay::before {
  content: ''; position: fixed; inset: 0; z-index: 0;
  background: rgba(0,0,0,0.55); pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.tutorial-overlay.has-target::before { display: none; }

/* Progress bar at top */
.tutorial-progress {
  position: fixed; top: 0; left: 0; height: 3px; z-index: 5002;
  background: var(--accent-gradient); border-radius: 0 3px 3px 0;
  transition: width 0.4s var(--ease-out);
}

.tutorial-spotlight {
  position: fixed; border-radius: var(--radius);
  /* The 9999px shadow paints the dim around the hole — leaving the
     highlighted element perfectly visible through the transparent center. */
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.62), 0 0 0 3px var(--accent), 0 0 40px rgba(0,212,255,0.45) inset;
  background: transparent;
  animation: spotlightPulse 2s ease-in-out infinite;
  transition: all 0.45s var(--ease-out); pointer-events: none;
  z-index: 5000;
}
.tutorial-box {
  position: fixed; background: var(--panel2); border: 1px solid var(--accent);
  border-radius: var(--radius-lg); padding: 28px; min-width: 320px; max-width: 400px;
  box-shadow: 0 0 60px rgba(0,212,255,0.15), var(--shadow-lg);
  z-index: 5001; animation: modalIn 0.35s var(--ease-out);
  backdrop-filter: blur(10px);
}
.tutorial-step-indicator { display: flex; gap: 6px; margin-bottom: 16px; }
.tutorial-step-indicator span {
  width: 24px; height: 4px; border-radius: 2px; background: var(--text-muted);
  transition: background 0.3s var(--ease), width 0.3s var(--ease);
}
.tutorial-step-indicator span.active { background: var(--accent); width: 32px; }
.tutorial-step-indicator span.done { background: var(--success); }
#tutorial-title {
  font-family: var(--display-font); font-size: 1.05rem;
  margin-bottom: 10px; color: var(--accent);
}
#tutorial-desc { font-size: 14px; color: var(--text-dim); line-height: 1.7; margin-bottom: 22px; }
.tutorial-actions { display: flex; justify-content: space-between; gap: 10px; }
.tutorial-actions .btn-ghost { font-size: 13px; padding: 8px 16px; }
.tutorial-actions .btn-primary { font-size: 13px; padding: 8px 20px; }
.tutorial-step-count {
  font-size: 11px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 6px;
}

/* ========================= TOAST NOTIFICATIONS ========================= */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  background: var(--panel2); border: 1px solid var(--border-bright);
  border-radius: var(--radius); padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; min-width: 280px;
  box-shadow: var(--shadow-lg); animation: toastIn 0.4s var(--ease-spring);
  pointer-events: all; position: relative; overflow: hidden;
  backdrop-filter: blur(10px);
}
.toast::after {
  content: ''; position: absolute; bottom: 0; left: 0; height: 3px;
  background: var(--accent-gradient); border-radius: 0 0 var(--radius) var(--radius);
  animation: toastProgress 3s linear forwards;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.success::after { background: var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.error::after { background: var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.warning::after { background: var(--warning); }
.toast.info { border-left: 3px solid var(--info); }
.toast i { font-size: 16px; flex-shrink: 0; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }
.toast.info i { color: var(--info); }

/* Drag */
.drag-ghost { opacity: 0.4; }
.drop-target { outline: 2px dashed var(--accent); outline-offset: 2px; }

/* ========================= RESPONSIVE ========================= */
@media (max-width: 900px) {
  .hero { flex-direction: column; padding: 40px 24px; gap: 40px; }
  .hero-visual { max-width: 100%; }
  .landing-nav { padding: 12px 20px; }
  .nav-links { gap: 4px; }
  .features-section, .how-section, .pricing-section { padding: 60px 24px; }
  .steps-row { flex-direction: column; gap: 24px; }
  .steps-row::before { display: none; }
}
@media (max-width: 768px) {
  .hero-visual { display: none; }
  .hero-stats { gap: 20px; }
  .nav-links .nav-link-text { display: none; }
  #editor-preview-wrap { flex-direction: column; margin-left: 0 !important; }
  .sidebar-panel { position: relative; width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .splitter { width: 100%; height: 6px; cursor: row-resize; }
  .shortcuts-grid { grid-template-columns: 1fr; }
  .modal-box { min-width: auto; margin: 16px; padding: 24px; }
}
@media (max-width: 480px) {
  .hero-title { font-size: 2rem; }
  .hero-cta { flex-direction: column; }
  .hero-stats { flex-wrap: wrap; gap: 16px; }
  .toolbar-center { display: none; }
}

/* ============================================================
   BUBBLY ADDITIONS — icon bubbles, ZoloAI chat, banner, etc.
   ============================================================ */

/* Generic "bubble" wrapper — any <i> inside .bubble-icon becomes a
   colorful rounded square with a soft inner shine. */
.bubble-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 14px;
  background: var(--accent-gradient);
  box-shadow: var(--shadow-bubble);
  color: #fff; font-size: 16px;
  transition: transform 0.4s var(--ease-spring);
}
.bubble-icon.sm { width: 28px; height: 28px; border-radius: 10px; font-size: 13px; }
.bubble-icon.lg { width: 56px; height: 56px; border-radius: 18px; font-size: 22px; }
.bubble-icon:hover { transform: scale(1.1) rotate(-8deg); }
.bubble-icon.pink  { background: linear-gradient(135deg,#ff6ec7,#c67dff); box-shadow: 0 6px 16px rgba(255,110,199,0.4), inset 0 2px 0 rgba(255,255,255,0.35); }
.bubble-icon.teal  { background: linear-gradient(135deg,#5cf1ff,#9b7bff); box-shadow: 0 6px 16px rgba(92,241,255,0.4),  inset 0 2px 0 rgba(255,255,255,0.35); }
.bubble-icon.sun   { background: linear-gradient(135deg,#ffd46b,#ff9a6c); box-shadow: 0 6px 16px rgba(255,212,107,0.4), inset 0 2px 0 rgba(255,255,255,0.35); }
.bubble-icon.lime  { background: linear-gradient(135deg,#7bffb3,#5cf1ff); box-shadow: 0 6px 16px rgba(123,255,179,0.4), inset 0 2px 0 rgba(255,255,255,0.35); }
.bubble-icon.flame { background: linear-gradient(135deg,#ff9a6c,#ff6b9a); box-shadow: 0 6px 16px rgba(255,107,154,0.4), inset 0 2px 0 rgba(255,255,255,0.35); }

/* Landing feature card icon bubbles should wobble on hover of card */
@keyframes wobble {
  0%,100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg) scale(1.1); }
  75% { transform: rotate(8deg) scale(1.1); }
}

/* ============================================================
   CONSTRUCTION BANNER — shown when ZoloAI is offline
   ============================================================ */
.zolo-construction-banner {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 10000;
  padding: 12px 20px;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  background: repeating-linear-gradient(
    -45deg,
    #ffd46b 0 20px,
    #ff9a6c 20px 40px,
    #ff6b9a 40px 60px,
    #9b7bff 60px 80px
  );
  background-size: 200% 100%;
  animation: bannerSlide 14s linear infinite;
  color: #1a0f35; font-weight: 600; font-size: 14px;
  border-bottom: 3px solid rgba(0,0,0,0.15);
  box-shadow: 0 6px 20px rgba(255,107,154,0.3);
  font-family: var(--display-font);
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}
.zolo-construction-banner i {
  font-size: 18px; color: #1a0f35;
  animation: wobble 1.6s ease-in-out infinite;
}
@keyframes bannerSlide {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}
body.zolo-ai-down #toolbar { top: 46px; }
body.zolo-ai-down #workspace,
body.zolo-ai-down #landing-page { padding-top: 46px; }

/* ============================================================
   ZOLO AI — floating launcher button + chat panel
   ============================================================ */
#zolo-ai-launcher {
  position: fixed; right: 24px; bottom: 24px; z-index: 900;
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent-gradient); background-size: 200% 200%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px;
  box-shadow: 0 12px 30px var(--accent-glow), inset 0 3px 0 rgba(255,255,255,0.4);
  cursor: pointer;
  transition: transform 0.4s var(--ease-spring), box-shadow 0.3s var(--ease);
  animation: launcherFloat 4s ease-in-out infinite, gradientShift 6s ease infinite;
  border: 3px solid rgba(255,255,255,0.2);
}
#zolo-ai-launcher:hover {
  transform: scale(1.12) rotate(-12deg);
  box-shadow: 0 16px 40px var(--accent-glow), inset 0 3px 0 rgba(255,255,255,0.5);
}
#zolo-ai-launcher.open { transform: scale(0.9) rotate(45deg); }
#zolo-ai-launcher::after {
  content: ''; position: absolute; inset: -4px;
  border-radius: 50%;
  background: var(--accent-gradient);
  filter: blur(20px); opacity: 0.35; z-index: -1;
  animation: pulse 3s ease-in-out infinite;
}
.zolo-ai-badge {
  position: absolute; top: -2px; right: -2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #7bffb3; border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px rgba(123,255,179,0.4);
  animation: pulse 2s ease-in-out infinite;
}
body.zolo-ai-down .zolo-ai-badge { background: #ff6b9a; box-shadow: 0 0 0 2px rgba(255,107,154,0.4); }
@keyframes launcherFloat {
  0%,100% { translate: 0 0; }
  50%     { translate: 0 -6px; }
}

#zolo-ai-panel {
  position: fixed; right: 24px; bottom: 104px; z-index: 899;
  width: 400px; max-width: calc(100vw - 48px);
  height: 600px; max-height: calc(100vh - 140px);
  background: var(--panel2); border: 2px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  animation: zoloPanelIn 0.45s var(--ease-spring);
  backdrop-filter: blur(20px);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(255,110,199,0.12), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(92,241,255,0.1), transparent 50%);
}
@keyframes zoloPanelIn {
  from { opacity: 0; transform: scale(0.5) translate(20%, 20%); }
  to   { opacity: 1; transform: scale(1) translate(0,0); }
}
.zolo-ai-header {
  padding: 18px 22px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 2px solid var(--border);
  background: linear-gradient(180deg, rgba(255,110,199,0.08), transparent);
  position: relative;
}
.zolo-ai-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px;
  box-shadow: var(--shadow-bubble);
  flex-shrink: 0;
  animation: launcherFloat 4s ease-in-out infinite;
}
.zolo-ai-title {
  font-family: var(--display-font); font-size: 18px; font-weight: 600;
  background: var(--accent-gradient); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1.2;
}
.zolo-ai-sub {
  font-size: 12px; color: var(--text-dim); font-weight: 500;
  display: flex; align-items: center; gap: 6px;
}
.zolo-ai-sub::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: #7bffb3; box-shadow: 0 0 0 3px rgba(123,255,179,0.3);
  animation: pulse 2s ease-in-out infinite;
}
body.zolo-ai-down .zolo-ai-sub::before {
  background: #ff6b9a; box-shadow: 0 0 0 3px rgba(255,107,154,0.3);
}
.zolo-ai-close {
  margin-left: auto; width: 36px; height: 36px; border-radius: 50%;
  color: var(--text-dim); background: var(--glass);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s var(--ease-spring);
  font-size: 14px;
}
.zolo-ai-close:hover {
  color: #fff; background: var(--danger);
  transform: rotate(90deg) scale(1.1);
}
.zolo-ai-messages {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.zolo-msg {
  max-width: 85%; padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 14px; line-height: 1.55;
  word-wrap: break-word; white-space: pre-wrap;
  animation: msgIn 0.35s var(--ease-spring);
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.zolo-msg.user {
  align-self: flex-end;
  background: var(--accent-gradient); color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.zolo-msg.ai {
  align-self: flex-start;
  background: var(--bg3); color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 6px;
}
.zolo-msg.ai .zolo-action-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-gradient); color: #fff;
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; margin: 6px 4px 6px 0;
  box-shadow: 0 2px 8px var(--accent-glow);
}
.zolo-msg.system {
  align-self: center; font-size: 12px; color: var(--text-muted);
  font-style: italic; text-align: center; background: transparent;
}
.zolo-typing {
  display: inline-flex; gap: 4px; padding: 14px 18px;
  background: var(--bg3); border-radius: var(--radius-lg);
  border: 1px solid var(--border); align-self: flex-start;
}
.zolo-typing span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: typingDot 1.2s ease-in-out infinite;
}
.zolo-typing span:nth-child(2) { animation-delay: 0.2s; background: var(--accent2); }
.zolo-typing span:nth-child(3) { animation-delay: 0.4s; background: var(--accent3); }
@keyframes typingDot {
  0%,60%,100% { transform: scale(0.7); opacity: 0.5; }
  30% { transform: scale(1.15); opacity: 1; }
}
.zolo-ai-input-row {
  padding: 14px 16px;
  border-top: 2px solid var(--border);
  display: flex; gap: 10px; align-items: flex-end;
  background: rgba(255,255,255,0.02);
}
.zolo-ai-input {
  flex: 1; resize: none; max-height: 120px; min-height: 44px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 14px; line-height: 1.5;
  font-family: var(--ui-font);
}
.zolo-ai-send {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-gradient); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  box-shadow: var(--shadow-bubble);
  transition: all 0.25s var(--ease-spring);
}
.zolo-ai-send:hover { transform: scale(1.1) rotate(-12deg); }
.zolo-ai-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.zolo-ai-down-notice {
  padding: 24px; text-align: center; color: var(--text-dim);
  font-size: 14px; line-height: 1.6;
}
.zolo-ai-down-notice i {
  font-size: 40px; color: var(--warning); margin-bottom: 12px; display: block;
  animation: wobble 2s ease-in-out infinite;
}

@media (max-width: 600px) {
  #zolo-ai-panel { width: calc(100vw - 32px); right: 16px; bottom: 92px; height: 70vh; }
  #zolo-ai-launcher { right: 16px; bottom: 16px; }
}

/* ============================================================
   EXTRA POLISH — landing stats, pricing, footer, toasts
   ============================================================ */
.stat span {
  background: var(--accent-gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-badge {
  background: var(--glass); border: 2px solid var(--glass-border);
  padding: 8px 20px; border-radius: var(--radius-pill);
  color: var(--text); font-weight: 600;
}
.hero-badge i {
  background: var(--accent-gradient); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.pricing-card {
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-xl);
}
.pricing-card::before {
  content: ''; position: absolute; inset: -2px; z-index: -1;
  background: var(--accent-gradient); background-size: 300% 300%;
  border-radius: inherit; filter: blur(20px); opacity: 0.3;
  animation: gradientShift 6s ease infinite;
}
.pricing-card { position: relative; }
.pricing-badge { background: var(--accent-gradient); }

/* Pro pricing card accents */
.pricing-card-pro { border-color: rgba(255,212,107,0.45); }
.pricing-badge-pro {
  background: linear-gradient(135deg, #ffd46b, #ff9a6c, #ff6ec7) !important;
  color: #1a0f2e !important; font-weight: 800;
}
.pricing-sub {
  text-align: center; color: rgba(224,221,245,0.65); font-size: .95rem;
  margin: -4px 0 12px 0;
}
.pricing-fine {
  text-align: center; color: rgba(224,221,245,0.45); font-size: .8rem; margin-top: 10px;
}
.pricing-also {
  text-align: center; margin-top: 22px; color: rgba(224,221,245,0.7); font-size: .9rem;
}
.pricing-also a { color: #ffd46b; text-decoration: none; font-weight: 600; }
.pricing-also a:hover { text-decoration: underline; }

/* Hero fine print */
.hero-fine {
  margin-top: 18px; color: rgba(224,221,245,0.5); font-size: .82rem;
}

/* Why-Zolo section */
.why-section {
  padding: 80px 24px; max-width: 1200px; margin: 0 auto; text-align: center;
}
.why-section h2 { font-size: 2.2rem; margin-bottom: 40px; }
.why-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.why-card {
  padding: 28px 20px; border-radius: 18px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  transition: transform .25s, border-color .25s;
}
.why-card:hover { transform: translateY(-4px); border-color: rgba(255,212,107,0.3); }
.why-icon {
  width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(255,212,107,0.18), rgba(255,110,199,0.18));
  font-size: 1.4rem; color: #ffd46b;
}
.why-card h3 { margin: 0 0 8px 0; font-size: 1.1rem; }
.why-card p { color: rgba(224,221,245,0.7); font-size: .9rem; line-height: 1.55; margin: 0; }
.step-number { border-radius: 50%; box-shadow: var(--shadow-bubble); }
.toast {
  border-radius: var(--radius-lg); border: 2px solid var(--glass-border);
  font-weight: 500;
}
.toast i {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--accent-gradient); color: #fff !important;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}
.toast.success i { background: linear-gradient(135deg,#7bffb3,#5cf1ff); }
.toast.error i   { background: linear-gradient(135deg,#ff6b9a,#ff9a6c); }
.toast.warning i { background: linear-gradient(135deg,#ffd46b,#ff9a6c); }
.toast.info i    { background: linear-gradient(135deg,#5cf1ff,#9b7bff); }

/* Context menu bubblification */
.context-menu {
  border-radius: var(--radius); border: 2px solid var(--glass-border);
  padding: 6px;
}
.context-menu li a {
  border-radius: var(--radius-sm); font-weight: 500;
  transition: all 0.2s var(--ease-spring);
}
.context-menu li a:hover {
  background: var(--accent-gradient); color: #fff;
  transform: translateX(3px);
}
.context-menu li a:hover i { color: #fff !important; }
.context-menu li a.danger:hover {
  background: linear-gradient(135deg,#ff6b9a,#ff9a6c);
}

/* Status bar polish */
.status-bar {
  font-weight: 500; padding: 6px 18px;
}
.status-bar span i { color: var(--accent); }

/* Tutorial bubbly */
.tutorial-box {
  border-radius: var(--radius-xl);
  border: 2px solid var(--glass-border);
}
.tutorial-spotlight {
  border-radius: var(--radius-lg);
}
#tutorial-title {
  background: var(--accent-gradient); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
  font-weight: 600;
}

/* Project card bubblification */
.project-card {
  border-radius: var(--radius-lg); border: 2px solid var(--glass-border);
  background: var(--bg3);
  transition: all 0.35s var(--ease-spring);
}
.project-card:hover {
  transform: translateY(-6px) rotate(-0.5deg);
  border-color: var(--accent);
}
.project-card i {
  width: 56px; height: 56px; border-radius: 18px;
  background: var(--accent-gradient); color: #fff !important;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-size: 1.6rem;
  box-shadow: var(--shadow-bubble);
}

/* Edit mode panel bubblification */
.edit-mode-panel {
  border-radius: var(--radius-xl); border: 2px solid var(--accent);
}
.emp-header {
  background: var(--accent-gradient); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
  font-weight: 600;
}

/* Editor + status small tweaks */
#line-numbers { background: var(--panel); border-right: 2px solid var(--border); }
#code-editor { background: var(--bg); }


/* ============ Pro Upgrade Banner (in-IDE) ============ */
.pro-upgrade-banner {
  background: linear-gradient(135deg, #ffd46b 0%, #ff6ec7 50%, #9b7bff 100%);
  color: #1a0f2e;
  padding: 10px 16px;
  font-family: 'Fredoka', system-ui, sans-serif;
  box-shadow: 0 2px 10px rgba(255,110,199,0.3);
  position: relative;
  z-index: 50;
}
.pro-upgrade-inner {
  display: flex; align-items: center; gap: 12px;
  max-width: 1400px; margin: 0 auto;
  flex-wrap: wrap;
}
.pro-upgrade-icon { font-size: 1.1rem; color: #6a2d8f; }
.pro-upgrade-text { font-size: .88rem; flex: 1; min-width: 260px; }
.pro-upgrade-text strong { font-weight: 700; }
.pro-upgrade-btn {
  background: #1a0f2e; color: #ffd46b;
  border: none; border-radius: 10px;
  padding: 7px 14px; font-family: inherit; font-size: .82rem; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.pro-upgrade-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.25); }
.pro-upgrade-btn.secondary { background: rgba(26,15,46,0.15); color: #1a0f2e; }
.pro-upgrade-close {
  background: transparent; border: none; color: #1a0f2e;
  cursor: pointer; padding: 4px 8px; font-size: 1rem; opacity: .6;
}
.pro-upgrade-close:hover { opacity: 1; }

/* ============================================================
   EXTRA ANIMATIONS + QoL POLISH  (batch added)
   ============================================================ */

/* --- Global entrance animations --- */
@keyframes zoloFadeUp   { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes zoloFadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoloPop      { 0% { transform: scale(.92); opacity: 0; } 60% { transform: scale(1.02); opacity: 1; } 100% { transform: scale(1); } }
@keyframes zoloShimmer  { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes zoloFloat    { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes zoloPulseSoft{ 0%,100% { opacity: 1; } 50% { opacity: 0.72; } }
@keyframes zoloSlideIn  { from { transform: translateX(-12px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes zoloWiggle   { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }

/* Tree items cascade in */
.tree-item { animation: zoloSlideIn 0.28s var(--ease-out) both; }
.tree-item:nth-child(1) { animation-delay: 0.02s; }
.tree-item:nth-child(2) { animation-delay: 0.05s; }
.tree-item:nth-child(3) { animation-delay: 0.08s; }
.tree-item:nth-child(4) { animation-delay: 0.11s; }
.tree-item:nth-child(5) { animation-delay: 0.14s; }
.tree-item:nth-child(6) { animation-delay: 0.17s; }
.tree-item:nth-child(n+7) { animation-delay: 0.2s; }

/* Buttons get a gentle lift + press effect globally */
button, .btn, .btn-primary, .btn-ghost, .btn-secondary {
  transition: transform 0.15s var(--ease-out), box-shadow 0.2s var(--ease-out), background 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), filter 0.2s var(--ease-out);
}
button:not(:disabled):hover, .btn:hover { transform: translateY(-1px); }
button:not(:disabled):active, .btn:active { transform: translateY(0) scale(0.98); filter: brightness(0.95); }

/* Tab switching animation */
.tab-item, .code-tab { transition: all 0.22s var(--ease-out); }
.tab-item.active, .code-tab.active { animation: zoloFadeUp 0.25s var(--ease-out); }

/* Toasts already slide, but add a satisfying pop on success */
.toast.success { animation: zoloPop 0.35s var(--ease-out); }

/* Modals — refine entrance */
.modal:not(.hidden) .modal-content,
.modal-backdrop:not(.hidden) > *:not(.modal-backdrop) { animation: zoloPop 0.32s var(--ease-out); }

/* File icon gets a tiny wiggle on hover */
.tree-item:hover > i:first-child { animation: zoloWiggle 0.5s var(--ease-out); }

/* Shimmer loader for skeleton states */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 800px 100%;
  animation: zoloShimmer 1.4s linear infinite;
  border-radius: 6px;
}

/* Soft floating on pro / badge pills */
.badge-pro, .status-badge, .user-badge { animation: zoloFloat 3.8s ease-in-out infinite; }

/* Focus ring accent */
input:focus, textarea:focus, select:focus, .code-editor:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.22);
  border-color: var(--accent);
  transition: box-shadow 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

/* Smooth scrollbars (QoL) */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.18) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15); border-radius: 8px;
  border: 2px solid transparent; background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(0,212,255,0.35); background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* Selection color */
::selection { background: rgba(0,212,255,0.35); color: #fff; }

/* Disabled look — more obvious */
button:disabled, .btn:disabled, input:disabled {
  opacity: 0.45; cursor: not-allowed; filter: grayscale(0.3);
}

/* Nicer drop-target indicator (QoL for drag-drop linking) */
.tree-item.drop-target {
  background: linear-gradient(90deg, rgba(0,212,255,0.18), rgba(99,102,241,0.14)) !important;
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
  transform: scale(1.02);
  transition: all 0.15s var(--ease-out);
}
.tree-item.drag-ghost { opacity: 0.5; transform: scale(0.98); }

/* Student-pro badge */
.badge-student {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 10px; font-size: 10px;
  font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  background: linear-gradient(135deg, #10b981, #3b82f6);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16,185,129,0.35);
}

/* Keyboard shortcut chip */
kbd, .kbd {
  display: inline-block; padding: 2px 6px; border-radius: 4px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14);
  border-bottom-width: 2px; font-family: var(--mono, monospace);
  font-size: 11px; color: var(--text-dim); line-height: 1;
}

/* Tooltip polish (title attr replacement not included, but native tooltips delay) */
[title]:hover { cursor: help; }

/* Profile modal */
.profile-body { display: grid; grid-template-columns: 180px 1fr; gap: 28px; padding: 4px 4px 10px; }
@media (max-width: 640px) { .profile-body { grid-template-columns: 1fr; } }
.profile-avatar-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.profile-avatar-ring {
  width: 140px; height: 140px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,212,255,0.35), rgba(155,123,255,0.35));
  padding: 4px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
  position: relative; overflow: hidden;
}
.profile-avatar-ring img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  background: #111;
}
.profile-avatar-ring i {
  font-size: 90px; color: rgba(224,221,245,0.55);
}
.profile-avatar-upload {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: 13px;
  background: linear-gradient(135deg, var(--accent), #9b7bff);
  color: #0b1020; font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,212,255,0.3);
  transition: transform 0.15s var(--ease-out), filter 0.2s var(--ease-out);
}
.profile-avatar-upload:hover { transform: translateY(-1px); filter: brightness(1.05); }
.profile-fields { display: flex; flex-direction: column; gap: 12px; }
.profile-fields .field { display: flex; flex-direction: column; gap: 4px; }
.profile-fields label { font-size: 12px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.profile-fields input, .profile-fields textarea {
  padding: 9px 12px; border-radius: 8px; font-size: 14px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text, #e0ddf5); font-family: inherit; resize: vertical;
}
.profile-fields input:disabled { opacity: 0.6; }
.profile-actions { display: flex; gap: 10px; margin-top: 6px; }
.profile-status { font-size: 13px; min-height: 18px; margin-top: 4px; }
.profile-status.ok  { color: var(--success, #10b981); }
.profile-status.err { color: #ef4444; }

/* ============================================================
   EDITOR PRO — Blueprint-style visual WYSIWYG editor (Pro)
   ============================================================ */

/* Preview / Editor Pro mode toggle tabs */
.preview-mode-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 4px;
}
.pm-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 7px;
  background: transparent; border: none; cursor: pointer;
  color: rgba(224,221,245,0.65); font: inherit; font-size: 13px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.pm-tab:hover { color: var(--text, #e0ddf5); background: rgba(255,255,255,0.05); }
.pm-tab.active {
  background: linear-gradient(135deg, rgba(92,241,255,0.15), rgba(155,123,255,0.15));
  color: var(--text, #e0ddf5);
  box-shadow: inset 0 0 0 1px rgba(92,241,255,0.25);
}
.pm-tab .pro-pill {
  font-size: 9px; font-weight: 700; letter-spacing: 0.5px;
  padding: 2px 6px; border-radius: 4px;
  background: linear-gradient(135deg, #ff6ec7, #9b7bff);
  color: #fff;
}

/* Editor Pro main container */
.editor-pro {
  display: none; flex-direction: column; height: 100%;
  background: linear-gradient(180deg, #0e1420, #0a0f18);
  color: var(--text, #e0ddf5);
}
.editor-pro.active { display: flex; }

.editor-pro-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 14px;
  background: rgba(20,9,31,0.6); border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ep-toolgroup {
  display: inline-flex; align-items: center; gap: 6px;
  padding-right: 12px; border-right: 1px solid rgba(255,255,255,0.08);
}
.ep-toolgroup:last-child { border-right: none; }
.ep-toolgroup-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px;
  color: rgba(224,221,245,0.45); margin-right: 4px;
}
.ep-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text, #e0ddf5); cursor: pointer; font: inherit; font-size: 13px;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
}
.ep-btn:hover { background: rgba(255,255,255,0.08); border-color: rgba(92,241,255,0.3); }
.ep-btn:active { transform: translateY(1px); }
.ep-btn.primary {
  background: linear-gradient(135deg, #5cf1ff, #9b7bff);
  border-color: transparent; color: #0a0614; font-weight: 600;
}
.ep-btn.primary:hover { filter: brightness(1.1); }
.ep-btn.ghost { background: transparent; }
.ep-check {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: rgba(224,221,245,0.8); cursor: pointer;
}
.ep-check input { accent-color: #9b7bff; }
.ep-gridsize {
  width: 56px; padding: 5px 8px; border-radius: 6px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  color: var(--text, #e0ddf5); font: inherit; font-size: 13px;
}

/* Canvas + inspector split */
.editor-pro-body {
  flex: 1; display: flex; min-height: 0; overflow: hidden;
}
.ep-canvas-wrap {
  flex: 1; overflow: auto; position: relative;
  background:
    radial-gradient(1200px 500px at 50% 0%, rgba(92,241,255,0.05), transparent 60%),
    #0b111c;
  padding: 24px;
}
.ep-canvas {
  --ep-grid: 8px;
  position: relative; min-height: 100%;
  background: #fff; color: #111;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  overflow: hidden;
}
.ep-canvas.ep-show-grid {
  background-image:
    linear-gradient(to right, rgba(92,241,255,0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(92,241,255,0.12) 1px, transparent 1px);
  background-size: var(--ep-grid) var(--ep-grid);
}
.ep-canvas [data-ep] {
  position: absolute; cursor: move; user-select: none;
  outline: 1px dashed transparent; transition: outline-color 0.1s;
}
.ep-canvas [data-ep]:hover { outline-color: rgba(155,123,255,0.6); }
.ep-canvas [data-ep].ep-editing {
  cursor: text; user-select: text;
  outline: 2px solid #5cf1ff;
}
.ep-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: rgba(0,0,0,0.35); font-size: 14px; pointer-events: none;
}

/* Selection overlay with 4 corner handles */
.ep-selection {
  position: absolute; pointer-events: none;
  border: 2px solid #5cf1ff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3), 0 4px 14px rgba(92,241,255,0.3);
  z-index: 50;
}
.ep-selection.hidden { display: none; }
.ep-handle {
  position: absolute; width: 10px; height: 10px; background: #5cf1ff;
  border: 1px solid #0a0614; border-radius: 2px; pointer-events: auto;
}
.ep-handle.nw { top: -6px; left: -6px; cursor: nwse-resize; }
.ep-handle.ne { top: -6px; right: -6px; cursor: nesw-resize; }
.ep-handle.sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.ep-handle.se { bottom: -6px; right: -6px; cursor: nwse-resize; }

/* Context menu (right-click) */
.ep-contextmenu {
  position: fixed; z-index: 1000; min-width: 180px;
  background: #14091f; border: 1px solid rgba(92,241,255,0.2);
  border-radius: 10px; padding: 6px; box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  font-size: 13px;
}
.ep-contextmenu.hidden { display: none; }
.ep-contextmenu .epm-title {
  padding: 6px 10px; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.8px; color: rgba(224,221,245,0.45);
}
.ep-contextmenu .epm-sep {
  height: 1px; background: rgba(255,255,255,0.08); margin: 4px 0;
}
.ep-contextmenu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 10px; border-radius: 6px; border: none; cursor: pointer;
  background: transparent; color: var(--text, #e0ddf5); font: inherit;
  font-size: 13px; text-align: left;
}
.ep-contextmenu button:hover { background: rgba(92,241,255,0.1); }
.ep-contextmenu button.danger { color: #ff8aa3; }
.ep-contextmenu button.danger:hover { background: rgba(255,138,163,0.1); }

/* Inspector sidebar */
.ep-inspector {
  width: 300px; flex-shrink: 0; overflow-y: auto;
  background: rgba(20,9,31,0.6); border-left: 1px solid rgba(255,255,255,0.08);
  padding: 14px;
}
.ep-inspector .ep-sec {
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ep-inspector .ep-sec:last-child { border-bottom: none; }
.ep-inspector .ep-sec h4 {
  margin: 0 0 10px; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.8px; color: rgba(92,241,255,0.8);
  display: flex; align-items: center; gap: 6px;
}
.ep-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.ep-row label {
  flex: 0 0 70px; font-size: 12px; color: rgba(224,221,245,0.6);
}
.ep-input, .ep-inspector select, .ep-inspector textarea {
  flex: 1; padding: 6px 9px; border-radius: 6px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text, #e0ddf5); font: inherit; font-size: 13px;
}
.ep-inspector textarea { resize: vertical; min-height: 60px; font-family: monospace; font-size: 12px; }
.ep-hint {
  font-size: 11px; color: rgba(224,221,245,0.4); margin-top: 4px; line-height: 1.4;
}

/* Blueprint-style action node (Unreal-like) */
.ep-blueprint {
  margin-top: 10px; padding: 10px;
  background: linear-gradient(180deg, rgba(155,123,255,0.08), rgba(92,241,255,0.05));
  border: 1px solid rgba(155,123,255,0.25);
  border-radius: 10px;
}
.ep-bp-node {
  background: #1a0f2e; border: 1px solid rgba(92,241,255,0.3);
  border-radius: 8px; padding: 8px; position: relative;
}
.ep-bp-node .ep-bp-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
  color: #5cf1ff; margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.ep-bp-pin {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: rgba(224,221,245,0.75);
}
.ep-bp-pin::before {
  content: ''; width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle, #5cf1ff 40%, #9b7bff);
  box-shadow: 0 0 6px rgba(92,241,255,0.5);
}
.ep-bp-hint {
  font-size: 10px; color: rgba(224,221,245,0.4);
  margin-top: 6px; font-style: italic;
}

/* Pro upsell gate */
.editor-pro-gate {
  display: none; align-items: center; justify-content: center;
  height: 100%; padding: 40px;
  background: linear-gradient(180deg, #0e1420, #0a0f18);
}
.editor-pro-gate.active { display: flex; }
.epg-box {
  max-width: 480px; text-align: center; padding: 40px 32px;
  background: linear-gradient(180deg, rgba(26,15,46,0.8), rgba(20,9,31,0.6));
  border: 1px solid rgba(155,123,255,0.25);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.epg-icon {
  font-size: 48px; margin-bottom: 14px;
  background: linear-gradient(135deg, #ffd86e, #ff6ec7, #9b7bff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.epg-box h2 {
  margin: 0 0 10px; font-size: 1.6rem;
  background: linear-gradient(135deg, #5cf1ff, #9b7bff, #ff6ec7);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.epg-box p { color: rgba(224,221,245,0.7); margin-bottom: 18px; font-size: 14px; }
.epg-feat {
  display: flex; align-items: flex-start; gap: 10px; text-align: left;
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 13px; color: rgba(224,221,245,0.8);
}
.epg-feat:last-of-type { border-bottom: none; }
.epg-feat i {
  color: #5cf1ff; margin-top: 2px; width: 16px; flex-shrink: 0;
}
.epg-actions {
  display: flex; gap: 10px; justify-content: center; margin-top: 20px;
}
.epg-actions .ep-btn.primary {
  padding: 10px 20px; font-size: 14px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   MOBILE / iPHONE RESPONSIVE FIXES
   ============================================================ */
html, body {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100vw;
}
img, svg, video, canvas, iframe { max-width: 100%; }

/* Use --vh (set by JS) to dodge iOS Safari's bouncing 100vh bug. */
.is-mobile #app, .is-mobile .ide-shell, .is-mobile body {
  min-height: calc(var(--vh, 1vh) * 100);
}

@media (max-width: 768px) {
  /* Brand and nav logos must never overflow */
  .brand, .logo, .nav-brand { max-width: 70vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .brand img, .logo img, .nav-brand img { max-height: 32px; width: auto; }

  /* Header/nav: wrap, don't push off-screen */
  header.nav, .navbar, .topbar {
    flex-wrap: wrap; gap: 8px; padding: 10px 14px;
  }
  header.nav nav, .navbar nav { flex-wrap: wrap; gap: 8px; }
  header.nav nav a, .navbar nav a { margin-left: 0; font-size: 0.9rem; }

  /* Main containers shouldn't enforce huge min-widths */
  main, .container, section { max-width: 100vw; }
  main { padding: 24px 16px !important; margin: 16px auto !important; }
  h1 { font-size: 1.8rem !important; }
  h2 { font-size: 1.15rem !important; }

  /* Buttons grow taps targets */
  button, .btn, a.btn { min-height: 40px; }

  /* Footer wraps */
  footer { font-size: 0.8rem; padding: 20px 12px; }
  footer a { display: inline-block; margin: 4px 6px; }
}

/* ============================================================
   MOBILE IDE — full redesign
   The goal: keep the desktop IDE layout (Files / Code / Preview)
   but make it actually fit on a phone. We turn the three columns
   into single-fullscreen panes controlled by a top tab bar.
   Active pane fills the screen, the rest are display:none.
   ============================================================ */
@media (max-width: 900px) {
  html, body { overflow-x: hidden; max-width: 100vw; }

  /* Workspace fills the viewport below the topbar */
  #workspace-body {
    flex-direction: row !important;
    height: calc(var(--vh,1vh)*100 - 56px - 52px) !important;
    width: 100vw !important; max-width: 100vw;
    overflow: hidden;
  }

  #editor-preview-wrap {
    flex-direction: column !important;
    width: 100% !important; height: 100% !important;
    flex: 1 1 auto;
  }
  #splitter { display: none !important; }

  /* DEFAULT (no body class) — split: tiny files rail + code editor.
     This matches the "Files on left, code on right" desktop feel,
     just compressed. Preview is reached via the bottom tab bar. */
  #file-manager-panel {
    width: 38vw !important; max-width: 220px; min-width: 140px;
    flex: 0 0 auto !important;
    height: 100% !important; max-height: none;
    border-right: 1px solid var(--border, rgba(255,255,255,0.08));
  }
  #editor-area, #preview-area {
    width: auto !important;
    flex: 1 1 auto !important;
  }
  #preview-area { display: none; } /* shown only when preview tab active */

  /* mide-files: full-screen file manager (Code & Preview hidden) */
  body.mide-files #file-manager-panel { width: 100% !important; max-width: 100vw; }
  body.mide-files #editor-preview-wrap { display: none !important; }

  /* mide-code: split files + code (default phone view) */
  body.mide-code #file-manager-panel { display: flex !important; }
  body.mide-code #editor-preview-wrap { display: flex !important; }
  body.mide-code #editor-area { display: flex !important; }
  body.mide-code #preview-area { display: none !important; }

  /* mide-preview: full-screen preview (Files & Code hidden) */
  body.mide-preview #file-manager-panel { display: none !important; }
  body.mide-preview #editor-preview-wrap { display: flex !important; }
  body.mide-preview #editor-area { display: none !important; }
  body.mide-preview #preview-area { display: flex !important; height: 100% !important; flex: 1 1 auto !important; }

  /* The bottom tab bar */
  #mide-tabs {
    display: flex !important;
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 5000;
    height: 52px;
    background: rgba(20,9,31,.96); backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 4px;
    padding-bottom: calc(4px + env(safe-area-inset-bottom, 0));
  }
  #mide-tabs button {
    flex: 1; background: transparent; border: none; color: rgba(224,221,245,.6);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; font: inherit; font-size: 11px; font-weight: 600; cursor: pointer;
    border-radius: 8px;
  }
  #mide-tabs button i { font-size: 17px; }
  #mide-tabs button.on {
    color: #5cf1ff; background: rgba(92,241,255,0.08);
  }
  /* Reserve space at the bottom for the tab bar */
  body.mide-files, body.mide-code, body.mide-preview {
    padding-bottom: calc(52px + env(safe-area-inset-bottom, 0)) !important;
  }

  /* Editor area — make code editor + preview properly fit */
  #editor-area { display: flex; flex-direction: column; }
  #editor-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-shrink: 0; }
  #editor-tabs::-webkit-scrollbar { display: none; }
  #editor-container {
    flex: 1 1 auto; min-height: 0;
    width: 100% !important; max-width: 100vw;
    overflow: hidden;
  }
  #code-editor {
    width: 100% !important; max-width: 100vw;
    height: 100% !important;
    box-sizing: border-box;
    /* Prevent iOS zoom — the keyboard CSS already forces 16px on inputs */
    font-size: 15px;
  }
  /* Status bar wraps */
  #status-bar { flex-wrap: wrap; gap: 6px; padding: 4px 8px; font-size: 11px; }

  /* Preview — fill the screen, no oversized iframe overflowing */
  #preview-area { display: flex; flex-direction: column; }
  .preview-header {
    flex-wrap: wrap; gap: 6px; padding: 6px 8px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .preview-header::-webkit-scrollbar { display: none; }
  .preview-mode-toggle, .preview-controls, .device-frames {
    flex-shrink: 0;
  }
  #preview-frame-wrap, .preview-frame-wrap {
    flex: 1 1 auto !important; min-height: 0 !important;
    width: 100% !important; max-width: 100vw;
    overflow: hidden;
    padding: 0 !important;
    background: #fff;
  }
  #preview-frame {
    width: 100% !important; height: 100% !important;
    max-width: 100vw; max-height: 100%;
    border: 0;
  }
  /* Device-frame previews shrink to fit instead of overflowing right */
  .preview-frame-wrap.device-mobile #preview-frame {
    width: min(95vw, 375px) !important; height: 95% !important;
    max-width: 95vw;
    margin: 0 auto;
  }
  .preview-frame-wrap.device-tablet #preview-frame {
    width: 95vw !important; height: 95% !important;
    max-width: 95vw;
    margin: 0 auto;
  }

  /* File explorer — let it actually breathe when active */
  #file-manager-panel { max-height: none !important; }
  #file-tree { flex: 1 1 auto; overflow-y: auto; }

  /* ZoloAI panel docks to bottom edge above tab bar instead of floating */
  #zolo-ai-panel:not(.hidden) {
    inset: auto 0 calc(52px + env(safe-area-inset-bottom, 0)) 0 !important;
    width: 100vw !important; max-width: 100vw !important;
    height: 70vh !important; border-radius: 16px 16px 0 0 !important;
  }
  #zolo-ai-launcher { bottom: calc(60px + env(safe-area-inset-bottom, 0)) !important; }
}

/* Hide the mobile tab bar on desktop */
#mide-tabs { display: none; }

/* Publish button — primary CTA in the preview header */
.preview-controls .zp-publish-btn {
  background: linear-gradient(135deg, #5cf1ff, #9b7bff, #ff6ec7) !important;
  color: #0a0614 !important;
  font-weight: 600;
  padding: 6px 14px !important;
  border-radius: 8px !important;
  display: inline-flex; align-items: center; gap: 6px;
}
.preview-controls .zp-publish-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.preview-controls .zp-publish-btn:active { transform: translateY(0); }
@media (max-width: 768px) {
  .preview-controls .zp-publish-btn span { display: none; }
}

/* ============================================================
   PHONE TOOLBAR OVERFLOW & CARET TINT
   ============================================================ */
@media (max-width: 768px) {
  /* The IDE top toolbar — let the row scroll horizontally so every
     tool stays reachable, and shrink labels so more buttons fit. */
  .toolbar, .ide-toolbar, #toolbar, .topbar-inner, .editor-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap !important;
    white-space: nowrap;
  }
  .toolbar::-webkit-scrollbar, .ide-toolbar::-webkit-scrollbar,
  #toolbar::-webkit-scrollbar, .editor-tabs::-webkit-scrollbar { display: none; }

  /* Tighter buttons in the toolbar */
  .toolbar button, .ide-toolbar button, #toolbar button {
    flex-shrink: 0;
    padding: 6px 10px !important;
    font-size: 12px;
    min-height: 32px;
  }
  /* Hide button labels — keep just the icon — when they would push the
     toolbar past the viewport edge */
  .toolbar button .label, #toolbar button .label,
  .toolbar button span:not(.icon), #toolbar button span:not(.icon) {
    display: none;
  }

  /* Caret tint: makes iOS show a visible cyan caret instead of grey */
  textarea, input[type="text"], input[type="email"], input[type="search"],
  [contenteditable="true"], .code-editor {
    caret-color: #5cf1ff;
  }
}

/* ============================================================
   PULSING CARET INDICATOR
   When user taps an empty input on iPhone, native shows a thin
   blinking caret. We add a brighter cyan animated overlay so it's
   obvious where typing will go.
   ============================================================ */
.is-iphone textarea:focus, .is-iphone input:focus,
.is-ipad   textarea:focus, .is-ipad   input:focus {
  caret-color: #5cf1ff;
  animation: ep-caret-pulse 1.4s ease-in-out infinite;
}
@keyframes ep-caret-pulse {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(92,241,255,0); }
  50%      { box-shadow: inset 0 0 0 1px rgba(92,241,255,0.45); }
}

@media (max-width: 480px) {
  .brand { font-size: 1rem !important; }
  h1 { font-size: 1.5rem !important; }
  .callout { padding: 10px 12px; font-size: 0.85rem; }
}

/* Landscape phones — keep things compact */
@media (max-height: 500px) and (orientation: landscape) {
  header.nav { padding: 6px 14px; }
  main { margin: 8px auto !important; padding: 16px !important; }
}

/* iOS auto-zooms when an input has font-size < 16px — force 16px on phones. */
.is-iphone input, .is-iphone select, .is-iphone textarea,
.is-ipad   input, .is-ipad   select, .is-ipad   textarea {
  font-size: 16px !important;
}

/* ============================================================
   LANDING PAGE — iPhone button & layout hardening
   ============================================================ */
@media (max-width: 768px) {
  /* Top nav buttons must never overflow the brand. They were running
     off-screen on small iPhones. */
  .nav-actions, .topbar .actions { flex-shrink: 0; gap: 6px; flex-wrap: wrap; }
  .nav-actions button, .topbar .actions button,
  .btn-outline.btn-sm, .btn-primary.btn-sm {
    padding: 7px 12px !important; font-size: 12px !important;
    white-space: nowrap; min-height: 36px;
  }

  /* Hero CTAs stack vertically and span full width on phones */
  .hero-cta, .hero-actions, .hero-buttons {
    flex-direction: column !important;
    width: 100%;
    gap: 10px !important;
  }
  .hero-cta .btn, .hero-actions .btn, .hero-buttons .btn,
  .hero .btn-primary, .hero .btn-ghost, .hero .btn-outline,
  .btn-xl {
    width: 100% !important;
    max-width: 360px;
    justify-content: center !important;
    box-sizing: border-box;
  }

  /* Pricing cards stack and don't get cropped */
  .pricing-grid {
    grid-template-columns: 1fr !important;
  }
  .pricing-grid { grid-template-columns: 1fr !important; }
  .pricing-grid .pricing-card { transform: none !important; }
  .pricing-grid, .plans, .plan-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .plan, .pricing-card { width: 100% !important; max-width: 100% !important; transform: none !important; }

  /* Feature grid stacks */
  .features-grid, .feature-grid { grid-template-columns: 1fr !important; }

  /* Pro upgrade banner must wrap, not push off-screen */
  .pro-upgrade-banner, .pro-upgrade-inner {
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 12px 14px !important;
    text-align: center;
  }
  .pro-upgrade-text { flex: 1 1 100%; font-size: 13px !important; }
  .pro-upgrade-btn  { flex: 1 1 auto; padding: 8px 14px !important; font-size: 13px !important; min-height: 36px; }
  .pro-upgrade-close{ position: absolute; top: 6px; right: 8px; }

  /* Auth modal — no clipping on iPhone SE-class screens */
  #auth-modal .modal-content, .auth-modal-content, #auth-modal {
    max-height: 92vh; overflow-y: auto;
    margin: 4vh auto !important;
  }

  /* Anything with role=button or aria click target stays tappable */
  [role="button"], a[onclick], button { min-height: 36px; }
}
