html.cift-ui.is-dark {
  color-scheme: dark;
  --brand-blue: #b4cedd;
  --brand-ink: #e8edf1;
  --brand-blue-soft: #2d3e4a;
  --brand-blue-ink: #c4dbe8;
  --brand-rose-soft: #40333d;
  --brand-rose-ink: #e2c7d3;
  --brand-focus: #a3c5da;
  --brand-progress-start: #253e50;
  --brand-progress-mid: #344f64;
  --brand-progress-end: #405f75;
  --brand-progress-glow: rgb(180 217 238 / .10);
  --cift-bg: #191e24;
  --cift-surface: #232a32;
  --cift-surface-muted: #2a323c;
  --cift-surface-soft: #262e37;
  --cift-surface-overlay: rgb(255 255 255 / .08);
  --cift-ink: var(--brand-ink);
  --cift-muted: #aab7c3;
  --cift-line: #39444f;
  --cift-control: #303b46;
  --cift-control-hover: #3b4855;
  --cift-accent: var(--brand-blue);
  --cift-accent-hover: #c9dde8;
  --cift-on-accent: #203340;
  --cift-sage: var(--brand-blue-soft);
  --cift-sage-ink: var(--brand-blue-ink);
  --cift-sky: #334958;
  --cift-sky-ink: #c4dbe8;
  --cift-lilac: var(--brand-rose-soft);
  --cift-lilac-ink: var(--brand-rose-ink);
  --cift-peach: #403b37;
  --cift-peach-ink: #e3d5c9;
  --cift-danger-bg: #4a302f;
  --cift-danger: #f1b2a9;
  --cift-scrollbar: #596b7a;
  --cift-scrim: rgb(0 0 0 / .6);
  --cift-shadow-float: 0 16px 45px rgb(0 0 0 / .25);
}
html.cift-ui .home-page .theme-mode-switch {
  position: relative; display: block; flex: 0 0 auto; width: 84px; height: 44px;
  padding: 4px; border: 1px solid var(--cift-line); border-radius: 999px;
  background: var(--cift-control); cursor: pointer; box-shadow: none;
  transition: background-color 320ms ease, border-color 320ms ease;
}
.theme-mode-thumb { position: relative; display: block; width: 34px; height: 34px; border-radius: 50%; background: var(--cift-surface); box-shadow: 0 2px 5px rgb(0 0 0 / .12); transform: translateX(0); transition: transform 420ms cubic-bezier(.22,.8,.24,1), background-color 320ms ease; }
.theme-mode-thumb i { position: absolute; inset: 7px; background: var(--cift-ink); mask: center / contain no-repeat; transition: opacity 260ms ease, transform 420ms ease; }
.theme-mode-thumb .theme-mode-sun { mask-image: url('/assets/theme-sun.svg'); }
.theme-mode-thumb .theme-mode-moon { mask-image: url('/assets/theme-moon.svg'); opacity: 0; transform: rotate(-70deg) scale(.5); }
.is-dark .theme-mode-thumb { transform: translateX(40px); }
.is-dark .theme-mode-thumb .theme-mode-sun { opacity: 0; transform: rotate(90deg) scale(.5); }
.is-dark .theme-mode-thumb .theme-mode-moon { opacity: 1; transform: rotate(0) scale(1); }
html.cift-ui.is-dark .workbench-bottom-nav { background: var(--cift-surface); border-color: var(--cift-line); color: var(--cift-ink); }
html.cift-ui.is-dark .workbench-bottom-nav::before { background: var(--cift-control-hover); box-shadow: none; }
html.cift-ui.is-dark .workbench-bottom-nav button { color: var(--cift-muted); }
html.cift-ui.is-dark .workbench-bottom-nav button.is-active { color: var(--cift-ink); }
html.cift-ui.is-dark :is(.sp-month-cell,.sp-day-track,.sp-stage,.sp-mini-month,.sp-dialog,.home-plan-popover,.word-inspector,.toast) { background-color: var(--cift-surface); color: var(--cift-ink); border-color: var(--cift-line); }
html.cift-ui.is-dark :is(.sp-month-day,.sp-mini-day,.sp-week-day,.sp-day-time,.home-plan-popover h3,.home-plan-item,.home-plan-trigger) { color: var(--cift-ink); }
html.cift-ui.is-dark :is(.home-plan-trigger,.home-plan-item,.sp-dialog input,.sp-dialog textarea,.word-inspector input) { background: var(--cift-control); border-color: var(--cift-line); }
html.cift-ui.is-dark :is(.mono-source-stage,.mono-donut-stage,.mono-donut-visual,.mono-donut-legend-item,.mono-source-tooltip) { background: var(--cift-surface-muted) !important; color: var(--cift-ink); border-color: var(--cift-line); }
html.cift-ui.is-dark :is(.mono-source-stage,.mono-donut-stage) text { fill: var(--cift-muted); }
html.cift-ui.is-dark :is(.site-update-entry,.home-legal-footer,.reading-paragraph,.authorized-answer-card) { border-color: var(--cift-line); }
@media(prefers-reduced-motion: reduce) { .theme-mode-thumb,.theme-mode-thumb i { transition-duration: .01ms; } }
html.cift-ui.is-dark .study-plans-page .sp-page-heading h1 { color: var(--cift-ink); }
html.cift-ui.is-dark .sp .sp-views button { color: var(--cift-muted); }
html.cift-ui.is-dark .sp .sp-views button[aria-selected="true"] { color: var(--cift-on-accent); }
html.cift-ui.is-dark .sp :is(.sp-icon,.sp-jump,.sp-add) img { filter: invert(.9); }
html.cift-ui.is-dark .sp :is(.sp-icon,.sp-today,.sp-jump,.sp-more,.sp-mini-month,.sp-date):hover,
html.cift-ui.is-dark .sp .sp-views button:hover:not([aria-selected="true"]) { color: var(--cift-ink); background: var(--cift-control-hover); }
html.cift-ui.is-dark .sp .sp-month-cell.is-selected,
html.cift-ui.is-dark .sp .sp-week-date,
html.cift-ui.is-dark .sp-dialog .sp-agenda-item { background: var(--cift-control); color: var(--cift-ink); }
html.cift-ui.is-dark .sp :is(.sp-mini-day.is-today,.sp-week-date.is-selected),
html.cift-ui.is-dark .sp .sp-date-strip button.is-selected,
html.cift-ui.is-dark .sp .sp-month-cell.is-today .sp-date { background: var(--cift-accent); color: var(--cift-on-accent); }
html.cift-ui.is-dark .sp .sp-mini-day { background: var(--cift-control-hover); }
html.cift-ui.is-dark .sp .sp-mini-day[class*="heat-"] { background: var(--cift-peach); color: var(--cift-peach-ink); }
html.cift-ui.is-dark .sp .sp-now > span { background: var(--cift-bg); }
html.cift-ui.is-dark .analytics-page .mono-donut-layout { background: var(--cift-surface-muted) !important; }
html.cift-ui.is-dark .analytics-page .mono-source-stage svg { filter: invert(.85) hue-rotate(180deg); }
html.cift-ui.is-dark .sp-dialog::backdrop { background: var(--cift-scrim); }
html.cift-ui .home-page .home-pet-button {
  transition: transform 220ms ease, filter 650ms ease;
}
html.cift-ui.is-dark .home-page .home-pet-button {
  filter: drop-shadow(0 0 5px rgb(209 230 245 / .25)) drop-shadow(0 0 18px rgb(180 206 221 / .22));
}
html.cift-ui.is-dark .home-page .home-pet-button:hover,
html.cift-ui.is-dark .home-page .home-pet-button:focus-visible {
  filter: drop-shadow(0 0 6px rgb(209 230 245 / .34)) drop-shadow(0 0 22px rgb(180 206 221 / .28));
}
@media (prefers-reduced-motion: reduce) {
  html.cift-ui .home-page .home-pet-button { transition-duration: .01ms; }
}
