/* Identité « Le Ticket » : interface douce et arrondie, ticket de caisse en police machine à écrire. */

@font-face { font-family: "DM Sans"; src: url("/polices/dm-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/polices/dm-sans-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("/polices/courier-prime-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("/polices/courier-prime-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --fond: #e9edf2;
  --bloc: #ffffff;
  --encre: #1a1a1a;
  --discret: #4b5563;
  --champ: #f2f4f7;
  --bord-champ: #c9d0da;
  --papier: #fffdf7;
  --erreur: #b42318;
  --theme: #15803d;
  --surlignage: #c7f0d8;
  --rayon: 14px;
  --fond-clair: #f5f7fa;
  --vert: #15803d;
  --vert-fonce: #116a32;
  --sortie: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--encre); font: 400 1rem/1.5 "DM Sans", system-ui, sans-serif; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--theme); outline-offset: 2px; }
mark { background: var(--surlignage); color: inherit; padding: 0 .2em; border-radius: 4px; }

.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.evitement { position: absolute; left: -999px; top: 8px; background: var(--bloc); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.evitement:focus { left: 8px; }

/* Barre de navigation */
.barre { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px clamp(16px, 3vw, 40px); }
.marque { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.125rem; text-decoration: none; }
.marque__icone { width: 16px; height: 20px; background: var(--encre); clip-path: polygon(0 0,100% 0,100% 100%,83% 88%,66% 100%,50% 88%,33% 100%,16% 88%,0 100%); }
/* Les liens passent à la ligne plutôt que de déborder (dès huit liens, entre 900 et 1 000 px). */
.barre ul { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; margin: 0; padding: 0; }
.barre a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-decoration-color: var(--theme); text-decoration-thickness: 3px; text-underline-offset: 6px; }

main { padding: 0 clamp(16px, 3vw, 40px) 48px; max-width: 1280px; margin: 0 auto; }

/* Tête du calculateur */
.calculateur__tete { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 16px; }
h1 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.125rem); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
.maj { margin: 0; color: var(--discret); font-size: .875rem; }

.calculateur__corps { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; align-items: start; }

/* Formulaire */
.formulaire { background: var(--bloc); border-radius: var(--rayon); padding: 20px; display: grid; gap: 14px; }
.champ { border: 0; margin: 0; padding: 0; min-width: 0; }
.champ > label, .champ legend { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; font-size: .9375rem; margin-bottom: 6px; padding: 0; }
.champ output { font-weight: 700; font-variant-numeric: tabular-nums; }
.champ--paire { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.champ--paire legend { grid-column: 1 / -1; }
.champ--paire label { display: block; font-size: .8125rem; color: var(--discret); margin-bottom: 4px; }
input[type="range"] { width: 100%; accent-color: var(--encre); margin: 0; height: 28px; }
.saisie { min-width: 0; display: flex; align-items: center; gap: 6px; background: var(--champ); border: 2px solid transparent; border-radius: 10px; padding: 0 12px; height: 44px; }
.saisie:focus-within { border-color: var(--theme); }
.saisie input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; color: inherit; outline: none; }
.saisie select { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-weight: 700; color: inherit; outline: none; cursor: pointer; }
.saisie span { color: var(--discret); font-size: .875rem; white-space: nowrap; }
.saisie:has(input[aria-invalid="true"]) { border-color: var(--erreur); }
.segments { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--champ); border-radius: 10px; padding: 4px; }
.segments input { position: absolute; opacity: 0; pointer-events: none; }
.segments label { text-align: center; padding: 8px; border-radius: 8px; cursor: pointer; font-weight: 700; color: var(--discret); }
.segments input:checked + label { background: var(--bloc); color: var(--encre); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.segments input:focus-visible + label { outline: 3px solid var(--theme); outline-offset: 2px; }
.champ__erreur { color: var(--erreur); font-size: .875rem; margin: 4px 0 0; }
.champ__aide { color: var(--discret); font-size: .875rem; margin: 4px 0 0; }
.avance summary { cursor: pointer; font-weight: 700; color: var(--theme); }
.avance__aide { color: var(--discret); font-size: .875rem; margin: 8px 0; }
.avance__grille { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.avance__grille label, .avance__grille legend { font-size: .8125rem; }
.formulaire__statut { margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--champ); font-size: .875rem; }

/* Résultat et ticket */
.resultat { display: grid; gap: 16px; justify-items: center; }
#ticket { width: 100%; max-width: 460px; transition: opacity .2s, filter .2s; }
#ticket.ticket-perime { opacity: .45; filter: grayscale(1); }
.ticket {
  position: relative; background: var(--papier); font-family: "Courier Prime", ui-monospace, monospace; font-size: .9375rem;
  padding: 20px 20px 84px; transform: rotate(1deg); box-shadow: 0 10px 24px rgb(0 0 0 / .12);
  --dent: 10px;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / var(--dent) 100%;
}
.ticket__titre { text-align: center; font-weight: 700; margin: 0 0 10px; }
.ticket__table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ticket__table th, .ticket__table td { padding: 2px 0 2px 12px; text-align: right; font-weight: 400; }
.ticket__table th[scope="row"], .ticket__table thead th:first-child { text-align: left; padding-left: 0; }
.ticket__table thead th { font-weight: 700; border-bottom: 1px dashed #8a8a8a; padding-bottom: 4px; }
.ticket__table tfoot th, .ticket__table tfoot td { font-weight: 700; border-top: 1px dashed #8a8a8a; padding-top: 4px; }
.ticket__table tfoot .ticket__poche th, .ticket__table tfoot .ticket__poche td { border-top: 0; padding-top: 2px; }
.ticket__bascule { display: flex; justify-content: space-between; margin: 10px 0 0; }
/* Les montants ne se coupent pas ; les libellés de poste, eux, peuvent passer à la ligne. */
.ticket__table td { white-space: nowrap; }
/* La colonne gagnante (classe posée par le crate ticket) : coche dans l'en-tête, chiffres dans la couleur du thème. */
.ticket__table .ticket__gagnant { color: var(--theme); }
.ticket__table thead .ticket__gagnant::before { content: "✓\00a0"; }
/* Sous 400 px, la coche ferait déborder le ticket : la couleur et le verdict suffisent. À trois
   ou quatre options, police, marges et écarts entre colonnes rapetissent pour que des montants à
   six chiffres tiennent sans débordement à 360 px (mesuré). */
@media (max-width: 399px) {
  .ticket__table thead .ticket__gagnant::before { content: none; }
  .ticket__verdict { max-width: none; }
  .ticket[data-options="3"] { font-size: .8125rem; }
  .ticket[data-options="4"] { font-size: .75rem; padding-left: 12px; padding-right: 12px; }
  .ticket[data-options="3"] .ticket__table td, .ticket[data-options="3"] .ticket__table thead th + th,
  .ticket[data-options="4"] .ticket__table td, .ticket[data-options="4"] .ticket__table thead th + th { padding-left: 6px; }
  /* Le tableau annuel (année, une colonne par option, « En tête ») se resserre lui aussi. */
  .onglet .annees { font-size: .8125rem; }
  .onglet .annees th, .onglet .annees td { padding: 6px 4px; }
}
/* Sous 340 px (iPhone SE de première génération, 288 px utiles), le ticket perd 8 px de marge
   de chaque côté et un cran de police, sinon ses montants en chiffres non sécables le font déborder. */
@media (max-width: 339px) {
  .ticket { padding-left: 12px; padding-right: 12px; font-size: .8125rem; }
  .ticket[data-options="3"] { font-size: .75rem; }
  .ticket[data-options="4"] { font-size: .6875rem; }
  .etape__preuve.lignes { padding: 14px 12px; font-size: .75rem; }
}
.ticket__verdict { margin: 12px 0 0; padding-top: 8px; border-top: 1px dashed #8a8a8a; max-width: 62%; line-height: 1.3; }
.ticket__verdict strong { font-family: "DM Sans", sans-serif; }
.ticket__tampon {
  position: absolute; right: 16px; bottom: 30px; margin: 0; transform: rotate(-12deg);
  border: 3px solid var(--theme); color: var(--theme); background: rgb(255 253 247 / .9);
  font: 700 .9375rem/1.15 "DM Sans", sans-serif; text-transform: uppercase; text-align: center; padding: 4px 10px; border-radius: 6px;
}
.ticket[data-gagnant="match_nul"] .ticket__tampon { border-color: var(--discret); color: var(--discret); }
.ticket__detail { margin-top: 12px; }
.bouton { font: inherit; font-weight: 700; background: var(--encre); color: #fff; border: 0; border-radius: 10px; padding: 10px 18px; cursor: pointer; }
.resume-mobile { display: none; }

/* Onglets */
.onglets { margin-top: 32px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.onglets details { background: var(--bloc); border-radius: var(--rayon); }
.onglets summary { cursor: pointer; padding: 14px 20px; font-weight: 700; }
.onglet { padding: 0 20px 20px; max-width: 72ch; }
.onglet table { border-collapse: collapse; width: 100%; font-size: .9375rem; }
.onglet th, .onglet td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--champ); vertical-align: top; }
.annees td { font-variant-numeric: tabular-nums; }
#detail-annees { overflow-x: auto; }
.faq dt { font-weight: 700; margin-top: 12px; }
.faq dd { margin: 4px 0 0; }

/* Pied de page : des tuiles, sur toutes les pages */
.pied { margin-top: clamp(64px, 8vw, 120px); }
.pied__tuiles { padding: 0 10px 10px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; }
.pied__tuiles > * { background: var(--bloc); border-radius: var(--rayon); padding: 24px; }
.pied__enonce { grid-column: 1 / 6; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; min-height: 220px; }
.pied__enonce p { margin: 0; }
.pied__enonce p:first-child { font-size: 1.375rem; line-height: 1.3; }
.pied__legal { font-size: .8125rem; color: var(--discret); }
.pied__nav { grid-column: 6 / 10; }
.pied__nav ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.pied__nav a { text-decoration: none; }
.pied__nav a:hover { text-decoration: underline; }
.pied__mail { grid-column: 10 / 13; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; font-size: .9375rem; color: var(--discret); }
.pied__mail a { font-size: 1.375rem; color: var(--encre); font-weight: 700; overflow-wrap: anywhere; }
.pied__marque { grid-column: 1 / 9; background: var(--encre) !important; color: var(--papier); min-height: 260px; display: grid; place-items: center; }
.pied__marque span { font-size: clamp(2.25rem, 6vw, 6.5rem); font-weight: 700; letter-spacing: -.045em; line-height: 1; white-space: nowrap; display: flex; align-items: center; gap: .18em; }
.pied__marque i { width: .3em; height: .38em; background: var(--papier); clip-path: polygon(0 0,100% 0,100% 100%,83% 88%,66% 100%,50% 88%,33% 100%,16% 88%,0 100%); }
.pied__action { grid-column: 9 / 13; background: var(--vert) !important; color: #fff; min-height: 260px; text-decoration: none; display: flex; flex-direction: column; justify-content: space-between; transition: background-color .2s; }
.pied__action:hover { background: var(--vert-fonce) !important; }
.pied__action span { font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.75rem); font-weight: 700; line-height: 1.05; letter-spacing: -.03em; }
.pied__action svg { align-self: flex-end; transition: transform .3s var(--sortie); }
.pied__action:hover svg { transform: translateX(8px); }
.credits { padding: 16px clamp(16px, 3vw, 40px) 32px; font-size: .8125rem; color: var(--discret); margin: 0; }
.barre__large { display: list-item; }

/* Pages de texte : mentions légales, confidentialité, sources */
.texte { background: var(--bloc); border-radius: var(--rayon); padding: clamp(24px, 4vw, 56px); max-width: 52rem; margin: 16px auto 0; }
.texte--large { max-width: none; }
.texte h1 { margin-bottom: 16px; }
.texte h2 { font-size: 1.25rem; margin: 32px 0 8px; }
.texte p { max-width: 68ch; }
.texte__chapo { font-size: 1.1875rem; }
.texte__groupe h2 a { text-decoration-color: var(--theme); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.hypotheses { border-collapse: collapse; width: 100%; font-size: .9375rem; }
.hypotheses th, .hypotheses td { text-align: left; padding: 8px; border-bottom: 1px solid var(--champ); vertical-align: top; }

/* ---------- Accueil ---------- */
main.accueil { max-width: none; padding: 0; }
.accueil h2 { font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.75rem); line-height: 1.05; letter-spacing: -.03em; margin: 0; }
.accueil p { margin: 0; }
.bouton--accent { display: inline-flex; align-items: center; background: var(--vert); padding: 17px 24px; text-decoration: none; transition: transform .2s var(--sortie), background-color .2s; }
.bouton--accent:hover { background: var(--vert-fonce); transform: translateY(-2px); }
.bouton--accent:active { transform: translateY(1px); }

/* Premier écran : deux moitiés de tons, le ticket à droite */
.ecran { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: min(calc(100svh - 64px), 900px); }
.ecran__gauche { display: flex; flex-direction: column; justify-content: center; gap: 24px; padding: 48px clamp(20px, 3vw, 40px) 56px; }
.ecran__titre { font-size: clamp(2.25rem, 1.2rem + 3.6vw, 4.5rem); line-height: .98; letter-spacing: -.045em; }
.ligne { display: block; overflow: hidden; padding-bottom: .08em; }
.ligne > span { display: inline-block; white-space: nowrap; }
.surligne { background: var(--surlignage); border-radius: 6px; padding: 0 .12em; margin-left: -.12em; }
.ecran__phrase { max-width: 44ch; font-size: 1.375rem; line-height: 1.4; }
.ecran__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.ecran__repere { font-size: .9375rem; color: var(--discret); }
.raccourcis { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.raccourcis a { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; text-decoration: none; padding: 6px 0; }
.raccourcis a::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--theme); transition: transform .3s var(--sortie); }
.raccourcis a:hover::before { transform: scale(1.4) rotate(45deg); }
.raccourcis a:hover { text-decoration: underline; text-decoration-color: var(--theme); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.ecran__droite { background: var(--fond-clair); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 40px clamp(20px, 3vw, 40px) 48px; }
.caisse { width: min(100%, 460px); display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
/* Un onglet par calculateur, en colonnes d'au moins 8rem pour que « Renégociation » (105 px de texte) tienne :
   deux colonnes sur mobile et jusque vers 1 000 px, trois au-delà, la dernière rangée incomplète si besoin. */
.caisse__onglets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 8rem), 1fr)); gap: 6px; background: var(--fond); padding: 5px; border-radius: 12px; }
.caisse__onglets button { flex: 1; font: 700 .9375rem/1 "DM Sans", sans-serif; border: 0; background: transparent; padding: 12px 8px; border-radius: 9px; cursor: pointer; color: var(--discret); transition: background-color .2s, color .2s; }
.caisse__onglets button:hover { color: var(--encre); }
.caisse__onglets button[aria-selected="true"] { background: var(--bloc); color: var(--encre); }
.caisse__panneau { display: grid; gap: 14px; }
.caisse__panneau[hidden] { display: none; }
.caisse__reglage { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--bloc); border-radius: 12px; padding: 10px 14px; font-size: .9375rem; font-weight: 700; }
.caisse__reglage select { font: 700 .9375rem "DM Sans", sans-serif; color: inherit; border: 2px solid transparent; background: var(--fond-clair); border-radius: 8px; padding: 8px 10px; max-width: 62%; }
.caisse__reglage select:focus-visible { border-color: var(--theme); outline: none; }
.caisse__ticket .ticket { transition: transform .4s var(--sortie); }
.caisse__ticket .ticket:hover { transform: rotate(0deg); }
.caisse__pied { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: .9375rem; color: var(--discret); }
.caisse__pied a { font-weight: 700; color: var(--encre); white-space: nowrap; }

/* Sections */
.bloc-section { padding: clamp(96px, 11vw, 168px) clamp(20px, 3vw, 40px) 0; }
.tampon {
  --theme-tampon: var(--theme);
  display: inline-block; border: 3px solid var(--theme-tampon); color: var(--theme-tampon); background: rgb(255 253 247 / .9);
  font: 700 1.0625rem/1.15 "DM Sans", sans-serif; text-transform: uppercase; text-align: center; padding: 5px 12px; border-radius: 6px; transform: rotate(-12deg);
}

/* Les additions */
.additions__tete { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 48px; }
.additions__tete p { max-width: 34ch; }
.additions { display: grid; gap: 16px; }
.addition { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr); background: var(--bloc); border-radius: var(--rayon); overflow: hidden; text-decoration: none; transition: transform .35s var(--sortie); }
.addition:hover, .addition:focus-visible { transform: translateY(-4px); }
.addition__photo { position: relative; overflow: hidden; min-height: 280px; }
.addition__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--sortie); }
.addition:hover .addition__photo img { transform: scale(1.05); }
.addition__texte { padding: 32px; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.addition__texte h3 { font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.75rem); line-height: 1.05; letter-spacing: -.03em; margin: 0 0 8px; }
.addition__ouvrir { font-weight: 700; color: var(--theme); display: inline-flex; gap: 8px; }
.addition__ouvrir span { transition: transform .3s var(--sortie); }
.addition:hover .addition__ouvrir span { transform: translateX(6px); }
.addition__ticket { background: var(--papier); padding: 28px 24px 40px; font-family: "Courier Prime", ui-monospace, monospace; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.addition__ticket dl { margin: 0; display: grid; gap: 6px; }
.addition__ticket dl div { display: flex; justify-content: space-between; gap: 12px; }
.addition__ticket dd { margin: 0; text-align: right; }
.addition__ticket .tampon { align-self: flex-end; }

/* Comment on fait l'addition */
.methode__titre { max-width: 18ch; margin-bottom: 56px !important; }
.etapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; list-style: none; margin: 0; padding: 0; }
.etape { display: grid; gap: 20px; }
.etape p b { display: block; font-size: 1.375rem; margin-bottom: 6px; letter-spacing: -.01em; }
.etape__preuve { background: var(--bloc); border-radius: var(--rayon); padding: 18px 20px; }
.champs { display: grid; gap: 10px; font-size: .9375rem; }
.champs div { display: flex; justify-content: space-between; gap: 12px; background: var(--fond-clair); border-radius: 8px; padding: 10px 12px; }
.lignes, .verdict { background: var(--papier); font-family: "Courier Prime", ui-monospace, monospace; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.lignes table { width: 100%; border-collapse: collapse; }
.lignes th, .lignes td { text-align: right; font-weight: 400; padding: 2px 0 2px 10px; }
.lignes th[scope="row"], .lignes thead th:first-child { text-align: left; padding-left: 0; }
.lignes thead th { font-weight: 700; border-bottom: 1px dashed #8a8a8a; }
.verdict { display: grid; gap: 14px; }
.verdict p { display: flex; justify-content: space-between; gap: 12px; }
.verdict .tampon { justify-self: end; margin: 4px 8px 6px 0; }
.engagements { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 56px; }
.engagements b { font-size: 1.375rem; display: block; margin-bottom: 4px; letter-spacing: -.01em; }

/* Photo en bandeau */
.bandeau { margin: clamp(96px, 11vw, 168px) 0 0; overflow: hidden; }
.bandeau img { width: 100%; height: clamp(280px, 42vw, 600px); object-fit: cover; }
.bandeau figcaption { padding: 14px clamp(20px, 3vw, 40px) 0; font-size: .9375rem; color: var(--discret); }

/* D'où viennent nos chiffres */
.sources { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.accueil .sources__titre { grid-column: 1 / 8; font-size: clamp(2.25rem, 1.4rem + 4.4vw, 5.25rem); line-height: .98; letter-spacing: -.045em; }
.sources__titre span { display: block; }
.sources__titre span + span { padding-left: calc(2 * (100% + 24px) / 7); }
.sources__intro { grid-column: 8 / 13; align-self: end; }
.sources__table { grid-column: 1 / -1; margin-top: 64px; }
.sources table { width: 100%; border-collapse: collapse; }
.sources thead th { text-align: left; font-size: .9375rem; font-weight: 400; color: var(--discret); padding: 0 16px 12px 0; }
.sources tbody th, .sources td { text-align: left; vertical-align: top; padding: 14px 16px 14px 0; }
.sources tbody th { width: 30%; }
.sources td:nth-child(3), .sources td:nth-child(4) { color: var(--discret); white-space: nowrap; }
.sources tbody tr:nth-child(odd) { background: var(--fond-clair); }
.sources tbody tr > :first-child, .sources thead tr > :first-child { padding-left: 16px; }
.sources tbody tr > :first-child { border-radius: 10px 0 0 10px; }
.sources tbody tr > :last-child { border-radius: 0 10px 10px 0; }
.sources__suite { grid-column: 1 / -1; margin-top: 24px !important; font-weight: 700; }

/* À propos : une lettre sur papier de caisse */
.lettre-zone { background: var(--encre); padding: 140px clamp(20px, 3vw, 40px); margin-top: clamp(96px, 11vw, 168px); }
.lettre { width: min(100%, 640px); margin: 0 auto; background: var(--papier); padding: 60px 60px 40px; --dent: 12px;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / var(--dent) 100%; }
.lettre__corps { display: grid; gap: 1.1em; }
.accueil .lettre__titre { font-family: "Courier Prime", ui-monospace, monospace; font-size: 1rem; letter-spacing: 0; text-transform: uppercase; text-align: center; margin-bottom: 28px; }
.lettre__signature { font-size: 1.375rem; font-style: italic; margin-top: 28px !important; }
.lettre__role { font-size: .9375rem; color: var(--discret); }
.lettre__trous { display: flex; justify-content: space-between; margin: 36px -40px 0; }
.lettre__trous i { width: 5px; height: 5px; border-radius: 50%; background: var(--encre); opacity: .35; }
.lettre__souche { padding: 24px 0 36px; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-family: "Courier Prime", ui-monospace, monospace; }
.lettre__souche a { font-weight: 700; }

/* Contact : un seul champ */
.contact { padding: 140px clamp(20px, 3vw, 40px) 40px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.accueil .contact__invite { grid-column: 1 / 6; }
.contact__invite span { display: block; font-weight: 400; }
.contact__col { grid-column: 7 / 13; }
.champ-unique { position: relative; }
.champ-unique textarea { width: 100%; height: 64px; resize: none; font: 400 1.0625rem/1.4 "DM Sans", sans-serif; color: inherit; background: var(--bloc); border: 0; border-radius: 12px; padding: 20px 68px 20px 20px; transition: height .3s var(--sortie); }
.champ-unique textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--vert); height: 132px; }
.champ-unique button { position: absolute; right: 10px; top: 10px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--vert); color: #fff; cursor: pointer; display: grid; place-items: center; transition: transform .2s var(--sortie); }
.champ-unique button:hover { transform: translateX(3px); }
.contact__suite { font-size: .9375rem; color: var(--discret); margin-top: 14px !important; }
.contact__infos { margin: 40px 0 0; display: grid; gap: 14px; font-size: .9375rem; }
.contact__infos div { display: grid; grid-template-columns: 11rem 1fr; gap: 16px; }
.contact__infos dt { color: var(--discret); }
.contact__infos dd { margin: 0; }

/* Mouvement de l'accueil : le titre monte, le reste reste immobile */
.ligne > span { animation: monte .9s var(--sortie) both; }
.ligne:nth-child(2) > span { animation-delay: .11s; }
@keyframes monte { from { transform: translateY(105%); } }
/* Entrée des blocs au défilement, en CSS seul : sans prise en charge, tout reste simplement visible. */
@supports (animation-timeline: view()) {
  .entre { animation: entree linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
  .etape.entre:nth-child(2) { animation-range: entry 8% entry 43%; }
  .etape.entre:nth-child(3) { animation-range: entry 16% entry 51%; }
}
@keyframes entree { from { opacity: 0; transform: translateY(28px); } }

@media (max-width: 1100px) {
  .addition { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .addition__photo { grid-row: span 2; }
  .addition__ticket { padding: 20px 24px 28px; }
  .etapes { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
}

/* ---------- Articles ---------- */
.rubrique { max-width: 52rem; margin: 16px auto 0; }
.rubrique__tete { margin-bottom: 40px; }
.rubrique h2 { font-size: 1.5rem; margin: 40px 0 16px; }
.rubrique__groupe { margin-bottom: 24px; }
.rubrique__groupe h3 { font-size: 1.0625rem; margin: 0 0 8px; }
.rubrique__groupe h3 a { text-decoration-color: var(--theme); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.rubrique__vide { color: var(--discret); }
.liste-articles { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.liste-articles li { background: var(--bloc); border-radius: var(--rayon); padding: 16px 20px; border-left: 6px solid var(--theme, var(--encre)); }
.liste-articles li a { font-weight: 700; font-size: 1.125rem; }
.liste-articles li p { margin: 4px 0 6px; max-width: 68ch; }
.liste-articles li span { font-size: .875rem; color: var(--discret); }
.liste-articles li .brouillon-tag { margin-left: 8px; padding: 2px 8px; border-radius: 6px; background: #fde68a; color: var(--encre); font-weight: 700; }
.article__meta { color: var(--discret); font-size: .9375rem; margin: 0 0 8px; }
.article__image { margin: 24px 0; }
.article__image img { width: 100%; height: auto; border-radius: 10px; }
.article__image figcaption { font-size: .8125rem; color: var(--discret); margin-top: 6px; }
.article__corps { max-width: 72ch; }
.article__corps h2 { font-size: 1.375rem; margin: 32px 0 8px; }
.article__corps h3 { font-size: 1.125rem; margin: 24px 0 6px; }
.article__corps p, .article__corps li { max-width: 68ch; }
.article__corps table:not(.ticket__table) { border-collapse: collapse; width: 100%; font-size: .9375rem; margin: 16px 0; }
.article__corps table:not(.ticket__table) th, .article__corps table:not(.ticket__table) td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--champ); vertical-align: top; }
.article__corps blockquote { margin: 16px 0; padding: 12px 20px; background: var(--champ); border-radius: 10px; }
.article__ticket { max-width: 460px; margin: 28px auto; }
.brouillon { background: #fde68a; color: var(--encre); font-weight: 700; padding: 10px 14px; border-radius: 10px; margin: 0 0 16px; }
.ancien { background: var(--champ); padding: 12px 16px; border-radius: 10px; margin: 0 0 16px; }
.encadre { margin: 40px 0 0; padding: 24px; border-radius: var(--rayon); background: var(--surlignage); display: grid; gap: 10px; justify-items: start; }
.encadre__titre { font-weight: 700; font-size: 1.25rem; margin: 0; }
.encadre .bouton { display: inline-block; text-decoration: none; background: var(--theme); }
.article__sources { margin-top: 40px; }
.article__sources h2 { font-size: 1.125rem; }
.article__sources ul { padding-left: 20px; font-size: .9375rem; }
.a-lire { max-width: 52rem; margin: 32px auto 0; }
.a-lire h2 { font-size: 1.375rem; margin: 0 0 12px; }
.a-lire__liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.a-lire__liste li { background: var(--bloc); border-radius: 10px; padding: 12px 16px; border-left: 6px solid var(--theme, var(--encre)); display: grid; gap: 2px; }
.a-lire__liste a { font-weight: 700; }
.a-lire__liste span { font-size: .875rem; color: var(--discret); }
.calculateur + .onglets + .a-lire, .onglets + .a-lire { max-width: none; }
.a-lire__liste--trois { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.a-lire__liste--trois li { padding: 20px; }
.a-lire__liste--trois p { margin: 6px 0; }

/* Mobile : formulaire puis ticket, résumé collé en bas */
@media (max-width: 899px) {
  .a-lire__liste--trois { grid-template-columns: minmax(0, 1fr); }
  .calculateur__corps { grid-template-columns: minmax(0, 1fr); }
  .barre { flex-wrap: wrap; }
  .barre ul { gap: 6px 16px; }
  .resume-mobile {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; margin: 0; padding: 12px 16px;
    background: var(--encre); color: #fff; font-weight: 700; text-align: center;
  }
  .avance__grille { grid-template-columns: minmax(0, 1fr); }
  main { padding-bottom: 72px; }
  main.accueil { padding-bottom: 0; }
  body:has(#resume) .pied { padding-bottom: 64px; }
  .barre__large { display: none; }
  .pied__tuiles { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 0 6px 6px; }
  .pied__tuiles > * { grid-column: 1 / -1 !important; min-height: 0; padding: 20px; }
  .pied__marque { min-height: 140px; order: -2; }
  .pied__action { min-height: 140px; order: -1; }
  .pied__enonce { order: 2; }
  .ecran { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .ecran__gauche { padding: 32px 20px 40px; }
  .ecran__titre { font-size: clamp(2.25rem, 10vw, 4rem); }
  .ecran__phrase { font-size: 1.0625rem; }
  .ecran__droite { padding: 32px 16px 48px; }
  .additions__tete { display: block; }
  .additions__tete p { margin-top: 12px; }
  .addition { grid-template-columns: minmax(0, 1fr); }
  .addition__photo { grid-row: auto; min-height: 200px; }
  .addition__texte { padding: 22px 20px; }
  .engagements { grid-template-columns: minmax(0, 1fr); }
  .sources { display: block; }
  .sources__titre span + span { padding-left: 0; }
  .sources__intro { margin-top: 20px !important; }
  .sources__table { margin-top: 40px; }
  .sources thead { display: none; }
  .sources tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 14px 16px; border-radius: 10px; }
  .sources tbody tr > * { padding: 0 !important; border-radius: 0 !important; width: auto !important; }
  .sources tbody th, .sources td:nth-child(2) { grid-column: 1 / -1; }
  .sources td:nth-child(3) { white-space: normal; }
  .lettre-zone { padding: 80px 0; }
  .lettre { padding: 40px 24px 24px; }
  .lettre__trous { margin: 28px -10px 0; }
  .lettre__souche { flex-direction: column; align-items: stretch; }
  .contact { display: block; padding: 96px 20px 24px; }
  .contact__col { margin-top: 28px; }
  .contact__infos div { grid-template-columns: 1fr; gap: 2px; }
  .texte { margin-top: 8px; }
}

/* Sous 600 px, la table des hypothèses (quatre colonnes : hypothèse, valeur, source, date)
   ne tient plus en largeur : chaque ligne devient une fiche empilée. */
@media (max-width: 599px) {
  .hypotheses thead { display: none; }
  .hypotheses tr { display: grid; padding: 10px 0; border-bottom: 1px solid var(--champ); }
  .hypotheses th, .hypotheses td { border: 0; padding: 2px 0; }
  .hypotheses td:last-child { color: var(--discret); font-size: .875rem; }
}

@media (prefers-reduced-motion: reduce) {
  #ticket { transition: none; }
  .ligne > span, .entre { animation: none; }
  .addition, .addition__photo img, .caisse__ticket .ticket, .bouton--accent, .raccourcis a::before, .pied__action svg, .champ-unique textarea { transition: none; }
}
