:root {
  /* CYBER GLASS palette — navy nuit + cyan + violet */
  --bg: #07091a;
  --bg-2: rgba(18, 22, 48, 0.65);
  --bg-3: rgba(28, 33, 64, 0.55);
  --bg-4: rgba(40, 46, 80, 0.5);
  --bg-solid: #0c1029;
  --border: rgba(120, 180, 255, 0.12);
  --border-2: rgba(120, 180, 255, 0.22);
  --text: #eaf0ff;
  --text-dim: #8aa0c8;
  --text-dim2: #5b6f96;

  /* Accents */
  --accent: #00e5ff;          /* cyan principal */
  --accent-2: #b06bff;         /* violet secondaire */
  --accent-3: #ff3b80;         /* magenta pour critique */
  --ok: #00ffaa;
  --warn: #ffb020;
  --danger: #ff3b80;
  --info: #00e5ff;

  --topbar-h: 56px;
  --sidebar-w: 300px;

  /* Effects */
  --glass-blur: blur(14px) saturate(1.4);
  --glow-accent: 0 0 24px rgba(0, 229, 255, 0.35);
  --glow-danger: 0 0 24px rgba(255, 59, 128, 0.4);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: "Outfit", -apple-system, "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(0,229,255,.08), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(176,107,255,.10), transparent 50%),
    var(--bg);
  background-attachment: fixed;
  overflow: hidden;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}
/* Mono pour les chiffres / tickers */
.mono, .gauge-val, .stat-value, .market-delta, .market-ticker, .commo-price, .ws-val, .clock,
.rmet-val, .quake-mag, .ap-code, code { font-family: "JetBrains Mono", monospace; }
body.light-mode {
  --bg: #f5f5f5; --bg-2: #ffffff; --bg-3: #eeeeee; --bg-4: #e4e4e4;
  --border: #d0d0d0; --border-2: #c0c0c0;
  --text: #111; --text-dim: #666; --text-dim2: #999;
}

#app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr 340px;
  grid-template-rows: var(--topbar-h) 1fr 32px;
  grid-template-areas:
    "top top top"
    "side main rside"
    "foot foot foot";
  height: 100vh; width: 100vw;
}
#app.collapsed { grid-template-columns: 0 1fr 340px; }
#app.collapsed #sidebar { transform: translateX(-100%); }
#app.no-map #map-section { display: none; }

#rightbar {
  grid-area: rside;
  background: var(--bg);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}
#rightbar::-webkit-scrollbar { width: 12px; }
#rightbar::-webkit-scrollbar-track { background: rgba(0,229,255,.06); }
#rightbar::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; box-shadow: 0 0 6px rgba(0,229,255,.4); }
#rightbar::-webkit-scrollbar-thumb:hover { background: var(--accent-2); background-clip: padding-box; }
#right-panels { display: flex; flex-direction: column; gap: 0; padding: 0; }
#right-panels .dash-panel { width: 100%; margin: 0; break-inside: auto; display: flex; border-radius: 0; }

#site-footer {
  grid-area: foot;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; font-size: 10px; color: var(--text-dim); letter-spacing: .5px;
}
.sf-left { display: flex; align-items: center; gap: 8px; }
.sf-name { font-weight: 700; letter-spacing: 2px; color: var(--text); }
.sf-ver { color: var(--text-dim); }
.sf-nav { display: flex; align-items: center; gap: 14px; }
.sf-nav a { color: var(--text-dim); text-decoration: none; }
.sf-nav a:hover { color: var(--accent); }
.sf-sources { color: var(--text-dim2); font-style: italic; }

/* Drop zone placeholder */
.drop-zone {
  margin: 8px; padding: 26px 14px; text-align: center;
  border: 2px dashed var(--border-2); border-radius: 8px;
  color: var(--text-dim2); font-size: 10px; letter-spacing: 2px;
  background: transparent;
}
.drop-zone.dragover { border-color: var(--accent); color: var(--accent); background: rgba(255,48,64,.05); }

@media (max-width: 1400px) {
  #app {
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--topbar-h) 1fr 32px;
    grid-template-areas: "top top" "side main" "foot foot";
  }
  /* On masque le rightbar mais on injecte ses panneaux dans #dashboard via JS */
  #rightbar { display: none; }
}

/* =========== TOP BAR =========== */
#topbar {
  grid-area: top;
  display: flex; align-items: center;
  padding: 0 14px; gap: 10px;
  background: linear-gradient(180deg, rgba(18,22,48,.85), rgba(12,16,41,.85));
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(0,229,255,.08), 0 8px 32px rgba(0,0,0,.4);
  height: var(--topbar-h);
  position: relative;
  z-index: 600;
}
.tb-left, .tb-right { display: flex; align-items: center; gap: 6px; }
.tb-center { display: flex; align-items: center; justify-content: center; }
.tb-left { flex: 1; }
.tb-right { justify-content: flex-end; }

.dash-chip {
  background: rgba(34,211,154,.12); color: var(--ok);
  border: 1px solid rgba(34,211,154,.4); padding: 6px 12px;
  border-radius: 20px; font-size: 11px; font-weight: 600;
  font-family: inherit; cursor: pointer; letter-spacing: 1px;
  display: inline-flex; align-items: center; gap: 5px;
}
.dash-chip.active { background: rgba(34,211,154,.2); }
.dash-chip:hover { background: rgba(34,211,154,.25); }

.tb-icon {
  background: var(--bg-3); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 4px;
  width: 34px; height: 34px; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; transition: all .15s;
}
.tb-icon:hover { color: var(--text); border-color: var(--accent); }

.tb-sep { width: 1px; height: 26px; background: var(--border); margin: 0 4px; }

.monitor-brand {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 8px;
}
.brand-logo { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; filter: drop-shadow(0 0 6px rgba(0,229,255,.5)); }
.brand-logo svg { width: 100%; height: 100%; display: block; }
.brand-logo svg ellipse { animation: argos-iris-pulse 2.5s ease-in-out infinite; transform-origin: center; }
.brand-logo .argos-eyes circle { animation: argos-eye-blink 4s ease-in-out infinite; transform-origin: center; }
.brand-logo .argos-eyes circle:nth-child(2n)  { animation-delay: .3s; }
.brand-logo .argos-eyes circle:nth-child(3n)  { animation-delay: .7s; }
.brand-logo .argos-eyes circle:nth-child(5n)  { animation-delay: 1.1s; }
.brand-logo .argos-eyes circle:nth-child(7n)  { animation-delay: 1.5s; }
.brand-logo-sm { width: 18px; height: 18px; }
@keyframes argos-iris-pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes argos-eye-blink { 0%,90%,100% { opacity: .55; } 95% { opacity: .15; } }
.brand-title { font-weight: 700; font-size: 15px; letter-spacing: 3px; }
.brand-ver { color: var(--text-dim); font-size: 10px; letter-spacing: 1px; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.15); opacity: .7; } }

.gh-stars {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg-3); border: 1px solid var(--border);
  padding: 5px 10px; border-radius: 4px; text-decoration: none;
  color: var(--text); font-size: 11px;
}
.gh-stars:hover { border-color: var(--accent); }

.live-pill {
  background: rgba(0,229,255,.12); border: 1px solid var(--accent);
  color: var(--accent); padding: 4px 10px; border-radius: 20px;
  font-size: 9px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
  letter-spacing: 1.5px; width: fit-content;
  box-shadow: 0 0 10px rgba(0,229,255,.2);
}
.live-pill.big { padding: 6px 12px; font-size: 10px; line-height: 1.05; text-align: center; border-radius: 4px; }
.dot-live { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s infinite; box-shadow: 0 0 6px var(--accent); }

.lang-select button {
  background: var(--bg-3); color: var(--text); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 4px; font-size: 11px; cursor: pointer;
  font-family: inherit; letter-spacing: .5px;
  min-width: 140px; text-align: left;
  display: inline-flex; align-items: center; gap: 6px;
}
.lang-select button:hover { border-color: var(--accent); }

.defcon-box {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2));
  color: #fff;
  border-radius: 8px;
  font-size: 11px; font-weight: 600;
  box-shadow: 0 0 14px rgba(255,59,128,.4);
}
.defcon-icon { font-size: 13px; }
.defcon-label { letter-spacing: 1.5px; font-size: 10px; }
.defcon-value { font-size: 16px; font-weight: 700; margin-left: 2px; }
.defcon-delta { font-size: 10px; opacity: .9; }

/* =========== SIDEBAR =========== */
#sidebar {
  grid-area: side;
  background: linear-gradient(180deg, rgba(18,22,48,.4), rgba(7,9,26,.7));
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  transition: transform .25s ease;
  scrollbar-width: thin; scrollbar-color: var(--border-2) transparent;
}
#sidebar::-webkit-scrollbar { width: 12px; }
#sidebar::-webkit-scrollbar-track { background: rgba(0,229,255,.06); }
#sidebar::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; box-shadow: 0 0 6px rgba(0,229,255,.4); }
#sidebar::-webkit-scrollbar-thumb:hover { background: var(--accent-2); background-clip: padding-box; }

.panel { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.panel-label { font-size: 9px; text-transform: uppercase; color: var(--text-dim); letter-spacing: 1.8px; font-weight: 600; margin-bottom: 8px; display: block; }
.panel-actions { display: flex; gap: 4px; }
.mini {
  background: var(--bg-3); color: var(--text-dim); border: 1px solid var(--border);
  border-radius: 3px; padding: 3px 8px; font-size: 10px; cursor: pointer;
  font-family: inherit; transition: all .15s; letter-spacing: .5px;
}
.mini:hover { color: var(--text); border-color: var(--accent); }

.search-wrap { position: relative; }
#search {
  width: 100%; background: var(--bg-3); border: 1px solid var(--border); color: var(--text);
  border-radius: 4px; padding: 8px 10px; font-size: 11px; outline: none;
  font-family: inherit;
}
#search::placeholder { color: var(--text-dim2); }
#search:focus { border-color: var(--accent); }
.search-results {
  position: absolute; top: 36px; left: 0; right: 0;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 4px;
  max-height: 260px; overflow-y: auto; z-index: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,.6);
}
.search-results div { padding: 7px 10px; font-size: 11px; cursor: pointer; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.search-results div:hover { background: var(--bg-3); color: var(--accent); }
.search-results .s-type { color: var(--text-dim2); font-size: 9px; }

.chip-row { display: flex; gap: 3px; }
.chip-row.wrap { flex-wrap: wrap; }
.chip-row button {
  flex: 1 1 auto; min-width: 44px;
  background: var(--bg-3); color: var(--text-dim); border: 1px solid var(--border);
  padding: 5px 8px; border-radius: 3px; font-size: 10px; cursor: pointer;
  font-family: inherit; letter-spacing: .3px;
}
.chip-row button:hover { color: var(--text); border-color: var(--border-2); }
.chip-row button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06091a; border-color: transparent;
  box-shadow: 0 2px 12px rgba(0,229,255,.4);
  font-weight: 600;
}

.playback { display: flex; gap: 2px; margin-bottom: 8px; }
.playback button {
  flex: 1; background: var(--bg-3); border: 1px solid var(--border); color: var(--text-dim);
  padding: 6px 0; border-radius: 3px; font-size: 10px; cursor: pointer;
  font-family: inherit;
}
.playback button:hover { color: var(--text); }
.playback button.live { color: var(--accent); font-weight: 600; letter-spacing: 1px; border-color: rgba(255,48,64,.3); line-height: 1.05; }
.playback button.live.active { background: var(--accent); color: #fff; }
#pbSlider { width: 100%; height: 3px; background: var(--bg-3); border-radius: 2px; -webkit-appearance: none; appearance: none; outline: none; }
#pbSlider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); cursor: pointer; }
.pb-time { margin-top: 6px; font-size: 10px; color: var(--text-dim); text-align: center; letter-spacing: 1px; }

.layers { list-style: none; padding: 0; margin: 0; }
.layer-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 4px; cursor: pointer;
  transition: background .15s;
  margin-bottom: 1px;
  font-size: 11px;
}
.layer-item:hover { background: var(--bg-3); }
.layer-item .check {
  width: 13px; height: 13px; border: 1.5px solid var(--border-2);
  border-radius: 3px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.layer-item.active .check {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 0 8px rgba(0,229,255,.5);
}
.layer-item.active .check::after { content: "✓"; color: #fff; font-size: 9px; font-weight: bold; line-height: 1; }
.layer-item .icon { font-size: 12px; flex-shrink: 0; width: 14px; text-align: center; }
.layer-item .swatch { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.layer-item .label { flex: 1; line-height: 1.2; }
.layer-item .count { font-size: 10px; color: var(--text-dim); background: var(--bg-3); padding: 1px 6px; border-radius: 8px; min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.layer-item.locked .count::after { content: " 🔒"; }

.options { display: flex; flex-direction: column; gap: 4px; }
.opt { display: flex; align-items: center; gap: 8px; font-size: 11px; cursor: pointer; padding: 3px 0; color: var(--text-dim); }
.opt input { accent-color: var(--accent); }
.opt:hover { color: var(--text); }

.stats-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.stat-card { background: var(--bg-3); padding: 5px 7px; border-radius: 3px; border: 1px solid var(--border); }
.stat-card .stat-label { font-size: 9px; color: var(--text-dim); text-transform: uppercase; }
.stat-card .stat-value { font-size: 14px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-card.critical .stat-value { color: var(--danger); }
.stat-card.warn .stat-value { color: var(--warn); }

.side-footer { margin-top: auto; padding: 8px 12px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-size: 9px; color: var(--text-dim); }
.refresh { background: var(--bg-3); border: 1px solid var(--border); color: var(--text); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 12px; font-family: inherit; }
.refresh:hover { background: var(--accent); border-color: var(--accent); }
.refresh.spinning { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =========== MAIN / DASHBOARD =========== */
#main {
  grid-area: main;
  overflow-y: auto; overflow-x: hidden;
  background: var(--bg);
  scrollbar-width: auto; scrollbar-color: var(--accent) rgba(0,229,255,.08);
}
#main::-webkit-scrollbar { width: 14px; }
#main::-webkit-scrollbar-track { background: rgba(0,229,255,.06); border-left: 1px solid var(--border); }
#main::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 7px;
  border: 2px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 0 8px rgba(0,229,255,.4);
}
#main::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  background-clip: padding-box;
}

/* Map section */
#map-section {
  position: relative; width: 100%; height: 48vh;
  min-height: 340px;
  border-bottom: 1px solid var(--border);
}
#map { width: 100%; height: 100%; background: #000; }
.leaflet-container { background: #000; font-family: inherit; }
/* Satellite Esri — pas de filtre pour préserver les couleurs naturelles */
.leaflet-tile { filter: none; }
body.light-mode .leaflet-tile { filter: none; }
.leaflet-control-zoom { border: none !important; margin: 14px !important; }
.leaflet-control-zoom a { background: var(--bg-2) !important; color: var(--text) !important; border: 1px solid var(--border) !important; font-family: inherit !important; }
.leaflet-control-zoom a:hover { background: var(--accent) !important; border-color: var(--accent) !important; }
.leaflet-control-attribution { background: rgba(10,10,10,.8) !important; color: var(--text-dim) !important; font-size: 9px !important; font-family: inherit !important; }
.leaflet-control-attribution a { color: var(--text-dim) !important; }

.map-overlay { position: absolute; z-index: 450; }
.map-overlay.top-left { top: 12px; left: 12px; display: flex; flex-direction: column; gap: 8px; }
.map-overlay.top-right-ctl { top: 12px; right: 12px; display: flex; gap: 6px; }
.map-overlay.top-right { top: 54px; right: 12px; }

.clock { background: rgba(17,17,17,.9); border: 1px solid var(--border); color: var(--text); padding: 4px 8px; border-radius: 4px; font-size: 10px; letter-spacing: 1px; backdrop-filter: blur(6px); width: fit-content; font-variant-numeric: tabular-nums; }

.top-right-ctl button {
  background: rgba(17,17,17,.9); border: 1px solid var(--border); color: var(--text);
  width: 30px; height: 30px; border-radius: 4px; font-size: 12px;
  cursor: pointer; font-family: inherit; backdrop-filter: blur(6px);
  display: inline-flex; align-items: center; justify-content: center;
}
.top-right-ctl button:hover { background: var(--accent); border-color: var(--accent); }

#legend { display: none !important; }
.map-overlay.top-right { display: none !important; }
#legend h4 { margin: 0 0 5px; font-size: 9px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1.2px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 10px; margin-top: 3px; }
.legend-item .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.leaflet-popup-content-wrapper { background: var(--bg-2) !important; color: var(--text) !important; border-radius: 4px !important; border: 1px solid var(--border) !important; }
.leaflet-popup-tip { background: var(--bg-2) !important; border: 1px solid var(--border) !important; }
.leaflet-popup-content { margin: 10px 12px !important; line-height: 1.45 !important; font-family: inherit !important; font-size: 11px !important; }
.popup-title { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.popup-meta { font-size: 10px; color: var(--text-dim); margin-bottom: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.popup-desc { font-size: 11px; }
.popup-tag { display: inline-block; font-size: 9px; padding: 1px 5px; border-radius: 2px; background: var(--bg-3); margin-right: 4px; margin-top: 4px; }
.popup-severity { padding: 2px 6px; border-radius: 3px; font-size: 9px; font-weight: 700; letter-spacing: .8px; }
.sev-critical { background: rgba(255,48,64,.2); color: var(--accent); border: 1px solid var(--accent); }
.sev-high { background: rgba(255,176,32,.15); color: var(--warn); border: 1px solid var(--warn); }
.sev-med { background: rgba(57,165,255,.15); color: var(--info); border: 1px solid var(--info); }
.sev-low { background: rgba(34,211,154,.15); color: var(--ok); border: 1px solid var(--ok); }

.detail-panel {
  position: absolute; top: 12px; right: 230px; width: 280px;
  background: rgba(17,17,17,.96); border: 1px solid var(--border); border-radius: 6px;
  padding: 12px; z-index: 500; backdrop-filter: blur(10px);
  max-height: calc(100% - 30px); overflow-y: auto; font-size: 11px;
}
.detail-close { position: absolute; top: 4px; right: 6px; background: none; border: none; color: var(--text-dim); font-size: 18px; cursor: pointer; }
.detail-close:hover { color: var(--accent); }
.detail-panel h3 { margin: 0 0 8px; font-size: 13px; }
.detail-panel .row { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid var(--border); font-size: 10px; }
.detail-panel .row .k { color: var(--text-dim); }
.detail-panel .desc { font-size: 11px; line-height: 1.5; margin-top: 8px; }

.custom-marker {
  border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 8px rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.marker-pulse::before {
  content: ""; position: absolute; inset: -4px;
  border-radius: 50%; border: 2px solid currentColor;
  animation: ping 1.8s ease-out infinite; pointer-events: none;
}
@keyframes ping { 0% { transform: scale(.7); opacity: 1; } 100% { transform: scale(2); opacity: 0; } }

.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: rgba(255,48,64,.4) !important; }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div {
  background: rgba(255,48,64,.85) !important; color: #fff !important;
  font-family: "JetBrains Mono", monospace !important;
  font-weight: 600 !important; font-size: 11px !important;
}

/* =========== DASHBOARD PANELS — Bento grille uniforme =========== */
#dashboard {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 320px;              /* Hauteur fixe par rangée → tuiles parfaitement alignées */
  grid-auto-flow: dense;              /* Remplit les trous avec les panneaux suivants */
  gap: 0;
  padding: 0;
}
@media (max-width: 1200px) { #dashboard { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 800px)  { #dashboard { grid-template-columns: 1fr; grid-auto-rows: auto; } }

.dash-panel {
  display: flex;
  flex-direction: column;
  grid-column: span 2;                /* 2/6 = 1/3 par défaut */
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  transition: background .2s, box-shadow .2s;
  overflow-x: hidden;
  overflow-y: auto;                   /* scroll interne quand contenu > 320px */
  position: relative;
  min-width: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}
.dash-panel::-webkit-scrollbar { width: 10px; }
.dash-panel::-webkit-scrollbar-track { background: rgba(0,229,255,.05); }
.dash-panel::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
.dash-panel::-webkit-scrollbar-thumb:hover { background: var(--accent-2); background-clip: padding-box; }
/* Cas spéciaux : pas de double scroll dans news/cam (vidéos pleines tuiles) */
[data-panel="news"], [data-panel="camwall"] { overflow: hidden; }
.dash-panel:hover {
  box-shadow: inset 0 0 0 1px rgba(0,229,255,.25), inset 0 1px 0 rgba(255,255,255,.04);
  z-index: 2;
}
.dash-panel.span-full, .world-monitor-bar { grid-column: 1 / -1; }
.dash-panel.wide-half { grid-column: span 3; }
.dash-panel.tall-double { grid-row: span 2; }
/* Maritime + Aérien : pleine largeur, empilés en bas de page */
.dash-panel[data-panel="maritime"] { grid-column: 1 / -1; }
.dash-panel[data-panel="aerien"]   { grid-column: 1 / -1; }
.dash-panel .iframe-wrap { flex: 1; min-height: 220px; position: relative; background: #000; border-radius: 4px; overflow: hidden; display: flex; justify-content: center; }
.dash-panel .iframe-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Maritime + Aérien : limite la largeur de l'iframe pour éviter la répétition du globe */
[data-panel="maritime"] .iframe-wrap iframe,
[data-panel="aerien"] .iframe-wrap iframe { max-width: 1100px; margin: 0 auto; left: 50%; transform: translateX(-50%); right: auto; inset: 0 auto 0 50%; width: min(100%, 1100px); }
.dash-panel .iframe-wrap iframe[loading="lazy"] { background: linear-gradient(135deg, #0a1024, #1a2a4a); }
.add-panel-tile { grid-column: 1 / -1; }
.drop-zone { grid-column: 1 / -1; }

/* News + Cam = 50/50 sur les deux premières rangées (vidéo) */
[data-panel="news"]    { grid-column: 1 / span 3; grid-row: 1 / span 2; }
[data-panel="camwall"] { grid-column: 4 / span 3; grid-row: 1 / span 2; }
@media (max-width: 1200px) {
  [data-panel="news"]    { grid-column: 1 / span 2; }
  [data-panel="camwall"] { grid-column: 3 / span 2; }
}
@media (max-width: 800px) {
  [data-panel="news"], [data-panel="camwall"] { grid-column: 1 !important; grid-row: auto !important; }
}

/* Le scroll est géré par .dash-panel — listes internes en flux normal */
.intel-feed, .intel-live, .xsrc-list, .market-list, .quake-list,
.airline-list, .pred-list, .risk-alerts,
.weather-grid, .instab-list, .commo-grid,
.forecast-list, .stocks-list, .cyber-list { max-height: none !important; overflow: visible !important; }
.dash-panel[hidden] { display: none !important; }

/* Drag-drop verrouillé : pas de handle visible, pas de cursor grab */
.dash-panel .dash-head { user-select: none; }
.dash-panel .dash-head input, .dash-panel .dash-head button, .dash-panel .dash-head a { cursor: pointer; }
.sortable-ghost { opacity: .25; background: var(--bg-3) !important; border-style: dashed !important; }
.sortable-drag { box-shadow: 0 20px 60px rgba(0,0,0,.7) !important; z-index: 1000; transform: rotate(1deg); }
.sortable-chosen { border-color: var(--accent) !important; }
.dash-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.panel-source {
  font-size: 9px; color: var(--text-dim2); letter-spacing: .5px;
  padding: 2px 0 6px; margin-bottom: 4px;
  border-bottom: 1px dashed var(--border);
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ps-icon { font-size: 9px; opacity: .7; }
.ps-text { overflow: hidden; text-overflow: ellipsis; font-style: italic; }
.dash-head h3 {
  margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 1.8px;
  color: var(--text);
  line-height: 1.3;
}
.panel-close {
  background: var(--bg-3); border: 1px solid var(--border); color: var(--text-dim);
  width: 22px; height: 22px; border-radius: 4px; cursor: pointer;
  font-family: inherit; font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 6px;
}
.panel-close:hover { color: #fff; background: var(--accent); border-color: var(--accent); }

/* Add Panel tile */
.add-panel-tile {
  background: transparent;
  border: 2px dashed var(--border-2);
  border-radius: 8px;
  padding: 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; min-height: 160px;
  cursor: pointer; color: var(--text-dim);
  transition: all .2s; position: relative;
}
.add-panel-tile:hover { border-color: var(--accent); color: var(--accent); background: rgba(255,48,64,.04); }
.add-panel-plus { font-size: 36px; font-weight: 300; line-height: 1; }
.add-panel-label { font-size: 11px; letter-spacing: 2px; font-weight: 600; }
.add-menu {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px; min-width: 220px; z-index: 200;
  box-shadow: 0 10px 30px rgba(0,0,0,.7);
  margin-top: 6px;
}
.add-menu[hidden] { display: none; }
.add-menu button {
  display: block; width: 100%; text-align: left;
  background: transparent; border: none; color: var(--text);
  padding: 8px 10px; border-radius: 3px; cursor: pointer;
  font-family: inherit; font-size: 12px;
}
.add-menu button:hover { background: var(--bg-3); color: var(--accent); }
.add-menu .am-empty { padding: 10px; font-size: 11px; color: var(--text-dim); text-align: center; }
.dash-head .help {
  display: inline-flex; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-dim); align-items: center; justify-content: center;
  font-size: 9px; font-weight: bold; margin-left: 2px;
}
.count-badge {
  margin-left: auto;
  background: var(--accent); color: #fff;
  padding: 1px 6px; border-radius: 10px; font-size: 10px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 3px;
}
.count-badge::before { content: "●"; font-size: 7px; }
.pill-live {
  background: rgba(34,211,154,.15); color: var(--ok);
  border: 1px solid rgba(34,211,154,.4);
  padding: 2px 8px; border-radius: 10px; font-size: 9px;
  font-weight: 600; letter-spacing: 1px;
}
.pro-badge {
  background: var(--warn); color: #000;
  padding: 1px 6px; border-radius: 3px; font-size: 9px; font-weight: 700;
  letter-spacing: 1px;
}
.dash-actions { margin-left: auto; display: flex; gap: 4px; }
.icon-btn { background: transparent; border: 1px solid var(--border); color: var(--text-dim); width: 22px; height: 22px; border-radius: 3px; cursor: pointer; font-family: inherit; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { color: var(--text); border-color: var(--accent); }

/* News */
.tabs-scroller { position: relative; display: flex; align-items: stretch; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.tabs-arrow {
  flex-shrink: 0; background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text); width: 24px; cursor: pointer; font-family: inherit;
  font-size: 18px; line-height: 1; padding: 0; margin-bottom: 4px;
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
}
.tabs-arrow:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.tabs-arrow.left { margin-right: 4px; }
.tabs-arrow.right { margin-left: 4px; }
.tabs-scroller .news-tabs { margin-bottom: 0; border-bottom: none; flex: 1; min-width: 0; }

.news-tabs, .cam-tabs {
  display: flex; gap: 3px; overflow-x: auto;
  scrollbar-width: none; padding-bottom: 4px;
  margin-bottom: 8px; border-bottom: 1px solid var(--border);
  scroll-behavior: smooth;
}
.news-tabs::-webkit-scrollbar, .cam-tabs::-webkit-scrollbar { display: none; }
.news-tabs button, .cam-tabs button {
  flex-shrink: 0; background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-dim); padding: 5px 10px; border-radius: 3px;
  font-size: 10px; cursor: pointer; font-family: inherit; letter-spacing: .3px;
}
.news-tabs button:hover, .cam-tabs button:hover { color: var(--text); }
.news-tabs button.active, .cam-tabs button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.news-player {
  background: #000; aspect-ratio: 16/9;
  border-radius: 4px; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.news-player iframe { width: 100%; height: 100%; border: 0; display: block; }
.news-placeholder { text-align: center; padding: 20px; }
.np-logo { font-size: 48px; margin-bottom: 8px; }
.np-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.np-sub { font-size: 10px; color: var(--text-dim); }
.news-caption { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 11px; }
.nc-tag { background: var(--accent); color: #fff; padding: 2px 6px; border-radius: 2px; font-size: 9px; font-weight: 700; letter-spacing: 1px; }

/* Insights */
.insight-box { background: var(--bg-3); border: 1px solid var(--border); border-radius: 4px; padding: 10px; }
.insight-head { font-size: 10px; color: var(--ok); letter-spacing: 1.5px; margin-bottom: 6px; }
.insight-body { font-size: 11px; line-height: 1.5; color: var(--text); margin-bottom: 8px; }
.insight-foot { display: flex; gap: 4px; flex-wrap: wrap; }
.insight-foot .tag { background: var(--bg-4); color: var(--text-dim); padding: 2px 6px; border-radius: 2px; font-size: 9px; }

/* Forecast */
.forecast-list { list-style: none; padding: 0; margin: 8px 0 0; overflow-y: auto; max-height: 220px; }
.forecast-item {
  display: flex; gap: 8px; padding: 7px; border-bottom: 1px solid var(--border);
  font-size: 11px;
}
.forecast-item:last-child { border-bottom: none; }
.forecast-item .prob { flex-shrink: 0; font-weight: 700; min-width: 34px; text-align: center; padding: 3px 5px; border-radius: 3px; font-size: 10px; }
.forecast-item .prob.hi { background: rgba(255,48,64,.2); color: var(--accent); }
.forecast-item .prob.med { background: rgba(255,176,32,.2); color: var(--warn); }
.forecast-item .prob.lo { background: rgba(34,211,154,.2); color: var(--ok); }
.forecast-item .txt { flex: 1; line-height: 1.35; }
.forecast-item .meta { font-size: 9px; color: var(--text-dim); margin-top: 2px; }

/* Webcams */
.cam-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px;
  max-height: 340px; overflow-y: auto;
}
.cam-grid.compact { grid-template-columns: repeat(2, 1fr); max-height: 300px; }
.cam-grid.compact .cam-cell { aspect-ratio: 16/11; }

/* Commodities */
.commo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 6px; }
.commo-cell { background: var(--bg-3); border: 1px solid var(--border); border-radius: 4px; padding: 8px 10px; }
.commo-name { font-size: 10px; color: var(--text-dim); letter-spacing: 1px; }
.commo-price { font-size: 14px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.commo-unit { font-size: 9px; color: var(--text-dim); font-weight: 400; }
.commo-delta { font-size: 10px; margin-top: 2px; font-weight: 600; }
.commo-delta.up { color: var(--ok); }
.commo-delta.down { color: var(--danger); }

/* Marchés boursiers (Yahoo) */
.stocks-list { list-style: none; padding: 0; margin: 0; }
.stock-item { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--border); font-size: 11px; align-items: center; }
.stock-name { font-weight: 700; letter-spacing: .5px; }
.stock-price { font-variant-numeric: tabular-nums; color: var(--text); }
.stock-delta { font-weight: 700; min-width: 56px; text-align: right; font-variant-numeric: tabular-nums; }
.stock-delta.up { color: var(--ok); }
.stock-delta.down { color: var(--danger); }

/* Cybermenaces (CISA KEV) */
.cyber-list { list-style: none; padding: 0; margin: 0; }
.cyber-item { padding: 7px 4px; border-bottom: 1px solid var(--border); font-size: 11px; }
.cyber-item.ransom { background: rgba(255,48,64,.06); border-left: 2px solid var(--danger); padding-left: 8px; }
.cyber-head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.cyber-cve { font-family: "JetBrains Mono", monospace; font-size: 10px; font-weight: 700; color: var(--accent); }
.cyber-ransom { background: var(--danger); color: #fff; font-size: 8px; padding: 1px 5px; border-radius: 2px; font-weight: 700; letter-spacing: .5px; }
.cyber-date { margin-left: auto; font-size: 9px; color: var(--text-dim); }
.cyber-name { font-size: 11px; line-height: 1.3; color: var(--text); margin-bottom: 2px; }
.cyber-meta { font-size: 9px; color: var(--text-dim); }

/* Predictions */
.pred-list { list-style: none; padding: 0; margin: 0; max-height: 260px; overflow-y: auto; }
.pred-item { padding: 8px; border-bottom: 1px solid var(--border); }
.pred-question { display: block; font-size: 11px; line-height: 1.35; color: var(--text); text-decoration: none; margin-bottom: 5px; }
.pred-question:hover { color: var(--accent); }
.pred-bar { display: flex; height: 18px; border-radius: 3px; overflow: hidden; gap: 1px; margin-bottom: 3px; font-size: 9px; line-height: 18px; color: #fff; font-weight: 600; }
.pred-oui { background: rgba(34,211,154,.8); text-align: center; min-width: 40px; }
.pred-non { background: rgba(255,48,64,.8); text-align: center; min-width: 40px; }
.pred-meta { font-size: 9px; color: var(--text-dim); }

/* Airlines */
.airline-list { list-style: none; padding: 0; margin: 0; max-height: 260px; overflow-y: auto; }
.airline-item { display: grid; grid-template-columns: 40px 1fr auto auto; gap: 8px; padding: 5px 8px; border-bottom: 1px solid var(--border); font-size: 11px; align-items: center; }
.ap-code { font-weight: 700; color: var(--text-dim); font-size: 10px; letter-spacing: .5px; }
.ap-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-status { font-size: 10px; font-weight: 700; letter-spacing: .5px; }
.ap-delay { font-size: 10px; color: var(--text-dim); }

/* Weather featured card */
.weather-featured {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  background: linear-gradient(135deg, #1a2a4a, #0a1024);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 14px; margin-bottom: 8px;
}
.weather-featured.severe { background: linear-gradient(135deg, #4a1a1a, #240a0a); border-color: var(--accent); animation: severePulse 2s infinite; }
@keyframes severePulse { 0%,100% { box-shadow: 0 0 0 rgba(255,48,64,0); } 50% { box-shadow: 0 0 12px rgba(255,48,64,.5); } }
.weather-big-left { display: flex; flex-direction: column; gap: 4px; }
.weather-city { font-size: 13px; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; }
.weather-temp { font-size: 38px; font-weight: 700; line-height: 1; }
.weather-cond { font-size: 11px; color: var(--text-dim); }
.weather-big-right { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; align-items: center; }
.weather-stat { display: flex; align-items: center; gap: 4px; font-size: 11px; }
.ws-icon { font-size: 13px; }
.ws-val { font-weight: 700; min-width: 28px; text-align: right; }
.ws-lbl { color: var(--text-dim); font-size: 9px; letter-spacing: .5px; }

.weather-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; max-height: 260px; overflow-y: auto; }
.weather-cell {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 4px;
  padding: 6px 4px; text-align: center; cursor: pointer; transition: all .15s;
  position: relative;
}
.weather-cell:hover { border-color: var(--accent); }
.weather-cell.active { border-color: var(--accent); background: var(--bg-4); }
.weather-cell.severe { border-color: var(--accent); background: rgba(255,48,64,.1); }
.wc-name { font-size: 9px; color: var(--text-dim); letter-spacing: .5px; margin-bottom: 2px; }
.wc-temp { font-size: 14px; font-weight: 700; line-height: 1; }
.wc-icon { font-size: 14px; margin-top: 2px; }
.wc-alert-dot { position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s infinite; }

/* Quakes list */
.quake-list { list-style: none; padding: 0; margin: 0; max-height: 280px; overflow-y: auto; }
.quake-item { background: var(--bg-3); border-left: 3px solid var(--ok); padding: 6px 8px; margin-bottom: 4px; border-radius: 3px; font-size: 11px; line-height: 1.35; }
.quake-item.M5 { border-left-color: var(--warn); }
.quake-item.M6 { border-left-color: var(--accent-2); }
.quake-item.M7 { border-left-color: var(--accent); background: rgba(255,48,64,.08); }
.quake-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.quake-mag { background: var(--bg-2); padding: 1px 6px; border-radius: 2px; font-weight: 700; font-size: 11px; }
.quake-mag.M5 { color: var(--warn); }
.quake-mag.M6 { color: var(--accent-2); }
.quake-mag.M7 { color: var(--accent); }
.quake-place { flex: 1; font-size: 10px; }
.quake-time { font-size: 9px; color: var(--text-dim); }
.quake-meta { font-size: 9px; color: var(--text-dim); }

/* Featured cam in MUR CAMÉRAS */
.cam-featured {
  position: relative; background: #000; border-radius: 4px;
  flex: 1; min-height: 180px;
  overflow: hidden; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center;
}
.cam-featured iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cam-featured-title {
  position: absolute; left: 8px; bottom: 8px; z-index: 2;
  background: rgba(0,0,0,.75); color: #fff; padding: 3px 8px;
  border-radius: 3px; font-size: 10px; letter-spacing: .5px;
}
/* Vignettes cam : défilement horizontal (1 rangée, scroll smooth) */
.cam-thumbs {
  display: flex; gap: 4px;
  margin-top: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.cam-thumbs::-webkit-scrollbar { height: 10px; }
.cam-thumbs::-webkit-scrollbar-track { background: rgba(0,229,255,.08); border-radius: 5px; }
.cam-thumbs::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; box-shadow: 0 0 4px rgba(0,229,255,.5); }
.cam-thumbs::-webkit-scrollbar-thumb:hover { background: var(--accent-2); background-clip: padding-box; }
.cam-thumbs .cam-cell {
  flex: 0 0 160px; height: 100px;
  position: relative; background: #000;
  border-radius: 3px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--border); transition: border-color .15s, transform .15s;
}
.cam-thumbs .cam-cell:hover { border-color: var(--accent); transform: scale(1.03); z-index: 3; }
.cam-thumbs .cam-cell.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cam-thumbs .cam-cell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-thumbs .cam-cell .cam-title { position: absolute; inset: auto 0 0 0; background: linear-gradient(transparent, rgba(0,0,0,.85)); color: #fff; font-size: 9px; padding: 8px 4px 3px; line-height: 1.1; text-align: center; font-weight: 600; }
.cam-thumbs .cam-cell .cam-live { position: absolute; top: 3px; right: 3px; background: var(--danger); color: #fff; padding: 1px 4px; border-radius: 2px; font-size: 7px; font-weight: 700; letter-spacing: .5px; }

/* Market list */
.market-list { list-style: none; padding: 0; margin: 0; overflow-y: auto; max-height: 240px; }
.market-item { padding: 8px; border-bottom: 1px solid var(--border); font-size: 11px; display: flex; gap: 8px; align-items: flex-start; }
.market-item:last-child { border-bottom: none; }
.market-delta { font-weight: 700; font-size: 12px; min-width: 54px; text-align: right; font-variant-numeric: tabular-nums; }
.market-delta.up { color: var(--ok); }
.market-delta.down { color: var(--danger); }
.market-body { flex: 1; }
.market-ticker { font-size: 12px; font-weight: 700; letter-spacing: 1px; }
.market-desc { font-size: 10px; color: var(--text-dim); margin-top: 2px; line-height: 1.3; }
.cam-cell {
  background: #000; aspect-ratio: 16/10; border-radius: 4px;
  position: relative; overflow: hidden; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.cam-cell .cam-title { position: absolute; left: 6px; top: 6px; font-size: 9px; background: rgba(0,0,0,.7); padding: 2px 5px; border-radius: 2px; color: #fff; }
.cam-cell .cam-live { position: absolute; right: 6px; top: 6px; background: var(--accent); color: #fff; padding: 1px 5px; border-radius: 2px; font-size: 8px; font-weight: 700; letter-spacing: 1px; }
.cam-cell .cam-loc { position: absolute; left: 6px; bottom: 6px; font-size: 9px; color: #ccc; }

/* Instabilité */
.instab-list { list-style: none; padding: 0; margin: 0; }
.instab-item { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.instab-item:last-child { border-bottom: none; }
.instab-row { display: flex; align-items: center; gap: 8px; }
.instab-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.instab-name { flex: 1; font-size: 12px; font-weight: 600; }
.instab-score { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.instab-arrow { color: var(--text-dim); font-size: 11px; }
.instab-share { background: var(--bg-3); border: 1px solid var(--border); color: var(--text-dim); width: 22px; height: 22px; border-radius: 3px; cursor: pointer; font-size: 11px; }
.instab-bar { height: 3px; background: var(--bg-3); border-radius: 2px; overflow: hidden; }
.instab-bar .bar-fill { height: 100%; border-radius: 2px; }
.instab-sub { font-size: 9px; color: var(--text-dim); letter-spacing: .5px; }

/* Risk gauge */
.risk-gauge { display: flex; align-items: center; gap: 16px; padding: 8px 4px; }
.gauge-wrap { position: relative; width: 96px; height: 96px; flex-shrink: 0; }
.gauge-svg { width: 96px; height: 96px; display: block; }
.gauge-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
.gauge-val { font-size: 24px; font-weight: 700; line-height: 1; }
.gauge-lbl { font-size: 8px; color: var(--warn); letter-spacing: 1.2px; margin-top: 3px; white-space: nowrap; }
.gauge-trend { padding-left: 6px; }
.gtrend-label { font-size: 9px; color: var(--text-dim); letter-spacing: 1.2px; margin-bottom: 4px; }
.gtrend-val { font-size: 13px; color: var(--info); font-weight: 600; display: flex; align-items: center; gap: 6px; }

/* Risk metrics 2x2 */
.risk-metrics {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px;
  margin: 8px 0 10px;
}
.rmet {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 4px;
  padding: 8px 10px; text-align: center;
}
.rmet-val { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rmet-lbl { font-size: 8px; color: var(--text-dim); letter-spacing: 1.2px; margin-top: 3px; text-transform: uppercase; }

.risk-section { margin-top: 10px; }
.risk-section-title {
  font-size: 9px; color: var(--text-dim); letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 6px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.rsec-count { background: var(--bg-3); color: var(--text); border: 1px solid var(--border); padding: 1px 6px; border-radius: 8px; font-size: 9px; }

.risk-top { list-style: none; padding: 0; margin: 0; counter-reset: risk; }
.risk-top li {
  background: linear-gradient(90deg, rgba(255,176,32,.08), transparent);
  border-left: 2px solid var(--warn);
  padding: 6px 8px 6px 24px; margin-bottom: 4px; border-radius: 3px;
  font-size: 11px; line-height: 1.35; position: relative;
}
.risk-top li::before {
  counter-increment: risk; content: counter(risk) ".";
  position: absolute; left: 8px; top: 6px;
  color: var(--warn); font-weight: 700;
}

.risk-alerts { list-style: none; padding: 0; margin: 0; max-height: 200px; overflow-y: auto; }
.risk-alert {
  background: var(--bg-3); border-left: 3px solid var(--ok);
  padding: 6px 8px; margin-bottom: 4px; border-radius: 3px;
  font-size: 11px; line-height: 1.35;
}
.risk-alert.hi { border-left-color: var(--danger); }
.risk-alert.med { border-left-color: var(--warn); }
.risk-alert-head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.risk-alert-country { font-size: 11px; font-weight: 600; }
.risk-alert-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.risk-alert-time { margin-left: auto; font-size: 9px; color: var(--text-dim); }
.risk-alert-desc { color: var(--text-dim); font-size: 10px; }

.risk-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border);
  font-size: 10px; color: var(--text-dim);
}

/* Régions (vue ensemble Risques) */
.risk-regions { list-style: none; padding: 0; margin: 0; }
.region-row { display: grid; grid-template-columns: 80px 1fr 32px 50px; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 11px; }
.region-row:last-child { border-bottom: none; }
.region-name { font-weight: 600; color: var(--text); }
.region-bar { height: 6px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.region-fill { display: block; height: 100%; border-radius: 3px; transition: width .3s; }
.region-score { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.region-meta { font-size: 9px; color: var(--text-dim); text-align: right; }

/* Intel feed */
.intel-feed, .intel-live, .xsrc-list { list-style: none; padding: 0; margin: 0; overflow-y: auto; max-height: 280px; }
.intel-item {
  padding: 8px; border-bottom: 1px solid var(--border); font-size: 11px;
  display: flex; flex-direction: column; gap: 4px;
}
.intel-item:last-child { border-bottom: none; }
.intel-header { display: flex; align-items: center; gap: 6px; font-size: 10px; }
.intel-source { color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; font-size: 9px; }
.intel-tag {
  padding: 1px 5px; border-radius: 2px; font-size: 8px; font-weight: 700; letter-spacing: 1px;
}
.intel-tag.alert { background: var(--accent); color: #fff; }
.intel-tag.cyber { background: var(--info); color: #fff; }
.intel-tag.dipl { background: var(--accent-2); color: #000; }
.intel-tag.critical { background: var(--accent); color: #fff; }
.intel-title { font-size: 11px; line-height: 1.35; color: var(--text); }
.intel-meta { font-size: 9px; color: var(--text-dim); display: flex; gap: 8px; }

/* Cross-source */
.xsrc-item { padding: 8px; border-bottom: 1px solid var(--border); display: flex; gap: 8px; align-items: flex-start; }
.xsrc-item:last-child { border-bottom: none; }
.xsrc-num { font-size: 10px; color: var(--text-dim); min-width: 14px; }
.xsrc-body { flex: 1; }
.xsrc-title { font-size: 11px; line-height: 1.35; margin-bottom: 4px; }
.xsrc-tags { display: flex; gap: 4px; flex-wrap: wrap; }

/* Locked */
.locked-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center; gap: 10px; flex: 1;
  background: var(--bg-3); border-radius: 4px;
}
.lock-icon { font-size: 32px; }
.lock-text { font-size: 11px; color: var(--text-dim); }
.signin-btn {
  background: var(--warn); color: #000; border: none; padding: 7px 14px;
  border-radius: 3px; font-size: 10px; font-weight: 700; cursor: pointer;
  font-family: inherit; letter-spacing: 1px;
}

/* World Monitor bar */
.world-monitor-bar {
  text-align: center; padding: 12px; color: var(--text-dim);
  font-size: 10px; letter-spacing: 1.5px;
  background: linear-gradient(90deg, transparent, var(--bg-3), transparent);
}

/* Toast + Modal + Splash */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--bg-2); border: 1px solid var(--accent); color: var(--text); padding: 10px 18px; border-radius: 4px; font-size: 12px; z-index: 9999; animation: toastIn .3s; font-family: inherit; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 2000; }
.modal[hidden] { display: none !important; }
.cam-modal { padding: 40px; background: rgba(0,0,0,.6); }
.cam-modal-box { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; width: min(760px, 70vw); max-height: 70vh; display: flex; flex-direction: column; position: relative; padding: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.7); }
.cam-modal-title { font-size: 12px; letter-spacing: 1px; padding-right: 30px; margin-bottom: 10px; color: var(--text); }
.cam-modal-video { background: #000; aspect-ratio: 16/9; border-radius: 4px; overflow: hidden; position: relative; }
.cam-modal-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.detail-panel[hidden] { display: none !important; }
.search-results[hidden] { display: none !important; }
.modal-box { background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px; padding: 24px; width: 420px; max-width: 90vw; position: relative; }
.modal-box h3 { margin: 0 0 14px; font-size: 14px; letter-spacing: 1px; }
.modal-close { position: absolute; top: 8px; right: 8px; background: none; border: none; color: var(--text-dim); font-size: 20px; cursor: pointer; }
.modal-box hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.small-note { font-size: 10px; color: var(--text-dim); line-height: 1.5; margin: 0; }

#splash { position: fixed; inset: 0; background: var(--bg); z-index: 5000; display: flex; align-items: center; justify-content: center; transition: opacity .5s; }
#splash.hide { opacity: 0; pointer-events: none; }
.splash-inner { text-align: center; }
.splash-dot { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); margin: 0 auto 20px; animation: pulse 1.2s infinite; box-shadow: 0 0 40px var(--accent); }
.splash-logo { width: 96px; height: 96px; margin: 0 auto 20px; filter: drop-shadow(0 0 30px rgba(0,229,255,.8)); animation: argos-spin 8s linear infinite; }
.splash-logo svg { width: 100%; height: 100%; display: block; }
.splash-logo .splash-eyes circle { animation: argos-eye-blink 3s ease-in-out infinite; }
.splash-logo .splash-eyes circle:nth-child(2n) { animation-delay: .4s; }
.splash-logo .splash-eyes circle:nth-child(3n) { animation-delay: .8s; }
.splash-logo .splash-eyes circle:nth-child(5n) { animation-delay: 1.2s; }
@keyframes argos-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.splash-title { font-size: 24px; font-weight: 700; letter-spacing: 6px; margin-bottom: 6px; }
.splash-sub { font-size: 11px; color: var(--text-dim); letter-spacing: 2px; }

/* Responsive */
html, body { overflow-x: hidden; max-width: 100vw; -webkit-text-size-adjust: 100%; }
@media (max-width: 900px) {
  /* MOBILE : autorise le scroll de la page entière */
  html, body { overflow-y: auto !important; overflow-x: hidden; height: auto; min-height: 100%; -webkit-overflow-scrolling: touch; }
  #app {
    width: 100vw; max-width: 100%;
    height: auto; min-height: 100vh;
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) auto auto;
    grid-template-areas: "top" "main" "foot";
  }
  #topbar { position: sticky; top: 0; z-index: 600; }
  #main { overflow: visible !important; height: auto; }
  #map-section { height: 36vh; min-height: 220px; position: relative; }

  /* News + Cam ancrés en haut sur mobile (sticky) */
  [data-panel="news"], [data-panel="camwall"] {
    position: sticky;
    top: var(--topbar-h);
    z-index: 50;
  }
  [data-panel="news"] { top: var(--topbar-h); }
  [data-panel="camwall"] { top: calc(var(--topbar-h) + 8px); }
  #dashboard {
    grid-template-columns: 1fr !important;
    padding: 0; gap: 0; max-width: 100%;
  }
  #dashboard .dash-panel { grid-column: 1 / -1 !important; }
  .drop-zone { display: none; }
  /* Mobile: rightbar devient un bandeau plein largeur DANS la zone main */
  #rightbar {
    display: block !important;
    grid-area: main;
    border-left: none;
    border-top: 1px solid var(--border);
    width: 100%;
    margin-top: 8px;
  }
  #right-panels { padding: 0; gap: 0; }
  #app { display: flex; flex-direction: column; }
  #app > #topbar { flex: 0 0 var(--topbar-h); }
  #app > #sidebar { order: -1; }
  #app > #main { flex: 1; order: 1; }
  #app > #rightbar { order: 2; flex: 0 0 auto; }
  #app > #site-footer { order: 3; flex: 0 0 32px; }
  #main { max-width: 100%; overflow-x: hidden; }
  #sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
    width: 86vw; max-width: 320px; z-index: 1000;
    box-shadow: 4px 0 30px rgba(0,0,0,.7);
    transform: translateX(-100%); transition: transform .25s ease;
  }
  #app.sidebar-open #sidebar { transform: translateX(0); }
  #app.sidebar-open::before {
    content: ""; position: fixed; top: var(--topbar-h); left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.5); z-index: 999;
  }

  /* TOPBAR ultra-compact */
  #topbar { padding: 0 6px; gap: 4px; overflow: hidden; }
  .tb-left, .tb-right { gap: 3px; min-width: 0; }
  .tb-left { flex: 1; overflow: hidden; }
  .tb-center { display: none; }                    /* hide EN DIRECT pill on mobile */
  .brand-title, .brand-ver, .tb-sep, .gh-stars { display: none; }
  .monitor-brand { padding: 0; }
  .brand-logo { font-size: 16px; }
  .dashboards button span, .tb-btn span, .lang-select button span, .dash-chip span { display: none; }
  .dash-chip { padding: 6px 10px; border-radius: 16px; }
  .lang-select button { min-width: 34px; padding: 6px; text-align: center; }
  .defcon-label { display: none; }
  .defcon-box { padding: 4px 6px; gap: 4px; }
  .defcon-icon { display: none; }
  .defcon-value { font-size: 13px; }
  .defcon-delta { font-size: 9px; }
  .dashboards { gap: 2px; }
  .dashboards button, .tb-icon { padding: 6px 7px; width: auto; min-width: 30px; height: 32px; }
  .tb-icon { font-size: 13px; }

  #map-section { height: 40vh; min-height: 240px; }
  #mobileMenuBtn { display: inline-flex !important; }
  .news-tabs button, .cam-tabs button { font-size: 11px; padding: 6px 8px; }
  .weather-grid { grid-template-columns: repeat(3, 1fr); }
  .weather-featured { grid-template-columns: 1fr; padding: 10px; }
  .weather-big-right { grid-template-columns: repeat(2, 1fr); gap: 6px 12px; margin-top: 8px; }
  .cam-thumbs { grid-template-columns: repeat(2, 1fr); }
  .stats-list { grid-template-columns: 1fr 1fr; }

  /* Leaflet zoom controls smaller */
  .leaflet-control-zoom a { width: 28px !important; height: 28px !important; line-height: 28px !important; }
  /* Overlays compacts */
  .map-overlay.top-right-ctl button { width: 28px; height: 28px; font-size: 11px; }
  .map-overlay.top-left { top: 8px; left: 8px; gap: 4px; }
  .map-overlay.top-right-ctl { top: 8px; right: 8px; gap: 3px; }
  .live-pill { font-size: 9px; padding: 3px 7px; }
  .clock { font-size: 9px; padding: 3px 6px; }

  /* Panels more compact */
  .dash-panel { padding: 8px; }
  .dash-head h3 { font-size: 11px; letter-spacing: 1.4px; }
  .panel-source { font-size: 8px; }
  .risk-metrics { gap: 4px; }
  .rmet { padding: 6px 8px; }
  .rmet-val { font-size: 14px; }

  /* Fullscreen cam modal smaller */
  .cam-modal { padding: 12px; }
  .cam-modal-box { width: 94vw; padding: 10px; }
}

@media (max-width: 500px) {
  #map-section { height: 36vh; }
  .weather-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboards button:not(.active) { display: none; } /* only MONDE on tiny screens */
  .dash-chip { padding: 5px 8px; }
}

#mobileMenuBtn { display: none; }
