:root {
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-tint: #f1f5f9;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #059669;
  --success-soft: #ecfdf5;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .05);
  --shadow-lg: 0 24px 70px rgba(15, 23, 42, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--surface-soft);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }

.app-shell { min-height: 100vh; }
.topbar {
  height: 70px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #0f172a, #2563eb);
  box-shadow: 0 8px 20px rgba(37, 99, 235, .22);
}
.brand-mark svg { width: 23px; height: 23px; fill: currentColor; stroke: none; }
.brand strong { display: block; font-family: Manrope, Inter, sans-serif; font-size: 15px; line-height: 1.25; }
.brand small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); letter-spacing: .03em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.save-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); margin-right: 4px; }
.status-dot { width: 7px; height: 7px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 4px rgba(5,150,105,.1); }

.btn {
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 11px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  transition: .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { color: #fff; background: var(--primary); box-shadow: 0 8px 22px rgba(37,99,235,.18); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { color: var(--primary-dark); border-color: #bfdbfe; background: var(--primary-soft); }
.btn-success { color: #fff; background: var(--success); box-shadow: 0 10px 24px rgba(5,150,105,.18); }
.btn-success:hover { background: #047857; }
.btn-danger { color: #fff; background: var(--danger); }
.btn-ghost { color: var(--ink-soft); border-color: var(--line); background: #fff; }
.btn-ghost:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.btn-sm { padding: 9px 13px; font-size: 12px; }
.btn-xs { padding: 7px 10px; font-size: 11px; }
.btn-lg { padding: 15px 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { font-size: 16px; }
.icon-btn { width: 34px; height: 34px; border: 1px solid var(--line); background: white; border-radius: 10px; color: var(--muted); display: grid; place-items: center; }
.icon-btn:hover { color: var(--primary); border-color: #bfdbfe; background: var(--primary-soft); }

.onboarding {
  min-height: calc(100vh - 70px);
  padding: 60px 28px 80px;
  background:
    radial-gradient(circle at 12% 5%, rgba(37, 99, 235, .10), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(5, 150, 105, .08), transparent 26%),
    linear-gradient(180deg, #fff 0%, #f8fafc 48%, #f1f5f9 100%);
}
.hero-copy { max-width: 790px; text-align: center; margin: 0 auto 36px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--primary-dark); background: var(--primary-soft); border: 1px solid #dbeafe; border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.eyebrow span { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.hero-copy h1 { font-family: Manrope, Inter, sans-serif; margin: 20px auto 14px; max-width: 760px; font-size: clamp(38px, 5vw, 64px); line-height: 1.03; letter-spacing: -.04em; }
.hero-copy > p { max-width: 690px; margin: 0 auto; color: var(--muted); font-size: 18px; line-height: 1.7; }
.hero-points { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px 22px; margin-top: 22px; }
.hero-points span { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.hero-points svg { color: var(--success); stroke-width: 2.4; }

.setup-card { width: min(980px, 100%); margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow-lg); overflow: hidden; }
.setup-progress { height: 74px; display: flex; align-items: center; justify-content: center; padding: 0 40px; background: #fbfdff; border-bottom: 1px solid var(--line); }
.setup-step { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); background: transparent; border: 0; font-size: 13px; font-weight: 800; }
.setup-step span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-tint); border: 1px solid var(--line); color: var(--muted); }
.setup-step.active { color: var(--ink); }
.setup-step.active span { color: #fff; background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 5px rgba(37,99,235,.09); }
.setup-step.complete span { color: #fff; background: var(--success); border-color: var(--success); }
.step-line { height: 1px; width: 90px; margin: 0 14px; background: var(--line); }
.setup-panel { display: none; padding: 42px; }
.setup-panel.active { display: block; animation: fadeUp .22s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.panel-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.section-kicker { margin: 0 0 6px; color: var(--primary); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.panel-heading h2, .campaign-title-row h2 { margin: 0; font-family: Manrope, Inter, sans-serif; letter-spacing: -.025em; }
.panel-heading h2 { font-size: 28px; }
.panel-heading p:not(.section-kicker) { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.sample-row { padding: 18px; margin-bottom: 24px; border-radius: var(--radius); background: #f8fbff; border: 1px solid #dbeafe; }

.form-grid { display: grid; gap: 18px; }
.form-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: block; margin-bottom: 19px; }
.field > span { display: flex; align-items: baseline; gap: 5px; margin-bottom: 8px; color: var(--ink-soft); font-size: 12px; font-weight: 800; }
.field em { color: var(--muted); font-size: 10px; font-style: normal; font-weight: 600; }
.field input, .field textarea, .field select, .small-select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  outline: none;
  padding: 12px 13px;
  font-size: 13px;
  line-height: 1.5;
  transition: .16s ease;
}
.field textarea { resize: vertical; min-height: 78px; }
.field input:focus, .field textarea:focus, .field select:focus, .small-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.field small { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.field-wide { margin: 0; }
.field.compact { margin-bottom: 14px; }
.field.compact input, .field.compact textarea, .field.compact select { padding: 10px 11px; font-size: 12px; border-radius: 9px; }
.field.compact textarea { min-height: 72px; }
.input-prefix { position: relative; }
.input-prefix b { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.input-prefix input { padding-left: 28px; }
.form-actions { display: flex; align-items: center; margin-top: 14px; }
.form-actions.right { justify-content: flex-end; }
.form-actions.split { justify-content: space-between; }

.template-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.template-card { text-align: left; min-height: 178px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: #fff; transition: .18s ease; }
.template-card:hover { border-color: #93c5fd; transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.template-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.09); background: #fbfdff; }
.template-card strong { display: block; margin-top: 13px; font-size: 13px; }
.template-card small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.5; font-size: 10px; }
.template-thumb { height: 80px; border-radius: 10px; display: grid; padding: 10px; gap: 6px; background: #f1f5f9; overflow: hidden; }
.template-thumb i { display: block; border-radius: 4px; background: #cbd5e1; }
.thumb-bridge { grid-template-rows: 20px 1fr 14px; }
.thumb-bridge i:first-child { width: 78%; background: #334155; }
.thumb-bridge i:nth-child(2) { background: #e2e8f0; border: 1px solid #cbd5e1; }
.thumb-bridge i:last-child { width: 42%; background: #2563eb; }
.thumb-review { grid-template-columns: 38% 1fr; grid-template-rows: 22px 1fr; }
.thumb-review i:first-child { grid-column: 1/3; width: 65%; background: #334155; }
.thumb-review i:nth-child(2) { background: #bfdbfe; }
.thumb-review i:last-child { background: repeating-linear-gradient(#cbd5e1 0 4px, transparent 4px 9px); }
.thumb-story { grid-template-rows: 18px 1fr 1fr; }
.thumb-story i:first-child { width: 58%; background: #92400e; }
.thumb-story i:nth-child(2), .thumb-story i:last-child { background: repeating-linear-gradient(#d6d3d1 0 3px, transparent 3px 8px); }
.thumb-compare { grid-template-columns: 1fr 1fr; grid-template-rows: 16px 1fr; }
.thumb-compare i:first-child { grid-column: 1/3; width: 62%; background: #334155; }
.thumb-compare i:nth-child(2) { background: #fee2e2; border: 1px solid #fecaca; }
.thumb-compare i:last-child { background: #dcfce7; border: 1px solid #bbf7d0; }
.thumb-quiz { grid-template-rows: 16px repeat(2, 1fr); }
.thumb-quiz i:first-child { width: 66%; background: #334155; }
.thumb-quiz i:nth-child(2), .thumb-quiz i:last-child { background: #fff; border: 1px solid #cbd5e1; }
.thumb-lead { grid-template-rows: 18px 1fr 15px; }
.thumb-lead i:first-child { width: 74%; background: #334155; }
.thumb-lead i:nth-child(2) { background: linear-gradient(90deg, #bfdbfe 42%, #fff 42%); border: 1px solid #cbd5e1; }
.thumb-lead i:last-child { background: #2563eb; }
.thumb-bonus { grid-template-columns: repeat(3, 1fr); grid-template-rows: 20px 1fr; }
.thumb-bonus i:first-child { grid-column: 1/4; width: 66%; background: #334155; }
.thumb-bonus i:nth-child(2), .thumb-bonus i:last-child { background: #fef3c7; border: 1px solid #fde68a; }
.build-summary { margin: 22px 0 8px; padding: 15px 17px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.build-summary strong { color: var(--ink); }

.workspace { height: calc(100vh - 70px); display: grid; grid-template-columns: 330px minmax(480px, 1fr) 300px; overflow: hidden; }
.editor-panel, .assistant-panel { background: #fff; min-height: 0; }
.editor-panel { border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.assistant-panel { border-left: 1px solid var(--line); padding: 20px; overflow-y: auto; }
.campaign-title-row { padding: 18px 18px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.campaign-title-row h2 { font-size: 17px; line-height: 1.25; max-width: 230px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace-tabs { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--line); padding: 0 9px; }
.workspace-tab { border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; padding: 11px 3px 10px; font-size: 9px; font-weight: 800; }
.workspace-tab:hover { color: var(--ink); }
.workspace-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.editor-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.editor-tab-panel { display: none; padding: 16px; }
.editor-tab-panel.active { display: block; }
.editor-section { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.editor-section:last-child { border-bottom: 0; }
.editor-section-heading, .assistant-heading, .asset-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.editor-section-heading { margin-bottom: 12px; }
.editor-section-heading h3, .assistant-heading h3, .asset-toolbar h3 { margin: 0; font-size: 12px; }
.editor-section-heading span, .assistant-heading span, .asset-toolbar p { color: var(--muted); font-size: 9px; }
.asset-toolbar { margin-bottom: 14px; }
.asset-toolbar p { margin: 3px 0 0; line-height: 1.4; }
.small-select { width: auto; max-width: 145px; padding: 7px 9px; font-size: 10px; }
.color-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.color-field { display: block; }
.color-field span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 9px; font-weight: 700; }
.color-field input { width: 100%; height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }

.preview-panel { min-width: 0; display: flex; flex-direction: column; background: #e9eef5; }
.preview-toolbar { height: 56px; flex: 0 0 56px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #d7dee8; background: #f8fafc; }
.device-switcher { display: inline-flex; padding: 3px; border: 1px solid var(--line); background: #fff; border-radius: 10px; }
.device-btn { width: 34px; height: 28px; display: grid; place-items: center; color: var(--muted); border: 0; background: transparent; border-radius: 7px; }
.device-btn.active { color: var(--primary); background: var(--primary-soft); }
.preview-actions { display: flex; gap: 7px; }
.preview-stage { flex: 1; min-height: 0; overflow: auto; padding: 24px; display: flex; justify-content: center; align-items: flex-start; }
.preview-device { background: white; box-shadow: 0 16px 55px rgba(15,23,42,.16); transition: width .25s ease; overflow: hidden; }
.preview-device.desktop { width: min(100%, 1180px); height: calc(100vh - 174px); min-height: 580px; border-radius: 12px; }
.preview-device.mobile { width: 390px; height: calc(100vh - 150px); min-height: 620px; border-radius: 28px; border: 8px solid #111827; }
.preview-device iframe { width: 100%; height: 100%; border: 0; background: #fff; }

.score-card { display: grid; grid-template-columns: 62px 1fr; gap: 13px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(145deg, #fff, #f8fafc); }
.score-ring { --score: 0; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; position: relative; background: conic-gradient(var(--primary) calc(var(--score) * 1%), #e2e8f0 0); }
.score-ring::before { content: ""; width: 48px; height: 48px; border-radius: 50%; background: #fff; position: absolute; }
.score-ring span { position: relative; z-index: 1; font-family: Manrope, Inter, sans-serif; font-size: 17px; font-weight: 800; }
.score-card h3 { margin: 0 0 4px; font-size: 13px; }
.score-card p:not(.section-kicker) { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.assistant-section { margin-top: 22px; }
.assistant-heading { margin-bottom: 9px; }
.assistant-heading span { padding: 3px 7px; border-radius: 999px; background: var(--surface-tint); }
.checklist, .issues-list { display: grid; gap: 7px; }
.check-item, .issue-item { display: grid; grid-template-columns: 19px 1fr; gap: 8px; align-items: start; padding: 9px; border-radius: 10px; background: var(--surface-soft); border: 1px solid var(--line); }
.check-icon, .issue-icon { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; font-size: 9px; font-weight: 800; }
.check-item.pass .check-icon { color: var(--success); background: var(--success-soft); }
.check-item.fail .check-icon { color: var(--warning); background: var(--warning-soft); }
.check-item strong, .issue-item strong { display: block; font-size: 9px; line-height: 1.4; }
.check-item small, .issue-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.issue-item.high { background: var(--danger-soft); border-color: #fecaca; }
.issue-item.high .issue-icon { color: var(--danger); background: #fee2e2; }
.issue-item.medium { background: var(--warning-soft); border-color: #fde68a; }
.issue-item.medium .issue-icon { color: var(--warning); background: #fef3c7; }
.empty-issues { padding: 15px; text-align: center; color: var(--muted); font-size: 10px; line-height: 1.5; background: var(--success-soft); border: 1px solid #a7f3d0; border-radius: 10px; }
.export-box { padding: 15px; border-radius: 14px; background: #0f172a; color: #fff; }
.export-box h3 { margin: 0; font-size: 13px; }
.export-box > p { margin: 7px 0 13px; color: #94a3b8; font-size: 9px; line-height: 1.5; }
.export-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 9px; }
.export-links button { padding: 7px 5px; color: #cbd5e1; border: 1px solid #334155; border-radius: 8px; background: #1e293b; font-size: 8px; font-weight: 700; }
.export-links button:hover { color: #fff; border-color: #475569; }

.email-list, .traffic-cards { display: grid; gap: 9px; }
.email-card, .traffic-card { width: 100%; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.email-card:hover, .traffic-card:hover { border-color: #93c5fd; background: #fbfdff; }
.email-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.email-card b, .traffic-card b { font-size: 10px; }
.email-card span { color: var(--primary); background: var(--primary-soft); border-radius: 999px; padding: 3px 6px; font-size: 8px; font-weight: 800; }
.email-card p, .traffic-card p { margin: 6px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.email-editor .back-link { padding: 0; margin-bottom: 13px; border: 0; color: var(--primary); background: transparent; font-size: 10px; font-weight: 700; }
.traffic-card { position: relative; padding-right: 42px; }
.traffic-card button { position: absolute; top: 9px; right: 9px; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fff; font-size: 10px; }
.traffic-card small { display: block; margin-bottom: 5px; color: var(--primary); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.lead-magnet-items { display: grid; gap: 8px; }
.magnet-item-editor { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.magnet-item-row { display: grid; grid-template-columns: 1fr 28px; gap: 6px; }
.magnet-remove { border: 1px solid #fecaca; border-radius: 8px; color: var(--danger); background: #fff; }

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 9px; }
.toast { min-width: 240px; max-width: 360px; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--success); border-radius: 10px; background: #fff; box-shadow: var(--shadow-lg); color: var(--ink-soft); font-size: 11px; animation: toastIn .2s ease; }
.toast.error { border-left-color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px; background: rgba(15,23,42,.58); backdrop-filter: blur(4px); }
.modal-card { width: min(420px, 100%); padding: 24px; border-radius: 18px; background: #fff; box-shadow: var(--shadow-lg); }
.modal-card h2 { margin: 0 0 8px; font-family: Manrope, Inter, sans-serif; font-size: 20px; }
.modal-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 310px minmax(430px, 1fr) 270px; }
  .assistant-panel { padding: 15px; }
}
@media (max-width: 980px) {
  .workspace { height: auto; min-height: calc(100vh - 70px); grid-template-columns: 320px 1fr; overflow: visible; }
  .assistant-panel { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; overflow: visible; }
  .score-card { align-self: start; }
  .assistant-section { margin-top: 0; }
  .export-box { grid-column: span 3; }
  .preview-device.desktop { height: 720px; }
  .preview-device.mobile { height: 720px; }
  .template-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .topbar { height: 62px; padding: 0 14px; }
  .brand small, .save-status, #newProjectBtn { display: none; }
  .onboarding { padding: 36px 14px 60px; min-height: calc(100vh - 62px); }
  .hero-copy { margin-bottom: 24px; }
  .hero-copy h1 { font-size: 38px; }
  .hero-copy > p { font-size: 15px; }
  .hero-points { align-items: flex-start; flex-direction: column; width: max-content; margin-left: auto; margin-right: auto; }
  .setup-progress { height: 64px; padding: 0 12px; }
  .setup-step { font-size: 0; gap: 0; }
  .setup-step span { font-size: 12px; }
  .step-line { width: 42px; margin: 0 8px; }
  .setup-panel { padding: 24px 18px; }
  .panel-heading h2 { font-size: 24px; }
  .form-grid.two-col, .form-grid.three-col { grid-template-columns: 1fr; gap: 0; }
  .template-grid { grid-template-columns: repeat(2, 1fr); }
  .template-card { min-height: 165px; }
  .form-actions.split { gap: 10px; }
  .form-actions.split .btn { flex: 1; }

  .workspace { min-height: calc(100vh - 62px); grid-template-columns: 1fr; }
  .editor-panel { border-right: 0; border-bottom: 1px solid var(--line); max-height: none; }
  .campaign-title-row { padding: 15px; }
  .workspace-tabs { position: sticky; top: 62px; z-index: 20; background: #fff; }
  .editor-scroll { max-height: none; overflow: visible; }
  .preview-panel { min-height: 720px; }
  .preview-toolbar { position: sticky; top: 100px; z-index: 15; }
  .preview-stage { padding: 14px; }
  .preview-device.desktop { height: 680px; }
  .preview-device.mobile { width: min(390px, 100%); height: 680px; }
  .assistant-panel { display: block; padding: 16px; }
  .assistant-section { margin-top: 18px; }
  .export-box { margin-bottom: 20px; }
}
@media (max-width: 430px) {
  .brand strong { font-size: 13px; }
  .topbar-actions { gap: 6px; }
  #topExportBtn { padding: 8px 10px; }
  .hero-copy h1 { font-size: 34px; }
  .template-grid { grid-template-columns: 1fr; }
  .template-card { min-height: 150px; display: grid; grid-template-columns: 112px 1fr; grid-template-rows: auto 1fr; column-gap: 12px; }
  .template-thumb { grid-row: 1 / 3; height: 100px; }
  .template-card strong { margin-top: 8px; }
  .preview-actions .btn:first-child { display: none; }
}
.projects-modal-card { width: min(620px, 100%); max-height: min(720px, calc(100vh - 40px)); display: flex; flex-direction: column; }
.projects-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.projects-modal-head h2 { margin: 0; }
.projects-modal-head .icon-btn { font-size: 19px; }
.projects-list { min-height: 110px; overflow-y: auto; display: grid; gap: 9px; }
.project-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.project-row.current { border-color: #93c5fd; background: var(--primary-soft); }
.project-row h3 { margin: 0; font-size: 12px; }
.project-row p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.project-row-actions { display: flex; gap: 6px; }
.project-row-actions button { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink-soft); font-size: 9px; font-weight: 800; }
.project-row-actions button:hover { border-color: #93c5fd; color: var(--primary); }
.project-row-actions button.delete { color: var(--danger); border-color: #fecaca; }
.projects-empty { padding: 28px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 12px; font-size: 11px; line-height: 1.6; }
.split-actions { justify-content: space-between; }
@media (max-width: 760px) { #projectsBtn { display: none; } .project-row { grid-template-columns: 1fr; } .project-row-actions { justify-content: flex-end; } }

/* --------------------------------------------------------------------------
   Public SEO landing + AI funnel entry
   -------------------------------------------------------------------------- */
.public-landing { width: 100%; }
.seo-hero { width: min(1120px, 100%); margin: 0 auto; }
.seo-hero-copy { margin-bottom: 30px; }
.seo-hero-copy h1 { max-width: 900px; }
.ai-builder-card {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 32px;
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(203,213,225,.9);
  border-radius: 26px;
  box-shadow: 0 30px 90px rgba(15,23,42,.14);
  position: relative;
  overflow: hidden;
}
.ai-builder-card::before { content:""; position:absolute; inset:0 0 auto; height:4px; background:linear-gradient(90deg,#2563eb,#10b981,#2563eb); }
.ai-builder-card.is-processing { opacity:.72; pointer-events:none; }
.builder-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:24px; }
.builder-card-head h2 { margin:0; font-family:Manrope,Inter,sans-serif; font-size:28px; letter-spacing:-.025em; }
.builder-card-head p:not(.section-kicker) { margin:8px 0 0; max-width:620px; color:var(--muted); font-size:14px; line-height:1.65; }
.free-badge { display:inline-flex; align-items:center; justify-content:center; min-width:58px; padding:8px 12px; border-radius:999px; color:#047857; background:#ecfdf5; border:1px solid #a7f3d0; font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; }
.ai-form-grid { grid-template-columns:minmax(0,1.35fr) minmax(180px,.65fr) !important; }
.url-input-wrap { position:relative; }
.url-input-wrap svg { position:absolute; top:50%; left:15px; transform:translateY(-50%); width:20px; height:20px; color:#64748b; pointer-events:none; }
.url-input-wrap input { min-height:54px; padding-left:46px; font-size:15px; border-width:1.5px; }
.builder-submit-row { display:flex; align-items:center; gap:18px; margin-top:4px; }
.builder-submit-row > p { margin:0; max-width:330px; color:var(--muted); font-size:10px; line-height:1.55; }
.ai-submit { min-width:270px; min-height:52px; }
.manual-fallback { margin-top:20px; padding-top:18px; text-align:center; color:var(--muted); border-top:1px solid var(--line); font-size:12px; }
.manual-fallback button, .manual-back-link { border:0; padding:0; color:var(--primary); background:transparent; font-weight:800; text-decoration:underline; text-underline-offset:3px; }
.manual-back-link { display:block; margin:0 auto 12px; font-size:12px; text-decoration:none; }
.ai-error { margin-top:16px; padding:12px 14px; color:#991b1b; background:#fef2f2; border:1px solid #fecaca; border-radius:11px; font-size:12px; line-height:1.55; }
.turnstile-slot { min-height:66px; margin:0 0 16px; }
.spinner { width:16px; height:16px; border:2px solid rgba(255,255,255,.45); border-top-color:#fff; border-radius:50%; animation:spin .7s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

.analysis-progress {
  width:min(900px,100%);
  min-height:210px;
  margin:36px auto 0;
  padding:34px;
  display:grid;
  grid-template-columns:120px 1fr;
  align-items:center;
  gap:30px;
  border-radius:24px;
  color:#e2e8f0;
  background:linear-gradient(135deg,#0f172a,#172554 58%,#1e3a8a);
  box-shadow:0 28px 70px rgba(15,23,42,.22);
}
.analysis-progress .section-kicker { color:#93c5fd; }
.analysis-progress h2 { margin:0; color:#fff; font-family:Manrope,Inter,sans-serif; font-size:27px; }
.analysis-progress p:not(.section-kicker) { margin:8px 0 18px; color:#cbd5e1; font-size:13px; line-height:1.65; }
.progress-orbit { width:104px; height:104px; position:relative; display:grid; place-items:center; border:1px solid rgba(147,197,253,.28); border-radius:50%; }
.progress-orbit span { width:64px; height:64px; display:grid; place-items:center; color:#fff; background:linear-gradient(145deg,#2563eb,#10b981); border-radius:20px; font-family:Manrope,Inter,sans-serif; font-weight:800; box-shadow:0 12px 30px rgba(37,99,235,.4); }
.progress-orbit i { position:absolute; width:8px; height:8px; border-radius:50%; background:#93c5fd; animation:orbit 2.4s linear infinite; transform-origin:52px 4px; left:48px; top:48px; }
.progress-orbit i:nth-child(3) { animation-delay:-.8s; background:#6ee7b7; }
.progress-orbit i:nth-child(4) { animation-delay:-1.6s; background:#fff; }
@keyframes orbit { from { transform:rotate(0deg) translateY(-48px); } to { transform:rotate(360deg) translateY(-48px); } }
.analysis-steps { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.analysis-steps span { padding:9px; text-align:center; color:#94a3b8; border:1px solid rgba(148,163,184,.2); border-radius:9px; font-size:9px; font-weight:800; }
.analysis-steps span.active { color:#fff; background:rgba(37,99,235,.32); border-color:#60a5fa; }
.analysis-steps span.complete { color:#a7f3d0; border-color:rgba(16,185,129,.5); }

.ai-results { width:min(1080px,100%); margin:48px auto 0; }
.results-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:20px; }
.results-heading h2, .keyword-heading h2 { margin:0; font-family:Manrope,Inter,sans-serif; font-size:clamp(27px,3vw,38px); letter-spacing:-.035em; }
.results-heading p:not(.section-kicker), .keyword-heading > p:not(.section-kicker) { margin:8px 0 0; max-width:700px; color:var(--muted); font-size:14px; line-height:1.7; }
.analysis-summary-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.analysis-summary-grid article { padding:20px; background:#fff; border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow-sm); }
.analysis-summary-grid small { display:block; margin-bottom:8px; color:var(--primary); font-size:9px; font-weight:800; text-transform:uppercase; letter-spacing:.1em; }
.analysis-summary-grid strong { display:block; font-family:Manrope,Inter,sans-serif; font-size:16px; line-height:1.35; }
.analysis-summary-grid p { margin:8px 0 0; color:var(--muted); font-size:11px; line-height:1.55; }
.result-preview-grid { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(310px,.75fr); gap:18px; margin-top:18px; }
.copy-preview-card, .locked-assets-card { border-radius:20px; box-shadow:var(--shadow-sm); }
.copy-preview-card { min-height:370px; padding:38px; background:linear-gradient(160deg,#fff,#f8fbff); border:1px solid #dbeafe; position:relative; overflow:hidden; }
.copy-preview-card::after { content:""; position:absolute; width:220px; height:220px; right:-85px; bottom:-95px; border-radius:50%; background:radial-gradient(circle,rgba(37,99,235,.18),transparent 68%); }
.preview-label { display:flex; justify-content:space-between; gap:10px; margin-bottom:50px; color:var(--muted); font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.preview-label b { color:#047857; }
.mini-eyebrow { margin:0 0 10px; color:var(--primary); font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.12em; }
.copy-preview-card h3 { max-width:630px; margin:0; font-family:Manrope,Inter,sans-serif; font-size:clamp(28px,3.2vw,43px); line-height:1.08; letter-spacing:-.045em; }
.copy-preview-card > p:not(.mini-eyebrow) { max-width:650px; margin:15px 0 20px; color:var(--muted); font-size:14px; line-height:1.7; }
.preview-benefits { display:flex; flex-wrap:wrap; gap:8px; position:relative; z-index:1; }
.preview-benefits span { padding:8px 10px; color:#334155; background:#fff; border:1px solid var(--line); border-radius:999px; font-size:10px; font-weight:700; }
.locked-assets-card { padding:28px; color:#e2e8f0; background:linear-gradient(145deg,#0f172a,#172554); border:1px solid #1e3a8a; }
.lock-mark { width:48px; height:48px; display:grid; place-items:center; color:#fff; background:#2563eb; border-radius:15px; font-size:23px; }
.locked-assets-card h3 { margin:18px 0 7px; color:#fff; font-family:Manrope,Inter,sans-serif; font-size:22px; }
.locked-assets-card > p { margin:0; color:#cbd5e1; font-size:12px; line-height:1.6; }
.locked-assets-card ul { margin:20px 0; padding:0; list-style:none; display:grid; gap:10px; }
.locked-assets-card li { position:relative; padding-left:22px; color:#e2e8f0; font-size:11px; }
.locked-assets-card li::before { content:"✓"; position:absolute; left:0; color:#6ee7b7; font-weight:900; }
.locked-assets-card > small { display:block; margin-top:12px; color:#94a3b8; font-size:8px; line-height:1.55; text-align:center; }

.keyword-section { width:min(1080px,100%); margin:90px auto 0; }
.keyword-heading { max-width:780px; margin-bottom:28px; }
.steps-grid, .seo-feature-grid { display:grid; gap:14px; }
.steps-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
.steps-grid article, .seo-feature-grid article { background:#fff; border:1px solid var(--line); border-radius:17px; box-shadow:var(--shadow-sm); }
.steps-grid article { padding:22px; }
.steps-grid article > span { width:36px; height:36px; display:grid; place-items:center; margin-bottom:28px; color:#fff; background:var(--primary); border-radius:11px; font-size:12px; font-weight:800; box-shadow:0 8px 20px rgba(37,99,235,.2); }
.steps-grid h3, .seo-feature-grid h3 { margin:0; font-family:Manrope,Inter,sans-serif; font-size:15px; }
.steps-grid p, .seo-feature-grid p { margin:8px 0 0; color:var(--muted); font-size:11px; line-height:1.65; }
.feature-keyword-section { padding:48px; background:#eef4ff; border:1px solid #dbeafe; border-radius:28px; }
.seo-feature-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.seo-feature-grid article { padding:22px; }
.seo-feature-grid article > div { width:38px; height:38px; display:grid; place-items:center; margin-bottom:20px; color:var(--primary); background:var(--primary-soft); border-radius:11px; font-weight:900; }
.faq-list { display:grid; gap:10px; }
.faq-list details { padding:0 20px; background:#fff; border:1px solid var(--line); border-radius:14px; }
.faq-list summary { padding:18px 0; cursor:pointer; font-family:Manrope,Inter,sans-serif; font-size:14px; font-weight:800; }
.faq-list details p { margin:0 0 18px; color:var(--muted); font-size:12px; line-height:1.75; }
.public-footer { width:min(1080px,100%); margin:80px auto -40px; padding:30px 0 0; display:grid; grid-template-columns:1fr auto; gap:18px; border-top:1px solid var(--line); }
.public-footer strong { font-family:Manrope,Inter,sans-serif; }
.public-footer p { margin:5px 0 0; color:var(--muted); font-size:10px; line-height:1.6; }
.public-footer nav { display:flex; gap:16px; align-items:flex-start; }
.public-footer a { color:var(--ink-soft); font-size:10px; font-weight:700; text-decoration:none; }
.public-footer a:hover { color:var(--primary); }
.footer-disclaimer { grid-column:1 / -1; max-width:900px; }

.unlock-modal-card { width:min(480px,100%); text-align:center; position:relative; }
.modal-close { position:absolute; top:13px; right:13px; width:34px; height:34px; border:1px solid var(--line); border-radius:10px; color:var(--muted); background:#fff; font-size:20px; }
.unlock-icon { width:56px; height:56px; display:grid; place-items:center; margin:0 auto 15px; color:#fff; background:linear-gradient(145deg,#2563eb,#10b981); border-radius:18px; font-size:24px; box-shadow:0 12px 28px rgba(37,99,235,.25); }
.unlock-modal-card h2 { margin:0; font-family:Manrope,Inter,sans-serif; font-size:25px; }
.unlock-modal-card > p:not(.section-kicker) { margin:8px auto 20px; max-width:390px; color:var(--muted); font-size:12px; line-height:1.6; }
.unlock-modal-card .field { text-align:left; }
.lead-consent { margin:12px 0 0; color:var(--muted); font-size:8px; line-height:1.55; }
.lead-consent a { color:var(--primary); }
.honeypot { position:absolute !important; left:-9999px !important; width:1px !important; height:1px !important; overflow:hidden !important; }

#manualSetupCard { margin-top:0; }
#manualSetupCard .setup-progress { position:relative; }
#manualSetupCard .manual-back-link { position:absolute; left:24px; }

@media (max-width: 850px) {
  .ai-form-grid { grid-template-columns:1fr !important; gap:0; }
  .builder-submit-row { align-items:stretch; flex-direction:column; }
  .builder-submit-row > p { max-width:none; text-align:center; }
  .analysis-summary-grid { grid-template-columns:1fr; }
  .result-preview-grid { grid-template-columns:1fr; }
  .steps-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .seo-feature-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .onboarding { padding-left:14px; padding-right:14px; }
  .ai-builder-card { padding:24px 18px; border-radius:20px; }
  .builder-card-head { display:block; }
  .free-badge { margin-top:14px; }
  .ai-submit { min-width:0; width:100%; }
  .analysis-progress { grid-template-columns:1fr; text-align:center; padding:28px 18px; }
  .progress-orbit { margin:0 auto; }
  .analysis-steps { grid-template-columns:repeat(2,1fr); }
  .results-heading { display:block; }
  .results-heading .btn { margin-top:14px; }
  .copy-preview-card { padding:28px 20px; }
  .preview-label { margin-bottom:34px; }
  .steps-grid, .seo-feature-grid { grid-template-columns:1fr; }
  .feature-keyword-section { padding:30px 18px; }
  .keyword-section { margin-top:64px; }
  .public-footer { grid-template-columns:1fr; }
  .public-footer nav { flex-wrap:wrap; }
  #manualSetupCard .manual-back-link { position:static; margin:0 0 8px; }
  #manualSetupCard .setup-progress { height:auto; min-height:76px; padding-top:12px; flex-wrap:wrap; }
}
.public-nav-link, .public-nav-cta { display:none; }
.public-mode .topbar-actions > .save-status,
.public-mode .topbar-actions > #projectsBtn,
.public-mode .topbar-actions > #importProjectBtn,
.public-mode .topbar-actions > #newProjectBtn,
.public-mode .topbar-actions > #topExportBtn,
.manual-mode .public-nav-link,
.manual-mode .public-nav-cta,
.workspace-mode .public-nav-link,
.workspace-mode .public-nav-cta { display:none; }
.public-mode .public-nav-link { display:inline-flex; color:var(--ink-soft); font-size:12px; font-weight:800; text-decoration:none; }
.public-mode .public-nav-cta { display:inline-flex; }
@media (max-width:560px) { .public-mode .public-nav-link { display:none; } }
