/* Mobile/touch layer. Desktop rules and reporting calculations are unchanged. */
.sm-mobile-table-scroll{max-width:100%;min-width:0}
.sm-mobile-scroll-hint{display:none}
.sm-mobile-menu-close{display:none}
.mp-chart-date-nav{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:12px 0;font-size:13px}.mp-chart-date-nav select{border:1px solid #cbd8e5;background:white;color:#26364c;padding:7px;border-radius:7px}
@media(max-width:768px), (max-width:1024px) and (max-height:500px){
  html{scroll-padding-top:70px;-webkit-text-size-adjust:100%;text-size-adjust:100%}
  body{margin:0}
  #tenantLayout{min-width:0;width:100%}
  #tenantLayout .main-content{min-width:0;max-width:100%;margin-left:0!important;padding:calc(72px + env(safe-area-inset-top)) 0 16px}
  #app,#content,#content>*,#content section,#content article{min-width:0;box-sizing:border-box}
  #content>*,#content main{max-width:100%}
  #content .card{min-width:0;max-width:100%;box-sizing:border-box}
  #content .rpt-two-col{grid-template-columns:minmax(0,1fr)!important;min-width:0}
  #content .rpt-trend-scroll{overflow-x:auto;max-width:100%;padding-bottom:6px}#content .rpt-trend-bars{min-width:760px}
  #content .lsv2-grid{grid-template-columns:minmax(0,1fr)!important}#content .lsv2-kpi-strip{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .modal-box{box-sizing:border-box;max-width:calc(100vw - 16px)!important;max-height:calc(100dvh - 24px)!important;overflow:auto}
  #tenantLayout .mobile-topbar{display:flex;position:fixed;top:0;left:0;right:0;align-items:center;gap:12px;background:var(--tenant-sidebar-bg,#1f2937);min-height:56px;padding-top:env(safe-area-inset-top);padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right));z-index:190}
  #tenantLayout .sm-sidebar{display:flex;position:fixed;top:0;left:0;width:260px;transform:translateX(-100%);max-width:calc(100vw - 48px);height:100vh;height:100dvh;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);box-sizing:border-box;z-index:220}
  #tenantLayout .sm-sidebar.open{transform:translateX(0)}.tablet-sidebar-toggle{display:none!important}
  #tenantLayout .sm-sidebar-nav{overflow-y:auto;overscroll-behavior:contain;min-height:0}
  #tenantLayout .sm-sidebar-nav-item{min-height:44px;white-space:normal}
  .sm-mobile-menu-close{display:block;align-self:flex-end;min-height:44px;min-width:44px;border:0;background:transparent;color:white;font-size:25px;cursor:pointer;margin:4px 8px}
  .mobile-overlay.active{z-index:210!important;touch-action:none}
  body.sm-mobile-nav-open{overflow:hidden}
  #content :is(button,select,[role=button],summary),dialog :is(button,select,summary),.modal :is(button,select),.smdr-pop button{min-height:44px!important;touch-action:manipulation}
  #content button,dialog button,.modal button,.cust-dialog button,.modal-box button{line-height:1.35;white-space:normal;min-width:44px}
  #content .smdr-day{min-width:0}
  #content :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea),dialog :is(input:not([type=checkbox]):not([type=radio]),select,textarea),.modal :is(input,select,textarea){font-size:16px!important;max-width:100%;box-sizing:border-box;min-height:44px!important}
  #content :is(input[type=checkbox],input[type=radio]),dialog :is(input[type=checkbox],input[type=radio]){width:20px;min-width:20px;height:20px;accent-color:#087f78}
  #content :is(.header,.cust-header,.reception-header,.report-v2-header,.event-checkin-header,.leads-header,.team-header,.pipeline-header){flex-wrap:wrap;gap:12px}
  #content :is(.cust-header-actions,.reception-header-actions,.crm-filter-actions,.mp-filter-actions,.report-v2-filter-actions){flex-wrap:wrap;min-width:0;max-width:100%}
  #content .leads-advanced-toggle-row{flex-wrap:wrap;width:100%;gap:8px}#content .leads-advanced-toggle-row>*{width:100%;min-width:0;max-width:100%}
  #content :is(.mp-pager,.crm-paginator,.pagination,.table-pagination,.ab-panel-pager,.reception-pagination,.leads-pagination-controls){flex-wrap:wrap;gap:10px;max-width:100%}
  #content :is(.mp-pager-controls,.crm-page-buttons){flex-wrap:wrap}
  #content :is(.mp-pager-controls,.crm-page-buttons,.pagination) button{min-width:44px}
  #content :is(.mp-tabs,.cust-tabs,.report-mode-tabs,.lsv2-tabs,.crm-chart-tabs){display:flex;flex-wrap:nowrap;overflow-x:auto;max-width:100%;gap:8px;overscroll-behavior-x:contain;scrollbar-width:thin}
  #content :is(.mp-tabs,.cust-tabs,.report-mode-tabs,.lsv2-tabs,.crm-chart-tabs)>*{flex:0 0 auto;white-space:nowrap;min-height:44px}
  #content :is(.mp-page,.cust-page,.reception-page,.report-v2-page){padding:12px 10px 28px}
  #content :is(.mp-page .mp-filter-grid,.cust-page .crm-filter-grid,.cust-page .crm-performance-filters .crm-filter-grid){grid-template-columns:minmax(0,1fr)!important}
  #content :is(.mp-field,.smdr-field,.smdr-shell){min-width:0!important;max-width:100%}
  #content :is(.cust-page .crm-filter-grid,.crm-performance-filters .crm-filter-grid)>*{grid-column:auto!important}
  #content :is(.mp-field select,.mp-date .smdr-trigger,.cust-page .crm-filter-grid input,.cust-page .crm-filter-grid select){height:44px!important}
  #content .smdr-trigger{min-width:0!important;width:100%;height:auto!important;min-height:44px!important;font-size:14px!important}
  #content :is(.mp-kpis-eight,.crm-metrics){grid-template-columns:repeat(2,minmax(0,1fr))}
  .mp-kpi strong{font-size:20px;overflow-wrap:anywhere}.mp-kpi span,.mp-kpi small{font-size:12px}
  .mp-head h1{font-size:22px}.mp-head p,.mp-panel-head p,.mp-caption{font-size:12px}
  .mp-explorer-toolbar{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}.mp-explorer-select{min-width:0;max-width:none;width:100%}.mp-platform-switch{justify-content:stretch}.mp-platform-switch button{flex:1;justify-content:center}
  .mp-page .mp-multi-menu{position:fixed!important;left:12px!important;right:12px!important;top:auto!important;bottom:max(12px,env(safe-area-inset-bottom))!important;width:auto!important;max-width:none!important;max-height:65vh!important;max-height:65dvh!important;overflow-y:auto;overscroll-behavior:contain;z-index:250;box-shadow:0 8px 40px #0f172a40}
  .mp-page .mp-choice{min-height:48px;padding:10px 8px!important;font-size:14px;gap:12px}.mp-page .mp-choice input{height:20px!important;width:20px!important;min-height:20px!important}
  .mp-menu-footer{bottom:0;min-height:54px;padding-bottom:env(safe-area-inset-bottom)}
  .mp-platform-cards{gap:8px}.mp-platform-card{padding:12px;min-width:0}.mp-platform-card strong{font-size:17px;overflow-wrap:anywhere}.mp-purpose-row>div:first-child{flex-wrap:wrap}
  .mp-chart-scroll{overflow-x:auto;max-width:100%;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
  .sm-mobile-scroll-hint{display:block;font-size:12px;color:#64748b;line-height:1.5}
  .mp-chart-scroll .mp-integrated-chart{width:1100px;max-width:none;min-height:348px;height:auto}
  .crm-trend-plot{overflow-x:auto;max-width:100%;overscroll-behavior-x:contain}.crm-trend-plot .crm-full-chart{min-width:850px;height:307px!important;max-height:none!important}
  .crm-floating-tooltip{position:fixed!important;top:auto!important;bottom:max(12px,env(safe-area-inset-bottom))!important;left:12px!important;right:12px!important;width:auto!important;max-width:none!important;max-height:65dvh;overflow:auto;z-index:260;background:white}
  .mp-chart-date-nav{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:12px 0}.mp-chart-date-nav select{flex:1;min-width:120px}.mp-chart-date-nav button{min-width:44px}
  .mp-integrated-legend{max-height:none;font-size:13px}.mp-readout-heading{gap:8px}
  .sm-mobile-table-scroll{overflow-x:auto!important;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;scrollbar-width:thin}
  .sm-mobile-table-scroll>table{min-width:var(--sm-mobile-table-min,520px);width:100%}
  .sm-mobile-table-scroll::before{content:'Swipe horizontally to see all columns';display:block;padding:8px 10px;color:#64748b;font-size:12px;white-space:nowrap}
  #content table th,dialog table th{font-size:12px!important}#content table td,dialog table td{font-size:13px!important}
  .sm-mobile-table-scroll:focus-visible,.mp-chart-scroll:focus-visible{outline:2px solid #087f78;outline-offset:2px}
  dialog[open]{box-sizing:border-box;max-width:calc(100vw - 16px)!important;max-height:calc(100vh - 24px)!important;max-height:calc(100dvh - 24px)!important;width:calc(100vw - 16px)!important;padding:14px!important;overflow:auto;overscroll-behavior:contain}
  dialog :is(header,footer){flex-wrap:wrap;gap:10px}dialog header h2{font-size:20px}
  .cust-dialog{box-sizing:border-box;max-width:calc(100vw - 16px)!important;max-height:calc(100dvh - 24px)!important}.cust-dialog :is(button,select){min-height:44px!important}.cust-dialog :is(input:not([type=checkbox]):not([type=radio]),select,textarea){font-size:16px!important;min-height:44px!important}.cust-dialog>header{flex-wrap:wrap;gap:8px}.cust-modal{padding:8px!important;align-items:center!important}
  .modal{padding:8px!important;box-sizing:border-box;align-items:center}
  .modal-content{box-sizing:border-box;min-width:0!important;max-width:calc(100vw - 16px)!important;width:100%!important;max-height:calc(100vh - 24px)!important;max-height:calc(100dvh - 24px)!important;overflow:auto;padding:16px!important}
  :is(.cust-form-grid,.cust-profile-grid,.reception-form-grid){grid-template-columns:minmax(0,1fr)!important}
  :is(.cust-form-grid,.reception-form-grid)>*{grid-column:auto!important}
  .smdr-pop.open{left:8px!important;width:calc(100% - 16px)!important;max-width:calc(100vw - 16px)!important;z-index:10100}
  .smdr-pop .smdr-layout{grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto minmax(0,1fr)}
  .smdr-pop .smdr-layout.smdr-single{grid-template-rows:minmax(0,1fr)}
  .smdr-pop .smdr-presets{display:flex;overflow-x:auto;gap:6px;border-right:0;border-bottom:1px solid #e2e8f0;padding:6px;flex-wrap:nowrap}
  .smdr-pop .smdr-sidehead{display:none}.smdr-pop .smdr-preset{width:auto;flex:0 0 auto;padding:8px 12px;font-size:13px;white-space:nowrap}
  .smdr-pop .smdr-day{height:44px;min-height:44px;font-size:14px}.smdr-pop .smdr-weekdays span{font-size:11px}.smdr-pop .smdr-month-title{font-size:14px}.smdr-pop .smdr-actions button{font-size:14px;min-width:70px}
  .smdr-pop .smdr-time-select{font-size:16px;min-height:44px}
  .lead-attribution-popover{position:fixed!important;left:12px!important;right:12px!important;top:80px!important;max-width:none!important;width:auto!important;max-height:65vh;overflow:auto;z-index:300}
  #notifBellWrapper{right:max(12px,env(safe-area-inset-right));bottom:max(12px,env(safe-area-inset-bottom))}
  body:has(.mp-multi[open],.smdr-pop.open,dialog[open],.cust-modal) #notifBellWrapper{visibility:hidden;pointer-events:none}
}
@media(max-width:360px){.mp-platform-cards{grid-template-columns:1fr}.mp-kpi{padding:10px}.mp-kpi strong{font-size:18px}}
@media(prefers-reduced-motion:reduce){.sm-sidebar,.mobile-overlay{transition:none!important}}
@media(pointer:coarse){
  #content :is(button,select,summary),.cust-dialog :is(button,select),.modal-box :is(button,select),dialog :is(button,select){min-height:44px!important;touch-action:manipulation}
  #content :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea),.cust-dialog :is(input:not([type=checkbox]):not([type=radio]),select,textarea),.modal-box :is(input:not([type=checkbox]):not([type=radio]),select,textarea){font-size:16px!important;min-height:44px!important}
}
