/* genea-arbre v2 / Nad-Gen — styles de la visionneuse, isolés sous .gv pour pouvoir être intégrés
   dans une page de site. Les couleurs sont des variables --gv-* : thème clair par défaut, thème sombre
   via data-theme="dark" sur <html> ou la préférence système. Le rendu Canvas lit les mêmes variables. */
:root {
  --gv-bg: #f4f6f9; --gv-panel: #ffffff; --gv-ink: #1f2a3a; --gv-muted: #5a6270; --gv-line: #d9dee5;
  --gv-accent: #2f6db5; --gv-accent-ink: #ffffff; --gv-root: #e09b00; --gv-root-fill: #fff3d1; --gv-root-ink: #5a3d00; --gv-marr: #7a3e63;
  --gv-ctrl: #f0f3f7; --gv-hover: #eef4fb; --gv-tip-bg: #1f2a3a; --gv-tip-ink: #ffffff; --gv-tip-muted: #c9d3e0;
  --gv-note-bg: #f7f8fa; --gv-warn-bg: #fff6dd; --gv-warn-line: #f0d58a; --gv-shadow: rgba(0,0,0,.12);
  --gv-male-fill: #e4eef8; --gv-male-line: #5b8dc9; --gv-female-fill: #fbe7ee; --gv-female-line: #d4789b;
  --gv-unk-fill: #f1f1f1; --gv-unk-line: #9a9a9a; --gv-spouse-fill: #ffffff; --gv-link: #8c98a8;
  --gv-card-ink: #1a1a1a; --gv-card-ink2: #2f2f2f; --gv-card-muted: #6b6b6b; --gv-photo-ph: #dde3ea;
  --gv-label-bg: rgba(244,246,249,.85); --gv-label-ink: #5a6270; --gv-label-line: #d8dde3;
  --gv-map-sea: #d9e6f2; --gv-map-land: #f7f4ec; --gv-map-border: #b8b1a3; --gv-map-label: #8d8575;
  --gv-map-desc: #2a9d5c; --gv-map-spouse: #8c98a8; --gv-map-hl: #e0452b; --gv-map-sel: #1f2a3a; --gv-map-w: 45%;
}
:root[data-theme="dark"] {
  --gv-map-sea: #0f1620; --gv-map-land: #262c36; --gv-map-border: #4a5262; --gv-map-label: #7f8a9a;
  --gv-map-desc: #4cc07a; --gv-map-spouse: #6b7788; --gv-map-hl: #ff6b4a; --gv-map-sel: #f0f3f7;
  --gv-bg: #151a22; --gv-panel: #1d2430; --gv-ink: #e6ebf2; --gv-muted: #9aa5b4; --gv-line: #2f3947;
  --gv-accent: #6ea4e8; --gv-accent-ink: #0d1218; --gv-root: #e0a93a; --gv-root-fill: #3a2d12; --gv-root-ink: #ffd98a; --gv-marr: #d08ab5;
  --gv-ctrl: #232b38; --gv-hover: #27324a; --gv-tip-bg: #e6ebf2; --gv-tip-ink: #151a22; --gv-tip-muted: #4a5568;
  --gv-note-bg: #232b38; --gv-warn-bg: #3a3119; --gv-warn-line: #6b5a2a; --gv-shadow: rgba(0,0,0,.5);
  --gv-male-fill: #1f3350; --gv-male-line: #6ea4e8; --gv-female-fill: #4a2335; --gv-female-line: #e48fb4;
  --gv-unk-fill: #2a2f38; --gv-unk-line: #8a93a0; --gv-spouse-fill: #1d2430; --gv-link: #6b7788;
  --gv-card-ink: #f0f3f7; --gv-card-ink2: #cfd6e0; --gv-card-muted: #9aa5b4; --gv-photo-ph: #2f3947;
  --gv-label-bg: rgba(21,26,34,.85); --gv-label-ink: #9aa5b4; --gv-label-line: #2f3947;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --gv-map-sea: #0f1620; --gv-map-land: #262c36; --gv-map-border: #4a5262; --gv-map-label: #7f8a9a;
    --gv-map-desc: #4cc07a; --gv-map-spouse: #6b7788; --gv-map-hl: #ff6b4a; --gv-map-sel: #f0f3f7;
    --gv-bg: #151a22; --gv-panel: #1d2430; --gv-ink: #e6ebf2; --gv-muted: #9aa5b4; --gv-line: #2f3947;
    --gv-accent: #6ea4e8; --gv-accent-ink: #0d1218; --gv-root: #e0a93a; --gv-root-fill: #3a2d12; --gv-root-ink: #ffd98a; --gv-marr: #d08ab5;
    --gv-ctrl: #232b38; --gv-hover: #27324a; --gv-tip-bg: #e6ebf2; --gv-tip-ink: #151a22; --gv-tip-muted: #4a5568;
    --gv-note-bg: #232b38; --gv-warn-bg: #3a3119; --gv-warn-line: #6b5a2a; --gv-shadow: rgba(0,0,0,.5);
    --gv-male-fill: #1f3350; --gv-male-line: #6ea4e8; --gv-female-fill: #4a2335; --gv-female-line: #e48fb4;
    --gv-unk-fill: #2a2f38; --gv-unk-line: #8a93a0; --gv-spouse-fill: #1d2430; --gv-link: #6b7788;
    --gv-card-ink: #f0f3f7; --gv-card-ink2: #cfd6e0; --gv-card-muted: #9aa5b4; --gv-photo-ph: #2f3947;
    --gv-label-bg: rgba(21,26,34,.85); --gv-label-ink: #9aa5b4; --gv-label-line: #2f3947;
  }
}

/* --- conteneur (fichier autonome : body > .gv plein écran) --- */
.gv, .gv * { box-sizing: border-box; }
body.gv-standalone { height: 100%; margin: 0; }
html:has(body.gv-standalone) { height: 100%; }
body.gv-standalone .gv { height: 100%; height: 100vh; height: 100dvh; } /* dvh : hauteur réelle sous la barre d'adresse des navigateurs mobiles */
.gv {
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--gv-ink);
  background: var(--gv-bg);
  display: flex; flex-direction: column;
  overflow: hidden; position: relative;
  min-height: 0;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
/* plein écran (bouton ⛶) : le conteneur recouvre la page (site autour masqué) ; l'API Fullscreen est appelée en plus quand elle existe */
.gv.gv-full { position: fixed; inset: 0; z-index: 1000; height: auto; width: auto; margin: 0; }
.gv:fullscreen { width: 100%; height: 100%; }
.gv button, .gv .chk, .gv .chip, .gv .sheet-bar { touch-action: manipulation; }
.gv-header {
  background: var(--gv-panel);
  border-bottom: 1px solid var(--gv-line);
  padding: 6px 14px 4px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px;
  z-index: 5; flex: none;
}
.gv-header .hd { min-width: 0; }
.gv-header h1 { font-size: 17px; margin: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gv-header .sub { font-size: 12px; color: var(--gv-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gv .toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-left: auto; }
.gv .grp { display: inline-flex; align-items: center; gap: 4px; background: var(--gv-ctrl); border: 1px solid var(--gv-line); border-radius: 8px; padding: 3px 6px; font-size: 12.5px; position: relative; }
.gv .grp label { color: var(--gv-muted); }
.gv .grp .val { min-width: 18px; text-align: center; font-weight: 600; }
.gv .grp input[type=range] { width: 90px; margin: 0 2px; accent-color: var(--gv-accent); }
.gv button, .gv .btn {
  font: inherit; font-size: 12.5px; cursor: pointer;
  border: 1px solid var(--gv-line); background: var(--gv-panel); color: var(--gv-ink);
  border-radius: 6px; padding: 4px 9px; line-height: 1.3;
}
.gv button:hover { border-color: var(--gv-accent); color: var(--gv-accent); }
.gv button.primary { background: var(--gv-accent); color: var(--gv-accent-ink); border-color: var(--gv-accent); }
.gv button.primary:hover { filter: brightness(1.08); color: var(--gv-accent-ink); }
.gv button.sq { width: 26px; padding: 2px 0; text-align: center; font-weight: 700; }
.gv button:disabled { opacity: .4; cursor: default; }
.gv button:disabled:hover { border-color: var(--gv-line); color: var(--gv-ink); }
.gv .chk { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--gv-muted); cursor: pointer; }
.gv .search { position: relative; }
.gv .search input { font: inherit; font-size: 12.5px; padding: 4px 8px; width: 210px; border: 1px solid var(--gv-line); border-radius: 6px; background: var(--gv-panel); color: var(--gv-ink); }
.gv .res {
  position: absolute; top: 30px; left: 0; width: 360px; max-height: 320px; overflow: auto;
  background: var(--gv-panel); border: 1px solid var(--gv-line); border-radius: 8px; box-shadow: 0 6px 20px var(--gv-shadow);
  display: none; z-index: 20;
}
.gv .res.open { display: block; }
.gv .res div { padding: 6px 10px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--gv-line); }
.gv .res div:hover { background: var(--gv-hover); }
.gv .res div small { color: var(--gv-muted); margin-left: 6px; }
.gv .res .none { color: var(--gv-muted); cursor: default; }
.gv .marks .menu { right: 0; left: auto; width: 300px; }
.gv .res.float { position: fixed; left: 8px; right: 8px; width: auto; } /* téléphone : hors de la barre d'outils défilante (position calculée en JS) */
.gv .trailbar { flex-basis: 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; font-size: 12px; color: var(--gv-muted); padding-top: 2px; }
.gv .trailbar .lbl { margin-right: 4px; }
.gv .trailbar .sep { color: var(--gv-muted); opacity: .7; padding: 0 2px; }
.gv .chip { border-radius: 12px; padding: 1px 9px; font-size: 12px; background: var(--gv-panel); }
.gv .chip.cur { background: var(--gv-root-fill); border-color: var(--gv-root); color: var(--gv-root-ink); font-weight: 600; cursor: default; }
.gv-embedded .theme-only { display: none !important; }
.gv .short { display: none; }
.gv button#btnFull.on { background: var(--gv-accent); color: var(--gv-accent-ink); border-color: var(--gv-accent); }

.gv-main { flex: 1; position: relative; overflow: hidden; min-height: 0; }
.gv canvas#cv { position: absolute; inset: 0; display: block; cursor: grab; touch-action: none; }
.gv canvas#cv.dragging { cursor: grabbing !important; }
.gv #tip { position: absolute; display: none; pointer-events: none; background: var(--gv-tip-bg); color: var(--gv-tip-ink); padding: 6px 9px; border-radius: 6px; font-size: 12.5px; z-index: 8; max-width: 280px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.gv #tip span { color: var(--gv-tip-muted); margin-left: 4px; }
.gv #tip .rel { color: var(--gv-tip-muted); font-size: 11.5px; margin-top: 2px; }

/* Panneau de détails */
.gv aside#panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: 390px; max-width: 100%;
  background: var(--gv-panel); border-left: 1px solid var(--gv-line);
  box-shadow: -4px 0 18px var(--gv-shadow);
  transform: translateX(105%); transition: transform .18s ease;
  overflow: auto; padding: 14px 16px 24px; font-size: 13.5px; z-index: 8;
}
.gv aside#panel.open { transform: none; }
.gv aside#panel .close { position: absolute; top: 8px; right: 10px; width: 28px; height: 28px; border-radius: 50%; padding: 0; font-size: 16px; }
/* barre d'aperçu du volet bas (≤ 900 px) : nom, dates, chevron, fermeture ; masquée en panneau latéral */
.gv aside#panel .sheet-bar { display: none; position: relative; align-items: center; gap: 6px; height: 64px; flex: none; padding: 8px 8px 0 16px; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.gv aside#panel .sheet-bar::before { content: ''; position: absolute; top: 5px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--gv-line); }
.gv aside#panel .sheet-txt { flex: 1; min-width: 0; }
.gv aside#panel .sheet-txt b { display: block; font-size: 16px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gv aside#panel .sheet-txt span { display: block; font-size: 12.5px; color: var(--gv-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gv aside#panel .sheet-bar button { flex: none; }
.gv aside#panel .sheet-chev svg { width: 18px; height: 18px; display: block; transition: transform .2s; }
.gv aside#panel.full .sheet-chev svg { transform: rotate(180deg); }
.gv aside#panel .head { display: flex; gap: 12px; align-items: flex-start; margin-right: 28px; }
.gv aside#panel .head img { width: 84px; height: 84px; border-radius: 8px; object-fit: cover; border: 1px solid var(--gv-line); }
.gv aside#panel h2 { margin: 0 0 2px; font-size: 17px; line-height: 1.2; }
.gv aside#panel .rel { color: var(--gv-muted); font-size: 12.5px; }
.gv aside#panel .rel b { color: var(--gv-ink); }
.gv aside#panel .acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.gv aside#panel h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--gv-muted); margin: 16px 0 6px; border-bottom: 1px solid var(--gv-line); padding-bottom: 3px; }
.gv aside#panel ul { margin: 0; padding-left: 0; list-style: none; }
.gv aside#panel li { margin: 3px 0; line-height: 1.35; }
.gv aside#panel li .sym { display: inline-block; width: 22px; color: var(--gv-marr); font-weight: 700; }
.gv aside#panel a { color: var(--gv-accent); text-decoration: none; }
.gv aside#panel a:hover { text-decoration: underline; }
.gv aside#panel .note { white-space: pre-wrap; font-size: 12.5px; color: var(--gv-ink); background: var(--gv-note-bg); border: 1px solid var(--gv-line); border-radius: 6px; padding: 8px; margin-top: 6px; }
.gv aside#panel details summary { cursor: pointer; color: var(--gv-accent); font-size: 12.5px; }
.gv aside#panel .warn { background: var(--gv-warn-bg); border: 1px solid var(--gv-warn-line); border-radius: 6px; padding: 8px; font-size: 12.5px; margin-top: 10px; }
.gv aside#panel .muted { color: var(--gv-muted); }

/* Carte des lieux */
.gv button#btnMap.on { background: var(--gv-accent); color: var(--gv-accent-ink); border-color: var(--gv-accent); }
.gv .gv-map {
  position: absolute; top: 0; right: 0; bottom: 0; width: var(--gv-map-w, 45%); min-width: 320px; max-width: 100%;
  background: var(--gv-panel); border-left: 1px solid var(--gv-line); box-shadow: -4px 0 18px var(--gv-shadow);
  display: none; flex-direction: column; z-index: 7; font-size: 12.5px;
}
.gv .gv-map.open { display: flex; }
.gv .gv-map .map-resizer { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 2; }
.gv .gv-map .map-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 8px 5px 12px; border-bottom: 1px solid var(--gv-line); }
.gv .gv-map .map-head .info { color: var(--gv-muted); font-size: 11.5px; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gv .gv-map .map-head .grp { padding: 2px 5px; }
.gv .gv-map .map-head .close { margin-left: auto; }
.gv .gv-map .map-head .legend-btn { display: none; }
.gv .gv-map .map-body { flex: 1; position: relative; min-height: 140px; background: var(--gv-map-sea); }
.gv .gv-map canvas { position: absolute; inset: 0; display: block; cursor: grab; touch-action: none; outline: none; }
.gv .gv-map canvas.dragging { cursor: grabbing; }
.gv .gv-map .map-msg { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; text-align: center; color: var(--gv-muted); padding: 16px; }
.gv .gv-map .map-msg[style*="block"] { display: flex !important; }
.gv .gv-map .map-tip { position: absolute; display: none; pointer-events: none; background: var(--gv-tip-bg); color: var(--gv-tip-ink); padding: 6px 9px; border-radius: 6px; font-size: 12px; z-index: 3; max-width: 260px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.gv .gv-map .map-tip .rel { color: var(--gv-tip-muted); font-size: 11px; margin-top: 2px; }
.gv .gv-map .map-list { display: none; max-height: 38%; overflow: auto; border-top: 1px solid var(--gv-line); padding: 6px 12px 8px; }
.gv .gv-map .map-list .hd { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.gv .gv-map .map-list .hd .unsel { margin-left: auto; }
.gv .gv-map .map-list .hd .off { font-size: 11.5px; padding: 1px 8px; color: var(--gv-map-hl); border: 1.5px dashed var(--gv-map-hl); border-radius: 10px; background: transparent; white-space: nowrap; }
.gv .gv-map .map-list .hd .off:hover { background: var(--gv-map-hl); color: #fff; }
.gv .gv-map .map-list ul { margin: 0; padding-left: 0; list-style: none; columns: 2; column-gap: 16px; }
.gv .gv-map .map-list li { margin: 2px 0; line-height: 1.3; break-inside: avoid; }
.gv .gv-map .map-list a { color: var(--gv-accent); text-decoration: none; }
.gv .gv-map .map-list a:hover { text-decoration: underline; }
.gv .gv-map .muted { color: var(--gv-muted); font-size: 11.5px; }
.gv .gv-map .map-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 4px 12px 5px; border-top: 1px solid var(--gv-line); font-size: 11px; color: var(--gv-muted); }
.gv .gv-map .map-foot .legend { display: inline-flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin: 0; }
.gv .gv-map .map-foot .legend i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--gv-panel); display: inline-block; }
.gv .gv-map .lg-anc { background: var(--gv-accent); }
.gv .gv-map .lg-desc { background: var(--gv-map-desc); }
.gv .gv-map .lg-sp { background: var(--gv-map-spouse); }
.gv .gv-map .lg-approx { background: transparent; border: 1.5px dashed var(--gv-muted) !important; }
.gv .gv-map .lg-grad { width: 46px !important; border-radius: 4px !important; border: none !important; background: linear-gradient(90deg, var(--gv-accent), color-mix(in srgb, var(--gv-accent) 30%, var(--gv-map-land))); }
.gv .gv-map .lg-ring { background: transparent; border: 1.5px solid var(--gv-map-sel, var(--gv-ink)) !important; }
.gv .gv-map .lg-ring.dashed { border-style: dashed !important; }
.gv .gv-map .lg-ring.double { box-shadow: 0 0 0 2px var(--gv-panel), 0 0 0 3.5px var(--gv-map-sel, var(--gv-ink)); }
/* fiche et carte côte à côte dès 1000 px (classes gv-side / gv-map-fit et --gv-map-eff posées par tree2.js) : la carte est
   réduite à sa largeur effective pour laisser 400 px à l'arbre ; en dessous de 1000 px la fiche recouvre la carte */
.gv.gv-side aside#panel { right: var(--gv-map-eff, var(--gv-map-w, 45%)); box-shadow: none; }
.gv.gv-side.gv-map-fit .gv-map { width: var(--gv-map-eff); }
@media (max-width: 900px) { .gv .gv-map { width: 100%; min-width: 0; } .gv .gv-map .map-list ul { columns: 1; } }
@media print { .gv .gv-map { display: none !important; } }

/* aide */
.gv #help { position: absolute; inset: 0; background: rgba(20,30,45,.45); display: none; z-index: 30; align-items: center; justify-content: center; }
.gv #help.open { display: flex; }
.gv #help .card { background: var(--gv-panel); color: var(--gv-ink); border-radius: 12px; max-width: 620px; width: calc(100% - 32px); padding: 20px 24px; font-size: 13.5px; box-shadow: 0 20px 60px rgba(0,0,0,.3); max-height: 90%; overflow: auto; }
.gv #help h2 { margin-top: 0; font-size: 17px; }
.gv #help ul { padding-left: 18px; }
.gv #help li { margin: 5px 0; }
.gv .legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 10px 0; }
.gv .legend span { display: inline-flex; align-items: center; gap: 6px; }
.gv .legend i { display: inline-block; width: 26px; height: 14px; border-radius: 3px; border: 1.5px solid; }
.gv .legend .lg-m { background: var(--gv-male-fill); border-color: var(--gv-male-line); }
.gv .legend .lg-f { background: var(--gv-female-fill); border-color: var(--gv-female-line); }
.gv .legend .lg-seed { background: var(--gv-root-fill); border-color: var(--gv-root); }
.gv .legend .lg-focus { background: var(--gv-panel); border-color: var(--gv-accent); border-width: 3px; }
.gv .legend .lg-sp { background: var(--gv-spouse-fill); border-color: var(--gv-unk-line); }
.gv .toast { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--gv-tip-bg); color: var(--gv-tip-ink); padding: 8px 14px; border-radius: 8px; font-size: 13px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 40; }
.gv .toast.show { opacity: .95; }
.gv footer.credits { position: absolute; left: 10px; bottom: 6px; font-size: 11px; color: var(--gv-muted); pointer-events: none; }

/* ---- tablette et téléphone (≤ 900 px) : la fiche est un volet bas à deux états, « aperçu » (64 px) ou « déplié » (60 %) ---- */
@media (max-width: 900px) {
  .gv-header h1 { font-size: 15px; }
  .gv .toolbar { margin-left: 0; }
  .gv .search input { width: 150px; }
  .gv aside#panel {
    width: 100%; top: auto; bottom: 0; height: 64px; max-height: 100%; border-left: none; border-top: 1px solid var(--gv-line);
    border-radius: 14px 14px 0 0; box-shadow: 0 -4px 18px var(--gv-shadow);
    transform: translateY(105%); transition: transform .18s ease, height .2s ease;
    overflow: hidden; padding: 0; display: flex; flex-direction: column;
  }
  .gv aside#panel.open { transform: none; }
  .gv aside#panel.full { height: 60%; }
  .gv aside#panel .sheet-bar { display: flex; }
  .gv aside#panel .sheet-body { flex: 1; min-height: 0; overflow: auto; padding: 4px 16px 24px; }
  .gv aside#panel.peek .sheet-body { display: none; }
  .gv aside#panel .sheet-body > .close, .gv aside#panel .sheet-body h2 { display: none; } /* nom et fermeture déjà dans la barre */
  .gv aside#panel .sheet-body .head { margin-right: 0; }
  .gv.gv-sheet-peek .gv-map { bottom: 64px; } /* la carte reste utilisable au-dessus de la barre d'aperçu */
  .gv .toast { bottom: auto; top: 12px; }
}
/* ---- téléphone (≤ 700 px) : en-tête compact, barre d'outils et fil des souches défilants, carte compacte ---- */
@media (max-width: 700px) {
  .gv-header { padding: 4px 8px 3px; gap: 1px 8px; }
  .gv-header .hd { flex-basis: 100%; }
  .gv-header h1 { font-size: 14px; }
  .gv-header .sub { display: none; }
  .gv .toolbar, .gv .trailbar { flex-basis: 100%; min-width: 0; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .gv .toolbar::-webkit-scrollbar, .gv .trailbar::-webkit-scrollbar { display: none; }
  /* dégradé collé au bord droit tant qu'il reste des boutons à faire défiler (classe at-end posée par tree2.js) */
  .gv .toolbar::after, .gv .trailbar::after { content: ''; position: sticky; right: 0; flex: none; width: 44px; margin-left: -44px; align-self: stretch; background: linear-gradient(90deg, transparent, var(--gv-panel) 80%); pointer-events: none; transition: opacity .15s; }
  .gv .toolbar.at-end::after, .gv .trailbar.at-end::after { opacity: 0; }
  .gv .toolbar > * { flex: none; }
  .gv .toolbar .grp.detail, .gv .toolbar .chk.tl, .gv .long { display: none; }
  .gv .short { display: inline; }
  .gv .toolbar .chk { order: 4; }
  .gv .toolbar #btnPng { order: 5; }
  .gv .toolbar #btnTheme, .gv .toolbar #btnHelp { order: 6; }
  .gv .search input { width: 110px; transition: width .15s; }
  .gv .search input:focus { width: 170px; }
  .gv .trailbar { padding-top: 3px; }
  .gv .trailbar .lbl { flex: none; }
  .gv .trailbar #trail { white-space: nowrap; }
  .gv footer.credits { display: none; }
  .gv #help .card { width: calc(100% - 16px); max-height: calc(100% - 16px); padding: 14px 16px; font-size: 14px; border-radius: 10px; }
  .gv #help .card ul { padding-left: 16px; }
  /* carte : en-tête sur une ligne (titre court, ⤢ + − ⓘ ×) puis la ligne des cases ; légende derrière ⓘ ; liste limitée à 35 % */
  .gv .gv-map .map-head { padding: 4px 6px 4px 10px; gap: 3px 6px; }
  .gv .gv-map .map-head .info { display: none; }
  .gv .gv-map .map-head .evs { order: 9; flex-basis: 100%; justify-content: space-around; }
  .gv .gv-map .map-head .legend-btn { display: inline-block; }
  .gv .gv-map .map-resizer { display: none; }
  .gv .gv-map .map-list { max-height: 35%; }
  .gv .gv-map .map-foot { display: none; font-size: 11.5px; }
  .gv .gv-map.legend-open .map-foot { display: flex; }
}
/* ---- écran tactile : cibles d'au moins 36 px, polices 14 px, champs 16 px (évite le zoom automatique d'iOS au focus) ---- */
@media (pointer: coarse) {
  .gv button, .gv .btn { min-height: 36px; font-size: 14px; padding: 5px 12px; }
  .gv button.sq { width: 36px; min-width: 36px; padding: 0; }
  .gv .chk { font-size: 14px; min-height: 36px; }
  .gv .chk input[type=checkbox] { width: 20px; height: 20px; margin: 0 2px; }
  .gv .grp { padding: 2px 5px; }
  .gv .grp label { font-size: 13px; }
  .gv input, .gv select, .gv textarea { font-size: 16px; }
  .gv .search input { min-height: 36px; }
  .gv .grp input[type=range] { -webkit-appearance: none; appearance: none; width: 130px; height: 30px; background: transparent; margin: 0 4px; }
  .gv .grp input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--gv-line); }
  .gv .grp input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%; border: none; background: var(--gv-accent); }
  .gv .grp input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--gv-line); }
  .gv .grp input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; border: none; background: var(--gv-accent); }
  .gv .res div { padding: 10px 12px; font-size: 15px; }
  .gv .chip { padding: 5px 12px; font-size: 13.5px; min-height: 30px; }
  .gv .trailbar { font-size: 13.5px; }
  .gv aside#panel { font-size: 14.5px; }
  .gv aside#panel .close { width: 36px; height: 36px; }
  .gv aside#panel li { margin: 6px 0; }
  .gv aside#panel .acts { gap: 8px; }
  .gv .gv-map { font-size: 14px; }
  .gv .gv-map .map-resizer { display: none; }
  .gv .gv-map .map-list li { margin: 6px 0; line-height: 1.4; }
  .gv .gv-map .map-list .hd .off { padding: 5px 12px; font-size: 13px; }
  .gv .gv-map .map-foot { font-size: 12px; }
}
@media (max-width: 700px) {
  .gv input, .gv select, .gv textarea { font-size: 16px; }
}
@media print {
  .gv-header, .gv aside#panel, .gv footer.credits, .gv #help, .gv .toast, .gv #tip { display: none !important; }
}
