/* Mnémo Studio — charte : nuit, violet, bleu électrique, chrome (logo Mnémo). Aucune ressource externe. */
:root {
  --nuit: #05030D; --fond: #08061A; --scene: #07051A; --panneau: #0E0A24; --carte: #120E29;
  --bord: rgba(167,139,250,.2); --bord-fort: rgba(196,181,253,.5);
  --texte: #ECEAF7; --doux: #A9A4C7; --pale: #8C86AD;
  --violet: #7C3AED; --violet-vif: #A855F7; --lilas: #C4B5FD; --bleu: #2563EB; --bleu-clair: #93C5FD;
  --ok: #4ADE80; --erreur: #FCA5A5;
  --titre: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --corps: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--nuit); color: var(--texte); font: 15px/1.45 var(--corps); }
a { color: var(--lilas); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--bleu-clair); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.titre { font-family: var(--titre); font-weight: 700; letter-spacing: .01em; }
.doux { color: var(--doux); }
.pale { color: var(--pale); font-size: 13px; }
.cache-visuel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.btn { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--bord-fort); background: transparent; }
.btn:hover { background: rgba(124,58,237,.18); }
.btn-plein { border: 0; background: linear-gradient(100deg, var(--violet), var(--bleu)); color: #fff; font-weight: 600; }
.btn-plein:hover { filter: brightness(1.12); background: linear-gradient(100deg, var(--violet), var(--bleu)); }
.btn-danger { border-color: rgba(248,113,113,.6); color: var(--erreur); }
.btn-danger-plein { border: 0; background: #B91C1C; color: #fff; font-weight: 600; }
.btn-danger-plein:hover { background: #991B1B; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Fenêtres de confirmation */
.modale { width: min(460px, calc(100vw - 32px)); padding: 24px; border-radius: 18px; border: 1px solid var(--bord-fort);
  background: #0E0A24; color: var(--texte); box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 60px rgba(124,58,237,.25); }
.modale::backdrop { background: rgba(5,3,13,.72); backdrop-filter: blur(4px); }
.modale h2 { margin: 0; font-size: 21px; }
.modale[open] { animation: apparait .18s ease-out; }
.champ { min-height: 42px; width: 100%; border-radius: 10px; border: 1px solid rgba(167,139,250,.35); background: var(--panneau); padding: 0 12px; }
.alerte { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; background: rgba(248,113,113,.12); color: var(--erreur); }
.succes { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; background: rgba(74,222,128,.1); color: #BBF7D0; }

/* Connexion */
.connexion { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(circle at 50% 40%, rgba(124,58,237,.25), transparent 55%), var(--nuit); }
.connexion form { width: min(420px, 100%); display: flex; flex-direction: column; gap: 14px; align-items: stretch;
  background: rgba(14,10,36,.85); border: 1px solid var(--bord); border-radius: 20px; padding: 28px; }
.connexion img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; align-self: center;
  box-shadow: 0 0 0 1px var(--bord-fort), 0 0 40px rgba(168,85,247,.5); }

/* Application */
.studio { min-height: 100vh; display: flex; flex-direction: column; }
.entete { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 10px 18px; background: var(--fond); border-bottom: 1px solid var(--bord); }
.marque { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.marque img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--bord-fort), 0 0 16px rgba(168,85,247,.45); }
.marque span span { color: var(--violet-vif); }
.ariane { display: flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 14px; }
.ariane button { min-height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; }
.ariane button[aria-current="page"] { background: rgba(124,58,237,.3); }
.etat { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; padding: 0 12px; min-height: 34px; border-radius: 999px; background: rgba(74,222,128,.1); }
.etat::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.etat.acces-limite { background: rgba(96,165,250,.12); color: var(--bleu-clair); }
.etat.acces-limite::before { background: #60A5FA; }
.droite { margin-left: auto; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.corps { flex: 1; display: flex; flex-wrap: wrap; min-height: 0; }
.rail { flex: 0 0 64px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; background: var(--fond); border-right: 1px solid var(--bord); }
.rail button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--doux); display: grid; place-items: center; }
.rail button[aria-pressed="true"] { color: #fff; background: rgba(124,58,237,.3); border-color: var(--bord-fort); }
.rail svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.scene { flex: 999 1 560px; min-width: 0; height: 620px; overflow: auto; position: relative; background-color: var(--scene);
  background-image: radial-gradient(rgba(167,139,250,.17) 1px, transparent 1px), radial-gradient(circle at 50% 50%, rgba(124,58,237,.2), transparent 60%);
  background-size: 26px 26px, 100% 100%; }
.plateau { position: relative; width: 860px; height: 600px; margin: 10px auto; }
.trait { position: absolute; height: 2px; transform-origin: 0 50%; pointer-events: none;
  transition: left .6s cubic-bezier(.2,.8,.2,1), top .6s cubic-bezier(.2,.8,.2,1), width .6s cubic-bezier(.2,.8,.2,1), transform .6s cubic-bezier(.2,.8,.2,1), opacity .4s; }
.trait.fort { background: linear-gradient(90deg, var(--violet-vif), #60A5FA); box-shadow: 0 0 10px rgba(168,85,247,.8); }
.trait.normal { background: rgba(167,139,250,.45); }
.trait.discret { background: rgba(167,139,250,.22); }
.trait.lien { background: repeating-linear-gradient(90deg, #60A5FA 0 6px, transparent 6px 12px); opacity: .75; }
.noeud { position: absolute; border: 1px solid var(--bord-fort); background: rgba(14,10,36,.92); text-align: left;
  transition: left .6s cubic-bezier(.2,.8,.2,1), top .6s cubic-bezier(.2,.8,.2,1), transform .6s, opacity .5s, box-shadow .3s, border-color .3s;
  box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.noeud:hover { border-color: var(--lilas); }
.noeud[aria-pressed="true"] { border-color: #C084FC; box-shadow: 0 0 0 1px #C084FC, 0 0 46px rgba(168,85,247,.55); }
.noeud.masque { opacity: 0; pointer-events: none; transform: scale(.6); }
.hub { width: 128px; height: 128px; border-radius: 50%; padding: 0; overflow: hidden; animation: pouls 3s ease-in-out infinite; }
.hub img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hub.petit { width: 84px; height: 84px; }
.etiquette-hub { position: absolute; width: 160px; text-align: center; font: 12px var(--mono); color: var(--lilas); pointer-events: none; transition: left .6s, top .6s; }
.base { width: 150px; height: 122px; border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.base svg { width: 32px; height: 32px; fill: none; stroke: #C084FC; stroke-width: 1.6; }
.base strong { font: 700 16px var(--titre); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.base span { font-size: 12px; color: var(--doux); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.base.nouvelle { border-style: dashed; border-color: rgba(96,165,250,.7); background: #0C1030; align-items: center; justify-content: center; color: var(--bleu-clair); }
.schema { width: 196px; height: 64px; border-radius: 14px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; animation: apparait .5s cubic-bezier(.2,.8,.2,1) both; }
.schema[aria-pressed="true"] { border-color: var(--bleu-clair); background: rgba(37,99,235,.22); box-shadow: 0 0 0 1px var(--bleu-clair), 0 0 32px rgba(96,165,250,.5); }
.schema.relie { border-color: #60A5FA; box-shadow: 0 0 0 1px rgba(96,165,250,.6), 0 0 22px rgba(96,165,250,.35); }
.schema .icone { width: 36px; height: 36px; border-radius: 10px; background: rgba(124,58,237,.25); display: grid; place-items: center; flex: none; }
.schema .icone svg { width: 20px; height: 20px; fill: none; stroke: var(--lilas); stroke-width: 1.8; }
.schema strong { display: block; font: 700 15px var(--titre); }
.schema span { font-size: 12px; color: var(--doux); }
.vide-scene { position: absolute; left: 370px; top: 284px; max-width: 420px; margin: 0; color: var(--doux); }
@keyframes pouls { 0%,100% { box-shadow: 0 0 0 0 rgba(168,85,247,.45); } 50% { box-shadow: 0 0 0 14px rgba(168,85,247,0); } }
@keyframes apparait { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }

.panneau { flex: 1 1 360px; min-width: 0; height: 620px; overflow-y: auto; padding: 18px; background: var(--fond); border-left: 1px solid var(--bord);
  display: flex; flex-direction: column; gap: 14px; }
.panneau h2 { margin: 2px 0 0; font: 700 24px var(--titre); }
.surtitre { font: 12px var(--mono); color: #60A5FA; text-transform: uppercase; letter-spacing: .06em; }
.tuiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tuile { background: var(--carte); border-radius: 12px; padding: 10px; }
.tuile div { font-size: 12px; color: var(--doux); }
.tuile strong { font: 700 19px var(--titre); }
.liste { display: flex; flex-direction: column; gap: 6px; }
.ligne-liste { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--bord); background: var(--panneau); text-align: left; }
.ligne-liste.sauvegarde { flex-wrap: wrap; padding: 8px 12px; }
.ligne-liste.sauvegarde .btn { min-height: 36px; padding: 0 10px; font-size: 14px; }
.form-cle { display: flex; flex-direction: column; gap: 6px; }
.bouton-langue { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.drapeau { display: block; flex: none; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.lien-d.bouton-langue { text-decoration: none; }
.memo-titre { margin: 6px 0 0; font: 700 16px var(--titre); }
.memo-texte { margin: 0; font-size: 14px; }
.bloc-code { position: relative; border: 1px solid var(--bord); border-radius: 12px; background: #0B0820; }
.bloc-code pre { margin: 0; padding: 12px 12px 44px; overflow-x: auto; font: 12.5px/1.55 var(--mono); color: #DDD6FE; white-space: pre; }
.bloc-code .copier-code { position: absolute; right: 8px; bottom: 8px; min-height: 32px; padding: 0 10px; font-size: 13px; background: var(--panneau); }
.memo-regles { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--doux); font-size: 14px; }
.form-cle .actions .champ { flex: 1 1 180px; width: auto; }
.modele-env { font: 12px var(--mono); background: var(--panneau); padding: 8px 10px; border-radius: 8px; overflow-wrap: anywhere; color: var(--doux); }
.ligne-liste:hover { border-color: var(--bord-fort); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cle { border: 1px dashed rgba(96,165,250,.6); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.cle code { font: 13px var(--mono); background: var(--panneau); padding: 8px 10px; border-radius: 8px; overflow-wrap: anywhere; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--doux); font-weight: 600; background: var(--panneau); }
th, td { padding: 7px 10px; border-top: 1px solid rgba(167,139,250,.12); vertical-align: top; }
.boite-table { overflow-x: auto; border: 1px solid var(--bord); border-radius: 12px; }
.pastille { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; margin: 1px 4px 1px 0; border-radius: 6px; border: 1px solid rgba(196,181,253,.5); color: var(--lilas); }
.pastille.cle-p { background: rgba(124,58,237,.35); color: #EDE9FE; }
.pastille.unique { background: rgba(37,99,235,.3); color: #DBEAFE; border-color: rgba(147,197,253,.6); }
.pastille.lien { color: var(--bleu-clair); border-color: rgba(147,197,253,.5); }

.console { border-top: 1px solid var(--bord); background: var(--scene); padding: 12px 18px 16px; display: flex; flex-wrap: wrap; gap: 14px; }
.console .saisie { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.console textarea { width: 100%; min-height: 110px; resize: vertical; border-radius: 12px; border: 1px solid var(--bord); background: #0B0820; padding: 10px 12px; font: 13px/1.55 var(--mono); color: #DDD6FE; }
.console .cote { flex: 1 1 240px; display: flex; flex-direction: column; gap: 8px; }
.resultat { flex: 1 1 100%; display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; }
.journal td:first-child { white-space: nowrap; font-family: var(--mono); font-size: 12px; }

@media (prefers-reduced-motion: reduce) { .noeud, .trait, .etiquette-hub { transition: none; } .hub, .schema { animation: none; } }

/* ------------------------------------------------------------------ Comptes : carte Mnémo (proposition D) */
.ecran-d { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 32px 16px;
  background-color: #05030F; background-image: radial-gradient(rgba(196,181,253,.22) 1px, transparent 1.5px), radial-gradient(circle at 50% 35%, rgba(91,33,182,.35), transparent 65%);
  background-size: 34px 34px, 100% 100%; }
.ecran-d-col { width: min(440px, 100%); display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
.surtitre-d { font-size: 12px; color: var(--pale); letter-spacing: .08em; text-transform: uppercase; }
.titre-d { margin: 0; font: 700 30px var(--titre); text-align: center; }
@media (max-width: 480px) {
  .ecran-d { padding: 24px 14px; }
  .titre-d { font-size: 25px; }
  .carte:not(.petite) { padding: 18px; border-radius: 18px; }
  .carte-capteur { width: 56px; height: 56px; }
  .carte-l2 { font-size: 21px; }
}
.texte-d { margin: 0; color: #C9C5E8; text-align: center; }
.label-d { font-size: 14px; color: var(--doux); margin-bottom: -8px; }
.btn-d { min-height: 50px; border-radius: 16px; border: 1px solid var(--bord-fort); background: rgba(14,10,36,.6); font-weight: 600; }
.btn-d:hover { background: rgba(124,58,237,.18); }
.btn-d-plein { border: 0; min-height: 54px; background: linear-gradient(100deg, var(--violet), var(--bleu)); color: #fff; font-size: 16px; font-weight: 700; }
.btn-d-plein:hover { filter: brightness(1.12); background: linear-gradient(100deg, var(--violet), var(--bleu)); }
.btn-d-bleu { border-color: rgba(96,165,250,.6); background: rgba(37,99,235,.1); color: #BFDBFE; }
.btn-d:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.liens-d { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; margin-top: 4px; }
.lien-d { border: 0; background: none; padding: 6px 2px; color: var(--lilas); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.lien-d:hover { color: #fff; }
.connexion .lien-d { align-self: center; }
.deux-d { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.encart-d { margin: 0; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 16px; background: rgba(14,10,36,.85); border: 1px solid rgba(96,165,250,.35); }
.encart-d strong { color: #BFDBFE; }
.encart-d span { font-size: 14px; color: #C9C5E8; }
.case-d { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.case-d input { width: 20px; height: 20px; accent-color: var(--violet-vif); }
.form-d { display: flex; flex-direction: column; gap: 14px; }
.installer-d { margin-top: 6px; border-style: dashed; color: var(--lilas); }

.carte { position: relative; width: 100%; aspect-ratio: 420 / 264; border-radius: 22px; padding: 24px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(135deg, #1B1442 0%, #121033 45%, #0F1D45 100%);
  box-shadow: 0 0 0 1px rgba(196,181,253,.55), 0 24px 60px rgba(0,0,0,.6), 0 0 60px rgba(124,58,237,.35); }
.carte-reflet { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.10) 45%, transparent 60%);
  background-size: 250% 100%; animation: reflet 6s ease-in-out infinite; }
.carte-haut, .carte-bas { position: relative; display: flex; justify-content: space-between; align-items: center; }
.carte-marque { font: 700 14px var(--titre); letter-spacing: .2em; color: var(--lilas); }
.carte-marque span { color: var(--bleu-clair); }
.carte-haut img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--bord-fort), 0 0 18px rgba(168,85,247,.5); }
.carte-milieu { position: relative; display: flex; align-items: center; gap: 18px; }
.carte-capteur { width: 64px; height: 64px; flex: none; border-radius: 18px; display: grid; place-items: center;
  background: rgba(124,58,237,.22); border: 1px solid rgba(196,181,253,.5); }
.carte-capteur svg { width: 36px; height: 36px; fill: none; stroke: #DDD6FE; stroke-width: 1.6; stroke-linecap: round; }
.carte-capteur.pouls { animation: pouls 2s ease-in-out infinite; }
button.carte-capteur { padding: 0; cursor: pointer; transition: background .2s, transform .15s, border-color .2s; }
button.carte-capteur:hover { background: rgba(124,58,237,.42); border-color: var(--lilas); }
button.carte-capteur:active { transform: scale(.94); }
.carte-l1 { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--pale); }
.carte-l2 { font: 700 24px var(--titre); overflow-wrap: anywhere; }
.carte-bas { font: 12px var(--mono); color: var(--doux); }
.carte.petite { position: absolute; width: 300px; padding: 16px; border-radius: 16px; }
.carte.petite .carte-capteur { width: 44px; height: 44px; border-radius: 12px; }
.carte.petite .carte-capteur svg { width: 26px; height: 26px; }
.carte.petite .carte-haut img { width: 32px; height: 32px; }
.carte.petite .carte-l2 { font-size: 20px; }
.carte.verso { aspect-ratio: auto; gap: 14px; justify-content: flex-start; }
.verso-haut { position: relative; display: flex; justify-content: space-between; font: 12px var(--mono); letter-spacing: .1em; color: var(--lilas); }
.verso-codes { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.verso-codes span { padding: 8px 10px; border-radius: 10px; background: rgba(5,3,13,.55); border: 1px solid rgba(167,139,250,.25); font-size: 14px; text-align: center; letter-spacing: .04em; }

.puce-carte { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px 0 6px; border-radius: 999px;
  border: 1px solid var(--bord-fort); background: linear-gradient(135deg, #1B1442, #0F1D45); }
.puce-carte:hover { border-color: var(--lilas); }
.puce-carte-mini { width: 30px; height: 20px; border-radius: 5px; background: linear-gradient(135deg, var(--violet), var(--bleu)); box-shadow: 0 0 10px rgba(168,85,247,.6); }

.constellation { position: relative; width: 860px; height: 520px; margin: 10px auto; }
.constellation .trait { transition: none; }
.noeud-d { position: absolute; width: 140px; min-height: 92px; padding: 10px; border-radius: 16px; border: 1px solid var(--bord-fort);
  background: #0E0A24; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center;
  box-shadow: 0 12px 30px rgba(0,0,0,.5); animation: apparait .5s cubic-bezier(.2,.8,.2,1) both; }
.noeud-d:hover { border-color: var(--lilas); }
.noeud-d[aria-pressed="true"] { border-color: #C084FC; box-shadow: 0 0 0 1px #C084FC, 0 0 40px rgba(168,85,247,.55); }
.noeud-d svg { width: 28px; height: 28px; fill: none; stroke: #C084FC; stroke-width: 1.6; }
.noeud-d strong { font: 700 14px var(--titre); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.noeud-d span { font-size: 12px; color: var(--doux); }
.noeud-d.ajout { min-height: 72px; border-style: dashed; border-color: rgba(96,165,250,.7); background: #0C1030; color: var(--bleu-clair); font-weight: 600; }
.fiche-d { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; border: 1px solid var(--bord); background: var(--panneau); }
.fiche-d.suspendu { border-color: rgba(248,113,113,.5); }
.quotas-d { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quotas-d label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--doux); }
.jauge { height: 8px; border-radius: 999px; background: var(--carte); overflow: hidden; }
.jauge div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--violet-vif), #60A5FA); }
.base.reservee { border-style: dashed; opacity: .8; }
.base.reservee svg { stroke: var(--pale); }
@keyframes reflet { 0%,100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .carte-reflet, .carte-capteur.pouls, .noeud-d { animation: none; } }

/* ------------------------------------------------------------------ Import SQL : remarques de conversion */
.remarques { border: 1px solid var(--bord); border-radius: 12px; padding: 8px 12px; background: var(--panneau); font-size: 14px; }
.remarques summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; color: var(--doux); }
.remarques ul { margin: 6px 0 2px; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.remarque.attention { color: #FDE68A; }
.remarque.erreur { color: var(--erreur); }
.remarque.info { color: var(--doux); }

/* ------------------------------------------------------------------ Téléphone : portefeuille (proposition C) */
.pf { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; gap: 10px;
  background-color: #05030F; background-image: radial-gradient(rgba(196,181,253,.22) 1px, transparent 1.5px), radial-gradient(circle at 50% 25%, rgba(91,33,182,.35), transparent 65%);
  background-size: 34px 34px, 100% 100%; }
.pf-tete { display: flex; align-items: flex-end; gap: 10px; padding: calc(16px + env(safe-area-inset-top)) 20px 4px; }
.pf-titres { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pf-surtitre { font-size: 12px; color: var(--pale); letter-spacing: .08em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-tete h1 { margin: 0; font: 700 28px var(--titre); }
.pf-etat { font-size: 12px; color: var(--pale); }
.pf-icone { flex: none; width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--bord-fort); background: rgba(14,10,36,.7); display: grid; place-items: center; }
.pf-icone svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pf-plus { border: 1px dashed rgba(96,165,250,.7); background: #0C1030; color: var(--bleu-clair); }

.pf-cartes { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 10px 7% 16px; scrollbar-width: none; overscroll-behavior-x: contain; }
.pf-cartes::-webkit-scrollbar { display: none; }
.pf-carte { position: relative; flex: 0 0 86%; max-width: 420px; aspect-ratio: 350 / 220; scroll-snap-align: center; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; padding: 18px; border: 0; border-radius: 22px; text-align: left; color: var(--texte);
  background: linear-gradient(135deg, #1B1442 0%, #121033 45%, #0F1D45 100%);
  box-shadow: 0 0 0 1px rgba(196,181,253,.55), 0 20px 50px rgba(0,0,0,.6), 0 0 40px rgba(124,58,237,.3); }
.pf-carte > span { position: relative; }
.pf-carte .carte-reflet { position: absolute; }
.pf-carte-haut { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pf-carte-nom { font: 700 14px var(--titre); letter-spacing: .18em; color: var(--lilas); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-carte-haut svg { flex: none; width: 30px; height: 30px; fill: none; stroke: #C084FC; stroke-width: 1.6; }
.pf-stats { display: flex; gap: 18px; flex-wrap: wrap; }
.pf-stat { display: flex; flex-direction: column; min-width: 0; }
.pf-stat span { font-size: 12px; color: var(--doux); }
.pf-stat strong { font: 700 22px var(--titre); white-space: nowrap; }
.pf-carte-bas { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--doux); }
.pf-carte-bas span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-carte.reservee { background: linear-gradient(135deg, #15122A, #0E1426); box-shadow: 0 0 0 1px rgba(140,134,173,.5), 0 20px 50px rgba(0,0,0,.6); }
.pf-carte.reservee .pf-carte-nom { color: var(--doux); }
.pf-carte.nouvelle { align-items: center; justify-content: center; gap: 8px; background: #0C1030; box-shadow: none; border: 1px dashed rgba(96,165,250,.7); color: var(--bleu-clair); font-weight: 600; }
.pf-carte.nouvelle svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2; }
.pf-points { display: flex; justify-content: center; gap: 8px; min-height: 6px; }
.pf-points span { width: 6px; height: 6px; border-radius: 999px; background: rgba(196,181,253,.4); transition: width .2s, background .2s; }
.pf-points span.actif { width: 22px; background: var(--violet-vif); }
.pf-aide { margin: 0; text-align: center; font-size: 12px; color: var(--pale); padding: 0 20px; }

.pf-schemas { padding: 4px 20px 0; display: flex; flex-direction: column; gap: 10px; }
.pf-schemas h2 { margin: 0; font-size: 15px; color: var(--doux); }
.pf-schemas p { margin: 0; }
.pf-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pf-schema { min-height: 64px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 12px; text-align: left;
  border-radius: 14px; border: 1px solid rgba(167,139,250,.25); background: #0E0A24; }
.pf-schema strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-schema span { font-size: 12px; color: var(--doux); }
.pf-schema:active, .pf-carte:active { transform: scale(.98); }
.pf-bas { position: sticky; bottom: 0; margin-top: auto; padding: 14px 20px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(5,3,15,0), #05030F 45%); }
.pf-console { width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 18px;
  background: linear-gradient(100deg, var(--violet), var(--bleu)); color: #fff; font-weight: 700; box-shadow: 0 10px 30px rgba(124,58,237,.45); }
.pf-console svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.pf-console:disabled { opacity: .45; }
.pf-ligne { display: flex; align-items: center; gap: 12px; text-align: left; }
.pf-ligne svg { width: 22px; height: 22px; flex: none; fill: none; stroke: #C084FC; stroke-width: 1.7; }
.ligne-liste[aria-pressed="true"] { border-color: #C084FC; box-shadow: 0 0 0 1px #C084FC; }
.pf-ajout { border-style: dashed; color: var(--bleu-clair); }

/* Feuille qui monte du bas */
dialog.feuille { position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: none; max-height: 88vh; max-height: 88dvh; padding: 0;
  border: 0; border-top: 1px solid var(--bord-fort); border-radius: 24px 24px 0 0; background: var(--panneau); color: var(--texte);
  box-shadow: 0 -20px 60px rgba(0,0,0,.6); display: none; flex-direction: column; }
dialog.feuille[open] { display: flex; animation: monte .22s cubic-bezier(.2,.8,.2,1); }
dialog.feuille::backdrop { background: rgba(5,3,13,.7); }
.feuille-tete { position: relative; display: flex; justify-content: flex-end; padding: 8px 10px 0; }
.feuille-poignee { position: absolute; left: 50%; top: 10px; width: 44px; height: 5px; margin-left: -22px; border-radius: 999px; background: rgba(196,181,253,.5); }
.feuille-corps { overflow-y: auto; padding: 0 18px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.feuille-corps h2 { margin: 2px 0 0; font: 700 24px var(--titre); }
@keyframes monte { from { transform: translateY(40%); opacity: .4; } to { transform: none; opacity: 1; } }

/* Console plein écran */
dialog.console-m { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0 12px calc(12px + env(safe-area-inset-bottom)); border: 0;
  background: #07051A; color: var(--texte); display: none; flex-direction: column; gap: 10px; overflow-y: auto; }
dialog.console-m[open] { display: flex; }
dialog.console-m > * { flex-shrink: 0; }
.console-m-tete { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 0 10px;
  background: #07051A; border-bottom: 1px solid var(--bord); }
.console-m-titre { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.console-m-titre .mono { font-size: 12px; color: var(--violet-vif); }
.console-m-titre .doux { font-weight: 600; color: var(--texte); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
dialog.console-m textarea { width: 100%; min-height: 150px; resize: vertical; border-radius: 14px; border: 1px solid rgba(167,139,250,.35); background: #0B0820; padding: 12px; font: 15px/1.6 var(--mono); color: #DDD6FE; }
.puces { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.puce { flex: none; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid rgba(196,181,253,.4); background: #120E29; color: var(--lilas); font: 14px var(--mono); }
.puce.schema { border-color: rgba(147,197,253,.5); background: #0C1030; color: var(--bleu-clair); }
.console-m-params summary { min-height: 40px; display: flex; align-items: center; color: var(--doux); font-size: 14px; cursor: pointer; }
dialog.console-m .resultat { max-height: none; overflow: visible; }
.cartes-lignes { display: flex; flex-direction: column; gap: 8px; }
.carte-ligne { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 6px 12px; padding: 12px; border-radius: 14px; border: 1px solid rgba(167,139,250,.25); background: #0E0A24; font-size: 13px; }
.carte-ligne .mono { overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { dialog.feuille[open] { animation: none; } .pf-points span { transition: none; } }

/* Impression du verso : seulement la carte, en noir sur blanc. */
@media print {
  body, .ecran-d { background: #fff !important; color: #000; }
  .ecran-d-col > :not(.verso):not(.titre-d) { display: none !important; }
  .carte.verso { box-shadow: none; background: #fff; border: 1px solid #000; color: #000; }
  .carte-reflet { display: none; }
  .verso-haut { color: #000; }
  .verso-codes span { background: #fff; border-color: #000; color: #000; }
}

/* ------------------------------------------------------------------ partages en lecture seule et Discord (ADR-0003)
   Une base reçue en partage porte la couleur sarcelle (bots KayoLabs, codes d'équipe) : pointillés, badge « Lecture seule ». */
.base.partagee { border-style: dashed; border-color: rgba(94,234,212,.6); background: rgba(20,184,166,.08); }
.base.partagee svg { stroke: #5EEAD4; }
.ligne-liste.partagee { border-style: dashed; border-color: rgba(94,234,212,.45); }
.badge-lecture { flex: none; font: 600 11px var(--corps); letter-spacing: .02em; padding: 3px 8px; border-radius: 99px; background: rgba(94,234,212,.16); color: #99F6E4; }
.pf-carte.partagee { background: linear-gradient(135deg, #0F1D22, #0E1426); box-shadow: 0 0 0 1px rgba(94,234,212,.5), 0 20px 50px rgba(0,0,0,.6); }
.pf-carte.partagee .pf-carte-nom { color: #CCFBF1; }
.pf-bande { position: absolute !important; left: 0; right: 0; top: 0; height: 8px; background: linear-gradient(90deg, #0F766E, #14B8A6); }
.encart-lecture { border-color: rgba(94,234,212,.4); }
.encart-lecture strong { color: #99F6E4; }
.encart-carte .actions { margin-top: 4px; }
.code-partage { border-color: rgba(94,234,212,.6); }
.code-equipe { font: 700 22px var(--mono) !important; letter-spacing: .12em; text-align: center; color: #ECFEFF; }
.btn-d-discord { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.icone-discord { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.connexion-d .ligne-d { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.connexion-d .btn { align-self: flex-start; }
.connexion-d.a-faire { border-color: rgba(252,211,77,.45); }
.avec-icone { display: inline-flex; align-items: center; gap: 8px; }
.avec-icone .icone-discord { stroke: var(--bleu-clair); }
.ok-d { font-size: 13px; color: #86EFAC; }
.attention-d { font-size: 13px; color: #FDE68A; }
.pf-bandeau { margin: 0 16px; padding: 14px 16px; border-radius: 16px; background: #161038; border: 1px solid rgba(196,181,253,.45); display: flex; flex-direction: column; gap: 8px; }
.pf-bandeau[hidden] { display: none; }
.pf-bandeau span { font-size: 14px; color: var(--doux); }
.pf-bandeau .actions .btn { min-height: 44px; }
