/* CRM-wide readability. Semantic surface colors, not a blanket foreground override. */
:root{--crm-ink:#1E40AF;--crm-secondary:#475569;--crm-link:#1D4ED8;--crm-line:#CBD5E1;--muted:#475569;--border:#CBD5E1}
body{color:var(--crm-ink)}
input,select,textarea{color:var(--crm-ink);border-color:#64748B}
input::placeholder,textarea::placeholder{color:#475569;opacity:1}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #2563EB;outline-offset:3px}
.primary,button.primary{background:#2563EB;border-color:#2563EB;color:#ffffff}.primary:hover,button.primary:hover{background:#1D4ED8;border-color:#1D4ED8}
.muted,.caption,.eyebrow,.stat-label,.stat small,.pipeline-heading p,.filter-caption,.toolbar select,.column-empty,.empty,.empty p,.topbar-workspace,footer,.profile small,.today-label{color:var(--crm-secondary)}
label,legend{color:var(--crm-ink)}
.table-wrap th,.directory-table th,.settings-content th,.control-table th,.task-list-table th,.permission-matrix th,.api-reference-panel th{color:#475569;background:#EFF6FF;border-color:#CBD5E1}
.table-wrap td,.directory-table td,.settings-content td,.control-table td,.task-list-table td,.api-reference-panel td{color:#1E40AF;border-bottom-color:#E2E8F0}
.directory-table,.directory-table td,.directory-table th{font-size:13px!important}
.panel,.lead-card,.control-stat,.control-table-wrap,.settings-content>.panel,.entity-properties,.entity-activity,.task-filter-panel,.crm-new-lead-dialog,.role-chip,.api-reference-panel{border-color:var(--crm-line)}
.badge,.tag,.subtle-badge{color:#475569;border-color:#CBD5E1}
.success,.badge.success,.entity-primary-badge,.market-installed-mark,.task-card-access{color:#176647}
.danger,.error,.badge.overdue,.card-task.is-overdue,.task-card-when.is-overdue{color:#b12f49}
.segmented button,.compact-filters select,.topbar-search #filter-count{color:#475569}
/* Keep the compact dark rail legible without changing its width. */
.sidebar{--crm-secondary:#DBEAFE;--crm-ink:#F8FAFC;--crm-link:#DBEAFE}
.sidebar .nav button{color:#DBEAFE}.sidebar .nav button>.rail-label{font-size:11px;line-height:1.35;letter-spacing:0;max-width:62px}
.sidebar .nav button.active{color:#ffffff}.sidebar .nav-icon{color:#DBEAFE}
.nav-badge,.nav button .nav-badge{font-size:11px;min-width:17px;min-height:17px;line-height:17px;color:#ffffff;background:#bf3554}
.sidebar .profile small,.sidebar .workspace-label,.sidebar .sidebar-note p{color:#DBEAFE}
/* Pipeline cards and search/filter popovers. */
.column-head h3{color:#334155}.stage-total,.card-owner,.compact-card-top time,.card-phone,.card-value,.card-customer,.card-task,.card-custom-fields>span,.compact-summary>div>span{color:#475569}
.compact-summary>div>span,.topbar-total{color:#475569}.pipeline-shell footer{color:#475569}
.card-title{color:#1D4ED8}.card-value{font-size:13px;font-weight:550}.compact-card-footer{gap:5px;flex-wrap:wrap}.tag{line-height:1.35}.card-task.is-overdue{color:#b12f49}
.lead-filter-dialog header p,.lead-filter-layout>aside h3,.lead-filter-layout>aside p,.lead-filter-section>span,.lead-filter-field label small,.filter-section-hint,.filter-group .lead-filter-section>div>span,.filter-group .lead-filter-section>b,.filter-query-box kbd,.preview-status,.preview-meta,.preview-contact,.preview-stage,.preview-owner{color:#475569}
.lead-filter-field>label,.lead-filter-dialog input,.lead-filter-dialog select,.lead-filter-field>[data-filter-op],.lead-filter-dialog .filter-view-switch button{color:#1D4ED8}
.lead-filter-dialog input,.lead-filter-dialog select{border-color:#94A3B8}.filter-value-row>span{color:#475569}
.crm-select-results,.crm-duplicate-group small,.crm-new-lead-dialog #new-lead>.caption,.crm-new-lead-summary>span,.crm-card-appearance small{color:#475569}
.crm-bulk-toolbar>button,.crm-bulk-toolbar>strong,.crm-action-menu button{color:#1D4ED8}
/* Deal properties, timeline, task composer and child dialogs. */
.deal-property-header{--crm-secondary:#DBEAFE;--crm-ink:#F8FAFC;--crm-link:#DBEAFE}
.deal-id,.deal-property-header>label,.deal-group-tabs button{color:#DBEAFE}.deal-id>span,.deal-property-header input,.deal-property-header select,.deal-group-tabs button.active{color:#ffffff}
.deal-field label,.deal-field>span,.deal-field small,.deal-manage-fields,.deal-person,.deal-contact-block dl,.deal-property-save>span,.deal-activity-header span,.deal-history-tabs button,.event-content header,.event-content header span,.event-content>small,.event-events .event-content p,.compose-top>span,.deal-task-item>span,.deal-task-item small,.deal-subdialog p,.field-manager-list small,.field-manager-list>button>span:last-child{color:#475569}
.deal-field input,.deal-field select,.deal-field textarea,.deal-subdialog input,.deal-subdialog textarea,.deal-subdialog select,.deal-subdialog label,.event-content header strong,.deal-contact-details dt{color:#1D4ED8}
.deal-field input,.deal-field select,.deal-field textarea,.deal-value-control,.deal-contact-details input,.deal-subdialog input,.deal-subdialog textarea,.deal-subdialog select{border-color:#94A3B8}
.deal-history-tabs button.active,.deal-history-tabs button[aria-selected=true]{color:#1D4ED8}.deal-composer,.deal-property-card,.deal-contact-block,.deal-subdialog,.deal-task-card,.event-note .event-content{border-color:#CBD5E1}
.event-note .event-content{color:#334155}.compose-task input,.compose-task select,.compose-top select{color:#1D4ED8}
.deal-contact-block .entity-card-actions button,.entity-card-actions button,.entity-section-heading button,.entity-empty-company>button{color:#1D4ED8}
.entity-section-heading h3>span,.entity-card-actions,.entity-empty p,.entity-empty-company>p,.entity-company dt,.entity-picker-results small,.entity-directory-row small,.entity-record-form>.entity-editor-hint,.entity-activity>header span,.entity-note>div,.entity-related-deal small,.directory-missing,.directory-table .directory-cell-created_at,.directory-table .directory-cell-updated_at{color:#475569}
.entity-properties>header{--crm-ink:#ffffff;--crm-secondary:#EFF6FF}.entity-properties>header span{color:#EFF6FF}
/* Tasks: date/author/status information stays readable. */
.task-card-contact small,.task-card-when,.task-card-author,.task-card-owner,.task-card-type,.task-card-description,.task-card-result,.task-date-nav small,.task-empty-group,.task-editor-context small,.task-type-row small,.task-calendar-grid>section>header button,.task-day-view>section>button{color:#475569}
.task-card{border-color:#CBD5E1}.task-stage{color:#334155;border-color:#CBD5E1}.task-month-item,.task-calendar-grid>section>[data-day-task]{color:#1D4ED8}
.task-toolbar button,.task-filter-panel label,.task-search>button{color:#1D4ED8}.task-toolbar button.primary{color:#ffffff}.task-editor input,.task-editor select,.task-editor textarea{color:#1E40AF;border-color:#94A3B8}
.task-card-when.overdue,.task-card-when.is-overdue{color:#b12f49}
/* Settings, role matrices and permission hints. */
.role-section-head p,.builtin-roles>span,.builtin-roles small,.role-chip strong,.role-chip span,.role-empty,.role-settings>.caption,.drawer-toolbar button,.drawer-role-chips>span,.drawer-role-chips>button,.drawer-rights-tools button,.settings-drawer .permission-check,.settings-drawer .caption,.drawer-footnote,.permission-check,.permission-unavailable,.settings-drawer .permission-unavailable{color:#475569}
.settings-drawer .rights-matrix thead th{color:#475569}.settings-drawer .rights-legend{font-size:12px!important;color:#475569!important;line-height:1.5}
.settings-subnav button{color:#475569}.settings-subnav button.active{color:#1D4ED8}.settings-drawer input,.settings-drawer select{color:#1D4ED8;border-color:#94A3B8}
.settings-drawer .drawer-toolbar button.primary{color:#ffffff;background:#2563EB;border-color:#2563EB}
/* Inbox retains its purple identity, including pale internal notes. */
.inbox-page-head>div>span:first-child,.inbox-conversation-top time,.inbox-conversation-bottom,.inbox-thread-head>div>span,.inbox-live-dot,.inbox-history-start,.inbox-bubble>footer,.inbox-bubble footer .message-state,.inbox-compose footer small,.inbox-context-label,.inbox-context-event small,.inquiry-card small,.inquiry-card time,.inbox-queue button,.inbox-queue-count,.inbox-day-divider,.inbox-event-meta,.inbox-customer-meta,.inbox-related-task small{color:#475569}
.inbox-conversation,.inbox-bubble,.inbox-compose,.inbox-context-section,.inquiry-card{border-color:#CBD5E1}.inbox-bubble blockquote{color:#475569;border-color:#93C5FD}
.inbox-compose input,.inbox-compose textarea,.inbox-search input{color:#334155;border-color:#94A3B8}.inbox-compose input::placeholder,.inbox-compose textarea::placeholder,.inbox-search input::placeholder{color:#475569}
.inbox-conversation-bottom b,.inbox-avatar i{color:#ffffff}.inbox-send-warning{color:#835315}.inbox-compose footer button.primary{background:#1D4ED8;border-color:#1D4ED8;color:#ffffff}
/* Native call/error/missed analytics. */
.control-eyebrow,.control-heading p,.control-source,.control-table small,.control-table-footer,.control-stat span,.control-settings p,.control-settings .control-caption,.control-detail dt,.control-evidence,.control-chat-grid fieldset small{color:#475569}
.control-filter label,.control-settings label,.control-filter input,.control-filter select,.control-settings input,.control-settings select{color:#1D4ED8}.control-filter input,.control-filter select,.control-settings input,.control-settings select{border-color:#94A3B8}
.control-badge{color:#475569;border-color:#CBD5E1}.control-badge.tone-GROSS,.control-badge.tone-waiting{color:#9e2c40}.control-badge.tone-ERROR,.control-badge.tone-attempted{color:#805014}.control-badge.tone-connected,.control-badge.tone-answered{color:#176447}
/* Marketplace banners retain their own artwork colors. */
.market-eyebrow,.market-card-category,.market-status,.market-footer,.market-footer p,.market-installed-description,.market-installed-info .market-status{color:#475569}
.market-card-bottom button,.market-installed-actions button{color:#1D4ED8}.market-card-bottom button.primary{color:#ffffff;background:#2563EB;border-color:#2563EB}.market-card,.market-installed-row{border-color:#CBD5E1}
.market-installed-badge{color:#305715;border-color:#a2ba89}
/* API reference: light docs, dark code. */
.api-kicker,.api-section-label,.api-ref-header p,.api-doc-nav label,.api-doc-nav h4,.api-doc-nav button,.api-base-url>span,.api-info-grid p,.api-scope-line code,.api-reference-panel .api-footnote,.api-token-item small,.api-token-empty,.api-token-form small{color:#475569}
.api-doc-nav label{color:#475569!important}.api-method-mini,.api-method-badge{color:#176348}.api-required{color:#82521d}.api-base-url,.api-doc-nav{border-color:#CBD5E1}
.api-code{--crm-secondary:#DBEAFE;--crm-ink:#EFF6FF;color:#EFF6FF}.api-code pre,.api-code code{color:#EFF6FF}.api-code-head>span{color:#a9d6be}.api-code-head button{color:#EFF6FF}
/* Outbound webhook editor and nested delivery/help dialogs. */
.webhook-settings-link p,.webhook-tools small,.webhook-row-meta label,.webhook-row-meta small,.webhook-row-meta button,.webhook-event-summary small,.webhook-footnote,.webhook-event-options h4,.webhook-event-options small,.webhook-delivery-meta,.webhook-guide p,.webhook-guide small{color:#475569}
.webhook-url-column>input,.webhook-event-select,.webhook-add,.webhook-event-options label,.webhook-event-search input,.webhook-select-all button,.webhook-events-done{color:#1D4ED8}
.webhook-url-column>input,.webhook-event-select,.webhook-event-search input,.webhook-sub-dialog input,.webhook-sub-dialog select{border-color:#94A3B8}
.webhook-market-button{font-size:12px!important}.webhook-market-button>span{color:#ffffff;background:#2563EB}
/* Shared sales analytics: keep semantic contrast, raise small supporting text. */
.sales-dashboard .ds-panel-heading p,.sales-dashboard .ds-note,.sales-dashboard .ds-meta,.sales-dashboard .ds-meta button,.sales-dashboard .ds-footnote,.sales-dashboard .ds-kpi-bottom,.sales-dashboard .ds-change small,.sales-dashboard .ds-chart-readout,.sales-dashboard .ds-funnel-row>small,.sales-dashboard .ds-funnel-row>small>b{color:#475569}
.sales-dashboard th,.sales-dashboard td,.sales-dashboard .ds-table-toolbar select,.sales-dashboard .ds-filters select,.sales-dashboard .ds-filters input{font-size:13px}
.sales-dashboard .ds-segments button,.sales-dashboard .ds-chart-legend button,.sales-dashboard .ds-task-list article small,.sales-dashboard .ds-task-list article div button{font-size:12px}
.sales-dashboard .ds-kpi-top i{flex-shrink:0}.sales-dashboard .ds-axis{fill:#475569}.sales-dashboard .ds-chart-point{stroke:#2563EB}
@media(max-width:600px){
 .topbar{flex-wrap:wrap}.topbar-title{min-width:0}.top-right{max-width:100%;flex-wrap:wrap}.topbar-title h1{overflow-wrap:anywhere}
 .sidebar .nav button>.rail-label{font-size:11px;line-height:1.25}.sidebar .nav button{min-width:70px}.sidebar .nav{scrollbar-width:thin}
 .compact-card-top{gap:5px}.compact-card-top time{flex-shrink:0}.compact-card-footer{row-gap:4px}
 .sales-dashboard .ds-filters select,.sales-dashboard .ds-filters input{font-size:13px}.sales-dashboard .ds-header-actions{flex-wrap:wrap}.sales-dashboard .ds-header-actions button{min-width:0}
 .sales-dashboard .ds-kpi>strong{font-size:23px}.sales-dashboard .ds-chart-legend{gap:10px;flex-wrap:wrap}.sales-dashboard .ds-task-tabs{flex-wrap:wrap}
 .inbox-compose footer{flex-wrap:wrap}.inbox-bubble>footer{flex-wrap:wrap}.inbox-conversation-top{gap:6px}
 .pipeline-editor-top{flex-wrap:wrap}.pipeline-editor-top>div{min-width:0}.pipeline-editor-top .pipeline-dirty{overflow-wrap:anywhere}
}
/* Overrides for more specific legacy component rules found by rendered audits. */
.avatar.header-avatar{color:#1D4ED8}
.pipeline-shell .compact-summary>div>span{color:#475569}.compact-summary strong,.summary-forecast strong{color:#475569}.compact-summary strong.summary-green{color:#11704f}.compact-summary strong.summary-amber{color:#8b5c12}.compact-summary strong.summary-pink{color:#ae3151}
.directory-table th button span,.entity-directory-paging{color:#475569}
.task-view-switch [aria-pressed=true]{color:#1D4ED8}.task-search>span,.task-toolbar>[data-task-count],.task-board-group>header>span{color:#475569}.task-reference-card.is-overdue .task-card-when{color:#af2d47}
.page-head .eyebrow,.page-head p,.settings-view .role-section-head p,.settings-view .role-settings>.caption,.settings-view .role-empty{color:#475569}.settings-view .settings-content th,.settings-drawer .rights-matrix th{color:#475569}
.deal-currency,.deal-properties .entity-section-heading h3,.deal-widgets h3,.deal-widget-note,.deal-channel span,.deal-channel b{color:#475569}
.deal-properties .entity-section-heading button{color:#1D4ED8}.deal-properties .deal-contact-heading .deal-person{color:#1D4ED8}.deal-activity-header button{color:#475569}
.event-avatar{color:#1D4ED8}.task-card-content>header,.task-card-content>footer small,.compose-bottom small{color:#475569}.task-done-label{color:#216b4b}
.lead-filter-dialog .filter-group .lead-filter-section h3{color:#475569}
.pipeline-editor-top>div>span,.pipeline-dirty,.pipeline-editor-layout>aside p,.pipeline-info,.pipeline-editor-layout>aside .pipeline-info-note,.pipeline-stage-header>div>span,.pipeline-stage-header small,.pipeline-stage-hint,.pipeline-trigger-card small,.pipeline-trigger-card em,.pipeline-subdialog p,.pipeline-subdialog small,.pipeline-action-gallery small,.pipeline-job-list header span{color:#475569}
.pipeline-stage-hint button,.pipeline-add-trigger,.pipeline-editor-layout>aside>button{color:#1D4ED8}.settings-drawer .modal-head button{color:#475569}
.api-ref-header h2>span,.api-info-grid b{color:#1D4ED8}.api-ref-tabs>[aria-pressed=true],.api-doc-nav button[aria-current=page],.api-info-grid button,.api-footnote a{color:#1D4ED8}.api-ref-tabs>button,.api-loading{color:#475569}
.api-method-mini.method-post{color:#805511}.api-method-mini.method-patch{color:#475569}
.webhook-heading-actions [data-webhook-cancel],.webhook-intro,.webhook-no-events,.webhook-down{color:#475569}
.sales-dashboard .ds-eyebrow b{color:#196b51}.sales-dashboard .ds-meta i{color:#475569}.sales-dashboard .ds-inset{color:#475569}.sales-dashboard .ds-person{color:#1D4ED8}.sales-dashboard .ds-communication button,.sales-dashboard .ds-configure-plan,.sales-dashboard .ds-panel-heading>button{color:#1D4ED8}
.inbox-reference .inbox-view-tabs button,.inbox-reference .inbox-queues h2>span,.inbox-reference .inbox-queues>button b,.inbox-reference .inbox-loading,.inbox-reference .inbox-welcome p,.inbox-reference .inbox-context p,.inbox-reference .inbox-conversation-top time,.inbox-reference .inbox-preview,.inbox-reference .inbox-conversation-bottom,.inbox-reference .inbox-thread-head>div>span,.inbox-reference .inbox-history-start,.inbox-reference .inbox-bubble footer,.inbox-reference .inbox-bubble footer .message-state,.inbox-reference .inbox-compose footer small,.inbox-reference .inbox-detail-section>summary>span,.inbox-reference .inbox-profile small,.inbox-reference .inbox-context dt,.inbox-reference .inbox-context dd{color:#334155}
.inbox-reference .inbox-bubble footer button,.inbox-reference .inbox-context-tabs button,.inbox-reference .inbox-compose-modes button,.inbox-reference .inbox-composer-tools>button{color:#475569}
.inbox-reference .inbox-welcome h2,.inbox-reference .inbox-state-pill,.inbox-reference .inbox-bubble blockquote{color:#475569}
.inbox-reference .inbox-compose-hint{color:#475569}.inbox-reference .avatar-2{background:#946019;color:#ffffff}.inbox-reference .avatar-5{background:#2563EB;color:#ffffff}
.webhooks-dialog .webhook-heading-actions .primary{background:#2563EB;border-color:#2563EB;color:#ffffff}
.auth-form .eyebrow,.auth-form .caption,.auth-form .muted,.auth-form>form>p{color:#475569}.auth-brand .caption{color:#DBEAFE}
.auth-form button.primary{background:#2563EB;border-color:#2563EB;color:#ffffff}
