/* App OCSIA2 commune, format A (maquettes validées par Flavio le 12/10/2026 : maquettes/app/).
   Charte : specs/charte-ocsia2.md. Hors d'un espace : deux violets au maximum, blanc cassé, prune, or rare.
   Dans un espace : accent discret à la couleur du client (boutons, onglet actif, trait des icônes actives, « + »),
   calculé et corrigé en contraste par l'app (variables --c-* et --cs-* posées sur <html>). */

@font-face { font-family: "Gilda Display"; src: url("polices/gilda-display-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Aileron"; src: url("polices/aileron-latin-300-normal.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Aileron"; src: url("polices/aileron-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Aileron"; src: url("polices/aileron-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Aileron"; src: url("polices/aileron-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Ms Madi"; src: url("polices/ms-madi-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }

@property --trace { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  --violet: #4B176F;
  --pastel: #E8DCF2;
  --blanc-casse: #FBFAF6;
  --blanc: #FFFFFF;
  --prune: #24152B;
  --doux: #5E5468;
  --or: #C9A24D;
  --or-texte: #7D5F17;
  --or-voile: #F4ECD6;
  --ok: #1F7A4D;
  --attention: #A35A00;
  --erreur: #B42340;

  --fond: var(--blanc-casse);
  --carte: var(--blanc);
  --texte: var(--prune);
  --texte-doux: var(--doux);
  --ligne: #E9E3EE;
  --voile: var(--pastel);
  --accent: var(--violet);
  --accent-texte: var(--violet);
  --accent-contraste: #FFFFFF;
  --ombre: 0 8px 24px -12px rgba(36, 21, 43, .28);
  --ombre-feuille: 0 -12px 40px -18px rgba(36, 21, 43, .35);
  --barre-fond: var(--blanc);
  --selection: var(--pastel);
  --squelette: #EFEAF2;

  --r-champ: 14px;
  --r-carte: 20px;
  --r-feuille: 28px;
  --duree: 200ms;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --haut-sur: env(safe-area-inset-top, 0px);
  --bas-sur: env(safe-area-inset-bottom, 0px);
  --barre-h: calc(62px + var(--bas-sur));
  color-scheme: light dark;
}

/* Mode sombre : automatique selon le réglage de l'appareil ([data-theme] ne sert qu'aux essais). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #1B0F22; --carte: #271A31; --texte: #EFE9F3; --texte-doux: #B9AEC4; --ligne: rgba(239, 233, 243, .12);
    --voile: #2F2040; --accent: var(--pastel); --accent-contraste: var(--prune); --accent-texte: #D9C8EA;
    --or: #E0C27A; --or-texte: #E0C27A; --or-voile: rgba(224, 194, 122, .14); --ok: #4DB384; --attention: #E3A15A; --erreur: #F07A8F;
    --ombre: 0 8px 24px -12px rgba(0, 0, 0, .6); --ombre-feuille: 0 -12px 40px -18px rgba(0, 0, 0, .7);
    --barre-fond: #221530; --selection: #3D2A52; --squelette: #2C1F37;
  }
}
:root[data-theme="dark"] {
  --fond: #1B0F22; --carte: #271A31; --texte: #EFE9F3; --texte-doux: #B9AEC4; --ligne: rgba(239, 233, 243, .12);
  --voile: #2F2040; --accent: var(--pastel); --accent-contraste: var(--prune); --accent-texte: #D9C8EA;
  --or: #E0C27A; --or-texte: #E0C27A; --or-voile: rgba(224, 194, 122, .14); --ok: #4DB384; --attention: #E3A15A; --erreur: #F07A8F;
  --ombre: 0 8px 24px -12px rgba(0, 0, 0, .6); --ombre-feuille: 0 -12px 40px -18px rgba(0, 0, 0, .7);
  --barre-fond: #221530; --selection: #3D2A52; --squelette: #2C1F37;
}

/* Dans un espace : la couleur du client (variables calculées par l'app), fonds doux neutres. */
:root.dans-espace { --accent: var(--c-accent); --accent-texte: var(--c-texte); --accent-contraste: var(--c-contraste); --voile: #EEEBE4; --selection: #E4DFD6; }
@media (prefers-color-scheme: dark) {
  :root.dans-espace:not([data-theme="light"]) { --accent: var(--cs-accent); --accent-texte: var(--cs-texte); --accent-contraste: var(--cs-contraste); --voile: #2E2537; --selection: #3A2F45; }
}
:root.dans-espace[data-theme="dark"] { --accent: var(--cs-accent); --accent-texte: var(--cs-texte); --accent-contraste: var(--cs-contraste); --voile: #2E2537; --selection: #3A2F45; }

* { box-sizing: border-box; }
/* Recalculé sur chaque élément pour suivre l'accent où qu'il soit posé. */
*, ::before, ::after { --accent-voile: color-mix(in srgb, var(--accent) 11%, var(--fond)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) * { --accent-voile: color-mix(in srgb, var(--accent) 22%, var(--fond)); } }
:root[data-theme="dark"] * { --accent-voile: color-mix(in srgb, var(--accent) 22%, var(--fond)); }

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  background: var(--fond);
  scrollbar-color: color-mix(in srgb, var(--texte-doux) 45%, transparent) transparent;
}
body {
  margin: 0; min-height: 100dvh;
  font-family: "Aileron", system-ui, sans-serif; font-size: 17px; line-height: 1.45;
  color: var(--texte); background: var(--fond);
  overscroll-behavior: none;
}
::selection { background: var(--selection); color: var(--texte); }
[hidden] { display: none !important; }
button, a, [role="button"], .onglet, .puce { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; opacity: .55; }
a { color: var(--accent-texte); text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; }
input, textarea, select { font: inherit; font-size: 16px; color: var(--texte); caret-color: var(--accent-texte); }
:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
h1 { font-family: "Gilda Display", serif; font-weight: 400; font-size: 30px; line-height: 1.15; letter-spacing: -0.005em; text-wrap: balance; }
h2 { font-size: 15px; font-weight: 600; line-height: 1.3; }
.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-s { width: 18px; height: 18px; }
.ic-xs { width: 13px; height: 13px; stroke-width: 2; }
.doux { color: var(--texte-doux); }
.petit { font-size: 14px; }
.tres-petit { font-size: 12.5px; }
.centre { text-align: center; }
.manuscrit { font-family: "Ms Madi", cursive; font-size: 34px; line-height: 1; color: var(--accent-texte); font-weight: 400; }
.sauter { position: fixed; left: 12px; top: calc(var(--haut-sur) + 8px); z-index: 70; padding: 10px 14px; border-radius: 12px; background: var(--carte); color: var(--accent-texte); font-weight: 600; transform: translateY(-160%); transition: transform 160ms var(--ease-out); }
.sauter:focus { transform: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chiffres { font-variant-numeric: tabular-nums; }

/* ---------- Coquille ---------- */
.coquille { min-height: 100dvh; }
.cadre { min-width: 0; display: flex; flex-direction: column; min-height: 100dvh; }
.entete {
  position: sticky; top: 0; z-index: 15; background: var(--fond);
  display: flex; align-items: center; gap: 2px; padding: var(--haut-sur) 8px 0; height: calc(52px + var(--haut-sur)); flex: none;
  transition: box-shadow var(--duree) ease;
}
.entete.defile { box-shadow: 0 1px 0 var(--ligne); }
.entete-bouton {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; flex: none; position: relative;
  transition: background var(--duree) ease, transform 160ms var(--ease-out);
}
.entete-bouton:active { transform: scale(.94); background: var(--voile); }
.entete-titre { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 4px; font-weight: 600; font-size: 17px; }
.entete-titre > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entete-titre .ic { width: 18px; height: 18px; color: var(--texte-doux); }
.entete-espace { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 12px; min-height: 44px; max-width: 100%; transition: background var(--duree) ease; }
.entete-espace > span:not(.pastille) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entete-espace:active { background: var(--voile); }
.entete-espace[aria-expanded="true"] .ic { transform: rotate(180deg); }
.entete-espace .ic { transition: transform var(--duree) var(--ease-out); }
.assistant { color: var(--accent-texte); }
.pastille { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--pastille, var(--violet)); }
.pastille-grande { width: 14px; height: 14px; }
.pastille-ocsia { --pastille: var(--violet); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pastille-ocsia { --pastille: var(--pastel); } }
:root[data-theme="dark"] .pastille-ocsia { --pastille: var(--pastel); }

.contenu { flex: 1; padding: 4px 20px calc(var(--barre-h) + 48px); outline: none; position: relative; }
.contenu.sans-barre { padding-bottom: calc(40px + var(--bas-sur)); }
.ecran-entree { animation: entree 220ms var(--ease-out); }
@keyframes entree { from { opacity: 0; transform: translateY(6px); } }

/* Bandeau hors ligne */
.bandeau {
  display: flex; align-items: center; gap: 8px; margin: 0 16px 6px; padding: 9px 12px; border-radius: 12px;
  background: var(--or-voile); color: var(--or-texte); font-size: 13.5px; line-height: 1.35;
}

/* ---------- Barre du bas : creusée en courbe autour du « + » ---------- */
.barre {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--barre-h); z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: start; padding: 8px max(env(safe-area-inset-right, 0px), 0px) 0 max(env(safe-area-inset-left, 0px), 0px);
}
.barre-fond { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; filter: drop-shadow(0 -6px 16px rgba(36, 21, 43, .08)); overflow: visible; }
.barre-fond path { fill: var(--barre-fond); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .barre-fond path { stroke: var(--ligne); stroke-width: 1; } }
:root[data-theme="dark"] .barre-fond path { stroke: var(--ligne); stroke-width: 1; }
.onglet {
  text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 50px; justify-content: center;
  font-size: 11px; font-weight: 600; color: var(--texte-doux); position: relative; transition: transform 160ms var(--ease-out), color var(--duree) ease;
}
.onglet:active { transform: scale(.94); }
.onglet[aria-current="page"] { color: var(--accent-texte); }
.onglet .ic { width: 25px; height: 25px; }
.onglet .badge { position: absolute; top: 1px; left: calc(50% + 6px); }
.onglet-plus { position: relative; height: 50px; }
.plus {
  position: absolute; left: 50%; top: -30px; transform: translateX(-50%);
  width: 60px; height: 60px; border-radius: 50%; background: var(--accent); color: var(--accent-contraste);
  display: grid; place-items: center; box-shadow: 0 10px 22px -10px rgba(36, 21, 43, .45);
  transition: transform 160ms var(--ease-out), background var(--duree) ease;
}
.plus:active { transform: translateX(-50%) scale(.95); }
.plus .ic { width: 28px; height: 28px; stroke-width: 2; transition: transform var(--duree) var(--ease-out); }
.plus.ouvert .ic { transform: rotate(45deg); }

.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-contraste);
  font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; font-variant-numeric: tabular-nums;
}
.badge-doux { background: var(--voile); color: var(--accent-texte); }
.badge-ocsia { background: var(--violet); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge-ocsia, :root:not([data-theme="light"]) .rond-ic.fond-ocsia { background: var(--pastel); color: var(--prune); } }
:root[data-theme="dark"] .badge-ocsia, :root[data-theme="dark"] .rond-ic.fond-ocsia { background: var(--pastel); color: var(--prune); }

/* ---------- Boutons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 20px;
  border-radius: var(--r-champ); font-weight: 600; font-size: 17px; text-align: center;
  transition: transform 160ms var(--ease-out), background var(--duree) ease, box-shadow var(--duree) ease;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn-principal { background: var(--accent); color: var(--accent-contraste); }
.btn-second { background: var(--carte); color: var(--accent-texte); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent); }
.btn-texte { color: var(--accent-texte); min-height: 44px; }
.btn-danger { color: var(--erreur); min-height: 44px; }
.btn-compact { width: auto; min-height: 44px; padding: 0 16px; font-size: 15px; border-radius: 12px; }
.btn-ligne { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--accent-texte); background: var(--accent-voile); }
.btn.occupe { position: relative; color: transparent; }
.btn.occupe::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--accent-contraste); border-right-color: transparent; animation: tourne 700ms linear infinite; }
.btn-second.occupe::after { border-color: var(--accent-texte); border-right-color: transparent; }
@keyframes tourne { to { transform: rotate(360deg); } }
.actions-pile { display: grid; gap: 10px; }

/* ---------- Listes et groupes ---------- */
.groupe { margin-top: 26px; }
.groupe-titre { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.groupe-titre h2 { font-size: 15px; font-weight: 600; }
.groupe-titre .compte { font-size: 13px; color: var(--texte-doux); }
.ligne {
  display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--ligne); min-height: 56px; width: 100%; text-align: left;
  text-decoration: none; color: inherit;
}
.ligne:last-child { border-bottom: 0; }
button.ligne, a.ligne { transition: background var(--duree) ease; border-radius: 0; }
button.ligne:active, a.ligne:active { background: var(--accent-voile); }
.ligne-corps { flex: 1; min-width: 0; }
.ligne-titre { font-weight: 600; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.ligne-sous { font-size: 14px; color: var(--texte-doux); line-height: 1.35; margin-top: 2px; overflow-wrap: anywhere; }
.ligne-fin { font-size: 13px; color: var(--texte-doux); flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.ligne .chevron { color: var(--texte-doux); opacity: .7; }
.carte { background: var(--carte); border-radius: var(--r-carte); padding: 16px 18px; box-shadow: var(--ombre); }
.rond-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; background: var(--voile); color: var(--accent-texte); }
.rond-ic.neutre { color: var(--texte); }
.rond-ic.fond-ocsia { background: var(--violet); color: #fff; }
.rond-ic.retard { background: var(--or-voile); color: var(--or-texte); }
.case { width: 24px; height: 24px; border-radius: 8px; border: 1.75px solid color-mix(in srgb, var(--texte-doux) 60%, transparent); flex: none; display: grid; place-items: center; color: var(--accent-contraste); }
.heure { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--texte-doux); width: 44px; flex: none; }
.heure.forte { color: var(--texte); font-weight: 600; }
.etiquette { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 8px; background: var(--voile); color: var(--texte); white-space: nowrap; }
.etiquette-or { background: var(--or-voile); color: var(--or-texte); }
.etiquette-accent { background: var(--accent-voile); color: var(--accent-texte); }
.vide-etat { text-align: center; padding: 40px 16px 24px; color: var(--texte-doux); }
.vide-etat .rond-ic { margin: 0 auto 14px; width: 52px; height: 52px; border-radius: 17px; }
.vide-etat p + p { margin-top: 6px; }
.vide-etat strong { display: block; color: var(--texte); font-size: 17px; font-weight: 600; }
.vide-etat .btn { margin-top: 18px; }
.contenu .salut + .encadre, .contenu > .encadre, .liste-messages > .encadre { margin-top: 20px; }
.encadre { background: var(--voile); border-radius: 16px; padding: 14px 16px; font-size: 14.5px; line-height: 1.45; }
.encadre strong { display: block; font-size: 15.5px; margin-bottom: 4px; }
.encadre .btn-ligne { margin-top: 10px; background: var(--carte); }

/* Squelettes de chargement */
.squelette { pointer-events: none; }
.squelette i { display: block; height: 12px; border-radius: 6px; background: var(--squelette); animation: pouls 1.4s ease-in-out infinite; }
.squelette .ligne { gap: 14px; }
.squelette .rond { width: 40px; height: 40px; border-radius: 13px; flex: none; }
.squelette .l1 { width: 62%; height: 14px; } .squelette .l2 { width: 86%; margin-top: 8px; } .squelette .l3 { width: 44%; margin-top: 8px; }
@keyframes pouls { 50% { opacity: .55; } }

/* ---------- Puces de filtre ---------- */
.puces { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 2px 20px; scroll-padding: 20px; }
.puces::-webkit-scrollbar { display: none; }
.puce {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 18px;
  font-size: 14px; font-weight: 600; color: var(--texte); background: var(--carte); box-shadow: inset 0 0 0 1px var(--ligne);
  transition: transform 160ms var(--ease-out), background var(--duree) ease, color var(--duree) ease;
}
.puce:active { transform: scale(.96); }
.puce[aria-selected="true"], .puce[aria-pressed="true"] { background: var(--accent); color: var(--accent-contraste); box-shadow: none; }
.puce .nb { font-size: 12px; font-weight: 700; opacity: .75; font-variant-numeric: tabular-nums; }
.puces-cat .puce { height: 32px; font-size: 13px; font-weight: 500; background: transparent; }
.puces-cat .puce[aria-pressed="true"] { background: var(--accent-voile); color: var(--accent-texte); box-shadow: none; font-weight: 600; }

/* ---------- Messages ---------- */
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--voile); color: var(--accent-texte); display: grid; place-items: center; font-weight: 700; font-size: 15px; position: relative; flex: none; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.source { position: absolute; right: -4px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%; background: var(--carte); color: var(--texte); display: grid; place-items: center; box-shadow: 0 0 0 2px var(--fond); }
.source .ic { width: 12px; height: 12px; stroke-width: 2; }
.etoiles { display: inline-flex; gap: 1px; flex: none; }
.etoiles .ic { width: 13px; height: 13px; stroke-width: 1.6; color: color-mix(in srgb, var(--texte-doux) 40%, transparent); }
.etoiles .ic.pleine { color: var(--or); fill: var(--or); }
.liste-messages { margin-top: 6px; }
.glisse { position: relative; overflow: hidden; margin: 0 -20px; }
.glisse::after { content: ""; position: absolute; left: 20px; right: 20px; bottom: 0; height: 1px; background: var(--ligne); pointer-events: none; }
.glisse:last-of-type::after { display: none; }
.glisse-action { position: absolute; top: 0; bottom: 0; width: 50%; display: flex; flex-direction: column; justify-content: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 0 22px; }
.glisse-action.gere { left: 0; align-items: flex-start; background: var(--ok); color: #fff; }
.glisse-action.repondre { right: 0; align-items: flex-end; background: var(--accent); color: var(--accent-contraste); }
.msg { display: flex; align-items: flex-start; gap: 12px; padding: 14px 20px; min-height: 56px; width: 100%; text-align: left; background: var(--fond); position: relative; touch-action: pan-y; color: inherit; transition: background var(--duree) ease; }
.msg.glisse-en-cours { transition: none; }
.msg.revient { transition: transform 220ms var(--ease-out), background var(--duree) ease; }
.msg:active { background: color-mix(in srgb, var(--accent) 6%, var(--fond)); }
.msg-tete { display: flex; align-items: baseline; gap: 8px; }
.msg-nom { font-weight: 600; font-size: 16px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-quand { font-size: 12.5px; color: var(--texte-doux); font-variant-numeric: tabular-nums; flex: none; }
.msg-objet { font-size: 15px; margin-top: 1px; overflow-wrap: anywhere; }
.msg-apercu { font-size: 14px; color: var(--texte-doux); line-height: 1.35; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.msg-meta { display: flex; align-items: center; gap: 8px; margin-top: 7px; flex-wrap: wrap; }
.msg.lu .msg-nom { font-weight: 500; }
.msg.lu .msg-objet { color: var(--texte-doux); }
.point { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 18px; }
.point.vide { background: transparent; }
.indice-glisser { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 13px; color: var(--texte-doux); margin: 14px 0 0; text-align: center; }

/* ---------- Feuilles, voile, menus ---------- */
.voile-scene { position: fixed; inset: 0; background: rgba(36, 21, 43, .42); z-index: 30; opacity: 0; transition: opacity 200ms ease; }
.voile-scene.visible { opacity: 1; }
.voile-scene.menu { z-index: 14; }
.feuille {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; background: var(--carte); border-radius: var(--r-feuille) var(--r-feuille) 0 0;
  padding: 10px 20px calc(28px + var(--bas-sur)); box-shadow: var(--ombre-feuille); max-height: calc(100dvh - var(--haut-sur) - 24px); overflow-y: auto; overscroll-behavior: contain;
  transform: translateY(100%); transition: transform 240ms var(--ease-drawer);
}
.feuille.visible { transform: translateY(0); }
.feuille:focus { outline: none; }
.menu-deroulant:focus { outline: none; }
.feuille.sort { transition-duration: 180ms; }
.poignee-zone { touch-action: none; padding: 0 0 6px; margin: -10px -20px 0; padding-top: 10px; cursor: grab; }
.poignee { width: 40px; height: 5px; border-radius: 3px; background: var(--ligne); margin: 0 auto 8px; }
.feuille h2 { font-size: 20px; font-weight: 600; margin-bottom: 4px; padding-right: 44px; }
.fermer { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; z-index: 1; }
.fermer span { width: 36px; height: 36px; border-radius: 50%; background: var(--voile); display: grid; place-items: center; }
.fermer .ic { width: 18px; height: 18px; }
.menu-deroulant {
  position: fixed; left: 16px; right: 16px; top: calc(var(--haut-sur) + 52px); z-index: 31; background: var(--carte); border-radius: var(--r-carte);
  padding: 8px; box-shadow: 0 24px 50px -20px rgba(36, 21, 43, .45), 0 0 0 1px var(--ligne);
  transform-origin: 50% 0; transform: scale(.96) translateY(-4px); opacity: 0; transition: transform 180ms var(--ease-out), opacity 180ms var(--ease-out);
  max-height: calc(100dvh - var(--haut-sur) - 120px); overflow-y: auto; overscroll-behavior: contain;
}
.menu-deroulant.visible { transform: none; opacity: 1; }
.menu-deroulant .ligne { padding: 12px 10px; border: 0; border-radius: 14px; min-height: 52px; }
.menu-deroulant .ligne[aria-current="true"] { background: var(--accent-voile); }
.menu-deroulant .sep { height: 1px; background: var(--ligne); margin: 6px 10px; }
.liste-actions { margin-top: 8px; }
.liste-actions .ligne { padding: 12px 4px; min-height: 52px; gap: 14px; }
.liste-actions .ligne .ic { color: var(--accent-texte); }
.liste-actions .ligne.danger, .liste-actions .ligne.danger .ic { color: var(--erreur); }

/* Toast */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--barre-h) + 14px); z-index: 40; margin: 0 auto; max-width: 440px;
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 16px;
  background: var(--prune); color: #F6F1F8; font-size: 15px; box-shadow: 0 16px 34px -16px rgba(0, 0, 0, .55);
  transform: translateY(12px); opacity: 0; transition: transform 220ms var(--ease-out), opacity 220ms var(--ease-out);
}
.toast.visible { transform: none; opacity: 1; }
.toast span { flex: 1; }
.toast button { color: var(--pastel); font-weight: 700; min-height: 36px; padding: 0 8px; border-radius: 10px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast { background: #F2ECF5; color: var(--prune); } :root:not([data-theme="light"]) .toast button { color: var(--violet); } }
:root[data-theme="dark"] .toast { background: #F2ECF5; color: var(--prune); }
:root[data-theme="dark"] .toast button { color: var(--violet); }
.sans-barre-visible .toast, body.sans-barre .toast { bottom: calc(20px + var(--bas-sur)); }

/* Grille d'ajout rapide */
.grille-ajout { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 6px; margin-top: 16px; }
.ajout { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 2px 8px; border-radius: 16px; font-size: 12.5px; font-weight: 600; text-align: center; line-height: 1.2; transition: transform 160ms var(--ease-out), background var(--duree) ease; }
.ajout:active { transform: scale(.95); background: var(--voile); }
.ajout .rond-ic { width: 52px; height: 52px; border-radius: 17px; }
.ajout.frequent .rond-ic { background: var(--accent); color: var(--accent-contraste); }
.choix-espace { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 14px -20px 0; padding: 0 20px; }
.choix-espace::-webkit-scrollbar { display: none; }
.formulaire-rapide { margin-top: 14px; display: grid; gap: 10px; }
.champ-texte { width: 100%; border: 0; background: var(--fond); border-radius: var(--r-champ); padding: 13px 14px; min-height: 52px; box-shadow: inset 0 0 0 1px var(--ligne); resize: vertical; line-height: 1.4; transition: box-shadow var(--duree) ease; }
.champ-texte:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.champ-texte::placeholder { color: var(--texte-doux); opacity: .85; }
.etiquette-champ { font-size: 14px; font-weight: 600; display: block; margin-bottom: 6px; }
.message-champ { font-size: 14px; color: var(--texte-doux); min-height: 1.4em; }
.message-champ.erreur { color: var(--erreur); }
.message-champ.ok { color: var(--ok); }

/* ---------- Accueil ---------- */
.salut { margin-top: 10px; }
.salut .date { font-size: 14px; color: var(--texte-doux); margin-top: 6px; }
.resume { font-family: "Gilda Display", serif; font-size: 24px; line-height: 1.3; margin-top: 14px; text-wrap: pretty; }
.bloc { background: var(--carte); border-radius: var(--r-carte); padding: 14px 16px 6px; box-shadow: var(--ombre); margin-top: 14px; transition: transform 200ms var(--ease-in-out), box-shadow var(--duree) ease; }
.bloc-tete { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.bloc-tete h2 { flex: 1; font-size: 16px; }
.bloc-tete .poignee-tri { color: var(--texte-doux); opacity: .6; width: 44px; height: 44px; display: grid; place-items: center; margin: -10px -10px -10px 0; }
.bloc .ligne { padding: 10px 0; min-height: 48px; }
.bloc-pied { padding: 8px 0 6px; font-size: 14px; }
.bloc-pied button { color: var(--accent-texte); text-decoration: underline; text-underline-offset: .18em; min-height: 36px; }
.tri-actif .bloc { box-shadow: var(--ombre), inset 0 0 0 1.5px var(--accent); }
.tri-boutons { display: flex; gap: 6px; }
.tri-boutons button { width: 40px; height: 40px; border-radius: 12px; background: var(--voile); display: grid; place-items: center; }
.priorites { margin-top: 18px; }
.priorite { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--ligne); align-items: flex-start; width: 100%; text-align: left; }
.priorite:last-child { border: 0; }
.priorite .num { font-family: "Gilda Display", serif; font-size: 26px; line-height: 1; color: var(--accent-texte); width: 22px; flex: none; padding-top: 2px; }
.voir-tout { margin-top: 22px; }

/* ---------- Choix de disposition ---------- */
.options { display: grid; gap: 12px; margin-top: 22px; }
.option {
  display: grid; grid-template-columns: 1fr 96px; gap: 14px; align-items: center; text-align: left; padding: 16px 16px 16px 18px;
  background: var(--carte); border-radius: var(--r-carte); box-shadow: inset 0 0 0 1px var(--ligne); transition: transform 160ms var(--ease-out), box-shadow var(--duree) ease;
}
.option:active { transform: scale(.985); }
.option[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.option-nom { font-weight: 600; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.option-desc { font-size: 14px; color: var(--texte-doux); margin-top: 4px; line-height: 1.35; }
.option .coche { width: 22px; height: 22px; border-radius: 50%; border: 1.75px solid var(--ligne); display: grid; place-items: center; color: var(--accent-contraste); flex: none; margin-left: auto; }
.option[aria-checked="true"] .coche { background: var(--accent); border-color: var(--accent); }
.option:not([aria-checked="true"]) .coche .ic { visibility: hidden; }
.croquis { width: 96px; height: 84px; border-radius: 12px; background: var(--fond); box-shadow: inset 0 0 0 1px var(--ligne); padding: 10px; display: flex; flex-direction: column; gap: 5px; }
.croquis i { display: block; height: 6px; border-radius: 3px; background: var(--ligne); }
.croquis i.a { background: var(--accent); opacity: .85; }
.croquis .deux { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.croquis .deux i { height: 22px; border-radius: 5px; }
.croquis .w40 { width: 40%; } .croquis .w45 { width: 45%; } .croquis .w55 { width: 55%; } .croquis .w60 { width: 60%; } .croquis .w65 { width: 65%; }
.croquis .w70 { width: 70%; } .croquis .w75 { width: 75%; } .croquis .w85 { width: 85%; } .croquis .w90 { width: 90%; height: 9px; } .croquis .ecart { margin-top: 6px; }

/* ---------- Bienvenue, verrou, états pleins ---------- */
.plein { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: calc(34px + var(--haut-sur)) 28px calc(28px + var(--bas-sur)); min-height: 100dvh; }
.plein .logo { width: 128px; height: auto; margin-top: 40px; }
.plein .mot { font-family: "Gilda Display", serif; font-size: 22px; letter-spacing: .05em; margin-top: 18px; }
.plein h1 { font-size: 30px; margin-top: 34px; }
.plein p.doux, .plein .texte { max-width: 30ch; margin-top: 12px; color: var(--texte-doux); font-size: 16px; }
.plein .manuscrit { font-size: 46px; margin-top: 26px; }
.plein .actions { width: 100%; max-width: 420px; display: grid; gap: 10px; margin-top: auto; padding-top: 36px; }
.filigrane { position: relative; isolation: isolate; }
.filigrane::before { content: ""; position: absolute; z-index: -1; width: 340px; height: 340px; left: 50%; top: 42%; transform: translate(-50%, -50%); background: url("img/logo-violet.png") center / contain no-repeat; opacity: .07; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .filigrane::before { background-image: url("img/logo-pastel.png"); opacity: .06; } }
:root[data-theme="dark"] .filigrane::before { background-image: url("img/logo-pastel.png"); opacity: .06; }
.plein.filigrane > h1 { margin-top: auto; }
.plein .code { font-size: 13px; color: var(--texte-doux); margin-top: 18px; font-variant-numeric: tabular-nums; }

.hors-ligne { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 8px 24px; }
.hors-ligne .logo { width: 88px; height: auto; }
.hors-ligne h1 { margin-top: 26px; font-size: 28px; }
.hors-ligne p { max-width: 30ch; margin-top: 10px; }
.hors-ligne .actions { width: 100%; max-width: 360px; margin-top: 26px; }

/* Chargement : le cercle du logo se trace comme au crayon (seul mouvement signature) */
.chargement { position: fixed; inset: 0; z-index: 60; background: var(--fond); display: grid; place-items: center; transition: opacity 220ms var(--ease-out); }
.chargement.sort { opacity: 0; pointer-events: none; }
.chargement-corps { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.chargement p { font-size: 15px; color: var(--texte-doux); min-height: 1.4em; }
.trace { width: 112px; height: auto; display: block; -webkit-mask-image: conic-gradient(from 188deg, #000 var(--trace), transparent 0); mask-image: conic-gradient(from 188deg, #000 var(--trace), transparent 0); }
.trace.anime { animation: tracer 1100ms var(--ease-in-out) forwards; }
.trace.boucle { animation: tracer 1100ms var(--ease-in-out) infinite; }
@keyframes tracer { from { --trace: 0deg; } to { --trace: 360deg; } }
.tirer { position: fixed; left: 50%; top: calc(var(--haut-sur) + 4px); width: 36px; height: 36px; margin-left: -18px; transform: translateY(0); z-index: 16; pointer-events: none; opacity: 0; }
.tirer .trace { width: 36px; }
.tirer.actif { opacity: 1; }
.tirer.relache { transition: transform 220ms var(--ease-out), opacity 220ms var(--ease-out); }

/* ---------- Vue d'ensemble ---------- */
.groupe-espace { margin-top: 24px; }
.groupe-espace .groupe-titre { align-items: center; }
.groupe-espace h2 { display: flex; align-items: center; gap: 9px; font-size: 16px; min-width: 0; }
.ouvrir { font-size: 13px; font-weight: 600; color: var(--accent-texte); display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 4px; flex: none; }

/* ---------- Détail d'un message ---------- */
.detail-tete { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.detail-tete .avatar { width: 48px; height: 48px; font-size: 16px; }
.detail-objet { font-family: "Gilda Display", serif; font-size: 24px; line-height: 1.2; margin-top: 18px; text-wrap: pretty; overflow-wrap: anywhere; }
.detail-corps { margin-top: 12px; font-size: 16px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.actions-rapides { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 18px; }
.action-rapide { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 14px; font-size: 12px; font-weight: 600; color: var(--texte); background: var(--carte); box-shadow: inset 0 0 0 1px var(--ligne); text-align: center; line-height: 1.2; transition: transform 160ms var(--ease-out); min-height: 64px; justify-content: center; }
.action-rapide:active { transform: scale(.96); }
.action-rapide .ic { width: 22px; height: 22px; color: var(--accent-texte); }
.contexte { margin-top: 4px; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; }
.contexte dt { color: var(--texte-doux); }
.contexte dd { margin: 0; overflow-wrap: anywhere; }
.fil-personne .bulle { background: var(--carte); border-radius: 16px 16px 16px 4px; padding: 10px 14px; font-size: 14.5px; line-height: 1.4; box-shadow: inset 0 0 0 1px var(--ligne); white-space: pre-line; overflow-wrap: anywhere; }
.fil-personne .bulle.moi { background: var(--accent-voile); border-radius: 16px 16px 4px 16px; margin-left: 32px; box-shadow: none; }
.fil-personne .quand { font-size: 12px; color: var(--texte-doux); margin: 10px 0 4px; display: flex; gap: 6px; align-items: center; }
.fil-personne .quand.moi { justify-content: flex-end; }
.reponse {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--carte); padding: 10px 16px calc(14px + var(--bas-sur)); box-shadow: var(--ombre-feuille);
  border-radius: 20px 20px 0 0;
}
.reponse .champ { display: flex; align-items: flex-end; gap: 8px; }
.reponse textarea { flex: 1; font-size: 16px; line-height: 1.4; resize: none; border: 0; background: var(--fond); border-radius: var(--r-champ); padding: 12px 14px; min-height: 48px; max-height: 40dvh; color: var(--texte); box-shadow: inset 0 0 0 1px var(--ligne); }
.reponse textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.reponse textarea::placeholder { color: var(--texte-doux); }
.envoyer { width: 48px; height: 48px; border-radius: 14px; background: var(--accent); color: var(--accent-contraste); display: grid; place-items: center; flex: none; transition: transform 160ms var(--ease-out); }
.envoyer:active:not(:disabled) { transform: scale(.94); }
.reponse-mode { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--texte-doux); margin-bottom: 8px; }
.contenu.avec-reponse { padding-bottom: calc(200px + var(--bas-sur)); }

/* ---------- Agenda ---------- */
.jour { margin-top: 22px; }
.jour-titre { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.jour-titre h2 { font-size: 16px; }
.jour-titre span { font-size: 13px; color: var(--texte-doux); }
.jour-vide { font-size: 14px; color: var(--texte-doux); padding: 4px 0 2px; }

/* ---------- Réglages ---------- */
.reglage { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--ligne); min-height: 58px; width: 100%; text-align: left; color: inherit; }
.reglage:last-child { border: 0; }
.reglage-corps { flex: 1; min-width: 0; }
.reglage-nom { font-weight: 600; font-size: 16px; }
.reglage-desc { font-size: 13.5px; color: var(--texte-doux); line-height: 1.35; margin-top: 2px; }
.interrupteur { width: 50px; height: 30px; border-radius: 15px; background: color-mix(in srgb, var(--texte-doux) 30%, var(--ligne)); position: relative; flex: none; transition: background var(--duree) ease; }
.interrupteur::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform var(--duree) var(--ease-out); }
.interrupteur[aria-checked="true"] { background: var(--accent); }
.interrupteur[aria-checked="true"]::after { transform: translateX(20px); }
.valeur { font-size: 15px; color: var(--accent-texte); font-weight: 600; display: inline-flex; align-items: center; gap: 2px; flex: none; min-height: 44px; font-variant-numeric: tabular-nums; }
.valeur select { appearance: none; -webkit-appearance: none; cursor: pointer; background-color: var(--fond); color: var(--accent-texte); }
.valeur select option { background-color: var(--carte); color: var(--texte); }
.valeur input[type="time"], .valeur select { border: 0; background: transparent; color: var(--accent-texte); font-weight: 600; font-size: 15px; padding: 6px 0; min-height: 40px; text-align: right; }
.sous-liste { margin: 6px 0 2px; padding-left: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.sous-liste li { font-size: 12.5px; padding: 3px 9px; border-radius: 8px; background: var(--voile); }
.canaux { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.canal { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 16px; background: var(--carte); box-shadow: inset 0 0 0 1px var(--ligne); font-size: 13px; font-weight: 600; position: relative; text-align: center; min-height: 76px; justify-content: center; }
.canal[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.canal .coche { position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: var(--accent-contraste); display: grid; place-items: center; }
.canal:not([aria-pressed="true"]) .coche { display: none; }
.canal > .ic { color: var(--accent-texte); }
.note-bas { font-size: 13px; color: var(--texte-doux); margin-top: 18px; line-height: 1.45; }

/* ---------- Vues de l'espace (« + » en option) ---------- */
.vues-bande { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 14px -20px 0; padding: 0 20px 2px; }
.vues-bande::-webkit-scrollbar { display: none; }
.bande { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 14px -20px 0; padding: 0 20px 6px; }
.bande::-webkit-scrollbar { display: none; }
.chiffre { flex: none; background: var(--carte); border-radius: 16px; padding: 12px 14px; min-width: 112px; box-shadow: var(--ombre); text-align: left; }
.chiffre b { display: block; font-size: 24px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.chiffre span { font-size: 12.5px; color: var(--texte-doux); }
.carte-mentale { position: relative; height: 340px; margin-top: 10px; }
.carte-mentale svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.carte-mentale svg path { stroke: var(--ligne); stroke-width: 1.75; fill: none; }
.noeud { position: absolute; transform: translate(-50%, -50%); background: var(--carte); border-radius: 14px; padding: 8px 12px; font-size: 13px; font-weight: 600; line-height: 1.25; box-shadow: var(--ombre), inset 0 0 0 1px var(--ligne); text-align: center; width: max-content; max-width: 29%; overflow-wrap: anywhere; transition: transform 160ms var(--ease-out); }
.noeud.centre { max-width: 38%; }
.noeud:active { transform: translate(-50%, -50%) scale(.96); }
.noeud.centre { background: var(--accent); color: var(--accent-contraste); font-size: 16px; padding: 14px 18px; border-radius: 20px; box-shadow: none; }
.noeud small { display: block; font-weight: 400; color: var(--texte-doux); font-size: 11.5px; }
.noeud.centre small { color: inherit; opacity: .8; }
.page-notion h2 { font-family: "Gilda Display", serif; font-weight: 400; font-size: 22px; margin-top: 26px; }
.page-notion ul { list-style: none; padding: 0; margin-top: 6px; }

/* Assistant et recherche */
.recherche-champ { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 0 6px 0 14px; border-radius: var(--r-champ); background: var(--fond); box-shadow: inset 0 0 0 1px var(--ligne); }
.recherche-champ:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.recherche-champ input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 14px 0; outline: none; }
.recherche-champ .ic { color: var(--texte-doux); }
.etapes { margin-top: 12px; padding-left: 0; list-style: none; counter-reset: e; display: grid; gap: 10px; }
.etapes li { counter-increment: e; display: grid; grid-template-columns: 28px 1fr; gap: 8px; font-size: 15px; line-height: 1.45; }
.etapes li::before { content: counter(e); font-family: "Gilda Display", serif; font-size: 20px; line-height: 1.1; color: var(--accent-texte); }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.resultats { margin-top: 10px; min-height: 120px; }

/* Lecteur de code QR */
.video-qr { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 20px; background: #000; margin-top: 14px; }

/* ---------- Ordinateur : trois colonnes ---------- */
.nav-bureau { display: none; }
.msg-detail-vide { display: none; }
@media (min-width: 1024px) {
  :root { --barre-h: 0px; }
  .barre { display: none; }
  .coquille { display: grid; grid-template-columns: 264px minmax(0, 1fr); }
  /* Sans volet (bienvenue, verrou, relier) : une seule colonne, sinon l'écran reste coincé dans les 264 px du volet. */
  .coquille:has(> .nav-bureau[hidden]) { grid-template-columns: minmax(0, 1fr); }
  .coquille:has(> .nav-bureau[hidden]) .contenu { margin-inline: auto; }
  .nav-bureau {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; overflow-y: auto;
    background: var(--carte); border-right: 1px solid var(--ligne); padding: 20px 14px;
  }
  .nav-bureau .marque { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; }
  .nav-bureau .marque img { width: 30px; height: auto; }
  .nav-bureau .marque b { font-family: "Gilda Display", serif; font-weight: 400; letter-spacing: .05em; font-size: 17px; }
  .nav-espace { color: var(--texte); display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-weight: 600; font-size: 15px; min-height: 44px; width: 100%; text-align: left; transition: background var(--duree) ease; }
  .nav-espace > span:not(.pastille):not(.badge):not(.rond-ic) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-espace[aria-current="true"] { background: var(--accent-voile); color: var(--accent-texte); }
  .nav-espace .rond-ic { width: 28px; height: 28px; border-radius: 9px; }
  .nav-partie { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; font-size: 15px; color: var(--texte); min-height: 40px; width: 100%; text-align: left; transition: background var(--duree) ease; }
  .nav-partie > span:not(.badge) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-partie .ic { width: 20px; height: 20px; color: var(--texte-doux); }
  .nav-partie[aria-current="page"] { background: var(--accent-voile); font-weight: 600; }
  .nav-partie[aria-current="page"] .ic { color: var(--accent-texte); }
  .nav-titre { font-size: 12.5px; color: var(--texte-doux); padding: 18px 12px 6px; font-weight: 600; }
  .nav-bas { margin-top: auto; padding-top: 12px; display: grid; gap: 4px; }
  .entete { padding: 0 24px; height: 64px; }
  .entete .selecteur-mobile { display: none; }
  .entete-titre { justify-content: flex-start; font-size: 15px; color: var(--texte-doux); }
  .contenu { padding: 8px 40px 48px; max-width: 880px; width: 100%; }
  .contenu.large { max-width: none; }
  .feuille { left: 50%; right: auto; bottom: auto; top: 50%; width: 520px; border-radius: var(--r-feuille); padding-bottom: 28px; transform: translate(-50%, -46%) scale(.98); opacity: 0; transition: transform 220ms var(--ease-out), opacity 220ms var(--ease-out); }
  .feuille.visible { transform: translate(-50%, -50%); opacity: 1; }
  .poignee-zone { display: none; }
  .menu-deroulant { left: 280px; right: auto; width: 380px; }
  .toast { bottom: 24px; }
  /* Messages : liste au centre, détail à droite */
  .messages-bureau { display: grid; grid-template-columns: 440px minmax(0, 1fr); margin: -8px -40px -48px; height: calc(100dvh - 64px); }
  .messages-bureau .colonne-liste { border-right: 1px solid var(--ligne); padding: 8px 22px 24px; min-width: 0; overflow-y: auto; overscroll-behavior: contain; }
  .messages-bureau .colonne-detail { overflow-y: auto; overscroll-behavior: contain; }
  .messages-bureau .glisse-action, .messages-bureau .glisse::after { display: none; }
  .messages-bureau .filtres { top: -8px; }
  .entete-titre { visibility: hidden; }
  .bureau-seul { display: block !important; }
  .messages-bureau .colonne-liste .puces { margin: 0 -22px; padding: 2px 22px; }
  .messages-bureau .glisse { margin: 0 -10px; border-bottom: 0; border-radius: 14px; overflow: hidden; }
  .messages-bureau .msg { padding: 12px 10px; border-radius: 14px; }
  .messages-bureau .msg[aria-current="true"] { background: var(--carte); box-shadow: var(--ombre); }
  .messages-bureau .colonne-detail { padding: 26px 40px 40px; min-width: 0; max-width: 820px; }
  .messages-bureau .detail-objet { font-size: 28px; }
  .messages-bureau .reponse { position: static; border-radius: var(--r-carte); box-shadow: var(--ombre); margin-top: 24px; padding: 14px 16px 16px; }
  .messages-bureau .actions-rapides { display: flex; flex-wrap: wrap; gap: 8px; }
  .messages-bureau .action-rapide { flex-direction: row; padding: 8px 14px; font-size: 14px; min-height: 44px; }
  .msg-detail-vide { display: grid; place-items: center; min-height: 60dvh; color: var(--texte-doux); text-align: center; }
  .accueil-bureau { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
  .contenu.avec-reponse { padding-bottom: 48px; }
}

/* Survols : seulement avec une souris précise (le doigt n'a pas de survol) */
@media (hover: hover) and (pointer: fine) {
  .nav-espace:hover:not([aria-current="true"]), .nav-partie:hover:not([aria-current="page"]) { background: color-mix(in srgb, var(--texte) 5%, transparent); }
  button.ligne:hover, a.ligne:hover, .priorite:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
  .msg:hover { background: color-mix(in srgb, var(--accent) 5%, var(--fond)); }
  .btn-principal:hover { background: color-mix(in srgb, var(--accent) 88%, var(--texte)); }
  .btn-second:hover, .action-rapide:hover, .puce:hover:not([aria-selected="true"]):not([aria-pressed="true"]), .option:hover, .canal:hover, .chiffre:hover, .noeud:not(.centre):hover { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 45%, var(--ligne)); }
  .entete-bouton:hover, .fermer:hover span, .ajout:hover { background: var(--voile); }
  .bloc-pied button:hover, .ouvrir:hover, .btn-texte:hover { text-decoration: underline; text-underline-offset: .18em; }
}

/* Divers */
.glisse.sortie .msg { transform: translateX(100%) !important; transition: transform 200ms var(--ease-out) !important; }
.glisse.sortie { opacity: 0; transition: opacity 200ms ease 60ms; }
.contenu.plein-cadre { padding: 0; }
.etiquette-lien { color: var(--accent-texte); }
.titre-bureau { display: none; }
.bureau-seul { display: none; }
.liste-actions .ligne[aria-pressed="true"] { background: var(--accent-voile); border-radius: 12px; }
.filtres { position: sticky; top: calc(52px + var(--haut-sur)); z-index: 5; background: var(--fond); margin: 0 -20px; padding: 0 20px 6px; }
@media (min-width: 1024px) { .titre-bureau { display: inline; } .filtres { top: 64px; margin: 0 -22px; padding: 0 22px 6px; } }

/* Mode réduit : on garde les fondus utiles, on retire les déplacements */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
  .trace.anime, .trace.boucle { animation: none; --trace: 360deg; }
  .feuille, .voile-scene, .menu-deroulant, .toast, .chargement { transition: opacity 160ms ease !important; }
  .squelette i { animation: none; }
}
@media (prefers-reduced-transparency: reduce) { .voile-scene { background: rgba(36, 21, 43, .6); } }

/* ---------- Chantier X (13/10/2026) : cocher une tâche, file d'attente hors ligne, notes vocales ---------- */
.ligne-tache { gap: 14px; }
.case-zone { width: 40px; height: 40px; display: grid; place-items: center; flex: none; }
.ligne-tache > .ligne-cible { border-bottom: 0; padding: 0; min-height: 0; flex: 1; min-width: 0; }
.case-tache {
  position: relative; flex: none; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; /* la case des maquettes validées */
  border: 1.75px solid color-mix(in srgb, var(--texte-doux) 60%, transparent); color: transparent; background: transparent;
  transition: background 160ms var(--ease-out), color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.case-tache::after { content: ""; position: absolute; inset: -10px; } /* zone de toucher de 44 px */
.case-tache:active { transform: scale(.9); }
.case-tache[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-contraste); }
.tache-faite .ligne-titre { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--texte-doux); }
.file-bandeau {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 14px; padding: 11px 14px; border-radius: 14px;
  background: var(--voile); color: var(--texte); font-size: 14.5px; font-weight: 600; text-align: left;
}
.file-bandeau > span { flex: 1; min-width: 0; }
.file-bandeau.refus { background: var(--or-voile); color: var(--or-texte); }
.file-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.file-actions-haut { justify-content: flex-end; margin: 6px 0 4px; }
.ligne-file, .ligne-vocal { align-items: flex-start; }
.ligne.lue .ligne-titre { font-weight: 500; }
.vocal { display: grid; justify-items: center; gap: 12px; padding: 14px 0 6px; }
.vocal-temps { font-family: "Gilda Display", serif; font-size: 36px; font-variant-numeric: tabular-nums; line-height: 1; }
.vocal-bouton { min-width: min(260px, 100%); }
.feuille.enregistre .vocal-temps { color: var(--accent-texte); }
.vocal-lecteur audio { display: block; width: 100%; margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .case-tache { transition: none; } .case-tache:active { transform: none; } }
@media (hover: hover) and (pointer: fine) { .case-tache:hover { background: var(--accent-voile); } .case-tache[aria-checked="true"]:hover { background: var(--accent); } }
