/* Matter tasks only. No changes to task or approval rules. */
#workspace #mw-tasks.tw-compact{padding:16px 20px}
#workspace #mw-tasks.tw-compact>.mw-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px}
#workspace #mw-tasks.tw-compact>.mw-toolbar>h2{font-size:17px!important;font-weight:500!important;margin:0;line-height:1.4;min-width:0}
#workspace #mw-tasks .tw-actions{display:flex;align-items:center;gap:6px;flex:none}
#workspace #mw-tasks .tw-actions>button,#workspace #mw-tasks .tw-help>summary{display:inline-flex;align-items:center;justify-content:center;min-height:36px!important;margin:0!important;padding:6px 12px!important;font-size:13px!important;line-height:20px;border-radius:5px;white-space:nowrap}
#workspace #mw-tasks .tw-actions>.tw-refresh,#workspace #mw-tasks .tw-help>summary{width:36px;min-width:36px;padding:0!important;background:transparent;color:#45647f;border:1px solid transparent;list-style:none}
#workspace #mw-tasks .tw-help>summary::-webkit-details-marker{display:none}
#workspace #mw-tasks .tw-help>summary::after{display:none!important;content:none!important}
#workspace #mw-tasks .tw-help{position:relative;margin:0!important;padding:0!important;border:0!important;background:transparent!important}
#workspace #mw-tasks .tw-help>p{position:absolute;right:0;top:calc(100% + 6px);width:min(320px,calc(100vw - 64px));box-sizing:border-box;z-index:12;margin:0!important;padding:12px 14px;background:#fff;border:1px solid #dce4ed;border-radius:6px;box-shadow:0 8px 24px #193b501a;font-size:13px;line-height:1.6;color:#526b80}
#workspace #mw-tasks .tw-refresh:hover,#workspace #mw-tasks .tw-help>summary:hover{background:#edf3f8}
#workspace #mw-tasks .tw-tabs{display:flex;gap:20px;margin:0 0 14px;padding:0;border-bottom:1px solid #e0e7ef}
#workspace #mw-tasks .tw-tabs>button{min-width:44px;min-height:36px!important;margin:0 0 -1px!important;padding:6px 0!important;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;color:#62798d;font-size:13px!important;font-weight:400}
#workspace #mw-tasks .tw-tabs>button[aria-pressed=true]{border-bottom-color:#225780;color:#194b73;font-weight:600}
#workspace #mw-tasks #task-panel{padding:0!important;margin:0!important;border:0!important;background:transparent;box-shadow:none}
#workspace #mw-tasks.tw-compact #task-panel>h2{display:none}
#workspace #mw-tasks .tw-empty{margin:0!important;padding:16px 0!important;color:#62798d;font-size:14px}
#workspace #mw-tasks .mw-matter-approvals>p:only-child{margin:0;padding:16px 0;color:#62798d;font-size:14px}
@media(max-width:1100px),(any-pointer:coarse){
 #workspace #mw-tasks .tw-actions>button,#workspace #mw-tasks .tw-help>summary,#workspace #mw-tasks .tw-tabs>button{min-height:44px!important}
 #workspace #mw-tasks .tw-actions>.tw-refresh,#workspace #mw-tasks .tw-help>summary{width:44px;min-width:44px}
}
@media(max-width:540px){
 #workspace #mw-tasks.tw-compact{padding:14px}
 #workspace #mw-tasks.tw-compact>.mw-toolbar{flex-wrap:wrap;gap:8px;margin-bottom:8px}
 #workspace #mw-tasks.tw-compact>.mw-toolbar>h2{flex:1 0 100%;font-size:16px!important}
 #workspace #mw-tasks .tw-actions{width:100%;justify-content:flex-end}
 #workspace #mw-tasks .tw-actions>.tw-add{margin-left:auto!important}
 #workspace #mw-tasks .tw-help>p{left:0;right:auto}
 #workspace #mw-tasks .tw-tabs{gap:24px;margin-bottom:8px}
}

/* Templates, time entries and draft billing: one shared compact toolbar. */
#workspace .pr-register .pr-heading-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin:0 0 12px;min-width:0}
#workspace .pr-register .pr-heading-actions:empty{display:none}
#workspace .pr-register .pr-heading-actions>button,#workspace .pr-register .pr-options>summary{margin:0!important;min-height:36px!important;padding:6px 12px!important;font-size:13px!important;line-height:20px;border-radius:5px;max-width:100%}
#workspace .pr-register .pr-options{position:relative;margin:0;border:0;padding:0;background:transparent}
#workspace .pr-register .pr-options>summary{display:flex;align-items:center;justify-content:center;min-width:36px;list-style:none;cursor:pointer;background:transparent;color:#365a78;border:1px solid #dce4ed;box-sizing:border-box}
#workspace .pr-register .pr-options>summary::-webkit-details-marker{display:none}
#workspace .pr-register .pr-options>summary::after{display:none!important;content:none!important}
#workspace .pr-register .pr-option-list{position:absolute;right:0;top:calc(100% + 6px);z-index:15;min-width:180px;padding:4px;background:white;border:1px solid #dce4ed;border-radius:6px;box-shadow:0 8px 24px #193b501a}
#workspace .pr-register .pr-option-list>button{display:block;width:100%;margin:0;padding:8px 12px;border:0;background:transparent;color:#345670;text-align:left;min-height:36px;font-size:13px}
#workspace .pr-register .register-filter-group{grid-template-columns:repeat(2,minmax(0,1fr));align-items:end}
#workspace .pr-register .register-filter-group>button{grid-column:1/-1}
#workspace .pr-register .register-toolbar .wr-refresh{margin:0!important;font-size:20px;font-weight:400;line-height:1;padding:0!important}
#workspace .pr-register .register-filter-group .register-field>label{position:static;width:auto;height:auto;clip-path:none;white-space:normal;margin:0 0 4px}
#workspace .pr-register #register-table th:first-child{width:38%}
#workspace .pr-register #register-table td{vertical-align:middle;overflow-wrap:anywhere}
#workspace .pr-register #register-table .register-record-link{font-weight:400!important}
#workspace .pr-register .register-intro{margin-bottom:8px}
@media(max-width:1100px),(any-pointer:coarse){
 #workspace .pr-register .register-toolbar{grid-template-columns:minmax(120px,1fr) 170px auto 44px}
 #workspace .pr-register .register-toolbar :is(input,select,button){min-height:44px!important;height:44px}
 #workspace .pr-register .register-toolbar .wr-refresh{width:44px}
 #workspace .pr-register .pr-heading-actions>button,#workspace .pr-register .pr-options>summary,#workspace .pr-register .pr-option-list>button,#workspace .pr-register .register-tabs>button{min-height:44px!important}
 #workspace .pr-register .pr-options>summary{min-width:44px}
}
@media(max-width:900px){
 #workspace .pr-register .register-toolbar{grid-template-columns:minmax(0,1fr) auto 44px}
 #workspace .pr-register .register-filter-group{grid-template-columns:1fr}
 #workspace .pr-register #register-table th:first-child{width:auto}
 #workspace .pr-register .register-filter-group>button{grid-column:1}
 #workspace .pr-register #register-table td{font-size:13px;line-height:1.5}
}

/* Consistent staff controls; document/email content and editor canvases are untouched. */
#workspace .sidebar-content{--uc-radius:5px;--uc-control:36px;--uc-space:12px}
#workspace .sidebar-content :is(.register-surface,.mw-section,.rw-surface,.dh-surface,.panel){border-radius:7px;box-shadow:none}
#workspace .sidebar-content>.panel{padding:18px;margin-bottom:16px}
#workspace .sidebar-content :is(.register-toolbar,.mw-toolbar,.rw-toolbar,.mail-toolbar){gap:8px 10px}
#workspace .sidebar-content :is(.register-toolbar,.mw-toolbar,.rw-toolbar,.mail-toolbar) :is(button,input,select){border-radius:var(--uc-radius);box-shadow:none}
#workspace .sidebar-content :is(.register-toolbar,.mw-toolbar,.rw-toolbar,.mail-toolbar) button:not(.mail-row):not(.wr-refresh):not(.tw-refresh){min-height:var(--uc-control)!important;padding:6px 12px;font-size:13px;line-height:20px;font-weight:500}
#workspace .sidebar-content :is(.register-toolbar,.mw-toolbar,.rw-toolbar,.mail-toolbar) :is(input:not([type=checkbox]):not([type=radio]),select){min-height:var(--uc-control)!important;font-size:14px;line-height:20px;padding:7px 10px;font-weight:400}
#workspace .sidebar-content :is(.mw-filters,.rw-form,.crm-form,.personnel-create-form) :is(input:not([type=checkbox]):not([type=radio]),select,textarea){border-radius:var(--uc-radius);box-shadow:none;font-weight:400}
.uc-mail-placeholder{box-sizing:border-box;min-height:320px;padding:12px 0;min-width:0}
#workspace .mail-workspace.nq-loading-target{display:block!important}
#workspace .mail-workspace{min-width:0}
/* A menu has a single disclosure indicator, with a full touch target. */
.ab-more>summary::after{display:none!important;content:none!important}
.ab-more>summary::-webkit-details-marker{display:none}
.ab-header>button{min-width:44px!important;min-height:44px!important}
@media(max-width:1100px),(any-pointer:coarse){
 #workspace .sidebar-content{--uc-control:44px}
 #workspace .sidebar-content :is(.register-toolbar,.mw-toolbar,.rw-toolbar,.mail-toolbar) :is(input:not([type=checkbox]):not([type=radio]),select){font-size:16px}
}
@media(max-width:540px){#workspace .sidebar-content>.panel{padding:14px}.uc-mail-placeholder{min-height:280px}}
@media(prefers-reduced-motion:reduce){.nq-skeleton{animation:none;opacity:1}}

/* Staff UI sizing only: no document content, permissions or form behaviour changes. */
:root{--ds-control-height:40px;--ds-control-radius:5px}
#workspace .sidebar-content{--uc-control:var(--ds-control-height)}
#workspace .sidebar-content :is(.legal-register,.matter-workplace,.mail-workspace,.panel) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=hidden]),select),
body>:is(.rw-dialog,.ab-dialog,.mw-dialog,.personnel-manage-dialog,.personnel-permissions-dialog,.resource-action-dialog,.mail-message-dialog,.mail-connect-dialog) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]),select){
 box-sizing:border-box;min-width:0;max-width:100%;height:var(--ds-control-height)!important;min-height:var(--ds-control-height)!important;padding:7px 10px!important;border-radius:var(--ds-control-radius)!important;line-height:20px!important;font-weight:400;vertical-align:middle
}
#workspace .sidebar-content :is(.legal-register,.matter-workplace,.mail-workspace,.panel) button:not(.dh-record):not(.mail-row):not(.sp-row):not(.resource-action-menu button):not(.qw-group button),
body>:is(.rw-dialog,.ab-dialog,.mw-dialog,.personnel-manage-dialog,.personnel-permissions-dialog,.resource-action-dialog,.mail-message-dialog,.mail-connect-dialog) button:not(.ab-identity){
 box-sizing:border-box;min-height:var(--ds-control-height)!important;border-radius:var(--ds-control-radius);line-height:20px!important;padding:6px 12px!important;vertical-align:middle
}
#workspace .sidebar-content :is(.register-toolbar,.mw-toolbar,.mw-filters,.mail-toolbar,.rw-toolbar,.pr-heading-actions,.tw-actions){align-items:center;gap:8px 10px}
#workspace .sidebar-content :is(.register-toolbar,.mw-toolbar,.mw-filters,.mail-toolbar,.rw-toolbar,.pr-heading-actions,.tw-actions) :is(button,input,select){margin-top:0!important;margin-bottom:0!important}
#workspace .sidebar-content :is(.register-toolbar,.mw-toolbar,.mail-toolbar) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select){height:var(--ds-control-height)!important;min-height:var(--ds-control-height)!important}
#workspace .sidebar-content :is(.register-toolbar,.mw-toolbar,.mail-toolbar,.register-tabs,.pr-heading-actions,.tw-actions)>button,
#workspace #mw-tasks.tw-compact .tw-actions>button,
#workspace #mw-tasks.tw-compact .tw-tabs>button{min-height:var(--ds-control-height)!important}
#workspace .sidebar-content :is(.resource-action-menu,.personnel-actions,.pr-options,.mail-account-menu,.ab-more)>summary,
body>.ab-dialog .ab-more>summary,
#workspace .sidebar-content :is(.wr-refresh,.tw-refresh),
#workspace #mw-tasks.tw-compact .tw-help>summary{
 box-sizing:border-box;width:var(--ds-control-height)!important;min-width:var(--ds-control-height)!important;height:var(--ds-control-height)!important;min-height:var(--ds-control-height)!important;padding:0!important;margin:0!important;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0
}
#workspace .sidebar-content .wr-register .register-toolbar{grid-template-columns:minmax(160px,1fr) 180px auto var(--ds-control-height)}
#workspace .sidebar-content .register-filter-group{align-items:end}
#workspace .sidebar-content textarea{box-sizing:border-box;min-height:96px;border-radius:var(--ds-control-radius);line-height:1.5}
/* An open details element otherwise inherits a 10px summary margin. */
body.enterprise-shell .eh-header-options{flex:0 0 44px;width:44px;height:44px;box-sizing:border-box}
body.enterprise-shell .eh-header-options[open]>summary{margin:0}
@media(max-width:1100px),(any-pointer:coarse){
 :root{--ds-control-height:44px}
 #workspace .sidebar-content :is(.register-toolbar,.mw-toolbar,.mail-toolbar) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select){font-size:16px}
}
@media(max-width:900px){
 #workspace .sidebar-content .wr-register .register-toolbar{grid-template-columns:minmax(0,1fr) auto var(--ds-control-height)}
}

#workspace .sidebar-content .rw-action-menu>summary{width:var(--ds-control-height)!important;height:var(--ds-control-height)!important;min-height:var(--ds-control-height)!important;margin:0!important}
#workspace .sidebar-content .rw-help>summary{min-height:var(--ds-control-height)!important;box-sizing:border-box;margin:0!important}
#workspace .sidebar-content .nq-load-error>button{min-height:var(--ds-control-height)!important;padding:6px 12px!important;line-height:20px!important;box-sizing:border-box}

#workspace .sidebar-content .register-toolbar{align-items:end}

/* Keep action containers and their controls on the same line. Presentation only. */
#workspace .sidebar-content .mw-header-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;min-width:0}
#workspace .sidebar-content :is(.mw-header-actions,.rw-tools,.mw-toolbar,.pr-heading-actions,.cp-register-actions,.qw-heading-actions,.ea-document-actions,.tw-actions,.mail-account-controls,.mail-message-toolbar)>:is(button,details){margin:0!important;align-self:center}
#workspace .sidebar-content :is(.mw-header-actions,.rw-tools,.pr-heading-actions,.qw-heading-actions,.ea-document-actions,.tw-actions,.mail-account-controls,.mail-message-toolbar)>button{box-sizing:border-box;min-height:var(--ds-control-height)!important;padding:6px 12px!important;line-height:20px!important}
#workspace .sidebar-content details:is(.resource-action-menu,.personnel-actions,.pr-options,.mail-account-menu,.mail-message-more,.rw-action-menu),
#workspace .sidebar-content details:is(.resource-action-menu,.personnel-actions,.pr-options,.mail-account-menu,.mail-message-more,.rw-action-menu)[open],
body>.ab-dialog details.ab-more,body>.ab-dialog details.ab-more[open]{box-sizing:border-box;width:var(--ds-control-height)!important;min-width:var(--ds-control-height)!important;height:var(--ds-control-height)!important;min-height:var(--ds-control-height)!important;max-height:var(--ds-control-height)!important;flex:0 0 var(--ds-control-height)!important;margin:0!important;padding:0!important;align-self:center}
#workspace .sidebar-content details:is(.resource-action-menu,.personnel-actions,.pr-options,.mail-account-menu,.mail-message-more,.rw-action-menu)>summary,
#workspace .sidebar-content details:is(.resource-action-menu,.personnel-actions,.pr-options,.mail-account-menu,.mail-message-more,.rw-action-menu)[open]>summary,
body>.ab-dialog details.ab-more>summary,body>.ab-dialog details.ab-more[open]>summary{box-sizing:border-box;width:100%!important;height:100%!important;min-height:var(--ds-control-height)!important;margin:0!important;padding:0!important;display:flex;align-items:center;justify-content:center}
#workspace .sidebar-content .documents-hub>.dh-header{grid-template-columns:minmax(0,1fr) auto var(--ds-control-height)}
#workspace .sidebar-content .documents-hub>.dh-header>.ea-document-actions{grid-template-columns:minmax(0,max-content) var(--ds-control-height)}
#workspace .sidebar-content .documents-hub>.dh-header>.resource-action-menu{width:var(--ds-control-height)!important}
#workspace .sidebar-content .rw-header .rw-tools{justify-content:flex-end;gap:8px}
#workspace .sidebar-content .rw-header .rw-tools>button{width:auto;min-width:0;flex:0 1 auto}
@media(max-width:1100px),(any-pointer:coarse){
 #workspace .sidebar-content .documents-hub>.dh-header{grid-template-columns:minmax(0,1fr) var(--ds-control-height)}
 #workspace .sidebar-content .mw-header-actions{justify-content:flex-start;grid-column:1/-1}
}
@media(max-width:600px){
 #workspace .sidebar-content .documents-hub>.dh-header>.ea-document-actions{grid-template-columns:minmax(0,1fr) var(--ds-control-height)}
}
@media(max-width:540px){
 #workspace .sidebar-content .rw-header .rw-tools{justify-content:flex-start}
 #workspace .sidebar-content .rw-surface>.rw-tools{display:grid;grid-template-columns:minmax(0,1fr);grid-auto-rows:1fr;gap:8px;align-items:stretch}
 #workspace .sidebar-content .rw-surface>.rw-tools>button{align-self:stretch;min-width:0}
}

/* Reserve scrollbar width while a matter tab or document dialog changes height. */
html{scrollbar-gutter:stable}
#workspace .matter-workplace,#workspace .mw-section{overflow-anchor:none}
/* Keep intermediate dossier/detail builds behind the existing document loader. */
.dp-route-opening .sidebar-content>:not(.nq-document-loading){visibility:hidden!important}
.dp-route-opening .sidebar-content>.nq-document-loading{display:block!important;visibility:visible!important}
