/* Shared contrast layer. Colours only, apart from explicit focus and button
   boundaries; hidden/disabled attributes and workflow gates remain authoritative. */
body.crm-type{
 --ui-ink:#18344b;--ui-muted:#475f73;--ui-border:#73889c;
 --ui-accent:#076e5b;--ui-accent-hover:#055847;--ui-link:#145c99;--ui-focus:#165fc1;
 --muted:var(--ui-muted)!important;--muted-2:#52697c!important;
}
body.crm-type :is(.eyebrow,.subhead,.emp-caption,.emp-secondary,.emp-meta,.board-guide,.board-foot,
 .no-results,.column-hint,.board-total,.review-subtitle,.review-card-hint,.review-file-count,
 .review-next-hint,.review-progress,.review-locked,.review-clarification,.review-art-label,.review-flow-arrow,
 .profile-hint,.profile-section-lead,.profile-summary dt,.partner-profile-form label>small,
 .contract-note,.contract-pack-number,.contract-print-help,.contract-row small,.contracts-toolbar>label,
 .contract-agreement-jump,.contract-workspace-meta summary,.auth-note,.auth-subtitle,
 .feed-meta,.feed-caption,.feed-endnote,.feed-brand,.auth-footnote,#auth-subtitle){color:var(--ui-muted)!important}
body.crm-type .contract-dialog{--doc-muted:var(--ui-muted);--doc-border:#b5c6d4;--doc-blue:var(--ui-link);--doc-mint:var(--ui-accent)}
body.crm-type :is(.contract-form-intro p,.contract-heading p,.contract-upload p){color:var(--ui-muted)!important}
body.crm-type :is(.profile-type,.partner-profile-form fieldset,.profile-summary,.contract-row,.mat-group){border-color:#a9bdcd}
body.crm-type :is(form label,form legend){color:var(--ui-ink)}

/* Text-entry boundaries and examples must remain visible before focus. */
body.crm-type :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),select,textarea){color:var(--ui-ink)!important;border-color:var(--ui-border)!important;background-color:#fff}
body.crm-type :is(input,textarea)::placeholder{color:#52677b!important;opacity:1!important}
body.crm-type :is(.global-search,.list-search,.column-search,.contracts-search,.messages-search){border-color:var(--ui-border)!important;background:#fff;color:var(--ui-muted)}
body.crm-type :is(input[type=checkbox],input[type=radio],input[type=range]){accent-color:var(--ui-accent)}

/* Secondary actions look like controls even without hovering. */
body.crm-type :is(.button,.icon-button,.board-tool,.open-card-button,.resolve-button,
 .review-card-open,.review-card-request,.feed-secondary,.feed-icon-button,.crm-section-back,
 .auth-secondary,.admin-secondary,.card-menu-button,.flag-button){
 color:var(--ui-ink)!important;background:#fff!important;border:1px solid var(--ui-border)!important;
 box-shadow:0 1px 3px #18344b12;opacity:1;
}
body.crm-type :is(.button,.icon-button,.board-tool,.open-card-button,.resolve-button,
 .review-card-open,.review-card-request,.feed-secondary,.feed-icon-button,.crm-section-back,
 .auth-secondary,.admin-secondary,.card-menu-button):hover:not(:disabled):not([aria-disabled=true]){
 color:#123b52!important;background:#e5f1f5!important;border-color:#25617e!important;
}
body.crm-type :is(.button-primary,.auth-primary,.admin-primary,.feed-primary,.review-next,.profile-footer .button){
 color:#fff!important;background:var(--ui-accent)!important;border:1px solid var(--ui-accent)!important;
 box-shadow:0 3px 8px #076e5b26;opacity:1;
}
body.crm-type :is(.button-primary,.auth-primary,.admin-primary,.feed-primary,.review-next,.profile-footer .button):hover:not(:disabled):not([aria-disabled=true]){
 color:#fff!important;background:var(--ui-accent-hover)!important;border-color:var(--ui-accent-hover)!important;
}
body.crm-type :is(.contract-print,.button-danger){color:#fff!important;background:#b32636!important;border:1px solid #9f1f30!important;opacity:1}
body.crm-type :is(.contract-print,.button-danger):hover:not(:disabled){background:#961b2b!important}
body.crm-type .flag-button{color:#a02535!important;border-color:#b34250!important}
body.crm-type .review-toolbar .button{padding:7px 11px;min-height:38px}
body.crm-type .intake-workspace .mat-frame{color:var(--ui-muted)}
body.crm-type .avatar-top{color:var(--ui-ink)!important}
body.crm-type :is(.message-icon-action,.messages-back,.auth-link,.admin-logout){color:var(--ui-ink)!important;background:#fff!important;border:1px solid var(--ui-border)!important}
body.crm-type #view-messages :is(.messages-online,.messages-conversation-head small,.message-meta,.message-thread-copy small,.messages-inbox-head span,.messages-count){color:var(--ui-muted)!important}
body.crm-type #view-messages .message-meta :is(span,time){color:inherit!important}
body.crm-type #view-messages :is(.message-avatar,.message-mini-avatar){background:#205e8c!important;color:#fff!important}
body.crm-type #view-messages .is-self .message-mini-avatar{background:#61468e!important}
body.crm-type #view-messages .message-send{background:var(--ui-accent)!important;color:#fff!important;border-color:var(--ui-accent)!important}
body.crm-type #view-messages .messages-filter{border:1px solid var(--ui-border);color:var(--ui-ink);background:#fff}
body.crm-type #view-messages .messages-filter.is-active{color:#fff!important;background:#205e8c!important;border-color:#205e8c}
body.crm-type #view-messages .messages-filter.is-active b{color:inherit;background:#174669}
body.crm-type .feed-mode-tabs button{color:var(--ui-muted)!important}
body.crm-type .feed-mode-tabs button.is-active{color:#153b54!important;border-bottom-color:#153b54!important}

/* An active section or selected tab has a clear edge and a dark label. */
body.crm-type #crm-navigation .nav-item{color:#28465d!important}
body.crm-type :is(#crm-navigation .nav-item,.emp-sidebar nav button){transition:box-shadow .15s,border-color .15s}
body.crm-type #crm-navigation .nav-item.is-active,
body.crm-type .emp-sidebar nav button[aria-pressed=true]{
 color:#fff!important;background:var(--ui-accent)!important;border-color:var(--ui-accent)!important;
 box-shadow:0 2px 5px #076e5b1c;
}
body.crm-type :is(#crm-navigation .nav-item.is-active,.emp-sidebar nav button[aria-pressed=true]) :is(b,.nav-icon){color:inherit!important}
body.crm-type :is(#crm-navigation .nav-item.is-active,.emp-sidebar nav button[aria-pressed=true]) b{background:#055341!important}
body.crm-type :is(.emp-sidebar nav button,.nav-item):hover:not([aria-pressed=true]):not(.is-active){background:#e9f1f5;color:#153a53}
body.crm-type :is(.contract-tabs,.contract-workspace-tabs,.filter-tabs,.feed-tabs) button{
 color:var(--ui-muted)!important;border:1px solid var(--ui-border);background:#fff;
}
body.crm-type :is(.contract-tabs,.contract-workspace-tabs,.filter-tabs,.feed-tabs) :is(button[aria-selected=true],button[aria-pressed=true],button.is-active){
 color:#074c3f!important;background:#dcefe7!important;border-color:var(--ui-accent)!important;box-shadow:inset 0 -2px var(--ui-accent);
}
body.crm-type :is(.profile-type.is-selected,.emp-order[aria-pressed=true]){border-color:var(--ui-accent);box-shadow:inset 0 0 0 1px var(--ui-accent)}
body.crm-type .profile-type.is-selected :is(strong,small){color:#164f42}
body.crm-type :is(.review-flow-step,.review-flow-step b){color:var(--ui-muted)}
body.crm-type .review-flow-step.is-current b{background:#185fa3;color:#fff}
body.crm-type .review-flow-step.is-done b{background:var(--ui-accent);color:#fff}
body.crm-type .review-card-badge{background:#e4eef9;color:#175185}
body.crm-type [data-review-state=done] .review-card-badge{background:#e0f0e8;color:#145b42}
body.crm-type .mat-filemeta a{color:var(--ui-link)!important;text-decoration:underline;text-underline-offset:3px}

/* Compact toolbars keep their geometry but no longer fade into the canvas. */
body.crm-type :is(.ak-editor,#ors-plantogram,#ors-scan-lab,.lab-tools,.lab-toolbar) button{
 color:var(--ui-ink)!important;background:#fff!important;border:1px solid var(--ui-border)!important;opacity:1;
}
body.crm-type :is(.ak-editor,#ors-plantogram,#ors-scan-lab,.lab-tools,.lab-toolbar) button[aria-pressed=true]{
 color:#074c3f!important;background:#d8eee4!important;border-color:var(--ui-accent)!important;box-shadow:inset 0 0 0 1px var(--ui-accent);
}
body.crm-type :is(.ak-editor,#ors-plantogram,#ors-scan-lab) button:hover:not(:disabled){background:#e5f1f5!important}
body.crm-type :is(.ak-rail,.pg-tools,.s3-tools,.lab-tools,.lab-toolbar) img{opacity:1!important}
body.crm-type :is(.pg-foot,.pg-ends,.s3-foot){color:var(--ui-muted)}
body.crm-type .ak-view output{color:#f5f9ff}
body.crm-type :is(.button,.icon-button,.review-card-open,.review-card-request,.review-locked) :is(.svg-icon,.review-icon){opacity:1}

/* Disabled is a readable, neutral state, never an almost invisible action. */
body.crm-type :is(button:disabled,button[aria-disabled=true],.button[aria-disabled=true]){
 opacity:1!important;color:#4d6273!important;background:#e7edf2!important;border:1px dashed #8a9eaf!important;
 box-shadow:none!important;text-shadow:none!important;cursor:not-allowed;transform:none!important;
}
body.crm-type :is(button:disabled,button[aria-disabled=true]) :is(span,small,svg){color:inherit!important;opacity:1!important}
body.crm-type :is(button:disabled,button[aria-disabled=true]) img{filter:none!important;opacity:.8!important}
body.crm-type :is(input:disabled,textarea:disabled,select:disabled){opacity:1!important;color:#4d6273!important;background:#e7edf2!important;-webkit-text-fill-color:#4d6273}
body.crm-type :is(button,a,input,select,textarea,summary,[tabindex]):focus-visible{
 outline:3px solid var(--ui-focus)!important;outline-offset:3px;box-shadow:0 0 0 2px #fff!important;
}
body.crm-type ::selection{background:#1d5a83;color:#fff}
