/* ═══════════════════════════════════════════════════════════════
   Moirans Pratique — Interface v2 « liquid glass » (test, 16/10/2026)
   ───────────────────────────────────────────────────────────────
   Activée par le réglage « Tester la nouvelle interface » (Perso /
   Préférences). Tout est cantonné :
     • à html.ui-v2 (classe posée dans le <head> d'index.html, puis
       par js/ui-v2.js) : sans cette classe, ce fichier ne change RIEN ;
     • au mobile (max-width: 899px) : l'ordinateur garde sa barre
       latérale actuelle.
   html.v2-eco = mode économie (verre sans flou, surfaces opaques).
   html[data-fond="…"] = ambiance choisie (aurore, lagon, couchant,
   foret, nuit ; « selon l'heure » est résolu en aurore/nuit par le JS).
   Aucune règle de app.css n'est modifiée : on surcharge seulement.
   ═══════════════════════════════════════════════════════════════ */

/* ── Hors v2 : les éléments propres à la v2 restent invisibles ── */
.v2-seul { display: none !important; }
#v2-dock { display: none; }
#v2-recherche { display: none; }

/* Le réglage n'a de sens que sur téléphone / tablette */
@media (min-width: 900px) {
  #prefs-apparence { display: none !important; }
}

/* ── Ambiances (variables utilisées uniquement en v2) ───────────── */
html {
  --v2-base: #0b0d18; --v2-b1: #7c5cff; --v2-b2: #22c3a6; --v2-b3: #ff6b8b; --v2-b4: #ffb547;
  --v2-accent: #7c5cff; --v2-accent-glow: rgba(124,92,255,.55);
  --v2-intensite: .62;
  --v2-plan-teinte: 220deg;
}
html[data-fond="lagon"]    { --v2-base: #05131f; --v2-b1: #1fb6ff; --v2-b2: #22d3a6; --v2-b3: #3b6cf6; --v2-b4: #7fe3f5; --v2-accent: #19b5d8; --v2-accent-glow: rgba(25,181,216,.55);  --v2-plan-teinte: 160deg; }
html[data-fond="couchant"] { --v2-base: #1a0c14; --v2-b1: #ff7a45; --v2-b2: #ff4f8b; --v2-b3: #ffb547; --v2-b4: #8b5cf6; --v2-accent: #ff6a4d; --v2-accent-glow: rgba(255,106,77,.55);  --v2-plan-teinte: 340deg; }
html[data-fond="foret"]    { --v2-base: #08130e; --v2-b1: #3fcf7e; --v2-b2: #138a52; --v2-b3: #c8ee8a; --v2-b4: #14b8a6; --v2-accent: #2fb46c; --v2-accent-glow: rgba(52,199,123,.5);  --v2-plan-teinte: 105deg; }
/* « Selon l'heure » : 4 ambiances propres au déroulé de la journée */
html[data-fond="matin"]    { --v2-base: #2a1a22; --v2-b1: #ffb38a; --v2-b2: #ffe08a; --v2-b3: #f7a1c4; --v2-b4: #8fd3ff; --v2-accent: #ff8a65; --v2-accent-glow: rgba(255,138,101,.55); --v2-intensite: .72;  --v2-plan-teinte: 335deg; }
html[data-fond="jour"]     { --v2-base: #0e2746; --v2-b1: #38b6ff; --v2-b2: #31e3c0; --v2-b3: #7c8cff; --v2-b4: #ffe066; --v2-accent: #1f9bff; --v2-accent-glow: rgba(31,155,255,.55); --v2-intensite: .85;  --v2-plan-teinte: 170deg; }
html[data-fond="soir"]     { --v2-base: #1f0a14; --v2-b1: #ff5e3a; --v2-b2: #d6246e; --v2-b3: #7b3fe4; --v2-b4: #ffab40; --v2-accent: #ff5e3a; --v2-accent-glow: rgba(255,94,58,.55); --v2-intensite: .70;  --v2-plan-teinte: 300deg; }
html[data-fond="nuit"]     { --v2-base: #06070d; --v2-b1: #3b3f80; --v2-b2: #1e3a66; --v2-b3: #55306a; --v2-b4: #2a3050; --v2-accent: #6f7bd8; --v2-accent-glow: rgba(111,123,216,.5); --v2-intensite: .55;  --v2-plan-teinte: 195deg; }

@media (max-width: 899px) {

  /* ═══ 1. JETONS : le verre partout ═══════════════════════════ */
  html.ui-v2:not(.ui-v2-exp) {
    --bg:       var(--v2-base);
    --card:     rgba(255,255,255,.075);
    --surface:  rgba(22,22,40,.80);
    --surface2: rgba(255,255,255,.075);
    --border:   rgba(255,255,255,.13);
    --border2:  rgba(255,255,255,.22);
    --text2:    rgba(240,240,255,.74);
    --text3:    rgba(240,240,255,.52);
    --r-md: 18px;
    --r-lg: 26px;
    --r-xl: 30px;
    --mobile-nav-h: 92px;     /* place réservée en bas des pages pour le dock flottant */
    --nav-h: 112px;           /* les toasts (compte.js) passent au-dessus du dock et de sa goutte */
    --v2-reflet: inset 0 1px 0 rgba(255,255,255,.26), inset 0 -1px 0 rgba(255,255,255,.04);
  }

  /* ═══ 2. FOND : couleur de base + grosses taches de couleur ══════
     Dégradés radiaux statiques (pas de filtre ni d'animation : coût
     quasi nul, le flou n'est calculé que par le verre des cartes). */
  html.ui-v2:not(.ui-v2-exp) body {
    background: var(--v2-base);
    background-image: none;
  }
  html.ui-v2:not(.ui-v2-exp) body::before {
    content: '';
    position: fixed;
    inset: -12%;
    z-index: -1;
    pointer-events: none;
    background:
      radial-gradient(38% 30% at 14% 8%,  var(--v2-b1), transparent 72%),
      radial-gradient(34% 28% at 92% 38%, var(--v2-b2), transparent 72%),
      radial-gradient(40% 30% at 10% 82%, var(--v2-b3), transparent 72%),
      radial-gradient(30% 24% at 88% 96%, var(--v2-b4), transparent 72%);
    opacity: var(--v2-intensite, .62);
    transition: opacity .4s;
  }

  /* ═══ 3. BARRE DU HAUT : verre, sans bouton menu ═════════════════ */
  html.ui-v2:not(.ui-v2-exp) .top-bar.mobile-app-bar {
    background: linear-gradient(rgba(255,255,255,.10), rgba(255,255,255,.03)), rgba(16,16,32,.30);
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    border-bottom: 1px solid rgba(255,255,255,.14);
    box-shadow: inset 0 -1px 0 rgba(255,255,255,.04), 0 8px 26px rgba(0,0,0,.22);
  }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-btn { display: none; }
  html.ui-v2:not(.ui-v2-exp) .top-bar-brand { padding-left: 0; }
  html.ui-v2:not(.ui-v2-exp) .top-bar-context { color: var(--text2); }
  html.ui-v2:not(.ui-v2-exp) #alertes-container { background: transparent; padding: 0 12px; }
  html.ui-v2:not(.ui-v2-exp) #alertes-container .alerte {
    border-radius: 20px; margin-top: 4px; border: 1px solid rgba(255,255,255,.14);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
  }

  /* ═══ 4. CARTES : verre dépoli, coins « organiques » ═════════════ */
  html.ui-v2:not(.ui-v2-exp) .card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 26px 22px 28px 24px;
    backdrop-filter: blur(22px) saturate(165%);
    -webkit-backdrop-filter: blur(22px) saturate(165%);
    box-shadow: var(--v2-reflet), 0 14px 34px rgba(0,0,0,.22);
  }
  html.ui-v2:not(.ui-v2-exp) .home-grid > .card:nth-child(3n+2) { border-radius: 22px 28px 24px 26px; }
  html.ui-v2:not(.ui-v2-exp) .home-grid > .card:nth-child(3n)   { border-radius: 28px 24px 26px 22px; }
  html.ui-v2:not(.ui-v2-exp) .home-grid > .grid-2 > .card:last-child { border-radius: 22px 28px 24px 26px; }

  /* Couleur d'accent : un voile coloré plutôt qu'un liseré à gauche */
  html.ui-v2:not(.ui-v2-exp) .card[class*="card--accent-"] { border-left-width: 1px; border-left-color: var(--border); }
  html.ui-v2:not(.ui-v2-exp) .card.card--accent-red    { background-image: linear-gradient(145deg, rgba(248,113,113,.20), transparent 58%); }
  html.ui-v2:not(.ui-v2-exp) .card.card--accent-blue   { background-image: linear-gradient(145deg, rgba(96,165,250,.20), transparent 58%); }
  html.ui-v2:not(.ui-v2-exp) .card.card--accent-orange { background-image: linear-gradient(145deg, rgba(251,146,60,.20), transparent 58%); }
  html.ui-v2:not(.ui-v2-exp) .card.card--accent-yellow { background-image: linear-gradient(145deg, rgba(251,191,36,.18), transparent 58%); }
  html.ui-v2:not(.ui-v2-exp) .card.card--accent-green  { background-image: linear-gradient(145deg, rgba(74,222,128,.18), transparent 58%); }
  html.ui-v2:not(.ui-v2-exp) .card.card--accent-purple { background-image: linear-gradient(145deg, rgba(192,132,252,.20), transparent 58%); }
  html.ui-v2:not(.ui-v2-exp) .home-grid > .card--accent-blue,
  html.ui-v2:not(.ui-v2-exp) .home-grid > .card--accent-orange,
  html.ui-v2:not(.ui-v2-exp) .home-grid > .card--accent-red,
  html.ui-v2:not(.ui-v2-exp) .home-grid > .card--accent-purple { background-color: var(--card); }

  /* Pastille d'icône en « galet » */
  html.ui-v2:not(.ui-v2-exp) .card-icon .picto {
    background: rgba(255,255,255,.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.32), inset 0 0 0 1px rgba(255,255,255,.14);
    border-radius: 50%;
    width: 32px; height: 32px;
  }

  html.ui-v2:not(.ui-v2-exp) .resto-card,
  html.ui-v2:not(.ui-v2-exp) .agenda-card,
  html.ui-v2:not(.ui-v2-exp) .gare-card,
  html.ui-v2:not(.ui-v2-exp) .bus-arret-card,
  html.ui-v2:not(.ui-v2-exp) .service-card { border-radius: 26px 22px 28px 24px; }
  html.ui-v2:not(.ui-v2-exp) .inner-tabs { border-radius: 20px; }
  html.ui-v2:not(.ui-v2-exp) .inner-tab { border-radius: 16px; }

  /* Titres plus généreux */
  html.ui-v2:not(.ui-v2-exp) .greeting-text { font-size: 30px; letter-spacing: -.02em; }
  html.ui-v2:not(.ui-v2-exp) .section-title { font-size: 24px; }

  /* Fiches (bas d'écran) : verre plus dense pour rester lisible */
  html.ui-v2:not(.ui-v2-exp) .resto-sheet-panel,
  html.ui-v2:not(.ui-v2-exp) .poi-sheet {
    background-color: rgba(20,20,38,.82);
    backdrop-filter: blur(30px) saturate(170%);
    -webkit-backdrop-filter: blur(30px) saturate(170%);
    border-top: 1px solid var(--border2);
    border-radius: 30px 30px 0 0;
  }

  /* ═══ 5. ANCIENNE BARRE DU BAS : remplacée par le dock ═══════════ */
  html.ui-v2:not(.ui-v2-exp) #pratique-bottom-nav { display: none !important; }

  /* ═══ 6. DOCK FLOTTANT ═══════════════════════════════════════════ */
  html.ui-v2:not(.ui-v2-exp) #v2-dock {
    position: fixed;
    left: 14px; right: 14px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    height: 70px;
    z-index: 450;            /* sous les fiches (500/600) et le tiroir (3000) */
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 4px;
    border-radius: 36px 38px 34px 40px;
    background: linear-gradient(rgba(255,255,255,.13), rgba(255,255,255,.05)), rgba(16,16,32,.36);
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    border: 1px solid rgba(255,255,255,.20);
    box-shadow: var(--v2-reflet), 0 16px 38px rgba(0,0,0,.38);
  }
  /* Tiroir « Tout » ouvert : le dock passe devant pour servir de bouton Fermer */
  html.ui-v2:not(.ui-v2-exp) body.menu-open #v2-dock { z-index: 3002; }

  html.ui-v2:not(.ui-v2-exp) #v2-dock .v2-dock-btn {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0 2px;
    color: rgba(240,240,255,.66);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .01em;
    -webkit-tap-highlight-color: transparent;
    transition: color .2s, transform .15s;
  }
  html.ui-v2:not(.ui-v2-exp) #v2-dock .v2-dock-btn::before { display: none; }
  html.ui-v2:not(.ui-v2-exp) #v2-dock .v2-dock-btn .ico { width: 24px; height: 24px; vertical-align: 0; }
  html.ui-v2:not(.ui-v2-exp) #v2-dock .v2-dock-btn:active { transform: scale(.92); }
  html.ui-v2:not(.ui-v2-exp) #v2-dock .v2-dock-btn.active { color: #fff; }
  html.ui-v2:not(.ui-v2-exp) #v2-dock .v2-dock-btn::after {
    content: '';
    width: 4px; height: 4px;
    border-radius: 50%;
    background: transparent;
    transition: background .2s;
  }
  html.ui-v2:not(.ui-v2-exp) #v2-dock .v2-dock-btn.active::after { background: #fff; }
  html.ui-v2:not(.ui-v2-exp) body.menu-open #v2-dock .v2-dock-btn.active { color: rgba(240,240,255,.66); }
  html.ui-v2:not(.ui-v2-exp) body.menu-open #v2-dock .v2-dock-btn.active::after { background: transparent; }

  /* Bouton central : la goutte */
  html.ui-v2:not(.ui-v2-exp) #v2-dock .v2-dock-tout { flex: 0 0 76px; justify-content: flex-start; margin-top: -40px; color: #fff; }
  html.ui-v2:not(.ui-v2-exp) #v2-dock .v2-dock-tout::after { display: none; }
  html.ui-v2:not(.ui-v2-exp) .v2-goutte {
    width: 64px; height: 64px;
    flex: 0 0 64px;
    min-height: 64px;
    aspect-ratio: 1;
    box-sizing: border-box;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--v2-accent);
    border: 1px solid rgba(255,255,255,.38);
    box-shadow: inset 0 2px 0 rgba(255,255,255,.45), inset 0 -6px 14px rgba(0,0,0,.18), 0 10px 28px var(--v2-accent-glow);
    transition: transform .35s cubic-bezier(.34,1.56,.64,1), background .4s;
  }
  html.ui-v2:not(.ui-v2-exp) .v2-goutte .ico { width: 28px !important; height: 28px !important; }
  html.ui-v2:not(.ui-v2-exp) .v2-goutte .v2-ico-fermer { display: none; }
  html.ui-v2:not(.ui-v2-exp) body.menu-open .v2-goutte { transform: rotate(90deg); }
  html.ui-v2:not(.ui-v2-exp) body.menu-open .v2-goutte .v2-ico-tout { display: none; }
  html.ui-v2:not(.ui-v2-exp) body.menu-open .v2-goutte .v2-ico-fermer { display: inline-block; transform: rotate(-90deg); }

  /* Bandeau « Nouvelle version disponible » (js/mise-a-jour.js, style en ligne) */
  html.ui-v2:not(.ui-v2-exp) #mp-update-banner { bottom: calc(128px + env(safe-area-inset-bottom, 0px)) !important; }

  /* ═══ 7. TIROIR « TOUT » : le menu devient une feuille de verre ══ */
  html.ui-v2:not(.ui-v2-exp) .mobile-drawer-backdrop { background: rgba(4,5,12,.42); }
  html.ui-v2:not(.ui-v2-exp) .mobile-drawer {
    top: auto;
    left: 0; right: 0; bottom: 0;
    width: auto;
    max-height: calc(100dvh - 56px - env(safe-area-inset-top, 0px));
    padding-top: 0;
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    border-radius: 36px 36px 0 0;
    border: 1px solid rgba(255,255,255,.18);
    border-bottom: 0;
    background: rgba(18,16,34,.62);
    backdrop-filter: blur(34px) saturate(180%);
    -webkit-backdrop-filter: blur(34px) saturate(180%);
    box-shadow: var(--v2-reflet), 0 -18px 50px rgba(0,0,0,.4);
    transform: translateY(105%);
    transition: transform .42s cubic-bezier(.16,1,.3,1);
  }
  html.ui-v2:not(.ui-v2-exp) .mobile-drawer.is-open { transform: none; }
  html.ui-v2:not(.ui-v2-exp) .mobile-drawer.v2-glisse { transition: none; }
  html.ui-v2:not(.ui-v2-exp) .mobile-drawer-head,
  html.ui-v2:not(.ui-v2-exp) .mobile-drawer-footer { display: none; }

  /* Poignée + recherche (ajoutées par js/ui-v2.js) */
  html.ui-v2:not(.ui-v2-exp) #v2-recherche {
    display: block;
    padding: 10px 18px 4px;
    touch-action: none;   /* le geste vers le bas ferme la feuille */
  }
  html.ui-v2:not(.ui-v2-exp) .v2-poignee {
    width: 42px; height: 5px;
    margin: 0 auto 14px;
    border-radius: 3px;
    background: rgba(255,255,255,.35);
  }
  html.ui-v2:not(.ui-v2-exp) .v2-champ {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 50px;
    padding: 0 16px;
    border-radius: 26px 24px 27px 23px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.2);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
    color: var(--text2);
    touch-action: auto;
  }
  html.ui-v2:not(.ui-v2-exp) .v2-champ .ico { width: 20px; height: 20px; flex: 0 0 auto; }
  html.ui-v2:not(.ui-v2-exp) .v2-champ input {
    flex: 1;
    min-width: 0;
    background: none;
    border: 0;
    outline: none;
    color: var(--text);
    font: inherit;
    font-size: 16px;      /* 16px : évite le zoom automatique d'iOS */
  }
  html.ui-v2:not(.ui-v2-exp) .v2-champ input::placeholder { color: var(--text3); }
  html.ui-v2:not(.ui-v2-exp) .v2-aucun {
    display: none;
    padding: 18px 8px 4px;
    color: var(--text2);
    font-size: 14px;
    text-align: center;
  }
  html.ui-v2:not(.ui-v2-exp) .v2-aucun.visible { display: block; }

  html.ui-v2:not(.ui-v2-exp) .mobile-drawer-scroll { padding: 6px 14px 10px; overscroll-behavior: contain; }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-section {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px 4px;
    margin-bottom: 20px;
  }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-section.v2-vide,
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-item.v2-cache { display: none !important; }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-title {
    grid-column: 1 / -1;
    padding: 8px 4px 0;
    color: var(--text);
    font-family: var(--font-d);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -.01em;
    text-transform: none;
  }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-item {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: center !important;
    gap: 7px !important;
    width: auto !important;
    min-height: 0;
    padding: 2px 1px;
    margin: 0 !important;
    border-radius: 14px;
    background: none !important;
    color: var(--text) !important;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.2;
    -webkit-tap-highlight-color: transparent;
  }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-item:active { transform: scale(.94); }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-icon {
    --galet: rgba(170,140,255,.34);
    width: 58px !important; height: 58px !important;
    min-width: 58px !important; flex: 0 0 58px !important;
    border-radius: 50%;
    background: var(--galet);
    border: 1px solid rgba(255,255,255,.22);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.36), inset 0 -8px 16px rgba(0,0,0,.12);
    transition: box-shadow .2s;
  }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-icon .picto {
    width: 32px !important; height: 32px !important;
    background: none; box-shadow: none; color: #fff;
  }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-icon .picto .ico { width: 100%; height: 100%; }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-icon img { width: 28px !important; height: 28px !important; opacity: 1 !important; }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-item.active .mobile-menu-icon {
    box-shadow: inset 0 1px 0 rgba(255,255,255,.36), 0 0 0 2px #fff;
  }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-item.active .picto { color: #fff; }

  /* Une couleur par rubrique */
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-item[data-page="accueil"]        .mobile-menu-icon { --galet: rgba(170,140,255,.36); }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-item[onclick*="exploreur"]       .mobile-menu-icon { --galet: rgba(255,181,71,.34); }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-item[data-page="carte"]          .mobile-menu-icon { --galet: rgba(94,234,212,.30); }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-item[data-page="alertes"]        .mobile-menu-icon { --galet: rgba(251,191,36,.32); }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-item[data-page="preferences"]    .mobile-menu-icon { --galet: rgba(148,163,184,.32); }
  html.ui-v2:not(.ui-v2-exp) #drawer-install-guide-btn                     .mobile-menu-icon { --galet: rgba(74,222,128,.28); }
  html.ui-v2:not(.ui-v2-exp) #drawer-partage-btn                           .mobile-menu-icon { --galet: rgba(244,114,182,.30); }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-item[data-page="restaurants"]    .mobile-menu-icon { --galet: rgba(253,186,116,.34); }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-item[data-page="commercants"]    .mobile-menu-icon { --galet: rgba(244,114,182,.32); }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-item[data-page="associations"]   .mobile-menu-icon { --galet: rgba(192,132,252,.34); }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-item[data-page="sante"]          .mobile-menu-icon { --galet: rgba(255,107,139,.36); }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-item[data-page="services"]       .mobile-menu-icon { --galet: rgba(45,212,191,.30); }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-item[data-page="agenda"]         .mobile-menu-icon { --galet: rgba(232,121,249,.30); }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-item[data-page="transports"]     .mobile-menu-icon { --galet: rgba(96,165,250,.36); }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-item[data-page="travaux"]        .mobile-menu-icon { --galet: rgba(251,146,60,.32); }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-item[data-page="moirans-mag"]    .mobile-menu-icon { --galet: rgba(129,140,248,.34); }
  html.ui-v2:not(.ui-v2-exp) .mobile-menu-item[data-page="numeros-utiles"] .mobile-menu-icon { --galet: rgba(134,239,172,.28); }

  /* ═══ 8. PLAN ═════════════════════════════════════════════════════
     La carte passe sous le dock de verre ; les boutons (Où suis-je ?,
     suivi GPS) et les crédits remontent au-dessus. Quand la fiche d'un
     lieu est ouverte, carte.js les place au-dessus d'elle (.raised). */
  html.ui-v2:not(.ui-v2-exp) #page-carte .map-fabs:not(.raised) { bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }
  html.ui-v2:not(.ui-v2-exp) #page-carte .gps-indicator:not(.raised) { bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }
  html.ui-v2:not(.ui-v2-exp) #page-carte .leaflet-bottom { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  html.ui-v2:not(.ui-v2-exp) #page-carte .fab {
    background: rgba(255,255,255,.14);
    backdrop-filter: blur(20px) saturate(170%);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    border: 1px solid rgba(255,255,255,.24);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 8px 22px rgba(0,0,0,.3);
    color: #fff;
  }
  html.ui-v2:not(.ui-v2-exp) #page-carte .fab-lg { background: var(--v2-accent); }

  /* Plan aux couleurs de l'app (réglage « Plan », activé par défaut) :
     le fond de carte OpenStreetMap passe en sombre, teinté selon
     l'ambiance. Seules les tuiles sont filtrées : marqueurs, fiches et
     itinéraires gardent leurs vraies couleurs. */
  html.ui-v2:not(.ui-v2-exp).v2-plan #map { background: var(--v2-base); }
  html.ui-v2:not(.ui-v2-exp).v2-plan #map .leaflet-tile-pane {
    filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9) saturate(.35)
            sepia(.45) hue-rotate(var(--v2-plan-teinte, 210deg)) saturate(1.9) brightness(.95);
  }
  html.ui-v2:not(.ui-v2-exp).v2-plan .leaflet-control-attribution {
    background: rgba(10,10,22,.55) !important;
    color: rgba(240,240,255,.7);
    border-radius: 10px 0 0 0;
  }
  html.ui-v2:not(.ui-v2-exp).v2-plan .leaflet-control-attribution a { color: rgba(240,240,255,.85); }

  /* ═══ 9. PERSO (page Préférences) ════════════════════════════════ */
  html.ui-v2:not(.ui-v2-exp) .v2-seul { display: revert !important; }
  html.ui-v2:not(.ui-v2-exp) .v1-seul { display: none !important; }

  html.ui-v2:not(.ui-v2-exp) .v2-perso-titre {
    margin: 0 2px 4px;
    font-family: var(--font-d);
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1.1;
  }
  html.ui-v2:not(.ui-v2-exp) .v2-perso-sous { margin: 0 2px 16px; color: var(--text2); font-size: 13.5px; }

  /* Mon portefeuille : la carte vedette */
  html.ui-v2:not(.ui-v2-exp) .v2-portefeuille {
    position: relative;
    overflow: hidden;
    margin-bottom: 14px;
    padding: 20px 20px 18px;
    border-radius: 32px 28px 34px 30px;
    border: 1px solid rgba(255,255,255,.24);
    background:
      radial-gradient(70% 90% at 100% 0%, var(--v2-accent-glow), transparent 70%),
      linear-gradient(150deg, rgba(255,255,255,.16), rgba(255,255,255,.05));
    backdrop-filter: blur(22px) saturate(165%);
    -webkit-backdrop-filter: blur(22px) saturate(165%);
    box-shadow: var(--v2-reflet), 0 18px 40px rgba(0,0,0,.3);
  }
  html.ui-v2:not(.ui-v2-exp) .v2-portefeuille-tete { display: flex; align-items: center; gap: 14px; }
  html.ui-v2:not(.ui-v2-exp) .v2-portefeuille-ico {
    width: 54px; height: 54px; flex: 0 0 54px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--v2-accent);
    border: 1px solid rgba(255,255,255,.38);
    box-shadow: inset 0 2px 0 rgba(255,255,255,.45), 0 8px 22px var(--v2-accent-glow);
    color: #fff;
  }
  html.ui-v2:not(.ui-v2-exp) .v2-portefeuille-ico .ico { width: 28px; height: 28px; vertical-align: 0; }
  html.ui-v2:not(.ui-v2-exp) .v2-portefeuille h2 { margin: 0; font-family: var(--font-d); font-size: 21px; font-weight: 600; }
  html.ui-v2:not(.ui-v2-exp) .v2-portefeuille-etat { color: var(--text2); font-size: 13px; }
  html.ui-v2:not(.ui-v2-exp) .v2-portefeuille-vide {
    margin-top: 16px;
    padding: 18px 14px;
    border-radius: 20px;
    border: 1px dashed rgba(255,255,255,.26);
    color: var(--text2);
    font-size: 13.5px;
    line-height: 1.5;
    text-align: center;
  }

  /* Apparence : choix du fond + mode économie */
  html.ui-v2:not(.ui-v2-exp) .v2-fonds {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 10px;
    margin: 14px 0 4px;
  }
  html.ui-v2:not(.ui-v2-exp) .v2-fond {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 0;
    color: var(--text);
    font-size: 12px; font-weight: 500;
    -webkit-tap-highlight-color: transparent;
  }
  html.ui-v2:not(.ui-v2-exp) .v2-fond-apercu {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.22);
    overflow: hidden;
    transition: box-shadow .2s, transform .15s;
  }
  html.ui-v2:not(.ui-v2-exp) .v2-fond:active .v2-fond-apercu { transform: scale(.95); }
  html.ui-v2:not(.ui-v2-exp) .v2-fond[aria-pressed="true"] .v2-fond-apercu { box-shadow: 0 0 0 3px #fff; }
  html.ui-v2:not(.ui-v2-exp) .v2-ligne-reglage { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; }
  html.ui-v2:not(.ui-v2-exp) .v2-fond[aria-pressed="true"] .v2-fond-apercu::after {
    content: '✓';
    position: absolute; top: 6px; right: 6px;
    width: 20px; height: 20px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: #fff; color: #141220;
    font-size: 12px; font-weight: 700;
  }
  html.ui-v2:not(.ui-v2-exp) .v2-eco-choix {
    display: flex;
    gap: 4px;
    margin-top: 10px;
    padding: 4px;
    border-radius: 18px;
    background: rgba(255,255,255,.07);
    border: 1px solid var(--border);
  }
  html.ui-v2:not(.ui-v2-exp) .v2-eco-choix button {
    flex: 1;
    padding: 9px 6px;
    border-radius: 14px;
    color: var(--text2);
    font-size: 13px; font-weight: 600;
  }
  html.ui-v2:not(.ui-v2-exp) .v2-eco-choix button[aria-pressed="true"] { background: rgba(255,255,255,.16); color: #fff; }
  html.ui-v2:not(.ui-v2-exp) .v2-eco-etat { margin-top: 8px; color: var(--text3); font-size: 12px; }
  html.ui-v2:not(.ui-v2-exp) .v2-sous-titre { margin-top: 18px; font-weight: 600; font-size: 14px; }

  /* ═══ 10. MODE ÉCONOMIE : verre sans flou, surfaces opaques ══════ */
  html.ui-v2:not(.ui-v2-exp).v2-eco {
    --card:     rgba(255,255,255,.085);
    --surface:  #17172a;
  }
  html.ui-v2:not(.ui-v2-exp).v2-eco *,
  html.ui-v2:not(.ui-v2-exp).v2-eco *::before,
  html.ui-v2:not(.ui-v2-exp).v2-eco *::after {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  html.ui-v2:not(.ui-v2-exp).v2-eco .top-bar.mobile-app-bar { background: rgba(18,18,34,.95); }
  html.ui-v2:not(.ui-v2-exp).v2-eco #v2-dock { background: rgba(30,30,52,.97); }
  html.ui-v2:not(.ui-v2-exp).v2-eco .mobile-drawer { background: rgba(20,20,36,.98); }
  html.ui-v2:not(.ui-v2-exp).v2-eco .resto-sheet-panel,
  html.ui-v2:not(.ui-v2-exp).v2-eco .poi-sheet { background-color: #17172a; }
  html.ui-v2:not(.ui-v2-exp).v2-eco .v2-portefeuille { background: linear-gradient(150deg, rgba(60,56,96,.97), rgba(34,32,58,.97)); }
}

@media (max-width: 899px) and (prefers-reduced-motion: reduce) {
  html.ui-v2 .v2-goutte,
  html.ui-v2 .mobile-drawer { transition: none; }
}


/* ═══════════════════════════════════════════════════════════════
   MOIRANS EXPLOREUR (exploreur.html : html.ui-v2.ui-v2-exp)
   Seul l'habillage de l'Exploreur change : en-tête, barre du bas,
   listes d'aventures, profil, classement et fenêtres d'accueil.
   L'interface propre de chaque aventure reste intacte :
     • la page « En cours » (#exploreur-page-encours) garde ses jetons
       et ses styles d'origine ;
     • le mode jeu immersif (body.xj-actif) désactive tout ce bloc.
   ═══════════════════════════════════════════════════════════════ */

/* Fond : couleur de base + taches de couleur (comme Moirans Pratique) */
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) {
  background: var(--v2-base);
}
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif)::before {
  content: '';
  position: fixed;
  inset: -12%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38% 30% at 14% 8%,  var(--v2-b1), transparent 72%),
    radial-gradient(34% 28% at 92% 38%, var(--v2-b2), transparent 72%),
    radial-gradient(40% 30% at 10% 82%, var(--v2-b3), transparent 72%),
    radial-gradient(30% 24% at 88% 96%, var(--v2-b4), transparent 72%);
  opacity: var(--v2-intensite, .62);
}
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) #exploreur-app,
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) #exploreur-pages { background: transparent; }

/* Jetons « verre » : seulement hors de la page En cours */
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) .exploreur-page:not(#exploreur-page-encours),
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) .exploreur-header,
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) .exploreur-bottom-nav,
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) .exploreur-modal-box {
  --card:     rgba(255,255,255,.075);
  --surface2: rgba(255,255,255,.075);
  --border:   rgba(255,255,255,.13);
  --border2:  rgba(255,255,255,.22);
  --text2:    rgba(240,240,255,.74);
  --text3:    rgba(240,240,255,.52);
}
/* Place réservée en bas des pages pour la barre flottante */
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) { --mobile-nav-h: 92px; }

/* En-tête : barre de verre pleine largeur */
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) .exploreur-header {
  background: linear-gradient(rgba(255,255,255,.10), rgba(255,255,255,.03)), rgba(16,16,32,.30);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  border-bottom: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 8px 26px rgba(0,0,0,.22);
}
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) .exploreur-back {
  width: 38px; height: 38px; flex-basis: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
}

/* Barre du bas : dock flottant */
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) .exploreur-bottom-nav {
  position: fixed;
  left: 14px; right: 14px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  width: auto;
  height: 70px;
  padding: 7px;
  gap: 4px;
  border-radius: 36px;
  background: linear-gradient(rgba(255,255,255,.13), rgba(255,255,255,.05)), rgba(16,16,32,.36);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid rgba(255,255,255,.20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.26), 0 16px 38px rgba(0,0,0,.38);
}
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) .exploreur-nav-btn {
  border-radius: 28px;
  color: rgba(240,240,255,.7);
  font-size: 10.5px;
  font-weight: 600;
}
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) .exploreur-nav-btn.active {
  background: var(--v2-accent);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 6px 18px var(--v2-accent-glow);
}

/* Titres */
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) .exploreur-page:not(#exploreur-page-encours) h1 { font-size: 30px; }

/* Cartes d'aventure, encadrés, fenêtres : verre dépoli */
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) .exploreur-adventure-card,
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) .exploreur-page:not(#exploreur-page-encours) .exploreur-placeholder {
  background-color: rgba(255,255,255,.075);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 26px;
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24), 0 14px 34px rgba(0,0,0,.22);
}
/* La couleur propre à chaque aventure : un voile coloré au lieu du liseré */
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) .exploreur-adventure-card {
  background-image: linear-gradient(145deg,
    color-mix(in srgb, var(--exploreur-card-couleur, #4ade80) 24%, transparent), transparent 60%);
}
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) .exploreur-adventure-card-icon { border-radius: 50%; }
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) .exploreur-adventure-card-banniere,
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) .exploreur-adventure-card-banniere img { border-radius: 20px; }
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) .exploreur-chip { border-radius: 999px; }
html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) .exploreur-code-lien { border-radius: 999px; }

html.ui-v2.ui-v2-exp body.exploreur-app:not(.xj-actif) .exploreur-modal-box {
  background: rgba(22,22,40,.80);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 30px;
  backdrop-filter: blur(30px) saturate(170%);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
}

/* Mode économie : sans flou, surfaces qui recouvrent du contenu opaques */
html.ui-v2.ui-v2-exp.v2-eco body.exploreur-app:not(.xj-actif) .exploreur-header,
html.ui-v2.ui-v2-exp.v2-eco body.exploreur-app:not(.xj-actif) .exploreur-bottom-nav,
html.ui-v2.ui-v2-exp.v2-eco body.exploreur-app:not(.xj-actif) .exploreur-adventure-card,
html.ui-v2.ui-v2-exp.v2-eco body.exploreur-app:not(.xj-actif) .exploreur-placeholder,
html.ui-v2.ui-v2-exp.v2-eco body.exploreur-app:not(.xj-actif) .exploreur-modal-box {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html.ui-v2.ui-v2-exp.v2-eco body.exploreur-app:not(.xj-actif) .exploreur-header { background: rgba(18,18,34,.95); }
html.ui-v2.ui-v2-exp.v2-eco body.exploreur-app:not(.xj-actif) .exploreur-bottom-nav { background: rgba(30,30,52,.97); }
html.ui-v2.ui-v2-exp.v2-eco body.exploreur-app:not(.xj-actif) .exploreur-modal-box { background: #17172a; }


/* ═══════════════════════════════════════════════════════════════
   Accueil — La Poste / Déchèterie (deux demi-cartes côte à côte)
   Les deux interfaces, sur téléphone : en demi-largeur, le titre, le
   badge « Ouverte » et les noms longs des bureaux se marchaient dessus
   (badge coupé, titre sur deux lignes). Le badge passe sous le titre et
   les lignes « bureau + Ouvert » vont à la ligne quand il le faut.
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 899px) {
  #home-poste-dechet .card-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
    row-gap: 3px;
  }
  #home-poste-dechet .card-header .card-icon { grid-row: span 2; }
  #home-poste-dechet .card-header .card-title {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
  }
  #home-poste-dechet .card-header .chip {
    justify-self: start;
    margin: 0;
    max-width: 100%;
  }
  /* Bureaux secondaires : nom puis badge, sans écrasement */
  #poste-home div[style*="space-between"] {
    flex-wrap: wrap;
    gap: 4px 8px;
  }
  #poste-home div[style*="space-between"] > span:first-child {
    font-size: 12.5px !important;
    line-height: 1.3;
  }
  #home-poste-dechet .card-body { overflow-wrap: anywhere; }
}


/* ═══════════════════════════════════════════════════════════════
   Interface v2 — surfaces posées PAR-DESSUS le contenu
   Bandeaux (toast « Nouvelle interface activée… », info cookie) et
   fenêtres (données et appareils, éphéméride, partage, dialogues de
   l'accueil, guide d'installation) : avec les jetons « verre » très
   transparents, le texte de dessous se mélangeait au leur. Verre dense
   et lisible, sans changer leur forme.
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 899px) {
  html.ui-v2:not(.ui-v2-exp) .mpc-toast,
  html.ui-v2:not(.ui-v2-exp) .mpc-info-cookie,
  html.ui-v2:not(.ui-v2-exp) .mpc-modal,
  html.ui-v2:not(.ui-v2-exp) .modal-card,
  html.ui-v2:not(.ui-v2-exp) .partage-box,
  html.ui-v2:not(.ui-v2-exp) .accueil-dialogue-boite {
    background: rgba(26,26,46,.93);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 14px 40px rgba(0,0,0,.5);
    color: var(--text);
  }
  /* Bandeaux : discrets mais nets */
  html.ui-v2:not(.ui-v2-exp) .mpc-toast,
  html.ui-v2:not(.ui-v2-exp) .mpc-info-cookie { border-radius: 20px; font-size: 13px; }
  html.ui-v2:not(.ui-v2-exp) .mpc-toast-close { color: var(--text2); }

  html.ui-v2:not(.ui-v2-exp).v2-eco .mpc-toast,
  html.ui-v2:not(.ui-v2-exp).v2-eco .mpc-info-cookie,
  html.ui-v2:not(.ui-v2-exp).v2-eco .mpc-modal,
  html.ui-v2:not(.ui-v2-exp).v2-eco .modal-card,
  html.ui-v2:not(.ui-v2-exp).v2-eco .partage-box,
  html.ui-v2:not(.ui-v2-exp).v2-eco .accueil-dialogue-boite { background: #1b1b30; }
}
