:root {
  --ink: #0b0f14;
  --ink-2: #131a24;
  --ink-3: #1c2632;
  --line: #293444;
  --fg: #eef3fa;
  --fg-dim: #a3b3c7;
  --bleu: #4b90ff;
  --blanc: #e9edf2;
  --rouge: #ff5757;
  --amber: #f7c249;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 620px at 10% -12%, #172433 0%, transparent 62%),
    radial-gradient(900px 520px at 94% -4%, #221624 0%, transparent 58%),
    var(--ink);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ---------- fond photographique ----------
   L'image est posee par un pseudo-element FIXE plutot que par
   `background-attachment: fixed`, que Safari mobile ne tient pas : la page defile,
   le paysage reste.

   Le voile n'est pas un effet de style, c'est ce qui rend la page lisible : l'image
   porte de la neige eclatante, et sans lui les chiffres qui comptent -- un prix, une
   echeance -- passeraient devant un fond clair et charge.

   Il ne sert PAS a cacher la typographie de l'image : ca, aucun voile ne le fait
   (du blanc vif sur fond sombre survit a l'assombrissement -- vu au rendu, le titre
   de l'image traversait le notre). C'est le recadrage qui s'en charge, a la source.
   Le voile n'a donc plus qu'un travail, et peut rester leger.

   Reste un degrade plutot qu'une valeur unique : le bas de page empile les cartes
   et demande un peu plus de calme que le haut.

   Il ne s'applique QUE si l'image a vraiment ete chargee (classe posee par le
   script) : sans elle, ajouter un voile ne ferait qu'assombrir le degrade de la
   page sans rien couvrir. Le site reste donc entier tant que le fichier n'est pas
   depose. */
body.a-fond::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(180deg, rgba(7,10,15,.82) 0%, rgba(7,10,15,.78) 30%, rgba(7,10,15,.90) 100%),
    var(--fond);
  background-size: cover, cover;
  background-position: center, center top;
  background-repeat: no-repeat, no-repeat;
}
/* Le paysage recadre est tres panoramique (3,3:1). Sur un ecran haut -- un telephone
   surtout -- `cover` le zoome fort et n'en garde qu'une tranche verticale. On la
   prend a droite : c'est la que sont la vallee et les lignes, alors que le centre
   n'offre qu'un versant. */
@media (max-width: 640px) {
  body.a-fond::before { background-position: center, 68% center; }
}

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 99; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- en-tete ---------- */
.masthead {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; padding: 32px 40px 20px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 18px; align-items: center; }
.brand-mark {
  width: 14px; height: 48px; border-radius: 3px;
  background: linear-gradient(180deg, var(--bleu) 0 45%, var(--blanc) 45% 72%, var(--rouge) 72% 100%);
  box-shadow: 0 0 26px rgba(255, 87, 87, .3);
}
h1 {
  font-family: var(--display); font-size: 32px; letter-spacing: -.02em;
  margin: 0; font-weight: 800; line-height: 1.1;
}
h1 span { color: var(--fg-dim); font-weight: 500; margin: 0 2px; }
.sub { margin: 5px 0 0; color: var(--fg-dim); font-size: 13px; }
/* Deux reperes de fraicheur cote a cote : d'ou vient la page, et quand elle bouge. */
.run-meta { text-align: right; display: flex; gap: 26px; align-items: flex-start; }
.run-meta strong { display: block; font-family: var(--mono); font-size: 15px; }
/* Portee elargie a tout l'en-tete : les deux blocs -- dernier et prochain calcul --
   portent la meme paire « valeur en gros, precision en petit ». */
.run-meta small {
  display: block; margin-top: 2px; color: var(--fg-dim); font-size: 11px;
  font-family: var(--mono);
}
@media (max-width: 640px) { .run-meta { gap: 18px; } }
.label {
  display: block; font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--fg-dim); font-weight: 500;
}
.run-meta strong { font-family: var(--mono); font-size: 15px; font-variant-numeric: tabular-nums; }

/* ---------- onglets ---------- */
.tabs { display: flex; gap: 4px; padding: 0 40px; border-bottom: 1px solid var(--line); }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent; color: var(--fg-dim);
  font-family: var(--sans); font-size: 14px; font-weight: 500; padding: 14px 18px;
  cursor: pointer; transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--fg); }
.tab.is-active { color: var(--fg); border-bottom-color: var(--amber); }

main { padding: 28px 40px 72px; }
.panel { display: none; }
.panel.is-active { display: block; }

/* ---------- previsions ---------- */
#panel-forecast { display: none; gap: 28px; align-items: start; }
#panel-forecast.is-active { display: grid; grid-template-columns: 268px 1fr; }

.side { display: grid; gap: 18px; }
.side-block {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px;
}
.side-block h2 {
  font-family: var(--display); font-size: 16px; margin: 0; font-weight: 700;
}
.side-intro { margin: 4px 0 18px; color: var(--fg-dim); font-size: 12px; line-height: 1.5; }
.side-foot { margin: 12px 0 0; color: var(--fg-dim); font-size: 11px; line-height: 1.55; }

.gauge + .gauge { margin-top: 18px; }
.gauge-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.gauge-head span {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-dim);
  font-weight: 500;
}
.gauge-head strong { font-family: var(--display); font-size: 27px; line-height: 1; }
.track { height: 7px; background: var(--ink-3); border-radius: 4px; margin: 9px 0 6px; overflow: hidden; }
.track i { display: block; height: 100%; width: 0; border-radius: 4px; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.gauge[data-color="bleu"] .track i { background: var(--bleu); }
.gauge[data-color="blanc"] .track i { background: var(--blanc); }
.gauge[data-color="rouge"] .track i { background: var(--rouge); }
.gauge[data-color="bleu"] .gauge-head strong { color: var(--bleu); }
.gauge[data-color="rouge"] .gauge-head strong { color: var(--rouge); }
.gauge small { color: var(--fg-dim); font-size: 11.5px; font-family: var(--mono); }

/* grille tarifaire de la colonne */
.tariff-grid { width: 100%; border-collapse: collapse; margin-top: 14px; }
.tariff-grid th, .tariff-grid td { padding: 7px 0; text-align: right; font-size: 12.5px; }
.tariff-grid thead th {
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-dim);
  font-weight: 500; border-bottom: 1px solid var(--line); padding-bottom: 8px;
}
.tariff-grid thead th:first-child, .tariff-grid tbody th { text-align: left; }
.tariff-grid tbody th { font-weight: 500; font-size: 13px; }
.tariff-grid tbody td { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tariff-grid tbody td.hp { color: var(--fg); font-weight: 500; }
.tariff-grid tbody tr:not(:last-child) th,
.tariff-grid tbody tr:not(:last-child) td { border-bottom: 1px solid rgba(41,52,68,.55); }
.tariff-grid tbody tr[data-color="3"] td.hp { color: var(--rouge); font-weight: 600; }

.note {
  padding: 14px 16px; border-left: 2px solid var(--amber); border-radius: 0 8px 8px 0;
  background: rgba(247, 194, 73, .07); color: var(--fg-dim); font-size: 12.5px; line-height: 1.6;
  margin: 0;
}

/* bandeau alerte rouge */
.alert {
  display: flex; gap: 14px; align-items: center; margin-bottom: 18px;
  padding: 14px 18px; border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(255,87,87,.16), rgba(255,87,87,.04));
  border: 1px solid rgba(255,87,87,.35); font-size: 13.5px; line-height: 1.5;
}
.alert-mark {
  flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--rouge);
  box-shadow: 0 0 0 5px rgba(255,87,87,.15);
}
/* Le bandeau peut porter du Rouge ET du Blanc a la fois : chaque mention prend la
   couleur de ce dont elle parle, sinon « 2 jours Blanc » sortait en rouge vif. */
.alert strong { color: var(--rouge); }
.alert strong.b { color: var(--blanc); }
.alert b { font-family: var(--mono); font-weight: 600; }

/* Un bandeau qui n'annonce que des Blanc ne doit pas crier au Rouge. */
.alert.is-blanc {
  background: linear-gradient(90deg, rgba(233,237,242,.12), rgba(233,237,242,.03));
  border-color: rgba(233,237,242,.28);
}
.alert.is-blanc .alert-mark {
  background: var(--blanc); box-shadow: 0 0 0 5px rgba(233,237,242,.12);
}

/* ---------- ruban : la forme des dix jours ----------
   Une case par journee, a largeur egale, sur une seule ligne. `grid` plutot que
   `flex` pour que la onzieme case ne soit pas plus etroite que les autres : un
   ruban dont les cases varient se lit comme une donnee, alors que la largeur ne
   veut rien dire ici. `minmax(0, 1fr)` empeche le contenu d'imposer sa largeur et de
   faire deborder la ligne sur telephone. */
.ruban {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  gap: 5px; margin-bottom: 18px;
}
.rj {
  position: relative; display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 8px 2px 7px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--ink-2); color: var(--fg-dim); font-family: inherit;
  cursor: pointer; transition: border-color .16s, transform .16s;
}
.rj:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--col) 55%, var(--line)); }
.rj:focus-visible { outline: 2px solid var(--col); outline-offset: 2px; }
/* La couleur du jour EST l'information : elle occupe la barre, pas un simple lisere. */
.rj-bar { width: 100%; height: 6px; border-radius: 3px; background: var(--col); }
.rj[data-color="3"] .rj-bar { box-shadow: 0 0 10px rgba(255,87,87,.7); }
.rj-dow { font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; }
.rj-num { font-family: var(--display); font-size: 15px; font-weight: 700; color: var(--fg); line-height: 1; }
/* Un jour qui a change d'avis se repere sur le ruban avant d'ouvrir sa carte. */
.rj-chg {
  position: absolute; top: -3px; right: -3px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--amber); border: 2px solid var(--ink);
}

/* cartes jour */
/* `align-items: start` : sans lui, la grille etire chaque carte a la hauteur de la plus
   haute de sa rangee, et une journee calme -- dont la carte est justement repliee pour
   s'effacer -- ressortait aussi grande qu'un jour Rouge, remplie de vide. Le repli ne
   servait alors a rien. */
.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; align-items: start; }
/* Onze jours sur cinq colonnes laissent quatre trous en derniere ligne. Six colonnes
   les repartissent en 6 + 5 : un seul trou, et la grille se lit comme deux semaines.
   Le seuil etait a 1180px, largeur a laquelle six colonnes ne font plus que 135px :
   l'en-tete de carte en demande 138 et le badge « J+1 » sortait coupe, comme
   « OFFICIEL RTE ». Mesure faite au rendu, a 1280px. Le seuil tient donc compte de ce
   que le contenu exige vraiment -- et `flex-wrap` ci-dessous garantit le reste, pour
   qu'aucune largeur ne puisse plus rien tronquer meme si ce seuil vieillit mal. */
@media (min-width: 1430px) { .days { grid-template-columns: repeat(6, 1fr); } }

.day {
  position: relative; background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 16px 14px; overflow: hidden;
  animation: rise .5s cubic-bezier(.2,.8,.2,1) backwards;
  transition: transform .18s, border-color .18s;
}
.day:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--col) 45%, var(--line)); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.day::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--col); }
.day[data-color="3"] { box-shadow: 0 0 0 1px rgba(255,87,87,.3), 0 10px 34px -14px rgba(255,87,87,.55); }

.day-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.date { display: flex; align-items: baseline; gap: 5px; }
.dow { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-dim); font-weight: 500; }
.dnum { font-family: var(--display); font-size: 21px; font-weight: 700; }
.horizon {
  font-family: var(--mono); font-size: 10px; color: var(--fg-dim);
  border: 1px solid var(--line); padding: 2px 7px; border-radius: 20px; white-space: nowrap;
}

/* Cible d'un clic sur le ruban : sans ce repere, le defilement depose le lecteur
   devant onze cartes identiques sans lui dire laquelle il visait. */
.day.is-cible { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }

/* Le revirement depuis la veille. Ambre et non rouge : ce n'est pas une alerte de
   plus, c'est un CHANGEMENT -- il doit se distinguer de la couleur annoncee, qui
   porte deja tout le reste de la carte. */
.change {
  display: flex; align-items: center; gap: 7px; margin: 10px 0 0;
  padding: 6px 9px; border-radius: 8px; font-size: 11.5px; line-height: 1.35;
  background: rgba(247,194,73,.1); border: 1px solid rgba(247,194,73,.28);
  color: #f3d795;
}
.change .arrow {
  flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--amber);
}

/* Ce que vaut la prediction A CETTE ECHEANCE. Discret par construction : c'est une
   nuance sur l'annonce, pas une annonce. */
.fiab {
  margin: 10px 0 0; padding-top: 9px; border-top: 1px dashed var(--line);
  font-size: 11px; line-height: 1.4; color: var(--fg-dim);
}
.fiab b { color: var(--fg); font-family: var(--mono); font-weight: 600; }

.verdict { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0; }
.chip { width: 11px; height: 11px; border-radius: 50%; background: var(--col); box-shadow: 0 0 12px var(--col); }
.verdict b { font-family: var(--display); font-size: 18px; font-weight: 700; }
.tag {
  margin-left: auto; font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 4px; background: rgba(247,194,73,.15); color: var(--amber);
  font-weight: 500; white-space: nowrap;
}

/* prix du jour */
.tariff {
  margin-top: 12px; padding: 10px 12px; border-radius: 9px;
  background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.05);
}
/* Le prix est le HEROS du bloc, pas une ligne de tableau : c'est lui qui fait agir.
   L'ancienne disposition poussait le multiplicateur hors de la carte, ou il se
   faisait couper -- une etiquette qui ne tient pas dans sa marque doit sortir de la
   marque, pas etre rognee. */
.t-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.t-main b {
  font-family: var(--mono); font-size: 19px; font-weight: 600;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.t-main em {
  font-style: normal; font-family: var(--mono); font-size: 10.5px; color: var(--fg-dim);
  padding: 2px 6px; border-radius: 4px; background: var(--ink-3);
}
.t-main span {
  flex-basis: 100%; font-size: 11px; color: var(--fg-dim); letter-spacing: .04em;
}
.t-row { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.t-row + .t-row { margin-top: 4px; }
.t-row span { font-size: 11px; color: var(--fg-dim); letter-spacing: .04em; }
.t-row b {
  margin-left: auto; font-family: var(--mono); font-size: 14px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.t-row em {
  font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--fg-dim);
  padding: 1px 5px; border-radius: 4px; background: var(--ink-3);
}
.t-row.t-hc b { font-size: 12.5px; font-weight: 400; color: var(--fg-dim); }
.day[data-color="3"] .tariff { background: rgba(255,87,87,.09); border-color: rgba(255,87,87,.22); }
.day[data-color="3"] .t-main b { color: var(--rouge); }
.day[data-color="3"] .t-main em { background: rgba(255,87,87,.2); color: #ffb3b3; }
.day[data-color="3"] .t-row.t-hc b { color: var(--fg-dim); }
.day[data-color="3"] .t-row em { background: rgba(255,87,87,.2); color: #ffb3b3; }

.proba { margin-top: 12px; }
.pbar { display: flex; height: 6px; border-radius: 4px; overflow: hidden; background: var(--ink-3); }
.pbar i { display: block; transition: width .6s; }
.pbar .b { background: var(--bleu); }
.pbar .w { background: var(--blanc); }
.pbar .r { background: var(--rouge); }
.pmeta {
  display: flex; justify-content: space-between; gap: 6px; margin-top: 7px;
  font-family: var(--mono); font-size: 10.5px; color: var(--fg-dim); font-variant-numeric: tabular-nums;
}
.pmeta .hot { color: var(--rouge); font-weight: 500; }
/* La ligne des cartes calmes : lisible si on la cherche, sans rivaliser avec la barre
   des jours a risque. */
/* Chaque valeur reste d'un seul tenant, mais la ligne peut se replier : sur une carte
   de telephone, « Rouge 0 % » sortait coupe en « Rou ». */
.pmini {
  margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 2px 10px;
  font-family: var(--mono); font-size: 10px; color: var(--fg-dim); letter-spacing: .02em;
}
.pmini span { white-space: nowrap; }
/* La temperature explique la prevision : elle se lit sous le verdict, pas en pied
   de carte en corps 12. */
.temp { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.t-now {
  font-family: var(--display); font-size: 19px; font-weight: 700; line-height: 1;
}
.t-range { font-family: var(--mono); font-size: 11px; color: var(--fg-dim); }

/* Une journee sans enjeu se replie : le regard va aux journees qui en ont une. */
.day.is-calme { padding: 13px 14px; opacity: .82; }
.day.is-calme:hover { opacity: 1; }
.day.is-calme .verdict { margin-top: 9px; }
.day.is-calme .verdict b { font-size: 15px; }
.day.is-calme .dnum { font-size: 18px; }
.day.is-calme .t-now { font-size: 15px; }

/* bandeau « rien a signaler » : meme place que l'alerte, ton oppose */
.calm {
  display: flex; gap: 14px; align-items: center; margin-bottom: 18px;
  padding: 13px 18px; border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(75,144,255,.10), rgba(75,144,255,.02));
  border: 1px solid rgba(75,144,255,.22); font-size: 13.5px; line-height: 1.5;
  color: var(--fg-dim);
}
.calm-mark {
  flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--bleu);
  box-shadow: 0 0 0 5px rgba(75,144,255,.12);
}
.calm strong { color: var(--fg); }

/* ---------- historique ---------- */
.filters { display: flex; gap: 20px; align-items: center; margin-bottom: 22px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button {
  background: none; border: 0; color: var(--fg-dim); font-family: var(--sans); font-size: 13px;
  padding: 8px 16px; cursor: pointer; transition: background .15s, color .15s;
}
.seg button:hover { color: var(--fg); }
.seg button.is-active { background: var(--ink-3); color: var(--fg); }
.pick { font-size: 12px; color: var(--fg-dim); }
.pick select {
  margin-left: 8px; background: var(--ink-2); color: var(--fg); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 12px; font-family: var(--sans); font-size: 13px;
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .label { margin-bottom: 8px; }
.stat b { font-family: var(--display); font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat small { color: var(--fg-dim); font-size: 11.5px; display: block; margin-top: 3px; }

.history-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.card-block {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px;
}
.card-block h3 { font-family: var(--display); font-size: 15px; margin: 0 0 16px; font-weight: 700; }
/* ---------- graphiques ----------
   Traits fins, grille en filet solide un ton au-dessus du fond, valeurs exactes
   dans l'infobulle plutot qu'un nombre sur chaque point. */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; opacity: .55; }
.chart .ax {
  fill: var(--fg-dim); font-family: var(--mono); font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.chart .line { fill: none; stroke: var(--amber); stroke-width: 2; stroke-linecap: round; }
.chart .pt { fill: var(--amber); stroke: var(--ink-2); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .endlab {
  fill: var(--fg); font-family: var(--mono); font-size: 11px; font-weight: 600;
}
/* La diagonale est une reference, pas une grille : trait plein, discret, nomme. */
/* Un carre reste un carre : etire sur la largeur d'une carte, il grossissait ses
   propres etiquettes jusqu'a l'absurde et faussait la lecture de la diagonale. */
.calib { max-width: 380px; margin: 0 auto; }
.calib .ideal { stroke: var(--fg-dim); stroke-width: 1.5; opacity: .45; }
.chart .ax-title { fill: var(--fg-dim); font-family: var(--sans); font-size: 10px; }
.calib .ideal-lab { fill: var(--fg-dim); font-size: 9.5px; font-family: var(--sans); }
.calib .dot { fill: var(--rouge); fill-opacity: .75; stroke: var(--ink-2); stroke-width: 2; cursor: pointer; }
.calib .dot.is-off { fill: var(--amber); }
.chart-axis { color: var(--fg-dim); font-size: 11px; margin: 10px 0 0; }
.chart-tip {
  position: absolute; z-index: 60; max-width: 250px; pointer-events: none;
  background: var(--ink-3); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; font-size: 11.5px; line-height: 1.45; color: var(--fg);
  box-shadow: 0 8px 26px -10px #000;
}

.confusion { display: grid; grid-template-columns: 70px repeat(3, 1fr); gap: 5px; font-size: 12px; }
.confusion div {
  padding: 10px 6px; text-align: center; border-radius: 6px; background: var(--ink-3);
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}
.confusion .h { background: none; color: var(--fg-dim); font-family: var(--sans); }
.confusion .diag { outline: 1px solid rgba(247,194,73,.5); }
.legend { color: var(--fg-dim); font-size: 11.5px; margin: 14px 0 0; }

.table-wrap { overflow-x: auto; max-height: 460px; overflow-y: auto; }
table#history-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
#history-table th {
  position: sticky; top: 0; background: var(--ink-2); text-align: left; font-weight: 500;
  color: var(--fg-dim); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  padding: 9px 10px; border-bottom: 1px solid var(--line);
}
#history-table td {
  padding: 8px 10px; border-bottom: 1px solid rgba(41,52,68,.5);
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}
#history-table tr.miss td { background: rgba(255, 87, 87, .08); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }
.src { color: var(--fg-dim); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.empty { color: var(--fg-dim); padding: 30px 0; text-align: center; }

/* Sur un ecran etroit, la question du jour passe avant le contexte : on ne fait pas
   defiler trois jauges et une grille tarifaire pour apprendre la couleur de demain. */
@media (max-width: 1000px) {
  #panel-forecast.is-active .forecast-main { order: 1; }
  #panel-forecast.is-active .side { order: 2; }
  .masthead, .tabs, main { padding-left: 20px; padding-right: 20px; }
  #panel-forecast.is-active { grid-template-columns: 1fr; }
  .side { grid-template-columns: 1fr 1fr; align-items: start; }
  .side .note { grid-column: 1 / -1; }
  .history-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .masthead { flex-direction: column; align-items: flex-start; gap: 14px; }
  .run-meta { text-align: left; }
  .side { grid-template-columns: 1fr; }
  .days { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
  .day { padding: 13px 12px 12px; }
  /* A deux colonnes sur telephone, la carte se resserre plutot que de deborder. */
  .pmeta { font-size: 9.5px; }
  .verdict b { font-size: 16px; }
  .tag { font-size: 8px; padding: 2px 5px; }
  .t-row span { font-size: 10px; }
  .t-row b { font-size: 12.5px; }
  .temp { font-size: 11px; }
  /* Onze cases sur ~370px utiles : la case tombe a 28px, le jour abrege n'y tient
     plus et le numero suffit a se reperer. */
  .ruban { gap: 3px; }
  .rj { padding: 6px 1px 5px; }
  .rj-dow { display: none; }
  .rj-num { font-size: 13px; }
  .fiab { font-size: 10px; }
  .change { font-size: 10.5px; padding: 5px 7px; }
}

/* ---------- periode d'evaluation ---------- */
.period-note {
  margin: -6px 0 20px; color: var(--fg-dim); font-size: 12.5px; line-height: 1.55;
  max-width: 78ch;
}

/* ---------- fiabilite des probabilites ---------- */
.reliability { display: grid; gap: 7px; }
.rel-row {
  display: grid; grid-template-columns: 66px 1fr 116px 62px; gap: 12px; align-items: center;
  font-family: var(--mono); font-size: 11.5px;
}
.rel-bin { color: var(--fg-dim); font-variant-numeric: tabular-nums; }
.rel-bars { display: grid; gap: 3px; }
.rel-bars i { display: block; height: 7px; border-radius: 4px; min-width: 2px; }
.rel-said { background: var(--fg-dim); }
.rel-got { background: var(--rouge); }
.rel-val { text-align: right; font-variant-numeric: tabular-nums; }
.rel-n { text-align: right; color: var(--fg-dim); font-variant-numeric: tabular-nums; }
/* Un ecart de plus de 20 points enotre l'annonce et le reel se voit. */
.rel-row.is-off .rel-val { color: var(--amber); }
.rel-key {
  display: flex; gap: 18px; margin-top: 12px; font-size: 11px; color: var(--fg-dim);
}
.rel-key span { display: flex; align-items: center; gap: 7px; }
.rel-key i { width: 16px; height: 7px; border-radius: 4px; display: block; }

@media (max-width: 640px) {
  .rel-row { grid-template-columns: 56px 1fr 92px; }
  .rel-n { display: none; }
}

/* Les deux faces d'une alerte : en attraper assez, sans deranger pour rien. */
.hbar .v em { font-style: normal; color: var(--fg-dim); }
.stat[data-warn="1"] b { color: var(--amber); }

/* Bouton discret dans un titre de bloc : « erreurs seulement ». */
.card-block h3 { display: flex; align-items: center; gap: 12px; }
.ghost {
  margin-left: auto; background: none; border: 1px solid var(--line); color: var(--fg-dim);
  font-family: var(--sans); font-size: 11.5px; font-weight: 500; padding: 5px 12px;
  border-radius: 20px; cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
.ghost:hover:not(:disabled) { color: var(--fg); border-color: var(--fg-dim); }
.ghost.is-active { background: rgba(247,194,73,.14); border-color: rgba(247,194,73,.4); color: var(--amber); }
.ghost:disabled { opacity: .4; cursor: default; }

/* Une ligne fausse doit se voir : c'est la seule qu'on vient chercher. */
#history-table tr.miss td { background: rgba(247,194,73,.07); }
#history-table tr.miss td:first-child { box-shadow: inset 2px 0 0 var(--amber); }

/* Le carre de calibration laissait deux vides lateraux ; la lecture du graphique
   occupe la place, au lieu d'etre releguee sous lui en legende. */
.calib-wrap { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: 34px; align-items: center; }
.calib-read { color: var(--fg-dim); font-size: 13px; line-height: 1.65; max-width: 46ch; }
.calib-read p { margin: 0 0 12px; }
.calib-read b { color: var(--fg); font-weight: 600; }
@media (max-width: 860px) { .calib-wrap { grid-template-columns: 1fr; gap: 18px; } }

/* Donnees vieillissantes : ambre, jamais rouge. Le rouge de cette page a un sens
   precis -- un jour Tempo Rouge, donc de l'argent -- et le lui emprunter pour une
   panne de collecte brouillerait le seul signal qui doit rester univoque. */
.degrade {
  display: flex; gap: 13px; align-items: flex-start; margin-bottom: 16px;
  padding: 12px 16px; border-radius: var(--radius); font-size: 13px; line-height: 1.5;
  background: rgba(247,194,73,.09); border: 1px solid rgba(247,194,73,.3);
  color: #f0d69a;
}
.degrade-mark {
  flex: none; margin-top: 5px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 0 4px rgba(247,194,73,.14);
}
.degrade strong { color: var(--amber); }
.degrade b { font-family: var(--mono); font-weight: 600; color: #ffe9b8; }

/* ---------- pied de page ---------- */
/* Memes marges laterales que `main` et l'en-tete, sinon le trait de separation ne
   s'aligne sur rien. */
.pied {
  margin-top: 10px; padding: 20px 40px 34px;
  border-top: 1px solid var(--line); text-align: center;
}
/* `:not([hidden])` n'est pas une coquetterie : une regle d'auteur qui pose
   `display: flex` bat le `[hidden] { display: none }` du navigateur, quelle que soit
   sa specificite. Sans cette precaution, le bloc restait VISIBLE alors que l'attribut
   disait le contraire -- et une image brisee se serait affichee le jour ou le service
   tombe, c'est-a-dire le seul jour ou ce code sert a quelque chose. */
/* Visible meme quand tout va bien : un temoin qui ne s'allume qu'en cas de panne ne
   se distingue pas d'un temoin grille. */
.sources:not([hidden]) { display: inline-flex; align-items: center; gap: 7px; }
.sources { margin: 0 0 14px; color: var(--fg-dim); font-size: 11.5px; }
.sources b { font-family: var(--mono); color: var(--fg); }
.sources b.ko { color: var(--amber); }
.pastille {
  width: 7px; height: 7px; border-radius: 50%; background: #3f7d5a;
}
.sources.is-ko .pastille { background: var(--amber); box-shadow: 0 0 8px rgba(247,194,73,.6); }

.compteur:not([hidden]) { display: flex; flex-direction: column; align-items: center; }
.compteur { margin: 0; gap: 7px; }
.compteur img { height: 20px; display: block; }
.compteur small { color: var(--fg-dim); font-size: 11px; }
@media (max-width: 1000px) { .pied { padding-left: 20px; padding-right: 20px; } }

/* Second rendu, quand la couleur officielle arrive en direct : rejouer l'entree en
   cascade ferait clignoter onze cartes pour en corriger une. */
.days.sans-animation .day { animation: none; }

/* ---------- voyants du dernier passage ---------- */
.voyants:not([hidden]) { display: block; }
.voyants {
  padding: 10px 40px; border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--fg-dim);
}
.voyants-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.voyants-titre { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; margin-right: 4px; }
.voyants.is-ko .voyants-titre { color: #ff8a8a; }
.voyant { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--fg); }
.voyant i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.voyant.ok i { background: #3ecf7a; box-shadow: 0 0 6px rgba(62,207,122,.55); }
.voyant.ko i { background: #ff4d4d; box-shadow: 0 0 8px rgba(255,77,77,.7); }
.voyant.ko { color: #ffb3b3; }
.voyants-detail { margin: 8px 0 0; padding: 0; list-style: none; line-height: 1.5; color: #f3c4c4; }
.voyants-detail b { color: #ffb3b3; font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 1000px) { .voyants { padding-left: 20px; padding-right: 20px; } }

/* ---------- emplacement publicitaire ---------- */
/* La hauteur est RESERVEE avant que l'annonce n'arrive : une regie repond apres le
   rendu, et un bloc qui grandit a ce moment-la fait sauter la page sous le doigt du
   lecteur. 90px est la banniere 728x90 ; sur telephone, 100px est le format 320x100. */
.pub:not([hidden]) { display: block; }
.pub { max-width: 728px; margin: 26px auto 0; }
.pub-label {
  display: block; margin: 0 0 6px; color: var(--fg-dim);
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
}
.pub-cadre { min-height: 90px; border-radius: var(--radius); overflow: hidden; }
@media (max-width: 640px) { .pub-cadre { min-height: 100px; } }
/* Apercu seulement : un cadre pointille qui montre la place prise, rien de plus. */
.pub.apercu .pub-cadre {
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--line); background: var(--ink-2);
  color: var(--fg-dim); font-family: var(--mono); font-size: 12px;
}

/* ---------- proposition d'installation (telephone) ---------- */
.installer:not([hidden]) { display: flex; }
.installer {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 50; align-items: center; gap: 12px; padding: 12px 12px 12px 14px;
  background: #141a23; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 34px rgba(0,0,0,.55); color: var(--fg); font-size: 13px;
  animation: installer-monte .35s ease-out;
}
@keyframes installer-monte { from { transform: translateY(20px); opacity: 0; } }
.installer-icone {
  flex: none; width: 34px; height: 34px; border-radius: 9px; background:
    linear-gradient(180deg, var(--bleu) 0 33%, var(--blanc) 33% 66%, var(--rouge) 66%) center / 12px 20px no-repeat,
    #0b0e14;
}
.installer-texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; line-height: 1.35; }
.installer-texte span { color: var(--fg-dim); font-size: 12px; }
.installer-texte b { color: var(--fg); }
.installer-oui {
  flex: none; padding: 8px 14px; border-radius: 9px; border: 0; cursor: pointer;
  background: var(--bleu); color: #fff; font: inherit; font-weight: 600;
}
.installer-non {
  flex: none; width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer;
  background: transparent; color: var(--fg-dim); font-size: 20px; line-height: 1;
}
