/* Scoped fixes. Semantic success/warning/error colors and business controls remain intact. */
html body #app .team-page .drawer-shade .drawer {
  width:min(720px,100vw)!important;max-width:100vw!important;box-sizing:border-box;overflow-x:hidden;
}
html body #app .team-page .drawer form,
html body #app .team-page .drawer .form-grid {width:100%!important;min-width:0!important;box-sizing:border-box;}
html body #app .team-page .drawer .form-grid {grid-template-columns:repeat(2,minmax(0,1fr))!important;}
html body #app .team-page .drawer :is(label,fieldset,section,input,select,textarea) {min-width:0;max-width:100%;box-sizing:border-box;}
html body #app .team-page .drawer .xl-team-presets-r197 {display:flex!important;flex-wrap:wrap;gap:8px;}
html body #app .team-page .drawer .xl-team-presets-r197>div,
html body #app .team-page .drawer .xl-team-presets-r197>output {flex:1 1 100%;}
html body #app .team-page .drawer footer {position:sticky;bottom:0;z-index:3;padding:14px 0;background:var(--xl-color-surface,#fff);border-top:1px solid var(--xl-ref-border,#dbe6df);}
html body #app .report-page .range-bar button.active {background:var(--xl-ref-primary,#315e4a)!important;color:#fff!important;border-color:var(--xl-ref-primary,#315e4a)!important;box-shadow:none!important;}
html body #app .team-report .kpis {display:grid!important;grid-template-columns:repeat(7,minmax(0,1fr))!important;}
html body #app .team-report .kpis article {min-width:0;padding:14px 10px!important;}
html body #app .team-report .kpis article :is(b,strong) {font-size:24px!important;line-height:1.3;white-space:nowrap;font-variant-numeric:tabular-nums;}
html body #app .team-report .heading {display:flex!important;align-items:center;flex-wrap:wrap;gap:12px;height:auto!important;min-height:0!important;}
html body #app .team-report .filters {position:static!important;transform:none!important;width:100%!important;max-width:none!important;margin:0!important;display:flex!important;flex-wrap:wrap;gap:8px;}
html body #app .team-report .filters>i {flex:1 1 250px;white-space:normal;line-height:1.6;color:#52657b!important;font-size:12px!important;}
html[data-xl-density] body #app .app-shell .topbar .global-context {flex:1 1 420px!important;max-width:610px!important;min-width:0!important;}
html[data-xl-density] body #app .app-shell .global-context label {min-width:0!important;}
html[data-xl-density] body #app .app-shell .global-context select {width:100%;min-width:0!important;}
html body #app .team-report .roi-scope-hint {font-size:12px!important;color:var(--xl-ref-text,#334155)!important;}
html body #app .zrtc-ownership-workbench {--asset-primary:var(--xl-ref-primary,#315e4a);--asset-primary-soft:var(--xl-control-soft,#edf4ef);--asset-muted:#52657b;}
html body #app .zrtc-table {min-width:820px!important;}
html body #app .zrtc-table :is(.zrtc-pill,.zrtc-row-actions,.zrtc-link) {white-space:nowrap!important;}
html body #app .zrtc-table .zrtc-muted {font-size:12px!important;color:#52657b!important;}
html body #app .zrtc-table td:first-child {min-width:200px;}
html body #app .zrtc-toolbar {flex-wrap:wrap;}
html body #app .zrtc-filters {flex-wrap:wrap;}
html body #app .zrtc-balance-pagination {display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:12px;padding:16px 22px;border-top:1px solid var(--xl-ref-border,#dbe6df);background:var(--xl-control-soft,#edf4ef);}
html body #app .zrtc-balance-pagination select {min-height:34px;border:1px solid var(--xl-ref-border,#cbd5e1);border-radius:6px;background:var(--xl-color-surface,#fff);color:var(--xl-ref-text,#243931);}
html body #app .zrtc-remark-button {color:var(--xl-ref-primary,#315e4a)!important;border-color:var(--xl-ref-border,#cbd5e1)!important;}
html body #app .zrtc-form-help {background:var(--xl-control-soft,#edf4ef)!important;border-color:var(--xl-ref-border,#cbd5e1)!important;color:var(--xl-ref-text,#243931)!important;}
html body .immersive-workspace .asset-grid {align-items:start!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,2fr)!important;}
html body .immersive-workspace .asset-grid>button {grid-column:1/-1;justify-self:start;}
html body .immersive-workspace .page-checklist {max-height:260px;overflow:auto;overscroll-behavior:contain;}
html body .immersive-workspace :is(.file-picker-cta,.template-guide-summary,.template-note) {background:var(--xl-control-soft,#edf4ef)!important;color:var(--xl-ref-primary,#315e4a)!important;border-color:var(--xl-ref-border,#cbd5e1)!important;}
html body :is(.landing-hint,.field-hint,.section-description,.subtitle,.task-card .muted) {font-size:12px!important;color:#52657b!important;line-height:1.6;}
html body .landing-field textarea {min-height:120px!important;resize:vertical;}
html body .landing-empty {padding:32px 20px!important;min-height:0!important;}
html body .landing-shell .side nav {display:grid;gap:3px;}
html body .landing-shell .side .nav-item {display:flex;align-items:center;gap:10px;min-height:36px;}
html body .landing-shell .side .nav-item svg {width:17px;height:17px;flex:none;}
html body .landing-shell .side .nav-title {margin:20px 10px 8px;font-size:12px;font-weight:650;}
html body .task-card-title {align-items:start;flex-wrap:wrap;}
html body .task-card-title strong {min-width:0;overflow-wrap:anywhere;flex:1 1 180px;}
html body .task-card-title small {white-space:nowrap;}
html body .ledger-view table {min-width:1900px!important;}
html body .ledger-view :is(th,td):first-child {min-width:165px;white-space:nowrap;}
html body .ledger-view :is(th,td):nth-child(4),html body .ledger-view :is(th,td):nth-child(5) {min-width:150px;max-width:220px;overflow-wrap:break-word;}
html body .ledger-view .link-summary {max-width:150px!important;width:150px;color:var(--xl-ref-primary,#315e4a)!important;}
html body .ledger-view .link-details {width:150px!important;}
html body :is(.country-option.selected,.structure-option.selected) {background:var(--xl-control-soft,#edf4ef)!important;color:var(--xl-ref-primary,#315e4a)!important;border-color:var(--xl-ref-primary,#315e4a)!important;}
html body :is(.country-option,.structure-option) input {accent-color:var(--xl-ref-primary,#315e4a);}
html body .unified-rules :is(.automation-condition-hint,.automation-stage-description,.automation-status-note) {font-size:12px!important;line-height:1.6;}
html body .automation-rule-summary {color:var(--xl-ref-text,#243931);}
html body :is(.zrtc-button,.button,button.secondary):focus-visible {outline:3px solid var(--xl-ref-primary,#315e4a);outline-offset:2px;}
html body .el-message-box__btns button {min-height:34px;}
html body .el-popper:has(.column-settings) {width:min(420px,calc(100vw - 32px))!important;max-height:min(540px,calc(100dvh - 130px))!important;overflow:auto!important;overscroll-behavior:contain;}
html body .column-settings :is(header,footer) {position:sticky;background:var(--xl-color-surface,#fff);z-index:2;}
html body .column-settings header {top:0;}
html body .column-settings footer {bottom:0;}
@media(max-width:1280px) {
  html body #app .team-report .kpis {grid-template-columns:repeat(4,minmax(0,1fr))!important;}
  html body #app .team-report .kpis article :is(b,strong) {font-size:28px!important;}
  html body #app .zrtc-ownership-workbench:not(.zrtc-balance-only) {grid-template-columns:minmax(220px,260px) minmax(0,1fr)!important;gap:12px;padding:14px!important;}
  html body .unified-rules .automation-custody-layout {grid-template-columns:minmax(0,1fr)!important;}
  html body .unified-rules .automation-rule-editor {grid-column:1!important;grid-row:1!important;border-right:0!important;}
  html body .unified-rules .automation-rule-summary {grid-column:1!important;grid-row:2!important;border-top:1px solid var(--xl-ref-border,#dbe6df);}
  html body .unified-rules .automation-rule-center {grid-column:1!important;grid-row:3!important;border-right:0!important;}
  html body .unified-rules .automation-summary-content {display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px;}
  html body .unified-rules .automation-summary-content>h4 {grid-column:1/-1;}
}
@media(min-width:1680px) {html body #app .team-report .kpis article :is(b,strong) {font-size:30px!important;}}
@media(max-width:1100px) {html[data-xl-density] body #app .app-shell .topbar .global-context {flex-basis:100%!important;max-width:none!important;}}
@media(max-width:980px) {
  html body #app .zrtc-ownership-workbench:not(.zrtc-balance-only) {grid-template-columns:minmax(0,1fr)!important;}
  html body #app .zrtc-tree {max-height:260px!important;}
}
@media(max-width:700px) {
  html body #app .team-page .drawer .form-grid {grid-template-columns:minmax(0,1fr)!important;}
  html body .immersive-workspace .asset-grid {grid-template-columns:minmax(0,1fr)!important;}
  html body .unified-rules .automation-summary-content {grid-template-columns:minmax(0,1fr);}
  html body #app .team-report .kpis {grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
