html[data-bs-theme="dark"] body.du-shell {
  --du-ground: #1b1d1e;
  --du-surface: #242728;
  --du-text: #eff3f5;
  --du-muted: #bbc6cc;
  --du-border: #495359;
  --du-control-border: #788990;
  --du-active: #343d43;
  --du-primary: #386585;
  --du-primary-text: #fff;
  --du-accent: #94cafd;
  --du-info: #b7ddfb;
  --du-info-bg: #263944;
  --du-danger: #ffb5ad;
  --du-danger-bg: #482d2d;
  --du-success: #ace6bd;
  --du-success-bg: #263d32;
  --du-warning: #f7dc98;
  --du-warning-bg: #403623;
  color: var(--du-text);
  background: var(--du-ground);
}
html[data-bs-theme="dark"] .du-shell :is(.topbar, .card, .hdc-info-panel, .hdc-manage-panel, .hdc-admin-tile,
  .hdc-work-panel, .hdc-stage-section .hdc-section, .hdc-flow .workflow-track, .hdc-flow .workflow-step,
  .hdc-flow-dot, .hdc-flow-arrow, .hdc-plan .plan-day, .hdc-plan .plan-day-head, .hdc-plan .plan-item,
  .hdc-entry-access, .registry-wrap, .filter-dialog, .hdc-plan-split, .du-dialog, dialog) {
  color: var(--du-text);
  background-color: var(--du-surface);
  border-color: var(--du-border);
}
html[data-bs-theme="dark"] .du-shell :is(.home-card, .jira-link, .hdc-registry .registry-head > th,
  .hdc-registry-footer, .task-row-remove, .hdc-task-strip nav .btn, .hdc-plan-operational,
  .hdc-plan-dialog-close, .hdc-plan-day-picker button, .fd-canvas, .fd-impact) {
  background: var(--du-surface);
  color: var(--du-text);
  border-color: var(--du-border);
}
html[data-bs-theme="dark"] .du-shell :is(.fd-layout, .hdc-registry .registry-task td) {
  background: var(--du-ground);
  border-color: var(--du-border);
}
html[data-bs-theme="dark"] .du-shell :is(.jira-link:hover, .fd-scopes a[aria-current],
  .hdc-task-strip nav .btn-primary, .hdc-plan-day-picker button[aria-pressed="true"], .today-tag) {
  background: var(--du-active);
  color: var(--du-text);
}
html[data-bs-theme="dark"] .du-shell .hdc-stage-section .bg-body-tertiary { background: var(--du-ground) !important; }
html[data-bs-theme="dark"] .du-shell :is(.hdc-day-heading .home-greeting, .home-card-title, .today-hours,
  .hdc-plan .plan-item-hours, .hdc-plan .plan-day-hours strong, .hdc-plan-operational summary strong,
  .fd-editor, .fd-field-name strong) { color: var(--du-text); }
html[data-bs-theme="dark"] .du-shell :is(.fd-header p, .fd-title p, .fd-note, .fd-field-name span,
  .jira-link-desc, .hdc-registry .registry-task .hdc-task-title) { color: var(--du-muted); }
html[data-bs-theme="dark"] .du-shell .fd-actions button { color: var(--du-accent); }
html[data-bs-theme="dark"] .du-shell .hdc-breadcrumb a { color: var(--du-accent); }
html[data-bs-theme="dark"] .du-shell :is(.home-card-head, .home-card-footer, .fd-fields li,
  .hdc-day-grid .jira-links li + li) { border-color: var(--du-border); }
html[data-bs-theme="dark"] .du-shell .hdc-admin {
  --admin-ink: var(--du-text);
  --admin-muted: var(--du-muted);
  --admin-surface: var(--du-surface);
  --admin-edge: var(--du-border);
  --admin-hover: var(--du-active);
}
html[data-bs-theme="dark"] .du-shell :is(.topbar-link.is-active, .workflow-step.is-selected, .workflow-step:hover,
  .hdc-stage-section .hdc-section > summary, .hdc-plan-week-nav a:hover) {
  color: var(--du-text);
  background: var(--du-active);
}
html[data-bs-theme="dark"] .du-shell :is(.hdc-plan, .hdc-plan-heading p, .hdc-plan-week-nav a,
  .hdc-plan-free, .hdc-plan-options, .hdc-plan-board-heading, .hdc-plan-category-note, .hdc-section-note,
  .hdc-section > summary .ui-icon, .hdc-flow-legend, .hdc-stage-overview, .hdc-account-role,
  .hdc-footer, .hdc-admin-heading p, .hdc-admin-tile p, .hdc-entry-access-lead, .form-text) {
  color: var(--du-muted);
}
html[data-bs-theme="dark"] .du-shell :is(.form-control, .form-select, input, textarea, select) {
  color: var(--du-text);
  background-color: var(--du-ground);
  border-color: var(--du-control-border);
}
html[data-bs-theme="dark"] .du-shell :is(.registry-head th, .hdc-registry .registry-head th[aria-sort]) {
  --bs-table-bg: var(--du-surface);
  --bs-table-color: var(--du-text);
}
html[data-bs-theme="dark"] .du-shell :focus-visible { outline: 2px solid var(--du-accent); outline-offset: 2px; }
html[data-bs-theme="dark"] .du-shell :is(.btn-outline-secondary, .btn-outline-primary) {
  --bs-btn-color: #c7d5dd;
  --bs-btn-border-color: #788990;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #343d43;
  --bs-btn-hover-border-color: #94cafd;
  color: var(--bs-btn-color);
  background-color: transparent;
}
html[data-bs-theme="dark"] .du-shell :is(.btn-outline-secondary, .btn-outline-primary):hover {
  color: var(--bs-btn-hover-color);
  background-color: var(--bs-btn-hover-bg);
}
html[data-bs-theme="dark"] .du-shell :is(.hdc-breadcrumb, .hdc-day-heading .home-date,
  .hdc-day-greeting, .hdc-day-grid .today-task-name, .hdc-day-grid .home-count) { color: var(--du-muted); }
html[data-bs-theme="dark"] .du-shell main a:not(.btn, .du-button, .hdc-admin-tile, .topbar-link) { color: #9ccff7; }
html[data-bs-theme="dark"] .du-shell :is(.btn-primary, .du-button-primary, .hdc-entry-submit) {
  background: var(--du-primary);
  color: var(--du-primary-text);
  border-color: var(--du-primary);
}
html[data-bs-theme="dark"] .tl {
  --tl-ink: #eff3f5;
  --tl-muted: #bbc6cc;
  --tl-surface: #242728;
  --tl-line: #495359;
  --tl-weekend: #32393c;
  --tl-accent: #78b7a9;
  --tl-pale: #273d3b;
  --tl-late: #ffb5ad;
  --tl-late-bg: #482d2d;
  --tl-control: #788990;
}
html[data-bs-theme="dark"] .tl :is(.tl-name, .tl-axis-year, .tl-settings, .tl-month-tint) {
  background: var(--tl-surface);
  color: var(--tl-ink);
}
html[data-bs-theme="dark"] .tl :is(.tl-axis-month, .tl-axis-week) { color: var(--tl-muted); }
html[data-bs-theme="dark"] .tl .tl-primary { color: var(--du-ground); }
html[data-bs-theme="dark"] .tl .tl-bar:is(.tl-level-2, .tl-level-3):not(.tl-done, .tl-late, [data-topic-color]) {
  background: var(--tl-pale);
  color: var(--tl-ink);
}
.hdc-theme-switch { display: inline-flex; align-items: center; gap: .45rem; min-height: 36px; cursor: pointer; white-space: nowrap; color: var(--du-text); }
.hdc-theme-switch input[type="checkbox"] { appearance: none; width: 34px; height: 20px; flex: none; margin: 0; border: 1px solid #788990; border-radius: 12px; background: #677983; position: relative; cursor: inherit; }
.hdc-theme-switch input::before { content: ""; position: absolute; inset: 2px auto auto 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; }
.hdc-theme-switch input:checked,
html[data-bs-theme="dark"] .du-shell .hdc-theme-switch input[type="checkbox"]:checked { background: #386585; }
.hdc-theme-switch input:checked::before { left: 16px; }
.hdc-theme-switch input:focus-visible { outline: 2px solid var(--du-accent); outline-offset: 3px; }

/* Bootstrap table cells carry their own background and hover variables. */
html[data-bs-theme="dark"] .du-shell .hdc-registry {
  --bs-table-bg: var(--du-surface);
  --bs-table-color: var(--du-text);
  --bs-table-border-color: var(--du-border);
  --bs-table-hover-bg: var(--du-active);
  --bs-table-hover-color: var(--du-text);
}
html[data-bs-theme="dark"] .du-shell .hdc-registry :is(td, th) {
  color: var(--du-text);
  border-color: var(--du-border);
}
html[data-bs-theme="dark"] .du-shell .hdc-registry .registry-task {
  --bs-table-bg: var(--du-ground);
}
html[data-bs-theme="dark"] .du-shell .hdc-registry :is(.hdc-type, .hdc-cell-meta, .hdc-task-toggle, .hdc-task-stage, .hdc-task-person) {
  color: var(--du-muted);
}
html[data-bs-theme="dark"] .du-shell .hdc-registry .hdc-avatar {
  background: var(--du-active);
  color: var(--du-text);
}
html[data-bs-theme="dark"] .du-shell .hdc-registry tbody tr {
  border-color: var(--du-border);
}
html[data-bs-theme="dark"] .du-shell .hdc-registry .registry-topic > td,
html[data-bs-theme="dark"] .du-shell .hdc-registry .hdc-empty-row > td {
  background-color: var(--du-surface);
}
