/* Observatoire FinOps de l'IA — charte Groupement Numérique.
   Bleu nuit d'encre, bleu, rouge (bandeau tricolore), fonds clairs ; Archivo pour les titres,
   IBM Plex Sans pour le texte, IBM Plex Mono pour les sur-titres et les chiffres. */
:root {
  --encre: #0b1b3f;
  --nuit: #0b1f4b;
  --ardoise: #475577;
  --bleu: #1f4fa3;
  --rouge: #cf2b33;
  --fond: #ffffff;
  --fond-2: #f5f7fc;
  --bleu-pale: #e8eefa;
  --trait: #d3daea;
  --trait-2: #e5e5e5;
  --vert: #1f7a4d;
  --vert-pale: #e6f4ec;
  --ambre: #a35a00;
  --ambre-pale: #fff4e0;
  --titre: "Archivo", "Arial Narrow", Arial, sans-serif;
  --texte: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--fond); color: var(--encre); font: 16px/1.6 var(--texte); }
a { color: var(--bleu); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }
.tricolore { height: 6px; background: linear-gradient(90deg, var(--bleu) 0 33.3%, #fff 33.3% 66.6%, var(--rouge) 66.6%); border-bottom: 1px solid var(--trait-2); }
.page { max-width: 1180px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* En-tête et navigation */
header.haut { border-bottom: 1px solid var(--trait-2); background: var(--fond); position: sticky; top: 0; z-index: 20; }
.haut .page { display: flex; align-items: center; gap: 20px; padding-block: 12px; flex-wrap: wrap; }
.marque { display: grid; line-height: 1.15; text-decoration: none; color: var(--encre); }
.marque b { font: 800 19px/1.1 var(--titre); }
.marque b span { color: var(--rouge); }
.marque small { font: 600 12px var(--texte); color: var(--ardoise); }
nav.menu { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
nav.menu a { text-decoration: none; color: var(--encre); font-weight: 600; font-size: 14px; padding: 6px 10px; border-radius: 6px; }
nav.menu a:hover, nav.menu a[aria-current="true"] { background: var(--bleu-pale); color: var(--bleu); }
@media (max-width: 760px) {
  .haut .page { gap: 8px; padding-block: 8px; }
  nav.menu { flex-wrap: nowrap; overflow-x: auto; margin-left: 0; width: 100%; scrollbar-width: none; }
  nav.menu::-webkit-scrollbar { display: none; }
  nav.menu a { white-space: nowrap; font-size: 13.5px; }
  main section { scroll-margin-top: 110px; }
}

/* Typographie */
.surtitre { font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ardoise); }
h1, h2, h3 { font-family: var(--titre); font-weight: 800; text-wrap: balance; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.05; font-stretch: 105%; }
h1 em { font-style: normal; color: var(--rouge); }
h2 { font-size: clamp(24px, 3vw, 32px); line-height: 1.15; }
h3 { font-size: 18px; line-height: 1.3; }
p { margin: 0; max-width: 72ch; }
.chapo { font-size: 18px; color: var(--ardoise); max-width: 64ch; }
.petit { font-size: 13.5px; color: var(--ardoise); }
.num { font-variant-numeric: tabular-nums; }

/* Sections */
main section { padding-block: 48px; border-bottom: 1px solid var(--trait-2); display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; scroll-margin-top: 90px; }
main section > *, #tco-zone > *, #dep-zone > *, #metho > *, #calc > * { min-width: 0; }
#tco-zone, #dep-zone, #metho, #calc { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.tableau input[type="number"] { width: 110px; }
main section:nth-of-type(even) { background: var(--fond-2); box-shadow: 0 0 0 100vmax var(--fond-2); clip-path: inset(0 -100vmax); }
.intro { padding-block: 40px 32px; display: grid; gap: 16px; }

/* Bandeau d'avertissement */
.alerte { border: 1px solid #f0c27a; background: var(--ambre-pale); color: #5c3500; padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.alerte b { color: #5c3500; }

/* Compteurs */
.compteurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.compteur { border: 1px solid var(--trait); border-radius: 10px; padding: 14px 16px; background: var(--fond); display: grid; gap: 2px; }
.compteur b { font: 800 30px/1.1 var(--titre); color: var(--encre); font-variant-numeric: tabular-nums; }
.compteur span { font-size: 13px; color: var(--ardoise); }

/* Cartes de graphique */
.graphe { border: 1px solid var(--trait); border-radius: 10px; background: var(--fond); padding: 16px; display: grid; gap: 10px; min-width: 0; }
.graphe header { display: grid; gap: 4px; }
.graphe svg { width: 100%; height: auto; display: block; }
.graphe .defile { overflow-x: auto; }
.graphe .defile svg { min-width: 620px; }
.graphe svg text { font-family: var(--texte); font-size: 12px; fill: var(--encre); }
.graphe svg .discret { fill: var(--ardoise); }
.graphe svg .grille { stroke: #e9edf6; }
.graphe svg .axe { stroke: var(--trait); }
.meta-graphe { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--ardoise); border-top: 1px dashed var(--trait); padding-top: 8px; }
.meta-graphe a { white-space: nowrap; }
.vide { border: 1px dashed var(--trait); border-radius: 10px; padding: 16px; color: var(--ardoise); background: var(--fond); }
.vide b { color: var(--encre); }
.grille-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 16px; }
.legende { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ardoise); }
.legende i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Tableaux */
.tableau { overflow-x: auto; border: 1px solid var(--trait); border-radius: 10px; background: var(--fond); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
.tableau table { min-width: 760px; }
.plus { justify-self: start; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--trait-2); vertical-align: top; }
th { font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--ardoise); background: var(--fond-2); white-space: nowrap; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover td { background: #fafbff; }
tr:last-child td { border-bottom: 0; }

/* Puces de statut et de confiance */
.puce { display: inline-block; font: 600 12px/1.4 var(--texte); border-radius: 999px; padding: 1px 9px; border: 1px solid var(--trait); white-space: nowrap; }
.puce.A { background: var(--vert-pale); color: var(--vert); border-color: #b8dfc9; }
.puce.B { background: var(--bleu-pale); color: var(--bleu); border-color: #c9d6f2; }
.puce.C { background: var(--ambre-pale); color: var(--ambre); border-color: #f0d3a3; }
.puce.actif, .puce.disponible { background: var(--vert-pale); color: var(--vert); border-color: #b8dfc9; }
.puce.deprecie { background: var(--ambre-pale); color: var(--ambre); border-color: #f0d3a3; }
.puce.retire { background: #fde8e9; color: var(--rouge); border-color: #f3bcbf; }
.puce.local { background: var(--bleu-pale); color: var(--bleu); border-color: #c9d6f2; }
.puce.neutre { background: var(--fond-2); color: var(--ardoise); }
.puce.attente { background: #fff; color: var(--ambre); border-color: #f0d3a3; border-style: dashed; }

/* Filtres et formulaires */
.filtres { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; }
label.champ { display: grid; gap: 4px; font-size: 13px; color: var(--ardoise); min-width: 0; }
select, input[type="number"], input[type="search"] { font: 15px var(--texte); color: var(--encre); background: var(--fond); border: 1px solid var(--trait); border-radius: 6px; padding: 7px 10px; min-width: 0; max-width: 100%; }
.bouton { font: 600 15px var(--texte); border: 0; border-radius: 6px; padding: 10px 16px; background: var(--encre); color: #fff; text-decoration: none; display: inline-block; cursor: pointer; }
.bouton.contour { background: var(--fond); color: var(--encre); border: 2px solid var(--trait); }
.formulaire { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px 16px; }
.resultats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.resultat { border: 1px solid var(--trait); border-radius: 10px; padding: 14px 16px; background: var(--fond); display: grid; gap: 4px; }
.resultat b { font: 800 24px/1.1 var(--titre); font-variant-numeric: tabular-nums; }
.resultat span { font-size: 13px; color: var(--ardoise); }
.resultat.principal { border: 2px solid var(--encre); }
.formule { font: 13.5px/1.6 var(--mono); background: var(--fond-2); border: 1px solid var(--trait); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }

/* Journal des événements */
.journal { display: grid; gap: 10px; }
.evt { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; border: 1px solid var(--trait); border-radius: 10px; padding: 12px 14px; background: var(--fond); }
.evt time { font: 600 13px var(--mono); color: var(--ardoise); }
.evt .type { font: 600 11.5px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.evt.prix .type { color: var(--rouge); }
.evt.retrait .type, .evt.depreciation .type { color: var(--ambre); }
.evt.tiers { border-style: dashed; }
.evt p { margin-top: 2px; }
@media (max-width: 560px) { .evt { grid-template-columns: 1fr; gap: 4px; } }

details { border: 1px solid var(--trait); border-radius: 10px; background: var(--fond); }
details > summary { cursor: pointer; padding: 10px 14px; font-weight: 600; }
details > div { padding: 0 14px 14px; display: grid; gap: 10px; }
pre.prompt { white-space: pre-wrap; font: 13px/1.5 var(--mono); background: var(--fond-2); border: 1px solid var(--trait); border-radius: 8px; padding: 10px 12px; margin: 0; }

footer.bas { background: var(--nuit); color: #f5f7fc; padding-block: 28px; margin-top: 0; }
footer.bas .page { display: grid; gap: 8px; font-size: 14px; }
footer.bas a { color: #fff; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Lignes officielles d'une annonce de retrait */
details.lignes { margin-top: 8px; }
details.lignes .tableau table { min-width: 0; }
details.lignes code { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 13px; overflow-wrap: anywhere; }

/* Points d'une actualité vérifiée : statut par affirmation */
ul.points { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; }
ul.points li { padding-left: 10px; border-left: 3px solid var(--trait); }
ul.points li.confirme { border-left-color: var(--vert); }
ul.points li.corrige { border-left-color: var(--ambre); }
ul.points li.nonverifie { border-left-color: var(--trait); color: var(--ardoise); font-style: italic; }
.statut-point { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }

/* Brainy FinOps : bulle de chat (assistant Base44) */
.brainy { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 50; font-family: var(--texte); }
.brainy-bulle { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 18px; background: var(--encre); color: var(--fond); font: 600 15px var(--texte); box-shadow: 0 8px 24px rgba(11, 27, 63, .28); cursor: pointer; }
.brainy-bulle:hover { background: var(--bleu); }
.brainy-panneau { position: absolute; right: 0; bottom: 60px; width: min(390px, calc(100vw - 32px)); max-height: min(620px, calc(100vh - 110px)); display: flex; flex-direction: column; background: var(--fond); color: var(--encre); border: 1px solid var(--trait); border-radius: 14px; box-shadow: 0 18px 48px rgba(11, 27, 63, .25); overflow: hidden; }
.brainy-panneau[hidden] { display: none; }
.brainy-panneau header { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 12px 14px; background: var(--encre); color: var(--fond); }
.brainy-panneau header b { font: 800 17px var(--titre); }
.brainy-panneau header span { grid-column: 1; font-size: 12.5px; opacity: .85; }
.brainy-fermer { grid-row: 1 / span 2; grid-column: 2; align-self: start; background: none; border: 0; color: inherit; font-size: 24px; line-height: 1; cursor: pointer; }
.brainy-fil { flex: 1; min-height: 140px; overflow-y: auto; padding: 12px; display: grid; gap: 10px; align-content: start; }
.brainy-msg { max-width: 92%; padding: 9px 12px; border-radius: 12px; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.brainy-msg.assistant { background: var(--bleu-pale); justify-self: start; }
.brainy-msg.user { background: var(--encre); color: var(--fond); justify-self: end; }
.brainy-msg.attente { font-style: italic; color: var(--ardoise); }
.brainy-msg.info { background: var(--ambre-pale); }
.brainy-msg a { color: var(--bleu); }
.brainy-accord { padding: 12px 14px; border-top: 1px solid var(--trait); font-size: 13.5px; display: grid; gap: 10px; }
.brainy-accord p { margin: 0; }
.brainy-accord button, .brainy-saisie button { justify-self: start; border: 0; border-radius: 8px; padding: 8px 14px; background: var(--bleu); color: var(--fond); font: 600 14px var(--texte); cursor: pointer; }
.brainy-saisie { border-top: 1px solid var(--trait); padding: 10px 12px; display: grid; gap: 8px; }
.brainy-saisie[hidden], .brainy-accord[hidden] { display: none; }
.brainy-saisie textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 52px; border: 1px solid var(--trait); border-radius: 8px; padding: 8px; font: 14.5px var(--texte); color: var(--encre); background: var(--fond); }
.brainy-saisie > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.brainy-reste { font-size: 12px; color: var(--ardoise); }
.brainy-saisie button:disabled { opacity: .6; cursor: wait; }
@media (max-width: 480px) {
  .brainy-bulle span { display: none; }
  .brainy-bulle[aria-expanded="true"] { display: none; }
  .brainy-panneau { position: fixed; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); bottom: max(12px, env(safe-area-inset-bottom, 0px)); width: auto; max-height: calc(100vh - 24px); }
}
.brainy-msg p { margin: 0 0 6px; }
.brainy-msg p:last-child { margin-bottom: 0; }
.brainy-titre { font-weight: 700; margin-top: 8px !important; }
.brainy-puce { padding-left: 4px; }
.brainy-note { border-left: 3px solid var(--bleu); padding-left: 8px; color: var(--ardoise); }
.brainy-tableau { overflow-x: auto; margin: 6px 0; }
.brainy-tableau table { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.brainy-tableau th, .brainy-tableau td { border: 1px solid var(--trait); padding: 4px 6px; text-align: left; vertical-align: top; }
.brainy-tableau th { background: var(--fond); }

/* Indicateurs FinOps clés et comparatif, en tête de page */
.kpi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.kpi-carte { display: grid; align-content: start; gap: 4px; padding: 16px 18px; background: var(--fond); border: 1px solid var(--trait); border-top: 4px solid var(--bleu); border-radius: 12px; min-width: 0; }
.kpi-carte:nth-child(5), .kpi-carte:nth-child(6) { border-top-color: var(--rouge); }
.kpi-carte b { font: 800 30px/1.1 var(--titre); color: var(--encre); font-variant-numeric: tabular-nums; }
.kpi-carte h3 { margin: 0; font: 700 15px/1.35 var(--texte); color: var(--encre); }
.kpi-carte p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ardoise); }
.kpi-carte a { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--bleu); text-decoration: none; }
.kpi-carte a:hover { text-decoration: underline; }
.comparatif { margin-top: 26px; display: grid; gap: 10px; }
.comparatif header h2 { margin: 0 0 4px; }
.comparatif .tableau table { min-width: 860px; }
@media (max-width: 900px) { .kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpi { grid-template-columns: minmax(0, 1fr); } .kpi-carte b { font-size: 26px; } }
.comparatif td:first-child b { white-space: nowrap; }

/* Calculateur : compléter le calcul */
.completer { margin-top: 16px; border: 1px solid var(--trait); border-radius: 12px; padding: 12px 16px 14px; background: var(--fond); }
.completer legend { font-weight: 700; padding: 0 6px; color: var(--encre); }
.completer .options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin-top: 8px; }
.completer .option { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; font-size: 14px; line-height: 1.45; min-width: 0; }
.completer .option input[type="checkbox"] { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--bleu); }
.completer .option input[type="number"] { display: block; width: 120px; margin-top: 4px; padding: 5px 8px; border: 1px solid var(--trait); border-radius: 6px; font: inherit; }
.completer .option small { display: block; margin-top: 3px; color: var(--ardoise); font-size: 12.5px; }
.detail-calcul { margin-top: 12px; }
.detail-calcul table { min-width: 0; }
.detail-calcul tr.total td { border-top: 2px solid var(--encre); }
@media (max-width: 700px) { .completer .options { grid-template-columns: minmax(0, 1fr); } }
.regles { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 6px; line-height: 1.55; }
