/* Final responsive layer shared by all editions. Screen-only; printed records retain their layout. */
@media screen{
.main,.workspace,.app-layout,.main section,.main fieldset,.main label,.main .panel,.main .table-wrap,.main [class*="-grid"]>*{min-width:0;box-sizing:border-box}
.main .actions,.main .row-actions,.main .cf-file-actions,.main .media-record-actions,.main .media-record-footer{gap:8px;flex-wrap:wrap}
.main .device-action-cell{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.main .device-action-cell>form{margin:0}.main .device-action-cell :is(button,.button){margin:0}
.main .table-wrap,.main .responsive-table-scroll{max-width:100%;overscroll-behavior-x:contain}.main :is(video,audio,img){max-width:100%}.main iframe{max-width:100%}.main .cf-file-detail{min-width:0}.main :is(pre,textarea){max-width:100%}.main .cf-subtab-row,.main .folder-tabs{scroll-padding-inline:10px}.main dialog[open]{overscroll-behavior:contain}.main dialog form{min-width:0}
.main .cf-folder-subtabs .cf-subtab-row>[hidden],.main .folder-tabs>[hidden]{display:none!important}
}
@media screen and (max-width:1180px){
.main .case-overview-layout{grid-template-columns:minmax(0,1fr)}.main .case-overview-aside{grid-template-columns:repeat(2,minmax(0,1fr))}.main .cf-file-browser{grid-template-columns:minmax(0,1fr)}.main .cf-file-detail{position:static}.main .cf-gps-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.main .cf-gps-filters label{min-width:0}.main .gallery-editor{max-width:calc(100vw - 28px)}
}
@media screen and (max-width:1024px){
.topbar{min-height:56px!important;height:auto!important;grid-template-columns:minmax(0,1fr) 44px 44px!important;gap:8px!important;background:#102d45!important;padding:6px 10px!important}.topbar .account-link,.topbar .menu-button{min-width:44px!important;min-height:44px!important;width:44px!important;height:44px!important}.topbar .user-menu{max-width:44px}.topbar .gallery-inbox-link{display:none!important}.sidebar,.nav-collapsed .sidebar{width:min(340px,92vw)!important;max-width:92vw!important;padding:14px 14px max(18px,env(safe-area-inset-bottom))!important;background:#102d45!important;box-shadow:8px 0 30px #071d3455}.sidebar .nav-link,.sidebar-group>summary,.sidebar-submenu .nav-link{min-height:44px!important;font-size:13px!important;line-height:1.4}.nav-backdrop:not([hidden]){background:#071d3470!important}.mobile-nav-search,.mobile-nav-search :is(input,button){min-height:44px!important}.sidebar-close{min-width:44px;min-height:44px}.main{padding:18px 16px!important}.main .panel-header{flex-wrap:wrap;gap:12px}.main .panel-header h2{min-width:0}.main .panel-header>.actions{max-width:100%}.main .form-grid-3,.main .form-grid-4,.main .cf-document-details{grid-template-columns:repeat(2,minmax(0,1fr))}.main .cf-gps-events{grid-template-columns:minmax(0,1fr)}.main :is(button,.button){touch-action:manipulation;min-height:40px;white-space:normal;line-height:1.4}.main .table-wrap{overflow-x:auto}.main .responsive-cards .responsive-cell-value{min-width:0}.main .page-banner h1{font-size:clamp(22px,3vw,30px)}.main :is(.page-banner,.command-hero){gap:16px}.main .cf-folder-subtabs .cf-subtab-row{flex-wrap:wrap;overflow:visible;gap:6px;padding-bottom:6px}.main .cf-folder-subtabs .cf-subtab-row>a.button{min-height:44px;white-space:normal;margin:0}.main .folder-tabs{flex-wrap:wrap!important;overflow:visible!important;gap:6px}.main .folder-tabs a{flex:1 1 135px;min-width:0;min-height:44px;white-space:normal;line-height:1.4}.main dialog{max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto}.main dialog .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.main .gallery-editor{padding:0}.main .gallery-editor[open]{display:flex;flex-direction:column}.main .gallery-editor form{display:flex;flex-direction:column;min-height:0}.main .gallery-editor-body{overflow:auto;overscroll-behavior:contain;min-height:0;max-height:calc(100dvh - 245px)}.main .gallery-editor-footer{position:static;flex:none}.main .cf-preview{width:100%;height:min(52dvh,520px)}
}
@media screen and (max-width:700px){
.main{padding:14px 12px!important}.main .panel{padding:16px}.main :is(.form-grid,.form-grid-3,.form-grid-4,.case-team-grid,.case-client-grid,.case-overview-aside,.overview-detail-columns,.overview-extra-fields,.relationship-grid,.billing-settings-grid,.accountant-grid,.cf-file-filters,.cf-gps-filters,.cf-recipient-selects,.cf-document-details,.protection-grid){grid-template-columns:minmax(0,1fr)!important}.main .case-client-grid>*{grid-column:auto!important}.main .case-client-panel-body{min-width:0}.main .case-team-chip,.main .client-team-chip,.main .client-selected-chip{flex-wrap:wrap;gap:8px}.main :is(input:not([type=checkbox]):not([type=radio]),select,textarea){font-size:16px!important;min-height:44px;min-width:0;max-width:100%}.main input[type=checkbox],.main input[type=radio]{width:20px;height:20px;min-width:20px;min-height:20px}.main :is(button,.button){min-height:44px;padding:10px 12px}.main .actions{gap:8px;align-items:stretch}.main .actions>.button{flex:1 1 130px}.main .page-banner{padding:18px;align-items:flex-start}.main .banner-date{white-space:normal;text-align:left}.main .case-header-side{max-width:100%;width:100%}.main .responsive-cards>tbody{padding:8px 0}.main .responsive-cards>tbody>tr>td,.main .responsive-cards>tbody>tr>th{grid-template-columns:minmax(0,30%) minmax(0,1fr);gap:9px}.main .device-action-cell{gap:8px}.main .device-action-cell :is(.button,button){flex:1 1 120px}.main .device-action-cell>form{flex:1 1 120px}.main .device-action-cell>form>button{width:100%}.main dialog{width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);margin:auto;padding:16px}.main dialog .form-grid,.main .gallery-editor .gallery-form-grid{grid-template-columns:minmax(0,1fr)!important}.main .gallery-editor{padding:0}.main .gallery-editor .gallery-details-title{grid-column:1}.main .gallery-editor .gallery-details-clients,.main .gallery-editor .gallery-details-subjects{display:block}.main .gallery-editor-header{padding:16px}.main .gallery-editor-footer{padding:12px;gap:10px}.main .gallery-editor-footer>div{display:flex;flex-wrap:wrap;gap:8px}.main .gallery-editor-footer button{min-height:44px;min-width:74px}.main .gallery-editor-body{max-height:calc(100dvh - 245px);padding:16px}.main .cf-gps-event dl{grid-template-columns:minmax(80px,.4fr) minmax(0,1fr)}.main .media-record-footer{align-items:flex-start;gap:10px}.main .media-record-actions{width:100%}.main .media-record-actions>.button{flex:1 1 130px}.main .cf-preview{min-height:220px}.main .calendar-toolbar{flex-wrap:wrap;gap:8px}.main .calendar-toolbar strong{flex-basis:100%}.main .invoice-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.main .diagram-canvas{max-width:100%;height:55dvh;touch-action:none}.main .diagram-tools{grid-template-columns:repeat(2,minmax(0,1fr))}.main .command-dashboard .command-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.main .command-dashboard .command-strip{grid-template-columns:repeat(2,minmax(0,1fr))}.main .overview-fields>div{grid-template-columns:minmax(0,1fr)}.main .cf-subtab-picker{display:none!important}.main .cf-folder-subtabs .cf-subtab-row{display:flex!important}.main .cf-folder-subtabs .cf-subtab-row>a.button{flex:1 1 130px;clip-path:polygon(0 7px,7px 0,86% 0,100% 9px,100% 100%,0 100%);padding:10px 12px}.auth-main{min-width:0}.auth-layout{min-width:0}.auth-card{max-width:100%;box-sizing:border-box}.public-request,.delivery-shell{max-width:100%;box-sizing:border-box}footer{padding-bottom:max(16px,env(safe-area-inset-bottom))}
}
@media screen and (max-width:380px){.main .command-dashboard .command-stats,.main .invoice-kpis,.main .diagram-tools{grid-template-columns:minmax(0,1fr)}.main .responsive-cards>tbody>tr>td{grid-template-columns:1fr;gap:4px}.main .gallery-editor-progress{order:3;flex-basis:100%;text-align:center}.main .gallery-editor-body{max-height:calc(100dvh - 275px)}}
@media screen and (max-height:540px) and (max-width:1024px){.main dialog{max-height:calc(100dvh - 12px)}.main .gallery-editor-body{max-height:calc(100dvh - 190px)}.main .gallery-editor-header{padding:10px 14px}.main .gallery-editor-header p{display:none}.main .gallery-editor-steps{padding:8px 12px}.main .gallery-editor-footer{padding:8px 12px}}
@media screen and (pointer:coarse){.main :is(button,.button),.sidebar .nav-link{min-height:44px}.main :is(input[type=checkbox],input[type=radio]){accent-color:#0a7f7c}}
@media(prefers-reduced-motion:reduce){.main *, .sidebar *{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* Responsive shell and content: keep controls and case records available on every device. */
@media screen{
 html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
 .main :is(.panel,.tab-panel,.two-col,.form-grid,.actions,.row-actions,.detail-list,.case-content){min-width:0;max-width:100%;box-sizing:border-box}
 dialog{box-sizing:border-box;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overscroll-behavior:contain}
 dialog :is(form,fieldset,label,input,select,textarea){min-width:0;max-width:100%;box-sizing:border-box}
 .topbar .cf-refresh{display:inline-flex;align-items:center;justify-content:center;gap:6px}.topbar .cf-refresh .ui-icon{width:16px;height:16px;flex:none}
 .main .cf-mobile-case-queue{display:block}
}
@media screen and (max-width:1100px),screen and (pointer:coarse) and (max-width:1366px){
 .app-layout,.nav-collapsed .app-layout{display:block!important;padding-top:var(--cfp-topbar-height)!important}
 .workspace,.nav-collapsed .workspace{width:100%;max-width:100%;margin:0!important}
 .topbar{position:fixed;top:0;left:0;right:0;display:grid!important;grid-template-columns:44px minmax(0,1fr) 44px 44px!important;grid-template-rows:minmax(44px,auto);gap:6px!important;align-items:center;box-sizing:border-box;width:100%;max-width:100%;height:auto!important;min-height:56px!important;padding:6px max(10px,env(safe-area-inset-right)) 6px max(10px,env(safe-area-inset-left))!important;z-index:40;background:#102d45!important}
 .topbar .menu-button{grid-column:1!important;grid-row:1!important;display:flex!important;align-items:center;justify-content:center;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;margin:0!important;padding:4px!important;border:1px solid #ffffff35;background:#ffffff0c;color:#fff;border-radius:5px;font-size:24px}
 .topbar .header-brand{grid-column:2!important;grid-row:1!important;display:block;min-width:0;width:auto!important;max-width:100%!important;margin:0!important;overflow:hidden;line-height:1.25}
 .topbar .header-brand>span.agency-header-name{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal!important;overflow:hidden;font-size:14px!important;font-weight:500;line-height:1.25;max-width:100%;color:#fff;margin:0}
 .topbar .header-brand .product-logo{width:auto;max-width:100%;max-height:34px;object-fit:contain;object-position:left center}
 .topbar .header-search{display:none!important}.topbar .user-menu{display:contents!important;max-width:none!important;margin:0!important}
 .topbar .user-menu>.cf-refresh{grid-column:3;grid-row:1;box-sizing:border-box;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;margin:0!important;padding:0!important;border:1px solid #ffffff45;background:#24536f;color:#fff;font-size:0!important;border-radius:5px}
 .topbar .cf-refresh .ui-icon{width:21px;height:21px}.topbar .cf-refresh-label{display:none}
 .topbar .account-link{grid-column:4!important;grid-row:1!important;display:grid!important;place-items:center;box-sizing:border-box;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;padding:0!important;margin:0!important;background:#ffffff12;border:1px solid #ffffff25;border-radius:5px;color:#fff}
 .topbar .account-link :is(b,small),.topbar .user-menu>form,.topbar .gallery-inbox-link{display:none!important}.topbar .mobile-account-icon{display:inline-flex}.topbar .mobile-account-icon .ui-icon{width:22px;height:22px}
 .sidebar,.nav-collapsed .sidebar{display:none!important;position:fixed;top:var(--cfp-topbar-height);bottom:0;left:0;width:min(340px,92vw)!important;max-width:92vw!important;height:calc(100dvh - var(--cfp-topbar-height));padding:14px 14px max(18px,env(safe-area-inset-bottom))!important;overflow-y:auto;overscroll-behavior:contain;background:#102d45!important;box-shadow:8px 0 30px #071d3455;z-index:35}
 .sidebar.open,.nav-collapsed .sidebar.open{display:flex!important}.sidebar .sidebar-brand{display:none}.sidebar .nav-link,.sidebar-group>summary,.sidebar-submenu .nav-link{min-height:44px!important;font-size:13px!important;line-height:1.4;box-sizing:border-box}
 .mobile-nav-search{display:flex;min-width:0;min-height:44px}.mobile-nav-search input{width:100%;min-width:0;min-height:44px;font-size:16px}.mobile-nav-search button{min-width:44px;min-height:44px}.nav-backdrop:not([hidden]){display:block!important;position:fixed;inset:var(--cfp-topbar-height) 0 0;z-index:34;background:#071d3470!important;border:0;margin:0;padding:0;min-height:0}body.menu-open{overflow:hidden}
 .main{width:100%;padding:18px 16px!important;min-width:0}.main .page-banner,.main .panel-header{flex-wrap:wrap;gap:12px}.main .case-header-side{max-width:100%;min-width:0}.main form.actions>label{flex:0 1 auto;min-width:0}.main .table-wrap{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
 .main .command-hero{grid-template-columns:minmax(0,1fr)!important;min-height:0!important}.main .dashboard-action-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-rows:auto!important}.main .dashboard-action-grid>a.button{width:100%!important;min-width:0!important;height:auto!important;min-height:44px!important;white-space:normal!important;line-height:1.4!important}
 .main .command-access .panel-header{align-items:flex-start}.main .command-access .panel-header>.actions{margin-top:0;max-width:100%}.main .command-strip{grid-template-columns:repeat(2,minmax(0,1fr))}.main .command-strip a{min-width:0;overflow-wrap:anywhere}
 dialog{max-width:calc(100vw - 20px);max-height:calc(100dvh - 20px);margin:auto}dialog .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}dialog :is(button,.button){min-height:44px}dialog :is(input:not([type=checkbox]):not([type=radio]),select,textarea){font-size:16px;max-width:100%}
}
@media screen and (max-width:700px){
 .main{padding:14px 12px!important}.main .panel{padding:16px}.main :is(.two-col,.form-grid,.grid-2,.relationship-grid,.case-overview-layout,.overview-detail-columns,.accounting-period){grid-template-columns:minmax(0,1fr)!important}
 .main .panel-header{align-items:flex-start}.main .panel-header>.actions{width:100%}.main form.actions{align-items:flex-end!important}.main form.actions>label{flex:1 1 140px}.main form.actions>.cf-case-action{flex:0 1 auto}.main :is(button,.button){overflow-wrap:anywhere}
 .main .detail-list>div{display:grid;grid-template-columns:minmax(0,1fr);gap:5px}.main .detail-list dd{margin:0;text-align:left;overflow-wrap:anywhere}.main .command-access .panel-header{display:block}.main .command-access .panel-header>.actions{display:flex;margin-top:12px}.main .command-access .actions>a{flex:1 1 135px;max-width:100%}.main .command-access .actions>a[href*="investigation"]{flex-basis:100%}
 .main .command-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}.main .command-stat{padding:12px!important;gap:8px;min-height:88px}.main .command-stat .stat-icon{width:32px;height:32px;flex:none}.main .command-stat strong{font-size:24px}.main .command-stat small{font-size:12px;line-height:1.35}
 .main .command-table .responsive-cards{display:block!important;min-width:0!important;width:100%;table-layout:fixed}.main .command-table .responsive-cards>thead{display:none}.main .command-table .responsive-cards>tbody{display:grid!important;gap:12px;padding:10px}.main .command-table .responsive-cards>tbody>tr{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 12px;border:1px solid #ccdbe7;border-radius:7px;padding:8px 12px;min-width:0;background:#fff}.main .command-table .responsive-cards>tbody>tr>td{display:flex!important;flex-direction:column;align-items:flex-start;gap:3px;min-width:0;border-bottom:1px solid #e1eaf0;padding:8px 0!important;overflow-wrap:anywhere}.main .command-table .responsive-cards>tbody>tr>td:first-child{grid-column:1/-1}.main .command-table .responsive-cards>tbody>tr>td[data-label]:before{content:attr(data-label);font-size:11px;font-weight:600;color:#536d80}.main .command-table .responsive-cell-value{width:100%;min-width:0}.main .command-table .responsive-empty-cell{grid-column:1/-1}
 dialog{width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);padding:16px}dialog .form-grid{grid-template-columns:minmax(0,1fr)!important}.cf-record-dialog{padding:12px}.cf-record-dialog-header{flex-wrap:wrap}.cf-record-dialog>iframe{min-height:180px}.cf-upload-dialog form{min-width:0}
}
@media screen and (max-width:360px){.topbar{gap:4px!important;padding-left:6px!important;padding-right:6px!important}.topbar .header-brand>span.agency-header-name{font-size:12px!important}.main .dashboard-action-grid{grid-template-columns:minmax(0,1fr)!important}.main .command-stats{gap:8px}.main .command-stat{display:block}.main .command-stat .stat-icon{margin-bottom:6px}}
@media screen and (max-height:540px) and (max-width:1366px){dialog{max-height:calc(100dvh - 12px);padding:12px}.cf-record-dialog-header h2{font-size:16px}.sidebar{overscroll-behavior:contain}.main .command-hero{padding:16px!important}}
