/* =============================================================================
   Cordeau — feuille de style de l'application
   Identité « Lagon » : sable, turquoise, corail — validée le 27 août 2026.
   Direction « Lagon » : Fraunces pour les titres, Outfit pour le texte,
   IBM Plex Mono pour les données et les identifiants (codes, montants, refs).
   ============================================================================= */
/* Caveat (OFL) : la main qui écrit les mentions — « Bon pour accord », etc.
   Servie en local, embarquée dans le PDF côté serveur avec le même fichier,
   pour que l'aperçu et le document signé se ressemblent au trait près. */
@font-face{
  font-family:'Caveat';
  src:url('/polices/Caveat-Mentions.ttf') format('truetype');
  font-weight:400;font-display:swap;
}
/* -----------------------------------------------------------------------------
   Palette « Lagon » — sable, turquoise, corail.
   Le corail (--accent-2) ne sert qu'aux accents vifs : dégradé d'avancement,
   confettis, retards. Le turquoise porte les actions.
   ----------------------------------------------------------------------------- */
:root{
  --ground:#F5EEE3; --surface:#FFFCF7; --surface-2:#F2E9DC; --surface-3:#EDE3D4;
  --ink:#12312F; --ink-2:#2C4A46; --muted:#6E7A73;
  --line:#E4D8C6; --line-strong:#D2BFA5;
  --accent:#0E8C86; --accent-ink:#FFFFFF; --accent-soft:#D7EDEA;
  --accent-2:#FF6B57; --accent-2-soft:#FFE1DB;
  --teal:#0E8C86; --teal-soft:#D7EDEA;
  --amber:#B5761A; --amber-soft:#F8E9CF;
  --red:#D9503C; --red-soft:#FBE0DA;
  --green:#2E8B6B; --green-soft:#D9EFE6;
  --shadow:0 1px 2px rgba(18,49,47,.05), 0 14px 30px -22px rgba(18,49,47,.45);
  --shadow-lg:0 26px 56px -26px rgba(18,49,47,.5);
  --r:16px;
  --r-petit:11px;
  --ressort:cubic-bezier(.34,1.4,.5,1);
}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){
  --ground:#0C201F; --surface:#123130; --surface-2:#173B39; --surface-3:#1A403D;
  --ink:#EAF3EF; --ink-2:#C6DAD4; --muted:#93A8A1;
  --line:#1F4A47; --line-strong:#2F6360;
  --accent:#4ECDC4; --accent-ink:#08201F; --accent-soft:#13403D;
  --accent-2:#FF8A73; --accent-2-soft:#3A211C;
  --teal:#4ECDC4; --teal-soft:#13403D;
  --amber:#E0B04E; --amber-soft:#33290F;
  --red:#FF8A73; --red-soft:#3A211C;
  --green:#5FC79E; --green-soft:#123A2E;
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 14px 30px -22px rgba(0,0,0,.85);
  --shadow-lg:0 26px 56px -26px rgba(0,0,0,.9);
}}
:root[data-theme="dark"]{
  --ground:#0C201F; --surface:#123130; --surface-2:#173B39; --surface-3:#1A403D;
  --ink:#EAF3EF; --ink-2:#C6DAD4; --muted:#93A8A1;
  --line:#1F4A47; --line-strong:#2F6360;
  --accent:#4ECDC4; --accent-ink:#08201F; --accent-soft:#13403D;
  --accent-2:#FF8A73; --accent-2-soft:#3A211C;
  --teal:#4ECDC4; --teal-soft:#13403D;
  --amber:#E0B04E; --amber-soft:#33290F;
  --red:#FF8A73; --red-soft:#3A211C;
  --green:#5FC79E; --green-soft:#123A2E;
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 14px 30px -22px rgba(0,0,0,.85);
  --shadow-lg:0 26px 56px -26px rgba(0,0,0,.9);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;background:var(--ground);color:var(--ink);
  font-family:"Outfit",system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:15px;line-height:1.5;-webkit-font-smoothing:antialiased;
  overscroll-behavior:none;
}
button,input,textarea,select{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.mono{font-family:"IBM Plex Mono",ui-monospace,monospace}

/* ---------- Shell ---------- */
#shell{display:flex;min-height:100vh}
aside.nav{
  width:230px;flex:none;background:var(--surface);border-right:1px solid var(--line);
  display:flex;flex-direction:column;position:sticky;top:0;height:100vh;
}
.brand{padding:16px 16px 12px;border-bottom:1px solid var(--line)}
.brand h1{
  font-family:"Fraunces",Georgia,serif;font-weight:700;font-size:1.35rem;
  margin:0;letter-spacing:-.02em;display:flex;align-items:center;gap:9px;
}
.brand h1 i{width:12px;height:12px;background:var(--accent);border-radius:2px;transform:rotate(45deg);display:block}
.brand p{margin:2px 0 0 21px;font-size:11px;color:var(--muted);font-family:"IBM Plex Mono",monospace;letter-spacing:.06em}

.soc-pick{padding:12px;flex:1 1 auto;overflow:auto;min-height:96px;border-bottom:1px solid var(--line)}
.soc-pick label{display:block;font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);margin-bottom:6px;font-family:"IBM Plex Mono",monospace}
.soc-list{display:flex;flex-direction:column;gap:3px}
.soc-btn{
  display:flex;align-items:center;gap:8px;padding:7px 9px;border-radius:var(--r);
  border:1px solid transparent;background:transparent;color:var(--ink-2);text-align:left;width:100%;font-size:13.5px;
}
.soc-btn:hover{background:var(--surface-2)}
.soc-btn[aria-pressed="true"]{background:var(--surface-3);color:var(--ink);border-color:var(--line);font-weight:500}
.dot{width:9px;height:9px;border-radius:2px;flex:none}
.soc-btn .cnt{margin-left:auto;font-size:11px;color:var(--muted);font-family:"IBM Plex Mono",monospace}
.soc-btn.child{padding-left:20px}
.soc-grp{
  display:flex;align-items:center;gap:7px;width:100%;padding:10px 9px 4px;margin-top:2px;
  background:transparent;border:0;border-radius:var(--r);text-align:left;cursor:pointer;color:var(--muted);
  font-family:"IBM Plex Mono",monospace;font-size:10px;letter-spacing:.13em;text-transform:uppercase;
}
.soc-grp:hover{color:var(--ink-2)}
.soc-grp[aria-pressed="true"]{color:var(--accent)}
.soc-grp .cnt{margin-left:auto;letter-spacing:0;font-size:11px}

nav.tabs{padding:8px 12px;display:flex;flex-direction:column;gap:2px;flex:none}
nav.tabs .sep{height:1px;background:var(--line);margin:8px 2px}
.tab{
  display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:var(--r);
  border:0;background:transparent;color:var(--ink-2);width:100%;text-align:left;font-size:14px;
}
.tab:hover{background:var(--surface-2);color:var(--ink)}
.tab[aria-current="page"]{background:var(--ink);color:var(--ground);font-weight:500}
.tab svg{width:17px;height:17px;flex:none}
.tab .badge{
  margin-left:auto;font-family:"IBM Plex Mono",monospace;font-size:10.5px;font-weight:600;
  background:var(--accent);color:var(--accent-ink);border-radius:20px;padding:1px 6px;min-width:19px;text-align:center;
}
.tab[aria-current="page"] .badge{background:var(--ground);color:var(--ink)}
.nav-foot{padding:10px 12px;border-top:1px solid var(--line);display:flex;gap:6px;flex-wrap:wrap}

main{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{
  position:sticky;top:0;z-index:20;background:color-mix(in srgb,var(--ground) 90%,transparent);
  backdrop-filter:blur(10px);border-bottom:1px solid var(--line);
  display:flex;align-items:center;gap:10px;padding:10px 20px;
}
.topbar h2{font-family:"Fraunces",Georgia,serif;font-size:1.2rem;margin:0;font-weight:600;letter-spacing:-.015em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar .btn{white-space:nowrap}
.topbar .socmob{display:none}
.topbar .sub{font-size:12px;color:var(--muted);font-family:"IBM Plex Mono",monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.spacer{flex:1}
.content{padding:20px;flex:1}
.mobbar{display:none}

/* ---------- Atoms ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  padding:8px 13px;border-radius:var(--r);border:1px solid var(--line-strong);
  background:var(--surface);color:var(--ink);font-size:13.5px;font-weight:500;min-height:38px;
}
.btn:hover{border-color:var(--ink-2)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.btn.primary:hover{filter:brightness(1.06)}
.btn.ghost{background:transparent;border-color:transparent;color:var(--muted)}
.btn.ghost:hover{background:var(--surface-2);color:var(--ink)}
.btn.sm{padding:5px 9px;min-height:30px;font-size:12.5px}
.btn.danger{color:var(--red);border-color:var(--red)}
.btn svg{width:16px;height:16px}
.inp,.sel,.ta{
  width:100%;background:var(--surface);border:1px solid var(--line-strong);border-radius:var(--r);
  padding:9px 11px;font-size:14px;min-height:40px;
}
.ta{min-height:90px;resize:vertical;font-family:inherit}
.inp::placeholder,.ta::placeholder{color:var(--muted)}
.field{display:flex;flex-direction:column;gap:5px}
.field>span{font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);font-family:"IBM Plex Mono",monospace}
.row{display:flex;gap:10px;flex-wrap:wrap}
.row>*{flex:1 1 160px;min-width:0}
.pill{
  display:inline-flex;align-items:center;gap:5px;font-family:"IBM Plex Mono",monospace;
  font-size:10px;letter-spacing:.07em;padding:2px 7px;border-radius:20px;font-weight:600;text-transform:uppercase;
  background:var(--surface-3);color:var(--muted);white-space:nowrap;
}
.pill.p1{background:var(--red-soft);color:var(--red)}
.pill.p2{background:var(--amber-soft);color:var(--amber)}
.pill.p3{background:var(--teal-soft);color:var(--teal)}
.pill.p4{background:var(--surface-3);color:var(--muted)}
.pill.ok{background:var(--green-soft);color:var(--green)}
.pill.warn{background:var(--amber-soft);color:var(--amber)}
.pill.late{background:var(--red-soft);color:var(--red)}
.empty{
  border:1px dashed var(--line-strong);border-radius:var(--r);padding:30px 20px;text-align:center;
  color:var(--muted);font-size:13.5px;background:var(--surface);
}
.empty b{display:block;color:var(--ink);font-size:15px;margin-bottom:4px;font-weight:600}
h3.sec{
  font-family:"Fraunces",Georgia,serif;font-size:1rem;font-weight:600;margin:0 0 10px;
  display:flex;align-items:center;gap:9px;letter-spacing:-.01em;
}
h3.sec .n{font-family:"IBM Plex Mono",monospace;font-size:11px;color:var(--muted);font-weight:400}
h3.sec::before{content:"";width:3px;height:14px;background:var(--accent);border-radius:2px}

/* ---------- Cartes tâches ---------- */
.tcard{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r);
  padding:10px 11px;display:flex;gap:10px;align-items:flex-start;position:relative;
  box-shadow:var(--shadow);touch-action:pan-y;
}
.tcard.done{opacity:.55}
.tcard.done .t-title{text-decoration:line-through;text-decoration-color:var(--muted)}
.tcard[data-prio="1"]{border-left:3px solid var(--red)}
.tcard[data-prio="2"]{border-left:3px solid var(--amber)}
.tcard[data-prio="3"]{border-left:3px solid var(--teal)}
.tcard[data-prio="4"]{border-left:3px solid var(--line-strong)}
.check{
  width:21px;height:21px;flex:none;border:1.5px solid var(--line-strong);border-radius:5px;
  background:var(--surface-2);display:grid;place-items:center;margin-top:1px;padding:0;
}
.check::after{
  content:"";width:9px;height:5px;border-left:2px solid var(--accent-ink);border-bottom:2px solid var(--accent-ink);
  transform:rotate(-45deg) scale(.4);opacity:0;transition:.13s;
}
.check[aria-checked="true"]{background:var(--accent);border-color:var(--accent)}
.check[aria-checked="true"]::after{opacity:1;transform:rotate(-45deg) scale(1)}
.t-main{flex:1;min-width:0}
.t-title{font-size:14px;font-weight:500;line-height:1.35;word-break:break-word;cursor:pointer}
.t-meta{display:flex;flex-wrap:wrap;gap:5px 8px;align-items:center;margin-top:5px;font-size:11.5px;color:var(--muted)}
.t-meta .mono{font-size:11px}
.t-proj{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;color:var(--muted)}
.grip{
  flex:none;width:30px;min-height:44px;align-self:stretch;border:0;color:var(--line-strong);
  cursor:grab;touch-action:none;display:grid;place-items:center;border-radius:5px;
  background:var(--surface-2);border:1px solid var(--line);margin:-2px 0;
}
.grip:hover{color:var(--accent);background:var(--accent-soft);border-color:var(--accent)}
.grip:active{cursor:grabbing}
.grip svg{width:16px;height:16px;pointer-events:none}
body.is-dragging{cursor:grabbing;user-select:none;-webkit-user-select:none}
body.is-dragging *{cursor:grabbing !important}
.subs{margin:8px 0 0 31px;display:flex;flex-direction:column;gap:6px}
.sub-line{display:flex;align-items:center;gap:8px;font-size:13px}
.sub-line .check{width:17px;height:17px;border-radius:4px}
.sub-line .check::after{width:7px;height:4px}
.sub-line.done span{text-decoration:line-through;color:var(--muted)}
.sub-line>span:not(.pill):not(.dot){flex:1;min-width:0;cursor:pointer}
.sub-line>span[contenteditable]{outline:0;border-bottom:1px dashed transparent}
.sub-line>span[contenteditable]:focus{border-bottom-color:var(--line-strong)}
.progress{height:3px;background:var(--surface-3);border-radius:2px;overflow:hidden;margin-top:7px}
.progress i{display:block;height:100%;background:var(--accent);border-radius:2px;transition:width .25s}

/* ---------- Drag ---------- */
.dragging{opacity:.35}
.drag-ghost{
  position:fixed;z-index:2000;pointer-events:none;box-shadow:var(--shadow-lg);
  transform:rotate(-1.2deg) scale(1.02);opacity:.97;border-radius:var(--r);
}
.drop-mark{height:3px;background:var(--accent);border-radius:2px;margin:2px 0;box-shadow:0 0 0 3px var(--accent-soft)}
.vgrid>.drop-mark,.pgrid>.drop-mark,.dgrid>.drop-mark{height:auto;min-height:110px;width:3px;margin:0;align-self:stretch}
.col-hot{background:var(--accent-soft) !important;border-color:var(--accent) !important}

/* ---------- Kanban ---------- */
.board{display:flex;gap:12px;overflow-x:auto;padding-bottom:10px;align-items:flex-start}
.col{
  flex:0 0 288px;background:var(--surface-2);border:1px solid var(--line);border-radius:var(--r);
  padding:10px;display:flex;flex-direction:column;gap:8px;max-height:calc(100vh - 190px);
}
.col-h{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--ink-2)}
.col-h .n{margin-left:auto;font-family:"IBM Plex Mono",monospace;font-size:11px;color:var(--muted);font-weight:400}
.col-body{display:flex;flex-direction:column;gap:8px;overflow-y:auto;min-height:40px;flex:1}

/* ---------- Projets ---------- */
.pgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(268px,1fr));gap:12px}
.pcard{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r);overflow:hidden;
  box-shadow:var(--shadow);display:flex;flex-direction:column;text-align:left;padding:0;position:relative;
}
.pcard:hover{border-color:var(--line-strong);transform:translateY(-1px)}
.pcover{height:104px;background:var(--surface-3);position:relative;overflow:hidden;flex:none}
.pcover img{width:100%;height:100%;object-fit:cover;display:block}
.pcover .ph{
  position:absolute;inset:0;display:grid;place-items:center;
  font-family:"Fraunces",Georgia,serif;font-size:2.1rem;font-weight:700;color:var(--surface);opacity:.9;
}
.pcover .soc{position:absolute;left:8px;top:8px;background:rgba(0,0,0,.55);color:#fff;border-radius:4px;padding:2px 7px;font-size:10px;font-family:"IBM Plex Mono",monospace;letter-spacing:.08em;backdrop-filter:blur(4px)}
.pcover .star{position:absolute;right:6px;top:6px;background:rgba(0,0,0,.45);border:0;border-radius:6px;padding:5px;color:#fff;line-height:0}
.pcover .star svg{width:15px;height:15px}
/* Outils de couverture : photo et suppression, lisibles sur une image comme
   sur un aplat de couleur, d'où le fond sombre translucide. */
.pcover-outils{position:absolute;right:6px;top:6px;display:flex;gap:4px}
.pcover-outils .btn{
  background:rgba(0,0,0,.45);border:0;border-radius:6px;padding:5px;color:#fff;line-height:0;
  backdrop-filter:blur(4px);
}
.pcover-outils .btn:hover{background:rgba(0,0,0,.68);color:#fff}
.pcover-outils .btn svg{width:15px;height:15px}
/* Corbeille d'une tâche : discrète, mais toujours présente — il n'y a pas de
   survol sur un téléphone. */
.tcard .t-sup{align-self:flex-start;color:var(--muted);padding:5px;line-height:0;opacity:.55}
.tcard .t-sup:hover{opacity:1;color:var(--red)}
.tcard .t-sup svg{width:15px;height:15px}
.sub-line [data-supprimer-tache]{color:var(--muted);padding:3px;line-height:0;opacity:.5}
.sub-line [data-supprimer-tache]:hover{opacity:1;color:var(--red)}
.sub-line [data-supprimer-tache] svg{width:13px;height:13px}
.pbody{padding:11px 12px 12px;display:flex;flex-direction:column;gap:7px;flex:1}
.pbody h4{margin:0;font-size:14.5px;font-weight:600;line-height:1.3}
.pbody .cli{font-size:12px;color:var(--muted)}
.pfoot{display:flex;align-items:center;gap:8px;margin-top:auto;font-size:11.5px;color:var(--muted);flex-wrap:wrap}
.pfoot>*{white-space:nowrap}
.pfoot .mono{font-size:11px}

/* ---------- Vignettes de tâches ---------- */
.vgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px;align-items:stretch}
.vcard{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r);overflow:hidden;
  box-shadow:var(--shadow);display:flex;flex-direction:column;position:relative;
  transition:border-color .12s ease, transform .12s ease;
}
.vcard:hover{border-color:var(--line-strong);transform:translateY(-1px)}
.vcard.done{opacity:.6}
.vcard.done .vtitle{text-decoration:line-through;text-decoration-color:var(--muted)}
.vcover{
  height:70px;position:relative;overflow:hidden;flex:none;cursor:grab;touch-action:none;
  display:flex;align-items:flex-end;padding:8px 10px;
}
.vcover:active{cursor:grabbing}
.vcover .hatch{position:absolute;inset:0;background-image:repeating-linear-gradient(135deg,transparent 0 9px,rgba(255,255,255,.14) 9px 10px)}
.vcover img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.vcover .shade{position:absolute;inset:0;background:linear-gradient(180deg,rgba(0,0,0,0) 35%,rgba(0,0,0,.42))}
.vcover .lab{
  position:relative;font-family:"IBM Plex Mono",monospace;font-size:10px;letter-spacing:.12em;
  text-transform:uppercase;color:#fff;font-weight:600;text-shadow:0 1px 3px rgba(0,0,0,.4);
}
.vcover .vgrip{position:absolute;left:8px;top:7px;color:rgba(255,255,255,.7);line-height:0}
.vcover .vgrip svg{width:15px;height:15px}
.vcheck{
  position:absolute;right:8px;top:7px;width:28px;height:28px;border-radius:50%;
  border:1.5px solid rgba(255,255,255,.75);background:rgba(0,0,0,.28);backdrop-filter:blur(4px);
  display:grid;place-items:center;padding:0;z-index:2;
}
.vcheck::after{
  content:"";width:11px;height:6px;border-left:2.4px solid #fff;border-bottom:2.4px solid #fff;
  transform:rotate(-45deg) scale(.85);opacity:.5;transition:.13s;margin-top:-3px;
}
.vcheck:hover::after{opacity:.95}
.vcheck[aria-checked="true"]{background:var(--green);border-color:var(--green)}
.vcheck[aria-checked="true"]::after{opacity:1;transform:rotate(-45deg) scale(1)}
.vbody{padding:10px 11px 11px;display:flex;flex-direction:column;gap:7px;flex:1;cursor:pointer}
.vtitle{font-size:14px;font-weight:600;line-height:1.32;word-break:break-word}
.vmeta{display:flex;flex-wrap:wrap;gap:5px;align-items:center}
.vfoot{display:flex;align-items:center;gap:8px;margin-top:auto;padding-top:2px;font-size:11px;color:var(--muted);font-family:"IBM Plex Mono",monospace}
.vsubs{display:flex;flex-direction:column;gap:4px;margin-top:2px}
.vsub{display:flex;align-items:center;gap:7px;font-size:12.5px;color:var(--ink-2)}
.vsub.done{color:var(--muted);text-decoration:line-through}
.vsub .b{width:14px;height:14px;border:1.4px solid var(--line-strong);border-radius:4px;flex:none;display:grid;place-items:center;padding:0;background:var(--surface-2)}
.vsub .b[aria-checked="true"]{background:var(--accent);border-color:var(--accent)}
.vsub .b::after{content:"";width:6px;height:3px;border-left:1.8px solid var(--accent-ink);border-bottom:1.8px solid var(--accent-ink);transform:rotate(-45deg);opacity:0}
.vsub .b[aria-checked="true"]::after{opacity:1}
.vsub span{flex:1;min-width:0;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.vmore{font-size:11.5px;color:var(--muted);font-family:"IBM Plex Mono",monospace}
.vtoggle{display:flex;gap:2px;background:var(--surface-2);border:1px solid var(--line);border-radius:var(--r);padding:2px}
.vtoggle button{border:0;background:transparent;color:var(--muted);border-radius:5px;padding:5px 10px;font-size:12.5px;min-height:30px}
.vtoggle button[aria-pressed="true"]{background:var(--surface);color:var(--ink);box-shadow:var(--shadow);font-weight:500}
@media (max-width:860px){ .vgrid{grid-template-columns:1fr 1fr;gap:9px} .vcover{height:56px} }

/* ---------- Documents ---------- */
.dgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:10px}
.dcard{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r);overflow:hidden;
  display:flex;flex-direction:column;text-align:left;padding:0;position:relative;box-shadow:var(--shadow);
}
.dthumb{aspect-ratio:4/3;background:var(--surface-3);display:grid;place-items:center;overflow:hidden;position:relative}
.dthumb img{width:100%;height:100%;object-fit:cover}
.dthumb .ext{font-family:"IBM Plex Mono",monospace;font-size:14px;font-weight:600;color:var(--muted);letter-spacing:.08em}
.dthumb .sg{position:absolute;right:6px;bottom:6px}
.dmeta{padding:8px 9px;display:flex;flex-direction:column;gap:3px}
.dmeta b{font-size:12.5px;font-weight:500;line-height:1.3;word-break:break-word;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.dmeta small{font-size:10.5px;color:var(--muted);font-family:"IBM Plex Mono",monospace}
.dropzone{
  border:2px dashed var(--line-strong);border-radius:var(--r);padding:22px;text-align:center;color:var(--muted);
  font-size:13.5px;background:var(--surface);transition:.15s;
}
.dropzone.hot{border-color:var(--accent);background:var(--accent-soft);color:var(--accent)}

/* ---------- Modal ---------- */
.scrim{
  position:fixed;inset:0;background:rgba(10,12,11,.55);backdrop-filter:blur(3px);z-index:900;
  display:flex;align-items:flex-end;justify-content:center;padding:0;
}
@media(min-width:720px){.scrim{align-items:center;padding:24px}}
.sheet{
  background:var(--ground);width:100%;max-width:660px;max-height:92vh;overflow:auto;
  border-radius:14px 14px 0 0;box-shadow:var(--shadow-lg);border:1px solid var(--line);
}
@media(min-width:720px){.sheet{border-radius:12px}}
.sheet.wide{max-width:1000px}
.sheet-h{
  position:sticky;top:0;background:var(--ground);border-bottom:1px solid var(--line);
  padding:14px 16px;display:flex;align-items:center;gap:10px;z-index:2;
}
.sheet-h h3{margin:0;font-family:"Fraunces",Georgia,serif;font-size:1.05rem;font-weight:600;flex:1;min-width:0}
.sheet-b{padding:16px;display:flex;flex-direction:column;gap:14px}
.sheet-f{position:sticky;bottom:0;background:var(--ground);border-top:1px solid var(--line);padding:12px 16px;display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}
.x{border:0;background:transparent;color:var(--muted);padding:6px;border-radius:6px;line-height:0}
.x:hover{background:var(--surface-2);color:var(--ink)}
.x svg{width:18px;height:18px}

/* ---------- Visionneuse ---------- */
.viewer{position:fixed;inset:0;background:#0B0D0C;z-index:1000;display:flex;flex-direction:column}
.viewer-h{display:flex;align-items:center;gap:10px;padding:10px 14px;color:#EDEDE7;border-bottom:1px solid rgba(255,255,255,.12)}
.viewer-h b{font-size:14px;font-weight:500;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.viewer-h .btn{background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.2);color:#EDEDE7}
.viewer-b{flex:1;overflow:auto;display:grid;place-items:center;padding:14px}
.viewer-b img{max-width:100%;max-height:calc(100vh - 96px);object-fit:contain;border-radius:4px}
.viewer-b iframe{width:100%;height:100%;border:0;background:#fff;border-radius:4px}
.viewer-fallback{color:#CFCFC8;text-align:center;max-width:380px;font-size:14px;display:flex;flex-direction:column;gap:14px;align-items:center}

/* ---------- Signature ---------- */
.sigpad{
  background:#FCFCF9;border:1px solid var(--line-strong);border-radius:var(--r);
  touch-action:none;width:100%;display:block;cursor:crosshair;
}
.sigstage{position:relative;display:inline-block;max-width:100%;line-height:0}
.sigstage img{max-width:100%;border-radius:4px;display:block}
.sigstamp{position:absolute;cursor:grab;touch-action:none;width:34%;user-select:none}
.sigstamp img{width:100%;display:block;pointer-events:none}
.audit{background:var(--surface-2);border:1px solid var(--line);border-radius:var(--r);padding:11px 12px;font-family:"IBM Plex Mono",monospace;font-size:11.5px;color:var(--muted);line-height:1.7}
.audit b{color:var(--ink-2);font-weight:500}

/* ---------- Mails ---------- */
.mcard{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:12px 13px;display:flex;flex-direction:column;gap:8px;box-shadow:var(--shadow)}
.mhead{display:flex;gap:8px;align-items:baseline;flex-wrap:wrap}
.mhead b{font-size:14px;font-weight:600}
.mhead .from{font-size:12px;color:var(--muted);font-family:"IBM Plex Mono",monospace}
.mbody{font-size:13px;color:var(--ink-2);white-space:pre-wrap;max-height:120px;overflow:auto;background:var(--surface-2);border-radius:6px;padding:9px 10px;border:1px solid var(--line)}
.sugg{display:flex;flex-direction:column;gap:6px}
.sugg-line{display:flex;align-items:center;gap:9px;background:var(--surface-2);border:1px solid var(--line);border-radius:6px;padding:7px 9px;font-size:13px}
.sugg-line .txt{flex:1;min-width:0}
mark{background:var(--accent-soft);color:var(--accent);border-radius:3px;padding:0 2px;font-weight:600}

/* ---------- Stats ---------- */
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(132px,1fr));gap:10px;margin-bottom:18px}
.stat{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:11px 12px;display:flex;flex-direction:column;gap:2px}
.stat b{font-family:"Fraunces",Georgia,serif;font-size:1.75rem;font-weight:700;line-height:1;font-variant-numeric:tabular-nums}
.stat span{font-size:11px;color:var(--muted);letter-spacing:.04em}
.stat.hot b{color:var(--red)}
.stat.warm b{color:var(--amber)}

/* Le bandeau d'action. Il manquait son état caché : `toast()` retirait bien la
   classe `on` au bout de 2,6 s, mais rien ne la rendait visible ou invisible,
   et le dernier message restait donc à l'écran indéfiniment. */
.toast{
  position:fixed;left:50%;bottom:24px;z-index:3000;
  background:var(--ink);color:var(--ground);padding:10px 16px;border-radius:22px;font-size:13.5px;
  box-shadow:var(--shadow-lg);display:flex;align-items:center;gap:9px;max-width:90vw;
  transform:translateX(-50%) translateY(14px);opacity:0;pointer-events:none;
  transition:opacity .22s ease,transform .28s var(--ressort);
}
.toast.on{transform:translateX(-50%) translateY(0);opacity:1;pointer-events:auto}
.hidden{display:none !important}

/* ---------- Mobile ---------- */
@media (max-width:860px){
  aside.nav{display:none}
  .content{padding:14px 14px 90px}
  .topbar{padding:10px 14px}
  .mobbar{
    display:flex;position:fixed;left:0;right:0;bottom:0;z-index:60;
    background:color-mix(in srgb,var(--surface) 94%,transparent);backdrop-filter:blur(12px);
    border-top:1px solid var(--line);padding:6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .mtab{
    flex:1;border:0;background:transparent;color:var(--muted);display:flex;flex-direction:column;
    align-items:center;gap:2px;padding:6px 2px;border-radius:8px;font-size:10px;position:relative;min-height:48px;
  }
  .mtab svg{width:20px;height:20px}
  .mtab[aria-current="page"]{color:var(--accent)}
  .mtab .badge{position:absolute;top:2px;right:calc(50% - 20px);background:var(--accent);color:var(--accent-ink);font-family:"IBM Plex Mono",monospace;font-size:9px;font-weight:600;border-radius:20px;padding:0 4px;min-width:14px}
  .col{flex:0 0 82vw;max-height:none}
  .board{margin:0 -14px;padding:0 14px 10px}
  .pgrid{grid-template-columns:1fr 1fr;gap:9px}
  .pcover{height:78px}
  .dgrid{grid-template-columns:1fr 1fr}
  .stats{grid-template-columns:1fr 1fr;gap:8px}
  .stat b{font-size:1.45rem}
  .topbar h2{font-size:1.05rem}
  .topbar .socmob{display:inline-flex}
  .topbar .btn span{display:none}
  .topbar .btn.primary span,.topbar .socmob span{display:inline-flex}
  .topbar .btn{padding:8px 10px}
}
@media (prefers-reduced-motion:reduce){*{transition:none !important;animation:none !important}}

/* =============================================================================
   « Lagon » — les gestes
   Tout ce qui suit ne change aucune structure : uniquement des rayons, des
   ombres et des transitions. Le ressort (--ressort) est le même partout, c'est
   lui qui donne à l'ensemble sa parenté.
   ============================================================================= */

/* ---------- Vignettes de projet ---------- */
.pcard{border:0;box-shadow:var(--shadow);transition:transform .34s var(--ressort),box-shadow .34s ease}
.pcard:hover{
  transform:translateY(-7px) scale(1.022);
  box-shadow:0 6px 12px rgba(18,49,47,.07), 0 30px 50px -26px rgba(18,49,47,.55);
  border-color:transparent;
}
:root[data-theme="dark"] .pcard:hover,
html:not([data-theme="light"]) .pcard:hover{box-shadow:0 6px 14px rgba(0,0,0,.35), 0 30px 50px -26px rgba(0,0,0,.9)}
.pcover{height:96px}
/* Le halo qui balaie la couverture au survol. */
.pcover::after{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(closest-side,rgba(255,255,255,.4),transparent 72%);
  transform:scale(.55);opacity:0;transition:transform .5s ease,opacity .5s ease;
}
.pcard:hover .pcover::after{transform:scale(1.4);opacity:1}
.pcover .soc{
  border-radius:999px;padding:3px 10px;letter-spacing:.1em;font-weight:600;
  background:rgba(0,0,0,.42);
}
.pcover-outils .btn{border-radius:999px}
.progress{border-radius:999px;overflow:hidden}
.progress i{background:linear-gradient(90deg,var(--accent),var(--accent-2));border-radius:999px}

/* ---------- Cartes de tâche ---------- */
.tcard{
  border:0;border-radius:var(--r-petit);box-shadow:var(--shadow);
  transition:transform .4s var(--ressort),opacity .4s ease,box-shadow .2s ease;
}
.tcard:hover{box-shadow:0 3px 8px rgba(18,49,47,.07), 0 18px 32px -24px rgba(18,49,47,.5)}
.tcard[data-prio="1"]{border-left:3px solid var(--red)}
.tcard[data-prio="2"]{border-left:3px solid var(--amber)}
/* La carte s'échappe vers la droite quand la tâche vient d'être terminée. */
.tcard.envol{transform:translateX(26px) scale(.97);opacity:.45}
.tcard .t-title{position:relative;display:inline}
.tcard .t-title::after{
  content:"";position:absolute;left:0;top:56%;height:2px;width:0;
  background:var(--accent);border-radius:2px;transition:width .34s var(--ressort);
}
.tcard.done .t-title{text-decoration:none}
.tcard.done .t-title::after{width:100%}

/* ---------- Cases à cocher ---------- */
.check{
  border-radius:999px;
  transition:background .25s ease,border-color .25s ease,transform .3s cubic-bezier(.34,1.6,.5,1);
}
.check:hover{border-color:var(--accent)}
[aria-checked="true"].check{transform:scale(1.14)}

/* ---------- Confettis ---------- */
canvas.confettis{position:fixed;inset:0;width:100vw;height:100vh;pointer-events:none;z-index:1200}

/* ---------- Boutons, champs, feuilles ---------- */
.btn{border-radius:999px}
.btn.sm{border-radius:999px}
.inp,.sel,.ta{border-radius:var(--r-petit)}
.sheet{border-radius:22px 22px 0 0}
@media(min-width:720px){.sheet{border-radius:22px}}
.pill{border-radius:999px}
.stat{border-radius:var(--r-petit)}
.empty{border-radius:var(--r-petit)}
.toast{border-radius:999px}

@media (prefers-reduced-motion: reduce){
  .pcard,.tcard,.check,.pcover::after{transition-duration:.001ms !important}
  .tcard.envol{transform:none;opacity:.45}
}

/* =============================================================================
   Mode démonstration — la visite guidée
   Un voile, un halo autour de l'élément dont on parle, une bulle de texte.
   ============================================================================= */
#visite{position:fixed;inset:0;z-index:1400}
.visite-voile{position:absolute;inset:0;background:rgba(10,32,31,.58);backdrop-filter:blur(2px)}
.visite-halo{
  position:absolute;border:2px solid var(--accent);border-radius:var(--r-petit);
  box-shadow:0 0 0 9999px rgba(10,32,31,.42), 0 0 26px rgba(78,205,196,.5);
  pointer-events:none;transition:all .28s var(--ressort);
}
.visite-bulle{
  position:absolute;left:50%;top:50%;transform:translate(0,0);
  width:min(410px,calc(100vw - 28px));background:var(--surface);color:var(--ink);
  border-radius:20px;box-shadow:var(--shadow-lg);padding:20px 21px 16px;
  display:flex;flex-direction:column;gap:9px;
}
/* Sans cible, la bulle se centre elle-même. */
.visite-bulle:not([style*="top"]){left:50%;top:50%;transform:translate(-50%,-50%)}
.visite-bulle .etape{
  margin:0;font-family:"IBM Plex Mono",monospace;font-size:10.5px;letter-spacing:.13em;
  text-transform:uppercase;color:var(--accent);
}
.visite-bulle h3{
  margin:0;font-family:"Fraunces",Georgia,serif;font-size:1.22rem;font-weight:700;
  line-height:1.22;letter-spacing:-.01em;
}
.visite-bulle .texte{margin:0;font-size:14px;line-height:1.55;color:var(--ink-2)}
.visite-pied{display:flex;align-items:center;gap:8px;margin-top:6px}

/* ---------- Périmètre d'un membre ---------- */
.perimetre{
  background:var(--surface-2);border-radius:var(--r-petit);padding:10px 12px;
  display:flex;flex-direction:column;gap:2px;margin:2px 0 8px;
}
.per-titre{margin:0 0 6px;font-size:11.5px;color:var(--muted)}
.per-ligne{display:flex;align-items:center;gap:8px;font-size:13.5px;padding:3px 0;cursor:pointer}
.per-ligne input{accent-color:var(--accent);width:16px;height:16px;flex:none}
.per-ligne.per-projet{padding-left:26px;font-size:13px;color:var(--ink-2)}
.per-pied{display:flex;align-items:center;gap:8px;margin-top:8px}

/* ---------- Saisie rapide de « Mes tâches » ---------- */
.capture{display:flex;gap:8px;margin-bottom:18px}
.capture .inp{flex:1;font-size:15px;padding:12px 14px}
.capture .btn{padding:0 16px}
.pill.a-classer{background:var(--amber-soft);color:var(--amber);cursor:pointer;border:0}
.pill.a-classer:hover{background:var(--amber);color:var(--ground)}

/* ---------- Documents d'un projet ---------- */
.doc-ligne{
  display:flex;align-items:center;gap:10px;background:var(--surface);
  border-radius:var(--r-petit);padding:8px 10px;box-shadow:var(--shadow);
}
.doc-ligne .doc-ic{color:var(--muted);line-height:0;flex:none}
.doc-ligne .doc-ic svg{width:17px;height:17px}
.doc-ligne .doc-nom{flex:1;min-width:0;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.doc-ligne .doc-taille{font-size:11px;color:var(--muted);flex:none}
.doc-ligne a.btn{text-decoration:none;display:inline-flex;align-items:center}
/* Le nom et, dessous, ce qui concerne la signature : demandé par, confié à, signé par. */
.doc-ligne .doc-corps{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.doc-ligne .doc-corps .doc-nom{flex:none;width:100%;text-align:left}
.doc-mention{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:5px;min-width:0;flex-wrap:wrap}
.doc-mention svg{width:13px;height:13px;color:var(--accent);flex:none}
.doc-mention i{font-style:italic;color:var(--ink-2)}
.notif-ic.attente{color:var(--accent)}
@media (max-width:640px){
  .doc-ligne.avec-mention{flex-wrap:wrap}
  .doc-ligne.avec-mention .doc-corps{flex-basis:100%}
}
.dropzone{display:block;cursor:pointer;border-radius:var(--r-petit)}

/* ---------- Planche à signer ---------- */
.planche{
  width:100%;height:220px;display:block;
  background:var(--surface);border:1px dashed var(--line-strong);border-radius:var(--r-petit);
  touch-action:none;cursor:crosshair;
}
.planche:hover{border-color:var(--accent)}

/* ---------- Sous-tâche à la volée ---------- */
.sous-saisie{margin-top:8px}
.sous-saisie .inp{width:100%;font-size:13.5px;padding:7px 10px}
.tcard .t-sous{align-self:flex-start;color:var(--muted);padding:5px;line-height:0;opacity:.55}
.tcard .t-sous:hover{opacity:1;color:var(--accent)}
.tcard .t-sous svg{width:15px;height:15px}

/* ---------- Zone de placement de la signature ---------- */
.page-zone{
  position:relative;width:100%;max-width:520px;margin:0 auto;
  background:#fff;border:1px solid var(--line-strong);border-radius:4px;
  box-shadow:var(--shadow);overflow:hidden;
}
:root[data-theme="dark"] .page-zone,
html:not([data-theme="light"]) .page-zone{background:#F7F5F0}
/* Repère du tiers de page — inutile dès que l'aperçu réel est là. */
.page-zone::after{
  content:"";position:absolute;left:0;right:0;bottom:33%;border-top:1px dashed rgba(18,49,47,.13);
  pointer-events:none;
}
.page-zone.avec-apercu::after{display:none}
.page-apercu{position:absolute;inset:0;width:100%;height:100%;display:block}
/* La page reçoit les gestes : rien ne doit défiler ni zoomer sous le doigt. */
.page-zone{touch-action:none;cursor:copy;user-select:none;-webkit-user-select:none}
.sig-calque{position:absolute;inset:0}
/* Un élément posé : image (signature, tampon, paraphe) ou mention manuscrite. */
.sig-el{
  position:absolute;cursor:grab;touch-action:none;
  background-repeat:no-repeat;background-size:100% 100%;
  border:1px solid transparent;border-radius:3px;
}
.sig-el:hover{border-color:var(--accent)}
.sig-el.choisi{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.sig-el:active{cursor:grabbing}
.sig-el.texte{
  font-family:'Caveat',cursive;line-height:1;white-space:nowrap;color:#141a59;
  padding:0 2px;
}
.sig-el .poignee{
  display:none;position:absolute;right:-9px;bottom:-9px;width:18px;height:18px;
  border-radius:50%;background:var(--accent);border:2px solid #fff;
  box-shadow:0 1px 3px rgba(0,0,0,.25);cursor:nwse-resize;touch-action:none;
}
.sig-el.choisi .poignee{display:block}
/* La barre d'outils : ce qu'on va poser. */
.sig-outils{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0 4px}
.sig-outils .source span{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sig-reglages{display:flex;flex-direction:column;gap:8px;margin-bottom:10px}
.sig-reglages .planche{height:170px}
/* Navigation de page : deux flèches, la position, le décompte. */
.sig-nav{
  display:flex;align-items:center;gap:8px;max-width:520px;margin:0 auto 8px;
  font-size:13px;color:var(--muted);
}
.sig-nav .btn{min-width:38px;justify-content:center}
.sig-nav .btn:disabled{opacity:.3;pointer-events:none}
.sig-nav #sPos{color:var(--ink);font-weight:600;letter-spacing:0}
}

/* ---------- Tâche confiée à quelqu'un d'autre ---------- */
.tcard.deleguee{opacity:.6}
.tcard.deleguee:hover{opacity:.95}
.pill.assignee{background:var(--teal-soft);color:var(--teal)}

/* ---------- Notifications ---------- */
.nav-cloche{position:relative}
.badge-notif{
  position:absolute;top:1px;right:1px;min-width:15px;height:15px;padding:0 4px;
  background:var(--accent-2);color:#fff;border-radius:999px;
  font-size:9.5px;line-height:15px;text-align:center;font-weight:600;
}
.notif-ligne{
  display:flex;align-items:flex-start;gap:10px;background:var(--surface-2);
  border-radius:var(--r-petit);padding:10px 12px;font-size:14px;
}
.notif-ic{color:var(--green);line-height:0;margin-top:2px;flex:none}
.notif-ic svg{width:17px;height:17px}

/* ---------- Cible de dépôt : une entité de la colonne de gauche ---------- */
.soc-btn.depot-hot{
  background:var(--accent-soft);box-shadow:inset 0 0 0 2px var(--accent);
  border-radius:var(--r-petit);
}

/* =============================================================================
   Le lavis d'entité
   Quand une seule entité est filtrée, sa couleur descend du haut et s'éteint.
   Tout est calculé par mélange : une couleur d'entité quelconque reste lisible,
   en thème clair comme en sombre, sans table de correspondance à tenir.
   ============================================================================= */
main.avec-entite{
  background:
    linear-gradient(to bottom, color-mix(in srgb, var(--ent) 20%, transparent) 0, transparent 190px),
    var(--ground);
}
main.avec-entite .topbar{
  background:color-mix(in srgb, var(--ent) 9%, color-mix(in srgb, var(--ground) 90%, transparent));
  border-bottom-color:color-mix(in srgb, var(--ent) 24%, var(--line));
}
main.avec-entite .content{background:transparent}
/* Le trait sous le titre : il nomme la couleur sans dépendre du fond. */
main.avec-entite .topbar h2::after{
  content:"";display:block;width:34px;height:2px;border-radius:2px;
  background:var(--ent);margin-top:5px;
}

/* ---------- Sélecteur de couleur d'entité ---------- */
.teinte{
  width:26px;height:26px;flex:none;padding:0;cursor:pointer;
  border:1px solid var(--line-strong);border-radius:999px;background:none;
  -webkit-appearance:none;appearance:none;
}
.teinte::-webkit-color-swatch-wrapper{padding:2px}
.teinte::-webkit-color-swatch{border:0;border-radius:999px}
.teinte::-moz-color-swatch{border:0;border-radius:999px}

/* =============================================================================
   Bandeau d'entités du mobile
   La colonne de gauche disparaît sous 860 px : ces vignettes la remplacent.
   Sur grand écran elles ne s'affichent pas — deux sélecteurs pour la même
   chose, c'est un de trop.
   ============================================================================= */
.entites-mob{display:none}
@media (max-width:860px){
  .entites-mob{
    display:flex;gap:8px;overflow-x:auto;padding:2px 14px 12px;margin:0 -14px 4px;
    scrollbar-width:none;-webkit-overflow-scrolling:touch;
  }
  .entites-mob::-webkit-scrollbar{display:none}
}
.vig-ent{
  flex:none;display:inline-flex;align-items:center;gap:7px;
  background:var(--surface);border:1px solid var(--line);border-radius:999px;
  padding:8px 14px;font:inherit;font-size:13.5px;color:var(--ink-2);
  white-space:nowrap;cursor:pointer;box-shadow:var(--shadow);
  transition:background .2s ease,color .2s ease,border-color .2s ease;
}
.vig-ent .dot{width:9px;height:9px;border-radius:999px;background:var(--ent,var(--muted));flex:none}
.vig-ent .n{
  font-family:"IBM Plex Mono",monospace;font-size:11px;color:var(--muted);
  background:var(--surface-2);border-radius:999px;padding:1px 6px;
}
/* Active : la vignette prend la couleur de son entité, comme le lavis. */
.vig-ent.active{
  background:var(--ent,var(--ink));border-color:transparent;color:#fff;font-weight:500;
}
.vig-ent.active .dot{background:rgba(255,255,255,.85)}
.vig-ent.active .n{background:rgba(255,255,255,.22);color:#fff}
.vig-ent:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* ---------- Bascule « toutes / sans projet » ---------- */
.bascule-vue{
  display:inline-flex;gap:4px;background:var(--surface-2);border-radius:999px;
  padding:4px;margin-bottom:16px;max-width:100%;overflow-x:auto;scrollbar-width:none;
}
.bascule-vue::-webkit-scrollbar{display:none}
.bascule-vue button{
  font:inherit;font-size:13px;border:0;background:none;color:var(--muted);
  border-radius:999px;padding:7px 15px;cursor:pointer;white-space:nowrap;
  display:inline-flex;align-items:center;gap:7px;
}
.bascule-vue button[aria-pressed="true"]{background:var(--surface);color:var(--ink);font-weight:500;box-shadow:var(--shadow)}
.bascule-vue button .n{
  font-family:"IBM Plex Mono",monospace;font-size:11px;
  background:var(--accent-2-soft);color:var(--accent-2);border-radius:999px;padding:1px 6px;
}
.bascule-vue button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* ---------- Visionneuse de documents ---------- */
.visio-barre{display:flex;align-items:center;gap:8px;margin-bottom:4px}
.visio-barre .mono{font-size:12px;color:var(--muted)}
.visio-barre a.btn{text-decoration:none;display:inline-flex;align-items:center}
.visio{
  background:var(--surface-2);border-radius:var(--r-petit);padding:10px;
  max-height:70vh;overflow:auto;display:flex;flex-direction:column;gap:10px;align-items:center;
}
.visio-img{max-width:100%;height:auto;border-radius:6px;cursor:zoom-in;display:block}
.visio-img.zoom{max-width:none;width:auto;cursor:zoom-out}
.visio-page{max-width:100%;height:auto;border-radius:4px;box-shadow:var(--shadow);background:#fff}
.visio-attente{color:var(--muted);font-size:13.5px;text-align:center;padding:24px 12px;margin:0}
/* Le nom d'un document est un bouton : il ouvre, il ne télécharge pas. */
.doc-ligne .doc-nom{
  flex:1;min-width:0;font:inherit;font-size:14px;text-align:left;background:none;border:0;
  color:inherit;cursor:pointer;padding:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.doc-ligne .doc-nom:hover{color:var(--accent);text-decoration:underline}
.doc-ligne .doc-nom:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}

/* =============================================================================
   Mobile : jamais de champ sous 16 px
   Safari sur iOS agrandit la page dès qu'on met le doigt dans un champ dont le
   texte fait moins de 16 px — et il ne dézoome pas ensuite. C'est la cause du
   « zoom à l'ouverture » : il suffit d'avoir touché la ligne de saisie une fois.
   On ne bride pas le zoom manuel (maximum-scale), qui reste utile sur un plan.
   ============================================================================= */
@media (max-width:860px){
  .inp, .sel, .ta, input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="date"], input[type="search"], select, textarea{
    font-size:16px;
  }
  .capture .inp{font-size:16px}
}

/* =============================================================================
   Annotation d'une photo
   Gros boutons, gros doigts : la barre d'outils doit être utilisable debout,
   sur un chantier, avec des gants s'il le faut.
   ============================================================================= */
.annot-outils{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.ao{
  width:44px;height:44px;flex:none;display:inline-flex;align-items:center;justify-content:center;
  background:var(--surface-2);border:1px solid var(--line);border-radius:12px;
  color:var(--ink-2);cursor:pointer;padding:0;
}
.ao svg{width:20px;height:20px}
.ao[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:var(--ground)}
.annot-reglages{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin:8px 0 10px}
.annot-ligne-couleurs{display:flex;align-items:center;gap:10px;margin-top:8px}
.annot-etiq{font-size:12px;color:var(--muted);width:88px;flex:none}
.annot-couleurs{display:flex;gap:6px;flex-wrap:wrap}
/* Le damier dit « transparent » sans avoir à l'écrire. */
.ac.vide{
  background-image:linear-gradient(45deg,var(--line-strong) 25%,transparent 25%,transparent 75%,var(--line-strong) 75%),
                   linear-gradient(45deg,var(--line-strong) 25%,transparent 25%,transparent 75%,var(--line-strong) 75%);
  background-size:12px 12px;background-position:0 0,6px 6px;background-color:var(--surface);
}
/* La saisie de texte se fait sur la photo, pas en dessous. */
.annot-saisie{
  position:absolute;left:50%;bottom:14px;transform:translateX(-50%);z-index:6;
  display:flex;gap:8px;align-items:center;width:min(92%,460px);
  background:var(--surface);border-radius:999px;padding:6px 6px 6px 14px;box-shadow:var(--shadow-lg);
}
.annot-saisie .inp{flex:1;font-size:16px;border:0;background:none;padding:6px 0}
.annot-saisie .inp:focus{outline:none}
.ac{
  width:30px;height:30px;border-radius:999px;border:2px solid var(--line-strong);
  cursor:pointer;padding:0;flex:none;
}
.ac.active{box-shadow:0 0 0 3px var(--accent-soft);border-color:var(--ink)}
.annot-taille{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--muted)}
.annot-taille input[type="range"]{width:110px;accent-color:var(--accent)}
.annot-scene{position:relative;background:var(--surface-3);border-radius:var(--r-petit);overflow:hidden}
.annot-scene canvas{display:block;width:100%;height:auto;touch-action:none;cursor:crosshair}
.annot-champ-inutilise{
  position:absolute;z-index:5;width:min(60%,260px);font-size:16px;
  box-shadow:var(--shadow-lg);
}
.annot-aide{margin:8px 0 0;font-size:12.5px;color:var(--muted);text-align:center}

/* ---------- Photos d'une tâche ---------- */
.photos-tache{display:flex;gap:8px;flex-wrap:wrap}
.vignette-doc{
  width:74px;height:74px;flex:none;border-radius:var(--r-petit);border:1px solid var(--line);
  background-size:cover;background-position:center;cursor:pointer;padding:0;
  box-shadow:var(--shadow);
}
.vignette-doc.fichier{
  display:inline-flex;align-items:center;justify-content:center;background:var(--surface-2);color:var(--muted);
}
.capture .btn.photo{background:var(--surface-2);color:var(--ink-2);padding:0 14px}
.capture .btn.photo:hover{background:var(--surface-3);color:var(--ink)}

/* ---------- Menu « Plus » du mobile ---------- */
.menu-plus{display:flex;flex-direction:column;gap:6px}
.menu-plus button{
  display:flex;align-items:center;gap:12px;width:100%;text-align:left;
  font:inherit;font-size:15px;color:var(--ink);background:var(--surface-2);
  border:0;border-radius:var(--r-petit);padding:14px 16px;cursor:pointer;
}
.menu-plus button:hover{background:var(--surface-3)}
.menu-plus button svg{width:19px;height:19px;color:var(--muted);flex:none}
.menu-plus button .n{
  margin-left:auto;font-family:"IBM Plex Mono",monospace;font-size:11px;
  background:var(--accent-2);color:#fff;border-radius:999px;padding:2px 8px;
}

/* Le bandeau hors ligne est cliquable : il propose de réessayer. */
.hors-ligne{cursor:pointer;user-select:none}
.hors-ligne b{font-weight:600;text-decoration:underline}

/* =============================================================================
   Visionneuse plein écran (plans, photos)
   Fond sombre volontaire : sur un chantier, en plein soleil, un cadre clair
   autour d'un plan blanc fait perdre les contours de la page.
   ============================================================================= */
.plan{
  position:fixed;inset:0;z-index:4000;display:flex;flex-direction:column;
  background:#0B1211;color:#F2F5F3;
}
.plan-barre{
  display:flex;align-items:center;gap:6px;padding:8px 10px;
  padding-top:calc(8px + env(safe-area-inset-top));
  background:rgba(11,18,17,.92);border-bottom:1px solid #1E2A28;flex:none;
}
.plan-nom{
  font-size:13px;max-width:34vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.plan-pos{font-size:11px;color:#8FA39D;flex:none}
.pb{
  width:40px;height:40px;flex:none;display:inline-flex;align-items:center;justify-content:center;
  background:transparent;border:0;border-radius:10px;color:#F2F5F3;cursor:pointer;
  text-decoration:none;
}
/* Export en cours : le fichier se télécharge avant d'ouvrir la feuille de partage. */
.pb.attente,.btn.attente{opacity:.45;pointer-events:none}
.pb:hover{background:#1B2827}
.pb svg{width:19px;height:19px}
.plan-scene{
  flex:1;overflow:auto;position:relative;touch-action:none;
  display:flex;align-items:flex-start;justify-content:flex-start;
  overscroll-behavior:contain;-webkit-overflow-scrolling:touch;
}
.plan-contenu{
  margin:auto;background:#fff;box-shadow:0 10px 40px rgba(0,0,0,.6);
  display:flex;align-items:center;justify-content:center;
  /* Enfant d'une boîte flex : sans ceci il se laisse comprimer à la largeur
     de l'écran dès qu'il la dépasse, pendant que sa hauteur suit le zoom —
     l'image s'étirait donc verticalement au lieu de déborder et défiler. */
  flex:none;
}
.plan-contenu canvas,.plan-img{display:block;width:100%;height:100%}
.plan-attente{color:#8FA39D;font-size:13.5px;text-align:center;padding:40px 16px;margin:0;background:#0B1211}
.plan-aide{
  position:absolute;left:50%;bottom:calc(18px + env(safe-area-inset-bottom));
  transform:translateX(-50%);margin:0;z-index:4001;
  background:rgba(0,0,0,.62);color:#fff;font-size:12.5px;border-radius:999px;
  padding:8px 16px;max-width:92vw;text-align:center;pointer-events:none;
}

.pill.partagee{background:var(--teal-soft);color:var(--teal)}

/* ---------- Vignette de photo : ouvrir ou annoter ---------- */
.vignette-boite{position:relative;display:inline-block;flex:none}
.vignette-crayon{
  position:absolute;right:4px;bottom:4px;width:26px;height:26px;padding:0;
  display:inline-flex;align-items:center;justify-content:center;
  background:rgba(0,0,0,.55);border:0;border-radius:999px;color:#fff;cursor:pointer;
  backdrop-filter:blur(4px);
}
.vignette-crayon svg{width:14px;height:14px}
.vignette-crayon:hover{background:rgba(0,0,0,.75)}
/* La scène d'annotation défile et se zoome. */
.annot-scene{overflow:auto;max-height:64vh;-webkit-overflow-scrolling:touch}
.annot-cadre{margin:0 auto}

/* Bandeau « nouvelle version » : discret, en haut, et jamais imposé. */
.maj-dispo{
  position:fixed;left:50%;top:calc(10px + env(safe-area-inset-top));transform:translateX(-50%);
  z-index:3500;background:var(--accent);color:var(--accent-ink);
  padding:9px 16px;border-radius:999px;font-size:13px;cursor:pointer;
  box-shadow:var(--shadow-lg);max-width:92vw;text-align:center;
}
.maj-dispo b{font-weight:600;text-decoration:underline}

/* =============================================================================
   Rubrique Signature
   ============================================================================= */
/* Le choix de la source, au-dessus de la planche : tracer, ou une image à soi. */
.choix-source{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:4px}
.source{
  display:inline-flex;align-items:center;gap:8px;font:inherit;font-size:13px;
  background:var(--surface);border:1px solid var(--line);border-radius:12px;
  padding:6px 12px 6px 8px;cursor:pointer;color:var(--ink-2);
}
.source img{height:30px;max-width:110px;object-fit:contain;display:block}
.source svg{width:18px;height:18px}
.source.active{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft);color:var(--ink)}

/* Les images de la personne, par type. */
.actifs{display:flex;flex-direction:column;gap:16px}
.actif-tete{display:flex;align-items:baseline;gap:10px;margin-bottom:8px;flex-wrap:wrap}
.actif-tete span{font-size:12.5px;color:var(--muted)}
.actif-liste{display:flex;gap:10px;flex-wrap:wrap}
.actif{
  margin:0;width:150px;background:var(--surface);border:1px solid var(--line);
  border-radius:var(--r-petit);overflow:hidden;box-shadow:var(--shadow);
}
.actif img{
  display:block;width:100%;height:76px;object-fit:contain;padding:8px;
  background:
    linear-gradient(45deg,var(--surface-3) 25%,transparent 25%,transparent 75%,var(--surface-3) 75%),
    linear-gradient(45deg,var(--surface-3) 25%,transparent 25%,transparent 75%,var(--surface-3) 75%);
  background-size:14px 14px;background-position:0 0,7px 7px;background-color:var(--surface);
}
.actif figcaption{
  display:flex;align-items:center;justify-content:space-between;gap:6px;
  font-size:12px;padding:4px 4px 4px 10px;border-top:1px solid var(--line);color:var(--ink-2);
}
.actif.ajout{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;
  min-height:110px;border-style:dashed;cursor:pointer;color:var(--muted);font-size:12.5px;
  box-shadow:none;background:transparent;
}
.actif.ajout:hover{border-color:var(--accent);color:var(--accent)}
.actif.ajout svg{width:20px;height:20px}

/* =============================================================================
   Rubrique Courrier
   ============================================================================= */
.courrier-accueil{
  max-width:560px;background:var(--surface);border-radius:var(--r);padding:22px 24px;
  box-shadow:var(--shadow);display:flex;flex-direction:column;gap:10px;font-size:14px;line-height:1.5;
}
.courrier-accueil h3{margin:0;font-family:"Fraunces",serif;font-weight:500;font-size:22px}
.courrier-accueil p{margin:0;color:var(--ink-2)}
.courrier-accueil a.btn{align-self:flex-start;text-decoration:none;margin-top:6px}
.courrier-etat{
  display:flex;align-items:center;gap:12px;background:var(--surface);border-radius:var(--r-petit);
  padding:10px 14px;box-shadow:var(--shadow);font-size:13.5px;flex-wrap:wrap;
}
.courrier-etat>span:first-child{color:var(--accent);line-height:0}
.courrier-etat>span:first-child svg{width:20px;height:20px}
.courrier-etat b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.courrier-etat .mono{font-size:11px;color:var(--muted)}
.courrier-erreur{display:block;font-size:12px;color:var(--accent-2);margin-top:2px}
.courriel{
  background:var(--surface);border-radius:var(--r-petit);padding:10px 14px;box-shadow:var(--shadow);
  display:flex;flex-direction:column;gap:4px;
}
.courriel.traite{opacity:.62}
.courriel-tete{display:flex;align-items:baseline;gap:10px}
.courriel-de{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13.5px}
.courriel-quand{font-size:11px;color:var(--muted);flex:none}
.courriel-sujet{font-size:15px;font-weight:500}
.courriel-extrait{font-size:12.5px;color:var(--muted);line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.courriel-pieces{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
.piece-chip{
  display:inline-flex;align-items:center;gap:6px;max-width:100%;font-size:12px;
  background:var(--bg);border:1px solid var(--line);border-radius:999px;padding:3px 10px 3px 8px;
}
.piece-chip svg{width:13px;height:13px;color:var(--muted);flex:none}
.piece-chip>span:not(.mono){max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.piece-chip .mono{font-size:10.5px;color:var(--muted)}
.piece-chip .lien{
  border:0;background:transparent;color:var(--accent);font:inherit;font-size:12px;font-weight:600;
  cursor:pointer;padding:0 2px;text-decoration:underline;text-underline-offset:2px;
}
.piece-chip .lien:disabled{opacity:.5;cursor:default}
.courriel-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:6px}
