/* Agent Dialspot : interface de chat. Charte Dialspot (indigo / cyan, Geist), clair / sombre selon le système. */
@font-face {
  font-family: "Geist";
  src: url("/polices/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/polices/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --fond: #ffffff;
  --panneau: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f3f4f9;
  --survol: #ebedf5;
  --bulle: #eef0fe;
  --texte: #0f1729;
  --doux: #647089;
  --tres-doux: #9aa3b5;
  --bord: #e6e8f0;
  --primaire: #4f46e5;
  --primaire-survol: #4338ca;
  --primaire-texte: #ffffff;
  --primaire-doux: #eef0fe;
  --accent: #06b6d4;
  --danger: #dc2626;
  --code: #f3f4f9;
  --ombre-saisie: 0 1px 2px rgba(15, 23, 41, .04), 0 6px 24px rgba(15, 23, 41, .06);
  --ombre-carte: 0 1px 2px rgba(15, 23, 41, .04), 0 12px 40px rgba(15, 23, 41, .08);
  --degrade: linear-gradient(135deg, #ec4899 0%, #8b5cf6 35%, #4f46e5 55%, #06b6d4 100%);
  --police: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #11131f;
    --panneau: #0a0c14;
    --surface: #161929;
    --surface-2: #1b1f31;
    --survol: #1f2336;
    --bulle: #232842;
    --texte: #eef1f8;
    --doux: #8b93a7;
    --tres-doux: #626a80;
    --bord: #232737;
    --primaire: #6366f1;
    --primaire-survol: #818cf8;
    --primaire-texte: #ffffff;
    --primaire-doux: #1e2140;
    --danger: #f87171;
    --code: #0c0e18;
    --ombre-saisie: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
    --ombre-carte: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 48px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--fond);
  color: var(--texte);
  font: 15px/1.6 var(--police);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--primaire); outline-offset: 2px; border-radius: 6px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icone {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border: none; border-radius: 8px;
  background: none; color: var(--doux);
}
.icone:hover { background: var(--survol); color: var(--texte); }
.lien { background: none; border: none; color: var(--doux); padding: 2px 0; font-size: 14px; }
.lien:hover { color: var(--primaire); }

.bouton-principal {
  height: 44px; border: none; border-radius: 10px; background: var(--primaire); color: var(--primaire-texte);
  font-weight: 600; transition: background .15s;
}
.bouton-principal:hover { background: var(--primaire-survol); }
.bouton-principal:disabled { opacity: .6; cursor: default; }

/* ------------------------------------------------------------ connexion */
.connexion {
  position: relative; min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; padding: 32px 16px; overflow: hidden; background: var(--panneau);
}
.connexion-halo {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(40rem 22rem at 20% 10%, color-mix(in srgb, var(--primaire) 16%, transparent), transparent 65%),
    radial-gradient(36rem 20rem at 85% 85%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%);
}
.carte {
  position: relative; width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--bord);
  border-radius: 18px; padding: 32px 28px 24px; box-shadow: var(--ombre-carte);
}
.carte-logo { display: block; margin: 0 auto 6px; }
.carte-marque { text-align: center; margin: 0 0 22px; font-weight: 600; color: var(--doux); font-size: 13px; letter-spacing: .02em; }
.etape { display: flex; flex-direction: column; gap: 14px; }
.etape h1 { font-size: 22px; font-weight: 650; letter-spacing: -.02em; margin: 0; text-align: center; }
.etape label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 550; }
.etape input:not([type=checkbox]) {
  height: 44px; padding: 0 14px; border: 1px solid var(--bord); border-radius: 10px; background: var(--surface);
  font-weight: 400; font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.etape input::placeholder { color: var(--tres-doux); }
.etape input:focus { outline: none; border-color: var(--primaire); box-shadow: 0 0 0 3px var(--primaire-doux); }
.etape .champ-code { font-family: var(--mono); font-size: 22px; letter-spacing: .5em; text-align: center; }
.etape label.case { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; font-size: 14px; }
.etape label.case input { width: 16px; height: 16px; accent-color: var(--primaire); }
.aide { margin: -4px 0 4px; color: var(--doux); font-size: 14px; text-align: center; }
.erreur { margin: 0; padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--danger);
  background: color-mix(in srgb, var(--danger) 9%, transparent); }
.erreur:empty { display: none; }
.connexion-pied { position: relative; margin: 0; font-size: 12.5px; color: var(--tres-doux); }

/* ------------------------------------------------------------ application */
.app { display: flex; height: 100%; }
.panneau {
  width: 272px; flex: none; background: var(--panneau); border-right: 1px solid var(--bord);
  display: flex; flex-direction: column; min-height: 0; transition: margin-left .2s ease;
}
.app.replie .panneau { margin-left: -272px; }
.panneau-tete { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 6px 14px; }
.marque { display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; font-weight: 650; letter-spacing: -.01em; }
.panneau-actions { padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 2px; }
.ligne-action {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border: none; border-radius: 9px;
  background: none; font-weight: 550; text-align: left;
}
.ligne-action:hover { background: var(--survol); }
.recherche { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 9px; color: var(--doux); }
.recherche:focus-within { background: var(--surface); box-shadow: inset 0 0 0 1px var(--bord); }
.recherche input { flex: 1; min-width: 0; border: none; background: none; outline: none; color: var(--texte); }
.recherche input::placeholder { color: var(--doux); }

.liste { flex: 1; overflow-y: auto; padding: 4px 8px 16px; }
.groupe { margin: 14px 10px 4px; font-size: 12px; font-weight: 600; color: var(--tres-doux); }
.item { position: relative; display: flex; align-items: center; gap: 2px; border-radius: 9px; }
.item:hover, .item.actif, .item.menu-actif { background: var(--survol); }
.item-lien {
  flex: 1; min-width: 0; display: flex; align-items: center; padding: 7px 4px 7px 10px; border: none;
  background: none; text-align: left; color: var(--texte); border-radius: 9px;
}
.item-plus { width: 28px; height: 28px; margin-right: 4px; opacity: 0; }
.item:hover .item-plus, .item.menu-actif .item-plus, .item-plus:focus-visible { opacity: 1; }
.item.menu-actif .item-plus { background: var(--bord); color: var(--texte); }
@media (hover: none) { .item-plus { opacity: 1; } }
.item-epingle { width: 13px; height: 13px; margin: 0 5px -1px 0; color: var(--doux); }
.item-renommage {
  flex: 1; height: 34px; margin: 3px 0; padding: 0 10px; border: 1px solid var(--primaire); border-radius: 8px;
  background: var(--surface); font-size: 14px; outline: none; box-shadow: 0 0 0 3px var(--primaire-doux);
}
.item-texte { flex: 1; min-width: 0; }
.item-titre { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-meta { display: block; font-size: 12px; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-travail { width: 18px; height: 18px; flex: none; margin-right: 2px; }
.liste-vide { color: var(--doux); font-size: 13.5px; padding: 14px 10px; }
.panneau-pied { display: flex; align-items: center; gap: 10px; padding: 10px 10px 12px 14px; border-top: 1px solid var(--bord); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--degrade); color: #fff; font-weight: 650; font-size: 14px;
}
.moi { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.moi strong { font-size: 14px; font-weight: 600; }
.moi span { font-size: 12px; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; background: var(--fond); }
.barre { display: flex; align-items: center; gap: 4px; height: 52px; padding: 0 12px; flex: none; }
#b-deplier, #b-nouvelle-barre { display: none; }
.app.replie #b-deplier, .app.replie #b-nouvelle-barre { display: inline-grid; }
.titre {
  display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 60%; height: 34px; padding: 0 10px;
  border: none; border-radius: 8px; background: none; font-weight: 550;
}
.titre span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titre svg { width: 15px; height: 15px; color: var(--doux); opacity: 0; transition: opacity .15s; }
.titre:hover { background: var(--survol); }
.titre:hover svg { opacity: 1; }
.titre-edition {
  height: 34px; min-width: 260px; padding: 0 10px; border: 1px solid var(--primaire); border-radius: 8px;
  background: var(--surface); font-weight: 550; outline: none; box-shadow: 0 0 0 3px var(--primaire-doux);
}

/* fil */
.fil { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.colonne { max-width: 768px; margin: 0 auto; padding: 16px 24px 32px; }
#messages { display: flex; flex-direction: column; gap: 28px; }

.msg { position: relative; }
.msg.humain { display: flex; flex-direction: column; align-items: flex-end; }
.entete { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; margin-bottom: 5px; font-size: 12.5px; color: var(--doux); }
.entete strong { color: var(--texte); font-weight: 600; }
.entete-email { color: var(--doux); }
.entete time { color: var(--tres-doux); font-variant-numeric: tabular-nums; }
.entete > * + *::before { content: "·"; margin-right: 8px; color: var(--tres-doux); }
.msg.humain .entete { justify-content: flex-end; margin-right: 6px; }
.msg.agent .entete { margin-top: 4px; }
.msg.humain .bulle {
  max-width: min(80%, 620px); background: var(--bulle); border-radius: 20px 20px 6px 20px; padding: 10px 16px;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg.agent { display: grid; grid-template-columns: 30px 1fr; gap: 14px; }
.msg.agent .avatar-agent { width: 30px; height: 30px; margin-top: 1px; }
.msg.agent .contenu { min-width: 0; }
.msg.systeme { display: flex; align-items: center; gap: 12px; color: var(--doux); font-size: 13px; }
.msg.systeme::before, .msg.systeme::after { content: ""; flex: 1; height: 1px; background: var(--bord); }

.actions { display: flex; align-items: center; gap: 2px; margin-top: 6px; color: var(--tres-doux); font-size: 12px;
  opacity: 0; transition: opacity .15s; }
.msg:hover .actions, .msg:focus-within .actions { opacity: 1; }
@media (hover: none) { .actions { opacity: 1; } }
.actions .icone { width: 28px; height: 28px; }
.actions svg { width: 15px; height: 15px; }
.msg.humain .actions { margin-right: 4px; }

/* texte de l'agent */
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md pre, .md table, .md blockquote { margin: 0 0 12px; }
.md ul, .md ol { padding-left: 22px; }
.md li { margin: 3px 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 20px 0 8px; line-height: 1.3; letter-spacing: -.01em; }
.md h1 { font-size: 20px; } .md h2 { font-size: 18px; } .md h3 { font-size: 16px; } .md h4 { font-size: 15px; }
.md strong { font-weight: 650; }
.md a { color: var(--primaire); text-underline-offset: 2px; }
.md code { font-family: var(--mono); font-size: .88em; background: var(--code); border: 1px solid var(--bord); border-radius: 5px; padding: 1px 5px; }
.md pre { position: relative; background: var(--code); border: 1px solid var(--bord); border-radius: 12px; padding: 14px 16px; overflow-x: auto; }
.md pre code { background: none; border: none; padding: 0; font-size: 13px; line-height: 1.55; }
.md table { border-collapse: collapse; display: block; overflow-x: auto; font-size: 14px; }
.md th, .md td { border-bottom: 1px solid var(--bord); padding: 8px 14px 8px 0; text-align: left; vertical-align: top; }
.md th { font-weight: 600; color: var(--doux); font-size: 13px; }
.md blockquote { padding-left: 14px; border-left: 3px solid var(--bord); color: var(--doux); }
.md hr { border: none; border-top: 1px solid var(--bord); margin: 18px 0; }

/* réflexion (en cours et terminée) */
.reflexion { margin-bottom: 10px; }
.reflexion summary {
  display: inline-flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; color: var(--doux);
  font-size: 13.5px; padding: 3px 8px 3px 0; border-radius: 6px; user-select: none;
}
.reflexion summary::-webkit-details-marker { display: none; }
.reflexion summary:hover { color: var(--texte); }
.reflexion summary svg { width: 14px; height: 14px; transition: transform .15s; }
.reflexion[open] summary svg { transform: rotate(90deg); }
.etapes { list-style: none; margin: 8px 0 4px; padding: 0 0 0 4px; border-left: 2px solid var(--bord); }
.etapes li { position: relative; padding: 3px 0 3px 16px; font-size: 13.5px; color: var(--doux); }
.etapes li::before {
  content: ""; position: absolute; left: -5px; top: 11px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--fond); border: 2px solid var(--tres-doux);
}
.etapes li.pensee { font-style: italic; }
.etapes li.plan { color: var(--texte); font-weight: 550; }
.etapes li.plan::before { border-color: var(--primaire); }
.etapes li.pensee::before { border-color: var(--bord); }
.etapes li.courante { color: var(--texte); }
.etapes li.courante::before { border-color: var(--primaire); background: var(--primaire); }

.en-cours { display: grid; grid-template-columns: 30px 1fr; gap: 14px; margin-top: 28px; }
.en-cours .logo-anime { width: 30px; height: 30px; }
.statut { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-height: 30px; padding-top: 4px; }
.statut-texte {
  font-weight: 550;
  background: linear-gradient(90deg, var(--doux) 0%, var(--doux) 40%, var(--texte) 50%, var(--doux) 60%, var(--doux) 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: reflet 2.2s linear infinite;
}
@keyframes reflet { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.statut-duree { font-size: 12.5px; color: var(--tres-doux); font-variant-numeric: tabular-nums; }
.statut-detail { flex-basis: 100%; font-size: 13px; color: var(--tres-doux); margin-top: -2px; }
.statut-detail:empty { display: none; }
.en-cours .reflexion { margin: 2px 0 0; }

/* accueil */
.accueil { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 12vh 0 24px; }
.accueil-logo { margin-bottom: 14px; }
.accueil h1 { font-size: 30px; font-weight: 650; letter-spacing: -.03em; margin: 0; }
.accueil p { margin: 6px 0 28px; color: var(--doux); font-size: 16px; }
.suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 620px; }
.suggestion {
  display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px 14px; border: 1px solid var(--bord);
  border-radius: 14px; background: var(--surface); transition: background .15s, border-color .15s;
}
.suggestion:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--primaire) 35%, var(--bord)); }
.suggestion strong { font-weight: 600; font-size: 14px; }
.suggestion span { font-size: 13px; color: var(--doux); }

/* saisie */
.zone-saisie { flex: none; padding: 0 24px 12px; }
.saisie {
  max-width: 768px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; padding: 10px 10px 10px 8px;
  background: var(--surface); border: 1px solid var(--bord); border-radius: 26px; box-shadow: var(--ombre-saisie);
  transition: border-color .15s, box-shadow .15s;
}
.saisie:focus-within { border-color: color-mix(in srgb, var(--primaire) 45%, var(--bord)); }
.saisie textarea {
  flex: 1; min-height: 24px; max-height: 260px; margin: 6px 0; padding: 0; border: none; outline: none; resize: none;
  background: none; line-height: 1.5; overflow-y: hidden;
}
.saisie textarea.long { overflow-y: auto; }
.saisie textarea::placeholder { color: var(--tres-doux); }
.envoyer {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: none; border-radius: 50%;
  background: var(--primaire); color: var(--primaire-texte); transition: background .15s, opacity .15s;
}
.envoyer:hover:not(:disabled) { background: var(--primaire-survol); }
.envoyer:disabled { opacity: .35; cursor: default; }
.envoyer svg { width: 18px; height: 18px; stroke-width: 2.2; }
.envoyer.arreter { background: var(--texte); color: var(--fond); }
.avertissement { max-width: 768px; margin: 8px auto 0; text-align: center; font-size: 12px; color: var(--tres-doux); }

.voile { display: none; }

@media (max-width: 820px) {
  .panneau { position: fixed; inset: 0 auto 0 0; z-index: 20; width: min(300px, 86vw); margin-left: 0;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--ombre-carte); }
  .app.menu-ouvert .panneau { transform: none; }
  .app.menu-ouvert .voile { display: block; position: fixed; inset: 0; z-index: 15; background: rgba(10, 12, 20, .45); }
  #b-deplier, #b-nouvelle-barre { display: inline-grid; }
  #b-replier { display: none; }
  .colonne { padding: 12px 16px 24px; }
  .zone-saisie { padding: 0 12px calc(10px + env(safe-area-inset-bottom)); }
  .suggestions { grid-template-columns: 1fr; }
  .accueil { padding-top: 6vh; }
  .msg.humain .bulle { max-width: 88%; }
}
@media (prefers-reduced-motion: reduce) {
  .statut-texte { animation: none; color: var(--doux); background: none; }
  * { transition: none !important; scroll-behavior: auto !important; }
}
.md pre .copier-code { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; opacity: 0; background: var(--surface); }
.md pre:hover .copier-code, .md pre .copier-code:focus-visible { opacity: 1; }
.md pre .copier-code svg { width: 14px; height: 14px; }

/* menu « … » et fenêtre de confirmation (fonds opaques) */
.menu-options {
  position: fixed; z-index: 50; min-width: 190px; padding: 5px; background: var(--surface); border: 1px solid var(--bord);
  border-radius: 12px; box-shadow: var(--ombre-carte);
}
.menu-option {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: none;
  border-radius: 8px; background: none; text-align: left; font-size: 14px; color: var(--texte);
}
.menu-option:hover, .menu-option:focus-visible { background: var(--survol); outline: none; }
.menu-option svg { width: 16px; height: 16px; color: var(--doux); }
.menu-option.danger, .menu-option.danger svg { color: var(--danger); }
.dialogue {
  width: min(420px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--bord); border-radius: 16px;
  background: var(--surface); color: var(--texte); box-shadow: var(--ombre-carte);
}
.dialogue::backdrop { background: rgba(10, 12, 20, .5); }
.dialogue h2 { margin: 0 0 8px; font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.dialogue p { margin: 0 0 20px; color: var(--doux); font-size: 14.5px; overflow-wrap: anywhere; }
.dialogue p strong { color: var(--texte); font-weight: 600; }
.dialogue-boutons { display: flex; justify-content: flex-end; gap: 8px; }
.bouton-secondaire, .bouton-danger { height: 38px; padding: 0 16px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.bouton-secondaire { border: 1px solid var(--bord); background: var(--surface); }
.bouton-secondaire:hover { background: var(--survol); }
.bouton-danger { border: none; background: var(--danger); color: #fff; }
.bouton-danger:hover { filter: brightness(1.08); }

/* pièces jointes : saisie */
.saisie-ligne { display: flex; align-items: flex-end; gap: 6px; }
.joindre { width: 36px; height: 36px; border-radius: 50%; }
.joindre svg { width: 19px; height: 19px; }
.saisie-pieces { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 2px 0 6px; }
.pj {
  position: relative; display: flex; align-items: center; gap: 10px; height: 56px; max-width: 240px; padding: 8px 30px 8px 8px;
  border: 1px solid var(--bord); border-radius: 12px; background: var(--surface-2); overflow: hidden;
}
.pj.pj-image { width: 56px; padding: 0; }
.pj.pj-image img { width: 100%; height: 100%; object-fit: cover; }
.pj.erreur { border-color: color-mix(in srgb, var(--danger) 45%, var(--bord)); }
.pj.erreur .piece-meta { color: var(--danger); }
.pj.envoi img, .pj.envoi .piece-texte { opacity: .55; }
.pj-progres { position: absolute; left: 8px; right: 8px; bottom: 5px; height: 3px; border-radius: 3px; background: var(--bord); }
.pj-progres span { display: block; width: 0; height: 100%; border-radius: 3px; background: var(--primaire); transition: width .15s; }
.pj-retirer {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; display: grid; place-items: center; padding: 0;
  border: none; border-radius: 50%; background: var(--texte); color: var(--fond); opacity: .85;
}
.pj-retirer:hover { opacity: 1; }
.pj-retirer svg { width: 11px; height: 11px; stroke-width: 2.6; }

/* pièces jointes : fil */
.pieces { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: flex-start; gap: 8px; max-width: min(80%, 620px); margin-bottom: 6px; }
.piece-image { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--bord); background: var(--surface-2); }
.piece-image img { display: block; max-width: 260px; max-height: 200px; object-fit: cover; }
.piece-fichier {
  display: flex; align-items: center; gap: 10px; min-width: 200px; max-width: 280px; padding: 9px 14px 9px 9px;
  border: 1px solid var(--bord); border-radius: 12px; background: var(--surface); color: inherit; text-decoration: none;
}
.piece-fichier:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--primaire) 35%, var(--bord)); }
.piece-icone {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 9px;
  background: var(--primaire-doux); color: var(--primaire);
}
.piece-texte { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.piece-nom { font-size: 13.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.piece-meta { font-size: 12px; color: var(--doux); }

/* dépôt de fichiers */
.principal { position: relative; }
.depot {
  position: absolute; inset: 10px; z-index: 30; display: grid; place-items: center; border-radius: 18px;
  border: 2px dashed color-mix(in srgb, var(--primaire) 60%, transparent);
  background: color-mix(in srgb, var(--fond) 88%, var(--primaire)); pointer-events: none;
}
.depot > div { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.depot svg { width: 34px; height: 34px; color: var(--primaire); }
.depot strong { font-size: 18px; }
.depot span { color: var(--doux); font-size: 13.5px; }
@media (max-width: 820px) { .piece-image img { max-width: 200px; } .pieces { max-width: 88%; } }

/* validations (go de Greg) */
.validation {
  border: 1px solid color-mix(in srgb, var(--primaire) 35%, var(--bord)); border-radius: 14px; padding: 14px 16px;
  background: color-mix(in srgb, var(--primaire-doux) 55%, var(--surface));
}
.validation.validee { border-color: color-mix(in srgb, #16a34a 45%, var(--bord)); background: color-mix(in srgb, #16a34a 6%, var(--surface)); }
.validation.refusee { border-color: color-mix(in srgb, var(--danger) 40%, var(--bord)); background: color-mix(in srgb, var(--danger) 5%, var(--surface)); }
.validation-tete { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--primaire); }
.validation.validee .validation-tete { color: #16a34a; }
.validation.refusee .validation-tete { color: var(--danger); }
.validation-tete svg { width: 16px; height: 16px; }
.validation-question { margin: 8px 0 4px; font-size: 15.5px; font-weight: 600; }
.validation-contexte { margin: 0 0 8px; color: var(--doux); font-size: 14px; white-space: pre-wrap; }
.validation-etat { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 12.5px; color: var(--doux); }
.validation-etat svg { width: 14px; height: 14px; }
.validation-commentaire { margin: 6px 0 0; font-size: 14px; font-style: italic; }
.validation-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.validation-actions input {
  flex: 1; min-width: 180px; height: 38px; padding: 0 12px; border: 1px solid var(--bord); border-radius: 10px;
  background: var(--surface); outline: none;
}
.validation-actions input:focus { border-color: var(--primaire); box-shadow: 0 0 0 3px var(--primaire-doux); }
.validation-actions .bouton-principal { height: 38px; padding: 0 18px; font-size: 14px; }
.item-meta.attente-go { color: var(--primaire); font-weight: 600; }
