:root {
  --fond: #f5f5ec; --carte: #fcfcf6; --encre: #2a2e22; --doux: #6a6e5e; --ligne: #e1e4d3;
  --accent: #6b7f3a; --accent-fonce: #4f6128; --accent-pale: #e6ecd6;
  --ok: #4f8a6b; --alerte: #a8641c; --alerte-pale: #fbefdc;
  --rayon: 18px; --ombre: 0 6px 24px rgba(50, 60, 30, .08);
}
[data-ton="terre"] { --accent: #b5603d; --accent-fonce: #94492b; --accent-pale: #f6e4d9; }
[data-ton="or"] { --accent: #b98a1e; --accent-fonce: #94700f; --accent-pale: #f8edcf; }
[data-ton="sauge"] { --accent: #6f8f6f; --accent-fonce: #557455; --accent-pale: #e4eee2; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--encre); font: 16px/1.6 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 14px; }
a { color: var(--accent-fonce); }
button { font: inherit; cursor: pointer; }
.app { max-width: 720px; margin: 0 auto; padding: 0 16px calc(48px + env(safe-area-inset-bottom)); min-height: 100vh; }

/* barre */
.barre { display: flex; align-items: center; gap: 10px; padding: 16px 0 12px; position: sticky; top: 0; background: var(--fond); z-index: 5; }
.barre .marque { font-family: Fraunces, serif; font-weight: 600; font-size: 17px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.retour, .lien { background: none; border: 0; color: var(--accent-fonce); font-weight: 600; padding: 8px 0; font-size: 15px; }
.retour::before { content: "‹"; font-size: 22px; line-height: 0; margin-right: 6px; position: relative; top: 2px; }

/* connexion */
.entree { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 32px 0; }
.entree .sceau { width: 64px; height: 64px; border-radius: 20px; margin-bottom: 22px; box-shadow: var(--ombre); }
.entree h1 { font-size: 32px; margin-bottom: 10px; }
.entree .sous { color: var(--doux); margin-bottom: 26px; }
.champ { display: block; width: 100%; padding: 15px 16px; border: 1.5px solid var(--ligne); border-radius: 14px; background: #fff; font: inherit; color: inherit; }
.champ:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-pale); }
.bouton { display: block; width: 100%; padding: 15px 18px; border: 0; border-radius: 14px; background: var(--accent); color: #fff; font-weight: 600; font-size: 16px; text-align: center; text-decoration: none; margin-top: 12px; }
.bouton:active { background: var(--accent-fonce); }
.bouton[disabled] { opacity: .6; }
.bouton.clair { background: var(--accent-pale); color: var(--accent-fonce); }
.message { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: var(--alerte-pale); color: #6b3f0e; font-size: 15px; }
.petit { font-size: 13px; color: var(--doux); line-height: 1.5; }

/* accueil */
.salut { padding: 10px 0 20px; }
.salut h1 { font-size: 30px; margin-bottom: 6px; }
.salut p { color: var(--doux); margin: 0; }
.programmes { display: grid; gap: 18px; }
.prog { display: block; width: 100%; text-align: left; padding: 0; border: 1px solid var(--ligne); border-radius: var(--rayon); background: var(--carte); overflow: hidden; box-shadow: var(--ombre); color: inherit; }
.prog img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--accent-pale); }
.prog .corps { padding: 16px 18px 18px; }
.prog .etiquette { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-fonce); margin-bottom: 6px; }
.prog h2 { font-size: 22px; margin-bottom: 6px; }
.prog p { color: var(--doux); font-size: 15px; margin-bottom: 14px; }
.jauge { height: 8px; border-radius: 99px; background: var(--accent-pale); overflow: hidden; }
.jauge i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.jauge-texte { display: flex; justify-content: space-between; font-size: 13px; color: var(--doux); margin-top: 8px; }

/* programme */
.hero { border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre); margin-bottom: 18px; background: var(--accent-pale); }
.hero img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.titre-prog h1 { font-size: 28px; margin-bottom: 4px; }
.titre-prog .sous { color: var(--accent-fonce); font-weight: 600; font-size: 14px; letter-spacing: .04em; margin-bottom: 10px; }
.titre-prog p { color: var(--doux); }
.bloc { border: 1px solid var(--ligne); border-radius: var(--rayon); background: var(--carte); padding: 18px; margin: 18px 0; }
.bloc h3 { font-size: 19px; margin-bottom: 12px; }
.coche { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; background: none; border: 0; padding: 10px 0; color: inherit; border-top: 1px solid var(--ligne); }
.coche:first-of-type { border-top: 0; }
.coche .case { flex: 0 0 24px; height: 24px; border-radius: 8px; border: 2px solid var(--accent); margin-top: 1px; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 700; }
.coche.on .case { background: var(--accent); }
.coche.on .case::before { content: "✓"; }
.coche.on span:last-child { color: var(--doux); text-decoration: line-through; text-decoration-color: var(--ligne); }
.serie { font-size: 13px; color: var(--doux); margin-top: 10px; }
.section-titre { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--doux); margin: 26px 0 10px; }
.module { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: 1px solid var(--ligne); background: var(--carte); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; color: inherit; }
.module .num { flex: 0 0 38px; height: 38px; border-radius: 12px; background: var(--accent-pale); color: var(--accent-fonce); font-weight: 600; display: grid; place-items: center; font-family: Fraunces, serif; }
.module.fait .num { background: var(--accent); color: #fff; }
.module .txt { flex: 1; min-width: 0; }
.module .txt b { display: block; font-weight: 600; line-height: 1.3; }
.module .txt span { display: block; font-size: 14px; color: var(--doux); line-height: 1.4; margin-top: 2px; }
.module .duree { font-size: 12px; color: var(--doux); white-space: nowrap; }

/* leçon */
.lecon h1 { font-size: 28px; margin: 6px 0 8px; }
.lecon .chapo { color: var(--doux); margin-bottom: 22px; }
.lecon h2 { font-size: 21px; margin: 28px 0 12px; }
.lecon ul { padding-left: 20px; margin: 0 0 16px; }
.lecon li { margin-bottom: 8px; }
.lecon li::marker { color: var(--accent); }
.etapes { list-style: none; padding: 0; margin: 0 0 18px; }
.etapes li { position: relative; padding: 0 0 18px 30px; margin: 0; border-left: 2px solid var(--accent-pale); margin-left: 8px; }
.etapes li:last-child { border-left-color: transparent; padding-bottom: 0; }
.etapes li::before { content: ""; position: absolute; left: -8px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 3px solid var(--fond); }
.etapes b { display: block; margin-bottom: 3px; }
.astuce, .attention { border-radius: 16px; padding: 14px 16px; margin: 18px 0; font-size: 15px; }
.astuce { background: var(--accent-pale); }
.attention { background: var(--alerte-pale); color: #5e3a0f; }
.astuce b:first-child, .attention b:first-child { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.recette { border: 1.5px solid var(--accent); border-radius: var(--rayon); background: #fff; padding: 18px; margin: 20px 0; }
.recette h3 { font-size: 20px; margin-bottom: 12px; color: var(--accent-fonce); }
.recette h4 { font: 600 12px/1 Inter, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--doux); margin: 14px 0 8px; }
.recette ol { padding-left: 20px; margin: 0; }
.recette .note { font-size: 14px; color: var(--doux); margin: 12px 0 0; padding-top: 12px; border-top: 1px dashed var(--ligne); }
.table { overflow-x: auto; margin: 0 -16px 18px; padding: 0 16px; }
table { border-collapse: collapse; width: 100%; min-width: 440px; font-size: 14.5px; background: var(--carte); border-radius: 14px; overflow: hidden; }
th, td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--ligne); vertical-align: top; line-height: 1.45; }
th { background: var(--accent-pale); color: var(--accent-fonce); font-weight: 600; font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; }
.pied-lecon { margin-top: 30px; }

.pied { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--ligne); }
.pied p { margin-bottom: 8px; }
.admin { background: #2a2e22; color: #f5f5ec; border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; font-size: 13px; }
.admin label { display: inline-flex; align-items: center; gap: 5px; margin: 6px 12px 0 0; }
@media (min-width: 620px) { .programmes { grid-template-columns: 1fr 1fr; } .salut h1 { font-size: 36px; } }

/* calculadora de porciones (App Shot) */
.calc { border: 1.5px solid var(--accent); border-radius: var(--rayon); background: #fff; padding: 18px; margin: 18px 0; }
.calc .filas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.calc label { display: block; font-size: 13px; font-weight: 600; color: var(--doux); margin-bottom: 6px; }
.calc .res { display: none; margin-top: 16px; }
.calc .res.on { display: block; }
.calc .res li { margin-bottom: 6px; }
.prog { display: flex; flex-direction: column; justify-content: flex-start; }
.prog .corps { flex: 1; display: flex; flex-direction: column; } .prog .corps .jauge { margin-top: auto; }
