/* Shared phone layout. Screen-only rules leave printed reports unchanged. */
.crm-menu-toggle,.crm-chat-back{display:none}
.crm-fold{margin:0;border:0;padding:0}
.crm-fold>summary{display:none}
@media screen and (max-width:720px){
  html.crm-responsive{scroll-padding-top:72px;-webkit-text-size-adjust:100%}
  .crm-responsive body{min-width:0;width:100%;margin:0}
  .crm-responsive *{box-sizing:border-box}
  .crm-responsive main,.crm-responsive #app,.crm-responsive section,.crm-responsive article,.crm-responsive form{min-width:0;max-width:100%}
  .crm-responsive button,.crm-responsive .buttonlink,.crm-responsive a.button,.crm-responsive summary{touch-action:manipulation}
  .crm-responsive button,.crm-responsive .buttonlink,.crm-responsive a.button{min-height:44px;max-width:100%;white-space:normal;overflow-wrap:anywhere;line-height:1.35}
  .crm-responsive button{padding:10px 12px}
  .crm-responsive input:not([type=checkbox]):not([type=radio]):not([type=hidden]),.crm-responsive select,.crm-responsive textarea{font-size:16px;min-width:0;max-width:100%;min-height:44px}
  .crm-responsive input[type=checkbox],.crm-responsive input[type=radio]{width:22px;height:22px;min-height:22px;flex-shrink:0}
  .crm-responsive textarea{width:100%}
  .crm-responsive h1{font-size:25px;line-height:1.2;overflow-wrap:anywhere}
  .crm-responsive h2{font-size:21px;line-height:1.3;overflow-wrap:anywhere}
  .crm-responsive h3,.crm-responsive p,.crm-responsive small,.crm-responsive label{overflow-wrap:anywhere}
  .crm-responsive button:focus-visible,.crm-responsive a:focus-visible,.crm-responsive summary:focus-visible,.crm-responsive .crm-scroll-region:focus-visible{outline:3px solid #eab83c;outline-offset:2px}
  .crm-responsive .controls,.crm-responsive .actions,.crm-responsive .head,.crm-responsive .heading,.crm-responsive .sectionhead{flex-wrap:wrap;min-width:0;gap:8px}
  .crm-responsive .controls>*,.crm-responsive .actions>*,.crm-responsive .head>*,.crm-responsive .heading>*,.crm-responsive .sectionhead>*{min-width:0;max-width:100%}
  .crm-responsive .controls button,.crm-responsive .actions button{flex:1 1 auto}
  .crm-responsive .panel{padding:14px;margin:12px 0;border-radius:12px}
  .crm-responsive .empty{padding:25px 12px}
  .crm-responsive .note{padding:12px;font-size:13px;overflow-wrap:anywhere}

  /* Main navigation takes one row until the employee opens the menu. */
  .crm-main-layout .top{position:static;top:auto;z-index:20;padding:8px 12px;gap:6px 10px;align-items:center;flex-wrap:wrap;min-height:60px}
  .crm-main-layout .top>.brand{flex:1 1 160px;font-size:12px;letter-spacing:.7px}
  .crm-main-layout .top>.brand small{font-size:8px;margin-top:4px}
  .crm-main-layout .crm-menu-toggle{display:block;background:#294552;color:white;border:1px solid #59717d;flex:0 0 auto;font-size:13px;padding:8px 12px}
  .crm-main-layout:not(.crm-menu-open) .top>.identity,.crm-main-layout:not(.crm-menu-open) #crmSectionMenu{display:none}
  .crm-main-layout.crm-menu-open .top{position:relative}
  .crm-main-layout .top>.identity{flex:1 1 100%;max-width:100%;padding:8px 0 2px;border-top:1px solid #49616d;gap:6px 12px}
  .crm-main-layout .top .logout{min-height:44px}
  .crm-main-layout .content{display:flex;flex-direction:column;padding:10px 12px 24px;width:100%;gap:0}
  .crm-main-layout .content>*{min-width:0;max-width:100%;flex-shrink:0}
  .crm-main-layout #crmSectionMenu{order:-2;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:0 0 14px;padding:0 0 14px;border-bottom:1px solid #cbd9e2}
  .crm-main-layout #crmSectionMenu>*{display:flex;align-items:center;justify-content:flex-start;text-align:left;min-height:48px;padding:10px 12px;background:#fff;border:1px solid #d5e1e8;border-radius:9px;font-size:13px;color:#233d4d;text-decoration:none}
  .crm-main-layout #crmSectionMenu>.active{background:#173844;color:white;border-color:#173844}
  .crm-main-layout .workspace-switch{order:-1;gap:6px;margin:0 0 8px;display:flex;flex-wrap:nowrap}
  .crm-main-layout .workspace-switch>button{flex:1 1 0;font-size:12px;padding:8px 6px;min-height:44px}
  .crm-main-layout .workspace-switch>span{display:none}
  .crm-main-layout .contenthead{flex-wrap:nowrap;align-items:center;margin:0 0 6px}
  .crm-main-layout .contenthead h2{font-size:22px;margin:4px 0}
  .crm-main-layout .contenthead .controls{flex:0 1 auto;justify-content:flex-end;gap:6px}
  .crm-main-layout .contenthead #refresh{font-size:12px;padding:8px 10px}
  .crm-main-layout:not(.crm-menu-open) .contenthead #exportReport,.crm-main-layout:not(.crm-menu-open) .contenthead a[href*="onec-workspace"]{display:none}
  .crm-main-layout.crm-menu-open .contenthead{flex-wrap:wrap}
  .crm-main-layout .customer-communication-notices{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 6px}
  .crm-main-layout .customer-communication-notices a{flex:1 1 130px;text-align:center;padding:8px;font-size:12px;line-height:1.3;min-height:44px}
  .crm-main-layout .connection-health{margin:4px 0 10px;padding:9px 10px;font-size:12px}
  .crm-main-layout .connection-health-head{flex-wrap:nowrap;gap:6px;align-items:center}
  .crm-main-layout .connection-health-head details{flex:1}
  .crm-main-layout .connection-health-head summary{min-height:44px;font-size:12px;display:flex;align-items:center}
  .crm-main-layout #refreshConnectionHealth{font-size:11px;padding:6px;min-width:66px;max-width:80px}
  .crm-main-layout .statusbar{font-size:11px;margin:20px 0 0;line-height:1.5}

  .crm-fold{margin:5px 0;border:1px solid #d5e1e8;border-radius:9px;background:#fff}
  .crm-fold>summary{display:list-item;list-style-position:inside;cursor:pointer;padding:12px;font-size:13px;font-weight:650;color:#294a5d;min-height:44px}
  .crm-fold[open]>summary{border-bottom:1px solid #e1e8ec}
  .crm-fold> :not(summary){margin:0!important;padding:10px}
  .crm-fold:not([open])> :not(summary){display:none}
  .crm-main-layout .metrics{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:8px 0}
  .crm-main-layout .metric{display:flex;flex-direction:column;align-items:flex-start;padding:10px 8px;gap:3px;text-align:left}
  .crm-main-layout .metric span{font-size:11px;line-height:1.2}
  .crm-main-layout .metric strong{font-size:24px;line-height:1.2}
  .crm-main-layout .metric small{display:none}
  .crm-main-layout .filterbar{gap:8px;margin:8px 0;flex-wrap:wrap}
  .crm-main-layout .crm-order-search{display:flex}
  .crm-main-layout .crm-order-search>input{flex:1 1 100%;width:100%}
  .crm-main-layout .crm-order-search>button,.crm-main-layout .crm-order-search>a{flex:1 1 140px;font-size:13px;padding:10px}
  .crm-main-layout .crm-order-search>.crm-fold{flex:1 1 100%;margin:0}
  .crm-order-maintenance{display:flex;gap:8px;flex-wrap:wrap}
  .crm-order-maintenance button{flex:1 1 120px;font-size:12px}
  .crm-main-layout .engineerfilter{display:block}
  .crm-main-layout .engineerfilter select{width:100%;margin-top:6px}
  .crm-main-layout .stagefilters .stagefilterhead{display:none}
  .crm-main-layout .stagechips{gap:6px}
  .crm-main-layout .stagechip{min-height:44px;font-size:12px;padding:8px 10px}
  .crm-main-layout .filterresult{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;margin:10px 0}
  .crm-main-layout .filterresult>p{margin:0;width:100%;font-size:12px}
  .crm-main-layout .listcontrols{width:100%;display:flex;gap:8px}
  .crm-main-layout .listcontrols>button{flex:1;font-size:12px}
  .crm-main-layout .ordergrid{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
  .crm-main-layout .compactorder{display:flex;flex-direction:column;gap:10px;padding:14px;border-radius:12px}
  .crm-main-layout .compactorder .orderhead{display:flex;gap:7px 10px;align-items:center}
  .crm-main-layout .compactorder .orderhead h3{flex:1 1 100%;font-size:16px;line-height:1.4;overflow-wrap:anywhere}
  .crm-main-layout .compactorder .rowpayment{flex:1 1 100%;font-size:13px;line-height:1.5}
  .crm-main-layout .compactorder .orderroute{width:100%;margin:0}
  .crm-main-layout .compactorder .route{display:flex;gap:6px;margin:0;flex-wrap:wrap}
  .crm-main-layout .compactorder .route button{flex:1 1 95px;min-height:44px;font-size:12px;padding:8px}
  .crm-main-layout .compactorder .rowtools{display:flex;width:100%;margin:0}
  .crm-main-layout .compactorder .orderdetails{width:100%}
  .crm-main-layout .compactorder .orderdetails>summary{min-height:44px;font-size:14px;padding:12px 0;white-space:normal}
  .crm-main-layout .compactorder .cardactions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .crm-main-layout .compactorder .cardactions button{min-height:44px;font-size:12px;padding:9px 8px}
  .crm-main-layout .compactorder .archiveorder{margin-left:0}
  .crm-main-layout .compactorder .cashorder{min-height:44px}
  .crm-main-layout .orderquickcontacts,.crm-main-layout .quickcontactlist{min-width:0;width:100%}
  .crm-main-layout .person{padding:14px;gap:12px;overflow-wrap:anywhere}
  .crm-main-layout .person>.controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .crm-main-layout .person>.controls button{min-height:48px;font-size:12px;padding:9px}
  .crm-main-layout .connections{grid-template-columns:minmax(0,1fr)}
  .crm-main-layout .connections article{padding:14px;overflow-wrap:anywhere}
  .crm-main-layout .connections button{margin:4px 0}
  .crm-main-layout .contactfilters input,.crm-main-layout .contactfilters select{min-width:0;flex:1 1 100%}
  .crm-main-layout .contactentry a{display:inline-flex;align-items:center;min-height:44px}
  .crm-main-layout .historyrow{overflow-wrap:anywhere}

  /* Record lists keep every field and place the actions after the title. */
  .crm-responsive .crm-card-table-wrap{overflow:visible;border:0;background:transparent;max-width:100%;margin:12px 0}
  .crm-responsive table.crm-card-table,.crm-responsive .crm-card-table>tbody{display:block;width:100%;min-width:0;max-width:100%}
  .crm-responsive .crm-card-table>thead{display:none}
  .crm-responsive .crm-card-table>tbody{display:grid;gap:12px}
  .crm-responsive .crm-card-table>tbody>tr{display:flex;flex-direction:column;gap:0;background:#fff;border:1px solid #d6e1e8;border-radius:10px;padding:12px;min-width:0;overflow-wrap:anywhere}
  .crm-responsive .crm-card-table>tbody>tr>td{display:block;order:2;padding:7px 0;border:0;white-space:normal;min-width:0;max-width:100%;width:auto;text-align:left}
  .crm-responsive .crm-card-table td[data-crm-label]:not(.crm-cell-title):not(.crm-cell-actions)::before{content:attr(data-crm-label);display:block;font-size:12px;line-height:1.4;color:#607887;font-weight:500;margin-bottom:3px}
  .crm-responsive .crm-card-table>tbody>tr>td.crm-cell-title{order:0;font-size:15px;font-weight:650;padding-top:0}
  .crm-responsive .crm-card-table>tbody>tr>td.crm-cell-actions{order:1;display:flex;gap:8px;flex-wrap:wrap;border-bottom:1px solid #e5ebef;padding:5px 0 10px;margin-bottom:4px}
  .crm-responsive .crm-cell-actions button,.crm-responsive .crm-cell-actions a{flex:1 1 100px;min-height:44px}
  .crm-responsive .crm-card-table td button{min-height:44px;font-size:13px}
  .crm-responsive .crm-card-table td small{white-space:normal;max-width:100%}
  .crm-responsive .crm-scroll-region{max-width:100%;min-width:0;overflow:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;scrollbar-width:thin}
  .crm-responsive .crm-scroll-region::before{content:'↔ Прокрутите таблицу влево / вправо';display:block;position:sticky;left:0;width:100%;font-size:11px;font-weight:500;color:#607887;padding:7px;background:#f2f6f9}
  .crm-responsive .attendance-table th:first-child,.crm-responsive .attendance-table td:first-child{min-width:124px;max-width:140px;width:140px;font-size:12px;white-space:normal;box-shadow:3px 0 5px #17384410}
  .crm-responsive .attendance-table .attendance-cell{min-height:44px;width:66px;font-size:16px}
  .crm-responsive .attendance-table td,.crm-responsive .attendance-table th{padding:8px 6px}
  .crm-responsive .pay-mobile-menu{display:none}
  .crm-responsive .pay-subtabs,.crm-responsive .pay-mobile-nav{flex-wrap:nowrap;overflow-x:auto;gap:6px;padding:4px 0 8px;margin:0;max-width:100%;scrollbar-width:thin}
  .crm-responsive .pay-subtabs button{flex:0 0 auto;white-space:nowrap;font-size:13px}
  .crm-responsive .pay-heading{align-items:stretch;flex-wrap:wrap}
  .crm-responsive .pay-heading>div{min-width:0}
  .crm-responsive .financefilters{gap:10px}
  .crm-responsive .financefilters label{flex:1 1 130px;min-width:0}
  .crm-responsive .financefilters input,.crm-responsive .financefilters select{min-width:0}
  .crm-responsive .financefilters button{flex:1 1 100%}
  .crm-responsive .financeselected>strong{font-size:24px;white-space:normal}
  .crm-responsive .financepeople>div{max-width:100%;min-width:0}
  .crm-responsive .mangal-catalog,.crm-responsive .reward-settings-grid{grid-template-columns:minmax(0,1fr)}
  .crm-responsive .mangal-catalog article{padding:14px}
  .crm-responsive .vacation-calendar{grid-template-columns:repeat(7,minmax(100px,1fr));min-width:700px}
  .crm-responsive .vacation-filters label{min-width:0!important;width:100%;margin:0}
  .crm-responsive .vacation-day button{min-height:44px;font-size:12px}
  .crm-responsive .vacation-balances>div{min-width:0;flex:1 1 110px}
  .crm-responsive .reward-shop{gap:8px}

  /* Forms remain in the viewport, with large close/save controls. */
  .crm-responsive dialog{width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100dvh - 24px);margin:auto;padding:16px;border-radius:14px;overflow:auto;overscroll-behavior:contain}
  .crm-responsive dialog .modalhead,.crm-responsive dialog .head{display:flex;align-items:flex-start;flex-wrap:nowrap;gap:10px}
  .crm-responsive dialog h2{font-size:20px;flex:1;min-width:0;margin:4px 0 12px}
  .crm-responsive dialog [aria-label="Закрыть"],.crm-responsive dialog #closeProduction,.crm-responsive dialog #close{flex:0 0 44px;width:44px;height:44px;padding:8px;font-size:22px}
  .crm-responsive dialog form>button[type=submit],.crm-responsive dialog form>.wide,.crm-responsive dialog form>#save{width:100%;min-height:48px;margin-top:16px}
  .crm-responsive dialog .formgrid,.crm-responsive dialog .pay-form-grid,.crm-responsive dialog .offcut-form-grid{grid-template-columns:minmax(0,1fr);gap:7px}
  .crm-responsive dialog .formgrid label,.crm-responsive dialog .formgrid input{grid-row:auto;grid-column:auto}
  .crm-responsive dialog .formgrid label{margin-top:10px}
  .crm-responsive dialog .checkboxrow{display:flex;flex-direction:column;gap:4px}
  .crm-responsive dialog .checkboxrow label{display:flex;align-items:center;gap:10px;min-height:44px;margin:0}
  .crm-responsive dialog .checkboxrow input{width:22px;min-height:22px}
  .crm-responsive dialog pre,.crm-responsive dialog code{white-space:pre-wrap;overflow-wrap:anywhere}
  .crm-responsive .toast{right:12px;left:12px;bottom:max(12px,env(safe-area-inset-bottom));max-width:none}

  /* Separate CRM pages use the same spacing and touch targets. */
  .crm-responsive body:not(.crm-main-layout)>header:not(.sheet-header){display:flex;flex-wrap:wrap;gap:8px;padding:10px 12px;align-items:center}
  .crm-responsive body:not(.crm-main-layout)>header>a{min-height:44px;display:inline-flex;align-items:center}
  .crm-responsive body:not(.crm-main-layout)>header h1{font-size:18px;flex:1 1 180px}
  .crm-responsive body:not(.crm-main-layout)>main{padding:12px;width:100%;min-width:0}
  .crm-responsive body:not(.crm-main-layout)>header #person{font-size:12px;overflow-wrap:anywhere}
  .crm-responsive .offcut-grid,.crm-responsive .consume-list{grid-template-columns:minmax(0,1fr)}
  .crm-page-metal #tabs,.crm-page-metal-offcuts #tabs,.crm-page-planning-board #sections{display:flex;flex-wrap:nowrap;overflow-x:auto;max-width:100%;gap:6px;margin:10px 0;scrollbar-width:thin}
  .crm-page-metal #tabs>*,.crm-page-metal-offcuts #tabs>*,.crm-page-planning-board #sections>*{flex:0 0 auto;white-space:nowrap;min-height:44px;font-size:13px}
  .crm-page-metal #tools{display:flex;gap:8px;flex-wrap:wrap;max-width:100%}
  .crm-page-metal #tools>button{flex:1 1 130px;font-size:13px}
  .crm-page-metal .head .actions{width:100%;display:flex}
  .crm-page-metal .metal-cards tr{gap:10px;padding:12px}
  .crm-page-metal .metal-cards .metal-actions{grid-column:1/-1;justify-self:stretch;display:flex;gap:8px;flex-wrap:wrap}
  .crm-page-metal .metal-actions button{flex:1 1 100px;min-height:44px;font-size:13px}
  .crm-page-metal .price td button{min-height:44px;padding:8px 5px;font-size:14px}
  .crm-page-metal .price td{padding:4px 6px}
  .crm-page-metal .price th:first-child{position:sticky;left:0;z-index:1;background:#edf3f6}
  .crm-page-metal .price td:first-of-type{position:sticky;left:0;z-index:1;min-width:125px;max-width:150px;background:var(--material-tint,#f4f7f9);box-shadow:3px 0 5px #17384412}
  .crm-page-metal .price-bending td:first-of-type{min-width:0;max-width:none;position:static}
  .crm-page-metal .stats,.crm-page-metal-offcuts .stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .crm-page-metal .stat,.crm-page-metal-offcuts .stat{padding:10px 7px;min-width:0;display:flex;flex-direction:column;align-items:flex-start;font-size:11px}
  .crm-page-metal-offcuts .offcut-last-number{grid-column:1/-1}
  .crm-page-planning-board .board,.crm-page-planning-board .board.limited-board{grid-template-columns:minmax(0,1fr)}
  .crm-page-planning-board .section{padding:0 10px 10px;overflow:visible}
  .crm-page-planning-board .section h2{margin:0 -10px;padding:12px;font-size:16px}
  .crm-page-planning-board .section .crm-card-table>tbody>tr{margin-top:10px;font-size:14px}
  .crm-page-planning-board .section .crm-card-table td input[type=checkbox]{width:24px;height:24px}
  .crm-page-planning-board .section .crm-card-table td button{width:100%;font-size:13px;margin:6px 0}
  .crm-page-planning-board .section .priority-cell select{width:100%;font-size:16px}
  .crm-page-planning-board .material-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr);padding:12px 0;border-bottom:1px solid #d6e1e8}
  .crm-page-planning-board .material-row>*{min-width:0;max-width:100%}
  .crm-page-planning-operations-print .tools,.crm-page-cutting-print .tools,.crm-page-bending-payments .tools{flex-wrap:wrap;gap:8px;padding:10px 12px}
  .crm-page-planning-operations-print .tools>a,.crm-page-cutting-print .tools>a,.crm-page-bending-payments .tools>a{display:inline-flex;align-items:center;min-height:44px}
  .crm-page-cutting-print main{min-width:0;width:100%;padding:12px}
  .crm-page-bending-payments .filters,.crm-page-bending-payments .period-nav{flex-wrap:wrap;gap:8px}
  .crm-page-bending-payments .filters>*{min-width:0;max-width:100%}
  .crm-page-cutting-control #search,.crm-page-file-control #search,.crm-page-voice-robot .history-search{display:flex;flex-wrap:wrap;gap:8px}
  .crm-page-cutting-control #search input,.crm-page-file-control #search input,.crm-page-voice-robot .history-search input{flex:1 1 180px;width:100%}
  .crm-page-cutting-control .heading,.crm-page-file-control .heading,.crm-page-voice-robot .heading{align-items:flex-start}
  .crm-page-cutting-preview .controls{display:flex;flex-wrap:wrap;gap:10px}
  .crm-page-cutting-preview .controls>label{width:100%;min-width:0}
  .crm-page-cutting-preview .viewerbar{display:flex;flex-wrap:wrap;gap:8px}
  .crm-page-cutting-drawing-check .compare-grid{grid-template-columns:minmax(0,1fr);gap:12px}
  .crm-page-marketplace-stocks .fields,.crm-page-ozon-archive .fields{grid-template-columns:minmax(0,1fr)}
  .crm-page-marketplace-stocks .files{grid-template-columns:minmax(0,1fr)}
  .crm-page-marketplace-stocks .scheduleTop,.crm-page-ozon-archive .scheduleTop{flex-wrap:wrap;align-items:flex-start;gap:10px}
  .crm-page-marketplace-stocks .scheduleDays label,.crm-page-ozon-archive .scheduleDays label{min-height:44px}
  .crm-page-marketplace-stocks .controls,.crm-page-ozon-archive .controls{display:flex;gap:8px;flex-wrap:wrap}
  .crm-page-marketplace-stocks .controls>button,.crm-page-ozon-archive .controls>button{flex:1 1 140px}
  .crm-page-onec-workspace header{min-height:60px}
  .crm-page-onec-workspace #onec{height:calc(100dvh - 150px);width:100%;min-width:0}

  /* Conversations switch between the list and the active dialog on phones. */
  .crm-responsive .crm-chat-layout{display:block;height:auto;min-height:0;scroll-margin-top:10px}
  .crm-responsive .crm-chat-layout>aside{max-height:none;overflow:visible;border:0}
  .crm-responsive .crm-chat-layout:not(.crm-chat-open)>.conversation{display:none}
  .crm-responsive .crm-chat-layout.crm-chat-open>aside{display:none}
  .crm-responsive .crm-chat-layout.crm-chat-open>.conversation{display:flex;height:calc(100dvh - 30px);min-height:350px;max-height:850px}
  .crm-responsive .crm-chat-back{display:block;text-align:left;background:#edf4f7;color:#234452;border:0;border-bottom:1px solid #d7e3e9;border-radius:8px 8px 0 0;flex-shrink:0;min-height:48px}
  .crm-responsive .crm-chat-layout #messages{height:auto;flex:1;min-height:80px;padding:12px;overflow:auto}
  .crm-responsive .crm-chat-layout #compose{padding:10px 10px max(10px,env(safe-area-inset-bottom));flex-shrink:0;gap:8px}
  .crm-responsive .crm-chat-layout #compose textarea{min-height:70px;max-height:25dvh}
  .crm-responsive .crm-chat-layout #compose button{min-height:44px;font-size:14px}
  .crm-responsive .messenger{height:calc(100dvh - 100px);min-height:440px;max-height:850px;scroll-margin-top:68px}
  .crm-responsive .messenger .chat-header{padding:10px;gap:8px}
  .crm-responsive .messenger .chat-header h3{font-size:15px}
  .crm-responsive .messenger .chat-header button{min-height:44px;font-size:12px;padding:8px}
  .crm-responsive .messenger .chat-composer{padding:10px}
  .crm-responsive .messenger .teammessages{padding:12px}
  .crm-responsive .chatfiles input{width:100%;max-width:100%}
  .crm-responsive .composer-tools{gap:8px;flex-wrap:wrap}
  .crm-responsive .composer-tools>small{display:none}
}
@media print{
  .crm-menu-toggle,.crm-chat-back,.crm-fold>summary{display:none!important}
}

@media screen and (max-width:720px){
 .crm-main-layout .connection-alert{display:grid;grid-template-columns:18px minmax(0,1fr) 76px;gap:6px;align-items:center;padding:8px;margin:4px 0 8px}
 .crm-main-layout .connection-warning-list{min-width:0;display:block}
 .crm-main-layout .connection-warning summary{font-size:11px;line-height:1.4;min-height:44px;align-content:center}
 .crm-main-layout .connection-alert>button{margin:0;min-height:44px;padding:6px;font-size:11px;white-space:normal}
 .crm-responsive .crm-card-table>tfoot,.crm-responsive .crm-card-table>tfoot>tr{display:block;width:100%}
 .crm-responsive .crm-card-table>tfoot>tr>*{display:block;width:100%;padding:10px;white-space:normal}
 .crm-responsive .crm-card-table .priority-cell{max-width:none}
 .crm-page-ozon-archive .metric{min-width:0;flex:1 1 120px}
 .crm-page-marketplace-stocks main,.crm-page-ozon-archive main{margin-top:12px}
}

@media screen and (max-width:720px){
 .crm-responsive .payroll .pay-week{grid-template-columns:44px minmax(0,1fr) 76px}
 .crm-responsive .payroll .pay-week>button:last-child{font-size:11px;padding:6px 3px;overflow-wrap:normal}
 .crm-responsive [aria-label="Финансовые отчёты"]{scroll-margin-top:8px}
}

@media screen and (max-width:720px){
 .crm-responsive .messenger{grid-template-columns:minmax(0,1fr)}
 .crm-responsive .chat-sidebar,.crm-responsive .chat-list{min-width:0;max-width:100%}
 .crm-responsive .chat-sidebar-head{min-width:0}
 .crm-responsive .pay-mobile-name .pay-reorder button{min-height:44px;min-width:44px;padding:8px}
 .crm-responsive .mangal-stock>.stagefilterhead{display:flex;gap:8px}
 .crm-responsive .mangal-stock>.stagefilterhead>h3{width:100%;font-size:18px}
 .crm-responsive .mangal-stock>.stagefilterhead>button{width:100%;min-height:44px}
 .crm-responsive .mangal-stock>.stagefilterhead>a{display:inline-flex;align-items:center;min-height:44px}
}

@media screen and (max-width:720px){
 html.crm-responsive:not(:has(.crm-main-layout)){scroll-padding-top:0}
 .crm-responsive .messenger{scroll-margin-top:8px}
 .crm-page-metal #tools>label{flex:1 1 100%;white-space:nowrap;overflow-wrap:normal;min-width:0}
 .crm-page-metal #tools>label>select{flex:1;min-width:0;width:0}
 .crm-responsive.crm-print-page body{padding:12px}
 .crm-responsive.crm-print-page .tools,.crm-responsive .operation-print-tools{padding:12px;margin-bottom:16px}
 .crm-responsive.crm-print-page .tools>div{display:flex;flex-wrap:wrap;gap:8px}
 .crm-responsive.crm-print-page .tools button{flex:1 1 120px;margin:0}
 .crm-responsive.crm-print-page .header-line{flex-wrap:wrap;gap:8px}
 .crm-responsive.crm-print-page .header-line .invoice{text-align:left;white-space:normal;width:100%}
 .crm-responsive.crm-print-page .part-row{gap:10px;min-width:0}
 .crm-responsive.crm-print-page .files{font-size:12px}
 .crm-responsive.crm-print-page .files a{display:inline-flex;align-items:center;min-height:44px}
}

@media screen and (max-width:720px){
 .crm-page-customer-chat #conversationHead{flex-wrap:wrap;gap:8px;padding:12px}
 .crm-page-customer-chat #conversationHead>p{flex:1 1 100%;margin:0}
 .crm-page-customer-chat #conversationHead>button{flex:1 1 100px}
 .crm-page-customer-chat .crm-chat-layout #compose{display:flex;flex-wrap:wrap}
 .crm-page-customer-chat #compose>textarea{flex:1 1 100%;width:100%;min-height:66px}
 .crm-page-customer-chat #compose>#send{flex:1 1 100%;width:100%;min-height:44px}
 .crm-mobile-loading{padding:20px;color:#607887;font:14px system-ui}
 .crm-responsive .pay-sync>button{width:100%}
}
@media screen and (max-width:720px){
 .crm-responsive .content .compactorder button,.crm-responsive .content .compactorder .helpcopy{min-height:44px}
 .crm-responsive dialog .modalhead,.crm-responsive dialog form>.head{position:sticky;top:-16px;z-index:3;background:#fff;padding:10px 0;border-bottom:1px solid #e4ebef}
 .crm-responsive .pbxincoming{left:8px;right:8px;bottom:max(8px,env(safe-area-inset-bottom));width:auto;max-width:none;padding:14px}
}
@media screen and (max-width:720px){
 html.crm-responsive:has(.crm-main-layout){scroll-padding-top:0}
 .crm-responsive [aria-label="Финансовые отчёты"]{scroll-margin-top:0}
 .crm-responsive .pay-subtabs,.crm-responsive .pay-mobile-nav{padding-bottom:4px;scrollbar-width:none}
 .crm-responsive .pay-subtabs::-webkit-scrollbar,.crm-responsive .pay-mobile-nav::-webkit-scrollbar{display:none}
}
@media screen and (max-width:720px){
 .crm-responsive .pay-mobile-salary .pay-mobile-actions button{flex:1 1 80px;min-width:0}
}

/* Personal interface size; browser pinch zoom remains available. */
.crm-order-brief{display:none}
.crm-order-expanded:empty{display:none}
.crm-scale{display:flex;align-items:center;gap:0;flex:0 0 auto;position:relative;border:1px solid #b7c8d2;border-radius:8px;background:#fff;color:#183947}
.crm-responsive .crm-scale>button[data-crm-scale]{width:38px;min-width:0;min-height:40px;padding:6px 4px;border:0;border-radius:7px;background:transparent;color:inherit;font:700 20px/1.1 system-ui;cursor:pointer}
.crm-responsive .crm-scale>button[data-crm-scale="reset"]{width:48px;font-size:12px;font-weight:650}
.crm-scale>button:disabled{opacity:.35;cursor:default}
.crm-scale>button:hover:not(:disabled){background:#e1edf3}
.crm-scale-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.crm-responsive .crm-scale-retry:not([hidden]){position:absolute;right:0;top:calc(100% + 4px);min-width:160px;z-index:25;background:#fff1e0;color:#83490b;border:1px solid #ddac67;font-size:12px}
.crm-scale-standalone{margin:8px 12px;width:max-content}
.crm-responsive .top>.crm-scale{background:#294552;color:white;border-color:#59717d}
.crm-responsive .top>.crm-scale>button:hover:not(:disabled){background:#3a5b6a}
@media screen{
  html.crm-responsive{--crm-ui-zoom:1}
  html.crm-responsive.crm-zoom-70{--crm-ui-zoom:.7;zoom:.7}
  html.crm-responsive.crm-zoom-80{--crm-ui-zoom:.8;zoom:.8}
  html.crm-responsive.crm-zoom-90{--crm-ui-zoom:.9;zoom:.9}
  html.crm-responsive.crm-zoom-100{--crm-ui-zoom:1;zoom:1}
  html.crm-responsive.crm-zoom-110{--crm-ui-zoom:1.1;zoom:1.1}
  html.crm-responsive.crm-zoom-120{--crm-ui-zoom:1.2;zoom:1.2}
  html.crm-responsive.crm-zoom-130{--crm-ui-zoom:1.3;zoom:1.3}
  html.crm-responsive.crm-zoom-140{--crm-ui-zoom:1.4;zoom:1.4}
  html.crm-responsive.crm-zoom-150{--crm-ui-zoom:1.5;zoom:1.5}
  html.crm-responsive dialog{max-height:calc(100dvh / var(--crm-ui-zoom) - 24px);max-width:calc(100vw / var(--crm-ui-zoom) - 16px)}
}
@media screen and (max-width:720px){
  .crm-main-layout .top{gap:6px;min-height:56px;padding:6px 8px}
  .crm-main-layout .top>.brand{flex:1 1 90px;min-width:80px;font-size:10px;line-height:1.35;letter-spacing:.3px}
  .crm-main-layout .crm-menu-toggle{font-size:12px;padding:7px 8px;min-height:40px}
  .crm-main-layout .ordergrid{gap:6px}
  .crm-main-layout .compactorder.crm-order-compact{padding:0 10px;gap:0;border-radius:8px}
  .crm-main-layout .crm-order-compact>.rowtools{display:block;margin:0}
  .crm-main-layout .crm-order-compact .orderdetails{padding:0}
  .crm-main-layout .crm-order-compact .orderdetails>summary{list-style:none;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px;min-height:0;padding:9px 0 6px;color:#233d4d}
  .crm-main-layout .crm-order-compact .orderdetails>summary::-webkit-details-marker{display:none}
  .crm-main-layout .crm-order-compact .crm-order-brief{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:5px 8px;width:100%;grid-column:1/-1;font-size:12px;line-height:1.3}
  .crm-order-number{font-size:14px;font-weight:750;white-space:nowrap}
  .crm-order-customer{font-size:13px;font-weight:650;min-width:0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}
  .crm-order-status{display:flex;align-items:baseline;gap:8px;grid-column:1/-1;grid-row:2;min-width:0;min-height:16px}
  .crm-order-stage{flex:1;min-width:0;font-size:11px;line-height:1.3;font-weight:700;color:#275b84;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .crm-order-stage::before{content:'Этап: ';font-weight:400}
  [data-order-stage="ready"] .crm-order-stage,[data-order-stage="finished"] .crm-order-stage{color:#26704e}
  [data-order-stage="review"] .crm-order-stage,[data-order-stage="payment"] .crm-order-stage{color:#975019}
  .crm-order-total{flex:none;font-size:12px;font-weight:700;white-space:nowrap}
  .crm-order-flags{grid-column:1/-1;font-size:10px;color:#975019;font-weight:650}
  .crm-main-layout .crm-order-compact .crm-order-detail-label{grid-column:2;grid-row:2;justify-self:end;font-size:11px;line-height:1.3;color:#1657ba;font-weight:600;white-space:nowrap}
  .crm-order-compact .crm-order-detail-label::before{content:'▸ ';font-size:10px}
  .crm-order-compact .orderdetails[open]>summary .crm-order-detail-label::before{content:'▾ '}
  .crm-order-compact .orderdetails[open]>.crm-order-expanded{display:flex;flex-direction:column;gap:10px;border-top:1px solid #dce5eb;padding:12px 0}
  .crm-main-layout .crm-order-expanded .ordertitle{gap:8px;min-width:0}
  .crm-main-layout .crm-order-expanded .orderhead{flex-wrap:wrap}
  .crm-main-layout .crm-order-expanded .orderhead .ordertitle h3{display:block;-webkit-line-clamp:unset;font-size:15px}
  .crm-main-layout .crm-order-expanded .rowwarning{font-size:12px;line-height:1.4}
  .crm-main-layout .crm-order-compact [data-order-detail-body]:not(:empty){padding:10px 0;border-top:1px solid #dce5eb}
  .crm-responsive dialog{width:calc(100vw / var(--crm-ui-zoom) - 16px)}
  .crm-responsive .crm-chat-layout.crm-chat-open>.conversation{height:calc(100dvh / var(--crm-ui-zoom) - 30px);min-height:min(350px,calc(100dvh / var(--crm-ui-zoom) - 30px))}
  .crm-responsive .messenger{height:calc(100dvh / var(--crm-ui-zoom) - 100px);min-height:min(440px,calc(100dvh / var(--crm-ui-zoom) - 100px))}
  .crm-page-onec-workspace #onec{height:calc(100dvh / var(--crm-ui-zoom) - 150px)}
}
@media print{html.crm-responsive{zoom:1!important}.crm-scale,.crm-order-brief{display:none!important}}

.crm-order-collapse{display:none}
@media screen and (max-width:720px){.crm-order-compact .orderdetails[open]>.crm-order-collapse{display:block;width:100%;margin:12px 0;min-height:44px}.crm-order-compact .orderdetails>summary{scroll-margin-top:8px}}

/* One mobile header row; appearance controls remain inside the open menu. */
@media screen and (max-width:720px){
  .crm-main-layout .top{
    display:grid;grid-template-columns:minmax(0,1fr) max-content;
    gap:0 8px;padding:4px 12px;min-height:52px;align-items:center;
  }
  .crm-main-layout .top>.brand{
    grid-column:1;grid-row:1;min-width:0;max-width:100%;
    font-size:13px;line-height:1.2;letter-spacing:.4px;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  }
  .crm-main-layout .top>.brand small{display:none}
  .crm-main-layout .top>.crm-menu-toggle{
    grid-column:2;grid-row:1;justify-self:end;margin:0;
    min-height:44px;padding:8px 10px;font-size:13px;white-space:nowrap;
  }
  .crm-main-layout:not(.crm-menu-open) .top>.crm-scale,
  .crm-main-layout:not(.crm-menu-open) .top>.crm-theme-control{display:none}
  .crm-main-layout .top>.crm-scale{
    grid-column:1/-1;grid-row:2;justify-self:start;margin:8px 0;
  }
  .crm-main-layout .top>.crm-theme-control{
    grid-column:1/-1;grid-row:3;justify-self:start;margin:0 0 10px;
  }
  .crm-main-layout .top>.identity{
    grid-column:1/-1;grid-row:4;min-width:0;max-width:100%;
  }
}

/* Keep the expanded phone header compact; allow wrapping at large text sizes. */
@media screen and (max-width:720px){
  .crm-main-layout.crm-menu-open .top{
    display:flex;flex-wrap:wrap;justify-content:flex-start;gap:4px 8px;
  }
  .crm-main-layout.crm-menu-open .top>.brand{
    order:0;flex:1 1 calc(100% - 132px);
  }
  .crm-main-layout.crm-menu-open .top>.crm-menu-toggle{
    order:1;flex:0 0 auto;
  }
  .crm-main-layout.crm-menu-open .top>.crm-scale{
    order:2;flex:0 0 auto;margin:0;max-width:100%;
  }
  .crm-main-layout.crm-menu-open .crm-scale>button[data-crm-scale]{width:34px;min-height:44px;white-space:nowrap}
  .crm-main-layout.crm-menu-open .crm-scale>button[data-crm-scale="reset"]{width:46px}
  .crm-main-layout.crm-menu-open .top>.crm-theme-control{
    order:3;flex:0 0 auto;gap:5px;margin:0;max-width:100%;font-size:12px;
  }
  .crm-main-layout.crm-menu-open .crm-theme-control select{
    width:132px;max-width:100%;min-height:44px;font-size:12px;
  }
  .crm-main-layout.crm-menu-open .top>.identity{
    order:4;flex:1 1 100%;justify-content:flex-start;gap:0 8px;
    padding:4px 0 0;margin:0;text-align:left;
  }
  .crm-main-layout.crm-menu-open .identity>.staff-identity{
    order:0;flex:1 1 calc(100% - 64px);min-width:0;gap:6px;
  }
  .crm-main-layout.crm-menu-open .identity>.reward-header{
    order:1;flex:0 0 auto;min-height:44px;padding:6px 10px;border-radius:8px;
  }
  .crm-main-layout.crm-menu-open .identity>.logout{
    order:2;flex:0 0 auto;min-height:44px;padding:4px 6px;font-size:12px;
  }
}

/* Dates use the existing Details line; no extra row in either department. */
.ordercreated-main{display:none}
.crm-order-created{display:none}
@media screen and (max-width:720px){
  .crm-main-layout .crm-order-compact .crm-order-created{display:block;grid-column:1;grid-row:2;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;line-height:1.3;color:inherit;opacity:.8}
  .crm-order-created time{white-space:nowrap}
}

.crm-order-stage-short{display:none}
@media screen and (max-width:720px){
  :is(.crm-zoom-120,.crm-zoom-130,.crm-zoom-140,.crm-zoom-150) .crm-order-stage::before{content:none}
  :is(.crm-zoom-120,.crm-zoom-130,.crm-zoom-140,.crm-zoom-150) .crm-order-stage-full,
  :is(.crm-zoom-120,.crm-zoom-130,.crm-zoom-140,.crm-zoom-150) .crm-order-date-prefix{display:none}
  :is(.crm-zoom-120,.crm-zoom-130,.crm-zoom-140,.crm-zoom-150) .crm-order-stage-short{display:inline}
}
