:root {
  --ddc-navy: #0d1b2a;
  --ddc-blue: #2563eb;
  --ddc-green: #16a34a;
  --ddc-bg: #ffffff;
  --ddc-border: #e2e8f0;
  --ddc-border-strong: #cbd5e1;
  --ddc-text: #0d1b2a;
  --ddc-text-soft: #1e293b;
  --ddc-muted: #64748b;
  --ddc-surface: #ffffff;
  --ddc-surface-alt: #f8fafc;
  --ddc-shadow-frame: 0 28px 64px rgba(13, 27, 42, 0.06);
  --ddc-shadow-card: 0 18px 42px rgba(13, 27, 42, 0.05);

  --brand-content-offset: clamp(9.5rem, 12vw, 14rem);
  --brand-content-gap-top: clamp(2rem, 2.8vw, 3rem);
  --brand-blue-100: var(--ddc-navy);
  --brand-blue-70: #475569;
  --brand-blue-40: var(--ddc-border-strong);
  --brand-blue-10: var(--ddc-surface-alt);
  --brand-red-100: var(--ddc-blue);
  --brand-red-10: #ecf3ff;
  --brand-font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --brand-font-display: "Barlow Condensed", sans-serif;
  --brand-border: 1px solid var(--ddc-border);
  --brand-border-strong: 1px solid var(--ddc-border-strong);
  --brand-surface: var(--ddc-surface);
  --brand-surface-soft: var(--ddc-surface-alt);
  --brand-text: var(--ddc-text);
}

/* Typographie éditoriale commune, inspirée du titre du logo DDC. */
h1,
h2 {
  font-family: var(--brand-font-display) !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
  line-height: 1 !important;
  text-transform: none !important;
  color: #111111 !important;
}

.hero__title-meta {
  font-family: var(--brand-font-display);
  font-weight: 500;
  letter-spacing: 0.25px;
  line-height: 1.25;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body,
#climat-extremes-app {
  min-height: 100%;
  background: #ffffff;
}

body,
body.site-body {
  margin: 0;
  min-width: 320px;
  font-family: var(--brand-font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ddc-text);
  background: #ffffff;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
  border-radius: 0;
}

button {
  cursor: pointer;
}

button,
a {
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    color 120ms ease,
    opacity 120ms ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--brand-font-display);
  color: var(--ddc-navy);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-frame {
  width: min(calc(100% - 32px), 1480px);
  margin: 30px auto;
  background: var(--ddc-surface);
  border: 1px solid var(--ddc-border);
  box-shadow: var(--ddc-shadow-frame);
  overflow: clip;
}

.site-container {
  padding-left: 48px;
  padding-right: 48px;
}

.site-header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--ddc-border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 112px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  text-decoration: none;
}

.site-brand-logo {
  display: block;
  flex: 0 0 auto;
}

.site-brand-logo img {
  width: 78px;
  height: auto;
}

.logo-title {
  font-family: var(--brand-font-display);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1;
  color: #111111;
  white-space: nowrap;
}

.site-brand-mark {
  width: 78px;
  height: 78px;
  flex: 0 0 auto;
}

.site-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.site-brand-text strong {
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ddc-navy);
}

.site-brand-text small {
  font-size: 0.86rem;
  color: var(--ddc-muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ddc-text-soft);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--ddc-blue);
}

.site-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--ddc-border);
  background: var(--ddc-surface);
  color: var(--ddc-navy);
}

.app-shell {
  min-height: 100vh;
  padding-top: 2rem;
  padding-bottom: 2rem;
  background: #ffffff;
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: var(--brand-border-strong);
}

.hero__body {
  display: grid;
  gap: 0.9rem;
  width: 100%;
  padding-top: var(--brand-content-gap-top);
}

.hero__head {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0.85rem;
  width: 100%;
}

.hero__title-block {
  min-width: 0;
}

.eyebrow {
  margin: 0;
  color: var(--brand-red-100);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1.hero__title {
  margin: 0.35rem 0 0;
  font-size: clamp(1.65rem, 2.2vw, 2.85rem);
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero__title-meta,
.text-muted {
  margin: 0.35rem 0 0;
  color: var(--ddc-muted);
  font-size: 0.94rem;
}

.hero__status {
  flex-shrink: 0;
  margin: 0;
  padding: 0.5rem 0.9rem;
  border: var(--brand-border-strong);
  background: #ffffff;
  color: var(--ddc-muted);
  font-size: 0.92rem;
}

.hero__status--error {
  color: #b91c1c;
  border-color: #b91c1c;
  background: #fef2f2;
}

/* Climat Extrêmes : carte + timeline */

.climate-app {
  min-height: 100vh;
  padding: 0 48px 2rem;
  background: #ffffff;
}

.climate-hero {
  display: block;
  margin: 0;
  padding: 72px 0 38px;
  border-bottom: 0;
}

.climate-hero .hero__body {
  display: block;
  padding-top: 0;
}

.climate-hero .hero__head {
  display: block;
}

.climate-hero h1.hero__title {
  width: 100%;
  max-width: none;
  margin: 0;
  font-size: clamp(2.95rem, 5.8vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -0.06em;
  text-transform: none;
}

.climate-hero .hero__title-meta {
  max-width: 720px;
  margin: 22px 0 0;
  font-size: clamp(1rem, 1.35vw, 1.14rem);
}

.climate-layout {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  grid-template-areas:
    "player player"
    "map    detail";
}

.climate-layout--with-chart {
  grid-template-areas:
    "player player"
    "map    detail"
    "chart  chart";
}

.climate-layout__player-card {
  grid-area: player;
}

.climate-layout__map-card {
  grid-area: map;
  background: var(--brand-surface);
  border: var(--brand-border);
  box-shadow: var(--ddc-shadow-card);
  padding: 0.75rem;
}

.climate-map-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
}

.climate-map-wrapper:fullscreen,
.climate-map-wrapper.maplibregl-pseudo-fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 0;
  background: #f7f5ee;
}

.climate-map-wrapper:fullscreen .climate-map,
.climate-map-wrapper.maplibregl-pseudo-fullscreen .climate-map {
  min-height: 0;
  border: 0;
}

.climate-map-wrapper:fullscreen .choropleth-legend,
.climate-map-wrapper.maplibregl-pseudo-fullscreen .choropleth-legend {
  padding: 0.65rem 1rem 0.75rem;
  background: #fff;
}

.climate-map {
  width: 100%;
  min-height: 520px;
  background: #f7f5ee;
  border: var(--brand-border);
  flex: 1;
}

/* Légende choroplèthe */
.choropleth-legend {
  padding: 0.5rem 0.25rem 0.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.choropleth-legend__bar {
  height: 10px;
  border-radius: 2px;
  border: 1px solid var(--ddc-border);
}

.choropleth-legend__labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--ddc-muted);
  font-weight: 600;
}

.choropleth-legend__title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-blue-70);
}

.climate-layout__detail-card {
  grid-area: detail;
  background: var(--brand-surface);
  border: var(--brand-border);
  box-shadow: var(--ddc-shadow-card);
  padding: clamp(1.15rem, 2vw, 1.8rem);
}

.climate-layout__timeline-card {
  grid-area: timeline;
  background: var(--brand-surface);
  border: var(--brand-border);
  box-shadow: var(--ddc-shadow-card);
  padding: 1.25rem;
}

.climate-detail--empty {
  color: var(--brand-blue-70);
}

.climate-detail__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--brand-red-100);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.climate-detail--cold_wave .climate-detail__eyebrow {
  color: var(--ddc-blue);
}

.climate-detail__title {
  margin: 0.5rem 0 0.25rem;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  line-height: 1.2;
}

.climate-detail__dates {
  margin: 0 0 0.85rem;
  color: var(--brand-blue-70);
  font-weight: 700;
}

.climate-detail__summary {
  margin: 0 0 1rem;
  line-height: 1.55;
}

.climate-detail__stats {
  display: grid;
  gap: 0.55rem;
  margin: 0 0 1rem;
  padding-top: 0.85rem;
  border-top: var(--brand-border);
}

.climate-detail__stats dt {
  color: var(--brand-blue-70);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.climate-detail__stats dd {
  margin: 0.1rem 0 0;
  color: var(--brand-blue-100);
  font-weight: 700;
}

.climate-detail__source {
  display: inline-block;
  color: var(--brand-red-100);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.climate-detail__source:hover,
.climate-detail__source:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.climate-timeline__track {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0.5rem 0.25rem 0.75rem;
  list-style: none;
  overflow-x: auto;
}

.climate-timeline__item {
  display: grid;
  gap: 0.5rem;
  justify-items: center;
  flex: 0 0 auto;
  width: 7.5rem;
}

.climate-timeline__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.6rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--brand-blue-40);
  background: #ffffff;
  color: var(--brand-blue-100);
  font-size: 0.86rem;
  font-weight: 800;
}

.climate-timeline__chip--heatwave {
  color: #d33b2f;
  border-color: #d33b2f;
}

.climate-timeline__chip--cold_wave {
  color: var(--ddc-blue);
  border-color: var(--ddc-blue);
}

.climate-timeline__chip.is-active {
  color: #ffffff;
  background: currentColor;
}

.climate-timeline__chip.is-active .climate-timeline__chip-year,
.climate-timeline__chip.is-active i {
  color: #ffffff;
}

.climate-timeline__chip--heatwave.is-active {
  background: #d33b2f;
}

.climate-timeline__chip--cold_wave.is-active {
  background: var(--ddc-blue);
}

.climate-timeline__chip-label {
  color: var(--brand-blue-70);
  font-size: 0.76rem;
  line-height: 1.3;
  text-align: center;
}

/* ───── Climate chart ───── */

.climate-layout__chart-card {
  grid-area: chart;
  background: var(--brand-surface);
  border: var(--brand-border);
  box-shadow: var(--ddc-shadow-card);
  padding: 1rem 1.25rem 0.75rem;
}

.climate-chart {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.climate-chart--loading,
.climate-chart--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  border: 1px dashed var(--ddc-border-strong);
  background: var(--ddc-surface-alt);
}

.climate-chart__msg {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ddc-muted);
  font-size: 0.9rem;
}

.climate-chart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.15rem;
}

.climate-chart__station {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ddc-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.climate-chart__legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.climate-chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.climate-chart__legend-swatch {
  display: inline-block;
  width: 22px;
  height: 3px;
  border-radius: 2px;
}

.climate-chart__legend-swatch--dash {
  background: repeating-linear-gradient(
    to right,
    currentColor 0, currentColor 6px,
    transparent 6px, transparent 9px
  );
  height: 2px;
}

.climate-chart__legend-item--tx {
  color: #d33b2f;
}
.climate-chart__legend-item--tx .climate-chart__legend-swatch { background: #d33b2f; }

.climate-chart__legend-item--tn {
  color: #2563eb;
}
.climate-chart__legend-item--tn .climate-chart__legend-swatch { background: #2563eb; }

.climate-chart__legend-item--tntxm {
  color: #7c3aed;
}
.climate-chart__legend-item--tntxm .climate-chart__legend-swatch { background: currentColor; }

.climate-chart__legend-item--rr {
  color: #0ea5e9;
}
.climate-chart__legend-item--rr .climate-chart__legend-swatch { background: #0ea5e9; }

.climate-chart__svg {
  width: 100%;
  display: block;
  overflow: visible;
}

/* ───── Timeline filtres ───── */

.climate-timeline__filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.climate-timeline__filter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--ddc-border-strong);
  background: #ffffff;
  color: var(--brand-blue-70);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}

.climate-timeline__filter:hover {
  border-color: var(--brand-blue-100);
  color: var(--brand-blue-100);
}

.climate-timeline__filter.is-active {
  background: var(--brand-blue-100);
  color: #ffffff;
  border-color: var(--brand-blue-100);
}

.climate-timeline__filter--heatwave.is-active {
  background: #d33b2f;
  border-color: #d33b2f;
}

.climate-timeline__filter--cold_wave.is-active {
  background: var(--ddc-blue);
  border-color: var(--ddc-blue);
}

.climate-timeline__filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.25rem;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.12);
  font-size: 0.72rem;
  font-weight: 800;
}

/* Badge "!" pour les épisodes exceptionnels */
.climate-timeline__chip {
  position: relative;
}

.climate-timeline__chip-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f59e0b;
  color: #ffffff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

/* Séverité via épaisseur de bordure */
.climate-timeline__chip--sev-notable  { border-width: 1px; }
.climate-timeline__chip--sev-major    { border-width: 2px; }
.climate-timeline__chip--sev-exceptional { border-width: 3px; }

@media (max-width: 991.98px) {
  .site-frame {
    width: min(calc(100% - 20px), 1480px);
    margin: 10px auto;
  }

  .site-container {
    padding-right: 24px;
    padding-left: 24px;
  }

  .site-header-inner {
    min-height: 92px;
    flex-wrap: wrap;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .site-nav-toggle {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding-top: 8px;
    border-top: 1px solid var(--ddc-border);
  }

  .site-nav[data-open="true"] {
    display: flex;
  }

  .climate-app {
    padding-right: 24px;
    padding-left: 24px;
  }

  .climate-hero {
    padding-top: 40px;
  }

  .climate-layout,
  .climate-layout--with-chart {
    grid-template-columns: 1fr;
    grid-template-areas:
      "player"
      "map"
      "detail"
      "chart";
  }
}

@media (max-width: 575.98px) {
  body.site-body {
    font-size: 15px;
  }

  .site-header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 10px;
    row-gap: 12px;
  }

  .site-brand {
    width: max-content;
    max-width: 100%;
    gap: 8px;
  }

  .site-nav-toggle {
    align-self: center;
    justify-self: end;
  }

  .site-nav {
    grid-column: 1 / -1;
  }

  .site-container {
    padding-right: 18px;
    padding-left: 18px;
  }

  .climate-app {
    padding-right: 18px;
    padding-left: 18px;
  }

  .site-brand-logo img {
    width: 46px;
  }

  .logo-title {
    font-size: clamp(24px, 7.5vw, 32px);
  }

  .climate-hero h1.hero__title {
    font-size: clamp(2.25rem, 12vw, 3.05rem);
  }
}

/* ═══════════════════════════════════════════════════════════════════
   Climate Player
   ═══════════════════════════════════════════════════════════════════ */
.climate-player {
  background: var(--brand-surface);
  border: var(--brand-border);
  box-shadow: var(--ddc-shadow-card);
  padding: 0.9rem 1.1rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Top bar */
.climate-player__top {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Buttons */
.climate-player__btns {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.climate-player__controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 0 0 auto;
  min-width: 0;
}

.climate-player__date-editor {
  display: block;
  min-width: 0;
}

.climate-player__date-input {
  width: 148px;
  height: 2.4rem;
  min-width: 0;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--brand-border-color, #d1d5db);
  background: #ffffff;
  color: var(--brand-text);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.climate-player__date-input:focus-visible {
  border-color: var(--ddc-blue);
  outline: 2px solid rgba(37, 99, 235, 0.2);
  outline-offset: 1px;
}

.climate-player__continuous-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.4rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--brand-border-color, #d1d5db);
  background: #ffffff;
  color: var(--brand-text-muted, #6b7280);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.climate-player__continuous-toggle:hover,
.climate-player__continuous-toggle:focus-visible {
  border-color: var(--ddc-blue);
  color: var(--ddc-blue);
}

.climate-player__continuous-toggle:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.2);
  outline-offset: 1px;
}

.climate-player__continuous-toggle.has-event-pauses {
  border-color: var(--ddc-blue);
  background: var(--brand-red-10, #ecf3ff);
  color: var(--ddc-blue);
}

.climate-player__continuous-toggle i {
  width: 1em;
  text-align: center;
}

.climate-player__information {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.cp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--brand-border-color, #d1d5db);
  border-radius: 50%;
  background: transparent;
  color: var(--brand-text);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cp-btn:hover { background: var(--brand-surface-hover, #f3f4f6); }

.cp-btn--play {
  width: 2.4rem;
  height: 2.4rem;
  background: var(--brand-text, #1a1a1a);
  color: var(--brand-surface, #fff);
  border-color: var(--brand-text, #1a1a1a);
}
.cp-btn--play:hover { opacity: 0.85; background: var(--brand-text, #1a1a1a); }

/* Températures du jour */
.climate-player__temperature-slot {
  display: flex;
  align-items: baseline;
  flex: 1;
  min-width: 0;
}

.climate-player__stats {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: var(--brand-text-muted, #6b7280);
  white-space: nowrap;
}
.cp-stat-sep { color: var(--brand-border-color, #d1d5db); }
.cp-stat--max { color: #b91c1c; font-weight: 600; }
.cp-stat--min { color: #1d4ed8; font-weight: 600; }
.cp-stat-n { margin-left: 0.4rem; font-size: 0.75rem; }

/* Speed buttons */
.climate-player__speeds {
  display: flex;
  gap: 0.2rem;
  flex-shrink: 0;
}
.cp-speed {
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--brand-border-color, #d1d5db);
  border-radius: 4px;
  background: transparent;
  font-size: 0.75rem;
  font-family: ui-monospace, monospace;
  cursor: pointer;
  color: var(--brand-text-muted, #6b7280);
  transition: background 0.12s, color 0.12s;
}
.cp-speed:hover { background: var(--brand-surface-hover, #f3f4f6); color: var(--brand-text); }
.cp-speed--active {
  background: var(--brand-text, #1a1a1a);
  color: var(--brand-surface, #fff);
  border-color: var(--brand-text, #1a1a1a);
}

/* Track area */
.climate-player__track-area {
  position: relative;
  padding: 1.4rem 0 1.6rem;
  user-select: none;
}

/* Event ticks layer */
.climate-player__ticks {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1.2rem;
  pointer-events: none;
}
.cp-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: 3px;
  height: 10px;
  border: none;
  border-radius: 1px;
  cursor: pointer;
  pointer-events: all;
  opacity: 0.65;
  padding: 0;
  transition: opacity 0.15s, width 0.15s;
}
.cp-tick:hover { opacity: 1; width: 4px; }
.cp-tick--heatwave             { background: #ef4444; }
.cp-tick--cold_wave            { background: #3b82f6; }
.cp-tick--sev1                 { height: 6px; opacity: 0.3; }
.cp-tick--sev2                 { height: 9px; opacity: 0.55; }
.cp-tick--sev3                 { height: 13px; opacity: 0.85; width: 4px; }

/* Scrubber */
.climate-player__scrubber {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 4px;
  margin: 0;
  accent-color: var(--brand-text, #1a1a1a);
  cursor: pointer;
}

/* Year labels */
.climate-player__years {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1.4rem;
}
.cp-year {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.68rem;
  color: var(--brand-text-muted, #9ca3af);
  white-space: nowrap;
  pointer-events: none;
}
.cp-year:first-child { transform: none; }
.cp-year:last-child  { transform: translateX(-100%); }

/* ═══════════════════════════════════════════════════════════════════
   Dept Panel (volet département cliqué)
   ═══════════════════════════════════════════════════════════════════ */
.dept-panel {
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  height: 100%;
}

.dept-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.dept-panel__title-block {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.dept-panel__dept-code {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--brand-text-muted, #6b7280);
  background: var(--brand-surface-alt, #f3f4f6);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.dept-panel__dept-name {
  font-size: 1.15rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dept-panel__close {
  border: none;
  background: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--brand-text-muted, #9ca3af);
  cursor: pointer;
  padding: 0 0.15rem;
  flex-shrink: 0;
}
.dept-panel__close:hover { color: var(--brand-text); }

.dept-panel__date {
  font-size: 0.85rem;
  color: var(--brand-text-muted, #6b7280);
  margin: 0;
}

.dept-panel__estimate {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.55rem 0.7rem;
  border: 1px dashed #94a3b8;
  background: #f8fafc;
  color: #475569;
  font-size: 0.75rem;
  line-height: 1.35;
}

.dept-panel__estimate strong {
  color: #334155;
  font-size: 0.8rem;
}

.dept-panel__avg {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  background: var(--brand-surface-alt, #f3f4f6);
  border-radius: 6px;
  font-size: 0.8rem;
}
.dept-panel__avg-label { color: var(--brand-text-muted); font-size: 0.75rem; }
.dept-panel__avg-vals  { display: flex; gap: 0.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.dept-panel__avg-val--hot  { color: #b91c1c; }
.dept-panel__avg-val--cold { color: #1d4ed8; }

.dept-panel__stations {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow-y: auto;
  flex: 1;
}

/* ── Station card ────────────────────────────────────────────────── */
.station-card {
  border: 1px solid var(--brand-border-color-light, #e5e7eb);
  border-radius: 7px;
  overflow: hidden;
}
.station-card--main {
  border-color: #bfdbfe;
  box-shadow: 0 0 0 1px #bfdbfe;
}

.station-card__header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.65rem;
  background: var(--brand-surface-alt, #f9fafb);
}
.station-card--main .station-card__header { background: #eff6ff; }

.station-card__rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
}

.station-card__nom {
  font-size: 0.82rem;
  font-weight: 600;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-card__alti {
  font-size: 0.72rem;
  color: var(--brand-text-muted);
  flex-shrink: 0;
}

.station-card__mesures {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.45rem 0.65rem;
}

.station-card__pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.2rem;
  padding: 0.2rem 0.5rem;
  border-radius: 99px;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.station-card__pill-label { font-size: 0.68rem; opacity: 0.75; }
.station-card__pill-value { font-weight: 700; }

.station-card__pill--hot  { background: #fee2e2; color: #991b1b; }
.station-card__pill--cold { background: #dbeafe; color: #1e40af; }
.station-card__pill--avg  { background: #f3f4f6; color: #374151; }
.station-card__pill--rain { background: #e0f2fe; color: #0369a1; }
.station-card__pill--wind { background: #f0fdf4; color: #15803d; }

.station-card__no-data {
  font-size: 0.78rem;
  color: var(--brand-text-muted);
  font-style: italic;
  padding: 0.35rem 0.65rem 0.45rem;
  margin: 0;
}

/* ── Popup survol station sur la carte ───────────────────────────── */
.station-popup .maplibregl-popup-content {
  padding: 0.45rem 0.7rem;
  font-size: 0.8rem;
  line-height: 1.45;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.station-popup__nom  { font-weight: 600; }
.station-popup__alti { color: #6b7280; }

.dept-panel__no-data {
  font-size: 0.82rem;
  color: var(--brand-text-muted);
  font-style: italic;
  margin: 0;
}

.dept-panel__source {
  margin-top: auto;
  font-size: 0.72rem;
  color: var(--brand-text-muted, #9ca3af);
  margin-bottom: 0;
}

.dept-panel__loading {
  font-size: 0.82rem;
  color: var(--brand-text-muted);
  margin: 0;
}

/* ── Label de date flottant sur la carte ────────────────────────── */
.climate-map__date-label {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 27, 42, 0.82);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  z-index: 10;
}

.climate-map__fullscreen-story {
  display: none;
}

.climate-map__fullscreen-charts {
  display: none;
}

/* ── Badge événement actif dans le player ───────────────────────── */
.climate-player__event-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  padding: 0.2rem 0.65rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.climate-player__event-badge--empty {
  display: none;
}

.cp-event-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cp-event-dot--heatwave { background: #ef4444; }
.cp-event-dot--cold_wave { background: #3b82f6; }

.cp-event-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Player en mode "événement" : légère teinte de fond */
.climate-player--in-event {
  background: linear-gradient(135deg, rgba(13,27,42,0.03) 0%, rgba(13,27,42,0.06) 100%);
}

@media (max-width: 575.98px) {
  .climate-map-wrapper:fullscreen,
  .climate-map-wrapper.maplibregl-pseudo-fullscreen {
    overflow: hidden;
    background: #f7f5ee;
  }

  .climate-map-wrapper:fullscreen .climate-map,
  .climate-map-wrapper.maplibregl-pseudo-fullscreen .climate-map {
    flex: 1 1 auto;
    height: auto;
  }

  .climate-map-wrapper:fullscreen .climate-map__date-label,
  .climate-map-wrapper.maplibregl-pseudo-fullscreen .climate-map__date-label,
  .climate-map-wrapper:fullscreen .choropleth-legend,
  .climate-map-wrapper.maplibregl-pseudo-fullscreen .choropleth-legend {
    display: none;
  }

  .climate-map-wrapper:fullscreen .climate-map__fullscreen-story,
  .climate-map-wrapper.maplibregl-pseudo-fullscreen .climate-map__fullscreen-story {
    display: flex;
    flex: 0 0 clamp(164px, 23vh, 210px);
    flex-direction: column;
    gap: 0.7rem;
    padding: 1rem 1.25rem max(1.15rem, env(safe-area-inset-bottom));
    border-top: 4px solid #0d1b2a;
    background: #fffdf7;
    color: #111111;
  }

  .climate-map-wrapper:fullscreen .climate-map__fullscreen-charts,
  .climate-map-wrapper.maplibregl-pseudo-fullscreen .climate-map__fullscreen-charts {
    position: absolute;
    right: 0.55rem;
    bottom: calc(clamp(164px, 23vh, 210px) + 0.55rem);
    left: 0.55rem;
    z-index: 12;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.4rem;
    pointer-events: none;
  }

  .video-trend {
    min-width: 0;
    padding: 0.38rem 0.42rem 0.28rem;
    border: 1px solid rgba(255, 255, 255, 0.82);
    background: rgba(255, 253, 247, 0.9);
    box-shadow: 0 3px 14px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(5px);
  }

  .video-trend--cold_wave {
    --trend-primary: #1d4ed8;
    --trend-track: rgba(59, 130, 246, 0.1);
  }

  .video-trend--heatwave {
    --trend-primary: #b91c1c;
    --trend-track: rgba(239, 68, 68, 0.1);
  }

  .video-trend__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    color: var(--trend-primary);
    font-size: 0.62rem;
    line-height: 1;
    text-transform: uppercase;
  }

  .video-trend__header strong {
    font-family: var(--brand-font-display);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
  }

  .video-trend__header > span {
    color: #475569;
    font-size: 0.52rem;
    font-weight: 700;
    white-space: nowrap;
  }

  .video-trend__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    min-height: 0.85rem;
    margin-top: 0.12rem;
    color: var(--trend-primary);
    line-height: 1;
  }

  .video-trend__summary strong {
    font-family: var(--brand-font-display);
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
  }

  .video-trend__summary small {
    font-family: var(--brand-font-body);
    font-size: 0.5rem;
    font-weight: 700;
  }

  .video-trend__summary > span {
    overflow: hidden;
    color: #475569;
    font-size: 0.47rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .video-trend__plot {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 0.12rem;
    overflow: visible;
  }

  .video-trend__grid,
  .video-trend__axis {
    stroke: rgba(71, 85, 105, 0.18);
    stroke-width: 0.7;
  }

  .video-trend__axis {
    stroke: rgba(71, 85, 105, 0.42);
  }

  .video-trend__median {
    stroke: var(--trend-primary);
    stroke-width: 0.75;
    stroke-dasharray: 2 1.5;
    opacity: 0.72;
  }

  .video-trend__median-label {
    fill: var(--trend-primary);
    font-family: var(--brand-font-body);
    font-size: 4.6px;
    font-weight: 700;
    text-anchor: end;
  }

  .video-trend__bar-track {
    fill: var(--trend-track);
  }

  .video-trend__bar {
    fill: var(--trend-primary);
    opacity: 0.58;
    transition: y 140ms linear, height 140ms linear, opacity 140ms ease;
  }

  .video-trend__bar--active {
    opacity: 1;
  }

  .video-trend__year,
  .video-trend__scale {
    fill: #64748b;
    font-family: var(--brand-font-body);
    font-size: 5.6px;
    font-weight: 600;
  }

  .video-trend__year--middle {
    text-anchor: middle;
  }

  .video-trend__year--end,
  .video-trend__median-label {
    text-anchor: end;
  }

  .video-trend__scale {
    fill: var(--trend-primary);
    font-size: 5px;
  }

  .climate-map-wrapper:fullscreen .climate-map__fullscreen-story--heatwave,
  .climate-map-wrapper.maplibregl-pseudo-fullscreen .climate-map__fullscreen-story--heatwave {
    border-top-color: #d33b2f;
  }

  .climate-map-wrapper:fullscreen .climate-map__fullscreen-story--cold_wave,
  .climate-map-wrapper.maplibregl-pseudo-fullscreen .climate-map__fullscreen-story--cold_wave {
    border-top-color: #2563eb;
  }

  .climate-map__fullscreen-story time {
    font-family: var(--brand-font-display);
    font-size: clamp(1.75rem, 8vw, 2.35rem);
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1;
  }

  .climate-map__fullscreen-event {
    min-height: 4.35rem;
  }

  .climate-map__fullscreen-event p {
    margin: 0;
  }

  .climate-map__fullscreen-event-dates {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.3;
  }

  .climate-map__fullscreen-event-summary {
    margin-top: 0.35rem !important;
    color: var(--ddc-muted);
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.35;
  }

  .climate-player__top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 0.75rem;
  }

  .climate-player__btns {
    justify-content: flex-start;
  }

  .climate-player__controls {
    display: grid;
    grid-template-columns: auto 108px 40px;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    width: 100%;
  }

  .climate-player__date-editor {
    justify-self: end;
  }

  .climate-player__continuous-toggle {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    font-size: 0.9rem;
  }

  .climate-player__continuous-toggle span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .climate-player__date-input {
    width: 108px;
    height: 36px;
    padding: 0.15rem 0.25rem;
    font-size: 0.72rem;
  }

  .climate-player__btns .cp-btn {
    width: 30px;
    height: 30px;
  }

  .climate-player__btns .cp-btn--play {
    width: 36px;
    height: 36px;
  }

  .climate-player__information {
    display: grid;
    grid-template-rows: minmax(0, 1fr) 30px;
    gap: 0.35rem;
    width: 100%;
    height: 112px;
    padding: 0.55rem 0.7rem;
    overflow: hidden;
    border: 1px solid var(--ddc-border);
    background: var(--ddc-surface-alt);
  }

  .climate-player__temperature-slot {
    display: flex;
    align-items: center;
    min-width: 0;
  }

  .climate-player__stats {
    min-width: 0;
    max-width: 100%;
    gap: 0.2rem;
    overflow: hidden;
    font-size: 0.78rem;
  }

  .cp-stat-n {
    margin-left: 0.2rem;
    font-size: 0.7rem;
  }

  .climate-player__event-badge,
  .climate-player__event-badge--empty {
    display: flex;
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 30px;
    margin-left: 0;
    background: #ffffff;
  }

  .climate-player__event-badge--empty {
    visibility: hidden;
  }
}

