:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --subtle: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --night: #1e293b;
  --blue: #0ea5e9;
  --violet: #0284c7;
  --cyan: #22d3ee;
  --green: #10b981;
  --amber: #fbbf24;
  --gold: #ffde59;
  --butter: #fffbeb;
  --red: #ef4444;

  /* Audit Scores (matching detail view) */
  --score-red: #ef4444;
  --score-orange: #f97316;
  --score-green: #10b981;

  --focus: rgba(14, 165, 233, .12);
  --shadow: 0 4px 12px rgba(8, 47, 73, 0.05);
  --shadow-soft: 0 2px 8px rgba(8, 47, 73, 0.04);
  --radius: 10px;
  --radius-lg: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 2px 2px, rgba(14, 165, 233, 0.04) 1px, transparent 0),
    radial-gradient(circle at 72% 0, rgba(34, 211, 238, 0.05), transparent 34%),
    linear-gradient(180deg, #ffffff 0, var(--bg) 420px);
  background-size: 32px 32px, auto, auto;
  color: var(--ink);
  line-height: 1.45;
  text-rendering: geometricPrecision;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.icon { width: 18px; height: 18px; flex: 0 0 auto; }
.icon path { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, #0c4a6e 0, #0ea5e9 100%);
  color: #fff;
  border-right: 1px solid rgba(255,255,255,.06);
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: auto -56px 68px auto;
  width: 170px;
  height: 170px;
  border: 1px solid rgba(255, 255, 255, .05);
  transform: rotate(28deg);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-soft);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  flex-shrink: 0;
  overflow: hidden;
}

.brand-mark svg {
  width: 44px;
  height: 44px;
  display: block;
}

.brand strong { display: flex; align-items: center; gap: 5px; font-size: 18px; line-height: 1.1; }
.brand-by { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 400; color: rgba(255,255,255,.7); }
.brand-by svg { display: block; flex-shrink: 0; }
.brand span, .sidebar-note p { color: rgba(255,255,255,.65); font-size: 13px; }
.side-nav { display: grid; gap: 6px; }

.nav-item {
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 11px 12px;
  background: transparent;
  color: rgba(255, 255, 255, .7);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.nav-item:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}

.nav-item.active {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(255, 222, 89, 0.2);
}

.nav-item.active .icon { color: var(--gold); }

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.06);
  position: relative;
  z-index: 1;
}
.sidebar-note span { font-weight: 800; }

.workspace {
  min-width: 0;
  padding: 6px clamp(22px, 3.2vw, 44px) 64px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, 660px);
  align-items: center;
  gap: 18px;
  margin-bottom: 8px;
}

.topbar-title { display: flex; align-items: center; gap: 16px; }
.topbar-title:has(h1:empty) { display: none; }
.topbar:has(h1:empty) {
  grid-template-columns: minmax(520px, 660px);
  justify-content: end;
  padding-top: 14px;
  margin-bottom: 8px;
}

.topbar:not(:has(h1:empty)) {
  padding-top: 14px;
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(26px, 2.8vw, 38px);
  line-height: 1.08;
  letter-spacing: 0;
}
.topbar h1:empty { display: none; }
.topbar p { margin: 0; color: var(--muted); }
.eyebrow { text-transform: uppercase; color: var(--muted); font-size: 12px; letter-spacing: .08em; font-weight: 800; }

.topbar-tools {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) max-content;
  align-items: center;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .8);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
  overflow: visible;
  backdrop-filter: blur(12px);
}

.global-search {
  position: relative;
  color: var(--muted);
  min-width: 0;
  display: block;
  border-right: 1px solid var(--line);
  height: 100%;
}

.global-search .icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  z-index: 1;
}

.global-search > span {
  display: none;
}

#global_search_input {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 50px;
  margin: 0;
  padding: 11px 13px 11px 38px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  @media (max-width: 720px) {
    border-top-right-radius: var(--radius);
    border-bottom-left-radius: 0px;
  }
}
.global-search input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.global-search input:focus { outline: 0; border-color: transparent; }
.global-search-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.global-search-results[hidden] { display: none; }
.global-search-results a,
.global-search-results p {
  margin: 0;
  padding: 10px 11px;
  border-radius: 10px;
}
.global-search-results a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}
.global-search-results a:hover {
  background: var(--surface-soft);
}
.global-search-result-content {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.global-search-results strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.global-search-result-type {
  padding: 5px 8px;
  border-radius: 999px;
  background: #e8f7ef;
  color: var(--green);
  font-size: 11px;
  font-weight: 850;
}
.global-search-results small,
.global-search-results p {
  color: var(--muted);
  font-size: 12px;
}
.global-search-results small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile {
  min-width: 0;
  padding: 7px 10px 7px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}
.profile span {
  padding-right: 10px;
  border-right: 1px solid var(--line);
  white-space: nowrap;
}
.profile strong {
  color: var(--ink);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile a {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: var(--radius);
  background: var(--night);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  white-space: nowrap;
}
.profile a .icon { color: var(--gold); }

.view { display: none; }
.view.active { display: block; }
.page-content-wrapper { margin-top: 0; }
.page-content-wrapper .section-heading > .actions {
  padding-top: 44px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.compact-heading { margin-top: -4px; }
.section-heading h2 {
  margin: 0 0 6px;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.08;
  letter-spacing: 0;
}
.section-heading p { margin: 0; color: var(--muted); max-width: 760px; }

.flow-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  background: var(--line);
}
.flow-strip article { background: var(--surface); padding: 18px; display: grid; gap: 5px; position: relative; }
.flow-strip article::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.flow-strip span { color: var(--blue); font-weight: 850; font-size: 12px; letter-spacing: .08em; }
.flow-strip strong { font-size: 18px; }
.flow-strip p { margin: 0; color: var(--muted); font-size: 13px; }

.panel,
.stat-card,
.score-card,
.recommendation,
.pdf-page,
.phone-frame,
.template-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.panel { padding: 22px; }
.panel-title { margin-bottom: 18px; }
.panel-title h3, .panel-title p { margin: 0; }
.panel-title h3 { display: inline-flex; align-items: center; gap: 9px; font-size: 18px; }
.panel-title h3 .icon { color: var(--amber); }
.panel-title p, .help, small, .fineprint { color: var(--muted); }
.inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ── Dashboard ──────────────────────────────────────────── */
.dash { display: grid; gap: 16px; }

.dash-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}
.dash-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 16px 18px;
  display: grid;
  gap: 6px;
  align-content: start;
}
.dash-stat .icon { color: var(--muted); opacity: .7; }
.dash-stat strong {
  font-size: 30px;
  line-height: 1;
  color: var(--ink);
  font-weight: 900;
  letter-spacing: -.02em;
}
.dash-stat span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.dash-stat.accent {
  background: linear-gradient(135deg, var(--night), #111827);
  border-color: rgba(255,255,255,.05);
}
.dash-stat.accent .icon { color: var(--gold); opacity: 1; }
.dash-stat.accent strong { color: var(--gold); }
.dash-stat.accent span { color: rgba(255,255,255,.5); }

.dash-main-insights {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.dash-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 16px;
  align-items: start;
}
.dash-main { display: grid; gap: 0; }
.dash-side { display: grid; gap: 14px; position: sticky; top: 14px; align-self: start; }

.dash-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.dash-empty .icon { width: 32px; height: 32px; opacity: .3; }
.dash-empty strong { color: var(--ink); font-size: 15px; }
.dash-empty p { margin: 0; font-size: 13px; max-width: 280px; line-height: 1.5; }

.dash-quick form,
.dash-quick-form {
  display: grid;
  gap: 11px;
}
.dash-quick-btn { width: 100%; margin-top: 4px; }

.dash-panel-compact { padding: 18px; }

.donut-container {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 8px 0;
}
.donut-chart {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.donut-hole {
  width: 68px;
  height: 68px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.04);
}
.donut-hole strong { font-size: 18px; line-height: 1; color: var(--ink); }
.donut-hole span { font-size: 10px; text-transform: uppercase; color: var(--muted); letter-spacing: 0.05em; font-weight: 800; }
.donut-legend { flex: 1; display: grid; gap: 8px; }
.legend-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend-row .dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-row .label { color: var(--muted); font-weight: 700; flex: 1; }
.legend-row .value { color: var(--ink); font-weight: 850; }

.insight-card { padding: 18px; }
.insight-card .panel-title { margin-bottom: 14px; }
.insight-bars { display: grid; gap: 10px; }
.insight-bars p {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  gap: 6px 8px;
  margin: 0;
  padding: 5px 0;
  color: var(--muted);
  font-size: 12px;
}
.insight-bars p span {
  grid-column: 1 / -1;
  font-weight: 760;
  font-size: 12px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.insight-bars i {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
}
.insight-bars b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}
.insight-bars strong { color: var(--ink); text-align: right; font-weight: 800; font-size: 13px; }

.priority-list { display: grid; gap: 0; }
.priority-list p {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.priority-list p:last-child { border-bottom: 0; padding-bottom: 0; }
.priority-list span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.priority-list strong { color: var(--ink); font-size: 13px; font-weight: 800; white-space: nowrap; }

.two-columns,
.result-grid,
.email-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, .82fr);
  gap: 18px;
  margin-bottom: 18px;
}
.result-grid.single-result { grid-template-columns: 1fr; }
.single-result .score-focus { max-width: 980px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 18px;
}
.form-grid.wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.context-grid .category-choice { grid-column: 1 / -1; }
.category-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}
.category-choice legend {
  width: 100%;
  margin-bottom: 4px;
  padding-bottom: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}
.choice-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 820;
  cursor: pointer;
}
.choice-chip input {
  width: auto;
  min-height: auto;
  accent-color: var(--blue);
}
.choice-chip:has(input:checked) {
  border-color: var(--blue);
  color: #0f172a;
}
.choice-chip-global {
  border-color: var(--gold);
  background: rgba(56, 189, 248, .1);
}
label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 760; }
.field-label { display: inline-flex; align-items: center; gap: 7px; }
.field-label .icon { width: 15px; height: 15px; color: var(--amber); }

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 11px 13px;
  color: var(--ink);
  background: var(--surface);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: 0;
  padding: 0;
  margin: 0;
}
select {
  appearance: none;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 19px,
    calc(100% - 13px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
input:hover, select:hover, textarea:hover { border-color: var(--subtle); background-color: var(--surface-soft); }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--focus); border-color: var(--blue); }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }

.primary,
.secondary,
.actions button,
.actions a,
.filters button,
.filters a,
.chips button,
.text-btn,
.audit-list button,
.audit-list a,
.score-card button,
.recommendation button,
.tabs button,
.tabs a,
.template-grid button,
.template-grid a,
.prospect-detail button,
.prospect-detail a {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 10px 15px;
  background: var(--surface);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  font-weight: 780;
  line-height: 1.2;
  box-shadow: 0 1px 1px rgba(0,0,0,.12);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.primary {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--night);
  box-shadow: 0 4px 12px rgba(255, 222, 89, 0.2);
}
.actions .primary,
.filters .primary,
.tabs .primary,
button.primary,
a.primary {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--night);
}
.secondary:hover,
.actions button:hover,
.actions a:hover,
.filters a:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  background: var(--surface-soft);
}
.primary:hover,
.actions .primary:hover,
.filters .primary:hover,
button.primary:hover,
a.primary:hover {
  background: #fbd54e;
  border-color: #fbd54e;
  color: var(--night);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 222, 89, 0.3);
}
.primary:focus-visible,
.actions .primary:focus-visible,
button.primary:focus-visible,
a.primary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  color: #fff;
}
.small { padding: 9px 12px; min-height: 38px; }
.actions, .filters, .chips, .tabs { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }

.icon-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  line-height: 1;
  box-shadow: 0 1px 1px rgba(16,24,40,.04);
  color: var(--muted);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.icon-btn:hover { color: var(--blue); background: #f3f6ff; transform: none; box-shadow: none; border-color: #bfd0ff; }
.icon-btn--danger:hover { color: var(--red); background: #fff4f4; border-color: #ffd0d0; }
.icon-btn .icon { display: block; margin: 0; }

.form-grid + .form-actions,
.form-grid + input[type="hidden"] + .form-actions {
  margin-top: 22px;
}
.launch-panel .form-actions {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.chips button.selected, .tabs a.selected, .tabs button.selected {
  border-color: #bfd0ff;
  background: #eef4ff;
  color: var(--blue);
}

.step-progress {
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow-soft);
}
.step-progress-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.step-progress-header strong { display: block; font-size: 18px; }
.step-progress-header span, .step-progress-header small { color: var(--muted); font-size: 13px; }
.step-progress-header small { padding: 6px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 800; }
.step-progress.compact-step { padding: 14px; margin-bottom: 14px; }
.progress-line { height: 8px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.08); }
.progress-line i { display: block; width: var(--progress); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--amber)); }
.step-track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.compact-step .step-track { margin-top: 10px; }
.step-track span {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 11px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 800;
}
.step-track span .icon { width: 16px; height: 16px; color: currentColor; }
.step-track b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 7px;
  background: rgba(255,255,255,.08);
  color: var(--ink);
  font-size: 11px;
}
.step-track .done { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.step-track .done b { background: var(--gold); color: var(--night); }
.step-track .current { outline: 3px solid var(--focus); }
.audit-progress .step-track { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.audit-list {
  display: grid;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}
.audit-list .audit-row {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 180px 140px max-content;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  transition: all .2s ease;
  position: relative;
}
.audit-list .audit-row:nth-child(even) { background: #fafbfc; }
.audit-list .audit-row:hover { background: #f1f7ff; transform: translateX(4px); box-shadow: inset 4px 0 0 var(--blue); }
.audit-list .audit-row:last-child { border-bottom: 0; }

.audit-cell-company { display: grid; gap: 10px; min-width: 0; }
.audit-select { display: flex; align-items: center; }
.audit-select input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
}
.audit-main-info { display: grid; gap: 4px; }
.audit-main-info strong { font-size: 17px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.audit-main-info span { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--blue); font-weight: 700; }
.audit-main-info .icon { width: 14px; height: 14px; opacity: 0.8; }

.audit-meta-tags {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-width: 0;
}
.audit-meta-tags span,
.audit-meta-tags a { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 700; }
.audit-meta-tags .icon { width: 13px; height: 13px; opacity: 0.5; }
.audit-meta-tags a {
  text-decoration: none;
  color: var(--blue);
}
.audit-meta-tags a.audit-campaign-link {
  color: var(--muted);
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  min-height: 0;
  box-shadow: none;
  font-weight: 700;
}
.audit-owner-tag {
  color: var(--violet) !important;
  background: #f0f9ff;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #e0f2fe;
  min-height: 0;
  box-shadow: none;
  line-height: 1.2;
}
.audit-meta-tags a.audit-owner-tag,
.audit-meta-tags span.audit-owner-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  background: #f0f9ff;
  border: 1px solid #e0f2fe;
  border-radius: 999px;
  min-height: 0;
  box-shadow: none;
}
.audit-meta-tags a.audit-owner-tag { color: var(--violet) !important; }

.audit-cell-score { display: flex; align-items: center; }
.audit-score-group { display: flex; align-items: center; gap: 12px; }
.audit-score-pill {
  position: relative;
  width: 86px;
  height: 26px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0,0,0,0.05);
}
.audit-score-pill i {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: var(--color);
  transition: width 0.4s ease;
}
.audit-score-pill b {
  position: relative;
  z-index: 2;
  font-size: 12px;
  color: var(--text-color, #fff);
  font-weight: 900;
  text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}
.audit-score-pill.compact { width: 64px; height: 22px; }
.audit-score-pill.compact b { font-size: 11px; }
.potential-tag {
  font-size: 11px;
  font-weight: 850;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  background: var(--surface-soft);
  border-radius: 4px;
  white-space: nowrap;
}

.audit-cell-status { display: flex; justify-content: start; }
.audit-cell-actions { 
  
  display: flex; 
  justify-content: flex-end; 
  position: relative; 
  z-index: 2;

  @media (max-width: 720px){
    justify-content: flex-start; 
  }
}

.latest-panel,
.latest-panel .audit-list {
  min-width: 0;
}
.audit-row:hover {
  background: #f8fafc;
}
.row-action { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; color: var(--blue); font-weight: 800; font-size: 13px; background: #f9fafc; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 850px; }
th, td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:hover { background: var(--surface-soft); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.status-badge, .lead { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 10px 5px 8px; font-size: 12px; font-weight: 850; position: relative; overflow: hidden; }
.status-badge .icon { width: 12px; height: 12px; flex-shrink: 0; opacity: .85; }
.status-badge::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  height: 2px;
  width: var(--pipeline-pct, 0%);
  background: currentColor;
  opacity: .35;
  border-radius: 0 999px 999px 0;
}
.s-draft       { background: #f1f5f9; color: #64748b; --pipeline-pct: 12%; }
.s-ready       { background: #e0e7ff; color: #4338ca; --pipeline-pct: 28%; }
.s-email       { background: #ede9fe; color: #6d28d9; --pipeline-pct: 42%; }
.s-sent        { background: #e0f2fe; color: #0369a1; --pipeline-pct: 56%; }
.s-relaunch    { background: #e0f2fe; color: #0284c7; --pipeline-pct: 70%; }
.s-opportunity { background: #d0f2ff; color: #0369a1; --pipeline-pct: 100%; }
.s-replied     { background: #ccfbf1; color: #0d9488; --pipeline-pct: 82%; }
.base          { background: var(--surface-soft); color: var(--ink); border: 1px solid var(--line); }
.lead.strong   { background: #dcfce7; color: #166534; }
.lead.very     { background: var(--butter); color: var(--amber); border: 1px solid var(--gold); }
.lead.medium   { background: var(--surface-soft); color: var(--muted); }

.wizard { display: grid; gap: 18px; }
.audit-composer .panel { position: relative; }
.audit-composer h3 { display: flex; align-items: center; gap: 10px; margin-top: 0; }
.audit-composer .form-grid + .help { margin-top: 16px; }
.audit-composer .actions { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.audit-composer .actions button { min-width: 174px; }
.audit-composer [hidden] { display: none; }
.wizard-actions { justify-content: flex-end; }
.step-pill {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.analysis-screen { text-align: center; max-width: 880px; margin: 40px auto; }
.lottie-visual {
  width: 240px;
  height: 240px;
  margin: 0 auto 20px;
  position: relative;
  overflow: hidden;
}
.analysis-meta { display: grid; gap: 4px; margin: 18px auto; color: var(--muted); }
.progress { height: 9px; background: #eef2f8; border-radius: 999px; overflow: hidden; }
.progress.large { max-width: 620px; height: 12px; margin: 0 auto 18px; }
.progress i, .bar-chart i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.checklist { columns: 2; text-align: left; max-width: 760px; margin: 22px auto; color: var(--muted); line-height: 2; list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 28px; transition: all .3s ease; }
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: var(--surface);
}
.checklist .done { color: var(--green); font-weight: 700; }
.checklist .done::before {
  background: var(--green);
  border-color: var(--green);
  content: "✓";
  color: #fff;
  font-size: 10px;
  display: grid;
  place-items: center;
  line-height: 1;
}
.checklist .active { color: var(--ink); font-weight: 850; transform: translateX(4px); }
.checklist .active::before {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 222, 89, 0.2);
  animation: pulse-sun 2s infinite;
}
@keyframes pulse-sun {
  0% { box-shadow: 0 0 0 0 rgba(255, 222, 89, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(255, 222, 89, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 222, 89, 0); }
}

/* ── Prospect discovery ─────────────────────────────────── */
.discovery-page {
  display: grid;
  gap: 22px;
}

.discovery-form {
  display: grid;
  gap: 20px;
}

.range-field {
  display: grid;
  gap: 9px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  --range-thumb-size: 24px;
  --range-track-height: 8px;
  #requestedLimit {
    padding-left: 20px;
  }
}

.range-field-head,
.range-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.range-field-head label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.range-field-head strong {
  color: var(--ink);
  white-space: nowrap;
}

.range-field input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: calc(100% + var(--range-thumb-size));
  min-height: var(--range-thumb-size);
  height: var(--range-thumb-size);
  margin: 2px calc(var(--range-thumb-size) / -2);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.range-field input[type="range"]:hover,
.range-field input[type="range"]:focus {
  background: transparent;
}

.range-field input[type="range"]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 6px;
}

.range-field input[type="range"]::-webkit-slider-runnable-track {
  height: var(--range-track-height);
  border-radius: 999px;
  background: var(--night);
}

.range-field input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: var(--range-thumb-size);
  height: var(--range-thumb-size);
  margin-top: calc((var(--range-track-height) - var(--range-thumb-size)) / 2);
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, .12);
}

.range-field input[type="range"]::-moz-range-track {
  height: var(--range-track-height);
  border: 0;
  border-radius: 999px;
  background: var(--night);
}

.range-field input[type="range"]::-moz-range-thumb {
  width: var(--range-thumb-size);
  height: var(--range-thumb-size);
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, .12);
}

.range-scale {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.filter-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.filter-choice legend {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 16px;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.filter-choice legend .icon {
  width: 15px;
  height: 15px;
  color: var(--amber);
}

.discovery-actions {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

.discovery-history {
  display: grid;
  gap: 14px;
  .historique_title {
    margin-top: 20px;
  }
}

.discovery-search {
  padding: 0;
  overflow: hidden;
}

.discovery-search summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}

.discovery-search summary::-webkit-details-marker {
  display: none;
}

.discovery-search summary span:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.discovery-search summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discovery-search summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discovery-summary-metrics {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.discovery-summary-metrics > b:not(.status-badge) {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.discovery-search .table-wrap {
  border-top: 1px solid var(--line);
}

.discovery-site-cell {
  display: grid;
  gap: 4px;
  min-width: 280px;
}

.discovery-site-cell strong,
.discovery-site-cell a,
.discovery-site-cell small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.discovery-site-cell strong {
  color: var(--ink);
  white-space: nowrap;
}

.discovery-site-cell a {
  color: var(--blue);
  font-weight: 800;
  white-space: nowrap;
}

.discovery-site-cell small {
  max-width: 560px;
  color: var(--muted);
  white-space: nowrap;
}

.discovery-result-list td {
  vertical-align: top;
}

.discovery-result-list .is-rejected {
  color: var(--muted);
}
.discovery-campaign-action {
  display: grid;
  gap: 8px;
  min-width: 180px;
}
.discovery-campaign-action select {
  min-width: 0;
}

.audit-header {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.audit-header span { display: block; color: var(--muted); font-size: 12px; font-weight: 760; }
.audit-header strong { overflow-wrap: anywhere; }
.audit-path { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.audit-path span { position: relative; padding: 10px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-weight: 800; text-align: center; }
.audit-path span.done { background: #e8f7ef; color: var(--green); border-color: #bee7d2; }

.score-focus {
  display: grid;
  grid-template-columns: 210px 1fr;
  align-items: center;
  gap: 22px;
}
.score-ring {
  width: 176px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  place-content: center;
  background: conic-gradient(var(--ring-color, var(--blue)) calc(var(--score) * 1%), #eef2f8 0);
  position: relative;
  margin: auto;
}
.score-ring::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.score-ring strong, .score-ring span { position: relative; z-index: 1; }
.score-ring strong { font-size: 38px; line-height: 1; color: var(--ring-color, var(--ink)); }
.score-ring span { color: var(--muted); font-size: 13px; }
.small-ring { width: 126px; }
.small-ring strong { font-size: 26px; }
.lead-box { margin-top: 16px; padding: 14px; border-radius: var(--radius); background: var(--surface-soft); border: 1px solid var(--line); }
.lead-box span { display: block; margin-top: 4px; color: var(--muted); }

.bar-chart { display: grid; gap: 10px; }
.bar-chart p { display: grid; grid-template-columns: 170px 1fr 48px; gap: 10px; align-items: center; margin: 0; color: var(--muted); font-size: 13px; }
.bar-chart i { height: 10px; }
.bar-chart b { color: var(--ink); }

.score-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 18px 0;
}
.score-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 17px;
}
.score-card h3, .score-card p { margin: 0; }
.score-card strong { font-size: 28px; line-height: 1; }
.score-card span { color: var(--ink); font-weight: 850; font-size: 13px; opacity: 0.8; }
.score-card p { color: var(--muted); line-height: 1.45; }
.score-card.priority {
  background: var(--surface);
  border-color: var(--line);
}
.score-card.priority .score-card-main span {
  color: #dc2626;
  opacity: 1;
}
.score-card.priority .progress i {
  background: linear-gradient(90deg, var(--gold), var(--amber));
}
.score-card-detailed { padding: 22px; gap: 16px; }

.score-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: start;
  gap: 16px;
}
.score-card-main h3 { font-size: 24px; }
.score-card-main strong { font-size: 42px; }
.score-card-copy {
  display: grid;
  gap: 10px;
  max-width: 980px;
}
.score-card-copy p { font-size: 17px; line-height: 1.6; }
.score-card-copy .internal-detail {
  padding: 14px 16px;
  border: 1px solid rgba(251, 191, 36, .3);
  border-radius: var(--radius);
  background: rgba(251, 191, 36, .07);
  color: var(--ink);
}
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.evidence-grid > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .62);
}
.evidence-grid h4,
.indicator-card h4,
.callout-card strong {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 14px;
}
.evidence-grid ul,
.indicator-card ul,
.callout-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}
.mini-score-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mini-score-list span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
}
.mini-score-list strong { font-size: 12px; }

.report-section { margin: 18px 0; }
.report-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.report-section-title span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--night);
  color: #fff;
  font-weight: 900;
}
.report-section-title h2 {
  margin: 0;
  font-size: 25px;
}
.floating-title { margin: 28px 0 14px; }
.indicator-list { display: grid; gap: 14px; }
.indicator-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(13, 148, 136, .22);
  border-radius: var(--radius);
  background: rgba(13, 148, 136, .04);
}
.indicator-card > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}
.indicator-card h3 { margin: 0; font-size: 19px; }
.indicator-card span { color: var(--muted); font-weight: 800; }
.indicator-card > strong { font-size: 18px; color: var(--blue); }
.indicator-card p { margin: 0; color: var(--muted); line-height: 1.6; }
.expert-note-panel form { display: grid; gap: 14px; }
.wysiwyg-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.wysiwyg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #f7faff;
}
.wysiwyg-toolbar button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
}
.wysiwyg-toolbar button:hover { border-color: var(--blue); }
.wysiwyg-editor {
  min-height: 230px;
  padding: 18px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
  outline: none;
}
.wysiwyg-editor:focus { box-shadow: inset 0 0 0 3px var(--focus); }
.wysiwyg-editor p { margin: 0 0 12px; }
.wysiwyg-editor ul { margin: 0 0 12px; padding-left: 22px; }
.rich-copy {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.65;
}
.summary-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.summary-columns > div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.summary-columns > .negative-points {
  border-color: rgba(239, 68, 68, .28);
  background: rgba(239, 68, 68, .05);
}
.summary-columns h3 { margin: 0 0 10px; }
.summary-columns ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}
.callout-card {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid rgba(8, 145, 178, .22);
  border-radius: var(--radius);
  background: rgba(8, 145, 178, .05);
}
.callout-card p { margin: 0; color: var(--muted); line-height: 1.6; }
.muted-callout { border-color: rgba(13, 148, 136, .22); background: rgba(13, 148, 136, .05); }

.scoring-panel { margin-bottom: 16px; }
.scoring-panel .error-state { margin-bottom: 12px; }
.scoring-list { display: grid; }
.scoring-row {
  display: grid;
  grid-template-columns: minmax(180px, .36fr) 112px minmax(280px, 1fr) 104px;
  align-items: end;
  column-gap: 16px;
  row-gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.scoring-row:last-child { border-bottom: 0; padding-bottom: 0; }
.scoring-category { display: grid; gap: 3px; min-width: 0; align-self: center; }
.scoring-category strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scoring-category small { color: var(--muted); font-size: 12px; }
.weight-field,
.description-field {
  gap: 6px;
}
.weight-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}
.weight-field span,
.description-field span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.weight-field b {
  padding: 0 0 11px 7px;
  color: var(--muted);
  font-size: 13px;
}
.switch-field {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  min-height: 44px;
  color: var(--ink);
  font-weight: 800;
}
.switch-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.switch-field span {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.switch-field span::before {
  content: "";
  width: 38px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.72);
  transition: background .16s ease, border-color .16s ease;
}
.switch-field span::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .16s ease, background .16s ease;
}
.switch-field input:checked + span::before {
  background: var(--night);
  border-color: var(--night);
}
.switch-field input:checked + span::after {
  transform: translateX(16px);
  background: var(--gold);
}
.switch-field input:focus + span::before { outline: 3px solid var(--focus); }
.view-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.view-switch > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.rules { margin-bottom: 18px; }
.rules h3 { margin-top: 0; }
.rules pre {
  white-space: pre-wrap;
  background: #101828;
  color: #edf4ff;
  padding: 16px;
  border-radius: var(--radius);
  font-size: 12px;
  overflow: auto;
}
.recommendations { display: grid; gap: 12px; margin-bottom: 18px; }
.report-empty-state {
  margin-bottom: 18px;
  border: 1px dashed rgba(19, 33, 55, 0.18);
  background: rgba(255,255,255,.72);
}
.report-empty-state strong,
.report-empty-state p {
  display: block;
  margin: 0;
}
.report-empty-state p {
  margin-top: 8px;
  color: var(--muted);
}
.recommendation {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  min-width: 0;
}
.recommendation b {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef4ff;
  color: var(--blue);
}
.recommendation h3, .recommendation p { margin: 0 0 6px; }
.recommendation span, .recommendation em { color: var(--muted); font-size: 13px; }
.recommendation .switch-field--stacked {
  display: inline-grid;
  justify-items: center;
  align-content: center;
  justify-content: center;
  gap: 10px;
}
.recommendation .switch-field--stacked strong {
  order: -1;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  text-align: center;
}
.recommendation .switch-field--stacked span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 24px;
}
.recommendation .switch-field--stacked span::after {
  left: 0;
  top: 50%;
  margin-left: 2px;
  transform: translateY(-50%);
}
.recommendation .switch-field--stacked input:checked + span::after {
  transform: translate(16px, -50%);
}
.editable-recommendation textarea { min-height: 74px; }
.strengths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.strengths h3 { grid-column: 1 / -1; margin: 0; }

.editor-layout, .crm-layout { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
.report-nav { display: grid; gap: 8px; position: sticky; top: 22px; }
.report-nav button, .report-nav a { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 12px; text-align: left; color: var(--ink); }
.toggles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.editable-report { display: grid; gap: 14px; }

.pdf-grid { display: grid; grid-template-columns: repeat(4, minmax(260px, 1fr)); gap: 18px; overflow-x: auto; padding-bottom: 10px; }
.pdf-page { min-height: 620px; padding: 34px; border-radius: var(--radius); box-shadow: 0 14px 40px rgba(16,24,40,.12); }
.pdf-page header { display: flex; justify-content: space-between; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 28px; }
.pdf-page h2 { margin: 0 0 14px; }
.pdf-score { margin: 38px 0 12px; font-size: 72px; line-height: 1; color: var(--blue); font-weight: 900; }
.cta-box { padding: 18px; background: #eef4ff; border-radius: var(--radius); color: var(--night); line-height: 1.55; }

.email-preview textarea { min-height: 520px; }
.attachment { padding: 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); display: flex; gap: 8px; align-items: center; }
.prospect-detail { display: grid; gap: 12px; }
.mini-scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-scores span { padding: 10px; border-radius: var(--radius); background: #f3f6ff; font-size: 12px; font-weight: 850; }
.timeline p { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.vertical { flex-direction: column; }
.rule-grid, .template-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.template-grid article { padding: 18px; box-shadow: none; display: grid; gap: 10px; align-content: start; }
.template-grid h3, .template-grid p { margin: 0 0 8px; }
.template-grid span { color: var(--muted); font-size: 13px; }
.template-filter-panel { margin-bottom: 14px; }
.template-filter-panel .tabs { gap: 8px; }
.template-list { display: grid; }
.template-row {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(160px, .38fr) max-content 120px;
  align-items: center;
  column-gap: 16px;
  min-height: 76px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.template-row:last-child { border-bottom: 0; }
.template-row:hover { background: var(--surface-soft); }
.template-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 0;
  box-shadow: none;
  padding: 0;
  min-height: 0;
  background: transparent;
  justify-content: start;
  color: var(--ink);
}
.template-main:hover { background: transparent; border: 0; box-shadow: none; transform: none; }
.template-main strong,
.template-main small,
.template-meta b,
.template-meta small,
.template-date {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.template-main strong { font-size: 16px; }
.template-main small, .template-meta small, .template-date { color: var(--muted); font-size: 12px; }
.template-meta { display: grid; gap: 3px; min-width: 0; }
.template-meta b { color: var(--ink); font-size: 13px; }
.template-date { text-align: right; }

.mobile-frames { margin-top: 34px; }
.phones { display: flex; gap: 18px; flex-wrap: wrap; }
.phone-frame {
  width: 330px;
  min-height: 640px;
  padding: 22px;
  border-radius: 34px;
  border: 8px solid #111827;
  box-shadow: 0 24px 60px rgba(16,24,40,.18);
  position: relative;
  overflow: hidden;
}
.mobile-stat { background: #f3f6ff; border-radius: 16px; padding: 14px; margin-bottom: 14px; }
.mobile-stat strong { display: block; font-size: 36px; }
.mobile-score-list p { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sticky-mobile-actions { position: absolute; left: 14px; right: 14px; bottom: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: rgba(255,255,255,.9); padding: 10px; border-radius: 18px; backdrop-filter: blur(8px); }
.sticky-mobile-actions button { border: 0; border-radius: var(--radius); padding: 10px; background: var(--night); color: #fff; }
.toast { position: fixed; right: 22px; bottom: 22px; background: var(--night); color: #fff; padding: 14px 18px; border-radius: var(--radius-lg); box-shadow: var(--shadow); opacity: .96; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, .15), transparent 34%),
    var(--bg);
  background-size: auto, auto;
}
.login-card {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 30px;
  display: grid;
  gap: 18px;
}
.login-card .brand span { color: var(--muted); }
.login-card .brand strong { color: var(--ink); }
.login-card .brand-mark { box-shadow: none; }
.login-card .brand-by { color: #000 !important; }
.login-card h1, .login-card p { margin: 0; }
.login-card p { color: var(--muted); line-height: 1.5; }
.login-card form { display: grid; gap: 14px; }
.error-state { border: 1px solid #ffd0d0; color: var(--red); background: #fff4f4; padding: 12px; border-radius: var(--radius); }
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.alert-error { background: #fff4f4; border: 1px solid #ffd0d0; color: var(--red); }

.filters-form {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(140px, 1fr)) auto;
  align-items: end;
  gap: 16px;
  margin-bottom: 24px;
}
.compact-filters {
  padding: 22px 26px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  border-radius: var(--radius-lg);
}
.filters-form label { gap: 6px; }
.filters-form .field-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 850; }
.campaign-bulk-panel {
  display: grid;
  grid-template-columns: minmax(280px, 540px) auto;
  align-items: end;
  gap: 16px 24px;
  margin-bottom: 24px;
}
.campaign-bulk-panel label {
  display: grid;
  gap: 6px;
}
.campaign-bulk-panel .field-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 850;
}
.campaign-bulk-panel .actions {
  justify-content: flex-start;
}

.audits-panel { padding: 0; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 4px 24px rgba(0,0,0,0.04); }
.audits-panel .panel-title { padding: 22px 24px; margin-bottom: 0; border-bottom: 1px solid var(--line); background: #fafbfc; }
.audits-panel .panel-title h3 { font-size: 19px; font-weight: 850; }
.audits-panel .audit-list { background: #fff; }

.table-actions { display: inline-flex; gap: 8px; }
.weight-input { max-width: 82px; }
.save-row { margin: 14px 0 18px; }
.copied { background: #e8f7ef !important; color: var(--green) !important; border-color: #bee7d2 !important; }

/* ── Contact lookup (wizard step 03) ── */
.contact-lookup { display: grid; gap: 18px; }
.contact-lookup-email-label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 760; }
.contact-lookup-email-wrap { position: relative; display: flex; align-items: center; gap: 10px; }
.contact-lookup-email-wrap input { flex: 1; }
.contact-lookup-spinner { display: flex; align-items: center; }
.contact-lookup-spinner .icon { width: 18px; height: 18px; color: var(--muted); }
.contact-lookup-found,
.contact-lookup-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}
.contact-lookup-found { background: #dcfce7; color: #166534; }
.contact-lookup-found .icon { width: 13px; height: 13px; }
.contact-lookup-new { background: #e0f2fe; color: #0369a1; }
.contact-lookup-new .icon { width: 13px; height: 13px; }
.contact-lookup-fields { animation: fadeSlideIn .2s ease; }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .8s linear infinite; }

/* ── Contacts listing ── */
.contacts-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.contacts-search-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  height: 46px;
}
.contacts-search-field .icon { color: var(--muted); flex-shrink: 0; }
.contacts-search-field input {
  flex: 1;
  border: 0;
  background: transparent;
  min-height: auto;
  padding: 0;
  box-shadow: none;
}
.contacts-search-field input:focus { outline: none; }
.contact-list { display: grid; }
.contact-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) max-content 20px;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  transition: background .16s ease;
  border-radius: var(--radius);
  text-decoration: none;
}
.contact-row:last-child { border-bottom: 0; }
.contact-row:hover { background: var(--surface-soft); }
.contact-row > .icon { color: var(--muted); opacity: .5; }
.contact-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--night), #0369a1);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
  flex-shrink: 0;
}
.contact-info { display: grid; gap: 2px; min-width: 0; }
.contact-info strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-info span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-info em { font-size: 12px; color: var(--blue); font-style: normal; font-weight: 700; }
.contact-meta { display: grid; gap: 2px; text-align: right; }
.contact-meta b { font-size: 14px; font-weight: 800; }
.contact-meta span { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ── Contact detail ── */
.contact-view { display: grid; gap: 14px; }
.contact-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 22px;
  padding: 24px;
}
.contact-card-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--night), #0369a1);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 900;
  flex-shrink: 0;
}
.contact-card-info h2 { margin: 0 0 4px; font-size: 24px; }
.contact-card-role { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.contact-card-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.contact-card-chips span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  background: var(--surface-soft);
}
.contact-card-chips .icon { width: 13px; height: 13px; }

/* ── Report view ────────────────────────────────────────── */
.report-view { display: grid; gap: 12px; }
.report-view > * { min-width: 0; }

/* ── Comparaison secteur ── */
.sector-compare {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  display: grid;
  gap: 10px;
}
.sector-compare-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.sector-compare-label span {
  font-size: 10px;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
}
.sector-compare-track-wrap { display: grid; gap: 6px; }
.sector-compare-track {
  position: relative;
  height: 10px;
  background: var(--line);
  border-radius: 999px;
  overflow: visible;
}
.sector-compare-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  max-width: 100%;
}
.sector-compare-track em {
  position: absolute;
  top: -5px;
  width: 2px;
  height: 20px;
  background: var(--ink);
  border-radius: 1px;
  transform: translateX(-50%);
  cursor: default;
}
.sector-compare-track em::after {
  content: "Moy.";
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: .03em;
}
.sector-compare-values {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
}
.sector-compare-values strong { font-size: 20px; line-height: 1; font-weight: 900; }
.sector-compare-values b { color: var(--muted); font-weight: 700; }
.sector-compare-delta {
  font-size: 13px;
  font-weight: 800;
  margin: 0;
}
.sector-compare-delta.positive { color: var(--green); }
.sector-compare-delta.negative { color: var(--red); }

/* ── Benchmark add section (scoring page) ── */
.benchmark-row { grid-template-columns: minmax(180px, .36fr) 140px 1fr; }
.benchmark-add { display: grid; gap: 12px; padding-top: 4px; }
.benchmark-add--sep { padding-top: 18px; border-top: 1px solid var(--line); margin-top: 8px; }
.benchmark-add-fields {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 14px;
  align-items: end;
}

/* ── Campaigns ── */
.campaign-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}
.campaign-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.campaign-create {
  align-self: start;
}
.campaign-create .actions {
  margin-top: 16px;
}
.campaign-template-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  flex-wrap: nowrap;
}
.campaign-template-row label {
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}
.campaign-template-row .actions {
  margin-top: 0;
  flex-wrap: nowrap;
  flex: 0 0 auto;
}
.campaign-template-row .actions > button {
  white-space: nowrap;
}
.campaign-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}
.campaign-row-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content max-content max-content;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.campaign-row form {
  margin: 0;
}
.campaign-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.campaign-summary span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 1180px) {
  .campaign-template-row {
    gap: 12px;
  }
  .campaign-template-row label {
    flex-basis: calc(100% - 250px);
  }
  .campaign-template-row .actions > button {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* ── Hero details (analyse complète repliée) ── */
.hero-details {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 4px;
}
.hero-details > summary {
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  color: var(--blue);
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hero-details > summary::-webkit-details-marker { display: none; }
.hero-details > summary::before { content: '+ '; }
.hero-details[open] > summary::before { content: '− '; }
.hero-details-body {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

/* ── Bouton flottant retour en haut ── */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 28px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: var(--night);
  color: #fff;
  border: 0;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.22);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease, box-shadow .2s ease;
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0,0,0,.28);
}
.back-to-top .icon { width: 20px; height: 20px; }

.report-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  gap: 16px 20px;
  padding: 18px 22px;
}
.report-meta-pipeline {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.report-identity { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.report-url-wrap { display: flex; align-items: center; gap: 16px; }
.visit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px !important;
  font-weight: 800;
  padding: 6px 12px !important;
  border-color: var(--line-strong) !important;
  background: var(--surface) !important;
  color: var(--blue) !important;
}
.visit-btn:hover {
  background: var(--surface-soft) !important;
  border-color: var(--blue) !important;
}
.visit-btn span {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.visit-btn .icon {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  transition: color .2s ease;
}
.contact-link:hover {
  color: var(--blue);
}
.contact-link .icon {
  width: 16px;
  height: 16px;
  color: var(--blue);
  transition: transform .2s ease;
}
.contact-link:hover .icon {
  transform: scale(1.1);
}
.contact-name {
  font-weight: 700;
  font-size: 13px;
}
.report-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.report-attribution {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}
.report-attribution .icon {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}
.report-attribution strong {
  color: var(--ink);
  font-weight: 800;
}
.report-chips span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  background: rgba(255,255,255,.7);
  line-height: 1;
}
.report-meta-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.report-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.report-actions form { display: contents; }

.pipeline-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.pipeline-label {
  font-size: 11px;
  font-weight: 900;
  color: var(--muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding-left: 10px;
}
.pipeline-steps {
  display: flex;
  align-items: stretch;
  flex: 1;
  border-radius: var(--radius);
  overflow: hidden;
}
.pipeline-steps span {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px 8px 24px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  background: #f1f5f9;
  text-align: center;
  position: relative;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
  margin-left: -12px;
  transition: all .2s ease;
}
.pipeline-steps span:first-child {
  padding-left: 14px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
  margin-left: 0;
}
.pipeline-steps span:last-child {
  padding-right: 14px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 12px 50%);
}
.pipeline-steps span.done {
  background: #e8f7ef;
  color: var(--green);
}
.pipeline-steps span.current {
  background: var(--blue);
  color: #fff;
  z-index: 1;
}
.pipeline-steps span.current .icon {
  color: #fff;
}
.pipeline-steps span .icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.pipeline-bar { width: 80px; height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; flex-shrink: 0; margin-right: 10px; }
.pipeline-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--amber)); border-radius: inherit; transition: width .4s ease; }

.status-form { display: contents; }
.status-selector-wrap { display: grid; gap: 4px; cursor: pointer; }
.status-selector-wrap .field-label { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.status-selector {
  position: relative;
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  overflow: hidden;
  min-width: 160px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  transition: all .2s ease;
}
.status-selector:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.status-selector select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  padding: 8px 32px 8px 12px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  width: 100%;
  outline: none;
}
.status-selector .icon {
  position: absolute;
  right: 10px;
  width: 12px;
  height: 12px;
  pointer-events: none;
  color: var(--muted);
  transition: color .2s ease;
}
.status-selector:hover .icon {
  color: var(--blue);
}

/* Status colors — badge style (no border-left) */
.status-selector.s-draft       { background: #f1f5f9; border-color: #cbd5e1; }
.status-selector.s-draft select { color: #64748b; }
.status-selector.s-ready       { background: #e0f2fe; border-color: #7dd3fc; }
.status-selector.s-ready select { color: #0369a1; }
.status-selector.s-email       { background: #ede9fe; border-color: #c4b5fd; }
.status-selector.s-email select { color: #6d28d9; }
.status-selector.s-sent        { background: #e0f2fe; border-color: #93c5fd; }
.status-selector.s-sent select { color: #0284c7; }
.status-selector.s-relaunch    { background: #fef3c7; border-color: #fde68a; }
.status-selector.s-relaunch select { color: #92400e; }
.status-selector.s-opportunity { background: #dcfce7; border-color: #86efac; }
.status-selector.s-opportunity select { color: #166534; }
.status-selector.s-replied     { background: #ccfbf1; border-color: #5eead4; }
.status-selector.s-replied select { color: #0d9488; }
.status-selector.s-inactive    { opacity: 0.55; filter: grayscale(.4); }

.report-anchors {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, .95);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 12px rgba(8, 47, 73, 0.04);
}
.quick-access-label {
  font-size: 11px;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
}
.quick-access-links {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 0;
  margin: -4px 0;
}
.quick-access-links::-webkit-scrollbar { display: none; }
.quick-access-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  transition: all .2s ease;
  border: 1px solid transparent;
}
.quick-access-links a:hover {
  background: #fff;
  border-color: var(--line-strong);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  color: var(--blue);
  transform: translateY(-1px);
}
.quick-access-links a .icon {
  width: 14px;
  height: 14px;
  color: var(--ink);
  opacity: 0.6;
}
.quick-access-links a:hover .icon {
  color: var(--blue);
  opacity: 1;
}

.report-hero {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 28px;
  align-items: start;
  padding: 26px;
}
.hero-score { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.hero-body { display: grid; gap: 14px; }
.hero-summary { font-size: 17px; line-height: 1.65; color: var(--ink); margin: 0; }
.hero-lead {
  padding: 14px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.hero-lead strong { display: block; margin-bottom: 4px; font-size: 15px; }
.hero-lead p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 14px; }

.report-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 4px;
  padding: 2px 0;
}
.report-section-header span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--night);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}
.report-section-header h2 { margin: 0; font-size: 21px; }

/* score-cards grid défini plus haut */
.score-card-summary { font-size: 14px; line-height: 1.5; color: var(--muted); margin: 2px 0 0; }
.score-card-details {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.score-card-details > summary {
  font-size: 12px;
  font-weight: 800;
  color: var(--blue);
  cursor: pointer;
  list-style: none;
  padding: 3px 0;
  user-select: none;
}
.score-card-details > summary::-webkit-details-marker { display: none; }
.score-card-details > summary::before { content: '+ '; }
.score-card-details[open] > summary::before { content: '− '; }
.score-card-inner { margin-top: 14px; display: grid; gap: 12px; }
.score-card-inner .evidence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.reco-content { display: grid; gap: 8px; min-width: 0; }
.reco-title-input {
  font-size: 15px;
  font-weight: 700;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 4px 0 6px;
  background: transparent;
  color: var(--ink);
  width: 100%;
}
.reco-title-input:focus { border-bottom-color: var(--blue); outline: none; box-shadow: none; }
.reco-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.reco-tags span { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: #eef4ff; color: var(--blue); }

.report-details {
  overflow: hidden;
}
.details-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background .2s ease;
  position: relative;
}
.details-toggle::-webkit-details-marker { display: none; }
.details-toggle .icon { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted); }
.details-toggle strong { font-size: 15px; }
.details-hint { margin-left: auto; margin-right: 32px; font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.details-toggle::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .3s ease;
}
.report-details[open] .details-toggle::after {
  transform: translateY(-30%) rotate(-135deg);
}
.details-body { padding: 20px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.report-details--technical .details-toggle { color: var(--muted); }
.rule-line { display: flex; gap: 12px; align-items: baseline; font-size: 14px; }
.rule-line span { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; min-width: 60px; }
.rule-line p { margin: 0; }

/* ── Audit Detail Overhaul (Modern Dashboard) ── */
.audit-header-modern {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-soft);
  margin-bottom: 0;
}
.audit-identity-group { display: grid; gap: 14px; }
.audit-title-row h1 { margin: 0; font-size: 32px; letter-spacing: -0.02em; }
.audit-meta-row { display: flex; flex-wrap: wrap; gap: 8px; }
.audit-sub-meta { display: flex; align-items: center; gap: 16px; margin-top: 4px; }

.audit-actions-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
}
.audit-status-box {
  background: var(--surface-soft);
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: grid;
  gap: 6px;
}
.audit-status-box .field-label { font-size: 11px; opacity: 0.7; }

.audit-pipeline-track {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 14px 28px;
  margin-bottom: 16px;
}

.audit-nav-sticky {
  position: sticky;
  top: 14px;
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.audit-nav-sticky a {
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.audit-nav-sticky a:hover { color: var(--blue); background: var(--surface); }
.audit-nav-sticky a.active { background: var(--night); color: #fff; }

.audit-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 340px;
  gap: 20px;
  margin-bottom: 24px;
}
.audit-combined-panel {
  grid-column: span 2;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 24px 32px;
}
.audit-main-score {
  flex: 0 0 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.audit-summary-card { padding: 24px; grid-row: span 2; display: flex; flex-direction: column; }
.audit-summary-card h3 { margin-top: 0; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.audit-summary-text { font-size: 15px; line-height: 1.6; color: var(--ink); margin-bottom: 16px; flex-grow: 1; }

.audit-potential-badge {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--night);
  color: #fff;
  width: fit-content;
}
.audit-potential-badge span { font-size: 11px; opacity: 0.7; font-weight: 700; text-transform: uppercase; }
.audit-potential-badge strong { font-size: 16px; color: var(--gold); }

.audit-benchmark-card {
  flex: 1;
  padding: 0 0 0 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 0;
  box-shadow: none;
  background: transparent;
  border-left: 1px solid var(--line);
}

.audit-pros-cons-grid {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.audit-pro-card, .audit-con-card { padding: 20px; }
.audit-pro-card h4, .audit-con-card h4 { margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.audit-pro-card h4 { color: var(--green); }
.audit-con-card h4 { color: var(--red); }
.audit-pros-cons-grid ul { margin: 0; padding-left: 20px; color: var(--muted); line-height: 1.6; }

.audit-section-title {
  margin: 40px 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.audit-section-title h2 { margin: 0; font-size: 24px; font-weight: 900; }
.audit-section-title hr { flex: 1; border: 0; border-top: 1px solid var(--line); }

.internal-tools-section {
  margin-top: 64px;
  padding: 40px 28px;
  background: #f1f5f9;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  display: grid;
  gap: 24px;
}
.internal-tools-header { display: flex; align-items: center; gap: 12px; color: var(--night); }
.internal-tools-header h2 { margin: 0; font-size: 20px; text-transform: uppercase; letter-spacing: 0.05em; }

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
    .page-content-wrapper {
      padding-top: 50px;
    }}
  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.12);
  }
  .side-nav { grid-template-columns: repeat(4, 1fr); }
  .topbar, .two-columns, .result-grid, .email-layout, .editor-layout, .crm-layout, .audit-header, .score-cards, .strengths, .filters-form, .template-row, .scoring-row, .evidence-grid, .summary-columns, .audit-dashboard-grid, .audit-pros-cons-grid, .campaign-grid, .campaign-stack, .campaign-bulk-panel { grid-template-columns: 1fr !important; }
  .dash-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-layout { grid-template-columns: 1fr; }
  .report-meta { grid-template-columns: 1fr; gap: 14px; }
  .report-meta-right { align-items: flex-start; }
  .report-actions { justify-content: flex-start; }
  .report-hero { grid-template-columns: 160px 1fr; gap: 20px; }
  .score-card-inner .evidence-grid { grid-template-columns: 1fr; }
  .scoring-row .weight-field {
    grid-template-columns: max-content max-content;
    justify-content: start;
  }
  .topbar:has(h1:empty) { grid-template-columns: 1fr; }
  .topbar-tools { grid-template-columns: minmax(260px, 1fr) max-content; }
  .form-grid.wide, .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .workspace { padding: 16px; }
  .sidebar { padding: 18px; }
  .brand-mark { width: 40px; height: 40px; }
  .side-nav { grid-template-columns: 1fr 1fr; }
  .section-heading { display: grid; }
  .page-content-wrapper .section-heading > .actions { padding-top: 0; }
  .topbar { grid-template-columns: 1fr; }
  .topbar-tools { grid-template-columns: 1fr; }
  .global-search { border-right: 0; border-bottom: 1px solid var(--line); }
  .profile { justify-content: flex-start; flex-wrap: wrap; }
  .profile strong { max-width: none; }
  .checklist { columns: 1; }
  .score-focus, .recommendation { grid-template-columns: 1fr; }
  .report-hero { grid-template-columns: 1fr; }
  .hero-score { flex-direction: row; align-items: center; gap: 20px; }
  .pipeline-steps span { font-size: 11px; gap: 3px; padding: 0 4px; }
  .pipeline-steps span .icon { display: none; }
  .details-hint { display: none; }
  .score-card-main,
  .indicator-card > div:first-child {
    grid-template-columns: 1fr;
    display: grid;
  }
  .step-track, .audit-progress .step-track, .audit-list .audit-row, .flow-strip { grid-template-columns: 1fr; }
  .audits-panel .audit-list .audit-row {
    grid-template-columns: minmax(0, 1fr) max-content max-content;
  }
  .audit-meta-tags {
    flex-wrap: wrap;
  }
  .audits-panel .audit-main {
    grid-column: 1 / -1;
  }
  .audits-panel .audit-score {
    grid-column: 1;
  }
  .audits-panel .status-badge {
    grid-column: 2;
    align-self: center;
    justify-self: end;
    white-space: nowrap;
  }
  .audits-panel .table-actions {
    grid-column: 3;
    justify-self: end;
  }
  .prospects-panel .audit-list .audit-row {
    grid-template-columns: minmax(0, 1fr) max-content max-content;
  }
  .prospects-panel .audit-main {
    grid-column: 1 / -1;
  }
  .prospects-panel .audit-score {
    grid-column: 1;
  }
  .prospects-panel .status-badge {
    grid-column: 2;
    align-self: center;
    justify-self: end;
    white-space: nowrap;
  }
  .prospects-panel .table-actions {
    grid-column: 3;
    justify-self: end;
  }
  .prospects-panel .table-actions {
    grid-column: 2;
    justify-self: end;
  }
  .audit-main { grid-template-columns: 1fr; row-gap: 2px; }
  .audit-score { text-align: left; }
  .audit-score { justify-items: start; }
  .toggles, .rule-grid, .template-grid, .score-cards { grid-template-columns: 1fr; }
  .template-row { row-gap: 10px; }
  .template-date { text-align: left; }
  .switch-field { justify-content: flex-start; }
  .view-switch { align-items: flex-start; flex-direction: column; }
  .filter-choice { display: grid; grid-template-columns: 1fr; }
  .discovery-search summary {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .discovery-summary-metrics {
    justify-content: flex-start;
  }
  .discovery-result-list table,
  .discovery-result-list thead,
  .discovery-result-list tbody,
  .discovery-result-list tr,
  .discovery-result-list td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .discovery-result-list table {
    border-collapse: separate;
    border-spacing: 0;
  }
  .discovery-result-list thead {
    display: none;
  }
  .discovery-result-list tr {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }
  .discovery-result-list tr:last-child {
    border-bottom: 0;
  }
  .discovery-result-list td {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    border-bottom: 0;
    white-space: normal;
  }
  .discovery-result-list td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
  }
  .discovery-site-cell {
    min-width: 0;
  }
  .discovery-site-cell strong,
  .discovery-site-cell a,
  .discovery-site-cell small {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .section-heading h2 { font-size: 30px; }
  .actions { align-items: stretch; }
  .actions > a, .actions > button, .actions > form { width: 100%; }
.actions > form > button { width: 100%; }
  .audit-composer .actions button { width: 100%; }
  .bar-chart p { grid-template-columns: 1fr; }
  .panel, .login-card { padding: 18px; }
}

@media (max-width: 550px) {
  .audits-panel .audit-list .audit-row {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .audits-panel .audit-cell-company {
    grid-column: 1 / -1;
  }
  .audits-panel .audit-cell-score {
    grid-column: 1;
    justify-self: start;
  }
  .audits-panel .audit-cell-status {
    grid-column: 2;
    justify-self: end;
    align-self: center;
  }
  .audits-panel .audit-cell-actions {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 500px) {
  .campaign-template-row {
    display: grid;
    grid-template-columns: 1fr;
  }
}
