/* Dernière couche responsive : ne doit jamais modifier le bureau. */
.mobile-nav-close,#mobile-search-toggle{display:none}
/* La fermeture et la confidentialité restent accessibles, même dans un
   formulaire long ou lorsque le clavier du téléphone est ouvert. */
#mov>.modal{position:relative}
#mov .mobile-dialog-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px;flex:none;margin-bottom:8px}
#mov .mobile-dialog-close{min-height:44px;padding:0 12px;border:1px solid var(--bord);border-radius:12px;background:var(--bg);color:var(--ink);font:600 13px Inter,Arial,sans-serif;cursor:pointer}
#mov .mobile-dialog-actions .dsa-privacy-toggle{width:44px;height:44px;flex-basis:44px}
@media(max-width:1180px){
  /* Le rail vitré v12.10 remettait position:relative!important : le menu
     hors écran conservait alors 300 px dans le flex et écrasait .mn. */
  #app>.sb{position:fixed!important;inset:0 auto 0 0!important;z-index:920!important;width:min(340px,88vw)!important;max-width:88vw!important;height:100%!important;max-height:100%!important;transform:translate3d(-105%,0,0);visibility:hidden;pointer-events:none;overflow-y:auto!important;overscroll-behavior:contain}
  body.mobile-nav-open #app>.sb{transform:translate3d(0,0,0);visibility:visible;pointer-events:auto}
  #app,#app.v1125-transform-zoom{width:100%!important;max-width:100%!important;transform:none!important;will-change:auto!important}
  #app>.mn{flex:1 1 100%;width:100%;min-width:0!important;max-width:100%;margin:0!important}
  #app>.mn{min-height:0}
  #app .crm-topbar-frame{flex:0 0 auto;position:sticky;top:0}
  #app #crm-topbar .mobile-nav-toggle{display:inline-flex!important;align-items:center;justify-content:center;visibility:visible;pointer-events:auto}
  #app .content{min-width:0!important;max-width:100%;overflow-x:hidden!important;scrollbar-gutter:auto}
  #app>.sb .nav{flex:1 0 auto!important;overflow:visible!important;min-height:0}
  #app>.sb .sb-top{padding-top:6px!important}
  #app>.sb .sb-top>.sb-logo{height:52px!important;padding:4px 10px!important}
  #app>.sb .sb-top>.sb-logo img{height:40px!important;max-height:40px!important}
  #app>.sb .sb-bot{flex:none;padding-bottom:max(12px,env(safe-area-inset-bottom))!important}
  #app .mobile-nav-close{display:block;align-self:flex-end;flex:none;margin:8px 12px 0;padding:8px 12px;min-height:44px;border:1px solid var(--bord);border-radius:12px;background:var(--bg);color:var(--ink);font:600 14px Inter,Arial,sans-serif;cursor:pointer}
  #app .sb .ni,#app #manager-team-nav summary{min-height:44px!important;font-size:14px!important}
  #app .mobile-nav-scrim{z-index:910}
  #app #v-calendar .v9-gcal-event:not(.personal-relance){touch-action:pan-x pan-y pinch-zoom!important;cursor:pointer!important}
  #app :is(.topbar,.content,.view){box-sizing:border-box}
}
@media(max-width:680px){
  /* En-tête compact : menu, titre, recherche, confidentialité et synchronisation. */
  body #app .mn>.topbar,body:has(#v-calendar.view.on) #app .mn>.topbar,body:has(#v-agvente.view.on) #app .mn>.topbar{display:grid!important;grid-template-columns:44px minmax(0,1fr) 40px 40px 28px!important;grid-template-rows:none!important;align-items:center!important;gap:6px!important;margin:0!important;padding:8px 10px!important;padding-top:max(8px,env(safe-area-inset-top))!important;height:auto!important;min-height:60px!important;border-radius:0!important;overflow:visible!important}
  #app .topbar .mobile-nav-toggle{grid-area:1/1!important;width:44px;height:44px;margin:0}
  #app .topbar .tb-title{grid-area:1/2!important;max-width:none!important;min-width:0;font-size:16px!important;white-space:normal!important;line-height:1.2;overflow-wrap:anywhere}
  #app .topbar>.sp{display:none!important}
  #app #mobile-search-toggle{display:grid;place-items:center;grid-area:1/3!important;width:40px;height:44px;padding:0;border:1px solid var(--bord);border-radius:12px;background:var(--bg);color:var(--ink);font:26px Arial,sans-serif;cursor:pointer}
  #app .topbar #dsa-privacy-toggle{grid-area:1/4!important;width:40px!important;height:44px!important;min-height:44px!important;margin:0!important;padding:0!important}
  #app .topbar #sync-status{grid-area:1/5!important;width:28px!important;max-width:28px!important;min-width:0!important;height:30px!important;padding:0!important;margin:0!important}
  #app .topbar .v1184-agency-context{grid-area:2/1/3/-1!important;justify-self:start;margin:0!important;max-width:100%;font-size:11px;white-space:normal}
  #app .topbar .v110-search{display:none!important;grid-area:3/1/4/-1!important;width:100%!important;min-width:0!important;max-width:none!important;margin:0!important}
  #app .topbar.mobile-search-open .v110-search{display:block!important}
  #app .topbar .v110-search-box{height:44px!important}
  #app .topbar .v110-search-results{position:absolute!important;top:100%!important;left:0!important;right:0!important;width:100%!important;max-height:45dvh!important;z-index:100}
  #app .topbar #topbar-extra{display:flex!important;grid-area:4/1/5/-1!important;min-width:0!important;width:100%!important;max-width:100%!important;padding:0!important;overflow:visible!important}
  #app .topbar #topbar-extra:empty{display:none!important}
  #app .topbar #btn-new-mandat{grid-area:5/1/6/-1!important;min-height:44px!important;width:100%;white-space:normal}
  #app .dsa-period-toolbar{gap:6px}
  #app .dsa-period-choice{width:100%;flex:1 1 100%;min-width:0;padding:3px 5px 3px 12px}
  #app .dsa-period-choice select{width:0;min-width:0;flex:1 1 0%;height:40px;font-size:16px!important}
  #app .dsa-period-month{width:100%;height:44px;justify-content:space-between}
  #app .dsa-period-month button{width:44px;min-height:42px;flex:none}
  #app .dsa-period-month .dsa-period-month-label{flex:1;min-width:0;font-size:14px}
  #app .dsa-period-range{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  #app .dsa-period-range label{display:grid;min-width:0;gap:3px}
  #app .dsa-period-range input{width:100%;height:44px;min-width:0;font-size:16px!important}
  #app .dsa-period-apply,#app #dsa-period-error{grid-column:1/-1;min-height:44px}

  body #app .content,body:has(#v-agvente.view.on) #app .content{padding:12px 10px max(18px,env(safe-area-inset-bottom))!important}
  #app .view.on{width:100%!important;min-width:0!important;max-width:100%!important}
  #app #v-mandat-detail :is(input,select,textarea),#app :is(input:not([type=checkbox]):not([type=radio]),select,textarea),.mov :is(input:not([type=checkbox]):not([type=radio]),select,textarea),.panel :is(input,select,textarea){font-size:16px!important;max-width:100%;min-width:0}
  #app :is(.btn,.v1165-action,.v1165-manage,.v1165-edit),.mov .btn{min-height:44px!important;white-space:normal}
  #app .frow{flex-wrap:wrap;overflow:visible;margin-inline:0;padding-inline:0;gap:6px}
  #app .frow .fsearch{flex:1 1 100%;width:100%}
  #app .frow :is(.chip,select){max-width:100%;font-size:13px}

  /* Cartes de données : libellés issus des en-têtes, mêmes nœuds et actions. */
  #app .dsa-mobile-table-wrap,#mo-b .dsa-mobile-table-wrap{width:100%!important;min-width:0!important;max-width:100%!important;max-height:none!important;overflow:visible!important}
  #app table.dsa-mobile-table,#mo-b table.dsa-mobile-table{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;table-layout:auto;white-space:normal}
  .dsa-mobile-table>thead{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)}
  .dsa-mobile-table>tbody{display:block!important}
  #app .dsa-mobile-table>tbody>tr,#mo-b .dsa-mobile-table>tbody>tr:not([hidden]):not([style*="display: none"]):not([style*="display:none"]){display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 12px;padding:14px 12px;border-bottom:1px solid var(--bord);width:100%;min-width:0}
  #app .dsa-mobile-table>tbody>tr>td,#mo-b .dsa-mobile-table>tbody>tr>td:not([hidden]):not([style*="display: none"]):not([style*="display:none"]){display:block!important;min-width:0!important;width:auto!important;max-width:none!important;padding:0!important;border:0!important;text-align:left!important;white-space:normal!important;overflow-wrap:anywhere;font-size:13px!important}
  .dsa-mobile-table>tbody>tr>td:before{content:attr(data-mobile-label);display:block;font:600 10px/1.4 Inter,Arial,sans-serif;color:var(--ink3);margin-bottom:3px}
  .dsa-mobile-table>tbody>tr>td[data-mobile-label=""]:before{display:none}
  .dsa-mobile-table>tbody>tr>td:first-child,.dsa-mobile-table .dsa-mobile-wide{grid-column:1/-1}
  .dsa-mobile-table td :is(strong,a,span,div){white-space:normal;max-width:100%;overflow-wrap:anywhere}
  #app .dsa-mobile-table td button{min-height:44px}
  #app .manager-sales-table{min-width:0!important}

  /* Tableau de bord : aucune largeur de 800 px héritée du tableau d'équipe. */
  #manager-overview{gap:12px}
  #manager-overview .overview-columns{grid-template-columns:minmax(0,1fr)}
  #manager-overview :is(.overview-mandates,.overview-sales){grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #manager-overview .overview-kpi{padding:11px 10px;min-height:94px}
  #manager-overview .overview-kpi span{font-size:12px}
  #manager-overview .overview-kpi strong{font-size:22px}
  #manager-overview .overview-kpi small{font-size:11px}
  #manager-overview .overview-actions .overview-kpi{min-height:66px}
  #manager-overview .v1177-team{overflow:visible!important}
  #manager-overview .v1177-agent-row{min-width:0!important;width:100%!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;padding:12px 4px!important}
  #manager-overview .v1177-agent-row>span:first-child{grid-column:1/-1}
  #manager-overview .v1177-agent-row>span:nth-child(5){display:block!important}
  #manager-overview .v1177-agent-head{display:none}
  #manager-overview .v1177-agent-row :is(strong,small){font-size:12px!important}
  #manager-overview .overview-vehicle{grid-template-columns:minmax(0,1fr) 92px 10px;gap:6px}
  #manager-overview .overview-agencies dl{grid-template-columns:repeat(3,minmax(0,1fr))}
  #manager-overview .overview-agencies{grid-template-columns:1fr}
  #manager-overview .v1177-mini>strong{white-space:normal;overflow-wrap:anywhere;font-size:16px}

  /* Fiche et vente : les onglets et toutes les commandes restent accessibles. */
  #v-mandat-detail>.mandat-tabs{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;flex-wrap:wrap!important;overflow:visible!important;margin:0!important;padding:8px 0!important}
  #v-mandat-detail>.mandat-tabs .mandat-tab{min-width:0!important;min-height:44px!important;padding:8px!important;justify-content:center;white-space:normal;font-size:13px!important}
  #v-mandat-detail .v1165-quick-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
  #v-mandat-detail .v1165-headerbar{padding:12px!important}
  #v-mandat-detail .v1165-primary-grid{grid-template-columns:minmax(0,1fr)!important}
  #v-mandat-detail .v1165-primary-section{min-width:0;padding:12px!important}
  #v-mandat-detail .v1165-fact :is(strong,a){white-space:normal;overflow-wrap:anywhere;font-size:13px}
  #mandat-section-vente .v1146-finance-workspace{min-width:0!important;max-width:100%!important}
  #mandat-section-vente .dsa-sale-sheet .v1146-finance-workspace>section{padding:12px!important;min-width:0}
  #mandat-section-vente .dsa-sale-sheet .v1146-field{grid-template-columns:minmax(0,1fr) 108px!important}
  #mandat-section-vente .dsa-sale-sheet .v1146-field input{height:44px!important;min-height:44px!important}
  #mandat-section-vente .v1184-attribution{grid-template-columns:minmax(0,1fr)!important}
  #mandat-section-vente :is(.v1175-warranty-picker,.v1176-autosave){min-width:0!important;max-width:100%!important}
  #mandat-section-vente .v1176-autosave button{width:100%;min-height:44px!important}
  #app .certificate-actions .btn{min-height:44px!important;font-size:12px!important}
  .cartell-filters label{min-width:0!important;flex:1 1 100%}
  .cartell-filters .inp{min-width:0!important;width:100%}
  .cartell-sub{max-width:100%;white-space:normal;overflow-wrap:anywhere}

  /* Une seule zone de défilement par dialogue ; le clavier ne masque pas
     définitivement les confirmations, qui restent en fin de formulaire. */
  .mov .modal{display:flex!important;flex-direction:column;min-width:0;max-width:100%!important;max-height:var(--dsa-mobile-height,100dvh)!important;height:var(--dsa-mobile-height,100dvh)!important;padding:12px 10px max(12px,env(safe-area-inset-bottom))!important;overflow:hidden!important}
  .mov .modal :is(.mt,.ms2){flex:none;overflow-wrap:anywhere}
  .mov .modal #mo-b{flex:1 1 auto;min-height:0;max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important;padding:12px 5px!important}
  #mo-b :is(.v1184-delivery-checks,.v1165-status-actions,.cartell-money-grid){grid-template-columns:minmax(0,1fr)!important}
  #v1127-rdv-card.v1169-centered{max-height:calc(var(--dsa-mobile-height,100dvh) - 16px)!important}
  #v1127-rdv-card :is(input,select,textarea){font-size:16px!important;min-height:44px!important}
  #mo-b .btn{max-width:100%;white-space:normal;min-height:44px!important}

  /* Planning : journée lisible par défaut. La semaine reste disponible et
     défile dans sa grille, sans élargir la page ou décaler les en-têtes. */
  body #app .content.v1187-calendar-content{padding:6px!important}
  #v-calendar .v1169-planning-bar{grid-template-columns:minmax(0,1fr) auto!important;grid-template-areas:"site site" "nav new" "view view"!important;margin:5px!important;padding:5px!important;max-width:calc(100% - 10px);gap:7px!important;position:relative;z-index:10;overflow:visible}
  #v-calendar .v1169-planning-bar .v9-calendar-nav{display:grid!important;grid-template-columns:40px minmax(80px,1fr) 40px!important;gap:4px!important;overflow:visible!important}
  #v-calendar .v1169-planning-bar .v9-calendar-site-select{display:grid!important;grid-template-rows:auto minmax(44px,auto)!important;height:auto!important;gap:4px!important;position:relative;min-height:44px;pointer-events:auto}
  #v-calendar .v1169-planning-bar .v9-calendar-site-select>span{display:block!important;font-size:11px;color:var(--ink2)}
  #app #v-calendar .v1169-planning-bar .v9-calendar-site-select select{display:block!important;pointer-events:auto;touch-action:manipulation;max-width:100%;min-height:44px!important;height:44px!important}
  #v-calendar .v1169-planning-bar .v9-calendar-nav strong{grid-column:1/-1;margin:0!important;white-space:normal!important;font-size:12px!important;text-align:center}
  #v-calendar .v1169-planning-bar .v9-calendar-nav .btn{height:42px!important;min-height:42px!important;padding:0 5px!important;font-size:12px!important}
  #v-calendar .v1169-planning-bar .v1169-new-rdv{align-self:start;height:42px!important;min-height:42px!important;padding:0 10px!important;font-size:0!important}
  #v-calendar .v1169-new-rdv:after{content:"+ RDV";font-size:13px}
  #v-calendar .v1169-planning-bar .v9-calendar-view-controls{grid-template-columns:minmax(0,1fr) 132px!important;min-width:0}
  #v-calendar .v1169-planning-bar :is(.v9-calendar-site-select select,.v9-calendar-site-fixed,.v9-week-kind){width:100%!important;min-width:0;height:42px!important;min-height:42px!important;font-size:16px!important}
  #v-calendar .v1169-planning-bar .v9-calendar-modes{height:42px!important;min-height:42px!important}
  #v-calendar .v1169-planning-bar .v9-calendar-modes button{height:36px!important;min-height:36px!important;padding:0 7px!important;font-size:12px!important}
  #v-calendar .v9-calendar-legend{max-height:34px!important;min-height:30px!important}
  #v-calendar .v9-calendar-legend span{font-size:11px!important;min-height:28px!important}
  #v-calendar .v9-gcal-scroll{scrollbar-gutter:auto!important;grid-template-columns:44px minmax(0,1fr)!important}
  #v-calendar .v9-gcal-hours{width:44px!important}
  #v-calendar.view[data-mobile-calendar="day"] :is(.v9-gcal-head,.v9-gcal-reminders){grid-template-columns:44px minmax(0,1fr)!important;width:100%!important;min-width:0!important}
  #v-calendar.view[data-mobile-calendar="day"] .v9-gcal-days{grid-template-columns:minmax(0,1fr)!important;min-width:0!important;width:100%!important}
  #v-calendar.view[data-mobile-calendar="week"] :is(.v9-gcal-head,.v9-gcal-reminders){grid-template-columns:44px repeat(var(--day-count),156px)!important;min-width:calc(44px + var(--day-count) * 156px)!important;width:calc(44px + var(--day-count) * 156px)!important}
  #v-calendar.view[data-mobile-calendar="week"] .v9-gcal-days{grid-template-columns:repeat(var(--day-count),156px)!important;min-width:calc(var(--day-count) * 156px)!important}
  #v-calendar.view[data-mobile-calendar="day"] .v9-week-kind{display:none!important}
  #v-calendar.view[data-mobile-calendar="day"] .v1169-planning-bar .v9-calendar-view-controls{grid-template-columns:minmax(0,1fr)!important}
  #v-calendar .v9-gcal-event{font-size:13px!important;line-height:1.35!important}
  /* Une petite hauteur d'écran ne doit jamais couper le choix d'agence.
     Les commandes défilent dans la page, la grille conserve son propre axe. */
  body #app .content.v1187-calendar-content{overflow-y:auto!important;overscroll-behavior-y:auto!important}
  #app .content.v1187-calendar-content #v-calendar.view.on{height:auto!important;overflow:visible!important}
  #v-calendar .v9-calendar-shell.v1169-calendar{height:auto!important;max-height:none!important;overflow:visible!important}
  #v-calendar .v9-gcal-scroll{flex:0 0 auto!important;height:clamp(260px,60dvh,620px)!important}
}

/* Catalogue borné : les filtres portent sur tous les dossiers, le téléphone
   ne construit que la page affichée. */
.dsa-catalog-pagination{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:14px 16px;border-top:1px solid var(--bord);font-size:12px;color:var(--ink2)}
.dsa-catalog-pagination>div{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.dsa-catalog-pagination button{min-height:44px}
#v109-agency-mandates{scroll-margin-top:16px}
@media(max-width:680px){.dsa-catalog-pagination{align-items:stretch}.dsa-catalog-pagination>div{width:100%;display:grid;grid-template-columns:1fr auto 1fr;gap:8px}.dsa-catalog-pagination button{padding:8px 9px;font-size:12px}.dsa-catalog-pagination>div>span{align-self:center;white-space:nowrap}
/* Conserver le verre sur les panneaux, sans multiplier les couches floutées
   sur chaque cellule ni derrière le volet de navigation. */
#app #v109-agency-body tr,#app #v109-agency-body td,#app #v-mesmandats .v1186-row{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
}
