/* ============================================================
   Design System v3 — Premium Cold Palette
   Inspired by Linear / Vercel / Stripe
   ============================================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* ── Deep Navy Palette ───────────────────────── */
  --bg-base: #0a0e1a;
  --bg-depth: #0f1424;
  --bg-surface: #141a2e;
  --glass: rgba(255, 255, 255, 0.028);
  --glass-strong: rgba(255, 255, 255, 0.048);
  --glass-hover: rgba(255, 255, 255, 0.065);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-border-hover: rgba(255, 255, 255, 0.12);

  /* ── Text Hierarchy ─────────────────────────── */
  --text-primary: #e2e8f0;
  --text-secondary: #8892a8;
  --text-muted: #4a5568;

  /* ── Cool Accent (Indigo → Violet) ──────────── */
  --accent: #818cf8;
  --accent-strong: #6366f1;
  --accent-soft: rgba(129, 140, 248, 0.12);
  --accent-glow: rgba(99, 102, 241, 0.25);

  /* ── Semantic Colors ────────────────────────── */
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.10);
  --red: #fb7185;
  --red-soft: rgba(251, 113, 133, 0.08);
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, 0.10);
  --yellow: #fbbf24;
  --yellow-soft: rgba(251, 191, 36, 0.08);
  --purple: #a78bfa;

  /* ── Radii & Blur ───────────────────────────── */
  --radius: 14px;
  --radius-sm: 9px;
  --radius-xs: 5px;
  --blur: 20px;
  --blur-heavy: 36px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Ambient Background ────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 15% 35%, rgba(99,102,241,0.07) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 85% 25%, rgba(139,92,246,0.05) 0%, transparent 50%),
    radial-gradient(ellipse 60% 60% at 50% 85%, rgba(6,182,212,0.035) 0%, transparent 45%);
  z-index: 0;
  pointer-events: none;
  will-change: transform;
  transform: translateZ(0);
}

/* Subtle grain */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 128px;
  z-index: 0;
  pointer-events: none;
}

/* ============================================================
   Layout
   ============================================================ */
.app { position: relative; z-index: 1; }

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   Glass Card System
   ============================================================ */
.card {
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateZ(0);
  will-change: transform, backdrop-filter;
  box-shadow:
    0 2px 20px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.card:hover {
  border-color: var(--glass-border-hover);
  background: var(--glass-hover);
  box-shadow:
    0 6px 32px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.card-header .lucide {
  width: 17px; height: 17px;
  color: var(--accent);
  opacity: 0.85;
}

/* ============================================================
   Header / Brand
   ============================================================ */
.header {
  text-align: center;
  padding: 48px 20px 20px;
}
.header .brand {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.header .tagline {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 8px;
  letter-spacing: 0.02em;
  font-weight: 400;
}

/* ============================================================
   Search (Glass Input)
   ============================================================ */
.search-card { padding: 22px 24px; }
.search-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.field { flex: 1; }
.field label {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.field input, .field select {
  width: 100%;
  background: rgba(255,255,255,0.025);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: all 0.25s ease;
}
.field input:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 16px rgba(99,102,241,0.06);
  background: rgba(255,255,255,0.04);
}
.field input::placeholder { color: var(--text-muted); }
.field select option { background: var(--bg-depth); }

.btn-primary {
  background: var(--accent-strong);
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 22px;
  color: white;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 1px 8px rgba(99,102,241,0.2);
  transform: translateZ(0);
}
.btn-primary:hover { transform: translateY(-1px) translateZ(0); box-shadow: 0 4px 20px rgba(99,102,241,0.3); background: #5558e6; }
.btn-primary:active { transform: scale(0.97) translateZ(0); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
  background: var(--glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-ghost:hover { background: var(--glass-hover); color: var(--text-primary); border-color: var(--glass-border-hover); }

.toolbar {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.key-indicator {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.key-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--red); }
.key-dot.ok { background: var(--green); box-shadow: 0 0 6px rgba(52,211,153,0.35); }
.key-link { color: var(--accent); cursor: pointer; background: none; border: none; font-size: 0.7rem; font-family: inherit; }

/* ============================================================
   Progress Stepper
   ============================================================ */
.progress-section {
  display: none;
  padding: 48px 20px;
  text-align: center;
}
.progress-section.active { display: block; animation: fadeIn 0.3s ease; }

.steps {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 22px;
}
.step-dot {
  width: 52px; height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.05);
  transition: background 0.5s ease;
  transform: translateZ(0);
}
.step-dot.done { background: linear-gradient(90deg, var(--accent-strong), var(--accent)); }
.step-dot.active { background: var(--accent); animation: stepPulse 1.4s ease infinite; }

.progress-label { font-size: 0.92rem; color: var(--text-secondary); margin-bottom: 4px; }
.progress-sub { font-size: 0.78rem; color: var(--text-muted); }

@keyframes stepPulse {
  0%,100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ============================================================
   Score Badge
   ============================================================ */
.score-card {
  text-align: center;
  padding: 36px 24px 28px;
  position: relative;
  overflow: hidden;
}
.score-card::before {
  content: '';
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%) translateZ(0);
  width: 280px;
  height: 180px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.12;
  pointer-events: none;
}
.score-card.grade-s::before { background: var(--accent-strong); }
.score-card.grade-a::before { background: var(--green); }
.score-card.grade-b::before { background: var(--blue); }
.score-card.grade-c::before { background: var(--yellow); }
.score-card.grade-d::before { background: var(--red); }

.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px; height: 80px;
  border-radius: 50%;
  font-size: 2rem;
  font-weight: 800;
  color: white;
  position: relative;
  margin-bottom: 14px;
  transform: translateZ(0);
  letter-spacing: -0.03em;
}
.score-badge::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.08);
}
.score-badge.s { background: linear-gradient(140deg, #6366f1, #4f46e5); box-shadow: 0 0 40px rgba(99,102,241,0.2); }
.score-badge.a { background: linear-gradient(140deg, #34d399, #059669); box-shadow: 0 0 40px rgba(52,211,153,0.15); }
.score-badge.b { background: linear-gradient(140deg, #60a5fa, #3b82f6); box-shadow: 0 0 40px rgba(96,165,250,0.15); }
.score-badge.c { background: linear-gradient(140deg, #fbbf24, #d97706); box-shadow: 0 0 40px rgba(251,191,36,0.15); }
.score-badge.d { background: linear-gradient(140deg, #fb7185, #e11d48); box-shadow: 0 0 40px rgba(251,113,133,0.15); }

.score-verdict { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; letter-spacing: -0.02em; }
.score-detail { font-size: 0.8rem; color: var(--text-secondary); max-width: 440px; margin: 0 auto; }

.comp-bar-wrap { margin-top: 18px; }
.comp-bar-label { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--text-muted); margin-bottom: 5px; }
.comp-bar { height: 3px; border-radius: 2px; background: rgba(255,255,255,0.04); overflow: hidden; }
.comp-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent), #a78bfa);
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateZ(0);
}

/* ============================================================
   Stats Grid
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}
.stat-item {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  transition: all 0.25s ease;
  transform: translateZ(0);
}
.stat-item:hover {
  border-color: var(--glass-border-hover);
  background: var(--glass-hover);
  transform: translateY(-2px) translateZ(0);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.stat-label {
  font-size: 0.63rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-label .lucide { width: 12px; height: 12px; }
.stat-value { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; }
.stat-note { font-size: 0.68rem; color: var(--text-muted); margin-top: 3px; }
.stat-value.green { color: var(--green); }
.stat-value.yellow { color: var(--yellow); }
.stat-value.blue { color: var(--blue); }

/* ============================================================
   Profit Calculator
   ============================================================ */
.profit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.profit-inputs { display: flex; flex-direction: column; gap: 12px; }
.profit-input label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 5px;
}
.profit-input label span { color: var(--accent); font-weight: 600; }
.profit-input input[type=range] {
  width: 100%;
  height: 3px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.profit-input input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  cursor: grab;
}
.profit-result {
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}
.profit-row { display: flex; justify-content: space-between; font-size: 0.82rem; }
.profit-row.total {
  font-weight: 700;
  font-size: 1.02rem;
  border-top: 1px solid var(--glass-border);
  padding-top: 10px;
  margin-top: 4px;
}
.profit-row .neg { color: var(--red); }
.profit-row .pos { color: var(--green); }

/* ============================================================
   Customer Insights
   ============================================================ */
.insight-item {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 8px;
  transform: translateZ(0);
  transition: all 0.25s ease;
}
.insight-item:hover {
  border-color: var(--glass-border-hover);
  background: var(--glass-hover);
  transform: translateY(-1px) translateZ(0);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.insight-item.severity-high { border-left: 3px solid var(--red); }
.insight-item.severity-mid { border-left: 3px solid var(--yellow); }
.insight-item.severity-low { border-left: 3px solid var(--green); }

.insight-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.insight-topic {
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.insight-topic .lucide { width: 15px; height: 15px; }
.insight-item.severity-high .insight-topic .lucide { color: var(--red); }
.insight-item.severity-mid .insight-topic .lucide { color: var(--yellow); }
.insight-item.severity-low .insight-topic .lucide { color: var(--green); }

.insight-pct {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}
.insight-item.severity-high .insight-pct { color: var(--red); background: rgba(251,113,133,0.1); }
.insight-item.severity-mid .insight-pct { color: var(--yellow); background: rgba(251,191,36,0.1); }
.insight-item.severity-low .insight-pct { color: var(--green); background: rgba(52,211,153,0.1); }

.insight-bar-wrap {
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.04);
  overflow: hidden;
  margin-bottom: 8px;
}
.insight-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateZ(0);
}
.insight-item.severity-high .insight-bar { background: linear-gradient(90deg, #e11d48, #fb7185); }
.insight-item.severity-mid .insight-bar { background: linear-gradient(90deg, #d97706, #fbbf24); }
.insight-item.severity-low .insight-bar { background: linear-gradient(90deg, #059669, #34d399); }

.insight-stats {
  display: flex;
  gap: 12px;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.insight-stats span { display: flex; align-items: center; gap: 3px; }
.insight-stats .lucide { width: 11px; height: 11px; }

.insight-ai-note {
  font-size: 0.76rem;
  color: var(--text-secondary);
  padding: 8px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-xs);
  border-left: 2px solid var(--accent);
  margin-top: 6px;
  line-height: 1.6;
}
.insight-ai-note .lucide { width: 12px; height: 12px; color: var(--accent); vertical-align: -1px; }

/* Golden Triangle Summary */
.insight-golden {
  background: var(--accent-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(129,140,248,0.1);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 12px;
}
.insight-golden-title {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.insight-golden-title .lucide { width: 15px; height: 15px; }
.insight-golden-list {
  list-style: none;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.8;
}
.insight-golden-list li {
  padding-left: 14px;
  position: relative;
}
.insight-golden-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ============================================================
   SWOT
   ============================================================ */
.swot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.swot-box {
  border-radius: var(--radius-sm);
  padding: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateZ(0);
  transition: all 0.25s ease;
}
.swot-box:hover { transform: translateY(-1px) translateZ(0); }
.swot-box.s { background: var(--green-soft); border: 1px solid rgba(52,211,153,0.08); }
.swot-box.w { background: var(--red-soft); border: 1px solid rgba(251,113,133,0.08); }
.swot-box.o { background: var(--blue-soft); border: 1px solid rgba(96,165,250,0.08); }
.swot-box.t { background: var(--yellow-soft); border: 1px solid rgba(251,191,36,0.08); }

.swot-title { font-weight: 600; font-size: 0.82rem; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.swot-box.s .swot-title { color: var(--green); }
.swot-box.w .swot-title { color: var(--red); }
.swot-box.o .swot-title { color: var(--blue); }
.swot-box.t .swot-title { color: var(--yellow); }

.swot-list { list-style: none; font-size: 0.76rem; color: var(--text-secondary); line-height: 1.7; }
.swot-list li { padding-left: 12px; position: relative; }
.swot-list li::before { content: '·'; position: absolute; left: 0; font-weight: 700; }

/* ============================================================
   Action Buttons
   ============================================================ */
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.action-btn {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  font-family: inherit;
  color: var(--text-primary);
  transform: translateZ(0);
}
.action-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px) translateZ(0);
  box-shadow: 0 6px 24px rgba(99,102,241,0.08);
}
.action-btn .action-icon { margin-bottom: 6px; }
.action-btn .action-icon .lucide { width: 20px; height: 20px; color: var(--accent); }
.action-btn .action-title { font-weight: 600; font-size: 0.86rem; margin-bottom: 2px; }
.action-btn .action-desc { font-size: 0.72rem; color: var(--text-muted); }

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 18, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  justify-content: center;
  align-items: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: rgba(15, 20, 36, 0.88);
  backdrop-filter: blur(var(--blur-heavy));
  -webkit-backdrop-filter: blur(var(--blur-heavy));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);
}
.modal h2 { font-size: 1.1rem; margin-bottom: 6px; font-weight: 600; }
.modal p { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 18px; }
.modal input {
  width: 100%;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  text-align: center;
  margin-bottom: 14px;
}
.modal input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.modal .modal-err { color: var(--red); font-size: 0.75rem; min-height: 1.2em; }

/* ============================================================
   Error + Report
   ============================================================ */
.error-box {
  display: none;
  background: var(--red-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(251,113,133,0.12);
  border-radius: var(--radius-sm);
  padding: 16px;
  color: #fda4af;
  text-align: center;
  font-size: 0.86rem;
  margin-bottom: 12px;
}
.error-box.active { display: block; }

.report { display: none; }
.report.active { display: block; }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  text-align: center;
  padding: 44px 20px;
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}
.footer a { color: var(--text-muted); transition: color 0.2s; }
.footer a:hover { color: var(--accent); }

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translate3d(0, 16px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
.fade-in { animation: fadeIn 0.4s ease; }
.slide-up { animation: slideUp 0.45s cubic-bezier(0.4, 0, 0.2, 1) both; }
.delay-1 { animation-delay: 0.06s; }
.delay-2 { animation-delay: 0.12s; }
.delay-3 { animation-delay: 0.18s; }
.delay-4 { animation-delay: 0.24s; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 640px) {
  .search-row { flex-direction: column; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .profit-grid { grid-template-columns: 1fr; }
  .swot-grid { grid-template-columns: 1fr; }
  .action-grid { grid-template-columns: 1fr; }
  .header .brand { font-size: 1.25rem; }
  .score-badge { width: 68px; height: 68px; font-size: 1.8rem; }
}

/* ============================================================
   AI Deep Report (Norman Theory Analysis)
   ============================================================ */
.ai-report-section {
  border-top: 1px solid rgba(255,255,255,0.04);
  padding-top: 16px;
}

.ai-report-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
}
.ai-report-header .lucide { color: var(--accent); opacity: 0.9; }

.ai-status {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
}
.ai-status.done { color: var(--green); background: rgba(52,211,153,0.1); }
.ai-status.pending { color: var(--text-muted); background: rgba(255,255,255,0.03); }
.ai-status.error { color: var(--yellow); background: rgba(251,191,36,0.08); }

/* ── AI Report Markdown Content ────────────────── */
.ai-report-content {
  font-size: 0.82rem;
  line-height: 1.75;
  color: var(--text-secondary);
  animation: fadeIn 0.5s ease;
}

.ai-report-content h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 20px 0 10px;
  letter-spacing: -0.02em;
}
.ai-report-content h2 {
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--text-primary);
  margin: 18px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.ai-report-content h3 {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent);
  margin: 14px 0 6px;
}

.ai-report-content p { margin-bottom: 8px; }

.ai-report-content strong { color: var(--text-primary); font-weight: 600; }

.ai-report-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 8px 14px;
  margin: 8px 0;
  background: rgba(129,140,248,0.04);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.ai-report-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.78rem;
}
.ai-report-content th {
  text-align: left;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ai-report-content td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text-secondary);
}
.ai-report-content tr:hover td {
  background: rgba(255,255,255,0.015);
}

.ai-report-content ul, .ai-report-content ol {
  padding-left: 18px;
  margin: 6px 0;
}
.ai-report-content li { margin-bottom: 3px; }

.ai-report-content code {
  background: rgba(255,255,255,0.04);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', monospace;
}

.ai-report-content hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.04);
  margin: 14px 0;
}

/* ── Setup Hint (when model key not configured) ── */
.ai-setup-hint {
  text-align: center;
  padding: 20px 16px;
  background: rgba(129,140,248,0.03);
  border: 1px dashed rgba(129,140,248,0.15);
  border-radius: var(--radius-sm);
}
.ai-setup-hint p {
  color: var(--text-secondary);
  font-size: 0.84rem;
  margin-bottom: 6px;
}
.ai-setup-hint .hint-sub {
  color: var(--text-muted);
  font-size: 0.74rem;
  margin-bottom: 12px;
}
