@font-face { font-family: Geist; src: url('/static/vendor/geist-latin.woff2') format('woff2'); font-display: swap; }
:root { color-scheme: dark;
  /* thème sombre unique (l'app n'a pas de thème clair) */
  --bg: #10151a; --surface: #1b232a; --surface-2: #243039;
  --text: #d7e0dc; --dim: #9fb0a8; --accent: #4fb98a; --track: #33424c;
  --shadow: 0 3px 16px #00000073;
  --good: #58c98a; --warn: #e0a33e; --bad: #ef7b7b;
  /* couleurs des sets (mêmes valeurs que DATASET_COLORS dans app.js, surchargées au chargement) */
  --precision: #1fc8e3; --diversity: #9a6bff; --representativite: #ff4fd8; --urban: #1e3a8a; }

/* en mode benchmark, le modèle et le GPS simulé sont dans le formulaire :
   on masque leurs doublons de la barre du haut (le bouton « Positions décalées »
   reste, c'est un réglage d'affichage de carte utilisé par le benchmark) */
body.mode-bench #engine-variant-label, body.mode-bench #gps-sim-label,
body.mode-bench #heat-toggle { display: none; }

/* réglage global « GPS simulé » (barre du haut) : même pilule que le sélecteur de modèle */
#gps-sim-label { position: static; display: flex; align-items: center; gap: 6px;
  padding: 5px 10px; border: 1px solid var(--track); border-radius: 8px;
  background: var(--surface); color: var(--text); font: 600 12px Geist, sans-serif;
  box-shadow: 0 3px 16px var(--shadow); }
#gps-sim-label input[type="number"] { border: none; background: transparent; color: inherit;
  font: inherit; width: 3.1em; text-align: center; padding: 1px 0; }
#gps-sim-label input[type="number"]:focus { outline: 1px solid var(--accent); border-radius: 4px; }
#gps-sim-label input[type="number"]::-webkit-outer-spin-button,
#gps-sim-label input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#gps-sim-label input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
#gps-sim-label .gps-sep { opacity: .55; }
#gps-show, #heat-toggle { position: static; padding: 5px 10px; border: 1px solid var(--track); border-radius: 8px;
  background: var(--surface); color: var(--text); font: 600 12px Geist, sans-serif;
  box-shadow: 0 3px 16px var(--shadow); cursor: pointer; }
#gps-show:not([aria-pressed="true"]):hover, #heat-toggle:not([aria-pressed="true"]):hover { background: var(--track); }
#gps-show[aria-pressed="true"], #heat-toggle[aria-pressed="true"] { background: var(--accent); color: var(--surface); border-color: var(--accent); }
* { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--text); font: 16px Geist, sans-serif; }
[hidden] { display: none !important; }
#drop:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#drop { min-height: 100dvh; outline: none; pointer-events: none; }
#drop.dragging #map { opacity: 0.85; }
/* sous la barre du haut (modes + modèle + GPS simulé) : jamais recouvert */
body.busy #message { top: 118px; }   /* passe sous la pastille de chargement */
#message { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 600; max-width: 440px; line-height: 1.5; padding: 10px 16px; border-radius: 10px; background: var(--surface); color: var(--text); box-shadow: 0 3px 16px var(--shadow); text-align: center; }
#loading { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 600; display: grid; justify-items: center; gap: 8px; text-align: center; pointer-events: none; }
.loading-track { width: 120px; height: 3px; overflow: hidden; background: var(--track); border-radius: 3px; }
.loading-track::after { content: ''; display: block; height: 100%; width: 45%; background: var(--accent); animation: loading 1.2s ease-in-out infinite alternate; }
@keyframes loading { from { transform: translateX(-100%); } to { transform: translateX(225%); } }
#loading-label { padding: 5px 12px; border-radius: 8px; background: var(--surface); box-shadow: 0 3px 16px var(--shadow); font-size: 13px; }
#map { position: fixed; inset: 0; background: var(--track); }
#search { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 1000; width: min(360px, 60vw); }
#search input { width: 100%; padding: 8px 12px; border: 1px solid var(--track); border-radius: 8px; background: var(--surface); color: var(--text); font: 14px Geist, sans-serif; box-shadow: 0 3px 16px var(--shadow); }
#search ul { position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; max-height: 42dvh; overflow-y: auto; margin: 0; padding: 0; list-style: none; border-radius: 8px; background: var(--surface); box-shadow: 0 3px 16px var(--shadow); }
#search li { padding: 8px 12px; font-size: 13px; line-height: 1.4; cursor: pointer; text-align: left; }
#search li:hover { background: var(--track); }
#search li span { display: block; font-size: 11px; opacity: 0.7; }
#elapsed { position: fixed; right: 16px; bottom: 32px; z-index: 1000; padding: 5px 9px; border-radius: 6px; background: var(--surface); color: var(--text); font-variant-numeric: tabular-nums; font-size: 13px; pointer-events: none; }
#comparison { position: fixed; bottom: 62px; left: 16px; z-index: 1000; max-width: calc(50vw - 210px);
  padding: 6px 10px; border-radius: 8px; background: var(--surface); color: var(--text);
  box-shadow: 0 3px 16px var(--shadow); font-size: 12px; }
#legend { position: fixed; right: 16px; bottom: 104px; z-index: 1000; max-width: min(320px, 44vw); padding: 8px 12px; border-radius: 10px; background: var(--surface); color: var(--text); font-size: 12px; line-height: 1.45; box-shadow: 0 3px 16px var(--shadow); }
#legend summary { cursor: pointer; font-weight: 600; }
#legend ul { margin: 6px 0 2px; padding-left: 0; list-style: none; }
#legend li { display: flex; gap: 7px; align-items: flex-start; margin-top: 5px; }
.key-point, .key-heat, .key-rect { flex: none; width: 12px; height: 12px; margin-top: 2px; border-radius: 50%; }
.key-exif { background: #6b7280; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--surface); }
.key-computed { background: linear-gradient(90deg, #58c98a, #e0a33e, #ef6d6d); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--surface); }
.key-search { background: #7a4fd4; border: 2px dashed var(--surface); box-shadow: 0 0 0 1px var(--surface); }
.key-rect { border-radius: 2px; border: 2px dashed #7a4fd4; background: transparent; }
.key-heat { border-radius: 3px; background: linear-gradient(90deg, #1e50eb, #eb2d23); }
#photos { position: fixed; top: 58px; left: 16px; z-index: 1000; width: 264px; max-height: calc(100dvh - 74px); overflow-y: auto; padding: 10px 12px; border-radius: 10px; background: var(--surface); color: var(--text); box-shadow: 0 3px 16px var(--shadow); font-size: 13px; }
#photos-head { display: flex; align-items: center; gap: 8px; }
#photos-head h2 { margin: 0; font-size: 14px; flex: 1; }
#add { width: 30px; height: 30px; border: 1px solid var(--track); border-radius: 8px; background: var(--track); color: var(--text); font: 600 18px/1 Geist, sans-serif; cursor: pointer; }
#image-list { margin: 8px 0 0; padding: 0; list-style: none; max-height: 44dvh; overflow-y: auto; }
#image-list li { padding: 6px; border-radius: 8px; cursor: pointer; }
#image-list li:hover { background: var(--track); }
#image-list li.active { background: var(--track); outline: 1px solid var(--accent); }
#image-list .g-top { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 6px; align-items: center; }
#image-list .g-top > * { min-width: 0; }
#image-list img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
#image-list .g-name { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#image-list .g-info { display: block; font-size: 11px; opacity: 0.75; }
#image-list .g-actions { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
#image-list .g-actions button, #predict-all { border: 1px solid var(--track); border-radius: 8px; background: var(--track); color: var(--text); font: 600 12px Geist, sans-serif; cursor: pointer; padding: 4px 9px; }
#predict-all { width: 100%; margin-top: 8px; padding: 6px; font-weight: 600; }
#gallery-empty { display: block; margin-top: 8px; font-size: 12px; opacity: 0.7; }
#predict { position: fixed; top: 16px; right: 16px; bottom: 16px; z-index: 1000; width: min(300px, 92vw); overflow-y: auto; padding: 10px 12px; border-radius: 10px; background: var(--surface); color: var(--text); box-shadow: 0 3px 16px var(--shadow); font-size: 13px; }
#predict h3 { margin: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#predict label { display: grid; grid-template-columns: 1fr 84px; gap: 8px; align-items: center; margin-top: 6px; }
#predict input, #predict select { width: 100%; padding: 3px 5px; border: 1px solid var(--track); border-radius: 5px; background: transparent; color: inherit; font: inherit; }
#predict input.invalid, #predict select.invalid { outline: 2px solid #c0392b; border-color: #c0392b; }
#predict-actions { display: flex; gap: 6px; margin-top: 10px; }
#predict-actions button { flex: 1; padding: 7px 10px; border-radius: 8px; font: 600 13px Geist, sans-serif; cursor: pointer; }
#predict-launch { border: none; background: var(--accent); color: var(--surface); font-weight: 600; }
#predict-reset, #predict-close { border: 1px solid var(--track); background: var(--track); color: var(--text); }
#exif-hint { display: block; margin-top: 6px; font-size: 11px; opacity: 0.8; }
@media (prefers-reduced-motion: reduce) { .loading-track::after { animation: none; transform: translateX(60%); } }

/* ---------- Datasets Panoramax (sélecteur de contexte + panneau + modale 360°) ---------- */
/* la barre du haut ne capture pas les clics hors de ses boutons (sinon elle masque les panneaux) */
#topbar-left { pointer-events: none; }
#topbar-left > * { pointer-events: auto; }
#topbar-left { position: fixed; top: 16px; left: 16px; z-index: 1003; display: flex;
  flex-wrap: wrap; gap: 8px; align-items: stretch; max-width: calc(100vw - 32px); }
#modes { position: static; display: flex;
  border: 1px solid var(--track); border-radius: 8px; overflow: hidden;
  background: var(--surface); box-shadow: 0 3px 16px var(--shadow); }
#modes button { padding: 6px 12px; border: none; background: transparent; color: var(--text);
  font: 600 13px Geist, sans-serif; cursor: pointer; }
#modes button + button { border-left: 1px solid var(--track); }
#modes button[aria-pressed="true"] { background: var(--accent); color: var(--surface); }
#modes button:not([aria-pressed="true"]):hover { background: var(--track); }
#engine-variant-label { position: static; display: flex;
  align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--track);
  border-radius: 8px; background: var(--surface); color: var(--text);
  font: 600 12px Geist, sans-serif; box-shadow: 0 3px 16px var(--shadow); }
#engine-variant-label select { border: none; background: transparent; color: inherit;
  font: inherit; cursor: pointer; }
#engine-variant-label select:disabled { opacity: .5; cursor: not-allowed; }
/* seuil de confiance : même pilule que le sélecteur de modèle */
#conf-threshold-label { position: static; display: flex;
  align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--track);
  border-radius: 8px; background: var(--surface); color: var(--text);
  font: 600 12px Geist, sans-serif; box-shadow: 0 3px 16px var(--shadow); }
#conf-threshold-label input[type="number"] { border: none; background: transparent; color: inherit;
  font: inherit; width: 3.4em; text-align: center; padding: 1px 0; }
#conf-threshold-label input[type="number"]:focus { outline: 1px solid var(--accent); border-radius: 4px; }
#conf-threshold-label input[type="number"]::-webkit-outer-spin-button,
#conf-threshold-label input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#conf-threshold-label input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
/* en mode datasets, l'UI d'import est masquée (états conservés côté app.js) */
body.mode-datasets #photos, body.mode-datasets #predict, body.mode-datasets #datasets { position: fixed; top: 58px; left: 16px; z-index: 1001; width: 264px; max-height: calc(100dvh - 90px);
  overflow-y: auto; padding: 10px 12px; border-radius: 10px; background: var(--surface);
  color: var(--text); box-shadow: 0 3px 16px var(--shadow); font-size: 13px; }
/* en mode datasets : l'UI d'import (Photos + légende) est masquée */
body.mode-datasets #photos, body.mode-datasets #legend { display: none; }

#datasets:not([hidden]) { display: block; }
#datasets-head { display: flex; align-items: center; gap: 8px; }
#datasets-head h3 { margin: 0; font-size: 14px; flex: 1; }
#ds-close { border: none; background: none; color: inherit; font-size: 14px; cursor: pointer; }
#ds-sets, #ds-modes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
#ds-sets label, #ds-modes label { cursor: pointer; border: 1px solid var(--track);
  border-radius: 12px; padding: 2px 9px; font-size: 12px; display: inline-flex; gap: 5px; align-items: center; }
#ds-sets label:has(input:checked), #ds-modes label:has(input:checked) { background: var(--accent); color: var(--surface); border-color: var(--accent); }
#ds-sets input, #ds-modes input { accent-color: currentColor; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
#ds-rig-label { display: grid; grid-template-columns: 1fr 120px; gap: 8px; align-items: center; margin-top: 8px; }
#ds-rig { width: 100%; padding: 3px 5px; border: 1px solid var(--track); border-radius: 5px; background: transparent; color: inherit; font: inherit; }
#ds-count { margin: 8px 0 0; font-size: 12px; opacity: .85; }
#ds-actions { display: flex; gap: 6px; margin-top: 8px; }
#ds-actions button { flex: 1; padding: 6px 4px; border-radius: 6px; border: 1px solid var(--track);
  background: var(--track); color: var(--text); font: inherit; cursor: pointer; }
#ds-hint { margin: 8px 0 0; font-size: 11px; opacity: .7; }
/* ---------- panneau photo réutilisable (Import / Datasets / Benchmark) ---------- */
.photo-panel { background: var(--surface); color: var(--text); border-radius: 12px; overflow: hidden;
  box-shadow: 0 4px 18px var(--shadow); font-size: 12px; display: flex; flex-direction: column; }
.photo-panel.pp-docked { position: fixed; top: 16px; right: 16px; bottom: auto; max-height: calc(100dvh - 32px); z-index: 1004;
  width: min(430px, 94vw); }
.photo-panel.pp-fullscreen { position: fixed; inset: 0; z-index: 4000; background: #0b0b0b; color: #fff;
  border-radius: 0; width: auto; margin: 0; border: 0; }
.pp-head { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-bottom: 1px solid var(--track); }
.pp-fullscreen .pp-head { border-color: #ffffff22; }
.pp-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pp-title { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-sub { font-size: 11px; opacity: 0.65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-tools { display: flex; align-items: center; gap: 6px; }
.pp-tools button, .pp-tools label { border: 1px solid var(--track); border-radius: 7px; background: var(--surface);
  color: inherit; font: 600 11.5px Geist, sans-serif; padding: 5px 8px; cursor: pointer; }
.pp-fullscreen .pp-tools button, .pp-fullscreen .pp-tools label { background: #ffffff14; border-color: #ffffff2b; color: #fff; }
.pp-fullscreen .pp-actions button { background: #ffffff14; border-color: #ffffff2b; color: #fff; }
.pp-fullscreen .pp-actions button.primary { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.pp-fullscreen .pp-lines dt { opacity: .55; }
.pp-tools label { display: inline-flex; align-items: center; gap: 5px; }
.pp-tools label input { accent-color: #e33; }
.pp-tools button:disabled { opacity: .5; cursor: default; }
.pp-view { position: relative; background: #111; flex: none; height: min(36dvh, 300px); }
.pp-docked .pp-view { height: min(38dvh, 320px); }
.pp-fullscreen .pp-view { flex: 1; height: auto; }
.pp-pano { position: absolute; inset: 0; }
.pp-flat { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; }
.pp-flat img { max-width: 96%; max-height: 96%; border-radius: 6px; object-fit: contain; }
.pp-fullscreen .pp-flat img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; }
.pp-fullscreen .pp-flat img { max-width: 100%; max-height: 100%; }
.pp-front-cv { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.pp-lines { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; padding: 9px 12px;
  overflow-y: auto; max-height: 30dvh; }
.pp-fullscreen .pp-lines { max-height: 24dvh; }
.pp-lines dt { opacity: .65; font-weight: 600; white-space: nowrap; }
.pp-lines dd { margin: 0; overflow-wrap: anywhere; }
.pp-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 12px 9px; }
.pp-actions button { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--track);
  background: var(--surface); color: inherit; font: 600 12px Geist, sans-serif; cursor: pointer; }
.pp-actions button.primary { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.pp-actions button:disabled { opacity: .5; cursor: default; }
.pp-status { margin: 0; padding: 0 12px 10px; min-height: 13px; font-size: 11.5px; opacity: .85; }

/* ---------- séquence + prédiction dataset ---------- */
#ds-seq { margin-top: 10px; border-top: 1px solid var(--track); padding-top: 8px; }
#ds-seq-head { display: flex; align-items: center; gap: 8px; }
#ds-seq-head b { flex: 1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ds-seq-head button { border: none; background: none; color: inherit; cursor: pointer; }
#ds-seq-photos { list-style: none; margin: 6px 0; padding: 0; max-height: 26dvh; overflow-y: auto; font-size: 11px; }
#ds-seq-photos li { padding: 2px 4px; border-radius: 4px; display: flex; justify-content: space-between; gap: 6px; }
#ds-seq-photos li.running { background: #e0a33e33; }
#ds-seq-photos li.done { background: #4fb98a2e; }
#ds-seq-photos li.error { background: #c0392b33; }
#ds-seq-predict { width: 100%; padding: 6px 4px; border-radius: 6px; border: none;
  background: var(--accent); color: var(--surface); font: 600 12px Geist, sans-serif; cursor: pointer; }
#ds-seq-predict:disabled { opacity: .5; cursor: default; }
#ds-seq-status { margin: 6px 0 0; font-size: 11px; opacity: .85; }

/* séquence logée sous le panneau photo : compacte + gouttière du panneau */
.pp-extra #ds-seq { margin: 8px 12px 10px; padding-top: 8px; }
.pp-extra #ds-seq-head b { font-size: 12px; }
.pp-extra #ds-seq-head button { font: 600 12px Geist, sans-serif; padding: 2px 4px; border-radius: 6px; }
.pp-extra #ds-seq-head button:hover { background: var(--track); }
.pp-extra #ds-seq-photos { margin: 6px 0; max-height: 24dvh; font-size: 11px; line-height: 1.45; }
.pp-extra #ds-seq-photos li { padding: 1px 6px; }
.pp-extra #ds-seq-predict { font: 600 12px Geist, sans-serif; padding: 6px 10px; border-radius: 8px; }
.pp-extra #ds-seq-status { font-size: 11.5px; line-height: 1.45; }

/* ---------- Benchmark des datasets ---------- */
body.mode-bench #photos, body.mode-bench #predict, body.mode-bench #bench { position: fixed; top: 58px; left: 16px; z-index: 1001; width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 90px); overflow-y: auto; display: none; padding: 12px 14px;
  border-radius: 10px; background: var(--surface); color: var(--text);
  box-shadow: 0 3px 16px var(--shadow); font-size: 13px; }
#bench { display: none; }
body.mode-bench #bench { display: block; }
/* en mode benchmark : pas de légende d'import */
body.mode-bench #legend { display: none; }
#bench-head { display: flex; align-items: center; gap: 8px; }
#bench-head h3 { margin: 0; font-size: 15px; flex: 1; }
#bench-close { border: none; background: none; color: inherit; font-size: 15px; cursor: pointer; }
#bench-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px; align-items: start; margin-top: 10px; }
#bench-form label { display: flex; flex-direction: column; gap: 3px; font-weight: 600;
  font-size: 12px; min-width: 0; }
#bench-sets { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#bench-sets label { flex-direction: row; font-weight: 600; font-size: 12px; gap: 5px; cursor: pointer;
  border: 1px solid var(--track); border-radius: 12px; padding: 2px 9px;
  display: inline-flex; align-items: center; }
#bench-sets label:has(input:checked) { background: var(--accent); color: var(--surface); border-color: var(--accent); }
#bench-sets input { accent-color: currentColor; }
#bench-form select, #bench-form input[type="number"] { border: 1px solid var(--track);
  border-radius: 6px; padding: 5px 7px; background: transparent; color: inherit; font: inherit;
  width: 100%; min-width: 0; }
.bench-gps-range { display: flex; align-items: center; gap: 6px; }
.bench-gps-range input[type="number"] { text-align: center; }
#bench-form .gps-sep { opacity: .55; }
#bench-launch { grid-column: 3 / span 2; align-self: end; border: 1px solid var(--accent); background: var(--accent);
  color: var(--surface); border-radius: 7px; padding: 7px 14px; font: 600 13px Geist, sans-serif;
  cursor: pointer; }
#bench-launch:disabled { opacity: .55; cursor: wait; }
#bench-launch-status { grid-column: 1 / -1; margin: 0; opacity: .8; }
.run-config { font-size: 12px; opacity: .75; margin: 2px 0 0; }
@media (max-width: 720px) {
  #bench-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #bench-launch { grid-column: 1 / -1; }
}
#bench-track { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; margin: 12px 0 6px; }
#bench-bar { height: 100%; width: 0; background: var(--accent); transition: width .4s ease; }
#bench-status, #bench-livestats { margin: 2px 0; }
#bench-livestats { opacity: .8; }
#bench-live-hist { width: 100%; max-height: 120px; margin-top: 6px; }
.bench-chart h4 { margin: 0 0 4px; font-size: 12px; }
.bench-chart canvas { width: 100%; max-height: 220px; }
#bench-history { margin-top: 12px; border-top: 1px solid var(--track); padding-top: 8px; }
#bench-history h4 { margin: 0 0 6px; font-size: 13px; }
#bench-runs { list-style: none; margin: 0; padding: 0; }
#bench-runs .run-id { font-family: monospace; font-size: 11px; opacity: .8; }
#bench-runs .run-meta { flex: 1; }
#bench-runs button { border: 1px solid var(--track); background: transparent; color: inherit;
  border-radius: 6px; padding: 2px 8px; font: 600 11px Geist, sans-serif; cursor: pointer; }

/* cônes d'orientation des points datasets (couleur = source du cap) */

/* ---------- vue complète d'un benchmark ---------- */
#bench-view { position: fixed; inset: 0; z-index: 2000; background: var(--surface);
  color: var(--text); display: flex; flex-direction: column; }
#bv-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--track); }
#bv-head b { font-size: 15px; }
#bv-config { flex: 1; opacity: .8; font-size: 12px; }
#bv-close { border: none; background: none; color: inherit; font-size: 17px; cursor: pointer; }
#bv-filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 16px;
  border-bottom: 1px solid var(--track); align-items: center; }
#bv-filters label { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; }
#bv-filters select, #bv-filters input { border: 1px solid var(--track); border-radius: 6px;
  padding: 3px 6px; background: transparent; color: inherit; font: inherit; }
#bv-filters input[type="number"] { width: 70px; }
#bv-filters input[type="search"] { width: 170px; }
#bv-tabs { display: flex; gap: 6px; padding: 8px 16px 0; }
#bv-tabs button { border: 1px solid var(--track); background: transparent; color: inherit;
  border-radius: 8px 8px 0 0; padding: 5px 12px; font: 600 13px Geist, sans-serif; cursor: pointer; }
#bv-tabs button[aria-pressed="true"] { background: var(--accent); color: var(--surface); border-color: var(--accent); }
#bv-content { flex: 1; overflow-y: auto; padding: 12px 16px 24px; }
.bv-cards { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.bv-card { border: 1px solid var(--track); border-radius: 8px; padding: 8px 12px; min-width: 118px; }
.bv-card b { display: block; font-size: 18px; }
.bv-card span { font-size: 11px; opacity: .75; }
.bv-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bv-charts h4 { margin: 0 0 4px; font-size: 13px; }
.bv-table { border-collapse: collapse; width: 100%; font-size: 12px; margin-bottom: 12px; }
.bv-table th, .bv-table td { border: 1px solid var(--track); padding: 3px 7px; text-align: right; }
.bv-table th:first-child, .bv-table td:first-child { text-align: left; }
.bv-table th.sortable { cursor: pointer; user-select: none; }
.bv-table caption { text-align: left; font-weight: 600; padding: 4px 0; }
.bv-photo-preview { float: right; width: min(420px, 42vw); margin: 0 0 10px 14px;
  border: 1px solid var(--track); border-radius: 8px; padding: 8px; font-size: 12px; }
.bv-photo-preview img { width: 100%; border-radius: 6px; }
.bv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bv-actions button { border: 1px solid var(--track); background: transparent; color: inherit;
  border-radius: 7px; padding: 4px 10px; font: 600 12px Geist, sans-serif; cursor: pointer; }
.bv-actions button:hover { background: var(--track); }
/* ---------- accordéon générique (historique benchmark, photos…) ---------- */
.acc-list, #bench-runs { list-style: none; margin: 0; padding: 0; }
.acc-item { display: flex; flex-direction: column; align-items: stretch; padding: 0; }
.acc-line { display: flex; gap: 7px; align-items: center; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.acc-line:hover { background: var(--track); }
.acc-item.open > .acc-line { background: var(--track); font-weight: 600; }
.acc-caret { flex: none; width: 12px; opacity: .7; }
.acc-body { padding: 8px 10px 12px; margin: 2px 0 6px; border-left: 3px solid var(--accent);
  background: #ffffff08; border-radius: 0 8px 8px 0; }
.acc-head { padding: 4px 8px 4px 27px; font-size: 11px; font-weight: 600; opacity: .65; }
.acc-line-cells { flex: 1; display: grid; grid-template-columns: var(--cols, 1fr); gap: 8px; align-items: center; min-width: 0; }
.acc-line-cells span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-sortable { cursor: pointer; }
.acc-sortable:hover { text-decoration: underline; }
.acc-headrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acc-headrow p { flex: 1; }
.pp-tool { border: 1px solid var(--track); border-radius: 8px; background: var(--surface);
  color: inherit; font: 600 12px Geist, sans-serif; padding: 6px 10px; cursor: pointer; }
.run-state.done { color: var(--good); }
.run-state.running { color: var(--warn); }
.run-state.error, .run-state.interrupted { color: var(--bad); }
.bench-hint-inline { font-weight: 400; opacity: .6; font-size: 11px; }
.run-stat { font-size: 12.5px; margin-bottom: 5px; }
.run-stat .run-variant { display: inline-block; min-width: 96px; font-weight: 600; }
.run-stat b { font-size: 14px; }
.run-loading { margin: 4px 0; opacity: .6; }
.run-empty { padding: 8px; opacity: .6; }
.run-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 9px; }
.run-actions button { padding: 8px 13px; border-radius: 9px; border: 1px solid var(--track);
  background: var(--surface); color: inherit; font: 600 13px Geist, sans-serif; cursor: pointer; }
.run-actions button:hover { background: var(--track); }
.run-actions button.primary { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.run-actions button:disabled { opacity: .45; cursor: not-allowed; }
.bv-launch-note { font-size: 12px; color: var(--dim); }
.export-group { display: inline-flex; border: 1px solid var(--track); border-radius: 9px; overflow: hidden; }
.export-group select { border: none; background: var(--surface); color: inherit; font: 600 12px Geist, sans-serif;
  padding: 0 8px; cursor: pointer; }
.export-group button { border: none; border-left: 1px solid var(--track); border-radius: 0; }

/* ---------- légendes de carte (composants communs) ---------- */
/* pas de filtre CSS sur les points : coûteux (repaint de chaque <path> à chaque frame) ;
   lisibilité assurée par le liseré blanc + le rendu canvas */
.bv-legend { line-height: 1.9; }
.bv-chip { display: inline-flex; align-items: center; gap: 5px; margin-right: 12px; font-weight: 600; }

/* écrans étroits : bandeau de comparaison plus large, légende remontée au-dessus */
@media (max-width: 760px) {
  #comparison { max-width: min(92vw, 460px); }
  #legend { bottom: 118px; }
}

/* mobile : le panneau photo ancré démarre sous la barre du haut (elle peut faire 2 lignes) */
@media (max-width: 760px) {
  .photo-panel.pp-docked { top: 96px; bottom: 12px; right: 8px; width: min(430px, calc(100vw - 16px)); }
}

/* ---------- normalisation des composants (audit transverse) ---------- */
#ds-rig, #bench input, #bench select, #predict input, #predict select {
  font: 13px Geist, sans-serif; border-radius: 8px; }
#bench-sample { font: 600 13px Geist, sans-serif; }
#bench-launch, #ds-seq-predict, .pp-actions button, #predict-actions button, .pp-tool, .run-actions button, .run-details {
  border-radius: 8px; font: 600 13px Geist, sans-serif; }
#ds-close, #bench-close { font: 600 13px Geist, sans-serif; border: 1px solid var(--track);
  border-radius: 8px; background: var(--surface); color: inherit; padding: 3px 9px; cursor: pointer; }
#legend[hidden] { display: none; }

/* mobile : panneaux sous la barre du haut et au-dessus de la recherche */
@media (max-width: 760px) {
  body.mode-datasets #datasets, body.mode-bench #bench, #photos, #predict {
    top: 96px; bottom: 76px; left: 8px; right: 8px; width: auto; max-height: none; }
  .photo-panel.pp-docked { top: 96px; bottom: 76px; max-height: none; right: 8px; width: min(430px, calc(100vw - 16px)); }
}

/* cibles tactiles et lisibilité (audit accessibilité) */
#ds-close, #bench-close, .pp-close, .pp-expand { min-width: 28px; min-height: 28px; }
#gallery-empty, .bench-hint-inline, #ds-hint, .acc-head, .pp-sub { opacity: 0.8; }

/* ---------- accessibilité : contrastes secondaires, focus, mouvement réduit ---------- */
.pp-lines dt, .g-info, #ds-count, #ds-seq-status, .pp-status, #bench-launch-status,
#bv-config, .bv-card span, .run-id, .pp-sub { opacity: 0.8; }
.photo-panel:focus { outline: none; }
#bench-view { outline: none; }
@media (prefers-reduced-motion: reduce) {
  #bench-bar { transition: none; }
  * { animation-duration: 0.001ms !important; }
}

/* alternative clavier : liste de photos du mode datasets */
#ds-kbd-label { display: block; margin-top: 8px; font-size: 11px; opacity: .8; }
#ds-kbd-photo { width: 100%; margin-top: 3px; font: 13px Geist, sans-serif; border-radius: 8px; }

/* ---------- carte en thème sombre ---------- */
.leaflet-container { background: var(--bg); }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--surface); color: var(--text); border-bottom-color: var(--track); }
.leaflet-bar a:hover { background: var(--surface-2); }
.leaflet-control-attribution { background: #1b232acd; color: var(--dim); }
.leaflet-control-attribution a { color: var(--accent); }
.leaflet-tooltip { background: var(--surface); color: var(--text); border: 1px solid var(--track); box-shadow: var(--shadow); }
.leaflet-tooltip-top:before, .leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before, .leaflet-tooltip-right:before { border-color: transparent; }
.leaflet-tooltip-top:before { border-top-color: var(--surface); }
.leaflet-tooltip-bottom:before { border-bottom-color: var(--surface); }
.leaflet-tooltip-left:before { border-left-color: var(--surface); }
.leaflet-tooltip-right:before { border-right-color: var(--surface); }

/* ---------- historique des runs : ligne en grille alignée ---------- */
#bench-runs .run-row { display: grid; grid-template-columns: minmax(0, 1fr) 54px 76px 58px 58px auto;
  gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
#bench-runs .run-row:hover { background: var(--surface-2); }
#bench-runs .run-item.active > .run-row { outline: 2px solid var(--accent); outline-offset: -2px; }
#bench-runs .run-details { border: 1px solid var(--track); border-radius: 8px; background: var(--surface);
  color: inherit; font: 600 12px Geist, sans-serif; padding: 6px 12px; cursor: pointer; justify-self: end; }
#bench-runs .run-details:hover { background: var(--surface-2); }
#bench-runs .run-row .run-head { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
#bench-runs .run-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
#bench-runs .run-model { flex: none; padding: 1px 7px; border: 1px solid var(--track); border-radius: 999px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); }
#bench-runs .run-title .run-id { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#bench-runs .run-row .run-id { font-size: 12.5px; font-variant-numeric: tabular-nums; opacity: 1; }
#bench-runs .run-row .run-tags { font-size: 11px; color: var(--dim); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
#bench-runs .run-row .run-state { flex: none; padding: 1px 7px; border: 1px solid currentColor;
  border-radius: 999px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; white-space: nowrap; }
#bench-runs .run-row .run-kpi { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
#bench-runs .run-row .run-kpi b { font-size: 13px; font-variant-numeric: tabular-nums; }
#bench-runs .run-row .run-kpi small { font-size: 10px; color: var(--dim); }
@media (max-width: 760px) {
  /* historique mobile : id sur une ligne, état + médiane ensuite, actions dessous */
  #bench-runs .acc-line { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
  #bench-runs .run-row .run-head { flex: 1 1 calc(100% - 26px); }
  #bench-runs .run-row .run-kpi--median { order: 3; margin-left: auto; }
  #bench-runs .acc-line .acc-actions { order: 4; flex: 1 1 100%; justify-content: flex-start; }
  #bench-runs .run-row .run-kpi--recall, #bench-runs .run-row .run-kpi--cap { display: none; }
}

/* ---------- barre du run dans la fenêtre benchmark ---------- */
#bv-run { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 16px 10px;
  border-bottom: 1px solid var(--track); }
.bv-run-stats { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 220px; }
#bv-run .run-actions { margin: 0; }
