/* Sélecteur commun : il reste accessible dans les deux interfaces. */
.display-mode-switch{display:flex;flex:0 0 auto;gap:3px;padding:3px;border:1px solid #29495c;border-radius:14px;background:#061722}.display-mode-switch button{min-height:32px;padding:5px 8px;border:0;border-radius:10px;color:#8298a6;font-size:10px}.display-mode-switch button.active{background:#1473e6;color:#fff;box-shadow:0 3px 10px #0005}.mobile-builder-toggle{display:none}

/* Toute la nouvelle interface tactile est activée par le choix Mobile. */
html[data-display-mode="mobile"],html[data-display-mode="mobile"] body{width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
html[data-display-mode="mobile"] body{position:fixed;inset:0;padding:0;background:#06131d}
html[data-display-mode="mobile"] .topbar{position:relative;z-index:20;display:grid;width:100%;height:112px;min-height:112px;padding:max(7px,env(safe-area-inset-top)) 10px 7px;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:38px 57px;gap:4px 8px;border-bottom:1px solid #244254;background:#081e2c;box-shadow:0 4px 18px #0007}
html[data-display-mode="mobile"] .topbar>div:first-child{grid-column:1;grid-row:1;min-width:0;text-align:left}html[data-display-mode="mobile"] .topbar>div:first-child small{display:block;font-size:8px;letter-spacing:.17em}html[data-display-mode="mobile"] .topbar>div:first-child h1{margin:2px 0 0;overflow:hidden;font-size:14px;text-overflow:ellipsis;white-space:nowrap}
html[data-display-mode="mobile"] .topbar>.header-map-menu{display:block;grid-column:1/-1;grid-row:2;min-width:0}html[data-display-mode="mobile"] .header-map-menu .address-search{position:relative;inset:auto;display:grid;width:100%;height:49px;padding:5px 6px 5px 11px;grid-template-columns:18px minmax(0,1fr) 42px;border-radius:15px;background:#061722}html[data-display-mode="mobile"] .address-search input{height:37px;font-size:16px}html[data-display-mode="mobile"] .address-search>button{width:38px;min-height:37px;padding:0;font-size:0}html[data-display-mode="mobile"] .address-search>button::after{content:'⌕';font-size:20px}
html[data-display-mode="mobile"] .header-map-menu .map-tools{position:absolute;z-index:22;top:120px;right:8px;left:8px;display:flex;max-width:none;padding:6px;gap:5px;overflow-x:auto;border:1px solid #29495c;border-radius:16px;background:#071824e8;box-shadow:0 7px 22px #0008;scrollbar-width:none;backdrop-filter:blur(10px)}html[data-display-mode="mobile"] .map-tools::-webkit-scrollbar{display:none}html[data-display-mode="mobile"] .map-tools button{flex:0 0 auto;min-height:39px;padding:7px 10px;border-radius:12px;font-size:10px;white-space:nowrap}
html[data-display-mode="mobile"] .display-mode-switch{position:absolute;z-index:32;top:max(7px,env(safe-area-inset-top));right:8px}html[data-display-mode="mobile"] .display-mode-switch button{width:37px;padding:4px;font-size:16px}html[data-display-mode="mobile"] .display-mode-switch button span{display:none}
html[data-display-mode="mobile"] .topbar .main-nav{position:fixed;z-index:40;right:0;bottom:0;left:0;display:flex;width:100%;height:calc(66px + env(safe-area-inset-bottom));padding:5px 5px max(5px,env(safe-area-inset-bottom));gap:3px;overflow-x:auto;justify-content:flex-start;border-top:1px solid #29495c;background:#081c2aee;box-shadow:0 -8px 26px #0009;scrollbar-width:none;backdrop-filter:blur(13px)}html[data-display-mode="mobile"] .main-nav::-webkit-scrollbar{display:none}html[data-display-mode="mobile"] .main-nav>.display-mode-switch{position:fixed}html[data-display-mode="mobile"] .main-nav>button{display:grid;place-items:center;align-content:center;flex:0 0 66px;gap:2px;width:66px;min-height:54px;padding:4px 3px;border:0;border-radius:12px;color:#a9bbc5;font-size:8px;line-height:1.1}html[data-display-mode="mobile"] .main-nav>button>span{font-size:19px}html[data-display-mode="mobile"] .main-nav>button:hover,html[data-display-mode="mobile"] .main-nav>button:focus{background:#12354a;color:#fff}html[data-display-mode="mobile"] .main-nav #account-button{display:grid;max-width:none;padding:4px 3px}html[data-display-mode="mobile"] .account-button-avatar{width:28px;height:28px;flex-basis:28px}html[data-display-mode="mobile"] .account-button-name{max-width:61px;font-size:8px}html[data-display-mode="mobile"] .main-nav #donate-button{background:transparent;color:#ffd76c;box-shadow:none}
html[data-display-mode="mobile"] .layout{position:relative;display:block;width:100%;height:calc(100dvh - 112px - 66px);min-height:0}html[data-display-mode="mobile"] .map-wrap{position:absolute;inset:0;width:100%;height:100%;min-height:0;max-height:none}html[data-display-mode="mobile"] #map{position:absolute;inset:0}html[data-display-mode="mobile"] .layer-switcher{top:62px;right:8px}html[data-display-mode="mobile"] .map-interaction-hint{display:none}html[data-display-mode="mobile"] .maplibregl-ctrl-top-right{top:111px;right:7px}
html[data-display-mode="mobile"] .panel{position:fixed;z-index:30;right:0;bottom:calc(66px + env(safe-area-inset-bottom));left:0;width:100%;height:min(73dvh,680px);max-height:none;padding:65px 14px max(22px,env(safe-area-inset-bottom));overflow-y:auto;border:1px solid #315064;border-bottom:0;border-radius:24px 24px 0 0;background:#0a2030f7;box-shadow:0 -18px 55px #000b;transform:translateY(calc(100% - 57px));transition:transform .28s ease;overscroll-behavior:contain;backdrop-filter:blur(14px)}html[data-display-mode="mobile"] body.mobile-builder-open .panel{transform:translateY(0)}
html[data-display-mode="mobile"] .mobile-builder-toggle{position:absolute;top:0;right:0;left:0;display:grid;height:57px;min-height:57px;padding:17px 58px 7px 17px;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:2px 9px;border:0;border-bottom:1px solid #29495c;border-radius:24px 24px 0 0;background:#0d2a3d;color:#fff;text-align:left}html[data-display-mode="mobile"] .mobile-builder-handle{position:absolute;top:7px;left:50%;width:38px;height:4px;border-radius:3px;background:#66808f;transform:translateX(-50%)}html[data-display-mode="mobile"] .mobile-builder-toggle b{font-size:13px}html[data-display-mode="mobile"] .mobile-builder-toggle small{color:#8fa8b6;font-size:9px}html[data-display-mode="mobile"] .mobile-builder-toggle i{position:absolute;right:5px;top:7px;display:grid;width:44px;height:44px;place-items:center;color:#69b7ff;font-size:0;font-style:normal;transition:transform .25s}html[data-display-mode="mobile"] .mobile-builder-toggle i::before{content:"";width:15px;height:15px;border-top:3px solid currentColor;border-right:3px solid currentColor;filter:drop-shadow(0 1px 2px #0008);transform:translateY(4px) rotate(-45deg)}html[data-display-mode="mobile"] body.mobile-builder-open .mobile-builder-toggle i{transform:rotate(180deg)}
html[data-display-mode="mobile"] .panel>.eyebrow{display:none}html[data-display-mode="mobile"] .panel>h2{margin:0 0 14px;font-size:20px}html[data-display-mode="mobile"] .panel section{margin:13px 0}html[data-display-mode="mobile"] .roadbook-name-field input{min-height:44px;font-size:16px}html[data-display-mode="mobile"] .actions.icon-actions{grid-template-columns:repeat(6,minmax(40px,1fr));gap:5px}html[data-display-mode="mobile"] .actions.icon-actions>button,html[data-display-mode="mobile"] .actions.icon-actions>.button{min-height:44px;padding:7px}html[data-display-mode="mobile"] .options,html[data-display-mode="mobile"] .segment-card,html[data-display-mode="mobile"] .stats,html[data-display-mode="mobile"] .roadbook{border:1px solid #29495c;border-radius:16px}html[data-display-mode="mobile"] .stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:9px}html[data-display-mode="mobile"] .stats div{padding:9px 6px;text-align:center}html[data-display-mode="mobile"] .stats small{font-size:8px}html[data-display-mode="mobile"] .stats strong{font-size:11px}html[data-display-mode="mobile"] .step-card{grid-template-columns:34px minmax(0,1fr) 22px 30px;min-height:52px}html[data-display-mode="mobile"] .step-copy strong{font-size:11px}
html[data-display-mode="mobile"] dialog{width:calc(100vw - 10px);max-width:none;max-height:calc(100dvh - 10px);margin:auto;border-radius:18px}html[data-display-mode="mobile"] dialog:not(#context-dialog):not(.poi-popup){height:calc(100dvh - 10px)}html[data-display-mode="mobile"] #context-dialog{position:fixed;inset:auto 5px 5px;width:calc(100vw - 10px);max-width:none;margin:0;padding:22px 15px;border-radius:22px}html[data-display-mode="mobile"] .trips-dialog,html[data-display-mode="mobile"] .gallery-dialog,html[data-display-mode="mobile"] .clubs-dialog,html[data-display-mode="mobile"] .auth-dialog,html[data-display-mode="mobile"] .private-dialog{padding:22px 13px}html[data-display-mode="mobile"] .profile-friends{grid-template-columns:1fr}html[data-display-mode="mobile"] #toast{bottom:78px;max-width:calc(100vw - 20px);text-align:center}

/* En mode PC forcé, le site conserve ses dimensions de bureau. */
html[data-display-mode="desktop"] .display-mode-switch button[data-display-mode="desktop"]{background:#1473e6;color:#fff}html[data-display-mode="desktop"] .mobile-builder-toggle{display:none}
html[data-display-mode="mobile"] .topbar{z-index:50}html[data-display-mode="mobile"] .topbar>div:first-child{padding-right:84px}html[data-display-mode="mobile"] body>.display-mode-switch{position:fixed;z-index:60;top:max(7px,env(safe-area-inset-top));right:8px}
#mobile-fullscreen{display:none}html[data-display-mode="mobile"] #mobile-fullscreen{position:fixed;z-index:61;top:max(8px,env(safe-area-inset-top));right:91px;display:grid;place-items:center;width:35px;height:35px;min-height:35px;padding:0;border:1px solid #31566f;border-radius:11px;background:#061722;color:#9fb5c1;font-size:20px}html[data-display-mode="mobile"] #mobile-fullscreen.active{border-color:#2997ff;background:#1473e6;color:#fff}html[data-display-mode="mobile"] :fullscreen #mobile-fullscreen,html[data-display-mode="mobile"] :-webkit-full-screen #mobile-fullscreen{top:max(8px,env(safe-area-inset-top))}
#mobile-fullscreen[hidden]{display:none!important}
#mobile-map-return{display:none}html[data-display-mode="mobile"] body:has(dialog[open]) #mobile-map-return{position:fixed;z-index:2147483647;top:max(9px,env(safe-area-inset-top));left:9px;display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:7px 13px;border:1px solid #4a6a7d;border-radius:13px;background:#071824ed;color:#fff;box-shadow:0 7px 20px #000a;font-size:11px;font-weight:800;backdrop-filter:blur(10px)}html[data-display-mode="mobile"] dialog[open] .dialog-close{position:fixed;z-index:2147483646;top:max(9px,env(safe-area-inset-top));right:9px;width:38px;height:38px;min-height:38px;border:1px solid #4a6a7d;border-radius:13px;background:#071824ed;color:#fff;box-shadow:0 7px 20px #000a}
html[data-display-mode="mobile"] .panel{height:auto;max-height:min(73dvh,680px)}html[data-display-mode="mobile"] body.mobile-builder-open .header-map-menu .map-tools,html[data-display-mode="mobile"] body.mobile-builder-open .layer-switcher,html[data-display-mode="mobile"] body.mobile-builder-open .maplibregl-ctrl-top-right{opacity:0;pointer-events:none;transition:opacity .15s}html[data-display-mode="mobile"] body.mobile-builder-open .panel{box-shadow:0 -12px 42px #000c}
html[data-display-mode="mobile"] .stats:empty,html[data-display-mode="mobile"] .roadbook:empty{display:none}
