/* Neutral, high-contrast dashboard typography; retain semantic market/status colours. */
html[data-theme=dark] body.modern-workspace{--desk-ink:#ffffff;--desk-muted:#d1d5db;--text:#ffffff;--muted:#d1d5db}
html[data-theme=dark] body.flow-workspace.modern-workspace.is-signed-in{--flow-ink:#ffffff;--flow-muted:#d1d5db;--flow-accent:#ffffff}
html[data-theme=dark] body.modern-workspace #profile-panel :is(h1,h2,h3,h4,h5,label,.eyebrow,.courseEyebrow,.workspaceEyebrow,.workspaceHeroSubtitle,.workspaceResumeLabel,.learningModuleNumber,.learningModuleArrow,.learningModuleCopy strong,.learningModuleCopy small,.dashboardModuleLessons summary,.flowGlassLabel,.courseRankTitle,.courseRankCount,.courseRankNext,.courseGlossaryList summary,.chart-footer a,.quick-links a,.calendar-event a,.calendar-event-meta time){color:#ffffff}
html[data-theme=dark] body.modern-workspace #profile-panel :is(p,small,.fine,.review,.feed-meta,.feed-meta span,.feed-note,.market-note,.coin-name,.calendar-event-meta,.chart-footer,.chart-drawing-note,.chart-drawing-row,.courseFine,.courseMeta,.courseText,.courseImageLegend,figcaption){color:#d1d5db}
html[data-theme=dark] body.modern-workspace #dashboardOverview .workspaceCourseGrid .learningModuleCopy :is(strong,small),
html[data-theme=dark] body.flow-workspace.is-signed-in #dashboardOverview .dashboardModuleTile .learningModuleCopy :is(strong,small),
html[data-theme=dark] body.modern-workspace #dashboardOverview .workspaceHero :is(h2,.workspaceEyebrow,.workspaceHeroSubtitle,.workspaceResumeLabel),
html[data-theme=dark] body.modern-workspace #courseWorkspace .courseHead :is(h2,p,.courseEyebrow,.courseMeta){color:#ffffff}
html[data-theme=dark] body.modern-workspace #courseWorkspace .courseRankStrip :is(.courseRankTitle span,.courseRankNext,.courseRankCount),
html[data-theme=dark] body.modern-workspace #journalWorkspace .journalHeading :is(p,.eyebrow){color:#ffffff}

/* Keep the light dashboard navigation legible on both sidebar backgrounds. */
html[data-theme=light] body.flow-workspace.is-signed-in .flowSidebar .workspaceNav button,
html[data-theme=light] body.flow-workspace.is-signed-in .flowSidebar .workspaceNav button:hover,
html[data-theme=light] body.flow-workspace.is-signed-in .flowSidebar .workspaceNav button.flowActive,
html[data-theme=light] body.flow-workspace.is-signed-in .flowSidebar :is(.flowHomeLink,.flowBrandWord) {
  color: #141a17 !important;
}

html[data-theme=light] body.modern-workspace,
html[data-theme=light] body.flow-workspace.modern-workspace.is-signed-in {
  --desk-ink: var(--light-text);
  --desk-muted: var(--light-text);
  --text: var(--light-text);
  --muted: var(--light-text);
  --flow-ink: var(--light-text);
  --flow-muted: var(--light-text);
  --flow-accent: var(--light-text);
  --flow-mint-ink: var(--light-text);
}

/* Match the foreground to the light workspace surfaces across all tabs. */
html[data-theme=light] body.modern-workspace.is-signed-in
  :is(#profile-panel,#dashboardOverview,#courseWorkspace,#journalWorkspace,.flowLessonDrawer,header,footer)
  :is(h1,h2,h3,h4,h5,h6,p,span,small,strong,b,em,a,button,label,summary,legend,li,dt,dd,th,td,time,figcaption,input,select,textarea):not(:where(svg *, .learningModuleVisual, .learningModuleVisual *, .dashboardModuleTile > .learningModuleCard,
    .dashboardModuleTile > .learningModuleCard *, .flowContinueCover, .flowContinueCover *,
    .courseImageViewer, .courseImageViewer *, .courseImageViewerBar, .courseImageViewerBar *,
    .language-switch [aria-current=page], .language-switch [aria-current=page] *,
    #theme-toggle, #adminPortalToggle[aria-pressed=true], .positive, .negative, .market-change, .market-change *, .learningResumeAction)) {
  color: var(--light-text) !important;
}

html[data-theme=light] body.modern-workspace.is-signed-in #profile-panel :is(input,textarea)::placeholder {
  color: var(--light-text);
  opacity: 1;
}

/* The dashboard module cards use dark photo overlays in both themes. */
html[data-theme] body.flow-workspace.is-signed-in #dashboardOverview .dashboardModuleTile > .learningModuleCard .learningModuleCopy :is(strong,small) {
  color: #fff !important;
  -webkit-text-fill-color: currentColor;
}

/* The rank reveal is mounted on the body over the light workspace. */
html[data-theme=light] body > .courseRankPromotion > :is(span,strong,.rankScreenMilestone) {
  color: #000;
  text-shadow: none;
}

body > .courseRankPromotion > :is(.rankSoundToggle,.rankScreenClose) {
  background: #294239;
  color: #fff;
}

body > .courseRankPromotion > :is(.rankSoundToggle,.rankScreenClose):hover {
  background: #36564a;
}


/* The course resume label sits on a dark green gradient in light mode. */
html[data-theme=light] body.modern-workspace #courseWorkspace .learningResume .learningResumeAction {
  color: #fff !important;
  -webkit-text-fill-color: currentColor;
}
