/* m-ui Liquid Glass switch (.lg-toggle)
 * Geometry follows iOS 26 / LiquidToggle.kt: a 64x28 track with a 40x24
 * knob. Wide screens use macOS-sized switches, narrow screens iOS-sized
 * ones; liquid-toggle.js scales every other length by height / 28.
 */
html body .lg-toggle {
  --lt-width: 46px;
  --lt-height: 20px;
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: none;
  width: var(--lt-width) !important;
  min-width: var(--lt-width) !important;
  height: var(--lt-height) !important;
  min-height: var(--lt-height) !important;
  padding: 0 !important;
  margin: 0;
  border: 0 !important;
  border-radius: 999px;
  box-sizing: border-box;
  vertical-align: middle;
  cursor: pointer;
  background: none !important;
  box-shadow: none !important;
  overflow: visible;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html body .lg-toggle.switch-sm,
html body .lg-toggle.lt-small,
html body button.search-toggle.lg-toggle {
  --lt-width: 36px;
  --lt-height: 16px;
}

@media (max-width: 768px) {
  html body .lg-toggle {
    --lt-width: 64px;
    --lt-height: 28px;
  }
  html body .lg-toggle.switch-sm,
  html body .lg-toggle.lt-small,
  html body button.search-toggle.lg-toggle {
    --lt-width: 50px;
    --lt-height: 22px;
  }
}

/* The canvas is larger than the track so the pressed 1.5x lens and its
 * shadow fit; liquid-toggle.js sets top/left to minus that margin. */
html body .lg-toggle > .liquid-toggle-canvas {
  position: absolute !important;
  pointer-events: none !important;
  z-index: 2 !important;
  display: block !important;
}

/* Native input sits invisibly on top to capture clicks, focus, and spacebar */
html body .lg-toggle > input[type="checkbox"] {
  position: absolute !important;
  inset: -4px !important;
  z-index: 5 !important;
  display: block !important;
  opacity: 0 !important;
  pointer-events: auto !important;
  width: calc(100% + 8px) !important;
  height: calc(100% + 8px) !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer !important;
  border: 0 !important;
}

/* Eradicate all legacy CSS decoration, pseudo-elements, and circular knobs */
html body .lg-toggle::before,
html body .lg-toggle::after,
html body button.search-toggle::before,
html body button.search-toggle::after,
html body .search-toggle.lg-toggle::before,
html body .search-toggle.lg-toggle::after,
html body .switch.lg-toggle > span,
html body .switch.lg-toggle > span::before,
html body .switch.lg-toggle > span::after,
html body .theme-switch.lg-toggle > span,
html body .theme-switch.lg-toggle > span::before,
html body .theme-switch.lg-toggle > span::after,
html body .ultra-check.lg-toggle > span,
html body .ultra-check.lg-toggle > span::before,
html body .ultra-check.lg-toggle > span::after,
html body .check-box.lg-toggle > span,
html body .check-box.lg-toggle > span::before,
html body .check-box.lg-toggle > span::after,
html body .check.lg-toggle > span,
html body .check.lg-toggle > span::before,
html body .check.lg-toggle > span::after,
html body .lg-toggle > span,
html body .lg-toggle > span::before,
html body .lg-toggle > span::after,
html body .lg-toggle > .lt-track {
  display: none !important;
  content: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Focus indicator for keyboard accessibility */
html body .lg-toggle:has(input:focus-visible),
html body button.lg-toggle:focus-visible {
  outline: 2px solid #007aff !important;
  outline-offset: 4px;
}

/* Disabled state */
html body .lg-toggle:has(input:disabled),
html body button.lg-toggle:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
}
html body .lg-toggle:has(input:disabled) > input,
html body button.lg-toggle:disabled {
  cursor: not-allowed !important;
}

/* Filter icon suppression inside button.search-toggle */
html body .lg-toggle .filter-icon {
  display: none !important;
}

/* Search toggle button styling */
html body button.search-toggle.lg-toggle {
  background: none !important;
  border: 0 !important;
  padding: 0 !important;
}
