/* SaaS Commerciale — Impeccable Style strict (light mode OKLCH).
 * Reuse les tokens du mockup exemples/maaf.fr.html.
 */

:root {
  --bg:           oklch(98.5% .003 250);
  --bg-surface:   oklch(100% 0 0);
  --bg-muted:     oklch(96% .005 250);
  --bg-hover:     oklch(94% .008 250);

  --text:           oklch(25% .02 250);
  --text-secondary: oklch(43% .02 250);
  --text-muted:     oklch(52% .018 250); /* assombri pour contraste WCAG AA sur petit texte */

  --accent:       oklch(55% .18 250);
  --accent-hover: oklch(48% .20 250);
  --accent-bg:    oklch(95% .03 250);

  --success: oklch(55% .17 155); --success-bg: oklch(95% .03 155);
  --warning: oklch(65% .18 85);  --warning-bg: oklch(95% .04 85);
  --danger:  oklch(55% .2 25);   --danger-bg:  oklch(95% .04 25);
  --info:    oklch(55% .15 280); --info-bg:    oklch(95% .03 280);

  --border: oklch(90% .01 250);
  --border-strong: oklch(82% .02 250);

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;

  --font-sans:    'Inter', 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Plus Jakarta Sans', var(--font-sans);
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  /* Échelle typographique resserrée (~ -10 %) pour un rendu plus compact. */
  --text-xs:    clamp(0.7rem, 0.66rem + 0.12vw, 0.75rem);
  --text-sm:    clamp(0.78rem, 0.75rem + 0.12vw, 0.8125rem);
  --text-base:  clamp(0.875rem, 0.85rem + 0.12vw, 0.9375rem);
  --text-lg:    clamp(1.0625rem, 1rem + 0.2vw, 1.15rem);
  --text-xl:    clamp(1.25rem, 1.15rem + 0.35vw, 1.5rem);
  --text-2xl:   clamp(1.5rem, 1.3rem + 0.5vw, 1.875rem);
  --text-3xl:   clamp(2rem, 1.7rem + 0.7vw, 2.4rem);
  --text-score: clamp(3rem, 2.6rem + 1.8vw, 4.5rem);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1100px; margin: 0 auto; padding: 40px 32px; }

/* ===== Topbar ===== */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 32px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); }
.topbar .actions { display: flex; gap: 8px; align-items: center; }
.topbar .user { font-size: var(--text-sm); color: var(--text-secondary); margin-right: 8px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 500;
  background: var(--bg-surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.btn:hover { background: var(--bg-muted); border-color: var(--border-strong); }
.btn-primary { background: var(--accent); color: oklch(100% 0 0); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-large { padding: 14px 28px; font-size: var(--text-base); font-weight: 600; }

/* ===== Form ===== */
.form-page { display: flex; flex-direction: column; align-items: center; padding: 64px 32px; min-height: 80vh; }
.form-page h1 {
  font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 800;
  letter-spacing: -0.02em; margin-bottom: 8px; text-align: center;
}
.form-page .tagline { color: var(--text-secondary); margin-bottom: 32px; max-width: 56ch; text-align: center; line-height: 1.6; }
.audit-form {
  width: 100%; max-width: 560px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: var(--text-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-sans); font-size: var(--text-base);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}
.field .hint { font-size: var(--text-xs); color: var(--text-muted); margin-top: 4px; }
.form-actions { margin-top: 24px; display: flex; justify-content: space-between; align-items: center; }
.form-meta { font-size: var(--text-xs); color: var(--text-muted); margin-top: 16px; text-align: center; }

/* ===== Error / Flash ===== */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  margin-bottom: 20px;
}
.flash-error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.flash-info  { background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent); }

/* ===== Audit Header / Score ===== */
.audit-header {
  display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center;
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
}
.audit-header h1 {
  font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 800;
  letter-spacing: -0.02em; margin-bottom: 8px;
}
.audit-header .meta { color: var(--text-secondary); font-size: var(--text-sm); display: flex; gap: 16px; flex-wrap: wrap; }
.audit-header .meta-item { display: inline-flex; align-items: center; gap: 6px; }
.audit-header .meta-item::before { content: ''; width: 4px; height: 4px; background: var(--text-muted); border-radius: 999px; }
.audit-header .meta-item:first-child::before { display: none; }

.score-block {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  text-align: center;
  min-width: 240px;
}
.score-label {
  font-size: var(--text-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-secondary); margin-bottom: 4px;
}
.score-quickwins { margin-top: 12px; font-size: var(--text-sm); color: var(--text-secondary); }
.score-quickwins strong { color: var(--accent); font-weight: 700; }

/* ===== KPI Bar ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 32px 0 48px; }
.kpi { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 16px; display: flex; flex-direction: column; }
/* min-height = 2 lignes : aligne les valeurs même quand un libellé passe sur 2 lignes */
.kpi .kpi-label { font-size: var(--text-xs); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: 6px; min-height: 2.4em; }
.kpi .kpi-value { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 800; color: var(--text); letter-spacing: -0.02em; line-height: 1.1; }
.kpi .kpi-trend { font-size: var(--text-xs); color: var(--text-muted); margin-top: auto; padding-top: 4px; }
.kpi-spark { width: 100%; height: 26px; display: block; margin: 8px 0 0; }
.trend-down { color: var(--danger); }
.trend-up   { color: var(--success); }
.kpi-highlight { background: var(--accent-bg); border-color: var(--accent); }
.kpi-highlight .kpi-value { color: var(--accent); }

/* ===== Tabs ===== */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 32px; }
.tab { padding: 12px 20px; font-size: var(--text-sm); font-weight: 600; color: var(--text-secondary); background: transparent; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 8px; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab .count { background: var(--bg-muted); color: var(--text-secondary); padding: 2px 8px; border-radius: 999px; font-size: var(--text-xs); font-weight: 600; }
.tab.active .count { background: var(--accent-bg); color: var(--accent); }

/* ===== Section ===== */
.section { margin-bottom: 56px; }
.section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.section-header h2 { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; letter-spacing: -0.02em; }
.section-header .section-count { background: var(--bg-muted); color: var(--text-secondary); padding: 4px 10px; border-radius: 999px; font-size: var(--text-xs); font-weight: 600; }
.section-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--accent); }
.section-dot.tech { background: var(--info); }
.section-dot.sem  { background: var(--accent); }
.section-dot.off  { background: var(--warning); }

/* ===== Quick Win cards ===== */
.qw-grid { display: grid; gap: 20px; }
.qw-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 28px; transition: border-color 120ms ease, box-shadow 120ms ease; }
.qw-card:hover { border-color: var(--border-strong); box-shadow: 0 1px 3px oklch(0% 0 0 / .04); }

/* ===== AI Reco cards (Claude) ===== */
.ai-reco-card {
  background: var(--info-bg);
  border: 1px solid color-mix(in srgb, var(--info), transparent 70%);
  border-left: 5px solid var(--info);
  border-radius: var(--radius-lg);
  padding: 28px 32px 24px;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.ai-reco-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px oklch(0% 0 0 / .05);
  border-left-color: var(--accent);
}
.ai-reco-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
}
.ai-reco-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--info);
  line-height: 0.9;
  min-width: 50px;
  flex-shrink: 0;
  letter-spacing: -0.04em;
}
.ai-reco-title-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex: 1;
  padding-top: 6px;
}
.ai-reco-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--text);
  flex: 1;
}
.ai-reco-prio { flex-shrink: 0; }
.ai-reco-body {
  color: var(--text);
  line-height: 1.7;
  font-size: 1rem;
  padding-left: 70px;
  max-width: 78ch;
}
.ai-reco-label {
  display: block;
  color: var(--info);
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 18px;
  margin-bottom: 4px;
  letter-spacing: -0.005em;
}
.ai-reco-body > .ai-reco-label:first-child { margin-top: 0; }
.ai-reco-emph {
  font-weight: 700;
  color: var(--text);
  background: color-mix(in srgb, var(--info), transparent 88%);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.ai-reco-step {
  display: inline-block;
  min-width: 1.5em;
  color: var(--info);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.ai-reco-source {
  margin-top: 20px;
  padding-left: 70px;
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--info), transparent 80%);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.ai-reco-source::before {
  content: 'Source : ';
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

@media (max-width: 700px) {
  .ai-reco-header { flex-direction: column; gap: 10px; }
  .ai-reco-body, .ai-reco-source { padding-left: 0; }
  .ai-reco-num { font-size: 2rem; }
}
.qw-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 10px; }
.qw-title h3 { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.qw-id { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); background: var(--bg-muted); padding: 2px 8px; border-radius: var(--radius-sm); font-weight: 600; white-space: nowrap; }
.qw-row { display: grid; grid-template-columns: 100px 1fr; gap: 12px; margin: 6px 0; font-size: var(--text-sm); line-height: 1.5; }
.qw-row .qw-key { color: var(--text-secondary); font-weight: 600; text-transform: uppercase; font-size: var(--text-xs); letter-spacing: 0.04em; padding-top: 2px; }
.qw-row code, .qw-row .url { font-family: var(--font-mono); font-size: 0.85em; background: var(--bg-muted); padding: 1px 6px; border-radius: var(--radius-sm); }
.qw-row .metric { font-weight: 700; font-variant-numeric: tabular-nums; }
.qw-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.qw-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.qw-source { font-size: var(--text-xs); color: var(--text-muted); font-family: var(--font-mono); }
.qw-source::before { content: 'Source : '; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }

/* ===== Badges ===== */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: var(--text-xs); font-weight: 600; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 999px; background: currentColor; opacity: 0.7; }
.badge-effort-xs { background: var(--success-bg); color: var(--success); }
.badge-effort-s  { background: var(--accent-bg);  color: var(--accent); }
.badge-effort-m  { background: var(--warning-bg); color: var(--warning); }
.badge-impact-fort   { background: var(--danger-bg);  color: var(--danger); }
.badge-impact-moyen  { background: var(--warning-bg); color: var(--warning); }
.badge-impact-faible { background: var(--bg-muted);   color: var(--text-secondary); }
.badge-gain { background: var(--info-bg); color: var(--info); font-variant-numeric: tabular-nums; }

/* ===== Dataviz : Gauge / Donut / Sparkline ===== */
.gauge { display: block; width: 100%; max-width: 240px; height: auto; margin: 4px auto 0; }
.gauge-track { fill: none; stroke: var(--bg-muted); stroke-width: 16; stroke-linecap: round; }
.gauge-fill  { fill: none; stroke-width: 16; stroke-linecap: round; }
.gauge-fill.danger  { stroke: var(--danger); }
.gauge-fill.warning { stroke: var(--warning); }
.gauge-fill.success { stroke: var(--success); }
.gauge-value-text { font-family: var(--font-display); font-size: 52px; font-weight: 800; fill: var(--text); letter-spacing: -0.04em; }
.gauge-suffix-text { font-family: var(--font-display); font-size: 16px; font-weight: 600; fill: var(--text-muted); }
.gauge-rating { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; text-align: center; margin-top: -8px; }

.donut-wrap { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.donut { flex: 0 0 64px; width: 64px; height: 64px; }
.donut-track { fill: none; stroke: var(--bg-muted); stroke-width: 11; }
.donut-segment { fill: none; stroke-width: 11; transform: rotate(-90deg); transform-origin: 32px 32px; }
.donut-segment.tech { stroke: var(--info); }
.donut-segment.sem  { stroke: var(--accent); }
.donut-segment.off  { stroke: var(--warning); }
.donut-center-text { font-family: var(--font-display); font-size: 18px; font-weight: 800; fill: var(--text); }
.donut-legend { font-size: var(--text-xs); display: grid; gap: 4px; line-height: 1.3; color: var(--text-secondary); }
.donut-legend-row { display: flex; align-items: center; gap: 6px; }
.donut-legend-dot { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; }
.donut-legend strong { color: var(--text); font-weight: 700; }

.sparkline-block {
  display: flex; align-items: center; gap: 16px;
  margin: 12px 0; padding: 12px 16px;
  background: var(--danger-bg); border-radius: var(--radius-sm);
  border-left: 3px solid var(--danger);
}
.sparkline { flex: 0 0 220px; width: 220px; height: 60px; }
.sparkline-area { fill: var(--danger); fill-opacity: 0.10; }
.sparkline-path { fill: none; stroke: var(--danger); stroke-width: 1.5; stroke-linejoin: round; }
.sparkline-dot { fill: var(--danger); }
.sparkline-dot-last { fill: var(--bg-surface); stroke: var(--danger); stroke-width: 2; }
.sparkline-axis { font-family: var(--font-mono); font-size: 9px; fill: var(--text-muted); }
.sparkline-caption { font-size: var(--text-xs); color: var(--text-secondary); line-height: 1.5; flex: 1; }
.sparkline-caption strong { color: var(--danger); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ===== Loading SSE ===== */
.loading-page { padding: 64px 32px; max-width: 720px; margin: 0 auto; }
.loading-page h1 { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 800; margin-bottom: 8px; }
.loading-page .tagline { color: var(--text-secondary); margin-bottom: 40px; }
.wave-row { display: grid; grid-template-columns: 140px 1fr 80px; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border); }
.wave-name { font-weight: 600; display: flex; gap: 8px; align-items: center; }
.wave-bar { height: 8px; background: var(--bg-muted); border-radius: 999px; overflow: hidden; }
.wave-bar-fill { height: 100%; background: var(--accent); width: 0; transition: width 240ms ease; }
.wave-bar-fill.tech { background: var(--info); }
.wave-bar-fill.sem  { background: var(--accent); }
.wave-bar-fill.off  { background: var(--warning); }
.wave-status { font-size: var(--text-xs); color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }
.wave-checks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; padding-left: 156px; }
.wave-check { font-family: var(--font-mono); font-size: var(--text-xs); padding: 2px 8px; border-radius: var(--radius-sm); color: var(--text-muted); background: var(--bg-muted); }
.wave-check.done { color: var(--success); background: var(--success-bg); }

/* ===== CTA + Footer ===== */
.cta { background: var(--bg-surface); border: 1px solid var(--accent); border-radius: var(--radius-lg); padding: 32px 40px; margin: 48px 0 32px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.cta-content h3 { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; margin-bottom: 8px; letter-spacing: -0.01em; }
.cta-content p { color: var(--text-secondary); font-size: var(--text-sm); line-height: 1.6; max-width: 56ch; }
.footer { text-align: center; padding: 24px 0; border-top: 1px solid var(--border); font-size: var(--text-xs); color: var(--text-muted); }
.footer strong { color: var(--text-secondary); font-weight: 600; }

/* ===== Login ===== */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px; background: var(--bg-muted); }
.login-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 400px; }
.login-card h1 { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; margin-bottom: 24px; text-align: center; }

/* ===== Recent audits ===== */
.recent-audits { margin-top: 48px; }
.recent-audits h2 { font-size: var(--text-lg); font-weight: 700; margin-bottom: 12px; }
.recent-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.recent-table th { text-align: left; font-weight: 600; color: var(--text-secondary); padding: 12px 16px; border-bottom: 2px solid var(--border-strong); }
.recent-table td { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.recent-table tr:hover { background: var(--bg-muted); }
.recent-table a { color: var(--accent); text-decoration: none; }
.recent-table a:hover { text-decoration: underline; }

/* ===== Fiche prospect ===== */
.prospect-section { margin-top: 8px; margin-bottom: 28px; }
.prospect-card { background: var(--bg-surface); border: 1px solid var(--border); border-left: 3px solid var(--info); border-radius: var(--radius-lg); padding: 24px 28px; }
.prospect-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.prospect-emoji { font-size: 20px; line-height: 1; }
.prospect-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 800; margin: 0; }
.prospect-sub { font-weight: 600; color: var(--text-muted); }
.prospect-tag { font-size: var(--text-xs); color: var(--info); background: var(--info-bg); padding: 3px 10px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.prospect-name { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 800; color: var(--text); letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 18px; }
.prospect-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px 28px; }
.prospect-field-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.prospect-field-value { font-size: var(--text-sm); color: var(--text-primary); line-height: 1.45; }
.prospect-prop { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.prospect-prop-text { font-size: var(--text-sm); color: var(--text-primary); line-height: 1.55; margin-top: 4px; max-width: 80ch; }
.prospect-angle { margin-top: 18px; padding: 14px 18px; background: var(--accent-bg); border-radius: var(--radius); border: 1px solid var(--accent); border-left-width: 3px; }
.prospect-angle-label { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); }
.prospect-angle-text { font-size: var(--text-sm); color: var(--text-primary); margin-top: 6px; line-height: 1.55; }
.prospect-contact { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.prospect-chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--text-secondary); background: var(--bg-muted); padding: 5px 11px; border-radius: 999px; line-height: 1.4; }
.prospect-chip-k { font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.03em; }
.prospect-chip-link { text-decoration: none; color: var(--info); font-weight: 600; transition: background 120ms ease; }
.prospect-chip-link:hover { background: var(--info-bg); }
.prospect-chip-social { text-decoration: none; color: var(--text-secondary); font-weight: 600; transition: background 120ms ease, color 120ms ease; }
.prospect-chip-social:hover { background: var(--info-bg); color: var(--info); }
.prospect-soc-ic { font-weight: 800; }

/* ===== Pitch commercial (hero condensé) ===== */
.pitch { display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 28px; margin: 8px 0 28px; }
.pitch-verdict { display: flex; flex-direction: column; gap: 4px; padding-right: 26px; border-right: 1px solid var(--border); }
.pitch-verdict-k { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 600; }
.pitch-verdict-w { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 800; color: var(--accent); letter-spacing: -0.02em; line-height: 1.1; }
.pitch-body { display: grid; gap: 10px; min-width: 0; }
.pitch-row { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: baseline; }
.pitch-row-k { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; }
.pitch-row-v { font-size: var(--text-sm); color: var(--text-primary); line-height: 1.5; }
.pitch-row-opp .pitch-row-v { font-weight: 600; }
.pitch-cta { white-space: nowrap; align-self: center; background: var(--accent); color: #fff; padding: 11px 20px; border-radius: var(--radius); font-weight: 700; font-size: var(--text-sm); text-decoration: none; transition: opacity 120ms ease; }
.pitch-cta:hover { opacity: 0.9; }

/* ===== Lexique SEO ===== */
.lex { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--info); cursor: help; }
.lex:hover { color: var(--info); border-bottom-style: solid; }
.lex-section { margin-top: 48px; }
.lex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; margin: 0; }
.lex-entry { padding: 11px 0; border-bottom: 1px solid var(--border); scroll-margin-top: 84px; }
.lex-entry:target { background: var(--info-bg); border-radius: var(--radius-sm); padding-left: 10px; padding-right: 10px; }
.lex-term { font-weight: 700; color: var(--text); font-size: var(--text-sm); margin: 0 0 2px; }
.lex-def { margin: 0; font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.5; }

/* ===== Clusters sémantiques (bullet chart part de voix) ===== */
.clusters-card { margin-top: 20px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 24px; }
.clusters-title { font-family: var(--font-display); font-size: var(--text-base); font-weight: 700; margin: 0 0 16px; color: var(--text); }
.clusters-sub { font-weight: 600; color: var(--text-muted); font-size: var(--text-sm); }
.clusters-list { display: grid; gap: 18px; }
.cluster-item { display: block; }
.cluster-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 7px; }
.cluster-name { font-weight: 600; font-size: var(--text-sm); color: var(--text-primary); }
.cluster-nums { font-size: var(--text-xs); color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cluster-gap { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-weight: 700; font-size: 11px; vertical-align: middle; }
.cluster-gap.behind { background: var(--danger-bg); color: var(--danger); }
.cluster-gap.lead { background: var(--success-bg); color: var(--success); }
.cluster-track { position: relative; height: 12px; background: var(--bg-muted); border-radius: 999px; }
.cluster-you { position: absolute; left: 0; top: 0; height: 100%; background: var(--accent); border-radius: 999px; min-width: 4px; transition: width 400ms ease; }
.cluster-leadmark { position: absolute; top: -4px; width: 3px; height: 20px; background: var(--text-secondary); border-radius: 2px; box-shadow: 0 0 0 2px var(--bg-surface); }
.cluster-note { font-size: var(--text-xs); color: var(--text-muted); margin-top: 6px; line-height: 1.4; }
.clusters-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); font-size: var(--text-xs); color: var(--text-muted); }
.clusters-legend span { display: inline-flex; align-items: center; }
.lg-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; }
.lg-tick { display: inline-block; width: 3px; height: 14px; background: var(--text-secondary); border-radius: 2px; margin-right: 8px; }

/* ===== Analyse sémantique approfondie ===== */
.sem-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 20px; }
.sem-h3 { font-family: var(--font-display); font-size: var(--text-base); font-weight: 700; margin: 0 0 6px; color: var(--text); }
.sem-note { font-size: var(--text-sm); color: var(--text-muted); margin: 0 0 14px; max-width: 72ch; }
.sem-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sem-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.sem-table th { text-align: left; color: var(--text-muted); font-weight: 600; padding: 8px 14px 8px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.sem-table th.num { text-align: right; }
.sem-table td { padding: 10px 14px 10px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.sem-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sem-sub { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; font-weight: 400; }
.sem-bar { display: inline-block; width: 54px; height: 7px; background: var(--bg-muted); border-radius: 999px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.sem-bar > span { display: block; height: 100%; border-radius: 999px; }
.sem-pot { color: var(--success); font-weight: 700; }
.sem-vs { color: var(--danger); font-weight: 700; }
.sem-profiles { display: grid; gap: 14px; }
.sem-profile-dom { font-weight: 700; font-size: var(--text-sm); margin-bottom: 6px; color: var(--text); }
.sem-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sem-chip { display: inline-flex; align-items: center; gap: 5px; font-size: var(--text-xs); background: var(--bg-muted); padding: 4px 10px; border-radius: 999px; color: var(--text-secondary); }
.sem-chip-v { color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Cocon dépliable (clic = exemples de mots-clés réels) */
.sem-cocon > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: baseline; gap: 8px; transition: color 150ms ease; }
.sem-cocon > summary::-webkit-details-marker { display: none; }
.sem-cocon > summary::before { content: "\25B8"; color: var(--text-muted); font-size: 0.8em; transition: transform 150ms ease; }
.sem-cocon[open] > summary::before { transform: rotate(90deg); }
.sem-cocon > summary:hover { color: var(--accent); }
.sem-cocon > summary:hover::before { color: var(--accent); }
.sem-kw-list { list-style: none; margin: 10px 0 4px; padding: 10px 0 0; border-top: 1px dashed var(--border); display: grid; gap: 7px; }
.sem-kw-list li { display: flex; justify-content: space-between; gap: 14px; font-size: var(--text-xs); align-items: baseline; }
.sem-kw-term { color: var(--text-secondary); flex-shrink: 0; }
.sem-kw-meta { color: var(--text-muted); font-variant-numeric: tabular-nums; text-align: right; line-height: 1.5; }

/* ===== Radar concurrentiel ===== */
.radar-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 24px; margin-top: 24px; }
.radar-h3 { font-family: var(--font-display); font-size: var(--text-base); font-weight: 700; margin: 0 0 8px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; }
.radar-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.radar-svg { width: 100%; max-width: 440px; height: auto; }
.radar-axis-label { font-size: 11px; fill: var(--text-secondary); font-weight: 600; }
.radar-legend { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; font-size: var(--text-xs); color: var(--text-secondary); }
.radar-legend span { display: inline-flex; align-items: center; }
.radar-note { font-size: var(--text-xs); color: var(--text-muted); margin: 6px 0 0; text-align: center; max-width: 60ch; }

/* ===== Treemap des cocons ===== */
.treemap { position: relative; width: 100%; height: 360px; border-radius: var(--radius); overflow: hidden; background: var(--bg-muted); }
.treemap-cell { position: absolute; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 8px 10px; border: 1.5px solid var(--bg-surface); overflow: hidden; transition: filter 150ms ease; }
.treemap-cell:hover { filter: brightness(1.07); }
.treemap-name { font-weight: 700; font-size: var(--text-sm); line-height: 1.15; }
.treemap-val { font-size: var(--text-xs); opacity: 0.92; font-variant-numeric: tabular-nums; }
.treemap-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: var(--text-xs); color: var(--text-muted); }
.treemap-legend span { display: inline-flex; align-items: center; }

/* ===== Menu sticky du rapport ===== */
html { scroll-behavior: smooth; }
[id^="s-"], .report-anchor { scroll-margin-top: 64px; }
.report-nav { position: sticky; top: 0; z-index: 30; display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 0; margin: -8px 0 18px; background: var(--bg); border-bottom: 1px solid var(--border); }
.report-nav-link { font-size: var(--text-xs); font-weight: 600; color: var(--text-secondary); text-decoration: none; padding: 6px 13px; border-radius: 999px; white-space: nowrap; transition: background 150ms ease, color 150ms ease; }
.report-nav-link:hover { background: var(--bg-muted); color: var(--text); }
.report-nav-link.active { background: var(--accent); color: #fff; }

/* ===== Accessibilité & polish (passe design) ===== */
a { transition: color 150ms ease; }
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.lex:focus-visible { outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .audit-header { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .cta { grid-template-columns: 1fr; }
  .container { padding: 24px 20px; }
  .wave-row { grid-template-columns: 1fr; }
  .wave-checks { padding-left: 0; }
  /* Empile les grilles 2-colonnes du rapport (styles inline) sur mobile */
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns: 220px 1fr"] { grid-template-columns: 1fr !important; }
}

@media (max-width: 640px) {
  .container { padding: 18px 14px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px 12px; }
  .kpi .kpi-value { font-size: var(--text-xl); }
  .audit-header h1 { font-size: var(--text-2xl); }
  .qw-grid { grid-template-columns: 1fr !important; }
  .pitch { grid-template-columns: 1fr; gap: 16px; padding: 18px 16px; }
  .pitch-verdict { flex-direction: row; align-items: baseline; gap: 10px; padding: 0 0 12px; border-right: none; border-bottom: 1px solid var(--border); }
  .pitch-row { grid-template-columns: 1fr; gap: 2px; }
  .pitch-cta { text-align: center; }
  .lex-grid { grid-template-columns: 1fr; }
  .prospect-card { padding: 18px 16px; }
  .prospect-name { font-size: var(--text-xl); }
  .prospect-grid { grid-template-columns: 1fr; gap: 14px; }
  .prospect-contact { gap: 6px; }
  .prospect-chip { font-size: 11px; padding: 5px 9px; }
  /* Topbar : autorise le retour à la ligne des actions */
  .topbar { flex-wrap: wrap; gap: 8px; }
  .topbar .actions { flex-wrap: wrap; }
  /* Tableaux scrollables horizontalement plutôt que débordants */
  .recent-table, .section table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* Sparkline / SVG plein largeur */
  svg { max-width: 100%; }
}
