:root {
  --red: #e30613;
  --red-dark: #ba0010;
  --ink: #191919;
  --muted: #686868;
  --line: #e7e7e7;
  --surface: #ffffff;
  --soft: #f5f5f3;
  --soft-red: #fff1f2;
  --green: #1f8a4c;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.shell--narrow { width: min(920px, calc(100% - 40px)); }
.shell--result { width: min(960px, calc(100% - 40px)); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.site-header__inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand img { width: 42px; height: 42px; object-fit: cover; }
.brand__text { display: grid; line-height: 1.2; }
.brand__text strong { font-size: 1rem; }
.brand__text small { color: var(--muted); margin-top: 3px; }

.share-menu { position: relative; }
.share-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 210px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.share-menu__panel button {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  text-align: left;
  border-radius: 9px;
  cursor: pointer;
}
.share-menu__panel button:hover { background: var(--soft); }
.share-menu__separator { display: block; height: 1px; background: var(--line); margin: 6px 0; }

.step { padding: 64px 0 120px; }
.step--active { animation: stepIn .28s ease both; }
@keyframes stepIn { from { opacity: .3; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.step-kicker { color: var(--red); font-weight: 800; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 4.7rem); line-height: .98; letter-spacing: -.045em; max-width: 930px; }
.intro { max-width: 760px; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.3rem); margin: 20px 0 34px; }
.step-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; margin-bottom: 28px; }

.step--resources { padding-top: 44px; }
.step--resources h1 { font-size: clamp(2.5rem, 4.5vw, 4.25rem); }
.step--resources .intro { margin: 16px 0 26px; }
.step--resources .step-actions { margin-top: 20px; }

.resource-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.resource-card {
  position: relative;
  min-height: 176px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: .18s ease;
}
.resource-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,.06); }
.resource-card.is-selected { border-color: var(--red); background: var(--soft-red); box-shadow: 0 0 0 2px rgba(227,6,19,.08); }
.resource-card__check {
  position: absolute;
  right: 20px;
  top: 18px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  opacity: 0;
  transform: scale(.8);
  transition: .18s ease;
}
.resource-card.is-selected .resource-card__check { opacity: 1; transform: scale(1); }
.resource-card__title { font-size: 1.03rem; font-weight: 800; max-width: 82%; line-height: 1.25; }
.resource-card__amount { margin-top: auto; font-size: clamp(1.9rem, 3vw, 2.8rem); letter-spacing: -.04em; line-height: 1; }
.resource-card__desc { color: var(--muted); margin-top: 8px; font-size: .86rem; line-height: 1.35; }
.resource-summary {
  margin: 18px 0 0;
  padding: 18px 22px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}
.resource-summary span { color: #cfcfcf; }
.resource-summary strong { font-size: clamp(1.7rem, 4vw, 2.8rem); letter-spacing: -.035em; }

.step-actions { display: flex; gap: 12px; margin-top: 28px; }
.step-actions--center { justify-content: flex-end; }
.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 800;
  cursor: pointer;
  transition: .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-dark); }
.btn--ghost { background: #fff; border: 1px solid var(--line); }
.btn--small { padding: 9px 15px; }
.btn--large { padding: 15px 24px; font-size: 1.05rem; }
.text-button { border: 0; background: transparent; color: var(--red); font-weight: 800; padding: 6px 0; cursor: pointer; white-space: nowrap; }

.selected-resources { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.resource-chip { display: inline-flex; gap: 8px; align-items: center; padding: 8px 11px; background: #fff; border: 1px solid var(--line); border-radius: 999px; font-size: .86rem; }
.resource-chip span { color: var(--muted); }

.allocation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.allocation-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 8px 26px rgba(0,0,0,.035); }
.allocation-card--double { grid-row: span 2; }
.allocation-card--triple { grid-row: span 3; }
.allocation-card__header { margin-bottom: 16px; }
.category-pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 999px; font-weight: 800; font-size: .84rem; }
.category-pill--education { background: rgba(226,0,26,.12); color: #c50016; }
.category-pill--services { background: rgba(255,193,7,.20); color: #8c6900; }
.category-pill--logement { background: rgba(255,87,34,.16); color: #a53d18; }
.category-pill--sante { background: rgba(3,169,244,.15); color: #056b9e; }
.category-pill--ecologie { background: rgba(76,175,80,.18); color: #1d6b27; }
.category-pill--femmes { background: rgba(233,30,99,.12); color: #9f124f; }
.category-pill--inspection { background: rgba(121,85,72,.14); color: #4e342e; }
.category-pill--feux { background: rgba(216,91,31,.14); color: #a63d12; }

.allocation-item + .allocation-item { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 22px; }
.allocation-item__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.allocation-item h2 { margin: 0; font-size: 1.08rem; letter-spacing: -.015em; }
.allocation-item p { margin: 4px 0 0; color: var(--muted); font-size: .87rem; }
.allocation-item__result { text-align: right; min-width: 115px; }
.allocation-item__result strong { display: block; font-size: 1.45rem; line-height: 1; letter-spacing: -.03em; }
.allocation-item__result span { color: var(--muted); font-size: .8rem; }

.budget-slider {
  --fill: 0%;
  width: 100%;
  height: 8px;
  margin: 24px 0 12px;
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(90deg, var(--red) var(--fill), #dedede var(--fill));
  outline: none;
  cursor: pointer;
}
.budget-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 7px solid var(--red);
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.budget-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 6px solid var(--red);
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.allocation-item__meta { display: flex; justify-content: space-between; gap: 12px; font-size: .82rem; color: var(--muted); }
.allocation-item__meta strong { color: var(--ink); }

.budget-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  background: rgba(25,25,25,.96);
  color: #fff;
  border-top: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(16px);
}
.budget-dock__inner { min-height: 84px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 26px; }
.budget-dock__labels { display: flex; justify-content: space-between; gap: 20px; font-size: .9rem; }
.budget-dock__labels span { color: #cfcfcf; }
.budget-progress { height: 8px; margin-top: 9px; background: #4b4b4b; border-radius: 999px; overflow: hidden; }
.budget-progress span { display: block; height: 100%; width: 0; background: var(--red); transition: width .18s ease, background .18s ease; }
.budget-progress span.is-complete { background: #34a466; }

.result-hero { padding: 42px; background: #fff; border-radius: 28px; box-shadow: var(--shadow); }
.result-hero h1 { font-size: clamp(2.4rem, 6vw, 5rem); }
.result-hero > p { color: var(--muted); font-size: 1.1rem; margin: 18px 0 0; }
.result-totals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 30px; }
.result-totals > div { padding: 24px; border-radius: 16px; background: var(--soft); }
.result-totals > div > span { display: block; color: var(--muted); font-size: .95rem; font-weight: 650; }
.result-totals strong { display: flex; align-items: baseline; gap: .16em; margin-top: 8px; font-size: clamp(3.4rem, 6.5vw, 6rem); line-height: .92; letter-spacing: -.055em; }
.result-totals strong [data-result-spent],
.result-totals strong [data-result-remaining] { color: var(--ink); font-size: 1em; font-weight: 900; }
.result-total__unit { color: var(--muted); font-size: .28em; font-weight: 850; letter-spacing: -.02em; }
.result-overview {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 20px;
  margin-top: 24px;
  align-items: stretch;
}
.result-chart-card,
.result-explainer {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 8px 26px rgba(0,0,0,.035);
}
.result-chart-card__head h2,
.result-explainer h2 {
  margin: 4px 0 0;
  font-size: 1.45rem;
  letter-spacing: -.025em;
}
.eyebrow {
  color: var(--red);
  font-size: .75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .09em;
}
.result-chart-wrap {
  position: relative;
  min-height: 330px;
  margin-top: 10px;
}
.result-chart-wrap canvas {
  width: 100% !important;
  height: 330px !important;
}
.result-explainer {
  display: flex;
  flex-direction: column;
}
.result-explainer__lead {
  margin: 14px 0 18px;
  color: var(--muted);
  font-size: 1.02rem;
}
.result-explainer__focus {
  padding: 16px 18px;
  background: var(--soft-red);
  border-left: 4px solid var(--red);
  border-radius: 12px;
  line-height: 1.45;
}
.result-explainer__focus strong { color: var(--ink); }
.result-explainer__examples {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}
.result-example {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: flex-start;
}
.result-example__icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--soft);
}
.result-example p { margin: 0; font-size: .92rem; }
.result-example p strong { display: inline; }
.result-explainer__note {
  margin: auto 0 0;
  padding-top: 16px;
  color: var(--muted);
  font-size: .78rem;
}

.result-section { margin-top: 32px; }
.result-section__head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 14px; }
.result-section__head h2 { margin: 0; font-size: 1.5rem; }
.result-list { display: grid; gap: 12px; }
.result-item { display: grid; grid-template-columns: 54px 1fr; gap: 16px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.result-item__icon { width: 54px; height: 54px; display: grid; place-items: center; background: var(--soft); border-radius: 14px; font-size: 1.35rem; }
.result-item__heading { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.result-item__heading > div { display: grid; }
.result-item__heading span { color: var(--muted); font-size: .83rem; }
.result-item__heading strong { font-size: 1.28rem; }
.result-item__pct { font-weight: 800; color: var(--ink) !important; }
.result-item__bar { height: 7px; background: #eee; border-radius: 999px; overflow: hidden; margin: 10px 0; }
.result-item__bar span { display: block; height: 100%; background: var(--red); }
.result-item p { margin: 0; color: var(--muted); }
.result-item p strong { color: var(--ink); }
.result-empty { padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 34px; }
.result-section--sources .selected-resources { margin-bottom: 0; }

.toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); z-index: 80; background: #111; color: #fff; padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow); }


@media (max-width: 1100px) {
  .result-overview { grid-template-columns: 1fr; }
  .result-chart-wrap { min-height: 300px; }
  .result-chart-wrap canvas { height: 300px !important; }
}

@media (max-width: 820px) {
  .step { padding-top: 42px; }
  .resource-grid, .allocation-grid { grid-template-columns: 1fr; }
  .allocation-card--double, .allocation-card--triple { grid-row: auto; }
  .step-head { display: block; }
  .step-head .text-button { margin-top: -12px; margin-bottom: 12px; }
}

@media (max-width: 640px) {
  .shell, .shell--narrow, .shell--result { width: min(100% - 24px, 1180px); }
  .site-header__inner { min-height: 66px; }
  .brand img { width: 36px; height: 36px; }
  .brand__text small { display: none; }
  .brand__text strong { font-size: .9rem; }
  .step { padding: 34px 0 120px; }
  h1 { font-size: clamp(2.15rem, 12vw, 3.5rem); }
  .intro { font-size: 1rem; margin: 16px 0 24px; }
  .resource-card { min-height: 150px; padding: 20px; }
  .resource-summary { display: grid; gap: 6px; padding: 20px; }
  .resource-summary strong { font-size: 2rem; }
  .step-actions--center { justify-content: stretch; }
  .step-actions .btn { width: 100%; }
  .allocation-card { padding: 18px; }
  .allocation-item__top { display: grid; grid-template-columns: 1fr auto; }
  .allocation-item__result { min-width: 90px; }
  .allocation-item__result strong { font-size: 1.25rem; }
  .budget-dock__inner { grid-template-columns: 1fr auto; gap: 12px; min-height: 92px; }
  .budget-dock__labels { display: grid; gap: 1px; font-size: .78rem; }
  .budget-dock .btn { padding: 11px 15px; font-size: .86rem; }
  .result-hero { padding: 26px 20px; border-radius: 20px; }
  .result-totals { grid-template-columns: 1fr 1fr; }
  .result-totals > div { padding: 16px; }
  .result-totals strong { font-size: clamp(2.45rem, 12vw, 4.2rem); }
  .result-total__unit { font-size: .3em; }
  .result-item { grid-template-columns: 42px 1fr; padding: 16px; gap: 12px; }
  .result-item__icon { width: 42px; height: 42px; }
  .result-section__head { align-items: flex-start; }
  .result-chart-card, .result-explainer { padding: 20px; }
  .result-chart-wrap { min-height: 280px; }
  .result-chart-wrap canvas { height: 280px !important; }
}

/* =========================================================
   V3 — partage viral + réception par mail
   ========================================================= */
.shared-budget-banner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 22px;
  margin: -12px -12px 30px;
  padding: 20px 22px;
  border-radius: 18px;
  background: var(--soft-red);
  border: 1px solid rgba(227, 6, 19, .16);
}
.shared-budget-banner strong {
  display: block;
  margin-top: 4px;
  font-size: 1.08rem;
}
.shared-budget-banner p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .9rem;
}
.btn--light {
  background: #fff;
  border: 1px solid rgba(227, 6, 19, .2);
  color: var(--red);
  white-space: nowrap;
}

.viral-section {
  margin-top: 42px;
  padding-top: 38px;
  border-top: 1px solid var(--line);
}
.viral-section__head {
  max-width: 760px;
  margin-bottom: 20px;
}
.viral-section__head h2 {
  margin: 5px 0 8px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.03;
  letter-spacing: -.035em;
}
.viral-section__head p {
  margin: 0;
  color: var(--muted);
}
.viral-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.viral-card {
  position: relative;
  min-width: 0;
  padding: 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 26px rgba(0,0,0,.035);
}
.viral-card__number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-weight: 900;
}
.viral-card h3 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -.025em;
}
.viral-card__intro {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: .92rem;
}
.share-preview {
  min-height: 130px;
  padding: 18px;
  border-radius: 14px;
  background: var(--soft);
  border-left: 4px solid var(--red);
  white-space: pre-line;
  font-size: .92rem;
  line-height: 1.55;
}
.viral-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}
.btn--whatsapp {
  background: #1f9d55;
  color: #fff;
}
.btn--telegram {
  background: #2389c9;
  color: #fff;
}
.viral-feedback {
  margin: 10px 0 0;
  color: var(--green);
  font-size: .82rem;
  font-weight: 800;
}

.plf-email-form { margin-top: 18px; }
.plf-email-form__label {
  display: block;
  margin-bottom: 7px;
  font-size: .84rem;
  font-weight: 800;
}
.plf-email-form__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.plf-email-form__input {
  width: 100%;
  min-width: 0;
  border: 1px solid #d7d7d7;
  border-radius: 999px;
  background: #fff;
  padding: 12px 16px;
  color: var(--ink);
  outline: none;
}
.plf-email-form__input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, .09);
}
.plf-email-form__optin {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 14px;
  font-size: .84rem;
  color: var(--ink);
  cursor: pointer;
}
.plf-email-form__optin input { margin-top: 3px; accent-color: var(--red); }
.plf-email-form__help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: .76rem;
}
.plf-email-form__devnote {
  margin: 12px 0 0;
  padding: 9px 11px;
  border-radius: 10px;
  background: #fff7d8;
  color: #6a5510;
  font-size: .76rem;
}
.plf-email-form__devnote code { font-size: .95em; }
.plf-honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}
.btn:disabled,
.plf-email-form input:disabled {
  opacity: .48;
  cursor: not-allowed;
  transform: none;
}
.result-actions--end { justify-content: flex-end; }

@media (max-width: 820px) {
  .viral-grid { grid-template-columns: 1fr; }
  .shared-budget-banner { grid-template-columns: 1fr; }
  .shared-budget-banner .btn { justify-self: start; }
}

@media (max-width: 640px) {
  .shared-budget-banner { margin: -6px -4px 24px; padding: 17px; }
  .shared-budget-banner .btn { width: 100%; white-space: normal; }
  .viral-section { margin-top: 32px; padding-top: 30px; }
  .viral-card { padding: 20px; }
  .share-preview { min-height: auto; }
  .viral-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .viral-actions .btn { width: 100%; padding-left: 13px; padding-right: 13px; }
  .plf-email-form__row { grid-template-columns: 1fr; }
  .plf-email-form__row .btn { width: 100%; }
}

/* =========================================================
   V4 — contenus, pictos CGT et pédagogie
   ========================================================= */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.interaction-hint {
  max-width: 760px;
  margin: -18px 0 28px;
  color: var(--muted);
  font-size: .88rem;
}

.category-pill {
  gap: 9px;
  padding: 7px 12px 7px 8px;
}
.category-pill img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex: 0 0 auto;
}
.allocation-card__purpose {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.4;
}
.allocation-card__header:has(.allocation-card__purpose) {
  margin-bottom: 18px;
}
.allocation-item__result {
  min-width: 155px;
}
.allocation-item__result strong {
  font-size: 1.58rem;
}
.allocation-item__result > span {
  display: block;
  max-width: 190px;
  margin-top: 5px;
  line-height: 1.25;
}

.result-chart-legend {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}
.result-chart-legend__item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: .78rem;
}
.result-chart-legend__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.result-chart-legend__label {
  min-width: 0;
  color: var(--ink);
  font-weight: 700;
}
.result-chart-legend__item strong {
  white-space: nowrap;
  font-size: .82rem;
}
.result-chart-legend__item > span:last-child {
  min-width: 34px;
  text-align: right;
  color: var(--muted);
}

.result-example__icon img,
.result-item__icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.result-example__icon img {
  width: 25px;
  height: 25px;
}
.result-item__icon img {
  width: 38px;
  height: 38px;
}

.method-details {
  margin-top: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.method-details summary {
  padding: 16px 20px;
  color: var(--red);
  font-weight: 800;
  cursor: pointer;
  list-style-position: inside;
}
.method-details[open] summary {
  border-bottom: 1px solid var(--line);
}
.method-details__body {
  padding: 18px 20px 20px;
  color: var(--muted);
  font-size: .9rem;
}
.method-details__body p {
  margin: 0 0 12px;
}
.method-details__body p:last-child {
  margin-bottom: 0;
}
.method-details__body ul {
  margin: 0 0 14px;
  padding-left: 20px;
}
.method-details__body li + li {
  margin-top: 5px;
}
.result-actions--primary {
  justify-content: space-between;
  align-items: center;
  padding: 26px 0 4px;
}

@media (max-width: 980px) {
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .interaction-hint { margin-top: -14px; }
  .category-pill img { width: 27px; height: 27px; }
  .allocation-item__result { min-width: 128px; }
  .allocation-item__result strong { font-size: 1.28rem; }
  .allocation-item__result > span { max-width: 140px; }
  .result-chart-legend__item {
    grid-template-columns: 10px minmax(0, 1fr) auto;
  }
  .result-chart-legend__item > span:last-child {
    grid-column: 2 / 4;
    text-align: left;
    padding-left: 0;
  }
  .result-actions--primary {
    display: grid;
    grid-template-columns: 1fr;
  }
  .result-actions--primary .btn { width: 100%; }
}


/* =========================================================
   V6 — prévention et lutte contre les feux de forêt
   ========================================================= */
.allocation-card--triple .allocation-card__purpose {
  max-width: 650px;
}
.category-pill--feux {
  white-space: normal;
  line-height: 1.15;
}

/* =========================================================
   V6.1 — formulaire Brevo intégré
   ========================================================= */
.plf-brevo {
  margin-top: 18px;
  padding: 0 !important;
  background: transparent !important;
  text-align: left !important;
  font-family: inherit !important;
}
.plf-brevo .sib-form-container,
.plf-brevo__container {
  width: 100%;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  text-align: left !important;
  border: 0 !important;
  font-family: inherit !important;
}
.plf-brevo .plf-email-form {
  margin: 0;
  font-family: inherit !important;
}
.plf-brevo .sib-form-block {
  padding: 0 !important;
}
.plf-brevo__field + .plf-brevo__field,
.plf-brevo__choice,
.plf-brevo__submit {
  margin-top: 14px;
}
.plf-brevo__label,
.plf-brevo .entry__label {
  display: block;
  margin: 0 0 7px;
  color: var(--ink) !important;
  font-family: inherit !important;
  font-size: .84rem !important;
  font-weight: 800 !important;
  text-align: left !important;
}
.plf-brevo .entry__field {
  border: 0 !important;
  background: transparent !important;
}
.plf-brevo .entry__field .input,
.plf-brevo select.input {
  width: 100%;
  min-height: 48px;
  margin: 0;
  border: 1px solid #d7d7d7 !important;
  border-radius: 14px !important;
  background: #fff !important;
  padding: 12px 14px !important;
  color: var(--ink) !important;
  font: inherit !important;
  text-align: left !important;
  outline: none;
}
.plf-brevo .entry__field .input:focus,
.plf-brevo select.input:focus {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(227, 6, 19, .09);
}
.plf-brevo .checkbox__label {
  display: flex !important;
  align-items: flex-start !important;
  gap: 9px;
  color: var(--ink) !important;
  font-family: inherit !important;
  font-size: .84rem !important;
  line-height: 1.4;
  text-align: left !important;
}
.plf-brevo .checkbox {
  flex: 0 0 auto;
  margin-top: 1px;
}
.plf-brevo__submit .btn {
  width: 100%;
  min-height: 48px;
  border-radius: 999px !important;
  background: var(--red) !important;
  color: #fff !important;
  font-family: inherit !important;
  font-weight: 800 !important;
}
.plf-brevo__message {
  max-width: none !important;
  margin: 0 0 14px !important;
  border-radius: 12px !important;
  font-family: inherit !important;
  font-size: .84rem !important;
  text-align: left !important;
}
.plf-brevo__message--error {
  color: #661d1d !important;
  background: #ffeded !important;
  border-color: #ff4949 !important;
}
.plf-brevo__message--success {
  color: #085229 !important;
  background: #e7faf0 !important;
  border-color: #13ce66 !important;
}
.plf-brevo .entry__error {
  margin-top: 6px;
  font-family: inherit !important;
  font-size: .78rem !important;
  text-align: left !important;
}


/* =========================================================
   V8 — viralité retravaillée + formulaire Brevo pleine largeur
   ========================================================= */
.viral-card--mail .viral-card__body {
  max-width: 100%;
}

.plf-brevo {
  margin-top: 20px;
}
.plf-brevo .form__label-row,
.plf-brevo .form__label-row--horizontal {
  display: block !important;
}
.plf-brevo .form__entry,
.plf-brevo .entry_block,
.plf-brevo .entry_mcq,
.plf-brevo .entry__choice,
.plf-brevo .entry__field {
  width: 100% !important;
  max-width: none !important;
}
.plf-brevo__field,
.plf-brevo__field--email,
.plf-brevo__field--select {
  width: 100%;
}
.plf-brevo__field--email .entry__field,
.plf-brevo__field--select .entry__field {
  width: 100%;
}
.plf-brevo .entry__field .input,
.plf-brevo select.input {
  min-height: 62px;
  width: 100% !important;
  border-radius: 18px !important;
  padding: 16px 18px !important;
  background-image: none !important;
  box-shadow: none !important;
}
.plf-brevo .entry__field .input::placeholder {
  color: #a9b6c5 !important;
}
.plf-brevo select.input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #6f6f6f 50%), linear-gradient(135deg, #6f6f6f 50%, transparent 50%) !important;
  background-position: calc(100% - 24px) calc(50% - 3px), calc(100% - 18px) calc(50% - 3px) !important;
  background-size: 6px 6px, 6px 6px !important;
  background-repeat: no-repeat !important;
  padding-right: 44px !important;
}
.plf-brevo__label,
.plf-brevo .entry__label {
  margin-bottom: 10px;
  font-size: 1rem !important;
}
.plf-brevo__field + .plf-brevo__field,
.plf-brevo__submit {
  margin-top: 18px;
}
.plf-brevo__choices {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.plf-brevo__choice {
  margin-top: 0;
}
.plf-brevo .checkbox__label {
  display: grid !important;
  grid-template-columns: 22px 1fr;
  align-items: start !important;
  gap: 10px;
  width: 100%;
  font-size: .98rem !important;
}
.plf-brevo .checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}
.plf-brevo__help {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.45;
}
.plf-brevo__submit .btn {
  min-height: 58px;
  font-size: 1rem;
}
.plf-brevo .entry__error {
  display: block;
  width: 100%;
}
@media (max-width: 640px) {
  .plf-brevo .entry__field .input,
  .plf-brevo select.input {
    min-height: 58px;
    padding: 15px 16px !important;
  }
  .plf-brevo .checkbox__label {
    font-size: .92rem !important;
  }
}


/* =========================================================
   V10 — simplification mobile étapes 2 et 3
   ========================================================= */
.mobile-collapse {
  margin-top: 32px;
}
.mobile-collapse > summary {
  display: none;
}
.mobile-collapse > summary::-webkit-details-marker {
  display: none;
}
/* desktop: keep content visible even if details is closed */
@media (min-width: 641px) {
  .mobile-collapse > *:not(summary) {
    display: block;
  }
}

@media (max-width: 640px) {
  .mobile-collapse {
    margin-top: 22px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
  }
  .mobile-collapse > summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    cursor: pointer;
    font-weight: 800;
    color: var(--ink);
  }
  .mobile-collapse > summary::after {
    content: '+';
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--soft);
    color: var(--red);
    font-size: 1.15rem;
    line-height: 1;
  }
  .mobile-collapse[open] > summary::after {
    content: '–';
  }
  .mobile-collapse__hint {
    display: none;
  }
  .mobile-collapse .result-section {
    margin-top: 0;
    padding: 0 18px 18px;
  }
  .mobile-collapse .result-section__head {
    padding-top: 4px;
    margin-bottom: 14px;
  }
  .mobile-collapse .result-section__head h2 {
    font-size: 1.35rem;
  }
  .mobile-collapse .selected-resources {
    margin-bottom: 0;
  }
  .result-hero > p {
    margin-bottom: 0;
  }
}

.step[data-step="2"] .selected-resources { display: none; }
.result-totals { display: none !important; }


/* =========================================================
   V11 — collapses unifiés desktop/mobile
   ========================================================= */
.result-collapse {
  margin-top: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 5px 18px rgba(0,0,0,.025);
}
.result-collapse > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  min-height: 82px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
}
.result-collapse > summary::-webkit-details-marker { display: none; }
.result-collapse > summary::marker { content: ''; }
.result-collapse > summary:hover { background: #fcfcfb; }
.result-collapse[open] > summary {
  border-bottom: 1px solid var(--line);
}
.result-collapse__label {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 850;
  letter-spacing: -.015em;
}
.result-collapse__icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--soft);
}
.result-collapse__icon img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.result-collapse__toggle {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--soft);
}
.result-collapse__toggle::before,
.result-collapse__toggle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 3px;
  border-radius: 3px;
  background: var(--red);
  transform: translate(-50%, -50%);
}
.result-collapse__toggle::after {
  transform: translate(-50%, -50%) rotate(90deg);
  transition: transform .18s ease, opacity .18s ease;
}
.result-collapse[open] .result-collapse__toggle::after {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(0deg);
}
.result-collapse__content {
  padding: 18px 20px 20px;
}
.result-collapse__toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}
.result-collapse .result-list {
  margin: 0;
}
.result-collapse .selected-resources {
  margin: 0;
}
.result-collapse--method .method-details__body {
  color: var(--muted);
  font-size: .9rem;
}
.result-collapse--method .method-details__body p { margin: 0 0 12px; }
.result-collapse--method .method-details__body p:last-child { margin-bottom: 0; }
.result-collapse--method .method-details__body ul { margin: 0 0 14px; padding-left: 20px; }
.result-collapse--method .method-details__body li + li { margin-top: 5px; }

/* Neutralise l'ancien comportement V10 des collapses réservés au mobile. */
.mobile-collapse { display: none !important; }

@media (max-width: 640px) {
  .result-collapse {
    margin-top: 16px;
    border-radius: 17px;
  }
  .result-collapse > summary {
    min-height: 74px;
    padding: 13px 15px;
    gap: 12px;
  }
  .result-collapse__label {
    gap: 11px;
    font-size: 1rem;
    line-height: 1.2;
  }
  .result-collapse__icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }
  .result-collapse__icon img {
    width: 30px;
    height: 30px;
  }
  .result-collapse__toggle {
    width: 34px;
    height: 34px;
  }
  .result-collapse__content {
    padding: 14px 15px 16px;
  }
  .result-collapse__toolbar {
    justify-content: flex-start;
    margin-bottom: 12px;
  }
}


/* =========================================================
   V12 — résultat simplifié : graphique à gauche, détail à droite
   ========================================================= */
.result-overview {
  display: block;
  margin-top: 24px;
}
.result-chart-card--horizontal {
  width: 100%;
}
.result-chart-layout {
  display: grid;
  grid-template-columns: minmax(300px, .9fr) minmax(360px, 1.1fr);
  gap: 28px;
  align-items: center;
  margin-top: 14px;
}
.result-chart-card--horizontal .result-chart-wrap {
  min-height: 360px;
  margin-top: 0;
}
.result-chart-card--horizontal .result-chart-wrap canvas {
  height: 360px !important;
}
.result-chart-detail {
  min-width: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.result-chart-detail__head {
  margin-bottom: 8px;
}
.result-chart-detail__head h3 {
  margin: 3px 0 0;
  font-size: 1.2rem;
  letter-spacing: -.02em;
}
.result-chart-card--horizontal .result-chart-legend {
  margin-top: 6px;
  gap: 7px;
}
.result-chart-card--horizontal .result-chart-legend__item {
  --legend-color: #d8d8d8;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 0;
  border-left: 4px solid var(--legend-color);
  border-radius: 10px;
  background: var(--soft);
}
.result-chart-card--horizontal .result-chart-legend__dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  background: var(--legend-color) !important;
}
.result-chart-legend__main {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.result-chart-card--horizontal .result-chart-legend__label {
  font-size: .84rem;
  line-height: 1.25;
}
.result-chart-legend__values {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.result-chart-card--horizontal .result-chart-legend__values strong {
  font-size: .86rem;
  white-space: nowrap;
}
.result-chart-card--horizontal .result-chart-legend__values span {
  color: var(--muted);
  font-size: .78rem;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .result-chart-layout {
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    gap: 16px;
    align-items: start;
  }
  .result-chart-card--horizontal .result-chart-wrap {
    min-height: 260px;
    position: sticky;
    top: 82px;
  }
  .result-chart-card--horizontal .result-chart-wrap canvas {
    height: 260px !important;
  }
  .result-chart-detail__head h3 { font-size: 1.05rem; }
}

@media (max-width: 640px) {
  .result-chart-card--horizontal {
    padding: 18px 14px;
  }
  .result-chart-layout {
    grid-template-columns: minmax(135px, .82fr) minmax(0, 1.18fr);
    gap: 10px;
    margin-top: 10px;
    align-items: start;
  }
  .result-chart-card--horizontal .result-chart-wrap {
    min-height: 190px;
    position: sticky;
    top: 76px;
  }
  .result-chart-card--horizontal .result-chart-wrap canvas {
    height: 190px !important;
  }
  .result-chart-detail__head {
    margin-bottom: 4px;
  }
  .result-chart-detail__head .eyebrow {
    display: none;
  }
  .result-chart-detail__head h3 {
    margin-top: 0;
    font-size: .98rem;
  }
  .result-chart-card--horizontal .result-chart-legend {
    gap: 5px;
  }
  .result-chart-card--horizontal .result-chart-legend__item {
    grid-template-columns: 8px minmax(0, 1fr);
    gap: 7px;
    padding: 7px 8px;
    border-left-width: 3px;
    border-radius: 8px;
  }
  .result-chart-card--horizontal .result-chart-legend__dot {
    width: 7px;
    height: 7px;
    margin-top: 4px;
  }
  .result-chart-card--horizontal .result-chart-legend__label {
    font-size: .72rem;
    line-height: 1.15;
  }
  .result-chart-legend__values {
    gap: 5px;
  }
  .result-chart-card--horizontal .result-chart-legend__values strong,
  .result-chart-card--horizontal .result-chart-legend__values span {
    font-size: .68rem;
  }
}


/* =========================================================
   V13 — résultat desktop empilé + détail compact
   ========================================================= */
@media (min-width: 821px) {
  .result-chart-layout {
    display: block;
    margin-top: 16px;
  }

  .result-chart-card--horizontal .result-chart-wrap {
    width: min(520px, 100%);
    min-height: 410px;
    margin: 0 auto 28px;
    position: relative;
  }

  .result-chart-card--horizontal .result-chart-wrap canvas {
    height: 410px !important;
  }

  .result-chart-detail {
    width: 100%;
    display: block;
  }

  .result-chart-detail__head {
    margin: 0 0 12px;
  }

  .result-chart-card--horizontal .result-chart-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 12px;
    margin-top: 0;
  }

  .result-chart-card--horizontal .result-chart-legend__item {
    grid-template-columns: 12px minmax(0, 1fr);
    align-items: center;
    min-height: 56px;
    padding: 10px 14px;
  }

  .result-chart-card--horizontal .result-chart-legend__dot {
    margin-top: 0;
  }

  .result-chart-legend__main {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
  }

  .result-chart-card--horizontal .result-chart-legend__label {
    min-width: 0;
    font-size: .86rem;
    font-weight: 800;
  }

  .result-chart-legend__values {
    flex: 0 0 auto;
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: baseline;
    justify-content: flex-end;
    gap: 7px;
    text-align: right;
  }

  .result-chart-card--horizontal .result-chart-legend__values strong {
    font-size: .88rem;
  }

  .result-chart-card--horizontal .result-chart-legend__values span {
    font-size: .78rem;
  }
}


/* =========================================================
   V14.1 — correction responsive du graphique
   Desktop : graphique | détail en 50/50
   Mobile/tablette : graphique au-dessus du détail
   Détail : toujours sur une seule colonne
   ========================================================= */

/* Desktop */
@media (min-width: 821px) {
  .result-chart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 34px;
    align-items: start;
    margin-top: 16px;
  }

  .result-chart-card--horizontal .result-chart-wrap {
    width: 100%;
    min-height: 430px;
    height: 430px;
    margin: 0;
    position: relative;
    top: auto;
  }

  .result-chart-card--horizontal .result-chart-wrap canvas {
    width: 100% !important;
    height: 430px !important;
  }

  .result-chart-detail {
    width: 100%;
    min-width: 0;
    display: block;
    align-self: start;
  }

  .result-chart-detail__head {
    margin: 0 0 12px;
  }

  .result-chart-card--horizontal .result-chart-legend {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 0;
  }

  .result-chart-card--horizontal .result-chart-legend__item {
    grid-template-columns: 12px minmax(0, 1fr);
    align-items: center;
    min-height: 54px;
    padding: 10px 14px;
  }

  .result-chart-card--horizontal .result-chart-legend__dot {
    margin-top: 0;
  }

  .result-chart-legend__main {
    min-width: 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
  }

  .result-chart-card--horizontal .result-chart-legend__label {
    min-width: 0;
    font-size: .86rem;
    font-weight: 800;
    line-height: 1.2;
  }

  .result-chart-legend__values {
    flex: 0 0 auto;
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: baseline;
    justify-content: flex-end;
    gap: 7px;
    text-align: right;
  }

  .result-chart-card--horizontal .result-chart-legend__values strong {
    font-size: .88rem;
    white-space: nowrap;
  }

  .result-chart-card--horizontal .result-chart-legend__values span {
    font-size: .78rem;
    white-space: nowrap;
  }
}

/* Tablette + mobile : le graphique passe au-dessus du détail */
@media (max-width: 820px) {
  .result-chart-layout {
    display: block;
    margin-top: 12px;
  }

  .result-chart-card--horizontal .result-chart-wrap {
    width: min(420px, 100%);
    min-height: 320px;
    height: 320px;
    margin: 0 auto 24px;
    position: relative;
    top: auto;
  }

  .result-chart-card--horizontal .result-chart-wrap canvas {
    width: 100% !important;
    height: 320px !important;
  }

  .result-chart-detail {
    width: 100%;
    display: block;
  }

  .result-chart-detail__head {
    margin: 0 0 10px;
  }

  .result-chart-card--horizontal .result-chart-legend {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    margin-top: 0;
  }

  .result-chart-card--horizontal .result-chart-legend__item {
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    padding: 9px 11px;
  }

  .result-chart-card--horizontal .result-chart-legend__dot {
    width: 9px;
    height: 9px;
    margin-top: 0;
  }

  .result-chart-legend__main {
    min-width: 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
  }

  .result-chart-card--horizontal .result-chart-legend__label {
    min-width: 0;
    font-size: .8rem;
    font-weight: 800;
  }

  .result-chart-legend__values {
    flex: 0 0 auto;
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 6px;
  }

  .result-chart-card--horizontal .result-chart-legend__values strong {
    font-size: .82rem;
    white-space: nowrap;
  }

  .result-chart-card--horizontal .result-chart-legend__values span {
    font-size: .74rem;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .result-chart-card--horizontal {
    padding: 18px 14px;
  }

  .result-chart-card--horizontal .result-chart-wrap {
    width: min(310px, 100%);
    min-height: 270px;
    height: 270px;
    margin-bottom: 22px;
  }

  .result-chart-card--horizontal .result-chart-wrap canvas {
    height: 270px !important;
  }

  .result-chart-detail__head .eyebrow {
    display: block;
  }

  .result-chart-detail__head h3 {
    font-size: 1rem;
  }

  .result-chart-card--horizontal .result-chart-legend__item {
    border-left-width: 3px;
    border-radius: 9px;
    padding: 9px 10px;
  }

  .result-chart-card--horizontal .result-chart-legend__label {
    font-size: .76rem;
  }

  .result-chart-card--horizontal .result-chart-legend__values strong {
    font-size: .78rem;
  }

  .result-chart-card--horizontal .result-chart-legend__values span {
    font-size: .7rem;
  }
}


/* =========================================================
   V16 — libellé Éducation / Enseignement supérieur et Recherche
   ========================================================= */
.category-pill--education {
  white-space: normal;
  line-height: 1.2;
}


/* =========================================================
   V17 — cinq cartes de recettes
   ========================================================= */
@media (min-width: 981px) {
  .resource-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}


/* =========================================================
   V18 — contrôle des fraudes
   ========================================================= */
.category-pill--fraudes {
  background: rgba(95, 111, 82, .14);
  color: #46533d;
}
