/* Accueil mobile (Ergonomie v2) : la carte d'abord, une feuille unique en bas, deux contrôles flottants. */
.country-view {--home-paper:#fff; --home-ink:#14171C; --home-muted:#6B7280; --home-line:#ECEDF0; --home-chip:#F2F3F5; --home-field:#F2F3F5; --home-blue:#1C6EF2; --home-shadow:0 -8px 30px rgb(16 24 40 / .12)}
html[data-atlas-theme=night] .country-view {--home-paper:#171B22; --home-ink:#F2F4F7; --home-muted:#9AA3B0; --home-line:#2A303A; --home-chip:#262C36; --home-field:#262C36; --home-shadow:0 -8px 30px rgb(0 0 0 / .45)}
@media (max-width:779px), (max-width:1024px) and (pointer:coarse) {
  /* La feuille */
  .country-view .national-sidebar.search-hub[data-home] {
    position:absolute; top:auto!important; bottom:0!important; left:0!important; right:0!important; width:auto!important; max-width:none!important;
    height:96px; display:flex; flex-direction:column; align-items:stretch; justify-items:stretch; grid-template-columns:none; grid-template-rows:none; margin:0; padding:0 0 env(safe-area-inset-bottom);
    border:0; border-radius:26px 26px 0 0; background:var(--home-paper); color:var(--home-ink); box-shadow:var(--home-shadow); overflow:hidden; z-index:30;
    font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; will-change:height; contain:layout style;
  }
  .country-view .national-sidebar[data-home] .atlas-brand {display:none!important}
  .country-view .national-sidebar[data-home] .atlas-top-actions {display:contents}
  .country-view .home-grab {display:flex; align-items:flex-start; justify-content:center; height:22px; min-height:22px; width:100%; padding:8px 0 0; border:0; background:none; touch-action:none; cursor:grab; flex-shrink:0}
  .country-view .home-grab span {width:38px; height:5px; border-radius:9px; background:#DADCE1}
  html[data-atlas-theme=night] .country-view .home-grab span {background:#3A414D}
  .country-view .home-row {display:flex; align-items:center; gap:10px; width:100%; box-sizing:border-box; align-self:stretch; padding:10px 20px 8px; flex-shrink:0; touch-action:pan-x}
  .country-view .home-row .national-search {flex:1; min-width:0; margin:0; padding:0; grid-column:auto; grid-row:auto; position:static}
  .country-view .home-row .national-search>div {display:flex; align-items:center; gap:8px; height:48px; padding:0 12px 0 16px; border:0; border-radius:16px; background:var(--home-field); box-shadow:none}
  .country-view .home-row .national-search>div>svg {width:22px; height:22px; color:var(--home-muted); flex-shrink:0}
  .country-view .home-row .national-search input {flex:1; min-width:0; height:48px; padding:0; border:0; background:none; font-size:17px; font-weight:500; color:var(--home-ink); box-shadow:none}
  .country-view .home-row .national-search input::placeholder {color:var(--home-muted)}
  .country-view .home-row .national-search>div button {width:36px; height:36px; min-height:36px; padding:0; border:0; background:none; color:var(--home-muted); display:grid; place-items:center; flex-shrink:0}
  .country-view .home-row .national-search>div button svg {width:22px; height:22px}
  .country-view .home-row #routeToggle {order:2; width:48px; height:48px; min-height:48px; min-width:48px; padding:0; border:0; border-radius:16px; background:var(--home-field); color:var(--home-blue); display:grid; place-items:center; font-size:0; flex-shrink:0; margin:0}
  .country-view .home-row #routeToggle svg {width:22px; height:22px}
  .country-view .home-row #routeToggle b {display:none}
  .country-view .home-row .home-avatar {order:3; font-size:0; overflow:hidden; width:48px; height:48px; min-height:48px; min-width:48px; padding:0; border:0; border-radius:50%; background:var(--home-ink); color:var(--home-paper); display:grid; place-items:center; flex-shrink:0; margin:0; box-shadow:none}
  .country-view .home-row .home-avatar svg {width:22px; height:22px}
  .country-view .home-row .home-avatar.active {outline:3px solid var(--home-blue); outline-offset:2px}
  .country-view .home-content {flex:1; min-height:0; width:100%; box-sizing:border-box; align-self:stretch; overflow:hidden; padding:0 20px 12px; overscroll-behavior:contain}
  .country-view .home-content.home-scroll {overflow:auto; scrollbar-width:none}
  .country-view .home-content::-webkit-scrollbar {display:none}
  .country-view .national-sidebar[data-home][data-state=low] .home-content {visibility:hidden}
  /* Résultats et atterrissage de la recherche, dans la feuille */
  .country-view .national-sidebar[data-home] .national-search-results {position:static!important; top:auto!important; left:auto!important; right:auto!important; width:auto!important; max-height:none!important; margin:0!important; padding:0!important; border:0!important; border-radius:0!important; background:none!important; box-shadow:none!important; overflow:visible!important}
  .country-view .national-sidebar[data-home] .national-search-results[hidden] {display:none}
  .country-view .national-sidebar[data-home] .search-results-heading {padding:16px 0 8px; margin:0; border:0; font-size:12px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--home-ink)}
  .country-view .national-sidebar[data-home] .search-results-heading.nearby {position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); padding:0; margin:0}
  .country-view .national-sidebar[data-home] .search-nearby-categories {display:flex!important; flex-wrap:nowrap; gap:8px; padding:4px 20px 6px!important; margin:0 -20px!important; width:calc(100% + 40px)!important; box-sizing:border-box; overflow-x:auto; scrollbar-width:none; grid-template-columns:none; order:1}
  .country-view .national-sidebar[data-home] .national-search-results {display:flex; flex-direction:column}
  .country-view .national-sidebar[data-home] .national-search-results[hidden] {display:none!important}
  .country-view .national-sidebar[data-home] .national-search-results>* {order:3}
  .country-view .national-sidebar[data-home] .atlas-profile-search-shortcuts {order:2}
  .country-view .national-sidebar[data-home] .search-nearby-categories::-webkit-scrollbar {display:none}
  .country-view .national-sidebar[data-home] .search-nearby-categories button {flex:0 0 auto!important; width:auto!important; min-width:0!important; max-width:none!important; display:flex!important; flex-direction:row!important; align-items:center; gap:7px; height:40px!important; min-height:40px!important; padding:0 14px 0 12px!important; margin:0!important; border:1.5px solid var(--home-line)!important; border-radius:99px!important; background:var(--home-paper)!important; color:var(--home-ink)!important; font-size:14px; font-weight:600; white-space:nowrap; box-shadow:none!important}
  .country-view .national-sidebar[data-home] .search-nearby-categories button.active {background:var(--home-ink)!important; color:var(--home-paper)!important; border-color:var(--home-ink)!important}
  .country-view .national-sidebar[data-home] .search-nearby-categories button i {width:20px; height:20px; border-radius:50%; background:none!important; color:inherit; display:grid; place-items:center}
  .country-view .national-sidebar[data-home] .search-nearby-categories button i svg {width:18px; height:18px}
  .country-view .national-sidebar[data-home] .search-nearby-categories button span {font-size:14px!important; font-weight:600; overflow:visible}
  .country-view .national-sidebar[data-home] .search-nearby-categories .atlas-categories-more {border-style:dashed; color:var(--home-muted); font-weight:600}
  .country-view .national-sidebar[data-home] .atlas-search-result {display:flex; align-items:center; gap:14px; width:100%; min-height:72px; padding:12px 0; margin:0; border:0; border-bottom:1px solid var(--home-line); border-radius:0; background:none; color:var(--home-ink); text-align:start; box-shadow:none}
  .country-view .national-sidebar[data-home] .atlas-search-result:last-child {border-bottom:0}
  .country-view .national-sidebar[data-home] .atlas-search-result i {width:48px; height:48px; min-width:48px; border-radius:14px; display:grid; place-items:center; background:var(--home-chip)!important; color:var(--home-ink)}
  .country-view .national-sidebar[data-home] .atlas-search-result i svg {width:22px; height:22px}
  .country-view .national-sidebar[data-home] .atlas-search-result-text {display:flex; flex-direction:column; gap:2px; min-width:0; flex:1}
  .country-view .national-sidebar[data-home] .atlas-search-result b {font-size:17px; font-weight:600; line-height:1.25; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
  .country-view .national-sidebar[data-home] .atlas-search-result b mark {background:none; color:var(--home-blue)}
  .country-view .national-sidebar[data-home] .atlas-search-result small {font-size:14px; color:var(--home-muted); line-height:1.3; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
  .country-view .national-sidebar[data-home] .national-search-results .empty {padding:14px 0; font-size:14px; color:var(--home-muted)}
  .country-view .national-sidebar[data-home] .national-search-results>* {max-width:100%}
  .country-view .national-sidebar[data-home] .atlas-profile-search-shortcuts {display:flex; gap:8px; margin:12px 0 2px}
  .country-view .national-sidebar[data-home] .atlas-profile-search-shortcuts>button {flex:1; min-width:0; height:44px; min-height:44px; padding:0 12px; border:1.5px solid var(--home-line); border-radius:14px; background:var(--home-paper); color:var(--home-ink); font-size:14px; font-weight:600; display:flex; align-items:center; gap:8px; box-shadow:none}
  .country-view .national-sidebar[data-home] .atlas-profile-search-shortcuts>button i,.country-view .national-sidebar[data-home] .atlas-profile-search-shortcuts>button svg {width:20px; height:20px; background:none!important; color:var(--home-blue)}
  /* À proximité (recherche par catégorie), dans la feuille */
  .country-view .national-sidebar[data-home] .atlas-nearby-panel {position:static; width:auto; max-height:none; margin:0; padding:0; border:0; border-radius:0; background:none; box-shadow:none; transform:none; overflow:visible; color:var(--home-ink)}
  .country-view .national-sidebar[data-home] .atlas-nearby-panel[hidden] {display:none}
  .country-view .national-sidebar[data-home] .atlas-nearby-panel>header {display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding:12px 0 4px; margin:0}
  .country-view .national-sidebar[data-home] .atlas-nearby-panel h2 {font-size:20px; font-weight:700; letter-spacing:-.01em; margin:0}
  .country-view .national-sidebar[data-home] .atlas-nearby-panel #atlasNearbyCount {font-size:14px; color:var(--home-muted); margin:2px 0 0}
  .country-view .national-sidebar[data-home] .atlas-nearby-panel>header button {width:34px; height:34px; min-height:34px; border:0; border-radius:50%; background:var(--home-chip); color:var(--home-ink); font-size:17px; padding:0}
  .country-view .national-sidebar[data-home] .atlas-nearby-actions {display:flex; gap:8px; margin:6px 0 2px}
  .country-view .national-sidebar[data-home] .atlas-nearby-actions button {height:36px; min-height:36px; padding:0 14px; border:1.5px solid var(--home-line); border-radius:99px; background:none; color:var(--home-ink); font-size:13.5px; font-weight:600}
  .country-view .national-sidebar[data-home] #atlasNearbyOrigin {font-size:12.5px; color:var(--home-muted); margin:6px 0 4px}
  .country-view .national-sidebar[data-home] .atlas-nearby-row {display:flex; align-items:center; gap:14px; width:100%; min-height:72px; padding:12px 0; border:0; border-bottom:1px solid var(--home-line); border-radius:0; background:none; color:var(--home-ink)}
  .country-view .national-sidebar[data-home] .atlas-nearby-row i {width:48px; height:48px; border-radius:14px; background:var(--home-chip); color:var(--home-ink); font-size:16px; font-weight:700; display:grid; place-items:center}
  .country-view .national-sidebar[data-home] .atlas-nearby-row>span {gap:2px}
  .country-view .national-sidebar[data-home] .atlas-nearby-row b {font-size:17px; font-weight:600}
  .country-view .national-sidebar[data-home] .atlas-nearby-row small {font-size:14px; color:var(--home-muted)}
  .country-view .national-sidebar[data-home] .atlas-nearby-empty {font-size:14px; color:var(--home-muted); padding:12px 0}
  .country-view .home-zone {position:absolute; top:calc(14px + env(safe-area-inset-top)); left:0; right:0; display:flex; justify-content:center; pointer-events:none; z-index:20}
  .country-view .home-zone[hidden] {display:none}
  .country-view .home-zone button {pointer-events:auto; height:44px; min-height:44px; padding:0 18px; border:0; border-radius:99px; background:rgb(255 255 255 / .9); backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px); color:var(--home-ink); font-size:15px; font-weight:700; box-shadow:0 8px 24px rgb(16 24 40 / .18)}
  html[data-atlas-theme=night] .country-view .home-zone button {background:rgb(23 27 34 / .9)}
  /* Lieux enregistrés et menu, en bas de la feuille */
  .country-view .home-more {display:flex; gap:8px; padding:14px 0 6px; border-top:1px solid var(--home-line); margin-top:8px}
  .country-view .home-more button {flex:1; display:flex; align-items:center; justify-content:center; gap:8px; height:44px; min-height:44px; padding:0 12px; border:0; border-radius:14px; background:var(--home-chip); color:var(--home-ink); font-size:14px; font-weight:600; box-shadow:none}
  .country-view .home-more button svg {width:20px; height:20px}
  /* Deux contrôles flottants : position et affichage ; le reste se fait au doigt */
  .country-view .public-map-controls #atlasZoomIn,.country-view .public-map-controls #atlasZoomOut,.country-view .public-map-controls #atlasMapTilt {display:none}
  .country-view .public-map-controls {bottom:calc(var(--home-height,96px) + 16px + env(safe-area-inset-bottom)); top:auto; right:12px; transition:bottom .26s cubic-bezier(.2,.8,.2,1)}
  .country-view .public-map-controls button {width:48px; height:48px; min-height:48px; border:0; border-radius:16px; background:rgb(255 255 255 / .96); color:var(--home-ink); box-shadow:0 6px 18px rgb(0 0 0 / .16)}
  html[data-atlas-theme=night] .country-view .public-map-controls button {background:rgb(23 27 34 / .92); color:#F2F4F7}
  /* La feuille s'efface quand une fiche, un panneau, un itinéraire ou le guidage prend la place */
  .country-view[data-active-panel=regionPreview] .national-sidebar[data-home],.country-view[data-active-panel=layersPanel] .national-sidebar[data-home],.country-view[data-active-panel=atlasProfilePanel] .national-sidebar[data-home],.country-view[data-active-panel=atlasAccountPanel] .national-sidebar[data-home],.country-view[data-active-panel=atlasMenuPanel] .national-sidebar[data-home],.country-view[data-active-panel=atlasInfoPanel] .national-sidebar[data-home],.country-view[data-active-panel=nationalNavigation] .national-sidebar[data-home],.country-view[data-active-panel=nationalRouteDrawer] .national-sidebar[data-home] {display:none}
  .country-view .atlas-back {display:none!important}
}
/* R1 (vérification Codex du 22/11) : de nuit, la feuille de recherche du téléphone garde son fond
   (design-system.css rend transparente la barre flottante de l'ancienne interface). */
html[data-atlas-theme=night] .country-view#countryView .national-sidebar.search-hub[data-home=sheet] {background:var(--home-paper)!important; box-shadow:var(--home-shadow)!important}
