/*
 * Dark mode — Deals, Projects, Job Costing, and Calendar.
 * Also loaded after the deferred Deal bundle so late feature CSS cannot
 * restore light surfaces.
 */

/* ── Deals: pipeline in every view ──────────────────────────── */
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelineWrap,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel .pipe-board,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel .pipe-board-list,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel .pipe-board-graph,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel .pipe-grouped-view {
  background: #181818 !important;
  background-image: none !important;
  color: #f0f0f0 !important;
  color-scheme: dark;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #filtersSection.filters-modern.list-toolbar-strip,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel > .pipe-header,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel .pipe-workspace-header,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel .pipe-list-filters {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #f0f0f0 !important;
  border-color: rgba(240, 240, 240, 0.2) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel .pipe-view-toggle,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel .pipe-list-search,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel input,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel select {
  background: #1e1e1e !important;
  background-image: none !important;
  color: #e6e6e6 !important;
  -webkit-text-fill-color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.26) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel .pipe-view-btn {
  background: transparent !important;
  color: #8a8a8a !important;
}
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel .pipe-view-btn.active,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel .pipe-view-btn[aria-pressed="true"] {
  background: #242424 !important;
  color: #f0f0f0 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel .pipe-kanban-col,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel .pipe-group,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel .pipe-graph-card,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel .pipe-meeting-pack {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.18) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel .pipe-deal-card,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel .pipe-list-row {
  background: #1e1e1e !important;
  background-image: none !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.16) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel .pipe-deal-card:hover,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelinePanel .pipe-list-row:hover {
  background: #242424 !important;
}

/* ── Deal detail workspace, including deferred deal-page.css ── */
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .deal-workspace,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .deal-workspace-body,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .deal-main-content,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .deal-content,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .deal-tab-content {
  background: #181818 !important;
  background-image: none !important;
  color: #f0f0f0 !important;
  color-scheme: dark;
}

html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .deal-header,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .deal-hero,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .deal-sidebar,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .deal-core-card,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .deal-card,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .deal-section,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .deal-section-panel,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .deal-panel,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .detailSection {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.2) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .deal-tabs,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .deal-tab-nav,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .deal-section-tabs,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .deal-card-header,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .deal-section-header {
  background: #222222 !important;
  background-image: none !important;
  color: #f0f0f0 !important;
  border-color: rgba(240, 240, 240, 0.18) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount input,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount textarea,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount select,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .inline-input {
  background: #1e1e1e !important;
  color: #e6e6e6 !important;
  -webkit-text-fill-color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.26) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount[data-deal-workspace-mode="simple"],
html[data-theme="dark"] body.deal-workspace-simple-page #dealWorkspaceMount[data-deal-workspace-mode="simple"] {
  --ro-page-bg: #181818;
  --ro-form-bg: #1a1a1a;
  --ro-border: rgba(240, 240, 240, 0.2);
  --ro-input-border: rgba(240, 240, 240, 0.28);
  --ro-label-color: #909090;
  --ro-value-color: #e6e6e6;
  --ro-card-shadow: none;
}

/* ── Projects list and every project detail tab ─────────────── */
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap .project-detail-workspace,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap .project-detail-workspace-body,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap .project-detail-primary-column,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap .project-tab-content {
  background: #181818 !important;
  background-image: none !important;
  color: #f0f0f0 !important;
  color-scheme: dark;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap .detailHeader.contact-detail-header-new,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap .contact-detail-header-wrap,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap .project-detail-tabs-card,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap .deal-card,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap .crm-contact-overview-fields,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap .project-overview-details-card,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap .detailSection,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap .contact-field-group {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.2) !important;
  box-shadow: none !important;
  color-scheme: dark !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap .project-detail-tabs-header,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap .project-detail-tabs-nav,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap .contact-field-group-title,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap .related-section-header {
  background: #222222 !important;
  background-image: none !important;
  color: #c6c6c6 !important;
  border-color: rgba(240, 240, 240, 0.18) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap .project-tab {
  background: transparent !important;
  color: #8a8a8a !important;
  border-color: transparent !important;
}
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap .project-tab.active,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap .project-tab.is-active {
  background: #242424 !important;
  color: #f0f0f0 !important;
  border-color: rgba(240, 240, 240, 0.2) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap .detailRow,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap .project-tab-pane,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap .activityItem {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.14) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap input,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap textarea,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="projects"] #projectsWrap select {
  background: #1e1e1e !important;
  color: #e6e6e6 !important;
  -webkit-text-fill-color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.26) !important;
}

html[data-theme="dark"] body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] {
  --ro-page-bg: #181818;
  --ro-form-bg: #1a1a1a;
  --ro-border: rgba(240, 240, 240, 0.2);
  --ro-input-border: rgba(240, 240, 240, 0.28);
  --ro-label-color: #909090;
  --ro-value-color: #e6e6e6;
  --ro-card-shadow: none;
  background: #181818 !important;
}

/* ── Job Cost / Budgets CRM shell and tabs ──────────────────── */
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="budgets"] #budgetsWrap,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="budgets"] #budgetsWrap #budgetsHubRoot,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="budgets"] #budgetsWrap #budgetsDetailPane,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="budgets"] #budgetsWrap .budgets-detail-with-nav,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="budgets"] #budgetsWrap .budgets-iframe-host {
  background: #181818 !important;
  background-image: none !important;
  color: #f0f0f0 !important;
  border-color: rgba(240, 240, 240, 0.18) !important;
  color-scheme: dark;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="budgets"] #budgetsWrap .budgets-detail-header-card,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .budgets-detail-header-card {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #f0f0f0 !important;
  border-color: rgba(240, 240, 240, 0.2) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="budgets"] #budgetsWrap .budgets-detail-tabs-header,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="budgets"] #budgetsWrap .project-detail-tabs-header,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="budgets"] #budgetsWrap .budgets-detail-tab-rail,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .budgets-detail-tab-rail {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #c6c6c6 !important;
  border-color: rgba(240, 240, 240, 0.2) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #budgetsWrap .budgets-rail-tab,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .budgets-rail-tab,
html[data-theme="dark"] body[data-theme="momentum"] #budgetsWrap .project-tab {
  background: transparent !important;
  color: #8a8a8a !important;
  border-color: transparent !important;
}
html[data-theme="dark"] body[data-theme="momentum"] #budgetsWrap .budgets-rail-tab.active,
html[data-theme="dark"] body[data-theme="momentum"] #dealWorkspaceMount .budgets-rail-tab.active,
html[data-theme="dark"] body[data-theme="momentum"] #budgetsWrap .project-tab.active {
  background: #242424 !important;
  color: #f0f0f0 !important;
}

/* ── Calendar: month, week, day, agenda, popovers ───────────── */
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="calendar"] #calendarWrap,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="calendar"] #calendarPanel,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="calendar"] #calendarPanel .cal-body,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="calendar"] #calendarPanel .cal-main {
  background: #181818 !important;
  background-image: none !important;
  color: #f0f0f0 !important;
  color-scheme: dark;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="calendar"] #filtersSection.filters-modern.list-toolbar-strip,
html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .cal-header,
html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .cal-header-nav-cluster,
html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .cal-view-toggle,
html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .cal-sidebar,
html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .cal-mini,
html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .cal-list {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.2) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .cal-search,
html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap input,
html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap select,
html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap textarea {
  background: #1e1e1e !important;
  color: #e6e6e6 !important;
  -webkit-text-fill-color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.26) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .cal-view-btn {
  background: transparent !important;
  color: #8a8a8a !important;
}
html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .cal-view-btn.active {
  background: #242424 !important;
  color: #f0f0f0 !important;
}
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="calendar"] #calendarWrap #calendarPanel .cal-header .cal-view-toggle .cal-view-btn.active {
  background: #242424 !important;
  background-image: none !important;
  color: #f0f0f0 !important;
  border-color: rgba(240, 240, 240, 0.22) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .calDay,
html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .cal-week-column,
html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .calWeekItem,
html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .cal-day-timeline,
html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .cal-time-grid,
html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .calSection,
html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .calDayCard,
html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .emptyState {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #c6c6c6 !important;
  border-color: rgba(240, 240, 240, 0.16) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .calDay.today,
html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .calDay.calDay--selected {
  background: rgba(107, 138, 171, 0.22) !important;
  border-color: rgba(136, 192, 208, 0.42) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .calSectionHeader,
html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .cal-quick-head,
html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .cal-quick-foot {
  background: #222222 !important;
  color: #f0f0f0 !important;
  border-color: rgba(240, 240, 240, 0.18) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .cal-quick-popover,
html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap .cal-quick-body {
  background: #1a1a1a !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.2) !important;
}

/* Calendar editors and scheduler overlays are portaled outside the view. */
html[data-theme="dark"] body[data-theme="momentum"] .task-event-backdrop .task-event-modal,
html[data-theme="dark"] body[data-theme="momentum"] .task-event-backdrop .task-event-modal__head,
html[data-theme="dark"] body[data-theme="momentum"] .task-event-backdrop .task-event-modal__body,
html[data-theme="dark"] body[data-theme="momentum"] .task-event-backdrop .task-event-modal__foot,
html[data-theme="dark"] body[data-theme="momentum"] .sched-modal,
html[data-theme="dark"] body[data-theme="momentum"] .sched-modal .sched-head,
html[data-theme="dark"] body[data-theme="momentum"] .sched-modal .sched-body,
html[data-theme="dark"] body[data-theme="momentum"] .sched-setup-modal {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.22) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .sched-setup-step,
html[data-theme="dark"] body[data-theme="momentum"] .sched-setup-step__text,
html[data-theme="dark"] body[data-theme="momentum"] .sched-setup-context {
  color: #e6e6e6 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .sched-setup-step__hint {
  color: #8a8a8a !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .sched-setup-step strong {
  color: #f8fafc !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .task-event-backdrop input,
html[data-theme="dark"] body[data-theme="momentum"] .task-event-backdrop textarea,
html[data-theme="dark"] body[data-theme="momentum"] .task-event-backdrop select,
html[data-theme="dark"] body[data-theme="momentum"] .sched-modal input,
html[data-theme="dark"] body[data-theme="momentum"] .sched-modal select {
  background: #1e1e1e !important;
  color: #e6e6e6 !important;
  -webkit-text-fill-color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.28) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap #calendarPanel .cal-avail-bar {
  background: #1e1e1e !important;
  color: #fff !important;
}

/* Pipeline graph and summary mode. */
html[data-theme="dark"] body[data-theme="momentum"] #pipelineWrap :is(
  .pipe-summary-stat,
  .pipe-funnel-bar-wrap
) {
  background: #1e1e1e !important;
  background-image: none !important;
  color: #dcdcdc !important;
  border-color: rgba(240, 240, 240, 0.2) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #pipelineWrap :is(
  .pipe-graph-card h3,
  .pipe-summary-value
) {
  color: #f0f0f0 !important;
  -webkit-text-fill-color: #f0f0f0 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #pipelineWrap .pipe-summary-label {
  color: #a0a0a0 !important;
}

/* Project simple-mode hardcodes that do not consume the shared dark tokens. */
html[data-theme="dark"] body[data-theme="momentum"] #projectsWrap[data-project-overview-mode="simple"] :is(
  .detailHeader.contact-detail-header-new,
  .project-overview-nextsteps-card,
  .project-overview-card,
  .crm-contact-overview-fields,
  .contact-field-group
) {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.2) !important;
  box-shadow: none !important;
}

/* Inline calendar event and availability controls. */
html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap :is(
  .calWeekItem,
  .calDayEvent,
  .cal-agenda-item,
  [style*="background:#fff"],
  [style*="background: #fff"],
  [style*="background:linear-gradient"],
  [style*="background: linear-gradient"]
) {
  background: #242424 !important;
  background-image: none !important;
  color: #dcdcdc !important;
  border-color: rgba(240, 240, 240, 0.24) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #calendarWrap :is(
  #calEmailBookingFromBar,
  #calCopyAvailBtn
) {
  background: #2a2a2a !important;
  background-image: none !important;
  color: #f0f0f0 !important;
  border-color: rgba(135, 166, 196, 0.36) !important;
  box-shadow: none !important;
}

/* Task/event sub-panels. */
html[data-theme="dark"] body[data-theme="momentum"] .task-event-backdrop :is(
  .task-event-kind-seg,
  .task-event-helper,
  .task-event-snooze,
  .task-event-already-done,
  #__te_attendees_dropdown
) {
  background: #1e1e1e !important;
  background-image: none !important;
  color: #dcdcdc !important;
  border-color: rgba(240, 240, 240, 0.22) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .task-event-backdrop :is(
  .task-event-kind-seg__btn,
  .task-event-modal__summary
) {
  color: #88c0d0 !important;
  -webkit-text-fill-color: #88c0d0 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .task-event-backdrop .task-event-modal__record-bit--company {
  color: #c8c8c8 !important;
  -webkit-text-fill-color: #c8c8c8 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .task-event-backdrop .task-event-modal__record-bit--person {
  color: #f0f0f0 !important;
  -webkit-text-fill-color: #f0f0f0 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .task-event-backdrop .task-event-modal__record-sep {
  color: #6b6b6b !important;
  -webkit-text-fill-color: #6b6b6b !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .task-event-backdrop :is(
  .task-event-modal__record-bit--email,
  .task-event-modal__record-bit--phone
) {
  color: #93c5fd !important;
  -webkit-text-fill-color: #93c5fd !important;
}

/* Project detail: KPI / overview / docs / events that still ship white !important in momentum. */
html[data-theme="dark"] body[data-theme="momentum"] #projectsWrap :is(
  .project-record-summary-kpi,
  .project-record-action-btn,
  .project-record-icon-btn,
  .project-overview-kickoff-inline--quiet,
  .project-overview-summary-card,
  .project-overview-context-card,
  .project-overview-inline-action,
  .project-overview-step-btn,
  .project-pane-empty,
  .project-status-dropdown-menu,
  .project-overview-notes-input,
  .project-event-row,
  .project-docs-selection-bar,
  .project-table-wrap,
  .project-data-table thead tr,
  .project-docs-table .doc-actions-trigger,
  .project-overview-edit-footer,
  .project-overview-step-list--simple
) {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.2) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #projectsWrap :is(
  .project-record-action-btn:hover,
  .project-record-icon-btn:hover,
  .project-overview-inline-action:hover,
  .project-overview-step-btn:hover,
  .project-event-row:hover
) {
  background: #242424 !important;
  color: #f0f0f0 !important;
  border-color: rgba(136, 192, 208, 0.35) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .project-status-dropdown-menu {
  background: #1a1a1a !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.22) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .task-event-backdrop :is(
  .task-event-foot-secondary
) {
  background: #2a2a2a !important;
  color: #dcdcdc !important;
  border-color: rgba(240, 240, 240, 0.28) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .task-event-backdrop .task-event-foot-secondary:hover {
  background: #2e2e2e !important;
  color: #ffffff !important;
}
