/* CoreMatchContrast/v1
   Resolve semantic text/control contrast at the last shared theme layer. */
.dashboard-shell {
    --workspace-text-primary: #f3f7ff;
    --workspace-text-muted: #b8c5d8;
    --workspace-text-subtle: #aebbd0;
}

.dashboard-shell.dashboard-light {
    --workspace-text-primary: #182032;
    --workspace-text-muted: #5d6a7d;
    --workspace-text-subtle: #64748b;
}

/* The workspace's dark palette is the legacy default. Several settings links
   were authored for a white panel and therefore disappeared on the dark shell. */
.dashboard-shell:not(.dashboard-light) .settings-tabs a:not(.active) {
    color: #e4ebf7;
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.dashboard-shell:not(.dashboard-light) .settings-tabs a:not(.active):hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
}

/* The light theme changes panel colors, so controls and actions must follow
   the same semantic foreground instead of retaining the dark theme's pale text. */
.dashboard-shell.dashboard-light .settings-form.cm-field-contract {
    --cm-color-text: #182032;
    --cm-color-muted: #5d6a7d;
    --cm-field-underline: rgba(24, 32, 50, 0.2);
    --cm-field-underline-hover: rgba(24, 32, 50, 0.42);
    --cm-field-underline-focus: #2677d8;
}

.dashboard-shell.dashboard-light .settings-form.cm-field-contract .settings-help {
    color: #5d6a7d;
}

.dashboard-shell .message-body,
.dashboard-shell .message-person,
.dashboard-shell .message-table time {
    color: var(--workspace-text-primary);
}

.dashboard-shell .message-person small {
    color: var(--workspace-text-muted);
}

.dashboard-shell .message-catalog__head {
    color: var(--workspace-text-muted);
}

.dashboard-shell.dashboard-light .btn.secondary,
.dashboard-shell.dashboard-light .btn.ghost,
.dashboard-shell.dashboard-light .board-mini-action,
.dashboard-shell.dashboard-light .core-catalog-tabs a {
    color: #304158;
    border-color: #c9d4e2;
    background: #ffffff;
}

.dashboard-shell.dashboard-light .btn.secondary:hover,
.dashboard-shell.dashboard-light .btn.ghost:hover,
.dashboard-shell.dashboard-light .board-mini-action:hover,
.dashboard-shell.dashboard-light .core-catalog-tabs a:hover {
    color: #174f91;
    border-color: #a9c5e5;
    background: #f2f7fd;
}

/* Make native Chromium select menus use matching foreground/background pairs.
   Styling <option> alone is insufficient in several native popup themes. */
body.public-mode:not(.color-mode-light),
.dashboard-shell:not(.dashboard-light) {
    color-scheme: dark;
}

body.public-mode:not(.color-mode-light) select option,
.dashboard-shell:not(.dashboard-light) select option {
    color: #f2f6fb;
    background-color: #202132;
}

body.public-mode.color-mode-light,
.dashboard-shell.dashboard-light {
    color-scheme: light;
}

body.public-mode.color-mode-light select option,
.dashboard-shell.dashboard-light select option {
    color: #172033;
    background-color: #ffffff;
}
