/* Surface/text pairs. Never repurpose --navy: existing buttons use it as a background. */
#appearance-mode-toggle{flex:0 0 36px;width:36px;height:36px;min-width:36px;min-height:36px;color:#1C3A57;border:1px solid #E4D9C8;background:#FBF8F3;padding:0}
#appearance-mode-toggle:hover{background:#F5F0E8;border-color:#B48C64}
#appearance-mode-toggle:focus-visible{outline:2px solid #1C3A57;outline-offset:3px}
.appearance-status{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.settings-preview.night{background:#1C3A57;border-color:#48617A}
body[data-crm-appearance] .email-thread-message :is(header small,header time,summary small,summary time,footer span){color:#586979!important}
body[data-crm-appearance=day] .content table th{color:#586979}
body[data-crm-appearance=day] .crm-calendar-day-events>small{color:#586979}
body[data-crm-appearance=night]{--appearance-surface:#1C3A57;--appearance-soft:#244561;--appearance-ink:#F5F0E8;--appearance-muted:#DCC4A8;--appearance-line:#48617A}
body[data-crm-appearance=night] .topbar{background:#19344E;border-color:var(--appearance-line)}
body[data-crm-appearance=night] .topbar :is(.mobile-menu,#notifications-action){color:var(--appearance-ink)}
body[data-crm-appearance=night] #appearance-mode-toggle{background:var(--appearance-soft);border-color:var(--appearance-line);color:var(--appearance-ink)}
body[data-crm-appearance=night] #appearance-mode-toggle:focus-visible{outline-color:var(--appearance-ink)}
body[data-crm-appearance=night] .content :is(.panel,.page-heading){background:var(--appearance-surface)!important;color:var(--appearance-ink);border-color:var(--appearance-line)!important;--paper:var(--appearance-surface);--line:var(--appearance-line)}
body[data-crm-appearance=night] .content .panel-title{background:var(--appearance-soft)!important;border-color:var(--appearance-line)}
body[data-crm-appearance=night] .content :is(.panel-title h2,.panel-title h3,.page-heading h1,.profile-fields-grid b,.field strong,.deal-contact-grid b,.deal-company-grid b,.deal-legacy-grid b){color:var(--appearance-ink)!important}
body[data-crm-appearance=night] .content :is(.page-heading p,.page-heading .eyebrow,.panel>.auth-hint,.panel>.empty,.panel-title .auth-hint,.profile-fields-grid small,.field>span,.deal-contact-grid small,.deal-company-grid small,.deal-legacy-grid small){color:var(--appearance-muted)!important}
/* Populated cards: the same pair applies to the inner surface and every text role. */
body[data-crm-appearance=night] .content :is(.settings-card,.tenant-user,.partner-entry,.department-thread,.deal-card,.compact-disclosure,.founder-link-item){background:var(--appearance-soft)!important;color:var(--appearance-ink)!important;border-color:var(--appearance-line)!important}
body[data-crm-appearance=night] .content :is(.settings-card h3,.settings-card h4,.tenant-user b,.partner-entry h3,.department-thread h3,.deal-card b,.founder-link-copy b,.compact-disclosure>summary){color:var(--appearance-ink)!important}
body[data-crm-appearance=night] .content :is(.settings-card p,.settings-card>label,.settings-note,.tenant-user small,.partner-entry small,.department-thread>small,.deal-card small,.founder-link-copy small){color:var(--appearance-muted)!important}
body[data-crm-appearance=night] .content .compact-disclosure>summary{background:transparent!important}
body[data-crm-appearance=night] .department-thread p{background:var(--appearance-surface);color:var(--appearance-ink)}
body[data-crm-appearance=night] .content :is(.field>a,.deal-contact-heading>button:not(.deal-contact-edit),.deal-company-grid button){color:#B8D8F0}
/* Tables have one opaque surface for headers, rows, hover and empty states. */
body[data-crm-appearance=night] .content table{background:var(--appearance-surface);color:var(--appearance-ink)}
body[data-crm-appearance=night] .content table :is(th,td){color:var(--appearance-ink);border-color:var(--appearance-line)!important}
body[data-crm-appearance=night] .content table th{background:var(--appearance-soft)!important;color:var(--appearance-muted)!important}
body[data-crm-appearance=night] .content table tbody tr:hover{background:var(--appearance-soft)!important}
body[data-crm-appearance=night] .content table a{color:#B8D8F0}
/* Neutral chat entries follow the surface; dated task status colors stay semantic. */
body[data-crm-appearance=night] .deal-timeline{background:var(--appearance-surface);color:var(--appearance-ink)}
body[data-crm-appearance=night] .timeline-entry p{background:var(--appearance-soft);color:var(--appearance-ink)}
body[data-crm-appearance=night] .timeline-entry :is(small,.timeline-email-meta){color:var(--appearance-muted)!important}
body[data-crm-appearance=night] .timeline-day{background:var(--appearance-surface)}
body[data-crm-appearance=night] .deal-inline-task{--ink:#1C3A57;--muted:#586979;color:#1C3A57}
body[data-crm-appearance=night] .deal-inline-task-heading button{color:#1C3A57}
/* Keep legal documents, email content, dialogs and status panels on paper with paper ink. */
body[data-crm-appearance=night] :is(dialog,.status-card,.email-workspace,.email-thread-message,.email-reader-body,.email-compose-body,.email-reader-crm,.deal-filter-panel,.task-list-toolbar,.deal-timeline-filters,.settings-choice-list button,.crm-calendar-toolbar,.crm-calendar-filters,.stage-picker-menu,.deal-stage-popover){--paper:#FBF8F3;--ink:#1C3A57;--navy:#1C3A57;--muted:#785537;--line:#E4D9C8;--sand:#F5F0E8;color:#1C3A57}
body[data-crm-appearance=night] dialog{background:#FBF8F3!important}
body[data-crm-appearance=night] .email-workspace .email-reader-header{color:#1C3A57}
body[data-crm-appearance=night] .content :is(.task-bulk-actions,.saved-view-bar){color:#1C3A57}
body[data-crm-appearance=night] .content :is(input,select,textarea,option){background:#FBF8F3!important;color:#1C3A57!important;border-color:#DCC4A8!important;color-scheme:light}
body[data-crm-appearance=night] .content :is(input,textarea)::placeholder{color:#647482;opacity:1}
body[data-crm-appearance=night] .content .settings-card :is(button,select){color:#1C3A57}
body[data-crm-appearance=night] .content .settings-card button.primary{color:#FFF}
body[data-crm-appearance=night] .content .settings-choice-list button :is(b,small){color:#1C3A57!important}
body[data-crm-appearance=night] .crm-calendar-day{background:var(--appearance-surface)!important;color:var(--appearance-ink)!important;border-color:var(--appearance-line)}
body[data-crm-appearance=night] .crm-calendar-day.selected,body[data-crm-appearance=night] .crm-calendar-day:hover{background:var(--appearance-soft)!important}
body[data-crm-appearance=night] .crm-calendar-day.other-month{color:var(--appearance-muted)!important}
body[data-crm-appearance=night] .crm-calendar-day-events>small{color:var(--appearance-muted)}
body[data-crm-appearance=night] .crm-calendar-weekdays{background:var(--appearance-soft);border-color:var(--appearance-line)}
body[data-crm-appearance=night] .crm-calendar-weekdays span{color:var(--appearance-muted)}
@media(pointer:coarse),(max-width:700px){#appearance-mode-toggle{flex-basis:44px;width:44px;height:44px;min-width:44px;min-height:44px}}
/* Both palettes change atomically, preventing a low-contrast frame during switching. */
body[data-crm-appearance] .content :is(.panel,.panel-title,.deal-card,.settings-card,.tenant-user){transition-property:box-shadow,transform}

/* Mailbox glyphs inherit the selected row color; the icon has no separate tile. */
#email-workspace-mailboxes .email-workspace-mailbox-icon{background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;color:inherit!important}
#email-workspace-mailboxes .email-workspace-mailbox-icon svg{color:inherit}

#record-saved-notice{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 18px 12px;padding:10px 12px;border:1px solid #DCC4A8;border-radius:7px;background:#FBF8F3;color:#1C3A57;font:500 12px/1.55 Montserrat,sans-serif;overflow-wrap:anywhere}
#record-saved-notice>span{flex:1 1 240px;min-width:0}
#record-saved-notice>button{flex:0 0 auto;min-height:36px;border:1px solid #DCC4A8;border-radius:6px;background:#F5F0E8;color:#1C3A57;font:600 11px Montserrat,sans-serif;padding:7px 10px}
@media(pointer:coarse){#record-saved-notice>button{min-height:44px}}

#record-dialog .eyebrow{color:#785537!important}
#record-dialog :is([data-clipboard-summary-status],[data-financial-year-for]){color:#586979!important}

#duplicate-review-dialog .eyebrow{color:#785537!important}
#duplicate-review-dialog #duplicate-review-list small:not(.duplicate-exact-match):not(.duplicate-richest){color:#586979!important}
#duplicate-review-dialog .duplicate-exact-match{color:#15754E!important}

#record-dialog .dialog-heading::before{content:'';position:absolute;left:0;right:0;top:-24px;height:24px;background:inherit;pointer-events:none}
#record-saved-notice{width:fit-content;max-width:min(900px,calc(100% - 36px))}
@media(max-width:700px){#record-dialog .dialog-heading::before{top:-18px;height:18px}}

.related-link-controls{padding:0 16px 14px;min-width:0}
.related-link-status{color:var(--appearance-muted,#586979);font-size:11px;line-height:1.55;overflow-wrap:anywhere}
.related-link-controls button{min-height:36px;white-space:normal}
#related-organizations-list .related-organization-main small{color:#586979!important}
@media(pointer:coarse){.related-link-controls button{min-height:44px}}

/* Contact history is a standalone glyph. Preserve its existing click target. */
body button.contact-note-star[data-contact-notes][type=button]{background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;color:#586979!important}
body button.contact-note-star[data-contact-notes][type=button].has-history{color:#2878BD!important}
body button.contact-note-star[data-contact-notes][type=button]:hover{color:#1C3A57!important;background:transparent!important;box-shadow:none!important}
body button.contact-note-star[data-contact-notes][type=button]:focus-visible{outline:2px solid #1C3A57;outline-offset:2px}
body[data-crm-appearance=night] .content button.contact-note-star[data-contact-notes][type=button]{color:#DCC4A8!important}
body[data-crm-appearance=night] .content button.contact-note-star[data-contact-notes][type=button].has-history{color:#B8D8F0!important}
body[data-crm-appearance=night] .content button.contact-note-star[data-contact-notes][type=button]:hover{color:#F5F0E8!important}
body[data-crm-appearance=night] .content button.contact-note-star[data-contact-notes][type=button]:focus-visible{outline-color:#F5F0E8}

#related-organizations-list>.empty{color:var(--appearance-muted,#586979)!important}
@media(pointer:coarse){#related-organizations-panel button{min-height:44px}}

body[data-crm-appearance=night] #related-organizations-list .related-organization-card{background:var(--appearance-soft)!important;border-color:var(--appearance-line)!important;border-left-color:#B48C64!important;color:var(--appearance-ink)}
body[data-crm-appearance=night] #related-organizations-list .related-organization-main button{color:#B8D8F0!important}
body[data-crm-appearance=night] #related-organizations-list .related-organization-main small{color:var(--appearance-muted)!important}
body[data-crm-appearance=night] #related-organizations-list .related-organization-reasons span{background:#19344E;color:var(--appearance-muted)}


/* Pipeline selection belongs beside the board/list controls, not across the board. */
#deal-pipeline-select-row{display:block;flex:0 1 260px;width:260px;min-width:180px;max-width:100%;margin:0;position:relative}
#deal-pipeline-select-row .pipeline-picker-caption{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#deal-pipeline-picker{width:100%;max-width:100%;min-width:0;min-height:40px;padding:8px 32px 8px 12px;border:1px solid #DCC4A8;border-radius:8px;background:#FBF8F3;color:#1C3A57;font:500 13px/1.4 Montserrat,sans-serif;text-overflow:ellipsis}
#deal-pipeline-picker:focus-visible{outline:2px solid #B48C64;outline-offset:2px}
#deal-view-switch{color:#1C3A57!important;--ink:#1C3A57;--muted:#586979}
#deal-view-switch .deal-toolbar-more>summary{color:#1C3A57!important}
body[data-crm-appearance] .content .back-to-dashboard{color:var(--appearance-muted,#785537)!important}
body[data-crm-appearance] .content .back-to-dashboard:hover{color:var(--appearance-ink,#1C3A57)!important}
body[data-crm-appearance] .content .back-to-dashboard:focus-visible{outline:2px solid var(--appearance-ink,#1C3A57);outline-offset:3px}
@media(max-width:700px){#deal-pipeline-select-row{flex:0 1 auto;max-width:100%;width:260px}}
@media(pointer:coarse){#deal-pipeline-picker{min-height:44px}}

/* Readable profile and department labels on their actual theme surfaces. */
#profile-section .profile-page-avatar{background:linear-gradient(135deg,#1C3A57,#244561);color:#FBF8F3}
#calendar-section .auth-hint{color:#586979}
body[data-crm-appearance=night] #profile-section .profile-settings-grid small{color:var(--appearance-muted)}
body[data-crm-appearance=night] #profile-section .profile-avatar-content dt{color:var(--appearance-muted)}
body[data-crm-appearance=night] #profile-section .profile-avatar-content dd{color:var(--appearance-ink)}
body[data-crm-appearance=night] #profile-section .profile-security-option{background:var(--appearance-soft);border-color:var(--appearance-line);color:var(--appearance-ink)}
body[data-crm-appearance=night] #profile-section .profile-security-option b{color:var(--appearance-ink)}
body[data-crm-appearance=night] #profile-section .profile-security-option :is(p,small){color:var(--appearance-muted)}
body[data-crm-appearance=night] #profile-performance>.empty{color:var(--appearance-muted)}
body[data-crm-appearance=night] #department-overview-panel>.department-overview-details>summary b{color:var(--appearance-ink)}
body[data-crm-appearance=night] #department-overview-panel>.department-overview-details>summary span{color:var(--appearance-muted)}

.core-list-controls{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:10px 18px;border-bottom:1px solid var(--appearance-line,#E4D9C8)}
.core-list-status{flex:1 1 200px;min-width:0;margin:0;color:var(--appearance-muted,#586979);font:500 12px/1.5 Montserrat,sans-serif;overflow-wrap:anywhere}
.core-list-controls button{flex:0 0 auto;min-height:36px;padding:7px 10px;border:1px solid #DCC4A8;border-radius:6px;background:#FBF8F3;color:#1C3A57;font:600 11px/1.4 Montserrat,sans-serif}
.core-list-controls button:focus-visible{outline:2px solid var(--appearance-ink,#1C3A57);outline-offset:2px}
@media(pointer:coarse){.core-list-controls button{min-height:44px}}

.record-lookup-field{min-width:0}
.record-lookup-field>label{display:grid;gap:6px}
.record-lookup-controls{margin-top:7px;min-width:0}
.record-lookup-query{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;align-items:stretch}
.record-lookup-query input{width:100%;min-width:0;margin:0;font-size:12px}
.record-lookup-controls button{min-height:36px;font-size:11px;padding:7px 10px}
.record-lookup-status{margin:6px 0;color:#586979;font:500 11px/1.5 Montserrat,sans-serif;overflow-wrap:anywhere}
.record-lookup-status[role=alert]{color:#9C2F2B}
@media(pointer:coarse){.record-lookup-controls :is(button,input){min-height:44px}}

body[data-crm-appearance=day] #list-section #list-head th{color:#1C3A57}

/* Contact field actions are compact, borderless and paired with the paper dialog. */
#record-dialog .contact-field-clear-row{display:flex;align-items:center;gap:6px;width:100%;min-width:0}
#record-dialog .contact-field-clear-row>:is(input,textarea,.phone-fields){flex:1 1 0;min-width:0;width:0}
#record-dialog .contact-field-clear{flex:0 0 36px;width:36px;height:36px;min-width:36px;min-height:36px;padding:0;display:inline-flex;align-items:center;justify-content:center;border:0!important;background:transparent!important;box-shadow:none!important;color:#586979!important}
#record-dialog .contact-field-clear[hidden]{display:none}
#record-dialog .contact-field-clear .ui-icon{width:18px;height:18px}
#record-dialog .contact-field-clear:hover,#record-dialog .contact-field-clear[aria-pressed=true]{color:#1C3A57!important}
#record-dialog .contact-field-clear:focus-visible{outline:2px solid #1C3A57;outline-offset:2px}
#record-dialog .contact-field-clear-status{font:500 11px/1.5 Montserrat,sans-serif;color:#785537;overflow-wrap:anywhere}
@media(pointer:coarse){#record-dialog .contact-field-clear{flex-basis:44px;width:44px;height:44px;min-width:44px;min-height:44px}}

#record-dialog .contact-field-clear-row:has(textarea){align-items:flex-start}

#record-dialog .contact-field-clear-row[data-pending-clear=true] :is(input,textarea)::placeholder{color:#785537;opacity:1;font-size:12px;font-weight:500}

/* Readability audit 2026-10-09: keep text and its containing surface paired. */
body[data-crm-appearance=day]{--muted:#586979}
body[data-crm-appearance] .content .field>span{color:#586979}
body[data-crm-appearance] :is(.deal-filter-panel,.task-list-toolbar) label,
body[data-crm-appearance] .task-toolbar-selected-count{color:#586979}
body[data-crm-appearance] dialog .eyebrow{color:#785537!important}
/* State remains apparent through its border/fill; opacity must not erase labels. */
body[data-crm-appearance] :is(.content,dialog) :is(button,input,select,textarea):disabled{opacity:1!important;color:#586979!important;background:#F0EDE7!important;border-color:#B8B4AD!important;cursor:not-allowed}
body[data-crm-appearance] :is(.content,dialog) button.primary:disabled{color:#FFFFFF!important;background:#53677A!important}
body[data-crm-appearance] #deal-bulk-actions{--ink:#1C3A57;--muted:#586979;color:#1C3A57}
body[data-crm-appearance] #deal-selected-count{color:#1C3A57!important}
body[data-crm-appearance] .content :is(.deal-responsibilities-heading,.deal-responsible-primary,.deal-responsible-person){--muted:#586979;--ink:#1C3A57;color:#1C3A57}
body[data-crm-appearance] .content :is(.deal-responsible-person,.deal-responsible-primary) b{color:#1C3A57!important}
body[data-crm-appearance] .deal-chat-dropzone{--muted:#586979}
body[data-crm-appearance=night] .content .panel{--ink:var(--appearance-ink);--muted:var(--appearance-muted)}
body[data-crm-appearance=night] .content .field>span{color:var(--appearance-muted)}
body[data-crm-appearance=night] .content :is(.muted-value,.department-team-lead>small,.record-title-disclosure>summary){color:var(--appearance-muted)!important}
body[data-crm-appearance=night] .department-team-members>summary{color:var(--appearance-ink)}
body[data-crm-appearance=night] .content .field a{color:#B8D8F0}
body[data-crm-appearance=night] :is(#client-rating-panel,#contact-chat-panel) h3{color:var(--appearance-ink)}
body[data-crm-appearance=night] #contact-chat-panel :is(label,.contact-message-confirmation,.contact-message-entry header){color:var(--appearance-muted)}
body[data-crm-appearance=night] .contact-message-entry :is(header>span,p){color:var(--appearance-ink)}
body[data-crm-appearance=night] .deal-chat-compose>label{color:var(--appearance-muted)}
body[data-crm-appearance=night] .content table tbody tr,
body[data-crm-appearance=night] .content table tbody tr:nth-child(even){background:var(--appearance-surface)}
body[data-crm-appearance=night] .content table tbody tr:is(:hover,.selected,[aria-selected=true]){background:var(--appearance-soft)!important}
/* Avoid a pale inherited title on the paper-backed responsible user tile. */
body[data-crm-appearance=night] .content :is(.deal-responsibilities-heading,.deal-responsible-primary,.deal-responsible-person){--muted:#586979;--ink:#1C3A57}
body[data-crm-appearance=night] .content :is(.deal-timeline-filters,.deal-filter-panel,.task-list-toolbar,.email-workspace,.email-reader-crm){--ink:#1C3A57;--muted:#586979}
body[data-crm-appearance=night] #deal-drafts-list small{color:var(--appearance-muted)}
body[data-crm-appearance=night] #dashboard-section .empty{color:var(--appearance-muted)}
body[data-crm-appearance=night] :is(#dashboard-calendar-all,#dashboard-attention-all){color:var(--appearance-ink)}
body[data-crm-appearance] .calendar-connect-step>span{background:#1C3A57;color:#FFFFFF}
body[data-crm-appearance] .calendar-provider small{color:#586979}
body[data-crm-appearance] .content .deal-responsible-summary{--muted:#586979;color:#1C3A57}
body[data-crm-appearance] .content .field>span{color:#586979!important}
body[data-crm-appearance=night] .content .field>span{color:var(--appearance-muted)!important}
body[data-crm-appearance] .content table tbody tr{transition:none!important}
/* Metric cards share the active surface/ink pair; document dialogs retain paper styles. */
body[data-crm-appearance=day] :is(.partner-rating-summary,.money-summary,.finance-summary)>article{--ink:#1C3A57;--muted:#586979;color:#1C3A57}
body[data-crm-appearance=day] .partner-rating-summary>article :is(span,small){color:#586979!important}
body[data-crm-appearance=night] .content :is(.partner-rating-summary,.money-summary,.finance-summary)>article{--ink:var(--appearance-ink);--muted:var(--appearance-muted);--summary-bad:#FFA2AC;--summary-good:#29DB8A;--summary-steady:#FFB74D;background:var(--appearance-soft);border-color:var(--appearance-line);color:var(--appearance-ink)}
body[data-crm-appearance=night] .content :is(.partner-rating-summary,.money-summary,.finance-summary)>article :is(strong,b){color:var(--appearance-ink)}
body[data-crm-appearance=night] .content :is(.partner-rating-summary,.money-summary,.finance-summary)>article :is(span,small){color:var(--appearance-muted)!important}
body[data-crm-appearance=night] .content :is(.partner-rating-summary,.money-summary,.finance-summary)>article.zone-red strong{color:var(--summary-bad)}
body[data-crm-appearance=night] .content :is(.partner-rating-summary,.money-summary,.finance-summary)>article.zone-green strong{color:var(--summary-good)}
body[data-crm-appearance=night] .content :is(.partner-rating-summary,.money-summary,.finance-summary)>article [data-metric-tone=bad]{color:var(--summary-bad)!important}
body[data-crm-appearance=night] .content :is(.partner-rating-summary,.money-summary,.finance-summary)>article [data-metric-tone=good]{color:var(--summary-good)!important}
body[data-crm-appearance=night] .content :is(.partner-rating-summary,.money-summary,.finance-summary)>article [data-metric-tone=steady]{color:var(--summary-steady)!important}
body[data-crm-appearance=day] .content :is(.panel-title .auth-hint,.empty-state>span){color:#586979}
body[data-crm-appearance=day] .legal-workspace-heading small,
body[data-crm-appearance=day] .legal-section-kicker{color:#785537}
body[data-crm-appearance=night] :is(.legal-workspace-heading small,.legal-section-kicker,.legal-dd-heading p){color:var(--appearance-muted)}
body[data-crm-appearance=night] :is(.legal-dd-heading h3,.official-forms>h3,.commercial-analytics-metrics b){color:var(--appearance-ink)}
body[data-crm-appearance=night] .content .partner-entry>button{color:var(--appearance-ink)}
body[data-crm-appearance=night] .content .partner-entry a{color:#B8D8F0}
body[data-crm-appearance=night] .content .official-forms>.auth-hint{color:var(--appearance-muted)}
/* Branch hints live inside a content wrapper, not directly under the panel. */
body[data-crm-appearance=night] #similar-organizations-content .auth-hint{color:var(--appearance-muted)}
body[data-crm-appearance] .content .empty-state{--ink:#1C3A57;--muted:#586979;color:#1C3A57}
body[data-crm-appearance] .content .empty-state>span{color:#586979!important}
body[data-crm-appearance=night] .settings-intro,
body[data-crm-appearance=night] .settings-save-status,
body[data-crm-appearance=night] .settings-field{color:var(--appearance-muted)}
body[data-crm-appearance=night] .profile-access-block{--ink:#1C3A57;color:#1C3A57}
body[data-crm-appearance=night] .profile-access-block b{color:#1C3A57}
body[data-crm-appearance=night] .profile-facts-grid .empty{color:var(--appearance-muted)}
body[data-crm-appearance] #record-dialog :is(.task-deadline header>small,.task-deadline>p,[data-document-deal-status]){color:#586979!important}
/* Mail is paper-backed in both themes, including labels of disabled actions. */
body[data-crm-appearance] .email-workspace :is(.email-folder-list b,.email-mailbox-other>summary>span,.email-organizer-empty,#email-workspace-address,.email-message-copy time,.email-message-copy>small,.email-reader-crm-links small){color:#586979!important}
body[data-crm-appearance] #email-reader-mailbox{color:#785537}
body[data-crm-appearance] #email-bulk-actions button:disabled>span{color:#586979!important}
/* Calendar has opaque paired surfaces independent of the desktop wallpaper. */
body[data-crm-appearance=day] :is(.crm-calendar-filters>small,.crm-calendar-weekdays span,.crm-calendar-selected-day small,.crm-calendar-selected-day header>span,.crm-calendar-day.other-month .crm-calendar-day-number){color:#586979!important}
body[data-crm-appearance=day] .crm-calendar-weekdays span.weekend{color:#785537!important}
body[data-crm-appearance=night] :is(.crm-calendar-toolbar,.crm-calendar-filters){background:var(--appearance-surface);color:var(--appearance-ink)}
body[data-crm-appearance=night] .crm-calendar-date-nav h3{color:var(--appearance-ink)}
body[data-crm-appearance=night] :is(.crm-calendar-filters label,.crm-calendar-filters>small,.crm-calendar-legend span){color:var(--appearance-muted)}
body[data-crm-appearance=night] .crm-calendar-selected-day{background:var(--appearance-soft);color:var(--appearance-ink)}
body[data-crm-appearance=night] .crm-calendar-selected-day>header :is(h3,span,small){color:var(--appearance-ink)}
body[data-crm-appearance] .content .panel .empty{color:var(--muted,#586979)}
body[data-crm-appearance] .content .field strong>span:not([class]){color:#586979!important}
body[data-crm-appearance=night] .content .field strong>span:not([class]){color:var(--appearance-muted)!important}
body[data-crm-appearance=night] .record-name-disclosure>summary{color:var(--appearance-muted)}
body[data-crm-appearance=night] #deal-related-records h3{color:var(--appearance-ink)}
body[data-crm-appearance=night] .deal-timeline .timeline-entry{background:var(--appearance-surface);color:var(--appearance-ink);border-color:var(--appearance-line)}
body[data-crm-appearance=night] .timeline-entry-header :is(b,time){color:var(--appearance-ink)}
body[data-crm-appearance] :is(.documents-edo-block p,.organization-document-entry small){color:#586979!important}
body[data-crm-appearance=night] :is(#dashboard-calendar-all,#dashboard-attention-all){background:var(--appearance-soft)!important;border-color:var(--appearance-line)}
body[data-crm-appearance] .content .compact-empty{--muted:#586979;color:#586979}
body[data-crm-appearance=night] #deal-related-records h3>span{background:var(--appearance-soft);color:var(--appearance-ink)}
body[data-crm-appearance=night] #commercial-analytics-summary>.count-badge{background:var(--appearance-soft);color:var(--appearance-ink)}
body[data-crm-appearance=night] .finance-columns>section{background:var(--appearance-surface);color:var(--appearance-ink)}
body[data-crm-appearance=night] .legal-results-heading small{color:#586979}
body[data-crm-appearance=night] .legal-form-section{--ink:#1C3A57;--muted:#586979;color:#1C3A57}
body[data-crm-appearance=night] .legal-form-section :is(label,small){color:#586979}
body[data-crm-appearance=night] .smm-analytics-toolbar{--muted:#586979;color:#1C3A57}
body[data-crm-appearance] .smm-platform-analytics{--ink:#1C3A57;--navy:#1C3A57;--muted:#586979;color:#1C3A57}
body[data-crm-appearance=night] #smm-workspace-panel .smm-ranking-note{color:var(--appearance-muted)}
body[data-crm-appearance] .tenant-user.inactive{opacity:1}
body[data-crm-appearance=night] .tenant-users-search>label{color:var(--appearance-muted)}
body[data-crm-appearance=night] .profile-access-block>h3{color:var(--appearance-ink)}
body[data-crm-appearance=night] .profile-access-block>div{--muted:#586979;color:#1C3A57}
body[data-crm-appearance=night] .profile-access-block p{color:#586979}
body[data-crm-appearance=night] .crm-calendar-selected-day,
body[data-crm-appearance=night] .crm-calendar-selected-day>header{background:var(--appearance-soft)!important}
/* Group panels share night surface/text roles. :where keeps specific department variants authoritative. */
body[data-crm-appearance=night] .content :is(.finance-columns,:where(#department-section) .partner-columns)>section{background:var(--appearance-surface)!important;color:var(--appearance-ink);border-color:var(--appearance-line)!important}
body[data-crm-appearance=night] .content :is(.finance-columns,:where(#department-section) .partner-columns)>section>h3{color:var(--appearance-ink)!important}
body[data-crm-appearance=night] .legal-queue-card{--muted:#586979;color:#1C3A57}
body[data-crm-appearance=night] .legal-queue-card small{color:#586979}
body[data-crm-appearance=night] .tenant-users-search label{color:var(--appearance-muted)}
body[data-crm-appearance=night] .content .profile-access-block>h3{color:var(--appearance-ink)!important}
body[data-crm-appearance] #department-workspace-nav>button{color:#586979}
body[data-crm-appearance=night] .content .profile-two-columns h3{color:var(--appearance-ink)}
body[data-crm-appearance=night] .content .price-catalog-row label{color:var(--appearance-ink)}
body[data-crm-appearance=night] #legal-dd-preview{--muted:#586979}
body[data-crm-appearance=night] #smm-channels-list>.auth-hint{color:var(--appearance-muted)}
body[data-crm-appearance=night] .content .tenant-users-search label{color:var(--appearance-muted)}
body[data-crm-appearance] :is(.email-domain-heading,.email-navigation-heading b){color:#586979}
body[data-crm-appearance] #library-workspace{--ink:#1C3A57;--navy:#1C3A57;--muted:#586979;color:#1C3A57}
body[data-crm-appearance] .library-material-link>em{color:#785537}
body[data-crm-appearance=night] .content #profile-performance .profile-two-columns h3{color:var(--appearance-ink)!important}
body[data-crm-appearance=night] .content #tenant-users-panel .tenant-users-search label{color:var(--appearance-muted)!important}
body[data-crm-appearance=night] #scout-section .auth-hint{color:var(--appearance-muted)}
body[data-crm-appearance=night] #scout-section .scout-card{--ink:#1C3A57;--muted:#586979;color:#1C3A57}
body[data-crm-appearance=night] .scout-detail a{color:#B8D8F0}
body[data-crm-appearance] .employee-department-summary{color:#586979!important}
body[data-crm-appearance] .board-column-heading span{background:transparent}
body[data-crm-appearance] .board-column-heading small{opacity:1}
body[data-crm-appearance] .board-card-footer{color:#785537}
body[data-crm-appearance] .sidebar .avatar:not(:has(img)){color:#FFFFFF;background:#244561}
body[data-crm-appearance] .auth-brand small{color:#785537}
body[data-crm-appearance=night] .content #profile-performance h3{color:var(--appearance-ink)!important}
body[data-crm-appearance=night] .timeline-entry .refusal-reason-label{color:#FFB4A8!important}
body[data-crm-appearance] #crm-guide-progress,
body[data-crm-appearance] #crm-guide button:disabled{color:#586979}
body[data-crm-appearance=night] .content #management-workspace-panel .official-forms h3{color:var(--appearance-ink)!important}
body[data-crm-appearance] .calendar-item{--ink:#1C3A57;--muted:#586979;color:#1C3A57}
body[data-crm-appearance] .calendar-item-open :is(b,time,small){color:#1C3A57}
body[data-crm-appearance=night] .crm-calendar-agenda-group{background:var(--appearance-soft)!important}
body[data-crm-appearance=night] #calendar-list .crm-calendar-agenda-group>h3{background:var(--appearance-soft);color:var(--appearance-ink)}

body[data-crm-appearance] :is(#department-reworks-notice,#smm-action-notice).auth-error{color:#9b2c27!important}
body[data-crm-appearance=night] #department-reworks-list .department-reworks-page-note{color:var(--appearance-muted)}
.crm-confirm-details-text{white-space:pre-wrap;overflow-wrap:anywhere;color:#1C3A57;font-size:12px;line-height:1.5}

/* Existing document anchors keep clear of both sticky layers in preview/read-only mode.
   Dialog scroll padding and ordinary-mode component offsets retain their own rules. */
body.read-only-mode .content :is(.settings-card[id],#department-section>.panel,#scout-detail,#scout-detail>.panel,#smm-action-notice){scroll-margin-top:calc(var(--crm-topbar-height,64px) + var(--crm-readonly-banner-height,46px) + 12px)}

/* Department navigation uses the shared night palette in every workspace. */
body[data-crm-appearance=night] #department-workspace-nav{background:var(--appearance-surface);border-color:var(--appearance-line)}
body[data-crm-appearance=night] #department-workspace-nav>button{color:var(--appearance-ink)}
body[data-crm-appearance=night] #department-workspace-nav>button:is(:hover,[aria-pressed=true]){background:var(--appearance-soft);border-color:var(--appearance-line);color:var(--appearance-ink)}
body[data-crm-appearance=night] #department-workspace-nav>button:focus-visible{outline-color:var(--appearance-muted)}

/* API cards follow the workspace theme; technical details keep one full row. */
#internal-api-integrations .api-integration-card>.compact-disclosure{grid-column:1/-1;min-width:0}
body[data-crm-appearance=night] .content #internal-api-integrations .api-integration-card{background:var(--appearance-soft)!important;color:var(--appearance-ink);border-color:var(--appearance-line)}
body[data-crm-appearance=night] .content #internal-api-integrations .api-integration-card.ready{border-color:#70BF9C}
body[data-crm-appearance=night] .content #internal-api-integrations .api-integration-card :is(b,small){color:var(--appearance-ink)}

/* Confirmed empty internal history only; pending/error never means empty. */
body button.contact-note-star[data-contact-notes][type=button][data-note-state="empty"]{color:#87939D!important}
body[data-crm-appearance=night] .content button.contact-note-star[data-contact-notes][type=button][data-note-state="empty"]{color:#91A0AE!important}
