:root {
  color-scheme: light;
  --bg: #f4f4f1;
  --surface: #fcfcfb;
  --grid: #e6e5e0;
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-3: #706f69;   /* contraste ≥ 4,5:1 sur --surface */
  --border: #e3e2dc;
  --ok: #1a8a4a;
  --warn: #c98500;
  --bad: #d03b3b;

  /* séries (palette de référence validée, mode clair) */
  --temp: #eb6834;
  --wind: #2a78d6;
  --gust: #eb6834;
  --rain: #2a78d6;
  --rainsum: #1baf7a;
  --sun:  #eda100;
  --hum:  #1baf7a;
  --press:#4a3aa7;
  --frost:#1f62c4;   /* ligne « Durée du gel en cours » */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111110;
    --surface: #1a1a19;
    --grid: #2c2c2a;
    --text: #ffffff;
    --text-2: #c3c2b7;
    --text-3: #8d8c84;
    --border: #2a2a28;
    --temp: #d95926;
    --wind: #3987e5;
    --gust: #d95926;
    --rain: #3987e5;
    --rainsum: #199e70;
    --sun:  #c98500;
    --hum:  #199e70;
    --press:#9085e9;
    --frost:#6aa6f2;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111110; --surface: #1a1a19; --grid: #2c2c2a; --text: #ffffff;
  --text-2: #c3c2b7; --text-3: #8d8c84; --border: #2a2a28;
  --temp: #d95926; --wind: #3987e5; --gust: #d95926; --rain: #3987e5; --rainsum: #199e70;
  --sun: #c98500; --hum: #199e70; --press: #9085e9; --frost: #6aa6f2;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

/* ---------- En-tête ---------- */
.top {
  display: flex; flex-wrap: wrap; gap: 12px 24px;
  align-items: flex-end; justify-content: space-between;
  max-width: 1280px; margin: 0 auto; padding: 24px 16px 12px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { display: block; width: auto; max-width: 40vw; object-fit: contain; flex: none; }
.brand-logo[hidden] { display: none; }
.top h1 { font-size: 22px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
.subtitle { margin: 2px 0 0; color: var(--text-3); font-size: 13px; }
.status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.clock { font-size: 20px; font-weight: 600; }
.age { color: var(--text-3); font-size: 13px; min-width: 9ch; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; color: var(--text-2);
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.pill-on  .dot { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.pill-wait .dot { background: var(--warn); }
.pill-off .dot { background: var(--bad); }
.pill-arch .dot { background: var(--wind); }

.banner {
  max-width: 1248px; margin: 0 auto 12px; padding: 10px 14px;
  border-radius: 10px; border: 1px solid color-mix(in srgb, var(--bad) 40%, var(--border));
  background: color-mix(in srgb, var(--bad) 8%, var(--surface));
  color: var(--text); font-size: 14px;
}
@media (max-width: 1280px) { .banner { margin-left: 16px; margin-right: 16px; } }

/* ---------- Grille du tableau de bord ----------
 * panneaux développés : une ligne entière chacun ; panneaux réduits : tuiles côte à côte,
 * regroupées en tête (voir « Panneaux réduits ») */
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); grid-auto-flow: row dense;
  max-width: 1280px; margin: 0 auto; padding: 4px 16px 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px 14px;
  display: flex; flex-direction: column; min-width: 0;
}
.card[hidden] { display: none; }   /* ex. carte désactivée dans skin.conf (extras.js) */
.card > header, .card-main > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.card h2 { margin: 0; font-size: 14px; font-weight: 600; color: var(--text-2); }
.card h2::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px;
  background: var(--c); margin-right: 8px; vertical-align: 1px;
}
.hint { font-size: 12px; color: var(--text-3); }

.now { display: flex; align-items: baseline; gap: 6px; margin: 8px 0 2px; min-height: 52px; }
.val { font-size: 44px; font-weight: 650; letter-spacing: -.02em; line-height: 1.05; transition: color .6s; }
.val.flash { color: var(--c); transition: none; }
.unit { font-size: 16px; color: var(--text-2); }
.aux { margin: 0 0 4px; font-size: 13px; color: var(--text-2); }
.aux b { color: var(--text); font-weight: 600; }
.aux.frost, .aux.frost b { color: var(--frost); }

.side { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; align-self: center; }
.compass { width: 44px; height: 44px; }
.compass .ring { fill: none; stroke: var(--grid); stroke-width: 2; }
.compass .cardinal { font-size: 7px; fill: var(--text-3); text-anchor: middle; font-weight: 600; }
.compass .needle { transform-origin: 20px 20px; transition: transform .8s cubic-bezier(.3,.7,.3,1); }
.compass .needle path { fill: var(--wind); }
.dir { display: flex; flex-direction: column; line-height: 1.15; }
.dir b { font-size: 16px; }
.dir small { color: var(--text-3); font-size: 12px; }

.ext {
  display: flex; flex-wrap: wrap; gap: 4px 20px;
  margin: 8px 0 10px; padding: 8px 0 0; border-top: 1px solid var(--grid);
}
.ext div { display: flex; flex-direction: column; }
.ext dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.ext dd { margin: 0; display: flex; align-items: baseline; gap: 6px; }
.ext dd b { font-size: 17px; font-weight: 600; }
.ext dd small { font-size: 12px; color: var(--text-3); }

.chart { position: relative; height: 120px; margin-top: auto; }
.chart canvas { display: block; width: 100%; height: 100%; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; margin: 6px 0 0; padding: 0; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: 3px; }
/* légende cliquable (minichart.js, meteogram.js) : masquer / réafficher une courbe */
.legend li.lg-tg { cursor: pointer; user-select: none; -webkit-user-select: none; border-radius: 6px; padding: 1px 4px; margin: -1px -4px; }
.legend li.lg-tg:hover { color: var(--text); background: var(--grid); }
.legend li.lg-tg:focus-visible { outline: 2px solid var(--wind); outline-offset: 1px; }
.legend li.lg-off { opacity: .45; text-decoration: line-through; }
.legend li.lg-off i { filter: grayscale(1); }

/* ---------- Infobulle ---------- */
.tip {
  position: fixed; z-index: 10; pointer-events: none;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 9px; font-size: 12px; line-height: 1.35;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  white-space: nowrap;
}
.tip .t { color: var(--text-3); }
.tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

.foot { max-width: 1280px; margin: 0 auto; padding: 4px 16px 28px; color: var(--text-3); font-size: 12px; }

/* ---------- Menu ---------- */
.menu {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center; position: relative; z-index: 20;
  max-width: 1280px; margin: 0 auto 12px; padding: 0 16px;
}
.menu a {
  flex: none; padding: 6px 12px; border-radius: 999px;
  color: var(--text-2); text-decoration: none; font-size: 14px;
  border: 1px solid transparent;
}
.menu a:hover { background: var(--surface); border-color: var(--border); color: var(--text); }
.menu a[aria-current="page"] { background: var(--text); color: var(--bg); font-weight: 600; }
/* lien vers un site extérieur (« Éclairs », nouvel onglet) */
.menu a.ext-link { display: inline-flex; align-items: center; gap: 5px; }
.menu a.ext-link svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.menu a:focus-visible, .dd-btn:focus-visible, .card h2 a:focus-visible { outline: 2px solid var(--wind); outline-offset: 2px; }

/* titres des cartes du tableau de bord : lien vers la page de détail */
.card h2 a { color: inherit; text-decoration: none; }
.card h2 a::after { content: " ›"; color: var(--text-3); font-weight: 400; }
.card h2 a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Page de détail ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: 4px 16px 16px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.p-title { margin: 0; font-size: 28px; font-weight: 650; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.p-title .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.p-last { margin: 2px 0 0 22px; color: var(--text-3); font-size: 13px; }
.p-range { margin: 10px 0 14px; color: var(--text-2); font-size: 13px; }


.stats {
  display: grid; gap: 12px; margin-bottom: 16px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; min-width: 0;
}
.t-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.t-val { display: flex; align-items: baseline; gap: 5px; margin-top: 4px; }
.t-val b { font-size: 26px; font-weight: 650; letter-spacing: -.01em; }
.t-val span { color: var(--text-2); font-size: 14px; }
.t-sub { font-size: 12px; color: var(--text-3); min-height: 1.4em; }

.card.big { padding-bottom: 12px; }
.card.big h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.chart-big { height: 340px; }
@media (max-width: 600px) {
  .chart-big { height: 240px; }
  .p-title { font-size: 22px; }
}
.legend i.band { height: 8px; vertical-align: 0; }
.legend i.hilo { width: 5px; height: 12px; border-radius: 2px; vertical-align: -2px; background: var(--text-3); }   /* remplacée par TempScale.hiloSwatch() */
.tscale { display: inline-flex; flex-direction: column; vertical-align: middle; margin-right: 6px; }
.tscale-bar { display: block; width: 170px; height: 6px; border-radius: 3px; }
.tscale-lab { position: relative; display: block; height: 13px; font-size: 10px; color: var(--text-3); width: 170px; }
.tscale-lab span { position: absolute; top: 0; transform: translateX(-50%); }

/* ---------- Prévisions, radar, satellite ---------- */
:root { --cloud: #a9a8a1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cloud: #77766f; } }
:root[data-theme="dark"] { --cloud: #77766f; }

.wide { max-width: 1280px; margin: 0 auto; padding: 0 16px 16px; }
.maps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.maps[hidden] { display: none; }
.muted { color: var(--text-3); font-size: 14px; }
.credit { margin: 8px 0 0; font-size: 11px; color: var(--text-3); }
.credit a { color: inherit; }
.fc-sun { margin-left: auto; }

.fc { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(min(var(--n, 7), 8), minmax(0, 1fr)); gap: 8px; }
.fc-day {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  padding: 10px 6px; border-radius: 10px; background: color-mix(in srgb, var(--grid) 35%, transparent);
}
.fc li:first-child .fc-day { background: color-mix(in srgb, var(--sun) 12%, transparent); }
.fc > li { display: flex; min-width: 0; }
:where(.fc-day > span) { display: block; }   /* éléments du bouton (span : HTML valide) */
button.fc-day {
  width: 100%; font: inherit; color: var(--text); border: 1px solid transparent; cursor: pointer;
}
button.fc-day:hover { border-color: var(--border); }
button.fc-day[aria-expanded="true"] { border-color: var(--text-2); box-shadow: inset 0 0 0 1px var(--text-2); }
button.fc-day:focus-visible, .fh-close:focus-visible { outline: 2px solid var(--wind); outline-offset: 2px; }
.fc-tip { margin: 8px 0 0; font-size: 12px; color: var(--text-3); }

/* Détail heure par heure */
.fc-hours { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--grid); }
.fh-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fh-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.fh-close {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font-size: 18px; line-height: 1; cursor: pointer;
}
.fh-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 10px 0 6px; }
@media (max-width: 700px) { .fh-charts { grid-template-columns: 1fr; gap: 8px; } }
.fh-label { font-size: 12px; color: var(--text-3); margin-bottom: 2px; }
.fh-dry { display: none; margin: 0; font-size: 13px; color: var(--text-3); }
.fh-rainbox.no-rain .fh-chart { display: none; }
.fh-rainbox.no-rain .fh-dry { display: block; }
.fh-chart { height: 130px; }
.fh-strip {
  list-style: none; margin: 8px 0 0; padding: 2px 0 6px; display: flex; gap: 6px;
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin;
}
.fh-hour {
  flex: none; width: 70px; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  padding: 8px 4px; border-radius: 10px; background: color-mix(in srgb, var(--grid) 35%, transparent);
  font-size: 12px; color: var(--text-2);
}
.fh-hour.now { background: color-mix(in srgb, var(--sun) 14%, transparent); }
.fh-hour.past { opacity: .55; }
.fh-hour .wx { width: 32px; height: 32px; }
.fh-h { font-weight: 600; color: var(--text); }
.fh-t { font-size: 16px; color: var(--text); }
.fh-r { color: var(--rain); font-weight: 600; display: flex; flex-direction: column; line-height: 1.25; }
.fh-r.dry { color: var(--text-3); font-weight: 400; }
.fh-r small, .fh-w small { font-weight: 400; font-size: 11px; }
.fh-w { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 3px; }
.fh-w small { width: 100%; color: var(--text-3); }
.fh-w svg { width: 10px; height: 10px; fill: var(--text-2); }
.fh-hu { color: var(--text-3); }
.fh-legend { margin: 4px 0 0; font-size: 11px; color: var(--text-3); }
.wx .i-moon { fill: var(--cloud); }
.fc-when { display: flex; flex-direction: column; line-height: 1.2; }
.fc-when b { font-size: 14px; }
.fc-when span { font-size: 12px; color: var(--text-3); }
.wx { width: 46px; height: 46px; }
.wx .i-cloud { fill: var(--cloud); }
.wx .i-sun circle { fill: var(--sun); }
.wx .i-sun line { stroke: var(--sun); stroke-width: 2.4; stroke-linecap: round; }
.wx .i-rain line, .wx .i-fog line { stroke-width: 2.4; stroke-linecap: round; }
.wx .i-rain line { stroke: var(--rain); }
.wx .i-rain circle { fill: var(--rain); }
.wx .i-fog line { stroke: var(--cloud); }
.wx .i-snow circle { fill: none; stroke: var(--rain); stroke-width: 1.6; }
.wx .i-bolt { fill: var(--sun); }
.fc-desc { font-size: 12px; color: var(--text-2); min-height: 2.6em; line-height: 1.3; }
.fc-temp { display: flex; gap: 8px; align-items: baseline; }
.fc-temp b { font-size: 18px; }
.fc-temp span { color: var(--text-3); font-size: 15px; }
.fc-bar { position: relative; width: 100%; max-width: 110px; height: 4px; border-radius: 2px; background: var(--grid); }
.fc-bar i { position: absolute; top: 0; bottom: 0; border-radius: 2px; background: linear-gradient(90deg, var(--wind), var(--temp)); }
.fc-rain { font-size: 12px; color: var(--rain); font-weight: 600; }
.fc-rain.dry { color: var(--text-3); font-weight: 400; }
.fc-wind { font-size: 12px; color: var(--text-2); display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 4px; }
.fc-wind svg { width: 11px; height: 11px; fill: var(--text-2); }
.fc-wind span { color: var(--text-3); width: 100%; }

.fc-rain .pp::before { content: " · "; }
.fc-when .short { display: none; }

@media (max-width: 860px) {
  .fc { grid-template-columns: 1fr; gap: 4px; }
  .fc-day {
    display: grid; align-items: center; text-align: left; gap: 0 10px; padding: 8px 10px;
    grid-template-columns: 54px 36px minmax(0, 1fr) auto;
    grid-template-areas: "when icon rain temp" "when icon rain wind";
  }
  .fc-when { grid-area: when; }
  .fc-when .long { display: none; }
  .fc-when .short { display: inline; }
  .wx { grid-area: icon; width: 36px; height: 36px; }
  .fc-desc, .fc-bar { display: none; }
  .fc-temp { grid-area: temp; justify-content: flex-end; }
  .fc-rain { grid-area: rain; display: flex; flex-direction: column; line-height: 1.25; white-space: nowrap; }
  .fc-rain .pp::before { content: ""; }
  .fc-wind { grid-area: wind; justify-content: flex-end; }
  .fc-wind span { width: auto; }
  .fc-sun { margin-left: 0; width: 100%; }
}

.map-card { min-width: 0; }
.map-card > header { min-height: 30px; align-items: center; }
.map { position: relative; height: 380px; margin-top: 10px; border-radius: 10px; overflow: hidden; background: var(--grid); z-index: 0; }
@media (max-width: 600px) { .map { height: 300px; } }
.map-msg { position: absolute; inset: auto 12px 12px; z-index: 1000; margin: 0; padding: 6px 10px; border-radius: 8px; background: var(--surface); font-size: 13px; }
.leaflet-container { font: 12px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--grid); }
.leaflet-control-attribution { font-size: 10px; }

.player { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.player[hidden] { display: none; }   /* carte Windy : lecteur intégré à la carte */
.pl-btn {
  flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer;
}
.pl-btn svg { width: 14px; height: 14px; fill: currentColor; }
.pl-btn .pl-pause { display: none; }
.pl-btn.on .pl-pause { display: inline; }
.pl-btn.on .pl-play { display: none; }
.pl-btn:focus-visible, .pl-range:focus-visible, .seg button:focus-visible { outline: 2px solid var(--wind); outline-offset: 2px; }
.pl-range { flex: 1; min-width: 0; accent-color: var(--c, var(--wind)); }
.pl-time { flex: none; min-width: 5.5ch; text-align: right; font-weight: 600; font-size: 14px; }

.seg { margin-left: auto; display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; border: 1px solid var(--border); }
.seg:empty { display: none; }
.seg button { font: inherit; font-size: 12px; border: 0; background: none; color: var(--text-2); padding: 3px 8px; border-radius: 6px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); font-weight: 600; }

.map iframe.windy { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Pages de détail : périodes empilées */
.period { margin-top: 28px; }
.period:first-child { margin-top: 16px; }
.period-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.period:first-child .period-head { border-top: 0; padding-top: 0; }
.period-head h3 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
.period .p-range { color: var(--text-3); font-size: 13px; }
.period .p-msg { margin: 0 0 12px; }
.card.big h4 { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.detail .chart-big { height: 280px; }
@media (max-width: 600px) { .detail .chart-big { height: 220px; } }
.aux-sep { margin: 0 8px; color: var(--text-3); }

/* ---------- Direction du vent : rose et nuage de points ---------- */
:root { --ws1: #b7d3f4; --ws2: #6fa6e6; --ws3: #2a78d6; --ws4: #184d93; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ws1: #1e3d63; --ws2: #2c62a6; --ws3: #3987e5; --ws4: #93c0f5; } }
:root[data-theme="dark"] { --ws1: #1e3d63; --ws2: #2c62a6; --ws3: #3987e5; --ws4: #93c0f5; }


.rose-row { display: flex; align-items: center; gap: 14px; margin: 10px 0 8px; padding-top: 10px; border-top: 1px solid var(--grid); }
.rose { flex: none; width: 190px; height: 190px; display: block; overflow: visible; }
.rose-legend { list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; }
.rose-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.rose-legend .note { margin-top: 4px; font-size: 11px; color: var(--text-3); max-width: 14ch; }
.rose .ring { fill: none; stroke: var(--grid); stroke-width: 1; }
.rose .axis { stroke: var(--grid); stroke-width: 1; }
.rose .rl { font-size: 8px; fill: var(--text-3); text-anchor: start; }
.rose .card-l { font-size: 11px; font-weight: 600; fill: var(--text-2); text-anchor: middle; dominant-baseline: middle; }
.rose .wedge { stroke: var(--surface); stroke-width: 1; }
.rose .hit { fill: transparent; }
.rose .hit:hover { fill: color-mix(in srgb, var(--text) 8%, transparent); }
.rose .calm { fill: var(--surface); stroke: var(--grid); }
.mini-label { font-size: 11px; color: var(--text-3); margin-bottom: 2px; }

@media (max-width: 400px) { .rose { width: 170px; height: 170px; } .rose-row { gap: 10px; } }

/* ---------- Tableau de bord : panneau développé (valeurs à gauche, graphique à droite) ---------- */
.grid > .card { flex-direction: row; gap: 28px; align-items: stretch; }
.card-main { flex: 0 0 330px; min-width: 0; display: flex; flex-direction: column; }
.card-side { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.card-side .chart { height: 184px; margin-top: 0; }   /* graphiques des panneaux (mobile : 150 px) */
.card-main .ext { margin-bottom: 0; }
.card-main .rose-row { border-top: 0; padding-top: 0; margin-bottom: 0; }
@media (max-width: 760px) {
  .grid > .card { flex-direction: column; gap: 0; }
  .card-main { flex: none; }
  .card-side { margin-top: 8px; }
  .card-side .chart { height: 150px; }
  .card-main .rose-row { border-top: 1px solid var(--grid); padding-top: 10px; margin-bottom: 8px; }
}

/* ---------- Panneaux réduits (sans graphique) ---------- */
.grid > .card { grid-column: 1 / -1; order: 0; }
/* panneaux développés en tête (pleine largeur) ; les panneaux réduits sont regroupés
   en dessous, en tuiles côte à côte */
.grid > .card.compact { grid-column: auto; order: 1; flex-direction: column; gap: 0; }
.card.compact .card-side, .card.compact .rose-row { display: none; }
.card.compact .card-main { flex: 1 1 auto; }
.card.compact .val { font-size: 38px; }
.card.compact .ext { gap: 4px 16px; }

.card-main > header { position: relative; padding-right: 34px; }
.size-btn {
  position: absolute; top: -4px; right: -4px; width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid transparent; background: none; color: var(--text-3); cursor: pointer;
  display: grid; place-items: center;
}
.size-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.size-btn:hover { border-color: var(--border); color: var(--text); background: var(--surface); }
.size-btn:focus-visible, .grid-tools button:focus-visible { outline: 2px solid var(--wind); outline-offset: 2px; }
/* panneau développé : le bouton se place en haut à droite de la carte entière */
.grid > .card:not(.compact) { position: relative; }
.grid > .card:not(.compact) .card-main > header { position: static; }
.grid > .card:not(.compact) .size-btn { top: 10px; right: 10px; z-index: 2; }
.grid > .card:not(.compact) .card-side { padding-top: 24px; }

.grid-tools { max-width: 1280px; margin: 0 auto; padding: 0 16px 8px; display: flex; justify-content: flex-end; gap: 6px; }
.grid-tools button {
  font: inherit; font-size: 12px; color: var(--text-2); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; cursor: pointer;
}
.grid-tools button:hover { color: var(--text); }

/* ---------- Ce jour et ce mois au fil des ans ---------- */
.climate { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.climate[hidden] { display: none; }
@media (max-width: 420px) { .climate { grid-template-columns: 1fr; } }
.cl-card h2 { font-size: 20px; color: var(--text); }
.cl-card h2::before { display: none; }
.cl-since { margin: 2px 0 8px; font-size: 12px; color: var(--text-3); }
.cl-text { font-size: 14px; line-height: 1.5; color: var(--text-2); }
.cl-text p { margin: 0; }
.cl-text b { color: var(--text); font-weight: 600; }
.cl-group { margin-bottom: 10px; }
.cl-now { color: var(--text-2); }
.cl-now.cl-record { background: color-mix(in srgb, var(--wind) 14%, transparent); border-radius: 6px; padding: 4px 8px; margin: 4px 0; color: var(--text); }
.cl-badge { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--wind); margin-left: 4px; }
.cl-h { margin: 16px 0 6px; font-size: 16px; font-weight: 600; }
.cl-chart { height: 260px; margin-top: 0; }
.cl-chart-rain { height: 180px; }
.legend i.midmark { width: 10px; height: 2px; background: var(--text); vertical-align: 3px; }

/* ---------- Menus déroulants (« Données », « Climatologie », « Prévisions ») ---------- */
.dd { position: relative; }
.dd-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px 6px 12px; border-radius: 999px;
  font: inherit; font-size: 14px; color: var(--text-2); background: none; border: 1px solid transparent; cursor: pointer;
}
.dd-btn:hover, .dd-btn[aria-expanded="true"] { background: var(--surface); border-color: var(--border); color: var(--text); }
.dd-btn.active { background: var(--text); color: var(--bg); font-weight: 600; }
.dd-btn .dd-cur { font-weight: 400; }
.dd-btn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.dd-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.dd-list {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 210px; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
  max-height: min(75vh, 640px); overflow-y: auto;
}
.dd-list a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 14px; border: 0; }
.dd-list a:hover, .dd-list a:focus-visible { background: color-mix(in srgb, var(--grid) 60%, transparent); color: var(--text); outline: none; }
.dd-list a[aria-current="page"] { background: none; color: var(--text); font-weight: 600; }
.dd-list a[aria-current="page"]::after { content: " ✓"; color: var(--text-3); font-weight: 400; }

/* ---------- Panneau groupé (plusieurs mesures, ex. particules PM1 / PM2.5 / PM10) ---------- */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.gtab { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.gtab thead th { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); text-align: left; padding: 0 8px 4px 0; }
.gtab tbody th { text-align: left; font-weight: 500; color: var(--text-2); white-space: nowrap; padding: 6px 10px 6px 0; border-top: 1px solid var(--grid); }
.gtab td { padding: 6px 8px 6px 0; vertical-align: baseline; border-top: 1px solid var(--grid); white-space: nowrap; }
.gtab td b { font-weight: 600; font-size: 15px; color: var(--text); }
.gtab td.gnow b { font-size: 22px; font-weight: 650; }
.gtab td small { display: block; font-size: 11px; color: var(--text-3); }
.gtab td.gnow small { display: inline; margin-left: 4px; font-size: 12px; }
.gtab .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.card.compact .gtab td.gnow b { font-size: 20px; }
.stats.stats-group { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 16px 6px; overflow-x: auto; }
.gstats { margin-top: 0; }
.gstats td b { font-size: 18px; }
.gstats td small.u { display: inline; margin-left: 3px; }
.legend .lg-note { color: var(--text-3); }
@media (max-width: 520px) {
  .gstats td { white-space: normal; padding-right: 6px; }
  .gstats td b { font-size: 16px; }
  .gstats td small.u { display: none; }
}
.legend i.tgrad { width: 18px; }
/* courbes de température d'un panneau groupé : pastille au motif du trait */
.gtab i.sw.tgrad { width: 14px; height: 3px; border-radius: 2px; vertical-align: 3px; }
i.tgrad.ln-1 { -webkit-mask: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 8px); mask: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 8px); }
i.tgrad.ln-2 { -webkit-mask: repeating-linear-gradient(90deg, #000 0 2px, transparent 2px 5px); mask: repeating-linear-gradient(90deg, #000 0 2px, transparent 2px 5px); }
.dd-sep { height: 1px; margin: 6px 4px; background: var(--border); }

/* ---------- Page « Extrêmes » ---------- */
.x-records { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.x-records .t-val b { font-size: 24px; }
.x-h { margin: 26px 0 10px; font-size: 18px; font-weight: 650; }
.x-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); align-items: start; }
.x-card { padding-bottom: 8px; }
.x-card h3 { margin: 0; font-size: 16px; font-weight: 650; }
.x-card.wide2 { grid-column: span 2; }
@media (max-width: 640px) { .x-card.wide2 { grid-column: auto; } }
.x-sub { margin: 2px 0 0; font-size: 12px; color: var(--text-3); }
.x-scroll { overflow-x: auto; margin-top: 8px; }
.xtab { width: 100%; border-collapse: collapse; font-size: 13px; }
.xtab thead th { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); text-align: left; padding: 0 8px 6px 0; border-bottom: 1px solid var(--border); vertical-align: bottom; }
.xtab td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--grid); white-space: nowrap; vertical-align: baseline; color: var(--text-2); }
.xtab tbody tr:last-child td { border-bottom: 0; }
.xtab td b { color: var(--text); font-weight: 600; font-size: 14px; }
.xtab td small { margin-left: 6px; font-size: 11px; color: var(--text-3); }
.xtab td.rk { width: 1.8em; color: var(--text-3); font-size: 11px; }
.xtab tbody tr:first-child td b { font-size: 15px; }
.x-note { margin: 18px 0 0; font-size: 12px; color: var(--text-3); line-height: 1.5; }

/* ---------- Soleil et Lune ---------- */
:root { --moon: #6b7a99; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --moon: #a9b7d6; } }
:root[data-theme="dark"] { --moon: #a9b7d6; }
.astro { display: flex; gap: 28px; align-items: stretch; margin-top: 8px; }
.astro-info { flex: 0 0 330px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.astro-side { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.astro-chart { height: 220px; margin-top: 0; }
.astro-col h3 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.as-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.as-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 13px; margin: 3px 0; }
.as-row b { font-size: 17px; font-weight: 650; margin-right: 10px; }
.as-k { color: var(--text-3); font-size: 12px; }
.as-sub { color: var(--text-3); font-size: 12px; gap: 2px 14px; }
.as-note { margin: 2px 0; font-size: 12px; color: var(--text-3); }
.as-up { color: var(--ok); }
.as-down { color: var(--text-2); }
.as-phase { align-items: center; gap: 10px; line-height: 1.3; }
.as-phase b { font-size: 14px; margin: 0; }
.moon-icon { width: 34px; height: 34px; flex: none; }
.moon-dark { fill: #3b4357; }
.moon-lit { fill: #f4e6a8; }
@media (max-width: 760px) {
  .astro { flex-direction: column; gap: 12px; }
  .astro-info { flex: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .astro-chart { height: 180px; }
}
.astro-side[hidden] { display: none; }

/* ---------- Menu « Données » : intitulés de groupes ---------- */
.dd-head { padding: 6px 10px 2px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }

/* ---------- Pages par période (tous les paramètres) ---------- */
.p-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 18px; }
.p-jump a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px;
  color: var(--text-2); text-decoration: none; background: var(--surface); border: 1px solid var(--border); }
.p-jump a:hover { color: var(--text); border-color: var(--text-3); }
.p-jump i { width: 8px; height: 8px; border-radius: 2px; }
.by-period .period-head .p-range { display: none; }
.by-period .period-head h3 { display: flex; align-items: center; gap: 8px; }
.by-period .period-head h3 .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.by-period .period-head h3 a { color: inherit; text-decoration: none; }
.by-period .period-head h3 a:hover { text-decoration: underline; }
.by-period .period { scroll-margin-top: 12px; }

/* ---------- Pages « jour » (archive/day-AAAA-MM-JJ.html) ---------- */
.day-nav { max-width: 1280px; margin: 4px auto 0; padding: 0 16px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.day-title { margin: 0; font-size: 22px; font-weight: 650; text-align: center; }
.day-title::first-letter { text-transform: uppercase; }
.day-prev, .day-next { font-size: 14px; color: var(--text-2); text-decoration: none; }
.day-next { justify-self: end; }
.day-prev:hover, .day-next:hover { color: var(--text); text-decoration: underline; }
.day-note { max-width: 1280px; margin: 6px auto 8px; padding: 0 16px; font-size: 12px; color: var(--text-3); text-align: center; }
@media (max-width: 520px) { .day-title { font-size: 17px; } }

/* ---------- Pages d'archives : sélecteur de date ---------- */
.arch-bar { max-width: 1280px; margin: 6px auto 4px; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.arch-bar label { font-size: 14px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; }
.arch-bar input[type="date"] { font: inherit; font-size: 15px; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); color-scheme: light dark; }
.arch-bar input[type="date"]:focus-visible { outline: 2px solid var(--wind); outline-offset: 1px; }
.arch-see { color: var(--text-2); font-size: 14px; }
.arch-bar button { font: inherit; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 6px 14px;
  border-radius: 8px; border: 1px solid var(--hum); background: var(--surface); color: var(--hum); cursor: pointer; }
.arch-bar button:hover { background: color-mix(in srgb, var(--hum) 10%, var(--surface)); }
.arch-bar button[aria-current="page"] { background: var(--hum); color: var(--surface); }
.arch-bar button:focus-visible { outline: 2px solid var(--wind); outline-offset: 2px; }
.arch-msg { font-size: 13px; color: var(--bad); }
/* calendrier dans la langue du site (archive.js) */
.ap { position: relative; display: inline-block; }
.arch-bar .ap-btn { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; letter-spacing: 0;
  text-transform: none; padding: 5px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.arch-bar .ap-btn:hover { background: color-mix(in srgb, var(--hum) 6%, var(--surface)); }
.ap-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; color: var(--text-3); }
.ap-pop { position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; padding: 10px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); box-shadow: 0 8px 28px rgb(0 0 0 / .18); min-width: 286px; }
.ap-pop[hidden] { display: none; }
.ap-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ap-head select { font: inherit; font-size: 14px; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); color-scheme: light dark; }
.ap-head .ap-month { flex: 1; }
.arch-bar .ap-pop button { font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; border: 0; background: none;
  color: var(--text); border-radius: 6px; padding: 0; }
.arch-bar .ap-nav { width: 30px; height: 30px; font-size: 18px; line-height: 1; color: var(--text-2); }
.arch-bar .ap-pop button:hover:not([disabled]) { background: color-mix(in srgb, var(--hum) 12%, var(--surface)); }
.arch-bar .ap-pop button[disabled] { color: var(--text-3); opacity: .45; cursor: default; }
.ap-grid { border-collapse: collapse; width: 100%; }
.ap-grid th { font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 2px 0 4px; text-align: center; text-transform: capitalize; }
.ap-grid td { padding: 1px; text-align: center; }
.arch-bar .ap-grid button { width: 36px; height: 32px; font-variant-numeric: tabular-nums; }
.arch-bar .ap-grid button.ap-today { box-shadow: inset 0 0 0 1px var(--hum); }
.arch-bar .ap-grid button[aria-pressed="true"] { background: var(--hum); color: var(--surface); font-weight: 650; }
@media (max-width: 520px) { .ap-pop { left: -8px; } }
.arch-page .page-head { display: none; }
.arch-page .p-last:empty { display: none; }

/* ---------- Tableau climatologique mensuel (archive/climato-AAAA-MM.html) ---------- */
.cm-page { max-width: 1280px; margin: 0 auto; padding: 8px 16px 24px; }
.cm-title { margin: 10px 0 2px; font-size: 26px; font-weight: 650; }
.cm-sub { margin: 0 0 12px; color: var(--text-2); font-size: 15px; }
.cm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 14px; }
.cm-bar select { font: inherit; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); }
.cm-bar select:focus-visible, .cm-link:focus-visible, .cm-go:focus-visible { outline: 2px solid var(--wind); outline-offset: 2px; }
.cm-go { font: inherit; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 6px 14px;
  border-radius: 6px; border: 1.5px solid var(--hum); background: transparent; color: var(--hum); cursor: pointer; }
.cm-go:hover { background: color-mix(in srgb, var(--hum) 10%, var(--surface)); }
.cm-link { font-size: 14px; padding: 6px 12px; border-radius: 6px; border: 1.5px solid var(--wind); color: var(--wind);
  text-decoration: none; white-space: nowrap; }
.cm-link:hover { background: color-mix(in srgb, var(--wind) 10%, var(--surface)); }
.cm-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cm-table { border-collapse: collapse; margin: 0 auto; font-size: 15px; white-space: nowrap; background: var(--surface); }
.cm-table th, .cm-table td { padding: 6px 9px; text-align: center; border-bottom: 1px solid var(--grid); }
.cm-table thead th { font-weight: 600; color: var(--text-2); vertical-align: bottom; border-bottom: 0; background: var(--bg); }
.cm-table thead th.cm-grp { color: var(--text); font-weight: 700; border-bottom: 1px solid var(--border); }
.cm-table thead tr:last-child th, .cm-table thead th[rowspan] { border-bottom: 2px solid var(--text); }
.cm-table thead th[rowspan] { color: var(--text); font-weight: 700; }
.cm-table th.cm-sub2 { font-weight: 500; white-space: normal; max-width: 150px; }
.cm-table tbody th { text-align: left; font-weight: 500; background: var(--bg); position: sticky; left: 0; z-index: 1; }
.cm-table td .u { font-size: .86em; }
.cm-table td.cm-rec { font-weight: 800; }
/* valeurs provisoires (journée climatologique pas encore close) : italique + astérisque */
.cm-table td.cm-prov { font-style: italic; }
.cm-p { margin-left: 1px; font-weight: 700; font-style: normal; }
.cm-table tfoot th, .cm-table tfoot td { border-top: 2px solid var(--text); border-bottom: 0; background: color-mix(in oklab, var(--text) 9%, var(--surface));
  font-weight: 600; }
.cm-table tfoot th { position: sticky; left: 0; z-index: 1; text-align: left; }
.cm-day { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; min-width: 3.2em; }
.cm-day svg, .cm-noicon { width: 18px; height: 18px; flex: none; }
.cm-day svg { stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; fill: none; color: var(--text-2); }
a.cm-day:hover svg, a.cm-day:focus-visible svg { color: var(--wind); }
a.cm-day:hover span { text-decoration: underline; }
a.cm-day:focus-visible { outline: 2px solid var(--wind); outline-offset: 2px; border-radius: 3px; }
.cm-note { max-width: 900px; margin: 10px auto 0; font-size: 13px; color: var(--text-3); white-space: normal; }
.arch-links { max-width: 1280px; margin: 2px auto 0; padding: 0 16px; text-align: center; font-size: 14px; }
.arch-links a { color: var(--wind); }
@media (max-width: 520px) {
  .cm-title { font-size: 20px; }
  .cm-table { font-size: 13px; }
  .cm-table th, .cm-table td { padding: 5px 6px; }
}
/* petit écran : page courante non répétée dans les boutons (bouton actif en noir) */
@media (max-width: 520px) { .dd-btn .dd-cur { display: none; } }
/* tableaux climatologiques annuels : les uns sous les autres, centrés */
.cm-tables { display: grid; gap: 28px; }
.cm-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.cm-table th.cm-sub2 small { font-weight: 400; font-size: 12px; color: var(--text-3); }
.cm-year th.cm-sub2 { min-width: 6.5em; }
.cm-table th.cm-sub2 small { display: block; white-space: nowrap; }

/* ---------- Prévisions d'ensemble (ensembles.html) ---------- */
:root { --m1: #2a78d6; --m2: #d03b3b; --m3: #e08a00; --m4: #12a08a; --m5: #7cb31a; --m6: #8a5cd6; --m7: #d6589c; --m8: #6b7a8a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --m1: #4b93f0; --m2: #ff5a5a; --m3: #ffa31a; --m4: #2cc7ad; --m5: #a5d93a; --m6: #a985f5; --m7: #f07ab8; --m8: #9aa9b8; }
}
:root[data-theme="dark"] { --m1: #4b93f0; --m2: #ff5a5a; --m3: #ffa31a; --m4: #2cc7ad; --m5: #a5d93a; --m6: #a985f5; --m7: #f07ab8; --m8: #9aa9b8; }
.en-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin: 4px 0 8px; }
.en-chips, .en-hz { display: flex; flex-wrap: wrap; gap: 6px; }
.en-chip, .en-hz button { font: inherit; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 8px;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; }
.en-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--mc); }
.en-chip span { font-size: 11px; color: var(--text-3); }
.en-chip[aria-pressed="true"] { border-color: var(--mc); color: var(--text); background: color-mix(in srgb, var(--mc) 9%, var(--surface)); }
.en-chip[aria-pressed="false"] { opacity: .55; }
.en-chip[aria-pressed="false"] i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--mc); }
.en-hz button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.en-chip:focus-visible, .en-hz button:focus-visible { outline: 2px solid var(--wind); outline-offset: 2px; }
.en-sum { margin: 0 0 12px; font-size: 13px; color: var(--text-3); }
.en-warn { margin: 0 0 10px; font-size: 13px; color: var(--warn); }
.en-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 860px) { .en-grid { grid-template-columns: minmax(0, 1fr); } }
.en-card { display: flex; flex-direction: column; }
.en-chart { height: 260px; margin-top: 6px; }
.en-chart-rain { height: 190px; }
.en-chart-prob { position: relative; height: 80px; margin-top: 4px; }
.en-chart-prob canvas { display: block; width: 100%; height: 100%; }
.legend i.dot { width: 8px; height: 8px; border-radius: 50%; }
.en-block { margin-top: 14px; }
.en-table { border-collapse: collapse; width: 100%; font-size: 14px; white-space: nowrap; }
.en-table th, .en-table td { padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.en-table thead th { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; border-bottom: 2px solid var(--border); }
.en-table tbody th { text-align: left; font-weight: 600; }
.en-table small { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 400; }
.en-table .en-sq { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 7px; }
.en-table td .en-t { font-weight: 650; font-size: 15px; }
.en-hot { color: var(--bad) !important; }
.en-cold { color: var(--wind) !important; }
.en-cov { display: inline !important; color: var(--warn) !important; font-weight: 600 !important; margin-left: 4px; }
.en-high { color: var(--ok); font-weight: 650; }
.en-mid { color: var(--warn); font-weight: 650; }
.en-low { color: var(--bad); font-weight: 650; }
.en-pbar { display: block; width: 64px; height: 6px; margin: 2px auto 3px; border-radius: 3px; background: var(--grid); overflow: hidden; }
.en-pbar i { display: block; height: 100%; background: var(--rain); }
.en-foot { margin: 14px 0 0; font-size: 12px; color: var(--text-3); }

/* ---------- Météogramme (meteogram.html) ---------- */
.mg-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mg-inner { min-width: 720px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 6px 12px; }
.mg-icons { position: relative; height: 34px; }
.mg-ic { position: absolute; top: 0; transform: translateX(-50%); width: 30px; height: 30px; }
.mg-ic .wx { width: 30px; height: 30px; }
.mg-panel { margin-top: 6px; }
.mg-panel h3 { margin: 6px 0 2px 50px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.mg-tot { font-weight: 400; color: var(--text-3); margin-left: 8px; }
.mg-tot b { color: var(--text); }
.mg-c { position: relative; }
.mg-c canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.mg-panel .legend { margin: 2px 0 0 50px; }
.mg-none { margin: 2px 0 6px 50px; font-size: 13px; }
.legend i.dash { height: 0; border-top: 2px dashed var(--wind); background: none !important; }
.mg-bar { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px 22px; }
.page-head > div { min-width: 0; max-width: 100%; }
.mg-bar:empty { display: none; }
.mg-bar label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.mg-bar select { font: inherit; font-size: 14px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); min-width: 0; max-width: 100%; flex: 0 1 auto; text-overflow: ellipsis; }
.mg-bar select:focus-visible { outline: 2px solid var(--wind); outline-offset: 1px; }
/* prévisions du tableau de bord : choix du modèle */
.fc-select { font: inherit; font-size: 13px; padding: 3px 8px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); min-width: 0; max-width: 100%; align-self: center; }
.fc-select:focus-visible { outline: 2px solid var(--wind); outline-offset: 1px; }
.mg-page .page-head { margin-bottom: 12px; }

/* ---------- Réorganisation du tableau de bord : cadres et panneaux (layout.js) ---------- */
.dash-bar { max-width: 1280px; margin: 0 auto 8px; padding: 0 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.dash-bar .dash-name { font-weight: 650; font-size: 14px; margin-right: auto; }
.dash-bar button { font: inherit; font-size: 13px; padding: 4px 10px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.dash-bar button:hover:not(:disabled) { border-color: var(--text-3); }
.dash-bar button:disabled { opacity: .4; cursor: default; }
.dash-bar button:focus-visible { outline: 2px solid var(--wind); outline-offset: 2px; }
.dash-editing .dash-block { margin: 0 8px 8px; padding: 8px 0 0; border: 2px dashed var(--border); border-radius: 14px; }
.grid-tools #dash-edit[aria-pressed="true"] { color: var(--bg); background: var(--text); border-color: var(--text); }
/* pendant la réorganisation, cadres repliés : seule la barre (nom, flèches) est affichée */
.dash-editing .dash-block > :not(.dash-bar):not(.dash-sub) { display: none !important; }
/* panneaux de mesures (sous-liste du cadre « Mesures de la station ») */
.dash-sub { list-style: none; margin: 0 16px 10px; padding: 0; display: grid; gap: 4px; }
.dash-sub li { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px 8px; padding: 5px 8px 5px 12px;
  border-radius: 9px; background: var(--surface); border: 1px solid var(--border); }
.dash-sub .dash-pname { margin-right: auto; font-size: 14px; color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-sub button { flex: none; font: inherit; font-size: 12px; padding: 3px 9px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); cursor: pointer; }
.dash-sub button:disabled { opacity: .4; cursor: default; }
.dash-sub button:focus-visible { outline: 2px solid var(--wind); outline-offset: 2px; }
@media (max-width: 520px) { .dash-sub .w { display: none; } .dash-sub button { padding: 3px 12px; } }
.dash-editing .dash { max-width: 760px; margin: 0 auto; }
@media (max-width: 520px) { .dash-bar .dash-name { flex: 1 1 100%; } }
/* éléments masqués par le visiteur (layout.js) ; visibles en réorganisation (barre seule) */
.user-hidden { display: none !important; }
.dash-editing .dash-block.user-hidden { display: block !important; opacity: .6; }
.dash-editing .dash-block.user-hidden .dash-name::after, .dash-sub li.is-hidden .dash-pname::after {
  content: var(--wx-hidden-label, " (masqué)"); font-weight: 400; color: var(--text-3); }   /* texte : layout.js */
.dash-sub li.is-hidden { opacity: .6; }
.dash-bar .dash-hide, .dash-sub .dash-hide { min-width: 5.6em; }
.dash-hide[aria-pressed="true"] { background: var(--text) !important; color: var(--bg) !important; border-color: var(--text) !important; }
/* fond de carte sans version sombre (OpenStreetMap, OpenTopoMap) : assombri en thème sombre ;
   seule la première couche (le fond) est filtrée, pas le radar ni le satellite */
.map-dim .leaflet-tile-pane > .leaflet-layer:first-child { filter: invert(1) hue-rotate(180deg) brightness(.82) contrast(.9) saturate(.55); }

/* Page « Réglages → Unités » (units.html) */
.u-card { max-width: 760px; }
.units-page .p-last { margin-left: 0; max-width: 760px; }
.u-list { display: grid; gap: 4px; }
.u-row { display: grid; grid-template-columns: 170px minmax(0, 260px) 1fr; gap: 6px 14px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--grid); }
.u-row label { font-weight: 600; font-size: 14px; }
.u-row select {
  font: inherit; font-size: 14px; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; min-width: 0;
}
.u-row select:focus-visible, .u-tools button:focus-visible { outline: 2px solid var(--wind); outline-offset: 2px; }
.u-ex { color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.u-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }
.u-tools button {
  font: inherit; font-size: 13px; color: var(--text-2); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; cursor: pointer;
}
.u-tools button:hover:not(:disabled) { color: var(--text); }
.u-tools button:disabled { opacity: .5; cursor: default; }
.u-live { color: var(--text-3); font-size: 13px; }
@media (max-width: 640px) {
  .u-row { grid-template-columns: 1fr; }
}

/* Mode admin (nav.js, WXA) : éléments réservés masqués hors mode admin */
html:not(.wx-admin) [data-admin] { display: none !important; }

/* Page « Réglages → Admin » (admin.html) */
.admin-page .p-last { margin-left: 0; max-width: 760px; }
.a-card { max-width: 560px; }
.a-state { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-weight: 600; font-size: 15px; }
.a-state i { width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); flex: none; }
.a-state.on i { background: var(--hum); }
.a-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.a-row label { font-weight: 600; font-size: 14px; }
.a-row input {
  font: inherit; font-size: 14px; color: var(--text); background: var(--bg); min-width: 0; flex: 1 1 200px;
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; max-width: 280px;
}
.a-row input:focus-visible { outline: 2px solid var(--wind); outline-offset: 2px; }
.a-card .u-tools { margin-top: 12px; }
.a-msg { color: var(--text-3); font-size: 13px; }
.a-msg.err { color: var(--text); font-weight: 600; }
.a-list { margin: 10px 0 0; padding-left: 18px; color: var(--text-2); font-size: 14px; }

/* Page « Webcam » (webcam.html) : images et vidéos l'une sous l'autre */
.webcam-page .p-last { margin-left: 0; }
.wc-list { display: grid; gap: 16px; max-width: 1100px; margin-top: 12px; }
.wc-card { margin: 0; display: block; }
.wc-card > header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 10px; }
.wc-card h3 { margin: 0; font-size: 15px; font-weight: 600; }
.wc-time { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.wc-admin { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600;
  vertical-align: 2px; color: var(--text-2); border: 1px solid var(--border); }
.wc-box { position: relative; border-radius: 10px; overflow: hidden; background: var(--grid); }
.wc-link { display: block; }
.wc-media { display: block; width: 100%; height: auto; max-height: 80vh; object-fit: contain; background: #000; }
.wc-media.wc-broken { min-height: 120px; visibility: hidden; }
.wc-err { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0;
  color: var(--text-2); font-size: 14px; }
.wc-err[hidden] { display: none; }
.wc-cap { margin: 8px 0 0; color: var(--text-2); font-size: 13px; }

/* ---------- Vigilance météo (MeteoAlarm) : pastilles du tableau de bord, page vigilance.html ----------
 * couleurs des niveaux : jaune, orange, rouge (conventions MeteoAlarm), identiques en thème sombre */
:root { --wa-1: #2e9b4f; --wa-2: #f9e400; --wa-3: #f7a401; --wa-4: #e71919; }
.wa-l1 { --wa: var(--wa-1); --wa-fg: #fff; }
.wa-l2 { --wa: var(--wa-2); --wa-fg: #2b2300; }
.wa-l3 { --wa: var(--wa-3); --wa-fg: #2b1500; }
.wa-l4 { --wa: var(--wa-4); --wa-fg: #fff; }
.wa-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  max-width: 1280px; margin: 0 auto 10px; padding: 0 16px;
}
.wa-bar[hidden] { display: none; }
.wa-lead { font-size: 13px; font-weight: 600; color: var(--text-2, var(--text)); margin-right: 2px; }
.wa-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 9px;
  border-radius: 999px; background: var(--wa); color: var(--wa-fg);
  font-size: 13px; font-weight: 650; text-decoration: none; line-height: 1.2;
  box-shadow: 0 1px 2px rgb(0 0 0 / .15);
}
.wa-pill:hover, .wa-pill:focus-visible { filter: brightness(1.06); text-decoration: underline; }
.wa-pill:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.wa-ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.wa-root { display: grid; gap: 16px; }
.wa-loc, .wa-legend { --c: var(--warn); }
.wa-loc > header, .wa-legend > header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.wa-loc > header h2, .wa-legend > header h2 { font-size: 18px; margin: 0; }
.wa-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  background: var(--wa); color: var(--wa-fg); font-size: 12.5px; font-weight: 650; white-space: nowrap;
}
.wa-badge .wa-ic { width: 16px; height: 16px; }
/* lieu dans la pastille d'un avertissement (page « Vigilance météo ») : « Vigilance orange · Sciez » */
.wa-place::before { content: "·"; margin: 0 6px 0 1px; opacity: .7; }
.wa-place { font-weight: 600; }
.wa-group { font-size: 14px; margin: 14px 0 8px; color: var(--text-2, var(--text)); text-transform: uppercase; letter-spacing: .04em; }
.wa-card {
  border: 1px solid var(--border); border-left: 6px solid var(--wa); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px; background: color-mix(in srgb, var(--wa) 6%, var(--surface));
}
.wa-card > header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.wa-card h3 { font-size: 16px; margin: 0; }
.wa-card h4 { font-size: 13px; margin: 10px 0 4px; }
.wa-state { margin-left: auto; font-size: 12px; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border); color: var(--text-3); }
.wa-state.on { color: var(--text); border-color: var(--wa); font-weight: 600; }
.wa-period { margin: 8px 0 4px; font-weight: 600; }
.wa-event { margin: 0 0 4px; color: var(--text-3); font-size: 13px; }
.wa-head { margin: 6px 0; font-weight: 600; }
.wa-text { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.wa-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 10px 0 0; font-size: 12.5px; }
.wa-meta div { display: flex; gap: 6px; }
.wa-meta dt { color: var(--text-3); }
.wa-meta dd { margin: 0; }
.wa-link { margin: 8px 0 0; font-size: 13px; }
.wa-legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.wa-legend li .wa-badge { margin-right: 6px; }

/* ---------- Pied de page commun ([[footer]], nav.js) ---------- */
.site-foot {
  max-width: 1280px; margin: 8px auto 0; padding: 14px 16px 28px;
  border-top: 1px solid var(--border); color: var(--text-3); font-size: 12px; line-height: 1.5;
  text-align: center;
}
.site-foot p { margin: 0 0 6px; }
.site-foot a { color: inherit; }
.site-foot .sf-head { color: var(--text-2); font-size: 12.5px; }
.site-foot .sf-disc { max-width: 900px; margin: 10px auto; }
.site-foot .sf-disc h2 { font-size: 12.5px; margin: 0 0 6px; color: var(--text-2); font-weight: 650; }
.site-foot hr { width: 120px; margin: 8px auto; border: 0; border-top: 1px solid var(--border); }
.site-foot .sf-warn { color: var(--text-2); }
.site-foot .sf-tail { margin-top: 10px; }
/* le pied de page propre à chaque page reste au-dessus, sans marge basse */
.foot:has(+ .site-foot) { padding-bottom: 8px; }
