:root {
  --rose: #b3134f;
  --rose-fonce: #8a0e3c;
  --rose-pale: #fbe9ef;
  --sable: #f6efe6;
  --sable-fonce: #e8dccb;
  --encre: #24161b;
  --gris: #5d4c52;
  --vert: #1f7a4d;
  --vert-pale: #e3f3ea;
  --ambre: #9a5b00;
  --ambre-pale: #fdf0d9;
  --rouge: #b42318;
  --blanc: #fff;
  --rayon: 18px;
  --ombre: 0 1px 2px rgba(36, 22, 27, .06), 0 6px 24px rgba(36, 22, 27, .06);
  --nav: 76px;
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  color: var(--encre);
  background: var(--sable);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html { scroll-padding-bottom: calc(var(--nav) + 24px); scroll-padding-top: 16px; }
@media (min-width: 900px) { html { scroll-padding-bottom: 24px; } }
body { margin: 0; min-height: 100vh; font-size: 17px; line-height: 1.5; }
h1, h2, h3 { font-family: 'Newsreader', Georgia, serif; font-weight: 500; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
h2 { font-size: clamp(1.45rem, 3.6vw, 1.85rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 .8em; }
a { color: var(--rose); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 2px; }

/* ── mise en page ── */
.cadre { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.contenu { padding: 20px 16px calc(var(--nav) + 28px); max-width: 980px; width: 100%; margin: 0 auto; }
.entete { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.logo { width: 44px; height: 44px; border-radius: 50%; background: var(--rose); color: #fff; display: grid; place-items: center; font-family: 'Newsreader', serif; font-size: 22px; flex: none; }
.entete .qui { flex: 1; min-width: 0; }
.entete .qui strong { display: block; }
.sur-titre { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 600; color: var(--rose); margin: 0 0 .3em; }

nav.principale { position: fixed; z-index: 10; inset: auto 0 0 0; height: var(--nav); background: var(--blanc); border-top: 1px solid var(--sable-fonce); display: flex; justify-content: space-around; padding-bottom: env(safe-area-inset-bottom); overflow-x: auto; }
nav.principale button { flex: 1 0 64px; min-height: 60px; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .74rem; font-weight: 600; color: var(--gris); cursor: pointer; padding: 6px 4px; }
nav.principale button .ico { font-size: 1.35rem; line-height: 1; }
nav.principale button[aria-current="page"] { color: var(--rose); }
nav.principale button .ico { position: relative; }
nav.principale button .cadenas { position: absolute; right: -10px; bottom: -4px; font-size: .62rem; }
nav.principale .long, .lecteur { display: none; }
.lecteur { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (min-width: 900px) { nav.principale .long { display: inline; } nav.principale .court { display: none; } }

@media (min-width: 900px) {
  .cadre { grid-template-columns: 250px 1fr; }
  nav.principale { position: sticky; top: 0; inset: auto; height: 100vh; flex-direction: column; justify-content: flex-start; border-top: 0; border-right: 1px solid var(--sable-fonce); padding: 24px 12px; gap: 4px; }
  nav.principale button { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 1rem; min-height: 52px; border-radius: 14px; padding: 0 16px; }
  nav.principale button[aria-current="page"] { background: var(--rose-pale); }
  .contenu { padding: 32px 32px 48px; }
}

/* ── cartes ── */
.carte { background: var(--blanc); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 20px; margin-bottom: 16px; }
.carte-centre { max-width: 520px; margin: 10vh auto; }
.carte.accent { background: linear-gradient(135deg, var(--rose) 0%, #d23a6e 100%); color: #fff; }
.carte.accent a, .carte.accent .sur-titre { color: #fff; }
.carte.verrou { background: repeating-linear-gradient(-45deg, #fff, #fff 12px, #fcf7f2 12px, #fcf7f2 24px); border: 1px dashed var(--sable-fonce); box-shadow: none; }
.grille { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grille > .carte { margin: 0; }
.ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ligne.entre { justify-content: space-between; }
.discret { color: var(--gris); font-size: .92rem; }
.montant { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ── boutons ── */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: 999px; border: 2px solid var(--rose); background: var(--blanc); color: var(--rose); font-weight: 700; cursor: pointer; text-decoration: none; text-align: center; }
.bouton.principal { background: var(--rose); color: #fff; }
.bouton.principal:hover { background: var(--rose-fonce); border-color: var(--rose-fonce); }
.carte.accent .bouton { background: #fff; color: var(--rose); border-color: #fff; }
.bouton.petit { min-height: 44px; padding: 0 16px; font-size: .95rem; }
.bouton.texte { border-color: transparent; background: none; padding: 0 8px; }
.bouton[disabled] { opacity: .55; cursor: wait; }
.boutons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* ── étiquettes ── */
.etiquette { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 12px; font-size: .82rem; font-weight: 700; background: var(--sable); color: var(--gris); white-space: nowrap; }
.etiquette.ok { background: var(--vert-pale); color: var(--vert); }
.etiquette.attente { background: var(--ambre-pale); color: var(--ambre); }
.etiquette.rose { background: var(--rose-pale); color: var(--rose); }

/* ── jauge ── */
.jauge { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 4px; }
.jauge div { border-radius: 12px; padding: 10px; background: rgba(255, 255, 255, .18); font-size: .88rem; font-weight: 600; text-align: center; }
.jauge div.fait { background: #fff; color: var(--rose); }
.compte-rebours { font-family: 'Newsreader', serif; font-size: 2.4rem; line-height: 1; }

/* ── formulaires ── */
form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
label .aide { font-weight: 400; color: var(--gris); font-size: .86rem; }
input, select, textarea { width: 100%; min-height: 52px; border: 1.5px solid var(--sable-fonce); border-radius: 14px; padding: 12px 14px; background: #fff; }
textarea { min-height: 110px; }
input:focus, select:focus, textarea:focus { border-color: var(--rose); outline: none; }
.case { display: flex; align-items: flex-start; gap: 12px; font-weight: 500; }
.case input { width: 26px; min-height: 26px; height: 26px; flex: none; margin-top: 2px; accent-color: var(--rose); }
.deux { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.choix { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.choix label { display: flex; align-items: center; gap: 10px; min-height: 56px; border: 1.5px solid var(--sable-fonce); border-radius: 14px; padding: 0 14px; cursor: pointer; background: #fff; }
.choix input { width: 22px; min-height: 22px; height: 22px; accent-color: var(--rose); }
.choix label:has(input:checked) { border-color: var(--rose); background: var(--rose-pale); }
.erreur { color: var(--rouge); font-weight: 600; }

/* ── listes ── */
.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { padding: 14px 0; border-top: 1px solid var(--sable); }
.liste > li:first-child { border-top: 0; }
.etapes { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.etapes li { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; border-radius: 14px; background: var(--sable); }
.etapes li.fait { background: var(--vert-pale); color: var(--vert); }
.etapes li button { margin-left: auto; }
.echeances { width: 100%; border-collapse: collapse; font-size: .95rem; margin-top: 10px; }
.echeances td { padding: 8px 4px; border-top: 1px solid var(--sable); }
.echeances td:last-child { text-align: right; }
.code { font-family: ui-monospace, monospace; font-size: 1.1rem; background: var(--sable); padding: 6px 12px; border-radius: 10px; letter-spacing: .06em; user-select: all; }

/* ── accueil non connectée ── */
.porte { min-height: 100vh; display: grid; align-content: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 10% -10%, #f8cddb 0%, transparent 60%), var(--sable); }
.porte .bloc { max-width: 1040px; margin: 0 auto; display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .porte .bloc { grid-template-columns: 1.1fr 1fr; align-items: start; } }
.onglets-porte { display: flex; gap: 8px; margin-bottom: 14px; }
.onglets-porte button { flex: 1; min-height: 48px; border-radius: 999px; border: 1.5px solid var(--sable-fonce); background: #fff; font-weight: 700; cursor: pointer; }
.onglets-porte button[aria-pressed="true"] { background: var(--rose); border-color: var(--rose); color: #fff; }
.bandeau { border-radius: 14px; padding: 12px 16px; background: var(--ambre-pale); color: var(--ambre); font-weight: 600; margin-bottom: 14px; }
.bandeau.recette { background: #eef2ff; color: #3730a3; }

#toast { position: fixed; z-index: 30; left: 50%; bottom: calc(var(--nav) + 18px); transform: translateX(-50%) translateY(20px); opacity: 0; transition: .25s; background: var(--encre); color: #fff; padding: 14px 20px; border-radius: 14px; max-width: min(92vw, 520px); pointer-events: none; font-weight: 600; }
#toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 900px) { #toast { bottom: 28px; } }

.page-simple { display: grid; min-height: 100vh; place-items: center; padding: 16px; }
.cache { display: none !important; }

.contenu > h1 { margin-top: 4px; }
.contenu > h2 { margin: 28px 0 12px; }
