:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --surface-2: #fafbff;
  --border: #e5e7f0;
  --border-strong: #d4d7e3;
  --text: #0f172a;
  --text-2: #1f2937;
  --muted: #64748b;
  --muted-2: #94a3b8;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --pink: #ec4899;
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --gradient-soft: linear-gradient(135deg, #eef2ff 0%, #fdf2f8 100%);

  --star: #fbbf24;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --success-bg: #dcfce7;
  --success-fg: #166534;
  --error-bg: #fee2e2;
  --error-fg: #991b1b;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 14px -4px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 14px 40px -12px rgba(99, 102, 241, 0.2);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(180%) blur(8px);
}
.nav .brand {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.2px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nav .brand::before {
  content: "";
  display: inline-block;
  width: 24px; height: 24px;
  border-radius: 8px;
  background: var(--gradient);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 4px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(99, 102, 241, 0.4);
}
.nav .right { display: flex; gap: 16px; align-items: center; font-size: 14px; }
.nav .right .email { color: var(--muted); font-size: 13px; }

main {
  max-width: 1200px;
  margin: 36px auto 80px;
  padding: 0 28px;
}
main.narrow {
  max-width: 460px;
}
main.flush {
  max-width: none;
  margin: 0 0 80px;
  padding: 0;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
}

/* Hero (landing) — full-bleed, gradient-mesh */
.hero {
  position: relative;
  overflow: hidden;
  background: #1e1b4b;
  color: #ffffff;
  padding: 92px 0 104px;
  margin-bottom: 0;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 60% at 12% 18%, rgba(99, 102, 241, 0.85), transparent 60%),
    radial-gradient(50% 50% at 88% 28%, rgba(236, 72, 153, 0.7), transparent 60%),
    radial-gradient(70% 70% at 60% 110%, rgba(139, 92, 246, 0.65), transparent 60%),
    radial-gradient(40% 40% at 0% 100%, rgba(56, 189, 248, 0.45), transparent 60%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 1100px; margin: 0 auto; padding: 0 28px; }
.hero h1 {
  margin: 14px 0 18px;
  font-size: clamp(38px, 5.4vw, 60px);
  line-height: 1.05;
  letter-spacing: -1.4px;
  font-weight: 800;
  max-width: 18ch;
}
.hero h1 .accent {
  background: linear-gradient(120deg, #fef3c7, #fbcfe8 50%, #c7d2fe);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lead {
  margin: 0 0 30px;
  font-size: clamp(16px, 1.4vw, 19px);
  font-weight: 400;
  line-height: 1.6;
  opacity: 0.9;
  max-width: 56ch;
}
.hero .hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .hero-cta .btn { padding: 12px 22px; font-size: 14.5px; font-weight: 600; }
.hero .hero-cta .btn.primary { background: #ffffff; color: #4f46e5; border-color: transparent; }
.hero .hero-cta .btn.primary:hover { background: #f1f5ff; }
.hero .hero-cta .btn.ghost {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
}
.hero .hero-cta .btn.ghost:hover { background: rgba(255, 255, 255, 0.25); }

.steps {
  display: grid;
  gap: 16px;
  margin-top: 28px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}
.step:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--gradient-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 10px;
}
.step h4 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.step p { margin: 0; font-size: 13px; color: var(--muted); }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px 32px;
  box-shadow: var(--shadow-sm);
}

/* Section header (used on landing after the hero) */
.section {
  padding: 64px 0 28px;
}
.section .eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--primary);
  margin: 0 0 10px;
}
.section .section-title {
  margin: 0 0 14px;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--text);
  max-width: 22ch;
}
.section .section-lead {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 60ch;
}

h1 { margin: 0 0 8px; font-size: 26px; font-weight: 700; letter-spacing: -0.3px; }
h2 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
h3 {
  margin: 16px 0 8px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
}

.sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.6; }

.row { display: flex; gap: 12px; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.stack > * + * { margin-top: 14px; }

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%;
  padding: 10px 13px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid #d4d7e3;
  border-radius: 9px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.13);
}
textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  resize: vertical;
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 9px;
  border: 1.5px solid transparent;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  border-color: #d4d7e3;
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
}
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn.primary, button.primary {
  background: var(--gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px -4px rgba(99, 102, 241, 0.5);
}
.btn.primary:hover, button.primary:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow: 0 8px 18px -6px rgba(99, 102, 241, 0.55);
}
.btn.secondary, button.secondary {
  background: var(--gradient-soft);
  color: var(--primary);
  border-color: #e0e7ff;
}
.btn.secondary:hover, button.secondary:hover:not(:disabled) { background: #e0e7ff; }
.btn.ghost, button.ghost {
  background: transparent; color: var(--text-2); border-color: #d4d7e3;
}
.btn.ghost:hover, button.ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn.danger, button.danger {
  background: var(--surface); color: var(--danger); border-color: #fecaca;
}
.btn.danger:hover, button.danger:hover:not(:disabled) { background: var(--danger-bg); }

.msg {
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 13px;
  margin-top: 10px;
}
.msg.ok    { background: var(--success-bg); color: var(--success-fg); }
.msg.error { background: var(--error-bg); color: var(--error-fg); }

.muted { color: var(--muted); font-size: 13px; }

/* Widget list */
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.list .item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: transform 0.12s, box-shadow 0.15s, border-color 0.15s;
}
.list .item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.list .item .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.list .item .title { font-weight: 700; font-size: 14.5px; color: var(--text); }

.item-avatar {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--gradient);
  color: #fff; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px -4px rgba(99, 102, 241, 0.4);
}

.item-rating {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 4px;
  font-size: 12.5px; color: #b45309; font-weight: 600;
}
.item-rating .stars { color: var(--star); letter-spacing: 0.5px; }

.empty-state {
  padding: 36px 20px;
  text-align: center;
  background: var(--gradient-soft);
  border: 1px dashed #c7d2fe;
  border-radius: 14px;
  color: var(--muted);
}
.empty-state h2 { font-size: 16px; color: var(--text); margin-bottom: 4px; }

/* Snippet */
code, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}
.snippet {
  background: #0b1020;
  color: #e2e8f0;
  padding: 14px 16px;
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  white-space: pre;
  overflow-x: auto;
  position: relative;
}

/* Stats strip */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}
.stat .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  font-weight: 600;
}
.stat .value {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.stat .value .accent {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.controls { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* Auth pages */
.auth-card { max-width: 440px; margin: 0 auto; }
.auth-card h1 { font-size: 22px; }

.footer {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--gradient-soft);
  border: 1px solid #e0e7ff;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary);
}

.divider { height: 1px; background: var(--border); margin: 22px 0; border: none; }

/* Style-picker cards (visual radio group) */
.style-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.style-picker label {
  position: relative;
  display: block;
  padding: 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  margin-bottom: 0;
  font-weight: 500;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.style-picker label:hover { border-color: #c7d2fe; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.style-picker label.active {
  border-color: var(--primary);
  background: linear-gradient(180deg, #ffffff, #f5f3ff);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}
.style-picker input[type="radio"] {
  position: absolute; opacity: 0; pointer-events: none;
}
.style-picker .style-thumb {
  height: 56px;
  border-radius: 8px;
  background: var(--gradient-soft);
  border: 1px solid #e0e7ff;
  margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 6px;
}
.style-picker .style-thumb span {
  display: block;
  background: #ffffff;
  border: 1px solid #c7d2fe;
  border-radius: 4px;
}
.style-picker .style-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.style-picker .style-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* Preview frame on the widget edit page */
.preview-frame {
  background: var(--gradient-soft);
  border: 1px dashed #c7d2fe;
  border-radius: 16px;
  padding: 20px;
}
.preview-frame .preview-bar {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 14px;
  font-size: 11.5px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.preview-frame .preview-bar::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}
.preview-surface {
  background: var(--surface);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

/* Edit-page layout with a sticky right-side TOC */
.edit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 900px) {
  .edit-layout { grid-template-columns: 1fr; }
  .edit-toc { display: none; }
}
.edit-toc {
  position: sticky;
  top: 84px;
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 0;
  font-size: 13px;
}
.edit-toc-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  padding: 4px 12px 8px;
}
.edit-toc a {
  display: block;
  padding: 7px 12px;
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.edit-toc a:hover { color: var(--text); background: var(--surface); }
.edit-toc a.active {
  color: var(--primary);
  border-left-color: var(--primary);
  background: var(--gradient-soft);
  font-weight: 600;
}

/* Subtle scroll offset so sticky nav doesn't cover headings */
.edit-section { scroll-margin-top: 88px; }

.business-pick {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface);
}
.business-pick label { display: flex; align-items: center; gap: 8px; margin-bottom: 0; font-weight: 500; font-size: 13px; color: var(--text); }

.drop {
  border: 2px dashed #c7d2fe;
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--gradient-soft);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.drop:hover, .drop.drag {
  border-color: var(--primary);
  background: #eef2ff;
}
.drop strong { color: var(--text); }
