/* Style Atelier clair : jetons Penpot atelier/base + atelier/clair (page 2 validée le 2026-10-06). */
@font-face { font-family: "Manrope"; src: url("polices/Manrope.ttf") format("truetype"); font-weight: 200 800; }
@font-face { font-family: "JetBrains Mono"; src: url("polices/JetBrainsMono.ttf") format("truetype"); font-weight: 100 800; }

:root {
  --fond: #F4F1EA; --surface: #FFFFFF; --surface2: #FAF8F3; --ligne: #E2DCCF; --texte: #1E2329; --doux: #6B7280;
  --principal: #1E2329; --sur-principal: #FFFFFF;
  --entree: #12A37F; --sortie: #F08A24; --objectif: #4F5BD5; --contrainte: #E0465E;
  --gain: #12A37F; --perte: #E0465E; --attention: #D99A06;
  --gain-usdt: #2B7BE4; --gain-pieces: #9B51E0; /* grille infinie, « Après l'ouverture » (GI-35) */
  --rayon-carte: 18px; --rayon-piece: 14px; --rayon-champ: 12px;
  --ombre-douce: 0 3px 12px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* sinon « display: flex » des écrans l'emporte sur l'attribut hidden */
html, body { margin: 0; height: 100%; }
body {
  background: var(--fond); color: var(--texte);
  font-family: "Manrope", system-ui, sans-serif; font-size: 14px;
  display: flex; flex-direction: column; overflow: hidden;
}

.barre {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--ligne);
}
.marque { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; margin-right: 8px; }
.signe { width: 28px; height: 28px; border-radius: 9px; background: var(--principal); }
.groupe { display: flex; align-items: center; gap: 6px; padding-left: 12px; border-left: 1px solid var(--ligne); }
.etiquette { font-size: 11px; font-weight: 700; letter-spacing: 0.4px; color: var(--doux); }

.champ {
  font: 500 14px "JetBrains Mono", monospace; color: var(--texte);
  background: var(--surface2); border: 1px solid var(--ligne); border-radius: var(--rayon-champ);
  padding: 7px 10px; outline: none;
}
.champ:focus { border-color: var(--entree); }
#paire { width: 120px; padding: 7px 8px; text-transform: uppercase; }
#echelle { width: 116px; }
select.champ { font-family: "Manrope", sans-serif; font-weight: 600; }

.segments { display: flex; background: var(--surface2); border: 1px solid var(--ligne); border-radius: 20px; padding: 3px; }
.segments button {
  font: 600 13px "Manrope", sans-serif; color: var(--doux); background: none; border: 0;
  padding: 5px 7px; border-radius: 16px; cursor: pointer;
}
.segments button.actif { background: var(--principal); color: var(--sur-principal); }

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 34px; height: 34px; padding: 0 8px; border-radius: 17px;
  background: var(--surface); border: 1px solid var(--ligne); color: var(--texte);
  font: 600 13px "Manrope", sans-serif; cursor: pointer;
}
.bouton:hover { background: var(--surface2); }
.bouton.actif { background: var(--principal); border-color: var(--principal); color: var(--sur-principal); }
.bouton svg { width: 18px; height: 18px; }

.etat {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: 12px; font-weight: 700; font-size: 12px;
}
.etat .point { width: 8px; height: 8px; border-radius: 4px; background: currentColor; }
.etat--connecte { color: var(--gain); background: rgba(18, 163, 127, 0.14); }
.etat--connexion, .etat--reconnexion { color: var(--attention); background: rgba(217, 154, 6, 0.14); }
.etat--erreur { color: var(--perte); background: rgba(224, 70, 94, 0.14); }

.zone { flex: 1; padding: 20px; min-height: 0; }
.cadre {
  height: 100%; display: flex; flex-direction: column; position: relative;
  background: var(--surface); border-radius: var(--rayon-carte); box-shadow: var(--ombre-douce); padding: 16px 16px 8px;
}
.entete { display: flex; align-items: center; gap: 16px; padding: 0 4px 10px; flex-wrap: wrap; }
.titre { font-weight: 700; font-size: 16px; }
.legende { font: 400 12px "JetBrains Mono", monospace; color: var(--doux); display: flex; gap: 12px; flex-wrap: wrap; }
.legende b { color: var(--texte); font-weight: 500; }
.legende .hausse { color: var(--gain); } .legende .baisse { color: var(--perte); }
.graphique { flex: 1; min-height: 0; }
.aide {
  position: absolute; bottom: 64px; left: 50%; transform: translateX(-50%); z-index: 5;
  background: var(--principal); color: var(--sur-principal); padding: 7px 14px; border-radius: 14px;
  font-weight: 600; font-size: 13px; pointer-events: none;
}

/* Écran de chargement (C-11), erreur (C-12), bandeau de reconnexion (C-13) — v0.1.1 */
.chargement {
  position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
  background: rgba(244, 241, 234, 0.78); backdrop-filter: blur(2px); border-radius: var(--rayon-carte);
}
.carte-chargement {
  width: 420px; background: var(--surface); border-radius: var(--rayon-carte); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  padding: 22px 24px; display: flex; flex-direction: column; gap: 14px;
}
.chg-haut { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.chg-titre { font-weight: 800; font-size: 17px; }
.chg-temps { font: 500 13px "JetBrains Mono", monospace; color: var(--doux); white-space: nowrap; }
.chargement.erreur .chg-temps { display: none; }
.chg-barre { height: 8px; border-radius: 4px; background: var(--ligne); overflow: hidden; }
.chg-rempli { height: 100%; width: 0; border-radius: 4px; background: var(--objectif); transition: width 0.35s ease; }
.chargement.erreur .chg-rempli { background: var(--perte); }
.chg-etapes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.chg-etapes li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--doux); }
.chg-etapes li svg { width: 18px; height: 18px; flex: none; }
.chg-etapes li.fait { color: var(--texte); } .chg-etapes li.fait svg { color: var(--gain); }
.chg-etapes li.en_cours { color: var(--texte); font-weight: 600; } .chg-etapes li.en_cours svg { color: var(--attention); animation: tourne 1s linear infinite; }
.chg-etapes li.echec svg { color: var(--perte); }
@keyframes tourne { to { transform: rotate(360deg); } }
.chg-erreur p { margin: 0; color: var(--perte); font-weight: 600; line-height: 1.45; }
.chg-actions { display: flex; gap: 8px; margin-top: 12px; }
.bouton--plein { background: var(--principal); border-color: var(--principal); color: var(--sur-principal); }
.bouton--plein:hover { background: #343a42; }
.barre .bloque { opacity: 0.5; pointer-events: none; }
.bandeau {
  position: absolute; top: 48px; left: 50%; transform: translateX(-50%); z-index: 6;
  display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 14px;
  background: rgba(217, 154, 6, 0.14); color: var(--attention); font-weight: 700; font-size: 13px; pointer-events: none;
}
.bandeau svg { width: 16px; height: 16px; }
.bandeau .tourne svg { animation: tourne 1.2s linear infinite; }
.bandeau .tourne { display: inline-flex; }

/* Indicateurs (spec indicateurs I-4, I-5) — v0.1.2 */
.legendes-indicateurs { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
.legende-indicateur {
  position: fixed; display: flex; align-items: center; gap: 8px; pointer-events: auto;
  font: 500 12px "JetBrains Mono", monospace; color: var(--texte);
  background: rgba(255, 255, 255, 0.86); border-radius: 8px; padding: 2px 4px 2px 8px;
}
.legende-indicateur .nom-ind { font-family: "Manrope", sans-serif; font-weight: 700; }
.legende-indicateur .vals { display: flex; gap: 10px; }
.legende-indicateur button {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: 6px; background: none; color: var(--doux); cursor: pointer; opacity: 0;
}
.legende-indicateur:hover button { opacity: 1; }
.legende-indicateur button:hover { background: var(--surface2); color: var(--texte); }
.legende-indicateur button svg { width: 15px; height: 15px; }
.legende-indicateur.masque { opacity: 0.45; }

.fenetre-indicateurs {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-start; justify-content: center; padding-top: 90px;
  background: rgba(30, 35, 41, 0.18);
}
.fi-carte {
  width: 520px; max-height: 70vh; display: flex; flex-direction: column; background: var(--surface);
  border-radius: var(--rayon-carte); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18); overflow: hidden;
}
.fi-haut { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.fi-titre { font-weight: 800; font-size: 18px; }
.fi-recherche { display: flex; align-items: center; gap: 8px; margin: 4px 18px 10px; padding: 8px 12px; border: 1px solid var(--ligne); border-radius: var(--rayon-champ); background: var(--surface2); }
.fi-recherche svg { width: 16px; height: 16px; color: var(--doux); }
.fi-recherche input { flex: 1; border: 0; outline: none; background: none; font: 500 14px "Manrope", sans-serif; color: var(--texte); }
.fi-liste { overflow: auto; padding: 0 10px 10px; }
.fi-famille { font-size: 11px; font-weight: 700; letter-spacing: 0.4px; color: var(--doux); padding: 12px 8px 4px; }
.fi-item {
  width: 100%; display: flex; align-items: baseline; gap: 10px; text-align: left; padding: 9px 10px; border: 0; border-radius: 10px;
  background: none; cursor: pointer; font-family: "Manrope", sans-serif;
}
.fi-item:hover { background: var(--surface2); }
.fi-nom { font-weight: 700; font-size: 14px; color: var(--texte); }
.fi-detail { flex: 1; font: 400 12px "JetBrains Mono", monospace; color: var(--doux); }
.fi-ajoute { display: none; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--gain); }
.fi-ajoute svg { width: 14px; height: 14px; }
.fi-item.vient-ajoute .fi-ajoute { display: inline-flex; }
.fi-vide { padding: 18px; color: var(--doux); }
.fi-pied { padding: 10px 18px; border-top: 1px solid var(--ligne); font-size: 12px; color: var(--doux); }

.reglage-indicateur {
  position: fixed; z-index: 21; width: 340px; max-height: calc(100vh - 120px); overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border-radius: 14px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}
.reg-titre { font-weight: 800; }
.reg-onglets { display: flex; gap: 4px; padding: 3px; background: var(--surface2); border: 1px solid var(--ligne); border-radius: 999px; }
.reg-onglets button {
  flex: 1; padding: 6px 10px; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font: 700 13px "Manrope", sans-serif; color: var(--doux);
}
.reg-onglets button.actif { background: var(--principal); color: var(--sur-principal); }
.reg-page { display: flex; flex-direction: column; gap: 8px; }
.reglage-indicateur label { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.reg-ligne { justify-content: space-between; }
.reg-sous { padding-left: 26px; }
.reg-vide { font-size: 13px; color: var(--doux); }
.reglage-indicateur input[type="number"] { width: 90px; font: 500 14px "JetBrains Mono", monospace; padding: 6px 8px; border: 1px solid var(--ligne); border-radius: 10px; background: var(--surface2); }
.reglage-indicateur input[type="number"]:disabled { opacity: 0.45; }
.reglage-indicateur input.faux { border-color: var(--perte); }
.reglage-indicateur input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--principal); }
.reg-serie { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; }
.reg-voir { flex: 1; min-width: 0; }
.reg-voir span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reg-ctrl { display: flex; align-items: center; gap: 6px; }
.reg-mini { font: 700 12px "JetBrains Mono", monospace; color: var(--doux); }
.reg-couleur { width: 24px; height: 24px; padding: 0; border: 2px solid var(--surface); border-radius: 50%; box-shadow: 0 0 0 1px var(--ligne); cursor: pointer; }
.reg-ctrl select {
  padding: 4px 6px; border: 1px solid var(--ligne); border-radius: 8px; background: var(--surface2);
  font: 500 12px "Manrope", sans-serif; color: var(--texte);
}
.reg-palette { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; background: var(--surface2); border: 1px solid var(--ligne); border-radius: 10px; }
.reg-palette button { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; }
.reg-palette label { gap: 4px; font-size: 12px; color: var(--doux); cursor: pointer; }
.reg-palette input[type="color"] { width: 24px; height: 20px; padding: 0; border: 0; background: none; cursor: pointer; }
.reg-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* 0.2.2 : exchange du graphique (maquettes G1, G2) */
.bouton-exchange { padding: 0 8px 0 4px; gap: 6px; }
.bouton-exchange > svg { width: 16px; height: 16px; color: var(--doux); }
.bouton-exchange.ouvert { background: var(--principal); border-color: var(--principal); color: var(--sur-principal); }
.bouton-exchange.ouvert .mono-ex { background: var(--surface); color: var(--texte); }
.mono-ex {
  width: 24px; height: 24px; border-radius: 12px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface2); border: 1px solid var(--ligne); font: 700 11px "Manrope", sans-serif; color: var(--texte);
}
.mono-ex--grand { width: 30px; height: 30px; border-radius: 15px; font-size: 12px; }
.segments button:disabled { opacity: 0.4; cursor: default; }
.choix-exchange {
  position: fixed; z-index: 40; width: 440px; display: flex; flex-direction: column; gap: 8px; padding: 16px;
  background: var(--surface); border: 1px solid var(--ligne); border-radius: 22px; box-shadow: 0 18px 40px rgba(30, 35, 41, 0.16);
}
.choix-exchange[hidden] { display: none; }
.cx-label { font-size: 12px; font-weight: 700; letter-spacing: 0.4px; color: var(--doux); }
.cx-saisie {
  display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 44px; flex: none;
  background: var(--surface2); border: 1px solid var(--ligne); border-radius: 14px;
}
.cx-saisie:focus-within { border-color: var(--entree); }
.cx-saisie svg { width: 18px; height: 18px; color: var(--doux); flex: none; }
.cx-saisie input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: 500 14px "Manrope", sans-serif; color: var(--texte); }
.cx-liste { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; flex: 1; }
.cx-section { font-size: 12px; font-weight: 700; letter-spacing: 0.4px; color: var(--doux); text-transform: uppercase; padding: 8px 2px 4px; }
.cx-ligne { display: flex; align-items: center; gap: 4px; border-radius: 14px; padding: 0 4px; }
.cx-ligne:hover { background: var(--surface2); }
.cx-ligne.actuel { background: rgba(18, 163, 127, 0.08); }
.cx-choisir {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 6px; border: 0; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.cx-ligne--simple .cx-choisir { padding: 5px 6px; }
.cx-textes { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cx-textes b { font-size: 14px; font-weight: 600; }
.cx-textes span { font-size: 12px; font-weight: 500; color: var(--doux); }
.cx-coche { display: flex; color: var(--entree); } .cx-coche svg { width: 18px; height: 18px; }
.cx-vide { font-size: 13px; color: var(--doux); padding: 8px 2px; }
.cx-note { margin: 0; font-size: 12px; font-weight: 500; color: var(--sortie); }

