:root {
  --fond: #f6f3ee; --carte: #ffffff; --texte: #2a2622; --doux: #7a716a;
  --accent: #8a4b2a; --bord: #e2dbd2; --ok: #2f7a4a; --alerte: #a33a2a; --moi: #f1e4d8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #1b1917; --carte: #262321; --texte: #ece6df; --doux: #a59c93;
    --accent: #d08a5e; --bord: #3a3531; --ok: #6cc08a; --alerte: #e47a68; --moi: #3a2d24;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, sans-serif; background: var(--fond); color: var(--texte); }
header { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 10px 16px;
  border-bottom: 1px solid var(--bord); background: var(--carte); position: sticky; top: 0; }
h1 { font-size: 18px; margin: 0 12px 0 0; }
nav button { background: none; border: 0; padding: 6px 10px; border-radius: 6px; color: var(--doux); cursor: pointer; font: inherit; }
nav button.actif { background: var(--moi); color: var(--texte); }
#qui { margin-left: auto; color: var(--doux); font-size: 13px; }
#qui button { margin-left: 8px; }
main { max-width: 900px; margin: 0 auto; padding: 16px; }
button { font: inherit; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--bord);
  background: var(--carte); color: var(--texte); cursor: pointer; }
button.principal, form button[type=submit] { background: var(--accent); color: #fff; border-color: var(--accent); }
input, textarea { font: inherit; padding: 8px; border-radius: 6px; border: 1px solid var(--bord);
  background: var(--carte); color: var(--texte); width: 100%; }
input[type=checkbox], input[type=file] { width: auto; }
.fil { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.msg { background: var(--carte); border: 1px solid var(--bord); border-radius: 8px; padding: 8px 12px; max-width: 85%; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.moi { align-self: flex-end; background: var(--moi); }
.msg .meta { font-size: 12px; color: var(--doux); margin-bottom: 2px; }
.saisie { display: flex; gap: 8px; position: sticky; bottom: 0; background: var(--fond); padding: 8px 0; }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.carte h3 { margin: 0 0 4px; font-size: 16px; }
.carte .meta { color: var(--doux); font-size: 13px; }
.carte .consignes { white-space: pre-wrap; margin: 8px 0; font-size: 14px; }
a { color: var(--accent); }
.images { display: grid; grid-template-columns: repeat(3, minmax(0, 170px)); gap: 8px; margin: 8px 0; }
.images figure { margin: 0; text-align: center; font-size: 12px; color: var(--doux); }
.images img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--fond); border-radius: 6px; border: 1px solid var(--bord); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.statut { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; border: 1px solid var(--bord); }
.statut.en_attente { color: var(--alerte); } .statut.livre { color: var(--ok); }
.statut.recupere { background: var(--ok); color: #fff; border-color: var(--ok); font-weight: 600; }
details.finies { margin-top: 24px; border-top: 1px solid var(--bord); padding-top: 12px; }
details.finies > summary { font-size: 16px; font-weight: 600; color: var(--ok); margin-bottom: 12px; }
details.finies .carte { opacity: .75; }
.question .qid { display: inline-block; min-width: 38px; padding: 0 6px; margin-right: 4px; border-radius: 6px; background: var(--moi); font-size: 14px; }
.question .reco { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--accent); background: var(--fond); border-radius: 4px; }
.question .reponse { margin-top: 8px; color: var(--ok); }
.question .repondre { margin-top: 10px; }
.question .repondre textarea { resize: vertical; }
.notif .texte { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }
.notif.urgent { border-left: 4px solid var(--alerte); }
.notif.urgent .meta { color: var(--alerte); }
.notif.lue { opacity: .55; border-left-color: var(--bord); }
#notifications > .actions { justify-content: space-between; margin-bottom: 8px; }
.fil.bloque { border-left: 4px solid var(--alerte); }
.fil.a_valider { border-left: 4px solid var(--accent); }
.fil.silencieux { opacity: .5; }
.fil .attend { color: var(--alerte); margin-top: 4px; }
.statut.etat-bloque, .statut.liv-refusee { color: var(--alerte); }
.statut.etat-a_valider { color: var(--accent); }
.statut.etat-fini, .statut.liv-integree { color: var(--ok); }
.livraison.refusee { border-left: 4px solid var(--alerte); }
.bandeau.alerte-orange { background: none; border: 1px solid #d08a2e; color: #d08a2e; }
.build.vert, .case.vert { border-left: 4px solid var(--ok); }
.build.rouge, .case.rouge { border-left: 4px solid var(--alerte); }
.build .meta { font-weight: 400; }
pre.journal { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; max-height: 240px; overflow: auto;
  background: var(--fond); padding: 8px; border-radius: 6px; }
.case .actions input { flex: 1; min-width: 140px; }
/* Lot 4 : style « argile modulaire » léger (Q19). Une bande de couleur d'argile par onglet sous l'en-tête,
   des onglets en galets arrondis, et le papier carnet 1930 pour les questions. */
header { border-bottom: 4px solid var(--bande, var(--accent)); transition: border-color .2s; }
body[data-onglet="aujourdhui"] { --bande: #c2683f; }
body[data-onglet="chat"] { --bande: #8aa05a; }
body[data-onglet="tripo"] { --bande: #d29a3c; }
body[data-onglet="agents"] { --bande: #6f8fb0; }
body[data-onglet="questions"] { --bande: #b5866a; }
body[data-onglet="fils"] { --bande: #9a6fb0; }
body[data-onglet="livraisons"] { --bande: #4f9c8c; }
body[data-onglet="proto"] { --bande: #b04f4f; }
body[data-onglet="notifications"] { --bande: #d06f3c; }
nav button { border-radius: 14px; }
nav button.actif { background: var(--bande, var(--moi)); color: #fff; }
.question { background-image: repeating-linear-gradient(transparent 0 23px, color-mix(in srgb, var(--bord) 55%, transparent) 23px 24px); }
details.discussion { margin-top: 10px; border-top: 1px dashed var(--bord); padding-top: 8px; }
details.discussion > summary { cursor: pointer; color: var(--accent); font-size: 14px; }
details.discussion .fil-disc { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
details.discussion .msg { max-width: 92%; font-size: 14px; }
.saisie-disc { display: flex; gap: 8px; align-items: flex-end; }
.saisie-disc textarea { flex: 1; }
.reponse-claude { border-left: 4px solid var(--accent); }
.msg.non-lu { border-left: 3px solid var(--accent); }
h2.prio-urgent { color: var(--alerte); }
h2.section:first-child { margin-top: 0; }
h2.section { font-size: 16px; color: var(--doux); margin: 24px 0 12px; }
.bandeau { margin: 6px 0; padding: 6px 10px; border-radius: 6px; font-weight: 600; background: var(--moi); }
.bandeau.libre { background: none; border: 1px dashed var(--alerte); color: var(--alerte); font-weight: 500; }
.bandeau.moi { color: var(--ok); }
.carte.prise { opacity: .6; }
.carte { transition: outline-color .1s; outline: 3px dashed transparent; outline-offset: -3px; }
.carte.survol { outline-color: var(--accent); background: var(--moi); opacity: 1; }
.badge { background: var(--alerte); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 12px; }
.erreur { color: var(--alerte); }
.note { color: var(--doux); font-size: 13px; }
#form-connexion { max-width: 360px; margin: 60px auto; display: flex; flex-direction: column; gap: 10px; }
#form-tripo { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
details summary { cursor: pointer; color: var(--doux); }
@media (max-width: 560px) { .images { grid-template-columns: repeat(3, 1fr); } .msg { max-width: 100%; } }
