:root {
  --ink: #0E0E0E;
  --panel: #171717;
  --panel-2: #1f1f1f;
  --line: #2a2a2a;
  --cream: #F6F4EE;
  --soft: #d8d5cc;
  --muted: #a6a39a;
  --yellow: #FFD60A;
  --red: #ff5a4d;
  --green: #5fd38d;
  --gutter: 16px;
  --cols: minmax(0, 1fr) 92px 104px 40px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--cream); font: 400 15px/1.45 'Inter Tight', system-ui, sans-serif; overflow-x: clip; max-width: 100%; }
::selection { background: var(--yellow); color: var(--ink); }
button { font: inherit; color: inherit; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.empty { margin: 0; padding: 10px 0; color: var(--muted); font-size: 14px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

/* Ordre mobile : bandeau, verdict, carte, théories, onglets */
.layout { display: flex; flex-direction: column; }
.panel { display: contents; }
.band { order: 0; }
.verdict { order: 1; }
.mapcol { order: 2; }
.theories { order: 3; }
.tabs { order: 4; }
.foot { order: 5; }
.splitter { display: none; }
.verdict, .theories, .tabs, .foot { margin: 0 var(--gutter); }
.mapcol { padding: 12px var(--gutter) 0; }

/* Bandeau */
.band { background: var(--yellow); color: var(--ink); padding: 10px var(--gutter) 10px; }
.band-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; }
.tag { font-weight: 900; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.status { padding: 1px 10px; border-radius: 99px; font-weight: 700; background: var(--ink); color: var(--cream); font-size: 12px; }
.status-live { color: var(--green); }
.status-cut { color: var(--yellow); }
.status-offline { color: var(--muted); }
.kpi { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; }
.kpi-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.kpi-value { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.kpi-place .kpi-value { font-family: 'Inter Tight', system-ui, sans-serif; font-weight: 900; }
.band-line { display: flex; align-items: baseline; gap: 12px; margin-top: 6px; }
.updated { flex: none; margin-left: auto; font-size: 12px; font-weight: 700; }
.updated.stale { color: #fff; background: var(--red); padding: 1px 8px; border-radius: 6px; }
.headline { display: block; flex: 1 1 auto; min-width: 0; margin: 0; padding: 0; border: 0; background: none; text-align: left; cursor: pointer;
  font-size: 15px; font-weight: 800; letter-spacing: -.01em; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.headline.open { white-space: normal; }
.band.flash { animation: flash 1s ease-out; }
@keyframes flash { 0% { background: #fff; } 100% { background: var(--yellow); } }

/* Jauges : probabilité = barre pleine jaune ; confiance = hachures + mot */
.prob { display: inline-flex; align-items: center; gap: 6px; }
.pbar { width: 36px; height: 6px; background: #333; border-radius: 99px; overflow: hidden; flex: none; }
.pbar i { display: block; height: 100%; background: var(--yellow); border-radius: 99px; }
.pct { font-size: 13px; font-weight: 700; color: var(--yellow); min-width: 34px; text-align: right; }
.prob-big .pbar { width: 80px; height: 10px; }
.prob-big .pct { font-size: 26px; font-weight: 800; min-width: 0; }
.conf { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); min-width: 0; }
.ctrack { width: 28px; height: 8px; border: 1px solid var(--muted); border-radius: 2px; overflow: hidden; flex: none; }
.ctrack i { display: block; height: 100%; background: repeating-linear-gradient(135deg, var(--cream) 0 2px, transparent 2px 4px); }
.cword { padding: 0 4px; border: 1px solid var(--line); border-radius: 3px; font-size: 11px; line-height: 16px; }
.cval { color: var(--cream); font-size: 12px; }
.conf-solide .cword { color: var(--green); border-color: var(--green); }
.conf-plausible .cword { color: var(--cream); border-color: #555; }
.conf-big { font-size: 14px; }
.conf-big .ctrack { width: 64px; height: 12px; }
.conf-big .cword { font-size: 13px; line-height: 20px; padding: 0 6px; }
.conf-big .cval { font-size: 20px; font-weight: 700; }
.conf-big .cval::after { content: ' %'; font-size: 13px; color: var(--muted); }
.trend { font-size: 13px; width: 12px; text-align: center; }
.trend-up { color: var(--green); }
.trend-down { color: var(--red); }
.trend-flat { color: var(--muted); }

/* Verdict */
.verdict { margin-top: 12px; padding: 12px 14px 14px; background: var(--panel); border: 2px solid var(--yellow); border-radius: 12px; }
.verdict.is-clickable { cursor: pointer; }
.verdict.is-clickable:hover { background: var(--panel-2); }
.v-head { display: flex; align-items: baseline; gap: 10px; }
.v-label { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--yellow); }
.v-time { font-size: 12px; color: var(--muted); }
.v-place { margin: 2px 0 8px; font-size: clamp(28px, 7vw, 40px); line-height: 1.02; font-weight: 900; letter-spacing: -.03em; overflow-wrap: anywhere; }
.v-grid { display: grid; gap: 10px; }
.v-metrics { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.v-metric { display: flex; flex-direction: column; gap: 2px; }
.v-mlabel { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.v-reason { margin: 0 0 8px; color: var(--soft); }
.v-next { margin: 0; font-weight: 600; }
.v-next .v-mlabel { color: var(--yellow); margin-bottom: 1px; }
.verdict-none { border-color: var(--line); }
.verdict-none .v-label { color: var(--muted); }
.verdict-none .v-place { font-size: 22px; color: var(--soft); margin-bottom: 6px; }
.verdict-none .v-reason { margin-bottom: 6px; }

/* Théories */
.theories { margin-top: 14px; }
.th-cols { display: grid; grid-template-columns: 1fr; gap: 14px; }
.th-col { min-width: 0; }
.col-title { display: flex; align-items: baseline; gap: 8px; margin: 0 0 4px; font-size: 18px; font-weight: 900; letter-spacing: -.02em; }
.col-hint { font-size: 11px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.col-count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.th-list { list-style: none; margin: 0; padding: 0; }
.th-cols-head { display: grid; grid-template-columns: var(--cols); gap: 8px; padding: 0 8px 3px; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--line); }
.th { border-bottom: 1px solid var(--line); }
.th-row { display: grid; grid-template-columns: var(--cols); align-items: center; gap: 2px 8px; width: 100%; padding: 6px 8px; border: 0; border-left: 2px solid transparent; background: none; text-align: left; cursor: pointer; }
.th-row:hover { background: var(--panel); }
.th-row[aria-expanded="true"] { background: var(--panel); }
.th.is-verdict .th-row { border-left-color: var(--yellow); }
.th-title { font-weight: 700; font-size: 15px; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.th-prob { display: inline-flex; align-items: center; gap: 4px; }
.th-ment { font-size: 12px; color: var(--muted); text-align: right; }
.th-chans { grid-column: 1 / -1; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: -2px; }
.th-detail { padding: 2px 10px 10px; background: var(--panel); }
.th-detail p { margin: 0 0 4px; color: var(--soft); font-size: 14px; }
.th-detail .th-meta { font-size: 11px; color: var(--muted); margin: 0; }
.th.is-gone .th-title { text-decoration: line-through; color: var(--muted); }
.th.is-gone .pbar i { background: #666; }
.th.is-gone .pct { color: var(--muted); }
.fold { display: block; width: 100%; margin: 0; padding: 5px 8px; font-size: 12px; text-align: left; color: var(--muted); background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.fold:hover { color: var(--yellow); }
.th-gone { opacity: .75; }

/* Onglets */
.tabs { margin-top: 16px; }
.tablist { display: flex; gap: 4px; border-bottom: 2px solid var(--line); }
.tablist [role="tab"] { position: relative; padding: 6px 14px; margin-bottom: -2px; border: 0; border-bottom: 2px solid transparent; background: none; font-size: 15px; font-weight: 800; color: var(--muted); cursor: pointer; }
.tablist [role="tab"]:hover { color: var(--cream); }
.tablist [role="tab"][aria-selected="true"] { color: var(--cream); border-bottom-color: var(--yellow); }
.tab-dot { position: absolute; top: 6px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); }
.tabpane { padding-top: 10px; }

.clues { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.clue { padding: 6px 10px; border-left: 3px solid var(--yellow); background: var(--panel); border-radius: 0 8px 8px 0; }
.clue p { margin: 0; }
.clue-text { font-weight: 600; }
.clue-text time { color: var(--muted); font-size: 12px; font-weight: 400; margin-right: 8px; }
.clue-interp { color: var(--yellow); font-size: 14px; }
.clue-links { font-size: 11px; color: var(--muted); }
.clue-more .fold { border: 0; padding: 2px 0; }
.chip { display: inline-block; margin-right: 6px; font-size: 11px; font-weight: 400; padding: 0 5px; border-radius: 4px; background: #2a2a2a; color: var(--cream); vertical-align: 1px; }

.live-grid { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
.frame { margin: 0; }
.frame-open { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); cursor: zoom-in; }
.frame-open img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.frame .empty { padding: 24px 12px; background: var(--panel); border-radius: 8px; text-align: center; }
.frame figcaption { padding-top: 4px; font-size: 11px; color: var(--muted); }
.transcript { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--yellow); }
.transcript li { padding: 2px 0 6px 12px; font-size: 14px; overflow-wrap: anywhere; }
.transcript time { font-size: 11px; color: var(--muted); margin-right: 8px; }
.transcript .empty { padding-left: 12px; }

.news { list-style: none; margin: 0; padding: 0; }
.news-item { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; padding: 5px 0 5px 8px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; font-size: 14px; }
.news-item time { font-size: 11px; color: var(--muted); padding-top: 2px; }
.news-item p { margin: 0; overflow-wrap: anywhere; color: var(--soft); }
.news-item.imp-3 { border-left-color: var(--yellow); }
.news-item.imp-3 p { color: var(--yellow); font-weight: 700; }
.news-item.imp-2 p { color: var(--cream); font-weight: 600; }

.chart { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

.foot { font-size: 11px; color: var(--muted); padding: 20px 0 24px; }

/* Carte */
.map-wrap { position: relative; }
#map { height: 40vh; min-height: 240px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); }
.leaflet-container { font-family: 'Inter Tight', system-ui, sans-serif; }
.leaflet-popup-content { color: var(--ink); margin: 10px 12px; }
.leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.6); }
.recenter { position: absolute; top: 10px; right: 10px; z-index: 800; padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--yellow); background: rgba(14,14,14,.88); border: 1px solid var(--yellow); border-radius: 8px; cursor: pointer; }
.recenter:hover, .recenter:focus-visible { background: var(--yellow); color: var(--ink); }
.pin { width: 22px; height: 22px; border-radius: 50%; background: var(--yellow); border: 3px solid var(--ink); box-shadow: 0 0 0 4px rgba(255,214,10,.45); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px rgba(255,214,10,0); } }
.vpin { position: relative; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--yellow); background: rgba(14,14,14,.75); box-shadow: 0 0 0 2px var(--ink); }
.vpin::after { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--yellow); }
.vpin span { position: absolute; left: 32px; top: 4px; padding: 0 6px; font: 800 11px/16px 'Inter Tight', system-ui, sans-serif; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); background: var(--yellow); border-radius: 3px; white-space: nowrap; }

.legend { position: absolute; left: 8px; bottom: 24px; z-index: 800; max-width: calc(100% - 16px); padding: 4px 8px; font-size: 11px; color: var(--soft); background: rgba(14,14,14,.88); border-radius: 6px; }
.legend summary { cursor: pointer; color: var(--muted); }
.legend ul { list-style: none; margin: 4px 0 2px; padding: 0; display: grid; gap: 2px; }
.lg { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; vertical-align: -1px; }
.lg-last { background: var(--yellow); border: 2px solid var(--ink); box-shadow: 0 0 0 2px rgba(255,214,10,.45); }
.lg-verdict { border: 2px solid var(--yellow); background: radial-gradient(circle, var(--yellow) 0 2px, transparent 2px); }
.lg-ia { background: rgba(255,214,10,.45); border: 1px solid var(--yellow); }
.lg-crowd { border: 1.5px solid var(--cream); }
.lg-debunked { border: 1px dashed #888; }
.lg-hunters { width: 7px; height: 7px; background: #8fa89a; opacity: .7; }
.lg-prev { width: 6px; height: 6px; background: var(--muted); }

.lightbox { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 96vh; cursor: zoom-out; }
.lightbox::backdrop { background: rgba(0,0,0,.85); }
.lightbox img { display: block; max-width: 96vw; max-height: 90vh; border-radius: 8px; }
.lightbox p { margin: 6px 0 0; text-align: center; font-size: 12px; color: var(--muted); }

@media (min-width: 600px) {
  .live-grid { grid-template-columns: minmax(180px, 38%) minmax(0, 1fr); }
}
@media (max-width: 479px) {
  :root { --cols: minmax(0, 1fr) 82px 78px 30px; }
  .conf:not(.conf-big) .ctrack { display: none; }
  .news-item { grid-template-columns: 64px minmax(0, 1fr); }
  .v-metrics { gap: 6px 16px; }
  .prob-big .pbar { width: 52px; }
  .conf-big .ctrack { width: 36px; }
  .prob-big .pct { font-size: 22px; }
}

/* Grand écran : carte à gauche, panneau à droite, seul le panneau défile */
@media (min-width: 1024px) {
  html, body { height: 100%; overflow: hidden; }
  .layout { display: grid; grid-template-columns: var(--mapw, 38%) 8px minmax(0, 1fr); height: 100vh; height: 100dvh; }
  .mapcol { order: 0; padding: 0; height: 100%; min-width: 0; }
  .map-wrap, #map { height: 100%; }
  #map { min-height: 0; border: 0; border-radius: 0; }
  .splitter { display: block; position: relative; cursor: col-resize; touch-action: none; background: var(--ink); z-index: 900; }
  .splitter::before { content: ''; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: var(--line); transition: background .15s; }
  .splitter::after { content: ''; position: absolute; top: 50%; left: 1px; width: 6px; height: 40px; margin-top: -20px; border-radius: 3px; background: #444; }
  .splitter:hover::before, .splitter:focus-visible::before, .resizing .splitter::before { background: var(--yellow); }
  .splitter:hover::after, .splitter:focus-visible::after, .resizing .splitter::after { background: var(--yellow); }
  .splitter:focus-visible { outline: none; }
  .resizing, .resizing * { cursor: col-resize !important; user-select: none; }
  .resizing #map { pointer-events: none; }
  .panel { display: block; height: 100%; min-width: 0; overflow-y: auto; overscroll-behavior: contain; }
  .band { position: sticky; top: 0; z-index: 10; }
  .th-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .th-cols.ia-empty { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .ia-empty .th-col:first-child { display: flex; align-items: baseline; gap: 12px; }
  .ia-empty .th-col:first-child .col-title { margin: 0; }
  .v-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; align-items: start; }
  .v-place { font-size: clamp(30px, 2.6vw, 44px); }
}
