:root {
  color-scheme: light;
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
  color: #123654;
  background: #eff6fa;
  --surface: #fff;
  --ligne: #d7e7ef;
  --franc: #1665a4;
  --fonce: #0e3a5c;
  --texte-secondaire: #49697c;
  --moins: #9b5c2f;
  --plus: #146ba5;
  --repere: #a95327;
  --eau: #e4f1fa;
}

* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, p, ul, figure, dl, dd { margin: 0; }
button, select { font: inherit; }
:focus-visible { outline: 2px solid var(--fonce); outline-offset: 3px; }
.page { width: min(1370px, 100%); margin-inline: auto; padding: clamp(.75rem, 3vw, 2.1rem); }
.entete { padding: clamp(1.2rem, 4vw, 3rem); background: var(--fonce); color: #fff; border-bottom: 4px solid #70c2e5; border-radius: .8rem; }
.repere { text-transform: uppercase; letter-spacing: .12em; color: #b1ddf4; font-size: .73rem; font-weight: 720; }
h1 { max-width: 23ch; margin-block: .4rem .65rem; font: 500 clamp(2rem, 5.7vw, 4rem)/1.04 Georgia, serif; letter-spacing: -.035em; }
.entete > p:last-child { color: #dcedfa; line-height: 1.45; font-size: .91rem; }

.grille { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); align-items: start; gap: .9rem; margin-top: .9rem; }
.panneau { min-width: 0; padding: clamp(.8rem, 2vw, 1.3rem); border: 1px solid var(--ligne); border-radius: .75rem; background: var(--surface); }
.en-tete-panneau { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: .7rem; }
h2 { font-size: 1.08rem; line-height: 1.3; }
.note { margin-top: .25rem; font-size: .79rem; color: var(--texte-secondaire); line-height: 1.4; }
label { display: grid; gap: .15rem; font-size: .75rem; color: var(--texte-secondaire); }
select { border: 1px solid #bdcfc7; padding: .33rem .45rem; border-radius: .32rem; background: var(--surface); color: var(--fonce); }
.cle-ecart { display: grid; grid-template-columns: 1fr 1fr; margin: 1.15rem 4.8rem .2rem 5.1rem; gap: .5rem; color: var(--texte-secondaire); font-size: .68rem; }
.cle-ecart span:first-child { text-align: right; }
.comparaison { padding: 0; list-style: none; }
.comparaison li { border-top: 1px solid #edf0eb; }
.ligne { display: grid; width: 100%; grid-template-columns: 4.6rem minmax(0, 1fr) 4.5rem; gap: .45rem; align-items: center; padding: .78rem .35rem; border: 0; border-radius: .4rem; color: var(--fonce); text-align: left; background: transparent; cursor: pointer; }
.ligne:hover, .ligne[aria-pressed="true"] { background: var(--eau); }
.nom { font-size: .81rem; }
.valeur { font-size: .77rem; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.piste { position: relative; height: .62rem; border-radius: .28rem; background: #e9eeea; }
.piste::before { content: ""; position: absolute; z-index: 1; left: 50%; top: -.22rem; bottom: -.22rem; border-left: 1px solid #47625d; }
.piste > span { position: absolute; inset-block: 0; }
.piste .deficit { right: 50%; border-radius: .25rem 0 0 .25rem; background: var(--moins); }
.piste .excedent { left: 50%; border-radius: 0 .25rem .25rem 0; background: var(--plus); }

.chronologie { display: grid; grid-template-columns: 1.85rem minmax(0, 1fr); margin-top: 1rem; }
.trace { min-width: 0; padding-right: .3rem; }
.echelle { height: 12rem; position: relative; color: var(--texte-secondaire); font-size: .67rem; }
.echelle span { position: absolute; right: .32rem; transform: translateY(-50%); }
#historique { display: block; width: 100%; height: 12rem; overflow: visible; }
#historique line, #historique polyline { vector-effect: non-scaling-stroke; }
.grille-graphique { stroke: #d8e6ef; stroke-width: 1; }
.trait-normal { stroke: #506765; stroke-width: 1.3; stroke-dasharray: 4 3; }
.pluie { fill: none; stroke: var(--franc); stroke-width: 2.1; stroke-linejoin: round; }
.trait-cible { stroke: var(--repere); stroke-width: 1.5; }
.trait-selection { stroke: var(--fonce); stroke-width: 1.5; }
.point-selection { stroke: var(--fonce); stroke-width: 5; stroke-linecap: round; }
.dates { height: 1.3rem; position: relative; color: var(--texte-secondaire); font-size: .66rem; }
.dates span { position: absolute; top: .18rem; transform: translateX(-50%); }
.dates span:first-child { transform: none; }
.dates span:last-child { color: var(--repere); font-weight: 730; transform: translateX(-65%); }
figcaption { grid-column: 1 / -1; color: var(--texte-secondaire); font-size: .75rem; line-height: 1.4; }

.detail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; margin-top: .8rem; }
.detail div { padding: .55rem; border-radius: .42rem; background: var(--eau); }
.detail dt { margin-bottom: .2rem; color: var(--texte-secondaire); font-size: .69rem; }
.detail dd { color: var(--fonce); font-size: .86rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.methode { margin-top: .8rem; font-size: .83rem; }
.methode summary { cursor: pointer; font-weight: 670; }
.methode p { margin-top: .55rem; max-width: 75ch; line-height: 1.45; }
footer { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin-top: .85rem; font-size: .78rem; }
footer a { color: var(--texte-secondaire); text-underline-offset: .2em; }

.vues { display: flex; flex-wrap: wrap; gap: .42rem; margin-top: .75rem; }
.vues a { padding: .52rem .7rem; border-radius: .36rem; color: var(--fonce); font-size: .84rem; font-weight: 650; text-decoration: none; }
.vues a:hover { background: #dceefa; }
.vues a[aria-current="location"] { background: var(--fonce); color: #fff; }
.grille-saisons { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.legende-saison { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .8rem; color: var(--texte-secondaire); font-size: .74rem; }
.legende-saison span { display: inline-flex; align-items: center; gap: .35rem; }
.legende-saison i { width: 1.2rem; border-top: 3px solid var(--plus); }
.legende-saison span:last-child i { border-top: 2px dashed #506e85; }
.cycle { margin-top: .65rem; }
#courbe-saison { display: block; width: 100%; height: 12rem; }
#courbe-saison line, #courbe-saison polyline { vector-effect: non-scaling-stroke; }
.cycle-2024 { fill: none; stroke: var(--plus); stroke-width: 2.4; stroke-linejoin: round; }
.cycle-reference { fill: none; stroke: #506e85; stroke-width: 1.8; stroke-dasharray: 5 4; stroke-linejoin: round; }
.repere-mois { fill: var(--eau); }
.zone-mois { fill: transparent; cursor: pointer; }
.mois-cycle { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); text-align: center; margin-block: .25rem .55rem; color: var(--texte-secondaire); font-size: clamp(.57rem, 1.7vw, .71rem); }
.detail-annuel { margin-top: .7rem; }
.bilan-saison { margin-top: .7rem; }
.ligne-saison { display: grid; grid-template-columns: minmax(4.8rem, 1.25fr) minmax(3.65rem, 1fr) minmax(3.8rem, 1fr) minmax(2.95rem, .75fr); gap: .3rem; padding-inline: .3rem; }
.colonnes-saison { margin: .7rem 0 .27rem; font-size: .68rem; color: var(--texte-secondaire); }
.colonnes-saison span:not(:first-child) { text-align: right; }
.ligne-saison .valeur { white-space: nowrap; }
.manque { color: #82431c; }
.surplus { color: #0e5e96; }
.maritime-note { margin-top: .6rem; }
#table-mensuelle table { width: 100%; margin-top: .6rem; border-collapse: collapse; font-size: .8rem; }
#table-mensuelle th, #table-mensuelle td { border-bottom: 1px solid var(--ligne); padding: .36rem .25rem; }
#table-mensuelle th:first-child { text-align: left; }
#table-mensuelle th:not(:first-child), #table-mensuelle td { text-align: right; font-variant-numeric: tabular-nums; }
#table-mensuelle .mois-actif { background: var(--eau); }

@media (max-width: 830px) { .grille { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 450px) {
  .detail div { padding: .45rem .35rem; }
  .detail dd { font-size: .79rem; }
  .ligne { grid-template-columns: 4rem minmax(0, 1fr) 3.9rem; }
  .cle-ecart { margin-inline: 4.5rem 4.4rem; }
  .valeur { font-size: .72rem; }
  .ligne-saison { grid-template-columns: minmax(4.1rem, 1.05fr) minmax(3.3rem, .9fr) minmax(3.55rem, .95fr) minmax(2.5rem, .75fr); gap: .17rem; padding-inline: .15rem; }
  #table-mensuelle table { font-size: .71rem; }
}
