/* ============================================================
   QueryFan.com — Global Styles
   Design: Modern SaaS, dark-first, inspired by intentgaps.com
   ============================================================ */

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

:root {
  --bg:            #0a0a0f;
  --bg-card:       #12121a;
  --bg-card-hover: #181828;
  --bg-input:      #1a1a26;
  --border:        rgba(255,255,255,0.08);
  --border-focus:  rgba(108,99,255,0.6);

  --purple:        #6C63FF;
  --teal:          #00C9A7;
  --green:         #22c55e;
  --red:           #ef4444;
  --amber:         #f59e0b;
  --white:         #ffffff;
  --text-primary:  #f0f0f8;
  --text-secondary:#9898b8;
  --text-muted:    #5a5a78;

  --gradient-main: linear-gradient(135deg, #6C63FF 0%, #00C9A7 100%);
  --gradient-card: linear-gradient(135deg, rgba(108,99,255,0.08) 0%, rgba(0,201,167,0.04) 100%);

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 30px rgba(108,99,255,0.2);

  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Screen reader only ── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ── Background orbs ── */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 12s ease-in-out infinite alternate;
}
.bg-orb-1 { width: 600px; height: 600px; background: radial-gradient(circle, rgba(108,99,255,0.12) 0%, transparent 70%); top: -200px; right: -100px; animation-delay: 0s; }
.bg-orb-2 { width: 500px; height: 500px; background: radial-gradient(circle, rgba(0,201,167,0.08) 0%, transparent 70%); bottom: 10%; left: -150px; animation-delay: -4s; }
.bg-orb-3 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(108,99,255,0.06) 0%, transparent 70%); top: 50%; left: 50%; transform: translate(-50%, -50%); animation-delay: -8s; }

@keyframes orbFloat {
  from { transform: translateY(0) scale(1); }
  to   { transform: translateY(-30px) scale(1.05); }
}

/* ── Header ── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0 24px;
  background: rgba(10,10,15,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 24px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}
.logo-fan { display: flex; align-items: center; }
.logo-text { font-size: 18px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.3px; }
.logo-dot { background: var(--gradient-main); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* Progress steps */
.steps-list { display: flex; list-style: none; gap: 4px; align-items: center; }
.step-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 100px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  transition: var(--transition);
}
.step-item .step-num {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1.5px solid currentColor;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.step-label { display: none; }
@media (min-width: 640px) { .step-label { display: block; } }
.step-item.active { color: var(--text-primary); background: rgba(108,99,255,0.12); }
.step-item.active .step-num { background: var(--gradient-main); border-color: transparent; color: white; }
.step-item.completed { color: var(--teal); }
.step-item.completed .step-num { background: var(--teal); border-color: transparent; color: white; }

/* ── App container ── */
.app-container {
  position: relative; z-index: 1;
  flex: 1;
  display: flex; align-items: flex-start; justify-content: center;
  /* Height is driven by the active step panel */
}

/* ── Step panels ── */
.step-panel {
  /* Inactive panels are hidden but do not affect layout */
  display: none;
  width: 100%;
  padding: 96px 24px 80px;
  justify-content: center;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.35s cubic-bezier(0.4,0,0.2,1), transform 0.35s cubic-bezier(0.4,0,0.2,1);
}
.step-panel.active {
  display: flex;
  pointer-events: auto; opacity: 1; transform: translateX(0);
  min-height: calc(100vh - 64px - 65px);
  align-items: flex-start;
}
.step-panel.exit-left {
  display: flex;
  pointer-events: none;
  opacity: 0; transform: translateX(-40px);
  position: absolute; top: 0; left: 0; right: 0;
}

.step-content {
  width: 100%; max-width: 680px;
  padding-top: 40px;
}
.step-content-wide { max-width: 1000px; }
.step-content-loading { max-width: 560px; padding-top: 80px; display: flex; flex-direction: column; align-items: center; text-align: center; }

/* ── Typography ── */
.step-badge {
  display: inline-block;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 100px;
  background: rgba(108,99,255,0.15); color: var(--purple);
  margin-bottom: 16px;
}
.step-heading {
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 700; line-height: 1.25;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.step-subhead { font-size: 16px; color: var(--text-secondary); margin-bottom: 32px; line-height: 1.6; }
.topic-highlight {
  background: var(--gradient-main);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  font-weight: 600;
}

/* ── Input card ── */
.input-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}
.input-card:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}
.input-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.input-row { display: flex; gap: 12px; }
.text-input {
  flex: 1; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  color: var(--text-primary); font-family: var(--font); font-size: 16px;
  padding: 12px 16px; outline: none;
  transition: var(--transition);
  width: 100%;
}
.text-input::placeholder { color: var(--text-muted); }
.text-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(108,99,255,0.15); }
.input-hint { font-size: 13px; color: var(--text-muted); margin-top: 10px; }

/* ── Textarea ── */
.textarea-input {
  width: 100%; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  color: var(--text-primary); font-family: var(--font); font-size: 15px;
  padding: 12px 16px; outline: none; resize: vertical; min-height: 90px;
  transition: var(--transition); line-height: 1.6;
}
.textarea-input::placeholder { color: var(--text-muted); }
.textarea-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(108,99,255,0.15); }

/* ── Personas container ── */
.personas-container { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.persona-row {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  transition: var(--transition);
  animation: slideIn 0.28s cubic-bezier(0.4,0,0.2,1);
}
.persona-row:focus-within { border-color: var(--border-focus); box-shadow: var(--shadow-glow); }
.persona-input-wrap { position: relative; }
.persona-row .remove-persona {
  position: absolute; top: 8px; right: 8px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 4px; border-radius: 4px;
  transition: var(--transition);
}
.persona-row .remove-persona:hover { color: var(--red); background: rgba(239,68,68,0.1); }

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

/* Add persona button */
.btn-add-persona {
  width: 100%; justify-content: center; margin-bottom: 24px;
  border: 1.5px dashed var(--border); border-radius: var(--radius-lg);
  padding: 14px; gap: 8px;
}
.btn-add-persona:hover { border-color: var(--purple); color: var(--purple); background: rgba(108,99,255,0.06); }
.btn-add-persona:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-add-persona:disabled:hover { border-color: var(--border); color: var(--text-muted); background: none; }

/* Warning card */
.warning-card {
  background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius-md); padding: 16px 20px;
  display: flex; flex-direction: column; gap: 12px;
  font-size: 14px; color: var(--amber); margin-bottom: 24px;
  animation: slideIn 0.25s ease;
}
.warning-card[hidden] { display: none !important; }
.warning-icon { flex-shrink: 0; }
.warning-actions { display: flex; gap: 10px; }

/* ── Configuration ── */
.config-section { margin-bottom: 28px; }
.config-label { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.06em; }
.config-hint { font-size: 13px; margin-top: 12px; min-height: 18px; color: var(--red); }

.llm-selector { display: flex; gap: 14px; flex-wrap: wrap; }
.llm-card {
  flex: 1; min-width: 160px;
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card); border: 2px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  cursor: pointer; transition: var(--transition);
  text-align: left;
}
.llm-card:hover { background: var(--bg-card-hover); border-color: rgba(108,99,255,0.3); }
.llm-card.selected {
  border-color: var(--green);
  background: rgba(34,197,94,0.06);
  box-shadow: 0 0 0 1px rgba(34,197,94,0.2);
}
.llm-card.deselected {
  border-color: var(--red);
  background: rgba(239,68,68,0.04);
  opacity: 0.7;
}
.llm-logo { color: var(--text-primary); display: flex; align-items: center; justify-content: center; }
.llm-info { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.llm-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.llm-model { font-size: 12px; color: var(--text-muted); }
.llm-status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border); transition: var(--transition);
  flex-shrink: 0;
}
.llm-card.selected .llm-status-dot { background: var(--green); box-shadow: 0 0 6px rgba(34,197,94,0.6); }
.llm-card.deselected .llm-status-dot { background: var(--red); }

/* AlsoAsked row */
.alsoasked-row {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  transition: var(--transition);
}
.alsoasked-row:hover { border-color: rgba(108,99,255,0.2); }
.toggle-label { flex: 1; cursor: pointer; display: flex; align-items: center; gap: 16px; }
.toggle-text { flex: 1; }
.toggle-title { font-size: 15px; font-weight: 600; color: var(--text-primary); display: block; margin-bottom: 4px; }
.toggle-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.alsoasked-logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.alsoasked-brand { font-size: 13px; font-weight: 600; color: var(--purple); white-space: nowrap; }

/* Custom checkbox */
.checkbox-wrap { flex-shrink: 0; position: relative; }
.checkbox-input { position: absolute; opacity: 0; width: 0; height: 0; }
.checkbox-visual {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 28px; border-radius: 14px;
  background: var(--bg-input); border: 1.5px solid var(--border);
  cursor: pointer; transition: var(--transition); position: relative; overflow: hidden;
}
.checkbox-inner {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--text-muted); position: absolute; left: 4px;
  transition: var(--transition);
}
.checkbox-input:checked + .checkbox-visual { background: rgba(108,99,255,0.3); border-color: var(--purple); }
.checkbox-input:checked + .checkbox-visual .checkbox-inner { background: var(--purple); transform: translateX(20px); }
.checkbox-input:focus-visible + .checkbox-visual { box-shadow: 0 0 0 3px rgba(108,99,255,0.3); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font); font-size: 14px; font-weight: 600;
  padding: 11px 22px; border-radius: var(--radius-md);
  border: none; cursor: pointer; transition: var(--transition);
  text-decoration: none; white-space: nowrap; letter-spacing: 0.01em;
  position: relative; overflow: hidden;
}
.btn:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0); transition: var(--transition);
}
.btn:hover::after { background: rgba(255,255,255,0.04); }
.btn:active { transform: scale(0.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--gradient-main); color: white;
  box-shadow: 0 4px 20px rgba(108,99,255,0.3);
}
.btn-primary:hover { box-shadow: 0 6px 30px rgba(108,99,255,0.45); transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg-card); color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { color: var(--text-primary); border-color: rgba(255,255,255,0.15); }

.btn-ghost {
  background: transparent; color: var(--text-secondary); border: 1px solid transparent;
}
.btn-ghost:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }

.btn-warning { background: rgba(245,158,11,0.2); color: var(--amber); border: 1px solid rgba(245,158,11,0.3); }
.btn-warning:hover { background: rgba(245,158,11,0.3); }

.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-fanout { font-size: 15px; padding: 13px 28px; }
.btn-icon { transition: transform 0.2s; }
.btn:hover .btn-icon { transform: translateX(3px); }
.btn-icon-left { transition: transform 0.2s; }
.btn:hover .btn-icon-left { transform: translateX(-3px); }

.step-actions {
  display: flex; gap: 12px; align-items: center; margin-top: 12px; flex-wrap: wrap;
}

/* ── Turnstile ── */
.turnstile-wrap { margin-bottom: 20px; }
.turnstile-hint { font-size: 13px; color: var(--text-muted); margin-top: 8px; min-height: 18px; }

/* ── Loading screen ── */
.loading-logo { margin-bottom: 28px; animation: loadingPulse 1.6s ease-in-out infinite; }
@keyframes loadingPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(108,99,255,0.4)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 20px rgba(108,99,255,0.7)); }
}
.fan-dot { animation: dotPulse 1.6s ease-in-out infinite; }
.fan-dot-1 { animation-delay: 0s; }
.fan-dot-2 { animation-delay: 0.2s; }
.fan-dot-3 { animation-delay: 0.4s; }
@keyframes dotPulse {
  0%, 100% { opacity: 0.4; r: 2.5; }
  50% { opacity: 1; r: 3.2; }
}

.loading-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.loading-topic { color: var(--text-secondary); margin-bottom: 32px; font-size: 15px; }

.progress-track {
  width: 100%; height: 6px; background: var(--bg-card);
  border-radius: 3px; overflow: hidden; margin-bottom: 28px;
}
.progress-fill {
  height: 100%; background: var(--gradient-main);
  border-radius: 3px; width: 0%;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}

.loading-log {
  width: 100%; text-align: left;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; max-height: 320px;
  overflow-y: auto;
}
.log-entry {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 14px; animation: logSlideIn 0.25s ease;
}
.log-entry:last-child { border-bottom: none; }
@keyframes logSlideIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.log-icon { flex-shrink: 0; margin-top: 2px; }
.log-icon-pending { color: var(--text-muted); animation: spin 1.5s linear infinite; }
.log-icon-done    { color: var(--teal); }
.log-icon-error   { color: var(--red); }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.log-text { flex: 1; line-height: 1.5; }
.log-text strong { color: var(--text-primary); }
.log-text .log-detail { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Results ── */
.results-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; margin-bottom: 32px; flex-wrap: wrap;
}
.export-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex-shrink: 0; }

.results-container { display: flex; flex-direction: column; gap: 24px; }

/* Topic block */
.result-topic-block {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); overflow: hidden;
  box-shadow: var(--shadow-md);
}

/* LLM block */
.result-llm-block {
  border-bottom: 1px solid var(--border);
}
.result-llm-block:last-child { border-bottom: none; }

.result-llm-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; cursor: pointer; gap: 12px;
  transition: var(--transition);
  user-select: none;
}
.result-llm-header:hover { background: var(--bg-card-hover); }
.result-llm-header-left { display: flex; align-items: center; gap: 12px; }
.result-llm-icon { display: flex; align-items: center; justify-content: center; }
.result-llm-name { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.result-llm-count { font-size: 13px; color: var(--text-muted); }
.result-llm-chevron {
  color: var(--text-muted); transition: transform 0.25s ease;
  flex-shrink: 0;
}
.result-llm-block.open .result-llm-chevron { transform: rotate(180deg); }

.result-llm-body { display: none; padding: 0 0 8px; }
.result-llm-block.open .result-llm-body { display: block; }

/* Persona block within LLM */
.result-persona-block {
  border-top: 1px solid var(--border);
}
.result-persona-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px 14px 32px; cursor: pointer;
  transition: var(--transition); gap: 12px; user-select: none;
}
.result-persona-header:hover { background: rgba(255,255,255,0.02); }
.result-persona-name { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.result-persona-chevron { color: var(--text-muted); transition: transform 0.25s ease; flex-shrink: 0; }
.result-persona-block.open .result-persona-chevron { transform: rotate(180deg); }
.result-persona-body { display: none; }
.result-persona-block.open .result-persona-body { display: block; }

/* Prompt rows */
.result-prompt-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: 12px; padding: 12px 24px 12px 40px;
  border-top: 1px solid rgba(255,255,255,0.04);
  align-items: start;
  transition: background 0.15s;
}
.result-prompt-row:hover { background: rgba(108,99,255,0.04); }

.prompt-source-badge {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: 100px; margin-right: 6px; vertical-align: middle;
  text-transform: uppercase;
}
.badge-generated { background: rgba(108,99,255,0.15); color: var(--purple); }
.badge-alsoasked  { background: rgba(0,201,167,0.12); color: var(--teal); }

.prompt-text { font-size: 14px; color: var(--text-primary); line-height: 1.5; }
.prompt-searches { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.search-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-secondary); padding-left: 12px;
}
.search-item::before {
  content: ''; flex-shrink: 0;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--purple); opacity: 0.6;
}
.search-item a { color: var(--teal); text-decoration: none; font-size: 12px; margin-left: auto; flex-shrink: 0; }
.search-item a:hover { text-decoration: underline; }
.search-count-badge {
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 100px;
  background: rgba(108,99,255,0.12); color: var(--purple); white-space: nowrap; align-self: flex-start; margin-top: 2px;
}
.no-searches { font-size: 13px; color: var(--text-muted); font-style: italic; }

.results-footer-actions { margin-top: 40px; display: flex; justify-content: center; }

/* ── Toast ── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 1000;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 18px;
  font-size: 14px; color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  pointer-events: auto;
  animation: toastIn 0.3s ease;
  max-width: 340px;
}
.toast.toast-success { border-left: 3px solid var(--teal); }
.toast.toast-error   { border-left: 3px solid var(--red); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(8px); }
}
.toast.removing { animation: toastOut 0.25s ease forwards; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}
.modal-overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 32px;
  max-width: 480px; width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s cubic-bezier(0.4,0,0.2,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.modal-body  { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.6; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ── Footer ── */
.site-footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  margin-top: auto;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.footer-copy { font-size: 13px; color: var(--text-muted); }
.footer-brand { color: var(--text-secondary); font-weight: 600; text-decoration: none; }
.footer-brand:hover { color: var(--text-primary); }
.footer-link { color: var(--purple); text-decoration: none; }
.footer-link:hover { text-decoration: underline; }
.footer-social { display: flex; gap: 6px; }
.social-link {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  color: var(--text-muted); transition: var(--transition);
  border: 1px solid transparent;
}
.social-link:hover { color: var(--text-primary); background: var(--bg-card); border-color: var(--border); }

/* ── Responsive ── */
@media (max-width: 600px) {
  .step-heading { font-size: 22px; }
  .llm-selector { flex-direction: column; }
  .results-header { flex-direction: column; }
  .export-group { width: 100%; }
  .result-prompt-row { grid-template-columns: 1fr; }
}
