/* Phone layouts: same records and actions, without desktop-sized tables. */
.mobile-select-all-label,:root .sidebar .mobile-nav-close,#mobile-nav-backdrop{display:none}
@media(max-width:900px){
 :root .sidebar{z-index:91;height:100dvh;height:var(--mobile-vh,100dvh);overflow-y:auto;padding-top:64px;padding-bottom:max(16px,env(safe-area-inset-bottom))}
 :root .sidebar .mobile-nav-close{display:inline-flex;position:absolute;right:12px;top:12px;width:44px;height:44px;padding:0;background:#ffffff12;color:#fff;border:1px solid #ffffff40}
 #mobile-nav-backdrop:not([hidden]){display:block;position:fixed;inset:0;z-index:90;border:0;background:var(--overlay)}
}
@media(max-width:760px){
 :root,:root[data-density=compact]{--ui-control:44px;--ui-form-control:44px}
 :root .page{padding:16px 12px 24px;min-width:0}
 :root .topbar{padding:0 12px;gap:8px;min-height:60px}
 :root .topbar .topright{gap:6px}
 :root .topbar .profile{padding-left:0;border:0}
 :root .topbar .profile-name{display:none}
 :root :is(.btn,.btn.small,.icon-btn,.task-filter-reset,.task-more-filters,.project-task-count,.filter-select-trigger){min-height:44px}
 :root .icon-btn{min-width:44px;padding:0}
 :root :is(.segmented,.task-view-tabs) button{min-height:44px;padding:8px 12px}
 :root :is(.head-actions,.modal-footer,.project-list-actions,.dl-bulk,.dl-pagination){gap:8px;flex-wrap:wrap}
 :root :is(.head-actions,.dl-bulk) .btn{white-space:normal;overflow-wrap:anywhere}
 :root :is(.task-focus-tabs,.dash-tabs,.chat-filter-tabs) button{min-height:44px}
 :root :is(.ui-more-filters>summary,.profile-animal-options>summary,.pf-transfer-targets>summary){min-height:44px;align-content:center}
 :root :is(.ui-filter-chip,.ui-density-options button){min-height:40px}
 :root :is(.task-search,.search,.mail-work-search){min-width:0}
 :root :is(input:not([type=checkbox],[type=radio],[type=file],[type=color],[type=hidden]),textarea,select,[contenteditable=true],.filter-select-search){font-size:var(--fs-lg)!important}
 :root :is(.portal-filter-grid,.task-work-v2 .task-filter-grid,.task-extra-filters,.deal-list-filters){grid-template-columns:minmax(0,1fr)}
 :root :is(.portal-filter-footer,.task-filter-footer){flex-wrap:wrap;align-items:center}
 :root .filter-select-popup .filter-select-option{min-height:48px;font-size:var(--fs-md)}
 :root .filter-select-popup{overscroll-behavior:contain}
 :root input[type=checkbox]{width:22px!important;height:22px!important;min-width:22px;flex:none}
 :root :is(.checkbox-choice,.mail-select-all){min-height:44px;align-items:center}
 :root .modal-overlay{top:var(--mobile-top,0px);bottom:auto;height:var(--mobile-vh,100dvh)}
 :root #modal-root .modal{width:100%!important;max-width:100%!important;min-width:0}
 :root #modal-root .modal-head{padding:8px 12px;min-height:60px;flex-shrink:0}
 :root #modal-root .modal-head h2{font-size:var(--fs-lg);overflow-wrap:anywhere}
 :root #modal-root .modal-body{padding:14px 12px;min-height:0;overscroll-behavior:contain}
 :root #modal-root .modal-footer{padding:8px 12px max(8px,env(safe-area-inset-bottom));flex-shrink:0}
 :root #modal-root .modal-footer .btn{min-height:44px;padding:9px 12px}
 :root #modal-root .tc-help{display:none}
 :root #modal-root .tc-edit{min-height:44px}
 :root #modal-root :is(.tc-inline-form,.form-grid,.co-pair){min-width:0}
 :root :is(.cc-actions,.client-company-actions,.mc-files-head){flex-wrap:wrap}
 :root :is(.cc-actions,.client-company-actions) .btn{min-height:44px}
 :root :is(.table-wrap,.project-list,.dl-table-scroll,.task-plan-list):has(.mobile-record-table){overflow:visible;max-height:none;min-width:0}
 :root table.mobile-record-table{display:block;width:100%;min-width:0;table-layout:auto;border:0}
 :root table.mobile-record-table>tbody{display:grid;gap:12px;padding:10px;background:var(--surface-2)}
 :root table.mobile-record-table>thead{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%)}
 :root table.mobile-record-table.mobile-selectable-table>thead{position:static;width:auto;height:auto;clip-path:none;display:block;border-bottom:1px solid var(--line)}
 :root .mobile-selectable-table>thead>tr{display:block}
 :root .mobile-selectable-table>thead th{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 :root .mobile-selectable-table>thead th:first-child{position:static;display:flex;align-items:center;gap:12px;width:auto;height:auto;clip-path:none;padding:10px 14px;min-height:44px}
 .mobile-select-all-label{display:inline;font-size:var(--fs-sm);color:var(--ink)}
 :root table.mobile-record-table>tbody>tr{display:grid;grid-template-columns:minmax(0,1fr);border:1px solid var(--line);border-radius:var(--r-md);padding:10px 12px;background:var(--surface)}
 :root table.mobile-record-table>tbody>tr:is(.is-selected,:has(input:checked)){background:var(--blue-soft)}
 :root table.mobile-record-table>tbody>tr>td{position:static;left:auto;display:block;width:auto;min-width:0;max-width:100%;padding:7px 0;border:0;box-shadow:none;background:transparent;font-size:var(--fs-md);white-space:normal;overflow-wrap:anywhere}
 :root table.mobile-record-table>tbody>tr>td::before{content:attr(data-mobile-label);display:block;font-size:var(--fs-xs);font-weight:500;line-height:1.4;color:var(--muted);margin-bottom:5px}
 :root table.mobile-record-table>tbody>tr>td.mobile-record-title::before,:root table.mobile-record-table td[colspan]::before{display:none}
 :root table.mobile-record-table>tbody>tr>td.mobile-record-title{order:-2;border-bottom:1px solid var(--line);padding:4px 0 12px;margin-bottom:4px}
 :root table.mobile-record-table>tbody>tr>td.mobile-record-check{order:-3;display:flex;align-items:center;justify-content:flex-end;gap:12px;min-height:44px;padding:0 0 4px}
 :root table.mobile-record-table td.mobile-record-check::before{margin:0}
 :root table.mobile-record-table :is(.dl-title,.project-list-title,.task-title-link){font-size:var(--fs-md);min-height:44px;width:100%}
 :root table.mobile-record-table .filter-select-trigger{width:100%;min-height:44px;font-size:var(--fs-md)}
 :root[data-theme] .dl-stage .filter-select-trigger{min-height:44px;font-size:var(--fs-md)}
 :root .dl-pagination>div{flex-wrap:wrap;justify-content:center;width:100%}
 :root .dl-pagination>div>span{order:-1;width:100%;text-align:center}
 :root .dl-bulk>strong{flex-basis:100%}
 :root .dl-bulk .btn{flex:1 1 120px;margin:0}
 :root .dl-summary .btn{width:100%}
 :root .sales-kanban{grid-auto-columns:minmax(250px,calc(100vw - 48px));scroll-snap-type:x proximity}
 :root :is(.sales-column,.task-plan-column){scroll-snap-align:start}
 :root .dp-actions .dp-action{min-width:40px;min-height:44px;height:auto}
 :root .task-card-actions .task-open-btn{width:44px;height:44px}
 :root .task-card-actions .filter-select-trigger{min-height:44px}
 :root .mail-workspace{height:auto;min-height:0;overflow:visible}
 :root .mail-work-content{padding:12px 0 0;overflow:visible}
 :root .mail-work-folders{padding:0 0 12px}
 :root .mail-work-folders nav{display:flex;flex-wrap:wrap;gap:6px}
 :root .mail-work-folders nav button{flex:1 1 85px;min-width:0;min-height:44px;white-space:normal;font-size:var(--fs-xs)}
 :root .mail-work-summary{flex-wrap:wrap;gap:6px 12px}
 :root .mail-work-summary button{min-height:44px}
 :root :is(.mail-inbox-list,.mail-open-scroll){max-height:none;overflow:visible}
 :root .mail-inbox-row{flex-wrap:wrap;padding:12px;gap:8px}
 :root .mail-row-open{grid-template-columns:26px minmax(0,1fr) 42px}
 :root .mail-row-actions{flex-direction:row;flex-basis:100%;justify-content:flex-end}
 :root .mail-row-actions button{min-height:44px;min-width:44px;font-size:var(--fs-xs)}
 :root .mail-row-actions .mail-task-chip span{display:inline}
 :root .mail-sender-name,:root .mail-row-message strong{font-size:var(--fs-md)}
 :root .mail-row-message strong{white-space:normal;overflow-wrap:anywhere}
 :root .drive-row-menu[open]>div{position:static;min-width:0;width:100%;box-sizing:border-box;margin-top:8px;box-shadow:none}
 :root .drive-row-menu>summary{min-height:44px;align-content:center}
 :root .drive-row-menu[open]{flex-basis:100%;width:100%}
 :root .pf-file-actions{flex-wrap:wrap;min-width:0}
 :root :is(.pf-file-name,.pf-folder-open span,.category-name,.trash-name){min-width:0;overflow-wrap:anywhere}
 :root :is(.pf-selection-bar,.category-selection,.trash-selection){flex-wrap:wrap}
 :root .ui-appearance-panel{box-sizing:border-box}
}
/* Conversation navigation switches at tablet portrait widths as well. */
@media(max-width:900px){
 :root body:has(.messenger-shell) .main-shell{height:var(--mobile-vh,100dvh);min-height:0}
 :root .page[data-page=chats]{padding:0;height:100%;overflow:hidden}
 :root .page[data-page=chats] .messenger-shell{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);height:100%;min-height:0}
 :root .messenger-shell .chat-sidebar{display:flex;min-width:0;border:0}
 :root .messenger-shell .chat-main{display:none;min-width:0}
 :root .messenger-shell.conversation-open .chat-sidebar{display:none}
 :root .messenger-shell.conversation-open .chat-main{display:flex}
 :root .messenger-shell .chat-back,:root .messenger-shell .chat-mobile-menu{display:inline-flex}
 :root .messenger-shell .chat-header{flex-wrap:wrap;padding:8px 10px;gap:6px;min-height:60px}
 :root .messenger-shell .chat-identity{flex:1;min-width:0}
 :root .messenger-shell .chat-identity>div{min-width:0}
 :root .messenger-shell .chat-header-actions{margin-left:auto;max-width:100%;flex-wrap:wrap;justify-content:flex-end;gap:4px}
 :root .messenger-shell .chat-header-actions .icon-btn,:root .messenger-shell .chat-header-actions .btn{min-width:40px;min-height:40px;height:40px;padding:8px}
 :root .messenger-shell .chat-header small{max-width:100%;display:block}
 :root .messenger-shell .chat-list-heading{height:auto;min-height:92px;padding:10px;flex-wrap:wrap}
 :root .messenger-shell .chat-list-heading>.row{gap:4px}
 :root .messenger-shell .chat-list-heading :is(.icon-btn,.theme-toggle,.ui-appearance>summary){width:40px;height:40px;min-width:40px;min-height:40px}
 :root .messenger-shell .channel-row-menu{width:40px;height:40px;min-width:40px;min-height:40px}
 :root #app .messenger-shell .message-input textarea{font-size:var(--fs-lg);min-height:48px;resize:none}
 :root #app .messenger-shell .message-tools .icon-btn{width:44px;height:44px;min-width:44px;padding:0}
 :root #app .messenger-shell .composer-help>span:first-child{display:none}
 :root #app .messenger-shell .composer-help{justify-content:flex-end}
 :root #app .messenger-shell .composer-help button{min-height:40px}
 :root #app .messenger-shell .messenger-composer{margin-bottom:max(8px,env(safe-area-inset-bottom));flex-shrink:0}
 :root .messenger-shell .bubble{max-width:calc(100% - 40px);overflow-wrap:anywhere}
}
@media(max-width:760px){
 :root table.mobile-record-table>tbody>tr{position:relative;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:14px}
 :root table.mobile-record-table>tbody>tr>td.mobile-record-title{grid-column:1/-1}
 :root table.mobile-selectable-table>tbody>tr>td.mobile-record-title{padding-right:34px}
 :root table.mobile-record-table>tbody>tr>td.mobile-record-check{position:absolute;right:8px;top:8px;padding:0;min-height:44px;min-width:36px;justify-content:center}
 :root table.mobile-record-table td.mobile-record-check::before{display:none}
 :root table.mobile-record-table>tbody>tr>td[colspan],:root table.mobile-record-table>tbody>tr>td:last-child:not(.mobile-record-title){grid-column:1/-1}
 :root .dl-table.mobile-record-table>tbody>tr>td:nth-child(4),:root .dl-table.mobile-record-table>tbody>tr>td:nth-child(5){grid-column:1/-1}
 :root [data-page=contacts] table.mobile-record-table>tbody>tr>td:nth-child(3){grid-column:1/-1}
 :root .project-selectable .project-team-column{min-width:0}
 :root .project-list-owner{min-width:0;align-items:flex-start}
 :root table.mobile-record-table .project-list-team{gap:8px}
 :root table.mobile-record-table td:last-child .row{flex-wrap:wrap}
 :root .project-list-row-actions .icon-btn{opacity:1}
}
@media(max-width:900px){
 :root .messenger-shell .chat-header-actions{width:100%;justify-content:space-between;flex-wrap:nowrap}
 :root .messenger-shell .quick-action{min-width:40px;min-height:40px}
 :root #app .messenger-shell .message-form{grid-template-columns:minmax(0,1fr) auto 44px;grid-template-rows:56px 44px;column-gap:4px}
 :root #app .messenger-shell .message-form>button[type=submit]{width:44px;height:44px;min-width:44px;min-height:44px}
 :root #app .messenger-shell .message-form>[data-work=schedule]{height:44px;min-height:44px;padding:7px}
 :root #app .messenger-shell .message-tools{gap:0}
 :root #app .messenger-shell .message-tools :is(.icon-btn,.upload-label){width:40px;min-width:40px;height:44px}
}
@media(max-width:760px){
 :root .project-row-actions .icon-btn{min-width:44px;min-height:44px;height:44px}
 :root .project-row-actions [data-pa=menu] .icon{stroke-width:3}
 :root .project-selectable.mobile-record-table td:nth-child(4){grid-column:1/-1}
 :root .project-selectable .mobile-record-table td:nth-child(4){grid-column:1/-1}
}
@media(max-width:760px){
 :root #modal-root :is(details>summary,.dc-stage-button){min-height:44px;align-content:center}
 :root .mc-toolbar button{min-width:40px;min-height:44px}
 :root #ui-save-feedback,:root #toast{box-sizing:border-box;max-width:calc(100vw - 24px);overflow-wrap:anywhere}
 :root .task-work-v2 .task-title-link,:root .project-list-title{overflow-wrap:break-word}
}

.mobile-keyboard-actions{display:none}
@media(max-width:1000px) and (pointer:coarse){
  :root[data-keyboard-open] #modal-root .modal-overlay{
    top:var(--mobile-top);bottom:auto;height:var(--mobile-vh);
  }
  :root[data-keyboard-open] #modal-root .modal-head{min-height:48px;padding-block:4px}
  :root[data-keyboard-open] #modal-root .modal-body{min-height:0;overscroll-behavior:contain}
  :root[data-keyboard-open] #modal-root .modal-footer{padding-bottom:8px}
  :root[data-keyboard-open] #modal-root .modal:has(>.mobile-keyboard-actions)>.modal-footer{display:none}
  :root[data-keyboard-open] .mobile-keyboard-actions{
    display:flex;justify-content:flex-end;flex:none;padding:6px 12px;
    background:var(--surface);border-top:1px solid var(--line);
  }
  :root[data-keyboard-open] body>.mobile-keyboard-actions{
    position:fixed;z-index:95;left:0;right:0;top:calc(var(--mobile-top) + var(--mobile-vh));transform:translateY(-100%);
  }
  :root[data-keyboard-open] .mobile-keyboard-actions .btn{min-height:44px}
  :root[data-keyboard-open] form[data-keyboard-comment] button[type=submit]{display:none}
  :root[data-keyboard-open] #page[data-page=projects]{padding-bottom:calc(84px + var(--mobile-covered,0px))}
  :root[data-keyboard-open] #modal-root .modal-body textarea[data-mobile-keyboard-field],
  :root[data-keyboard-open] #page[data-page=projects] textarea[data-mobile-keyboard-field]{
    min-height:clamp(36px,calc(var(--mobile-vh) - 116px),54px);
    max-height:clamp(36px,calc(var(--mobile-vh) - 116px),112px);
  }
  :root[data-keyboard-open] #app .main-shell:has(.messenger-shell.conversation-open){
    position:fixed;inset:var(--mobile-top) 0 auto;margin:0;height:var(--mobile-vh);min-height:0;
  }
  :root[data-keyboard-open] #app .messenger-shell.conversation-open .chat-header{min-height:48px;padding:4px 10px}
  :root[data-keyboard-open] #app .messenger-shell.conversation-open .chat-header-actions,
  :root[data-keyboard-open] #app .messenger-shell.conversation-open .chat-pinned-bar{display:none}
  :root[data-keyboard-open] #app .messenger-shell .messenger-composer{margin:0 8px 6px;padding-bottom:0}
  :root[data-keyboard-open] #app .messenger-shell .message-form{
    grid-template-columns:minmax(0,1fr) 44px 44px;grid-template-rows:48px 40px;padding:4px 8px;
  }
  :root[data-keyboard-open] #app .messenger-shell .message-input{grid-column:1/3}
  :root[data-keyboard-open] #app .messenger-shell .message-input textarea{min-height:48px;height:48px;max-height:48px}
  :root[data-keyboard-open] #app .messenger-shell .message-form>button[type=submit]{grid-row:1}
  :root[data-keyboard-open] #app .messenger-shell .message-form>[data-work=schedule]{grid-column:3;width:44px;height:40px;min-height:40px}
  :root[data-keyboard-open] #app .messenger-shell .message-form>[data-work=schedule]>span{display:none}
  :root[data-keyboard-open] #app .messenger-shell .message-tools :is(.icon-btn,.upload-label){height:40px}
  :root[data-keyboard-open] #app .messenger-shell .composer-help:not(:has(#chat-presence:not(:empty))){display:none}
}
