/* === WebzQuiz — Hebrew RTL design system === */

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #fafaf9;
  --border: #e7e5e2;
  --border-strong: #d6d3ce;
  --ink: #18181b;
  --ink-2: #3f3f46;
  --ink-3: #71717a;
  --ink-4: #a1a1aa;
  --accent: #4f46e5;
  --accent-2: #6366f1;
  --accent-soft: #eef2ff;
  --accent-ink: #312e81;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --info: #0ea5e9;
  --info-soft: #e0f2fe;
  --font-sans: "Heebo", "Assistant", system-ui, -apple-system, sans-serif;
  --font-display: "Heebo", "Assistant", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(15,15,15,.04), 0 1px 1px rgba(15,15,15,.03);
  --shadow-md: 0 4px 12px rgba(15,15,15,.06), 0 2px 4px rgba(15,15,15,.04);
  --shadow-lg: 0 12px 32px rgba(15,15,15,.08), 0 4px 8px rgba(15,15,15,.04);
}

body[data-theme="indigo"]  { --accent: #4f46e5; --accent-2: #6366f1; --accent-soft: #eef2ff; --accent-ink: #312e81; }
body[data-theme="emerald"] { --accent: #059669; --accent-2: #10b981; --accent-soft: #d1fae5; --accent-ink: #064e3b; }
body[data-theme="rose"]    { --accent: #e11d48; --accent-2: #f43f5e; --accent-soft: #ffe4e6; --accent-ink: #881337; }
body[data-theme="amber"]   { --accent: #d97706; --accent-2: #f59e0b; --accent-soft: #fef3c7; --accent-ink: #78350f; }
body[data-theme="slate"]   { --accent: #18181b; --accent-2: #3f3f46; --accent-soft: #f4f4f5; --accent-ink: #18181b; }

body[data-type="heebo"]     { --font-sans: "Heebo", system-ui, sans-serif; --font-display: "Heebo", system-ui, sans-serif; }
body[data-type="assistant"] { --font-sans: "Assistant", system-ui, sans-serif; --font-display: "Assistant", system-ui, sans-serif; }
body[data-type="rubik"]     { --font-sans: "Rubik", system-ui, sans-serif; --font-display: "Rubik", system-ui, sans-serif; }
body[data-type="frank"]     { --font-sans: "Heebo", system-ui, sans-serif; --font-display: "Frank Ruhl Libre", serif; }
body[data-type="frank"] h1, body[data-type="frank"] h2 { font-family: var(--font-display); font-weight: 700; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font: 500 13.5px/1 var(--font-sans);
  cursor: pointer;
  transition: background 120ms, border-color 120ms, transform 120ms;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; border-color: #000; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 14.5px; border-radius: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { width: 36px; padding: 0; justify-content: center; }
.btn-sm.btn-icon { width: 30px; }
.btn[disabled], .btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px;
  border-radius: 999px;
  font: 500 11.5px/1 var(--font-sans);
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--border);
}
.pill-success { background: var(--success-soft); color: #166534; border-color: transparent; }
.pill-warn    { background: var(--warn-soft); color: #92400e; border-color: transparent; }
.pill-info    { background: var(--info-soft); color: #075985; border-color: transparent; }
.pill-accent  { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.pill-danger  { background: var(--danger-soft); color: #991b1b; border-color: transparent; }
.pill-muted   { background: #f4f4f5; color: var(--ink-3); border-color: transparent; }

.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.card-pad { padding: 20px; }
.card-hd { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }

/* Inputs */
.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
  font: 14px/1 var(--font-sans);
  outline: none;
  transition: border-color 120ms, box-shadow 120ms;
  font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; min-height: 84px; }
.input-lg { height: 44px; font-size: 15px; padding: 0 14px; border-radius: 12px; }

.label { display: block; font: 500 12px/1 var(--font-sans); color: var(--ink-3); margin-bottom: 6px; letter-spacing: 0.01em; }
.help-text { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* Layout */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.start { justify-content: flex-start; }
.end { justify-content: flex-end; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.flex-1 { flex: 1; min-width: 0; }
.tnum { font-variant-numeric: tabular-nums; }

/* Scrollbar */
.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-thumb { background: #d6d3ce; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
.scroll::-webkit-scrollbar-track { background: transparent; }

/* Tab link */
.tab-link { position: relative; padding: 10px 0; color: var(--ink-3); font: 500 13px/1 var(--font-sans); cursor: pointer; }
.tab-link.active { color: var(--ink); }
.tab-link.active::after {
  content: ''; position: absolute; inset-inline: 0; bottom: -1px;
  height: 2px; background: var(--ink); border-radius: 2px;
}

.spark { stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark-area { fill: var(--accent); opacity: 0.08; }

.progress { height: 6px; background: #efece8; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ink); border-radius: 999px; transition: width 220ms; }

.kbd { font: 500 11px/1 var(--font-mono); padding: 3px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2); color: var(--ink-3); }

.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 11px/1 var(--font-sans); color: #fff;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  flex-shrink: 0;
}

/* App layout */
.app { display: flex; height: 100vh; min-height: 0; }
.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.sidebar {
  width: 232px; flex-shrink: 0;
  background: var(--surface);
  border-inline-start: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 18px 12px; gap: 4px;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px 14px; border-bottom: 1px solid var(--border); margin-bottom: 10px;
}
.sidebar-brand .mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, #4f46e5, #ec4899);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px;
  box-shadow: 0 4px 10px rgba(79,70,229,0.3);
}
.brand-text { font-weight: 800; font-size: 14px; letter-spacing: -0.01em; }
.brand-text .grad { background: linear-gradient(135deg, #4f46e5, #ec4899); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.brand-sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

.nav-link {
  display: flex; align-items: center; gap: 12px;
  height: 36px; padding: 0 10px; border-radius: 8px;
  color: var(--ink-2); font-weight: 500; font-size: 13.5px;
  cursor: pointer; text-decoration: none;
}
.nav-link:hover { background: var(--surface-2); }
.nav-link.active { color: var(--ink); background: var(--surface-2); font-weight: 600; }
.nav-link .pill { margin-inline-start: auto; }

.sidebar-section {
  margin: 16px 10px 6px;
  font-size: 11px; color: var(--ink-4);
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;
}
.plan-badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px;
  background: linear-gradient(135deg, #4f46e5, #ec4899);
  color: #fff; letter-spacing: 0.04em; text-transform: uppercase;
}
.recent-link {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 6px;
  font-size: 12.5px; color: var(--ink-2); text-decoration: none;
  font-weight: 500;
}
.recent-link:hover { background: var(--surface-2); }
.recent-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.recent-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 10px; }
.sidebar-user { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; }
.sidebar-user .name { font-size: 13px; font-weight: 600; }
.sidebar-user .role { font-size: 11px; color: var(--ink-3); }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 28px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.topbar h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.topbar .sub { margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.topbar .search-wrap { position: relative; width: 280px; }
.topbar .search-wrap .icon { position: absolute; inset-inline-start: 12px; top: 10px; color: var(--ink-4); }
.topbar .search-wrap .kbd { position: absolute; inset-inline-end: 8px; top: 7px; }
.company-switcher { display: flex; }
.company-switcher .select { width: auto; min-width: 160px; max-width: 220px; padding-inline-end: 28px; font-weight: 500; }

.app-content { flex: 1; overflow-y: auto; padding: 24px 28px; display: flex; flex-direction: column; gap: 20px; }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { padding: 20px; }
.kpi .label { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.kpi .value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.kpi .meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--ink-3); }

/* Table */
.qtable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.qtable thead th {
  background: var(--surface-2); color: var(--ink-3); font-size: 12px; font-weight: 500; text-align: right;
  padding: 10px 12px;
}
.qtable tbody tr { border-top: 1px solid var(--border); }
.qtable tbody td { padding: 14px 12px; vertical-align: middle; }
.qtable tbody tr:hover { background: var(--surface-2); }
.qtable .icon-tile {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700; color: var(--ink-2);
  flex-shrink: 0;
}

/* Lead row */
.lead-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--border); }
.lead-row:first-child { border-top: 0; }
.lead-row .info { min-width: 0; display: flex; align-items: center; gap: 12px; }
.lead-row .info .text { min-width: 0; }
.lead-row .info .name { font-weight: 600; font-size: 13.5px; }
.lead-row .info .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Score chip */
.score-chip { font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.score-chip.high  { background: var(--success-soft); color: #166534; }
.score-chip.mid   { background: var(--warn-soft); color: #92400e; }

/* Funnel bars */
.funnel-bar { height: 22px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.funnel-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 6px; }

/* AI hero */
.ai-hero {
  background: linear-gradient(135deg, #18181b 0%, #312e81 100%);
  color: #fff; border: none; overflow: hidden; position: relative;
  border-radius: var(--r-lg);
}
.ai-hero .glow {
  position: absolute; inset-inline-end: -40px; top: -40px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.4), transparent 70%);
}
.ai-hero .body { padding: 22px 24px; position: relative; }

/* Templates grid */
.templates { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.template-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; cursor: pointer; transition: transform 120ms, box-shadow 120ms; background: var(--surface); }
.template-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.template-card .top { height: 78px; display: grid; place-items: center; }
.template-card .top span { font-size: 24px; font-weight: 800; color: rgba(0,0,0,0.55); letter-spacing: -0.03em; }
.template-card .bot { padding: 10px 12px; }

/* Auth pages */
.auth-page {
  min-height: 100vh; display: grid; place-items: center; background: var(--bg);
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 32px;
  box-shadow: var(--shadow-md);
}
.auth-card h1 { margin: 0 0 4px; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.auth-card .sub { font-size: 13px; color: var(--ink-3); margin-bottom: 24px; }
.auth-form .field { margin-bottom: 14px; }

/* Editor */
.editor { display: flex; flex-direction: column; height: 100vh; min-height: 0; }
.editor-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surface);
  gap: 16px;
}
.editor-modes {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--border);
}
.editor-modes button {
  height: 28px; padding: 0 12px; border: none; border-radius: 6px;
  background: transparent; color: var(--ink-3); font-size: 12.5px; font-weight: 500;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.editor-modes button.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }

.editor-main { flex: 1; display: flex; min-height: 0; }
.questions-list {
  width: 260px; border-inline-start: 1px solid var(--border); background: var(--surface);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.questions-list .head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.questions-list .body { flex: 1; overflow-y: auto; padding: 8px; }
.questions-list .foot { padding: 10px; border-top: 1px solid var(--border); }
.q-item {
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  background: transparent; border: 1px solid transparent;
  margin-bottom: 4px; transition: background 120ms;
}
.q-item:hover { background: var(--surface-2); }
.q-item.active { background: var(--accent-soft); border-color: var(--accent); }
.q-item .q-num {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--surface-2); color: var(--ink-3);
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
}
.q-item.active .q-num { background: var(--accent); color: #fff; }
.q-item .q-title {
  font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.4; margin-top: 4px;
}
.q-item.active .q-title { color: var(--accent-ink); }
.q-item .q-grip { color: var(--ink-4); cursor: grab; margin-inline-start: auto; }
.q-item .q-dup { background: transparent; border: none; color: var(--ink-4); cursor: pointer; padding: 2px; border-radius: 4px; display: grid; place-items: center; }
.q-item .q-dup:hover { color: var(--ink-2); background: var(--surface-2); }
.q-item.dragging { opacity: 0.4; }
.q-item.drag-over { box-shadow: 0 -2px 0 0 var(--accent) inset, 0 2px 0 0 var(--accent) inset; background: var(--accent-soft); }

.editor-mid {
  flex: 1; overflow-y: auto; padding: 24px 28px; background: var(--bg); min-width: 0;
}
.type-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.type-tile {
  padding: 10px 8px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--ink-2);
  cursor: pointer; font-size: 11.5px; font-weight: 500;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center;
}
.type-tile.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

.editor-preview {
  flex: 1; background: #f4f4f5; border-inline-start: 1px solid var(--border);
  display: flex; flex-direction: column; min-width: 0;
}
.editor-preview-bar { padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: space-between; }
.device-toggle {
  display: inline-flex; gap: 4px; padding: 3px;
  background: var(--surface-2); border-radius: 8px; border: 1px solid var(--border);
}
.device-toggle button { height: 26px; padding: 0 12px; border: none; border-radius: 5px; background: transparent; color: var(--ink-3); font-size: 12px; font-weight: 500; cursor: pointer; }
.device-toggle button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.editor-preview-stage { flex: 1; overflow-y: auto; padding: 32px 24px; display: grid; place-items: start center; }

.preview-frame {
  width: 560px; background: var(--surface); border-radius: 16px; border: 1px solid var(--border);
  box-shadow: var(--shadow-md); padding: 40px 36px;
}
.preview-frame.mobile {
  width: 320px; height: 640px; border-radius: 32px; border: 8px solid #18181b;
  box-shadow: var(--shadow-lg); padding: 32px 20px 24px; overflow: hidden; position: relative;
}

/* Question preview */
.qp { width: 100%; }
.qp h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 8px; line-height: 1.3; }
.qp .helper { font-size: 14px; color: var(--ink-3); margin-bottom: 20px; }
.qp .progress-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-bottom: 8px; }

.option-btn {
  padding: 14px 18px; border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--surface); text-align: start; font-size: 15px; font-weight: 500;
  cursor: pointer; transition: all 120ms; color: var(--ink); width: 100%;
  display: flex; align-items: center; gap: 12px; font-family: inherit;
}
.option-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.option-btn.selected { border-color: var(--accent); background: var(--accent-soft); }
.option-btn .letter {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--surface-2); display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--ink-3); border: 1px solid var(--border);
  flex-shrink: 0;
}
.option-btn.selected .letter { background: var(--accent); color: #fff; border-color: var(--accent); }

.option-list { display: flex; flex-direction: column; gap: 10px; }

.image-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.image-tile { border: 1.5px solid var(--border); border-radius: 12px; padding: 0; overflow: hidden; cursor: pointer; background: var(--surface); }
.image-tile.selected { border-color: var(--accent); }
.image-tile .swatch { height: 100px; }
.image-tile .lbl { padding: 10px 14px; font-size: 13px; font-weight: 500; text-align: start; }

.rating-row { display: flex; gap: 12px; justify-content: center; padding: 18px 0; }
.rating-btn {
  width: 56px; height: 56px; border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--ink-3); cursor: pointer;
  display: grid; place-items: center;
}
.rating-btn.selected { background: var(--accent); color: #fff; border-color: var(--accent); }

.brand-bar {
  padding: 16px 24px; border-bottom: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: space-between;
}

/* Public quiz layout */
.public-shell {
  min-height: 100vh; background: linear-gradient(180deg, var(--bg) 0%, #fff 100%);
  display: flex; flex-direction: column;
}
.public-stage {
  flex: 1; display: flex; flex-direction: column; align-items: stretch;
  padding: 40px 24px; gap: 24px;
}
/* Step wrappers must own their width so the inner card can hit max-width */
#step-cover, #step-quiz, #step-quiz > form {
  width: 100%; max-width: 680px; margin: 0 auto;
}
#step-quiz > form { display: flex; flex-direction: column; gap: 24px; }
.public-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(15,15,15,.04), 0 1px 2px rgba(15,15,15,.04);
  padding: 48px 56px;
}
@media (max-width: 720px) {
  .public-card { padding: 32px 20px; border-radius: 14px; }
  .public-stage { padding: 16px; }
}

.cover {
  width: 100%; max-width: 680px; text-align: center; margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(15,15,15,.04), 0 1px 2px rgba(15,15,15,.04);
  padding: 56px 48px;
}
.cover .badge {
  width: 64px; height: 64px; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  margin: 0 auto 24px; display: grid; place-items: center; color: #fff;
}
.cover h1 { font-size: 38px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 14px; }
.cover .lead { font-size: 16px; color: var(--ink-3); line-height: 1.6; margin: 0 0 32px; }
.cover .bullets { display: flex; gap: 12px; justify-content: center; margin-top: 32px; font-size: 12px; color: var(--ink-4); }
.cover-hero { width: 100%; max-width: 600px; aspect-ratio: 21/9; margin: 0 auto 24px; border-radius: 14px; background-size: cover; background-position: center; }

.public-footer {
  text-align: center; padding: 24px 16px;
  font-size: 12px; color: rgba(127,127,127,0.7);
  display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;
}
.public-footer a { text-decoration: none; }

.share-row { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.share-btn { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: 14px; transition: transform 120ms; }
.share-btn:hover { transform: translateY(-2px); background: var(--accent); color: #fff; }

.score-hero {
  text-align: center; padding: 32px 24px; margin-bottom: 24px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, #fce7f3 100%);
  border-radius: 20px; border: 1px solid var(--border);
}
.score-hero .label { font-size: 13px; color: var(--ink-3); font-weight: 500; margin-bottom: 8px; }

/* === Visual design editor === */
.design-controls {
  width: 360px; flex-shrink: 0;
  border-inline-start: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
  padding: 0;
}

.design-subtabs {
  display: flex; gap: 0;
  position: sticky; top: 0; z-index: 5;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 8px 8px 0;
  overflow-x: auto;
}
.design-subtabs button {
  flex: 1; min-width: 64px;
  padding: 10px 8px;
  border: none; background: transparent;
  border-bottom: 2px solid transparent;
  font: 600 11.5px/1 var(--font-sans);
  color: var(--ink-3); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  white-space: nowrap;
}
.design-subtabs button:hover { color: var(--ink-2); }
.design-subtabs button.active { color: var(--ink); border-bottom-color: var(--ink); }

.design-pane { padding: 18px; }

.seg-3 {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
  gap: 4px; padding: 3px;
  background: var(--surface-2); border-radius: 8px; border: 1px solid var(--border);
}
.seg-3 button {
  height: 30px; padding: 0 8px; border: none; border-radius: 5px;
  background: transparent; color: var(--ink-3); font-size: 12px; font-weight: 500;
  cursor: pointer; font-family: inherit;
}
.seg-3 button.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }

.toggle-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; cursor: pointer;
}
.toggle-row:last-child { margin-bottom: 0; }

.custom-color-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.custom-color-grid label { display: block; }
.ctrl-section { margin-bottom: 22px; }
.ctrl-section:last-child { margin-bottom: 0; }
.ctrl-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
  font-size: 13px; font-weight: 600; color: var(--ink);
}

.preset-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.preset-tile {
  padding: 8px; border: 1.5px solid var(--border);
  border-radius: 10px; background: var(--surface);
  cursor: pointer; text-align: start; font-family: inherit;
  transition: border-color 120ms;
}
.preset-tile:hover { border-color: var(--border-strong); }
.preset-tile.active { border-color: var(--accent); }
.preset-tile .preview {
  height: 50px; border-radius: 6px;
  margin-bottom: 6px;
  display: flex; align-items: flex-end; padding: 6px; gap: 4px;
  overflow: hidden; position: relative;
}
.preset-tile .preview .swatch {
  width: 12px; height: 12px; border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.05);
}
.preset-tile .name { font-size: 12px; font-weight: 600; }

.accent-swatch {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.accent-palette { display: flex; gap: 4px; flex-wrap: wrap; }
.accent-palette button {
  width: 28px; height: 28px; border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
}
.accent-palette button.active { border: 2px solid var(--ink); }

.font-stack { display: flex; flex-direction: column; gap: 6px; }
.font-tile {
  padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--surface); cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  font-family: inherit;
}
.font-tile.active { border-color: var(--accent); background: var(--accent-soft); }
.font-tile .lbl { display: flex; align-items: center; gap: 8px; }
.font-tile .lbl .aa { font-size: 12px; color: var(--ink-3); }
.font-tile .lbl .name { font-size: 13px; font-weight: 600; }
.font-tile .sample { font-size: 16px; font-weight: 600; }

.btn-style-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.btn-style-tile {
  padding: 10px 6px; border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--surface); cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 500;
}
.btn-style-tile.active { border-color: var(--accent); background: var(--accent-soft); }
.btn-style-tile .swatch { width: 36px; height: 18px; background: var(--ink); }

.pattern-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pattern-tile {
  aspect-ratio: 1; padding: 0;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--surface-2); cursor: pointer;
  color: var(--ink-3); position: relative; overflow: hidden;
}
.pattern-tile.active { border-color: var(--accent); }
.pattern-tile .name {
  position: relative; z-index: 1;
  font-size: 9px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  height: 100%;
}
.pattern-tile .pat-fill { position: absolute; inset: 0; opacity: 0.4; }

.logo-card {
  padding: 14px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 10px;
  display: flex; align-items: center; gap: 12px;
}
.logo-preview {
  width: 42px; height: 42px; border-radius: 8px;
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 18px;
  flex-shrink: 0;
  background-size: cover; background-position: center;
}

.anim-stack { display: flex; flex-direction: column; gap: 6px; }
.anim-tile {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; font-size: 12.5px; font-weight: 500;
  background: var(--surface);
  display: flex; align-items: center; gap: 8px;
}
.anim-tile.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }

.design-stage {
  flex: 1; background: #f4f4f5;
  border-inline-start: 1px solid var(--border);
  display: flex; flex-direction: column;
  min-width: 0; overflow: hidden;
}
.design-preview-area {
  flex: 1; overflow: auto; padding: 24px;
  display: grid; place-items: center;
  position: relative;
}

.live-frame {
  width: 540px; height: 600px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
  transition: background 200ms;
}
.live-frame.mobile {
  width: 320px; height: 640px;
  border-radius: 32px;
  border: 8px solid #18181b;
}
.live-frame .pattern-layer {
  position: absolute; inset: 0;
  opacity: 0.3;
  pointer-events: none;
}
.live-frame .lf-content {
  position: relative;
  padding: 40px 36px;
  height: 100%;
  display: flex; flex-direction: column;
}
.live-frame.mobile .lf-content { padding: 32px 22px; }
.live-frame .lf-progress {
  margin-bottom: 28px;
}
.live-frame .lf-progress-row {
  display: flex; justify-content: space-between;
  margin-bottom: 8px; font-size: 11px; opacity: 0.7;
}
.live-frame .lf-bar {
  height: 4px; background: rgba(127,127,127,0.25);
  border-radius: 999px; overflow: hidden;
}
.live-frame .lf-bar > span { display: block; height: 100%; border-radius: 999px; }
.live-frame h2 {
  font-size: 26px; font-weight: 800; letter-spacing: -0.01em;
  margin: 0 0 8px; line-height: 1.25;
}
.live-frame.mobile h2 { font-size: 20px; }
.live-frame .lf-helper { font-size: 14px; opacity: 0.7; margin: 0 0 24px; }
.live-frame .lf-options { display: flex; flex-direction: column; gap: 10px; }
.live-frame .lf-opt {
  padding: 14px 18px;
  border: 1.5px solid;
  font-family: inherit;
  font-size: 14px; font-weight: 600;
  text-align: start; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
}
.live-frame .lf-opt-letter {
  width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
}
.live-frame .lf-foot {
  margin-top: auto;
  display: flex; justify-content: space-between; align-items: center;
}
.live-frame .lf-back { background: transparent; border: none; opacity: 0.7; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; color: inherit; }
.live-frame .lf-next { padding: 12px 24px; border: none; color: #fff; font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }

/* Animations */
.anim-slide .lf-content { animation: lf-slide 320ms ease both; }
.anim-fade  .lf-content { animation: lf-fade  320ms ease both; }
.anim-scale .lf-content { animation: lf-scale 320ms cubic-bezier(.2,.8,.2,1) both; }
@keyframes lf-slide { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lf-fade  { from { opacity: 0; } to { opacity: 1; } }
@keyframes lf-scale { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

/* === Logic builder === */
.logic-sidebar {
  width: 260px; flex-shrink: 0;
  border-inline-start: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
  padding: 18px;
}
.logic-q-row {
  padding: 8px 10px; border-radius: 8px;
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px;
  cursor: default; font-size: 12.5px; font-weight: 500;
}
.logic-q-row .q-tag {
  width: 22px; height: 22px; border-radius: 5px;
  background: var(--surface-2); color: var(--ink-3);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.logic-q-row .q-text {
  flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.suggestion-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--ink-2);
  cursor: pointer; font-family: inherit;
  font-size: 12.5px; font-weight: 500; text-align: start;
  transition: background 120ms, border-color 120ms;
}
.suggestion-chip:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }

.rule-row {
  padding: 16px 18px;
  border-top: 1px solid var(--border);
}
.rule-row:first-child { border-top: 0; }
.rule-row .rule-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.rule-row .rule-num {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700;
}
.rule-chain {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.rule-chip {
  padding: 6px 10px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600;
  background: var(--surface); border: 1.5px solid var(--border);
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit;
}
.rule-chip.kw {
  background: var(--ink); color: #fff; border: none;
  font-weight: 700; font-size: 11px; padding: 6px 10px; border-radius: 999px;
}
.rule-chip.kw-soft {
  background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--border);
  font-weight: 700; font-size: 11px; border-radius: 999px;
}
.rule-chip.action-jump  { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.rule-chip.action-show  { background: var(--success-soft); color: #166534; border-color: transparent; }
.rule-chip.action-hide  { background: var(--surface-2); color: var(--ink-3); border-color: transparent; }
.rule-chip.action-end   { background: var(--danger-soft); color: #991b1b; border-color: transparent; }
.rule-chip.action-tag   { background: var(--info-soft); color: #075985; border-color: transparent; }
.rule-chip.action-score { background: var(--warn-soft); color: #92400e; border-color: transparent; }
.rule-chip select, .rule-chip input {
  border: none; outline: none; background: transparent;
  font: inherit; color: inherit; padding: 0;
  min-width: 60px;
}

.flow-diagram {
  background: var(--surface-2); border-radius: 10px;
  padding: 24px;
  display: flex; gap: 12px; align-items: center;
  flex-wrap: wrap; min-height: 100px;
  position: relative;
}
.flow-node {
  flex: 0 0 130px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  display: flex; flex-direction: column; gap: 4px;
  position: relative; z-index: 2;
}
.flow-node .num { font-size: 10px; color: var(--ink-4); font-weight: 600; }
.flow-node .text {
  font-size: 11px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.flow-arrow {
  flex: 0 0 32px; height: 2px; background: var(--border-strong);
  position: relative;
}

/* === Field config (Results tab) === */
.field-config-grid { display: flex; flex-direction: column; gap: 8px; }
.field-config-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  gap: 12px;
}
.field-config-row .field-label { display: flex; align-items: center; gap: 12px; }
.field-config-row .field-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface-2); color: var(--ink-3);
  display: grid; place-items: center; flex-shrink: 0;
}
.field-options {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--surface-2); border-radius: 8px; border: 1px solid var(--border);
}
.field-opt {
  height: 28px; padding: 0 12px; border: none; border-radius: 6px;
  background: transparent; color: var(--ink-3); font-size: 12.5px; font-weight: 500;
  cursor: pointer; font-family: inherit;
}
.field-opt:hover { color: var(--ink-2); }
.field-opt.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.field-opt[data-value="hidden"].active   { color: var(--ink-3); }
.field-opt[data-value="required"].active { color: var(--accent-ink); background: var(--accent-soft); }

/* === Dashboard upgrades === */
.range-tabs {
  display: inline-flex; gap: 4px; padding: 3px;
  background: var(--surface); border-radius: 10px;
  border: 1px solid var(--border);
}
.range-tabs a {
  height: 30px; padding: 0 14px;
  border-radius: 7px;
  display: inline-flex; align-items: center;
  font-size: 13px; font-weight: 500;
  color: var(--ink-3); text-decoration: none;
}
.range-tabs a:hover { background: var(--surface-2); color: var(--ink-2); }
.range-tabs a.active { background: var(--ink); color: #fff; font-weight: 600; }

.dash-search { position: relative; min-width: 320px; }
.dash-search .input { padding-inline-start: 36px; height: 38px; }
.dash-search::before {
  content: ''; position: absolute; inset-inline-start: 12px; top: 11px;
  width: 16px; height: 16px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.5-3.5'/></svg>") no-repeat;
  pointer-events: none;
}
.dash-search-results {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0;
  width: 100%; max-height: 380px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  display: none; z-index: 50;
  padding: 4px;
}
.dash-search-section {
  padding: 10px 12px 4px;
  font-size: 11px; font-weight: 600;
  color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.05em;
}
.dash-search-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 8px;
  font-size: 13.5px; color: var(--ink); text-decoration: none;
}
.dash-search-item:hover { background: var(--surface-2); }
.dash-search-item .ico { font-size: 14px; opacity: 0.7; }
.dash-search-empty { padding: 20px; text-align: center; color: var(--ink-3); font-size: 13px; }

.analytics-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.analytics-card {
  padding: 4px 0;
}
.analytics-title { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 10px; }
.analytics-bars { display: flex; flex-direction: column; gap: 8px; }
.analytics-row { display: grid; grid-template-columns: minmax(60px, 100px) 1fr 36px; align-items: center; gap: 10px; font-size: 12.5px; }
.analytics-row .lbl { color: var(--ink-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analytics-row .bar { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.analytics-row .bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; }
.analytics-row .cnt { text-align: end; color: var(--ink-2); font-weight: 600; }

/* === Leads filter + bulk === */
.filter-bar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px;
}
.filter-bar .input, .filter-bar .select { height: 34px; }
.bulk-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--ink); color: #fff;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 13.5px;
}
.bulk-bar .btn-danger { background: #ef4444; border-color: #ef4444; }

/* Helper utilities */
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.text-center { text-align: center; }
.text-end { text-align: end; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }

/* Toasts */
.toast-stack {
  position: fixed;
  top: 20px;
  inset-inline-end: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
  max-width: calc(100vw - 40px);
  width: 360px;
}
.toast {
  pointer-events: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink);
  position: relative;
  overflow: hidden;
  animation: toast-in 220ms cubic-bezier(.2,.8,.2,1);
}
.toast.leaving { animation: toast-out 180ms ease forwards; }
.toast .toast-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--surface-2); color: var(--ink-3);
}
.toast .toast-body { flex: 1; min-width: 0; }
.toast .toast-title { font-weight: 600; font-size: 13.5px; }
.toast .toast-msg { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.toast .toast-close {
  background: transparent; border: none; cursor: pointer;
  color: var(--ink-4); padding: 2px; margin-inline-start: 4px;
  border-radius: 6px; display: grid; place-items: center;
}
.toast .toast-close:hover { background: var(--surface-2); color: var(--ink-2); }
.toast::after {
  content: ''; position: absolute; bottom: 0; inset-inline-start: 0;
  height: 3px; width: 100%;
  background: var(--accent);
  transform-origin: inset-inline-start center;
  animation: toast-bar var(--toast-life, 4000ms) linear forwards;
}
.toast.success .toast-icon { background: var(--success-soft); color: #166534; }
.toast.success::after { background: #16a34a; }
.toast.error .toast-icon { background: var(--danger-soft); color: #991b1b; }
.toast.error::after { background: var(--danger); }
.toast.info .toast-icon { background: var(--info-soft); color: #075985; }
.toast.info::after { background: var(--info); }
.toast.warn .toast-icon { background: var(--warn-soft); color: #92400e; }
.toast.warn::after { background: var(--warn); }

@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes toast-out {
  to { transform: translateX(20px); opacity: 0; }
}
@keyframes toast-bar {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}
[dir="rtl"] .toast::after {
  transform-origin: right center;
}

/* Empty state */
.empty {
  padding: 48px 24px; text-align: center; color: var(--ink-3);
  border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--surface);
}
.empty .icon-wrap {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--surface-2); display: grid; place-items: center; margin: 0 auto 14px; color: var(--ink-4);
}

/* Logo bar (in editor / public) */
.brand-mini { display: flex; align-items: center; gap: 8px; }
.brand-mini .mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: linear-gradient(135deg, #4f46e5, #ec4899);
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 11px;
}

/* Responsive tweaks */
@media (max-width: 980px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .templates { grid-template-columns: repeat(3, 1fr); }
  .sidebar { width: 64px; padding: 12px 6px; }
  .sidebar .nav-link span:not(.pill) { display: none; }
  .sidebar-brand .brand-text, .sidebar-brand .brand-sub { display: none; }
  .topbar .search-wrap { display: none; }
  .editor-main { flex-direction: column; }
  .questions-list { width: 100%; max-height: 200px; }
  .editor-preview { display: none; }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .templates { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 14px 16px; }
  .app-content { padding: 14px 16px; }
  .cover h1 { font-size: 28px; }
}
