:root {
  /* Neutres chauds */
  --bg: #FAF7F5;
  --surface: #FFFFFF;
  --surface-alt: #F4ECF3;
  --ink: #1C1520;
  --ink-muted: #6B6172;
  --ink-quiet: #9A8FA0;
  --border: rgba(28, 21, 32, .13);

  /* Accent : mauve stylise (a la place de l'orange de la reference) */
  --accent: #8C4A94;
  --accent-hover: #723C79;
  --accent-deep: #3E2145;
  --accent-ink: #FFFFFF;
  --accent-soft: #F1E1EF;

  --ok: #1F8B5C;
  --error: #C0392B;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-xl: 40px;
  --radius-full: 999px;

  --font-display: "Baloo 2", "Inter", system-ui, sans-serif;
  --font: "Inter", system-ui, sans-serif;

  --shadow-card: 0 1px 2px rgba(28,21,32,.05), 0 16px 40px rgba(28,21,32,.08);
  --shadow-lift: 0 14px 32px rgba(140,74,148,.28);
  --shadow-pill: 0 8px 24px rgba(28,21,32,.10);
}

* { box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0 0 10px;
  line-height: 1.05;
}
p { line-height: 1.6; margin: 0 0 12px; }

/* ---------- Nav en pilule flottante ---------- */
.nav-pill {
  position: sticky;
  top: 16px;
  z-index: 20;
  margin: 16px auto 0;
  max-width: 820px;
  width: calc(100% - 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 12px 12px 22px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-pill);
}
.nav-pill-logo {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--accent);
  font-size: 16px;
}
.nav-pill-user {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0; /* sans ca, l'email long refuse de retrecir et ejecte le bouton */
  font-size: 13px;
  color: var(--ink-muted);
}
.nav-pill-user #user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-pill-logo { flex-shrink: 0; }
#btn-logout { flex-shrink: 0; white-space: nowrap; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 9px 18px;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
@media (hover: hover) {
  .btn-ghost:hover { border-color: var(--accent); background: var(--accent-soft); }
}

/* ---------- Formes geometriques + blobs organiques ---------- */
.shape-field {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  color: var(--accent);
  --shape-cutout: var(--bg);
}
.shape {
  position: absolute;
  left: var(--x, 10%);
  top: var(--y, 10%);
  width: var(--size, 120px);
  height: auto;
  opacity: .14;
  will-change: transform;
}
.shape--small { opacity: .09; }
.shape--diamond { color: var(--ink); opacity: .07; }
.shape--square { color: var(--ok); opacity: .06; border-radius: 20%; }

.blob {
  position: absolute;
  left: var(--x, 10%);
  top: var(--y, 10%);
  width: var(--size, 320px);
  height: var(--size, 320px);
  background: var(--blob-color, var(--accent));
  opacity: var(--blob-opacity, .1);
  animation: blob-morph 14s ease-in-out infinite;
  will-change: transform, border-radius;
}
@keyframes blob-morph {
  0%, 100% { border-radius: 42% 58% 65% 35% / 45% 40% 60% 55%; transform: rotate(0deg); }
  34% { border-radius: 62% 38% 40% 60% / 55% 65% 35% 45%; transform: rotate(8deg); }
  67% { border-radius: 38% 62% 55% 45% / 35% 50% 50% 65%; transform: rotate(-6deg); }
}

/* Motif de points en marque, decoratif */
.dot-pattern {
  position: absolute;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  opacity: .5;
}
.dot-pattern span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--border);
}
.dot-pattern span.is-brand { background: var(--accent); opacity: .55; }

/* ---------- Reveal au scroll ---------- */
.anim-hidden { opacity: 0; }
.reveal-word { opacity: .16; transition: opacity .2s linear; }

/* ---------- Landing ---------- */
body.landing { margin: 0; }

.hero-mauve {
  position: relative;
  z-index: 1;
  margin: 0 16px;
  padding: 120px 24px 100px;
  background: var(--accent-deep);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  text-align: center;
  overflow: hidden;
}
.hero-mauve::before {
  content: "";
  position: absolute;
  left: 50%; top: -20%;
  width: 640px; height: 640px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255,255,255,.08), transparent 70%);
  pointer-events: none;
}
.hero-eyebrow {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .04em;
  color: #E7C9E2;
  margin-bottom: 18px;
}
.hero-mauve h1 {
  position: relative;
  color: #FBF3FA;
  font-size: 52px;
  max-width: 640px;
  margin: 0 auto 20px;
}
.hero-sub {
  position: relative;
  color: #D9BFD6;
  font-size: 17px;
  max-width: 480px;
  margin: 0 auto 34px;
}

.btn-google {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 28px;
  background: #17111A;
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn-google:hover { transform: translateY(-2px); background: #000; box-shadow: 0 14px 32px rgba(0,0,0,.35); }
.btn-google svg { background: #fff; border-radius: 3px; padding: 2px; }

.auth-buttons {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.btn-discord {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 28px;
  background: #5865F2;
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn-discord:hover { transform: translateY(-2px); background: #4752C4; box-shadow: 0 14px 32px rgba(88,101,242,.4); }
.btn-discord svg { background: #fff; border-radius: 50%; padding: 3px; }

.auth-error { position: relative; color: #FFD6D6; font-size: 13px; margin-top: 14px; }

.hero-mauve .landing-footnote {
  position: relative;
  color: #C7A9C3;
  font-size: 12px;
  margin: 26px auto 0;
  max-width: 400px;
  line-height: 1.6;
}

/* Section "comment ca marche" : reveal mot-a-mot au scroll */
.explainer {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 100px 24px 40px;
  text-align: center;
}
.explainer-text {
  font-family: var(--font-display);
  font-size: 27px;
  line-height: 1.35;
  color: var(--ink);
}

.steps {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 24px 120px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px 22px;
  box-shadow: var(--shadow-card);
  text-align: left;
}
.step-icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 14px;
}
.step-card h3 { font-size: 16px; margin-bottom: 6px; }
.step-card p { font-size: 13px; color: var(--ink-muted); margin: 0; }

/* ---------- Dashboard ---------- */
.dash-main {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 30px 20px 90px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
}
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.card-icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
}
.card h2 { font-size: 19px; }
.card-sub { color: var(--ink-muted); font-size: 13px; margin: 0 0 18px; }

/* CV dropzone */
.dropzone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.dropzone-over { border-color: var(--accent); background: var(--accent-soft); }
@media (hover: hover) {
  .dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
}
.dropzone p { margin: 4px 0; }
.dropzone-hint { color: var(--ink-muted); font-size: 12px; }
.cv-filename { font-size: 15px; }

.field-status { font-size: 13px; display: inline-block; margin-top: 8px; color: var(--ink-muted); }
.field-status-ok { color: var(--ok); }
.field-status-error { color: var(--error); }

/* Map + zones */
/* La liste de suggestions doit passer au-dessus de la carte. Leaflet empile
   ses propres calques jusqu'a z-index 700 ; comme #map ne creait aucun
   contexte d'empilement, ces calques se comparaient directement au z-index de
   la liste (20) et gagnaient. On enferme donc Leaflet dans son propre
   contexte, et on remonte la recherche au-dessus. */
.zone-search { position: relative; z-index: 30; margin-bottom: 14px; }
.zone-search input[type="text"] {
  width: 100%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  padding: 13px;
}
.zone-search input[type="text"]:focus { outline: none; border-color: var(--accent); }
.zone-search-results {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 14px 32px rgba(0,0,0,.18);
  max-height: 220px;
  overflow-y: auto;
}
.zone-search-results li {
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
}
.zone-search-results li:hover,
.zone-search-results li.is-active { background: var(--accent-soft); }

#map {
  position: relative;
  z-index: 0;
  isolation: isolate; /* confine les calques Leaflet, cf. .zone-search */
  height: 300px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.zones-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.zone-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.zone-item input[type="text"] {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
}
.zone-item input[type="text"]:focus { outline: none; }
.zone-radius {
  width: 54px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
  font-family: var(--font);
  padding: 5px 6px;
  text-align: right;
}
.zone-radius-unit { color: var(--ink-muted); font-size: 12px; }
.zone-del {
  background: none;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 6px;
  transition: color .15s;
}
.zone-del:hover { color: var(--error); }

/* Prefs */
textarea, input[type="url"] {
  width: 100%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  padding: 13px;
  resize: vertical;
}
textarea:focus, input[type="url"]:focus { outline: none; border-color: var(--accent); }
input[type="url"] { margin-top: 10px; }

#discord-manual-block input[type="text"] {
  width: 100%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  padding: 13px;
  margin-top: 10px;
}
#discord-manual-block input[type="text"]:focus { outline: none; border-color: var(--accent); }

/* Notif switches */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.switch-row:last-of-type { border-bottom: none; }
.switch-row-static { cursor: default; opacity: .7; }
.switch-row-sub { display: block; color: var(--ink-muted); font-size: 12px; font-weight: 400; }
.switch-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }

.discord-connected-badge {
  margin: -6px 0 14px;
  padding: 11px 14px;
  background: rgba(88,101,242,.12);
  border: 1px solid rgba(88,101,242,.3);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 13px;
}
.discord-connected-badge span { font-weight: 600; }

.discord-id-help {
  margin-top: 10px;
  padding: 14px 16px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.6;
}
.discord-id-help p { margin: 0 0 8px; }
.discord-id-help p:last-of-type { margin-bottom: 10px; }
.discord-id-help strong { color: var(--ink); }
.discord-id-help .discord-id-steps { color: var(--ink-muted); }
.discord-id-help a { color: var(--accent); font-weight: 600; text-decoration: none; }
.discord-id-help a:hover { text-decoration: underline; }

/* Save bar */
.save-bar { display: flex; align-items: center; gap: 14px; justify-content: flex-end; }
.btn-primary {
  position: relative;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: var(--radius-full);
  padding: 13px 30px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
@media (hover: hover) {
  .btn-primary:hover { transform: translateY(-2px); background: var(--accent-hover); box-shadow: var(--shadow-lift); }
}
.btn-primary:disabled { cursor: default; transform: none; }
.btn-primary .btn-label { display: inline-flex; align-items: center; gap: 9px; }
.btn-primary .spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-primary.is-loading .btn-label-text { opacity: .85; }
.btn-primary.is-success { background: var(--ok); }
.btn-primary .check {
  display: inline-block;
  transform: scale(0);
  animation: pop-check .38s ease forwards;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop-check { to { transform: scale(1); } }

/* Resultats */
.results-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -6px 0 16px;
}
.results-filters { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.results-filters select {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13px;
  /* marge a droite pour la fleche native, sinon elle mord sur le libelle */
  padding: 7px 28px 7px 10px;
}
.results-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-muted);
  cursor: pointer;
  user-select: none;
}
.results-toggle input { accent-color: var(--accent); width: 15px; height: 15px; }
.btn-export {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
@media (hover: hover) {
  .btn-export:hover { border-color: var(--accent); background: var(--accent-soft); }
}
.btn-export:disabled { opacity: .45; cursor: default; }

.empty-state { color: var(--ink-muted); font-size: 14px; }

.result-score {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  color: var(--accent-hover);
}
.result-title-row { display: flex; align-items: center; gap: 8px; }
.result-title { font-weight: 600; font-size: 14px; }
.result-new-badge {
  flex-shrink: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}
.result-meta { color: var(--ink-muted); font-size: 12px; margin-top: 2px; }
.result-reason { color: var(--ink-muted); font-size: 12px; margin-top: 4px; font-style: italic; }

/* Skeleton (chargement des resultats) */
.skeleton-item { display: flex; gap: 14px; padding: 14px; }
.skeleton-block {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface-alt) 25%, var(--border) 37%, var(--surface-alt) 63%);
  background-size: 400% 100%;
  animation: skeleton-shine 1.4s ease infinite;
}
.skeleton-score { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.skeleton-line { height: 10px; }
.skeleton-line--title { width: 60%; }
.skeleton-line--meta { width: 40%; }
@keyframes skeleton-shine { to { background-position: -400% 0; } }

/* Footer explicatif du dashboard */
.dash-footer {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 8px auto 0;
  padding: 0 20px 40px;
  color: var(--ink-muted);
  font-size: 12.5px;
  line-height: 1.7;
  text-align: center;
}
.dash-footer strong { color: var(--ink); }

/* ---------- Onboarding ---------- */
.onboarding-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
}
.onboarding-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.onboarding-head h3 { font-size: 15px; margin: 0; }
.onboarding-count { font-size: 12px; color: var(--ink-muted); font-weight: 600; }
.onboarding-bar { height: 6px; border-radius: var(--radius-full); background: var(--surface-alt); overflow: hidden; margin-bottom: 14px; }
.onboarding-bar-fill { height: 100%; background: var(--accent); border-radius: var(--radius-full); transition: width .4s ease; }
.onboarding-steps { display: flex; flex-wrap: wrap; gap: 10px; }
.onboarding-step {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink-muted);
  background: var(--surface-alt); padding: 6px 12px; border-radius: var(--radius-full);
}
.onboarding-step .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.onboarding-step.is-done { color: var(--ok); background: rgba(31,139,92,.1); }

/* ---------- Mini-stats ---------- */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}
.stat-value { font-family: var(--font-display); font-size: 26px; color: var(--accent); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--ink-muted); }

/* ---------- Nav : ancres de section ---------- */
.nav-pill-links { display: flex; gap: 2px; }
.nav-pill-links a {
  font-size: 12.5px;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 7px 12px;
  border-radius: var(--radius-full);
  transition: background .2s, color .2s;
}
.nav-pill-links a.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ---------- Actions sur une offre : postule / reseautage / relance ---------- */
.result-item { position: relative; border-bottom: 1px solid var(--border); padding: 14px 14px 14px 20px; transition: background .15s; }
@media (hover: hover) {
  .result-item:hover { background: var(--surface-alt); }
}
.result-item:last-child { border-bottom: none; }
.result-item.is-new::before {
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}
.result-link { display: flex; gap: 14px; text-decoration: none; color: var(--ink); }
.result-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 0 50px; }
.chip-btn {
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
}
@media (hover: hover) {
  .chip-btn:hover { border-color: var(--accent); color: var(--accent); }
}
.chip-btn.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip-relance {
  font-size: 11.5px; font-weight: 600;
  padding: 5px 12px; border-radius: var(--radius-full);
  background: rgba(197,138,16,.12); color: #8A5A0A; border: none;
  cursor: pointer;
}
.reseau-panel {
  margin: 10px 0 0 50px;
  padding: 12px 14px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  display: flex; flex-direction: column; gap: 7px;
}
.reseau-panel[hidden] { display: none; }
.reseau-panel a { font-size: 12.5px; color: var(--accent); text-decoration: none; }
.reseau-panel a:hover { text-decoration: underline; }
.relance-panel {
  margin: 10px 0 0 50px;
  padding: 12px 14px;
  background: rgba(197,138,16,.08);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--ink);
}
.relance-panel textarea {
  width: 100%; margin-top: 8px; font-size: 12.5px; padding: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--ink); font-family: var(--font); resize: vertical;
}

/* ---------- Mode tri (swipe) ---------- */
.swipe-deck { position: relative; height: 320px; margin: 0 0 18px; }
.swipe-card {
  position: absolute; inset: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 26px;
  display: flex; flex-direction: column;
  /* pan-y et non none : le doigt garde le droit de faire defiler la page
     verticalement, seul le glissement horizontal est capte par la carte. */
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
}
.swipe-card:active { cursor: grabbing; }
.swipe-card .result-score { margin-bottom: 14px; }
.swipe-card .result-title { font-size: 17px; }
.swipe-card .result-meta { margin: 6px 0 10px; }
.swipe-card .result-reason { font-size: 13px; overflow-y: auto; }
.swipe-stamp {
  position: absolute; top: 22px;
  font-family: var(--font-display); font-weight: 800; font-size: 22px;
  padding: 5px 14px; border: 3px solid; border-radius: 10px;
  opacity: 0; pointer-events: none;
}
.swipe-stamp--like { left: 22px; color: var(--ok); border-color: var(--ok); transform: rotate(-10deg); }
.swipe-stamp--nope { right: 22px; color: var(--error); border-color: var(--error); transform: rotate(10deg); }
.swipe-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--ink-muted); font-size: 14px; text-align: center; padding: 20px;
}
.swipe-actions { display: flex; justify-content: center; gap: 20px; margin: -4px 0 18px; }
.swipe-btn {
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 21px;
  box-shadow: var(--shadow-card);
  transition: transform .15s ease;
}
@media (hover: hover) {
  .swipe-btn:hover { transform: scale(1.08); }
}
.swipe-btn--no { color: var(--error); }
.swipe-btn--yes { color: var(--ok); }

/* ---------- Carte : habillage maison ---------- */
.leaflet-container { font-family: var(--font); background: var(--surface-alt); }
.leaflet-control-zoom a {
  color: var(--ink) !important;
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
.leaflet-control-zoom a:first-child { border-radius: 8px 8px 0 0; }
.leaflet-control-zoom a:last-child { border-radius: 0 0 8px 8px; }
.leaflet-bar { border: none !important; box-shadow: 0 2px 10px rgba(28,21,32,.14) !important; }
.leaflet-control-attribution {
  background: rgba(255,255,255,.78) !important;
  font-size: 10px;
  color: var(--ink-quiet);
}
.leaflet-control-attribution a { color: var(--ink-muted); }

/* Pastille de zone, a la place du marqueur bleu par defaut de Leaflet */
.zone-pin { background: none; border: none; }
.zone-pin-dot {
  display: block;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(62,33,69,.45);
  cursor: grab;
}

/* Voile tactile : la carte ne capte le doigt qu'apres un appui volontaire,
   sinon elle confisque le defilement de la page (cf. initCarteTactile). */
.map-voile {
  position: absolute;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(28,21,32,.32);
  font-family: var(--font);
  cursor: pointer;
  padding: 0;
}
.map-voile[hidden] { display: none; }
.map-voile span {
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-card);
}

/* ---------- Scanner ATS ---------- */
.cv-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.btn-scan {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 9px 18px;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
}
@media (hover: hover) {
  .btn-scan:hover { background: var(--accent); color: var(--accent-ink); }
}
.btn-scan:disabled { opacity: .5; cursor: default; }

.cv-actions-hint { font-size: 12px; color: var(--ink-muted); margin: 8px 0 0; line-height: 1.55; }
.results-actions { display: flex; align-items: center; gap: 10px; }

.ats-panel { margin-top: 16px; padding: 18px; border-radius: var(--radius-md); background: var(--surface-alt); }
.ats-score-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.ats-score-badge {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 26px;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  line-height: 1;
}
.ats-score-badge.is-good { background: rgba(31,139,92,.12); color: var(--ok); }
.ats-score-badge.is-warn { background: rgba(197,138,16,.12); color: #8A5A0A; }
.ats-score-badge.is-bad { background: rgba(192,57,43,.12); color: var(--error); }
.ats-score-label { font-size: 13px; color: var(--ink-muted); line-height: 1.5; }
.ats-score-label strong { color: var(--ink); font-size: 14px; }

.ats-group-title {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-quiet);
  margin: 18px 0 2px;
}
.ats-group-title:first-of-type { margin-top: 0; }
.ats-group-sub { font-size: 12px; color: var(--ink-muted); margin: 0 0 10px; }

.ats-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ats-check {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.ats-check.is-fail { border-color: rgba(192,57,43,.28); }
.ats-check > details > summary { list-style: none; cursor: pointer; }
.ats-check > details > summary::-webkit-details-marker { display: none; }
.ats-check-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
}
.ats-check > details > summary.ats-check-head::after {
  content: "+";
  margin-left: auto;
  flex-shrink: 0;
  font-size: 15px;
  line-height: 1;
  color: var(--ink-quiet);
}
.ats-check > details[open] > summary.ats-check-head::after { content: "\2212"; }
.ats-check .ats-icon { flex-shrink: 0; font-weight: 700; }
.ats-check.is-pass .ats-icon { color: var(--ok); }
.ats-check.is-fail .ats-icon { color: var(--error); }
.ats-check-label { min-width: 0; }
.ats-check-detail,
.ats-check-action {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-muted);
  margin: 0 14px 12px 34px;
}
.ats-check-action { color: var(--ink); }
.ats-check-action strong { color: var(--accent); }

.ats-blocage { font-size: 14px; margin: 0 0 8px; }

/* Portee du score selon le metier : replie par defaut, c'est une nuance,
   pas une alerte. */
.ats-portee {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
}
.ats-portee > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ats-portee > summary::-webkit-details-marker { display: none; }
.ats-portee > summary::after {
  content: "+";
  margin-left: auto;
  font-size: 15px;
  line-height: 1;
  color: var(--ink-quiet);
}
.ats-portee[open] > summary::after { content: "\2212"; }
.ats-portee p { font-size: 12.5px; line-height: 1.65; color: var(--ink-muted); margin: 0 0 10px; }
.ats-portee > p:last-of-type { margin-bottom: 14px; }
.ats-portee strong { color: var(--ink); }
.ats-portee-astuce {
  background: var(--accent-soft);
  margin-bottom: 14px !important;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--ink) !important;
}

.ats-note { font-size: 11.5px; color: var(--ink-quiet); margin: 14px 0 0; line-height: 1.6; }

@media (max-width: 600px) {
  .nav-pill-links { display: none; }
  .stats-row { grid-template-columns: 1fr; }
  .result-actions, .reseau-panel, .relance-panel { margin-left: 0; }
  .nav-pill { gap: 10px; padding: 10px 10px 10px 18px; }
  .dash-main { padding: 24px 14px 70px; }
  .card { padding: 20px; }
  .hero-mauve { margin: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); padding: 100px 20px 70px; }
  .hero-mauve h1 { font-size: 36px; }
  .steps { grid-template-columns: 1fr; }
  .explainer-text { font-size: 21px; }

  /* Moins de formes, plus discretes : sur petit ecran elles se
     rapprochent du contenu et surchargent la lecture. */
  .shape { opacity: .08; }
  .shape--diamond, .shape--square { display: none; }
  .blob { opacity: calc(var(--blob-opacity, .1) * .6); }

  /* La barre d'outils des offres tenait sur une ligne trop etroite : le
     select et les deux boutons se marchaient dessus. */
  .results-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .results-filters { justify-content: space-between; gap: 10px; }
  .results-actions { width: 100%; }
  .results-actions .btn-export { flex: 1; min-height: 40px; }
  .results-filters select { flex: 1; min-width: 0; min-height: 40px; padding-right: 30px; }
  .results-toggle { font-size: 12.5px; }

  /* L'email pousse le bouton hors de la pilule : on lui laisse au plus la
     moitie de la largeur et on coupe proprement. */
  .nav-pill-user { gap: 8px; flex: 1; justify-content: flex-end; }
  .nav-pill-user #user-email { max-width: 42vw; font-size: 12px; }
  #btn-logout { padding: 9px 14px; }

  /* Le bouton d'enregistrement et son message tenaient sur une ligne, si
     bien qu'une erreur un peu longue ecrasait le bouton. */
  .save-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .save-bar .btn-primary { width: 100%; }
  .save-bar .field-status { margin-top: 0; text-align: center; }

  /* iOS zoome automatiquement sur un champ dont le texte fait moins de
     16px, et ne dezoome jamais ensuite. */
  textarea,
  input[type="text"],
  input[type="url"],
  input[type="number"],
  .zone-search input[type="text"],
  #discord-manual-block input[type="text"] { font-size: 16px; }

  /* Cibles tactiles : les pastilles faisaient 24px de haut, en dessous de
     ce qu'un pouce vise de facon fiable. */
  .chip-btn, .chip-relance { min-height: 36px; padding: 8px 14px; }
  .zone-del { min-width: 40px; min-height: 40px; font-size: 16px; }
  .zone-item { padding: 8px 10px; }
  .results-toggle input, .switch-row input[type="checkbox"] { width: 22px; height: 22px; }

  /* Le mode tri prenait toute la hauteur utile du telephone. */
  .swipe-deck { height: 300px; }
  .swipe-card { padding: 20px; }

  #map { height: 260px; }
  .ats-panel { padding: 14px; }
  .ats-check-detail, .ats-check-action { margin-left: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .anim-hidden { opacity: 1 !important; }
  .reveal-word { opacity: 1 !important; }
  .blob { animation: none; }
}
