/* Mobile presentation only. Business data and actions stay in their original modules. */
:root {
  --crm-safe-top: env(safe-area-inset-top, 0px);
  --crm-safe-bottom: env(safe-area-inset-bottom, 0px);
  --crm-safe-left: env(safe-area-inset-left, 0px);
  --crm-safe-right: env(safe-area-inset-right, 0px);
}
.eco-cash-back { display:none; }
@media (pointer:coarse) {
  body input:not([type=checkbox]):not([type=radio]):not([type=range]), body textarea, body select { font-size:16px !important; }
}
@media (pointer:coarse) and (min-width:769px) and (max-width:1024px) {
  .themed-nav-wrapper { padding:var(--crm-safe-top) var(--crm-safe-right) var(--crm-safe-bottom) var(--crm-safe-left) !important; border-radius:0 !important; }
}
@media (max-width: 768px) {
  html, body { background:#121113; -webkit-text-size-adjust:100%; }
  .m-shell {
    position:fixed !important; top:var(--crm-viewport-top, 0px) !important;
    right:0; bottom:auto !important; left:0; width:100% !important; max-width:none !important;
    height:var(--crm-viewport-height, 100dvh) !important; min-height:0 !important;
    box-sizing:border-box; margin:0 !important;
    padding:var(--crm-safe-top) var(--crm-safe-right) var(--crm-safe-bottom) var(--crm-safe-left) !important;
    gap:0 !important; overflow:hidden; background:#171618;
  }
  .m-shell > div:first-child, .m-shell [class*='_pageContent_6dgv4_'] {
    min-width:0; min-height:0; padding:0 !important;
  }
  .m-shell .m-card { min-height:0 !important; height:100%; border:0 !important; border-radius:0 !important; gap:0 !important; }
  .m-shell .m-head { padding:8px 68px 8px 12px !important; gap:8px; }
  .m-shell .mlb-home > .m-head { flex-direction:row; flex-wrap:wrap; align-items:center; }
  .m-shell .mlb-home > .m-head .scr-head { flex:1; min-width:90px; }
  .m-shell .scr-title { font-size:21px !important; line-height:1.2; }
  .m-shell .m-head .date-field, .m-shell .m-head .select-field { min-height:44px !important; font-size:15px !important; }
  .m-shell .m-body { padding:12px !important; gap:12px !important; overscroll-behavior-y:contain; scroll-padding-block:12px; }
  .m-shell .m-menu-trigger {
    top:calc(var(--crm-viewport-top, 0px) + var(--crm-safe-top) + 8px) !important;
    right:calc(var(--crm-safe-right) + 12px) !important; bottom:auto !important;
    width:44px !important; height:44px !important; min-height:44px; border-radius:12px !important;
  }
  .m-shell .m-menu-overlay {
    top:var(--crm-viewport-top, 0px) !important; bottom:auto !important;
    height:var(--crm-viewport-height, 100dvh); box-sizing:border-box;
    align-items:flex-start !important;
    padding:calc(var(--crm-safe-top) + 60px) calc(var(--crm-safe-right) + 12px) calc(var(--crm-safe-bottom) + 12px) calc(var(--crm-safe-left) + 12px) !important;
  }
  .m-shell .m-menu-panel { width:100% !important; max-height:100% !important; overflow-y:auto !important; }
  .m-shell .m-menu-panel .menu-ios-row { min-height:48px !important; font-size:15px !important; }
  .m-shell .mlb-home-points .row { min-height:60px !important; padding:8px 10px !important; gap:8px !important; }
  .m-shell .mlb-home-points .r-info { justify-items:start; text-align:left; }
  .m-shell .mlb-home-points .r-name { font-size:14px !important; line-height:1.35; }
  .m-shell .mlb-home-points .r-sub, .m-shell .mlb-home-points .mlb-home-point-driver { font-size:12px !important; }
  .m-shell .mlb-home-points .pc { font-size:12px !important; }
  .m-shell .mlb-point-share, .m-shell .mlb-trip-toggle, .m-shell .rdm-share-button { min-width:44px !important; min-height:44px !important; }
  .m-shell .mlb-home-shortcuts button { min-height:60px !important; }
  .m-shell .mlb-trip-heading strong { font-size:16px !important; }
  .m-shell .mlb-trip-heading small { font-size:12px !important; }

  /* iOS must not zoom when an editable control receives focus. */
  body input:not([type=checkbox]):not([type=radio]):not([type=range]), body textarea, body select {
    font-size:16px !important; min-height:44px; box-sizing:border-box; max-width:100%;
  }
  .m-shell button, .m2-modal button { touch-action:manipulation; }
  .m-shell .btn { min-height:44px; }

  .m-shell > .ecocrm-commerce--mobile, .m-shell > .ecocrm-cash--mobile,
  .m-shell > .ecocrm-driver-report--mobile { padding:0 !important; min-height:0; }
  .m-shell .eco-commerce-shell, .m-shell .eco-cash-shell, .m-shell .edr-shell {
    border:0 !important; border-radius:0 !important; height:100%; min-height:0;
  }
  .m-shell .eco-commerce-head, .m-shell .eco-cash-head, .m-shell .edr-head { padding:10px 12px !important; }
  .m-shell .eco-commerce-head p { display:none; }
  .m-shell .eco-commerce-head h1 { font-size:20px; }
  .eco-commerce-back, .eco-commerce-section-toggle, .eco-commerce-section-menu button,
  .edr-head button, .edr-day-picker button, .edr-filter-toggle, .eco-cash-head button { min-height:44px !important; }
  .edr-close, .edr-day-picker button { min-width:44px !important; }
  .eco-commerce-section-bar { padding:8px 12px !important; }
  .ecocrm-commerce--mobile.is-finance .eco-commerce-finance { padding:4px 12px 16px !important; }
  .eco-finance-toolbar { position:static !important; }
  .eco-finance-toolbar { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .eco-finance-periods { grid-column:1 / -1; box-sizing:border-box; }
  .eco-finance-toolbar > label { grid-template-columns:auto minmax(0,1fr); }
  .eco-finance-toolbar > button { min-height:44px; }
  .eco-finance-toolbar .eco-finance-export { width:auto; }
  .eco-finance-toolbar > label { padding:0 6px; min-width:0; }
  .eco-finance-toolbar input { width:100%; padding:0; }
  .eco-finance-periods button { min-height:44px !important; padding:0 5px; font-size:12px; }
  .eco-finance-export, .eco-finance-primary { min-height:44px !important; font-size:13px; }
  .eco-finance-metrics { gap:8px !important; }
  .eco-finance-metrics article { min-height:102px !important; padding:12px !important; gap:10px; }
  .eco-finance-metrics article > span { font-size:11px !important; line-height:1.4; letter-spacing:.02em; }
  .eco-finance-metrics article strong { font-size:clamp(16px, 4.3vw, 22px) !important; font-variant-numeric:tabular-nums; }
  .eco-finance-metrics article:last-child { grid-column:1 / -1; min-height:82px !important; }
  .eco-finance-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; overflow:visible !important; }
  .eco-finance-tabs button { min-width:0; min-height:44px; padding:0 5px; font-size:13px; }
  .eco-finance-tabs button[aria-selected=true] { border-radius:8px; background:rgba(203,151,53,.12); }
  .eco-finance-mobile-card { overflow-wrap:anywhere; }
  .ecocrm-driver-report .edr-day-picker { grid-template-columns:44px minmax(0,1fr) 44px !important; gap:8px !important; }
  .ecocrm-driver-report .edr-filters { max-height:48%; }
  .ecocrm-driver-report .edr-content { scrollbar-gutter:auto; }
  .edr-ride-toggle { min-height:44px !important; min-width:44px; }

  .ecocrm-client-app--mobile {
    top:var(--crm-viewport-top, 0px) !important; bottom:auto !important;
    height:var(--crm-viewport-height, 100dvh) !important; box-sizing:border-box;
    padding:var(--crm-safe-top) var(--crm-safe-right) var(--crm-safe-bottom) var(--crm-safe-left);
  }
  .eco-client-app-head { flex-shrink:0; min-height:56px; padding:6px 12px; }
  .eco-client-app-back, .eco-client-app-open { min-height:44px !important; font-size:13px; }
  .ecocrm-cash--mobile .eco-cash-head { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; }
  .ecocrm-cash--mobile .eco-cash-head-actions { grid-column:1 / -1; width:100%; }
  .eco-cash-back { display:block; border:1px solid #d8b06040; border-radius:10px; padding:0 12px; color:#e7bf70; background:#bf8b2c14; font:600 13px inherit; }
  .ecocrm-cash--mobile .eco-cash-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  .ecocrm-cash--mobile .eco-cash-metrics article { min-height:82px; padding:10px; }
  .ecocrm-cash--mobile .eco-cash-metrics article small { display:none; }
  .ecocrm-cash--mobile .eco-cash-metrics strong { font-size:clamp(14px,4vw,18px); white-space:normal; overflow-wrap:anywhere; }

  /* Portalled dialogs use the same visible area as the native shell. */
  .eco-finance-modal-backdrop, .eco-cash-modal-backdrop {
    top:var(--crm-viewport-top, 0px) !important; bottom:auto !important;
    height:var(--crm-viewport-height, 100dvh); box-sizing:border-box;
    padding:calc(var(--crm-safe-top) + 8px) calc(var(--crm-safe-right) + 8px) calc(var(--crm-safe-bottom) + 8px) calc(var(--crm-safe-left) + 8px) !important;
  }
  .eco-finance-modal, .eco-cash-modal, .m2-modal {
    max-height:calc(var(--crm-viewport-height, 100dvh) - var(--crm-safe-top) - var(--crm-safe-bottom) - 16px) !important;
    max-width:100%; min-height:0;
  }
  .m2-modal .m2-body { overflow-y:auto; }
  .m-shell .sheet-overlay, .m-shell .modal-overlay { inset:var(--crm-safe-top) var(--crm-safe-right) var(--crm-safe-bottom) var(--crm-safe-left) !important; }
  .m-shell .sheet { max-height:100% !important; padding-bottom:12px !important; }
  .m-shell .sheet-body { min-height:0; overflow-y:auto; }
  .eco-finance-modal button, .eco-cash-modal button { min-height:44px; }
  html[data-crm-keyboard] { --crm-safe-bottom:0px; }
  html[data-crm-keyboard] .ecocrm-driver-report .edr-filters { max-height:65%; }
  html[data-crm-keyboard] .ecocrm-driver-report .edr-summary { display:none; }
  @media (max-width:360px) {
    .eco-finance-toolbar > label { grid-column:1 / -1; }
    .eco-finance-metrics { grid-template-columns:1fr !important; }
  }
}
