
/* Territoires dans les filtres; raccourci cartographique de cadrage. */
.filter-zone-picker{margin:0 0 14px}
.sidebar #zone-toggle{width:100%;padding:10px 12px;border:1px solid var(--button-edge,#c9c9c9);border-radius:12px;background:var(--button-face,#fff);color:inherit;box-shadow:var(--button-relief);font-size:12px;text-align:left}
.sidebar #zone-toggle.active{background:var(--selection-fill)!important;color:#fff;border-color:var(--selection-border);box-shadow:var(--button-selected)}
.sidebar #zone-panel{position:static;width:100%;max-width:none;max-height:360px;box-sizing:border-box;margin-top:10px;padding:12px;backdrop-filter:none;box-shadow:none}
.map-area .view-presets{padding:0;border:0;background:transparent;box-shadow:none;border-radius:50%}
.map-area .view-presets #view-all{display:grid;place-items:center;width:38px;height:38px;padding:0;border:1px solid #c9c9c9;border-radius:50%;background:#fff;color:#34434d;box-shadow:0 2px 5px #0002}
.map-area #view-all svg{display:block;width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.culture-dark .map-area .view-presets{background:transparent;box-shadow:none}
.culture-dark .map-area .view-presets #view-all{background:#000;color:#fff;border-color:#404040}

.sidebar #zone-panel .zone-clear{display:block;margin:0 0 6px auto;padding:4px 0;border:0;background:transparent;color:inherit;box-shadow:none;font-size:11px;font-weight:500;line-height:1.4;text-decoration:underline;text-underline-offset:3px;cursor:pointer}

.sidebar #zone-panel .zone-clear + h3{margin-top:0}

/* Commandes cartographiques de même gabarit et sur le même axe. */
.map-area .map-top{align-items:center;gap:12px}
.map-area .map-top .view-presets{align-self:center;flex:none;margin:0;padding:0}
.map-area .map-top #view-all,.map-area .map-top #cloud-toggle,.map-area .map-top #map-locate{box-sizing:border-box;display:grid;place-items:center;flex:none;align-self:center;width:38px;height:38px;min-width:38px;min-height:38px;padding:0;margin:0;border-width:1px;border-radius:50%;box-shadow:0 2px 5px #0002;line-height:1}
.map-area .map-top #cloud-toggle{margin-left:auto}
.map-area .map-top :is(#view-all,#cloud-toggle,#map-locate)>svg{display:block;width:22px;height:22px;margin:0}
:root:not(.culture-dark) #map .osm-theme-switch button{color:#000}
@media(max-width:720px){.map-area .map-top{gap:10px}.map-area .map-top #view-all,.map-area .map-top #cloud-toggle,.map-area .map-top #map-locate{width:34px;height:34px;min-width:34px;min-height:34px}}

/* Même gabarit pour le sélecteur clair/sombre; croissant plein. */
#map .osm-theme-switch button{width:38px;height:38px;min-width:38px;min-height:38px}
#map .osm-theme-switch button svg{width:22px;height:22px}
@media(max-width:720px){#map .osm-theme-switch button{width:34px;height:34px;min-width:34px;min-height:34px}}

/* Attribution visible, sans cartouche opaque. */
#map .leaflet-control-attribution{background:transparent!important;color:#39454c!important;font-size:10px!important;line-height:1.4;padding:2px 6px;border:0;box-shadow:none;text-shadow:0 1px 2px #fff,0 0 3px #fff}
#map .leaflet-control-attribution a{color:inherit}
.culture-dark #map .leaflet-control-attribution{color:#d1d9de!important;text-shadow:0 1px 2px #000,0 0 3px #000}
#map .leaflet-control-attribution a:focus-visible{outline:2px solid currentColor;outline-offset:2px}

/* Centrage optique du dessin du nuage et pastilles sans bordure. */
.map-area .map-top #cloud-toggle>svg{transform:translate(-.7px,0px)}
.map-area .map-top #map-locate,#map .osm-theme-switch button{border:0}

/* Toutes les commandes superposées à la carte partagent des pastilles sans bordure. */
.map-area .map-action-row .map-action,
:root .map-area .map-action-row #filters-toggle,
.map-area .map-top :is(#view-all,#cloud-toggle,#map-locate,#map-favorites),
.map-area .map-quick-filters button,
.map-area .time-player button,
#map .osm-theme-switch button{border:0!important}

/* Sélection géographique locale, sans fond distant ni points d’événements. */
#territory-dialog{padding:18px;overflow:auto}
#territory-dialog .territory-title{font-size:18px;line-height:1.4;letter-spacing:0;margin:0 0 12px}
#territory-dialog .territory-tags{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}
#territory-dialog .territory-tag{font:inherit;font-size:11px;line-height:1.4;padding:5px 8px;border:0;border-radius:9px;background:#dfeef9;color:#215c82;cursor:pointer;text-align:left}
#territory-dialog .zone-clear{margin:0 0 10px auto}#territory-dialog .zone-clear:disabled{opacity:.45;cursor:default}
#territory-dialog .territory-search{width:100%;box-sizing:border-box;padding:10px 12px;border:1px solid #bbcbd5;border-radius:9px;background:#fff;color:#263842;font:inherit;font-size:13px;margin-bottom:10px}
#territory-map{height:290px;min-height:220px;width:100%;border:1px solid #cedce4;border-radius:10px;background:#eaf2f6;isolation:isolate;cursor:grab}
#territory-map .territory-shape{fill:#c2d1da;stroke:#fff;cursor:pointer;transition:fill .12s,opacity .12s}
#territory-map .territory-shape.is-selected{fill:#269bdb;stroke:#155a81}
#territory-map .territory-shape.is-hovered,#territory-map .territory-shape:focus-visible{fill:#8dc8e9;stroke:#215f87;stroke-width:2;outline:none}
#territory-map .territory-shape.is-selected.is-hovered,#territory-map .territory-shape.is-selected:focus-visible{fill:#147bb6}
#territory-map .territory-shape.is-muted{opacity:.3}
#territory-map .leaflet-top.leaflet-right{top:8px!important;right:8px!important}
#territory-map .leaflet-control-zoom a{width:28px!important;height:28px!important;line-height:28px!important;font-size:19px}
#territory-map .territory-tooltip{font:600 12px/1.4 system-ui;color:#253b49;background:#fff;border:1px solid #b4c6d1;border-radius:6px;padding:6px 9px;white-space:normal;max-width:230px;box-shadow:0 2px 8px #0002}
#territory-map .territory-map-reset{font:600 11px system-ui;background:#fff;color:#324c5d;border:1px solid #becfd9;border-radius:7px;padding:7px 9px;cursor:pointer}
#territory-dialog .territory-results{max-height:155px;overflow:auto;margin-top:12px;overscroll-behavior:contain}
#territory-dialog .territory-results h3{font-size:12px;margin:8px 0}#territory-dialog .zone-pills{display:flex;flex-wrap:wrap;gap:5px}
#territory-dialog .zone-pills button[aria-pressed=true]{background:#247dab!important;border-color:#247dab!important}
.culture-dark #territory-dialog .territory-search{background:#172128;color:#edf4f8;border-color:#405664}
.culture-dark #territory-dialog .territory-tag{background:#193d53;color:#b4e6ff}
.culture-dark #territory-map{background:#14232e;border-color:#354a59}
.culture-dark #territory-map .territory-shape{fill:#475d6a;stroke:#172731}
.culture-dark #territory-map .territory-shape.is-selected{fill:#249edb;stroke:#a2dcfa}
.culture-dark #territory-map .territory-shape.is-hovered,.culture-dark #territory-map .territory-shape:focus-visible{fill:#739db5;stroke:#c0e5fa}
.culture-dark #territory-map .territory-shape.is-selected.is-hovered{fill:#47baf2}
.culture-dark #territory-map :is(.territory-tooltip,.territory-map-reset){background:#223642;color:#edf7ff;border-color:#587286}
@media(max-height:700px){#territory-map{height:235px;min-height:180px}#territory-dialog .territory-results{max-height:110px}}

/* Grande carte et liste accessible sur toute la hauteur disponible. */
dialog#territory-dialog{top:0;bottom:0;height:100dvh;max-height:100dvh;width:600px;margin:0;box-sizing:border-box;padding:18px;border-radius:0;overflow:hidden}
#territory-dialog #zone-panel{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}
#territory-dialog #zone-panel>*{flex-shrink:0}
#territory-dialog .territory-tags{max-height:90px;overflow:auto}
#territory-dialog #territory-map{height:clamp(280px,46dvh,450px);min-height:240px;position:relative}
#territory-dialog #zone-panel .territory-results{flex:1 1 auto;min-height:100px;max-height:none;overflow:auto;padding-right:4px}
#territory-map .territory-hover-name{position:absolute;top:10px;left:50%;transform:translateX(-50%);z-index:800;box-sizing:border-box;width:max-content;max-width:calc(100% - 100px);padding:7px 12px;border:1px solid #b4c6d1;border-radius:7px;background:#fffffff5;color:#253b49;box-shadow:0 2px 8px #0002;font:600 13px/1.35 system-ui;text-align:center;pointer-events:none;overflow-wrap:normal}
.culture-dark #territory-map .territory-hover-name{background:#223642f5;color:#edf7ff;border-color:#587286}
@media(max-height:600px){dialog#territory-dialog{padding:12px}#territory-dialog #territory-map{height:40dvh;min-height:160px}#territory-dialog .territory-tags{max-height:50px}#territory-dialog #zone-panel .territory-results{min-height:60px}}

#territory-dialog .territory-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
#territory-dialog .territory-header .territory-title{margin:0}
#territory-dialog .territory-close{flex:none;display:grid;place-items:center;width:30px;height:30px;padding:5px;border:0;border-radius:50%;background:#e7edf1;color:#263842;cursor:pointer}
#territory-dialog .territory-close svg{display:block;width:20px;height:20px}
.culture-dark #territory-dialog .territory-close{background:#30414b;color:#edf4f8}
#territory-dialog .territory-close:focus-visible{outline:2px solid #20b8ff;outline-offset:3px}
#territory-dialog #territory-map{cursor:default}

#territory-dialog .territory-result-group + .territory-result-group{margin-top:22px}

#territory-dialog #zone-panel .zone-pills button.is-map-hovered,#territory-dialog #zone-panel .zone-pills button:hover,#territory-dialog #zone-panel .zone-pills button:focus-visible{background:#e2f2fc;color:#174d70;border-color:#2989be;box-shadow:inset 0 0 0 1px #2989be}
.culture-dark #territory-dialog #zone-panel .zone-pills button.is-map-hovered,#territory-dialog #zone-panel .zone-pills button:hover,#territory-dialog #zone-panel .zone-pills button:focus-visible{background:#284b61;color:#e4f5ff;border-color:#8acff5;box-shadow:inset 0 0 0 1px #8acff5}
#territory-dialog #zone-panel .zone-pills button.is-map-hovered[aria-pressed=true],#territory-dialog #zone-panel .zone-pills button[aria-pressed=true]:hover,#territory-dialog #zone-panel .zone-pills button[aria-pressed=true]:focus-visible{box-shadow:inset 0 0 0 2px #b6e6ff}

