/* Charte : celle du code d'Elsass Dico (src/app/globals.css) — or #EFC631 pour l'action,
   rouge du logo #a7070d pour la signature, Azimut pour les titres, Archivo pour le texte.
   Erreurs en vermillon, jamais en rouge de marque : une panne ne doit pas ressembler à la marque.
   Fil conducteur : le « bon à tirer ». Chaque contenu est présenté comme une épreuve
   (repères de coupe autour de la vidéo) que John signe d'un geste : Publier. */

@font-face {
  font-family: 'Azimut';
  src: url('/fonts/Azimut-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --fond: hsl(30 20% 97%);
  --surface: #ffffff;
  --surface-2: hsl(30 18% 94%);
  --texte: hsl(210 11% 15%);
  --texte-2: hsl(20 6% 38%);
  --trait: hsl(30 12% 88%);
  --trait-fort: hsl(20 8% 22%);
  --champ: hsl(210 14% 59%);

  --or: #EFC631;
  --or-survol: hsl(44 84% 50%);
  --or-texte: hsl(40 72% 30%);
  --or-pale: hsl(46 90% 92%);
  --sur-or: hsl(210 11% 13%);
  --rouge: #a7070d;
  --rouge-pale: hsl(356 68% 95%);
  --anneau: hsl(47 86% 38%);

  --succes: hsl(145 45% 31%);
  --succes-pale: hsl(143 39% 91%);
  --attention: hsl(33 73% 30%);
  --attention-pale: hsl(36 70% 90%);
  --erreur: #c2410c;
  --erreur-pale: #fbe6dc;

  --sq: hsl(30 14% 91%);
  --sq-reflet: hsl(30 18% 96%);
  --ombre-carte: 0 1px 2px hsl(20 20% 20% / 0.04), 0 4px 14px hsl(20 20% 20% / 0.05);
  --ombre-barre: 0 -8px 24px hsl(20 20% 15% / 0.08);
  --ombre-epreuve: 0 10px 30px hsl(20 30% 10% / 0.18);

  --r: 8px;
  --r-lg: 14px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-sortie: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #171412;
    --surface: #221e1c;
    --surface-2: #2a2523;
    --texte: #f1eeec;
    --texte-2: #a79d98;
    --trait: #3a3330;
    --trait-fort: #cfc7c3;
    --champ: #7d746f;
    --or-texte: #EFC631;
    --or-pale: hsl(44 40% 16%);
    --rouge: #e0767b;
    --rouge-pale: hsl(356 30% 16%);
    --anneau: #EFC631;
    --succes: #6cc08f;
    --succes-pale: hsl(145 25% 15%);
    --attention: #e8b468;
    --attention-pale: hsl(36 35% 15%);
    --erreur: #ec7a4a;
    --erreur-pale: hsl(18 40% 15%);
    --sq: #2a2523;
    --sq-reflet: #342e2b;
    --ombre-carte: 0 1px 2px rgb(0 0 0 / 0.3);
    --ombre-barre: 0 -8px 24px rgb(0 0 0 / 0.45);
    --ombre-epreuve: 0 10px 30px rgb(0 0 0 / 0.55);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
html { accent-color: var(--anneau); caret-color: var(--rouge); }
::selection { background: var(--or); color: var(--sur-or); }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--anneau); outline-offset: 2px; border-radius: var(--r); }

/* ---- Cadre ---------------------------------------------------------- */

.ecran {
  max-width: 520px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 16px calc(var(--nav-h) + 40px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.ecran-decision { padding-bottom: calc(var(--nav-h) + 132px); }

.entete {
  margin: 0 -16px;
  padding: 8px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-bottom: 1px solid var(--trait);
  background: var(--surface);
}
.entete-haut { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.signature {
  font-family: 'Azimut', Georgia, serif;
  font-size: 19px;
  color: var(--rouge);
  letter-spacing: 0.01em;
  line-height: 1;
}
.titre-ecran {
  font-family: 'Azimut', Georgia, serif;
  font-weight: 400;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.sous-titre { color: var(--texte-2); font-size: 15px; margin-top: -6px; }

.btn-icone {
  width: 44px; height: 44px; margin-right: -10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--r); background: transparent; color: var(--texte-2); cursor: pointer;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}
.btn-icone:hover { background: var(--surface-2); color: var(--texte); }
.btn-icone svg { width: 20px; height: 20px; }

.lien-retour {
  display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin-left: -8px; padding: 0 10px 0 4px;
  color: var(--texte); font-weight: 600; font-size: 15px; text-decoration: none; border-radius: var(--r);
}
.lien-retour:hover { background: var(--surface-2); }
.lien-retour svg { width: 20px; height: 20px; }

.bandeau-demo {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--r);
  background: var(--attention-pale); color: var(--attention);
  font-size: 13px; font-weight: 600;
}
.bandeau-demo::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* ---- Blocs ------------------------------------------------------------ */

.bloc { display: flex; flex-direction: column; gap: 10px; }
.bloc-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; }
.bloc-titre { font-family: 'Azimut', Georgia, serif; font-weight: 400; font-size: 23px; line-height: 1.15; }
.bloc-note { font-size: 13px; color: var(--texte-2); }
.panneau {
  background: var(--surface);
  border: 1px solid var(--trait);
  border-radius: var(--r-lg);
  box-shadow: var(--ombre-carte);
}
.panneau-pad { padding: 16px; display: flex; flex-direction: column; gap: 12px; }

.lignes { display: flex; flex-direction: column; }
.lignes > * + * { border-top: 1px solid var(--trait); }

.petit { font-size: 13px; color: var(--texte-2); }
.fort { font-weight: 600; }
.chiffre { font-variant-numeric: tabular-nums; }

.pastille {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 26px; padding: 0 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--texte-2);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.pastille svg { width: 14px; height: 14px; flex-shrink: 0; }
.pastille.succes { background: var(--succes-pale); color: var(--succes); }
.pastille.attente { background: var(--attention-pale); color: var(--attention); }
.pastille.erreur { background: var(--erreur-pale); color: var(--erreur); }
.pastille.or { background: var(--or); color: var(--sur-or); }
.pastille.neutre { background: var(--surface-2); color: var(--texte-2); }

.vide {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 36px 20px; text-align: center;
  border: 1px dashed var(--trait); border-radius: var(--r-lg);
}
.vide-titre { font-family: 'Azimut', Georgia, serif; font-size: 24px; }
.vide-ligne { color: var(--texte-2); font-size: 14px; max-width: 30ch; }

.erreur-bloc {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r);
  background: var(--erreur-pale); color: var(--erreur);
  font-weight: 600; font-size: 14px; line-height: 1.4;
}
.erreur-bloc svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

/* ---- Boutons et champs ------------------------------------------------ */

.btn {
  min-height: 48px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--r);
  font: 600 15px 'Archivo', system-ui, sans-serif;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform 120ms var(--ease);
}
.btn:active:not(:disabled) { transform: scale(0.985); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn svg { width: 18px; height: 18px; }
.btn-or { background: var(--or); color: var(--sur-or); }
.btn-or:hover:not(:disabled) { background: var(--or-survol); }
.btn-contour { background: var(--surface); color: var(--texte); border-color: var(--trait-fort); }
.btn-contour:hover:not(:disabled) { background: var(--surface-2); }
.btn-discret { background: transparent; color: var(--texte-2); }
.btn-discret:hover:not(:disabled) { background: var(--surface-2); color: var(--texte); }
.btn-plein { width: 100%; }

.lien-action {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 12px;
  border: 1px solid var(--trait); border-radius: 999px;
  background: var(--surface);
  font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}
.lien-action:hover { border-color: var(--trait-fort); }
.lien-action svg { width: 15px; height: 15px; }
.lien-action.or { background: var(--or); border-color: var(--or); color: var(--sur-or); }
.lien-action.or:hover { background: var(--or-survol); border-color: var(--or-survol); }
.actions-ligne { display: flex; gap: 8px; flex-wrap: wrap; }

.champ {
  width: 100%; padding: 12px 14px;
  border-radius: var(--r); border: 1px solid var(--champ);
  background: var(--surface); color: var(--texte);
  font: 16px 'Archivo', system-ui, sans-serif; line-height: 1.4;
}
.champ:focus-visible { outline: 3px solid var(--anneau); outline-offset: 0; border-color: var(--trait-fort); }
.etiquette { font-weight: 600; font-size: 15px; }

.message-action { min-height: 20px; font-size: 14px; font-weight: 600; }
.message-action.erreur { color: var(--erreur); }

/* ---- Navigation ------------------------------------------------------- */

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; justify-content: center;
  background: var(--surface);
  border-top: 1px solid var(--trait);
}
.nav-inner { display: flex; width: 100%; max-width: 520px; }
.lien-nav {
  flex: 1; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--texte-2);
  font-size: 12px; font-weight: 500;
  border-radius: 0;
}
.lien-nav svg { width: 22px; height: 22px; }
.lien-nav[aria-current="page"] { color: var(--rouge); font-weight: 700; }
.lien-nav[aria-current="page"]::before {
  content: ''; position: absolute; top: 0; left: 32%; right: 32%; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--rouge);
}
.badge {
  position: absolute; top: 7px; left: calc(50% + 6px);
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--rouge); color: #fff;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--surface);
}

/* ---- Chargement ------------------------------------------------------- */

.sq {
  border-radius: var(--r-lg);
  background: linear-gradient(90deg, var(--sq) 0%, var(--sq-reflet) 50%, var(--sq) 100%);
  background-size: 200% 100%;
  animation: reflet 1.4s ease-in-out infinite;
}
.sq-a { height: 168px; }
.sq-b { height: 108px; }
.sq-c { height: 72px; }
@keyframes reflet { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---- Connexion -------------------------------------------------------- */

.connexion {
  min-height: 100vh; justify-content: center; padding-bottom: 40px; gap: 28px;
}
.connexion-tete { display: flex; flex-direction: column; gap: 10px; }
.connexion .titre-ecran { font-size: 44px; }

/* ---- À décider ---------------------------------------------------------- */

.liste-decisions { display: flex; flex-direction: column; gap: 12px; }
.carte-contenu {
  display: flex; gap: 14px; padding: 12px;
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-lg);
  box-shadow: var(--ombre-carte);
  text-decoration: none; color: inherit;
  transition: border-color 180ms var(--ease), transform 140ms var(--ease);
}
.carte-contenu:hover { border-color: var(--trait-fort); }
.carte-contenu:active { transform: scale(0.99); }
.vignette {
  width: 74px; height: 132px; flex-shrink: 0;
  border-radius: 8px; object-fit: cover; background: var(--texte);
}
.vignette-vide {
  display: flex; align-items: flex-end; padding: 8px;
  font-family: 'Azimut', Georgia, serif; font-size: 30px; line-height: 1; color: var(--sur-or);
  background: var(--or);
}
.vignette-vide.cuisine { background: var(--rouge); color: #fff; }
.vignette-vide.blog { background: var(--texte); color: var(--fond); }
.carte-corps { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; padding: 2px 0; }
.carte-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.carte-titre { font-weight: 700; font-size: 17px; line-height: 1.3; }
.carte-extrait {
  font-size: 14px; color: var(--texte-2); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.carte-pied { margin-top: auto; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--texte-2); }
.carte-pied svg { width: 14px; height: 14px; }

/* ---- Un contenu : l'épreuve ------------------------------------------- */

.meta-contenu { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: -4px; }

.epreuve {
  position: relative; align-self: center;
  width: min(232px, 64%);
  padding: 12px;
}
/* Repères de coupe aux quatre coins, comme sur une épreuve d'imprimeur. */
.epreuve::before, .epreuve::after, .epreuve > .coins::before, .epreuve > .coins::after {
  content: ''; position: absolute; width: 16px; height: 16px; border-color: var(--texte-2); border-style: solid; opacity: 0.7;
}
.epreuve::before { top: 0; left: 0; border-width: 1.5px 0 0 1.5px; }
.epreuve::after { top: 0; right: 0; border-width: 1.5px 1.5px 0 0; }
.epreuve > .coins::before { bottom: 0; left: 0; border-width: 0 0 1.5px 1.5px; }
.epreuve > .coins::after { bottom: 0; right: 0; border-width: 0 1.5px 1.5px 0; }
.lecteur-video {
  width: 100%; aspect-ratio: 9 / 16;
  border-radius: 10px; overflow: hidden;
  background: hsl(210 11% 13%); color: #f1eeec;
  box-shadow: var(--ombre-epreuve);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  text-align: center; padding: 16px;
}
.lecteur-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.lecteur-video:has(video) { padding: 0; }
.lecteur-video .lecteur-titre { font-family: 'Azimut', Georgia, serif; font-size: 22px; }
.lecteur-video .lecteur-note { font-size: 13px; opacity: 0.75; }
.legende-epreuve { text-align: center; font-size: 12.5px; color: var(--texte-2); margin-top: -10px; letter-spacing: 0.02em; }

.texte-post {
  font-size: 16px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere;
}
.cibles { display: flex; flex-direction: column; gap: 10px; }
.cible { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; }
.cible-icone {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--succes-pale); color: var(--succes);
}
.cible-icone svg { width: 14px; height: 14px; }

.reecrire { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-lg); box-shadow: var(--ombre-carte); }
.reecrire summary {
  min-height: 56px; padding: 0 16px;
  display: flex; align-items: center; gap: 12px;
  font-weight: 600; cursor: pointer; list-style: none; border-radius: var(--r-lg);
}
.reecrire summary::-webkit-details-marker { display: none; }
.reecrire summary svg { width: 20px; height: 20px; color: var(--texte-2); }
.reecrire summary .chevron { margin-left: auto; transition: transform 200ms var(--ease); }
.reecrire[open] summary .chevron { transform: rotate(180deg); }
.reecrire summary .resume-note { font-weight: 400; font-size: 13px; color: var(--texte-2); }
.reecrire-corps { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 16px; }

.barre-decision {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); z-index: 11;
  display: flex; justify-content: center;
  background: var(--surface); border-top: 1px solid var(--trait); box-shadow: var(--ombre-barre);
}
.barre-inner {
  width: 100%; max-width: 520px; padding: 12px 16px;
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
}
.btn-publier { min-height: 56px; font-size: 18px; letter-spacing: 0.01em; }
.confirmer { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; }
.confirmer-titre { font-family: 'Azimut', Georgia, serif; font-size: 24px; line-height: 1.1; }
.confirmer .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.barre-inner > .message-action { grid-column: 1 / -1; min-height: 0; }
.barre-inner > .message-action:empty { display: none; }

/* ---- Choix de la recette (cuisine) ------------------------------------- */

.choix-recettes { border: 0; padding: 0; margin: 0; min-width: 0; }
.choix-recettes legend { padding: 0; margin-bottom: 2px; }
.recette-option {
  position: relative;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px; cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--trait); border-radius: var(--r-lg);
  box-shadow: var(--ombre-carte);
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}
.recette-option:hover { border-color: var(--trait-fort); }
.recette-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.recette-option:has(input:focus-visible) { outline: 3px solid var(--anneau); outline-offset: 2px; }
.recette-option:has(input:checked) { border: 2px solid var(--or); padding: 15px; background: var(--or-pale); }
.recette-corps { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.recette-numero { font-size: 12.5px; font-weight: 600; color: var(--texte-2); text-transform: uppercase; letter-spacing: 0.04em; }
.recette-titre { font-family: 'Azimut', Georgia, serif; font-size: 22px; line-height: 1.15; overflow-wrap: anywhere; }
.recette-sous { font-weight: 600; font-size: 15px; }
.recette-desc { font-size: 14.5px; color: var(--texte-2); line-height: 1.4; }
.recette-etiquettes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.recette-coche {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--trait); color: transparent;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease);
}
.recette-coche svg { width: 16px; height: 16px; }
.recette-option:has(input:checked) .recette-coche { background: var(--or); border-color: var(--or); color: var(--sur-or); }

/* ---- Nouveau modèle IA : essais côte à côte ----------------------------- */

.modele-comparaison { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .modele-comparaison { grid-template-columns: 1fr 1fr; } }
.modele-col {
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
  padding: 14px; background: var(--surface);
  border: 1px solid var(--trait); border-radius: var(--r-lg);
}
.modele-col.nouveau { border: 2px solid var(--or); padding: 13px; background: var(--or-pale); }
.modele-col .recette-titre { font-size: 19px; }
.modele-col .recette-sous { font-size: 13px; font-weight: 400; color: var(--texte-2); overflow-wrap: anywhere; }
.modele-image { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r); margin: 4px 0; background: var(--trait); }
.modele-texte { font-size: 14.5px; max-height: 320px; overflow: auto; margin: 4px 0; }

/* ---- Validation du cours (cuisine) ------------------------------------- */

.controle {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 14px; border-radius: var(--r);
  background: var(--attention-pale); color: var(--attention);
  font-size: 14px; line-height: 1.4;
}
.controle.conforme { background: var(--succes-pale); color: var(--succes); }
.controle-titre { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.controle-titre svg { width: 18px; height: 18px; flex-shrink: 0; }
.controle ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.consigne-precedente { font-size: 14px; color: var(--texte-2); font-style: italic; }
.cours { gap: 18px; }
.cours-section { display: flex; flex-direction: column; gap: 6px; }
.cours-section + .cours-section, .cours-intro + .cours-section { border-top: 1px solid var(--trait); padding-top: 14px; }
.cours-titre { font-family: 'Azimut', Georgia, serif; font-weight: 400; font-size: 20px; line-height: 1.15; }
.cours-texte { white-space: pre-line; font-size: 15.5px; line-height: 1.55; overflow-wrap: anywhere; }
.cours-intro { color: var(--texte-2); }
.sources { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
.sources a { color: var(--texte); overflow-wrap: anywhere; }

.fait {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center; padding: 48px 12px 24px;
}
.fait-icone {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--succes-pale); color: var(--succes);
}
.fait-icone.neutre { background: var(--surface-2); color: var(--texte-2); }
.fait-icone svg { width: 30px; height: 30px; }
.fait-titre { font-family: 'Azimut', Georgia, serif; font-size: 34px; line-height: 1.05; }
.fait-texte { color: var(--texte-2); max-width: 32ch; }
.fait .btn { margin-top: 12px; min-width: 240px; }

/* ---- Publié ------------------------------------------------------------ */

.tableau { display: grid; grid-template-columns: 1fr 1fr; }
.tableau > * { padding: 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tableau > * + * { border-left: 1px solid var(--trait); }
.tableau .budget { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--trait); gap: 8px; }
.valeur { font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.valeur-unite { font-size: 15px; font-weight: 600; color: var(--texte-2); margin-left: 2px; }
.reseau { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--texte-2); font-weight: 600; }
.reseau svg { width: 15px; height: 15px; }
.budget-ligne { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.barre { width: 100%; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.barre-remplie { height: 100%; background: var(--or); border-radius: 999px; }
.barre-remplie.alerte { background: var(--erreur); }
.alerte { color: var(--erreur); font-weight: 600; }

.ligne-pub { display: grid; grid-template-columns: 52px 1fr auto; gap: 4px 12px; padding: 14px 16px; align-items: start; }
.date-bloc {
  grid-row: span 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 52px; height: 56px; border-radius: 10px; background: var(--surface-2);
}
.date-jour { font-family: 'Azimut', Georgia, serif; font-size: 24px; line-height: 1; }
.date-mois { font-size: 11px; font-weight: 700; color: var(--texte-2); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 3px; }
.ligne-pub-titre {
  font-weight: 600; line-height: 1.3; min-width: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ligne-pub-meta { grid-column: 2; font-size: 13px; color: var(--texte-2); line-height: 1.45; }
.ligne-pub-meta svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.ligne-pub-chiffre { grid-column: 3; grid-row: 1 / span 2; text-align: right; }
.ligne-pub-chiffre .valeur { font-size: 20px; }
.ligne-pub-chiffre .petit { display: block; }
.ligne-pub .actions-ligne, .ligne-pub .verdict { grid-column: 2 / -1; margin-top: 6px; }

.ligne-boost { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.ligne-boost-statut { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.ligne-boost-titre { margin: 2px 0 0; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.ligne-boost-detail { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--texte-2); line-height: 1.45; }
.ligne-boost-chiffres { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: var(--texte-2); font-variant-numeric: tabular-nums; }
.ligne-boost-chiffres strong { color: var(--texte); font-weight: 700; }

.a-lancer { border-color: var(--or); box-shadow: 0 0 0 1px var(--or), var(--ombre-carte); }
.a-lancer .groupe { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 6px; }

.themes { padding: 8px 16px 14px; display: flex; flex-direction: column; }
.theme-ligne { display: grid; grid-template-columns: 112px 1fr 28px; align-items: center; gap: 12px; min-height: 40px; }
.theme-nom { font-size: 14px; font-weight: 600; }
.theme-piste { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.theme-plein { height: 100%; border-radius: 999px; background: var(--rouge); }
.theme-n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.theme-ligne.zero .theme-nom, .theme-ligne.zero .theme-n { color: var(--texte-2); font-weight: 500; }
.theme-afaire { font-size: 12px; font-weight: 600; color: var(--attention); }

/* ---- Santé ------------------------------------------------------------- */

.chaine { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.chaine-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chaine-nom { font-weight: 600; }
.historique summary {
  cursor: pointer; font-size: 13.5px; color: var(--texte-2); min-height: 36px;
  display: inline-flex; align-items: center; gap: 4px; list-style: none; border-radius: var(--r);
}
.historique summary::-webkit-details-marker { display: none; }
.historique summary svg { width: 16px; height: 16px; transition: transform 200ms var(--ease); }
.historique[open] summary svg { transform: rotate(180deg); }
.historique-liste { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.historique-ligne { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; }

/* ---- Booster ------------------------------------------------------------ */

.choix { display: flex; flex-direction: column; gap: 8px; }
.choix label {
  display: flex; align-items: flex-start; gap: 12px;
  min-height: 56px; padding: 12px 14px;
  border: 1px solid var(--trait); border-radius: var(--r);
  background: var(--surface); cursor: pointer;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}
.choix label:has(input:checked) { border-color: var(--trait-fort); background: var(--or-pale); }
.choix input { width: 20px; height: 20px; margin: 2px 0 0; flex-shrink: 0; }
.choix-texte { display: flex; flex-direction: column; gap: 2px; }
.choix-texte .fort { font-size: 15px; }
.reglages { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.reglages label { display: flex; flex-direction: column; gap: 6px; }
.reglage-site { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.reglage-site[hidden] { display: none; }
.reglage-campagne { display: flex; flex-direction: column; gap: 12px; }
.reglage-campagne label { display: flex; flex-direction: column; gap: 6px; }
.reglage-campagne label[hidden] { display: none; }
.lien-secours { display: flex; justify-content: flex-end; margin-top: 4px; }

/* ---- Grands écrans --------------------------------------------------------- */

@media (min-width: 720px) {
  .ecran { max-width: 560px; padding-top: 12px; }
  .entete { margin: 0; border: 1px solid var(--trait); border-radius: var(--r-lg); padding: 8px 20px 22px; }
  .titre-ecran { font-size: 42px; }
}

/* ---- Mouvement ------------------------------------------------------------ */

@media (prefers-reduced-motion: no-preference) {
  .ecran > * { animation: monte 360ms var(--ease-sortie) both; }
  .ecran > *:nth-child(2) { animation-delay: 30ms; }
  .ecran > *:nth-child(3) { animation-delay: 60ms; }
  .ecran > *:nth-child(4) { animation-delay: 90ms; }
  .ecran > *:nth-child(n+5) { animation-delay: 120ms; }
  .ecran > .entete { animation: none; }
  .fait-icone { animation: tampon 480ms var(--ease-sortie) both; }
  .confirmer { animation: monte 240ms var(--ease-sortie) both; }
}
@keyframes monte { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes tampon { from { opacity: 0; transform: scale(0.6) rotate(-8deg); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .sq { animation: none; }
  * { transition: none !important; }
}

.visuellement-cache {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---- Publié : un contenu = une ligne, un réseau = une sous-ligne ------------ */

.sous-lignes { grid-column: 2 / -1; display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.sous-ligne {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center;
  padding-top: 10px; border-top: 1px dashed var(--trait);
}
.sous-ligne-reseau { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.sous-ligne-reseau svg { width: 15px; height: 15px; }
.sous-ligne-chiffres { font-size: 13px; color: var(--texte-2); font-variant-numeric: tabular-nums; text-align: right; }
.sous-ligne-chiffres strong { color: var(--texte); }
.sous-ligne .actions-ligne { grid-column: 1 / -1; }
.plus summary {
  list-style: none; cursor: pointer;
  min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--trait); border-radius: var(--r-lg); background: var(--surface);
  font-weight: 600; font-size: 14px; color: var(--texte-2);
}
.plus summary::-webkit-details-marker { display: none; }
.plus summary svg { width: 16px; height: 16px; transition: transform 200ms var(--ease); }
.plus[open] summary { margin-bottom: 10px; }
.plus[open] summary svg { transform: rotate(180deg); }

/* ---- Notifications sur le téléphone ------------------------------------------ */

.encart-push { display: flex; gap: 14px; padding: 16px; align-items: flex-start; }
.encart-icone {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--or-pale); color: var(--or-texte);
}
.encart-icone.ok { background: var(--succes-pale); color: var(--succes); }
.encart-icone svg { width: 20px; height: 20px; }
.encart-corps { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.encart-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.encart-push .message-action:empty, .chaine .message-action:empty { display: none; }
