/* Sarya : feuille de style.
   Forêt (#12362b) pour la structure, latérite (#c2501f) pour l'accent, neutres chauds.
   Funnel Display pour les titres et les chiffres, Funnel Sans pour l'interface, Newsreader pour lire la loi. */

@font-face { font-family: "Funnel Sans"; src: url("fonts/funnel-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 300 800; font-display: swap; }
@font-face { font-family: "Funnel Sans"; src: url("fonts/funnel-sans-latin-wght-italic.woff2") format("woff2"); font-weight: 300 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Funnel Display"; src: url("fonts/funnel-display-latin-wght-normal.woff2") format("woff2"); font-weight: 300 800; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader-latin-opsz-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader-latin-opsz-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --f-ui: "Funnel Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-titre: "Funnel Display", "Funnel Sans", system-ui, sans-serif;
  --f-lecture: "Newsreader", Georgia, "Times New Roman", serif;
  --f-mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --toile: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --surface-3: #f0eee8;
  --trait: #e8e5dd;
  --trait-fort: #d5d1c6;
  --encre: #13201b;
  --encre-2: #3f4b46;
  --encre-3: #6b7671;
  --encre-4: #9ca49f;

  --foret: #12362b;
  --foret-2: #1c4a3b;
  --foret-3: #2c6551;
  --foret-teinte: #e5eee9;
  --foret-teinte-2: #cfe0d7;
  --laterite: #c2501f;
  --laterite-2: #a7421a;
  --laterite-teinte: #fbebe2;

  --ok: #1d7448; --ok-teinte: #e2f2e8;
  --veille: #9a6200; --veille-teinte: #fbf0d9;
  --alerte: #bd3326; --alerte-teinte: #fbe7e4;
  --info: #2d5d86; --info-teinte: #e5eef7;

  --barre-fond: #10302a;
  --barre-encre: #d8e2dc;
  --barre-encre-2: #8fa69c;
  --barre-survol: rgba(255, 255, 255, .06);
  --barre-actif: rgba(255, 255, 255, .11);

  --wa-fond: #efeae2;
  --wa-moi: #d9fdd3;
  --wa-lui: #ffffff;

  --r-p: 6px;
  --r: 10px;
  --r-g: 16px;
  --o-1: 0 1px 2px rgba(19, 32, 27, .05);
  --o-2: 0 1px 2px rgba(19, 32, 27, .04), 0 6px 20px -8px rgba(19, 32, 27, .12);
  --o-pop: 0 2px 6px rgba(19, 32, 27, .08), 0 24px 48px -16px rgba(19, 32, 27, .30);
  --entete-h: 64px;
  --nav-bas-h: 0px;
  color-scheme: light;
}

[data-theme="sombre"] {
  --toile: #0c1512;
  --surface: #121d19;
  --surface-2: #15221d;
  --surface-3: #1a2a24;
  --trait: #22342d;
  --trait-fort: #2f463d;
  --encre: #e8ede9;
  --encre-2: #b9c5bf;
  --encre-3: #8b9993;
  --encre-4: #5f6f68;
  --foret: #3f8a6c;
  --foret-2: #4d9c7c;
  --foret-3: #6bb595;
  --foret-teinte: #17302a;
  --foret-teinte-2: #1f4137;
  --laterite: #e2703f;
  --laterite-2: #ee8352;
  --laterite-teinte: #33201a;
  --ok: #5cc28e; --ok-teinte: #15302a;
  --veille: #e2ae4c; --veille-teinte: #302816;
  --alerte: #f0806f; --alerte-teinte: #351c1a;
  --info: #7fb2e0; --info-teinte: #172838;
  --barre-fond: #0a1310;
  --barre-encre: #d6e0db;
  --barre-encre-2: #7d9188;
  --wa-fond: #0b141a;
  --wa-moi: #134d37;
  --wa-lui: #1f2c34;
  --o-1: 0 1px 2px rgba(0, 0, 0, .3);
  --o-2: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -10px rgba(0, 0, 0, .5);
  --o-pop: 0 24px 60px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-family: var(--f-ui); font-size: 14.5px; line-height: 1.5; color: var(--encre); background: var(--toile); -webkit-font-smoothing: antialiased; font-feature-settings: "ss01" 0; }
[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--laterite); }
p { margin: 0 0 12px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--laterite-teinte); color: var(--encre); }
:focus-visible { outline: 2px solid var(--laterite); outline-offset: 2px; border-radius: 4px; }

.ic { width: 18px; height: 18px; flex: none; fill: currentColor; display: inline-block; vertical-align: -3px; }
.ic.p { width: 15px; height: 15px; vertical-align: -2px; }
.ic.g { width: 22px; height: 22px; }
.mono { font-family: var(--f-mono); font-size: .9em; letter-spacing: -.01em; }
.chiffre { font-family: var(--f-titre); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.discret { color: var(--encre-3); }
.petit { font-size: 12.5px; }
.tres-petit { font-size: 11.5px; }
.gras { font-weight: 600; }
.droite { text-align: right; }
.centre { text-align: center; }
.tronque { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lignes-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lignes-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pile { display: flex; flex-direction: column; gap: 16px; }
.rang { display: flex; align-items: center; gap: 10px; }
.rang.entre { justify-content: space-between; }
.rang.haut { align-items: flex-start; }
.rang.envelopper { flex-wrap: wrap; }
.etire { flex: 1; min-width: 0; }
.ordi-seul { }
.tel-seul { display: none !important; }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 9px; color: inherit; }
.logo-signe { height: 1.45em; width: auto; color: var(--laterite); fill: currentColor; }
.grand-signe { fill: currentColor; }
.couverture .logo-signe { width: 11px; }
.couverture.p .logo-signe { width: 8px; }
.logo-nom { font-family: var(--f-titre); font-weight: 600; font-size: 1.32em; letter-spacing: -.025em; line-height: 1; }

/* ============ Coquille de l'administration ============ */
.coquille { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100dvh; }
.barre { position: sticky; top: 0; height: 100dvh; background: var(--barre-fond); color: var(--barre-encre); display: flex; flex-direction: column; z-index: 40; }
.barre .marque { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 14px 20px; color: #fff; font-size: 15px; }
.barre .marque:hover { color: #fff; }
.barre .marque .logo-signe { color: #ec8152; }
.barre .marque-sous { font-size: 11px; color: var(--barre-encre-2); border: 1px solid rgba(255,255,255,.12); padding: 2px 7px; border-radius: 20px; letter-spacing: .02em; }
.barre .chercher-nav { margin: 4px 14px 10px; display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 10px; border-radius: 8px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.07); color: var(--barre-encre-2); cursor: pointer; width: calc(100% - 28px); text-align: left; font-size: 13.5px; }
.barre .chercher-nav:hover { background: rgba(255,255,255,.09); color: var(--barre-encre); }
.barre .chercher-nav kbd { margin-left: auto; }
kbd { font-family: var(--f-mono); font-size: 10.5px; padding: 1px 5px; border-radius: 4px; border: 1px solid currentColor; opacity: .7; line-height: 1.5; }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.nav-groupe { margin-bottom: 14px; }
.nav-titre { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--barre-encre-2); padding: 8px 10px 6px; opacity: .85; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 8px; color: var(--barre-encre); font-size: 14px; font-weight: 450; }
.nav a .ic { opacity: .75; }
.nav a:hover { background: var(--barre-survol); color: #fff; }
.nav a.actif { background: var(--barre-actif); color: #fff; font-weight: 550; }
.nav a.actif .ic { opacity: 1; color: #ec8152; }
.nav .compte { margin-left: auto; font-size: 11.5px; font-weight: 600; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.12); color: #fff; }
.nav .compte.signal { background: #c2501f; }
.barre .pied { border-top: 1px solid rgba(255,255,255,.08); padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; background: var(--foret-teinte); color: var(--foret); letter-spacing: .02em; }
.barre .avatar { background: #2c6551; color: #fff; }
.barre .pied .qui { min-width: 0; flex: 1; line-height: 1.25; }
.barre .pied .qui b { display: block; font-weight: 550; font-size: 13.5px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barre .pied .qui span { font-size: 12px; color: var(--barre-encre-2); }
.barre .pied button { background: none; border: 0; color: var(--barre-encre-2); cursor: pointer; padding: 6px; border-radius: 6px; }
.barre .pied button:hover { background: var(--barre-survol); color: #fff; }

.zone-principale { min-width: 0; display: flex; flex-direction: column; }
.entete { position: sticky; top: 0; z-index: 30; height: var(--entete-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px; background: color-mix(in srgb, var(--toile) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--trait); }
.entete .titres { min-width: 0; }
.entete h1 { font-family: var(--f-titre); font-size: 21px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fil { font-size: 12.5px; color: var(--encre-3); display: flex; gap: 6px; align-items: center; margin-bottom: 1px; }
.fil a:hover { color: var(--encre); }
.entete .actions { display: flex; gap: 8px; align-items: center; flex: none; }
.contenu { padding: 24px 28px 32px; flex: 1; min-width: 0; }
.contenu.ajuste { flex: none; height: calc(100dvh - var(--entete-h) - var(--nav-bas-h)); overflow: hidden; display: flex; flex-direction: column; padding-bottom: 20px; }
.contenu.plein { flex: none; padding: 0; height: calc(100dvh - var(--entete-h) - var(--nav-bas-h)); overflow: hidden; }
.ecran { display: flex; flex-direction: column; gap: 18px; min-height: 0; flex: 1; }
.remplir { flex: 1; min-height: 0; }
.defile { overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--trait-fort) transparent; }
.intro-page { color: var(--encre-3); margin: -6px 0 18px; max-width: 760px; }

/* Barre du bas sur téléphone */
.nav-bas { display: none; }

/* ============ Surfaces ============ */
.panneau { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-g); box-shadow: var(--o-1); min-width: 0; display: flex; flex-direction: column; }
.panneau > .tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; min-height: 50px; }
.panneau > .tete.trait { padding-bottom: 14px; border-bottom: 1px solid var(--trait); }
.panneau > .tete h2 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.panneau > .tete h2 .ic { color: var(--encre-3); }
.panneau > .tete .sous-titre { font-size: 12.5px; color: var(--encre-3); font-weight: 400; margin-top: 2px; }
.panneau > .corps { padding: 16px 20px 20px; min-height: 0; }
.panneau > .corps.serre { padding: 6px 0 8px; }
.panneau > .corps.plat { padding: 0; }
.panneau.remplir > .corps { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--trait-fort) transparent; }
.panneau > .pied-panneau { border-top: 1px solid var(--trait); padding: 12px 20px; display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); border-radius: 0 0 var(--r-g) var(--r-g); }
.encart { background: var(--surface-2); border: 1px solid var(--trait); border-radius: var(--r); padding: 14px 16px; }
.encart.foret { background: var(--foret-teinte); border-color: var(--foret-teinte-2); }
.encart.laterite { background: var(--laterite-teinte); border-color: color-mix(in srgb, var(--laterite) 22%, transparent); }

.grille { display: grid; gap: 18px; min-height: 0; }
.grille > * { min-height: 0; }
.grille.remplir, .grille.hauteur { grid-template-rows: minmax(0, 1fr); }
.contenu.ajuste > .ecran > *, .contenu.ajuste > .grille, .contenu.ajuste > .essai { min-height: 0; }
.contenu.ajuste > .grille, .contenu.ajuste > .essai { flex: 1; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.g-3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.g-lat { grid-template-columns: minmax(0, 1fr) 340px; }

/* Indicateurs */
.kpis { display: grid; grid-template-columns: 1.35fr repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-g); box-shadow: var(--o-1); overflow: hidden; }
.kpi { padding: 18px 20px 16px; border-left: 1px solid var(--trait); min-width: 0; position: relative; }
.kpi:first-child { border-left: 0; background: var(--foret); color: #eef4f0; }
.kpi .lib { font-size: 12.5px; color: var(--encre-3); display: flex; align-items: center; gap: 6px; }
.kpi:first-child .lib { color: #a9c3b7; }
.kpi .val { font-family: var(--f-titre); font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; margin-top: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .val small { font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--encre-3); margin-left: 4px; }
.kpi:first-child .val small { color: #a9c3b7; }
.kpi .evo { font-size: 12px; margin-top: 4px; display: flex; gap: 4px; align-items: center; color: var(--encre-3); white-space: nowrap; }
.kpi .evo.hausse { color: var(--ok); }
.kpi .evo.baisse { color: var(--alerte); }
.kpi:first-child .evo { color: #a9c3b7; }
.kpi:first-child .evo.hausse { color: #8fe0b4; }
.kpi .mini { position: absolute; right: 16px; bottom: 16px; width: 96px; height: 34px; }
.kpi .mini path.l { fill: none; stroke: #ec8152; stroke-width: 1.8; }
.kpi .mini path.a { fill: rgba(236, 129, 82, .16); }

/* Graphiques dessinés en SVG */
.graphe { width: 100%; height: 100%; overflow: visible; }
.graphe .grille-l { stroke: var(--trait); stroke-width: 1; shape-rendering: crispEdges; }
.graphe .axe { font-size: 12.5px; fill: var(--encre-4); font-family: var(--f-ui); }
.graphe .barre-g { fill: var(--foret-teinte-2); }
.graphe .barre-g.fin-semaine { fill: var(--foret-teinte); }
.graphe .barre-g.jour { fill: var(--laterite); }
.graphe .barre-g:hover { fill: var(--foret-3); }
.graphe .ligne-g { fill: none; stroke: var(--foret); stroke-width: 2; stroke-linejoin: round; }
.graphe .aire-g { fill: var(--foret); opacity: .08; }
.graphe .point-g { fill: var(--surface); stroke: var(--foret); stroke-width: 2; }
.legende { display: flex; gap: 16px; font-size: 12px; color: var(--encre-3); }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.graphe-boite { position: relative; }
.bulle-info { position: absolute; pointer-events: none; background: var(--encre); color: var(--surface); font-size: 12px; padding: 5px 8px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -110%); box-shadow: var(--o-2); z-index: 5; }

.entonnoir { display: flex; flex-direction: column; gap: 10px; }
.entonnoir .etage { display: grid; grid-template-columns: 150px 1fr 70px; gap: 12px; align-items: center; font-size: 13px; }
.entonnoir .piste { height: 26px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.entonnoir .piste span { display: block; height: 100%; background: var(--foret); border-radius: 6px; min-width: 2px; }
.entonnoir .etage:last-child .piste span { background: var(--laterite); }
.entonnoir .taux { font-size: 12px; color: var(--encre-3); text-align: right; font-variant-numeric: tabular-nums; }

.barres-h { display: flex; flex-direction: column; gap: 12px; }
.barres-h li { list-style: none; }
.barres-h .haut { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 5px; }
.barres-h .jauge { height: 6px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.barres-h .jauge span { display: block; height: 100%; background: var(--foret-3); border-radius: 4px; }
.barres-h li:first-child .jauge span { background: var(--laterite); }
ul.barres-h { margin: 0; padding: 0; }

/* Listes et tableaux */
.registre { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.registre th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--encre-3); padding: 10px 14px; border-bottom: 1px solid var(--trait); white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
.registre th:first-child { padding-left: 20px; }
.registre th:last-child { padding-right: 20px; }
.registre td { padding: 12px 14px; border-bottom: 1px solid var(--trait); vertical-align: middle; }
.registre td:first-child { padding-left: 20px; }
.registre td:last-child { padding-right: 20px; }
.registre tbody tr:last-child td { border-bottom: 0; }
.registre tbody tr:hover td { background: var(--surface-2); }
.registre tr.cliquable { cursor: pointer; }
.registre .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.registre .titre-ligne { font-weight: 550; color: var(--encre); }
.registre .sous { font-size: 12.5px; color: var(--encre-3); margin-top: 1px; }
.registre .actions-ligne { text-align: right; white-space: nowrap; }
.table-boite { overflow: auto; min-height: 0; flex: 1; scrollbar-width: thin; scrollbar-color: var(--trait-fort) transparent; border-radius: 0 0 var(--r-g) var(--r-g); }

.liste-lignes { display: flex; flex-direction: column; }
.ligne { display: flex; gap: 12px; align-items: flex-start; padding: 12px 20px; border-bottom: 1px solid var(--trait); }
.ligne:last-child { border-bottom: 0; }
a.ligne:hover, .ligne.cliquable:hover { background: var(--surface-2); color: inherit; }
.ligne .corps-ligne { flex: 1; min-width: 0; }
.ligne .titre-l { font-weight: 550; font-size: 14px; }
.ligne .texte-l { color: var(--encre-2); font-size: 13.5px; margin-top: 2px; }
.ligne .meta-l { font-size: 12px; color: var(--encre-3); margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.puce-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--encre-2); }
.puce-ic.foret { background: var(--foret-teinte); color: var(--foret); }
.puce-ic.laterite { background: var(--laterite-teinte); color: var(--laterite); }

.etat { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 550; padding: 2px 8px; border-radius: 20px; white-space: nowrap; line-height: 1.6; background: var(--surface-3); color: var(--encre-2); }
.etat.ok { background: var(--ok-teinte); color: var(--ok); }
.etat.veille { background: var(--veille-teinte); color: var(--veille); }
.etat.alerte { background: var(--alerte-teinte); color: var(--alerte); }
.etat.info { background: var(--info-teinte); color: var(--info); }
.etat.accent { background: var(--laterite-teinte); color: var(--laterite); }
.etat.foret { background: var(--foret-teinte); color: var(--foret); }
.etat.neutre { background: var(--surface-3); color: var(--encre-3); }
.etiquette { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 5px; border: 1px solid var(--trait); color: var(--encre-2); background: var(--surface); white-space: nowrap; }

.vide { padding: 36px 24px; text-align: center; color: var(--encre-3); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.vide .ic { width: 30px; height: 30px; color: var(--encre-4); }
.vide b { color: var(--encre); font-weight: 600; font-size: 15px; }
.vide p { margin: 0; max-width: 360px; font-size: 13.5px; }

/* Boutons */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--trait-fort); background: var(--surface); color: var(--encre); font-size: 13.5px; font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s, transform .06s; box-shadow: 0 1px 1px rgba(19, 32, 27, .04); }
.bouton:hover { background: var(--surface-2); border-color: var(--encre-4); color: var(--encre); }
.bouton:active { transform: translateY(1px); }
.bouton.principal { background: var(--foret); border-color: var(--foret); color: #fff; box-shadow: 0 1px 2px rgba(18, 54, 43, .25), inset 0 1px 0 rgba(255, 255, 255, .08); }
.bouton.principal:hover { background: var(--foret-2); border-color: var(--foret-2); color: #fff; }
[data-theme="sombre"] .bouton.principal { color: #06120d; }
.bouton.accent { background: var(--laterite); border-color: var(--laterite); color: #fff; }
.bouton.accent:hover { background: var(--laterite-2); border-color: var(--laterite-2); color: #fff; }
.bouton.fantome { background: transparent; border-color: transparent; box-shadow: none; color: var(--encre-2); }
.bouton.fantome:hover { background: var(--surface-3); color: var(--encre); }
.bouton.danger { color: var(--alerte); }
.bouton.danger:hover { background: var(--alerte-teinte); border-color: color-mix(in srgb, var(--alerte) 35%, transparent); color: var(--alerte); }
.bouton.petit { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; gap: 6px; }
.bouton.grand { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 11px; }
.bouton.carre { width: 36px; padding: 0; }
.bouton.petit.carre { width: 30px; }
.bouton.occupe { position: relative; color: transparent !important; pointer-events: none; }
.bouton.occupe::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--encre-3) transparent var(--encre-3) transparent; animation: tourne .7s linear infinite; }
.bouton.principal.occupe::after, .bouton.accent.occupe::after { border-color: #fff transparent #fff transparent; }
@keyframes tourne { to { transform: rotate(360deg); } }
.lien { color: var(--laterite); font-weight: 550; font-size: 13.5px; display: inline-flex; gap: 4px; align-items: center; }
.lien:hover { color: var(--laterite-2); text-decoration: underline; text-underline-offset: 3px; }
.lien-bouton { background: none; border: 0; padding: 0; cursor: pointer; color: var(--laterite); font-weight: 550; }
.rangee-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.rangee-actions.gauche { justify-content: flex-start; }

/* Formulaires */
.champ { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.champ > label, .champ > .lib { font-size: 13px; font-weight: 550; color: var(--encre-2); }
.champ .aide { font-size: 12.5px; color: var(--encre-3); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=url], input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--trait-fort); background: var(--surface); color: var(--encre); font-size: 14.5px; transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%236b7671' d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; background-size: 14px; }
select[multiple] { height: auto; padding: 6px; background-image: none; }
input:hover, select:hover, textarea:hover { border-color: var(--encre-4); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--foret-3); box-shadow: 0 0 0 3px color-mix(in srgb, var(--foret-3) 18%, transparent); }
input::placeholder, textarea::placeholder { color: var(--encre-4); }
input[type=file] { font-size: 13px; }
.champ.erreur input, .champ.erreur select, .champ.erreur textarea { border-color: var(--alerte); box-shadow: 0 0 0 3px color-mix(in srgb, var(--alerte) 14%, transparent); }
.msg-erreur { font-size: 12.5px; color: var(--alerte); font-weight: 550; }
.champs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.champs.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.champs .large { grid-column: 1 / -1; }
.case { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; padding: 4px 0; }
.case input { margin-top: 3px; accent-color: var(--foret); width: 16px; height: 16px; flex: none; }
.cases { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.choix-pastilles { display: flex; flex-wrap: wrap; gap: 6px; }
.choix-pastilles label { position: relative; }
.choix-pastilles input { position: absolute; opacity: 0; pointer-events: none; }
.choix-pastilles span { display: inline-block; padding: 5px 11px; border-radius: 20px; border: 1px solid var(--trait-fort); font-size: 13px; cursor: pointer; background: var(--surface); }
.choix-pastilles input:checked + span { background: var(--foret); border-color: var(--foret); color: #fff; }
.interrupteur { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--trait); cursor: pointer; }
.interrupteur:last-child { border-bottom: 0; }
.interrupteur input { appearance: none; width: 38px; height: 22px; border-radius: 11px; background: var(--trait-fort); position: relative; cursor: pointer; flex: none; transition: background .15s; margin: 0; }
.interrupteur input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.interrupteur input:checked { background: var(--foret); }
.interrupteur input:checked::after { transform: translateX(16px); }
.interrupteur .t b { display: block; font-weight: 550; font-size: 14px; }
.interrupteur .t span { font-size: 12.5px; color: var(--encre-3); }
.lecture-seule { background: var(--surface-2); border: 1px solid var(--trait); border-radius: 9px; padding: 10px 12px; white-space: pre-wrap; font-size: 14px; color: var(--encre-2); max-height: 220px; overflow: auto; }
.bloc-modifiable .tete-bloc { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.recherche { position: relative; }
.recherche .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--encre-4); pointer-events: none; }
.recherche input { padding-left: 36px; }
.barre-outils { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.barre-outils .recherche { flex: 1; min-width: 200px; max-width: 420px; }
.barre-outils select { width: auto; min-width: 150px; }

.depot { border: 1.5px dashed var(--trait-fort); border-radius: var(--r-g); padding: 30px 20px; text-align: center; cursor: pointer; background: var(--surface-2); transition: background .15s, border-color .15s; }
.depot:hover, .depot.survol { border-color: var(--foret-3); background: var(--foret-teinte); }
.depot .ic { width: 30px; height: 30px; margin: 0 auto 8px; color: var(--foret-3); }
.depot b { display: block; font-weight: 600; }
.depot span { font-size: 13px; color: var(--encre-3); }

.onglets { display: flex; gap: 2px; border-bottom: 1px solid var(--trait); overflow-x: auto; scrollbar-width: none; flex: none; }
.onglets a { padding: 10px 14px; font-size: 14px; font-weight: 500; color: var(--encre-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 7px; align-items: center; }
.onglets a:hover { color: var(--encre); }
.onglets a.actif { color: var(--encre); border-bottom-color: var(--laterite); font-weight: 600; }
.onglets .n { font-size: 11.5px; background: var(--surface-3); border-radius: 10px; padding: 0 6px; color: var(--encre-3); }
.segments { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; }
.segments a, .segments button { border: 0; background: none; padding: 4px 11px; border-radius: 7px; font-size: 13px; color: var(--encre-3); cursor: pointer; font-weight: 500; }
.segments .actif { background: var(--surface); color: var(--encre); box-shadow: var(--o-1); }

/* Définitions */
.defs { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.defs dt { color: var(--encre-3); }
.defs dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Avis et messages flottants */
.avis { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); font-size: 14px; border: 1px solid; margin-bottom: 16px; }
.avis.ok { background: var(--ok-teinte); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 20%, transparent); }
.avis.erreur { background: var(--alerte-teinte); color: var(--alerte); border-color: color-mix(in srgb, var(--alerte) 20%, transparent); }
.avis.veille { background: var(--veille-teinte); color: var(--veille); border-color: color-mix(in srgb, var(--veille) 20%, transparent); }
.avis.info { background: var(--info-teinte); color: var(--info); border-color: color-mix(in srgb, var(--info) 20%, transparent); }
.avis.toast { position: fixed; bottom: calc(22px + var(--nav-bas-h)); left: 50%; transform: translateX(-50%); z-index: 90; margin: 0; max-width: min(560px, calc(100vw - 32px)); background: var(--encre); color: var(--surface); border: 0; box-shadow: var(--o-pop); font-weight: 500; animation: monte .22s ease-out; }
.avis.toast.erreur { background: var(--alerte); color: #fff; }
.avis.toast.veille { background: #6d4600; color: #fff; }
@keyframes monte { from { opacity: 0; transform: translate(-50%, 8px); } }

.progression { display: none; margin: 14px 0 0; }
.progression.visible { display: block; }
.progression .piste { height: 8px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progression .remplissage { height: 100%; width: 0; background: linear-gradient(90deg, var(--foret), var(--foret-3)); border-radius: 6px; transition: width .2s; }
.progression .texte { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--encre-3); margin-top: 6px; }
.progression .pourcent { font-family: var(--f-titre); font-weight: 600; color: var(--encre); font-variant-numeric: tabular-nums; }
.progression-flottante { position: fixed; z-index: 95; right: 20px; bottom: calc(20px + var(--nav-bas-h)); width: 340px; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--o-pop); margin: 0; }

/* Fenêtres */
.voile { position: fixed; inset: 0; z-index: 80; background: rgba(10, 20, 16, .45); backdrop-filter: blur(2px); display: grid; place-items: start center; padding: 12vh 16px 16px; animation: apparait .14s ease-out; }
@keyframes apparait { from { opacity: 0; } }
.modale { width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--r-g); box-shadow: var(--o-pop); border: 1px solid var(--trait); padding: 22px; }
.modale h3 { font-size: 17px; margin-bottom: 6px; font-family: var(--f-titre); }
.modale p { color: var(--encre-2); margin-bottom: 0; }

.palette { width: 100%; max-width: 620px; background: var(--surface); border-radius: var(--r-g); box-shadow: var(--o-pop); border: 1px solid var(--trait); overflow: hidden; }
.palette .saisie { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--trait); }
.palette .saisie input { border: 0; box-shadow: none; height: 54px; font-size: 16px; padding: 0; background: transparent; }
.palette .saisie .ic { color: var(--encre-3); }
.palette .resultats { max-height: 52vh; overflow-y: auto; padding: 6px; }
.palette .groupe { font-size: 11.5px; font-weight: 600; color: var(--encre-3); padding: 10px 10px 4px; text-transform: uppercase; letter-spacing: .05em; }
.palette .res { display: flex; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--encre); }
.palette .res .ic { color: var(--encre-3); }
.palette .res .t { flex: 1; min-width: 0; }
.palette .res .t b { font-weight: 550; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette .res .t span { font-size: 12.5px; color: var(--encre-3); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette .res.choisi { background: var(--foret-teinte); }
.palette .res.choisi .ic { color: var(--foret); }
.palette .pied-palette { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--trait); font-size: 12px; color: var(--encre-3); background: var(--surface-2); }

/* ============ Conversations ============ */
.messagerie { display: grid; grid-template-columns: 320px minmax(0, 1fr) 300px; height: 100%; min-height: 0; }
.messagerie > * { min-height: 0; }
.mess-liste { border-right: 1px solid var(--trait); display: flex; flex-direction: column; background: var(--surface); }
.mess-liste .filtres { padding: 14px 14px 10px; border-bottom: 1px solid var(--trait); display: flex; flex-direction: column; gap: 10px; }
.mess-liste .items { flex: 1; overflow-y: auto; scrollbar-width: thin; }
.mess-item { display: flex; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--trait); color: var(--encre); }
.mess-item:hover { background: var(--surface-2); color: var(--encre); }
.mess-item.actif { background: var(--foret-teinte); }
.mess-item .corps-ligne { flex: 1; min-width: 0; }
.mess-item .nom { display: flex; justify-content: space-between; gap: 8px; font-weight: 550; font-size: 14px; }
.mess-item .nom time { font-weight: 400; font-size: 11.5px; color: var(--encre-3); flex: none; }
.mess-item .apercu { font-size: 13px; color: var(--encre-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.mess-fil { display: flex; flex-direction: column; background: var(--wa-fond); min-width: 0; }
.mess-fil .tete-fil { display: flex; align-items: center; gap: 12px; padding: 10px 18px; background: var(--surface); border-bottom: 1px solid var(--trait); min-height: 62px; }
.fil-messages { flex: 1; overflow-y: auto; padding: 18px 6% 12px; display: flex; flex-direction: column; gap: 4px; scrollbar-width: thin; }
.mess-fil form.reponse { display: flex; gap: 10px; padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--trait); align-items: flex-end; }
.mess-fil form.reponse textarea { min-height: 44px; height: 44px; max-height: 140px; resize: none; border-radius: 22px; padding: 11px 16px; }
.mess-info { border-left: 1px solid var(--trait); overflow-y: auto; background: var(--surface); padding: 20px; }
.mess-info h3 { font-size: 13px; color: var(--encre-3); font-weight: 600; margin: 18px 0 8px; }
.mess-info h3:first-child { margin-top: 0; }

.bulle { max-width: 72%; padding: 7px 10px 6px; border-radius: 10px; background: var(--wa-lui); font-size: 14px; line-height: 1.45; box-shadow: 0 1px 1px rgba(0,0,0,.08); align-self: flex-start; overflow-wrap: anywhere; position: relative; color: var(--encre); }
.bulle.sortant { align-self: flex-end; background: var(--wa-moi); }
.bulle + .bulle.sortant, .bulle.sortant + .bulle:not(.sortant) { margin-top: 6px; }
.bulle .meta { font-size: 11px; color: var(--encre-3); text-align: right; margin-top: 2px; font-family: var(--f-ui); }
.bulle a { color: #0b7bba; word-break: break-all; }
[data-theme="sombre"] .bulle a { color: #53bdeb; }
.bulle .boutons-wa { display: flex; flex-direction: column; margin: 8px -10px -6px; border-top: 1px solid rgba(0,0,0,.08); }
.bulle .boutons-wa > span, .bulle .boutons-wa > button { display: block; text-align: center; padding: 8px; color: #0b7bba; font-weight: 550; font-size: 14px; border: 0; border-top: 1px solid rgba(0,0,0,.06); background: none; cursor: default; }
.bulle .boutons-wa > :first-child { border-top: 0; }
.bulle .boutons-wa > button { cursor: pointer; }
.bulle .boutons-wa > button:hover { background: rgba(0,0,0,.03); }
[data-theme="sombre"] .bulle .boutons-wa > span, [data-theme="sombre"] .bulle .boutons-wa > button { color: #53bdeb; border-color: rgba(255,255,255,.06); }
.bulle .liste-wa { margin: 8px -10px -6px; border-top: 1px solid rgba(0,0,0,.08); }
.bulle .liste-wa .sect { font-size: 12px; color: #0b7a5e; font-weight: 600; padding: 8px 12px 2px; }
.bulle .liste-wa button, .bulle .liste-wa span.ligne-wa { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 12px; cursor: pointer; font-size: 14px; }
.bulle .liste-wa button:hover { background: rgba(0,0,0,.03); }
.bulle .liste-wa small { display: block; color: var(--encre-3); font-size: 12.5px; }
.bulle .document { display: flex; gap: 10px; align-items: center; padding: 8px; background: rgba(0,0,0,.04); border-radius: 8px; margin-bottom: 4px; }
.jour-sep { align-self: center; font-size: 12px; background: var(--surface); color: var(--encre-3); padding: 3px 10px; border-radius: 8px; margin: 10px 0; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.ecrit { align-self: flex-start; background: var(--wa-lui); border-radius: 10px; padding: 10px 14px; display: flex; gap: 4px; }
.ecrit i { width: 6px; height: 6px; border-radius: 50%; background: var(--encre-4); animation: saute 1s infinite; }
.ecrit i:nth-child(2) { animation-delay: .15s; }
.ecrit i:nth-child(3) { animation-delay: .3s; }
@keyframes saute { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-3px); opacity: 1; } }

/* Essai du bot */
.essai { display: grid; grid-template-columns: minmax(0, 1fr) 400px; grid-template-rows: minmax(0, 1fr); gap: 22px; min-height: 0; flex: 1; }
.essai > * { min-height: 0; }
.appareil .ecran-app .fil-messages { flex: 1; min-height: 0; }
.appareil { border-radius: 28px; background: #0f1714; padding: 8px; box-shadow: var(--o-2); display: flex; min-height: 0; }
.appareil .ecran-app { flex: 1; border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; background: var(--wa-fond); min-height: 0; }
.appareil .barre-app { background: #12362b; color: #fff; padding: 12px 14px; display: flex; gap: 10px; align-items: center; }
.appareil .barre-app .rond { width: 36px; height: 36px; border-radius: 50%; background: #c2501f; display: grid; place-items: center; }
.appareil .barre-app .rond .logo-signe { color: #fff; height: 20px; }
.appareil .barre-app b { display: block; font-weight: 600; font-size: 15px; }
.appareil .barre-app span { font-size: 12px; color: #a9c3b7; }
.appareil .fil-messages { padding: 14px 12px; }
.appareil .bulle { max-width: 86%; }
.appareil form { display: flex; gap: 8px; padding: 8px; background: var(--surface-3); align-items: flex-end; }
.appareil form textarea { border-radius: 20px; min-height: 40px; height: 40px; resize: none; padding: 9px 14px; font-size: 14px; }
.appareil form .bouton { border-radius: 50%; width: 40px; height: 40px; padding: 0; flex: none; }
.suggestions { display: flex; flex-direction: column; }
.suggestions button { display: flex; gap: 12px; align-items: center; text-align: left; padding: 12px 20px; border: 0; border-bottom: 1px solid var(--trait); background: none; cursor: pointer; width: 100%; color: var(--encre); }
.suggestions button:last-child { border-bottom: 0; }
.suggestions button:hover { background: var(--surface-2); }
.suggestions button b { font-weight: 550; display: block; font-size: 14px; }
.suggestions button span { font-size: 12.5px; color: var(--encre-3); }

/* ============ Fiche d'un texte ============ */
.fiche-tete { display: flex; gap: 18px; align-items: flex-start; }
.couverture { width: 64px; height: 84px; border-radius: 6px 10px 10px 6px; background: var(--foret); color: #f3eee2; display: flex; flex-direction: column; justify-content: space-between; padding: 8px 7px; flex: none; position: relative; box-shadow: inset 4px 0 0 rgba(0,0,0,.18), var(--o-1); }
.couverture .logo-signe { height: 16px; color: #ec8152; }
.couverture small { font-size: 8.5px; line-height: 1.15; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; opacity: .9; }
.couverture.p { width: 44px; height: 58px; padding: 6px 5px; border-radius: 4px 7px 7px 4px; }
.couverture.p small { font-size: 6.5px; }
.couverture.p .logo-signe { height: 11px; }
.couverture.t-code { background: #12362b; }
.couverture.t-loi { background: #2a4f6b; }
.couverture.t-decret { background: #6a3c25; }
.couverture.t-arrete { background: #4a4a2a; }
.couverture.t-ordonnance { background: #3f2f55; }
.couverture.t-autre { background: #3d4743; }
.article-ligne { padding: 12px 20px; border-bottom: 1px solid var(--trait); }
.article-ligne:last-child { border-bottom: 0; }
.article-ligne .num-art { font-family: var(--f-mono); font-size: 12.5px; color: var(--laterite); font-weight: 500; }
.article-ligne .chem { font-size: 12px; color: var(--encre-3); margin-top: 2px; }
.article-ligne .txt { font-family: var(--f-lecture); font-size: 15px; line-height: 1.55; color: var(--encre-2); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Formules */
.formules-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.formule-carte { border: 1px solid var(--trait); border-radius: var(--r-g); padding: 18px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; position: relative; }
.formule-carte.mise-en-avant { border-color: var(--foret); box-shadow: 0 0 0 1px var(--foret); }
.formule-carte .prix { font-family: var(--f-titre); font-size: 28px; font-weight: 600; letter-spacing: -.03em; }
.formule-carte .prix small { font-family: var(--f-ui); font-size: 13px; color: var(--encre-3); font-weight: 400; letter-spacing: 0; }

/* Code QR et partage */
.qr-boite { background: #fff; border-radius: var(--r); padding: 10px; width: 150px; border: 1px solid var(--trait); }

/* ============ Connexion ============ */
.page-connexion { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.connexion-visuel { background: var(--foret); color: #e9f1ec; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.connexion-visuel .logo { color: #fff; font-size: 17px; }
.connexion-visuel .logo-signe { color: #ec8152; }
.connexion-visuel .grand-signe { position: absolute; right: -60px; bottom: -80px; height: 520px; width: 330px; color: rgba(255,255,255,.05); }
.connexion-visuel blockquote { margin: 0; font-family: var(--f-lecture); font-size: 26px; line-height: 1.35; max-width: 520px; font-weight: 400; color: #fff; position: relative; }
.connexion-visuel blockquote cite { display: block; font-family: var(--f-ui); font-style: normal; font-size: 13.5px; color: #a9c3b7; margin-top: 14px; }
.connexion-visuel .chiffres { display: flex; gap: 36px; position: relative; }
.connexion-visuel .chiffres b { display: block; font-family: var(--f-titre); font-size: 28px; font-weight: 600; color: #fff; letter-spacing: -.02em; }
.connexion-visuel .chiffres span { font-size: 12.5px; color: #a9c3b7; }
.connexion-form { display: grid; place-items: center; padding: 40px 24px; }
.connexion-form form { width: 100%; max-width: 380px; }
.connexion-form h1 { font-family: var(--f-titre); font-size: 28px; letter-spacing: -.025em; margin-bottom: 6px; }

/* ============ Site public ============ */
body.public { background: var(--surface); }
.site-int { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.site-entete { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(1.5) blur(12px); -webkit-backdrop-filter: saturate(1.5) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-entete.colle { border-bottom-color: var(--trait); }
.site-entete .site-int { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.site-entete .logo { font-size: 16px; }
.site-entete nav { display: flex; gap: 6px; align-items: center; }
.site-entete nav a.l { padding: 8px 12px; border-radius: 8px; font-size: 14.5px; color: var(--encre-2); font-weight: 500; }
.site-entete nav a.l:hover { background: var(--surface-3); color: var(--encre); }

.hero { padding: 72px 0 56px; position: relative; }
.hero .site-int { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.hero .surtitre { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 550; color: var(--encre-2); margin-bottom: 22px; }
.hero .surtitre .ic { height: 18px; width: 12px; }
.hero h1 { font-family: var(--f-titre); font-size: clamp(40px, 5.4vw, 66px); line-height: 1.02; letter-spacing: -.035em; font-weight: 600; margin-bottom: 22px; }
.hero h1 em { font-style: normal; color: var(--laterite); }
.hero .chapo { font-size: 18.5px; line-height: 1.55; color: var(--encre-2); max-width: 540px; margin-bottom: 30px; }
.hero .appels { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero .preuves { display: flex; gap: 32px; margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--trait); }
.hero .preuves b { display: block; font-family: var(--f-titre); font-size: 26px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.hero .preuves span { font-size: 13px; color: var(--encre-3); }

.essai-public { background: var(--toile); border: 1px solid var(--trait); border-radius: 22px; padding: 22px; box-shadow: var(--o-2); position: relative; }
.essai-public .entete-essai { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.essai-public .entete-essai b { font-family: var(--f-titre); font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.essai-public form { display: flex; gap: 8px; background: var(--surface); border: 1px solid var(--trait-fort); border-radius: 14px; padding: 6px; box-shadow: var(--o-1); }
.essai-public form:focus-within { border-color: var(--foret-3); box-shadow: 0 0 0 4px color-mix(in srgb, var(--foret-3) 14%, transparent); }
.essai-public form input { border: 0; box-shadow: none !important; height: 42px; font-size: 15.5px; background: transparent; }
.essai-public .idees { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.essai-public .idees button { border: 1px solid var(--trait-fort); background: var(--surface); border-radius: 20px; padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--encre-2); }
.essai-public .idees button:hover { border-color: var(--foret-3); color: var(--foret); background: var(--foret-teinte); }
.essai-public .reponse-essai { margin-top: 16px; background: var(--surface); border-radius: 14px; border: 1px solid var(--trait); padding: 18px 18px 14px; animation: monte-b .25s ease-out; }
@keyframes monte-b { from { opacity: 0; transform: translateY(6px); } }
.essai-public .reponse-essai .q { font-size: 13px; color: var(--encre-3); margin-bottom: 8px; }
.essai-public .reponse-essai .r { font-family: var(--f-lecture); font-size: 17px; line-height: 1.55; color: var(--encre); max-height: 260px; overflow-y: auto; }
.essai-public .reponse-essai .r p { margin: 0 0 8px; }
.essai-public .sources-essai { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--trait); }
.essai-public .sources-essai a { display: flex; gap: 10px; align-items: center; font-size: 13.5px; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--trait); }
.essai-public .sources-essai a:hover { border-color: var(--foret-3); color: var(--foret); }
.essai-public .sources-essai .mono { color: var(--laterite); }
.essai-public .reste { font-size: 12.5px; color: var(--encre-3); margin-top: 10px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.section { padding: 84px 0; }
.section.toile { background: var(--toile); }
.section.foret { background: var(--foret); color: #e9f1ec; }
.section .tete-section { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 36px; flex-wrap: wrap; }
.section h2 { font-family: var(--f-titre); font-size: clamp(30px, 3.6vw, 44px); line-height: 1.08; letter-spacing: -.03em; font-weight: 600; max-width: 640px; }
.section .chapo-s { font-size: 16.5px; color: var(--encre-2); max-width: 520px; margin: 12px 0 0; }
.section.foret .chapo-s { color: #a9c3b7; }
.section .surtitre-s { font-size: 13px; font-weight: 600; color: var(--laterite); margin-bottom: 12px; display: block; }
.section.foret .surtitre-s { color: #ec8152; }

.etapes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 56px; align-items: center; }
.etapes ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.etapes li { display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 22px 0; border-top: 1px solid rgba(255,255,255,.12); }
.etapes li:first-child { border-top: 0; }
.etapes li .n { font-family: var(--f-titre); font-size: 15px; font-weight: 600; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); display: grid; place-items: center; color: #ec8152; }
.etapes li b { display: block; font-size: 17px; font-weight: 600; color: #fff; margin-bottom: 4px; }
.etapes li p { margin: 0; color: #a9c3b7; font-size: 15px; }
.carte-reponse { background: #f6f3ec; color: #13201b; border-radius: 18px; padding: 26px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.6); position: relative; }
.carte-reponse .ques { font-size: 13.5px; color: #6b7671; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
.carte-reponse .rep { font-family: var(--f-lecture); font-size: 18.5px; line-height: 1.55; }
.carte-reponse .rep strong { font-weight: 600; background: linear-gradient(transparent 62%, rgba(194, 80, 31, .2) 62%); }
.carte-reponse .src { margin-top: 18px; padding-top: 16px; border-top: 1px dashed #d5d1c6; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.carte-reponse .src .etiquette { background: #fff; }
.carte-reponse .actions-c { display: flex; gap: 8px; margin-top: 16px; }
.carte-reponse .actions-c span { flex: 1; text-align: center; padding: 9px; border-radius: 10px; background: #fff; border: 1px solid #e8e5dd; color: #0b7bba; font-weight: 550; font-size: 13.5px; }
.carte-reponse .annot { position: absolute; font-size: 12px; color: #ec8152; font-weight: 600; display: flex; gap: 6px; align-items: center; white-space: nowrap; }

.biblio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.livre { display: flex; gap: 16px; padding: 18px; border-radius: var(--r-g); border: 1px solid var(--trait); background: var(--surface); transition: border-color .15s, box-shadow .15s, transform .15s; color: var(--encre); }
.livre:hover { border-color: var(--trait-fort); box-shadow: var(--o-2); transform: translateY(-2px); color: var(--encre); }
.livre .infos { min-width: 0; display: flex; flex-direction: column; }
.livre .type-l { font-size: 12px; color: var(--encre-3); }
.livre b { font-family: var(--f-titre); font-size: 18px; font-weight: 600; letter-spacing: -.015em; line-height: 1.2; margin: 2px 0 6px; }
.livre .ref { font-family: var(--f-mono); font-size: 12px; color: var(--encre-3); }
.livre .bas-l { margin-top: auto; padding-top: 10px; display: flex; gap: 12px; font-size: 12.5px; color: var(--encre-3); align-items: center; }
.livre.premier { grid-row: span 2; flex-direction: column; background: var(--toile); }
.livre.premier .couverture { width: 96px; height: 128px; padding: 12px 10px; }
.livre.premier .couverture small { font-size: 11px; }
.livre.premier .couverture .logo-signe { height: 22px; }
.livre.premier b { font-size: 26px; }

.tarifs { display: grid; grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(0, 1fr)); border: 1px solid var(--trait); border-radius: 20px; overflow: hidden; background: var(--surface); }
.tarif { padding: 26px 22px; border-left: 1px solid var(--trait); display: flex; flex-direction: column; gap: 8px; }
.tarif:first-child { border-left: 0; background: var(--toile); }
.tarif .nom-t { font-weight: 600; font-size: 15px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.tarif .prix-t { font-family: var(--f-titre); font-size: 34px; font-weight: 600; letter-spacing: -.035em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tarif .prix-t small { font-family: var(--f-ui); font-size: 14px; color: var(--encre-3); letter-spacing: 0; font-weight: 400; }
.tarif ul { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--encre-2); }
.tarif ul li { display: flex; gap: 8px; }
.tarif ul .ic { color: var(--foret-3); margin-top: 2px; }
.tarif.vedette { background: var(--foret); color: #fff; border-color: var(--foret); }
.tarif.vedette .prix-t small, .tarif.vedette ul { color: #cfe0d7; }
.tarif.vedette ul .ic { color: #ec8152; }
.autres-tarifs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; font-size: 14px; color: var(--encre-2); }
.autres-tarifs span { border: 1px solid var(--trait); border-radius: 10px; padding: 8px 12px; background: var(--surface); }

.faq-liste { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.faq-liste a { display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--trait); font-size: 16px; font-weight: 500; align-items: center; color: var(--encre); }
.faq-liste a .ic { color: var(--encre-4); transition: transform .15s, color .15s; }
.faq-liste a:hover .ic { transform: translateX(3px); color: var(--laterite); }
.faq-liste a small { display: block; font-size: 13px; color: var(--encre-3); font-weight: 400; margin-top: 3px; }

.appel-final { border-radius: 26px; background: var(--laterite); color: #fff; padding: 52px; display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: 40px; align-items: center; position: relative; overflow: hidden; }
.appel-final h2 { color: #fff; }
.appel-final p { color: #fde3d6; font-size: 17px; margin: 12px 0 0; }
.appel-final .grand-signe { position: absolute; right: 220px; top: -70px; height: 320px; width: 200px; color: rgba(255,255,255,.08); }
.appel-final .qr-boite { width: 140px; }
.appel-final .bouton { background: #fff; color: var(--laterite); border-color: #fff; }

.site-pied { background: var(--foret); color: #a9c3b7; padding: 56px 0 32px; font-size: 14px; }
.site-pied .colonnes { display: grid; grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr)); gap: 32px; }
.site-pied .logo { color: #fff; font-size: 17px; margin-bottom: 14px; }
.site-pied .logo-signe { color: #ec8152; }
.site-pied h4 { color: #fff; font-size: 13.5px; margin-bottom: 12px; font-weight: 600; }
.site-pied a { display: block; padding: 3px 0; }
.site-pied a:hover { color: #fff; }
.site-pied .bas-pied { border-top: 1px solid rgba(255,255,255,.1); margin-top: 40px; padding-top: 22px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; }

/* Pages d'une réponse publiée et des conditions */
.page-texte { max-width: 760px; margin: 0 auto; padding: 56px 32px 80px; }
.page-texte h1 { font-family: var(--f-titre); font-size: clamp(30px, 4vw, 42px); line-height: 1.1; letter-spacing: -.03em; margin-bottom: 18px; }
.page-texte .corps-lecture { font-family: var(--f-lecture); font-size: 19px; line-height: 1.65; color: var(--encre); }
.page-texte .corps-lecture p { margin: 0 0 16px; }
.page-texte .corps-lecture h2 { font-family: var(--f-titre); font-size: 22px; margin: 32px 0 10px; }
.citation-art { border-radius: var(--r-g); background: var(--toile); border: 1px solid var(--trait); padding: 20px 22px; margin: 18px 0; }
.citation-art .tete-c { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 8px; font-size: 13.5px; }
.citation-art .tete-c .mono { color: var(--laterite); font-weight: 500; }
.citation-art .txt-c { font-family: var(--f-lecture); font-size: 16.5px; line-height: 1.6; color: var(--encre-2); white-space: pre-line; }

/* ============ Liseuse ============ */
.corps-liseuse { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--toile); }
.corps-liseuse > .site-entete { flex: none; position: relative; background: var(--surface); border-bottom-color: var(--trait); }
.liseuse { display: grid; grid-template-columns: 320px minmax(0, 1fr); flex: 1; min-height: 0; }
.liseuse .sommaire { border-right: 1px solid var(--trait); overflow-y: auto; padding: 18px 14px 40px; background: var(--surface); scrollbar-width: thin; }
.liseuse .sommaire .tete-s { padding: 4px 8px 14px; border-bottom: 1px solid var(--trait); margin-bottom: 12px; }
.liseuse .sommaire .tete-s b { display: block; font-family: var(--f-titre); font-size: 18px; letter-spacing: -.015em; line-height: 1.2; }
.liseuse .sommaire a { display: block; padding: 6px 10px; font-size: 13.5px; color: var(--encre-2); border-radius: 7px; line-height: 1.35; }
.liseuse .sommaire a:hover { background: var(--surface-3); color: var(--encre); }
.liseuse .sommaire a.n0 { font-weight: 600; color: var(--encre); margin-top: 6px; }
.liseuse .sommaire a.n1 { padding-left: 18px; }
.liseuse .sommaire a.n2 { padding-left: 28px; font-size: 13px; color: var(--encre-3); }
.liseuse .sommaire a.n3, .liseuse .sommaire a.n4 { padding-left: 38px; font-size: 13px; color: var(--encre-3); }
.liseuse .lecture { overflow-y: auto; scroll-behavior: auto; }
.liseuse .colonne-lecture { max-width: 760px; margin: 0 auto; padding: 40px 32px 120px; }
.liseuse .titre-texte { margin-bottom: 30px; padding-bottom: 26px; border-bottom: 1px solid var(--trait); }
.liseuse .titre-texte h1 { font-family: var(--f-titre); font-size: 34px; line-height: 1.12; letter-spacing: -.03em; margin: 8px 0 10px; }
.liseuse .titre-texte .meta-t { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13.5px; color: var(--encre-3); }
.art { padding: 20px 22px; margin: 0 -22px; border-radius: 14px; scroll-margin-top: 20px; }
.art .tete-art { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 6px; }
.art .num-art { font-family: var(--f-mono); font-size: 13px; color: var(--laterite); font-weight: 500; }
.art .chem { font-size: 12.5px; color: var(--encre-3); margin-bottom: 8px; }
.art .txt { font-family: var(--f-lecture); font-size: 18.5px; line-height: 1.65; color: var(--encre); }
.art .txt p { margin: 0 0 12px; }
.art .copier { font-size: 12.5px; color: var(--encre-3); background: none; border: 0; cursor: pointer; opacity: 0; transition: opacity .15s; display: inline-flex; gap: 5px; align-items: center; }
.art:hover .copier, .art.cible .copier { opacity: 1; }
.art .copier:hover { color: var(--laterite); }
.art.cible { background: var(--surface); box-shadow: var(--o-2); border: 1px solid var(--trait); }
.liseuse .partie { font-family: var(--f-titre); font-size: 15px; font-weight: 600; color: var(--foret); margin: 30px 0 4px; letter-spacing: -.01em; }
[data-theme="sombre"] .liseuse .partie { color: var(--foret-3); }
.resultats-rech { background: var(--surface); border: 1px solid var(--trait); border-radius: 10px; margin-top: 6px; max-height: 340px; overflow: auto; box-shadow: var(--o-2); }
.resultats-rech a { display: block; padding: 8px 10px; font-size: 13px; border-bottom: 1px solid var(--trait); }
.resultats-rech a:last-child { border-bottom: 0; }
.resultats-rech .mono { color: var(--laterite); }

/* Paiement et reçu */
.page-centree { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--toile); }
.ticket { width: 100%; max-width: 440px; background: var(--surface); border-radius: 20px; border: 1px solid var(--trait); box-shadow: var(--o-2); overflow: hidden; }
.ticket .haut-t { background: var(--foret); color: #e9f1ec; padding: 22px 24px; }
.ticket .haut-t .logo { color: #fff; }
.ticket .haut-t .logo-signe { color: #ec8152; }
.ticket .montant { font-family: var(--f-titre); font-size: 40px; font-weight: 600; letter-spacing: -.035em; margin-top: 16px; line-height: 1.05; }
.ticket .montant small { font-size: 16px; font-weight: 500; color: #a9c3b7; }
.ticket .corps-t { padding: 22px 24px; }
.ticket .ligne-t { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--trait); font-size: 14px; }
.ticket .ligne-t span:first-child { color: var(--encre-3); }
.ticket .ligne-t:last-child { border-bottom: 0; }
.ticket .bas-t { padding: 0 24px 24px; display: flex; flex-direction: column; gap: 10px; }
.ticket .bas-t .bouton { width: auto; }
.sceau { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 12px; }
.sceau.ok { background: var(--ok-teinte); color: var(--ok); }
.sceau.veille { background: var(--veille-teinte); color: var(--veille); }
.sceau.alerte { background: var(--alerte-teinte); color: var(--alerte); }
.sceau .ic { width: 26px; height: 26px; }
.sceau b { display: block; font-size: 15px; }
.sceau span { font-size: 13px; opacity: .9; }

/* ============ Ordinateur moyen ============ */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis .kpi:nth-child(n+4) { border-top: 1px solid var(--trait); }
  .kpis .kpi:nth-child(4) { border-left: 0; }
  .messagerie { grid-template-columns: 290px minmax(0, 1fr); }
  .mess-info { display: none; }
  .biblio { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============ Téléphone et tablette ============ */
@media (max-width: 900px) {
  :root { --entete-h: 56px; --nav-bas-h: 64px; }
  body { font-size: 15px; }
  .ordi-seul { display: none !important; }
  .tel-seul:not(.bouton) { display: revert !important; }
  .bouton.tel-seul { display: inline-flex !important; }
  .kpi .evo { white-space: normal; }
  .tete-fil .mono { display: none; }
  .coquille { grid-template-columns: 1fr; }
  .barre { position: fixed; left: 0; top: 0; bottom: 0; width: 290px; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--o-pop); }
  .barre.ouverte { transform: none; }
  .entete { padding: 0 16px; }
  .entete h1 { font-size: 18px; }
  .entete .actions .bouton:not(.toujours) { display: none; }
  .fil { display: none; }
  .contenu { padding: 16px 16px 24px; }
  .contenu.ajuste { padding-bottom: 12px; overflow-y: auto; display: block; }
  .contenu.ajuste .ecran { min-height: 100%; }
  .grille.remplir, .grille.hauteur { grid-template-rows: none; }
  .contenu.ajuste .panneau.remplir { max-height: 70dvh; }
  .contenu.ajuste .remplir.defile { overflow: visible; }
  .contenu.ajuste .essai { height: 100%; }
  .grille.g-2, .grille.g-3, .grille.g-4, .grille.g-2-1, .grille.g-1-2, .grille.g-3-2, .grille.g-lat { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis .kpi { border-left: 1px solid var(--trait); border-top: 1px solid var(--trait); padding: 14px; }
  .kpis .kpi:first-child { grid-column: 1 / -1; border-top: 0; border-left: 0; }
  .kpis .kpi:nth-child(2n) { border-left: 0; }
  .kpi .val { font-size: 24px; }
  .kpi .mini { display: none; }
  .kpis .kpi:first-child .mini { display: block; }
  .champs, .champs.c3 { grid-template-columns: minmax(0, 1fr); }
  .defs { grid-template-columns: 1fr; gap: 2px; }
  .defs dd { margin-bottom: 10px; }
  .nav-bas { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: var(--nav-bas-h); background: var(--surface); border-top: 1px solid var(--trait); z-index: 35; padding-bottom: env(safe-area-inset-bottom); }
  .nav-bas a, .nav-bas button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--encre-3); background: none; border: 0; cursor: pointer; position: relative; }
  .nav-bas .ic { width: 22px; height: 22px; }
  .nav-bas .actif { color: var(--foret); font-weight: 600; }
  [data-theme="sombre"] .nav-bas .actif { color: var(--foret-3); }
  .nav-bas .pastille-n { position: absolute; top: 8px; left: calc(50% + 6px); background: var(--laterite); color: #fff; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; font-weight: 600; }
  .rangee-actions { justify-content: center; }
  .panneau > .tete { padding: 14px 16px 0; }
  .panneau > .corps { padding: 14px 16px 16px; }
  .registre th:first-child, .registre td:first-child { padding-left: 16px; }
  .registre th:last-child, .registre td:last-child { padding-right: 16px; }
  .registre .cache-tel { display: none; }
  .ligne, .article-ligne { padding: 12px 16px; }
  .messagerie { grid-template-columns: 1fr; }
  .messagerie.fil-ouvert .mess-liste { display: none; }
  .messagerie:not(.fil-ouvert) .mess-fil { display: none; }
  .fil-messages { padding: 14px 10px; }
  .bulle { max-width: 88%; }
  .essai { grid-template-columns: 1fr; }
  .essai .colonne-aide { display: none; }
  .appareil { border-radius: 0; padding: 0; background: none; box-shadow: none; margin: -16px -16px -12px; }
  .appareil .ecran-app { border-radius: 0; }
  .fiche-tete { gap: 12px; }
  .barre-outils .recherche { max-width: none; min-width: 100%; }
  .progression-flottante { left: 12px; right: 12px; width: auto; }

  .page-connexion { grid-template-columns: 1fr; }
  .connexion-visuel { padding: 24px; min-height: 200px; }
  .connexion-visuel blockquote { font-size: 19px; }
  .connexion-visuel .chiffres { display: none; }

  .site-int { padding: 0 20px; }
  .site-entete nav a.l { display: none; }
  .hero { padding: 36px 0 40px; }
  .hero .site-int { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hero .chapo { font-size: 16.5px; }
  .hero .preuves { gap: 20px; }
  .hero .preuves b { font-size: 21px; }
  .essai-public { padding: 16px; border-radius: 18px; }
  .section { padding: 56px 0; }
  .etapes { grid-template-columns: 1fr; gap: 28px; }
  .carte-reponse .annot { display: none; }
  .biblio { grid-template-columns: 1fr; }
  .livre.premier { grid-row: auto; flex-direction: row; }
  .livre.premier .couverture { width: 64px; height: 84px; }
  .livre.premier b { font-size: 19px; }
  .tarifs { grid-template-columns: 1fr; }
  .tarif { border-left: 0; border-top: 1px solid var(--trait); }
  .tarif:first-child { border-top: 0; }
  .faq-liste { grid-template-columns: 1fr; }
  .appel-final { grid-template-columns: 1fr; padding: 30px 24px; gap: 20px; }
  .appel-final .qr-boite { display: none; }
  .site-pied .colonnes { grid-template-columns: 1fr 1fr; }
  .site-pied .colonnes > div:first-child { grid-column: 1 / -1; }
  .page-texte { padding: 32px 20px 60px; }
  .page-texte .corps-lecture { font-size: 17.5px; }

  .liseuse { grid-template-columns: 1fr; position: relative; }
  .liseuse .sommaire { position: absolute; inset: 0; z-index: 10; display: none; }
  .liseuse.sommaire-ouvert .sommaire { display: block; }
  .liseuse .colonne-lecture { padding: 24px 18px 90px; }
  .liseuse .titre-texte h1 { font-size: 26px; }
  .art { margin: 0 -10px; padding: 16px 12px; }
  .art .txt { font-size: 17.5px; }
  .art .copier { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.champ.erreur .depot { border-color: var(--alerte); background: var(--alerte-teinte); }

/* Ajout de textes : dépôt multiple et file de traitement */
.depot.grand { padding: 44px 20px; }
.file-ajout { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.fichier-ajout { border: 1px solid var(--trait); border-radius: var(--r-g); background: var(--surface); padding: 14px 16px; display: grid; grid-template-columns: 36px 1fr; gap: 4px 14px; align-items: start; }
.fichier-ajout > .ic { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: var(--laterite-teinte, var(--surface-2)); color: var(--laterite); }
.fichier-ajout .nom { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fichier-ajout .etape { font-size: 13px; color: var(--encre-3); }
.fichier-ajout .etape.ok { color: var(--ok); }
.fichier-ajout .etape.erreur { color: var(--alerte); }
.fichier-ajout .progression { grid-column: 2; margin: 6px 0 0; }
.fichier-ajout .resume-fiche { grid-column: 2; margin-top: 8px; font-size: 13.5px; color: var(--encre-2); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.fichier-ajout .resume-fiche b { color: var(--encre); font-weight: 600; }
.fichier-ajout .actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.coches { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.coches li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.coches .ic { color: var(--foret-3); margin-top: 2px; flex: none; }
@media (max-width: 760px) { .fichier-ajout { grid-template-columns: 1fr; } .fichier-ajout > .ic { display: none; } .fichier-ajout .progression, .fichier-ajout .resume-fiche, .fichier-ajout .actions { grid-column: 1; } .fichier-ajout .actions { justify-content: center; } }

/* ============ Document officiel (liseuse PDF) ============ */
.corps-document { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--toile); }
.corps-document > .site-entete { flex: none; position: relative; background: var(--surface); border-bottom: 1px solid var(--trait); }
.corps-document .site-int { max-width: none; padding: 0 22px; }
.corps-document .site-entete .site-int { height: 60px; }
.corps-document .site-entete nav a.l { display: none; }
.doc-titre-entete { font-family: var(--f-titre); font-weight: 600; font-size: 15px; color: var(--encre-2); margin-right: 10px; letter-spacing: -.01em; }
.doc { flex: 1; min-height: 0; display: grid; grid-template-columns: 290px minmax(0, 1fr) 300px; position: relative; }
.doc-sommaire { background: var(--surface); border-right: 1px solid var(--trait); overflow-y: auto; padding: 16px 12px 90px; scrollbar-width: thin; }
.doc-s-tete { padding: 2px 8px 14px; position: relative; }
.doc-s-tete b { display: block; font-family: var(--f-titre); font-size: 18px; letter-spacing: -.02em; line-height: 1.2; margin-top: 2px; }
.doc-fermer { position: absolute; right: 0; top: 0; }
.doc-recherche { margin: 0 4px 6px; }
.doc-resultats { margin: 4px 4px 10px; border: 1px solid var(--trait); border-radius: 10px; background: var(--surface); max-height: 320px; overflow-y: auto; }
.doc-resultats a { display: block; padding: 9px 11px; border-bottom: 1px solid var(--trait); font-size: 13px; color: var(--encre-2); }
.doc-resultats a:last-child { border-bottom: 0; }
.doc-resultats a:hover { background: var(--surface-2); }
.doc-resultats b { font-family: var(--f-mono); font-weight: 500; color: var(--laterite); font-size: 12.5px; }
.doc-resultats .ex { display: block; margin-top: 2px; line-height: 1.35; }
.doc-plan { border-top: 1px solid var(--trait); margin-top: 8px; padding-top: 8px; }
.doc-plan a, .doc-resultats .p { line-height: 1.35; }
.doc-plan a { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; font-size: 13.5px; color: var(--encre-2); border-radius: 7px; }
.doc-plan a:hover { background: var(--surface-3); color: var(--encre); }
.doc-plan a.n0 { font-weight: 600; color: var(--encre); margin-top: 6px; }
.doc-plan a.n1 { padding-left: 18px; }
.doc-plan a.n2, .doc-plan a.n3 { padding-left: 28px; font-size: 13px; color: var(--encre-3); }
.doc-plan .p, .doc-resultats .p { flex: none; font-family: var(--f-mono); font-size: 11.5px; color: var(--encre-4); font-weight: 400; margin-left: 6px; }
.doc-zone { overflow-y: auto; overflow-x: auto; position: relative; padding: 0 0 96px; scrollbar-width: thin; }
.doc-bandeau { position: sticky; top: 0; z-index: 4; padding: 12px 24px 0; pointer-events: none; }
.doc-bandeau-int { pointer-events: auto; max-width: 880px; margin: 0 auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--trait); border-left: 3px solid var(--laterite); border-radius: 10px; padding: 9px 14px; box-shadow: var(--o-1); font-size: 13.5px; }
.doc-bandeau .num-art { font-family: var(--f-mono); font-size: 13px; color: var(--laterite); font-weight: 500; }
.doc-bandeau .copier { margin-left: auto; font-size: 12.5px; color: var(--encre-3); background: none; border: 0; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
.doc-bandeau .copier:hover { color: var(--laterite); }
.doc-avis { max-width: 880px; margin: 14px auto 0; display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; background: var(--veille-teinte); color: var(--encre-2); font-size: 13.5px; }
.doc-pages { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 18px 16px 0; }
.feuille { position: relative; background: #fff; box-shadow: 0 1px 2px rgba(19, 32, 27, .08), 0 8px 24px -12px rgba(19, 32, 27, .18); border-radius: 3px; max-width: none; flex: none; }
.feuille canvas { display: block; width: 100%; height: 100%; border-radius: 3px; }
.feuille-num { position: absolute; left: 50%; bottom: -17px; transform: translateX(-50%); font-family: var(--f-mono); font-size: 11px; color: var(--encre-4); }
.feuille:not(.prete)::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(19, 32, 27, .03), transparent); background-size: 200% 100%; animation: lueur 1.4s linear infinite; }
@keyframes lueur { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.doc-repere { position: absolute; background: rgba(194, 80, 31, .2); border-radius: 3px; pointer-events: none; mix-blend-mode: multiply; box-shadow: -7px 0 0 -3px var(--laterite); }
.doc-attente { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 80px 20px; color: var(--encre-3); font-size: 14px; }
.doc-attente .ecrit { background: var(--surface); }
.doc-fiche { background: var(--surface); border-left: 1px solid var(--trait); overflow-y: auto; padding: 22px 22px 90px; }
.doc-fiche h1 { font-family: var(--f-titre); font-size: 24px; line-height: 1.15; letter-spacing: -.025em; margin: 12px 0 8px; }
.doc-titre-off { font-family: var(--f-lecture); font-size: 15.5px; line-height: 1.45; color: var(--encre-2); margin: 0 0 16px; }
.doc-defs { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; margin: 0; font-size: 13.5px; padding: 14px 0; border-top: 1px solid var(--trait); border-bottom: 1px solid var(--trait); }
.doc-defs dt { color: var(--encre-3); }
.doc-defs dd { margin: 0; color: var(--encre); }
.doc-lien-texte { display: flex; flex-direction: column; gap: 2px; padding: 12px 0 0; font-size: 14px; }
.doc-outils { position: absolute; left: 290px; right: 300px; bottom: 18px; margin: 0 auto; width: max-content; display: flex; align-items: center; gap: 10px; padding: 6px 8px; background: var(--surface); border: 1px solid var(--trait); border-radius: 12px; box-shadow: var(--o-pop); z-index: 6; }
.doc-pager, .doc-zoom { display: flex; align-items: center; gap: 4px; }
.doc-zoom { border-left: 1px solid var(--trait); padding-left: 8px; }
.doc-zoom .bouton { width: 32px; padding: 0; font-size: 16px; }
.doc-num { font-family: var(--f-mono); font-size: 13px; min-width: 64px; text-align: center; }
.doc-pager .bouton { width: 32px; padding: 0; }
[data-theme="sombre"] .feuille { box-shadow: 0 0 0 1px var(--trait); }
@media (max-width: 1280px) { .doc { grid-template-columns: 270px minmax(0, 1fr); } .doc-fiche { display: none !important; } .doc-outils { left: 270px; right: 0; } }
@media (max-width: 900px) {
  .corps-document .site-int { padding: 0 14px; }
  .corps-document .site-entete .site-int { height: 54px; }
  .corps-document .site-entete nav .bouton { height: 34px; padding: 0 10px; }
  .doc { grid-template-columns: 1fr; }
  .doc-sommaire { position: absolute; inset: 0; z-index: 12; display: none; padding-top: 18px; }
  .doc.sommaire-ouvert .doc-sommaire { display: block; }
  .doc-bandeau { padding: 8px 8px 0; }
  .doc-bandeau-int { font-size: 12.5px; padding: 8px 11px; gap: 4px 10px; }
  .doc-avis { margin: 10px 8px 0; }
  .doc-pages { padding: 12px 8px 0; gap: 16px; }
  .doc-outils { left: 0; right: 0; bottom: calc(12px + env(safe-area-inset-bottom)); gap: 4px; padding: 5px 6px; }
  .doc-outils .bouton { width: 36px; padding: 0; }
  .doc-zoom #doc-zoom { display: none; }
  .doc-num { min-width: 56px; }
}
.piece-wa { display: flex; gap: 10px; align-items: center; margin: -2px -4px 8px; padding: 10px 12px; border-radius: 8px; background: rgba(19, 32, 27, .05); color: var(--encre); text-decoration: none; }
.piece-wa .ic { width: 28px; height: 28px; color: var(--laterite); flex: none; }
.piece-wa b { display: block; font-weight: 600; font-size: 13px; line-height: 1.3; }
.piece-wa span span { font-size: 11.5px; color: var(--encre-3); }
.pied-wa { display: block; margin-top: 6px; font-size: 12px; color: var(--encre-3); }
.bulle .txt-wa { white-space: pre-line; }

/* Rôles et actions */
.droits-grille { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.droits-groupe { border: 1px solid var(--trait); border-radius: var(--r-g); padding: 10px 14px 12px; margin: 0; min-width: 0; background: var(--surface); }
.droits-groupe legend { padding: 0 6px; margin-left: -6px; }
.droits-groupe legend .coche-tout span { font-weight: 600; color: var(--encre); font-size: 13.5px; }
.droit, .coche-tout { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; color: var(--encre-2); cursor: pointer; line-height: 1.4; }
.droit { padding: 5px 0; }
.droit input, .coche-tout input { margin-top: 2px; accent-color: var(--foret); width: 16px; height: 16px; flex: none; }
.pied-form { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--trait); background: var(--surface); border-radius: 0 0 var(--r-g) var(--r-g); }
.etapes-simples { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.etapes-simples b { display: block; font-weight: 600; }
.etapes-simples span { color: var(--encre-3); font-size: 13.5px; }
@media (max-width: 1280px) { .droits-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .droits-grille { grid-template-columns: 1fr; } .pied-form { flex-direction: column; } }
.sceau.neutre { background: var(--surface-3); color: var(--encre-2); }
.retour-auto { margin: 14px 0 0; font-size: 13.5px; color: var(--encre-2); }
.retour-auto b { font-family: var(--f-mono); color: var(--foret); }

/* Mise en relation */
.messagerie.deux { grid-template-columns: 320px minmax(0, 1fr); border: 1px solid var(--trait); border-radius: var(--r-g); overflow: hidden; background: var(--surface); }
.coches-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.avec-unite { display: flex; align-items: center; gap: 8px; }
.avec-unite input { flex: 1; min-width: 0; }
.avec-unite span { color: var(--encre-3); font-size: 13.5px; flex: none; }
.lecture-seule-fil { padding: 13px 16px; background: var(--surface); border-top: 1px solid var(--trait); text-align: center; }
.demande-epinglee { margin: 2px 0 14px; padding: 12px 14px; border-radius: var(--r-g); background: var(--surface); border: 1px solid var(--trait); box-shadow: 0 1px 0 var(--trait); }
.demande-epinglee .lib { font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--encre-3); margin-bottom: 4px; display: block; }
.demande-epinglee p { margin: 0; white-space: pre-line; font-size: 14.5px; line-height: 1.5; }
.actions-fil { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.bascule-dispo { display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px 6px 8px; border-radius: 999px; border: 1px solid var(--trait); background: var(--surface); font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--encre-2); }
.bascule-dispo i { width: 10px; height: 10px; border-radius: 50%; background: var(--encre-4, #9a9a9a); }
.bascule-dispo.oui i { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.mess-item .pastille-n { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--laterite, #b4532a); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 1280px) { .messagerie.deux { grid-template-columns: 290px minmax(0, 1fr); } }
@media (max-width: 900px) {
  .messagerie.deux { grid-template-columns: 1fr; }
  .coches-grille { grid-template-columns: 1fr; }
  .actions-fil .bouton span.ordi-seul { display: none; }
}

/* Lignes avec plusieurs actions : à droite sur ordinateur, sous le texte sur téléphone */
.ligne .actions-ligne { display: flex; gap: 8px; align-items: center; flex: none; }
@media (max-width: 760px) {
  .ligne.avec-actions { flex-wrap: wrap; }
  .ligne.avec-actions .actions-ligne { width: 100%; padding-left: 44px; }
}
