.lg-tabs,
.lg-slider,
.lg-switch {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.lg-tabs {
  position: relative;
  display: flex;
  padding: 4px;
  height: 63px;
  width: min(340px, 100%);
  isolation: isolate;
}
.lg-surface,
.lg-selection,
.lg-knob,
.lg-switch-thumb {
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
}
.lg-surface {
  inset: 0;
  background: rgba(246, 248, 250, 0.72);
}
.lg-selection {
  top: 5px;
  bottom: 5px;
  left: calc(4px + (100% - 8px) / var(--count) * (var(--tab) + 0.5));
  width: calc((100% - 8px) / var(--count));
  background: rgba(112, 118, 127, 0.16);
  transform: translateX(-50%);
  transition:
    left 0.32s cubic-bezier(0.19, 1.22, 0.38, 1),
    background 0.16s;
}
.lg-tabs[data-held] .lg-selection {
  top: -5%;
  bottom: -5%;
  transition: background 0.13s;
  background: #ffffff12;
  z-index: 2;
  width: calc((100% - 8px) / var(--count) * var(--lg-held-width, 1.14));
  box-shadow:
    inset 0 1px 1px #ffffff60,
    inset 0 -1px 1px #0a182d88,
    0 1px 4px #00152330;
}
.lg-tabs button {
  position: relative;
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  display: flex;
  gap: 2px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font:
    600 10px/1.1 -apple-system,
    system-ui,
    sans-serif;
  color: #19191b;
  cursor: pointer;
}
.lg-tabs button[aria-current="page"] {
  color: #007aff;
}
.lg-tabs svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}
.lg-slider {
  --knob: 38px;
  position: relative;
  height: 46px;
  width: 100%;
  color: #007aff;
}
.lg-rail {
  position: absolute;
  top: 50%;
  left: calc(var(--knob) / 2);
  right: calc(var(--knob) / 2);
  height: 6px;
  transform: translateY(-50%);
  border-radius: 8px;
  background: linear-gradient(
    to right,
    currentColor var(--level),
    #78788042 var(--level)
  );
}
.lg-knob {
  width: var(--knob);
  height: 24px;
  top: 50%;
  left: calc((100% - var(--knob)) * var(--fraction, 0.5));
  transform: translateY(-50%);
  background: #fff;
  transition:
    width 0.15s,
    height 0.15s,
    margin 0.15s,
    background 0.14s;
}
.lg-slider input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: grab;
  appearance: none;
  background: transparent;
}
.lg-slider input::-webkit-slider-thumb {
  appearance: none;
  width: var(--knob);
  height: 30px;
}
.lg-slider input::-moz-range-thumb {
  width: var(--knob);
  height: 30px;
}
.lg-slider[data-held] .lg-knob {
  background: rgba(255, 255, 255, 0.08);
  width: 58px;
  height: 38px;
  margin-left: -10px;
}
.lg-slider:focus-within,
.lg-tabs button:focus-visible,
.lg-switch:focus-visible {
  outline: 2px solid #007aff;
  outline-offset: 2px;
  border-radius: 30px;
}
.lg-switch {
  position: relative;
  width: 64px;
  height: 28px;
  flex-shrink: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  overflow: visible;
  cursor: pointer;
}
.lg-switch-rail {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #78788059;
  transition: background 0.18s;
}
.lg-switch[aria-checked="true"] .lg-switch-rail {
  background: #34c759;
}
.lg-switch-thumb {
  width: 36px;
  height: 24px;
  left: 2px;
  top: 50%;
  background: white;
  transform: translateY(-50%) translateX(calc(var(--toggle) * 24px));
  transition:
    width 0.15s,
    height 0.15s,
    margin 0.15s,
    background 0.14s,
    transform 0.22s cubic-bezier(0.2, 1.15, 0.34, 1);
}
/* Resize the aperture itself so its captured track stays aligned. */
.lg-switch[data-held] .lg-switch-thumb {
  width: 58px;
  height: 38px;
  margin-left: -11px;
  background: rgba(255, 255, 255, 0.08);
  transition:
    width 0.15s,
    height 0.15s,
    margin 0.15s,
    background 0.14s;
}
.lg-switch[data-held],
.lg-slider[data-held] {
  --lg-shadow: 0 4px 7px rgba(25, 45, 60, 0.16);
}
.lg-items {
  display: flex;
  position: relative;
  width: 100%;
  height: 100%;
}
.lg-tab-viewport {
  position: relative;
  width: 100%;
  height: 100%;
}
@media (prefers-reduced-motion: reduce) {
  .lg-tabs .lg-selection,
  .lg-slider .lg-knob,
  .lg-switch .lg-switch-thumb,
  .lg-switch .lg-switch-rail {
    transition: none;
  }
}
