/* Phone screen only: stack content rather than hiding wide content. Print/Desktop unchanged. */
@media screen and (max-width:700px){
 html{overflow-x:clip}body{min-width:0!important;max-width:100%!important;overflow-x:clip!important;overflow-wrap:anywhere}
 :is(main,.shell,.layout,.workspace,.content,.center,.panel,.card,.record,.sidebar,.dialog,.modal,.dialog-body,.window-body){min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
 .shell{width:100%!important;padding-left:8px!important;padding-right:8px!important}
 :is(.form-grid,.case-body,.access-grid,.content-grid,.two-columns,.two-col,.details-grid,.legal-grid,.settings-options,.desktop-style-grid,.records-grid){grid-template-columns:minmax(0,1fr)!important}
 :is(.form-grid,.case-body,.access-grid,.content-grid,.two-columns,.details-grid)>*{min-width:0!important;max-width:100%!important;grid-column:auto!important}
 :is(.toolbar,.hero-actions,.dialog-actions,.actions,.filters,.tabs,.chat-tabs,.settings-nav,.workspace-tools){min-width:0!important;max-width:100%!important;flex-wrap:wrap!important;overflow-x:visible!important;white-space:normal!important}
 :is(.toolbar,.hero-actions,.actions,.filters)>*{min-width:0!important;max-width:100%!important}
 :is(.tabs,.chat-tabs,.settings-nav){max-height:25dvh;overflow-y:auto!important;align-content:flex-start;gap:5px!important}
 :is(.chat-tab,.tab,.settings-nav-button){min-width:0!important;flex:1 1 calc(50% - 8px)!important;white-space:normal!important;height:auto!important;min-height:38px!important;padding:7px!important;overflow-wrap:anywhere}
 .hero{flex-wrap:wrap!important;gap:8px!important;padding:12px!important}.hero-actions{flex-basis:100%;margin-left:0!important}
 :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),textarea,select){min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
 textarea{resize:vertical!important}
 :is(p,.muted,.helper,.record-title,.finding-entry,.bubble,.file-chip,.app-name){overflow-wrap:anywhere!important;max-width:100%!important}
 :is(img,video){max-width:100%;object-fit:contain}
 :is(.dialog,.modal-card,.confirm-card,.case-dialog){min-width:0!important;width:min(100%,calc(100vw - 16px))!important;max-width:calc(100vw - 16px)!important;overflow-x:clip!important}
 :is(.table-wrap,.table-container,.table-scroll){min-width:0!important;max-width:100%!important;overflow-x:visible!important}
 /* Each table row becomes a labelled card. Buttons/inputs stay in their original cells. */
 table.jd-phone-table{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;border-collapse:separate!important;table-layout:auto!important}
 table.jd-phone-table>thead{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important}
 table.jd-phone-table>tbody{display:grid!important;gap:10px!important;width:100%!important}
 table.jd-phone-table>tbody>tr{display:grid!important;grid-template-columns:minmax(0,1fr)!important;width:100%!important;min-width:0!important;padding:8px!important;border:1px solid var(--line,#60503c)!important;border-radius:10px!important}
 table.jd-phone-table>tbody>tr>:is(td,th){display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;padding:7px 4px!important;white-space:normal!important;overflow-wrap:anywhere!important;box-sizing:border-box!important;text-align:left!important}
 table.jd-phone-table>tbody>tr>td::before{content:attr(data-phone-label);display:block;margin-bottom:4px;font-size:11px;font-weight:700;color:var(--muted,#b9c2ce);letter-spacing:.02em}
 /* Fixed desktop viewport selections must not force phone pages into a wide canvas. */
 body.ipad-mode .window-frame.jd-fixed-viewport{position:static!important;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;transform:none!important}
 /* Tablet navigation also runs downwards. Home layout has its own vertical launcher. */
 html:not([data-mobile-layout="home"]) body.ipad-mode #jdBottomAppDock{height:164px!important;max-height:27dvh!important;align-items:stretch!important;overflow-y:auto!important;overflow-x:clip!important}
 html:not([data-mobile-layout="home"]) body.ipad-mode #jdBottomAppDock #appsTop{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;width:100%!important;max-width:100%!important;height:auto!important;min-height:0!important;gap:8px!important;overflow:visible!important;align-content:start!important}
 html:not([data-mobile-layout="home"]) body.ipad-mode #jdBottomAppDock #appsTop .desktop-app{width:100%!important;min-width:0!important;max-width:100%!important;height:90px!important;min-height:90px!important;flex:none!important;touch-action:pan-y!important}
 html[data-app-placement="bottom"]:not([data-mobile-layout="home"]) body.ipad-mode #windowLayer{bottom:calc(min(164px,27dvh) + 16px + env(safe-area-inset-bottom))!important}
 html[data-app-placement="top"]:not([data-mobile-layout="home"]) body.ipad-mode .ipad-status #appsTop{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;flex:0 0 100%!important;width:100%!important;height:90px!important;overflow-y:auto!important;overflow-x:clip!important;gap:6px!important}
 html[data-app-placement="top"]:not([data-mobile-layout="home"]) body.ipad-mode .ipad-status #appsTop .desktop-app{width:100%!important;min-width:0!important;max-width:100%!important;height:76px!important;min-height:76px!important;touch-action:pan-y!important}
 html:not([data-mobile-layout="home"]) body.ipad-mode #jdWorkbar{height:82px!important}
 html:not([data-mobile-layout="home"]) body.ipad-mode #jdWorkbar #runningApps{height:74px!important;max-height:74px!important;flex-wrap:wrap!important;overflow-y:auto!important;overflow-x:clip!important;align-content:flex-start!important}
 html:not([data-mobile-layout="home"]) body.ipad-mode #jdWorkbar .task-app{flex:1 1 100%!important;width:100%!important;min-width:0!important;max-width:100%!important}
 html:not([data-mobile-layout="home"]) body.ipad-mode #windowLayer{top:82px!important}
 .jd-phone-open-row>button{min-width:0!important;white-space:normal!important;overflow-wrap:anywhere!important}
 .messages .message{min-width:0!important;max-width:95%!important}.bubble{min-width:0!important}
}
@media screen and (max-width:700px){
 .jd-phone-overflow-stack{grid-template-columns:minmax(0,1fr)!important;grid-template-areas:none!important}
 .jd-phone-overflow-stack>*{grid-area:auto!important;grid-column:1!important;grid-row:auto!important;min-width:0!important;max-width:100%!important}
 :is(.tab-nav,.tab-list,.nav-tabs,.filter-tabs){display:flex!important;flex-wrap:wrap!important;min-width:0!important;max-width:100%!important;overflow-x:visible!important;gap:5px!important}
 :is(.tab-nav,.tab-list,.nav-tabs,.filter-tabs)>*{min-width:0!important;max-width:100%!important;white-space:normal!important;overflow-wrap:anywhere!important}
 .btn{white-space:normal!important;overflow-wrap:anywhere!important}
 textarea{white-space:pre-wrap!important;overflow-wrap:anywhere!important;overflow-x:clip!important}
 html:not([data-mobile-layout="home"]) body.ipad-mode #jdWorkbar .task-app-name{white-space:normal!important;overflow-wrap:anywhere!important;line-height:13px!important}
}
