/* Phone presentation only; desktop layout and records are shared. */
.mobile-menu-shade{display:none}.mobile-calendar-hint{display:none}
@media screen and (max-width:760px){
html,body{max-width:100%;overflow-x:clip}.app-shell,.main,.page,#content,.panel,.suite-grid,.suite-card{min-width:0}.main{width:100%;margin-left:0}.page{padding:18px 12px 24px}.page-heading>div{min-width:0}.page-heading h1{font-size:24px;line-height:1.25}.page-heading p{font-size:14px;line-height:1.5;color:#596579}.page-heading>.button{min-height:44px;font-size:14px}.topbar{min-height:56px;height:auto;padding:8px 12px;gap:8px}.top-actions{gap:6px}.topbar .icon-btn{min-width:44px;min-height:44px}.sidebar{z-index:44;height:100dvh;padding-bottom:max(20px,env(safe-area-inset-bottom));overflow-y:auto}.sidebar.mobile-open{box-shadow:8px 0 35px #0005}.sidebar nav{flex-shrink:0;overflow:visible}.sidebar .nav-item{font-size:14px;min-height:46px}.sidebar .nav-item>span{display:block}.sidebar .brand{padding-bottom:18px}.mobile-menu-shade.open{display:block;position:fixed;inset:0;z-index:43;background:#0007;border:0}.joist-mobile-nav{z-index:42}.joist-mobile-nav button{min-height:52px;font-size:11px}.app-shell .main{padding-bottom:calc(76px + env(safe-area-inset-bottom))}.toast{left:50%;bottom:calc(82px + env(safe-area-inset-bottom));max-width:calc(100vw - 24px);font-size:14px;white-space:pre-wrap}
button,.button,.button.small{touch-action:manipulation}.button,.button.small,.icon-btn{min-height:44px;font-size:14px}.input,select,textarea,input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]){font-size:16px!important;min-height:44px;max-width:100%}textarea{min-height:110px}input[type=checkbox],input[type=radio]{min-width:20px;min-height:20px}.field>label{font-size:13px;color:#465468}.form-grid{grid-template-columns:minmax(0,1fr)}.field.full{grid-column:1/-1}.field,.form-row>*{min-width:0}.company-check{font-size:13px;min-height:46px}.suite-actions,.upload-actions{gap:8px;flex-wrap:wrap}.suite-actions>.button{white-space:normal}.toolbar{flex-direction:column;align-items:stretch;gap:10px}.toolbar-right,.searchbox{width:100%;max-width:100%}.toolbar-right select{width:100%}.section-tools{flex-wrap:wrap;gap:10px}.section-tools .fade-label{font-size:13px;color:#596579}.metrics,.cost-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.metric{padding:14px}.metric-head{font-size:12px}.metric-value{font-size:30px}.dashboard-grid,.right-stack,.suite-grid,.contact-grid,.project-grid{grid-template-columns:minmax(0,1fr)}.panel-header{padding:16px;gap:10px}.panel-header h2{font-size:17px}.panel-subtitle,.small-help{font-size:12px;color:#596579}.record-link{font-size:14px}.task-row{flex-wrap:wrap;gap:10px}.task-main{min-width:0}.note-card,.drawer-description{font-size:14px;line-height:1.6;color:#526175}.info-grid{grid-template-columns:minmax(0,1fr)}
.modal-overlay{padding:0;align-items:stretch}.modal{width:100%!important;max-width:100%!important;max-height:100dvh;height:100dvh;border-radius:0}.modal-header,.modal-footer{border-radius:0;padding:14px 16px;flex-shrink:0}.modal-header h2{font-size:19px}.modal-body{padding:16px;min-height:0;overscroll-behavior:contain}.modal-footer{flex-wrap:wrap;padding-bottom:max(14px,env(safe-area-inset-bottom));gap:8px}.modal-footer .button{flex:1}.drawer{width:100%;height:100dvh}.drawer-body{padding:16px;min-width:0}.drawer-tabs{gap:18px;padding:0 16px}.drawer-tabs button{min-height:44px}.auth-wall{padding:16px}.auth-card{padding:24px 20px}.auth-card h1{font-size:25px}.auth-card p{font-size:14px}
/* Each ordinary data row becomes a labeled card; complex tables retain local scrolling. */
table.mobile-card-table{display:block;width:100%;min-width:0!important;white-space:normal}.mobile-card-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.mobile-card-table tbody{display:block}.mobile-card-table tbody>tr{display:block;margin:12px 0;padding:12px;background:#fff;border:1px solid #dce3eb;border-radius:10px}.mobile-card-table tbody>tr>td{display:block;width:auto!important;min-width:0!important;max-width:none!important;border:0;padding:8px 4px;font-size:14px;white-space:normal!important;text-align:left;overflow-wrap:anywhere}.mobile-card-table td[data-mobile-label]:before{content:attr(data-mobile-label);display:block;font-size:11px;font-weight:700;color:#64748b;margin-bottom:5px;text-transform:uppercase;letter-spacing:.03em}.mobile-card-table small{font-size:12px;max-width:none}.mobile-card-table .suite-actions{justify-content:flex-start}.table-wrap,.supply-table-wrap{max-width:100%;overflow-x:auto}.table-wrap>table:not(.mobile-card-table){min-width:600px}.joist-record-row,.joist-items .joist-record-row{grid-template-columns:minmax(0,1fr);gap:10px;padding:16px}.joist-record-row>div:last-child{grid-column:auto;justify-self:start}.joist-record-row .suite-actions{justify-content:flex-start}.joist-record-row strong,.proposal-customer-link{font-size:15px}.joist-address,.joist-record-row small{font-size:13px}.proposal-list-row{grid-template-columns:minmax(0,1fr) auto;gap:12px;padding:16px}.proposal-list-row b{font-size:15px}.proposal-list-row small{font-size:12px}.proposal-list-row>.suite-actions{grid-column:1/-1;grid-row:auto;justify-content:flex-start}.proposal-list-tabs{overflow-x:auto;flex-wrap:nowrap}.proposal-list-tabs button{white-space:nowrap;min-height:44px;padding:10px 15px;font-size:13px}.proposal-editor,.proposal-preview-modal{left:0;top:0;width:100vw!important;height:100dvh!important}.proposal-editor .modal-body,.proposal-preview-modal .modal-body{padding:12px}.proposal-editor .modal-footer{gap:8px}.proposal-editor .proposal-line{display:block!important}.proposal-editor .estimate-line-values{grid-template-columns:repeat(2,minmax(0,1fr))!important}.proposal-finance>.form-grid{float:none;width:100%}.proposal-editor-totals{width:100%;max-width:100%}.proposal-paper{padding:24px 16px;min-width:0;overflow-wrap:anywhere}.proposal-letterhead{flex-wrap:wrap;gap:16px}.proposal-paper table{font-size:12px;table-layout:fixed;width:100%}.proposal-paper th,.proposal-paper td{overflow-wrap:anywhere;padding:6px 3px}.proposal-paper img{max-width:100%;height:auto}
.calendar-controls{grid-template-columns:minmax(0,1fr)}.calendar-controls label:first-child{grid-column:auto}.calendar-columns{grid-template-columns:minmax(0,1fr)}.calendar-team-panel{padding:14px}.calendar-sales-checks label{min-width:0;flex:1 1 140px}.month-scroll{overflow-x:auto;overscroll-behavior-x:contain}.month-grid{min-width:630px}.month-event{padding:7px 5px;min-height:44px}.month-event strong{font-size:12px}.month-event span{font-size:11px}.month-day>header button{min-width:36px;height:36px;font-size:13px}.month-weekday{font-size:11px}.mobile-calendar-hint{display:block;font-size:12px;color:#596579;padding:8px 0 12px}.week-scroll{max-width:100%;overscroll-behavior-x:contain}.slot-picker-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.slot-picker-time{min-height:70px}.slot-picker-toolbar label{min-width:0;flex-basis:100%}.calendar-slot{min-height:64px}.month-toolbar h2{font-size:20px}.call-contact-control{flex-wrap:wrap}.call-contact-control>input{flex-basis:100%}.call-contact-results{max-height:220px}.call-work-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.cost-toolbar>label{min-width:0;width:100%}.supply-component{grid-template-columns:minmax(0,1fr)}
}
@media screen and (max-width:360px){.metrics,.cost-kpis{grid-template-columns:minmax(0,1fr)}.call-work-grid{grid-template-columns:minmax(0,1fr)}.calendar-slots{grid-template-columns:minmax(0,1fr)}}
/* The global nav rule is a column; shortcuts must always be one row. */
@media screen and (max-width:760px){
#joist-mobile-nav{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);grid-template-columns:none;grid-template-rows:minmax(0,1fr);flex-direction:row;flex-wrap:nowrap;gap:0;align-items:stretch;position:fixed;inset:auto 0 0;width:100%;height:calc(64px + env(safe-area-inset-bottom));min-height:0;max-height:calc(64px + env(safe-area-inset-bottom));margin:0;padding:4px 4px calc(4px + env(safe-area-inset-bottom));overflow:hidden;box-sizing:border-box}
#joist-mobile-nav>button{min-width:0;min-height:0;height:55px;max-height:55px;padding:4px 2px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:11px;line-height:1.25;overflow:hidden}
#joist-mobile-nav>button>span{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#joist-mobile-nav svg{width:19px;height:19px;flex:none}
.app-shell .main{padding-bottom:calc(80px + env(safe-area-inset-bottom))}
}

/* Dense document lists: opening and editing no longer need row action buttons. */
.compact-document-list .proposal-list-row,.compact-document-list .proposal-list-head{grid-template-columns:minmax(0,1fr) 110px 150px;gap:14px;padding:8px 16px;min-height:60px}
.compact-document-list .proposal-list-row>div{min-width:0;grid-column:auto;grid-row:auto}
.compact-document-list .proposal-customer-link{display:block;width:100%;min-height:30px;padding:3px 0;background:transparent;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px;line-height:1.4;color:#263a50}
.compact-document-list .proposal-customer-link:hover{color:#087a0a;text-decoration:underline}.compact-document-title{font-weight:400;color:#536175}
.compact-document-list .proposal-document-identity>small{margin-top:1px;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.4}
.compact-document-list .proposal-document-amount>b{font-size:14px}.compact-document-list .proposal-document-amount>small{font-size:11px;margin-top:1px}
@media screen and (max-width:760px){
.compact-document-list .proposal-list-row{grid-template-columns:minmax(0,1fr) 110px;gap:3px 12px;padding:8px 12px;min-height:84px}
.compact-document-list .proposal-list-row>.proposal-document-identity{grid-column:1;grid-row:1/3}
.compact-document-list .proposal-list-row>.proposal-document-amount{grid-column:2;grid-row:1;text-align:right}
.compact-document-list .proposal-list-row>.proposal-document-status{grid-column:2;grid-row:2}
.compact-document-list .proposal-customer-link{min-height:44px;white-space:normal;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;font-size:14px}
.compact-document-list .proposal-document-identity>small{font-size:11px;white-space:normal;overflow-wrap:anywhere;line-height:1.35}
.compact-document-list .proposal-document-status select{min-height:44px;font-size:12px!important;padding:6px;max-width:100%!important}
}
/* Dialog actions must stay above the phone navigation, including long permission forms. */
#modal-root .modal-overlay{z-index:100}
#modal-root .modal-body{flex:1 1 auto;min-height:0}
#modal-root .modal-footer{flex:0 0 auto;position:sticky;bottom:0;z-index:2;background:#fff}
body.tracker-modal-open #joist-mobile-nav,body:has(#modal-root .modal-overlay) #joist-mobile-nav{display:none!important}
.user-permissions-modal .modal-header{gap:8px}
.user-permissions-modal .modal-header>div:first-child{flex:1;min-width:0}
.user-permissions-modal .permissions-save-top{flex:none;white-space:nowrap;min-height:44px}
@media(max-width:760px){.user-permissions-modal .modal-header h2{font-size:17px}.user-permissions-modal .modal-header p{display:none}#modal-root .modal-footer{padding-bottom:max(14px,env(safe-area-inset-bottom))}}
@media(max-width:760px){#joist-mobile-nav:has(>button:nth-child(6))>button{font-size:9px}}
