/* ==========================================================================
   Design tokens
   Palette ancrée dans l'esthétique waterfall SDR (GQRX/SDR#) : fond encre
   marine façon écran de spectre, accent "signal" teal et "alerte" ambre
   évoquant un dégradé de spectrogramme, typo technique façon instrument.
   ========================================================================== */
:root {
  --bg-ink: #0B1220;
  --bg-panel: #101A2E;
  --bg-panel-raised: #16223C;
  --grid-line: #1E2A42;
  --border-hairline: #223252;

  --signal-teal: #3FE0C5;
  --signal-teal-dim: #1F7A6B;
  --alert-amber: #F2A93B;
  --alert-amber-dim: #8A5E1E;

  --text-primary: #E8EDF5;
  --text-secondary: #9AA6BC;
  --text-muted: #5E6A82;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --radius: 3px;
  --container-max: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg-ink);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--signal-teal); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--signal-teal);
  outline-offset: 2px;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 18, 32, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-hairline);
}
.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}
.nav-brand .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal-teal);
  box-shadow: 0 0 8px var(--signal-teal);
}
.footer-text .brand-iq { color: var(--alert-amber); }

/* Logo IQLOG en petit dans la barre de nav (remplace le nom texte). */
.nav-brand { padding: 4px 0; }
.nav-logo {
  display: block;
  height: 36px;
  width: auto;
}
@media (max-width: 640px) { .nav-logo { height: 30px; } }
.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-links {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--text-secondary);
}
.nav-links a { color: var(--text-secondary); }
.nav-links a:hover { color: var(--signal-teal); text-decoration: none; }

/* Indicateur d'état de l'API en direct (façon voyant d'instrument) */
.api-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
}
.api-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.3s, box-shadow 0.3s;
}
.api-status.online .api-status-dot {
  background: var(--signal-teal);
  box-shadow: 0 0 8px var(--signal-teal);
  animation: status-pulse 2.4s ease-in-out infinite;
}
.api-status.online .api-status-label { color: var(--signal-teal); }
.api-status.offline .api-status-dot { background: var(--alert-amber); box-shadow: 0 0 8px var(--alert-amber); }
.api-status.offline .api-status-label { color: var(--alert-amber); }
@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@media (max-width: 640px) {
  .api-status-label { display: none; }
  .nav-right { gap: 16px; }
}

/* ==========================================================================
   Hero — le waterfall animé, signature de la page
   ========================================================================== */
.hero {
  position: relative;
  border-bottom: 1px solid var(--border-hairline);
  overflow: hidden;
}
.hero-canvas-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}
#waterfall {
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.55;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11,18,32,0.35) 0%, rgba(11,18,32,0.55) 55%, var(--bg-ink) 100%);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 96px 0 72px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--signal-teal);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.eyebrow::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--signal-teal);
}
h1.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
  max-width: 760px;
}
.hero-title .accent { color: var(--signal-teal); }
.hero-sub {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 0 36px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border-hairline);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn:hover { border-color: var(--signal-teal); text-decoration: none; }
.btn-primary {
  background: var(--signal-teal);
  border-color: var(--signal-teal);
  color: #06201B;
}
.btn-primary:hover { background: #56E8D0; border-color: #56E8D0; }

/* ==========================================================================
   Stats readout bar — lecture façon instrument
   ========================================================================== */
.readout-bar {
  border-bottom: 1px solid var(--border-hairline);
  background: var(--bg-panel);
}
.readout-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-hairline);
}
.readout-cell {
  background: var(--bg-panel);
  padding: 22px 24px;
}
.readout-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.readout-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  color: var(--text-primary);
}
.readout-value .unit {
  font-size: 14px;
  color: var(--text-secondary);
  margin-left: 4px;
}
@media (max-width: 760px) {
  .readout-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   Section shell
   ========================================================================== */
.section {
  padding: 72px 0;
  border-bottom: 1px solid var(--border-hairline);
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 26px;
  margin: 0;
}
.section-note {
  font-size: 14px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ==========================================================================
   Map
   ========================================================================== */
.map-panel {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-panel);
}
#map-canvas {
  height: 460px;
  width: 100%;
  background: var(--bg-panel);
}
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-hairline);
  font-size: 13px;
  color: var(--text-secondary);
}
.map-legend .item { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend-empty { color: var(--text-muted); font-size: 13px; }

/* Filtre interactif de la carte : chips cliquables par famille */
.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-panel-raised);
  border: 1px solid var(--border-hairline);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  line-height: 1;
  transition: border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease, transform 0.12s ease;
}
.legend-chip:hover { border-color: var(--signal-teal); color: var(--text-primary); }
.legend-chip:active { transform: scale(0.96); }
.legend-chip .legend-dot { transition: filter 0.18s ease; box-shadow: 0 0 6px currentColor; }
.legend-chip .chip-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.legend-chip.off { opacity: 0.38; }
.legend-chip.off .legend-dot { filter: grayscale(1) brightness(0.7); box-shadow: none; }
.legend-chip.reset {
  color: var(--signal-teal);
  border-color: var(--signal-teal-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.legend-chip.reset.off { opacity: 0.38; color: var(--text-muted); border-color: var(--border-hairline); }

/* ==========================================================================
   Category grid
   ========================================================================== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--border-hairline);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 48px;
}
.category-card {
  background: var(--bg-panel);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.category-card .icon { color: var(--signal-teal); }
.category-card .icon svg { width: 22px; height: 22px; }
.category-card .name {
  font-size: 14px;
  font-weight: 500;
}
.category-card .count {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--text-primary);
}
.category-card .count .label {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 4px;
}
.category-card.empty .icon,
.category-card.empty .count { color: var(--text-muted); }
.category-card.is-clickable {
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}
.category-card.is-clickable:hover { background: var(--bg-panel-raised); transform: translateY(-2px); }
.category-card.is-clickable:hover .name { color: var(--signal-teal); }
.category-card.is-clickable:focus-visible { outline: 2px solid var(--signal-teal); outline-offset: -2px; }

/* ==========================================================================
   Log (dernières trames) — façon carnet de bord radio
   ========================================================================== */
.log-list {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  overflow: hidden;
}
.log-row {
  display: grid;
  grid-template-columns: 90px 1fr 140px 90px;
  gap: 16px;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--grid-line);
  font-size: 13px;
}
.log-row:last-child { border-bottom: none; }
.log-row:nth-child(odd) { background: var(--bg-panel); }
.log-time { font-family: var(--font-mono); color: var(--text-muted); }
.log-model { color: var(--text-primary); font-weight: 500; }
.log-category { color: var(--text-secondary); font-family: var(--font-mono); font-size: 12px; }
.log-station { color: var(--text-muted); text-align: right; font-family: var(--font-mono); font-size: 12px; }
@media (max-width: 640px) {
  .log-row { grid-template-columns: 70px 1fr; }
  .log-category, .log-station { display: none; }
}

/* ==========================================================================
   Join / how it works
   ========================================================================== */
.join-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 860px) {
  .join-grid { grid-template-columns: 1fr; }
}
.step-card {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--bg-panel);
}
.step-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--signal-teal);
  margin-bottom: 14px;
}
.step-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  margin: 0 0 8px;
}
.step-body {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 16px;
}
.step-card code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--bg-panel-raised);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--signal-teal);
}

/* Panneau technique "brancher un agent / l'app" */
.connect-panel {
  margin-top: 24px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  background: var(--bg-panel);
  padding: 22px 24px;
}
.connect-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--grid-line);
}
.connect-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--signal-teal);
  letter-spacing: 0.02em;
}
.connect-sub { font-size: 12.5px; color: var(--text-muted); }
.connect-sub code { font-family: var(--font-mono); color: var(--text-secondary); }
.connect-grid { margin: 0; }
.connect-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--grid-line);
}
.connect-row:last-child { border-bottom: none; }
.connect-row dt {
  flex: 0 0 160px;
  font-size: 13px;
  color: var(--text-secondary);
}
.connect-row dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
}
.connect-row dd code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--signal-teal);
}
.connect-note {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
.connect-note code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-secondary);
  background: var(--bg-panel-raised);
  padding: 1px 5px;
  border-radius: 3px;
}
@media (max-width: 560px) {
  .connect-row { flex-direction: column; gap: 3px; }
  .connect-row dt { flex-basis: auto; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  padding: 40px 0;
}
.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-text {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.footer-links { display: flex; gap: 20px; font-size: 13px; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--signal-teal); }

/* Leaflet dark tweaks */
.leaflet-container { background: var(--bg-panel) !important; font-family: var(--font-body); }
.leaflet-popup-content-wrapper { background: var(--bg-panel-raised); color: var(--text-primary); border-radius: var(--radius); }
.leaflet-popup-tip { background: var(--bg-panel-raised); }
.leaflet-popup-content { font-size: 13px; font-family: var(--font-mono); margin: 12px 14px; }
.leaflet-popup-content-wrapper { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }

/* Popup carte enrichi : modèle + famille + mesures */
.pp { min-width: 168px; }
.pp-head { display: flex; align-items: center; gap: 7px; font-family: var(--font-display); }
.pp-head strong { font-size: 14px; color: var(--text-primary); }
.pp-dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 6px currentColor; flex: none; }
.pp-cat { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; margin: 3px 0 8px; }
.pp-values { display: flex; flex-direction: column; gap: 3px; }
.pp-row { display: flex; justify-content: space-between; gap: 14px; padding: 2px 0; border-bottom: 1px dashed var(--grid-line); }
.pp-row:last-child { border-bottom: none; }
.pp-k { color: var(--text-secondary); }
.pp-v { color: var(--signal-teal); font-weight: 500; }
.pp-empty { color: var(--text-muted); border-bottom: none; }
.pp-time { margin-top: 8px; font-size: 11px; color: var(--text-muted); }
.log-value { color: var(--signal-teal); font-family: var(--font-mono); font-size: 12px; margin-left: 8px; }

/* ==========================================================================
   ✦ Couche animations / ambiance — tout ce qui rend le site vivant
   ========================================================================== */

/* --- Sélection + scrollbar teintées instrument ------------------------------ */
::selection { background: rgba(63, 224, 197, 0.28); color: #EAFBF6; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-ink); }
::-webkit-scrollbar-thumb { background: #223252; border-radius: 6px; border: 3px solid var(--bg-ink); }
::-webkit-scrollbar-thumb:hover { background: var(--signal-teal-dim); }
html { scrollbar-color: #223252 var(--bg-ink); }

/* --- Overlay CRT : scanlines + vignette + grain léger, fixe, non cliquable -- */
.crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.11) 0px,
      rgba(0, 0, 0, 0.11) 1px,
      transparent 1px,
      transparent 3px
    ),
    radial-gradient(120% 90% at 50% 0%, transparent 55%, rgba(3, 7, 15, 0.55) 100%);
  mix-blend-mode: multiply;
  opacity: 0.55;
}
/* Balayage lumineux vertical qui traverse lentement l'écran */
.scan-sweep {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 42vh;
  z-index: 901;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(63, 224, 197, 0.05) 45%, rgba(63, 224, 197, 0.09) 50%, transparent 100%);
  animation: sweep-down 7.5s linear infinite;
  opacity: 0.7;
}
@keyframes sweep-down {
  0%   { transform: translateY(-50vh); }
  100% { transform: translateY(150vh); }
}

/* --- Nav : soulignement animé + brand qui respire ------------------------- */
.nav-links a { position: relative; padding-bottom: 3px; transition: color 0.2s ease; }
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--signal-teal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.1, 1);
}
.nav-links a:hover::after { transform: scaleX(1); }
.nav-brand .dot { animation: brand-breathe 3s ease-in-out infinite; }
@keyframes brand-breathe {
  0%, 100% { box-shadow: 0 0 6px var(--signal-teal); }
  50%      { box-shadow: 0 0 14px var(--signal-teal), 0 0 22px rgba(63,224,197,0.5); }
}

/* --- Hero : cadre instrument, oscilloscope, tuner, curseur ---------------- */
#waterfall { animation: waterfall-fade-in 1.4s ease both; }
@keyframes waterfall-fade-in { from { opacity: 0; } to { opacity: 0.55; } }

.hero-corner {
  position: absolute;
  width: 26px; height: 26px;
  z-index: 2;
  border: 1px solid rgba(63, 224, 197, 0.45);
  opacity: 0;
  animation: corner-in 0.9s 0.5s ease forwards;
}
.hero-corner.tl { top: 20px; left: 20px; border-right: 0; border-bottom: 0; }
.hero-corner.tr { top: 20px; right: 20px; border-left: 0; border-bottom: 0; }
.hero-corner.bl { bottom: 20px; left: 20px; border-right: 0; border-top: 0; }
.hero-corner.br { bottom: 20px; right: 20px; border-left: 0; border-top: 0; }
@keyframes corner-in { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }

.hero-oscilloscope {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%; height: 90px;
  z-index: 1;
  opacity: 0.9;
  pointer-events: none;
}

/* Révélation en cascade des blocs du hero */
.hero-content > * { opacity: 0; transform: translateY(18px); animation: hero-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.hero-content > .eyebrow      { animation-delay: 0.15s; }
.hero-content > .hero-title   { animation-delay: 0.30s; }
.hero-content > .hero-sub     { animation-delay: 0.48s; }
.hero-content > .hero-tuner   { animation-delay: 0.62s; }
.hero-content > .hero-actions { animation-delay: 0.76s; }
@keyframes hero-rise { to { opacity: 1; transform: none; } }

.rec-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--alert-amber);
  box-shadow: 0 0 8px var(--alert-amber);
  animation: rec-blink 1.3s steps(1) infinite;
}
@keyframes rec-blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.15; } }

.hero-title .accent {
  color: var(--signal-teal);
  background: linear-gradient(90deg, #3FE0C5, #7CF3DE, #3FE0C5);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 26px rgba(63, 224, 197, 0.35);
  animation: accent-shimmer 5s linear infinite;
}
@keyframes accent-shimmer { to { background-position: 200% 0; } }

.type-caret {
  display: inline-block;
  width: 3px; height: 0.95em;
  margin-left: 6px;
  vertical-align: -0.08em;
  background: var(--signal-teal);
  box-shadow: 0 0 8px var(--signal-teal);
  animation: caret-blink 1s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

.hero-tuner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 30px;
  padding: 8px 14px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  background: rgba(16, 26, 46, 0.6);
  backdrop-filter: blur(4px);
  font-family: var(--font-mono);
}
.tuner-label { font-size: 10.5px; letter-spacing: 0.14em; color: var(--text-muted); }
.tuner-freq { font-size: 17px; color: var(--signal-teal); text-shadow: 0 0 10px rgba(63,224,197,0.4); min-width: 84px; }
.tuner-unit { font-size: 12px; color: var(--text-secondary); }
.tuner-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; margin-left: 2px; }
.tuner-bars i {
  width: 3px;
  background: var(--signal-teal);
  border-radius: 1px;
  opacity: 0.85;
  animation: eq-bounce 1.1s ease-in-out infinite;
}
.tuner-bars i:nth-child(1) { height: 40%; animation-delay: 0.0s; }
.tuner-bars i:nth-child(2) { height: 70%; animation-delay: 0.12s; }
.tuner-bars i:nth-child(3) { height: 100%; animation-delay: 0.24s; }
.tuner-bars i:nth-child(4) { height: 55%; animation-delay: 0.36s; }
.tuner-bars i:nth-child(5) { height: 85%; animation-delay: 0.48s; }
.tuner-bars i:nth-child(6) { height: 45%; animation-delay: 0.60s; }
.tuner-bars i:nth-child(7) { height: 65%; animation-delay: 0.72s; }
@keyframes eq-bounce { 0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }

/* --- Boutons : halo + balayage lumineux au survol ------------------------- */
.btn { position: relative; overflow: hidden; transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.2s ease; }
.btn::before {
  content: '';
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s ease;
}
.btn:hover::before { left: 140%; }
.btn:hover { transform: translateY(-1px); }
.btn-primary:hover { box-shadow: 0 6px 24px rgba(63, 224, 197, 0.35), 0 0 0 1px rgba(63,224,197,0.4); }
.btn:not(.btn-primary):hover { box-shadow: 0 0 18px rgba(63, 224, 197, 0.12); }

/* --- Système de révélation au scroll (progressive enhancement) ------------ */
html.has-js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
html.has-js .reveal.is-visible { opacity: 1; transform: none; }

/* --- Readout bar : cellules vivantes -------------------------------------- */
.readout-cell { position: relative; overflow: hidden; transition: background 0.25s ease; }
.readout-cell::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--signal-teal), transparent);
  transform: translateX(-100%);
  opacity: 0;
}
.readout-cell:hover { background: var(--bg-panel-raised); }
.readout-cell:hover::after { animation: cell-scan 1.1s ease; }
@keyframes cell-scan { 0% { transform: translateX(-100%); opacity: 0.9; } 100% { transform: translateX(100%); opacity: 0; } }
.readout-value { transition: text-shadow 0.3s ease; }
.readout-cell:hover .readout-value { text-shadow: 0 0 16px rgba(63, 224, 197, 0.5); color: var(--signal-teal); }
.readout-value.counting { color: var(--signal-teal); }

/* --- Section titres : index mono animé ------------------------------------ */
.section-title { position: relative; display: inline-block; }
.section-title::before {
  content: '';
  position: absolute;
  left: -14px; top: 50%;
  width: 4px; height: 0;
  background: var(--signal-teal);
  box-shadow: 0 0 10px var(--signal-teal);
  transform: translateY(-50%);
  transition: height 0.5s ease 0.1s;
}
.reveal.is-visible .section-title::before,
.section-head.is-visible .section-title::before { height: 70%; }

/* --- Cartes catégories : cascade + halo coloré au survol ------------------ */
.category-card {
  position: relative;
  transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.28s ease;
  cursor: default;
}
.category-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--cat, var(--signal-teal));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s ease;
}
.category-card:not(.empty):hover {
  transform: translateY(-3px);
  background: var(--bg-panel-raised);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--cat, var(--signal-teal));
  z-index: 2;
}
.category-card:not(.empty):hover::before { transform: scaleY(1); }
.category-card .icon { transition: transform 0.3s ease, filter 0.3s ease; }
.category-card:not(.empty):hover .icon { transform: translateY(-2px) scale(1.08); filter: drop-shadow(0 0 8px currentColor); }
.category-card.empty { opacity: 0.5; }

/* --- Journal : lignes qui glissent, ligne « live » ------------------------ */
.log-list { position: relative; }
.log-row {
  transition: background 0.2s ease, transform 0.2s ease;
  animation: row-in 0.5s ease both;
}
@keyframes row-in { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.log-row:hover { background: var(--bg-panel-raised); transform: translateX(3px); }
.log-time { position: relative; }
.log-row.fresh { animation: row-flash 1.6s ease; }
@keyframes row-flash {
  0% { background: rgba(63, 224, 197, 0.18); box-shadow: inset 2px 0 0 var(--signal-teal); }
  100% { background: transparent; box-shadow: inset 2px 0 0 transparent; }
}

/* --- Map panel : coins d'instrument + label scan -------------------------- */
.map-panel { position: relative; }
.map-panel::before,
.map-panel::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 1px solid rgba(63, 224, 197, 0.5);
  z-index: 5;
  pointer-events: none;
}
.map-panel::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.map-panel::after { bottom: 52px; right: 8px; border-left: 0; border-top: 0; }

/* --- Connect panel : liseré animé ----------------------------------------- */
.connect-panel { position: relative; overflow: hidden; }
.connect-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--signal-teal), transparent);
  transform: translateX(-100%);
  animation: border-run 4s linear infinite;
}
@keyframes border-run { to { transform: translateX(100%); } }

/* --- Footer status link glow ---------------------------------------------- */
.footer-links a { transition: color 0.2s ease, text-shadow 0.2s ease; }
.footer-links a:hover { text-shadow: 0 0 10px rgba(63, 224, 197, 0.5); }

/* ==========================================================================
   Recherche façon Shodan — barre + facettes + résultats
   ========================================================================== */
.section-note code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--signal-teal);
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  background: var(--bg-panel);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

/* Autocomplétion : dropdown sous la barre */
.search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 320px;
  overflow-y: auto;
  background: var(--bg-panel-raised);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
}
.search-suggest[hidden] { display: none; }
.sugg-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 13px;
}
.sugg-item:hover, .sugg-item.active { background: var(--bg-panel); }
.sugg-label { color: var(--text-secondary); }
.sugg-item:hover .sugg-label, .sugg-item.active .sugg-label { color: var(--signal-teal); }
.sugg-hint { font-size: 11px; color: var(--text-muted); }
.search-bar:focus-within {
  border-color: var(--signal-teal);
  box-shadow: 0 0 0 1px rgba(63, 224, 197, 0.35), 0 0 22px rgba(63, 224, 197, 0.1);
}
.search-icon { width: 18px; height: 18px; color: var(--text-muted); flex: none; }
.search-bar:focus-within .search-icon { color: var(--signal-teal); }
.search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 8px 4px;
  outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
.search-clear {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  transition: color 0.15s ease;
}
.search-clear:hover { color: var(--alert-amber); }
.search-submit { flex: none; }

.search-hints {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.search-hint {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px dashed var(--border-hairline);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.search-hint:hover { border-color: var(--signal-teal); color: var(--signal-teal); border-style: solid; }

/* --- Facettes ------------------------------------------------------------- */
.search-facets {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 22px;
}
.facet-group { display: flex; align-items: flex-start; gap: 12px; }
.facet-label {
  flex: 0 0 74px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: 6px;
}
.facet-chips { display: flex; flex-wrap: wrap; gap: 7px; flex: 1; }
.facet-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--text-secondary);
  background: var(--bg-panel-raised);
  border: 1px solid var(--border-hairline);
  border-radius: 999px;
  padding: 4px 11px;
  cursor: pointer;
  line-height: 1.4;
  transition: border-color 0.16s ease, color 0.16s ease, transform 0.1s ease;
}
.facet-chip:hover { border-color: var(--signal-teal); color: var(--text-primary); }
.facet-chip:active { transform: scale(0.96); }
.facet-dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 6px currentColor; flex: none; }
.facet-n { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); }
.facet-chip.field { font-family: var(--font-mono); font-size: 12px; }
.facet-chip.field.num { color: var(--signal-teal); border-color: var(--signal-teal-dim); }
.facet-chip.field.num:hover { border-color: var(--signal-teal); }

/* --- Méta + résultats ----------------------------------------------------- */
.search-meta {
  margin: 24px 0 14px;
  font-size: 13px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  min-height: 18px;
}
.search-meta .count { color: var(--signal-teal); font-weight: 500; }
.search-meta .muted { color: var(--text-muted); }
.search-meta .err { color: var(--alert-amber); }

.search-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.sr-card {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  background: var(--bg-panel);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.18s ease, transform 0.14s ease, box-shadow 0.2s ease;
}
/* Badge « N trames » sur une carte de résultat regroupée par objet */
.sr-frames {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--alert-amber);
  border: 1px solid var(--alert-amber-dim);
  border-radius: 999px;
  padding: 1px 7px;
}
.sr-card.pinnable { cursor: pointer; }
.sr-card:hover {
  border-color: var(--signal-teal);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}
.sr-card.pinnable:hover .sr-model { color: var(--signal-teal); }
.sr-card:focus-visible { outline: 2px solid var(--signal-teal); outline-offset: 2px; }
.sr-head { display: flex; align-items: center; gap: 8px; }
.sr-dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 6px currentColor; flex: none; }
.sr-model { font-family: var(--font-display); font-size: 14px; font-weight: 500; color: var(--text-primary); }
.sr-cat { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.sr-time { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.sr-values { display: flex; flex-wrap: wrap; gap: 6px; }
.sr-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: var(--bg-panel-raised);
  border: 1px solid var(--grid-line);
  border-radius: var(--radius);
  padding: 3px 8px;
}
.sr-k { font-size: 11px; color: var(--text-secondary); }
.sr-v { font-family: var(--font-mono); font-size: 12px; color: var(--signal-teal); font-weight: 500; }
.sr-empty { font-size: 12px; color: var(--text-muted); }
.sr-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px dashed var(--grid-line);
}
.sr-foot b { color: var(--text-secondary); font-weight: 500; }
.sr-foot .sep { color: var(--grid-line); }

/* Étiquette de compteur au centre d'un cluster de carte */
.leaflet-tooltip.cluster-label {
  background: transparent;
  border: none;
  box-shadow: none;
  color: #EAFBF6;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}
.leaflet-tooltip.cluster-label::before { display: none; }

.search-more { margin-top: 16px; text-align: center; }
.load-more-btn { font-family: var(--font-mono); font-size: 13px; }
.load-more-btn:disabled { opacity: 0.55; cursor: default; }
.lm-remaining { color: var(--text-muted); font-size: 12px; margin-left: 6px; }

@media (max-width: 560px) {
  .facet-group { flex-direction: column; gap: 6px; }
  .facet-label { padding-top: 0; }
  .search-results { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Historique capteur : bouton + modale + timeline
   ========================================================================== */
.sr-hist, .pp-hist {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--signal-teal);
  background: transparent;
  border: 1px solid var(--signal-teal-dim);
  border-radius: 999px;
  padding: 2px 9px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.sr-hist { margin-left: auto; }
.sr-hist:hover, .pp-hist:hover { border-color: var(--signal-teal); background: rgba(63, 224, 197, 0.1); }
.pp-hist { margin-top: 10px; width: 100%; text-align: center; }

/* Timeline (réutilisée dans la page capteur) */
.hist-count { color: var(--signal-teal); font-weight: 500; }
.hist-row { padding: 12px 0; border-bottom: 1px dashed var(--grid-line); }
.hist-row:last-child { border-bottom: none; }
.hist-when { display: flex; align-items: baseline; gap: 10px; font-family: var(--font-mono); font-size: 12px; color: var(--text-primary); }
.hist-ago { color: var(--text-muted); font-size: 11px; }
.hist-vals { display: flex; flex-wrap: wrap; gap: 6px; margin: 7px 0; }
.hist-chip { background: var(--bg-panel-raised); border: 1px solid var(--grid-line); border-radius: var(--radius); padding: 2px 8px; font-size: 11.5px; color: var(--text-secondary); }
.hist-chip b { color: var(--signal-teal); font-family: var(--font-mono); }
.hist-line { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.hist-empty { padding: 24px 0; text-align: center; color: var(--text-muted); }
.hist-empty.err { color: var(--alert-amber); }

/* ==========================================================================
   Page capteur (route #/sensor/...) : plein écran, graphes + carte + journal
   ========================================================================== */
body.sensor-open { overflow: hidden; }
.sensor-page {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow-y: auto;
  background: var(--bg-ink);
  padding: 28px 0 64px;
}
.sensor-page[hidden] { display: none; }
.sensor-back {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--signal-teal);
  background: transparent;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.sensor-back:hover { border-color: var(--signal-teal); }
.sensor-header { margin: 20px 0 24px; }
.sensor-title { font-family: var(--font-display); font-size: 24px; margin: 0 0 8px; }
.sensor-summary { font-family: var(--font-mono); font-size: 13px; color: var(--text-secondary); }
.sensor-summary .sep { color: var(--grid-line); margin: 0 8px; }
.sensor-cat { text-transform: uppercase; letter-spacing: 0.05em; font-size: 12px; }
.sensor-subtitle { font-family: var(--font-display); font-size: 16px; font-weight: 500; margin: 0 0 14px; }
.sensor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 32px; }
@media (max-width: 860px) { .sensor-grid { grid-template-columns: 1fr; } }
.sensor-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.chart-card { border: 1px solid var(--border-hairline); border-radius: var(--radius); background: var(--bg-panel); padding: 12px 14px; }
.chart-title { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.chart-unit { color: var(--text-muted); }
.chart-box { height: 150px; position: relative; }
.sensor-map-panel { border: 1px solid var(--border-hairline); border-radius: var(--radius); overflow: hidden; background: var(--bg-panel); }
#sensor-map { height: 340px; width: 100%; background: var(--bg-panel); }
.sensor-map-note { padding: 10px 16px; border-top: 1px solid var(--border-hairline); font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.sensor-timeline { border: 1px solid var(--border-hairline); border-radius: var(--radius); padding: 4px 18px; }
.sensor-more { margin-top: 16px; text-align: center; }
.sensor-more:empty { display: none; }

/* Capture IQ dans une ligne de timeline */
.hist-capture { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.iq-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #06201B;
  background: var(--signal-teal);
  border-radius: 3px;
  padding: 1px 6px;
  font-weight: 600;
}
.iq-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.iq-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--signal-teal);
  background: transparent;
  border: 1px solid var(--signal-teal-dim);
  border-radius: 999px;
  padding: 2px 10px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.iq-btn:hover { border-color: var(--signal-teal); background: rgba(63, 224, 197, 0.1); text-decoration: none; }

/* Spectrogramme (overlay) */
.spectro-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(6, 10, 18, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.spectro-overlay[hidden] { display: none; }
.spectro-panel {
  width: min(1000px, 100%);
  background: var(--bg-panel);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  padding: 16px 18px;
}
.spectro-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.spectro-title { font-family: var(--font-mono); font-size: 14px; color: var(--text-primary); }
.spectro-close { background: transparent; border: none; color: var(--text-muted); font-size: 24px; line-height: 1; cursor: pointer; }
.spectro-close:hover { color: var(--alert-amber); }
.spectro-canvas-wrap { border: 1px solid var(--grid-line); border-radius: var(--radius); overflow: hidden; background: var(--bg-ink); }
#spectro-canvas { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.spectro-audio {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
}
.spectro-ctl {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}
.spectro-ctl input[type="range"] { accent-color: var(--signal-teal); }
.spectro-ctl input[type="checkbox"] { accent-color: var(--signal-teal); }
.spectro-audio-hint { font-size: 11px; color: var(--text-muted); }
.spectro-note { margin-top: 10px; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); }

/* --- Respect de prefers-reduced-motion ------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .scan-sweep, .crt-overlay, .accent-shimmer, .tuner-bars i,
  .rec-dot, .type-caret, .connect-panel::before, .nav-brand .dot,
  .hero-content > * { animation: none !important; }
  html.has-js .reveal { opacity: 1 !important; transform: none !important; }
  .hero-content > * { opacity: 1 !important; transform: none !important; }
  .hero-corner { opacity: 1 !important; animation: none !important; }
}

/* --- Mes appareils : liste, cartes, rapport, QR de liaison ----------------- */
.device-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.device-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.device-card {
  background: var(--bg-panel-raised);
  border: 1px solid var(--border-hairline);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.12s ease;
}
.device-card:hover { border-color: var(--signal-teal); transform: translateY(-1px); }
.device-card-head { font-size: 16px; color: var(--text-primary); margin-bottom: 4px; }
.device-card-stats { font-size: 13px; color: var(--text-secondary); margin-top: 6px; }

.link-qr { margin: 6px 0 18px; }
.link-qr-inner {
  display: inline-block;
  background: #fff;                 /* fond blanc obligatoire : le QR est noir */
  padding: 16px;
  border-radius: 14px;
  text-align: center;
}
.link-qr-inner svg { display: block; width: 220px; height: 220px; }
.link-code {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 26px;
  letter-spacing: 4px;
  color: #0B1220;
  font-weight: 600;
}
.link-qr-inner .muted { color: #4a5468; max-width: 260px; margin: 8px auto 0; }

.dev-stats { display: flex; gap: 10px; margin: 14px 0 6px; }
.dev-stat {
  flex: 1;
  background: var(--bg-panel-raised);
  border: 1px solid var(--border-hairline);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
}
.dev-stat-v { font-size: 22px; font-weight: 600; color: var(--signal-teal); font-family: var(--font-mono); }
.dev-stat-l { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.dev-bar { margin: 8px 0; }
.dev-bar-l { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.dev-bar-track { height: 8px; background: var(--border-hairline); border-radius: 4px; overflow: hidden; }
.dev-bar-fill { height: 100%; background: var(--signal-teal); border-radius: 4px; }

.dev-row, .dev-recent {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 6px 0; border-bottom: 1px solid var(--border-hairline);
  font-size: 13px; color: var(--text-secondary);
}
.dev-row b { color: var(--signal-teal); }
/* Trame récente cliquable (rapport d'appareil) -> page capteur */
.dev-recent-link { cursor: pointer; }
.dev-recent-link:hover span:first-child,
.dev-recent-link:focus-visible span:first-child { color: var(--signal-teal); }
.dev-recent-link:focus-visible { outline: 2px solid var(--signal-teal); outline-offset: -2px; }

/* --- Journal : lignes cliquables vers la page capteur ---------------------- */
.log-row-link { cursor: pointer; }
.log-row-link:hover .log-model,
.log-row-link:focus-visible .log-model { color: var(--signal-teal); }
.log-row-link:focus-visible { outline: 2px solid var(--signal-teal); outline-offset: -2px; }

/* --- Encart « install en une ligne » (Linux) ------------------------------ */
.install-cta {
  margin: 28px 0;
  padding: 20px 22px;
  border: 1px solid var(--signal-teal-dim);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(63, 224, 197, 0.06), transparent);
}
.install-head { font-family: var(--font-mono); color: var(--text-primary); font-size: 15px; margin-bottom: 12px; }
.install-badge {
  display: inline-block; font-size: 11px; color: var(--signal-teal);
  border: 1px solid var(--signal-teal-dim); border-radius: 999px;
  padding: 2px 10px; margin-right: 10px;
}
.install-cmd {
  display: flex; align-items: stretch; gap: 8px;
  background: var(--bg-ink); border: 1px solid var(--border-hairline);
  border-radius: 8px; padding: 4px 4px 4px 14px; overflow-x: auto;
}
.install-cmd code {
  flex: 1; align-self: center; white-space: nowrap;
  font-family: var(--font-mono); font-size: 14px; color: var(--signal-teal);
}
.install-copy {
  flex: none; cursor: pointer; border: 0; border-radius: 6px;
  background: var(--signal-teal); color: #03211c; font-weight: 600; font-size: 12px;
  padding: 8px 14px;
}
.install-copy:hover { background: #56E8D0; }
.install-note { margin-top: 10px; color: var(--text-secondary); font-size: 13px; }

/* --- Page Guide ------------------------------------------------------------ */
.guide { max-width: 820px; }
.guide p { color: var(--text-secondary); font-size: 14px; line-height: 1.65; margin: 8px 0; }
.guide h3 { margin-top: 28px; }
.guide code { font-family: var(--font-mono); color: var(--signal-teal); font-size: 13px; }
.guide-cmds { margin: 10px 0; }
.guide-cmds > div {
  display: flex; gap: 16px; flex-wrap: wrap;
  padding: 9px 0; border-bottom: 1px solid var(--border-hairline);
}
.guide-cmds dt { min-width: 250px; margin: 0; }
.guide-cmds dd { flex: 1; min-width: 220px; margin: 0; color: var(--text-secondary); font-size: 13px; }
.guide-cmds em { color: var(--signal-teal); font-style: normal; }
.guide-steps { color: var(--text-secondary); font-size: 14px; line-height: 1.75; padding-left: 20px; }
.guide-steps li { margin: 4px 0; }
.apk-dl { margin: 12px 0 4px; }
.apk-sha { margin-top: 8px; font-size: 11px; word-break: break-all; }
.apk-sha code { color: var(--text-secondary); }

/* ==========================================================================
   Page Météo (route #/meteo) : carte colorée par métrique + filtres à droite
   ========================================================================== */
.meteo-head { margin: 18px 0 18px; }
.meteo-sub { font-family: var(--font-mono); font-size: 13px; color: var(--text-secondary); margin-top: 6px; }

.meteo-layout { display: flex; gap: 18px; align-items: stretch; }
.meteo-map-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-panel);
}
#meteo-map { height: min(72vh, 720px); width: 100%; background: var(--bg-panel); }

/* Légende posée en bas-gauche par-dessus la carte */
.meteo-legend {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 500;
  background: rgba(11, 18, 32, 0.86);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  padding: 9px 11px;
  width: 190px;
  pointer-events: none;
  backdrop-filter: blur(2px);
}
.meteo-legend-title { font-family: var(--font-mono); font-size: 12px; color: var(--text-primary); margin-bottom: 6px; }
.meteo-legend-unit { color: var(--text-muted); }
.meteo-legend-bar { height: 10px; border-radius: 5px; border: 1px solid rgba(255, 255, 255, 0.08); }
.meteo-legend-scale {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); margin-top: 4px;
}

/* Panneau de filtres à droite */
.meteo-controls {
  flex: none;
  width: 210px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.meteo-ctl-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.meteo-btns { display: flex; flex-direction: column; gap: 8px; }
.meteo-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  background: var(--bg-panel);
  border: 1px solid var(--border-hairline);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.meteo-btn:hover { border-color: var(--signal-teal); color: var(--text-primary); }
.meteo-btn.is-active {
  border-color: var(--signal-teal);
  color: var(--text-primary);
  background: rgba(63, 224, 197, 0.1);
  box-shadow: inset 0 0 0 1px var(--signal-teal-dim);
}
.meteo-btn-ico { font-size: 18px; line-height: 1; }
.meteo-count {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}
.meteo-count b { color: var(--signal-teal); }

/* Marqueur météo = pastille colorée portant la valeur (divIcon) */
.meteo-pin-icon { background: transparent; border: none; }
.meteo-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1.5px solid rgba(11, 18, 32, 0.85);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

/* Cellule « tendance » (zoom faible) = moyenne d'une zone, plus grosse + badge n */
.meteo-cell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border-radius: 999px;
  border: 2px solid rgba(11, 18, 32, 0.9);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}
.meteo-cell-n {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-ink);
  color: var(--text-secondary);
  border: 1px solid var(--border-hairline);
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 600;
}
.meteo-mode { color: var(--signal-teal); }

@media (max-width: 760px) {
  .meteo-layout { flex-direction: column; }
  .meteo-controls { width: 100%; }
  .meteo-btns { flex-direction: row; flex-wrap: wrap; }
  .meteo-btn { flex: 1; min-width: 130px; justify-content: center; }
  #meteo-map { height: 60vh; }
}
