.hidden { display: none !important; }

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

:root {
  --black: #000000;
  --white: #ffffff;
  --gray-50:  #f8f8f8;
  --gray-100: #f0f0f0;
  --gray-150: #e8e8e8;
  --gray-200: #e0e0e0;
  --gray-300: #c8c8c8;
  --gray-400: #9a9a9a;
  --gray-500: #6e6e6e;
  --gray-600: #4e4e4e;
  --gray-700: #3a3a3a;
  --gray-800: #242424;
  --gray-900: #141414;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 999px;

  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font);
  background-color: var(--white);
  color: var(--black);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
}

img { display: block; max-width: 100%; }

/* ─── Entry animation ──────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
  opacity: 0;
  animation: fade-up 0.55s var(--ease-out) forwards;
  animation-delay: var(--delay, 0s);
}


/* ─── Landing Nav ──────────────────────────────────────── */
.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 0 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255,255,255,0.8);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.landing-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  max-width: 1024px;
  margin: 0 auto;
}

.nav-cta {
  height: 34px;
  padding: 0 16px;
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.1px;
  transition: opacity 0.15s var(--ease);
}

.nav-cta:hover { opacity: 0.78; }


/* ─── Auth Page ────────────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--white);
  position: relative;
  overflow: hidden;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,0,0,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 100%);
  pointer-events: none;
}

.auth-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  padding: 96px 24px 64px;
  max-width: 520px;
  width: 100%;
}

/* Hero badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  letter-spacing: 0.1px;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--black);
  flex-shrink: 0;
}

/* Logo */
.logo-lockup {
  display: flex;
  align-items: center;
  gap: 9px;
  user-select: none;
}

.logo-mark {
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-text {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--black);
}

/* Hero */
.hero { text-align: center; }

.hero-headline {
  font-size: clamp(44px, 9vw, 64px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--black);
  margin-bottom: 18px;
}

.hero-sub {
  font-size: 17px;
  font-weight: 400;
  color: var(--gray-500);
  line-height: 1.65;
  max-width: 380px;
  margin: 0 auto;
  letter-spacing: -0.01em;
}

/* Sign-in */
.sign-in-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 300px;
  height: 50px;
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.2px;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
  position: relative;
  overflow: hidden;
}

.btn-google:hover { opacity: 0.84; transform: translateY(-1px); }
.btn-google:active { opacity: 1; transform: translateY(0); }
.btn-google.loading { pointer-events: none; opacity: 0.45; }
.google-icon { flex-shrink: 0; }

.sign-in-note {
  font-size: 12px;
  color: var(--gray-400);
  text-align: center;
  letter-spacing: 0.1px;
}

.sign-in-note a {
  color: var(--gray-600);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sign-in-note a:hover { color: var(--black); }

/* Feature pills */
.feature-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
  background: var(--white);
  letter-spacing: 0.05px;
}


/* ─── Dashboard Page ───────────────────────────────────── */
.dashboard-page {
  display: flex;
  min-height: 100vh;
  background: var(--gray-50);
}

/* Sidebar */
.sidebar {
  width: 216px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--gray-150);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 10;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  margin-bottom: 28px;
  user-select: none;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  letter-spacing: -0.1px;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}

.nav-item:hover {
  background: var(--gray-100);
  color: var(--black);
}

.nav-item.active {
  background: var(--black);
  color: var(--white);
}

.nav-item svg { flex-shrink: 0; opacity: 0.85; }

/* Sidebar bottom */
.sidebar-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--gray-100);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gray-150);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.1px;
}

.user-email {
  font-size: 11px;
  color: var(--gray-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-sign-out {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  color: var(--gray-400);
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}

.btn-sign-out:hover { background: var(--gray-100); color: var(--black); }

/* Main content */
.main-content {
  margin-left: 216px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 44px 48px 28px;
  gap: 16px;
}

.page-title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.7px;
  color: var(--black);
  line-height: 1.2;
}

.page-sub {
  font-size: 13px;
  color: var(--gray-400);
  margin-top: 4px;
  letter-spacing: -0.05px;
}

/* Buttons */
.btn-new {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.1px;
  transition: opacity 0.15s var(--ease), transform 0.15s var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-new:hover { opacity: 0.82; transform: translateY(-1px); }
.btn-new:active { opacity: 1; transform: translateY(0); }

/* Businesses grid */
.businesses-grid {
  flex: 1;
  padding: 0 48px 48px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  align-content: start;
}

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  gap: 14px;
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-300);
  margin-bottom: 4px;
}

.empty-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--black);
}

.empty-body {
  font-size: 14px;
  color: var(--gray-400);
  max-width: 280px;
  line-height: 1.6;
  letter-spacing: -0.05px;
}

/* Business card */
.business-card {
  background: var(--white);
  border: 1px solid var(--gray-150);
  border-radius: var(--radius-lg);
  padding: 22px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.biz-delete-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--gray-400);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease);
  z-index: 1;
}

.business-card:hover .biz-delete-btn {
  opacity: 1;
}

.biz-delete-btn:hover {
  background: #fee2e2;
  color: #dc2626;
  opacity: 1;
}

.business-card:hover {
  border-color: var(--gray-300);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.07);
}

.business-card-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--black);
  margin-bottom: 6px;
}

.business-card-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-300);
  flex-shrink: 0;
}

.status-dot--live { background: #22c55e; }
.status-dot--building { background: var(--black); animation: pulse 1.5s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}


/* Business card dynamic content */
.business-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.business-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--black);
}

.business-status {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 980px;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-idea     { background: #f5f5f7; color: var(--gray-600); }
.status-building { background: #1d1d1f; color: #fff; }
.status-live     { background: #dcfce7; color: #166534; }

.business-excerpt {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.5;
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.business-card-footer {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.biz-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}

.biz-btn:hover { opacity: 0.75; }

.biz-btn--secondary {
  background: #f5f5f7;
  color: var(--gray-700);
}

.biz-btn--primary {
  background: var(--black);
  color: #fff;
}

/* ─── Launches grid ───────────────────────────────────── */
.launches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 28px 32px;
  align-content: start;
}

.launch-card {
  background: var(--white);
  border: 1px solid var(--gray-150);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.15s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.launch-card:hover {
  border-color: var(--gray-300);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.07);
}

.launch-preview {
  position: relative;
  height: 180px;
  background: #f5f5f7;
  overflow: hidden;
}

.launch-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.launch-preview--failed {
  background: linear-gradient(135deg, #f0f0f2 0%, #e8e8ea 100%);
}

.launch-preview--failed::after {
  content: "Preview unavailable";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--gray-400);
}

.launch-preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s var(--ease);
}

.launch-card:hover .launch-preview-overlay {
  opacity: 1;
}

.launch-card-body {
  padding: 16px 18px 18px;
}

.launch-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.launch-url {
  font-size: 12px;
  color: var(--gray-400);
  text-decoration: none;
  display: block;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.launch-url:hover { color: var(--gray-600); text-decoration: underline; }

/* ─── Modal ────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  animation: fade-in 0.18s var(--ease);
}

.modal-overlay.hidden { display: none; }

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 460px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.14), 0 4px 16px rgba(0,0,0,0.06);
  animation: modal-in 0.28s var(--ease-spring);
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 22px 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--black);
}

.modal-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  color: var(--gray-400);
  transition: background 0.12s, color 0.12s;
}

.modal-close:hover { background: var(--gray-100); color: var(--black); }

.modal-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.field-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 7px;
  display: block;
  letter-spacing: -0.05px;
}

.idea-textarea, .repo-input {
  width: 100%;
  padding: 11px 13px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  color: var(--black);
  line-height: 1.6;
  outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.idea-textarea { resize: vertical; }
.repo-input { height: 42px; }

.idea-textarea::placeholder, .repo-input::placeholder { color: var(--gray-400); }

.idea-textarea:focus, .repo-input:focus {
  border-color: var(--gray-400);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
  background: var(--white);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 22px 22px;
}

.btn-cancel {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  transition: background 0.12s, color 0.12s;
}

.btn-cancel:hover { background: var(--gray-100); color: var(--black); }

.btn-launch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 16px;
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.1px;
  transition: opacity 0.15s var(--ease), transform 0.15s var(--ease);
}

.btn-launch:hover { opacity: 0.82; transform: translateY(-1px); }
.btn-launch:active { opacity: 1; transform: translateY(0); }

/* ─── Choice Cards ────────────────────────────────────── */
.choice-cards {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.choice-card {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 15px 16px;
  border: 1.5px solid var(--gray-150);
  border-radius: var(--radius-md);
  background: var(--white);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s var(--ease), background 0.12s, transform 0.15s var(--ease);
}

.choice-card:hover {
  border-color: var(--black);
  background: var(--gray-50);
  transform: translateY(-1px);
}

.choice-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-700);
  flex-shrink: 0;
  transition: background 0.12s;
}

.choice-card:hover .choice-icon { background: var(--gray-150); }

.choice-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.choice-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--black);
  letter-spacing: -0.2px;
}

.choice-sub { font-size: 12px; color: var(--gray-400); }

.choice-arrow {
  color: var(--gray-300);
  flex-shrink: 0;
  transition: color 0.12s, transform 0.15s var(--ease);
}

.choice-card:hover .choice-arrow {
  color: var(--gray-600);
  transform: translateX(2px);
}

.modal-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--gray-400);
  margin-bottom: 18px;
  padding: 4px 0;
  transition: color 0.12s;
}

.modal-back:hover { color: var(--black); }


/* ─── New Business Page (chat + canvas) ─────────────────── */
.new-page {
  height: 100vh;
  overflow: hidden;
  background: var(--white);
  display: flex;
  flex-direction: column;
}

.chat-back {
  position: fixed;
  top: 18px;
  left: 22px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--gray-400);
  padding: 6px 0;
  transition: color 0.12s;
  letter-spacing: -0.05px;
}

.chat-back:hover { color: var(--black); }

/* Two-panel layout */
.new-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
  transition: all 0.42s var(--ease-out);
}

/* Chat panel */
.new-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.new-hero {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 32px 120px;
  gap: 14px;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
}

.new-hero.hero-gone {
  opacity: 0;
  transform: translateY(-14px);
  pointer-events: none;
}

.new-hero-logo { color: var(--black); }

.new-hero-headline {
  font-size: clamp(26px, 3.8vw, 42px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: var(--black);
}

.new-hero-sub {
  font-size: 15px;
  color: var(--gray-400);
  max-width: 360px;
  line-height: 1.65;
  letter-spacing: -0.01em;
}

/* Scrollable messages */
.new-messages-wrap {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.new-messages-wrap::-webkit-scrollbar { width: 0; }

.new-messages {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 80px 24px 24px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

/* Messages */
.msg {
  display: flex;
  animation: msg-in 0.22s var(--ease);
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg--user { justify-content: flex-end; }
.msg--agent { justify-content: flex-start; flex-direction: column; gap: 8px; }

.msg-bubble {
  background: var(--black);
  color: var(--white);
  padding: 10px 15px;
  border-radius: 17px;
  border-bottom-right-radius: 4px;
  font-size: 14.5px;
  line-height: 1.55;
  max-width: 76%;
  white-space: pre-wrap;
  word-break: break-word;
  letter-spacing: -0.1px;
}

.agent-text {
  font-size: 15px;
  line-height: 1.72;
  color: var(--black);
  max-width: 100%;
  letter-spacing: -0.1px;
}

.agent-text p { margin-bottom: 12px; }
.agent-text p:last-child { margin-bottom: 0; }
.agent-text strong { font-weight: 600; }
.agent-text ul, .agent-text ol { padding-left: 20px; margin-bottom: 12px; }
.agent-text li { margin-bottom: 4px; }
.agent-text h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; margin-top: 16px; letter-spacing: -0.3px; }

.agent-error {
  font-size: 14px;
  color: #b91c1c;
  padding: 8px 0;
}

/* Thinking dots */
.thinking-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 0 4px;
}

.thinking-dots span {
  width: 6px;
  height: 6px;
  background: var(--gray-300);
  border-radius: 50%;
  animation: dot-pulse 1.4s infinite ease-in-out;
}

.thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.thinking-dots span:nth-child(2) { animation-delay: -0.16s; }
.thinking-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes dot-pulse {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.3; }
  40% { transform: scale(1.2); opacity: 1; }
}

/* Search card */
.search-card {
  display: inline-flex;
  flex-direction: column;
  gap: 9px;
  background: var(--gray-50);
  border: 1px solid var(--gray-150);
  border-radius: 12px;
  padding: 10px 13px;
  max-width: 90%;
  animation: msg-in 0.22s var(--ease);
  transition: opacity 0.25s, transform 0.25s;
}

.search-card--collapsing { opacity: 0.45; transform: scale(0.98); }
.search-card--inline { margin-bottom: 6px; }

.search-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.search-spinner {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--gray-300);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}

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

.search-label {
  font-size: 12.5px;
  color: var(--gray-500);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.source-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.source-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--gray-600);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  transition: border-color 0.1s, color 0.1s;
  animation: chip-in 0.2s var(--ease) both;
}

.source-chip:hover { border-color: var(--gray-400); color: var(--black); }

@keyframes chip-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Input bar */
.new-input-bar {
  flex-shrink: 0;
  padding: 10px 22px 20px;
  background: linear-gradient(to top, var(--white) 80%, transparent);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.new-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  width: 100%;
  max-width: 640px;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 20px;
  padding: 10px 10px 10px 16px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.07);
  transition: border-color 0.14s, box-shadow 0.14s;
}

.new-input-wrap:focus-within {
  border-color: var(--gray-400);
  box-shadow: 0 4px 24px rgba(0,0,0,0.1);
}

.new-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 15px;
  color: var(--black);
  line-height: 1.55;
  resize: none;
  max-height: 160px;
  overflow-y: auto;
  letter-spacing: -0.1px;
}

.new-input::placeholder { color: var(--gray-300); }

.new-send {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  background: var(--black);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s, transform 0.15s;
}

.new-send:disabled { opacity: 0.15; cursor: default; }
.new-send:not(:disabled):hover { opacity: 0.78; transform: scale(1.07); }

.new-input-note {
  font-size: 11px;
  color: var(--gray-300);
  letter-spacing: 0.1px;
}

/* Canvas panel */
.canvas-panel {
  width: 0;
  flex-shrink: 0;
  overflow: hidden;
  transition:
    width 0.42s var(--ease-out),
    padding 0.42s var(--ease-out),
    opacity 0.32s ease;
  opacity: 0;
  padding: 0;
}

.canvas-open .canvas-panel {
  width: 540px;
  opacity: 1;
  padding: 12px 16px 12px 6px;
}

.canvas-card {
  width: 100%;
  height: 100%;
  background: var(--white);
  border-radius: 18px;
  border: 1px solid var(--gray-150);
  box-shadow: 0 8px 40px rgba(0,0,0,0.07), 0 2px 6px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.canvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px 13px 17px;
  border-bottom: 1px solid var(--gray-100);
  flex-shrink: 0;
}

.canvas-header-left {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--gray-600);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.1px;
  overflow: hidden;
}

.canvas-header-left svg { flex-shrink: 0; color: var(--gray-400); }

#canvas-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.canvas-close-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  color: var(--gray-400);
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}

.canvas-close-btn:hover { background: var(--gray-100); color: var(--black); }

.canvas-build-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius-xs);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: -0.1px;
  transition: opacity 0.15s var(--ease);
  animation: fade-up 0.3s var(--ease-out);
}

.canvas-build-btn:hover { opacity: 0.78; }

.canvas-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px;
}

.canvas-body::-webkit-scrollbar { width: 4px; }
.canvas-body::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 2px; }

.canvas-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.canvas-placeholder p {
  font-size: 13px;
  color: var(--gray-300);
  max-width: 200px;
  line-height: 1.6;
}

.canvas-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 14px;
}

.canvas-loading p {
  font-size: 12.5px;
  color: var(--gray-400);
}

.canvas-dots { display: flex; gap: 5px; }

.canvas-dots span {
  width: 5px;
  height: 5px;
  background: var(--gray-300);
  border-radius: 50%;
  animation: dot-pulse 1.4s infinite ease-in-out;
}

.canvas-dots span:nth-child(1) { animation-delay: -0.32s; }
.canvas-dots span:nth-child(2) { animation-delay: -0.16s; }
.canvas-dots span:nth-child(3) { animation-delay: 0s; }

/* PRD body */
.prd-body h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.7px;
  color: var(--black);
  margin: 0 0 22px;
  line-height: 1.2;
}

.prd-body h2 {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--gray-400);
  margin: 26px 0 9px;
}

.prd-body h2:first-of-type { margin-top: 0; }

.prd-body p {
  font-size: 13.5px;
  line-height: 1.68;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.prd-body ul {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.prd-body li {
  font-size: 13px;
  line-height: 1.6;
  color: var(--gray-700);
  padding-left: 14px;
  position: relative;
}

.prd-body li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--gray-300);
}

.prd-body strong { color: var(--black); font-weight: 600; }


/* ─── Build Page ───────────────────────────────────────── */
.build-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--gray-50);
}

/* Build header */
.build-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-150);
  flex-shrink: 0;
  z-index: 10;
}

.build-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.build-back {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  color: var(--gray-400);
  transition: background 0.12s, color 0.12s;
}

.build-back:hover { background: var(--gray-100); color: var(--black); }

.build-header-logo {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--black);
  letter-spacing: -0.3px;
}

.build-divider {
  width: 1px;
  height: 18px;
  background: var(--gray-200);
}

.build-title-wrap {
  display: flex;
  align-items: center;
}

.build-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gray-700);
  letter-spacing: -0.2px;
}

.build-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.build-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--gray-600);
}

.build-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gray-300);
  flex-shrink: 0;
}

.build-status-dot--active {
  background: var(--black);
  animation: pulse 1.4s ease-in-out infinite;
}

.build-status-dot--done { background: #22c55e; animation: none; }
.build-status-dot--error { background: #ef4444; animation: none; }
.build-status-dot--paused { background: var(--gray-400); animation: none; }

.build-pause-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xs);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--gray-600);
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.build-pause-btn:hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
  color: var(--black);
}

/* Build layout */
.build-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
  gap: 0;
}

/* Build left */
.build-left {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-right: 1px solid var(--gray-150);
  overflow: hidden;
}

/* Pipeline */
.pipeline {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--gray-100);
  flex-shrink: 0;
}

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

.pipeline-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--gray-400);
}

.pipeline-pct {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  font-variant-numeric: tabular-nums;
}

.pipeline-track {
  height: 2px;
  background: var(--gray-100);
  border-radius: 1px;
  margin-bottom: 20px;
  overflow: hidden;
}

.pipeline-progress {
  height: 100%;
  background: var(--black);
  border-radius: 1px;
  transition: width 0.6s var(--ease-out);
}

.pipeline-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pipeline-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 0;
}

.step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  gap: 0;
}

.step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.step-num {
  font-size: 10px;
  font-weight: 600;
  color: var(--gray-400);
}

.step-check { display: none; }

.step-connector {
  width: 1.5px;
  height: 26px;
  background: var(--gray-150);
  margin: 2px 0;
}

.step-body {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.step-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  letter-spacing: -0.1px;
  line-height: 1.3;
  transition: color 0.15s;
}

.step-sub {
  display: block;
  font-size: 11px;
  color: var(--gray-300);
  margin-top: 2px;
  line-height: 1.4;
}

.step-status-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 3px;
  transition: all 0.2s;
}

.step-badge--pending { background: var(--gray-50); color: var(--gray-300); }
.step-badge--active { background: var(--black); color: var(--white); }
.step-badge--done { background: var(--gray-100); color: var(--gray-600); }
.step-badge--error { background: #fee2e2; color: #b91c1c; }

/* Active step */
.pipeline-step--active .step-dot {
  border-color: var(--black);
  background: var(--black);
}

.pipeline-step--active .step-dot .step-num { color: var(--white); }
.pipeline-step--active .step-label { color: var(--black); font-weight: 600; }

/* Done step */
.pipeline-step--done .step-dot {
  border-color: var(--black);
  background: var(--black);
}

.pipeline-step--done .step-check { display: block; color: var(--white); }
.pipeline-step--done .step-num { display: none; }
.pipeline-step--done .step-label { color: var(--gray-500); }
.pipeline-step--done .step-connector { background: var(--black); }

/* Error step */
.pipeline-step--error .step-dot {
  border-color: #ef4444;
  background: #fef2f2;
}

.pipeline-step--error .step-num { color: #ef4444; }
.pipeline-step--error .step-label { color: #b91c1c; }

/* Build log */
.build-log {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.build-log-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 20px 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--gray-400);
  border-bottom: 1px solid var(--gray-100);
  flex-shrink: 0;
}

.build-log-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.build-log-body::-webkit-scrollbar { width: 0; }

.log-entry {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 12px;
  line-height: 1.5;
  animation: msg-in 0.15s var(--ease);
}

.log-ts {
  font-size: 10.5px;
  color: var(--gray-300);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  letter-spacing: 0.2px;
}

.log-text { color: var(--gray-600); }
.log-entry--success .log-text { color: var(--gray-700); }
.log-entry--error .log-text { color: #b91c1c; }
.log-entry--info .log-text { color: var(--gray-600); }

/* Playwright Click Area (Remote Viewport) */
#browser-screenshot {
  cursor: crosshair;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

/* ── Interactive Chat Overlay ── */
.interactive-chat-overlay {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 540px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(52px) saturate(180%);
  -webkit-backdrop-filter: blur(52px) saturate(180%);
  border-radius: 26px;
  border: 0.5px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 1) inset,
    0 24px 48px rgba(0, 0, 0, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.06);
  padding: 7px 7px 7px 18px;
  z-index: 100;
  animation: slide-up-chat 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

#chat-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

#chat-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 14.5px;
  color: var(--black);
  padding: 8px 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  letter-spacing: -0.1px;
}

#chat-input::placeholder { color: rgba(0, 0, 0, 0.35); }

#chat-submit {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1c1c1e;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25), 0 1px 0 rgba(255,255,255,0.08) inset;
}

#chat-submit:hover {
  opacity: 0.82;
  transform: scale(1.07);
}

#chat-submit:active {
  transform: scale(0.95);
  opacity: 1;
}

/* ── Browser setup modal ── */
.bsetup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.bsetup-card {
  background: #fff;
  border: 1px solid var(--gray-150);
  border-radius: 20px;
  width: min(900px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,0.22);
  overflow: hidden;
}

.bsetup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-150);
  gap: 16px;
}

.bsetup-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bsetup-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f5f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-700);
  flex-shrink: 0;
}

.bsetup-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--gray-900);
  margin: 0 0 2px;
}

.bsetup-sub {
  font-size: 12px;
  color: var(--gray-500);
  margin: 0;
}

.bsetup-skip {
  font-size: 13px;
  color: var(--gray-500);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.bsetup-skip:hover { background: #f5f5f7; color: var(--gray-700); }

.bsetup-steps {
  display: flex;
  gap: 0;
  padding: 12px 24px;
  border-bottom: 1px solid var(--gray-150);
  background: #fafafa;
}

.bsetup-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--gray-400);
  flex: 1;
  position: relative;
  cursor: pointer;
  transition: color 0.15s;
  user-select: none;
}
.bsetup-step:hover:not(.bsetup-step--active) {
  color: var(--gray-600);
}

.bsetup-step + .bsetup-step::before {
  content: "→";
  margin-right: 8px;
  color: var(--gray-300);
}

.bsetup-step--active { color: var(--gray-800); font-weight: 500; }
.bsetup-step--done   { color: #22c55e; }

.bsetup-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: currentColor;
  color: #fff;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.bsetup-step--done .bsetup-step-num {
  background: #22c55e;
  font-size: 0; /* hide number */
}
.bsetup-step--done .bsetup-step-num::after {
  content: "✓";
  font-size: 11px;
  color: #fff;
}
.bsetup-step--active .bsetup-step-num { background: var(--gray-900); }
.bsetup-step:not(.bsetup-step--active):not(.bsetup-step--done) .bsetup-step-num {
  background: var(--gray-200);
  color: var(--gray-400);
}

.bsetup-browser {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.bsetup-browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #f0f0f5;
  border-bottom: 1px solid var(--gray-150);
}

.bsetup-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.bsetup-url {
  font-size: 12px;
  color: var(--gray-600);
  margin-left: 8px;
  font-family: monospace;
  flex: 1;
}

/* navbtns removed — steps drive navigation now */

.bsetup-browser-body {
  flex: 1;
  position: relative;
  background: #000;
  min-height: 420px;
}

.bsetup-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  min-height: 420px;
}

.bsetup-screenshot {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: contain;
  display: block;
  outline: none;
}
.bsetup-screenshot:focus {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.bsetup-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
  color: var(--gray-400);
  gap: 12px;
  font-size: 13px;
}

.bsetup-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: rgba(255,255,255,0.7);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.bsetup-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid var(--gray-150);
  gap: 16px;
  flex-wrap: wrap;
}

.bsetup-footer > :last-child:not(:first-child) {
  margin-left: auto;
}

.bsetup-hint {
  font-size: 12px;
  color: var(--gray-500);
  margin: 0;
}

.bsetup-done-btn {
  padding: 10px 22px;
  background: var(--gray-900);
  color: #fff;
  border: none;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.bsetup-done-btn:hover  { opacity: 0.85; }
.bsetup-done-btn:disabled { opacity: 0.5; cursor: default; }

/* ── Thought block ── */
.log-thought {
  margin: 6px 0;
  padding: 10px 12px;
  background: #fafaf5;
  border: 1px solid #e8e8d8;
  border-left: 3px solid #c8b96e;
  border-radius: 8px;
  font-size: 12px;
  color: var(--gray-600);
  font-style: italic;
}

.log-thought-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a0893a;
  margin-bottom: 4px;
  font-style: normal;
}

.log-thought-text {
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Log Cards ── */
.log-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--white);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid var(--gray-150);
  animation: slide-in-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  margin-bottom: 6px;
}

.log-card.user {
  background: #f5f5f7;
  border-color: #d2d2d7;
}

.log-card-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #f5f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--black);
  flex-shrink: 0;
  margin-top: 2px;
}

.log-card.click .log-card-icon { background: #e8f2ff; color: #0071e3; }
.log-card.type .log-card-icon { background: #fdf2f8; color: #ec4899; }
.log-card.nav .log-card-icon { background: #f0fdf4; color: #22c55e; }
.log-card.scroll .log-card-icon { background: #fefce8; color: #eab308; }
.log-card.ask .log-card-icon { background: #f3e8ff; color: #a855f7; }
.log-card.user .log-card-icon { background: #e5e5ea; color: #1d1d1f; }

.log-card-content {
  flex: 1;
  font-size: 13px;
  color: var(--gray-800);
  line-height: 1.4;
  word-break: break-word;
}

.log-card-title {
  font-weight: 600;
  margin-bottom: 3px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
}

@keyframes slide-in-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Build right */
.build-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  padding: 16px;
  background: var(--gray-50);
  min-width: 0;
}

/* Browser chrome */
.browser-chrome {
  height: 100%;
  max-width: 100%;
  aspect-ratio: 16/10;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fdfdfd;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 20px 60px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.02);
  overflow: hidden;
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  height: 52px;
  background: #fdfdfd;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.browser-bar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.browser-dots {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.browser-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.1);
}
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.browser-url-wrap {
  flex: 1;
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 32px;
  background: rgba(0,0,0,0.04);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--gray-500);
}

.browser-url {
  font-size: 13px;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.1px;
}

.browser-bar-actions {
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.browser-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--gray-200);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

.browser-viewport {
  width: 100%;
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: var(--white);
}

.browser-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 40px;
}

.browser-placeholder-icon { color: var(--gray-200); }

.browser-placeholder p {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-400);
  letter-spacing: -0.2px;
}

.browser-placeholder-sub {
  font-size: 12.5px;
  font-weight: 400 !important;
  color: var(--gray-300) !important;
  max-width: 240px;
}

.browser-screenshot {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}


/* ─── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    flex-direction: row;
    align-items: center;
    padding: 10px 14px;
    border-right: none;
    border-bottom: 1px solid var(--gray-150);
  }

  .sidebar-logo { margin-bottom: 0; margin-right: auto; }
  .sidebar-nav { flex-direction: row; flex: none; gap: 2px; }
  .nav-item span { display: none; }
  .sidebar-bottom { padding-top: 0; border-top: none; }
  .user-details { display: none; }
  .main-content { margin-left: 0; }
  .topbar { padding: 22px 22px 18px; }
  .businesses-grid { padding: 0 22px 28px; grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .canvas-open .canvas-panel {
    position: fixed;
    right: 0; top: 0; bottom: 0;
    width: min(460px, 90vw) !important;
    padding: 12px 12px 12px 6px;
    z-index: 20;
    background: transparent;
  }

  .build-left { width: 280px; }
}

/* ── Stitch Design Screen Label ────────────────────────── */
.design-screen-label {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 20px;
  pointer-events: none;
  z-index: 40;
  white-space: nowrap;
}

/* ── Intervention Overlay ──────────────────────────────── */
.intervention-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--gray-900);
  z-index: 50;
  border-radius: inherit;
  overflow: hidden;
}

.intervention-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #1a1000;
  border-bottom: 1px solid #3a2800;
  color: #f5a623;
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
}

.intervention-header svg {
  color: #f5a623;
  flex-shrink: 0;
}

#intervention-iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
}

.intervention-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--gray-800);
  border-top: 1px solid var(--gray-700);
  flex-shrink: 0;
}

.intervention-hint {
  font-size: 12px;
  color: var(--gray-400);
}

.intervention-continue-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--black);
  color: var(--white);
  border: 1px solid var(--gray-600);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.intervention-continue-btn:hover {
  background: var(--gray-800);
  border-color: var(--gray-400);
}

@media (max-width: 640px) {
  .build-left {
    display: none;
  }
}

/* ── Marketing Hub Elements ────────────────────────────────── */

.marketing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  width: 100%;
}

.marketing-card {
  display: flex;
  flex-direction: column;
  padding: 32px;
  border-radius: 20px;
  background: var(--white);
  border: 1px solid rgba(0, 0, 0, 0.04);
  text-decoration: none;
  color: var(--black);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02), inset 0 1px 0 rgba(255, 255, 255, 1);
  transition: transform 0.4s var(--bouncy-bezier), box-shadow 0.4s var(--bouncy-bezier), border-color 0.4s;
}

.marketing-card.glassmorphism {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.marketing-card.bounce-hover:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.08);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gradient-lavender {
  background: linear-gradient(135deg, #A886FF, #8A5AFE);
}

.gradient-blue {
  background: linear-gradient(135deg, #4A90E2, #1C6FE0);
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--black);
}

.card-description {
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray-500);
}

/* ── View tab bar (lives inside browser-bar) ────────────────────────── */
.build-view-tabs {
  display: flex;
  gap: 2px;
  padding: 2px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 7px;
  width: fit-content;
  flex-shrink: 0;
}

.bvt-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
  background: transparent;
  cursor: pointer;
  transition: all 0.14s var(--ease);
  letter-spacing: -0.1px;
}

.bvt-btn--active {
  background: var(--white);
  color: var(--gray-800);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 0 0 0.5px rgba(0,0,0,0.04);
}

/* ── Design Gallery (Stitch phase) ──────────────────────────────────── */
.design-gallery {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  min-height: 0;
}

.design-gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 20px 0;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 20px;
  flex-shrink: 0;
}

.design-gallery-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
}

.design-gallery-subtitle {
  font-size: 12px;
  color: var(--gray-400);
}

.design-skip-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.design-skip-btn:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}

.design-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  flex: 1;
  align-content: start;
}

.design-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* iframe preview inside card */
.design-card-preview {
  position: relative;
  width: 100%;
  overflow: hidden;
  cursor: pointer;
  background: var(--white);
  border-radius: 8px 8px 0 0;
  /* height set dynamically by JS */
}

.design-card-preview--img img {
  width: 100%;
  height: auto;
  display: block;
}

.design-card-scaler {
  position: absolute;
  top: 0;
  left: 0;
  width: 1440px;
  height: 900px;
  transform-origin: top left;
  pointer-events: none;
  /* transform: scale(X) set by JS */
}

.design-card-hover-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: background 0.18s;
}

.design-card-hover-overlay span {
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
  background: rgba(0,0,0,0.55);
  padding: 5px 14px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.18s;
  letter-spacing: 0.01em;
}

.design-card-preview:hover .design-card-hover-overlay {
  background: rgba(0,0,0,0.08);
}

.design-card-preview:hover .design-card-hover-overlay span {
  opacity: 1;
}

.design-card-label {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
  border-top: 1px solid var(--gray-150);
  background: var(--gray-50);
}

/* Skeleton loading state */
.design-card--skeleton .design-card-skeleton-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(90deg, var(--gray-150) 25%, var(--gray-100) 50%, var(--gray-150) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

#browser-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 0;
}

/* ── Design preview modal ────────────────────────────────────────────── */
.design-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.design-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
}

.design-modal-box {
  position: relative;
  z-index: 1;
  width: 90vw;
  height: 90vh;
  max-width: 1440px;
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 40px 80px rgba(0,0,0,0.45);
}

.design-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
  background: var(--gray-50);
}

.design-modal-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
}

.design-modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--gray-500);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.design-modal-close:hover {
  background: var(--gray-150);
  color: var(--gray-900);
}

.design-modal-iframe {
  flex: 1;
  width: 100%;
  border: none;
  display: block;
}
