@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;700;800&family=Space+Grotesk:wght@700&display=swap');

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface2: #f1f5f9;
  --surface3: #e8edf5;
  --border: #d1d5db;
  --text: #0f172a;
  --text2: #334155;
  --text3: #475569;
  --primary: #2563eb;
  --primary-h: #1d4ed8;
  --accent: #7c3aed;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --gold: #d97706; /* Slightly darker gold for better contrast */
  --gold-bg: rgba(245,158,11,0.12);
  --gold-text: #b45309;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 6px rgba(0,0,0,.07), 0 12px 40px rgba(0,0,0,.1);
  --transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}

.dark {
  --bg: #030712;
  --surface: #0f172a;
  --surface2: #1e293b;
  --surface3: #263348;
  --border: #334155;
  --text: #f8fafc;
  --text2: #cbd5e1;
  --text3: #cbd5e1;
  --primary: #3b82f6;
  --primary-h: #60a5fa;
  --shadow: 0 1px 3px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  --shadow-lg: 0 4px 6px rgba(0,0,0,.3), 0 12px 40px rgba(0,0,0,.35);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.dark ::-webkit-scrollbar-thumb { background: #475569; }

/* ===== LAYOUT ===== */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

/* ===== HEADER (inline in HTML) ===== */
/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 2.5rem 0 2rem;
}
.hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: .75rem;
}
.hero p {
  color: var(--text3);
  max-width: 620px;
  margin: 0 auto 1.25rem;
  font-size: 1.05rem;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(124,58,237,.12));
  border: 1px solid rgba(37,99,235,.25);
  color: var(--primary);
  padding: .35rem .85rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
}

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  transition: var(--transition);
  margin-bottom: 1.5rem;
}
.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1.25rem;
}
.card-title i { color: var(--primary); font-size: 1rem; }
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  background: var(--primary);
  color: white;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ===== TEMPLATE CARDS ===== */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem;
}
.template-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  padding: 1rem;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.template-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(37,99,235,.15);
}
.template-card.active {
  border-color: var(--primary);
  background: rgba(37,99,235,.08);
  box-shadow: 0 0 0 2px rgba(37,99,235,.2), 0 4px 20px rgba(37,99,235,.15);
}
.template-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.template-name { font-size: .88rem; font-weight: 700; color: var(--text); }
.template-desc { font-size: .75rem; color: var(--text3); line-height: 1.3; }

/* ===== SETUP FORM ===== */
.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 640px) { .setup-grid { grid-template-columns: 1fr; } }

.tags-input-wrap {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  min-height: 48px;
  transition: var(--transition);
  cursor: text;
}
.tags-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .6rem;
  background: var(--primary);
  color: white;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  animation: tagIn .15s ease;
}
@keyframes tagIn {
  from { opacity:0; transform: scale(0.85); }
  to { opacity:1; transform: scale(1); }
}
.tag-remove {
  cursor: pointer;
  opacity: .7;
  font-size: .75rem;
  line-height: 1;
  padding: 0 2px;
  transition: opacity .15s;
}
.tag-remove:hover { opacity: 1; }
.tags-real-input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: .88rem;
  flex: 1;
  min-width: 80px;
  padding: .25rem .35rem;
}
.tags-hint { font-size: .75rem; color: var(--text3); margin-top: .35rem; }
.tags-count {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text3);
  margin-top: .25rem;
}
.tags-count.warn { color: var(--danger); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 2px 12px rgba(37,99,235,.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(37,99,235,.4); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--surface3); }
.btn-danger { background: rgba(220,38,38,.08); color: var(--danger); border: 1.5px solid rgba(220,38,38,.2); }
.btn-danger:hover { background: rgba(220,38,38,.15); }
.btn-sm { padding: .45rem 1rem; font-size: .82rem; }
.btn-icon { padding: .5rem; width: 36px; height: 36px; border-radius: 8px; }
.btn-lg { padding: .85rem 2rem; font-size: 1rem; border-radius: 12px; }

.generate-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding-top: 1.5rem;
  flex-wrap: wrap;
}

/* ===== MATRIX SECTION ===== */
#matrix-section { display: none; }
#matrix-section.visible { display: block; }

/* Export bar */
.export-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.export-bar-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.export-bar-sub { font-size: .82rem; color: var(--text3); margin-top: .1rem; }
.export-btns { display: flex; gap: .55rem; flex-wrap: wrap; }

/* ===== DECISION TABLE ===== */
.matrix-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
}
.decision-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
  background: var(--surface);
  min-width: 640px;
}
.decision-table th {
  background: var(--surface2);
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  color: var(--text2);
  text-align: left;
  white-space: nowrap;
}
.decision-table th.option-header {
  text-align: center;
  background: linear-gradient(135deg, rgba(37,99,235,.08), rgba(124,58,237,.08));
  color: var(--primary);
}
.decision-table td {
  padding: .7rem 1rem;
  border: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.decision-table tr:nth-child(even) td { background: rgba(0,0,0,.015); }
.dark .decision-table tr:nth-child(even) td { background: rgba(255,255,255,.02); }
.decision-table tbody tr:hover td { background: rgba(37,99,235,.04); }
.decision-table td.criteria-cell {
  font-weight: 600;
  color: var(--text);
  min-width: 160px;
}
.decision-table td.weight-cell, .decision-table td.score-cell { text-align: center; }
.decision-table tfoot td {
  font-weight: 700;
  background: var(--surface2);
  border-top: 2px solid var(--border);
}
.total-row td { font-weight: 800; }

/* Editable cells */
.editable-num {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.editable-num input {
  width: 52px;
  text-align: center;
  padding: .25rem .35rem;
  border: 1.5px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-weight: 600;
  font-size: .88rem;
  transition: var(--transition);
  cursor: pointer;
}
.editable-num input:hover {
  border-color: var(--border);
  background: var(--surface2);
}
.editable-num input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(37,99,235,.06);
  cursor: text;
}
.editable-text {
  border: 1.5px solid transparent;
  border-radius: 6px;
  padding: .2rem .4rem;
  transition: var(--transition);
  cursor: pointer;
  display: inline-block;
  min-width: 60px;
}
.editable-text:hover { border-color: var(--border); background: var(--surface2); }
.editable-text:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(37,99,235,.06);
}

/* Score cells per option */
.option-score-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}
.score-raw {
  width: 44px;
  text-align: center;
  padding: .2rem;
  border: 1.5px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.score-raw:hover { border-color: var(--border); background: var(--surface2); }
.score-raw:focus { outline: none; border-color: var(--primary); background: rgba(37,99,235,.06); }
.score-weighted {
  font-size: .85rem;
  color: var(--text2);
  min-width: 40px;
  text-align: right;
  opacity: 0.8;
}
.score-weighted.highlight { color: var(--primary); font-weight: 700; opacity: 1; }

/* Total rows */
.total-score {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
}
.total-row .col-winner .total-score { color: var(--gold-text) !important; }
.total-row .total-score { color: var(--primary); }
.winner-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--gold-bg);
  border: 1.5px solid rgba(217,119,6,0.4);
  color: var(--gold-text);
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.col-winner td { background: rgba(245,158,11,.04) !important; }
.dark .col-winner td { background: rgba(245,158,11,.06) !important; }

/* Score bar */
.score-bar-wrap { margin-top: .3rem; }
.score-bar {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  width: 100%;
}
.score-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.6s ease;
}

/* ===== CONCLUSION SECTION ===== */
.conclusion-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.conclusion-header {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  padding: 1.5rem 1.75rem;
  color: white;
}
.conclusion-header h2 {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  margin-bottom: .25rem;
}
.conclusion-header p { opacity: .85; font-size: .9rem; }
.conclusion-body { padding: 1.75rem; }

.winner-showcase {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(245,158,11,.08), rgba(245,158,11,.03));
  border: 1.5px solid rgba(245,158,11,.3);
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
}
.winner-trophy {
  font-size: 2rem;
  flex-shrink: 0;
}
.winner-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gold);
}
.winner-score-display {
  font-size: .88rem;
  color: var(--text3);
  margin-top: .1rem;
}

.ranking-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-bottom: 1.5rem;
}
.ranking-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem 1rem;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.rank-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .85rem;
  flex-shrink: 0;
}
.rank-1 { background: rgba(245,158,11,.15); color: var(--gold); border: 1.5px solid rgba(245,158,11,.4); }
.rank-2 { background: rgba(100,116,139,.1); color: #64748b; border: 1.5px solid rgba(100,116,139,.3); }
.rank-3 { background: rgba(180,101,40,.1); color: #b46528; border: 1.5px solid rgba(180,101,40,.3); }
.rank-other { background: var(--surface3); color: var(--text3); border: 1.5px solid var(--border); }
.rank-name { font-weight: 600; color: var(--text); flex: 1; }
.rank-bar-wrap { flex: 2; }
.rank-score { font-weight: 700; color: var(--primary); font-size: .88rem; white-space: nowrap; }

.conclusion-reasons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.reason-card {
  padding: 1rem 1.1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  gap: .75rem;
  align-items: flex-start;
}
.reason-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  flex-shrink: 0;
}
.reason-text { font-size: .88rem; color: var(--text); line-height: 1.5; }
.reason-text strong { color: var(--primary); display: block; font-weight: 700; margin-bottom: .1rem; }

.conclusion-note {
  padding: .9rem 1.1rem;
  background: linear-gradient(135deg, rgba(37,99,235,.06), rgba(124,58,237,.06));
  border: 1px solid rgba(37,99,235,.2);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  color: var(--text2);
  line-height: 1.6;
}
.conclusion-note strong { color: var(--primary); }

/* ===== ENHANCED ANALYSIS SECTIONS ===== */
.analysis-section {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.analysis-section-header {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: 1.15rem;
}
.analysis-section-badge {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  flex-shrink: 0;
  color: white;
}
.analysis-section-badge.insights-badge { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.analysis-section-badge.risks-badge { background: linear-gradient(135deg, #dc2626, #ef4444); }
.analysis-section-badge.reco-badge { background: linear-gradient(135deg, #059669, #10b981); }
.analysis-section-badge.compare-badge { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }

.analysis-section-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.analysis-section-subtitle {
  font-size: .8rem;
  color: var(--text3);
  font-weight: 400;
  margin-top: .05rem;
}

/* Insight / Risk / Recommendation cards */
.analysis-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
}
.analysis-card {
  padding: 1rem 1.15rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  transition: var(--transition);
}
.analysis-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(37,99,235,.08);
  transform: translateY(-1px);
}
.analysis-card.risk-card:hover {
  border-color: var(--danger);
  box-shadow: 0 2px 12px rgba(220,38,38,.08);
}
.analysis-card.reco-card:hover {
  border-color: var(--success);
  box-shadow: 0 2px 12px rgba(5,150,105,.08);
}
.analysis-card-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  flex-shrink: 0;
  color: white;
}
.analysis-card-icon.insight-icon { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.analysis-card-icon.risk-icon { background: linear-gradient(135deg, #dc2626, #f87171); }
.analysis-card-icon.reco-icon { background: linear-gradient(135deg, #059669, #34d399); }

.analysis-card-body { flex: 1; min-width: 0; }
.analysis-card-title {
  font-weight: 700;
  font-size: .88rem;
  color: var(--text);
  margin-bottom: .2rem;
}
.analysis-card-title.insight-title { color: var(--primary); }
.analysis-card-title.risk-title { color: var(--danger); }
.analysis-card-title.reco-title { color: var(--success); }
.analysis-card-text {
  font-size: .84rem;
  color: var(--text2);
  line-height: 1.55;
}

/* Comparative analysis (per-option strengths/weaknesses) */
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.compare-option-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: var(--transition);
}
.compare-option-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(37,99,235,.08);
}
.compare-option-card.is-winner {
  border-color: rgba(245,158,11,.4);
  box-shadow: 0 2px 16px rgba(245,158,11,.1);
}
.compare-option-header {
  padding: .75rem 1rem;
  background: var(--surface3);
  font-weight: 700;
  font-size: .88rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.compare-option-rank {
  font-size: .72rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.compare-option-rank.rank-gold { background: var(--gold-bg); color: var(--gold-text); border: 1px solid rgba(245,158,11,.4); }
.compare-option-rank.rank-silver { background: rgba(100,116,139,.1); color: #64748b; border: 1px solid rgba(100,116,139,.3); }
.compare-option-rank.rank-bronze { background: rgba(180,101,40,.1); color: #b46528; border: 1px solid rgba(180,101,40,.3); }
.compare-option-rank.rank-default { background: var(--surface3); color: var(--text3); border: 1px solid var(--border); }

.compare-option-body { padding: .85rem 1rem; }
.compare-option-body .strength-item,
.compare-option-body .weakness-item {
  display: flex;
  align-items: baseline;
  gap: .4rem;
  font-size: .82rem;
  color: var(--text2);
  margin-bottom: .35rem;
  line-height: 1.45;
}
.compare-option-body .strength-item::before {
  content: '✓';
  color: var(--success);
  font-weight: 800;
  font-size: .7rem;
  flex-shrink: 0;
}
.compare-option-body .weakness-item::before {
  content: '✗';
  color: var(--danger);
  font-weight: 800;
  font-size: .7rem;
  flex-shrink: 0;
}
.compare-separator {
  border: none;
  border-top: 1px dashed var(--border);
  margin: .5rem 0;
}
.compare-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text3);
  margin-bottom: .35rem;
}

/* Criteria breakdown (radar-like per option) */
.criteria-breakdown {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-top: .35rem;
}
.criteria-bar-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
}
.criteria-bar-label {
  flex: 0 0 120px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}
.criteria-bar-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.criteria-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s ease;
}
.criteria-bar-fill.fill-primary { background: linear-gradient(90deg, var(--primary), var(--accent)); }
.criteria-bar-fill.fill-gold { background: linear-gradient(90deg, #f59e0b, #d97706); }
.criteria-bar-fill.fill-success { background: linear-gradient(90deg, #059669, #10b981); }
.criteria-bar-value {
  flex: 0 0 32px;
  text-align: right;
  font-weight: 600;
  color: var(--text2);
}

/* Gap analysis callout */
.gap-callout {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: 1rem 1.15rem;
  background: linear-gradient(135deg, rgba(5,150,105,.06), rgba(16,185,129,.04));
  border: 1px solid rgba(5,150,105,.25);
  border-radius: var(--radius-sm);
  margin-top: 1rem;
}
.gap-callout.tight {
  background: linear-gradient(135deg, rgba(245,158,11,.06), rgba(217,119,6,.04));
  border-color: rgba(245,158,11,.3);
}
.gap-callout-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}
.gap-callout-text {
  font-size: .85rem;
  color: var(--text2);
  line-height: 1.5;
}
.gap-callout-text strong { color: var(--text); }

@media (max-width: 768px) {
  .analysis-cards-grid { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .criteria-bar-label { flex: 0 0 80px; font-size: .72rem; }
}

/* ===== SOURCES ===== */
.sources-box {
  margin-top: 1rem;
  padding: .9rem 1.1rem;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .8rem;
}
.sources-title {
  font-weight: 700;
  color: var(--text3);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.sources-list { display: flex; flex-direction: column; gap: .35rem; }
.sources-list a {
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .8rem;
  transition: opacity .15s;
  word-break: break-all;
}
.sources-list a:hover { text-decoration: underline; opacity: .8; }

/* ===== LOADING ===== */
.spinner-wrap { display: none; text-align: center; padding: 3rem 0; }
.spinner-wrap.visible { display: block; }
.spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp 0.4s ease-out forwards; }

/* ===== FORM ELEMENTS ===== */
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-label {
  font-size: .82rem; font-weight: 600; color: var(--text2);
  text-transform: uppercase; letter-spacing: .04em;
}
.form-control {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .65rem .9rem;
  font-family: inherit;
  font-size: .92rem;
  transition: var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-control::placeholder { color: var(--text3); }
option { background: var(--surface); color: var(--text); }

/* ===== NOTIFICATION / TOAST ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: .85rem 1.25rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: .88rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  z-index: 9999;
  animation: toastIn .3s ease;
  max-width: 360px;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
@keyframes toastIn { from { opacity:0; transform: translateY(16px); } to { opacity:1; transform: translateY(0); } }
@keyframes toastOut { to { opacity:0; transform: translateY(16px); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .export-bar { flex-direction: column; align-items: flex-start; }
  .conclusion-reasons { grid-template-columns: 1fr; }
  .winner-showcase { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .card { padding: 1.25rem; }
  .templates-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== PRINT ===== */
@media print {
  .grimont-global-header, .export-bar, .generate-actions, #setup-card { display: none !important; }
  .app-container { padding: 0; }
  body { font-size: 12px; }
  .matrix-wrap { overflow: visible; }
}

/* Extracted from index.html */

.grimont-global-header {
  width: 100%; z-index: 1000; position: sticky; top: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 0;
  font-family: 'Outfit', 'Inter', sans-serif;
  color: #e2e8f0; box-sizing: border-box;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}
.grimont-global-header * { box-sizing: border-box; }
.grimont-global-header .ggh-container {
  max-width: 1200px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; justify-content: space-between; align-items: center;
}
.ggh-left { display: flex; align-items: center; gap: 1.5rem; }
.ggh-logo-group { display: flex; align-items: center; gap: .875rem; text-decoration: none; transition: transform .2s ease; }
.ggh-logo-group:hover { transform: scale(1.02); }
.ggh-logo-box {
  width: 40px; height: 40px; background: linear-gradient(135deg, #2563eb, #7c3aed);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  color: white; font-weight: bold; font-size: 1.25rem;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.25); flex-shrink: 0;
}
.ggh-logo-text { font-family: 'Space Grotesk', monospace; font-weight: 800; font-size: 1.2rem; color: white; letter-spacing: .05em; display: none; }
.ggh-logo-text span { color: #00f2ff; }
@media (min-width: 640px) { .ggh-logo-text { display: block; } }
.ggh-separator { width: 1px; height: 36px; background: rgba(255,255,255,.1); display: none; }
@media (min-width: 768px) { .ggh-separator { display: block; } }
.ggh-app-info { display: flex; flex-direction: column; justify-content: center; }
.ggh-app-title-group { display: flex; align-items: center; gap: .6rem; }
.ggh-app-icon-container {
  width: 32px; height: 32px; border-radius: 8px; background: rgba(30, 41, 59, 1);
  border: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #60a5fa; box-shadow: 0 2px 10px rgba(0,0,0,.2); flex-shrink: 0;
}
.ggh-app-name { font-weight: 700; color: white; font-size: 1.05rem; margin: 0; padding: 0; letter-spacing: .02em; }
.ggh-app-desc { font-size: .8rem; color: #94a3b8; max-width: 600px; display: none; margin: 4px 0 0; padding: 0; line-height: 1.4; font-weight: 300; }
@media (min-width: 1024px) { .ggh-app-desc { display: block; } }
.ggh-right { display: flex; align-items: center; gap: 1rem; }
.ggh-right button {
  background: rgba(30,41,59,.6) !important; border: 1px solid rgba(255,255,255,.1) !important;
  color: #cbd5e1 !important; width: 40px !important; height: 40px !important;
  border-radius: 50% !important; display: flex !important; align-items: center !important;
  justify-content: center !important; cursor: pointer !important; transition: all .2s ease !important;
  padding: 0 !important; box-shadow: 0 2px 8px rgba(0,0,0,.1) !important;
}
.ggh-right button:hover {
  background: rgba(30,41,59,1) !important; color: white !important;
  border-color: rgba(255,255,255,.2) !important; transform: translateY(-1px) !important;
}

