/* Day-theme contrast repair: light overview cards must never inherit focus-card white ink. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-module-tab="0"]
  [data-overview-canvas-widget]:not([data-overview-canvas-widget="focus"]):not([data-overview-canvas-widget="finance"]) > .panel {
  color: #19363a !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-module-tab="0"]
  [data-overview-canvas-widget]:not([data-overview-canvas-widget="focus"]):not([data-overview-canvas-widget="finance"]) > .panel
  :is(h2, h3, h4, strong, p, span, small, time, .overview-task-kind, .tag) {
  color: inherit !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-module-tab="0"]
  [data-overview-canvas-widget]:not([data-overview-canvas-widget="focus"]):not([data-overview-canvas-widget="finance"]) > .panel
  :is(.overview-task-kind, .tag) {
  color: #8a6227 !important;
}

/* Keep intentional white type only on the two dark glass surfaces. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-module-tab="0"]
  :is([data-overview-canvas-widget="focus"], [data-overview-canvas-widget="finance"]) > .panel
  :is(h2, h3, h4, strong, p, span, small, time) {
  color: inherit !important;
}

/* Finance stays a dark feature panel, but its nested KPI cards use a light paper surface. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-module-tab="0"]
  [data-overview-canvas-widget="finance"] .stacked-kpis .kpi {
  color: #19363a !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-module-tab="0"]
  [data-overview-canvas-widget="finance"] .stacked-kpis .kpi :is(span, strong) {
  color: inherit !important;
}

/* Keep decorative linework behind the actual reminder copy. */
body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-module-tab="0"]
  [data-overview-canvas-widget="focus"] .overview-task-row > span:first-child {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 5px 8px;
  border-radius: 4px;
  background: rgba(8, 50, 51, 0.78);
  box-shadow: 0 1px 0 rgba(215, 180, 95, 0.2);
}

/* Recent amounts use a light pill, so pin the foreground instead of inheriting white panel ink. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-module-tab="0"]
  [data-overview-canvas-widget="finance"] > .panel .finance-recent-row > .tag {
  color: #17383b !important;
  background: rgba(248, 251, 247, 0.96) !important;
  border-color: rgba(190, 147, 65, 0.68) !important;
  font-weight: 800;
  text-shadow: none !important;
}

/* Priority and follow-up pills are light surfaces inside the dark Today card. */
html body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-module-tab="0"]
  [data-overview-canvas-widget="focus"] > .panel .overview-task-row > .tag {
  color: #17383b !important;
  background: rgba(248, 251, 247, 0.96) !important;
  border-color: rgba(190, 147, 65, 0.68) !important;
  font-weight: 800;
  text-shadow: none !important;
}

@media (max-width: 760px) {
  html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-module-tab="0"]
    [data-overview-canvas-widget]:not([data-overview-canvas-widget="focus"]):not([data-overview-canvas-widget="finance"]) > .panel {
    color: #19363a !important;
  }
}
