/* Terminal A.I.M. : le portable de campagne d'un mercenaire, version cyberpunk.
   Grammaire reprise de Jagged Alliance: Back in Action : fenêtre de métal biseauté, boutons empilés avec icône,
   puits creusés dans le métal, enseigne de boutique, fiche de recrutement. L'orange du jeu devient vert : l'orange,
   le rouge et le bleu sont les couleurs d'autres camps sur le serveur.
   Cible : le CEF de FiveM (Chromium 103) : pas de nesting, de color-mix ni de @media (width >= …). */
@font-face { font-family: Chakra; src: url(polices/chakra-petch-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Chakra; src: url(polices/chakra-petch-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: Chakra; src: url(polices/chakra-petch-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Tech; src: url(polices/share-tech-mono-latin-400-normal.woff2) format("woff2"); font-display: swap; }

:root {
  --noir: #060807;
  --puits: #090c0a;
  --acier-1: #464c48;
  --acier-2: #2b302d;
  --acier-3: #1a1e1b;
  --arete: #737b75;
  --ombre: #030403;
  --os: #dfe4dc;
  --gris: #98a39b;
  --gris-sombre: #66716a;
  --vert: #39f59b;
  --lime: #c3ec87;
  --olive: #4d6340;
  --olive-clair: #8fa877;
  --titre: Chakra, "Arial Narrow", sans-serif;
  --mono: Tech, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  background: var(--noir) url(metal.jpg); color: var(--os);
  font: 500 14px/1.45 var(--titre); overflow: hidden; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--puits); box-shadow: inset 0 0 3px #000; }
::-webkit-scrollbar-thumb { background: linear-gradient(90deg, var(--acier-1), var(--acier-2)); border: 1px solid #000; }
:focus-visible { outline: 1px solid var(--vert); outline-offset: 1px; }

.ecran { position: fixed; inset: 0; }
.trame {
  position: fixed; inset: 0; pointer-events: none; z-index: 60;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.1) 0 1px, transparent 1px 3px);
}
.pousse { flex: 1; }
.chiffre, .mono { font-family: var(--mono); }

/* --- Le portable --- */
.portable {
  position: absolute; inset: 8px; display: flex; flex-direction: column;
  background: var(--acier-3) url(metal.jpg);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
  box-shadow: inset 0 0 0 1px var(--arete), inset 0 0 0 3px var(--acier-3), inset 0 0 0 4px #000;
  padding: 4px;
}
.barre-titre, .barre-pied {
  display: flex; align-items: center; gap: 14px; flex: none; padding: 0 30px 0 12px;
  font: 400 12px/1 var(--mono); letter-spacing: .08em; color: var(--gris); white-space: nowrap;
}
.barre-titre { height: 34px; background: linear-gradient(#3b413d, #1e2220); border-bottom: 1px solid #000; box-shadow: inset 0 1px 0 var(--arete); }
.barre-pied { height: 26px; background: linear-gradient(#1e2220, #2b302d); border-top: 1px solid #000; box-shadow: inset 0 1px 0 #3b413d; padding: 0 16px 0 30px; }
.os { font: 700 14px/1 var(--titre); color: var(--os); letter-spacing: .06em; }
.os b { color: var(--vert); }
.b-nom { color: var(--os); overflow: hidden; text-overflow: ellipsis; }
#b-role { color: var(--vert); }
.rayures {
  width: 58px; height: 12px; flex: none;
  background: repeating-linear-gradient(-45deg, var(--vert) 0 5px, transparent 5px 11px); opacity: .7;
}
.flux { color: var(--gris-sombre); overflow: hidden; flex: 1; }
.led { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--vert); box-shadow: 0 0 6px var(--vert); }
.batterie { display: block; width: 92px; height: 11px; padding: 2px; background: var(--puits); box-shadow: inset 0 1px 2px #000; }
.batterie b { display: block; height: 100%; width: 84%; background: repeating-linear-gradient(90deg, var(--vert) 0 6px, transparent 6px 8px); }
.croix {
  width: 26px; height: 24px; margin-right: -22px; background: linear-gradient(#59605b, #2b302d); border: 1px solid #000;
  box-shadow: inset 0 1px 0 #8b938d; font-size: 13px; line-height: 1;
}
.croix:hover { color: var(--vert); }

/* Matières de base */
.puits { background: var(--puits); box-shadow: inset 0 2px 7px #000, inset 0 0 0 1px #000, 0 1px 0 rgba(255,255,255,.06); }
.bouton {
  background: linear-gradient(#4a504c, #262a27); border: 1px solid #000; padding: 6px 15px;
  box-shadow: inset 0 1px 0 #7d857f, inset 0 -1px 0 #171a18;
  font: 600 14px/1.2 var(--titre); letter-spacing: .03em; white-space: nowrap;
}
.bouton:hover { color: var(--vert); box-shadow: inset 0 1px 0 #8d958f, inset 0 -1px 0 #171a18, 0 0 8px rgba(57,245,155,.3); }
.bouton:active { background: linear-gradient(#262a27, #3b413d); }
.bouton.fort { color: var(--vert); box-shadow: inset 0 1px 0 #7d857f, inset 0 0 0 1px var(--olive-clair), 0 0 9px rgba(57,245,155,.25); }
.bouton.petit { padding: 2px 8px; font-size: 12px; }
.bouton.grand { padding: 12px 28px; font-size: 18px; min-width: 220px; }

/* --- Verrou --- */
.verrou-corps { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px; }
.sigle {
  position: relative; display: block; width: min(600px, 76vw); padding: 26px 34px;
  background: linear-gradient(#222725, #111412); border: 1px solid #000;
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
  box-shadow: inset 0 0 0 1px var(--acier-1), inset 0 2px 12px #000;
  transition: width .45s cubic-bezier(.2,.7,.2,1), padding .45s;
}
.sigle-logo { position: relative; display: block; width: 100%; }
.sigle-halo {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(57,245,155,.16), rgba(57,245,155,.04) 52%, transparent 74%);
  animation: souffle 5s ease-in-out infinite;
}
@keyframes souffle { 50% { opacity: .55; } }
.sigle:hover .sigle-halo { animation: none; }
.en-saisie .sigle { width: min(250px, 55vw); padding: 10px 16px; cursor: default; }
.invite { margin-top: 20px; color: var(--vert); font: 400 14px/1.3 var(--mono); letter-spacing: .08em; }

.saisie { display: flex; flex-direction: column; align-items: center; margin-top: 12px; padding: 12px 22px 16px;
  background: linear-gradient(#2b302d, #1a1e1b); box-shadow: inset 0 1px 0 var(--arete), inset 0 0 0 1px #000; }
.saisie-titre { font: 700 16px/1.2 var(--titre); letter-spacing: .08em; text-transform: uppercase; }
.cases { display: flex; gap: 6px; margin: 10px 0 5px; }
.case { width: 32px; height: 40px; display: grid; place-items: center; font: 400 20px/1 var(--mono); color: var(--vert);
  background: var(--puits); box-shadow: inset 0 2px 5px #000, inset 0 0 0 1px #000; }
.case.pleine { box-shadow: inset 0 2px 5px #000, inset 0 0 0 1px var(--olive-clair); }
.cases.refus { animation: refus .3s linear; }
.cases.refus .case { background: var(--os); }
@keyframes refus { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
.saisie-erreur { min-height: 20px; font: 400 12px/1.5 var(--mono); }
.pave { display: grid; grid-template-columns: repeat(3, 76px); gap: 6px; }
.touche {
  height: 44px; background: linear-gradient(#4a504c, #262a27); border: 1px solid #000;
  box-shadow: inset 0 1px 0 #7d857f, inset 0 -1px 0 #171a18; font: 700 21px/1 var(--titre);
}
.touche:hover { color: var(--vert); }
.touche:active { background: linear-gradient(#1a1e1b, #2b302d); }
.touche.mot { font-size: 13px; color: var(--gris); }

/* --- Code valide : l'écran de verrouillage devient la porte. Ses deux moitiés sont de vraies copies de l'écran,
   le logo se coupe en deux sous les yeux et le terminal attend derrière. --- */
.valide .case { background: #0f3a28; color: var(--vert); box-shadow: inset 0 0 0 1px var(--vert), 0 0 8px rgba(57,245,155,.45); transition: background .1s; }
.valide .saisie { opacity: 0; transform: translateY(26px) scale(.97); transition: opacity .28s .14s, transform .28s .14s; }
.valide .sigle { transition: transform .42s cubic-bezier(.3,0,.2,1) .1s; }
#porte { position: fixed; inset: 0; z-index: 40; overflow: hidden; perspective: 1500px; }
#porte::before { content: ""; position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, rgba(57,245,155,.5), rgba(57,245,155,.1) 45%, transparent 72%); }
#porte.ouvre::before { animation: lueur-porte 1.05s linear forwards; }
@keyframes lueur-porte { 25% { opacity: 1; } 100% { opacity: 0; } }
.battant { position: absolute; inset: 0; }
.face-porte { position: absolute; inset: 0; background: var(--acier-3) url(metal.jpg); }
.face-porte .sigle { transition: none; }
.tranche { position: absolute; left: 50%; top: -10%; width: 18px; height: 120%; margin-left: -9px; background: linear-gradient(90deg, #0a0d0b, #5a625d 45%, #1a1e1b); box-shadow: 0 0 10px #000; }
.tranche i { position: absolute; top: 0; bottom: 0; left: 7px; width: 4px; background: var(--vert); box-shadow: 0 0 12px var(--vert), 0 0 30px rgba(57,245,155,.6); transform: scaleY(0); transition: transform .26s cubic-bezier(.2,.7,.2,1); }
#porte.joint .tranche i { transform: scaleY(1); }
#porte.acoup .battant { transition: transform .08s linear; }
#porte.acoup .battant.g { transform: translate(-6px, -2px); }
#porte.acoup .battant.d { transform: translate(6px, 2px); }
#porte.ouvre .battant { transition: transform 1s cubic-bezier(.6,0,.28,1); }
#terminal.arrivee .portable { animation: arrivee-terminal 1.05s cubic-bezier(.2,.6,.2,1); }
@keyframes arrivee-terminal { from { transform: scale(.955); filter: brightness(.45); } }

/* --- Transmission --- */
#transmission { background: #000; display: flex; flex-direction: column; padding: 22px clamp(20px, 6vw, 80px); }
.tr-haut { display: flex; align-items: center; gap: 16px; font: 400 12px/1 var(--mono); letter-spacing: .1em; color: var(--gris); }
#tr-etat { color: var(--vert); }
#tr-dest { margin-left: auto; }
#tr-onde { width: 100%; height: 150px; margin-top: auto; }
.tr-texte { min-height: 150px; margin: 20px auto auto; max-width: 880px; text-align: center; font: 600 clamp(20px, 2.5vw, 28px)/1.3 var(--titre); }
.tr-texte.nom { font-weight: 700; font-size: clamp(32px, 4.4vw, 50px); letter-spacing: .1em; text-transform: uppercase; color: var(--vert); }
.tr-fin { position: absolute; inset: 0; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: 24px; text-align: center; }
.tr-fin img { width: min(340px, 60vw); }
.tr-fin h2 { font: 700 32px/1.15 var(--titre); text-transform: uppercase; color: var(--vert); }
.tr-fin p { color: var(--gris); max-width: 540px; }
.tr-choix { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.tr-bas { display: flex; align-items: center; gap: 14px; margin-top: 12px; color: var(--gris-sombre); font: 400 12px/1 var(--mono); }
.tr-barre { flex: 1; height: 2px; background: #1a1e1b; }
.tr-barre span { display: block; height: 100%; width: 0; background: var(--vert); }

/* --- Corps du portable --- */
.corps { flex: 1; min-height: 0; display: flex; }
.console { width: 212px; flex: none; display: flex; flex-direction: column; padding: 12px 10px 10px; border-right: 1px solid #000; box-shadow: inset -1px 0 0 #3b413d; }
.compte { padding: 7px 9px; margin-bottom: 11px; font: 400 13px/1.55 var(--mono); color: var(--lime); }
.compte div { display: flex; justify-content: space-between; gap: 8px; }
.compte span { color: var(--olive-clair); }
#nav { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 3px 2px 1px; }
.nav-lien { display: grid; grid-template-columns: 30px 1fr; gap: 7px; align-items: center; width: 100%; margin-bottom: 6px; padding: 0; background: none; border: 0; color: var(--gris); }
.nav-icone { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--puits); box-shadow: inset 0 2px 4px #000, 0 1px 0 #4a504c, 0 0 0 1px #000; color: var(--olive-clair); }
.nav-icone svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-texte {
  display: flex; justify-content: space-between; align-items: center; height: 31px; padding: 0 9px;
  background: linear-gradient(#3b413d, #1e2220); border: 1px solid #000; box-shadow: inset 0 1px 0 #6a716c, inset 0 0 0 1px rgba(143,168,119,.13);
  font: 600 14px/1 var(--titre); text-align: left; white-space: nowrap; overflow: hidden;
}
.nav-lien:hover .nav-texte { color: var(--os); }
.nav-lien.actif .nav-texte { color: var(--vert); background: linear-gradient(#4a504c, #2b302d); box-shadow: inset 0 1px 0 #8d958f, inset 0 0 0 1px var(--olive-clair), 0 0 8px rgba(57,245,155,.28); }
.nav-lien.actif .nav-icone { color: var(--vert); }
.nav-lien b { color: #04140b; background: var(--vert); padding: 0 5px; font: 400 12px/16px var(--mono); }
.quitter { margin-top: 8px; width: 100%; }

.ecran-contenu { flex: 1; min-width: 0; overflow-y: auto; margin: 10px; padding: 16px 18px; background: rgba(6,8,7,.72); box-shadow: inset 0 2px 9px #000, inset 0 0 0 1px #000, 0 1px 0 rgba(255,255,255,.06); }

/* Enseigne en tête d'écran, comme la boutique du jeu */
.enseigne {
  display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 7px 14px; margin-bottom: 8px;
  background: linear-gradient(#1a1e1b, #0b0e0c); box-shadow: inset 0 0 0 1px #000, inset 0 1px 0 #3b413d;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}
.enseigne h1 { flex: 1; font: 700 24px/1.1 var(--titre); color: var(--vert); text-shadow: 0 0 12px rgba(57,245,155,.45); }
.enseigne p { font: 400 12px/1.3 var(--mono); color: var(--gris); }
.enseigne .centre { flex: 1; text-align: center; }
.onglets { display: flex; gap: 3px; margin-bottom: 10px; }
.onglet {
  flex: 1; padding: 5px 4px; background: linear-gradient(#2b302d, #131614); border: 1px solid #000;
  box-shadow: inset 0 1px 0 #4a504c; font: 600 14px/1.2 var(--titre); color: var(--gris); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.onglet:hover { color: var(--os); }
.onglet.actif { color: var(--vert); box-shadow: inset 0 1px 0 #4a504c, inset 0 -2px 0 var(--vert); }

/* Panneaux à bandeau olive, comme les infobulles de carte du jeu */
.panneau { background: #111512; box-shadow: inset 0 0 0 1px var(--olive-clair), 0 2px 8px #000; }
.panneau > h2 {
  padding: 4px 10px; background: linear-gradient(#5e7a4d, #3a4c30); color: #eef4e4;
  font: 600 13px/1.3 var(--titre); text-shadow: 0 1px 1px #000;
}
.panneau > div { padding: 9px 11px; }
.grille { display: grid; gap: 11px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); align-items: start; }
.vide { color: var(--gris-sombre); padding: 14px 2px; }
.ligne { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-top: 1px solid #252b27; }
.ligne:first-child { border-top: 0; }
.ligne > span:first-child { color: var(--gris); }
.etiquette { padding: 0 6px; font: 400 12px/18px var(--mono); white-space: nowrap; background: #1a1e1b; box-shadow: inset 0 0 0 1px var(--acier-1); }
.etiquette.vive { color: var(--vert); box-shadow: inset 0 0 0 1px var(--vert); }
.etiquette.pleine { background: var(--os); color: var(--noir); box-shadow: none; }
.outils { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--olive-clair); font: 600 12px/1.3 var(--titre); padding: 3px 10px 5px 0; border-bottom: 1px solid var(--olive); }
td { padding: 6px 10px 6px 0; border-bottom: 1px solid #252b27; vertical-align: top; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .bouton { margin-left: 4px; }
td.coche { text-align: center; }
th.coche { text-align: center; }

/* Recrutement : la fiche A.I.M. du jeu */
.membres { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.membre { padding: 5px; background: linear-gradient(#2b302d, #161917); border: 1px solid #000; box-shadow: inset 0 1px 0 #4a504c; text-align: center; }
.membre:hover { box-shadow: inset 0 1px 0 #4a504c, inset 0 0 0 1px var(--olive-clair); }
.membre b { display: block; margin-top: 4px; font: 600 13px/1.15 var(--titre); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.membre span { color: var(--gris); font: 400 11px/1.2 var(--mono); }
.portrait { display: block; position: relative; aspect-ratio: 4 / 5; background: var(--puits); box-shadow: inset 0 0 0 1px #000; overflow: hidden; }
.portrait img, .portrait svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.dossier { display: grid; grid-template-columns: 178px minmax(0, 1fr); gap: 11px; align-items: start; }
.details { margin-top: 7px; padding: 6px 8px; font-size: 12px; }
.details h3 { margin: 7px 0 2px; text-align: center; font: 600 12px/1.2 var(--titre); color: var(--olive-clair); }
.details h3:first-child { margin-top: 0; }
.attr { display: flex; justify-content: space-between; color: var(--lime); font: 400 12px/1.4 var(--mono); }
.attr b { font-weight: 400; color: var(--os); }
.nom-barre { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.nom-barre h2 { flex: 1; padding: 5px 8px; text-align: center; font: 700 20px/1.1 var(--titre); }
.fleche { width: 42px; height: 34px; flex: none; background: linear-gradient(#2b302d, #131614); border: 1px solid #000; box-shadow: inset 0 1px 0 #4a504c; color: var(--vert); font-size: 16px; line-height: 1; }
.fleche:hover { text-shadow: 0 0 8px var(--vert); }
.texte-puits { padding: 8px 11px; min-height: 70px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sous-titre { margin: 9px 0 3px; font: 600 12px/1.2 var(--titre); color: var(--olive-clair); }
.bas-dossier { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 11px; }
.gear { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.gear span { aspect-ratio: 1; display: grid; place-items: center; padding: 3px; font: 500 10px/1.1 var(--titre); color: var(--lime); text-align: center; overflow: hidden; background: var(--puits); box-shadow: inset 0 2px 4px #000, inset 0 0 0 1px #000; }
.pied-onglets { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }

/* Bureau de l'agent : silhouette holographique, le mannequin vert de l'inventaire */
.holo { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 12px; align-items: start; }
.mannequin { padding: 8px; text-align: center; }
.mannequin svg { height: 268px; filter: drop-shadow(0 0 7px rgba(57,245,155,.55)); }

/* Boutique */
.articles { display: grid; gap: 7px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.article { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 9px; padding: 7px; background: linear-gradient(#1e2220, #0f1210); box-shadow: inset 0 0 0 1px #000, inset 0 1px 0 #3b413d; }
.article.masque { opacity: .55; }
.vignette { display: grid; place-items: center; height: 92px; color: var(--olive-clair); }
.vignette svg { width: 96px; height: 60px; fill: currentColor; filter: drop-shadow(0 0 5px rgba(57,245,155,.35)); }
.vignette img { max-width: 100%; max-height: 100%; }
.article-nom { font: 600 14px/1.2 var(--titre); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 34px; }
.article-bas { display: flex; align-items: center; gap: 4px; margin: 7px 0 5px; font: 400 14px/1 var(--mono); color: var(--lime); }
.article-bas .prix { flex: 1; white-space: nowrap; }
.qte { min-width: 18px; text-align: center; color: var(--os); }
.mini { width: 22px; height: 22px; padding: 0; background: linear-gradient(#3b413d, #1e2220); border: 1px solid #000; box-shadow: inset 0 1px 0 #6a716c; color: var(--vert); line-height: 1; font-size: 14px; }
.article-info { font: 400 11px/1.2 var(--mono); color: var(--gris-sombre); }
.panier { display: flex; align-items: center; gap: 16px; margin-top: 9px; padding: 7px 12px; background: linear-gradient(#1e2220, #0f1210); box-shadow: inset 0 0 0 1px #000, inset 0 1px 0 #3b413d; }
.panier div { text-align: center; font: 400 13px/1.3 var(--mono); }
.panier div b { display: block; font: 600 12px/1.3 var(--titre); color: var(--olive-clair); }

/* Cibles */
.cibles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.cible { padding: 5px; background: linear-gradient(#2b302d, #161917); border: 1px solid #000; box-shadow: inset 0 1px 0 #4a504c; text-align: left; }
.cible img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top; }
.cible-fiche { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
.cible-fiche img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top; }
.cible b { display: block; margin-top: 5px; font: 700 16px/1.15 var(--titre); }
.cible span { color: var(--gris); font: 400 11px/1.3 var(--mono); }

/* Listes à gauche, détail à droite */
.double { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 11px; align-items: start; }
.choix { display: block; width: 100%; margin-bottom: 5px; padding: 6px 9px; text-align: left; background: linear-gradient(#2b302d, #161917); border: 1px solid #000; box-shadow: inset 0 1px 0 #4a504c; }
.choix.actif { box-shadow: inset 0 1px 0 #4a504c, inset 0 0 0 1px var(--vert); }
.choix b { display: block; font: 600 14px/1.2 var(--titre); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choix span { color: var(--gris); font: 400 11px/1.3 var(--mono); }
.choix.nonlu b { color: var(--vert); }
.texte { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Canal crypté */
.ecran-contenu.plein { display: flex; flex-direction: column; overflow: hidden; }
.chat { flex: 1; min-height: 0; display: grid; grid-template-columns: 276px minmax(0, 1fr); gap: 10px; }
.chat-liste { overflow-y: auto; padding: 5px; }
.chat-ligne { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 8px; align-items: center; width: 100%; margin-bottom: 4px; padding: 6px; background: none; border: 0; text-align: left; }
.chat-ligne:hover { background: #151a17; }
.chat-ligne.actif { background: linear-gradient(90deg, #1b3226, #131815); box-shadow: inset 2px 0 0 var(--vert); }
.chat-avatar { width: 38px; height: 38px; display: grid; place-items: center; font: 700 14px/1 var(--titre); color: var(--vert); background: #0f1a14;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px)); }
.chat-avatar.groupe { color: #06140c; background: var(--olive-clair); font-size: 18px; }
.chat-resume { min-width: 0; }
.chat-resume b, .chat-resume span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-resume b { font: 600 14px/1.25 var(--titre); }
.chat-resume span { color: var(--gris); font: 400 12px/1.3 var(--mono); }
.chat-etat { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.chat-etat i { font: 400 11px/1 var(--mono); color: var(--gris-sombre); }
.chat-etat b { min-width: 18px; padding: 0 5px; text-align: center; color: #04140b; background: var(--vert); font: 400 12px/16px var(--mono); }
.chat-zone { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-repos { margin: auto; }
.chat-tete { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: linear-gradient(#232826, #151917); box-shadow: inset 0 -1px 0 #000, inset 0 1px 0 #3b413d; }
.chat-tete b { display: block; font: 700 16px/1.2 var(--titre); }
.chat-tete div span { color: var(--olive-clair); font: 400 11px/1.2 var(--mono); letter-spacing: .06em; }
.chat-duree { display: flex; align-items: center; gap: 7px; color: var(--gris); font-size: 12px; }
.chat-duree b { font: 500 12px/1 var(--titre); }
.chat-duree select { background: var(--puits); border: 0; box-shadow: inset 0 0 0 1px #000, inset 0 0 0 2px var(--acier-1); padding: 3px 5px; color: var(--os); }
.chat-fil { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 12px;
  background: repeating-linear-gradient(0deg, rgba(57,245,155,.018) 0 1px, transparent 1px 22px), repeating-linear-gradient(90deg, rgba(57,245,155,.018) 0 1px, transparent 1px 22px); }
.bulle { align-self: flex-start; max-width: 72%; padding: 6px 10px 5px; background: linear-gradient(#272c29, #1c201e); box-shadow: inset 0 1px 0 #454c47;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%); }
.bulle.moi { align-self: flex-end; background: linear-gradient(#17553a, #0f3a28); box-shadow: inset 0 1px 0 #2f8a60;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 8px 100%, 0 calc(100% - 8px)); }
.bulle b { display: block; color: var(--vert); font: 600 12px/1.3 var(--titre); }
.bulle span { display: block; text-align: right; color: var(--gris); font: 400 10px/1.3 var(--mono); }
.bulle.moi span { color: #8fd3af; }
.chat-envoi { display: flex; gap: 8px; padding: 8px; background: linear-gradient(#151917, #232826); box-shadow: inset 0 1px 0 #000; }
.chat-envoi textarea { flex: 1; min-height: 34px; max-height: 90px; resize: none; padding: 7px 9px; border: 0; color: var(--os); background: var(--puits); box-shadow: inset 0 2px 5px #000, inset 0 0 0 1px #000; }

/* Fenêtre et formulaires */
dialog {
  margin: auto; width: min(660px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto;
  background: var(--acier-3) url(metal.jpg); color: var(--os); border: 1px solid #000; padding: 0;
  box-shadow: inset 0 0 0 1px var(--arete), 0 8px 40px #000;
}
dialog::backdrop { background: rgba(0,0,0,.7); }
.fen-titre { padding: 6px 12px; background: linear-gradient(#5e7a4d, #3a4c30); font: 700 15px/1.3 var(--titre); text-shadow: 0 1px 1px #000; }
.fen-corps { padding: 13px 16px 14px; }
.champ { display: block; margin-bottom: 9px; }
.champ > span { display: block; color: var(--olive-clair); font: 600 12px/1.3 var(--titre); margin-bottom: 2px; }
.champ input:not([type]), .champ input[type=text], .champ input[type=number], .champ textarea, .champ select {
  width: 100%; background: var(--puits); border: 0; box-shadow: inset 0 2px 5px #000, inset 0 0 0 1px #000; padding: 6px 8px; color: var(--os);
}
.champ select option { background: var(--puits); }
.champ textarea { min-height: 88px; resize: vertical; }
.coches { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.coches label { display: flex; align-items: center; gap: 5px; }
input[type=checkbox], input[type=range] { accent-color: var(--vert); }
input[type=range] { margin: 0; width: 100%; }
.fenetre-pied { display: flex; justify-content: flex-end; gap: 7px; margin-top: 12px; }
.code-revele { font: 400 36px/1.2 var(--mono); letter-spacing: .14em; color: var(--vert); text-align: center; padding: 13px; user-select: all; }

.alerte { position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%); z-index: 70; padding: 7px 16px; background: var(--os); color: var(--noir); font: 600 14px/1.3 var(--titre); }

@media (max-width: 860px) {
  body { overflow: auto; }
  .portable { position: relative; inset: auto; min-height: 100vh; clip-path: none; }
  .corps { flex-direction: column; }
  .console { width: auto; border-right: 0; }
  #nav { display: flex; gap: 5px; overflow-x: auto; }
  .nav-lien { width: auto; flex: none; margin: 0; grid-template-columns: auto; }
  .nav-icone, .quitter { display: none; }
  .ecran-contenu { margin: 6px; padding: 12px; }
  .dossier, .double, .holo, .bas-dossier, .cible-fiche, .chat { grid-template-columns: minmax(0, 1fr); }
  .ecran-contenu.plein { overflow: visible; }
  .chat-liste { max-height: 170px; }
  .chat-zone { height: 62vh; }
  .chat-duree span { display: none; }
  .articles { grid-template-columns: minmax(0, 1fr); }
  .b-nom, .flux { display: none; }
  .barre-titre { gap: 8px; }
  .panier { flex-wrap: wrap; }
}
@media (max-height: 640px) {
  .en-saisie .sigle { width: 170px; padding: 4px 10px; }
  .touche { height: 36px; }
}
