html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --cw-theme-background: #13171f;
  --cw-theme-surface: #1c232e;
  --cw-theme-surface-soft: #252e3b;
  --cw-theme-surface-rgb: 28, 35, 46;
  --cw-theme-text: #edf1f7;
  --cw-theme-muted: #b3bfd0;
  --cw-theme-muted-rgb: 179, 191, 208;
  --cw-theme-border: #3c495c;
  --cw-theme-border-strong: #5a6a81;
  --cw-theme-border-rgb: 185, 203, 228;
  --cw-theme-hover-rgb: 210, 225, 245;
  --cw-theme-link: #93bbff;
  --cw-theme-action: #245ab2;
  --cw-theme-action-hover: #1b478f;
  --cw-theme-cta-end: #0e7490;
  --cw-theme-info-surface: #22334e;
  --cw-theme-info-rgb: 34, 51, 78;
  --cw-theme-info-border: #496795;
  --cw-theme-success-surface: #1b382e;
  --cw-theme-success-rgb: 27, 56, 46;
  --cw-theme-success-text: #97e5b4;
  --cw-theme-success-border: #3f8262;
  --cw-theme-danger-surface: #40262e;
  --cw-theme-danger-rgb: 64, 38, 46;
  --cw-theme-danger-text: #ffb3bd;
  --cw-theme-danger-border: #a35c6a;
  --cw-theme-warning-surface: #3b3020;
  --cw-theme-warning-rgb: 59, 48, 32;
  --cw-theme-warning-text: #fbd592;
  --cw-theme-warning-border: #9a7739;
  --cw-theme-purple-surface: #342b4e;
  --cw-theme-purple-text: #cfb9ff;
  --cw-theme-accent-text: #ffa16b;
  --cw-accent-strong: #ffa16b;
  --cw-accent-soft: #38281f;
  --cw-accent-border: #875633;
  --cw-icon: #bac8db;
  --cw-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
  --consent-modal-bg: var(--cw-theme-surface);
  --blog-accent: #63d2c2;
  --blog-accent-strong: #87e1d4;
  --blog-gold: #dfb679;
}

html[data-theme="dark"] body {
  color: var(--cw-theme-text);
  background: var(--cw-theme-background);
}

:where(html[data-theme="dark"]) a {
  color: var(--cw-theme-link);
}

html[data-theme="dark"] :where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="submit"], [type="button"]), select, textarea) {
  color: var(--cw-theme-text);
  background-color: var(--cw-theme-surface);
  border-color: var(--cw-theme-border-strong);
}

html[data-theme="dark"] :where(input, textarea)::placeholder {
  color: var(--cw-theme-muted);
  opacity: 1;
}

html[data-theme="dark"] :where(input, select, textarea):focus-visible {
  border-color: var(--cw-theme-link);
  outline-color: var(--cw-theme-link);
}

html[data-theme="dark"] .brand-logo {
  filter: brightness(0) invert(1);
}

html[data-theme="dark"] .blog-button {
  color: #102a25;
}

html[data-theme="dark"] .consent-button--primary,
html[data-theme="dark"] .coworking-404-button--primary,
html[data-theme="dark"] .filter-submit {
  color: #24180f;
}

html[data-theme="dark"] .notifications-bell-badge {
  background: #c2410c;
}

:where(html[data-theme="dark"]) a:focus-visible {
  outline: 2px solid var(--cw-theme-link);
  outline-offset: 3px;
}

.theme-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  font-family: var(--cw-font-body, inherit);
  color: var(--cw-theme-text, #1b2130);
  font-size: 0.82rem;
}

.theme-switcher__label {
  font-weight: 650;
}

.theme-switcher__options {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.2rem;
  border: 1px solid var(--cw-theme-border, #d8dce2);
  border-radius: 12px;
  background: var(--cw-theme-surface-soft, #f2f5fb);
}

.theme-switcher .theme-switcher__option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 0 auto;
  min-height: 40px;
  min-width: 44px;
  gap: 0.35rem;
  margin: 0;
  padding: 0.4rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--cw-theme-muted, #5a6476);
  box-shadow: none;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.theme-switcher .theme-switcher__option:hover {
  color: var(--cw-theme-text, #1b2130);
  background: var(--cw-theme-surface, #ffffff);
}

.theme-switcher .theme-switcher__option[aria-pressed="true"] {
  color: var(--cw-theme-accent-text, #9a3412);
  background: var(--cw-theme-surface, #ffffff);
  border-color: var(--cw-accent-border, #ffd8c2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.theme-switcher .theme-switcher__option:focus-visible {
  outline: 2px solid var(--cw-theme-link, #1d4ed8);
  outline-offset: 2px;
}

.theme-switcher__icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: currentColor;
  stroke: none;
}

.profile-panel__theme {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--cw-theme-border, #e1e4ea);
}

.theme-switcher--standalone {
  width: fit-content;
  margin: 0 0 1rem auto;
}

.theme-switcher--compact .theme-switcher__label,
.theme-switcher--compact .theme-switcher__option span {
  display: none;
}

.theme-switcher--compact .theme-switcher__option {
  padding: 0.35rem;
}

html[data-theme="dark"] .flatpickr-calendar {
  background: var(--cw-theme-surface);
  border: 1px solid var(--cw-theme-border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  color: var(--cw-theme-text);
}

html[data-theme="dark"] .flatpickr-months .flatpickr-month,
html[data-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months,
html[data-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month,
html[data-theme="dark"] .flatpickr-weekdays,
html[data-theme="dark"] .flatpickr-weekday {
  background: var(--cw-theme-surface);
  color: var(--cw-theme-text);
  fill: var(--cw-theme-text);
}

html[data-theme="dark"] .flatpickr-day {
  color: var(--cw-theme-text);
}

html[data-theme="dark"] .flatpickr-day.prevMonthDay,
html[data-theme="dark"] .flatpickr-day.nextMonthDay,
html[data-theme="dark"] .flatpickr-day.flatpickr-disabled,
html[data-theme="dark"] .flatpickr-day.flatpickr-disabled:hover {
  color: #8392a9;
}

html[data-theme="dark"] .flatpickr-day:hover,
html[data-theme="dark"] .flatpickr-day:focus,
html[data-theme="dark"] .flatpickr-day.inRange {
  background: var(--cw-theme-surface-soft);
  border-color: var(--cw-theme-border);
}

html[data-theme="dark"] .flatpickr-day.today {
  border-color: var(--cw-theme-link);
}

html[data-theme="dark"] .flatpickr-day.selected,
html[data-theme="dark"] .flatpickr-day.startRange,
html[data-theme="dark"] .flatpickr-day.endRange {
  background: #245ab2;
  border-color: #93bbff;
  color: #ffffff;
}

html[data-theme="dark"] .flatpickr-months .flatpickr-prev-month,
html[data-theme="dark"] .flatpickr-months .flatpickr-next-month {
  color: var(--cw-theme-text);
  fill: var(--cw-theme-text);
}

html[data-theme="dark"] .numInputWrapper span.arrowUp::after {
  border-bottom-color: var(--cw-theme-muted);
}

html[data-theme="dark"] .numInputWrapper span.arrowDown::after {
  border-top-color: var(--cw-theme-muted);
}

html[data-theme="dark"] .flatpickr-calendar.arrowTop::before,
html[data-theme="dark"] .flatpickr-calendar.arrowTop::after {
  border-bottom-color: var(--cw-theme-surface);
}

html[data-theme="dark"] .flatpickr-calendar.arrowBottom::before,
html[data-theme="dark"] .flatpickr-calendar.arrowBottom::after {
  border-top-color: var(--cw-theme-surface);
}

@media (max-width: 1180px) {
  .theme-switcher--compact {
    display: none;
  }

  .mobile-menu-overview > .theme-switcher {
    margin: 0.8rem 0;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--cw-theme-border, #e1e4ea);
  }
}

@media print {
  .theme-switcher {
    display: none;
  }
}
