/* Shared bounds: controls shrink inside their own container, tables scroll locally. */
#app,.main,.content,.branch-workspace,.branch-console-body,#branch-main{min-width:0}
.pilot-toolbar{align-items:flex-end}
.pilot-toolbar>label{min-width:0;max-width:100%}
.pilot-toolbar input,.pilot-toolbar select{min-width:0;max-width:100%;box-sizing:border-box}
.title-row>div{min-width:0}.title-row h1{overflow-wrap:anywhere}
.branch-workspace .branch-controls{align-items:flex-end!important}
.branch-workspace .branch-controls label{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:6px!important;margin:0!important;min-width:0}
.branch-workspace .branch-controls button{min-height:44px!important;height:auto!important;align-self:end!important;white-space:normal}
.branch-workspace .branch-controls input,.branch-workspace .branch-controls select{min-height:44px!important;box-sizing:border-box}
.branch-tabs{display:flex;flex-wrap:wrap;gap:8px}
.branch-tabs button{min-height:44px;white-space:normal}
#director-access{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px max(16px,env(safe-area-inset-left));background:#fff5e9;border-bottom:1px solid #dfc7b1;font:14px system-ui;color:#3f342b}
.director-identity{min-width:0;display:grid;gap:4px}.director-identity strong{font-size:13px}.director-identity span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
#director-access button{flex-shrink:0;min-height:44px}
#director-access-dialog{box-sizing:border-box;width:min(580px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:24px;border:1px solid #d8dfe3;border-radius:16px;overflow:auto;background:#fff;color:#24313d}
#director-access-dialog::backdrop{background:#14232980}
#director-access-dialog header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:22px}
#director-access-dialog h2{margin:0;font-size:22px}
#director-access-dialog label{display:grid;gap:8px;min-width:0}
#director-access-dialog select{width:100%;min-width:0;box-sizing:border-box;min-height:48px;font-size:16px}
.director-selected{overflow-wrap:anywhere;font-size:14px;line-height:1.5;color:#626d77}
.director-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:20px}
#director-access-dialog button{min-height:44px;white-space:normal}.director-error{color:#a11;line-height:1.5}
@media(max-width:700px){
 .content{padding:16px!important}.branch-workspace .content{padding:0!important}
 .pilot-toolbar>label{flex:1 1 160px}
 .pilot-toolbar button{min-height:44px;max-width:100%;white-space:normal}
 .pilot-toolbar input,.pilot-toolbar select,.pilot-form input,.pilot-form select,.pilot-form textarea{font-size:16px!important}
 .pilot-grid{grid-template-columns:minmax(0,1fr)}
 .title-row{flex-wrap:wrap;gap:12px}.title-row h1{font-size:24px}
 .topbar{gap:8px!important;padding:12px!important;min-width:0;max-width:100%}
 .topbar .user-block{width:100%;min-width:0;grid-template-columns:minmax(0,1fr) auto auto auto!important;gap:6px}
 .topbar .workspace-user{min-width:0}.topbar .workspace-user b{white-space:normal;overflow-wrap:anywhere}
 .branch-workspace .branch-controls{display:grid!important;grid-template-columns:minmax(0,1fr);gap:10px!important;width:100%;margin:16px 0!important}
 .branch-workspace .branch-controls label{width:auto!important;font-size:13px!important}
 .branch-workspace .branch-controls input,.branch-workspace .branch-controls select{width:100%!important;max-width:100%!important;min-width:0!important;min-inline-size:0!important;font-size:16px!important}
 .branch-controls .branch-date{grid-column:1;grid-row:1}
 .branch-controls #branch-refresh{grid-column:1;grid-row:auto;margin:0!important;width:100%;min-width:0}
 .branch-controls .branch-filter,.branch-controls #branch-export{grid-column:1/-1;margin:0!important;width:100%}
 .branch-workspace .branch-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .branch-tabs button{width:100%;padding:10px!important;line-height:1.35}
 #director-access{padding:8px 12px;gap:8px}.director-identity strong{font-size:12px}
 #director-access-dialog{padding:18px}#director-access-dialog h2{font-size:20px}
 .director-actions{display:grid;grid-template-columns:1fr}.director-actions button{width:100%}
}
@media print{#director-access,#director-access-dialog{display:none!important}}
@media(max-width:700px){
 .branch-workspace .branch-tabs{align-items:stretch}
 .topbar button{min-height:44px}
 .topbar #reload,.topbar #help{min-width:44px}
}
@media(max-width:1024px){
 .shell .content{padding-bottom:calc(150px + env(safe-area-inset-bottom,0px))!important}
 body:has(#pwa-launch) #app>.branch-workspace{padding-bottom:calc(150px + env(safe-area-inset-bottom,0px))!important}
}
@media(max-width:700px){
 .topbar .user-block{flex:0 0 100%;margin:0;grid-template-columns:minmax(0,1fr) auto auto!important}
 .topbar .workspace-user b{font-size:13px}.topbar .workspace-user small{font-size:12px}
}
.sales-buyer-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));gap:16px}
.sales-buyer-card{min-width:0;overflow-wrap:anywhere}
.sales-buyer-card h2{font-size:18px;line-height:1.4;margin-top:0}
.sales-buyer-card dl{margin:0}.sales-buyer-card dt{color:#65717a;font-size:13px;margin-top:14px}.sales-buyer-card dd{margin:4px 0 0;line-height:1.5}.sales-buyer-card a{display:inline-block;padding:6px 0;color:#a92631}
