/* obs.meteothom.com : carte des observations radome. Sombre d'abord, clair selon le système.
   Mise en page B : carte + colonne de lecture ; frise de la journée en bas. */
@font-face { font-family: "Inter"; src: url("polices/inter-variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("polices/jetbrains-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("polices/jetbrains-mono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --s-t: #d95926; --s-td: #199e70; --s-ff: #3987e5; --s-raf: #d55181; --s-rr: #3987e5; --s-u: #199e70; --s-p: #9085e9;
  --grid: rgba(141, 154, 171, .18);
  --sea: #0c1219; --land: #18202a; --dep: #2b3644; --border: #55657a; --coast: #3d4b5c;
  --bg: #0a0f15; --panel: rgba(16, 22, 30, .86); --panel-solid: #111821; --line: #243040;
  --ink: #e7ecf2; --muted: #8d9aab; --accent: #5cc8ff; --accent-ink: #04121c; --chip: #18212c;
  --halo: rgba(6, 10, 15, .9); --dot-edge: rgba(0, 0, 0, .65); --dot: #f3f6fa; --live: #3ddc84;
  --f-ui: "Inter", "Segoe UI", system-ui, sans-serif; --f-num: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --sea: #d6e2ec; --land: #efece5; --dep: #c9c4b8; --border: #6f6a60; --coast: #8e9aa6;
    --bg: #e9edf1; --panel: rgba(255, 255, 255, .9); --panel-solid: #ffffff; --line: #d5dbe2;
    --ink: #18202b; --muted: #5d6877; --accent: #0b6fb8; --accent-ink: #ffffff; --chip: #eef2f6;
    --halo: rgba(255, 255, 255, .92); --dot-edge: rgba(20, 25, 35, .55); --dot: #18202b; --live: #16a34a;
    --s-t: #eb6834; --s-td: #1baf7a; --s-ff: #2a78d6; --s-raf: #e87ba4; --s-rr: #2a78d6; --s-u: #1baf7a; --s-p: #6250d6;
    --grid: rgba(93, 104, 119, .18);
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.4 var(--f-ui); overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
button:focus-visible, input:focus-visible, select:focus-visible, canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app { position: relative; height: 100%; display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-block: 10px;
       padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
       background: var(--panel-solid); border-bottom: 1px solid var(--line); z-index: 3; }
.brand { display: flex; align-items: baseline; gap: 10px; margin-right: auto; }
.brand b { font-weight: 800; font-size: 17px; letter-spacing: .06em; }
.brand span { color: var(--muted); font-size: 12.5px; }
.seg { display: inline-flex; background: var(--chip); border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.seg button { border: 0; background: transparent; padding: 4px 10px; border-radius: 7px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg button:disabled { opacity: .35; cursor: not-allowed; }

.stage { position: relative; min-height: 0; display: grid; grid-template-columns: 290px minmax(0, 1fr) 320px; }
.mapbox { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--sea); }
canvas#map { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
canvas#map.drag { cursor: grabbing; }
.msg { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 3; padding: 7px 12px; border-radius: 9px;
       background: var(--panel-solid); border: 1px solid var(--line); color: var(--muted); font-size: 13px; }

.float { position: absolute; z-index: 2; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
         backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
.legend { right: max(12px, env(safe-area-inset-right, 0px)); bottom: 12px; padding: 9px 11px 8px; width: min(440px, calc(100% - 24px)); }
.legend .row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.legend .row b { font-size: 13px; }
.legend .row span { color: var(--muted); font-size: 12px; }
.bar { display: flex; height: 12px; border-radius: 3px; overflow: hidden; }
.bar i { flex: 1; position: relative; }
.bar i.hit { outline: 2px solid var(--ink); outline-offset: -2px; z-index: 1; }
.ticks { position: relative; height: 15px; margin-top: 3px; font-size: 10.5px; color: var(--muted); }
.ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.note { margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.zoom { top: 12px; right: max(12px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; padding: 3px; }
.zoom button { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font-size: 17px; }
.zoom button:hover { background: var(--chip); }

.tip { position: absolute; z-index: 4; pointer-events: none; min-width: 190px; max-width: min(300px, calc(100% - 16px)); padding: 9px 11px;
       background: var(--panel-solid); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(0, 0, 0, .35); font-size: 12.5px; }
.tip header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.tip header b { min-width: 0; overflow-wrap: anywhere; }
.tip header span { flex: none; white-space: nowrap; }
.tip header b { font-size: 13.5px; }
.tip header span { color: var(--muted); }
.tip dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; margin: 0; align-items: baseline; }
.tip dt { color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.tip dd { margin: 0; text-align: right; white-space: nowrap; }
.tip .sw { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.tip .warn { margin-top: 5px; color: var(--muted); font-size: 11.5px; }

.side { display: flex; flex-direction: column; gap: 16px; padding: 14px 14px 18px; overflow: auto; min-width: 0;
        background: var(--panel-solid); border-left: 1px solid var(--line); }
.side h3 { margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
/* panneau Calques (à gauche ; tiroir en bas sur téléphone) */
.layers { display: flex; flex-direction: column; gap: 16px; padding: 12px 12px 18px; overflow: auto; min-width: 0;
          background: var(--panel-solid); border-right: 1px solid var(--line); }
.grp h3 { margin: 0 0 7px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
          display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.grp h3 small { text-transform: none; letter-spacing: 0; font-weight: 500; text-align: right; }
.fam { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 5px 8px; align-items: start; }
.fam > span { color: var(--muted); font-size: 12px; padding-top: 5px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 3px 10px; cursor: pointer; font-size: 13px; }
.chips button:hover { background: var(--chip); }
.chips button[aria-pressed="true"] { background: var(--chip); border-color: var(--accent); }
.calques { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.calque { display: grid; grid-template-columns: 22px minmax(0, 1fr) 84px; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 8px; }
.calque:hover { background: var(--chip); }
.calque input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.calque label { cursor: pointer; min-width: 0; }
.calque label small { display: block; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.calque input[type=range] { width: 100%; accent-color: var(--accent); margin: 0; }
.calque.off { opacity: .45; }
.calque.off label { cursor: default; }
.vars { display: flex; flex-wrap: wrap; gap: 4px; margin: -1px 0 6px 36px; min-width: 0; }
.vars button { border: 0; background: var(--chip); border-radius: 6px; padding: 3px 8px; cursor: pointer; font-size: 12px; color: var(--muted); }
.vars button[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); }
.vars button:disabled { opacity: .4; cursor: not-allowed; }
.vars select { width: 100%; min-width: 0; background: var(--chip); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; font-size: 12.5px; }
.layers .note { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }
.fab { display: none; }
.legend .part + .part { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); }
.legend .lic { margin-top: 6px; font-size: 11px; color: var(--muted); }
.logos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.logos a { display: inline-flex; background: #fff; border-radius: 4px; padding: 3px 6px; }  /* logos sombres : fond blanc */
.logos img { display: block; height: 22px; width: auto; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div { background: var(--chip); border-radius: 9px; padding: 8px 9px; min-width: 0; }
.stats small { display: block; color: var(--muted); font-size: 11px; }
.stats b { font-size: 16px; }
.altf { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.altf select { background: var(--chip); border: 1px solid var(--line); border-radius: 6px; padding: 1px 4px; }
.rank { display: grid; gap: 1px; }
.rank button { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 8px; align-items: center; text-align: left;
               border: 0; background: transparent; padding: 4px 6px; border-radius: 7px; cursor: pointer; }
.rank button:hover { background: var(--chip); }
.rank i { width: 10px; height: 10px; border-radius: 50%; }
.rank span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank em { font-style: normal; color: var(--muted); font-size: 11.5px; }
.foot { margin: auto 0 0; color: var(--muted); font-size: 11.5px; }

.time { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px 14px; padding-block: 10px;
        padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
        background: var(--panel-solid); border-top: 1px solid var(--line); z-index: 3; }
.day { display: flex; align-items: center; gap: 6px; }
.day button { width: 32px; height: 32px; border: 1px solid var(--line); background: var(--chip); border-radius: 8px; cursor: pointer; }
.day input { background: var(--chip); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }
.when { text-align: right; line-height: 1.25; min-width: 0; }
.when b { font-size: 15px; }
.when small { display: block; color: var(--muted); font-size: 11.5px; }
.track { position: relative; height: 40px; min-width: 0; }
.track canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; touch-action: none; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--live); font-weight: 600; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .live::before { animation: none; } .layers { transition: none; } }

@media (max-width: 980px) {  /* trois colonnes : il faut au moins ~1000 px */
  body { overflow: auto; }
  .app { height: auto; min-height: 100%; grid-template-rows: auto auto auto; }
  .stage { grid-template-columns: minmax(0, 1fr); }
  .mapbox { height: 62vh; }
  .layers { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; max-height: 75vh; border-right: 0;
            border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .45);
            padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
            transform: translateY(105%); transition: transform .25s ease; }
  .layers.open { transform: none; }
  .legend .note, .legend .lic { display: none; }  /* téléphone : légende compacte ; sources dans le pied de colonne */
  .legend .part + .part { margin-top: 5px; padding-top: 5px; }
  .layers::before { content: ""; align-self: center; flex: none; width: 40px; height: 4px; border-radius: 2px; background: var(--line); }
  .fab { display: inline-flex; position: absolute; z-index: 4; left: 10px; top: 10px; align-items: center; gap: 6px;
         padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-solid);
         font-weight: 600; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
  .side { border-left: 0; border-top: 1px solid var(--line);
          padding: 14px max(16px, env(safe-area-inset-right, 0px)) 18px max(16px, env(safe-area-inset-left, 0px)); }
  .legend { left: 8px; right: 8px; bottom: 8px; width: auto; }
  .time { grid-template-columns: 1fr auto; }
  .track { grid-column: 1 / -1; grid-row: 2; }
  .brand span { display: none; }
}

/* ---------------------------------------------------------------- fiche et page de station (assets/station.js)
   Couleurs des courbes validées (contraste, daltonisme) pour chaque thème ; un axe par graphique. */
.side.fiche-on > :not(.fiche) { display: none; }
.stage.fiche-on { grid-template-columns: 290px minmax(0, 1fr) 400px; }
.fiche { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fiche[hidden] { display: none; }
.fh { display: flex; align-items: flex-start; gap: 10px; }
.fh h2 { margin: 0; font-size: 19px; line-height: 1.2; overflow-wrap: anywhere; }
.sub { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.fh .x { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--chip); cursor: pointer; flex: none; }
.slien { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); text-decoration: none; font-weight: 600; font-size: 13px; }
.slien:hover { text-decoration: underline; }
.stiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.stiles6 { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.stile { background: var(--chip); border-radius: 9px; padding: 7px 9px; min-width: 0; }
.stile small { display: block; color: var(--muted); font-size: 11px; }
.stile b { font-size: 16px; }
.stile .u { font-size: 12px; }
.stile em { font-style: normal; color: var(--muted); font-size: 11px; }
.scharts { display: grid; gap: 10px; min-width: 0; }
.scharts2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; }
.schart { min-width: 0; }
.schart h4 { margin: 0 0 2px; font-size: 12px; font-weight: 600; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.schart h4 .titre, .stitre { color: var(--muted); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 10.5px; margin: 0 auto 0 0; }
.stitre { margin: 0; }
.schart h4 .s { display: inline-flex; align-items: center; gap: 5px; }
.schart h4 .s i { width: 10px; height: 3px; border-radius: 2px; }
.schart h4 .s.bar i { height: 9px; width: 8px; border-radius: 2px; }
.schart svg { display: block; width: 100%; height: auto; touch-action: none; }
.schart .vide { color: var(--muted); font-size: 12px; padding: 4px 0; }
.ax { font: 10px var(--f-num); fill: var(--muted); }
.stable { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.stable th { text-align: right; color: var(--muted); font-weight: 600; font-size: 11px; padding: 4px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.stable th:first-child, .stable td:first-child { text-align: left; }
.stable td { text-align: right; padding: 4px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.stable tr.partiel td { color: var(--muted); }
.snote { color: var(--muted); font-size: 11.5px; margin: 0; }
.fiche .stable { font-size: 12px; }
.fiche .stable td, .fiche .stable th { padding: 4px 4px; }

body.page-station { overflow: auto; height: auto; }
.spage { max-width: 1180px; margin: 0 auto; padding-block: 18px 40px; display: grid; gap: 16px;
         padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.stete h1 { margin: 2px 0 0; font-size: 28px; line-height: 1.15; letter-spacing: -.01em; overflow-wrap: anywhere; }
.scarte { background: var(--panel-solid); border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-width: 0; }
.scarte h3 { margin: 0 0 10px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
             display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.scarte h3 > :first-of-type { margin-left: auto; }
.scarte h3 .seg, .scarte h3 .snav, .scarte h3 .sbtn { text-transform: none; letter-spacing: 0; }
.snav { display: inline-flex; align-items: center; gap: 6px; }
.snav button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--chip); cursor: pointer; }
.snav button:disabled { opacity: .35; cursor: not-allowed; }
.snav span { min-width: 170px; text-align: center; color: var(--ink); font-weight: 600; }
.sbtn { border: 1px solid var(--line); background: var(--chip); border-radius: 8px; padding: 5px 11px; cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--ink); }
.sscroll { overflow: auto; max-height: 460px; border-radius: 8px; }
.sscroll thead th { position: sticky; top: 0; background: var(--panel-solid); }
.sscroll-mois { max-height: none; }
@media (max-width: 980px) {
  .stage.fiche-on { grid-template-columns: minmax(0, 1fr); }
  .scharts2 { grid-template-columns: minmax(0, 1fr); }
  .stiles6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stete h1 { font-size: 23px; }
  .snav span { min-width: 0; }
}
