/* Width tiers shared by every authenticated shell. Feature styles stay in their own files. */
.compact-rail,.compact-only,.compact-step-label,.compact-more,.compact-editor-note{display:none}
/* Keep the full borrower sidebar vertical, including anchors styled inline by accessibility rules. */
body.v2:is(.area-borrower,.area-broker,.area-investor) .side nav{display:flex;flex-direction:column}
body.v2:is(.area-borrower,.area-broker,.area-investor) .side nav>a{display:flex;width:100%;box-sizing:border-box}
@media(min-width:501px) and (max-width:1020px){
 body.v2{--tabbar-h:0px;font-size:15px}
 body.v2 .compact-rail{position:fixed;inset:0 auto 0 0;width:76px;z-index:25;display:flex;flex-direction:column;align-items:center;gap:4px;padding:calc(24px + env(safe-area-inset-top,0px)) 5px max(20px,env(safe-area-inset-bottom,0px));box-sizing:border-box;background:var(--sidebar,var(--surface));border-right:1px solid var(--hairline,var(--line));overflow-y:auto;color:var(--ink)}
 body.v2 .compact-mark{display:flex;min-height:44px;align-items:center;justify-content:center;margin-bottom:16px;width:64px}
 body.v2 .compact-mark img{width:50px;height:auto}.compact-mark .logo-d{display:none}
 body.v2 .compact-link{display:flex;flex:none;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:64px;min-height:58px;padding:4px 2px;box-sizing:border-box;border:0;border-radius:12px;background:transparent;text-decoration:none;color:var(--secondary,var(--steel));font:500 12px/1.2 var(--sans,system-ui);text-align:center;overflow-wrap:normal;cursor:pointer}
 body.v2 .compact-link>span{display:block;max-width:100%;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px}
 body.v2 .compact-link[aria-current]{background:var(--brand-tint,var(--fill));color:var(--ink)}
 body.v2 .compact-avatar{margin-top:auto;flex:none;display:grid;place-items:center;width:44px;min-height:44px;border-radius:50%;background:var(--fill,var(--surface-2));font-size:13px;color:var(--ink);text-decoration:none}
 body.v2 .app{display:block;margin-left:76px;min-width:0}
 body.v2 .d-app{margin-left:76px;min-width:0}
 body.v2 .side,body.v2 .d-side{display:none}
 body.v2 .app.nav-open .side,body.v2 .side.open,body.v2 .d-side.open{display:flex;flex-direction:column;position:fixed;inset:0 auto 0 0;width:280px;height:100dvh;transform:none;visibility:visible;z-index:65}
 body.v2 .d-scrim.open{display:block;position:fixed;inset:0;z-index:60}
 body.v2 :is(.tabbar,.d-tabbar,.pv2-tabs,.d-phone-only){display:none!important}
 body.v2 .desktop-only{display:block!important}body.v2 .phone-only{display:none!important}
 body.v2 .main{padding-bottom:0;min-width:0}
 body.v2 main{min-width:0;padding-bottom:env(safe-area-inset-bottom,0px)}
 body.v2 .content,body.v2 .d-content,body.v2 .desk-legacy{padding:20px 24px 32px;min-width:0;box-sizing:border-box}
 body.v2 .desk-legacy .content{padding:0}
 body.v2 .topbar{padding:24px 24px 12px;min-height:76px;flex-wrap:wrap}
 body.v2 .topbar h1{font-size:26px;white-space:normal;overflow-wrap:anywhere}
 body.v2 .topbar .nav-open{display:none}
 body.v2 .topbar .tb-actions{max-width:100%;flex-wrap:wrap;overflow:visible}
 body.v2 .d-tb{padding:12px 20px;gap:8px;flex-wrap:wrap;height:auto;min-height:64px}
 body.v2 .d-search{display:none}
 body.v2 :is(.split,.pv2-two,.pv2-two.even,.dt-body,.iv3-columns,.d-grid3,.d-match,.d-settings,.mdx-pb,.mdx-call){display:grid;grid-template-columns:minmax(0,1fr);min-width:0}
 body.v2 :is(.grid-3,.grid-4,.d-stats,.d-grid2,.pv2-next,.pv2-grid,.bv-kpis){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));min-width:0}
 body.v2 .d-span2{grid-column:auto}
 body.v2 :is(.pv2,.dt-main,.dt-side,.dc-main,.d-file-top,.d-ld-detail){min-width:0;padding:20px}
 body.v2 .pv2{gap:18px}
 body.v2 :is(.d-ld,.dc-panes){display:grid;grid-template-columns:minmax(0,1fr)}
 body.v2 :is(.d-ld-list,.dc-list){min-width:0;max-height:300px;border-right:0;border-bottom:1px solid var(--line)}
 body.v2 :is(.d-ld-detail,.d-ld.has-detail .d-ld-detail){display:block}
 body.v2 .dc-insp{display:none}
 body.v2 :is(.dt-tiles,.d-file-head,.d-next,.d-page-h){flex-wrap:wrap;min-width:0}
 body.v2 :is(.btn,.d-btn,.pv2-btn,button,select.input,.tabs a,.d-file-tabs a){min-height:44px}
 body.v2 :is(.btn,.d-btn){white-space:normal;text-align:center}
 body.v2 :is(input,textarea,select){max-width:100%;box-sizing:border-box}
 body.v2 :is(.grid-2,.grid-3,.grid-4,.d-grid2)>*{min-width:0}
 body.v2 .compact-table{width:100%;table-layout:fixed;display:block}
 body.v2 .compact-table thead{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden}
 body.v2 .compact-table tbody{display:block}
 body.v2 .compact-table tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;padding:14px 16px;border-bottom:1px solid var(--line)}
 body.v2 .compact-table td{display:block;border:0;padding:3px 0;min-width:0;overflow-wrap:anywhere;white-space:normal;font-size:15px}
 body.v2 .compact-table td::before{display:none}
 body.v2 .compact-table td:first-child{font-weight:600;grid-column:1}
 body.v2 .compact-table td:last-child{grid-column:2;grid-row:1 / span 3;align-self:center}
 body.v2 .compact-table td[colspan]{grid-column:1/-1;grid-row:auto}
 body.v2 .compact-tabs{display:flex;flex-wrap:wrap;width:auto;max-width:100%;overflow:visible;position:relative}
 body.v2 .compact-tabs>.compact-tab-extra{display:none}
 body.v2 .compact-more{display:block;position:relative;margin-left:auto}
 body.v2 .compact-more summary{display:flex;align-items:center;min-height:44px;padding:0 12px;cursor:pointer;font-size:15px}
 body.v2 .compact-more-menu{position:absolute;right:0;top:100%;z-index:35;min-width:190px;max-width:calc(100vw - 110px);padding:8px;background:var(--card,var(--surface));color:var(--ink);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow-pop)}
 body.v2 .compact-more-menu>a{display:flex;align-items:center;white-space:normal;min-height:44px}
 body.v2 .compact-step-label{display:block;font-size:15px;font-weight:600;margin:12px 0 8px}
 body.v2 .compact-steps{display:flex;gap:4px;padding:0;margin:0 0 20px;border:0;overflow:visible}
 body.v2 .compact-steps>div,body.v2 .compact-steps li{flex:1;min-width:0;height:6px;padding:0;border-radius:3px;border:0;background:var(--line-off,var(--line));font-size:0}
 body.v2 .compact-steps .done{background:var(--accent,var(--brand))}
 body.v2 .compact-steps :is(.now,[aria-current=step]){background:var(--gold,#b68b3d)}
 body.v2 .compact-steps :is(span,.pt,.pl),body.v2 .compact-steps>.d-prog-track,body.v2 .compact-steps>.d-prog-fill{display:none}
 body.v2 .d-prog.compact-steps{display:block;height:auto;background:transparent}
 body.v2 .compact-steps ol{display:flex;gap:4px}
 body.v2 .compact-only{display:block}
 body.v2 :is(.helper-panel,.ai-dock,.ai-dock.is-side,.ai-dock.is-float,.ai-dock.is-max){position:fixed!important;inset:0 0 0 auto!important;width:min(340px,calc(100vw - 96px))!important;height:100dvh!important;max-height:100dvh;box-sizing:border-box;border-radius:20px 0 0 20px;z-index:210}
 html.ai-side-open body.v2 :is(.d-app,.app){margin-right:0}
 body.v2 .ai-rs{display:none}
 .compact-ai-scrim{display:block;position:fixed;inset:0;z-index:200;border:0;background:rgba(3,9,20,.48);backdrop-filter:blur(3px)}
 .compact-ai-scrim[hidden]{display:none}
 body.v2 .compact-editor-note{display:block;padding:12px 16px;border-radius:12px;background:var(--fill,var(--surface-2));font-size:15px}
 body.v2 :is(.d-row-actions,.row-actions,.hover-actions){opacity:1;visibility:visible}
 body.v2 .side>.theme-sw,body.v2 .side>.lang-sw{display:none}
 body.v2 .compact-preferences{display:block}
 body.v2 .compact-preferences :is(.theme-sw,.lang-sw){display:flex;flex-wrap:wrap;margin:12px 0}
}
@media(pointer:coarse) and (min-width:501px) and (max-width:1020px){body.v2 :is(.btn,.d-btn,button,a.compact-link){min-height:44px}body.v2 :is(.d-row-actions,.row-actions,.hover-actions){opacity:1;visibility:visible}}
/* At the cover width, retain the existing phone shell. */
@media(max-width:500px){body.v2 .compact-rail{display:none}}
@media(min-width:501px) and (max-width:1020px){body.v2 .compact-stage{display:flex;align-items:center;gap:12px;min-height:52px;border-top:1px solid var(--hairline,var(--line));color:var(--ink)}body.v2 .compact-stage>span:first-of-type{flex:1}body.v2 .compact-stage>span:last-child{font-size:13px}body.v2 .compact-pipeline>a:first-child{display:flex;min-height:44px;align-items:center;justify-content:flex-end}}
/* These inherited phone-shell properties must not leak into the medium tier. */
@media(min-width:501px) and (max-width:1020px){
 body.v2 .helper-toggle.ai-launch--header{position:fixed;inset:16px 24px auto auto;width:auto;height:auto;z-index:100}
 body.v2 .helper-toggle.ai-launch--header img{width:100%}
 body.v2 .topbar:has(~main) .tb-title{padding-right:138px}
 body.v2 .compact-preferences .theme-sw button{min-height:44px}
 body.v2 .compact-steps>div{margin:0;border-top:0}
 body.v2 :is(.d-small,.d-muted,.chip,.label){font-size:15px}
 body.v2 .dc-row-sub{font-size:13px}
 body.v2 :is(.d-row,.d-next,.d-ld-detail p,.pv2-body,.pv2-muted,.input,.d-input,.mt-text){font-size:15px}
 body.v2 .d-file-top{padding:8px 24px 0}
 body.v2 .d-sheet{max-width:calc(100vw - 32px)}
 body.v2 .d-sheet.wide{width:calc(100vw - 32px)}
 body.v2 .compact-tabs .compact-more-menu{background:var(--card,var(--surface));border-color:var(--hairline,var(--line))}
}
@media(min-width:501px) and (max-width:1020px){body.v2 .dc-progress.compact-steps{display:block;padding:0}body.v2 .compact-steps .dc-track{display:none}body.v2 .compact-steps .dc-pl{display:none}body.v2 .compact-steps ol{margin:0;padding:0;list-style:none}body.v2 .compact-steps li{border-radius:3px;height:6px}body.v2 .compact-steps li>*{display:none}}

@media(min-width:501px) and (max-width:1020px){
 .compact-nav-scrim.open{display:block;position:fixed;inset:0;z-index:60;border:0;background:rgba(3,9,20,.48)}
 .compact-nav-scrim[hidden]{display:none}
 body.v2 :is(.legal-advisory-grid,.sx-cols){grid-template-columns:minmax(0,1fr)!important}
 body.v2 :is(.legal-lanes,.legal-done){grid-template-columns:repeat(2,minmax(0,1fr))}
 body.v2 :is(.grid-2,.d-field-row){grid-template-columns:repeat(2,minmax(0,1fr))}
 body.v2 :is(.grid-2,.d-field-row,.sx-cols)>*{min-width:0}
 body.v2 :is(.compact-more-menu button,.compact-more-menu .btn,.compact-more-menu .d-btn){width:100%;min-height:44px}
 body.v2 :is(.d-see-all,.d-back,.ck-link,.msg-about>summary,.tabs>a,.d-pills>a,.d-file-tabs>a){min-width:44px;min-height:44px;display:inline-flex;align-items:center}
 body.v2 .compact-rail a{min-width:44px}
 body.v2 .compact-table :is(th,td){max-width:100%}
 body.v2 .compact-table td:last-child .btn{max-width:160px}
 body.v2 :is(.d-bulkbar,.sc-bulk){max-width:calc(100vw - 108px);flex-wrap:wrap;box-sizing:border-box}
 body.v2 .d-bulkbar{left:calc(50% + 38px)}
 body.v2 .d-inline-form .input{min-width:0}
 body.area-borrower{--sans:-apple-system,BlinkMacSystemFont,'Helvetica Neue',sans-serif;--pv-sans:var(--sans);--pv-serif:var(--sans);font-family:var(--sans)}
}

/* Lender classic shell shares the certification floor; client portals are unchanged. */
body.area-lender [hidden],body.area-lender dialog:not([open]){display:none!important}
body.area-lender :is(.tabbar .tab,.tabbar .tab span,.d-title-btn,#rm-cc,input[type=color],#ai-foot,.ai-att b,.ai-ctx-chip){font-size:13px}
body.area-lender svg text{font-size:12px}
body.area-lender :is(a[href],button,input:not([type=hidden]),select,textarea,summary,[contenteditable=true]){min-height:24px;min-width:24px;box-sizing:border-box}
@media(max-width:1020px){
 body.area-lender :is(a[href],button,input:not([type=hidden]),select,textarea,summary,[contenteditable=true],label[for]){min-height:44px;min-width:44px;box-sizing:border-box}
 body.area-lender .tabbar .tab{font-size:13px}
}

/* lx2: target floors must survive feature selectors and inline width/height.
   Inline anchors do not honor min-height; only text links need a new display mode. */
body.area-lender :is(a[href],button,input:not([type=hidden]),select,textarea,summary,[role=button],[contenteditable=true]){min-height:24px!important;min-width:24px!important;box-sizing:border-box}
body.area-lender :is(.att a[href],.tbl a[href],.hint[href],.d-link,.cx-table a[href]){display:inline-flex;align-items:center}
@media(max-width:1020px){
 body.area-lender :is(a[href],button,input:not([type=hidden]),select,textarea,summary,[role=button],[contenteditable=true]){min-height:44px!important;min-width:44px!important}
 body.area-lender:not(.desk-v3) :is(.att a[href],.activity a[href],.panel a[href]){display:inline-flex;align-items:center}
}
