﻿/* =========================================================
   Flux Montréal — mobile.css (MOBILE)
   - ORDONNÉ / SANS DOUBLONS INUTILES
   - Mobile ONLY (ne touche pas au PC)
   - Fix iOS Safari "NO GLYPH" (select natif + kill flèches custom)
   ========================================================= */


/* =========================================================
   0) Helpers (hors media)
   ========================================================= */
.hm-mobile-only{ display:none; }


/* =========================================================
   1) HISTORIQUE — styles globaux (polices)
   ========================================================= */
.hm-hist24{
  font-family: var(--hm-font-global, "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif) !important;
}
.hm-hist24 :not(.hm-hist24-live){
  font-family: var(--hm-font-global, "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif) !important;
  font-weight: 700 !important;
  letter-spacing: .02em !important;
}
.hm-hist24 .hm-hist24-title-sub,
.hm-hist24 .hm-hist24-stamp-label{
  font-weight: 800 !important;
  letter-spacing: .12em !important;
  text-transform: uppercase !important;
}
.hm-hist24 .hm-hist24-select,
.hm-hist24 .hm-hist24-chip{
  font-weight: 800 !important;
  letter-spacing: .02em !important;
}


/* =========================================================
   2) MOBILE CORE (<= 991.98px)
   ========================================================= */
@media (max-width: 991.98px){

  /* -----------------------------------------
     2.1) Vars mobile
     ----------------------------------------- */
  :root{
    --hm-footer-h: 44px;
    --hm-mobilebar-h: 72px; /* mis à jour par JS */
    --hm-mobilebar-z: 40000;
    --hm-overlay-z: 30000;
    --hm-drawer-z: 32000;

    --hm-mobile-surface: #283242;
    --hm-mobile-surface-2: rgba(30,41,59,.55);
  }

  /* Helpers */
  .hm-mobile-only{ display:block !important; }

  /* Desktop-only: hide sur mobile */
  .hm-hide-mobile{
    display:none !important;
    visibility:hidden !important;
    pointer-events:none !important;
  }

  /* -----------------------------------------
     2.2) Desktop header OFF (mobile)
     ----------------------------------------- */
  .hm-header,
  .hm-header-top,
  .hm-header-bottom,
  .hm-header-nav,
  .hm-data-status-wrapper,
  .hm-indicators-handle{
    display:none !important;
    visibility:hidden !important;
    opacity:0 !important;
    pointer-events:none !important;
  }

  /* -----------------------------------------
     2.3) MOBILE BAR — PRO (5 boutons)
     - Plus de "grosse bulle" autour
     - Capsules séparées + icônes nettes
     ----------------------------------------- */
  #hmMobileBar,
  .hm-mobilebar{
    position: fixed !important;
    top: calc(env(safe-area-inset-top) + 10px) !important;
    left: 12px !important;
    right: 12px !important;
    bottom: auto !important;

    z-index: var(--hm-mobilebar-z) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;

    /* IMPORTANT: plus de background/border ici */
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;

    pointer-events: auto !important;
  }

  #hmMobileBar .hm-mbar-btn,
  .hm-mobilebar .hm-mbar-btn{
    flex: 1 1 0 !important;
    height: 46px !important;

    border-radius: 16px !important;
    border: 1px solid rgba(148,163,184,.22) !important;
    background: rgba(15,23,42,.72) !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    cursor: pointer !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;

    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    box-shadow: 0 14px 34px rgba(0,0,0,.42) !important;

    transition: transform .12s ease, background-color .12s ease, border-color .12s ease, box-shadow .12s ease !important;
  }

  #hmMobileBar .hm-mbar-btn:active{
    transform: translateY(1px) scale(.99) !important;
  }

  #hmMobileBar .hm-mbar-btn i{
    font-size: 20px !important;
    line-height: 1 !important;
    color: #e5e7eb !important;
    opacity: .92 !important;
  }

/* États actifs — même style que normal (pas plus foncé) */
body.hm-mobile-menu-open #hmMobileMenuBtn,
body.hm-mobile-bubbles-open #hmMobileBubblesBtn,
body.hm-mobile-dashboard-open #hmMobileDashBtn,
body.hm-mobile-history-open #hmMobileHistoryBtn,
body.hm-mobile-nav-open #hmMobileNavBtn{
  background: rgba(15,23,42,.72) !important;            /* même que normal */
  border-color: rgba(148,163,184,.22) !important;       /* même que normal */
  box-shadow: 0 14px 34px rgba(0,0,0,.42) !important;    /* même que normal */
}

  /* -----------------------------------------
     2.4) Main: réserve l’espace sous mobilebar
     ----------------------------------------- */
  .hm-main{
    left:0 !important;
    right:0 !important;
    top:0 !important;
    bottom: var(--hm-footer-h) !important;

    overflow:hidden !important;
    padding-top: calc(var(--hm-mobilebar-h) + env(safe-area-inset-top) + 20px) !important;
    background: #0b1220 !important;
  }

  .hm-main-inner{ padding:0 !important; }

  .hm-layout-row{
    margin:0 !important;
    --bs-gutter-x:0 !important;
    --bs-gutter-y:0 !important;
  }

  .hm-map-col,
  .hm-sidebar-col{
    padding-left:0 !important;
    padding-right:0 !important;
  }

  /* -----------------------------------------
     2.5) Map full-screen (coins carrés)
     ----------------------------------------- */
  .hm-map-col .card,
  .hm-map-col .card.custom-card{
    border:none !important;
    box-shadow:none !important;
    background:transparent !important;
    border-radius:0 !important;
    margin:0 !important;
  }

  .hm-map-wrapper{
    width:100% !important;
    border-radius:0 !important;
    border:none !important;
    box-shadow:none !important;
    background:transparent !important;

    height: calc(100dvh - (var(--hm-mobilebar-h) + env(safe-area-inset-top) + 20px) - var(--hm-footer-h)) !important;
    min-height: calc(100dvh - (var(--hm-mobilebar-h) + env(safe-area-inset-top) + 20px) - var(--hm-footer-h)) !important;

    position:relative !important;
    overflow:hidden !important;
  }

  .hm-map-wrapper iframe{
    position:absolute !important;
    inset:0 !important;
    width:100% !important;
    height:100% !important;
    border:0 !important;
    display:block !important;
    border-radius:0 !important;
    background:transparent !important;
    z-index:1 !important;
  }

  /* -----------------------------------------
     2.6) Overlay (backdrop) quand panels ouverts
     ----------------------------------------- */
  body::before{
    content:none !important;
    display:none !important;
    pointer-events:none !important;
  }

  body.hm-mobile-menu-open::before,
  body.hm-mobile-dashboard-open::before,
  body.hm-mobile-bubbles-open::before,
  body.hm-mobile-nav-open::before,
  body.hm-mobile-history-open::before{
    content:"" !important;
    position:fixed !important;
    inset:0 !important;
    background: rgba(0,0,0,.55) !important;
    z-index: var(--hm-overlay-z) !important;
    display:block !important;
    pointer-events:auto !important;
  }

  /* -----------------------------------------
     2.7) Drawers (default)
     ----------------------------------------- */
  .hm-sidebar-left{
    position:fixed !important;
    left:0 !important;

    top: calc(var(--hm-mobilebar-h) + env(safe-area-inset-top) + 20px) !important;
    height: calc(100dvh - (var(--hm-mobilebar-h) + env(safe-area-inset-top) + 20px)) !important;

    width:min(88vw, 340px) !important;
    transform: translateX(-105%);
    transition: transform .18s ease;

    z-index: var(--hm-drawer-z) !important;
    overflow:auto !important;

    background: var(--hm-mobile-surface) !important;
    border-right: 1px solid rgba(148,163,184,.18) !important;
  }
  body.hm-mobile-menu-open .hm-sidebar-left{ transform: translateX(0); }

  .hm-sidebar-col{
    position:fixed !important;
    right:0 !important;

    top: calc(var(--hm-mobilebar-h) + env(safe-area-inset-top) + 20px) !important;
    height: calc(100dvh - (var(--hm-mobilebar-h) + env(safe-area-inset-top) + 20px)) !important;

    width:min(92vw, 520px) !important;
    transform: translateX(105%);
    transition: transform .18s ease;

    z-index: var(--hm-drawer-z) !important;
    overflow:auto !important;

    padding: 12px !important;
    background: var(--hm-mobile-surface) !important;
    border-left: 1px solid rgba(148,163,184,.18) !important;
    display:block !important;
  }
  body.hm-mobile-dashboard-open .hm-sidebar-col{ transform: translateX(0); }

  /* -----------------------------------------
     2.8) Sidebar gauche — Menu mobile “pro”
     - retire hamburger dropdown
     - retire section AFFICHAGE (inclut Historique)
     - logo lisible / aligné gauche
     ----------------------------------------- */
  .hm-sidebar-left .hm-mainmenu{ display:none !important; } /* hamburger dropdown 3 barres */
  #hmSidebarAffichageSection{ display:none !important; }    /* nécessite l'id côté HTML */

  .hm-sidebar-left .hm-sidebar-header{
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 14px 14px 12px !important;
    background: linear-gradient(180deg, rgba(30,41,59,.92), rgba(30,41,59,.75)) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(148,163,184,.16);
  }

  .hm-sidebar-left .hm-sidebar-logo{
    width:100% !important;
    display:flex !important;
    justify-content:flex-start !important;
    align-items:center !important;
    gap:10px !important;
    padding: 6px 6px !important;
    text-align:left !important;
  }

  .hm-sidebar-left .hm-sidebar-logo img{
    width: 34px !important;
    height: 34px !important;
    margin:0 !important;
    filter: drop-shadow(0 8px 18px rgba(0,0,0,.35));
  }

  .hm-sidebar-left .hm-sidebar-logo span{
    display:inline-block !important;
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    letter-spacing: .2px;
    color: rgba(226,232,240,.96) !important;
    white-space: nowrap;
  }

  .hm-sidebar-left .hm-sidebar-section{
    padding-top: 10px !important;
  }
  .hm-sidebar-left .hm-sidebar-section-title{
    margin-top: 6px !important;
    opacity: .9;
  }

  /* -----------------------------------------
     2.9) Bulles / KPIs: style clean (panel)
     ----------------------------------------- */
  .hm-network-list--header,
  #hm-header-bubbles-wrap{
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .hm-network-list{ gap: 6px !important; }

  .hm-network-row{
    border-radius: 14px !important;
    box-shadow: 0 10px 24px rgba(15,23,42,0.22) !important;
  }

  /* Indicateurs (panel mobile): FORCE 1 bulle par ligne */
  body.hm-mobile-bubbles-open #hmMobileBubblesPanel #hm-header-bubbles-wrap{
    display:grid !important;
    grid-template-columns: 1fr !important;
    grid-auto-flow: row !important;
    gap:10px !important;
    width:100% !important;
  }
  body.hm-mobile-bubbles-open #hmMobileBubblesPanel #hm-header-bubbles-wrap .hm-network-row{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    grid-column: 1 / -1 !important;
  }
  body.hm-mobile-bubbles-open #hmMobileBubblesPanel #hm-header-bubbles-wrap .hm-network-row--stm-details{
    grid-column: 1 / -1 !important;
    width:100% !important;
  }
  body.hm-mobile-bubbles-open #hmMobileBubblesPanel #hm-header-bubbles-wrap *{
    box-sizing:border-box;
  }

  /* -----------------------------------------
     2.10) Dashboard (Tableau de bord) — FULL WIDTH + table lisible
     ----------------------------------------- */
  body.hm-mobile-dashboard-open .hm-sidebar-col{
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: calc(var(--hm-mobilebar-h, 72px) + env(safe-area-inset-top) + 20px) !important;
    bottom: var(--hm-footer-h, 44px) !important;
    z-index: 39990 !important;
    overflow: hidden !important;
    pointer-events: auto !important;

    transform: none !important; /* s’assure qu’on ne garde pas le slide */
    width: auto !important;
    padding: 0 !important;
    border-left: none !important;
    background: transparent !important;
  }

  body.hm-mobile-dashboard-open .hm-sidebar-col .custom-card{
    height: 100% !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    background: var(--hm-mobile-surface) !important;
  }

  body.hm-mobile-dashboard-open .hm-sidebar-col .card-header{
    position: sticky !important;
    top: 0 !important;
    z-index: 2 !important;
    background: rgba(30,41,59,.92) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(148,163,184,.14) !important;
  }

  body.hm-mobile-dashboard-open .hm-sidebar-col .card-body{
    height: calc(100% - 56px) !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 12px !important;
  }

  body.hm-mobile-dashboard-open .hm-sidebar-col .hm-city-selector{
    max-width: none !important;
    width: 100% !important;
  }

  body.hm-mobile-dashboard-open .hm-sidebar-col .table-responsive{
    overflow-x: hidden !important; /* stop scroll horizontal */
  }

  body.hm-mobile-dashboard-open .hm-sidebar-col table.hm-coverage-table{
    width: 100% !important;
    table-layout: fixed !important;
    font-size: .82rem !important;
  }

  /* autorise wrap global (contre text-nowrap bootstrap) */
  body.hm-mobile-dashboard-open .hm-sidebar-col table.hm-coverage-table,
  body.hm-mobile-dashboard-open .hm-sidebar-col table.hm-coverage-table *{
    white-space: normal !important;
  }

  /* colonnes chiffres compactes */
  body.hm-mobile-dashboard-open .hm-sidebar-col table.hm-coverage-table th:not(:first-child),
  body.hm-mobile-dashboard-open .hm-sidebar-col table.hm-coverage-table td:not(:first-child){
    white-space: nowrap !important;
    text-align: center !important;
    width: 11.5% !important;
  }

  /* colonne nom: wrap lisible */
  body.hm-mobile-dashboard-open .hm-sidebar-col table.hm-coverage-table th:first-child,
  body.hm-mobile-dashboard-open .hm-sidebar-col table.hm-coverage-table td:first-child{
    width: 54% !important;
    text-align: left !important;
    overflow: hidden !important;
    word-break: break-word !important;
    line-height: 1.15 !important;
  }

  body.hm-mobile-dashboard-open .hm-sidebar-col table.hm-coverage-table th,
  body.hm-mobile-dashboard-open .hm-sidebar-col table.hm-coverage-table td{
    padding: 8px 8px !important;
  }

  body.hm-mobile-dashboard-open .hm-sidebar-col table.hm-coverage-table thead th{
    position: sticky !important;
    top: 0 !important;
    z-index: 1 !important;
    background: rgba(30,41,59,.92) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  /* -----------------------------------------
     2.11) Historique — panel mobile (layout compact + pickers)
     ----------------------------------------- */
  #hmMobileHistoryBody .hm-hist24{
    padding: 10px 12px 12px !important;
  }

  #hmMobileHistoryBody .hm-hist24-top{
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:10px !important;
    margin-bottom: 8px !important;
  }

  #hmMobileHistoryBody .hm-hist24-title{
    min-width:0 !important;
    flex:1 1 auto !important;
  }

  #hmMobileHistoryBody .hm-hist24-title-sub,
  #hmMobileHistoryBody .hm-hist24-title-sep{
    display:none !important;
  }

  #hmMobileHistoryBody .hm-hist24-live{
    flex: 0 0 auto !important;
    padding: 6px 10px !important;
    font-size: .78rem !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
  }

  #hmMobileHistoryBody .hm-hist24-track{
    width: 100% !important;
    max-width: 100% !important;
    margin: 10px 0 0 !important;
  }
  #hmMobileHistoryBody .hm-hist24-rail{ width: 100% !important; }
  #hmMobileHistoryBody .hm-hist24-slider{
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    display: block !important;
    height: 26px !important;
  }

  #hmMobileHistoryBody .hm-hist24-date{
    margin: 0 0 10px !important;
    display:flex !important;
    justify-content:center !important;
  }

  #hmMobileHistoryBody .hm-hist24-pickers{
    display:flex !important;
    flex-wrap:wrap !important;
    align-items:center !important;
    justify-content:center !important;
    gap:8px !important;
    width:100% !important;
  }

  /* Selects centrés */
  #hmMobileHistoryBody select.hm-hist24-select,
  #hmMobileHistoryBody .hm-hist24-select.form-select,
  #hmMobileHistoryBody .hm-hist24-select{
    height: 34px !important;
    min-height: 34px !important;

    direction: ltr !important;
    text-align: center !important;
    text-align-last: center !important;
    -moz-text-align-last: center !important;

    padding-left: 14px !important;
    padding-right: 14px !important;

    border-radius: 999px !important;
    font-size: .82rem !important;

    -webkit-appearance: none !important;
    appearance: none !important;

    background-position: right 12px center !important;
    background-size: 16px 16px !important;
  }

  #hmMobileHistoryBody select.hm-hist24-select option,
  #hmMobileHistoryBody .hm-hist24-select option{
    direction: ltr !important;
    text-align: center !important;
  }

  /* Bulle "Instant analysé" */
  #hmMobileHistoryBody .hm-hist24-stamp{
    flex: 1 1 100% !important;
    margin-top: 2px !important;
    width: 100% !important;

    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap: 10px !important;
    text-align:center !important;

    max-width: 100% !important;
  }

  #hmMobileHistoryBody .hm-hist24-stamp-label{
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    font-size: .72rem !important;
    letter-spacing: .12em !important;
    text-transform: uppercase !important;
    color: rgba(229,231,235,.70) !important;
  }

  #hmMobileHistoryBody .hm-hist24-chip{
    flex: 0 0 auto !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;

    padding: 5px 10px !important;
    border-radius: 999px !important;
    font-size: .78rem !important;

    width: auto !important;
    max-width: 220px !important;

    margin: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  #hmMobileHistoryBody .hm-hist24 > *{ max-width: 100% !important; }

  /* TITRE HISTORIQUE (mobile): remplace visuel */
  #hmMobileHistoryBody .hm-hist24-title-main,
  #hmMobileHistoryBody .hm-hist24-title-sep,
  #hmMobileHistoryBody .hm-hist24-title-sub{
    display:none !important;
  }

  /* -----------------------------------------
     2.12) Historique — Fake selects (optionnel)
     ----------------------------------------- */
  body.hm-use-fake-hist-selects #hmMobileHistoryBody #hmHist24Bar select.hm-hist24-select,
  body.hm-use-fake-hist-selects #hmMobileHistoryBody #hmHist24Bar .hm-hist24-select.form-select{
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  #hmMobileHistoryBody .hm-fake-select{
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;

    height: 34px !important;
    padding: 0 14px !important;
    border-radius: 999px !important;

    border: 1px solid rgba(148,163,184,.22) !important;
    background: rgba(30,41,59,.55) !important;
    color: #e5e7eb !important;

    font-weight: 800 !important;
    font-size: .82rem !important;
    letter-spacing: .02em !important;

    cursor: pointer !important;
    user-select: none !important;
    white-space: nowrap !important;
  }

  #hmMobileHistoryBody .hm-fake-select i{
    opacity: .9 !important;
    font-size: 1.05rem !important;
  }

  #hmMobileHistoryBody .hm-fake-menu{
    position: absolute !important;
    z-index: 50000 !important;

    min-width: 160px !important;
    max-width: min(86vw, 320px) !important;

    margin-top: 8px !important;
    padding: 8px !important;

    border-radius: 14px !important;
    border: 1px solid rgba(148,163,184,.18) !important;
    background: rgba(15,23,42,.92) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;

    box-shadow: 0 18px 40px rgba(0,0,0,.55) !important;
  }

  #hmMobileHistoryBody .hm-fake-item{
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;

    padding: 10px 12px !important;
    border-radius: 12px !important;

    color: #e5e7eb !important;
    font-weight: 800 !important;
    cursor: pointer !important;
  }

  #hmMobileHistoryBody .hm-fake-item:hover{
    background: rgba(148,163,184,.14) !important;
  }

  /* -----------------------------------------
     2.13) FIX: Année/Mois/Jour dans panel Historique mobile
     (hmTopbarHistory + hm-hist-select)
     ----------------------------------------- */
  #hmMobileHistoryBody #hmTopbarHistory{
    display:block !important;
    visibility:visible !important;
    opacity:1 !important;
    pointer-events:auto !important;
  }

  #hmMobileHistoryBody #hmTopbarHistory .hm-hist-date{
    display:flex !important;
    gap:10px !important;
    justify-content:center !important;
    align-items:center !important;
    margin-bottom: 10px !important;
    flex-wrap: wrap !important;
  }

  #hmMobileHistoryBody #hmTopbarHistory select.hm-hist-select{
    display:inline-flex !important;
    visibility:visible !important;
    opacity:1 !important;
    pointer-events:auto !important;

    height: 34px !important;
    min-height: 34px !important;
    border-radius: 999px !important;

    border: 1px solid rgba(148,163,184,.22) !important;
    background: rgba(30,41,59,.55) !important;
    color: #e5e7eb !important;

    font-weight: 800 !important;
    font-size: .82rem !important;
    letter-spacing: .02em !important;

    direction: ltr !important;
    text-align: center !important;
    text-align-last: center !important;
    -moz-text-align-last: center !important;

    padding-left: 14px !important;
    padding-right: 14px !important;

    -webkit-appearance: none !important;
    appearance: none !important;
    background-image: none !important; /* kill SVG arrow */
  }

  #hmMobileHistoryBody #hmTopbarHistory select.hm-hist-select option{
    text-align: center !important;
    direction: ltr !important;
  }

  #hmMobileHistoryBody #hmTopbarHistory select.hm-hist-select:focus{
    outline: none !important;
    border-color: rgba(147,197,253,.55) !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,.20) !important;
  }

  /* -----------------------------------------
     2.14) Footer mobile
     ----------------------------------------- */
  .hm-footer{ left:0 !important; right:0 !important; }
  .hm-footer-desktop{ display:none !important; }
  .hm-footer-mobile{ display:block !important; }
}


/* =========================================================
   3) Mobile strict (<= 768px): cacher contrôles carte inutiles
   ========================================================= */
@media (max-width: 768px){
  #hm-sidebar-toggle{ display:none !important; }
  .th-legend{ display:none !important; }
  .leaflet-control-zoom,
  .leaflet-control-layers,
  .leaflet-control-share{ display:none !important; }
}


/* =========================================================
   4) Historique (<= 380px): micro-écrans (sans media imbriqué)
   ========================================================= */
@media (max-width: 380px){
  #hmMobileHistoryBody .hm-hist24-stamp{
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  #hmMobileHistoryBody .hm-hist24-chip{
    max-width: 100% !important;
    white-space: normal !important;
    text-overflow: clip !important;
    line-height: 1.15 !important;
  }
}

/* =========================================================
   5) iOS Safari — FIX iPhone (enlève les petits carrés blancs à droite)
   ========================================================= */
@supports (-webkit-touch-callout: none){

  #hmMobileHistoryBody select.hm-hist-select,
  #hmMobileHistoryBody select.hm-hist24-select,
  #hmMobileHistoryBody #hmTopbarHistory select,
  #hmMobileHistoryBody #hmHist24Bar select{
    -webkit-appearance: none !important;
    appearance: none !important;

    background-image: none !important;
    background: rgba(30,41,59,.55) !important;

    box-shadow: none !important;
    outline: none !important;

    padding-right: 14px !important; /* pas de place pour un glyph iOS */
  }

  /* si jamais tu avais un wrapper avec flèche custom */
  #hmMobileHistoryBody .hm-select-wrap::after,
  #hmMobileHistoryBody #hmTopbarHistory .hm-select-wrap::after,
  #hmMobileHistoryBody #hmHist24Bar .hm-select-wrap::after{
    content: none !important;
    display: none !important;
  }
}

/* =========================================================
   HISTORIQUE (mobile panel) — clean title + stamp auto
   - retire "Analyse à un instant donné" (pseudo-title)
   - "Instant analysé" caché par défaut, visible seulement après slider move
   ========================================================= */

/* 1) Kill le pseudo-titre "Analyse à un instant donné" */
#hmMobileHistoryBody .hm-hist24-title::before{
  content:none !important;
  display:none !important;
}

/* 2) Stamp ("Instant analysé") caché par défaut sur mobile */
#hmMobileHistoryBody #hmHist24Stamp{
  display:none !important;
}

/* 3) Stamp visible seulement quand JS ajoute .hm-hist-stamp-on sur <body> */
body.hm-hist-stamp-on #hmMobileHistoryBody #hmHist24Stamp{
  display:flex !important;
}

.hm-sidebar-logo{
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100%;
  gap: 8px;
  text-align: center;
}
