:root {
  --bg: #04010d;
  --bg-2: #0a0420;
  --neon: #00f6ff;
  --magenta: #ff2bd6;
  --violet: #8a2bff;
  --lime: #b6ff3c;
  --text: #d8e9ff;
  --muted: #8390b8;
  --line: rgba(0, 246, 255, 0.18);
  --line-strong: rgba(0, 246, 255, 0.45);
  --card: rgba(10, 4, 32, 0.55);
  --glass-blur: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', 'JetBrains Mono', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Backdrops */
.bg-particles {
  position: fixed; inset: 0;
  z-index: -2; display: block;
  width: 100vw; height: 100vh;
  pointer-events: none;
}
.bg-glow {
  position: fixed; inset: -20%;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 43, 214, 0.18), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(0, 246, 255, 0.18), transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(138, 43, 255, 0.18), transparent 50%);
  z-index: -1;
  filter: blur(30px);
  animation: glowDrift 16s ease-in-out infinite alternate;
}
@keyframes glowDrift {
  0% { transform: translate3d(-2%, -1%, 0); }
  100% { transform: translate3d(2%, 1%, 0); }
}

/* Topbar */
.topbar {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(var(--glass-blur));
  position: sticky; top: 0; z-index: 10;
  background: rgba(4, 1, 13, 0.55);
  transition: padding 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.topbar.scrolled {
  padding: 0.6rem 2rem;
  background: rgba(4, 1, 13, 0.85);
  box-shadow: 0 6px 32px rgba(0, 0, 0, 0.4);
}
.brand { display: flex; align-items: center; gap: 0.85rem; }
.logo-mark {
  font-size: 2rem; color: var(--neon);
  text-shadow: 0 0 12px var(--neon), 0 0 24px rgba(0, 246, 255, 0.6);
  display: inline-block;
  animation: spinGlow 9s linear infinite;
}
.logo-mark.big { font-size: 3rem; }
@keyframes spinGlow {
  0%   { transform: rotate(0deg); filter: drop-shadow(0 0 6px var(--neon)); }
  50%  { filter: drop-shadow(0 0 14px var(--magenta)); }
  100% { transform: rotate(360deg); filter: drop-shadow(0 0 6px var(--neon)); }
}
.brand h1 {
  font-size: 1.2rem; letter-spacing: 0.1em;
  text-transform: uppercase;
}
.brand .accent { color: var(--magenta); text-shadow: 0 0 8px var(--magenta); }
.brand .tag { color: var(--muted); font-size: 0.72rem; letter-spacing: 0.1em; }

/* tabs styled below */
.tab {
  background: transparent; color: var(--muted);
  border: 1px solid transparent;
  padding: 0.5rem 1rem; border-radius: 999px;
  font-size: 0.85rem; cursor: pointer; letter-spacing: 0.08em;
  text-transform: uppercase; transition: all 0.2s ease;
  font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--neon); border-color: var(--line-strong);
  background: rgba(0, 246, 255, 0.06);
  box-shadow: inset 0 0 12px rgba(0, 246, 255, 0.18), 0 0 16px rgba(0, 246, 255, 0.12);
}

.topbar-right { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.user-pill {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 0.4rem 0.4rem 0.8rem;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 0.8rem; color: var(--text);
}
.lang-switcher {
  display: inline-flex; gap: 2px;
  padding: 3px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(4,1,13,.55);
}
.lang-switcher.inline { background: transparent; }
.lang-btn {
  background: transparent; color: var(--muted);
  padding: 0.3rem 0.7rem; border-radius: 999px;
  font-size: 0.72rem; letter-spacing: 0.12em; font-weight: 700;
  border: 0; cursor: pointer; font-family: inherit;
  transition: color .15s, background .15s;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active {
  color: #0a0118;
  background: linear-gradient(90deg, var(--neon), var(--magenta));
  box-shadow: 0 0 12px rgba(255, 43, 214, 0.45);
}
.tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; }
/* override original margin-left:auto since topbar-right takes that spot */
.user-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--lime); box-shadow: 0 0 8px var(--lime);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.45; } }

/* Layout */
main { padding: 2rem; max-width: 1180px; margin: 0 auto; display: grid; gap: 1.5rem; }
.panel { display: none; animation: fadeIn 0.3s ease; }
.panel.active { display: grid; gap: 1.5rem; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } }

/* Cards */
.card {
  position: relative;
  background: var(--card);
  border-radius: 18px;
  padding: 1.75rem;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45),
              inset 0 0 30px rgba(138, 43, 255, 0.06);
}
.glass-card {
  border: 1px solid transparent;
  background-clip: padding-box;
}
.glass-card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, rgba(0, 246, 255, 0.6), rgba(255, 43, 214, 0.6), rgba(138, 43, 255, 0.6), rgba(0, 246, 255, 0.6));
  background-size: 280% 280%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0.55;
  pointer-events: none;
  animation: borderFlow 9s linear infinite;
}
@keyframes borderFlow { to { background-position: 280% 0; } }

.card h2 {
  font-size: 1.4rem; letter-spacing: 0.05em;
  color: var(--neon);
  text-shadow: 0 0 12px rgba(0, 246, 255, 0.45);
  margin-bottom: 0.5rem;
}
.card .muted, .muted { color: var(--muted); }
.card > p.muted { margin-bottom: 1.25rem; font-size: 0.9rem; }
.hint { color: var(--muted); font-size: 0.8rem; margin: 0.6rem 0 0; }

label {
  display: block; margin: 1rem 0 0.4rem;
  font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
input, textarea {
  width: 100%; padding: 0.78rem 0.95rem;
  background: rgba(4, 1, 13, 0.6);
  border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font-family: inherit; font-size: 0.95rem;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus {
  border-color: var(--neon);
  box-shadow: 0 0 0 3px rgba(0, 246, 255, 0.12);
}
textarea { resize: vertical; min-height: 130px; }

.row { display: flex; gap: 0.75rem; margin-top: 1.25rem; flex-wrap: wrap; }
.row.between { justify-content: space-between; align-items: center; margin-top: 0; }

button, .btn-link {
  cursor: pointer; font-family: inherit;
  padding: 0.78rem 1.4rem; border-radius: 10px;
  font-size: 0.88rem; letter-spacing: 0.08em;
  text-transform: uppercase; transition: all 0.18s ease;
  border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 0.45rem;
  text-decoration: none;
}
.btn-icon { font-size: 1.05em; }
.primary {
  background: linear-gradient(90deg, var(--neon), var(--magenta));
  color: #0a0118; font-weight: 700;
  box-shadow: 0 0 18px rgba(255, 43, 214, 0.35);
}
.primary:hover { transform: translateY(-1px); box-shadow: 0 0 28px var(--magenta); }
.primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.ghost {
  background: transparent; color: var(--neon);
  border-color: var(--line);
}
.ghost:hover { background: rgba(0, 246, 255, 0.08); }
.ghost:disabled { opacity: 0.5; cursor: not-allowed; }
.mini { padding: 0.45rem 0.85rem; font-size: 0.72rem; border-radius: 8px; }

.result {
  margin-top: 1.5rem; padding: 1rem;
  border: 1px dashed var(--line); border-radius: 10px;
  background: rgba(0, 0, 0, 0.3); font-size: 0.92rem;
}
.result a { color: var(--lime); text-decoration: none; }
.result a:hover { text-shadow: 0 0 8px var(--lime); }

/* Build loader */
.build-loader { display: grid; gap: 0.85rem; padding: 0.5rem 0 0.25rem; }
.loader-brand { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.loader-logo {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 1.25rem; letter-spacing: 0.22em; font-weight: 800;
  color: var(--neon);
  text-shadow: 0 0 10px rgba(0, 246, 255, 0.9), 0 0 28px rgba(255, 43, 214, 0.45);
}
.loader-logo .mark { animation: spinGlow 4s linear infinite; }
.loader-sub { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
.loader-track {
  width: 100%; height: 14px; padding: 2px;
  border-radius: 999px;
  background: rgba(4, 1, 13, 0.85);
  border: 1px solid rgba(0, 246, 255, 0.24);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.45);
  overflow: hidden; position: relative;
}
.loader-fill {
  width: 0%; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--neon), var(--magenta), var(--violet));
  background-size: 200% 100%;
  box-shadow: 0 0 22px rgba(0, 246, 255, 0.65);
  transition: width 0.35s ease;
  animation: shimmer 2s linear infinite;
}
@keyframes shimmer { to { background-position: 200% 0; } }
.loader-meta {
  display: flex; justify-content: space-between; gap: 1rem;
  color: var(--text); font-size: 0.9rem; letter-spacing: 0.05em;
}
.build-loader.done .loader-fill { box-shadow: 0 0 28px var(--lime); background: linear-gradient(90deg, var(--lime), var(--neon)); }
.build-loader.done .loader-logo { color: var(--lime); text-shadow: 0 0 12px var(--lime); animation: pulseUp 0.8s ease; }
@keyframes pulseUp { 0% { transform: scale(0.96); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }

.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(0, 246, 255, 0.25);
  border-top-color: var(--neon);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Live preview */
.preview-card { padding: 1.25rem; }
.preview-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.iframe-wrap {
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  box-shadow: 0 0 32px rgba(0, 246, 255, 0.1);
}
#previewFrame {
  width: 100%; height: 70vh; min-height: 480px;
  border: 0; display: block; background: #000;
}

/* Templates */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem; margin-top: 1rem;
}
.template-card {
  text-align: left;
  background: rgba(4, 1, 13, 0.65);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 1.1rem; cursor: pointer; color: var(--text);
  display: grid; gap: 0.5rem;
  text-transform: none; letter-spacing: 0; font-size: 0.92rem;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.template-card:hover {
  transform: translateY(-3px);
  border-color: var(--magenta);
  box-shadow: 0 0 28px rgba(255, 43, 214, 0.25);
}
.template-card .tpl-name {
  font-weight: 800; color: var(--neon); letter-spacing: 0.08em;
  text-transform: uppercase; font-size: 0.85rem;
}
.template-card .tpl-prompt { color: var(--muted); font-size: 0.85rem; line-height: 1.45; }
.template-card .tpl-cta { color: var(--lime); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; }

/* Chat */
.chat-card { display: flex; flex-direction: column; min-height: 480px; }
.chat-log {
  flex: 1; overflow-y: auto;
  padding: 1rem; margin: 1rem 0;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line); border-radius: 12px;
  min-height: 300px; max-height: 55vh;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.bubble {
  max-width: 85%; padding: 0.7rem 1rem;
  border-radius: 12px; line-height: 1.45;
  font-size: 0.92rem; white-space: pre-wrap; word-wrap: break-word;
}
.bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(0, 246, 255, 0.18), rgba(138, 43, 255, 0.18));
  border: 1px solid rgba(0, 246, 255, 0.35);
}
.bubble.bot {
  align-self: flex-start;
  background: rgba(255, 43, 214, 0.08);
  border: 1px solid rgba(255, 43, 214, 0.3);
}
.chat-input { display: flex; gap: 0.5rem; }
.chat-input input { flex: 1; }

/* Project grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem; margin-top: 1.25rem;
}
.proj {
  position: relative;
  background: rgba(4, 1, 13, 0.65);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 1.1rem;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.proj:hover {
  transform: translateY(-3px);
  border-color: var(--neon);
  box-shadow: 0 0 28px rgba(0, 246, 255, 0.22);
}
.proj h3 { color: var(--neon); font-size: 1rem; letter-spacing: 0.04em; }
.proj .slug { color: var(--muted); font-size: 0.72rem; }
.proj .meta-line { color: var(--muted); font-size: 0.72rem; display: flex; justify-content: space-between; align-items: center; }
.proj .badge {
  display: inline-block; padding: 0.15rem 0.55rem;
  border-radius: 999px; font-size: 0.65rem; letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(0, 246, 255, 0.08); color: var(--neon);
  border: 1px solid var(--line);
}
.proj .status-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.65rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--lime);
}
.proj .status-badge::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--lime); box-shadow: 0 0 8px var(--lime);
}
.proj .actions {
  display: flex; gap: 0.4rem; margin-top: 0.6rem; flex-wrap: wrap;
}
.proj .actions a, .proj .actions button {
  font-size: 0.7rem; padding: 0.4rem 0.7rem;
  border-radius: 8px; text-decoration: none;
  letter-spacing: 0.06em;
}
.danger {
  background: transparent; color: var(--magenta);
  border: 1px solid rgba(255, 43, 214, 0.4);
}
.danger:hover { background: rgba(255, 43, 214, 0.1); box-shadow: 0 0 14px rgba(255, 43, 214, 0.25); }

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem; margin-top: 1.25rem;
}
.pricing-card {
  position: relative;
  background: rgba(4, 1, 13, 0.7);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 1.5rem 1.25rem;
  display: flex; flex-direction: column; gap: 0.6rem;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 32px rgba(0, 246, 255, 0.2);
  border-color: var(--neon);
}
.pricing-card.featured {
  border-color: var(--magenta);
  box-shadow: 0 0 36px rgba(255, 43, 214, 0.3);
}
.pricing-card.current {
  border-color: var(--lime);
  box-shadow: 0 0 36px rgba(182, 255, 60, 0.28);
  background: rgba(8, 22, 4, 0.7);
}
.pricing-card .ribbon {
  position: absolute; top: -10px; right: 16px;
  background: linear-gradient(90deg, var(--neon), var(--magenta));
  color: #0a0118; padding: 0.2rem 0.7rem;
  border-radius: 999px; font-size: 0.65rem;
  letter-spacing: 0.14em; text-transform: uppercase; font-weight: 800;
}
.pricing-card .ribbon.current-ribbon {
  background: linear-gradient(90deg, var(--lime), var(--neon));
}
.pricing-card .plan-cta:disabled {
  opacity: 0.85; cursor: default;
  background: rgba(182, 255, 60, 0.18);
  color: var(--lime);
  border-color: rgba(182, 255, 60, 0.4);
  box-shadow: none;
}
.plan-pill {
  background: rgba(182, 255, 60, 0.12);
  color: var(--lime);
  border: 1px solid rgba(182, 255, 60, 0.45);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 700; cursor: pointer;
  transition: box-shadow .2s, transform .15s;
}
.plan-pill:hover {
  box-shadow: 0 0 18px rgba(182, 255, 60, 0.35);
  transform: translateY(-1px);
}
.pricing-card h3 { color: var(--neon); font-size: 1.1rem; letter-spacing: 0.06em; }
.pricing-card .plan-tag { color: var(--muted); font-size: 0.85rem; }
.pricing-card .plan-price { font-size: 2.2rem; color: var(--lime); text-shadow: 0 0 12px rgba(182,255,60,.4); }
.pricing-card .plan-price small { font-size: 0.85rem; color: var(--muted); margin-left: 0.2rem; }
.pricing-card .plan-features { list-style: none; padding: 0; display: grid; gap: 0.35rem; margin: 0.5rem 0; }
.pricing-card .plan-features li {
  font-size: 0.85rem; color: var(--text);
  padding-left: 1.2rem; position: relative;
}
.pricing-card .plan-features li::before {
  content: '✦'; color: var(--neon); position: absolute; left: 0;
}
.pricing-card .plan-cta { width: 100%; justify-content: center; margin-top: auto; }
.plan-status {
  margin-top: 1.25rem; padding: 0.85rem 1rem;
  border-radius: 10px; font-size: 0.88rem;
  background: rgba(0, 246, 255, 0.08); color: var(--neon);
  border: 1px solid var(--line);
}
.plan-status.err { background: rgba(255, 43, 214, 0.08); color: var(--magenta); border-color: rgba(255, 43, 214, 0.4); }

/* Auth gate */
.auth-gate {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2.5rem;
  z-index: 50;
  background: radial-gradient(circle at 50% 30%, rgba(138, 43, 255, 0.18), transparent 60%), rgba(4, 1, 13, 0.86);
  backdrop-filter: blur(8px);
  padding: 1.5rem;
  overflow-y: auto;
}

/* Hero strip inside auth gate */
.hero-landing {
  text-align: center;
  max-width: 640px;
  animation: fadeUp 0.55s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
.hero-headline {
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--neon);
  text-shadow: 0 0 24px rgba(0,246,255,.45);
  margin: 0 0 0.6rem;
  line-height: 1.25;
}
.hero-sub {
  font-size: 0.95rem;
  margin: 0 0 1.4rem;
  line-height: 1.6;
}
.hero-cta-row {
  display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap;
}
.hero-cta {
  font-size: 1rem;
  padding: 0.75rem 2rem;
  letter-spacing: 0.06em;
}
.hero-signin {
  font-size: 0.9rem;
  padding: 0.75rem 1.4rem;
}
.auth-shell {
  width: 100%; max-width: 440px;
  padding: 2rem 1.75rem; text-align: center;
}
.auth-brand { display: grid; gap: 0.4rem; margin-bottom: 1.25rem; }
.auth-brand h2 { color: var(--neon); font-size: 1.2rem; letter-spacing: 0.1em; text-transform: uppercase; text-shadow: 0 0 12px rgba(0,246,255,.5); }
.auth-tabs {
  display: inline-flex; gap: 0.4rem;
  padding: 0.3rem; border-radius: 999px;
  border: 1px solid var(--line);
  margin: 0 auto 1rem;
}
.auth-tab {
  background: transparent; color: var(--muted);
  padding: 0.4rem 1rem; border-radius: 999px;
  font-size: 0.78rem; letter-spacing: 0.08em;
  text-transform: uppercase; border: 0; cursor: pointer;
  font-family: inherit;
}
.auth-tab.active { color: var(--neon); background: rgba(0, 246, 255, 0.08); }
.auth-form { display: grid; gap: 0.4rem; text-align: left; }
.auth-form button { margin-top: 1rem; justify-content: center; }
.auth-status {
  margin-top: 0.5rem; padding: 0.6rem 0.8rem;
  border-radius: 8px; font-size: 0.85rem;
}
.auth-status.ok { background: rgba(182,255,60,.1); color: var(--lime); border: 1px solid var(--lime); }
.auth-status.err { background: rgba(255, 43, 214, 0.1); color: var(--magenta); border: 1px solid rgba(255, 43, 214, 0.4); }
.auth-foot { font-size: 0.78rem; margin-top: 1rem; }

/* Edit modal */
.modal {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 60; padding: 1.5rem;
}
.modal[hidden] { display: none !important; }
.modal-shell {
  width: 100%; max-width: 920px;
  max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column; gap: 0.75rem;
  padding: 1.25rem;
}
.edit-tabs { display: flex; gap: 0.4rem; }
.edit-tab {
  background: transparent; color: var(--muted);
  padding: 0.4rem 0.85rem; border-radius: 8px;
  font-size: 0.75rem; letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line); cursor: pointer; font-family: inherit;
}
.edit-tab.active { color: var(--neon); background: rgba(0, 246, 255, 0.08); border-color: var(--line-strong); }
.edit-area {
  flex: 1; min-height: 50vh;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.82rem; line-height: 1.5;
  white-space: pre; overflow: auto;
  background: #050213;
}
.edit-status {
  padding: 0.6rem 0.8rem; border-radius: 8px; font-size: 0.85rem;
}
.edit-status.ok { background: rgba(182,255,60,.1); color: var(--lime); border: 1px solid var(--lime); }
.edit-status.err { background: rgba(255, 43, 214, 0.1); color: var(--magenta); border: 1px solid rgba(255, 43, 214, 0.4); }

/* Publish — visibility badges + modal */
.badge.vis-published { background: rgba(182, 255, 60, .12); color: var(--lime); border: 1px solid var(--lime); }
.badge.vis-draft     { background: rgba(0, 246, 255, .08); color: var(--neon); border: 1px solid rgba(0, 246, 255, .35); }
.badge.vis-private   { background: rgba(255, 43, 214, .1); color: var(--magenta); border: 1px solid rgba(255, 43, 214, .4); }
.public-link { color: var(--neon); text-decoration: none; word-break: break-all; }
.public-link:hover { text-decoration: underline; }
.pub-url-box {
  display: flex; gap: .4rem; align-items: stretch; margin-top: .35rem;
  background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 10px; padding: .35rem;
}
.pub-url-box input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: #e8f4ff;
  font-family: ui-monospace, monospace; font-size: .82rem; padding: .35rem .55rem;
}
.pub-alt-list { display: flex; flex-direction: column; gap: .25rem; margin-top: .35rem; }
.pub-alt-list a { color: var(--neon); text-decoration: none; font-size: .78rem; word-break: break-all; }
.pub-alt-list a:hover { text-decoration: underline; }

/* Chat — autonomous build card */
.chat-project-card {
  display: flex; flex-direction: column; gap: .55rem;
  margin-top: .65rem; padding: .65rem .8rem;
  background: rgba(0, 246, 255, .06);
  border: 1px solid var(--neon); border-radius: 12px;
  box-shadow: 0 0 18px rgba(0, 246, 255, .18);
}
.cpc-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.cpc-actions { display: flex; gap: .45rem; flex-wrap: wrap; }
.cpc-actions .primary, .cpc-actions .ghost {
  font-size: .78rem; padding: .35rem .7rem; border-radius: 999px;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}

/* Future Signals */
.trends-grid { display: grid; gap: 1rem; margin-top: 1rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.trend-card {
  background: rgba(4, 1, 13, 0.6);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 1.1rem; display: flex; flex-direction: column; gap: 0.75rem;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.trend-card:hover { border-color: var(--neon); box-shadow: 0 0 24px rgba(0,246,255,.18); transform: translateY(-2px); }
.trend-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.trend-head h3 { margin: 0; color: var(--neon); font-size: 1.05rem; }
.trend-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; font-size: 0.75rem; }
.pill {
  padding: 0.3rem 0.7rem; border-radius: 999px; border: 1px solid var(--line);
  letter-spacing: .04em; text-transform: uppercase; font-weight: 600;
}
.demand-high { color: var(--lime); border-color: var(--lime); }
.demand-medium { color: var(--neon); border-color: var(--neon); }
.demand-low { color: var(--muted); }
.comp-low { color: var(--lime); border-color: var(--lime); }
.comp-medium { color: var(--neon); border-color: var(--neon); }
.comp-high { color: var(--magenta); border-color: var(--magenta); }
.trend-details { display: flex; flex-direction: column; gap: 0.6rem; padding-top: .25rem; border-top: 1px dashed var(--line); }
.detail-block { display: flex; flex-direction: column; gap: 0.2rem; }
.detail-key { font-size: 0.7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.detail-val { color: var(--text); font-size: 0.92rem; line-height: 1.45; }
.monetization-list { margin: 0.25rem 0 0 1rem; color: var(--text); font-size: 0.9rem; }
.score-row { display: flex; align-items: center; gap: .6rem; }
.score-bar { flex: 1; height: 8px; border-radius: 999px; background: rgba(0,246,255,.08); overflow: hidden; border: 1px solid var(--line); }
.score-fill { height: 100%; background: linear-gradient(90deg, var(--neon), var(--magenta)); box-shadow: 0 0 12px var(--magenta); }
.score-num { color: var(--lime); font-weight: 700; min-width: 2rem; text-align: right; }
.trend-card .actions { display: flex; gap: .5rem; }
.trend-card .actions button { flex: 1; }

/* Admin */
.admin-badge {
  background: linear-gradient(135deg, var(--magenta), var(--neon));
  color: #04010d; font-weight: 800; font-size: 0.65rem;
  letter-spacing: .15em; padding: 0.18rem 0.55rem; border-radius: 999px;
  box-shadow: 0 0 16px rgba(255,43,214,.55);
}
.admin-stats { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 1rem; }
.stat-card {
  background: rgba(0,246,255,.04); border: 1px solid var(--line); border-radius: 14px;
  padding: 0.95rem 1rem; display: flex; flex-direction: column; gap: 0.25rem;
}
.stat-value { font-size: 1.45rem; color: var(--neon); font-weight: 700; text-shadow: 0 0 12px var(--neon); }
.stat-label { font-size: 0.7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.admin-table-wrap { overflow-x: auto; margin-top: 0.5rem; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.admin-table th, .admin-table td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.admin-table th { color: var(--muted); font-size: 0.7rem; letter-spacing: .12em; text-transform: uppercase; }
.admin-table td a { color: var(--neon); text-decoration: none; }
.admin-table td a:hover { text-decoration: underline; }
.admin-plan {
  background: rgba(0,246,255,.05); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 0.3rem 0.5rem; font-family: inherit; font-size: 0.8rem;
}
.badge.ok { color: var(--lime); border-color: var(--lime); }
.badge.warn { color: var(--neon); border-color: var(--neon); }
.badge.danger { color: var(--magenta); border-color: var(--magenta); }
.badge.admin { background: linear-gradient(135deg, var(--magenta), var(--neon)); color: #04010d; }
button.mini.danger {
  background: rgba(255,43,214,.1); color: var(--magenta);
  border: 1px solid var(--magenta); padding: 0.35rem 0.7rem; border-radius: 8px;
  font-size: 0.75rem; cursor: pointer; transition: all .15s;
}
button.mini.danger:hover { background: var(--magenta); color: #04010d; }

/* Settings */
.settings-grid { display: grid; gap: 0.85rem; margin-top: 1rem; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.85rem 1rem;
  background: rgba(4, 1, 13, 0.6);
  border: 1px solid var(--line); border-radius: 12px;
}
.setting-label {
  color: var(--muted); font-size: 0.72rem;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.setting-value { color: var(--text); font-size: 0.95rem; }

/* Footer */
.footer {
  display: flex; justify-content: space-between;
  padding: 1.5rem 2rem; max-width: 1180px;
  margin: 1rem auto 2rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem; color: var(--muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ============================================================
   Trust & Safety / Auth extras
   ============================================================ */
.tos-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  line-height: 1.5;
  margin: 0.15rem 0;
}
.tos-row input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
  accent-color: var(--neon);
  width: 14px;
  height: 14px;
}
.auth-forgot {
  margin-top: 0.45rem;
  font-size: 0.76rem;
  opacity: 0.65;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-forgot:hover { opacity: 1; color: var(--neon); }
.footer-legal {
  font-size: 0.7rem;
  color: var(--muted);
  display: flex;
  gap: 0.3rem;
  align-items: center;
  flex-wrap: wrap;
}
.footer-legal a {
  color: var(--muted);
  text-decoration: none;
}
.footer-legal a:hover { color: var(--neon); }

/* ============================================================
   Help Copilot & Bug Report
   ============================================================ */
.help-fab {
  position: fixed; bottom: 2rem; right: 2rem;
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--neon), var(--magenta));
  color: #04010d; font-size: 1.5rem; font-weight: 800;
  border: none; cursor: pointer; z-index: 900;
  box-shadow: 0 0 24px rgba(0,246,255,.5);
  transition: transform .15s, box-shadow .15s;
  display: flex; align-items: center; justify-content: center;
}
.help-fab:hover { transform: scale(1.1); box-shadow: 0 0 40px rgba(0,246,255,.8); }

.help-panel {
  position: fixed; bottom: 6.5rem; right: 2rem;
  width: 360px; max-height: 600px;
  background: rgba(4,1,13,.97);
  border: 1px solid var(--neon); border-radius: 18px;
  box-shadow: 0 0 40px rgba(0,246,255,.18), 0 8px 32px rgba(0,0,0,.6);
  z-index: 899; flex-direction: column; overflow: hidden;
}
.help-panel:not([hidden]) { display: flex; }
.help-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--line);
  font-size: 0.8rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--neon); flex-shrink: 0;
}
.help-topics {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.help-topic-btn {
  font-size: 0.7rem; padding: 0.28rem 0.6rem; border-radius: 20px;
  border: 1px solid var(--line); background: rgba(0,246,255,.05);
  color: var(--text); cursor: pointer; transition: all .15s; white-space: nowrap;
  font-family: inherit;
}
.help-topic-btn:hover { border-color: var(--neon); color: var(--neon); background: rgba(0,246,255,.1); }
.help-log {
  flex: 1; overflow-y: auto; padding: 0.75rem;
  display: flex; flex-direction: column; gap: 0.55rem;
  min-height: 140px;
}
.help-msg {
  padding: 0.5rem 0.75rem; border-radius: 12px;
  font-size: 0.84rem; line-height: 1.55; max-width: 92%;
}
.help-msg.user {
  align-self: flex-end;
  background: rgba(0,246,255,.12); border: 1px solid rgba(0,246,255,.3);
}
.help-msg.bot {
  align-self: flex-start;
  background: rgba(255,255,255,.05); border: 1px solid var(--line);
}
.help-msg p { margin: 0; }
.help-copy-btn {
  margin-top: 0.45rem; font-size: 0.7rem; padding: 0.28rem 0.65rem;
  border-radius: 8px; border: 1px solid var(--neon);
  background: rgba(0,246,255,.07); color: var(--neon);
  cursor: pointer; transition: all .15s;
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: inherit;
}
.help-copy-btn:hover { background: rgba(0,246,255,.18); }
.help-use-btn {
  margin-top: 0.3rem; font-size: 0.7rem; padding: 0.28rem 0.65rem;
  border-radius: 8px; border: 1px solid var(--magenta);
  background: rgba(255,43,214,.07); color: var(--magenta);
  cursor: pointer; transition: all .15s;
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: inherit;
}
.help-use-btn:hover { background: rgba(255,43,214,.18); }
.help-input {
  display: flex; gap: 0.5rem; padding: 0.55rem 0.75rem;
  border-top: 1px solid var(--line); flex-shrink: 0;
}
.help-input input {
  flex: 1; background: rgba(255,255,255,.05); border: 1px solid var(--line);
  border-radius: 10px; color: var(--text); padding: 0.45rem 0.7rem;
  font-size: 0.84rem; font-family: inherit;
}
.help-input input:focus { outline: none; border-color: var(--neon); }
.help-input button { padding: 0.45rem 0.85rem; font-size: 0.8rem; }
.help-bug-btn {
  margin: 0.4rem auto 0.5rem; display: block;
  font-size: 0.72rem; opacity: 0.7;
}
.help-bug-btn:hover { opacity: 1; }
.bug-form {
  padding: 1rem; display: flex; flex-direction: column; gap: 0.7rem;
  overflow-y: auto; flex: 1;
}
.bug-form label {
  font-size: 0.72rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .1em;
}
.bug-form textarea {
  width: 100%; min-height: 110px; box-sizing: border-box;
  background: rgba(255,255,255,.05); border: 1px solid var(--line);
  border-radius: 10px; color: var(--text);
  padding: 0.65rem 0.75rem; font-size: 0.84rem;
  resize: vertical; font-family: inherit;
}
.bug-form textarea:focus { outline: none; border-color: var(--neon); }

/* Responsive */
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; gap: 0.75rem; padding: 0.9rem 1rem; }
  .tabs { order: 3; width: 100%; justify-content: center; }
  .user-pill { margin-left: auto; }
  main { padding: 1rem; }
  .card { padding: 1.25rem; }
  #previewFrame { height: 60vh; }
  .help-panel { right: 0.5rem; left: 0.5rem; width: auto; bottom: 5.5rem; }
  .help-fab { bottom: 1rem; right: 1rem; }
}
