:root {
  --ink: #1d2733;
  --ink-soft: #5b6775;
  --panel: rgba(255, 255, 255, 0.94);
  --line: rgba(29, 39, 51, 0.12);
  --accent: #1f6fd1;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 4px 14px rgba(0, 0, 0, 0.1);
  --gap: 12px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #e9ecef;
}

#map {
  position: absolute;
  inset: 0;
  background: #e9ecef;
}

.radar-canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}

.panel {
  position: absolute;
  z-index: 1000;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

/* ---- En-tête ---- */
.brand {
  top: var(--gap);
  left: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: 0.2px; }
.brand-sub { font-size: 12px; color: var(--ink-soft); }
.back {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
}
.back:hover { background: rgba(0, 0, 0, 0.06); }

.fullscreen { display: none; }

/* ---- Légende ---- */
.legend {
  top: var(--gap);
  right: var(--gap);
  padding: 10px 12px;
  font-size: 12px;
  min-width: 168px;
}
.legend h2 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}
.legend-row { display: flex; align-items: center; gap: 8px; height: 17px; }
.legend-sw { width: 22px; height: 11px; border-radius: 2px; flex: none; }
.legend-mm { width: 46px; text-align: right; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.legend-group {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid var(--line);
  font-weight: 600;
}
.legend-group:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.legend-strip { display: none; }

/* ---- Timeline ---- */
.timeline {
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 2 * var(--gap)));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 8px 10px;
}
.play {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.play:hover { filter: brightness(1.08); }
.play:focus-visible, .timeline input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.play .i-pause, .play.playing .i-play { display: none; }
.play.playing .i-pause { display: block; }

.track { flex: 1; min-width: 0; }
.time-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.time { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rel { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }

.timeline input[type=range] {
  width: 100%;
  margin: 6px 0 2px;
  accent-color: var(--accent);
  cursor: pointer;
}
.ticks { position: relative; height: 14px; font-size: 10px; color: var(--ink-soft); }
.ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }

/* Leaflet : contrôles au même style */
.leaflet-control-zoom.leaflet-bar { border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 10px; overflow: hidden; }
.leaflet-control-attribution { font-size: 10px; }

/* ---- Mobile ---- */
@media (max-width: 600px) {
  .brand { left: 52px; padding: 6px 10px 6px 6px; }
  .brand-sub { display: none; }
  .legend { min-width: 0; padding: 5px 7px; }
  .legend h2, .legend-list { display: none; }
  .legend-strip { display: block; }
  .legend-bar { width: 130px; }
  .timeline { bottom: 22px; padding: 8px 12px 6px 8px; gap: 10px; }
  .time { font-size: 14px; }
}

/* ---- Vue intégrée (iframe) ---- */
.embed .brand,
.embed .leaflet-control-zoom { display: none; }
.embed .fullscreen {
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.embed .fullscreen:hover { background: #fff; }
.embed .leaflet-top.leaflet-left { right: 110px; }
.embed .leaflet-control-attribution { margin: 0; border-radius: 0 0 6px 0; line-height: 1.3; }

/* Légende compacte : simple bande de couleurs */
.embed .legend {
  top: auto;
  right: auto;
  left: 8px;
  bottom: 84px;
  min-width: 0;
  padding: 5px 7px;
}
.embed .legend h2, .embed .legend-list { display: none; }
.embed .legend-strip { display: block; }
.legend-bar { display: flex; height: 8px; border-radius: 2px; overflow: hidden; width: 150px; }
.legend-bar i { flex: 1; }
.legend-ends { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-soft); margin-top: 2px; }

.embed .timeline {
  left: 8px;
  right: 8px;
  bottom: 18px;
  width: auto;
  transform: none;
  padding: 6px 10px 4px 6px;
  gap: 8px;
}
.embed .play { width: 34px; height: 34px; }
.embed .time { font-size: 13px; }
.embed .ticks { display: none; }
