/* Météo web — composition validée : fond de l’espace, ciel discret, solaire proche. */
#tab-meteo {
  --wx-ink: #f2f1ed; --wx-secondary: #b6b5ad; --wx-quiet: #a19f95;
  --wx-line: #ffffff19; --wx-panel: #181815; --wx-amber: #edc574;
  --wx-blue: #a6c8d9; --wx-track: #36352e; --wx-focus: #f5d799;
  color: var(--wx-ink); font-size: 15px; line-height: 1.5;
  max-width: 1080px; margin: 10px auto 0; width: 100%;
}
:root[data-mode="jour"] #tab-meteo {
  --wx-ink: #262820; --wx-secondary: #55594e; --wx-quiet: #62665b;
  --wx-line: #292e241c; --wx-panel: #eeeee6; --wx-amber: #875d16;
  --wx-blue: #3b667b; --wx-track: #d9d9cd; --wx-focus: #875d16;
}
#wxBody { min-width: 0; }
#wxBody :is(h1, h2, h3, p) { margin: 0; }
#wxBody h2 { font-size: 18px; font-weight: 500; letter-spacing: -.025em; }
#wxBody a { color: inherit; text-underline-offset: 5px; }
#wxBody :is(button, a, summary, input, [tabindex]):focus-visible { outline: 2px solid var(--wx-focus); outline-offset: 4px; }
#wxBody ::selection { color: var(--wx-panel); background: var(--wx-amber); }
#wxBody svg { flex-shrink: 0; }
#wxBody .wi { display: inline-flex; color: var(--wx-blue); }
#wxBody .wi svg { width: 100%; height: 100%; }
#wxBody .wx-note { font-size: 12px; color: var(--wx-quiet); }
.wx-heading h1 { font-size: 30px; line-height: 1.25; }
#wxBody .wx-heading p { font-size: 14px; color: var(--wx-secondary); margin-top: 5px; overflow-wrap: anywhere; }
.wx-overview { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 64px; align-items: center; padding: 28px 0 32px; }
/* Sans installation, pas de carte solaire : la météo du moment prend toute la largeur. */
.wx-overview.seule { grid-template-columns: minmax(0, 1fr); }
.wx-current { position: relative; isolation: isolate; min-width: 0; min-height: 230px; display: flex; flex-direction: column; justify-content: center; }
.wx-sky { position: absolute; z-index: -1; right: -32px; top: -78px; width: 390px; height: 290px; overflow: hidden; pointer-events: none;
  mask-image: linear-gradient(to right, transparent, #000 36%, #000 75%, transparent), linear-gradient(to bottom, transparent, #000 24%, #000 62%, transparent 99%); mask-composite: intersect; }
.wx-clouds { position: absolute; width: 470px; max-width: none; height: auto; top: 5px; right: -55px; opacity: .5; filter: brightness(.75) saturate(.4); animation: wx-cloud 24s ease-in-out infinite alternate; }
.wx-sky.clear .wx-clouds { opacity: .18; }
.wx-sky.unknown { visibility: hidden; }
.wx-sky.rain .wx-clouds { filter: brightness(.55) saturate(.25); }
:root[data-mode="jour"] .wx-clouds { opacity: .5; filter: saturate(.25) brightness(1.12); }
:root[data-mode="jour"] .wx-sky.clear .wx-clouds { opacity: .18; }
:root[data-mode="jour"] .wx-sky.rain .wx-clouds { filter: saturate(.25) brightness(.8); }
.wx-temperature-row { display: flex; align-items: center; gap: 24px; }
.wx-temperature { font-size: 88px; line-height: 1; font-weight: 300; letter-spacing: -.04em; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.wx-conditions { padding-top: 6px; min-width: 0; }
#wxBody .wx-conditions h2 { font-size: 23px; line-height: 1.3; overflow-wrap: anywhere; }
#wxBody .wx-conditions p { margin-top: 6px; font-size: 14px; color: var(--wx-secondary); }
#wxBody .wx-range { margin-top: 14px; font-size: 14px; color: var(--wx-secondary); display: flex; flex-wrap: wrap; gap: 4px 18px; }
.wx-rain-summary { margin-top: 27px; display: flex; align-items: center; gap: 13px; max-width: 400px; text-decoration: none; width: fit-content; min-height: 44px; }
.wx-rain-summary svg { color: var(--wx-blue); width: 21px; height: 24px; }
.wx-rain-summary strong { font-size: 15px; font-weight: 500; display: block; }
.wx-rain-summary small { font-size: 13px; color: var(--wx-secondary); display: block; }
.wx-rain-summary:hover strong { color: var(--wx-blue); }
.wx-solar { position: relative; padding: 10px 0 10px 32px; border-left: 1px solid var(--wx-line); min-width: 0; }
.wx-solar h2 { display: flex; gap: 9px; align-items: center; }
.wx-solar h2 svg { color: var(--wx-amber); width: 21px; height: 21px; }
#wxBody .wx-production { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 9px; margin-top: 13px; font-variant-numeric: tabular-nums; }
.wx-production strong { font-size: 43px; line-height: 1.1; font-weight: 400; letter-spacing: -.035em; color: var(--wx-amber); }
.wx-production span { font-size: 15px; color: var(--wx-secondary); }
#wxBody .wx-outlook { font-size: 14px; margin-top: 8px; color: var(--wx-secondary); }
.wx-solar-graph { margin-top: 16px; width: 100%; height: 68px; display: block; overflow: visible; }
.wx-solar-graph text { font: 12px 'Space Grotesk', system-ui, sans-serif; fill: var(--wx-quiet); }
.wx-solar-graph .wx-curve { fill: none; stroke: var(--wx-amber); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.wx-solar-graph .wx-axis { fill: none; stroke: var(--wx-line); stroke-width: 1; }
#wxBody .wx-solar-source { font-size: 12px; color: var(--wx-quiet); margin-top: 12px; }
#wxBody .wx-solar a { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; font-size: 13px; color: var(--wx-secondary); }
#wxBody .wx-solar a:hover { color: var(--wx-amber); }
.wx-hours { padding: 21px 0 20px; border-block: 1px solid var(--wx-line); }
.wx-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.wx-hour-buttons { display: flex; gap: 8px; flex-shrink: 0; }
.wx-hour-buttons button { border: 0; background: transparent; color: var(--wx-secondary); width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border-radius: 50%; }
.wx-hour-buttons button:hover:not(:disabled) { background: var(--wx-panel); }
.wx-hour-buttons button:disabled { opacity: .3; cursor: default; }
.wx-hour-buttons svg { width: 16px; height: 16px; }
.wx-scroll { overflow: auto; scrollbar-width: thin; scrollbar-color: var(--wx-track) transparent; padding-bottom: 8px; overscroll-behavior-x: contain; }
.wx-hour-list { display: grid; grid-auto-columns: minmax(69px, 1fr); grid-auto-flow: column; gap: 12px; min-width: 100%; width: max-content; }
.wx-hour { text-align: center; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.wx-hour time { font-size: 13px; color: var(--wx-secondary); }
.wx-hour .wi { width: 27px; height: 27px; }
.wx-hour strong { font-weight: 500; font-size: 20px; }
.wx-hour-rain { font-size: 12px; color: var(--wx-quiet); }
.wx-hour:first-child time { color: var(--wx-ink); }
.wx-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px; padding: 25px 0 28px; border-bottom: 1px solid var(--wx-line); }
#wxBody .wx-metric h2 { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--wx-secondary); letter-spacing: 0; font-weight: 400; }
.wx-metric h2 svg { width: 17px; height: 17px; color: var(--wx-quiet); }
#wxBody .wx-metric-value { font-size: 22px; margin-top: 9px; line-height: 1.2; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.wx-metric-value small { font-size: 13px; color: var(--wx-secondary); }
#wxBody .wx-metric .wx-note { margin-top: 5px; }
.wx-days { padding: 26px 0; }
.wx-days .wx-section-head { margin-bottom: 20px; }
.wx-legend { font-size: 12px; color: var(--wx-amber); }
.wx-day-list { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.wx-day { min-width: 0; text-align: center; border-left: 1px solid var(--wx-line); padding: 4px 12px; display: flex; flex-direction: column; align-items: center; }
.wx-day:first-child { border-left: 0; }
.wx-day h3 { font-size: 14px; letter-spacing: 0; font-weight: 400; }
.wx-day .wi { width: 28px; height: 28px; margin: 13px 0 9px; }
.wx-day-range { font-size: 16px; font-variant-numeric: tabular-nums; display: flex; gap: 8px; white-space: nowrap; }
.wx-day-range span { color: var(--wx-quiet); }
.wx-day-solar { font-size: 16px; color: var(--wx-amber); font-variant-numeric: tabular-nums; margin-top: 10px; white-space: nowrap; }
.wx-day-solar small { font-size: 12px; }
.wx-day-rain { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--wx-quiet); margin-top: 4px; }
.wx-day-rain svg { width: 12px; height: 12px; }
.wx-details { border-block: 1px solid var(--wx-line); padding: 16px 0; margin-top: 8px; scroll-margin-top: 20px; }
.wx-details summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 20px; list-style: none; min-height: 44px; }
.wx-details summary::-webkit-details-marker { display: none; }
.wx-details summary strong { font-weight: 500; font-size: 16px; }
.wx-details summary small { display: block; font-size: 12px; color: var(--wx-quiet); margin-top: 3px; }
.wx-details summary svg { width: 20px; height: 20px; color: var(--wx-secondary); transition: transform .2s; }
.wx-details[open] summary svg { transform: rotate(45deg); }
.wx-duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; padding: 24px 0 14px; }
#wxBody .wx-duo h2 { font-size: 16px; }
#wxBody .wx-duo .hint { color: var(--wx-quiet); font-size: 12px; margin-top: 6px; }
#wxBody .wx-source { color: var(--wx-quiet); font-size: 12px; padding-top: 22px; }
.wx-error { padding: 40px 0; max-width: 550px; }
#wxBody .wx-error p { margin: 12px 0 20px; color: var(--wx-secondary); }
#tab-meteo.wx-paused .wx-clouds, #tab-meteo[hidden] .wx-clouds { animation-play-state: paused; }
@keyframes wx-cloud { to { transform: translate3d(9px, -4px, 0); } }

/* Détails AROME et carte : contrôles existants, chargement des tuiles à l’ouverture. */
.nc { min-width: 0; scroll-margin-top: 24px; }
.nc-hd { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 4px 12px; }
.nc-read { margin-left: auto; font-size: 12px; color: var(--wx-secondary); font-variant-numeric: tabular-nums; min-height: 1.2em; }
.nc-text { font-size: 18px; font-weight: 500; margin-top: 12px; line-height: 1.4; }
.nc-bars { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 120px; margin-top: 30px; touch-action: pan-y; cursor: crosshair; }
.nc-bars > div { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.nc-bars > div > i { display: block; width: 100%; min-height: 3px; border-radius: 3px 3px 0 0; background: var(--wx-blue); }
.nc-bars > div.dry > i { background: var(--wx-track); }
.nc-bars > div.past > i { opacity: .35; }
.nc-bars > div.missing { border-bottom: 1px dashed var(--wx-quiet); }
.nc-bars .nc-now, .nc-bars .nc-cur { position: absolute; top: -6px; bottom: 0; width: 0; border-left: 1px solid var(--wx-secondary); height: auto; flex: none; }
.nc-bars .nc-cur { top: 0; border-left: 1px dashed var(--wx-secondary); }
.nc-bars .nc-now span { position: absolute; top: -20px; left: 0; transform: translateX(-50%); font-size: 12px; color: var(--wx-secondary); white-space: nowrap; }
.nc-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--wx-quiet); margin-top: 6px; font-variant-numeric: tabular-nums; }
#wxBody .nc-foot { margin-top: 12px; }
.rad-card { min-width: 0; }
.rmap { position: relative; height: 300px; margin-top: 14px; border-radius: 12px; overflow: hidden; background: #111; --fg-rgb: 255 255 255; }
.rmap .layer { position: absolute; inset: 0; }
.rmap #rBase { filter: brightness(.7); }
.rmap img { position: absolute; user-select: none; -webkit-user-drag: none; }
.rmap .rad img { opacity: 0; transition: opacity 250ms linear; }
.rmap .rad.on img { opacity: .85; }
.rmap .home { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; outline: 4px solid #ffffff40; }
.rmap .ring { position: absolute; border: 1px dashed #ffffff55; border-radius: 50%; pointer-events: none; }
.rmap .ring span { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); font-size: 12px; color: #ddd; background: #111b; }
.rmap .attr { position: absolute; right: 6px; bottom: 4px; font-size: 12px; color: #ddd; background: #111b; padding: 1px 3px; }
.rctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.rctl button { width: 44px; height: 44px; padding: 0; border-radius: 50%; justify-content: center; flex: none; }
.rctl button svg { width: 16px; height: 16px; fill: currentColor; }
.rctl input[type=range] { flex: 1; min-width: 80px; width: 0; height: 44px; padding: 0; border: 0; background: none; accent-color: var(--wx-blue); }
.rctl .when { font-size: 13px; color: var(--wx-secondary); text-align: right; font-variant-numeric: tabular-nums; }
@media (min-width: 1600px) {
  #tab-meteo { margin-top: 18px; }
  .wx-overview { padding-top: 34px; padding-bottom: 38px; gap: 80px; }
  .wx-current { min-height: 250px; }
  .wx-sky { width: 440px; height: 320px; right: -30px; top: -65px; }
  .wx-clouds { width: 500px; }
}
@media (max-width: 1000px) {
  .wx-overview { gap: 32px; }
  .wx-solar { padding-left: 24px; }
  .wx-temperature-row { gap: 16px; }
  .wx-temperature { font-size: 76px; }
  .wx-sky { width: 300px; right: -35px; }
  #wxBody .wx-conditions h2 { font-size: 21px; }
  .wx-metrics { gap: 20px; }
  .wx-day { padding-inline: 6px; }
  .wx-day h3 { font-size: 13px; }
}
@media (max-width: 760px) {
  #tab-meteo { margin-top: 8px; }
  .wx-heading h1 { font-size: 28px; }
  .wx-overview { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 12px 0 26px; }
  .wx-current { min-height: 232px; }
  .wx-temperature { font-size: 80px; }
  .wx-temperature-row { gap: 20px; }
  #wxBody .wx-conditions h2 { font-size: 22px; }
  .wx-sky { width: 300px; height: 240px; right: -14px; top: -35px; }
  .wx-clouds { width: 380px; right: -40px; top: 0; }
  .wx-rain-summary { margin-top: 23px; }
  .wx-solar { border-left: 0; border-top: 1px solid var(--wx-line); padding: 22px 0 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 18px; }
  .wx-solar h2 { grid-column: 1 / -1; }
  .wx-production { grid-column: 1; }
  .wx-production strong { font-size: 36px; }
  .wx-production span { font-size: 13px; }
  #wxBody .wx-outlook { grid-column: 1 / -1; font-size: 13px; }
  .wx-solar-graph { grid-column: 2; grid-row: 2; width: 92px; height: 44px; margin: 10px 0 0; }
  .wx-solar-graph text { display: none; }
  #wxBody .wx-solar-source { grid-column: 1 / -1; margin-top: 8px; }
  .wx-solar a { grid-column: 1 / -1; justify-self: start; }
  .wx-hours { padding: 18px 0 16px; }
  .wx-section-head { margin-bottom: 13px; }
  .wx-hour-list { gap: 9px; grid-auto-columns: minmax(58px, max-content); }
  .wx-hour-buttons button { width: 44px; height: 44px; }
  .wx-metrics { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 23px 0; gap: 23px 24px; }
  .wx-days { padding: 23px 0; }
  .wx-days .wx-section-head { align-items: start; gap: 18px; }
  .wx-legend { text-align: right; max-width: 95px; }
  .wx-day-list { grid-template-columns: minmax(0, 1fr); }
  .wx-day { display: flex; flex-flow: row wrap; gap: 2px 10px; align-items: center; text-align: left; border-left: 0; border-bottom: 1px solid var(--wx-line); padding: 12px 0; }
  .wx-day h3 { flex: 1 0 83px; }
  .wx-day:last-child { border-bottom: 0; }
  .wx-day .wi { width: 24px; height: 24px; margin: 0; flex-shrink: 0; }
  .wx-day-range { font-size: 14px; gap: 7px; justify-content: flex-end; min-width: 72px; }
  .wx-day-solar { margin: 0 0 0 auto; font-size: 15px; text-align: right; min-width: 85px; }
  .wx-day-rain { flex-basis: 100%; margin-top: 0; }
  .wx-duo { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .rmap { height: 280px; }
}
@media (max-width: 370px) {
  .wx-sky { right: -10px; max-width: 100%; }
  .wx-temperature { font-size: 72px; }
  .wx-temperature-row { gap: 16px; }
  #wxBody .wx-production { gap: 6px; }
  .wx-production span { font-size: 12px; }
  .wx-solar { column-gap: 8px; }
  .wx-solar-graph { width: 70px; }
  .wx-day { gap: 2px 8px; }
  .wx-day h3 { flex-basis: 72px; }
  .wx-day-range { min-width: 60px; }
  .wx-day-solar { font-size: 14px; min-width: 72px; }
  .wx-metrics { gap: 22px 14px; }
  #wxBody .wx-conditions h2 { font-size: 20px; }
  #wxBody .wx-conditions p { font-size: 13px; }
  .wx-hour-buttons { gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #wxBody *, #wxBody *::before, #wxBody *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* La production prévue : aux couleurs de l'IA (offre Pro), un cadenas violet sinon. */
.wx-solar.ia .wx-production strong, .wx-day-solar { color: var(--t-ia); }
.wx-solar.ia .wx-solar-graph .wx-curve { stroke: var(--ia); }
.wx-solar .of-lock { margin: 14px 0 12px; }
.wx-day-lock { padding: 6px; min-width: 32px; min-height: 32px; border-radius: 999px; background: none; border-color: color-mix(in srgb, var(--t-ia) 40%, transparent); color: var(--t-ia); justify-content: center; }
.wx-day-lock svg { width: 14px; height: 14px; }
