/* ============================================================
   STOREFRONT AI — Enterprise UI Design System (v2.0)
   Silicon Valley Standard | Linear & Vercel-inspired Architecture
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@600;700&display=swap');

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

:root {
  /* ── Base / Background ── */
  --bg-primary:     #FAFAFA;
  --bg-secondary:   #F5F5F4;
  --bg-elevated:    #FFFFFF;
  --bg-hover:       #F4F4F5;
  --bg-active:      #E4E4E7;
  --bg-input:       #FFFFFF;

  /* ── Text ── */
  --text-primary:   #18181B;
  --text-secondary: #52525B;
  --text-tertiary:  #71717A;
  --text-muted:     #A1A1AA;
  --text-inverse:   #FFFFFF;

  /* ── Borders / Dividers ── */
  --border-default: #E4E4E7;
  --border-strong:  #D4D4D8;
  --border-subtle:  #F0F0F1;

  /* ── Primary Accent (CTAs, active states, links, focus rings only) ── */
  --accent-primary:        #1D4ED8;
  --accent-primary-hover:  #1E40AF;
  --accent-primary-subtle: #EFF6FF;
  --accent-primary-border: #BFDBFE;
  --focus-ring:            rgba(29, 78, 216, 0.28);

  /* ── Semantic ── */
  --color-success:    #15803D;
  --color-warning:    #B45309;
  --color-error:      #B91C1C;
  --color-success-bg: #F0FDF4;
  --color-warning-bg: #FFFBEB;
  --color-error-bg:   #FEF2F2;

  /* ── Button Tokens (flat, no gradients) ── */
  --btn-primary-bg:    var(--accent-primary);
  --btn-primary-text:  #FFFFFF;
  --btn-primary-hover: var(--accent-primary-hover);

  /* ── Typography ── */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif; /* marketing headlines only */
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* ── Radius Scale ──
     6px  small elements (badges, chips)
     8px  buttons & inputs
     12px cards & modals */
  --r-sm:   6px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-xl:   12px;
  --r-2xl:  12px;
  --r-full: 9999px; /* tags/chips only */

  /* ── Shadows (single-layer, subtle) ── */
  --shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md:    0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg:    0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-modal: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-glow:  none; /* retired: neon glows removed */

  /* ── Dark Mode Tokens ──
     Exposed for a future theme toggle; applied via :root[data-theme="dark"]. */
  --bg-primary-dark:   #18181B;
  --bg-elevated-dark:  #27272A;
  --text-primary-dark: #FAFAFA;
  --border-dark:       #3F3F46;
}

/* Dark theme — reworked to match the light palette, not a mechanical inversion.
   Inert until a `data-theme="dark"` attribute is set on <html>. */
:root[data-theme="dark"] {
  --bg-primary:     var(--bg-primary-dark);
  --bg-secondary:   #202023;
  --bg-elevated:    var(--bg-elevated-dark);
  --bg-hover:       #323236;
  --bg-active:      #3F3F46;
  --bg-input:       #202023;

  --text-primary:   var(--text-primary-dark);
  --text-secondary: #D4D4D8;
  --text-tertiary:  #A1A1AA;
  --text-muted:     #71717A;
  --text-inverse:   #18181B;

  --border-default: var(--border-dark);
  --border-strong:  #52525B;
  --border-subtle:  #2E2E33;

  /* Same blue family; lightened for AA contrast on dark surfaces. */
  --accent-primary:        #60A5FA;
  --accent-primary-hover:  #93C5FD;
  --accent-primary-subtle: #1E293B;
  --accent-primary-border: #1E40AF;
  --focus-ring:            rgba(96, 165, 250, 0.35);

  --btn-primary-text: #0B1220;

  --color-success:    #4ADE80;
  --color-warning:    #FBBF24;
  --color-error:      #F87171;
  --color-success-bg: #14261A;
  --color-warning-bg: #2A1F0B;
  --color-error-bg:   #2A1414;

  --shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md:    0 1px 3px rgba(0, 0, 0, 0.45);
  --shadow-lg:    0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-modal: 0 4px 16px rgba(0, 0, 0, 0.6);
}

/* ============================================================
   ICON SYSTEM (Lucide, stroked, 16–20px)
   Decorative emoji are not used as UI icons; every functional
   icon is an inline SVG that inherits currentColor.
   ============================================================ */
.ui-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.18em;
}
.ui-icon-lg { width: 20px; height: 20px; }
.ui-icon-muted  { color: var(--text-secondary); }
.ui-icon-accent { color: var(--accent-primary); }

/* ── Global Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

html {
  font-size: 14px;
  background-color: var(--bg-primary);
}

/* Consistent accent focus ring across the product chrome. */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

/* ============================================================
   SCREEN CONTAINER & TRANSITIONS
   ============================================================ */
.screen {
  display: none;
  min-height: 100vh;
  width: 100%;
}
.screen.active {
  display: flex;
  flex-direction: column;
}

/* ============================================================
   LANDING PAGE (Screen 1)
   ============================================================ */
#screen-landing {
  position: relative;
  background-color: var(--bg-primary);
  background-image: none;
  overflow-y: auto;
  align-items: center;
}

/* Landing Navigation Header */
.landing-nav {
  width: 100%;
  max-width: 1200px;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 10;
}

.brand-logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
  border: none;
}

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

.brand-icon svg {
  color: var(--accent-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Landing Hero Section */
.landing-hero {
  width: 100%;
  max-width: 960px;
  margin: 3.5rem auto 4.5rem;
  text-align: center;
  padding: 0 1.5rem;
  position: relative;
  z-index: 2;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-primary-subtle);
  border: 1px solid var(--accent-primary-border);
  border-radius: var(--r-full);
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 1.75rem;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}

.hero-pill-badge:hover {
  background: var(--accent-primary-subtle);
  border-color: var(--accent-primary);
}

.pill-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(1.3); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5.5vw, 4.4rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.hero-gradient-text {
  color: var(--text-secondary);
}

.hero-accent-text {
  color: var(--accent-primary);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-hero-cta {
  padding: 13px 32px;
  font-size: 0.98rem;
  font-weight: 600;
  border-radius: var(--r-md);
  background: var(--btn-primary-bg) !important;
  color: var(--btn-primary-text) !important;
  border: 1px solid var(--btn-primary-bg) !important;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-hero-cta:hover {
  background: var(--btn-primary-hover) !important;
  border-color: var(--btn-primary-hover) !important;
  box-shadow: var(--shadow-sm);
}

/* Feature Grid on Landing Page */
.landing-features-grid {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto 5rem;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.feature-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  padding: 1.75rem 1.5rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.feature-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.feature-icon-box {
  width: 40px;
  height: 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  transition: all 0.2s ease;
}

.feature-card:hover .feature-icon-box {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--accent-primary-subtle);
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.feature-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ============================================================
   GLOBAL TOP NAVIGATION BAR (Builder App Header)
   ============================================================ */
.app-topbar {
  width: 100%;
  height: 52px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  position: relative;
  flex-shrink: 0;
  z-index: 100;
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.topbar-brand .brand-icon {
  width: 32px;
  height: 32px;
}

/* Center Viewport Segmented Control — Clean Flex Center */
.topbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--bg-primary);
  padding: 3px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-default);
}

.vp-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.vp-btn:hover {
  color: var(--text-primary);
}

.vp-btn.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-strong);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.user-profile-badge {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  padding: 3px 10px 3px 4px;
  border-radius: var(--r-full);
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  color: var(--btn-primary-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
  text-transform: uppercase;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-signout {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
  transition: color 0.15s ease;
}
.user-signout:hover {
  color: var(--color-error);
}

/* ============================================================
   BUILDER WORKSPACE LAYOUT
   ============================================================ */
#screen-builder {
  flex: 1;
}
#screen-builder.active {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.builder-workspace {
  flex: 1;
  display: flex;
  flex-direction: row;
  height: calc(100vh - 52px);
  overflow: hidden;
  position: relative;
}

.panel-left {
  width: 400px;
  min-width: 360px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  z-index: 10;
}

/* Sidebar Tab Segment Bar */
.sidebar-tabs-nav {
  display: flex;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-default);
  padding: 8px 10px;
  gap: 4px;
  flex-shrink: 0;
}

.sidebar-tab-btn {
  flex: 1;
  padding: 7px 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  white-space: nowrap;
  font-family: inherit;
}

.sidebar-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.sidebar-tab-btn.active {
  background: var(--accent-primary-subtle);
  color: var(--accent-primary);
  border-color: var(--accent-primary-border);
  font-weight: 600;
}

.panel-scroll-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 1.25rem;
}

.tab-pane.active {
  display: flex;
}

.step-header-simple {
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: 0.25rem;
}

.step-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.step-sub {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.form-group {
  margin-bottom: 1rem;
}
.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.optional-tag {
  font-size: 0.74rem;
  color: var(--text-tertiary);
  font-weight: 400;
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  outline: none;
  transition: all 0.15s ease;
}

.form-input:focus {
  border-color: var(--accent-primary);
  background: var(--bg-input);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.lang-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.lang-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.lang-btn.selected {
  border-color: var(--accent-primary);
  background: var(--accent-primary-subtle);
  color: var(--accent-primary);
  font-weight: 600;
}

.lang-flag {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  background: var(--bg-elevated);
  border-radius: 4px;
  color: var(--text-tertiary);
}

.out-lang-grid,
.style-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.style-btn {
  padding: 6px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.style-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.style-btn.selected {
  border-color: var(--accent-primary);
  background: var(--accent-primary-subtle);
  color: var(--accent-primary);
  font-weight: 600;
}

.color-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
}

.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected {
  border-color: var(--bg-elevated);
  transform: scale(1.15);
  box-shadow: 0 0 0 2px var(--accent-primary);
}

.voice-area {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  padding: 1rem;
}

.voice-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.mic-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.mic-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.mic-btn.recording {
  border-color: var(--color-error);
  background: var(--color-error-bg);
  color: var(--color-error);
  animation: mic-pulse 1.2s infinite;
}

.voice-status {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-wave { display: none; gap: 3px; align-items: center; }
.voice-wave.active { display: flex; }
.voice-wave span { width: 3px; background: var(--color-error); border-radius: 3px; animation: wave-bar 0.8s infinite ease-in-out; }
.voice-wave span:nth-child(1) { animation-delay: 0s; }
.voice-wave span:nth-child(2) { animation-delay: 0.1s; }
.voice-wave span:nth-child(3) { animation-delay: 0.2s; }
.voice-wave span:nth-child(4) { animation-delay: 0.3s; }
.voice-wave span:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave-bar { 0%, 100% { height: 5px; } 50% { height: 16px; } }

.prompt-textarea {
  width: 100%;
  min-height: 100px;
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: all 0.15s ease;
}

.prompt-textarea:focus {
  border-color: var(--accent-primary);
  background: var(--bg-input);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.prompt-hint { font-size: 0.76rem; color: var(--text-tertiary); margin-top: 6px; }

.examples-section { margin-top: 12px; }
.examples-label { font-size: 0.78rem; font-weight: 600; color: var(--text-tertiary); margin-bottom: 6px; }
.examples-list { display: flex; flex-direction: column; gap: 5px; }

.example-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  padding: 8px 10px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
}

.example-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.upload-zone {
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  background: var(--bg-input);
}

.upload-zone:hover {
  border-color: var(--accent-primary);
  background: var(--accent-primary-subtle);
}

.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-icon { color: var(--text-secondary); margin-bottom: 6px; }
.upload-label { font-size: 0.85rem; color: var(--text-secondary); }
.upload-label strong { color: var(--text-primary); }
.upload-hint { font-size: 0.74rem; color: var(--text-tertiary); margin-top: 3px; }

.image-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }

.img-thumb {
  aspect-ratio: 1;
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
}
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }

.img-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: var(--text-primary);
  border: none;
  border-radius: 50%;
  color: var(--text-inverse);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-footer-sticky {
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.progress-ring { display: none; flex-direction: column; align-items: center; gap: 8px; padding: 0.75rem 0; }
.progress-ring.visible { display: flex; }

.spinner {
  width: 26px;
  height: 26px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-steps { list-style: none; font-size: 0.76rem; color: var(--text-tertiary); text-align: center; }
.progress-steps li.done { color: var(--color-success); font-weight: 600; }
.progress-steps li.current { color: var(--text-primary); font-weight: 600; }

/* ============================================================
   RIGHT PREVIEW CANVAS & TOOLBAR
   ============================================================ */
.panel-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-secondary);
  overflow: hidden;
}

.workspace-toolbar {
  min-height: 44px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px;
  flex-shrink: 0;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.workspace-toolbar::-webkit-scrollbar {
  display: none;
}

.toolbar-url-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  padding: 3px 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

.toolbar-actions .btn {
  height: 28px;
  padding: 0 8px;
  font-size: 0.75rem;
  font-weight: 500;
  gap: 5px;
  white-space: nowrap;
  border-radius: 6px;
}

.toolbar-actions .btn svg {
  width: 13px;
  height: 13px;
}

.toolbar-actions .btn-icon-only {
  width: 28px;
  min-width: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toolbar-actions .toolbar-divider {
  width: 1px;
  height: 18px;
  background: var(--border-default);
  margin: 0 2px;
  flex-shrink: 0;
}

.workspace-subbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 1rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 6px;
}

.preview-canvas-container {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg-secondary);
}

.device-wrapper {
  width: 100%;
  max-width: 1200px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.device-wrapper.mobile {
  max-width: 390px;
  border: 6px solid var(--border-strong);
  border-radius: 32px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

#preview-iframe {
  width: 100%;
  height: calc(100vh - 160px);
  min-height: 560px;
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  background: white;
  display: block;
}

.device-wrapper.mobile #preview-iframe {
  border-radius: 0;
  height: 680px;
  border: none;
}

.preview-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1rem;
}

.preview-empty-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--r-xl);
  padding: 2.5rem 2rem;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-md);
}

.preview-empty-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
  background: transparent;
  border: none;
}

.preview-empty-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview-empty-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.preview-empty-card p {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  line-height: 1.55;
}

/* Upload Website Section (inside preview-empty-card) */
.upload-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 1.1rem 0;
}

.upload-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-default);
}

.upload-divider-text {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.upload-website-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.upload-website-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.upload-hint-text {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-top: 6px;
}

/* ============================================================
   BUTTON DESIGN SYSTEM (Silicon Valley Standard)
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 13px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}

/* Primary CTA — solid accent fill, white text, no gradient */
.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border: 1px solid var(--btn-primary-bg);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
  box-shadow: var(--shadow-sm);
}

/* Secondary Button with Hairline Border */
.btn-secondary {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.btn-secondary:hover {
  border-color: var(--text-muted);
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.btn-block {
  width: 100%;
}

.generate-btn {
  width: 100%;
  padding: 11px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--r-md);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border: 1px solid var(--btn-primary-bg);
  box-shadow: var(--shadow-sm);
}
.generate-btn:hover {
  background: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
  box-shadow: var(--shadow-sm);
}

.regen-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.publish-btn {
  width: 100%;
  padding: 10px;
  background: var(--accent-primary);
  color: var(--btn-primary-text);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--r-md);
  border: 1px solid var(--accent-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}
.publish-btn:hover {
  background: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
  box-shadow: var(--shadow-sm);
}

.publish-card {
  background: var(--accent-primary-subtle);
  border: 1px solid var(--accent-primary-border);
  border-radius: var(--r-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.publish-card-label { font-size: 0.68rem; font-weight: 700; color: var(--accent-primary); text-transform: uppercase; }
.publish-card-url { font-size: 0.82rem; color: var(--text-primary); font-weight: 600; text-decoration: underline; word-break: break-all; }
.publish-card-copy {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  padding: 3px 8px;
  font-size: 0.75rem;
  cursor: pointer;
}

/* ============================================================
   MODALS & DRAWERS (Frosted Glass & Hairline Elevation)
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 24, 27, 0.45);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-box.modal-lg { max-width: 800px; }

.modal-header {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}
.modal-close:hover { color: var(--text-primary); }

.modal-body {
  padding: 1.25rem;
  max-height: 72vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg-secondary);
}

/* Catalog Manager */
.catalog-manager-grid { display: flex; flex-direction: column; gap: 8px; }

.catalog-edit-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  padding: 10px;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}

.catalog-edit-card input {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  padding: 6px 8px;
  border-radius: var(--r-sm);
  font-size: 0.82rem;
}

.btn-delete-item {
  background: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid #FECACA;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-weight: bold;
}
.btn-delete-item:hover { background: var(--color-error); color: white; }

/* My Websites List */
.my-websites-list { display: flex; flex-direction: column; gap: 8px; }

.website-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.website-card-info .shop-name { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.website-card-info .shop-url { font-size: 0.8rem; color: var(--accent-primary); }
.website-card-info .shop-date { font-size: 0.72rem; color: var(--text-tertiary); margin-top: 2px; }

.website-card-actions { display: flex; gap: 6px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--text-primary);
  z-index: 10000;
  transform: translateY(16px);
  opacity: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid var(--color-success); }
.toast.error { border-left: 3px solid var(--color-error); }

/* Responsive Layout */
@media (max-width: 900px) {
  .builder-workspace { flex-direction: column; }
  .panel-left { width: 100%; min-width: unset; height: 50vh; }
  .panel-right { height: 50vh; }
  #preview-iframe { height: 100%; }
}

/* Fullscreen Preview */
.fullscreen-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

.fullscreen-bar {
  height: 48px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  position: relative;
  flex-shrink: 0;
}

.fullscreen-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.fullscreen-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fullscreen-canvas-wrap {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: var(--bg-secondary);
}

.fullscreen-device-wrapper {
  width: 100%;
  height: 100%;
  transition: all 0.3s ease;
}

.fullscreen-device-wrapper.mobile {
  max-width: 410px;
  height: calc(100vh - 60px);
  margin-top: 8px;
  border: 8px solid var(--border-strong);
  border-radius: 36px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

#fullscreen-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

/* Loading Stage Animation */
.stage-loading-container {
  width: 100%;
  height: 100%;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  background-image: radial-gradient(circle at 50% 50%, var(--bg-hover) 1px, transparent 1px);
  background-size: 24px 24px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border-default);
}

.loading-stage-card {
  width: min(640px, 92vw);
  padding: 36px 32px;
  text-align: center;
  position: relative;
}

.mark-animated-icon {
  margin: 0 auto 20px;
  width: 64px;
  height: 64px;
}
.mark-animated-icon svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.mark-animated-icon path,
.mark-animated-icon line {
  fill: none;
  stroke: var(--accent-primary);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  animation: drawStorefront 2.8s ease-in-out infinite;
}
.mark-animated-icon .roof { animation-delay: 0s; }
.mark-animated-icon .body { animation-delay: 0.35s; }
.mark-animated-icon .door { animation-delay: 0.7s; stroke: var(--accent-primary-hover); }

@keyframes drawStorefront {
  0% { stroke-dashoffset: 240; opacity: 0.3; }
  35% { stroke-dashoffset: 0; opacity: 1; }
  80% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}

.building-shop-name {
  font-size: 22px;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text-primary);
}
.building-caret {
  display: inline-block;
  width: 2px;
  height: 18px;
  background: var(--accent-primary);
  margin-left: 4px;
  vertical-align: -2px;
  animation: blinkCaret 1s step-end infinite;
}
@keyframes blinkCaret { 50% { opacity: 0; } }

.building-subline {
  color: var(--text-tertiary);
  font-size: 13px;
  margin: 0 0 28px;
  font-variant-numeric: tabular-nums;
}

.segs-bar-container {
  display: flex;
  gap: 5px;
  margin: 0 auto 28px;
  width: 100%;
}
.seg-track {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--border-default);
  overflow: hidden;
  position: relative;
}
.seg-fill {
  position: absolute;
  inset: 0;
  background: var(--accent-primary);
  width: 0%;
  transition: width 0.4s ease;
}

.steps-checklist-container {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  margin: 0 auto;
}
.step-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-tertiary);
  transition: color 0.2s ease;
}
.step-row.active { color: var(--text-primary); font-weight: 600; }
.step-row.done { color: var(--text-primary); }

.step-dot {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border-radius: 50%;
  border: 1.5px solid var(--border-default);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-row.active .step-dot {
  border-color: var(--accent-primary);
}
.step-row.active .step-dot::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-primary);
  animation: pulseDot 1.1s ease-in-out infinite;
}
@keyframes pulseDot { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.4); opacity: 0.6; } }

.step-row.done .step-dot {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
}
.step-row.done .step-dot::after {
  content: '';
  width: 3px;
  height: 6px;
  border-right: 2px solid var(--btn-primary-text);
  border-bottom: 2px solid var(--btn-primary-text);
  transform: rotate(45deg) translate(-1px, -1px);
}

.step-pct {
  font-variant-numeric: tabular-nums;
  color: var(--text-tertiary);
  font-size: 11px;
  margin-left: auto;
}

.loading-footer-note {
  margin-top: 28px;
  font-size: 11px;
  color: var(--text-tertiary);
  opacity: 0.7;
}

/* Pricing Modal 3-Column Layout */
.pricing-cards-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 16px;
  align-items: stretch;
}

@media (max-width: 920px) {
  .pricing-cards-container {
    grid-template-columns: 1fr !important;
  }
}

/* Chat Refinement Drawer */
.chat-refinement-drawer {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 380px;
  max-width: calc(100% - 40px);
  height: 480px;
  max-height: 80vh;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-default);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  z-index: 99;
  transform: translateY(16px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-refinement-drawer.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.chat-drawer-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-elevated);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.chat-messages-container {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-quick-suggestions {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 8px 12px;
  border-top: 1px solid var(--border-default);
  background: var(--bg-primary);
}

.chat-quick-suggestions::-webkit-scrollbar {
  display: none;
}

.quick-pill {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.quick-pill:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.chat-input-row {
  padding: 10px 12px;
  border-top: 1px solid var(--border-default);
  display: flex;
  gap: 8px;
  background: var(--bg-elevated);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}

.chat-input-row input {
  flex: 1;
  font-size: 0.82rem;
  padding: 7px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-default);
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
}

.chat-input-row input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.page-tab-btn {
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: var(--r-md);
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  cursor: pointer;
  transition: all 0.15s ease;
}

.page-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.page-tab-btn.active {
  background: var(--accent-primary-subtle);
  color: var(--accent-primary);
  border-color: var(--accent-primary-border);
  font-weight: 600;
}

.variant-pill-btn {
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: var(--r-md);
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  cursor: pointer;
  transition: all 0.15s ease;
}

.variant-pill-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.variant-pill-btn.active {
  background: var(--accent-primary-subtle);
  color: var(--accent-primary);
  border-color: var(--accent-primary-border);
  font-weight: 600;
}

.template-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong) !important;
  box-shadow: var(--shadow-md);
}

/* Publish & Custom Domain Modal Controls */
.dns-kv-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  padding: 10px 12px;
}

.dns-kv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  padding: 3px 0;
}

.dns-kv-label {
  color: var(--text-tertiary);
  font-weight: 500;
}

.dns-kv-val {
  color: var(--text-primary);
  font-weight: 600;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.publish-input-group {
  display: flex;
  gap: 8px;
  width: 100%;
}

.publish-input-group input[type="text"] {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  padding: 9px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.84rem;
  outline: none;
  transition: all 0.2s ease;
}

.publish-input-group input[type="text"]::placeholder {
  color: var(--text-secondary);
}

.publish-input-group input[type="text"]:focus {
  border-color: var(--accent-primary);
  background: var(--bg-input);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.publish-input-group button {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-weight: 600;
  font-size: 0.82rem;
  font-family: inherit;
  padding: 0 16px;
  border: 1px solid var(--btn-primary-bg);
  border-radius: var(--r-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.publish-input-group button:hover {
  background: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
  box-shadow: var(--shadow-sm);
}

.test-domain-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--r-sm);
  padding: 3px 8px;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 0.74rem;
  transition: all 0.15s ease;
}

.test-domain-chip:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--accent-primary-subtle);
}

.test-domain-chip span {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-weight: 600;
}

/* Website Goal Pills */
.goal-pill-group {
  display: flex;
  gap: 6px;
  background: var(--bg-input);
  padding: 4px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-default);
}

.goal-pill-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  border-radius: var(--r-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  text-align: center;
}

.goal-pill-icon {
  font-size: 1rem;
  margin-bottom: 2px;
}

.goal-pill-text {
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
}

.goal-pill-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.goal-pill-btn.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.goal-pill-btn.active .goal-pill-text {
  color: var(--accent-primary);
}

/* CRM Table & Orders Styling */
.crm-tab-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: 16px;
  padding-bottom: 8px;
}

.crm-nav-btn {
  padding: 6px 14px;
  border-radius: var(--r-md);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.crm-nav-btn:hover {
  color: var(--text-primary);
  background: var(--bg-input);
}

.crm-nav-btn.active {
  color: var(--btn-primary-text);
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.crm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.crm-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-default);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.crm-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.crm-table tr:hover td {
  background: var(--bg-hover);
}

.crm-badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.crm-badge-order {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid #BBF7D0;
}

.crm-badge-inquiry {
  background: var(--accent-primary-subtle);
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary-border);
}

.crm-badge-booking {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid #FDE68A;
}

.crm-btn-chat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  background: #25D366;
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.72rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.crm-btn-chat:hover {
  background: #1eb954;
  transform: translateY(-1px);
}

/* ============================================================
   DEMO GALLERY SECTION (LANDING PAGE)
   ============================================================ */
.demo-gallery-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px 80px;
  width: 100%;
}

.demo-gallery-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 40px;
}

.demo-gallery-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}

.demo-gallery-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.demo-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.demo-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

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

.demo-card-img-wrap {
  position: relative;
  width: 100%;
  height: 175px;
  background: var(--bg-secondary);
  overflow: hidden;
}

.demo-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.demo-card:hover .demo-card-img {
  transform: scale(1.04);
}

.demo-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-xs);
}

.demo-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.demo-card-category {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent-primary);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.demo-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
  line-height: 1.35;
}

.demo-card-desc {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  line-height: 1.5;
  margin-bottom: 18px;
  flex: 1;
}

.demo-card-btn {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 8px;
  cursor: pointer;
}

.demo-gallery-cta {
  text-align: center;
  display: flex;
  justify-content: center;
}

/* ============================================================
   CRM FILTERS & FULFILLMENT TOGGLE
   ============================================================ */
.crm-filter-toolbar {
  transition: all 0.2s ease;
}

.crm-filter-pill {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.crm-filter-pill:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.crm-filter-pill.active {
  background: var(--accent-primary);
  color: var(--btn-primary-text);
  border-color: var(--accent-primary);
}

.crm-fulfilled-row {
  opacity: 0.62;
  transition: opacity 0.2s ease;
}

.crm-fulfilled-row:hover {
  opacity: 0.9;
}

.crm-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.crm-toggle-btn.pending {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border-color: #FDE68A;
}

.crm-toggle-btn.pending:hover {
  background: #FEF3C7;
}

.crm-toggle-btn.fulfilled {
  background: var(--color-success-bg);
  color: var(--color-success);
  border-color: #BBF7D0;
}

.crm-toggle-btn.fulfilled:hover {
  background: #DCFCE7;
}

.crm-toggle-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}


