/* Shared layout uses the approved Trusted tokens and leaves data components intact. */
body.has-shell{--shell-width:260px;--shell-height:76px}
body.has-shell .shell-topbar{height:var(--shell-height);min-height:var(--shell-height);display:flex;gap:18px;padding:12px 24px;border-bottom:1px solid var(--t-border);z-index:40}
.has-shell .shell-topbar .brand{flex-shrink:0}.has-shell .shell-topbar .brand strong{font-size:25px;letter-spacing:3px}
.has-shell .shell-context{color:var(--t-text-secondary);font-size:12px}.has-shell .shell-date{font-size:12px;color:var(--t-text-muted)}
.has-shell .shell-account{margin-inline-start:auto;display:flex;align-items:center;gap:14px;font-size:12px;min-width:0}.shell-identity{max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.has-shell .shell-account a{color:var(--t-trust)}.has-shell .shell-account button{padding:7px 12px;min-height:38px}
body.has-shell .shell-sidebar{position:fixed;inset-block:var(--shell-height) 0;inset-inline:0 auto;width:var(--shell-width);padding:18px 14px;overflow:auto;display:flex;flex-direction:column;gap:12px;z-index:35;border-inline-end:1px solid var(--t-border);scrollbar-gutter:stable}
.shell-nav-heading{display:flex;align-items:center;justify-content:space-between;font-size:11px;color:var(--t-text-muted);padding:0 10px}
body.has-shell .shell-nav{display:block;overflow:visible;flex:1}.shell-group{margin-bottom:8px;border-bottom:1px solid var(--t-border);padding-bottom:8px}.shell-group summary{font-size:13px;font-weight:600;cursor:pointer;padding:12px 9px;color:var(--t-text);min-height:46px}.shell-group summary:focus-visible{outline:2px solid var(--t-trust);outline-offset:2px;border-radius:6px}.shell-group>div{display:grid;gap:3px;margin-top:4px}
body.has-shell .shell-nav a{font-size:12px;font-weight:400;padding:9px 12px;white-space:normal;min-height:40px;line-height:1.55;border-radius:8px;border-inline-start-width:3px;display:flex}.shell-nav a[aria-current=page]{font-weight:700!important}.shell-foot{font-size:10px;color:var(--t-text-muted);padding:12px 10px}
body.has-shell main{margin-inline-start:var(--shell-width);margin-inline-end:0;max-width:none;min-width:0;padding:24px 30px;min-height:calc(100vh - var(--shell-height))}
.has-shell .shell-session-notice{margin-inline-start:var(--shell-width);padding:10px 30px;font-size:12px;background:var(--t-warning-bg);color:var(--t-warning);border-bottom:1px solid var(--t-border)}.shell-session-notice a{color:var(--t-trust);text-decoration:underline}
.has-shell .shell-menu,.has-shell #shell-close{display:none}.shell-backdrop{display:none}
.has-shell [hidden]{display:none!important}.has-shell .table-wrap{max-width:100%;min-width:0}
.has-shell .trusted-identity{min-height:110px;max-height:140px}.has-shell .trusted-identity img{object-position:center 47%}
@media(max-width:1100px){body.has-shell{--shell-width:235px}.has-shell .shell-context{display:none}.has-shell .shell-topbar{gap:12px;padding-inline:18px}body.has-shell main{padding:20px}}
@media(max-width:700px){
 body.has-shell{--shell-height:68px}.has-shell .shell-topbar{flex-wrap:nowrap;padding:10px 14px;gap:10px}.has-shell .shell-topbar .brand strong{font-size:20px}.has-shell .shell-context,.has-shell .shell-date,.has-shell .shell-identity,.has-shell #shell-security{display:none}.has-shell .shell-account{gap:8px}.has-shell .shell-menu,.has-shell #shell-close{display:block;min-height:42px;font-size:12px;padding:7px 10px}
 body.has-shell .shell-sidebar{display:none;width:min(290px,88vw);inset-block:0;z-index:70;padding:18px 14px;background:var(--t-bg-1)}body.has-shell.shell-menu-open .shell-sidebar{display:flex}.has-shell .shell-nav{display:block!important;overflow:visible!important}.has-shell .shell-nav a{font-size:13px;min-height:44px}
 .has-shell .shell-backdrop:not([hidden]){display:block;position:fixed;inset:0;z-index:60;border:0;background:rgba(0,0,0,.65)}body.shell-menu-open{overflow:hidden}
 body.has-shell main{margin:0;padding:18px 14px}.has-shell .shell-session-notice{margin:0;padding:10px 14px}.has-shell .heading{padding-top:12px}.has-shell .trusted-identity{min-height:90px;max-height:110px}
}
@media print{.has-shell .shell-topbar,.has-shell .shell-sidebar,.shell-session-notice,.shell-backdrop{display:none!important}body.has-shell main{margin:0;padding:0}}

/* Consistent operational density, without altering data or brand tokens. */
body.has-shell{--shell-height:64px}
body.has-shell main{padding:20px 24px}
.has-shell .heading{padding:0;margin-bottom:18px;gap:16px}.has-shell h1{font-size:26px;line-height:1.45;margin:4px 0 8px}.has-shell h2{font-size:18px}
.has-shell .panel{padding:20px;margin-bottom:18px}.has-shell .toolbar{gap:12px;margin-bottom:14px;align-items:end;flex-wrap:wrap}.has-shell .toolbar label{min-width:150px}
.has-shell .shell-nav a{font-size:14px;min-height:44px}.has-shell .shell-group summary{font-size:14px}.has-shell .shell-foot{font-size:12px}
.has-shell .table-wrap{overflow:auto;max-height:68vh;overscroll-behavior:contain;scrollbar-gutter:stable;border:1px solid var(--t-border);border-radius:10px}
.has-shell table{border-collapse:separate;border-spacing:0;width:100%}.has-shell th,.has-shell td{font-size:14px;line-height:1.65;padding:12px 14px;max-width:360px;overflow-wrap:anywhere}
.has-shell thead th{position:sticky;top:0;z-index:3;background:var(--t-surface-2,#16283c);white-space:normal}.has-shell tbody td:first-child{position:sticky;inset-inline-start:0;z-index:1;background:var(--t-surface-1,#101e30)}.has-shell thead th:first-child{inset-inline-start:0;z-index:4}
.has-shell tbody tr:hover td{background:var(--t-surface-hover,#1c334b)}.has-shell td.money{font-variant-numeric:tabular-nums;white-space:nowrap;direction:ltr;text-align:right}.has-shell th button{font-size:inherit;padding:4px;background:transparent;color:inherit;border:0}
.has-shell button,.has-shell input,.has-shell select{min-height:44px}.has-shell button:disabled{opacity:.45;cursor:not-allowed}.has-shell button[type=submit],.has-shell .action{background:var(--t-opportunity,#ffc477);color:#091321;border-color:transparent;font-weight:700}
.has-shell :focus-visible{outline:2px solid var(--t-opportunity,#ffc477);outline-offset:3px}.has-shell details>summary{cursor:pointer;padding:8px 0;font-weight:600}.has-shell .source-details{font-size:13px;color:var(--t-text-secondary);margin:10px 0 16px;overflow-wrap:anywhere}.has-shell .source-details p{margin:8px 0}
.has-shell .data-warning{border-inline-start:3px solid var(--t-warning,#ffd084);padding:8px 12px;margin:10px 0;font-size:13px}.has-shell .empty-state{padding:24px;border:1px solid var(--t-border);border-radius:12px;background:var(--t-surface-1,#101e30)}
.has-shell .workspace-filters{display:flex;flex-wrap:wrap;gap:12px;margin:12px 0}.has-shell .workspace-filters label{display:grid;gap:6px;font-size:13px}.has-shell .workspace-filters select{max-width:240px}.has-shell .risk-high{color:var(--t-warning,#ffd084);font-weight:700}
body.has-shell:not([data-shell-session=authenticated]) .shell-sidebar,body.has-shell:not([data-shell-session=authenticated]) .shell-menu,body.has-shell:not([data-shell-session=authenticated]) .shell-context,body.has-shell:not([data-shell-session=authenticated]) .shell-date{display:none!important}
body.has-shell:not([data-shell-session=authenticated]) main,body.has-shell:not([data-shell-session=authenticated]) .shell-session-notice{margin-inline-start:0}
body.has-shell:not([data-shell-session=authenticated]):not(.trusted-auth):not(.public-page) main{display:none}
body.trusted-auth:not([data-shell-session=authenticated]) main{max-width:560px;margin:32px auto;padding:20px}
body.trusted-auth:not([data-shell-session=authenticated]) main>.heading,body.trusted-auth:not([data-shell-session=authenticated]) main>.notice,body.trusted-auth:not([data-shell-session=authenticated]) .trusted-identity,body.trusted-auth:not([data-shell-session=authenticated]) #cases-panel,body.trusted-auth:not([data-shell-session=authenticated]) #role-overview{display:none!important}
body.trusted-auth #login-panel .toolbar{display:grid;grid-template-columns:1fr;align-items:stretch}.trusted-auth #login-panel{border-top:3px solid var(--t-opportunity,#ffc477)}.trusted-auth #login-panel input{width:100%;box-sizing:border-box}.trusted-auth #login-panel h2{font-size:26px}.trusted-auth #other-login{margin-block:14px}.trusted-auth #logout{display:none}
body[data-shell-session=loading] #login-panel,body[data-shell-session=unavailable] #login-panel{visibility:hidden}body[data-shell-session=authenticated] .trusted-identity{display:none}
@media(max-width:700px){body.has-shell main{padding:16px 12px}.has-shell h1{font-size:22px}.has-shell .panel{padding:14px}.has-shell .toolbar label{flex:1;min-width:130px}.has-shell th,.has-shell td{padding:10px;font-size:14px}.has-shell .table-wrap{max-height:65vh}.has-shell .metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.has-shell .card{min-width:0}.has-shell .card strong{font-size:22px;overflow-wrap:anywhere}body.trusted-auth:not([data-shell-session=authenticated]) main{margin:16px auto}.has-shell .shell-account{font-size:12px}.has-shell .shell-topbar .brand strong{font-size:20px}}
@media print{.has-shell .table-wrap{max-height:none;overflow:visible}.has-shell th,.has-shell td:first-child{position:static!important}}

.trend-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(90px,1fr));gap:14px;margin:16px 0}.trend-grid meter{display:block;width:100%;height:16px}.trend-grid meter::-webkit-meter-optimum-value{background:#ffc477}.trend-grid meter.prior::-webkit-meter-optimum-value{background:#70cfff}

html body.trusted-ui.has-shell :is(button.primary,button.action,.btn-primary,button[type=submit]){background:var(--t-opportunity);color:#091321;border-color:var(--t-opportunity)}
html body.trusted-ui.has-shell :is(button.primary,button.action,.btn-primary,button[type=submit]):hover:not(:disabled){background:#ffd49c;color:#091321}
.has-shell .shell-tools{padding-inline:10px}.has-shell .shell-tools>summary{font-size:13px;color:var(--t-text-secondary)}.has-shell .shell-tools>div{display:grid;gap:3px}

body.has-shell:not([data-shell-session=authenticated]) dialog{display:none!important}
/* Keep filter controls inside narrow screens, including legacy minimum widths. */
body.has-shell.sales-dashboard .metrics .card{min-height:104px;padding:16px}
@media(max-width:700px){
 body.has-shell .table-filters{display:grid;grid-template-columns:minmax(0,1fr);width:100%}
 body.has-shell .table-filters label,body.has-shell .workspace-filters label{min-width:0;width:100%}
 body.has-shell .toolbar input,body.has-shell .toolbar select,body.has-shell .workspace-filters input,body.has-shell .workspace-filters select{min-width:0;width:100%;max-width:100%;box-sizing:border-box}
 body.has-shell .workspace-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Operational pages share the showroom palette; the navigation rail has its own contrast tokens. */
:root {
  color-scheme: light;
  --t-bg-0: #f5f7f8; --t-bg-1: #f0f4f5;
  --t-surface-1: #fff; --t-surface-2: #eef5f4; --t-surface-hover: #dcefeb;
  --t-glass: #fff; --t-text: #13213a; --t-text-secondary: #415569; --t-text-muted: #556a79;
  --t-trust: #006f69; --t-trust-strong: #bce7e0;
  --t-opportunity: #80521b; --t-opportunity-strong: #bd9359;
  --t-success: #146843; --t-success-bg: #def5e9;
  --t-warning: #805018; --t-warning-bg: #fff2d9;
  --t-error: #a32740; --t-error-bg: #ffebef;
  --t-info: #006e72; --t-info-bg: #dcf3ef;
  --t-border: #d6e0e4; --t-border-strong: #96aeb3;
  --t-shadow: 0 2px 10px rgba(20,45,60,.05);
  --t-shadow-raised: 0 14px 42px rgba(20,45,60,.16);
  --t-glow: none;
}
html body.trusted-ui.has-shell {background:var(--t-bg-0)}
html body.trusted-ui.has-shell .shell-sidebar {
  --t-bg-1:#101f38; --t-text:#f6fafb; --t-text-secondary:#d8e6ec; --t-text-muted:#adbfce;
  --t-border:#344861; --t-trust:#80e7d8; --t-opportunity:#70e1d4; --t-info-bg:#006e6a;
  background:#101f38; color:var(--t-text);
}
body.has-shell .shell-nav a {color:#dce9ed;font-size:14px}
html body.has-shell .shell-nav a:hover {background:#213853;color:white}
html body.trusted-ui.has-shell .shell-nav a[aria-current=page] {background:#006e6a;color:white}
html body.trusted-ui.has-shell main :is(.panel,.card,.work-detail) {
  background-color:var(--t-surface-1);border:1px solid var(--t-border);border-radius:16px;
}
html body.trusted-ui.has-shell main :is(input:not([type=checkbox]):not([type=radio]),select,textarea) {background:white}
html body.trusted-ui.has-shell :is(button.primary,button.action,.btn-primary,button[type=submit]) {
  background:#00756e;color:white;border-color:#00756e;border-radius:9px;
}
html body.trusted-ui.has-shell :is(button.primary,button.action,.btn-primary,button[type=submit]):hover:not(:disabled) {background:#005e59;color:white}
html body.trusted-ui.has-shell .shell-topbar {background:white;color:var(--t-text)}
html body.trusted-ui.has-shell .shell-topbar .brand strong {color:#123047}

.has-shell .shell-topbar .shell-wordmark {display:block;width:150px;height:50px;object-fit:contain}
@media(max-width:700px){.has-shell .shell-topbar .shell-wordmark{width:117px;height:39px}}

.has-shell :is(.table-wrap,.table-scroll,.comm-table-wrap,.editor-table-wrap,.evidence-scroll){
  max-inline-size:100%;min-inline-size:0;isolation:isolate;
}
.has-shell :is(.table-wrap,.table-scroll,.comm-table-wrap,.editor-table-wrap,.evidence-scroll) td:not(.money){
  white-space:normal;overflow-wrap:anywhere;
}
.has-shell #workspace-controls{justify-content:flex-start}
.has-shell #workspace-controls small{flex-basis:100%;color:var(--t-text-secondary)}
.has-shell #workspace-controls label:not([hidden]){min-inline-size:min(15rem,100%)}
.has-shell #workspace-controls input{inline-size:100%}
.has-shell :is(#workspace-summary,#workspace-filters):empty{display:none}
.has-shell .table-wrap td.workspace-detail{min-inline-size:10rem;max-inline-size:24rem}
.has-shell .table-wrap td.workspace-detail button{white-space:nowrap}
.has-shell .table-wrap th button{white-space:normal;text-align:start}
.has-shell .table-wrap td[colspan]:first-child{position:static}
.has-shell dialog[open]{max-inline-size:calc(100vw - 1.5rem);max-block-size:90dvh;overflow:auto}
