/* These rules affect phones only. Desktop uses the existing styles unchanged. */
@media(max-width:700px){
  html.crm-mobile{--crm-mobile-nav-height:76px}
  .crm-mobile .app-main{min-width:0;width:100%;margin-left:0}
  .crm-mobile .app-main>.content{padding:18px 14px calc(var(--crm-mobile-nav-height) + env(safe-area-inset-bottom) + 20px);min-width:0}
  .crm-mobile .topbar{padding:0 14px;height:56px}
  .crm-mobile .sidebar,.crm-mobile .sidebar-mobile-backdrop,.crm-mobile .mobile-menu{display:none!important}
  .crm-mobile .topbar .crumb{font-size:13px}
  .crm-mobile .page-heading{gap:10px;margin-bottom:18px;flex-wrap:wrap}
  .crm-mobile .crm-mobile-customers .page-heading{flex-wrap:nowrap}
  .crm-mobile .page-heading .page-intro{flex:1 1 auto;min-width:0}
  .crm-mobile .page-heading h1{font-size:24px}
  .crm-mobile .page-heading p{font-size:12px;max-width:none}
  .crm-mobile .page-actions{flex:0 1 auto;gap:6px;width:auto;max-width:100%;flex-wrap:wrap}
  .crm-mobile .page-actions .btn{font-size:13px;padding:10px;flex:0 0 auto}
  .crm-mobile .input,.crm-mobile .select,.crm-mobile .textarea{font-size:16px;min-height:44px;max-width:100%}
  .crm-mobile .btn,.crm-mobile .text-btn{min-height:44px}
  #crm-mobile-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));position:fixed;inset:auto 0 0;z-index:35;background:#fff;border-top:1px solid var(--line);padding:8px 8px calc(8px + env(safe-area-inset-bottom));min-height:var(--crm-mobile-nav-height)}
  #crm-mobile-nav button{border:0;background:transparent;color:var(--muted);display:flex;align-items:center;justify-content:center;flex-direction:column;gap:5px;min-height:52px;font-size:12px}
  #crm-mobile-nav button[aria-current=page]{color:var(--accent);font-weight:600}
  #crm-mobile-nav svg{width:21px;height:21px}
  #crm-mobile-nav span{position:relative}#crm-mobile-nav b{position:absolute;bottom:13px;left:24px;background:var(--accent);color:#fff;border-radius:10px;font-size:10px;padding:0 5px;min-width:16px}
  .crm-mobile body:has(#active-overlay) #crm-mobile-nav{display:none}
  .crm-mobile .crm-mobile-customers>.stat-grid,.crm-mobile-customers>.permission-bar,.crm-mobile-customers>section>.stage-tabs,.crm-mobile-customers .filter-sub,.crm-mobile-customers .footer-note{display:none}
  .crm-mobile .page-heading .export-btn{display:none}
  .crm-mobile-customers>section.panel{border:0;background:transparent;overflow:visible}
  .crm-mobile-customers .filter-zone{padding:0;border:0}
  .crm-mobile-customers .filter-grid{display:block}
  .crm-mobile-customers .filter-grid>:not(.input-wrap){display:none!important}
  .crm-mobile-customers .filter-grid .input-wrap{min-width:0;width:100%}
  .crm-mobile-customers .filter-grid .input-wrap .input{width:100%;padding-left:38px}
  .crm-mobile-scopes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:14px 0}
  .crm-mobile-scopes .btn{padding:9px 3px;font-size:13px}
  .crm-mobile-filters{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:8px}
  .crm-mobile-filters .select{width:100%!important;font-size:13px;min-width:0;padding:10px 5px}
  .crm-mobile-filters .btn{padding:9px;font-size:13px}
  .crm-mobile-filter-summary{display:flex;flex-wrap:wrap;gap:6px;margin-top:9px}
  .crm-mobile-chip{border:1px solid var(--line);border-radius:6px;background:#fff;color:var(--accent-dark);font-size:12px;min-height:36px;padding:7px}
  .crm-mobile-count{font-size:12px;color:var(--muted);padding:10px 0}
  .crm-mobile-customer{border:1px solid var(--line);border-radius:10px;background:#fff;padding:14px;margin-bottom:12px;overflow-wrap:anywhere}
  .crm-mobile-customer>.row{align-items:flex-start;gap:8px}
  .crm-mobile-customer .company-link{min-height:44px;flex:1;text-align:left;min-width:0}
  .crm-mobile-customer h2{font-size:17px;line-height:1.5;margin:0;color:var(--ink)}
  .crm-mobile-customer p{margin:5px 0;line-height:1.6}
  .crm-mobile-customer .tag{font-size:11px;white-space:normal;flex-shrink:0;margin-top:7px;max-width:45%}
  .crm-mobile-person{display:flex;gap:8px;align-items:center;margin-top:12px}
  .crm-mobile-phone{display:inline-flex;align-items:center;gap:8px;min-height:44px;font-size:16px;font-weight:600;color:var(--accent-dark);overflow-wrap:anywhere}
  .crm-mobile-address{display:flex;gap:7px;align-items:flex-start;font-size:13px;color:var(--muted)}
  .crm-mobile-address svg{margin-top:3px;width:16px;height:16px}
  .crm-mobile-customer footer{display:flex;justify-content:space-between;align-items:center;gap:8px;border-top:1px solid var(--line);margin-top:10px;padding-top:8px}
  .crm-mobile-customers .table-footer{padding:12px 0;justify-content:space-between;background:transparent}
  .crm-mobile-profile{padding:0 14px}
  .crm-mobile-identity{display:flex;align-items:center;gap:14px;padding:22px 0}
  .crm-mobile-identity h2{margin:0 0 5px;font-size:20px}
  .crm-mobile-identity .avatar{width:48px;height:48px;font-size:20px}
  .crm-mobile-menu{display:flex;width:100%;justify-content:space-between;align-items:center;text-align:left;background:transparent;border:0;border-top:1px solid var(--line);padding:17px 0;min-height:56px;font-size:15px}
  .crm-mobile-menu span{color:var(--muted)}
  .crm-mobile .stat-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;border:0;background:transparent}
  .crm-mobile .stat-card{background:#fff;border:1px solid var(--line);border-radius:9px;padding:16px;min-height:108px}
  .crm-mobile .stat-card+.stat-card::before{display:none}
  .crm-mobile .stat-card .stat-label{font-size:12px}
  .crm-mobile .stat-card .stat-foot{font-size:11px}
  .crm-mobile .task-row{padding:14px;flex-wrap:wrap}
  .crm-mobile .message-row{flex-wrap:wrap;align-items:flex-start}
  .crm-mobile .message-row .grow{min-width:0}
  .crm-mobile .message-row p{font-size:13px;overflow-wrap:anywhere}
  .crm-mobile .message-actions{flex-direction:row;flex-wrap:wrap;margin-left:auto}
  .crm-mobile #active-overlay.overlay{padding:0!important;align-items:stretch}
  .crm-mobile #active-overlay>.drawer,.crm-mobile #active-overlay>.modal{width:100%!important;max-width:none!important;height:100dvh;max-height:100dvh!important;border-radius:0!important;margin:0}
  .crm-mobile #active-overlay .dialog-header{padding:15px 16px;gap:8px;flex-shrink:0}
  .crm-mobile #active-overlay .dialog-header h2{font-size:20px}
  .crm-mobile #active-overlay .dialog-body{min-height:0;overscroll-behavior:contain}
  .crm-mobile #active-overlay .dialog-footer{padding:12px 16px calc(12px + env(safe-area-inset-bottom));flex-shrink:0}
  .crm-mobile #active-overlay .dialog-footer>.small{display:none}
  .crm-mobile #active-overlay .dialog-footer>.row{flex:1;gap:8px;flex-wrap:wrap;justify-content:flex-end}
  .crm-mobile #active-overlay .dialog-footer .btn{min-height:46px;white-space:normal}
  .crm-mobile #active-overlay .cw-shell .dialog-footer{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:44px;align-items:stretch;gap:8px;height:auto}
  .crm-mobile #active-overlay .cw-shell .dialog-footer>.row{display:contents}
  .crm-mobile #active-overlay .cw-shell .dialog-footer .btn{width:100%;height:44px;min-height:44px;max-height:44px;min-width:0!important;max-width:100%;white-space:nowrap;overflow-wrap:normal;padding:8px;font-size:13px;gap:6px;align-self:stretch}
  .crm-mobile #active-overlay .cw-shell .dialog-footer .btn svg{width:17px;height:17px;max-height:17px;flex:0 0 17px}
  .crm-mobile #active-overlay .cw-shell .dialog-footer>.btn:only-of-type:last-child:first-child{grid-column:1/-1}
  .crm-mobile .customer-entry .entry-labeled,.crm-mobile .customer-entry .entry-business,.crm-mobile .customer-entry .entry-business .entry-labeled,.crm-mobile .customer-entry .entry-secondary .entry-labeled,.crm-mobile .customer-entry .entry-industry .field{grid-template-columns:minmax(0,1fr)}
  .crm-mobile .customer-entry .entry-labeled>label,.crm-mobile .customer-entry .entry-industry .field>label{font-size:14px}
  .crm-mobile .customer-entry .entry-people{grid-template-columns:minmax(0,1fr)}
  .crm-mobile .customer-entry .entry-person-identity{grid-template-columns:minmax(0,1fr);gap:6px}
  .crm-mobile .customer-entry .entry-name-row,.crm-mobile .customer-entry .entry-account-main{min-width:0}
  .crm-mobile .customer-entry .entry-phone-row{grid-template-columns:minmax(0,1fr) auto;gap:7px}
  .crm-mobile .customer-entry .entry-phone-row>label{grid-column:1/-1}
  .crm-mobile .crm-mobile-region-entry{width:100%;justify-content:space-between;white-space:normal;text-align:left;font-size:15px}
  .crm-mobile-native-regions{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;opacity:0;pointer-events:none}
  .crm-mobile .cw-tabs{overflow-x:auto;white-space:nowrap;flex-shrink:0;padding:0 16px;gap:22px}
  .crm-mobile .cw-tabs button{min-height:48px;flex-shrink:0}
  .crm-mobile .cw-follow-grid{grid-template-columns:minmax(0,1fr)}
  .crm-mobile .cw-fields{grid-template-columns:minmax(0,1fr)}
  .crm-mobile .cw-side,.crm-mobile .cw-main,.crm-mobile .cw-follow-main{padding:16px}
  .crm-mobile .cw-profile-line{grid-template-columns:minmax(0,1fr) auto;gap:8px}
  .crm-mobile .cw-profile-line>span{grid-column:1/-1}
  .crm-mobile .cw-company-fields>div{flex-wrap:wrap}
  .crm-mobile .cw-company-fields dt{flex-basis:90px}
  .crm-mobile .cw-company-fields dd{min-width:0;flex-basis:calc(100% - 110px)}
  .crm-mobile-sheet-open{overflow:hidden}
  #crm-mobile-layer{position:fixed;inset:0;z-index:150;display:flex;align-items:flex-end}
  .crm-mobile-shade{position:absolute;inset:0;background:#0006}
  .crm-mobile-sheet{position:relative;display:flex;flex-direction:column;width:100%;max-height:92dvh;background:#fff;border-radius:20px 20px 0 0;box-shadow:0 -5px 30px #0001}
  .crm-mobile-sheet>header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--line);flex-shrink:0}
  .crm-mobile-sheet h2{font-size:18px;margin:0}
  .crm-mobile-sheet-body{overflow-y:auto;overscroll-behavior:contain;padding:16px;min-height:0}
  .crm-mobile-sheet-body>.field{display:flex;flex-direction:column;gap:7px;margin-bottom:16px}
  .crm-mobile-sheet .field>span,.crm-mobile-sheet .field>label{font-size:14px;color:var(--ink);font-weight:500}
  .crm-mobile-sheet .select,.crm-mobile-sheet .input{width:100%;font-size:16px;min-height:46px;min-width:0}
  .crm-mobile-sheet>footer{display:flex;gap:10px;padding:12px 16px calc(12px + env(safe-area-inset-bottom));border-top:1px solid var(--line);flex-shrink:0}
  .crm-mobile-sheet>footer .btn{flex:1;min-height:46px}
  .crm-mobile-date-pair{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}
  .crm-mobile-region-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:12px}
  .crm-mobile-region-tabs .btn{white-space:normal;padding:9px 4px}
  .crm-mobile-region-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}
  .crm-mobile-region-list .btn{min-height:46px;white-space:normal}
  #crm-mobile-filter-error:not(:empty){padding:12px;background:#fff1ec;color:var(--red);border-radius:8px}
}
