/* ==========================================================================
   Carte Caudalie — feuille de style
   Direction artistique : deck Nordesta 2026 (photos plein écran, cartes
   translucides à liseré jaune, Roboto, accroches jaunes en capitales).
   ========================================================================== */
:root {
  --navy: #000027;                       /* fond bleu nuit du deck */
  --yellow: #ffd100;                     /* jaune Nordesta */
  --yellow-2: #ffc000;
  --yellow-soft: rgba(255, 209, 0, 0.16);
  --card: rgba(2, 2, 18, 0.62);          /* cartes noires translucides */
  --card-strong: rgba(2, 2, 18, 0.9);
  --line: rgba(255, 209, 0, 0.7);        /* liseré jaune des cartes */
  --line-soft: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --text-soft: #c7cee3;                  /* gris bleuté du deck */
  --muted: #8f97b3;
  --faint: #5f6785;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 14px 40px rgba(0, 0, 20, 0.45);
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --sidebar-w: 360px;
  --detail-w: 400px;
  --ease: cubic-bezier(0.22, 0.8, 0.26, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--navy);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
a { color: var(--yellow); }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: rgba(255,255,255,.1); padding: 1px 5px; border-radius: 4px; }

/* ---------- éléments de marque ---------- */
.kicker {
  display: inline-block; color: var(--yellow); font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.26em;
}
.rule { display: block; width: 40px; height: 3px; background: var(--yellow); border-radius: 2px; }
.leaf { width: 22px; height: auto; opacity: .95; }

/* ---------- carte ---------- */
#map { position: fixed; inset: 0; background: var(--navy); }
/* vignettage bleu nuit, comme les photos assombries du deck */
.map-vignette {
  position: fixed; inset: 0; z-index: 5; pointer-events: none;
  background:
    radial-gradient(ellipse 78% 72% at 50% 46%, transparent 52%, rgba(0, 0, 39, 0.5) 100%),
    linear-gradient(180deg, rgba(0, 0, 39, 0.32), transparent 20%, transparent 80%, rgba(0, 0, 39, 0.45));
}
.maplibregl-ctrl-group { background: var(--card-strong) !important; border: 1px solid var(--line); box-shadow: var(--shadow) !important; border-radius: var(--radius-sm) !important; }
.maplibregl-ctrl-group button + button { border-top-color: var(--line-soft) !important; }
.maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(1) brightness(1.4); }
.maplibregl-ctrl-attrib { background: rgba(0,0,20,.75) !important; color: var(--muted) !important; font-size: 11px; }
.maplibregl-ctrl-attrib a { color: var(--text-soft) !important; }
.maplibregl-ctrl-scale { background: rgba(0,0,20,.7) !important; color: var(--text) !important; border-color: var(--line) !important; }
.maplibregl-ctrl-bottom-right { margin-bottom: 8px; }
.maplibregl-canvas:focus { outline: none; }

/* ---------- cartes translucides ---------- */
.glass {
  background: var(--card);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  backdrop-filter: blur(12px) saturate(1.1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0,0,20,0.35); color: var(--text);
  font-weight: 500; white-space: nowrap; text-decoration: none;
  transition: background .2s, color .2s, border-color .2s, transform .2s var(--ease);
}
.btn:hover { background: rgba(255,209,0,0.14); }
.btn:active { transform: scale(.97); }
.btn.active, .btn-primary { background: var(--yellow); color: var(--navy); border-color: var(--yellow); font-weight: 700; }
.btn-primary:hover { background: #ffdb33; }
.btn-ghost { background: transparent; }
.btn-lg { padding: 13px 26px; font-size: 15px; letter-spacing: .02em; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid transparent; background: transparent; color: var(--text);
  transition: background .2s, border-color .2s;
}
.icon-btn:hover { background: rgba(255,209,0,0.14); border-color: var(--line); }
.link-btn { background: none; border: 0; padding: 0; color: var(--yellow); font-size: 12px; text-decoration: underline dotted; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0,0,20,0.35); }
.seg-btn { border: 0; background: transparent; color: var(--text-soft); padding: 5px 12px; border-radius: 999px; font-weight: 500; }
.seg-btn.active { background: var(--yellow); color: var(--navy); font-weight: 700; }

/* ---------- barre supérieure ---------- */
.topbar {
  position: fixed; top: 12px; left: 16px; right: 16px; z-index: 20;
  display: flex; align-items: flex-start; gap: 12px; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; width: var(--sidebar-w); }
.brand .brand-logo { width: 30px; height: auto; margin-right: 2px; }
.brand h1 { font-size: 19px; line-height: 1.1; }
.brand small { display: block; color: var(--text-soft); font-size: 11.5px; margin-top: 2px; }
.toolbar { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.menu { position: relative; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 290px;
  padding: 6px; display: flex; flex-direction: column; border-radius: var(--radius-sm);
  background: var(--card-strong);
}
.menu-list[hidden] { display: none; }
.menu-list > button, .menu-list > a {
  text-align: left; padding: 9px 12px; border: 0; background: transparent; color: var(--text);
  border-radius: 6px; text-decoration: none; font-size: 13px;
}
.menu-list > button:hover, .menu-list > a:hover { background: rgba(255,209,0,0.14); }
.menu-list hr { border: 0; border-top: 1px solid var(--line-soft); margin: 4px 6px; }

/* ---------- écran d'accueil ---------- */
.splash {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; text-align: center;
  background: var(--navy) url("../assets/img/hero-pepiniere.jpg") center / cover no-repeat;
  transition: opacity 1s var(--ease), visibility 1s;
}
.splash::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,20,.55), rgba(0,0,20,.45) 45%, rgba(0,0,30,.78));
}
.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-inner { position: relative; max-width: 780px; padding: 32px 24px; animation: rise 1.1s var(--ease) both; }
.splash-logo { width: min(220px, 48vw); height: auto; margin-bottom: 26px; filter: drop-shadow(0 6px 24px rgba(0,0,0,.45)); }
.splash .rule { margin: 14px auto 16px; }
.splash h1 { font-size: clamp(40px, 7vw, 76px); line-height: 1.02; letter-spacing: -0.02em; text-shadow: 0 4px 30px rgba(0,0,0,.4); }
.splash-sub { font-size: 17px; color: var(--text-soft); margin: 14px 0 8px; font-weight: 500; }
.splash-intro { max-width: 560px; margin: 0 auto 30px; color: var(--text-soft); font-size: 14.5px; }
.splash-stats { display: flex; justify-content: center; gap: 40px; margin-bottom: 32px; }
.splash-stats div { display: flex; flex-direction: column; }
.splash-stats strong { font-size: 38px; color: var(--yellow); font-weight: 700; line-height: 1; letter-spacing: -0.01em; }
.splash-stats span { color: var(--text); font-size: 11px; text-transform: uppercase; letter-spacing: .18em; margin-top: 8px; font-weight: 500; }
.splash-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.splash-foot { margin-top: 36px; color: var(--text-soft); opacity: .75; font-size: 12px; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---------- écran de chargement ---------- */
.loader {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; text-align: center;
  background: radial-gradient(900px 600px at 50% 42%, rgba(255, 209, 0, 0.1), transparent 60%), var(--navy);
  opacity: 0; transition: opacity .5s var(--ease);
}
.loader.on { opacity: 1; }
.loader[hidden] { display: none; }
.loader-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px; }
.loader-logo { width: min(200px, 44vw); height: auto; margin-bottom: 10px; filter: drop-shadow(0 8px 30px rgba(0,0,0,.5)); animation: breathe 2.4s ease-in-out infinite; }
.loader-bar { width: min(280px, 70vw); height: 3px; border-radius: 2px; background: rgba(255,255,255,0.12); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 0; background: var(--yellow); border-radius: 2px; transition: width .35s var(--ease); }
.loader-text { margin: 0; color: var(--text-soft); font-size: 13px; min-height: 20px; }
.loader .btn { margin-top: 10px; }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .88; } 50% { transform: scale(1.05); opacity: 1; } }

/* ---------- panneau latéral ---------- */
.sidebar {
  position: fixed; top: 76px; left: 16px; bottom: 16px; width: var(--sidebar-w); z-index: 15;
  display: flex; flex-direction: column; overflow: hidden;
  transition: transform .45s var(--ease), opacity .35s;
}
.sidebar.collapsed { transform: translateX(calc(-100% - 24px)); opacity: 0; pointer-events: none; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 14px 10px; }
.kpi { padding: 10px 12px 11px; border-radius: var(--radius-sm); background: rgba(0,0,20,0.35); border: 1px solid var(--line-soft); }
.kpi .v { display: block; font-size: 30px; line-height: 1; color: var(--yellow); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kpi .l { display: block; color: var(--text-soft); font-size: 11px; margin-top: 6px; text-transform: uppercase; letter-spacing: .08em; }
.tabs { display: flex; padding: 0 14px; border-bottom: 1px solid var(--line-soft); }
.tab { flex: 1; padding: 10px 6px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text-soft); font-weight: 500; margin-bottom: -1px; text-transform: uppercase; letter-spacing: .12em; font-size: 11.5px; }
.tab.active { color: var(--yellow); border-bottom-color: var(--yellow); font-weight: 700; }
.panel { flex: 1; overflow: auto; padding: 10px 10px 14px; overscroll-behavior: contain; }
.panel[hidden] { display: none; }
.list-tools { display: flex; gap: 8px; margin: 2px 4px 10px; }
.list-tools input, .list-tools select, .fiche input, .fiche select, .fiche textarea {
  width: 100%; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-soft);
  background: rgba(0,0,20,0.45); color: var(--text); outline: none; min-width: 0;
}
.list-tools input:focus, .fiche input:focus, .fiche select:focus, .fiche textarea:focus { border-color: var(--yellow); }
.list-tools select { width: auto; flex: 0 0 auto; }
.list-tools select option, .fiche select option { color: #111; }
.list { list-style: none; margin: 0; padding: 0; }
.item {
  display: grid; grid-template-columns: 34px 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; opacity: .3;
  transition: opacity .5s, background .2s, transform .5s var(--ease), border-color .2s; transform: translateX(-8px);
  border: 1px solid transparent;
}
.item.revealed { opacity: 1; transform: none; }
.item:hover, .item.hover { background: rgba(255,209,0,0.08); }
.item.active { background: var(--yellow-soft); border-color: var(--line); }
.num {
  grid-row: 1 / span 2; min-width: 32px; height: 24px; padding: 0 7px; border-radius: 999px;
  background: rgba(0,0,20,0.7); border: 1.5px solid var(--yellow); color: var(--text);
  font-weight: 700; font-size: 12px; display: grid; place-items: center;
}
.num img { width: 13px; height: auto; }
.item .nom { font-weight: 500; }
.item .ha { color: var(--text-soft); font-variant-numeric: tabular-nums; font-size: 13px; }
.item .yr { color: var(--muted); font-weight: 400; font-size: 11px; margin-left: 4px; }
.item .bar { grid-column: 2 / span 2; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.1); margin-top: 6px; overflow: hidden; }
.item .bar i { display: block; height: 100%; background: var(--yellow); border-radius: 2px; width: 0; transition: width .9s var(--ease); }
.item .st { font-size: 10px; color: var(--yellow); margin-left: 6px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.hint { color: var(--muted); font-size: 12px; margin: 10px 6px 0; }
.empty { color: var(--muted); text-align: center; padding: 24px 0; }

/* ---------- statistiques ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 2px 4px 6px; }
.stat { padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(0,0,20,0.35); border: 1px solid var(--line-soft); }
.stat .v { display: block; font-size: 24px; color: var(--yellow); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .l { display: block; color: var(--text-soft); font-size: 11px; margin-top: 4px; }
.section-title { font-size: 11px; font-weight: 700; margin: 18px 6px 8px; color: var(--yellow); text-transform: uppercase; letter-spacing: .2em; }
.section-title small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; margin-top: 2px; text-transform: none; letter-spacing: 0; }
.chart { display: flex; flex-direction: column; gap: 5px; padding: 0 4px; }
.crow { display: grid; grid-template-columns: 112px 1fr 52px; align-items: center; gap: 8px; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.crow:hover, .crow.hover { background: rgba(255,209,0,0.08); }
.crow .cl { font-size: 12px; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow .cl b { color: var(--text); font-weight: 700; }
.crow .ct { height: 12px; background: rgba(255,255,255,0.08); border-radius: 0 4px 4px 0; overflow: hidden; }
.crow .ct i { display: block; height: 100%; width: 0; background: var(--yellow); border-radius: 0 4px 4px 0; transition: width 1s var(--ease); }
.crow.nursery .ct i { background: var(--yellow-2); opacity: .75; }
.crow .cv { font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.buckets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 4px; }
.bucket { padding: 8px 6px; text-align: center; border-radius: var(--radius-sm); background: rgba(0,0,20,0.35); border: 1px solid var(--line-soft); }
.bucket .v { display: block; font-size: 22px; line-height: 1; font-weight: 700; color: var(--yellow); }
.bucket .l { display: block; font-size: 10px; color: var(--text-soft); margin-top: 4px; }
.fiche-stats { padding: 0 4px; color: var(--text-soft); font-size: 13px; }
.fiche-stats .pill { display: inline-block; margin: 0 6px 6px 0; padding: 3px 10px; border-radius: 999px; background: rgba(0,0,20,0.4); border: 1px solid var(--line); color: var(--text); font-size: 12px; }

/* ---------- fiche détail ---------- */
.detail {
  position: fixed; top: 76px; right: 16px; width: var(--detail-w); max-height: calc(100vh - 92px); z-index: 16;
  overflow: auto; padding: 16px 18px 18px; transform: translateX(calc(100% + 32px)); opacity: 0;
  transition: transform .5s var(--ease), opacity .35s; overscroll-behavior: contain;
}
.detail.open { transform: none; opacity: 1; }
.detail { padding: 0; }
.detail-body { padding: 14px 18px 18px; }
.d-cover { position: relative; margin: 0; height: 200px; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; background: rgba(0,0,20,.4); }
.d-cover img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.d-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,20,.25), transparent 40%, rgba(2,2,18,.75)); pointer-events: none; }
.d-cover figcaption { position: absolute; left: 14px; bottom: 12px; z-index: 1; }
.d-cover.empty { height: 0; }
.d-close { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(0,0,20,.55); border-color: var(--line); }
.photo-tag {
  display: inline-block; padding: 3px 9px; border-radius: 999px; background: rgba(0,0,20,.78); border: 1px solid var(--line);
  color: var(--text); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
}
.photo-tag.before { border-color: rgba(255,255,255,.45); color: var(--text-soft); }
.stats4 { grid-template-columns: 1fr 1fr; }
.stats4 .v { font-size: 23px; }
.section { margin-top: 6px; }
/* comparateur avant / après */
.cmp { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: #000; user-select: none; }
.cmp img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cmp-after { clip-path: inset(0 0 0 var(--k, 50%)); }
.cmp-handle { position: absolute; top: 0; bottom: 0; left: var(--k, 50%); width: 2px; background: var(--yellow); transform: translateX(-1px); pointer-events: none; box-shadow: 0 0 12px rgba(0,0,0,.6); }
.cmp-handle::after { content: "⇔"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; background: var(--yellow); color: var(--navy); font-weight: 700; display: grid; place-items: center; font-size: 15px; }
.cmp-label { position: absolute; bottom: 10px; padding: 3px 9px; border-radius: 999px; background: rgba(0,0,20,.78); border: 1px solid var(--line); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; pointer-events: none; }
.cmp-label-before { left: 10px; border-color: rgba(255,255,255,.45); color: var(--text-soft); }
.cmp-label-after { right: 10px; color: var(--yellow); }
.cmp-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
/* chronologie des photos */
.strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; scroll-snap-type: x proximity; }
.strip-item { flex: 0 0 150px; cursor: zoom-in; scroll-snap-align: start; }
.strip-item .img { position: relative; width: 150px; height: 100px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line-soft); background: rgba(0,0,20,.4); transition: border-color .2s, transform .2s var(--ease); }
.strip-item:hover .img { border-color: var(--yellow); transform: translateY(-2px); }
.strip-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.strip-item .photo-tag { position: absolute; left: 6px; top: 6px; padding: 2px 7px; font-size: 9px; }
.strip-item .cap { font-size: 11px; color: var(--text-soft); margin-top: 5px; line-height: 1.3; }
.strip-item .cap b { color: var(--text); font-weight: 500; }
.strip-empty { color: var(--muted); font-size: 12px; padding: 6px 0; }
/* espèces */
.species summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: var(--radius-sm); background: rgba(0,0,20,.35); border: 1px solid var(--line-soft); font-weight: 500; }
.species summary::-webkit-details-marker { display: none; }
.species summary::after { content: "+"; color: var(--yellow); font-weight: 700; font-size: 16px; }
.species[open] summary::after { content: "–"; }
.species ul { list-style: none; margin: 8px 0 0; padding: 0; columns: 2; column-gap: 14px; }
.species li { break-inside: avoid; padding: 4px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.species li i { display: block; color: var(--muted); font-size: 11px; font-style: italic; }
.species .src { font-size: 11px; color: var(--muted); margin-top: 8px; }
.detail-head { display: flex; align-items: flex-start; gap: 12px; }
.detail-titles { flex: 1; min-width: 0; }
.detail-titles .kicker { margin-bottom: 6px; }
.detail-head h2 { font-size: 26px; line-height: 1.1; }
.detail-head small { display: block; color: var(--text-soft); margin-top: 4px; }
.detail-head .leaf { margin-top: 2px; }
.detail .rule { margin: 12px 0 14px; }
.badge {
  min-width: 40px; height: 28px; padding: 0 9px; flex: 0 0 auto; border-radius: 999px;
  background: rgba(0,0,20,0.7); border: 1.5px solid var(--yellow); color: var(--text);
  font-weight: 700; display: grid; place-items: center; font-size: 13px;
}
.badge img { width: 15px; height: auto; }
.detail-hero { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.detail-hero > div { padding: 10px; border-radius: var(--radius-sm); background: rgba(0,0,20,0.35); border: 1px solid var(--line-soft); }
.detail-hero .v { display: block; font-size: 25px; color: var(--yellow); line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.detail-hero .l { display: block; color: var(--text-soft); font-size: 11px; margin-top: 5px; }
.facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.facts > div { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.facts dt { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-weight: 500; }
.facts dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; color: var(--text); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.fiche label { display: block; font-size: 12px; color: var(--text-soft); margin: 8px 0 0; }
.fiche input, .fiche select, .fiche textarea { margin-top: 4px; font-size: 13px; }
.fiche textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-nav { display: flex; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }

/* ---------- visite guidée ---------- */
.tourbar {
  position: fixed; bottom: 22px; left: 50%; z-index: 18; width: min(720px, calc(100vw - 32px));
  transform: translate(-50%, calc(100% + 40px)); opacity: 0; padding: 0 0 10px; overflow: hidden;
  transition: transform .5s var(--ease), opacity .3s;
}
.tourbar.open { transform: translate(-50%, 0); opacity: 1; }
.tour-progress { height: 3px; background: rgba(255,255,255,0.1); }
.tour-progress span { display: block; height: 100%; width: 0; background: var(--yellow); transition: width linear; }
.tour-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px 6px; }
.tour-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tour-text strong { font-size: 20px; font-weight: 700; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tour-text small { color: var(--text-soft); }
.tour-ctrl { display: flex; align-items: center; gap: 4px; }
.tour-ctrl .play { background: var(--yellow); color: var(--navy); width: 40px; height: 40px; border-color: var(--yellow); }
.tour-ctrl .play:hover { background: #ffdb33; }
.tour-ctrl .play .ico-play { display: none; }
.tour-ctrl .play.paused .ico-play { display: block; }
.tour-ctrl .play.paused .ico-pause { display: none; }
.tour-dots { display: flex; gap: 4px; padding: 0 14px; flex-wrap: wrap; }
.tour-dots button { width: 18px; height: 5px; border-radius: 3px; border: 0; background: rgba(255,255,255,0.16); padding: 0; transition: background .2s, transform .2s; }
.tour-dots button.done { background: rgba(255,209,0,.45); }
.tour-dots button.current { background: var(--yellow); transform: scaleY(1.5); }

/* ---------- marqueurs : badge jaune + nom en accroche, comme les étiquettes « 2014 / 2024 » du deck ---------- */
.pin { cursor: pointer; }
.pin-inner { position: relative; display: grid; place-items: center; transform-origin: 50% 100%; }
.pin.pop .pin-inner { animation: pop .7s cubic-bezier(.2,.9,.3,1.3) both; }
.pin-pill {
  display: inline-flex; align-items: center; gap: 0; height: 26px; padding: 2px; border-radius: 999px;
  background: rgba(0,0,39,0.86); border: 1.5px solid var(--yellow); color: var(--text);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  transition: transform .2s var(--ease), background .2s, color .2s;
}
.pin-n {
  width: 20px; height: 20px; border-radius: 50%; flex: 0 0 20px;
  background: var(--yellow); color: var(--navy); font-weight: 700; font-size: 11px;
  display: grid; place-items: center; font-style: normal;
}
.pin-n img { width: 12px; height: auto; display: block; filter: brightness(0) saturate(100%) invert(5%) sepia(40%) saturate(2000%) hue-rotate(220deg); }
.pin-name {
  max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0;
  font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  padding: 0; transition: max-width .3s var(--ease), opacity .25s, padding .3s;
}
.map-labels .pin-name, .pin:hover .pin-name, .pin.active .pin-name { max-width: 160px; opacity: 1; padding: 0 9px 0 7px; }
.pin:hover .pin-pill, .pin.active .pin-pill { transform: scale(1.08); }
.pin.active .pin-pill { background: var(--yellow); color: var(--navy); }
.pin.active .pin-n { background: var(--navy); color: var(--yellow); }
.pin.active .pin-n img { filter: none; }
.photo-pin { display: none; width: 16px; height: 16px; border-radius: 50%; background: rgba(0,0,39,.9); border: 1.5px solid rgba(255,255,255,.85); cursor: zoom-in; box-shadow: 0 2px 8px rgba(0,0,0,.5); transition: transform .2s var(--ease), border-color .2s; }
.photo-pin svg { width: 9px; height: 9px; display: block; margin: 2px auto; }
.photo-pin:hover { transform: scale(1.3); border-color: var(--yellow); }
.map-photos .photo-pin { display: block; }
.sw-photo { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.85); background: rgba(0,0,39,.9); margin: 0 3px; }
.sw-eau { background: rgba(79,179,255,.55); border-color: #5cc3ff; }
.no-hires #base-dark { display: none; }
.facts .fact-wide { grid-column: 1 / span 2; }
.facts .fact-wide dd b { color: var(--text); font-weight: 500; }
.facts .fact-wide dd i { color: #7fcbff; font-style: normal; }
.ping { position: absolute; inset: -10px -14px; border-radius: 999px; border: 2px solid var(--yellow); animation: ping 1.3s ease-out 2 both; pointer-events: none; }
@keyframes pop { from { transform: translateY(14px) scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ping { from { transform: scale(.5); opacity: 1; } to { transform: scale(2); opacity: 0; } }

/* ---------- panneau photo de la visite guidée ---------- */
.tour-photo {
  position: fixed; top: 76px; right: 16px; z-index: 17; width: 360px; overflow: hidden;
  transform: translateX(calc(100% + 32px)); opacity: 0; transition: transform .5s var(--ease), opacity .35s;
}
.tour-photo.open { transform: none; opacity: 1; }
.tp-media { position: relative; aspect-ratio: 16 / 10; background: #000; }
.tp-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tp-after { clip-path: inset(0 0 0 100%); }
.tp-media.run .tp-after { transition: clip-path 6s linear; clip-path: inset(0 0 0 0%); }
.tp-media.single .tp-after, .tp-media.single .tp-tag-after, .tp-media.single .tp-tag-before { display: none; }
.tp-tag { position: absolute; bottom: 10px; }
.tp-tag-before { left: 10px; border-color: rgba(255,255,255,.45); color: var(--text-soft); }
.tp-tag-after { right: 10px; color: var(--yellow); }
.tp-stats { padding: 9px 14px 11px; font-size: 12.5px; color: var(--text-soft); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.tp-stats b { color: var(--yellow); font-weight: 700; }

/* ---------- plein écran ---------- */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,20,.94); display: grid; place-items: center; }
.lightbox[hidden] { display: none; }
.lb-figure { margin: 0; max-width: min(1400px, 94vw); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lb-figure img { max-width: 94vw; max-height: 76vh; border-radius: var(--radius-sm); border: 1px solid var(--line); box-shadow: var(--shadow); }
.lb-caption { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; max-width: 94vw; }
.lb-caption strong { font-size: 15px; }
.lb-caption small { color: var(--text-soft); }
.lb-caption .link-btn { margin-top: 4px; align-self: flex-start; }
.lb-close { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; background: rgba(0,0,20,.6); border-color: var(--line); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; background: rgba(0,0,20,.6); border-color: var(--line); }
.lb-prev { left: 16px; } .lb-next { right: 16px; }
.lb-count { position: absolute; left: 20px; bottom: 16px; color: var(--muted); font-size: 12px; letter-spacing: .1em; }

/* ---------- statistiques : années et espèces ---------- */
.years { display: flex; align-items: flex-end; gap: 6px; height: 96px; padding: 0 6px 22px; position: relative; }
.years .yc { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; cursor: default; }
.years .yc i { display: block; width: 100%; max-width: 34px; background: var(--yellow); border-radius: 3px 3px 0 0; height: 0; transition: height .9s var(--ease); }
.years .yc b { position: absolute; bottom: -18px; font-size: 10px; color: var(--text-soft); font-weight: 500; }
.years .yc span { font-size: 11px; color: var(--text); margin-bottom: 3px; }

/* ---------- cartouche de légende ---------- */
.legend {
  position: fixed; left: 16px; bottom: 44px; z-index: 14; display: flex; align-items: center; gap: 12px;
  padding: 10px 14px 10px 12px; max-width: 420px; transition: transform .45s var(--ease), opacity .35s;
}
.legend .leaf { width: 26px; }
.legend-text { display: flex; flex-direction: column; line-height: 1.25; }
.legend-text strong { font-size: 13px; }
.legend-keys { list-style: none; margin: 0 0 0 6px; padding: 0 0 0 14px; border-left: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--text-soft); }
.legend-keys li { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.sw { width: 18px; height: 11px; border-radius: 3px; border: 1.5px solid var(--yellow); background: rgba(0,0,39,.6); }
.sw-nurs { background: rgba(255,209,0,.35); outline: 1px dashed #fff; outline-offset: -3px; }
.sidebar:not(.collapsed) ~ .legend { left: calc(var(--sidebar-w) + 32px); }

/* ---------- infobulle, toast, modal ---------- */
.tip { position: fixed; z-index: 30; pointer-events: none; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--card-strong); border: 1px solid var(--line); font-size: 12px; box-shadow: var(--shadow); }
.tip b { font-weight: 700; }
.tip[hidden] { display: none; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; padding: 10px 18px; border-radius: 999px; background: var(--card-strong); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; animation: rise .3s var(--ease) both; }
.toast[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; background: rgba(0,0,20,.6); padding: 20px; }
.modal[hidden] { display: none; }
.modal-box { position: relative; max-width: 640px; max-height: 90vh; overflow: auto; padding: 0 0 24px; background: var(--card-strong); }
.modal-photo { display: block; width: 100%; height: 190px; object-fit: cover; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px 26px 0; }
.modal-box h2 { font-size: 26px; margin: 8px 0 10px; }
.modal-close { position: absolute; top: 12px; right: 12px; background: rgba(0,0,20,.6); }
.about-list { padding-left: 18px; color: var(--text-soft); }
.about-list li { margin: 8px 0; }
.about-list strong { color: var(--text); }
.about-foot { color: var(--muted); font-size: 12px; margin-top: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  :root { --sidebar-w: 320px; --detail-w: 340px; }
  .toolbar .btn span { display: none; }
  .toolbar .btn { padding: 8px 10px; }
}
@media (max-width: 760px) {
  .topbar { left: 8px; right: 8px; top: 8px; flex-wrap: wrap; }
  .brand { width: auto; flex: 1; }
  .toolbar { margin-left: 0; width: 100%; overflow-x: auto; }
  .sidebar { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 46vh; }
  .sidebar.collapsed { transform: translateY(calc(100% + 16px)); }
  .detail { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 70vh; transform: translateY(calc(100% + 16px)); }
  .detail.open { transform: none; }
  .tourbar { bottom: 8px; }
  .splash h1 { font-size: 42px; }
  .splash-stats { gap: 22px; }
  .splash-stats strong { font-size: 30px; }
  .maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { display: none; }
  .legend { display: none; }
  .tour-photo { display: none; }
  .species ul { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
