.navbar-social-controls {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  justify-self: center;
}

:root {
  --wz-page-bg: #ffffff;
  --wz-surface-bg: #ffffff;
  --wz-surface-elevated: #f5f8fb;
  --wz-text-color: #212529;
}

html[data-wz-theme="dark"] {
  --wz-page-bg: #212529;
  --wz-surface-bg: #212529;
  --wz-surface-elevated: #27303a;
  --wz-text-color: #f8f9fa;
}

html[data-wz-theme="light"],
html[data-wz-theme="dark"] {
  scrollbar-color: var(--primary-wizardeo) var(--wz-page-bg);
  scrollbar-width: auto;
}

html[data-wz-theme="light"]::-webkit-scrollbar,
html[data-wz-theme="dark"]::-webkit-scrollbar {
  width: 15px;
  height: 15px;
}

html[data-wz-theme="light"]::-webkit-scrollbar-track,
html[data-wz-theme="dark"]::-webkit-scrollbar-track {
  background: var(--wz-page-bg);
}

html[data-wz-theme="light"]::-webkit-scrollbar-thumb,
html[data-wz-theme="dark"]::-webkit-scrollbar-thumb {
  background: var(--primary-wizardeo);
  border-radius: 999px;
  border: 3px solid var(--wz-page-bg);
}

html[data-wz-theme="light"]::-webkit-scrollbar-thumb:hover,
html[data-wz-theme="dark"]::-webkit-scrollbar-thumb:hover {
  background: var(--primary-wizardeo-darker, var(--primary-wizardeo));
}

html[data-wz-theme="light"]::-webkit-scrollbar-corner,
html[data-wz-theme="dark"]::-webkit-scrollbar-corner {
  background: var(--wz-page-bg);
}

.navbar-theme-palette-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.9rem;
  min-width: 2.9rem;
  height: 2.9rem;
  padding: 0;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.95rem;
  background:
    radial-gradient(circle at 24% 26%, rgba(255, 255, 255, 0.33), transparent 43%),
    linear-gradient(135deg, #db5f2d 0%, #c73c6b 40%, #6f58cc 100%);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(27, 35, 51, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.primary-navigation.navbar-compact .navbar-theme-palette-button {
  width: 2.55rem;
  min-width: 2.55rem;
  height: 2.55rem;
  border-radius: 0.85rem;
}

.navbar-theme-palette-button:hover,
.navbar-theme-palette-button:focus-visible {
  color: #ffffff;
  transform: translateY(-1px) scale(1.03);
  filter: brightness(1.03);
  box-shadow: 0 16px 28px rgba(27, 35, 51, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.navbar-social-controls button:focus-visible,
.navbar-theme-palette-button:focus-visible {
  outline: none;
}

.navbar-social-controls button:focus,
.navbar-theme-palette-button:focus {
  outline: none;
}

.navbar-theme-palette-button__icon {
  font-size: 1.05rem;
  line-height: 1;
}

.wz-theme-palette-modal__content {
  border: 1px solid var(--primary-wizardeo-alpha-20, rgba(18, 27, 37, 0.14));
  border-radius: 1rem;
  background: var(--wz-surface-elevated);
  color: var(--wz-text-color);
}

.wz-theme-palette-modal {
  z-index: 1061;
}

html[data-wz-theme="light"] body,
html[data-wz-theme="dark"] body {
  background-color: var(--wz-page-bg) !important;
  color: var(--wz-text-color);
}

html[data-wz-theme="light"] .BgColorSwitch,
html[data-wz-theme="dark"] .BgColorSwitch,
html[data-wz-theme="light"] .site-nav,
html[data-wz-theme="dark"] .site-nav,
html[data-wz-theme="light"] .site-mobile-menu,
html[data-wz-theme="dark"] .site-mobile-menu,
html[data-wz-theme="light"] .site-footer,
html[data-wz-theme="dark"] .site-footer,
html[data-wz-theme="light"] .navbar-search-form .form-control,
html[data-wz-theme="dark"] .navbar-search-form .form-control {
  background-color: var(--wz-surface-bg) !important;
}

html[data-wz-theme="light"] .bg-light,
html[data-wz-theme="dark"] .bg-dark {
  background-color: var(--wz-surface-bg) !important;
}

html[data-wz-theme="light"] .card,
html[data-wz-theme="dark"] .card,
html[data-wz-theme="light"] .modal-content,
html[data-wz-theme="dark"] .modal-content {
  background-color: var(--wz-surface-elevated);
}

.wz-theme-palette-modal__header {
  border-bottom: 1px solid var(--primary-wizardeo-alpha-16, rgba(18, 27, 37, 0.09));
}

.wz-theme-palette-modal__body {
  padding-top: 0.8rem;
}

.wz-theme-palette-modal__description {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: color-mix(in srgb, var(--wz-text-color) 76%, transparent);
}

.wz-theme-palette-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.wz-theme-palette-option {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  border-radius: 0.85rem;
  border: 1px solid var(--primary-wizardeo-alpha-20, #d4dbe2);
  background: var(--wz-surface-bg, #f9fafb);
  color: var(--wz-text-color, #202833);
  padding: 0.65rem 0.75rem;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.wz-theme-palette-option:hover,
.wz-theme-palette-option:focus-visible {
  border-color: var(--primary-wizardeo-alpha-32, #a8b3bf);
  background: var(--primary-wizardeo-alpha-10, #ffffff);
  transform: translateY(-1px);
}

.wz-theme-palette-option:focus-visible {
  outline: 2px solid rgba(122, 162, 255, 0.9);
  outline-offset: 2px;
}

.wz-theme-palette-option.is-active {
  border-color: var(--primary-wizardeo);
  box-shadow: 0 10px 20px var(--primary-wizardeo-alpha-24, rgba(0, 0, 0, 0.2));
  background: var(--primary-wizardeo-alpha-10, rgba(255, 255, 255, 0.95));
}

.wz-theme-palette-option__preview {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.wz-theme-palette-option__swatch {
  display: inline-block;
  width: 0.7rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--wz-palette-preview);
}

.wz-theme-palette-option__name {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
}

.wz-theme-palette-option__check {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.18s ease, transform 0.18s ease;
  color: var(--primary-wizardeo);
}

.wz-theme-palette-option.is-active .wz-theme-palette-option__check {
  opacity: 1;
  transform: scale(1);
}

html[data-wz-theme="dark"] .wz-theme-palette-option.is-active {
  background: var(--primary-wizardeo-alpha-24, rgba(255, 255, 255, 0.08));
}

html[data-wz-theme="dark"] .wz-theme-palette-modal .btn-close {
  filter: invert(1) grayscale(100%);
}

@media (max-width: 991.98px) {
  .navbar-theme-palette-button {
    width: 2.75rem;
    min-width: 2.75rem;
    height: 2.75rem;
  }
}

@media (max-width: 620px) {
  .wz-theme-palette-grid {
    grid-template-columns: 1fr;
  }

  .navbar-social-controls {
    gap: 0.45rem;
  }

  .navbar-theme-palette-button {
    width: 2.55rem;
    min-width: 2.55rem;
    height: 2.55rem;
    border-radius: 0.85rem;
  }
}
