/* MAMH - Feux de forêt - aide à la décision pour les projets - v3 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --header-bg:    #d2dcd2;
  --header-text:  #1a2e1a;
  --accent:       #2980b9;
  --accent-dark:  #2471a3;
  --panel-bg:     #f9f9f9;
  --panel-border: #dde2e8;
  --box-bg:       #ffffff;
  --box-shadow:   0 2px 8px rgba(0,0,0,0.08);
  --text-main:    #2a2a2a;
  --text-muted:   #6b7280;
  --text-label:   #374151;
  --navy:         #2C3E50;
  --humain:       #56B4E9;
  --foudre:       #E69F00;
  --burn:         #8b0000;
}

html { height: 100%; overflow: hidden; }
body {
  height: 100%; overflow: hidden;
  font-family: 'Source Sans 3', sans-serif;
  background: var(--panel-bg); color: var(--text-main);
  display: flex; flex-direction: column;
}

/* ── Header ── */
#header {
  flex-shrink: 0; background: var(--header-bg);
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; gap: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10); z-index: 10;
  border-bottom: 2px solid #aebfae; min-height: 88px;
}
#header h1 {
  font-family: 'Oswald', sans-serif; font-size: 18px; font-weight: 600;
  letter-spacing: 0.8px; text-transform: uppercase; color: var(--header-text); line-height: 1.3;
}
#header h1 .hdr-sub {
  display: block; margin-top: 3px; font-family: 'Source Sans 3', sans-serif; font-size: 14px; font-weight: 400;
  letter-spacing: 0.2px; text-transform: none; color: #3f4f3f;
}
#header h1 .hdr-ver { margin-left: 10px; font-size: 12px; font-style: italic; white-space: nowrap; }
#header-logo { padding: 2px 4px; }
#header-logo img { height: 60px; width: auto; display: block; }
#header-right { display: flex; align-items: center; gap: 18px; }
.lang-switch { display: flex; border: 1px solid #b9c9b9; border-radius: 6px; overflow: hidden; background: #fff; }
.lang-btn {
  border: none; background: none; padding: 6px 11px; cursor: pointer; font-family: 'Oswald', sans-serif;
  font-size: 12.5px; letter-spacing: 1px; color: var(--text-muted);
}
.lang-btn + .lang-btn { border-left: 1px solid #b9c9b9; }
.lang-btn.active { background: var(--navy); color: #fff; }
.lang-btn:not(.active):hover { color: var(--accent); }

#app { flex: 1; min-height: 0; display: flex; overflow: hidden; }

/* ── Panneau gauche ── */
#panel {
  width: 33vw; min-width: 340px; max-width: 620px; flex-shrink: 0;
  background: var(--panel-bg); border-right: 1px solid var(--panel-border);
  display: flex; flex-direction: column; overflow: hidden;
}
#panel-tabs { display: flex; flex-shrink: 0; border-bottom: 2px solid var(--panel-border); background: var(--box-bg); }
.tab-btn {
  flex: 1; padding: 9px 6px; font-family: 'Oswald', sans-serif; font-size: 11px;
  letter-spacing: 0.9px; text-transform: uppercase; color: var(--text-muted);
  background: none; border: none; border-bottom: 3px solid transparent; margin-bottom: -2px;
  cursor: pointer; transition: color 0.18s, border-color 0.18s; line-height: 1.3;
}
.tab-btn:hover { color: var(--accent); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-pane { display: none; flex: 1; overflow-y: auto; overflow-x: hidden; padding: 14px 12px; gap: 12px; flex-direction: column; }
.tab-pane.active { display: flex; }
.tab-pane::-webkit-scrollbar { width: 5px; }
.tab-pane::-webkit-scrollbar-thumb { background: #c9d0d8; border-radius: 3px; }

.panel-section { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.panel-label {
  font-family: 'Oswald', sans-serif; font-size: 10px; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--text-muted);
}
.panel-label.step-label { font-size: 14px; font-weight: 600; letter-spacing: 1px; color: var(--header-text); }
.info-btn {
  width: 20px; height: 20px; border-radius: 50%; border: none; background: var(--accent); color: #fff; cursor: pointer;
  font: italic 700 12.5px/1 Georgia, serif; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.info-btn:hover { background: var(--accent-dark); }
.divider { border: none; border-top: 1px solid var(--panel-border); flex-shrink: 0; }

.box {
  background: var(--box-bg); border: 1px solid var(--panel-border);
  border-radius: 8px; padding: 10px 12px; box-shadow: var(--box-shadow); flex-shrink: 0;
}
.box-title {
  font-family: 'Oswald', sans-serif; font-size: 13px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: var(--navy); display: flex; align-items: center; gap: 8px;
  justify-content: space-between;
}
.box-sub { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.muted { color: var(--text-muted); font-size: 12px; line-height: 1.45; }

/* ── Bouton générique ── */
.btn {
  background: var(--accent); border: none; border-radius: 6px; color: #fff;
  font-family: 'Oswald', sans-serif; font-size: 12px; letter-spacing: 0.8px; text-transform: uppercase;
  padding: 7px 11px; cursor: pointer; transition: background 0.2s; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--text-label); border: 1px solid var(--panel-border); }
.btn.secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn.secondary.on { background: #eaf3fa; border-color: var(--accent); color: var(--accent-dark); }
.btn.navy { background: var(--navy); }
.btn.navy:hover { background: #1a252f; }
.btn.green { background: #4a7c4e; }
.btn.green:hover { background: #3a6340; }
.btn.full { width: 100%; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }
.icon-btn {
  background: none; border: 1px solid var(--panel-border); border-radius: 50%; width: 22px; height: 22px;
  font-size: 12px; line-height: 1; color: var(--text-muted); cursor: pointer; flex-shrink: 0;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ── Sélecteur de mode (MRC / zone) ── */
.seg { display: flex; border: 1px solid var(--panel-border); border-radius: 7px; overflow: hidden; background: #fff; box-shadow: var(--box-shadow); }
.seg button {
  flex: 1; border: none; background: none; padding: 7px 6px; cursor: pointer;
  font-family: 'Oswald', sans-serif; font-size: 11.5px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted);
}
.seg button + button { border-left: 1px solid var(--panel-border); }
.seg button.active { background: var(--accent); color: #fff; }

/* ── Combobox avec autocomplétion ── */
.combo { position: relative; }
.combo input {
  width: 100%; background: var(--box-bg); border: 1px solid var(--panel-border); border-radius: 6px;
  color: var(--text-main); font-family: 'Source Sans 3', sans-serif; font-size: 13px;
  padding: 7px 30px 7px 9px; outline: none; transition: border-color 0.2s; box-shadow: var(--box-shadow);
}
.combo input:focus, .combo input:hover { border-color: var(--accent); }
.combo input:disabled { opacity: 0.5; cursor: not-allowed; }
.combo .combo-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  border: none; background: none; color: var(--text-muted); cursor: pointer; font-size: 11px; padding: 4px 6px;
}
.combo .combo-clear { right: 22px; font-size: 13px; display: none; }
.combo.has-value .combo-clear { display: block; }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 60;
  max-height: 300px; overflow-y: auto; background: #fff; border: 1px solid var(--accent);
  border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); display: none;
}
.combo.open .combo-list { display: block; }
.combo-item { padding: 6px 10px; font-size: 13px; cursor: pointer; line-height: 1.3; }
.combo-item small { color: var(--text-muted); font-size: 11.5px; }
.combo-item.hl, .combo-item:hover { background: #eaf3fa; }
.combo-item mark { background: #fff1b8; color: inherit; padding: 0; }
.combo-empty { padding: 8px 10px; font-size: 12px; color: var(--text-muted); }
/* Recherche d'adresse (section 1) : champ sans boutons internes */
.geo-search { flex: 1; min-width: 180px; }
.geo-search input { padding-right: 9px; }
.proj-or { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Indice de prédisposition ── */
#expo-box { position: relative; }
.expo-value { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.expo-num { font-family: 'Oswald', sans-serif; font-size: 22px; font-weight: 600; }
.expo-rank { font-size: 12.5px; color: var(--text-label); }
.expo-note { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.legend-bar {
  height: 12px; border-radius: 4px; margin: 6px 0 3px; position: relative; border: 1px solid #d5dbe1;
  background: linear-gradient(to right, rgba(141,184,64,0) 0%, rgba(141,184,64,0.35) 10%, #8db840 25%, #f5e000 50%,
    #f39c12 62%, #e31a1c 80%, #67001f 100%), #fff;
}
.legend-bar .marker {
  position: absolute; top: -4px; width: 3px; height: 20px; background: #111; border-radius: 2px;
  box-shadow: 0 0 0 1.5px #fff; transform: translateX(-50%); display: none;
}
.legend-bar .band {
  position: absolute; top: -3px; height: 18px; background: rgba(20,20,20,0.22);
  border: 1px solid rgba(255,255,255,0.9); border-radius: 3px; display: none;
}
.legend-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-muted); }

/* Boîtes repliables */
.box.collapsible .box-toggle { cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 6px; position: relative; }
.box.collapsible .chev {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  transition: transform 0.15s; font-size: 20px; line-height: 1; color: var(--accent);
  border-radius: 50%; background: #eaf3fa;
}
.box.collapsible .box-toggle:hover .chev { background: var(--accent); color: #fff; }
/* Infobulle d'aide au survol du titre */
.box.collapsible .box-toggle[data-hint]:hover::after {
  content: attr(data-hint); position: absolute; left: 0; top: calc(100% + 8px); z-index: 80;
  width: 290px; padding: 8px 11px; border-radius: 7px; background: rgba(30,40,30,0.96); color: #f0f4f0;
  font-family: 'Source Sans 3', sans-serif; font-size: 12px; font-weight: 400; letter-spacing: 0; line-height: 1.45;
  text-transform: none; white-space: normal; box-shadow: 0 4px 16px rgba(0,0,0,0.25); pointer-events: none;
}
.box.collapsible.collapsed .chev { transform: rotate(-90deg); }
.box.collapsible.collapsed .box-body { display: none; }
.btn-xs { padding: 3px 8px; font-size: 10.5px; }
.box-summary {
  font-family: 'Source Sans 3', sans-serif; font-size: 12px; font-weight: 600; letter-spacing: 0;
  text-transform: none; color: var(--accent); max-width: 170px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; display: none;
}
.box.collapsed .box-summary.on { display: inline-block; }
.box-summary::before { content: '●'; color: #4a7c4e; margin-right: 4px; font-size: 10px; vertical-align: 1px; }

/* Barre de progression du rapport */
.rep-bar { position: relative; height: 18px; border-radius: 9px; background: #e8edf2; overflow: hidden; margin-top: 10px; }
.rep-bar-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #4a7c4e, #6a9f6e); transition: width 0.3s; }
.rep-bar span { position: relative; display: block; text-align: center; font-size: 11.5px; line-height: 18px; font-weight: 600; color: #1a2e1a; }
#fiche-body .chart-title { font-size: 13px; }
.pair-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: end; }
.pair-grid .chart { align-self: start; }

/* Légendes des fiches */
.modal.modal-top { z-index: 450; }
.imp-body { font-size: 14px; line-height: 1.5; display: flex; flex-direction: column; gap: 10px; }
.imp-body p { margin: 0; }
.btn-legend { background: #f1c40f; color: #1a252f; border: 2px solid #d4ac0d; font-weight: 700; }
.btn-legend:hover { background: #d4ac0d; }
.leg-body { font-size: 14px; line-height: 1.45; }
.leg-block { margin-bottom: 16px; }
.leg-block:last-child { margin-bottom: 0; }
.leg-sub, .leg-col-title {
  font-family: 'Oswald', sans-serif; font-size: 14px; font-weight: 600; color: var(--navy);
  letter-spacing: 0.4px; text-transform: uppercase; margin-bottom: 6px;
}
.leg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.leg-intro { font-size: 12.5px; color: #444; line-height: 1.55; margin-bottom: 10px; }
.leg-intro a { color: var(--accent); text-decoration: none; }
.leg-group { font-family: 'Oswald', sans-serif; font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase;
  font-weight: 700; border-bottom: 1.5px solid var(--panel-border); padding-bottom: 3px; margin: 10px 0 5px; }
.leg-row { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; font-size: 12.5px; }
.leg-swatch { width: 22px; height: 14px; border-radius: 3px; flex-shrink: 0; border: 1px solid rgba(0,0,0,0.12); }
.sw-inline { display: inline-block; width: 12px; height: 10px; border-radius: 2px; margin: 0 4px 0 2px; vertical-align: -1px; }
.sw-inline.band { width: 18px; background: rgba(50,50,50,0.12); border-top: 1px dashed #666; border-radius: 0; }
@media (max-width: 760px) { .leg-grid { grid-template-columns: 1fr; } }
#fiche-body .fiche-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.tooltip-info {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: rgba(30,40,30,0.97); color: #f0f4f0; font-size: 11.5px; line-height: 1.55;
  padding: 10px 12px; border-radius: 8px; z-index: 70; box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.has-tip:hover > .tooltip-info, .has-tip:focus-within > .tooltip-info { display: block; }

/* ── Graphiques ── */
.chart { width: 100%; margin-top: 6px; position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-title { font-family: 'Oswald', sans-serif; font-size: 11.5px; letter-spacing: 0.6px; color: var(--text-label); margin-top: 8px; }
.chart-legend { display: flex; gap: 12px; font-size: 11px; color: var(--text-label); flex-wrap: wrap; align-items: center; }
.chart-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.chart-legend .band { width: 16px; height: 9px; background: rgba(50,50,50,0.12); border-top: 1px dashed #666; border-radius: 0; }
.chart-tip {
  position: fixed; z-index: 400; pointer-events: none; display: none;
  background: rgba(255,255,255,0.98); border: 1px solid var(--panel-border); border-radius: 6px;
  padding: 6px 10px; font-size: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); line-height: 1.45;
}
.toggle-line { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-muted); cursor: pointer; user-select: none; }
.box-tools { display: flex; align-items: center; gap: 10px; }
.stat-line { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-label); margin-top: 4px; }
.stat-line b { font-family: 'Oswald', sans-serif; font-weight: 600; }
.badge {
  display: inline-block; font-family: 'Oswald', sans-serif; font-size: 10px; letter-spacing: 0.8px; text-transform: uppercase;
  border-radius: 4px; padding: 2px 6px; background: #eef2f6; color: var(--text-label);
}
.badge.long { background: #fdf0e1; color: #9a5b10; }
.placeholder { color: var(--text-muted); font-size: 12px; line-height: 1.5; padding: 4px 0; }
.spin-inline {
  display: inline-block; width: 14px; height: 14px; border: 2px solid #e5e7eb; border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -2px;
}

/* ── Curseur zone tampon ── */
.slider-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.slider-row input[type=range] { flex: 1; accent-color: var(--accent); }
.slider-row output { font-family: 'Oswald', sans-serif; font-size: 13px; min-width: 52px; text-align: right; }

/* ── Sources & auteurs (onglet Introduction) ── */
.intro-body { font-size: 12.5px; line-height: 1.55; display: flex; flex-direction: column; gap: 10px; }
.intro-body p, .intro-body ol { margin: 0; }
.intro-lead { font-size: 13.5px; }
.intro-h { font-family: 'Oswald', sans-serif; font-size: 13px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  color: var(--header-text); margin: 6px 0 0; border-bottom: 1.5px solid var(--panel-border); padding-bottom: 3px; }
.intro-steps { padding-left: 20px; display: flex; flex-direction: column; gap: 7px; }
.intro-warn { background: #fff8e1; border-left: 3px solid #d4821a; padding: 8px 10px; border-radius: 0 4px 4px 0; }
.auteurs-box, #sources-section { font-size: 11px; color: var(--text-muted); line-height: 1.6; }
.auteurs-box .auteur-title, #sources-section .src-title {
  font-family: 'Oswald', sans-serif; font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 4px;
}
#sources-section .src-group { margin-bottom: 8px; }
#sources-section .src-group-title { font-weight: 600; color: var(--text-label); font-size: 11px; }
.auteurs-box a, #sources-section a { color: var(--accent); text-decoration: none; }
.auteurs-box a:hover, #sources-section a:hover { text-decoration: underline; }

/* ── Resizer ── */
#resizer { width: 6px; flex-shrink: 0; background: var(--panel-border); cursor: col-resize; position: relative; z-index: 5; }
#resizer:hover, #resizer.dragging { background: var(--accent); }
#resizer::after {
  content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 2px; height: 32px; background: rgba(0,0,0,0.15); border-radius: 2px;
}

/* ── Carte ── */
#map { flex: 1; position: relative; overflow: hidden; }
#map-container { width: 100%; height: 100%; }
#map.drawing #map-container canvas, #map.picking #map-container canvas { cursor: crosshair !important; }
#map-tooltip {
  position: absolute; z-index: 20; background: rgba(255,255,255,0.97); border: 1px solid var(--panel-border);
  border-radius: 6px; padding: 6px 12px; pointer-events: none; display: none;
  font-family: 'Oswald', sans-serif; font-size: 13px; color: var(--text-main);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12); white-space: nowrap; line-height: 1.5;
}
#map-tooltip .tt-sub { font-size: 11.5px; color: var(--text-muted); font-family: 'Source Sans 3', sans-serif; }
#map-tooltip .tt-rasters { color: var(--text-main); margin-top: 3px; white-space: normal; max-width: 340px; line-height: 1.5; }
#map-tooltip .tt-rasters:first-child { margin-top: 0; }
#map-tooltip .tt-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; border: 1px solid rgba(0,0,0,0.2); }
#draw-hint, #pick-hint {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 25; display: none;
  background: var(--navy); color: #fff; font-size: 13px; padding: 7px 14px; border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
#map.drawing #draw-hint, #map.picking #pick-hint { display: block; }
#draw-box { position: absolute; border: 2px dashed var(--accent); background: rgba(41,128,185,0.12); pointer-events: none; z-index: 22; display: none; }

/* Panneau de contrôle des couches */
#layers-panel {
  /* large et plafonné en hauteur : les boutons de zoom (en bas à droite) restent visibles */
  position: absolute; top: 10px; right: 10px; z-index: 30; width: 380px; max-width: calc(100% - 20px); max-height: calc(100% - 130px);
  overflow-y: auto; background: rgba(255,255,255,0.97); border: 1px solid var(--panel-border);
  border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.14); font-size: 12.5px;
  opacity: 0.82; transition: opacity 0.15s;
}
/* légère transparence hors survol ; opaque au survol, au clavier et pendant le redimensionnement */
#layers-panel:hover, #layers-panel:focus-within, #layers-panel.resizing { opacity: 1; }
@media (hover: none) { #layers-panel { opacity: 1; } }
#layers-panel .lp-resize { position: absolute; top: 0; bottom: 0; left: 0; width: 7px; cursor: ew-resize; z-index: 1; }
#layers-panel .lp-resize:hover, #layers-panel.resizing .lp-resize { background: rgba(41,128,185,0.25); }
#layers-panel .lp-head {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; cursor: pointer;
  font-family: 'Oswald', sans-serif; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--navy);
}
#layers-panel.collapsed .lp-body { display: none; }
#layers-panel .lp-body { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 9px; }
.lyr { border-top: 1px solid #edf0f3; padding-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.lyr-head { display: flex; align-items: center; gap: 7px; font-weight: 600; color: var(--text-label); }
.lyr-head input { accent-color: var(--accent); }
.lyr-head .sw { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.lyr-opts { display: flex; flex-direction: column; gap: 4px; padding-left: 21px; }
.lyr-opts label { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 11.5px; }
.lyr-opts input[type=range] { flex: 1; accent-color: var(--accent); }
.lyr-opts select { font-size: 12px; padding: 3px 5px; border: 1px solid var(--panel-border); border-radius: 4px; flex: 1; }
.lyr-note { font-size: 11px; color: var(--text-muted); line-height: 1.35; }
.ramp { height: 8px; border-radius: 3px; }
.ramp-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-muted); }
.ramp-labels b { color: var(--text-label); font-size: 11px; }

/* Curseur double : années de début et de fin des contours de feux */
.yr-range { position: relative; height: 18px; margin-top: 2px; }
.yr-range .ramp, .yr-shade { position: absolute; top: 5px; height: 8px; }
.yr-range .ramp { left: 0; right: 0; }
.yr-shade { background: rgba(255,255,255,0.78); }
#yr-shade-a { left: 0; border-radius: 3px 0 0 3px; }
#yr-shade-b { right: 0; border-radius: 0 3px 3px 0; }
.yr-range input[type=range] {
  position: absolute; inset: 0; width: 100%; height: 18px; margin: 0; background: none;
  -webkit-appearance: none; appearance: none; pointer-events: none;
}
.yr-range input[type=range]::-webkit-slider-runnable-track { background: none; }
.yr-range input[type=range]::-moz-range-track { background: none; }
.yr-range input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto; cursor: pointer;
  width: 10px; height: 18px; border-radius: 3px; background: #fff; border: 1.5px solid var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.yr-range input[type=range]::-moz-range-thumb {
  pointer-events: auto; cursor: pointer;
  width: 8px; height: 16px; border-radius: 3px; background: #fff; border: 1.5px solid var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.leg-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; font-size: 10.5px; color: var(--text-label); }
.leg-mini span { display: flex; align-items: center; gap: 4px; }
.leg-mini i { width: 10px; height: 8px; border-radius: 2px; border: 1px solid rgba(0,0,0,0.12); flex-shrink: 0; }
#leg-comb { grid-template-columns: 1fr 1fr; gap: 1px 8px; }
#leg-comb span { align-items: baseline; line-height: 1.25; }
#leg-comb i { transform: translateY(1px); }
#leg-comb b { font-weight: 700; margin-right: 1px; white-space: nowrap; }
#leg-comb .leg-mini-grp { display: block; grid-column: 1 / -1; font-family: 'Oswald', sans-serif; font-size: 9.5px; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--text-muted); margin-top: 4px; }

/* Variables de l'indice */
.vars-list { margin: 4px 0 6px 18px; padding: 0; }
.vars-list li { margin-bottom: 2px; }
.vars-p { font-size: 0.9em; opacity: 0.8; white-space: nowrap; }
#idx-tip .vars-list { margin: 4px 0 6px 16px; }

/* Bandeau d'erreur */
#err-banner {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 600;
  width: min(92vw, 720px); display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: #fff4f2; border: 1px solid #e3a59b; border-left: 4px solid #c0392b; border-radius: 8px;
  padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,0.18); font-size: 13px; color: #5a1d14;
}
#err-banner[hidden] { display: none; }
#err-banner .err-msg { flex: 1 1 320px; line-height: 1.4; }
#err-banner .err-actions { display: flex; gap: 8px; align-items: center; }
#err-banner .err-close { border: none; background: none; font-size: 16px; cursor: pointer; color: #8a3a2e; }

/* ── Modals ── */
.modal {
  display: none; position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,0.55);
  align-items: center; justify-content: center;
}
.modal.open { display: flex; }
.modal-box {
  background: #fff; border-radius: 12px; width: min(92vw, 850px); max-height: 88vh;
  display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.35); overflow: hidden;
}
.modal-head {
  background: var(--navy); padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.modal-head h2 { font-family: 'Oswald', sans-serif; font-size: 18px; letter-spacing: 1px; text-transform: uppercase; color: #fff; }
.modal-close { background: none; border: none; color: rgba(255,255,255,0.8); font-size: 22px; cursor: pointer; line-height: 1; padding: 0 4px; }
.modal-close:hover { color: #fff; }
.modal-body { padding: 18px 22px; overflow-y: auto; flex: 1; font-size: 15px; line-height: 1.4; color: #333; }
.modal-body p { margin-bottom: 10px; }
.modal-foot { padding: 12px 22px; border-top: 1px solid #e5e7eb; display: flex; justify-content: flex-end; gap: 8px; background: #f9f9f9; flex-shrink: 0; }
.lien-onglet { color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; }

/* Rapport */
.rep-list { display: flex; flex-direction: column; gap: 2px; max-height: 42vh; overflow-y: auto; border: 1px solid var(--panel-border); border-radius: 6px; padding: 6px; margin: 8px 0; }
.rep-list label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 3px 4px; border-radius: 4px; cursor: pointer; }
.rep-list label:hover { background: #f2f6fa; }
.rep-list small { color: var(--text-muted); }
.rep-progress { font-size: 13px; color: var(--text-muted); }

/* Loading */
#loading {
  position: absolute; inset: 0; background: #f9f9f9; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; z-index: 100; transition: opacity 0.5s;
}
#loading.hidden { opacity: 0; pointer-events: none; }
#loading-msg { font-family: 'Oswald', sans-serif; letter-spacing: 2px; font-size: 12px; color: var(--text-muted); text-transform: uppercase; }
.spinner { width: 36px; height: 36px; border: 3px solid #e5e7eb; border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  #app { flex-direction: column-reverse; }
  #panel { width: 100% !important; min-width: 0; max-width: none; height: 55%; }
  #resizer { display: none; }
  #header h1 { font-size: 14px; }
  #header h1 .hdr-sub { font-size: 12px; }
  #header-logo img { height: 42px; }
  #layers-panel { width: 240px; }
  #leg-comb { grid-template-columns: 1fr; }
}

/* ── v3 : import de fichiers, zone automatique ── */
.label-row { display: flex; align-items: center; gap: 6px; position: relative; }
.info-tip {
  display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%;
  background: #eaf3fa; color: var(--accent); font-size: 11px; font-weight: 700; cursor: help; position: relative; flex-shrink: 0;
}
.info-tip .tooltip-info { width: min(400px, 80vw); left: -8px; right: auto; font-weight: 400; text-transform: none; letter-spacing: 0; }
.fmt-tip b { color: #fff; }
.fmt-tip ul { margin: 4px 0 4px 16px; padding: 0; }
.fmt-tip li { margin-bottom: 3px; }
.drop-zone { border-radius: 8px; transition: background 0.15s, outline-color 0.15s; outline: 2px dashed transparent; outline-offset: 3px; }
.drop-zone.dragover { background: #eaf3fa; outline-color: var(--accent); }
.seg.seg-sm button { padding: 5px 4px; font-size: 10.5px; text-transform: none; letter-spacing: 0.3px; }
.zone-status { font-size: 12px; color: var(--text-label); line-height: 1.45; flex-shrink: 0; }
.zone-status:empty { display: none; }
.zone-status .warn, .muted .warn { color: #9a5b10; }
.muted .err { color: #c0392b; }
#drop-hint {
  position: absolute; inset: 12px; z-index: 26; display: none; align-items: center; justify-content: center;
  border: 3px dashed var(--accent); border-radius: 12px; background: rgba(41,128,185,0.12);
  font-family: 'Oswald', sans-serif; font-size: 20px; letter-spacing: 1px; color: var(--accent-dark); pointer-events: none;
}
#map.dragover #drop-hint { display: flex; }
.site-chip { display: inline-block; font-family: 'Oswald', sans-serif; font-size: 10.5px; letter-spacing: 0.6px; border-radius: 4px;
  padding: 1px 6px; background: #111; color: #fff; margin-right: 4px; vertical-align: 1px; }
