
@media (max-width:900px){
  :root{--mobile-nav-h:86px;--mobile-top-h:58px}
  *{-webkit-tap-highlight-color:transparent}
  html,body{height:100dvh;max-width:100vw;overflow:hidden;overscroll-behavior:none}
  body{background:#edf4ff}
  #main{height:100dvh;width:100%;padding-bottom:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom));background:#edf4ff}
  #tb{height:var(--mobile-top-h);padding:0 12px;background:rgba(255,255,255,.94);backdrop-filter:saturate(140%) blur(14px);border-bottom:1px solid rgba(203,213,225,.9);box-shadow:0 8px 22px rgba(15,23,42,.04)}
  .tb-title{min-width:0;max-width:calc(100vw - 92px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:18px;font-weight:900;color:#102033}
  body.page-requests .tb-title{max-width:calc(100vw - 186px)}
  .tb-view-toggle .vbtn{min-width:36px;min-height:36px;padding:0 10px}
  #tb>div:last-child{margin-left:auto!important}
  #tb>div:last-child .btn{min-width:44px;min-height:42px;border-radius:10px;padding:0 13px;font-size:0;box-shadow:0 8px 20px rgba(37,99,235,.18)}
  #tb>div:last-child .btn:after{content:'+';font-size:24px;font-weight:900;line-height:1}
  #cnt{height:calc(100dvh - var(--mobile-top-h) - var(--mobile-nav-h) - env(safe-area-inset-bottom));overflow:hidden}
  .pg{height:100%;min-width:0;overflow-y:auto!important;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
  #sb{height:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom));padding:7px 10px calc(9px + env(safe-area-inset-bottom));gap:6px;align-items:center;background:linear-gradient(90deg,#071f38 0,#0b3f6c 54%,#075985 100%);box-shadow:0 -14px 34px rgba(15,42,72,.24);scroll-snap-type:x proximity}
  .ni{width:74px;min-width:74px;height:64px;border-radius:13px;padding:7px 5px;gap:4px;scroll-snap-align:center}
  .ni.act{width:94px;min-width:94px;background:linear-gradient(135deg,#2563eb,#06b6d4);box-shadow:0 10px 22px rgba(6,182,212,.22)}
  .ni-ic{font-size:21px;line-height:1}.ni-lb{font-size:10px;line-height:1.12;max-width:86px;font-weight:800;color:inherit}.ni-bdg{top:2px;right:6px;min-width:18px;height:18px;font-size:10px}
  #notifs{top:auto;bottom:calc(var(--mobile-nav-h) + 12px + env(safe-area-inset-bottom));left:12px;right:12px;z-index:2500}.notif{max-width:none;width:100%;border-radius:12px;font-size:13px;box-shadow:0 12px 30px rgba(15,23,42,.16)}
  .btn{min-height:40px;border-radius:10px;align-items:center}.btn.bsm{min-height:34px}.fc,.plsel{min-height:42px;border-radius:10px;font-size:16px}.fl{font-size:12px}.tag{line-height:1.25}

  .dash-wrap,.lv,.cg,.cal-wrap{padding:12px 12px calc(22px + env(safe-area-inset-bottom))}
  .dash-hero{margin:0 0 10px;padding:14px;border-radius:12px;gap:12px}
  .dash-title{font-size:21px;line-height:1.12}.dash-sub{font-size:12px;line-height:1.35}
  .dash-actions{display:grid;grid-template-columns:1fr 1fr;width:100%;gap:8px}.dash-actions .btn{justify-content:center;min-height:42px;padding:0 10px}
  .report-period{display:grid!important;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:10px;padding:10px;border-radius:12px}
  .report-period-title,.report-period-label{grid-column:1/-1;width:auto;font-size:10px}
  .report-period input[type="date"],.report-period input[type="month"],.report-period .plsel,.report-period .btn{width:100%;min-width:0;height:42px}
  .kpi-row,.module-kpis,.an-kpis,.dash-picture-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px}
  .kpi{min-height:112px;padding:12px;border-radius:12px}.kpi-val{font-size:22px}.kpi-sub{font-size:11px;line-height:1.25}
  .dash-grid,.an-grid,.dash-picture,.dash-picture-split{grid-template-columns:1fr!important;gap:10px}
  .dash-manager-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dash-manager-table-wrap .tbl{display:table;white-space:normal}
  .dash-tabs{position:sticky;top:0;background:#edf4ff;z-index:5;margin:0 -12px 10px;padding:6px 12px;scrollbar-width:none}
  .dash-tabs::-webkit-scrollbar{display:none}
  .card,.sett-sec,.sp-card,.sp-taskboard,.sp-review-sec,.sp-console,.sp-pulse,.sp-hero,.rq-hero,.rq-toolbar,.rq-kpi,.rq-col,.rq-card{border-radius:12px}
  .card-h,.sp-card-h,.sp-taskboard-h{padding:11px 12px}.card-b,.sp-card-b,.sp-taskboard-b{padding:12px;overflow-x:auto}
  .tbl,.sp-table-wrap{display:block;overflow-x:auto;white-space:nowrap;border-radius:12px}.tbl th,.tbl td{padding:10px 9px}

  .dtb{padding:10px 12px;gap:8px;overflow-x:auto;scrollbar-width:none}.dtb::-webkit-scrollbar{display:none}
  .dtb .fc,.dtb .plsel,.dtb .btn{height:42px;min-width:132px}
  #pg-deals .dtb{display:grid!important;grid-template-columns:1fr 1fr;overflow:visible}.deal-period{grid-column:1/-1}
  #pg-deals .dtb .plsel,#pg-deals .dtb .btn{width:100%;min-width:0}
  #pg-deals .dtb>div[style*="margin-left:auto"]{grid-column:1/-1;margin-left:0!important;display:grid!important;grid-template-columns:1fr 1fr;gap:8px!important;width:100%}
  #pg-deals .dtb>div[style*="margin-left:auto"] .deal-pipe-total{grid-column:1/-1;justify-content:center;width:100%;min-height:42px}
  .kb-wrap{padding:12px;gap:10px;scroll-snap-type:x mandatory}.kb-col{width:calc(100vw - 28px);min-width:calc(100vw - 28px);scroll-snap-align:start;border-radius:12px}.kb-cards{max-height:none;min-height:calc(100dvh - 276px)}

  .co-pipe-toolbar{min-height:auto;height:auto;grid-template-columns:1fr;gap:8px;padding:12px;background:#fff}.co-pipe-title{font-size:18px;letter-spacing:.04em}.co-pipe-search input{font-size:16px}
  .co-pipe-actions{display:grid!important;grid-template-columns:1fr 1fr;gap:8px;width:100%;overflow:visible}.co-pipe-actions>*{min-width:0}.co-pipe-total{grid-column:1/-1;font-size:13px}.co-setup,.co-new,.co-more{height:42px;width:100%;font-size:13px}
  .contact-filters{grid-template-columns:1fr;gap:8px;padding:10px 12px}.contact-filters .btn{grid-column:auto;height:42px}
  .co-funnel{padding:12px;gap:10px;scroll-snap-type:x mandatory;overflow-x:auto}.co-fcol{flex-basis:calc(100vw - 28px);scroll-snap-align:start}.co-fcards{max-height:none;min-height:calc(100dvh - 286px)}
  .co-fcard,.driver-card,.quote-card,.quote-template-card{border-radius:12px;padding:12px}
  .cg{grid-template-columns:1fr}.quote-template-grid{grid-template-columns:1fr}.quote-template-head{align-items:stretch}.quote-template-head .btn,.quote-template-head .plsel{width:100%}

  #pg-requests{padding-bottom:calc(14px + env(safe-area-inset-bottom))}
  .rq-wrap{padding:12px;gap:10px;min-height:auto}
  .rq-hero{padding:15px;flex-direction:column}.rq-hero h2{font-size:23px}.rq-hero p{font-size:13px;line-height:1.38}
  .rq-hero-actions{display:grid;grid-template-columns:1fr 1fr;width:100%;gap:8px}.rq-hero-actions .btn{justify-content:center}
  .rq-toolbar{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:10px}.rq-toolbar-label,.rq-toolbar .report-period-label{grid-column:1/-1}.rq-toolbar #rq-search{grid-column:1/-1;width:100%;min-width:0!important}
  .rq-toolbar .fc,.rq-toolbar .plsel,.rq-toolbar .btn{width:100%;height:42px;min-width:0;font-size:15px}
  .rq-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px}.rq-kpi{padding:10px}.rq-kpi b{font-size:20px}
  .rq-board{grid-auto-columns:minmax(312px,calc(100vw - 28px));gap:10px;min-height:calc(100dvh - 254px);padding-bottom:10px;scroll-snap-type:x mandatory}
  .rq-table-wrap{min-height:calc(100dvh - 254px)}
  .rq-table-wrap .tbl{display:table;white-space:normal}
  .rq-col{scroll-snap-align:start;min-height:calc(100dvh - 278px);overflow:hidden}.rq-col-head{padding:10px 11px}.rq-cards{min-height:220px;overflow-y:auto;-webkit-overflow-scrolling:touch}.rq-card{padding:12px}.rq-card-title{font-size:17px}.rq-card-money{grid-template-columns:1fr 1fr}

  #pg-sales-plan{padding:12px!important}.sp-wrap{gap:10px}.sp-hero{padding:14px;gap:10px}.sp-title{font-size:21px}.sp-actions{display:grid;grid-template-columns:1fr 1fr;width:100%;gap:8px}.sp-actions .btn{justify-content:center}
  .sp-toolbar{display:grid;grid-template-columns:1fr 1fr;gap:8px}.sp-toolbar .sp-month,.sp-toolbar .btn,.sp-toolbar .plsel{width:100%;min-width:0}
  .sp-command,.sp-grid{grid-template-columns:1fr!important}.sp-review,.sp-kpis,.sp-dept-head,.sp-plan-run{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px}.sp-action-list,.sp-taskboard-b{grid-template-columns:1fr}.sp-table{min-width:900px}

  .driver-filters{padding:10px 12px}.driver-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:10px 12px}.driver-grid{grid-template-columns:1fr;padding:12px}.driver-card-actions .btn{flex:1 1 auto;justify-content:center}.driver-modal-grid{grid-template-columns:1fr}.driver-modal-wide{grid-column:auto}
  .carrier-driver-tools{padding:10px 12px;gap:8px}.carrier-driver-tools .fc,.carrier-driver-tools .btn{width:100%;flex:1 1 100%}.carrier-driver-panel{padding-bottom:calc(86px + env(safe-area-inset-bottom))}

  #pg-mail-center,#pg-mail{overflow:hidden!important;padding:0!important}.m2,.mail-wrap{height:100%!important;min-height:0!important}.m2{flex-direction:column!important}.m2-sb{width:100%!important;max-height:172px!important;border-right:0!important;border-bottom:1px solid #e0e7f0!important}.m2-main{min-height:0!important}.m2-list,.m2-thread,.mail-list-panel,.mail-thread-panel{width:100%!important;min-width:0!important;min-height:0!important}.m2-right{display:none!important}
  .mail-sb{max-height:170px!important;grid-template-columns:1fr 1fr!important}.mail-list-toolbar,.mail-thread-head{min-height:48px!important}.mail-msg{min-height:66px!important}.mail-compose-modal{align-items:flex-end!important;padding:0!important}.mail-compose-box{width:100vw!important;max-width:100vw!important;max-height:94dvh!important;border-radius:18px 18px 0 0!important}
  .mail-editor-toolbar{overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}.mail-editor-toolbar::-webkit-scrollbar{display:none}.mail-editor-area,.mc-body{font-size:16px}

  .mov{align-items:flex-end;justify-content:center;padding:0}.mod,.mod-lg,.mod-sm{width:100vw;max-width:100vw;height:min(95dvh,960px);max-height:95dvh;border-radius:18px 18px 0 0;overflow:hidden;display:flex;flex-direction:column}.mh{position:sticky;top:0;z-index:3;background:#fff;padding:13px 16px}.mb{flex:1;min-height:0;overflow-y:auto;padding:14px 16px}.mf{position:sticky;bottom:0;z-index:3;background:#fff;padding:11px 16px calc(11px + env(safe-area-inset-bottom));display:grid;grid-template-columns:1fr 1fr;gap:8px}.mf .btn{width:100%;justify-content:center;min-height:44px}.frow,.dm-main .frow,.fg,.dm-main .fg{grid-template-columns:1fr!important;gap:6px}
  .deal-amo,.company-amo,.contact-amo{height:100dvh;max-height:100dvh;border-radius:0}.deal-amo .mb,.company-amo .mb,.contact-amo .mb{height:calc(100dvh - 58px);padding:0;overflow:hidden}.dm-lay,.co-amo-lay,.ct-amo-lay{grid-template-columns:1fr!important;overflow-y:auto}.dm-amo-tabs,.co-amo-tabs,.ct-amo-tabs{overflow-x:auto;white-space:nowrap;scrollbar-width:none}.dm-amo-tabs::-webkit-scrollbar,.co-amo-tabs::-webkit-scrollbar,.ct-amo-tabs::-webkit-scrollbar{display:none}
  .dm-amo-head,.co-amo-head,.ct-amo-head{min-height:176px;padding:16px 16px 0}.dm-amo-title,.co-amo-title,.ct-amo-title{font-size:20px}.dm-main,.co-amo-main,.ct-amo-main,.dm-side,.co-amo-side,.ct-amo-side{max-height:none;overflow:visible;border-right:0;padding-bottom:calc(92px + env(safe-area-inset-bottom))}
  .rq-modal-grid,.sp-form-grid{grid-template-columns:1fr}.rq-modal-grid .wide,.rq-modal-grid .full,.sp-form-grid .full{grid-column:1/-1}
}
@media (max-width:520px){
  :root{--mobile-nav-h:84px}
  .kpi-row,.module-kpis,.an-kpis,.dash-picture-kpis,.sp-review,.sp-kpis,.sp-dept-head,.sp-plan-run{grid-template-columns:1fr!important}
  .dash-manager-kpis{grid-template-columns:1fr}
  .dash-actions,.rq-hero-actions,.sp-actions,.co-pipe-actions{grid-template-columns:1fr}
  .rq-card-money{grid-template-columns:1fr}.rq-board{grid-auto-columns:calc(100vw - 26px)}
  .report-period,.rq-toolbar,#pg-deals .dtb,.sp-toolbar{grid-template-columns:1fr!important}
  .ni{width:70px;min-width:70px}.ni.act{width:88px;min-width:88px}.ni-lb{font-size:9px}
  .li-box{width:calc(100vw - 26px);padding:28px 22px}
}
@media (max-width:520px){
  .dash-hero,.rq-hero,.sp-hero{padding:12px;gap:9px}
  .dash-title,.sp-title{font-size:20px}.rq-hero h2{font-size:21px}
  .dash-sub,.rq-hero p,.sp-sub{font-size:12px;line-height:1.32}
  .dash-actions,.rq-hero-actions,.sp-actions{grid-template-columns:1fr 1fr!important;gap:7px}
  .dash-actions .btn,.rq-hero-actions .btn,.sp-actions .btn{min-height:38px;padding:0 8px;font-size:13px}
  .dash-period.report-period{grid-template-columns:1fr 1fr!important}
  .dash-period>.report-period-title:first-child{grid-column:1/-1}
  .dash-period>.report-period-title:not(:first-child){display:none}
  .dash-period #dash-period-mode{grid-column:1/-1}
  .rq-toolbar{grid-template-columns:1fr 1fr!important}
  .rq-toolbar .report-period-label{display:none}
  #pg-deals .dtb>div[style*="margin-left:auto"]{grid-template-columns:1fr 1fr!important}
  #pg-deals .dtb>div[style*="margin-left:auto"] .deal-pipe-total{justify-content:flex-start;overflow-x:auto;padding:4px;border-radius:14px}
  .deal-total-m{padding:5px 10px}.deal-total-l{font-size:9px}.deal-total-v{font-size:13px}
  .sp-toolbar{grid-template-columns:1fr!important}
  .sp-month{display:grid;grid-template-columns:44px 1fr 44px;width:100%;gap:8px;align-items:center}
  .sp-month .btn{width:44px!important;min-width:44px!important;padding:0}
  .sp-month span{text-align:center;line-height:1.12;white-space:normal;font-size:18px;font-weight:900}
  .sp-toolbar>div[style*="margin-left:auto"]{margin-left:0!important;display:grid!important;grid-template-columns:1fr;gap:8px!important;width:100%}
}
