/* Percival — inspiration Cyberpunk 2077 (palette netrunner) : noir, bleu néon, rouge d alerte. */
:root {
  --fond: #0a0a0c;
  --fond-2: #111114;
  --panneau: rgba(16, 16, 19, .92);
  --bleu: #05d9f5;            /* bleu néon, couleur principale */
  --bleu-doux: rgba(5, 217, 245, .45);
  --bleu-fin: rgba(5, 217, 245, .13);
  --rouge: #ff003c;
  --rouge-doux: rgba(255, 0, 60, .5);
  --corail: #ff4d6d;
  --champ: #050506;           /* fond des champs de saisie */
  --barre: rgba(10,10,12,.96);  /* en-têtes et barres */
  --sur-bleu: #000;            /* texte posé sur la couleur principale */
  --rouge-lueur: rgba(255,0,60,.16);
  --bleu-lueur: rgba(5,217,245,.05);
  --texte: #e6eef5;
  --doux: #6f7c8a;
  --titre: "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --corps: "Rajdhani", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Share Tech Mono", ui-monospace, Consolas, monospace;
  --coin: 14px;
  --haut: env(safe-area-inset-top, 0px);
  --bas: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--fond); color: var(--texte);
  font: 500 var(--taille, 17px)/1.4 var(--corps);
  overscroll-behavior: none; overflow: hidden;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; }
code { font-family: var(--mono); font-size: .82em; color: var(--bleu); background: var(--bleu-fin); padding: .05em .4em; }
.erreur { color: var(--rouge); min-height: 1.4em; font-family: var(--mono); font-size: .85rem; }

/* ---------- fond : noir mat, trame fine, une lueur rouge au loin ---------- */
.fond-hud { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.fond-hud::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 45% at 100% 0%, var(--rouge-lueur), transparent 70%),
    radial-gradient(ellipse 60% 40% at 0% 100%, var(--bleu-lueur), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 4px);
}
.fond-hud::after {
  /* repères d'angle façon interface du jeu */
  content: ""; position: absolute; inset: 10px;
  background:
    linear-gradient(var(--bleu-doux), var(--bleu-doux)) left top / 18px 1px no-repeat,
    linear-gradient(var(--bleu-doux), var(--bleu-doux)) left top / 1px 18px no-repeat,
    linear-gradient(var(--bleu-doux), var(--bleu-doux)) right bottom / 18px 1px no-repeat,
    linear-gradient(var(--bleu-doux), var(--bleu-doux)) right bottom / 1px 18px no-repeat;
  opacity: .5;
}

.ecran { position: relative; z-index: 1; height: 100dvh; display: flex; flex-direction: column; }

/* Coin coupé en bas à droite : la signature 2077 */
.coupe, .cadre, .bouton-neon, .envoyer, .bulle, .rond, .puce, .bouton-doux {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--coin)), calc(100% - var(--coin)) 100%, 0 100%);
}

/* ---------- emblème ---------- */
.reacteur-svg { overflow: visible; color: var(--bleu); --r-accent: var(--rouge); --r-vitesse: 1; }
.r-trait { fill: none; stroke: currentColor; stroke-width: 1.6; }
.r-fin { stroke-width: .8; opacity: .4; }
.r-epais { stroke-width: 4; }
.r-accent { stroke: var(--r-accent); }
.r-plein { fill: var(--rouge); stroke: none; }
.r-segments path { fill: currentColor; stroke: none; opacity: .8; }
.r-coeur { fill: rgba(5,217,245,.08); stroke: currentColor; stroke-width: 1.6; }
.r-noyau { fill: var(--bleu); stroke: none; transform-box: fill-box; transform-origin: center; animation: battement 2s ease-in-out infinite; }
.r-tourne { transform-box: view-box; transform-origin: 100px 100px; animation: tourne calc(20s * var(--r-vitesse)) linear infinite; }
.r-moyen { animation-duration: calc(11s * var(--r-vitesse)); }
.r-rapide { animation-duration: calc(6s * var(--r-vitesse)); }
.r-lent { animation-duration: calc(34s * var(--r-vitesse)); }
.r-inverse { animation-direction: reverse; }
@keyframes tourne { to { transform: rotate(360deg); } }
@keyframes battement { 50% { transform: scale(.78); } }

/* ---------- titre : glitch rare et sec ---------- */
.titre-glitch {
  position: relative; font-family: var(--titre); font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--bleu); margin: 0;
}
.titre-glitch::before, .titre-glitch::after { content: attr(data-texte); position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.titre-glitch::before { color: var(--corail); clip-path: inset(10% 0 55% 0); animation: glitch 5s steps(1) infinite; }
.titre-glitch::after { color: var(--rouge); clip-path: inset(58% 0 8% 0); animation: glitch 5s steps(1) .08s infinite; }
@keyframes glitch {
  0%, 93%, 100% { transform: translate(0); opacity: 0; }
  94% { transform: translate(-4px, 0); opacity: 1; }
  96% { transform: translate(3px, 0); opacity: 1; }
  98% { transform: translate(-1px, 0); opacity: .7; }
}

/* ---------- connexion ---------- */
#connexion { align-items: center; justify-content: center; padding: calc(var(--haut) + 24px) 16px calc(var(--bas) + 24px); overflow-y: auto; }
.connexion-boite { width: 100%; max-width: 380px; text-align: left; }
.reacteur-svg.grand { width: 96px; height: 96px; display: block; margin-bottom: 18px; }
.connexion-boite h1 { font-size: 3rem; line-height: 1; }
.tag { font-family: var(--mono); font-size: .78rem; color: var(--doux); letter-spacing: .06em; margin: 8px 0 26px; padding-left: 10px; border-left: 2px solid var(--rouge); }
.cadre { position: relative; padding: 18px 16px 18px; background: var(--panneau); border: 1px solid var(--bleu-doux); border-top: 3px solid var(--bleu); }
.cadre-etiquette { font-family: var(--titre); font-weight: 700; font-size: .85rem; color: var(--rouge); letter-spacing: .14em; margin-bottom: 6px; }
.aide { color: var(--doux); margin: 0 0 14px; }
#form-cle { display: flex; flex-direction: column; gap: 12px; }
#form-cle input {
  padding: 12px 14px; border: 1px solid var(--bleu-doux); border-radius: 0;
  background: var(--champ); color: var(--bleu); font: 18px var(--mono); caret-color: var(--rouge);
}
#form-cle input:focus { outline: none; border-color: var(--bleu); }
.bouton-neon {
  padding: 12px; font-family: var(--titre); font-weight: 700; font-size: 1.05rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--sur-bleu); background: var(--bleu);
}
.bouton-neon:active { background: var(--rouge); color: #fff; }

/* ---------- entête ---------- */
.entete {
  position: relative; display: flex; align-items: center; gap: 6px;
  padding: calc(var(--haut) + 8px) 8px 8px;
  background: var(--barre); border-bottom: 1px solid var(--bleu-doux);
}
.icone-bouton { width: 44px; height: 44px; display: grid; place-items: center; flex: none; color: var(--bleu); }
.icone-bouton:active { background: var(--bleu); color: var(--sur-bleu); }
.icone-bouton.appel { color: var(--corail); }
.identite { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.reacteur-svg.avatar { width: 36px; height: 36px; flex: none; }
.identite-texte { min-width: 0; }
.nom { font-family: var(--titre); font-weight: 700; font-size: 1.15rem; letter-spacing: .16em; color: var(--bleu); line-height: 1.1; }
.etat { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: .7rem; color: var(--doux); text-transform: uppercase; white-space: nowrap; overflow: hidden; }
#etat { overflow: hidden; text-overflow: ellipsis; }
.voyant { width: 6px; height: 6px; flex: none; background: var(--corail); animation: clignote 2s steps(1) infinite; }
@keyframes clignote { 50% { opacity: .2; } }

.bandeau {
  display: flex; justify-content: space-between; align-items: center;
  padding: 2px 12px; font-family: var(--titre); font-weight: 700; font-size: .7rem; letter-spacing: .14em; color: var(--sur-bleu);
  background: var(--bleu);
}
.bandeau span:last-child { font-family: var(--mono); font-weight: 400; letter-spacing: .04em; }

/* ---------- agents ---------- */
.agents {
  display: flex; gap: 6px; overflow-x: auto; padding: 10px 12px; flex: none;
  scrollbar-width: none; border-bottom: 1px solid var(--bleu-fin);
}
.agents::-webkit-scrollbar { display: none; }
.puce {
  --coin: 8px;
  flex: none; padding: 4px 14px 4px 12px; font-family: var(--titre); font-weight: 700; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--bleu); background: var(--bleu-fin); border-left: 2px solid var(--bleu);
}
.puce.choisi { color: var(--sur-bleu); background: var(--bleu); }

/* ---------- fil ---------- */
.fil { flex: 1; overflow-y: auto; padding: 18px 12px; display: flex; flex-direction: column; gap: 14px; position: relative; z-index: 1; }
.vide { margin: auto; color: var(--doux); padding: 0 24px; font-family: var(--mono); font-size: .85rem; line-height: 1.8; }
.vide b { color: var(--bleu); font-weight: 400; }
.vide .ligne { display: block; opacity: 0; animation: apparait .25s forwards; }
.vide .ligne:last-child { font-family: var(--titre); font-weight: 700; font-size: 1.1rem; letter-spacing: .12em; text-transform: uppercase; color: var(--bleu); margin-top: 6px; }
.vide .ligne:nth-child(2) { animation-delay: .25s; } .vide .ligne:nth-child(3) { animation-delay: .5s; }
.vide .ligne:nth-child(4) { animation-delay: .75s; } .vide .ligne:nth-child(5) { animation-delay: 1s; }
@keyframes apparait { to { opacity: 1; } }

.bulle {
  --coin: 12px;
  position: relative; max-width: 88%; padding: 10px 14px;
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
  animation: entre .18s ease-out;
}
@keyframes entre { from { opacity: 0; transform: translateY(4px); } }
.bulle.moi {
  align-self: flex-end;
  background: rgba(255,0,60,.10); border: 1px solid var(--rouge-doux); border-right: 3px solid var(--rouge);
}
.bulle.lui {
  align-self: flex-start;
  background: var(--panneau); border: 1px solid var(--bleu-fin); border-left: 3px solid var(--bleu);
}
.bulle .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; margin-bottom: 3px; font-family: var(--titre); font-weight: 700; font-size: .8rem; color: var(--bleu); letter-spacing: .14em; text-transform: uppercase; }
.bulle .meta .doux { color: var(--doux); font-family: var(--mono); font-weight: 400; letter-spacing: 0; text-transform: none; }
.bulle .corps b { color: var(--bleu); }
.bulle .vocal { font-family: var(--mono); font-size: .72rem; color: var(--rouge); text-transform: uppercase; margin-bottom: 4px; }
.bulle audio { width: 220px; max-width: 100%; height: 34px; }
.bulle .actions { display: flex; gap: 6px; margin-top: 8px; }
.bulle .actions button {
  font-family: var(--titre); font-weight: 700; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--bleu); padding: 2px 10px; border: 1px solid var(--bleu-doux);
}
.bulle .actions button:active { background: var(--bleu); color: var(--sur-bleu); }
.bulle.erreur-bulle { border-color: var(--rouge-doux); border-left-color: var(--rouge); color: #ffc4d0; }
.curseur::after { content: "▌"; margin-left: 2px; animation: clignote .8s steps(1) infinite; color: var(--bleu); }

/* ---------- saisie ---------- */
.saisie, .enregistrement {
  position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 10px calc(var(--bas) + 10px);
  background: var(--barre); border-top: 1px solid var(--bleu-doux);
}
.invite { align-self: center; font-family: var(--mono); color: var(--rouge); font-size: 1.1rem; }
#champ {
  flex: 1; resize: none; max-height: 140px; padding: 11px 12px; border-radius: 0;
  border: 1px solid var(--bleu-fin); border-bottom: 1px solid var(--bleu-doux); background: var(--champ); color: var(--texte);
  font: 500 17px/1.35 var(--corps); caret-color: var(--rouge);
}
#champ::placeholder { color: var(--doux); font-family: var(--mono); font-size: .9rem; }
#champ:focus { outline: none; border-color: var(--bleu); }
.envoyer { --coin: 10px; width: 48px; height: 46px; flex: none; display: grid; place-items: center; color: var(--sur-bleu); background: var(--bleu); }
.envoyer svg { stroke-width: 2.4; }
.envoyer:active { background: var(--rouge); color: #fff; }
.envoyer:disabled { opacity: .4; }

.enregistrement { align-items: center; gap: 10px; }
.point-rouge { width: 10px; height: 10px; background: var(--rouge); animation: clignote .8s steps(1) infinite; flex: none; }
#chrono { font-family: var(--mono); color: var(--rouge); min-width: 3em; }
#onde { flex: 1; min-width: 0; height: 40px; }

/* ---------- tiroir ---------- */
.tiroir { position: fixed; inset: 0; z-index: 10; display: flex; }
.tiroir-fond { position: absolute; inset: 0; background: rgba(0,0,0,.7); }
.tiroir-contenu {
  position: relative; width: min(86vw, 360px); height: 100%;
  background: var(--fond-2); border-right: 2px solid var(--bleu);
  display: flex; flex-direction: column; padding: calc(var(--haut) + 14px) 0 calc(var(--bas) + 12px);
  animation: none;
}
@keyframes glisse { from { transform: translateX(-100%); } }
.tiroir-entete { display: flex; align-items: center; justify-content: space-between; padding: 0 14px 12px; border-bottom: 1px solid var(--bleu-fin); }
.tiroir-entete h2 { font-family: var(--titre); font-weight: 700; font-size: 1.05rem; letter-spacing: .16em; margin: 0; color: var(--bleu); }
.bouton-doux {
  --coin: 8px;
  padding: 6px 14px 6px 12px; font-family: var(--titre); font-weight: 700; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--sur-bleu); background: var(--bleu);
}
.bouton-doux:active { background: var(--corail); }
.bouton-doux.danger { background: transparent; color: var(--rouge); border: 1px solid var(--rouge-doux); }
.fils { flex: 1; overflow-y: auto; }
.chercher-fils { margin: 10px 14px 4px; padding: 8px 12px; border: 1px solid var(--bleu-fin); background: var(--champ); color: var(--texte); font: inherit; font-size: 16px; }
.fil-item { display: block; width: 100%; text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--bleu-fin); }
.fil-item:active { background: var(--bleu-fin); }
.fil-item.actif { background: var(--bleu-fin); box-shadow: inset 3px 0 var(--bleu); }
.fil-titre { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.fil-meta { display: block; font-family: var(--mono); font-size: .72rem; color: var(--doux); text-transform: uppercase; }
.tiroir-pied { padding: 12px 14px 0; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--bleu-fin); }
.interrupteur { display: flex; align-items: center; gap: 10px; }
.interrupteur input { width: 18px; height: 18px; accent-color: var(--bleu); }

/* ---------- appel ---------- */
.appel-ecran {
  position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column;
  background:
    radial-gradient(circle at 50% 44%, rgba(5,217,245,.08) 0%, transparent 40%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.02) 0 1px, transparent 1px 4px),
    var(--fond);
  padding: calc(var(--haut) + 26px) 18px calc(var(--bas) + 30px);
}
.appel-haut { text-align: left; border-left: 3px solid var(--bleu); padding-left: 12px; }
.appel-etiquette { font-family: var(--mono); font-size: .72rem; color: var(--corail); letter-spacing: .08em; }
.appel-nom { font-size: 2.1rem; line-height: 1.05; margin-top: 2px; }
.appel-duree { font-family: var(--mono); color: var(--doux); margin-top: 2px; }
.appel-centre { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; min-height: 0; }
.halo { width: min(60vw, 250px); aspect-ratio: 1; position: relative; display: grid; place-items: center; transition: transform .08s linear; }
.halo .reacteur-svg { width: 100%; height: 100%; }
.halo::before, .halo::after { content: ""; position: absolute; inset: -4%; border-radius: 50%; border: 1px solid var(--bleu); opacity: 0; }
.halo.parle::before { animation: onde 1.4s ease-out infinite; }
.halo.parle::after { animation: onde 1.4s ease-out .7s infinite; }
.halo.parle .reacteur-svg { filter: drop-shadow(0 0 10px rgba(5,217,245,.45)); }
.halo.reflechit .reacteur-svg { --r-vitesse: .12; --r-accent: var(--corail); }
@keyframes onde { from { transform: scale(.94); opacity: .8; } to { transform: scale(1.35); opacity: 0; } }
.appel-etat { font-family: var(--titre); font-weight: 700; font-size: 1.05rem; letter-spacing: .2em; text-transform: uppercase; color: var(--bleu); }
.appel-texte {
  align-self: stretch; color: var(--texte); max-height: 26vh; overflow-y: auto;
  white-space: pre-wrap; padding: 10px 14px; background: var(--panneau); border-left: 3px solid var(--bleu);
}
.appel-texte:empty { display: none; }
.appel-bas { display: flex; justify-content: center; gap: 22px; }
.rond { --coin: 14px; width: 66px; height: 60px; display: grid; place-items: center; color: var(--bleu); border: 1px solid var(--bleu-doux); background: rgba(5,217,245,.06); }
.rond svg { width: 26px; height: 26px; }
.rond.actif { background: var(--bleu); color: var(--sur-bleu); }
.rond.raccrocher { background: var(--rouge); color: #fff; border-color: var(--rouge); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}

/* ---------- palette netrunner : le rouge prend plus de place ---------- */
.bandeau { background: var(--rouge); color: #fff; }
.tag { border-left-color: var(--bleu); }
.cadre { border-top-color: var(--rouge); }
.bouton-neon:active, .envoyer:active { background: var(--rouge); color: #fff; }
.titre-glitch::before { color: var(--rouge); }
.titre-glitch::after { color: #fff; }
.icone-bouton.appel { color: var(--rouge); }
.voyant { background: var(--rouge); }
.invite { color: var(--rouge); }
.appel-etiquette { color: var(--rouge); }
.appel-haut { border-left-color: var(--rouge); }
.bulle.lui .meta .doux { color: var(--rouge); opacity: .8; }
.halo::after { border-color: var(--rouge); }

/* ---------- auto-amélioration ---------- */
.evo-bouton { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.badge-evo { min-width: 20px; padding: 0 6px; background: var(--rouge); color: #fff; font-family: var(--mono); font-size: .75rem; text-align: center; }
.evolution-ecran {
  position: fixed; inset: 0; z-index: 15; display: flex; flex-direction: column; background: var(--fond);
}
.evo-entete {
  display: flex; align-items: center; gap: 8px; padding: calc(var(--haut) + 10px) 8px 10px;
  border-bottom: 1px solid var(--bleu-doux); background: var(--barre);
}
.evo-etiquette { font-family: var(--mono); font-size: .7rem; color: var(--rouge); }
.evo-titre { margin: 0; font-family: var(--titre); font-weight: 700; font-size: 1.2rem; letter-spacing: .14em; color: var(--bleu); }
.evo-corps { flex: 1; overflow-y: auto; padding: 14px 12px calc(var(--bas) + 20px); display: flex; flex-direction: column; gap: 14px; }
.evo-bloc { background: var(--panneau); border: 1px solid var(--bleu-fin); border-left: 3px solid var(--bleu); padding: 12px 14px; }
.evo-bloc h3 { margin: 0 0 8px; font-family: var(--titre); font-weight: 700; font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; color: var(--bleu); }
.evo-mode.on { border-left-color: var(--rouge); }
.evo-mode.on h3 { color: var(--rouge); }
.evo-ligne-mode { display: flex; gap: 12px; align-items: flex-start; }
.evo-ligne-mode p { margin: 0; color: var(--doux); font-size: .95rem; }
.evo-meta { margin-top: 10px; font-family: var(--mono); font-size: .72rem; color: var(--doux); }
.commutateur { flex: none; width: 54px; height: 28px; position: relative; border: 1px solid var(--bleu-doux); background: var(--champ); margin-top: 2px; }
.commutateur i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: var(--doux); transition: transform .15s, background .15s; }
.commutateur[aria-checked="true"] { border-color: var(--rouge); }
.commutateur[aria-checked="true"] i { transform: translateX(26px); background: var(--rouge); }
.evo-item { padding: 9px 0; border-top: 1px solid var(--bleu-fin); }
.evo-item:first-of-type { border-top: 0; }
.evo-item p { margin: 3px 0 0; color: var(--doux); font-size: .9rem; }
.evo-item.attente b { color: var(--rouge); }
.evo-vide { margin: 0; color: var(--doux); font-family: var(--mono); font-size: .8rem; }
.evo-etat { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; padding: 1px 6px; border: 1px solid var(--bleu-doux); color: var(--bleu); }
.evo-etat.refuse, .evo-etat.annule { border-color: var(--rouge-doux); color: var(--rouge); }
.evo-actions { display: flex; gap: 8px; margin-top: 8px; }
.evo-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.evo-form input, .evo-form textarea {
  padding: 10px; border: 1px solid var(--bleu-doux); border-radius: 0; background: var(--champ); color: var(--texte); font: 500 16px var(--corps); resize: vertical;
}
.evo-form button { align-self: flex-start; }

/* ---------- Claude Code : étapes, plan, bilan ---------- */
.puce.modele { border-left-color: var(--rouge); color: var(--texte); background: rgba(255,0,60,.08); }
.puce.modele.choisi { background: var(--rouge); color: #fff; }
.separateur { flex: none; width: 1px; background: var(--bleu-fin); margin: 2px 2px; }
.envoyer.stop { background: var(--rouge); color: #fff; animation: clignote 1.2s steps(1) infinite; }
.bulle.lui { max-width: 94%; }
.bulle .corps + .corps { margin-top: 6px; }
.bulle .h { display: block; color: var(--bleu); letter-spacing: .06em; margin-top: 4px; }
.bulle pre.code, .outil pre {
  margin: 6px 0; padding: 8px 10px; background: var(--champ); border-left: 2px solid var(--bleu-fin);
  font: 12px/1.45 var(--mono); color: #b9c7d4; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto;
}
.outil { margin: 6px 0; border: 1px solid var(--bleu-fin); background: rgba(5,217,245,.03); }
.outil summary { display: flex; gap: 8px; align-items: baseline; padding: 5px 8px; cursor: pointer; list-style: none; font-size: .9rem; min-width: 0; }
.outil summary::-webkit-details-marker { display: none; }
.outil summary i { font-style: normal; font-family: var(--mono); color: var(--bleu); width: 1.4em; flex: none; }
.outil summary b { font-family: var(--titre); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--bleu); flex: none; }
.outil summary span { font-family: var(--mono); font-size: .76rem; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.outil.encours summary i { animation: clignote .8s steps(1) infinite; }
.outil.erreur { border-color: var(--rouge-doux); }
.outil.erreur summary i, .outil.erreur summary b { color: var(--rouge); }
.outil.sous { margin-left: 14px; opacity: .85; }
.plan { margin: 6px 0; padding: 6px 10px; border-left: 2px solid var(--rouge); background: rgba(255,0,60,.05); font-size: .9rem; }
.tache { color: var(--doux); }
.tache.in_progress { color: var(--texte); }
.tache.completed { text-decoration: line-through; opacity: .6; }
.bilan { margin-top: 8px; font-family: var(--mono); font-size: .7rem; color: var(--doux); }
.erreur-texte { color: var(--rouge); }
.wikilien { color: var(--bleu); text-decoration: none; border-bottom: 1px dashed var(--bleu-doux); }
.wikilien.absent { color: var(--doux); border-bottom-color: var(--rouge-doux); }

/* ---------- tiroir : modules ---------- */
.modules { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.modules .evo-bouton { grid-column: 1 / -1; }
.conso { margin: 0; font-family: var(--mono); font-size: .72rem; color: var(--doux); }

/* ---------- mémoire, agenda ---------- */
.evo-entete .nouvelle { margin-left: auto; }
.evo-champ {
  width: 100%; padding: 10px 12px; border: 1px solid var(--bleu-doux); border-radius: 0;
  background: var(--champ); color: var(--texte); font: 500 16px var(--corps); resize: vertical;
}
.evo-champ:focus { outline: none; border-color: var(--bleu); }
.note-item { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--bleu-fin); border-left: 3px solid var(--bleu); background: var(--panneau); margin-top: 8px; }
.note-item .extrait { display: block; font-size: .85rem; color: var(--doux); margin-top: 2px; }
.note-barre { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.note-barre .fil-meta { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-corps { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--panneau); border: 1px solid var(--bleu-fin); padding: 12px 14px; margin-bottom: 12px; }
.note-edition { width: 100%; min-height: 55vh; padding: 12px; border: 1px solid var(--bleu); border-radius: 0; background: var(--champ); color: var(--texte); font: 14px/1.5 var(--mono); margin-bottom: 12px; }
.evo-bloc .wikilien { display: inline-block; margin: 2px 8px 2px 0; }
.heure { color: var(--bleu); font-family: var(--mono); font-weight: 400; margin-right: 6px; }
.evo-durees { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.evo-durees .bouton-doux { flex: 1; }
.evo-meta select { background: var(--champ); color: var(--texte); border: 1px solid var(--bleu-doux); font: inherit; padding: 2px 6px; }
.evo-encours { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-family: var(--mono); font-size: .8rem; color: var(--texte); }
.evo-encours .bouton-doux { margin-left: auto; }
#evo-direct { margin-top: 10px; max-width: 100%; }
details.evo-bloc summary { list-style: none; cursor: pointer; }
details.evo-bloc summary h3 { display: inline; }

/* ---------- arborescence et fichiers ---------- */
.arbre { margin-top: 8px; font-size: .98rem; }
.arbre-enfants { margin-left: 14px; border-left: 1px solid var(--bleu-fin); padding-left: 6px; }
.arbre-dossier summary { list-style: none; cursor: pointer; padding: 6px 4px; font-weight: 600; color: var(--texte); display: flex; gap: 8px; align-items: center; }
.arbre-dossier summary::-webkit-details-marker { display: none; }
.arbre-dossier summary i { font-style: normal; color: var(--bleu); transition: transform .12s; width: 1em; }
.arbre-dossier[open] > summary i { transform: rotate(90deg); }
.arbre-fichier { display: flex; width: 100%; align-items: baseline; gap: 8px; text-align: left; padding: 6px 4px; color: var(--texte); }
.arbre-fichier:active { background: var(--bleu-fin); }
.arbre-fichier i { font-style: normal; font-family: var(--mono); color: var(--doux); width: 1.4em; flex: none; font-size: .8rem; }
.arbre-fichier span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arbre-fichier small { font-family: var(--mono); color: var(--doux); font-size: .66rem; flex: none; }
.arbre-vide { padding: 4px; }
.segments { display: flex; gap: 6px; }
.fichier-contenu { max-height: none; }
.memoire-outils { display: flex; gap: 8px; align-items: stretch; }
.memoire-outils .evo-champ { flex: 1; }
a.bouton-doux { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.lien-obsidian { background: #7c3aed; color: #fff; }

/* ---------- ordinateur virtuel ---------- */
.ecran-cadre { border: 1px solid var(--bleu-doux); background: #000; min-height: 160px; display: grid; place-items: center; }
.ecran-cadre img { width: 100%; height: auto; display: block; }
.modules .evo-bouton { grid-column: 1 / -1; }

/* ---------- tâches ---------- */
.badge-icone { position: relative; }
.badge-icone .badge-evo { position: absolute; top: 4px; right: 2px; min-width: 16px; padding: 0 4px; font-size: .62rem; }
.reglages-veille select { margin: 0 2px; }
.form-tache { display: flex; flex-direction: column; gap: 8px; }
.form-ligne { display: flex; gap: 8px; }
.form-ligne > * { flex: 1; min-width: 0; }
.form-tache select.evo-champ, .form-tache input.evo-champ { padding: 9px 10px; }
.form-tache .bouton-doux { align-self: flex-start; }
.resume-tache { border-left: 2px solid var(--bleu-fin); padding-left: 8px; white-space: pre-wrap; }

/* ---------- réglages d'affichage ---------- */
.sans-anim *, .sans-anim *::before, .sans-anim *::after { animation: none !important; transition: none !important; }
.sans-lignes .fond-hud::before { background-image: none !important; }
.theme-clair .fond-hud::before { opacity: .5; }
.theme-clair .bulle.lui, .theme-clair .evo-bloc, .theme-clair .cadre { box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ---------- écran de lancement ---------- */
.accueil {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: radial-gradient(circle at 50% 42%, var(--bleu-lueur), transparent 55%), var(--fond);
  padding: var(--haut) 16px var(--bas); touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
.accueil-centre { position: relative; width: min(62vw, 300px); aspect-ratio: 1; display: grid; place-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.accueil-reacteur { width: 100%; height: 100%; position: relative; z-index: 1; filter: drop-shadow(0 0 14px var(--bleu-doux)); transition: transform .12s; }
.accueil-centre:active .accueil-reacteur { transform: scale(.96); }
.accueil-anneaux { position: absolute; inset: 0; pointer-events: none; }
.accueil-anneaux span { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--bleu); opacity: 0; animation: anneau 3s ease-out infinite; }
.accueil-anneaux span:nth-child(2) { animation-delay: 1s; }
.accueil-anneaux span:nth-child(3) { animation-delay: 2s; border-color: var(--rouge); }
@keyframes anneau { from { transform: scale(.85); opacity: .7; } to { transform: scale(1.5); opacity: 0; } }
.accueil-titre { font-size: clamp(2.4rem, 11vw, 4.2rem); color: var(--bleu); letter-spacing: .18em; margin-top: 8px; }
.accueil-sous { margin: 0; font-family: var(--mono); font-size: .8rem; letter-spacing: .3em; color: var(--doux); }
.accueil-aide { margin: 28px 0 0; font-family: var(--mono); font-size: .78rem; color: var(--bleu); animation: clignote 2.4s ease-in-out infinite; }
.accueil.touche .accueil-reacteur { transform: scale(1.06); filter: drop-shadow(0 0 26px var(--bleu)); }

/* L'ouverture : le réacteur s'emballe et grandit, le titre se brouille, l'appli apparaît derrière. */
.accueil.ouverture { animation: accueil-part .9s ease-in forwards; pointer-events: none; }
.accueil.ouverture .accueil-reacteur { animation: reacteur-part .9s cubic-bezier(.6, 0, .4, 1) forwards; --r-vitesse: .08; }
.accueil.ouverture .accueil-anneaux span { animation: anneau-part .7s ease-out forwards; }
.accueil.ouverture .accueil-titre { animation: titre-part .5s steps(4) forwards; }
.accueil.ouverture .accueil-sous, .accueil.ouverture .accueil-aide { opacity: 0; transition: opacity .2s; }
@keyframes reacteur-part { 30% { transform: scale(.85) rotate(-20deg); } 100% { transform: scale(7) rotate(90deg); opacity: 0; } }
@keyframes anneau-part { from { transform: scale(1); opacity: .9; } to { transform: scale(5); opacity: 0; } }
@keyframes titre-part { 25% { transform: translateX(-6px) skewX(-12deg); } 50% { transform: translateX(5px); opacity: .7; } 100% { transform: scaleY(.1); opacity: 0; } }
@keyframes accueil-part { 0%, 55% { background-color: var(--fond); opacity: 1; } 100% { opacity: 0; } }
#appli.entree { animation: appli-entre .7s .35s ease-out both; }
@keyframes appli-entre { from { opacity: 0; transform: scale(.94); filter: blur(6px); } }

/* ---------- paramètres ---------- */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 8px; }
.theme-carte { padding: 8px; border: 1px solid var(--bleu-fin); background: var(--champ); color: var(--texte); text-align: left; font-family: var(--titre); font-weight: 700; font-size: .8rem; letter-spacing: .06em; }
.theme-carte.actif { border-color: var(--bleu); box-shadow: 0 0 0 1px var(--bleu); }
.theme-carte .apercu { display: flex; height: 26px; margin-bottom: 6px; }
.theme-carte .apercu i { flex: 1; }
.param-ligne { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--bleu-fin); }
.param-ligne:first-of-type { border-top: 0; }
.param-ligne label { flex: 1; }
.param-ligne small { display: block; color: var(--doux); font-size: .8rem; }
.param-ligne select, .param-ligne input[type="color"] { background: var(--champ); color: var(--texte); border: 1px solid var(--bleu-doux); font: inherit; padding: 4px 6px; }
.param-ligne input[type="color"] { width: 46px; height: 34px; padding: 2px; }
.segment { display: flex; gap: 0; }
.segment button { padding: 6px 10px; border: 1px solid var(--bleu-fin); background: var(--champ); color: var(--texte); font-family: var(--titre); font-weight: 700; font-size: .78rem; }
.segment button.actif { background: var(--bleu); color: var(--sur-bleu); border-color: var(--bleu); }

/* ---------- mouvements façon iPhone ---------- */
:root { --ios: cubic-bezier(.32, .72, 0, 1); }

/* Menu de gauche : il glisse, et suit le doigt pendant un balayage (classe .glisse). */
.tiroir .tiroir-contenu { transform: translateX(-100%); transition: transform .42s var(--ios); will-change: transform; }
.tiroir .tiroir-fond { opacity: 0; transition: opacity .42s var(--ios); }
.tiroir.ouvert .tiroir-contenu { transform: none; }
.tiroir.ouvert .tiroir-fond { opacity: 1; }
.tiroir.glisse .tiroir-contenu, .tiroir.glisse .tiroir-fond { transition: none; }
.tiroir.ouvert .fil-item, .tiroir.ouvert .modules > * { animation: item-entre .45s var(--ios) both; }
.tiroir.ouvert .fil-item:nth-child(2) { animation-delay: .03s; } .tiroir.ouvert .fil-item:nth-child(3) { animation-delay: .06s; }
.tiroir.ouvert .fil-item:nth-child(4) { animation-delay: .09s; } .tiroir.ouvert .fil-item:nth-child(n+5) { animation-delay: .12s; }
@keyframes item-entre { from { opacity: 0; transform: translateX(-14px); } }

/* Panneaux : ils arrivent par la droite et l'appli recule derrière, comme une navigation iOS. */
.evolution-ecran { transform: translateX(100%); transition: transform .44s var(--ios); will-change: transform; box-shadow: -12px 0 32px rgba(0,0,0,.35); }
.evolution-ecran.ouvert { transform: none; }
.evolution-ecran.glisse { transition: none; }
#appli { transition: transform .44s var(--ios), filter .44s var(--ios); }
body.pousse #appli { transform: translateX(-22%); filter: brightness(.55); }
.evolution-ecran.ouvert .evo-bloc { animation: bloc-entre .5s var(--ios) both; }
.evolution-ecran.ouvert .evo-bloc:nth-child(2) { animation-delay: .04s; } .evolution-ecran.ouvert .evo-bloc:nth-child(3) { animation-delay: .08s; }
.evolution-ecran.ouvert .evo-bloc:nth-child(n+4) { animation-delay: .12s; }
@keyframes bloc-entre { from { opacity: 0; transform: translateY(10px); } }

/* Les glissés horizontaux sont pour les gestes ; le défilement vertical reste natif. */
.fil, .evo-corps, .fils { touch-action: pan-y; }

/* Retour au toucher : tout ce qui se touche s'enfonce légèrement. */
button, .bouton-doux, .puce, .icone-bouton, .note-item, .fil-item, .arbre-fichier, .theme-carte, a.bouton-doux, .rond, .envoyer {
  transition: transform .18s var(--ios), background-color .2s, color .2s, border-color .2s, box-shadow .2s;
}
button:active, .bouton-doux:active, .puce:active, .icone-bouton:active, .note-item:active, .fil-item:active,
.arbre-fichier:active, .theme-carte:active, .rond:active, .envoyer:active { transform: scale(.95); }

/* Messages : arrivée douce. */
.bulle { animation: bulle-entre .38s var(--ios) both; }
.bulle.moi { transform-origin: right bottom; }
.bulle.lui { transform-origin: left bottom; }
@keyframes bulle-entre { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.outil, .plan { animation: bloc-entre .3s var(--ios) both; }
details[open] > pre { animation: bloc-entre .25s var(--ios) both; }

/* Changement de thème : les couleurs se fondent au lieu de sauter. */
.transition-theme, .transition-theme * { transition: background-color .45s ease, color .45s ease, border-color .45s ease, fill .45s, stroke .45s !important; }

/* Défilement fluide et inertiel. */
.fil, .evo-corps, .fils { scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }

@media (prefers-reduced-motion: reduce) {
  .tiroir .tiroir-contenu, .evolution-ecran, #appli { transition: none; }
}

/* ---------- aiguillage (modèle Auto) ---------- */
.routage { display: flex; align-items: center; gap: 8px; margin: 2px 0 6px; font-family: var(--mono); font-size: .7rem; color: var(--doux); }
.routage .niveau { padding: 1px 7px; border: 1px solid var(--bleu-doux); color: var(--bleu); text-transform: uppercase; letter-spacing: .06em; animation: bloc-entre .3s var(--ios) both; }
.routage .niveau.simple { border-color: var(--bleu-fin); color: var(--doux); }
.routage .niveau.complexe { border-color: var(--rouge-doux); color: var(--rouge); }
.explication { margin: 0 0 6px; line-height: 1.5; }
.explication b { color: var(--texte); font-weight: 600; }

/* ---------- consommation ---------- */
.tuiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tuile { background: var(--panneau); border: 1px solid var(--bleu-fin); border-left: 3px solid var(--bleu); padding: 10px 12px; display: flex; flex-direction: column; animation: bloc-entre .4s var(--ios) both; }
.tuile b { font-family: var(--titre); font-size: 1.7rem; line-height: 1.1; color: var(--texte); font-variant-numeric: tabular-nums; }
.tuile span { font-family: var(--mono); font-size: .68rem; color: var(--doux); text-transform: uppercase; letter-spacing: .04em; }
.barre-ligne { display: grid; grid-template-columns: 7.5em 1fr auto; align-items: center; gap: 8px; padding: 5px 0; }
.barre-nom { font-size: .9rem; color: var(--texte); }
.barre-piste { height: 8px; background: var(--bleu-fin); border-radius: 4px; overflow: hidden; }
.barre-piste i { display: block; height: 100%; background: var(--bleu); border-radius: 4px; animation: barre-pousse .7s var(--ios) both; transform-origin: left; }
.barre-piste.quota i { background: var(--rouge); }
@keyframes barre-pousse { from { transform: scaleX(0); } }
.barre-val { font-family: var(--mono); font-size: .72rem; color: var(--doux); font-variant-numeric: tabular-nums; }
.colonnes { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 2px; height: 120px; align-items: end; }
.colonne { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; padding: 0; }
.colonne i { display: block; width: 100%; max-width: 22px; background: var(--bleu); border-radius: 4px 4px 0 0; animation: colonne-pousse .7s var(--ios) both; transform-origin: bottom; }
.colonne:active i, .colonne:hover i { background: var(--texte); }
@keyframes colonne-pousse { from { transform: scaleY(0); } }
.colonne small { font-family: var(--mono); font-size: .6rem; color: var(--doux); min-height: 1em; }

/* ---------- connexions ---------- */
.pastille { font-family: var(--mono); font-size: .66rem; letter-spacing: .02em; margin-left: 8px; text-transform: none; }
.pastille.ok { color: #2bd47a; }
.pastille.ko { color: var(--rouge); }
pre.commande { user-select: all; -webkit-user-select: all; }
.evo-bloc details summary { cursor: pointer; margin-top: 8px; }

/* ---------- Conseil ---------- */
.puce.conseil { border-left-color: var(--rouge); }
.puce.conseil.choisi { background: var(--rouge); color: #fff; border-color: var(--rouge); }
.conseil { margin: 6px 0 10px; border: 1px solid var(--bleu-fin); background: rgba(0,0,0,.15); }
.conseil-titre { padding: 6px 10px; font-family: var(--titre); font-weight: 700; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--bleu); border-bottom: 1px solid var(--bleu-fin); }
.membre { border-bottom: 1px solid var(--bleu-fin); animation: bloc-entre .35s var(--ios) both; }
.membre:last-child { border-bottom: 0; }
.membre summary { display: flex; align-items: baseline; gap: 8px; padding: 7px 10px; list-style: none; cursor: pointer; min-width: 0; }
.membre summary::-webkit-details-marker { display: none; }
.membre summary i { font-style: normal; width: 1.1em; flex: none; color: var(--doux); font-family: var(--mono); }
.membre summary b { flex: none; font-size: .92rem; }
.membre summary span { font-size: .78rem; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.membre.encours summary i { color: var(--bleu); display: inline-block; animation: tourne 1.2s linear infinite; }
.membre.fini summary i { color: var(--bleu); }
.membre.erreur summary i { color: var(--rouge); }
.membre.attente { opacity: .55; }
.membre-avis { padding: 2px 12px 6px 30px; white-space: pre-wrap; font-size: .95rem; }
.membre .bilan { padding: 0 12px 8px 30px; }
body.mode-conseil #champ { border-color: var(--rouge-doux); }
.barre-piste.quota.haut i { background: var(--rouge); }
.barre-piste.quota i { background: var(--bleu); }

/* ---------- visionneuse 3D, aperçus ---------- */
.vue3d { width: 100%; min-height: 200px; border: 1px solid var(--bleu-fin); background: radial-gradient(circle at 50% 40%, var(--bleu-lueur), transparent 70%), var(--champ); touch-action: none; display: grid; place-items: center; }
.vue3d canvas { display: block; width: 100% !important; height: auto !important; }
.apercu-image { width: 100%; height: auto; border: 1px solid var(--bleu-fin); background: #fff; }
.tuile-large { grid-column: 1 / -1; margin-top: 8px; border-left-color: #2bd47a; }
.puce.modele[title^="petit modèle"] { border-left-color: #2bd47a; }
.puce.modele[title^="petit modèle"].choisi { background: #2bd47a; color: #000; border-color: #2bd47a; }

/* ---------- pièces jointes ---------- */
.pj-bouton { width: 40px; height: 46px; color: var(--doux); align-self: flex-end; }
.invite { display: none; }
.pj-liste { position: relative; z-index: 1; display: flex; gap: 8px; overflow-x: auto; padding: 8px 10px; background: var(--barre); border-top: 1px solid var(--bleu-fin); scrollbar-width: none; }
.pj { position: relative; flex: none; display: flex; align-items: center; gap: 8px; max-width: 220px; padding: 6px 30px 6px 6px; background: var(--panneau); border: 1px solid var(--bleu-fin); overflow: hidden; animation: bloc-entre .3s var(--ios) both; }
.pj img { width: 44px; height: 44px; object-fit: cover; flex: none; }
.pj-icone { width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.4rem; flex: none; background: var(--bleu-fin); }
.pj-nom { font-size: .82rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-nom small { display: block; font-family: var(--mono); font-size: .66rem; color: var(--doux); }
.pj.erreur { border-color: var(--rouge-doux); } .pj.erreur small { color: var(--rouge); }
.pj-retirer { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; color: var(--doux); font-size: .8rem; }
.pj-barre { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--bleu); transition: width .2s; }
.pj-menu { position: absolute; z-index: 5; left: 10px; bottom: calc(var(--bas) + 66px); display: flex; flex-direction: column; background: var(--barre); border: 1px solid var(--bleu-doux); box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: bloc-entre .2s var(--ios) both; }
.pj-menu button { padding: 12px 18px; text-align: left; font-size: .95rem; border-bottom: 1px solid var(--bleu-fin); }
.pj-menu button:last-child { border-bottom: 0; }
#appli { position: relative; }
#appli.depot::after { content: "Dépose tes fichiers ici"; position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(0,0,0,.6); border: 2px dashed var(--bleu); color: var(--bleu); font-family: var(--titre); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; pointer-events: none; }
.pj-message { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pj-vignette img { width: 120px; height: 120px; object-fit: cover; display: block; border: 1px solid rgba(255,255,255,.15); }
.pj-puce { display: inline-flex; gap: 6px; padding: 5px 9px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.15); color: inherit; text-decoration: none; font-size: .85rem; }
a.lien-fichier code { text-decoration: underline; text-decoration-color: var(--bleu-doux); }

/* ---------- génération d'images ---------- */
.image-feuille { position: absolute; z-index: 6; left: 10px; right: 10px; bottom: calc(var(--bas) + 66px); display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--barre); border: 1px solid var(--bleu-doux); box-shadow: 0 8px 24px rgba(0,0,0,.45); max-width: 520px; }
.image-feuille small { opacity: .7; }
.image-feuille textarea, .image-feuille select { width: 100%; background: transparent; color: inherit; border: 1px solid var(--bleu-fin); padding: 10px; font: inherit; resize: vertical; }
.image-feuille select { width: auto; }
.image-options { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.image-actions { display: flex; justify-content: flex-end; gap: 10px; }
.image-actions button { padding: 10px 16px; border: 1px solid var(--bleu-fin); }
.image-actions .principal { border-color: var(--bleu-doux); color: var(--bleu, inherit); }
.image-attente { display: flex; align-items: center; gap: 12px; }
.image-cadre { width: 64px; height: 64px; flex: none; border: 1px solid var(--bleu-doux); background: linear-gradient(110deg, transparent 30%, rgba(120,180,255,.25) 50%, transparent 70%) 0 0 / 200% 100%; animation: image-balaye 1.4s linear infinite; }
@keyframes image-balaye { to { background-position: -200% 0; } }
.image-reponse { display: block; margin: 8px 0; }
.image-reponse img { max-width: min(100%, 420px); display: block; border: 1px solid var(--bleu-fin); }

/* ---------- consommation par heure ---------- */
.colonnes.heures { gap: 1px; height: 110px; }
.colonnes.heures .colonne i { max-width: 14px; opacity: .75; }
.colonnes.heures .colonne.pic i { background: var(--rouge, var(--bleu)); opacity: 1; }
.colonnes.heures .colonne.maintenant small { color: var(--texte); }
.colonnes.heures .colonne.maintenant::after { content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--texte); }

/* ---------- canaux : dossiers, archives, couleurs ---------- */
.tiroir-boutons { display: flex; gap: 6px; }
.fil-item { display: flex; align-items: stretch; padding: 0; position: relative; }
.fil-item[style*="--canal"] { box-shadow: inset 3px 0 var(--canal); }
.fil-item.actif { box-shadow: inset 3px 0 var(--canal, var(--bleu)); }
.fil-ouvrir { flex: 1; min-width: 0; text-align: left; padding: 11px 6px 11px 14px; }
.fil-plus { flex: none; width: 44px; font-size: 1.2rem; color: var(--doux); }
.pastille-canal { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--canal); margin-right: 8px; vertical-align: middle; }
.groupe-canaux { border-bottom: 1px solid var(--bleu-fin); }
.groupe-entete { display: flex; align-items: center; }
.groupe-titre { flex: 1; display: flex; align-items: center; gap: 4px; padding: 12px 14px; text-align: left; font-family: var(--titre); font-weight: 700; letter-spacing: .06em; font-size: .85rem; text-transform: uppercase; color: var(--canal, var(--doux)); }
.groupe-titre small { margin-left: auto; font-family: var(--mono); color: var(--doux); font-weight: 400; }
.groupe-fleche { display: inline-block; width: 16px; transition: transform .25s var(--ios); }
.groupe-canaux.replie .groupe-fleche { transform: rotate(-90deg); }
.groupe-canaux.replie .groupe-liste { display: none; }
.groupe-liste .fil-item .fil-ouvrir { padding-left: 26px; }
.groupe-vide { padding: 8px 26px 12px; text-transform: none; }
.feuille-fond { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,0); display: flex; align-items: flex-end; justify-content: center; transition: background .25s var(--ios); }
.feuille-fond.ouvert { background: rgba(0,0,0,.6); }
.feuille { width: 100%; max-width: 520px; max-height: 85vh; overflow-y: auto; background: var(--barre); border-top: 1px solid var(--bleu-doux); padding: 18px 16px calc(16px + var(--bas, 0px)); display: flex; flex-direction: column; gap: 14px; transform: translateY(100%); transition: transform .3s var(--ios); }
.feuille-fond.ouvert .feuille { transform: none; }
.feuille-titre { font-family: var(--titre); letter-spacing: .1em; text-transform: uppercase; color: var(--bleu); }
.feuille-ligne { display: flex; flex-direction: column; gap: 8px; font-size: .85rem; color: var(--doux); }
.nuancier { display: flex; flex-wrap: wrap; gap: 10px; }
.nuance { width: 34px; height: 34px; border-radius: 50%; background: var(--canal); border: 2px solid var(--bleu-fin); color: var(--doux); }
.nuance.choisie { outline: 2px solid var(--texte); outline-offset: 2px; }
.choix-dossiers { display: flex; flex-wrap: wrap; gap: 6px; }
.choix-dossiers .puce[style*="--canal"] { border-left: 3px solid var(--canal); }
.feuille-fermer { align-self: stretch; }
/* Tiroir allégé : modules compacts sur 3 colonnes, réglages rapides sur une ligne. */
.tiroir-pied { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.tiroir-pied .modules, .tiroir-pied .conso { grid-column: 1 / -1; }
.tiroir-pied .modules { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tiroir-pied .modules > * { padding: 8px 4px; font-size: .64rem; letter-spacing: .04em; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiroir-pied .modules .evo-bouton { grid-column: auto; }
.tiroir-pied .conso { margin: 0; }
.tiroir-pied #deconnexion { padding: 8px 12px; font-size: .64rem; }

/* ---------- mails et alertes ---------- */
.mail-ligne { padding: 8px 0; border-bottom: 1px solid var(--bleu-fin); font-size: .88rem; }
.mail-ligne small { display: block; color: var(--doux); margin-top: 2px; }
/* Canal qui a avancé depuis la dernière visite. */
.fil-item.non-lu .fil-titre::before {
  content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--bleu);
  box-shadow: 0 0 6px var(--bleu); margin: 0 8px; vertical-align: middle; }
/* Dossier replié : nombre de canaux non lus qu'il contient. */
.groupe-canaux.replie.non-lu .groupe-titre::after { content: attr(data-n); min-width: 15px; height: 15px; padding: 0 3px; margin-left: 8px;
  box-sizing: border-box; border-radius: 8px; background: var(--bleu); box-shadow: 0 0 6px var(--bleu); color: #fff;
  font: 600 .6rem/15px var(--mono); letter-spacing: 0; text-align: center; }
#ouvrir-fils { position: relative; }
#ouvrir-fils.non-lu::after { content: attr(data-n); position: absolute; top: 4px; right: 2px; min-width: 15px; height: 15px; padding: 0 3px;
  box-sizing: border-box; border-radius: 8px; background: var(--bleu); box-shadow: 0 0 6px var(--bleu); color: #fff;
  font: 600 .6rem/15px var(--mono); text-align: center; }
