/* Shared theme toggle — AppTheme light/dark */
.theme-toggle {
  --tt-track: var(--theme-toggle-track, #e8edf5);
  --tt-knob: var(--theme-toggle-knob, #ffffff);
  --tt-icon: var(--theme-toggle-icon, #6b7280);
  --tt-active: var(--theme-toggle-active, #e87722);
  position: relative;
  box-sizing: border-box;
  flex: 0 0 48px;
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  padding: 0;
  border: 1px solid rgba(26, 29, 38, 0.1);
  border-radius: 999px;
  background: var(--tt-track);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  overflow: hidden;
  transition: background 0.2s ease, border-color 0.2s ease;
}

html[data-theme="dark"] .theme-toggle {
  border-color: #2d3748;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--tt-active);
  outline-offset: 2px;
}

.theme-toggle-icons {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
  pointer-events: none;
  z-index: 1;
}

.theme-toggle-icons svg {
  width: 11px !important;
  height: 11px !important;
  max-width: 11px !important;
  max-height: 11px !important;
  color: var(--tt-icon);
  opacity: 0.4;
  transition: opacity 0.2s ease, color 0.2s ease;
}

html[data-theme="light"] .theme-toggle .icon-sun,
html:not([data-theme="dark"]) .theme-toggle .icon-sun {
  opacity: 1;
  color: var(--tt-active);
}

html[data-theme="dark"] .theme-toggle .icon-moon {
  opacity: 1;
  color: #ffb36b;
}

.theme-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--tt-knob);
  box-shadow: 0 1px 2px rgba(26, 29, 38, 0.18);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

html[data-theme="dark"] .theme-toggle-knob {
  transform: translateX(20px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
