:where(:root, [data-theme="light"]) {
  --lg-foreground: rgb(0 0 0 / 0.88);
  --lg-muted: rgb(60 60 67 / 0.6);
  --lg-glass: rgb(255 255 255 / 0.6);
  --lg-sidebar-glass: rgb(227 226 225 / 0.6);
  --lg-glass-active: rgb(236 236 240 / 0.85);
  --lg-glass-clear: rgb(255 255 255 / 0.14);
  --lg-glass-clear-active: rgb(255 255 255 / 0.28);
  --lg-edge: rgb(0 0 0 / 0.08);
  --lg-drop: rgb(0 0 0 / 0.06);
  --lg-selection: rgb(0 0 0 / 0.1);
  --lg-tab-selection: var(--lg-selection);
  --lg-tab-well: transparent;
  --lg-tab-vivid: #000 8%;
  --lg-lens: rgb(0 0 0 / 0.03);
  --lg-lens-drop: rgb(0 0 0 / 0.11);
  --lg-segment-track: rgb(118 118 128 / 0.12);
  --lg-segment-thumb: rgb(255 255 255);
  --lg-segment-label: rgb(0 0 0);
  --lg-segment-lens: rgb(0 0 0 / 0.03);
  --lg-surface: rgb(250 250 252 / 0.86);
  --lg-surface-edge: rgb(0 0 0 / 0.08);
  --lg-shadow: rgb(25 25 35 / 0.12);
  --lg-highlight: rgb(60 60 67 / 0.09);
  --lg-hover: rgb(0 0 0 / 0.05);
  --lg-separator: rgb(60 60 67 / 0.15);
  --lg-destructive: #ff383c;
  --lg-track: rgb(59 59 66 / 0.3);
  --lg-rail: rgb(0 0 0 / 0.1);
  --lg-within: rgb(0 0 0 / 0.06);
  --lg-within-active: rgb(0 0 0 / 0.11);
  --lg-dialog-action: rgb(0 0 0 / 0.1);
  --lg-dialog-action-active: rgb(0 0 0 / 0.17);
  --lg-on: #34c759;
  --lg-fill: #0088ff;
  --lg-ring: rgb(0 0 0 / 0.4);
  --lg-lens-shine: -1.5;
  --lg-rim-shine: 0.3;
  --lg-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* A field is macOS's glass, fitted to it over 32 colours: its own tint,
   saturation and gain, a rim lit along its top and bottom, a faint hairline
   outside it and a faint shade under its top lip. Its
   placeholder and icon take their colour from the glass, as macOS's do:
   darker than it by half in light, lighter by half in dark. On drawn glass
   they're mixed into it; on glass that frosts the page they're laid over it. */
:where(:root, [data-theme="light"]) {
  --lg-field-glass: rgb(252 252 252 / 0.5);
  --lg-field-glass-active: rgb(236 236 240 / 0.8);
  --lg-field-saturate: 1.95;
  --lg-field-gain: 1;
  --lg-field-shine: 0.5;
  --lg-field-outline: rgb(0 0 0 / 0.06);
  --lg-field-shade: rgb(0 0 0 / 0.07);
  --lg-field-inner: rgb(0 0 0 / 0.018);
  --lg-placeholder: rgb(0 0 0 / 0.5);
  --lg-input-clear: rgb(0 0 0 / 0.5);
  --lg-vibrant: rgb(128 128 128);
  --lg-vibrant-blend: difference;
  --lg-vibrant-icon: 0.75;
}

@supports (mix-blend-mode: plus-darker) {
  :where(:root, [data-theme="light"]) {
    --lg-vibrant-blend: plus-darker;
  }
}

:where([data-theme="dark"]) {
  --lg-foreground: rgb(255 255 255);
  --lg-field-glass: rgb(110 110 110 / 0.35);
  --lg-field-glass-active: rgb(150 150 150 / 0.4);
  --lg-field-saturate: 1.7;
  --lg-field-gain: 1.1;
  --lg-field-shine: 0.27;
  --lg-field-outline: rgb(0 0 0 / 0.2);
  --lg-field-shade: rgb(0 0 0 / 0.2);
  --lg-field-inner: transparent;
  --lg-placeholder: rgb(255 255 255 / 0.66);
  --lg-input-clear: rgb(255 255 255 / 0.55);
  --lg-vibrant: rgb(124 124 124);
  --lg-vibrant-blend: plus-lighter;
  --lg-vibrant-icon: 0.65;
  --lg-muted: rgb(235 235 245 / 0.6);
  --lg-glass: rgb(40 40 40 / 0.62);
  --lg-sidebar-glass: rgb(19 19 19 / 0.62);
  --lg-glass-active: rgb(70 70 70 / 0.62);
  --lg-glass-clear: rgb(255 255 255 / 0.12);
  --lg-glass-clear-active: rgb(255 255 255 / 0.24);
  --lg-edge: rgb(255 255 255 / 0.08);
  --lg-drop: transparent;
  --lg-selection: rgb(255 255 255 / 0.145);
  --lg-tab-selection: transparent;
  --lg-tab-well: rgb(0 0 0 / 0.25);
  --lg-tab-vivid: #fff 18%;
  --lg-lens: rgb(255 255 255 / 0.055);
  --lg-lens-drop: transparent;
  --lg-segment-track: transparent;
  --lg-segment-thumb: rgb(235 235 245 / 0.3);
  --lg-segment-label: rgb(255 255 255);
  --lg-segment-lens: transparent;
  --lg-surface: rgb(28 28 31 / 0.86);
  --lg-surface-edge: rgb(255 255 255 / 0.13);
  --lg-shadow: rgb(0 0 0 / 0.38);
  --lg-highlight: rgb(235 235 245 / 0.13);
  --lg-hover: rgb(255 255 255 / 0.1);
  --lg-separator: rgb(235 235 245 / 0.16);
  --lg-destructive: #ff4245;
  --lg-track: rgb(235 235 245 / 0.3);
  --lg-rail: rgb(255 255 255 / 0.1);
  --lg-within: rgb(255 255 255 / 0.09);
  --lg-within-active: rgb(255 255 255 / 0.17);
  --lg-dialog-action: rgb(255 255 255 / 0.15);
  --lg-dialog-action-active: rgb(255 255 255 / 0.24);
  --lg-on: #30d158;
  --lg-fill: #0091ff;
  --lg-ring: rgb(255 255 255 / 0.5);
  --lg-lens-shine: 1;
  --lg-rim-shine: 0.13;
}

@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) {
    --lg-foreground: rgb(255 255 255);
    --lg-field-glass: rgb(110 110 110 / 0.35);
    --lg-field-glass-active: rgb(150 150 150 / 0.4);
    --lg-field-saturate: 1.7;
    --lg-field-gain: 1.1;
    --lg-field-shine: 0.27;
    --lg-field-outline: rgb(0 0 0 / 0.2);
    --lg-field-shade: rgb(0 0 0 / 0.2);
    --lg-field-inner: transparent;
    --lg-placeholder: rgb(255 255 255 / 0.66);
    --lg-input-clear: rgb(255 255 255 / 0.55);
    --lg-vibrant: rgb(124 124 124);
    --lg-vibrant-blend: plus-lighter;
    --lg-vibrant-icon: 0.65;
    --lg-muted: rgb(235 235 245 / 0.6);
    --lg-glass: rgb(40 40 40 / 0.62);
    --lg-sidebar-glass: rgb(19 19 19 / 0.62);
    --lg-glass-active: rgb(70 70 70 / 0.62);
    --lg-glass-clear: rgb(255 255 255 / 0.12);
    --lg-glass-clear-active: rgb(255 255 255 / 0.24);
    --lg-edge: rgb(255 255 255 / 0.08);
    --lg-drop: transparent;
    --lg-selection: rgb(255 255 255 / 0.145);
    --lg-tab-selection: transparent;
    --lg-tab-well: rgb(0 0 0 / 0.25);
    --lg-tab-vivid: #fff 18%;
    --lg-lens: rgb(255 255 255 / 0.055);
    --lg-lens-drop: transparent;
    --lg-segment-track: transparent;
    --lg-segment-thumb: rgb(235 235 245 / 0.3);
    --lg-segment-label: rgb(255 255 255);
    --lg-segment-lens: transparent;
    --lg-surface: rgb(28 28 31 / 0.86);
    --lg-surface-edge: rgb(255 255 255 / 0.13);
    --lg-shadow: rgb(0 0 0 / 0.38);
    --lg-highlight: rgb(235 235 245 / 0.13);
    --lg-hover: rgb(255 255 255 / 0.1);
    --lg-separator: rgb(235 235 245 / 0.16);
    --lg-destructive: #ff4245;
    --lg-track: rgb(235 235 245 / 0.3);
    --lg-rail: rgb(255 255 255 / 0.1);
    --lg-within: rgb(255 255 255 / 0.09);
    --lg-within-active: rgb(255 255 255 / 0.17);
    --lg-dialog-action: rgb(255 255 255 / 0.15);
    --lg-dialog-action-active: rgb(255 255 255 / 0.24);
    --lg-on: #30d158;
    --lg-fill: #0091ff;
    --lg-ring: rgb(255 255 255 / 0.5);
  --lg-lens-shine: 1;
    --lg-rim-shine: 0.13;
  }
}

/* Glass */

.lg-glass {
  position: relative;
  background-color: var(--lg-glass);
  background-image: var(--lg-rim, none);
  background-size: 100% 100%;
  --lg-finish: brightness(var(--lg-gain, 1)) saturate(var(--lg-saturate, 1.5));
  -webkit-backdrop-filter: blur(var(--lg-blur, 3px)) var(--lg-filter, var(--lg-finish));
  backdrop-filter: blur(var(--lg-blur, 3px)) var(--lg-filter, var(--lg-finish));
  box-shadow:
    inset 0 0 0 0.5px var(--lg-edge),
    0 1px 3px var(--lg-drop);
}

/* Glass that paints its rim (see refraction.ts) draws its edge line there,
   under the light, which an inset shadow would cover. */
.lg-glass[data-rim] {
  box-shadow: 0 1px 3px var(--lg-drop);
}

/* Glass that draws its own bent rim (see drawn.ts) keeps the drawing under
   everything else it holds, and its lit rim over the drawing. */
.lg-glass[data-drawn] {
  isolation: isolate;
}

/* Glass that draws its whole face has nothing left to frost or tint. */
.lg-glass[data-drawn="whole"] {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.lg-drawn {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.lg-drawn > canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.lg-drawn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--lg-rim, none) 0 0 / 100% 100%;
}

.lg-glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    circle 240px at var(--lg-x, 50%) var(--lg-y, 50%),
    rgb(255 255 255 / 0.035),
    rgb(255 255 255 / 0.025) 50%,
    transparent
  );
  opacity: 0;
  transition: opacity 220ms ease-in-out;
}

.lg-glass[data-pressed]::after {
  opacity: 1;
  transition-duration: 0s;
}

/* Apple's two glasses, as SwiftUI names them. Regular frosts what's behind
   it, so anything reads on it; clear lets it through, bent at the rim but
   hardly softened or tinted. */
.lg-glass[data-variant="regular"] {
  --lg-blur: 16px;
}

.lg-glass[data-variant="clear"] {
  --lg-blur: 0.5px;
  background-color: var(--lg-glass-clear);
}

/* Tinted, the glass takes the colour and still shows what's behind it. */
/* As SwiftUI's tinted glass: nearly the colour itself on regular glass, and
   a little more of what's behind it on clear. */
.lg-glass[data-tint] {
  background-color: color-mix(in srgb, var(--lg-tint) 86%, transparent);
}

.lg-glass[data-tint][data-variant="clear"] {
  background-color: color-mix(in srgb, var(--lg-tint) 70%, transparent);
}

/* Interactive glass answers a press as a control's does: lit under the
   pointer, and (see usePress) grown and pulled after a drag. */
.lg-glass[data-interactive] {
  cursor: default;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 200ms ease;
}

.lg-glass[data-interactive]::after {
  background: radial-gradient(
    circle 180px at var(--lg-x, 50%) var(--lg-y, 50%),
    rgb(255 255 255 / 0.2),
    rgb(255 255 255 / 0.07) 55%,
    transparent
  );
}

.lg-glass[data-interactive][data-pressed]:not([data-tint]) {
  background-color: var(--lg-glass-active);
  transition-duration: 0s;
}

.lg-glass[data-interactive][data-pressed][data-variant="clear"]:not([data-tint]) {
  background-color: var(--lg-glass-clear-active);
}

/* Button */

/* A control's size: `size` on it, or on a Modal for everything inside. With
   none, each keeps its own. */
:is(.lg-button, .lg-input, .lg-select, .lg-stepper, .lg-segmented, .lg-dialog)[data-size="sm"] {
  --lg-control-size: 28px;
  --lg-control-pad: 12px;
  --lg-control-font: 13px;
}

:is(.lg-button, .lg-input, .lg-select, .lg-stepper, .lg-segmented, .lg-dialog)[data-size="md"] {
  --lg-control-size: 32px;
  --lg-control-pad: 14px;
  --lg-control-font: 13px;
}

:is(.lg-button, .lg-input, .lg-select, .lg-stepper, .lg-segmented, .lg-dialog)[data-size="lg"] {
  --lg-control-size: 40px;
  --lg-control-pad: 16px;
  --lg-control-font: 14px;
}

.lg-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--lg-control-size, 40px);
  padding: 0 var(--lg-control-pad, 16px);
  border: 0;
  border-radius: calc(var(--lg-control-size, 40px) / 2);
  color: var(--lg-foreground);
  font: inherit;
  font-size: var(--lg-control-font, 14px);
  cursor: pointer;
  /* A long press keeps pressing, as on iOS, rather than selecting the label. */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 200ms ease;
  --lg-glass: var(--lg-field-glass);
  --lg-glass-active: var(--lg-field-glass-active);
  --lg-saturate: var(--lg-field-saturate);
  --lg-gain: var(--lg-field-gain);
  --lg-rim-shine: var(--lg-field-shine);
  --lg-rim-lit: along;
}

/* A button is of the field's glass (see Input), as a pop-up button and a
   toolbar's groups are: its rim lit along the top and bottom, and its faint
   hairline outside. Filled or tinted, it keeps its colour under them. */
.lg-button.lg-glass[data-rim] {
  box-shadow:
    inset 0 4px 10px var(--lg-field-inner),
    0 0 0 0.5px var(--lg-field-outline),
    1.5px 0 0 -0.5px var(--lg-field-shade),
    -1.5px 0 0 -0.5px var(--lg-field-shade),
    0 1px 3px var(--lg-drop);
}

.lg-button[data-icon] {
  padding-left: calc(var(--lg-control-pad, 16px) - 4px);
}

.lg-button[data-icon="only"] {
  width: var(--lg-control-size, 40px);
  padding: 0;
}

.lg-button > svg {
  flex: none;
  width: 20px;
  height: 20px;
}

/* A tint colours a glass button's label, not its glass, which a pane of
   tinted glass takes (see .lg-glass[data-tint]): the label would be lost on
   it. Before what a press, the pointer and a fill set, which come after. */
.lg-button[data-tint] {
  background-color: var(--lg-glass);
}

/* Lights up at once when pressed, as on iOS, and fades on release. */
.lg-button:is(:active, [data-pressed]) {
  background-color: var(--lg-glass-active);
  transition-duration: 0s;
}

@media (hover: hover) and (pointer: fine) {
  .lg-button:hover {
    background-color: var(--lg-glass-active);
  }
}

.lg-button:disabled {
  background-color: var(--lg-glass);
  opacity: 0.35;
  cursor: default;
}

.lg-button[data-destructive]:not([data-tint]) {
  --lg-tint: var(--lg-destructive);
}

.lg-button:is([data-tint], [data-destructive]) {
  color: var(--lg-tint);
}

.lg-button[data-variant="filled"] {
  --lg-button-fill: var(--lg-tint, var(--lg-fill));
  color: #fff;
}

/* One that deletes is of red glass, its label white: tinted as a pane of
   glass is (see .lg-glass[data-tint]), so it still shows what's behind it,
   where a filled one is the colour alone. It answers the pointer as a filled
   one does. */
.lg-button[data-destructive]:not([data-variant="filled"]) {
  --lg-button-fill: color-mix(in srgb, var(--lg-tint) 86%, transparent);
  color: #fff;
}

.lg-button:is([data-variant="filled"], [data-destructive]),
.lg-button:is([data-variant="filled"], [data-destructive]):disabled {
  background-color: var(--lg-button-fill);
}

.lg-button:is([data-variant="filled"], [data-destructive]):is(:active, [data-pressed]) {
  background-color: color-mix(in srgb, var(--lg-button-fill) 85%, #000);
}

@media (hover: hover) and (pointer: fine) {
  .lg-button:is([data-variant="filled"], [data-destructive]):hover {
    background-color: color-mix(in srgb, var(--lg-button-fill) 88%, #fff);
  }

  .lg-button:is([data-variant="filled"], [data-destructive]):hover:is(:active, [data-pressed]) {
    background-color: color-mix(in srgb, var(--lg-button-fill) 85%, #000);
  }
}

/* On the way to the width of what it now holds: what it holds stays at its
   near end, and what doesn't fit yet is cut off. */
.lg-button[data-morphing] {
  justify-content: flex-start;
  overflow: clip;
  white-space: nowrap;
}

/* Its spinner comes in as --lg-spin goes from 0 to 1. Ahead of a label that
   had no icon, it takes up its room as it comes, so the label slides over. */
.lg-button-spinner {
  opacity: var(--lg-spin, 1);
  scale: calc(0.5 + 0.5 * var(--lg-spin, 1));
}

.lg-button-spinner[data-slide] {
  margin-inline-end: calc((var(--lg-spin, 1) - 1) * 20px);
}

/* Busy: as it was at rest, but for the spinner, whatever the pointer does. */
.lg-button.lg-button[data-loading] {
  cursor: default;
}

.lg-button.lg-button[data-loading]:not([data-variant="filled"], [data-destructive]) {
  background-color: var(--lg-glass);
}

.lg-button.lg-button[data-loading]:is([data-variant="filled"], [data-destructive]) {
  background-color: var(--lg-button-fill);
}

.lg-button:focus-visible,
.lg-tab:focus-visible,
.lg-switch:focus-visible,
.lg-menu-item:focus-visible {
  outline: 2px solid var(--lg-ring);
  outline-offset: 2px;
}

/* Tab bar */

/* The bar's padding is --lg-tab-inset. The selection fills its slot, less
   --lg-thumb-inset on every side: none here, 2px on a segmented control. */
.lg-tab-bar {
  --lg-tab-width: 84px;
  --lg-tab-height: 32px;
  --lg-tab-inset: 4px;
  --lg-thumb-inset: 0px;
  --lg-lens-grow-x: 27px;
  --lg-lens-grow-y: 20px;
  position: relative;
  display: inline-flex;
  padding: var(--lg-tab-inset);
  border-radius: calc(var(--lg-tab-height) / 2 + var(--lg-tab-inset));
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.lg-tab-bar-glass {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

/* A tab bar's glass, and a segmented control's, is the field's (see Input):
   its tint, saturation and gain, its rim lit along the top and bottom, and
   its faint hairline outside. */
:is(.lg-tab-bar, .lg-segmented) > .lg-tab-bar-glass {
  --lg-glass: var(--lg-field-glass);
  --lg-saturate: var(--lg-field-saturate);
  --lg-gain: var(--lg-field-gain);
  --lg-rim-shine: var(--lg-field-shine);
  --lg-rim-lit: along;
}

:is(.lg-tab-bar, .lg-segmented) > .lg-tab-bar-glass.lg-glass[data-rim] {
  box-shadow:
    inset 0 4px 10px var(--lg-field-inner),
    0 0 0 0.5px var(--lg-field-outline),
    1.5px 0 0 -0.5px var(--lg-field-shade),
    -1.5px 0 0 -0.5px var(--lg-field-shade),
    0 1px 3px var(--lg-drop);
}

.lg-tab-bar-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle 260px at var(--lg-x, 20%) 50%,
    rgb(255 255 255 / 0.09),
    rgb(255 255 255 / 0.045) 60%,
    transparent
  );
  opacity: 0;
  transition: opacity 160ms ease;
}

:is(.lg-tab-bar, .lg-segmented)[data-lifted] .lg-tab-bar-glass::before {
  opacity: 1;
  transition-duration: 120ms;
}

/* The labels, with room around them for the whole lifted lens, which
   refracts them (see lens.ts): Safari paints none of a filter outside its
   element. The room hangs outside the bar and takes no clicks. */
.lg-tab-labels {
  --lg-room-x: calc(var(--lg-lens-grow-x) / 2 + 4px);
  --lg-room-y: calc(var(--lg-lens-grow-y) / 2 + 4px);
  position: relative;
  z-index: 1;
  display: flex;
  margin: calc(var(--lg-room-y) * -1) calc(var(--lg-room-x) * -1);
  padding: var(--lg-room-y) var(--lg-room-x);
  pointer-events: none;
  /* On a layer of their own, as the tint's copy of them is: a browser sets a
     layer on whole pixels, so on a bar that isn't, labels beside a layer
     would sit a pixel off the copy and jump as one gives way to the other. */
  will-change: transform;
}

/* What the lifted lens shows in place of the labels: the same labels in full
   colour, laid exactly over them and seen only through the lens. */
.lg-tab-lensed {
  position: absolute;
  top: var(--lg-tab-inset);
  left: var(--lg-tab-inset);
  color: var(--lg-tab-selected, var(--lg-foreground));
  visibility: hidden;
}

:is(.lg-tab-bar, .lg-segmented)[data-lensing] .lg-tab-tint {
  visibility: hidden;
}

.lg-tab,
.lg-tab-copy {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--lg-tab-width);
  height: var(--lg-tab-height);
  font: inherit;
  font-size: 14px;
}

.lg-tab {
  position: relative;
  z-index: 1;
  padding: 0;
  border: 0;
  border-radius: calc(var(--lg-tab-height) / 2);
  color: var(--lg-muted);
  background: none;
  text-decoration: none;
  cursor: pointer;
  pointer-events: auto;
  -webkit-touch-callout: none;
  transition: color 200ms ease;
}

.lg-tab:focus-visible {
  outline-offset: -2px;
}

/* A tab's own label, wrapped so its colour can change at once, without the
   tab's colour transition. While the selection is over the selected tab (no
   data-away), it draws that tab's label alone: drawn twice, the copy on its
   own layer lands a fraction of a pixel off and the label beneath fringes it.
   Transparent, not hidden, so the tab keeps its name. */
.lg-tab-face {
  display: contents;
}

.lg-tab-bar:not([data-away]) .lg-tab[data-selected] > .lg-tab-face {
  color: transparent;
}

/* A label alone, centred by its letters: its box is trimmed to the height of
   the capitals above the baseline, so neither the font's ascent and descent
   nor the page's line height moves it off centre. Browsers without text-box
   centre its line box instead. */
.lg-tab-text {
  display: block;
  text-box: trim-both cap alphabetic;
}

/* Tabs with icons, as in an iOS tab bar: each icon over a small label, the
   others in full colour and the selected one in --lg-tab-selected. */
.lg-tab-bar[data-icons] {
  --lg-tab-width: 72px;
  --lg-tab-height: 52px;
  --lg-lens-grow-x: 24px;
  --lg-lens-grow-y: 16px;
  --lg-tab-selected: color-mix(in srgb, var(--lg-fill), var(--lg-tab-vivid));
}

.lg-tab-bar[data-icons] :is(.lg-tab, .lg-tab-copy) {
  flex-direction: column;
  gap: 1px;
  font-size: 10px;
  font-weight: 500;
}

.lg-tab-bar[data-icons] .lg-tab {
  color: var(--lg-foreground);
}

.lg-tab-icon {
  display: flex;
}

.lg-tab-icon > svg {
  width: 26px;
  height: 26px;
}

@media (hover: hover) and (pointer: fine) {
  .lg-tab:hover {
    color: var(--lg-foreground);
  }
}

.lg-tab-lens,
.lg-tab-tint,
.lg-segmented-thumb {
  position: absolute;
  top: calc(var(--lg-tab-inset) + var(--lg-thumb-inset));
  left: calc(var(--lg-tab-inset) + var(--lg-thumb-inset));
  width: calc(var(--lg-tab-width) - 2 * var(--lg-thumb-inset));
  height: calc(var(--lg-tab-height) - 2 * var(--lg-thumb-inset));
  border-radius: calc(var(--lg-tab-height) / 2 - var(--lg-thumb-inset));
  pointer-events: none;
  transform: translateX(calc(var(--lg-tab-width) * var(--lg-index, 0)));
  transition: opacity 140ms ease;
  will-change: transform;
}

.lg-tab-tint {
  z-index: 1;
  overflow: hidden;
  color: var(--lg-tab-selected, var(--lg-foreground));
}

/* The labels again, set back by the tint's inset so they line up. */
.lg-tab-row {
  display: flex;
  height: var(--lg-tab-height);
  margin: calc(var(--lg-thumb-inset) * -1) 0 0 calc(var(--lg-thumb-inset) * -1);
  transform: translateX(calc(var(--lg-tab-width) * var(--lg-index, 0) * -1));
  transform-origin: 0 0;
  will-change: transform;
}

/* Lifted, the lens casts iOS's shadow (fitted to iOS 26.1), faded in with its
   lift (--lg-lift) and kept to iOS's size against its own stretch
   (--lg-lift-y). The page's --lg-lens-drop colours it: none on a dark page. */
.lg-tab-lens.lg-glass {
  z-index: 2;
  background-color: transparent;
  background-image: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 calc(7px / var(--lg-lift-y, 1)) calc(11px / var(--lg-lift-y, 1))
    color-mix(in srgb, var(--lg-lens-drop) calc(var(--lg-lift, 0) * 100%), transparent);
  transition:
    opacity 140ms ease,
    background-color 140ms ease;
}

.lg-tab-bar[data-lifted] .lg-tab-lens.lg-glass {
  background-color: var(--lg-lens);
  transition-duration: 100ms;
}

.lg-tab-lens::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--lg-selection);
  transition: opacity 140ms ease;
}

/* A tab bar's selection is iOS's: darker than the bar in either theme (a dark
   bar's 60 over a 30 page holds a 34 selection, a light one's 253 over white
   a 234), which keeps the selected tab's colour legible over a bright
   picture. On a light bar it is the grey over the label (--lg-tab-selection);
   on a dark one a well under it (--lg-tab-well), on the tint, so the label
   keeps its colour, and it gives way to the lens as that lifts. The colour is
   iOS's too: lighter than --lg-fill on a dark bar, darker on a light one
   (--lg-tab-vivid). */
.lg-tab-bar .lg-tab-lens::before {
  background: var(--lg-tab-selection);
}

.lg-tab-bar .lg-tab-tint {
  background-color: var(--lg-tab-well);
  transition:
    opacity 140ms ease,
    background-color 140ms ease;
}

.lg-tab-bar[data-lifted] .lg-tab-tint {
  background-color: transparent;
  transition-duration: 100ms;
}

.lg-tab-bar[data-lensing] .lg-tab-tint {
  visibility: visible;
}

.lg-tab-bar[data-lensing] .lg-tab-row {
  visibility: hidden;
}

/* The lens's copy of the labels lies over the well as it comes and goes. */
.lg-tab-bar .lg-tab-lensed {
  z-index: 2;
}

.lg-tab-lens[data-pressed]::after {
  opacity: 0.2;
}

.lg-tab-bar[data-lifted] .lg-tab-lens::before {
  opacity: 0;
  transition-duration: 100ms;
}

/* The lifted lens's rim comes and goes with its lift (--lg-lift), as iOS's
   does: it is gone by the time the lens is back to the selection's size, not
   cut off there. */
.lg-tab-rim {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: var(--lg-lift, 0);
}

:is(.lg-tab-bar, .lg-segmented)[data-refracting] .lg-tab-rim {
  background: var(--lg-rim, none) 0 0 / 100% 100%;
}

/* On a light page (data-light), where a faint lens is lost against light
   glass, the lifted lens stands out as iOS 26.1's does: it drops under the
   labels and bends the bar's glass and the page behind it, where the browser
   can (--lg-filter), and takes iOS's brighter rim. The labels it bends on its
   own, so they bend once. At rest it lies over the labels, as before. */
:is(.lg-tab-bar, .lg-segmented)[data-refracting][data-light] .lg-tab-rim {
  background-image: var(--lg-rim-bright, var(--lg-rim, none));
}

.lg-segmented[data-refracting][data-light] .lg-tab-lens.lg-glass,
.lg-tab-bar[data-under][data-light] .lg-tab-lens.lg-glass {
  z-index: 0;
}

.lg-tab-bar[data-under][data-light] .lg-tab-lens.lg-glass {
  -webkit-backdrop-filter: var(--lg-filter, none);
  backdrop-filter: var(--lg-filter, none);
}

/* A segmented control's bend is one strength, so it's the rim that holds it:
   it lifts and settles with the rim's light. */
.lg-segmented[data-refracting][data-light] .lg-tab-rim {
  -webkit-backdrop-filter: var(--lg-filter, none);
  backdrop-filter: var(--lg-filter, none);
}

/* A tab bar's lens on a light page changes over with its lift, so the
   selected label never changes colour at once: the grey of the selection,
   which lies over the label at rest, fades as the lens lifts (--lg-rest),
   the lens drops under the labels once it's gone (data-under), and only then
   does its fill come in (--lg-under), as its bend does. Settling, the same
   in reverse. */
.lg-tab-bar[data-light] .lg-tab-lens::before {
  opacity: var(--lg-rest, 1);
  transition: none;
}

.lg-tab-bar[data-light] .lg-tab-lens.lg-glass {
  background-color: color-mix(in srgb, var(--lg-lens) calc(var(--lg-under, 0) * 100%), transparent);
  transition: opacity 140ms ease;
}

:is(.lg-tab-bar, .lg-segmented)[data-hidden] :is(.lg-tab-lens, .lg-tab-tint, .lg-segmented-thumb),
:is(.lg-tab-bar, .lg-segmented):not([data-ready]):not(:has([data-selected])) :is(.lg-tab-lens, .lg-tab-tint, .lg-segmented-thumb) {
  opacity: 0;
}

/* Segmented control, sized as iOS 26.1's, measured from UIKit: a 32px
   capsule, segments of 13px labels, and under the selected one a thumb inset
   2px on every side. Held, the thumb fades and the lens lifts in its place,
   24px wider and 16px taller. Its track is the tab bar's glass. On a light
   page it's tinted with iOS's track fill (--lg-segment-track), or the white
   thumb would vanish against a white page; on a dark one it's the glass
   alone, exactly as the tab bar's. */
.lg-segmented {
  --lg-tab-width: 84px;
  --lg-tab-height: var(--lg-control-size, 32px);
  --lg-tab-inset: 0px;
  --lg-thumb-inset: 2px;
  --lg-lens-grow-x: 24px;
  --lg-lens-grow-y: 16px;
  --lg-tab-selected: var(--lg-segment-label);
  position: relative;
  display: inline-flex;
  border-radius: calc(var(--lg-tab-height) / 2);
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.lg-segmented > .lg-tab-bar-glass {
  background-image: var(--lg-rim, none), linear-gradient(var(--lg-segment-track) 0 0);
}

.lg-segmented :is(.lg-tab, .lg-tab-copy) {
  font-size: 13px;
}

/* Every label in full colour, the selected one in medium, as UIKit sets it.
   With no colour to change under the thumb, there's no tint: a second copy
   of a label drawn over it would thicken it. */
.lg-segmented .lg-tab,
.lg-segmented .lg-tab:hover {
  color: var(--lg-segment-label);
}

.lg-segmented :is(.lg-tab, .lg-tab-copy)[data-selected] {
  font-weight: 500;
}

.lg-segmented .lg-tab-tint {
  display: none;
}

.lg-segmented-thumb {
  background: var(--lg-segment-thumb);
}

.lg-segmented[data-lifted] .lg-segmented-thumb {
  opacity: 0;
  transition-duration: 100ms;
}

.lg-segmented .lg-tab-lens::before {
  content: none;
}

.lg-segmented[data-lifted] .lg-tab-lens.lg-glass {
  background-color: var(--lg-segment-lens);
  transition-duration: 100ms;
}

/* Input */

.lg-input {
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  width: 100%;
  max-width: 360px;
  height: var(--lg-control-size, 40px);
  padding: 0 var(--lg-control-pad, 14px);
  border-radius: calc(var(--lg-control-size, 40px) / 2);
  color: var(--lg-foreground);
  --lg-glass: var(--lg-field-glass);
  --lg-saturate: var(--lg-field-saturate);
  --lg-gain: var(--lg-field-gain);
  --lg-rim-shine: var(--lg-field-shine);
  --lg-rim-lit: along;
}

/* A rim lit along its very edge would be covered by an inset line: the
   field's edge is a faint hairline outside it instead, a little darker at its
   ends, where the rim catches no light. macOS draws both about three times as
   strong, which reads as a border here. */
.lg-input.lg-glass[data-rim] {
  box-shadow:
    inset 0 4px 10px var(--lg-field-inner),
    0 0 0 0.5px var(--lg-field-outline),
    1.5px 0 0 -0.5px var(--lg-field-shade),
    -1.5px 0 0 -0.5px var(--lg-field-shade),
    0 1px 3px var(--lg-drop);
}

.lg-input input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  color: inherit;
  background: none;
  font: inherit;
  font-size: var(--lg-control-font, 14px);
}

.lg-input input::placeholder {
  color: var(--lg-placeholder);
}

.lg-input input::-webkit-search-cancel-button {
  display: none;
}

.lg-input-icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--lg-placeholder);
  opacity: var(--lg-vibrant-icon);
}

.lg-input-icon {
  display: grid;
  place-items: center;
}

.lg-input-icon > svg {
  width: 100%;
  height: 100%;
}

/* Over a picture the glass is drawn, and the placeholder and icon are mixed
   into the drawing. Glass that frosts the page has nothing of it to mix into. */
.lg-input[data-drawn] input:placeholder-shown,
.lg-input[data-drawn] .lg-input-icon {
  mix-blend-mode: var(--lg-vibrant-blend);
}

.lg-input[data-drawn] input:placeholder-shown {
  caret-color: var(--lg-vibrant);
}

.lg-input[data-drawn] input::placeholder,
.lg-input[data-drawn] .lg-input-icon {
  color: var(--lg-vibrant);
}

.lg-input[data-focus-ring] {
  outline: 2px solid var(--lg-ring);
  outline-offset: 2px;
}

/* What's at its far end is quieter than its text, and a key there is drawn
   as one. */
.lg-input-trailing {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  color: var(--lg-placeholder);
  font-size: 12px;
}

.lg-input-trailing kbd {
  display: grid;
  box-sizing: border-box;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  color: var(--lg-muted);
  background: var(--lg-within);
  box-shadow: inset 0 0 0 0.5px color-mix(in srgb, currentColor 30%, transparent);
  font: 500 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.lg-input-trailing:has(> kbd:only-child) {
  margin-inline-end: -4px;
}

/* macOS's: a filled disc with the cross cut out of it, about the middle of
   the field's round end. */
.lg-input-clear {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: min(32px, 100%);
  margin-inline-end: -10px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--lg-input-clear);
  background: none;
  cursor: pointer;
}

.lg-input-clear svg {
  width: 14px;
  height: 14px;
}

.lg-input-clear:active {
  color: var(--lg-foreground);
}

/* Its text dims, not its glass: a field that can't be typed in is still there. */
.lg-input:has(input:disabled) {
  color: var(--lg-placeholder);
}

.lg-input input:disabled {
  -webkit-text-fill-color: currentColor;
  opacity: 1;
}

.lg-input:has(input:disabled) .lg-input-icon,
.lg-input input:disabled::placeholder {
  opacity: 0.5;
}

/* Switch and slider thumbs */

/* At rest, a white knob. Held, it lifts into clear glass, a lens that bends the
   track under its rim (see lens.ts), so the blur and brightening clear as it
   lifts and the track shows through true, all but a little frost:
   --lg-thumb-frost, the blur kept on the lifted glass. */
.lg-switch-thumb,
.lg-slider-thumb {
  --lg-settled: calc(1 - var(--lg-lift, 0));
  --lg-thumb-blur: calc(2px * var(--lg-settled) + var(--lg-thumb-frost, 0.5px) * var(--lg-lift, 0));
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  -webkit-backdrop-filter: blur(var(--lg-thumb-blur)) brightness(calc(1 + 0.15 * var(--lg-settled))) saturate(1.5);
  backdrop-filter: blur(var(--lg-thumb-blur)) brightness(calc(1 + 0.15 * var(--lg-settled))) saturate(1.5);
}

/* A thumb's shadows are the costliest thing a browser first draws in a
   control, and its frosting of what's behind it the next, so a modal draws
   both once ahead of its first opening (see useAhead), on a stand-in for a
   thumb it may hold. */
.lg-ahead-thumb {
  -webkit-backdrop-filter: blur(2px) brightness(1.15) saturate(1.5);
  backdrop-filter: blur(2px) brightness(1.15) saturate(1.5);
}

.lg-switch-thumb,
.lg-slider-thumb,
.lg-ahead-thumb {
  box-shadow:
    0 6px 24px rgb(0 0 0 / 0.2),
    inset 0 0 0 1.5px rgb(255 255 255 / 0.5),
    inset 0 2px 1px rgb(255 255 255 / 0.45),
    inset 2px 7px 24px rgb(0 0 0 / 0.09),
    inset -2px -7px 24px rgb(255 255 255 / 0.16);
}

.lg-ahead-thumb {
  position: absolute;
  top: 40px;
  left: 40px;
  width: 55px;
  height: 34px;
  border-radius: 999px;
}

.lg-thumb-face {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #fff;
}

/* Switch */

.lg-switch {
  /* Drawn 160 by 67, at the scale that makes it a whole, even 26px high (and
     62 wide). Its thumb is drawn apart from its track (it's transformed, and
     frosts what's behind it), and a browser sets each on the pixel grid by
     itself: at 25.125px high, half of which is a fraction of a px, the thumb
     came to rest as much as half a px low, more room over it than under. The
     thumb's travel in switch.tsx is at this scale too. */
  --lg-scale: calc(26 / 67);
  position: relative;
  flex: none;
  width: calc(160px * var(--lg-scale));
  height: calc(67px * var(--lg-scale));
  height: round(calc(67px * var(--lg-scale)), 2px);
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  cursor: pointer;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}


.lg-switch::before {
  content: "";
  position: absolute;
  inset: min(0px, calc((67px * var(--lg-scale) - 44px) / 2)) -8px;
}

/* What the lifted thumb refracts: the track, with room around it for the
   whole lens, since Safari paints none of a filter outside its element. */
.lg-switch-bed {
  position: absolute;
  inset: -6px -12px;
  pointer-events: none;
}

.lg-switch-track,
.lg-switch-fill {
  position: absolute;
  border-radius: 999px;
}

.lg-switch-track {
  inset: 6px 12px;
  background: var(--lg-track);
}

.lg-switch-fill {
  inset: 0;
  background: var(--lg-on);
  opacity: 0;
}

/* What the lifted thumb shows in place of the track: the track as Aave's
   switch draws it, a little smaller so the glass rings it, growing as the
   thumb does. It's seen only through the thumb (see lens.ts). */
.lg-switch-inset {
  visibility: hidden;
}

/* Centred by margins rather than a transform: WebKit sizes a filter's box by
   its content's untransformed layout, so nothing may sit past it even before
   a transform moves it back. */
.lg-switch-inset .lg-switch-track {
  inset: 0;
  width: calc((100% - 24px) * (0.85 + 0.1 * var(--lg-lift, 0)));
  height: calc((100% - 12px) * 0.75 * (0.525 + 0.45 * var(--lg-lift, 0)));
  margin: auto;
}

.lg-switch-thumb {
  top: 50%;
  left: calc(-21.95px * var(--lg-scale));
  width: calc(146px * var(--lg-scale));
  height: calc(92px * var(--lg-scale));
  transform: translate(0, -50%) scale(0.65);
}

.lg-switch[aria-checked="true"] .lg-switch-fill {
  opacity: 1;
}

.lg-switch[aria-checked="true"] .lg-switch-thumb {
  transform: translate(calc(57.9px * var(--lg-scale)), -50%) scale(0.65);
}

.lg-switch:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Slider */

.lg-slider {
  position: relative;
  width: 100%;
  height: 40px;
}

/* What the lifted thumb refracts, with room around the track for the whole lens. */
.lg-slider-bed {
  position: absolute;
  inset: -4px -16px;
  pointer-events: none;
}

.lg-slider-track {
  position: absolute;
  inset: 21px 16px auto;
  height: 6px;
  border-radius: 3px;
  background: var(--lg-rail);
}

/* Ends under the middle of the thumb, where a lifted thumb shows it. It's
   rounded rather than clipped by the track, since Safari can't refract
   content clipped round its corners. */
.lg-slider-fill {
  display: block;
  width: calc((100% - 36px) * var(--lg-progress) + 18px);
  height: 100%;
  border-radius: inherit;
  background: var(--lg-fill);
}

/* What the lifted thumb shows in place of the track: the track as Aave's
   slider draws it, a little thicker as if magnified, growing as the thumb
   does. It's
   seen only through the thumb (see lens.ts). --lg-slider-line sets how thick
   it is once the thumb is fully lifted, and --lg-slider-bend how far the
   thumb's rim bends it. */
.lg-slider-magnified {
  visibility: hidden;
}

.lg-slider-magnified .lg-slider-track {
  inset: 0 16px;
  height: calc(var(--lg-slider-line, 8px) * (0.6 + 0.4 * var(--lg-lift, 0)));
  margin: auto 0;
  border-radius: 999px;
}

/* Within a few pixels of either end, the fill gives way from the middle of
   the thumb to the end of the track, so through the thumb an empty slider
   shows no fill and a full one no bare track. */
.lg-slider-magnified .lg-slider-fill {
  --lg-travel: calc((100% - 36px) * var(--lg-progress));
  width: calc(
    var(--lg-travel) + min(18px, var(--lg-travel) * 4) + max(0px, 18px - (100% - 36px - var(--lg-travel)) * 4)
  );
}

.lg-slider-thumb {
  top: 0;
  left: calc((100% - 36px) * var(--lg-progress) - 12px);
  width: 60px;
  height: 40px;
  scale: 0.6;
}

.lg-slider input {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 40px;
  margin: 0;
  background: transparent;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

.lg-slider input::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent;
}

/* The native thumb only takes the touch; the glass thumb is drawn beneath.
   iOS shades the native one even without its appearance, so hide it. */
.lg-slider input::-webkit-slider-thumb {
  width: 36px;
  height: 40px;
  margin-top: -17px;
  border: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  /* A touch on the thumb drags it rather than scrolling the page; the rest of
     the track still scrolls. Blocking touchmove instead would stop Safari's
     own drag. */
  touch-action: none;
  appearance: none;
  -webkit-appearance: none;
}

.lg-slider input::-moz-range-track {
  height: 6px;
  background: transparent;
}

.lg-slider input::-moz-range-thumb {
  width: 36px;
  height: 40px;
  border: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
}

.lg-slider:has(input:focus-visible) .lg-slider-thumb {
  outline: 2px solid var(--lg-ring);
  outline-offset: 3px;
}

.lg-slider:has(input:disabled) {
  opacity: 0.35;
}

.lg-slider input:disabled {
  cursor: default;
}

/* Menu */

.lg-menu {
  position: relative;
  display: inline-flex;
}

.lg-menu-card {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 10;
  box-sizing: border-box;
  width: 200px;
  border-radius: 20px;
  color: var(--lg-foreground);
  font-size: 14px;
  transform-origin: calc(100% - 20px) 20px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.lg-menu-card[data-held="start"] {
  right: auto;
  left: 0;
  transform-origin: 20px 20px;
}

/* With no room below it rises from the trigger's foot (see menu.tsx). */
.lg-menu-card[data-side="top"] {
  top: auto;
  bottom: 0;
}

.lg-menu-card[data-phase="leaving"] {
  pointer-events: none;
}

/* Drawn ahead of its first opening (see menu.tsx): too faint to see, and
   fixed so that it adds nothing to scroll. */
.lg-menu-card[data-phase="ahead"] {
  position: fixed;
  top: 0;
  left: 0;
  opacity: 0.01;
  pointer-events: none;
}

/* Grown from the corner it's held by, so that nothing on the page is counted
   as having shifted. */
.lg-menu-card[data-phase="ahead"] .lg-menu-surface {
  right: auto;
  left: 0;
}

/* The card is glass like any other (see .lg-glass), frosted further so its
   items read over anything, and lifted off the page by a wider shadow. */
.lg-menu-surface.lg-glass {
  --lg-blur: 12px;
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 0.5px var(--lg-edge),
    0 12px 40px var(--lg-shadow);
  pointer-events: none;
}

.lg-menu-surface.lg-glass[data-rim] {
  box-shadow: 0 12px 40px var(--lg-shadow);
}

.lg-menu-card[data-held="start"] .lg-menu-surface {
  right: auto;
  left: 0;
}

/* While it's a drop on its way to or from the trigger (see menu.tsx), its lit
   rim, painted for the card's shape, is left off for an edge that follows its
   own. As it lands (--lg-landed, from 0 to 1) the one gives way to the other,
   so that the card it comes to rest as is the one it already looks. */
.lg-menu-card[data-morphing] .lg-menu-surface.lg-glass {
  --lg-drop-edge: calc(1 - var(--lg-landed, 0));
  background-image: none;
  box-shadow:
    inset 0 0 0 0.5px color-mix(in srgb, var(--lg-edge) calc(var(--lg-drop-edge) * 100%), transparent),
    inset 0 1px 1px rgb(255 255 255 / calc(0.22 * var(--lg-drop-edge))),
    inset 0 -1px 1px rgb(255 255 255 / calc(0.08 * var(--lg-drop-edge))),
    inset 0 0 10px rgb(255 255 255 / calc(0.12 * var(--lg-drop-edge))),
    0 12px 40px var(--lg-shadow);
}

/* Glass that draws its rim itself (see .lg-drawn) has it all the way. */
.lg-menu-card[data-morphing] .lg-menu-surface.lg-glass:not([data-drawn])::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--lg-rim, none) 0 0 / 100% 100%;
  opacity: var(--lg-landed, 0);
}

.lg-menu-glyph {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  pointer-events: none;
}

.lg-menu-card[data-held="start"] .lg-menu-glyph {
  right: auto;
  left: 0;
}

.lg-menu-glyph > svg {
  width: 20px;
  height: 20px;
}

.lg-menu-content {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 6px;
}

.lg-menu-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgb(255 255 255 / 0.11), rgb(255 255 255 / 0.025));
  opacity: 0;
  transition: opacity 120ms ease-out;
}

.lg-menu-card[data-pressed]::after {
  opacity: 1;
}

.lg-menu-plate {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 14px;
  background: var(--lg-highlight);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 100ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 80ms ease-out;
}

.lg-menu-item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  padding: 6px 12px;
  border: 0;
  border-radius: 14px;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

/* The icons' column: an icon of any width sits in the middle of it, so the
   labels after it start on one line. */
.lg-menu-icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.lg-menu-icon > svg {
  width: 18px;
  height: 18px;
}

.lg-menu-item:focus-visible {
  outline-offset: -2px;
  background: var(--lg-highlight);
}

@media (hover: hover) and (pointer: fine) {
  .lg-menu-item:hover:not(:disabled) {
    background: var(--lg-highlight);
  }
}

.lg-menu-card[data-scrubbing] .lg-menu-item {
  background: transparent;
  outline: none;
}

.lg-menu-item[data-destructive] {
  color: var(--lg-destructive);
}

.lg-menu-item:disabled {
  opacity: 0.38;
  cursor: default;
}

.lg-menu-separator {
  flex: none;
  margin: 7px 11px;
  border-top: 0.5px solid var(--lg-separator);
}

/* A context menu's area (see context-menu.tsx). A finger held on it opens
   the menu, not the system's callout or a selection. */
@media (pointer: coarse) {
  .lg-context-menu {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
}

/* Its card is a menu's, over the page at the point it was asked for: a
   popover, with none of what a browser draws one with. */
.lg-menu-card.lg-context-menu-card {
  position: fixed;
  inset: auto;
  z-index: 20;
  width: max-content;
  min-width: 200px;
  max-width: min(320px, 100vw - 16px);
  margin: 0;
  padding: 0;
  border: 0;
  overflow: visible;
  background: none;
  outline: none;
}

/* Its glass grows from the corner on the point, and what it lists with it. */
.lg-context-menu-card .lg-menu-surface {
  right: auto;
  left: 0;
}

.lg-context-menu-card[data-x="end"] .lg-menu-surface {
  right: 0;
  left: auto;
}

.lg-context-menu-card[data-y="end"] .lg-menu-surface {
  top: auto;
  bottom: 0;
}

.lg-context-menu-card .lg-menu-content {
  transform-origin: 0 0;
}

.lg-context-menu-card[data-x="end"] .lg-menu-content {
  transform-origin: 100% 0;
}

.lg-context-menu-card[data-y="end"] .lg-menu-content {
  transform-origin: 0 100%;
}

.lg-context-menu-card[data-x="end"][data-y="end"] .lg-menu-content {
  transform-origin: 100% 100%;
}

.lg-context-menu-card[data-phase="ahead"] {
  top: 0;
  left: 0;
}

/* A combobox is an input with a list under it: the list a card of glass as
   a menu's, as wide as the field. */
.lg-combobox {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 360px;
}

.lg-combobox-field.lg-input {
  max-width: none;
  padding-inline-end: 40px;
}

.lg-combobox-toggle {
  position: absolute;
  top: 50%;
  inset-inline-end: 6px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--lg-foreground);
  background: transparent;
  opacity: 0.6;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.lg-combobox-toggle > svg {
  transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lg-combobox-toggle[aria-expanded="true"] > svg {
  transform: rotate(180deg);
}

.lg-combobox[data-disabled] .lg-combobox-toggle {
  opacity: 0.3;
  cursor: default;
}

/* Over the page whatever it's in (see combobox.tsx): a popover, with none
   of what a browser draws one with. */
.lg-combobox-card {
  position: fixed;
  inset: auto;
  z-index: 20;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 20px;
  overflow: visible;
  color: var(--lg-foreground);
  background: none;
  font-size: 14px;
}

/* Its glass grows out of the field (see combobox.tsx): down from its top
   under the field, or up from its bottom over it. */
/* Its glass and what it lists come out of the field's side of it, at one scale. */
.lg-combobox-card > .lg-menu-surface {
  transform-origin: 50% 0;
}

.lg-combobox-card[data-side="top"] > .lg-menu-surface {
  transform-origin: 50% 100%;
}

.lg-combobox-card[data-side="top"] > .lg-combobox-list {
  transform-origin: 50% 100%;
}

.lg-combobox-card[data-phase="leaving"] {
  pointer-events: none;
}

/* Drawn ahead of its first opening (see menu.tsx): too faint to see. */
.lg-combobox-card[data-phase="ahead"] {
  opacity: 0.01;
  pointer-events: none;
}

.lg-combobox-list {
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  max-height: min(var(--lg-combobox-height, 264px), var(--lg-combobox-room, 264px));
  padding: 6px;
  /* An option the keys bring into view stops clear of the list's edge, by its padding. */
  scroll-padding-block: 6px;
  border-radius: inherit;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform-origin: 50% 0;
}

/* The lit option's plate, a menu's: as wide as an option whatever the
   list's width comes to. */
.lg-combobox-list > .lg-menu-plate {
  left: 6px;
  width: calc(100% - 12px);
}

.lg-combobox-option {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
  box-sizing: border-box;
  padding: 6px 12px;
  border-radius: 14px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.lg-combobox-option > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lg-combobox-option > svg {
  flex: none;
}

.lg-combobox-option[aria-disabled="true"] {
  opacity: 0.38;
  cursor: default;
}

.lg-combobox-empty {
  padding: 8px 12px;
  opacity: 0.6;
}

@media (prefers-reduced-motion: reduce) {
  .lg-menu-plate {
    transition: opacity 80ms ease-out;
  }

  .lg-menu-card,
  .lg-combobox-card {
    animation: lg-menu-fade 100ms ease-out;
  }
}

@keyframes lg-menu-fade {
  from {
    opacity: 0;
  }
}

/* Where the system is asked for less transparency, glass is a solid surface:
   its own tint, laid over the page's canvas colour, with nothing behind
   showing through, bent or frosted. Asked for more contrast, it's the same:
   a Mac turns the one on with the other, and not every browser hears of the first. */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .lg-glass {
    background-color: Canvas;
    background-image: linear-gradient(var(--lg-glass), var(--lg-glass));
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .lg-switch-thumb,
  .lg-slider-thumb {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  /* The thumbs fade their faces from script as they lift. */
  .lg-thumb-face {
    opacity: 1 !important;
  }

  .lg-drawn {
    display: none;
  }

  .lg-input[data-drawn] :is(input, .lg-input-icon) {
    mix-blend-mode: normal;
    caret-color: auto;
  }

  .lg-input[data-drawn] input::placeholder,
  .lg-input[data-drawn] .lg-input-icon {
    color: var(--lg-placeholder);
  }
}

/* And for more contrast it has an edge that tells it from what it lies on. */
@media (prefers-contrast: more) {
  .lg-glass {
    outline: 1px solid color-mix(in srgb, currentColor 55%, transparent);
    outline-offset: -1px;
  }
}

/* A sheet or a dialog is a <dialog> the size of the window, clear but for
   the scrim that dims the page and the glass that comes over it. */
.lg-sheet,
.lg-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  /* Clipped, not hidden, where a browser can: focus on something still out
     of sight, as the sheet slides in, must not scroll it into view. */
  overflow: clip;
  background: none;
  color: var(--lg-foreground);
}

.lg-sheet:not([open]),
.lg-dialog:not([open]) {
  display: none;
}

/* Drawn ahead of its first opening (see useAhead): in the page, all but
   transparent and out of reach, with a stand-in for what it will hold. */
:is(.lg-sheet, .lg-dialog)[data-ahead]:not([open]) {
  display: block;
  opacity: 0.01;
  pointer-events: none;
}

.lg-dialog[data-ahead]:not([open]) {
  display: grid;
  place-items: center;
}

[data-ahead] > .lg-sheet-panel {
  min-height: 320px;
}

[data-ahead] > .lg-dialog-card {
  min-height: 150px;
}

[data-ahead] > .lg-modal-card {
  min-height: 320px;
}

.lg-sheet::backdrop,
.lg-dialog::backdrop {
  background: none;
}

.lg-sheet-scrim,
.lg-dialog-scrim {
  position: absolute;
  inset: 0;
  background: var(--lg-scrim, rgb(0 0 0 / 0.2));
  opacity: 0;
}

/* As iOS 26's, the panel floats a little in from the window's edges,
   narrow, its corners rounded all the way round. It's glass like any other
   (see .lg-glass), frosted further so what it holds reads over anything. */
.lg-sheet-panel.lg-glass {
  --lg-blur: 16px;
  /* How far in from the window's edges it floats: as an iPad's sheet in a
     wide window, and a phone's in a narrow one. */
  --lg-sheet-gap: 8px;
  position: absolute;
  right: 0;
  /* Clear of a phone's home indicator, where there is one. */
  bottom: max(var(--lg-sheet-inset, var(--lg-sheet-gap)), env(safe-area-inset-bottom, 0px));
  left: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: min(100% - 2 * var(--lg-sheet-inset, var(--lg-sheet-gap)), var(--lg-sheet-width, 580px));
  max-height: calc(100% - 2 * var(--lg-sheet-inset, var(--lg-sheet-gap)) - 18px);
  margin: 0 auto;
  border-radius: var(--lg-sheet-radius, 36px);
  box-shadow:
    inset 0 0 0 0.5px var(--lg-edge),
    0 12px 40px var(--lg-shadow);
  touch-action: none;
  will-change: transform;
}

@media (min-width: 700px) {
  .lg-sheet-panel.lg-glass {
    --lg-sheet-gap: 20px;
  }
}

/* Full width, as vaul's drawer: it spans the window's bottom edge, and
   hangs a tail below it, so springing a little past its rest shows no gap
   under it. What it holds keeps to a column (see .lg-sheet-body). */
.lg-sheet-panel.lg-glass[data-full-width] {
  --lg-sheet-tail: 96px;
  bottom: calc(-1 * var(--lg-sheet-tail));
  width: auto;
  max-height: calc(100% - 24px + var(--lg-sheet-tail));
  margin: 0;
  padding-bottom: calc(var(--lg-sheet-tail) + env(safe-area-inset-bottom, 0px));
  border-radius: var(--lg-sheet-radius, 28px);
}

.lg-sheet-panel.lg-glass[data-rim] {
  box-shadow: 0 12px 40px var(--lg-shadow);
}

.lg-sheet-panel[data-dragging] {
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
}

.lg-sheet-handle {
  position: relative;
  z-index: 1;
  flex: none;
  order: -2;
  width: 36px;
  height: 5px;
  margin: 6px auto 0;
  border-radius: 2.5px;
  background: var(--lg-track);
}

/* A bar along its top, as a pointer wants: its name in the middle, a
   button to close it in a corner and what's done with it in the other, as
   an iPadOS sheet's. First in the panel though after what it holds in the
   page, so focus goes to that first. */
.lg-sheet-bar {
  position: relative;
  z-index: 1;
  display: grid;
  flex: none;
  /* Its name is in the middle while what's in the corners leaves it room,
     and gives way to them, cut short, when they don't. */
  grid-template-columns: minmax(max-content, 1fr) minmax(0, auto) minmax(max-content, 1fr);
  align-items: center;
  order: -1;
  box-sizing: border-box;
  min-height: 52px;
  padding: 6px 10px 0;
  column-gap: 10px;
}

.lg-sheet-bar > * {
  grid-row: 1;
}

.lg-sheet-handle + .lg-sheet-bar,
.lg-sheet-scroll + .lg-sheet-bar {
  margin-top: -5px;
}

/* Whatever a page makes of its headings, this one keeps to the bar. */
.lg-sheet-bar .lg-sheet-title {
  grid-column: 2;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  color: inherit;
  font-family: inherit;
  font-size: 17px;
  font-style: normal;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: normal;
  text-align: center;
  text-decoration: none;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

/* A control for a title, such as a segmented control, keeps its own type
   and isn't clipped as a line of text is. */
.lg-sheet-bar .lg-sheet-title:has(> :is(.lg-glass, .lg-segmented)) {
  overflow: visible;
  font-size: inherit;
  font-weight: 400;
  line-height: inherit;
}

.lg-sheet-close,
.lg-sheet-action {
  grid-column: 3;
  justify-self: end;
}

.lg-sheet-close[data-side="near"],
.lg-sheet-bar:has(> .lg-sheet-action) > .lg-sheet-close {
  grid-column: 1;
  justify-self: start;
}

/* What it holds scrolls only once the sheet is at its tallest; below that
   a drag over it raises the sheet. */
/* With heights to move between, the grabber is a button: wider to the
   touch than it looks, and first in the panel though last in the page. */
button.lg-sheet-handle {
  position: relative;
  /* Over the bar under it, which would take its presses. */
  z-index: 2;
  padding: 0;
  border: 0;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
}

button.lg-sheet-handle::after {
  position: absolute;
  inset: -8px -40px -10px;
  content: "";
}

button.lg-sheet-handle:focus-visible {
  outline: 2px solid var(--lg-ring);
  outline-offset: 3px;
}

/* Its grabber and its bar lie over what it holds, which scrolls under
   them and softens there (see .lg-scroll): `--lg-sheet-over` is how much
   of its top they take. */
.lg-sheet-panel:has(> .lg-sheet-handle) {
  --lg-sheet-over: 11px;
}

.lg-sheet-panel:has(> .lg-sheet-bar) {
  --lg-sheet-over: 52px;
}

.lg-sheet-panel:has(> .lg-sheet-handle):has(> .lg-sheet-bar) {
  --lg-sheet-over: 58px;
}

.lg-sheet-scroll.lg-scroll {
  --lg-edge-top-size: calc(var(--lg-sheet-over, 0px) + 16px);
  flex: 1;
  margin-top: calc(-1 * var(--lg-sheet-over, 0px));
}

/* Under its bar what it holds softens down to the bar's foot and no further. */
.lg-sheet-panel:has(> .lg-sheet-bar) > .lg-sheet-scroll.lg-scroll {
  --lg-edge-top-size: var(--lg-sheet-over);
}

.lg-sheet-body {
  flex: 1;
  box-sizing: border-box;
  width: 100%;
  /* A panel that spans a wide window keeps what it holds to a column. */
  max-width: var(--lg-sheet-width, 580px);
  min-height: 0;
  margin: 0 auto;
  padding: calc(16px + var(--lg-sheet-over, 0px)) 20px 20px;
  scroll-padding-top: var(--lg-sheet-over, 0px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.lg-sheet-panel[data-top] .lg-sheet-body {
  overflow-y: auto;
  touch-action: pan-y;
}

/* The dialog's card sits in the middle of the window, as a macOS alert:
   narrow, its title and what it says over a row of buttons that share its
   width. */
.lg-dialog[open] {
  display: grid;
  place-items: center;
}

.lg-dialog-card.lg-glass {
  --lg-blur: 16px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: min(100% - 32px, var(--lg-dialog-width, 300px));
  max-height: calc(100% - 32px);
  padding: 20px 16px 16px;
  border-radius: var(--lg-dialog-radius, 26px);
  overflow: auto;
  box-shadow:
    inset 0 0 0 0.5px var(--lg-edge),
    0 16px 48px var(--lg-shadow);
  font-size: 13px;
  line-height: 1.3;
  will-change: transform, opacity;
}

.lg-dialog-card.lg-glass[data-rim] {
  box-shadow: 0 16px 48px var(--lg-shadow);
}

/* Opened over another dialog or modal, its glass would only show that one's
   through it. It takes a surface, and dims what's under it further. */
.lg-dialog[data-over] > .lg-dialog-card.lg-glass {
  --lg-glass: var(--lg-surface);
  --lg-blur: 30px;
}

.lg-dialog[data-over] > .lg-dialog-scrim {
  background: var(--lg-scrim-over, rgb(0 0 0 / 0.36));
}

/* Named twice over, so a page's own rules for headings and paragraphs
   don't restyle them. */
.lg-dialog-card .lg-dialog-title {
  margin: 0 4px;
  padding: 0;
  border: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
}

.lg-dialog-card .lg-dialog-description {
  margin: 8px 4px 0;
  padding: 0;
  color: var(--lg-foreground);
  font-size: 13px;
  line-height: 1.3;
}

.lg-dialog-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.lg-dialog-actions > * {
  flex: 1;
  justify-content: center;
}

/* Its buttons are of its glass (see Glass on glass), but an alert's glass is
   clear, and that faint layer is lost over whatever shows through it: they
   look like holes in the card. They take a fuller one, as the buttons of a
   macOS alert are filled. A filled button keeps its own colour. */
.lg-dialog-actions > .lg-button.lg-glass[data-within]:not([data-variant="filled"]) {
  --lg-glass: var(--lg-dialog-action);
  --lg-glass-active: var(--lg-dialog-action-active);
}

/* Three or more don't fit side by side: they stack, as macOS stacks them. */
.lg-dialog-actions:has(> :nth-child(3)) {
  flex-direction: column;
}

.lg-dialog-actions:has(> :nth-child(3)) > * {
  flex: none;
}

/* A modal is a dialog's card grown to hold a form: a bar across its top
   as a sheet's, what it holds scrolling under it, its buttons at the
   trailing end of its bottom edge. */
.lg-modal-card.lg-dialog-card.lg-glass {
  width: min(100% - 32px, var(--lg-modal-width, 520px));
  max-height: min(100% - 64px, var(--lg-modal-height, 100%));
  padding: 0;
  --lg-glass: var(--lg-surface);
  --lg-blur: 30px;
  border-radius: var(--lg-modal-radius, 16px);
  overflow: hidden;
  font-size: 15px;
  line-height: 1.4;
}

.lg-modal-scroll {
  flex: 1;
}

.lg-modal-body {
  flex: 1;
  min-height: 0;
  padding: 20px;
  overflow: auto;
  overscroll-behavior: contain;
}

/* Its bar lies over what it holds, which scrolls under it and softens
   there (see .lg-scroll). */
.lg-modal-bar.lg-sheet-bar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  /* A Mac's sheet: a bar 48 deep, its name in the type of what's under it, bold. */
  min-height: 48px;
  padding: 0 10px;
}

/* Its name is at the bar's near end, in line with what it holds, as on a
   Mac's panels; a sheet's is in the middle, as on an iPad. A control for a
   title, such as a segmented control, stays in the middle. */
.lg-modal-bar.lg-sheet-bar:not(:has(> .lg-sheet-title > :is(.lg-glass, .lg-segmented))) {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.lg-modal-bar .lg-sheet-title:not(:has(> :is(.lg-glass, .lg-segmented))) {
  font-size: 13px;
  font-weight: 700;
  line-height: 16px;
  text-align: start;
}

.lg-modal-card:has(> .lg-modal-bar) .lg-modal-scroll {
  --lg-edge-top-size: 48px;
}

.lg-modal-card:has(> .lg-modal-bar) .lg-modal-body {
  padding-top: 68px;
  scroll-padding-top: 68px;
}

.lg-modal-footer {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 20px 20px;
}

/* What scrolls under what lies over its top softens there (see
   ScrollEdges), down as far as `--lg-edge-top-size`.

   It's blurred and faded more the nearer the top it is, and by nothing at
   the foot of what lies over it, with no line where it ends, as macOS and
   iOS draw it. Under a bar that's down the bar's depth.

   Fading makes this a backdrop of its own, so it only fades while there's
   something to scroll: glass held inside is of the glass around it the rest
   of the time. */
.lg-scroll {
  --lg-edge-top: 0;
  --lg-edge-top-size: 24px;
  --lg-edge-bottom: 0;
  --lg-edge-bottom-size: 0px;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.lg-scroll[data-soften="filter"] {
  --lg-edge-fade: linear-gradient(
    to bottom,
    rgb(0 0 0 / 0.4) 0,
    rgb(0 0 0 / 0.5) calc(0.6 * var(--lg-edge-top-size)),
    rgb(0 0 0 / 0.8) calc(0.85 * var(--lg-edge-top-size)),
    #000 var(--lg-edge-top-size)
  );
  -webkit-mask-image: var(--lg-edge-fade);
  mask-image: var(--lg-edge-fade);
}

/* Under what lies over its foot it fades the same way, turned over. */
.lg-scroll[data-soften="filter"][data-foot] {
  --lg-edge-fade: linear-gradient(
    to bottom,
    rgb(0 0 0 / 0.4) 0,
    rgb(0 0 0 / 0.5) calc(0.6 * var(--lg-edge-top-size)),
    rgb(0 0 0 / 0.8) calc(0.85 * var(--lg-edge-top-size)),
    #000 var(--lg-edge-top-size),
    #000 calc(100% - var(--lg-edge-bottom-size)),
    rgb(0 0 0 / 0.8) calc(100% - 0.85 * var(--lg-edge-bottom-size)),
    rgb(0 0 0 / 0.5) calc(100% - 0.6 * var(--lg-edge-bottom-size)),
    rgb(0 0 0 / 0.4) 100%
  );
}

/* Glass held inside is filled over the fill of the glass around it. While
   this fades, that fill is out of its reach, so its own stands in for both. */
.lg-scroll {
  --lg-scroll-around: var(--lg-glass);
}

@supports (color: rgb(from red r g b / calc(alpha * 2))) {
  .lg-scroll[data-soften="filter"] > :not(.lg-scroll-edge) {
    --lg-glass: rgb(from var(--lg-scroll-around) r g b / calc(alpha * (2 - alpha)));
  }
}

/* Where the browser blurs a backdrop all the way down to the page (WebKit),
   the blur is of the backdrop, in layers one over the other. Elsewhere the
   blur is of what scrolls itself, and none of them is drawn. */
.lg-scroll-edge {
  position: absolute;
  inset: 0 0 auto;
  display: none;
  height: var(--lg-edge-top-size);
  pointer-events: none;
}

.lg-scroll[data-soften="backdrop"][data-under] > .lg-scroll-edge:not([data-foot]),
.lg-scroll[data-soften="backdrop"][data-over] > .lg-scroll-edge[data-foot] {
  display: block;
}

.lg-scroll-edge[data-foot] {
  inset: auto 0 0;
  height: var(--lg-edge-bottom-size);
}

/* A sheet doesn't clip what it holds round its corners, so there the layers
   take its corners themselves. */
.lg-sheet-scroll {
  border-radius: inherit;
}

.lg-sheet-scroll > .lg-scroll-edge {
  overflow: hidden;
  border-start-start-radius: inherit;
  border-start-end-radius: inherit;
}

/* Each layer ends sooner than the one before, so the blur lessens down to
   none. With no bar nothing fades: a wash of the glass around it stands in
   for that. */
.lg-scroll-edge > i {
  --lg-edge-blur: 2px;
  --lg-edge-end: 100%;
  --lg-edge-mask: linear-gradient(to bottom, #000 calc(var(--lg-edge-end) - 40%), transparent var(--lg-edge-end));
  position: absolute;
  inset: 0;
  opacity: var(--lg-edge-top);
  -webkit-backdrop-filter: blur(var(--lg-edge-blur));
  backdrop-filter: blur(var(--lg-edge-blur));
  -webkit-mask-image: var(--lg-edge-mask);
  mask-image: var(--lg-edge-mask);
}

.lg-scroll-edge[data-foot] > i {
  --lg-edge-mask: linear-gradient(to top, #000 calc(var(--lg-edge-end) - 40%), transparent var(--lg-edge-end));
  opacity: var(--lg-edge-bottom);
}

.lg-scroll-edge:not([data-bar], [data-foot])::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: calc(0.7 * var(--lg-edge-top));
  background: linear-gradient(to bottom, var(--lg-scroll-around), transparent 90%);
}

.lg-scroll-edge > i:nth-child(2) {
  --lg-edge-blur: 4px;
  --lg-edge-end: 92%;
}

.lg-scroll-edge > i:nth-child(3) {
  --lg-edge-blur: 6px;
  --lg-edge-end: 82%;
}

.lg-scroll-edge > i:nth-child(4) {
  --lg-edge-blur: 10px;
  --lg-edge-end: 70%;
}

/* Under a bar what scrolls is faded itself, which WebKit lets glass inside
   it see through, and there's no wash. */
.lg-scroll[data-soften="backdrop"]:has(> .lg-scroll-edge[data-bar]) > :first-child {
  --lg-edge-fade: linear-gradient(
    to bottom,
    rgb(0 0 0 / 0.4) 0,
    rgb(0 0 0 / 0.5) calc(0.6 * var(--lg-edge-top-size)),
    rgb(0 0 0 / 0.8) calc(0.85 * var(--lg-edge-top-size)),
    #000 var(--lg-edge-top-size)
  );
  -webkit-mask-image: var(--lg-edge-fade);
  mask-image: var(--lg-edge-fade);
}

.lg-scroll[data-soften="backdrop"][data-foot] > :first-child {
  --lg-edge-fade: linear-gradient(
    to top,
    rgb(0 0 0 / 0.4) 0,
    rgb(0 0 0 / 0.5) calc(0.6 * var(--lg-edge-bottom-size)),
    rgb(0 0 0 / 0.8) calc(0.85 * var(--lg-edge-bottom-size)),
    #000 var(--lg-edge-bottom-size)
  );
  -webkit-mask-image: var(--lg-edge-fade);
  mask-image: var(--lg-edge-fade);
}

.lg-scroll[data-soften="backdrop"][data-foot]:has(> .lg-scroll-edge[data-bar]) > :first-child {
  --lg-edge-fade: linear-gradient(
    to bottom,
    rgb(0 0 0 / 0.4) 0,
    rgb(0 0 0 / 0.5) calc(0.6 * var(--lg-edge-top-size)),
    rgb(0 0 0 / 0.8) calc(0.85 * var(--lg-edge-top-size)),
    #000 var(--lg-edge-top-size),
    #000 calc(100% - var(--lg-edge-bottom-size)),
    rgb(0 0 0 / 0.8) calc(100% - 0.85 * var(--lg-edge-bottom-size)),
    rgb(0 0 0 / 0.5) calc(100% - 0.6 * var(--lg-edge-bottom-size)),
    rgb(0 0 0 / 0.4) 100%
  );
}

/* The view's own scroller would run up under what lies over it and soften
   with what scrolls, so it's hidden, and another stands in for it that
   starts where the softening ends (see ScrollEdges). */
.lg-scroll[data-soften] > :first-child {
  scrollbar-width: none;
}

.lg-scroll[data-soften] > :first-child::-webkit-scrollbar {
  display: none;
}

.lg-scroller {
  position: absolute;
  inset-block: var(--lg-edge-top-size) var(--lg-edge-bottom-size);
  inset-inline-end: 0;
  display: none;
  min-width: 16px;
  overflow: hidden scroll;
  overscroll-behavior: contain;
  outline: none;
}

.lg-scroll[data-soften] > .lg-scroller {
  display: block;
}

.lg-scroller > i {
  display: block;
  width: 1px;
}

/* Where scrollers take room of their own, the view keeps clear of it. */
.lg-scroll[data-soften] > :first-child {
  margin-inline-end: var(--lg-scroll-gutter, 0px);
}

/* A view that scrolls under a bar of the window's (see ScrollArea). */
.lg-scroll-area {
  flex: 1;
}

.lg-scroll-view {
  flex: 1;
  min-height: 0;
  overflow: hidden auto;
}

.lg-scroll-area[data-bar] > .lg-scroll-view {
  padding-top: var(--lg-edge-top-size);
  scroll-padding-top: var(--lg-edge-top-size);
}

.lg-scroll-area[data-foot] > .lg-scroll-view {
  padding-bottom: var(--lg-edge-bottom-size);
  scroll-padding-bottom: var(--lg-edge-bottom-size);
}

/* A sidebar is a column of glass that floats beside a window's content, as
   on macOS and iPadOS: rows 30px high under small headings, the open one on
   a rounded fill. Its wrapper lays it out beside the content, and is what a
   page sizes: as tall as the window unless it's told otherwise. */
.lg-sidebar-wrapper {
  --lg-sidebar-inset: 8px;
  position: relative;
  display: flex;
  box-sizing: border-box;
  width: 100%;
  min-height: 100svh;
}

.lg-sidebar-inset {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

/* As in Weather and Music on macOS 26, the panel floats over the content,
   which runs on under it and keeps its own edge clear of the panel; the
   panel slides off the leading edge while the content takes the room back.
   Timings are traced from Weather: closing drops away fast and settles
   (330 ms), opening eases out on a critically damped spring (450 ms). */
@property --lg-sidebar-trigger-room {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}

.lg-sidebar-wrapper,
.lg-sidebar {
  --lg-sidebar-open: 450ms cubic-bezier(0.25, 0.8, 0.3, 1);
  --lg-sidebar-close: 330ms cubic-bezier(0.15, 0.75, 0.25, 1);
  --lg-sidebar-ease: var(--lg-sidebar-open);
  --lg-sidebar-room: calc(var(--lg-sidebar-width, 240px) + var(--lg-sidebar-inset, 0px));
}

.lg-sidebar {
  display: flex;
  flex: none;
  justify-content: flex-end;
  box-sizing: border-box;
  width: calc(var(--lg-sidebar-room) + 4px);
  margin-inline-end: -4px;
  padding: var(--lg-sidebar-inset, 0px);
  padding-inline-end: 4px;
  overflow: clip;
  transition:
    width var(--lg-sidebar-ease),
    padding var(--lg-sidebar-ease);
}

@supports (transition-timing-function: linear(0, 1)) {
  .lg-sidebar-wrapper,
  .lg-sidebar {
    --lg-sidebar-open: 450ms
      linear(0, 0.066, 0.203, 0.356, 0.497, 0.617, 0.714, 0.789, 0.847, 0.89, 0.922, 0.945, 0.962, 0.974, 0.982, 0.988, 0.992, 0.995, 0.998, 0.999, 1);
    --lg-sidebar-close: 330ms
      linear(0, 0.148, 0.267, 0.385, 0.481, 0.578, 0.652, 0.726, 0.778, 0.83, 0.867, 0.896, 0.919, 0.941, 0.956, 0.967, 0.978, 0.985, 0.993, 1);
  }
}

.lg-sidebar[data-state="collapsed"] {
  --lg-sidebar-ease: var(--lg-sidebar-close);
}

/* Down to its icons it keeps that much room, and opens to the whole of it. */
.lg-sidebar-wrapper:has(> .lg-sidebar[data-state="collapsed"][data-collapsible="icon"]),
.lg-sidebar[data-state="collapsed"][data-collapsible="icon"] {
  --lg-sidebar-room: calc(var(--lg-sidebar-width-icon, 50px) + var(--lg-sidebar-inset, 0px));
}

.lg-sidebar[data-side="end"] {
  justify-content: flex-start;
  margin-inline: -4px 0;
  padding-inline: 4px var(--lg-sidebar-inset, 0px);
}

.lg-sidebar[data-state="collapsed"][data-collapsible="offcanvas"] {
  width: 0;
  margin-inline: 0;
  padding-inline: 0;
}

.lg-sidebar[data-state="collapsed"][data-collapsible="icon"] {
  width: calc(var(--lg-sidebar-width-icon, 50px) + var(--lg-sidebar-inset, 0px) + 4px);
}

/* In a provider: over the content, which keeps clear of it. */
.lg-sidebar-wrapper > .lg-sidebar:not([data-mobile]) {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 10;
  width: calc(var(--lg-sidebar-width, 240px) + var(--lg-sidebar-inset, 0px) + 24px);
  margin: 0;
  padding: var(--lg-sidebar-inset, 0px);
  padding-inline-end: 24px;
  justify-content: flex-start;
  pointer-events: none;
  transition: none;
}

.lg-sidebar-wrapper > .lg-sidebar[data-side="end"]:not([data-mobile]) {
  inset-inline: auto 0;
  justify-content: flex-end;
  padding-inline: 24px var(--lg-sidebar-inset, 0px);
}

.lg-sidebar-wrapper > .lg-sidebar:not([data-mobile]) > .lg-sidebar-panel {
  pointer-events: auto;
}

.lg-sidebar-wrapper > .lg-sidebar[data-state="collapsed"][data-collapsible="offcanvas"]:not([data-mobile]) > .lg-sidebar-panel {
  translate: calc(-100% - var(--lg-sidebar-inset, 0px) - 1px) 0;
}

.lg-sidebar-wrapper > .lg-sidebar[data-side="end"][data-state="collapsed"][data-collapsible="offcanvas"]:not([data-mobile]) > .lg-sidebar-panel,
.lg-sidebar-wrapper > .lg-sidebar[data-state="collapsed"][data-collapsible="offcanvas"]:not([data-mobile]):dir(rtl) > .lg-sidebar-panel {
  translate: calc(100% + var(--lg-sidebar-inset, 0px) + 1px) 0;
}

.lg-sidebar-wrapper > .lg-sidebar[data-side="end"][data-state="collapsed"][data-collapsible="offcanvas"]:not([data-mobile]):dir(rtl) > .lg-sidebar-panel {
  translate: calc(-100% - var(--lg-sidebar-inset, 0px) - 1px) 0;
}

/* Before Chrome 120 and Safari 16.4 there's no :dir(), and a rule that names it is
   dropped whole: there, the dir attribute stands in for it, here and below. */
@supports not selector(:dir(rtl)) {
  .lg-sidebar-wrapper > .lg-sidebar[data-state="collapsed"][data-collapsible="offcanvas"]:not([data-mobile]):is([dir="rtl"], [dir="rtl"] *) > .lg-sidebar-panel {
    translate: calc(100% + var(--lg-sidebar-inset, 0px) + 1px) 0;
  }

  .lg-sidebar-wrapper > .lg-sidebar[data-side="end"][data-state="collapsed"][data-collapsible="offcanvas"]:not([data-mobile]):is([dir="rtl"], [dir="rtl"] *) > .lg-sidebar-panel {
    translate: calc(-100% - var(--lg-sidebar-inset, 0px) - 1px) 0;
  }
}

/* A trigger written in the sidebar is the window's own, and lies outside the
   panel: it rides the panel's top corner as that slides away, and stops at the
   content's corner once it gets there, so it's never gone and never jumps. */
@property --lg-sidebar-gone {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

.lg-sidebar-bar {
  --lg-sidebar-gone: 0;
  --lg-sidebar-span: var(--lg-sidebar-width, 240px);
  --lg-sidebar-slide: calc(var(--lg-sidebar-span) + var(--lg-sidebar-inset, 0px) + 1px);
  --lg-sidebar-trigger-at: max(
    var(--lg-sidebar-trigger-offset, calc(var(--lg-sidebar-inset, 0px) + 8px)),
    calc(var(--lg-sidebar-inset, 0px) + var(--lg-sidebar-span) - 44px - var(--lg-sidebar-gone) * var(--lg-sidebar-slide))
  );
  position: absolute;
  z-index: 1;
  inset-block: calc(var(--lg-sidebar-inset, 0px) + 8px);
  inset-inline-start: var(--lg-sidebar-trigger-at);
  display: flex;
  align-items: flex-start;
  pointer-events: none;
  transition: --lg-sidebar-gone var(--lg-sidebar-ease);
}

.lg-sidebar[data-side="end"] > .lg-sidebar-bar {
  inset-inline: auto var(--lg-sidebar-trigger-at);
}

.lg-sidebar[data-mobile] > .lg-sidebar-bar {
  --lg-sidebar-span: min(var(--lg-sidebar-width-mobile, 280px), 100% - 2 * var(--lg-sidebar-inset, 0px));
  --lg-sidebar-slide: calc(var(--lg-sidebar-span) + var(--lg-sidebar-inset, 0px));
}

.lg-sidebar[data-state="collapsed"]:is([data-collapsible="offcanvas"], [data-mobile]) > .lg-sidebar-bar {
  --lg-sidebar-gone: 1;
}

/* Down to its icons the panel keeps it, in the middle of the rail. */
.lg-sidebar[data-collapsible="icon"]:not([data-mobile]) > .lg-sidebar-bar {
  transition: inset var(--lg-sidebar-ease);
}

.lg-sidebar[data-state="collapsed"][data-collapsible="icon"]:not([data-mobile]) > .lg-sidebar-bar {
  inset-inline-start: calc(var(--lg-sidebar-inset, 0px) + (var(--lg-sidebar-width-icon, 50px) - 36px) / 2);
}

.lg-sidebar[data-state="collapsed"][data-collapsible="icon"][data-side="end"]:not([data-mobile]) > .lg-sidebar-bar {
  inset-inline: auto calc(var(--lg-sidebar-inset, 0px) + (var(--lg-sidebar-width-icon, 50px) - 36px) / 2);
}

/* Down a page that scrolls under the panel, it stays in the panel's corner. */
.lg-sidebar-bar > .lg-sidebar-trigger {
  position: sticky;
  top: calc(var(--lg-sidebar-inset, 0px) + 8px);
  width: 36px;
  height: 36px;
  pointer-events: auto;
}

/* It answers the pointer as a toolbar's button does: a little darker, at
   once, and darker again while pressed. */
.lg-sidebar-trigger.lg-button {
  transition: none;
}

.lg-sidebar-trigger.lg-button:is(:active, [data-pressed]) {
  background-color: var(--lg-glass);
  background-image: linear-gradient(var(--lg-selection), var(--lg-selection)), var(--lg-rim, none);
}

@media (hover: hover) and (pointer: fine) {
  .lg-sidebar-trigger.lg-button:hover:not(:active, [data-pressed]) {
    background-color: var(--lg-glass);
    background-image: linear-gradient(var(--lg-hover), var(--lg-hover)), var(--lg-rim, none);
  }
}

/* The room the trigger takes in the row it's written in. */
.lg-sidebar-trigger-slot {
  flex: none;
  align-self: flex-end;
  width: 34px;
  height: 34px;
}

/* What the content's leading edge keeps clear for it once the panel's gone:
   whatever the panel's own room no longer covers. So what's padded by it
   comes away with the content's edge and stops beside the trigger, as a
   window's toolbar does beside its buttons on macOS, rather than easing
   there on its own. --lg-sidebar-away runs from 0 to 1 on the timing of the
   content's edge. (On the wrapper: WebKit drops the content's border
   transition if another runs on the same element.) Neither it nor the
   edge worked out from it is handed down: what changes on every frame of
   the slide would have everything in the wrapper styled again on each,
   where the room for the trigger changes only over the slide's last 44px. */
@property --lg-sidebar-away {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

@property --lg-sidebar-edge {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

.lg-sidebar-wrapper {
  --lg-sidebar-away: 0;
  --lg-sidebar-trigger-room: 0px;
  transition: --lg-sidebar-away var(--lg-sidebar-open);
}

.lg-sidebar-wrapper:has(> .lg-sidebar[data-state="collapsed"][data-collapsible="offcanvas"]:not([data-mobile])) {
  --lg-sidebar-away: 1;
  transition: --lg-sidebar-away var(--lg-sidebar-close);
}

.lg-sidebar-wrapper:has(> .lg-sidebar[data-trigger][data-collapsible="offcanvas"]:not([data-mobile])) {
  --lg-sidebar-trigger-room: max(0px, 44px - var(--lg-sidebar-room) * (1 - var(--lg-sidebar-away)));
}

/* The content's edge is a border, which is drawn on whole pixels of the
   screen, and never thinner than one: so is this, or what it pads would
   shiver while it waits beside the trigger. */
@supports (width: round(down, 1.5px, 1px)) {
  .lg-sidebar-wrapper:has(> .lg-sidebar[data-trigger][data-collapsible="offcanvas"]:not([data-mobile])) {
    --lg-sidebar-pixel: 1px;
    --lg-sidebar-edge: calc(var(--lg-sidebar-room) * (1 - var(--lg-sidebar-away)));
    --lg-sidebar-trigger-room: max(
      0px,
      44px - max(round(down, var(--lg-sidebar-edge), var(--lg-sidebar-pixel)), min(var(--lg-sidebar-pixel), var(--lg-sidebar-edge) * 1000))
    );
  }

  @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
    .lg-sidebar-wrapper:has(> .lg-sidebar[data-trigger][data-collapsible="offcanvas"]:not([data-mobile])) {
      --lg-sidebar-pixel: 0.5px;
    }
  }
}

/* Over the content it takes none of its room, so the content stays put. */
.lg-sidebar-wrapper:has(> .lg-sidebar[data-trigger][data-mobile]) {
  --lg-sidebar-trigger-room: 44px;
}

/* The content's own background runs under the panel: the room it keeps
   clear is a transparent border, which leaves its padding to the page. */
.lg-sidebar-wrapper > .lg-sidebar-inset {
  border: 0 solid transparent;
  transition: border-width var(--lg-sidebar-ease);
}

/* Crossing the breakpoint as the window is resized, nothing slides. */
.lg-sidebar-wrapper[data-resizing],
.lg-sidebar-wrapper[data-resizing] > .lg-sidebar,
.lg-sidebar-wrapper[data-resizing] > .lg-sidebar > *,
.lg-sidebar-wrapper[data-resizing] > .lg-sidebar-inset,
.lg-sidebar-wrapper[data-resizing] .lg-sidebar-trigger > svg {
  transition: none !important;
  animation: none !important;
}

.lg-sidebar-wrapper:has(> .lg-sidebar[data-state="collapsed"]) > .lg-sidebar-inset {
  --lg-sidebar-ease: var(--lg-sidebar-close);
}

.lg-sidebar-wrapper:has(> .lg-sidebar:not([data-mobile], [data-side="end"])) > .lg-sidebar-inset {
  border-inline-start-width: var(--lg-sidebar-room);
}

.lg-sidebar-wrapper:has(> .lg-sidebar[data-side="end"]:not([data-mobile])) > .lg-sidebar-inset {
  border-inline-end-width: var(--lg-sidebar-room);
}

.lg-sidebar-wrapper:has(> .lg-sidebar[data-state="collapsed"][data-collapsible="offcanvas"]:not([data-mobile])) > .lg-sidebar-inset {
  border-inline-width: 0;
}

/* It stays in view down a page that scrolls under it. Its glass is a shade
   darker than the window's, as a macOS sidebar's is: greyer than a white
   window, and dimmer than a dark one. */
.lg-sidebar-panel.lg-glass {
  --lg-blur: 16px;
  background-color: var(--lg-sidebar-glass);
  position: sticky;
  top: var(--lg-sidebar-inset, 0px);
  display: flex;
  flex: none;
  flex-direction: column;
  box-sizing: border-box;
  width: var(--lg-sidebar-width, 240px);
  max-height: calc(100svh - 2 * var(--lg-sidebar-inset, 0px));
  border-radius: var(--lg-sidebar-radius, 16px);
  color: var(--lg-foreground);
  font-size: 13px;
  line-height: 1.25;
  outline: none;
  transition:
    width var(--lg-sidebar-ease),
    translate var(--lg-sidebar-ease),
    visibility 0s;
}

.lg-sidebar-wrapper > .lg-sidebar > .lg-sidebar-panel.lg-glass {
  align-self: flex-start;
  height: 100%;
}

/* Out of reach of the keyboard and of assistive technology once it's gone. */
.lg-sidebar[data-state="collapsed"][data-collapsible="offcanvas"] .lg-sidebar-panel {
  visibility: hidden;
  transition-delay: 0s, 0s, 330ms;
}

.lg-sidebar[data-state="collapsed"][data-collapsible="icon"] .lg-sidebar-panel {
  width: var(--lg-sidebar-width-icon, 50px);
}

/* Where there's no room beside the content it lies over it, with the content
   dimmed behind it, and slides in from the edge. Closed, it keeps its size,
   for the panel to slide out of. */
.lg-sidebar[data-mobile],
.lg-sidebar[data-mobile][data-state="collapsed"][data-collapsible] {
  position: absolute;
  inset: 0;
  z-index: 20;
  justify-content: flex-start;
  width: auto;
  margin: 0;
  padding: var(--lg-sidebar-inset, 0px);
  pointer-events: none;
  transition: none;
}

.lg-sidebar[data-mobile][data-side="end"],
.lg-sidebar[data-mobile][data-state="collapsed"][data-collapsible][data-side="end"] {
  justify-content: flex-end;
}

.lg-sidebar[data-mobile] .lg-sidebar-panel.lg-glass {
  width: min(var(--lg-sidebar-width-mobile, 280px), 100%);
  pointer-events: auto;
  transition:
    translate var(--lg-sidebar-ease),
    visibility 0s;
}

.lg-sidebar[data-mobile][data-state="collapsed"] .lg-sidebar-panel.lg-glass {
  translate: calc(-100% - var(--lg-sidebar-inset, 0px)) 0;
  transition-delay: 0s, 350ms;
}

.lg-sidebar[data-mobile][data-state="collapsed"][data-side="end"] .lg-sidebar-panel.lg-glass,
.lg-sidebar[data-mobile][data-state="collapsed"]:dir(rtl) .lg-sidebar-panel.lg-glass {
  translate: calc(100% + var(--lg-sidebar-inset, 0px)) 0;
}

.lg-sidebar[data-mobile][data-state="collapsed"][data-side="end"]:dir(rtl) .lg-sidebar-panel.lg-glass {
  translate: calc(-100% - var(--lg-sidebar-inset, 0px)) 0;
}

@supports not selector(:dir(rtl)) {
  .lg-sidebar[data-mobile][data-state="collapsed"]:is([dir="rtl"], [dir="rtl"] *) .lg-sidebar-panel.lg-glass {
    translate: calc(100% + var(--lg-sidebar-inset, 0px)) 0;
  }

  .lg-sidebar[data-mobile][data-state="collapsed"][data-side="end"]:is([dir="rtl"], [dir="rtl"] *) .lg-sidebar-panel.lg-glass {
    translate: calc(-100% - var(--lg-sidebar-inset, 0px)) 0;
  }
}

.lg-sidebar-scrim {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.2);
  pointer-events: auto;
  transition: opacity 300ms var(--lg-ease);
}

.lg-sidebar[data-state="collapsed"] .lg-sidebar-scrim {
  opacity: 0;
  pointer-events: none;
}

.lg-sidebar-header,
.lg-sidebar-footer {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.lg-sidebar-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 10px;
  overflow: hidden auto;
  overscroll-behavior: contain;
  /* Where scrollbars always show, a thumb on the glass: no track of the page's colour down the panel. */
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, currentColor 30%, transparent) transparent;
}

.lg-sidebar-header + .lg-sidebar-content {
  padding-top: 0;
}

/* With a ScrollArea round its content that's given the header's depth as its
   bar, the header lies over the list, as a window's toolbar does over what
   scrolls under it: the rows start below it and soften as they pass up
   behind it. The area scrolls, so the content inside it doesn't. */
.lg-sidebar-panel:has(> .lg-scroll-area[data-bar]) > .lg-sidebar-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
}

/* Given the footer's depth as its foot, the footer lies over the list's end the same way. */
.lg-sidebar-panel:has(> .lg-scroll-area[data-foot]) > .lg-sidebar-footer {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
}

.lg-sidebar-panel > .lg-scroll-area > .lg-scroll-view > .lg-sidebar-content {
  flex: none;
  overflow: visible;
}

.lg-sidebar-panel > .lg-scroll-area[data-bar] > .lg-scroll-view > .lg-sidebar-content {
  padding-top: 0;
}

/* The panel doesn't clip what it holds round its corners either (see the sheet's, above). */
.lg-sidebar-panel > .lg-scroll-area {
  border-radius: inherit;
}

.lg-sidebar-panel > .lg-scroll-area > .lg-scroll-edge {
  overflow: hidden;
  border-start-start-radius: inherit;
  border-start-end-radius: inherit;
}

.lg-sidebar-panel > .lg-scroll-area > .lg-scroll-edge[data-foot] {
  border-start-start-radius: 0;
  border-start-end-radius: 0;
  border-end-start-radius: inherit;
  border-end-end-radius: inherit;
}

/* WebKit fills a backdrop drawn inside glass that has a backdrop of its own
   with that glass's tint once more, which would darken the header while rows
   are under it. So where the blur is in layers of its own (WebKit), the
   panel's glass is a layer under what it holds, not the panel itself. */
.lg-sidebar-panel.lg-glass:has(> .lg-scroll-area[data-soften="backdrop"]) {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background-color: transparent;
  background-image: none;
}

.lg-sidebar-panel.lg-glass:has(> .lg-scroll-area[data-soften="backdrop"])::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background-color: var(--lg-sidebar-glass);
  background-image: var(--lg-rim, none);
  background-size: 100% 100%;
  -webkit-backdrop-filter: blur(var(--lg-blur, 3px)) var(--lg-filter, var(--lg-finish));
  backdrop-filter: blur(var(--lg-blur, 3px)) var(--lg-filter, var(--lg-finish));
  pointer-events: none;
}

.lg-sidebar-panel > .lg-scroll-area > .lg-scroller {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, currentColor 30%, transparent) transparent;
}

/* Their edges draw in with the panel going down to its icons. */
.lg-sidebar[data-collapsible="icon"] :is(.lg-sidebar-header, .lg-sidebar-footer, .lg-sidebar-content) {
  transition: padding var(--lg-sidebar-ease);
}

.lg-sidebar-separator {
  flex: none;
  height: 1px;
  margin: 0 10px;
  border: 0;
  background: var(--lg-separator);
}

.lg-sidebar-group {
  position: relative;
  display: flex;
  flex: none;
  flex-direction: column;
  min-width: 0;
}

.lg-sidebar-group-label {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  box-sizing: border-box;
  width: 100%;
  height: 24px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--lg-muted);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  text-align: start;
  white-space: nowrap;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  transition:
    height var(--lg-sidebar-ease),
    opacity 200ms var(--lg-ease);
}

.lg-sidebar-group-label > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* What shows and hides rows: pointing along the row with them hidden, and
   down with them shown. */
.lg-sidebar-chevron {
  flex: none;
  transition:
    rotate 250ms cubic-bezier(0.32, 0.72, 0, 1),
    opacity 150ms var(--lg-ease);
}

.lg-sidebar-chevron:dir(rtl) {
  scale: -1 1;
}

@supports not selector(:dir(rtl)) {
  .lg-sidebar-chevron:is([dir="rtl"], [dir="rtl"] *) {
    scale: -1 1;
  }
}

[aria-expanded="true"] > .lg-sidebar-chevron {
  rotate: 90deg;
}

[aria-expanded="true"] > .lg-sidebar-chevron:dir(rtl) {
  rotate: -90deg;
}

@supports not selector(:dir(rtl)) {
  [aria-expanded="true"] > .lg-sidebar-chevron:is([dir="rtl"], [dir="rtl"] *) {
    rotate: -90deg;
  }
}

/* A group's chevron shows with the pointer or the keyboard on its heading,
   as Finder's does; and always while its rows are hidden, or where there's
   no pointer to bring it out. */
@media (hover: hover) and (pointer: fine) {
  .lg-sidebar-group-label[aria-expanded="true"]:not(:hover, :focus-visible) > .lg-sidebar-chevron {
    opacity: 0;
  }
}

.lg-sidebar-group-action,
.lg-sidebar-menu-action,
.lg-sidebar-menu-disclosure {
  position: absolute;
  inset-inline-end: 4px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--lg-muted);
  font: inherit;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

.lg-sidebar-group-action {
  top: 1px;
}

.lg-sidebar-menu-action,
.lg-sidebar-menu-disclosure {
  top: 4px;
}

.lg-sidebar-group:has(> .lg-sidebar-group-action) > .lg-sidebar-group-label {
  padding-inline-end: 30px;
}

.lg-sidebar-group-action > svg,
.lg-sidebar-menu-action > svg {
  width: 14px;
  height: 14px;
}

@media (hover: hover) and (pointer: fine) {
  .lg-sidebar-group-action:hover,
  .lg-sidebar-menu-action:hover,
  .lg-sidebar-menu-disclosure:hover,
  button.lg-sidebar-group-label:hover {
    color: var(--lg-foreground);
  }

  .lg-sidebar-group-action:hover,
  .lg-sidebar-menu-action:hover,
  .lg-sidebar-menu-disclosure:hover {
    background: var(--lg-highlight);
  }

  .lg-sidebar-menu-action[data-hover] {
    opacity: 0;
  }

  .lg-sidebar-menu-item:hover > .lg-sidebar-menu-action[data-hover],
  .lg-sidebar-menu-item:focus-within > .lg-sidebar-menu-action[data-hover],
  .lg-sidebar-menu-action[data-hover][aria-expanded="true"] {
    opacity: 1;
  }
}

/* Rows close by their height. Named twice over, as the lists are below. */
.lg-sidebar-collapse {
  display: grid;
  grid-template-rows: 1fr;
  transition:
    grid-template-rows 350ms cubic-bezier(0.32, 0.72, 0, 1),
    opacity 250ms var(--lg-ease),
    visibility 0s;
}

.lg-sidebar-collapse > * {
  min-height: 0;
  overflow: hidden;
}

.lg-sidebar-collapse[data-lg-collapsed] {
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition-delay: 0s, 0s, 350ms;
}

/* Named twice over, so a page's own rules for lists don't indent, space or
   mark its rows. */
.lg-sidebar-panel .lg-sidebar-menu,
.lg-sidebar-panel .lg-sidebar-menu-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lg-sidebar-panel .lg-sidebar-menu-item,
.lg-sidebar-panel .lg-sidebar-menu-sub-item {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lg-sidebar-panel .lg-sidebar-menu-sub {
  padding: 2px 0 0;
  padding-inline-start: 26px;
}

.lg-sidebar-menu-button,
.lg-sidebar-menu-sub-button {
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  min-height: 30px;
  margin: 0;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 500;
  text-align: start;
  text-decoration: none;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  transition:
    width var(--lg-sidebar-ease),
    padding var(--lg-sidebar-ease);
}

.lg-sidebar-menu-button[data-size="sm"],
.lg-sidebar-menu-sub-button {
  min-height: 24px;
  padding-block: 2px;
  font-size: 12px;
}

.lg-sidebar-menu-button[data-size="lg"] {
  gap: 10px;
  min-height: 46px;
  padding: 6px 8px;
  border-radius: 10px;
}

/* An icon keeps its size and takes the accent colour, as a macOS sidebar's
   does; the label after it gives way. */
.lg-sidebar-menu-button > svg,
.lg-sidebar-menu-button > img,
.lg-sidebar-menu-sub-button > svg,
.lg-sidebar-menu-sub-button > img {
  flex: none;
}

.lg-sidebar-menu-button > svg,
.lg-sidebar-menu-sub-button > svg {
  width: 18px;
  height: 18px;
  color: var(--lg-sidebar-icon, var(--lg-fill));
}

.lg-sidebar-menu-button > span:last-child,
.lg-sidebar-menu-sub-button > span:last-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Room at a row's far end for what lies over it there. */
.lg-sidebar-menu-item:has(> .lg-sidebar-menu-action, > .lg-sidebar-menu-disclosure) > .lg-sidebar-menu-button {
  padding-inline-end: 30px;
}

.lg-sidebar-menu-item:has(> .lg-sidebar-menu-badge) > .lg-sidebar-menu-button {
  padding-inline-end: 38px;
}

.lg-sidebar-menu-item:has(> .lg-sidebar-menu-badge):has(> .lg-sidebar-menu-action, > .lg-sidebar-menu-disclosure)
  > .lg-sidebar-menu-button {
  padding-inline-end: 62px;
}

.lg-sidebar-menu-item:has(> .lg-sidebar-menu-action, > .lg-sidebar-menu-disclosure) > .lg-sidebar-menu-badge {
  inset-inline-end: 32px;
}

.lg-sidebar-menu-badge {
  position: absolute;
  top: 0;
  inset-inline-end: 10px;
  display: flex;
  align-items: center;
  height: 30px;
  color: var(--lg-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .lg-sidebar-menu-button:hover,
  .lg-sidebar-menu-sub-button:hover {
    background: var(--lg-highlight);
  }
}

.lg-sidebar-menu-button[data-active],
.lg-sidebar-menu-sub-button[data-active] {
  background: var(--lg-sidebar-selection, var(--lg-selection));
  color: var(--lg-sidebar-selection-foreground, inherit);
}

.lg-sidebar-menu-button[data-active] > svg,
.lg-sidebar-menu-sub-button[data-active] > svg {
  color: var(--lg-sidebar-selection-foreground, var(--lg-sidebar-icon, var(--lg-fill)));
}

.lg-sidebar-menu-button[data-active] ~ .lg-sidebar-menu-badge,
.lg-sidebar-menu-button[data-active] ~ .lg-sidebar-menu-disclosure {
  color: var(--lg-sidebar-selection-foreground, var(--lg-muted));
}

.lg-sidebar-menu-button:focus-visible,
.lg-sidebar-menu-sub-button:focus-visible,
.lg-sidebar-group-label:focus-visible,
.lg-sidebar-group-action:focus-visible,
.lg-sidebar-menu-action:focus-visible,
.lg-sidebar-menu-disclosure:focus-visible {
  outline: 2px solid var(--lg-ring);
  outline-offset: -2px;
}

/* Down to its icons: each row is as wide as its icon, with its label cut off
   rather than taken away, so it still has its name; headings, counts and the
   rows under rows are put away. */
.lg-sidebar[data-state="collapsed"][data-collapsible="icon"] :is(.lg-sidebar-header, .lg-sidebar-footer, .lg-sidebar-content) {
  padding-inline: 8px;
  overflow-x: hidden;
}

.lg-sidebar[data-state="collapsed"][data-collapsible="icon"] .lg-sidebar-menu-button {
  width: 34px;
  padding-inline: 8px;
}

.lg-sidebar[data-state="collapsed"][data-collapsible="icon"] .lg-sidebar-menu-button[data-size="lg"] {
  padding-inline: 1px;
}

/* A heading keeps its line, so the icons under it stay where they are. */
.lg-sidebar[data-state="collapsed"][data-collapsible="icon"] .lg-sidebar-group-label {
  opacity: 0;
  pointer-events: none;
}

.lg-sidebar[data-state="collapsed"][data-collapsible="icon"]
  :is(.lg-sidebar-group-action, .lg-sidebar-menu-action, .lg-sidebar-menu-badge, .lg-sidebar-menu-disclosure, .lg-sidebar-menu-sub) {
  display: none;
}

/* The label of a row that's down to its icon, beside it. */
.lg-sidebar-tooltip.lg-glass {
  --lg-blur: 12px;
  position: fixed;
  z-index: 60;
  translate: 0 -50%;
  padding: 5px 10px;
  border-radius: 9px;
  color: var(--lg-foreground);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  animation: lg-sidebar-tip 150ms var(--lg-ease);
}

@keyframes lg-sidebar-tip {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lg-sidebar,
  .lg-sidebar-wrapper > .lg-sidebar-inset,
  .lg-sidebar-bar,
  .lg-sidebar-panel.lg-glass,
  .lg-sidebar[data-mobile] .lg-sidebar-panel.lg-glass,
  .lg-sidebar-collapse,
  .lg-sidebar-group-label,
  .lg-sidebar-menu-button,
  .lg-sidebar-chevron {
    transition-duration: 0s;
    transition-delay: 0s;
  }

  .lg-sidebar-wrapper,
  .lg-sidebar-wrapper:has(> .lg-sidebar[data-state="collapsed"][data-collapsible="offcanvas"]:not([data-mobile])) {
    transition-duration: 0s;
  }
}

/* A toolbar's buttons gather into groups, each a capsule of glass 36px
   high, as macOS floats them over a window's content. */
.lg-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--lg-foreground);
  font-size: 13px;
}

.lg-toolbar-spacer {
  flex: 1;
}

.lg-toolbar-slot {
  display: flex;
  align-items: center;
  min-width: 0;
}

/* A window's title: 15px and semibold, 12px clear of the buttons before it,
   as Finder sets it, over a smaller, quieter line. It gives way before the
   buttons do. */
.lg-toolbar-slot:has(> .lg-toolbar-title) {
  flex: 0 1 auto;
}

.lg-toolbar-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-inline: 4px;
  line-height: 1.2;
}

.lg-toolbar-title-text,
.lg-toolbar-subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lg-toolbar-title-text {
  font-size: 15px;
  font-weight: 600;
}

.lg-toolbar-subtitle {
  color: var(--lg-muted);
  font-size: 11px;
  font-weight: 400;
}

.lg-toolbar-group.lg-glass {
  display: flex;
  flex: none;
  align-items: center;
  height: 36px;
  gap: 4px;
  padding: 0 4px;
  border-radius: 18px;
  box-shadow:
    inset 0 0 0 0.5px var(--lg-edge),
    0 2px 8px var(--lg-drop);
  touch-action: manipulation;
  will-change: scale, translate;
  --lg-glass: var(--lg-field-glass);
  --lg-saturate: var(--lg-field-saturate);
  --lg-gain: var(--lg-field-gain);
  --lg-rim-shine: var(--lg-field-shine);
  --lg-rim-lit: along;
}

/* A toolbar's buttons and the field beside them are one glass, the field's
   (see Input), and one height, as on macOS. */
.lg-toolbar-group.lg-glass[data-rim] {
  box-shadow:
    inset 0 4px 10px var(--lg-field-inner),
    0 0 0 0.5px var(--lg-field-outline),
    1.5px 0 0 -0.5px var(--lg-field-shade),
    -1.5px 0 0 -0.5px var(--lg-field-shade),
    0 1px 3px var(--lg-drop);
}

.lg-toolbar .lg-input {
  height: 36px;
  border-radius: 18px;
}

.lg-toolbar .lg-input-clear {
  margin-inline-end: -12px;
}

.lg-toolbar-item {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  min-width: 36px;
  height: 28px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 14px;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.lg-toolbar-item > svg {
  width: 18px;
  height: 18px;
}

/* A button alone on its glass is the glass: it fills it, edge to edge. */
.lg-toolbar-item:only-child {
  height: 36px;
  margin-inline: -4px;
  border-radius: 18px;
}

.lg-toolbar-item:only-child:not([aria-label]) {
  padding-inline: 14px;
}

/* Under the pointer a button darkens a little, at once, as on macOS; one
   that's on is darker, and darker again under the pointer. */
.lg-toolbar-item[aria-pressed="true"],
.lg-toolbar-item:is(:active, [data-pressed]):not(:disabled) {
  background-color: var(--lg-selection);
}

@media (hover: hover) and (pointer: fine) {
  .lg-toolbar-item:hover:not(:disabled) {
    background-image: linear-gradient(var(--lg-hover), var(--lg-hover));
  }
}

.lg-toolbar-item:disabled {
  opacity: 0.35;
}

.lg-toolbar-item:focus-visible {
  outline: 2px solid var(--lg-ring);
  outline-offset: -2px;
}

/* The small controls: a checkbox, radio buttons, a stepper, a pop-up button
   and a progress bar, drawn as macOS draws them at the size of the rest. */
.lg-checkbox,
.lg-radio input {
  flex: none;
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 0;
  background: var(--lg-rail) center / 100% no-repeat;
  /* Empty, it frosts what's behind it as a field does, and has a field's hairline:
     over a picture it's of the glass beside it, not a faint square. */
  -webkit-backdrop-filter: blur(8px) saturate(var(--lg-field-saturate));
  backdrop-filter: blur(8px) saturate(var(--lg-field-saturate));
  box-shadow:
    inset 0 0 0 0.5px var(--lg-edge),
    0 0 0 0.5px var(--lg-field-outline);
  vertical-align: middle;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 120ms ease,
    scale 120ms ease;
}

/* On glass they're a layer on it, as every control is (see Glass on glass). */
.lg-glass :is(.lg-checkbox, .lg-radio input) {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.lg-checkbox {
  border-radius: 6px;
}

.lg-radio input {
  border-radius: 50%;
}

.lg-checkbox:active:not(:disabled),
.lg-radio input:active:not(:disabled) {
  scale: 0.92;
}

.lg-checkbox:is(:checked, :indeterminate),
.lg-radio input:checked {
  background-color: var(--lg-fill);
  box-shadow: none;
}

.lg-checkbox:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5.5 10.5 3 3 6-7'/%3E%3C/svg%3E");
}

.lg-checkbox:indeterminate {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M5.5 10h9'/%3E%3C/svg%3E");
}

.lg-radio input:checked {
  background-image: radial-gradient(circle, white 0 3.5px, transparent 4px);
}

.lg-checkbox:disabled,
.lg-radio[data-disabled] {
  opacity: 0.4;
}

.lg-checkbox:focus-visible,
.lg-radio input:focus-visible {
  outline: 2px solid var(--lg-ring);
  outline-offset: 2px;
}

.lg-radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--lg-foreground);
  font-size: 14px;
}

.lg-radio-group[data-orientation="horizontal"] {
  flex-direction: row;
  gap: 16px;
}

.lg-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lg-stepper.lg-glass {
  display: inline-flex;
  align-items: center;
  height: var(--lg-control-size, 32px);
  border-radius: calc(var(--lg-control-size, 32px) / 2);
  color: var(--lg-foreground);
}

.lg-stepper button {
  display: grid;
  place-items: center;
  width: calc(var(--lg-control-size, 32px) + 12px);
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: none;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* A hairline between the two, as iOS draws it. */
.lg-stepper button + button {
  background: linear-gradient(var(--lg-separator), var(--lg-separator)) left center / 1px 16px no-repeat;
}

.lg-stepper button:is(:active, [data-pressed]):not(:disabled, [aria-disabled="true"]) {
  background-color: var(--lg-highlight);
}

.lg-stepper button:is(:disabled, [aria-disabled="true"]) {
  color: var(--lg-muted);
  cursor: default;
}

/* Said, not shown. */
.lg-stepper-value {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.lg-stepper button:focus-visible {
  outline: 2px solid var(--lg-ring);
  outline-offset: -2px;
}

.lg-stepper svg,
.lg-select svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* A pop-up button is a field, of the field's glass (see Input), as a search
   field, a segmented control and a toolbar's groups are: beside them it's the
   same material, not a pane of the page's. */
.lg-select.lg-glass {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: var(--lg-control-size, 40px);
  border-radius: calc(var(--lg-control-size, 40px) / 2);
  color: var(--lg-foreground);
  transition: background-color 200ms ease;
  --lg-glass: var(--lg-field-glass);
  --lg-saturate: var(--lg-field-saturate);
  --lg-gain: var(--lg-field-gain);
  --lg-rim-shine: var(--lg-field-shine);
  --lg-rim-lit: along;
}

.lg-select.lg-glass[data-rim] {
  box-shadow:
    inset 0 4px 10px var(--lg-field-inner),
    0 0 0 0.5px var(--lg-field-outline),
    1.5px 0 0 -0.5px var(--lg-field-shade),
    -1.5px 0 0 -0.5px var(--lg-field-shade),
    0 1px 3px var(--lg-drop);
}

.lg-select select {
  height: 100%;
  margin: 0;
  padding: 0 36px 0 var(--lg-control-pad, 16px);
  border: 0;
  border-radius: inherit;
  outline: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: var(--lg-control-font, 14px);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.lg-select svg {
  position: absolute;
  right: 12px;
  color: var(--lg-muted);
  pointer-events: none;
}

/* Tapped, a field whose text is under 16px has iOS zoom the page in on it,
   and the page stays zoomed after. On iOS a field's text is 16px, near the
   17 of its own fields. (Only iOS has -webkit-touch-callout.) */
@supports (-webkit-touch-callout: none) {
  .lg-input input,
  .lg-select select {
    font-size: max(16px, var(--lg-control-font, 14px));
  }
}

.lg-select:has(select:focus-visible) {
  outline: 2px solid var(--lg-ring);
  outline-offset: 2px;
}

.lg-select[data-disabled] {
  opacity: 0.4;
}

.lg-progress {
  width: 100%;
  max-width: 360px;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--lg-rail);
}

.lg-progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--lg-fill);
  transform: translateX(calc((var(--lg-progress, 0) - 1) * 100%));
  transition: transform 200ms var(--lg-ease);
}

.lg-progress:dir(rtl) .lg-progress-fill {
  transform: translateX(calc((1 - var(--lg-progress, 0)) * 100%));
}

@supports not selector(:dir(rtl)) {
  .lg-progress:is([dir="rtl"], [dir="rtl"] *) .lg-progress-fill {
    transform: translateX(calc((1 - var(--lg-progress, 0)) * 100%));
  }
}

.lg-progress[data-indeterminate] .lg-progress-fill {
  width: 40%;
  transform: none;
  animation: lg-progress 1.4s ease-in-out infinite;
}

@keyframes lg-progress {
  from {
    translate: -100%;
  }
  to {
    translate: 250%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lg-progress[data-indeterminate] .lg-progress-fill {
    width: 100%;
    animation: lg-progress-pulse 2s ease-in-out infinite alternate;
  }
}

@keyframes lg-progress-pulse {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
  }
}

/* A Mac's spinner: eight spokes, each lit in turn and fading until its turn
   comes round again, a turn of the ring every 0.8 s. */
.lg-spinner {
  position: relative;
  display: inline-block;
  flex: none;
  width: var(--lg-spinner-size, 20px);
  height: var(--lg-spinner-size, 20px);
  vertical-align: middle;
}

.lg-spinner[data-size="sm"] {
  --lg-spinner-size: 16px;
}

.lg-spinner[data-size="md"] {
  --lg-spinner-size: 20px;
}

.lg-spinner[data-size="lg"] {
  --lg-spinner-size: 32px;
}

.lg-spinner > span {
  position: absolute;
  top: 0;
  left: 43.75%;
  width: 12.5%;
  height: 30%;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.05;
  transform-origin: 50% 166.667%;
  animation: lg-spinner 0.8s linear infinite;
}

.lg-spinner > span:nth-child(1) {
  animation-delay: -0.8s;
}

.lg-spinner > span:nth-child(2) {
  transform: rotate(45deg);
  animation-delay: -0.7s;
}

.lg-spinner > span:nth-child(3) {
  transform: rotate(90deg);
  animation-delay: -0.6s;
}

.lg-spinner > span:nth-child(4) {
  transform: rotate(135deg);
  animation-delay: -0.5s;
}

.lg-spinner > span:nth-child(5) {
  transform: rotate(180deg);
  animation-delay: -0.4s;
}

.lg-spinner > span:nth-child(6) {
  transform: rotate(225deg);
  animation-delay: -0.3s;
}

.lg-spinner > span:nth-child(7) {
  transform: rotate(270deg);
  animation-delay: -0.2s;
}

.lg-spinner > span:nth-child(8) {
  transform: rotate(315deg);
  animation-delay: -0.1s;
}

@keyframes lg-spinner {
  0% {
    opacity: 0.05;
  }
  12.5% {
    opacity: 0.6;
  }
  100% {
    opacity: 0.05;
  }
}

/* Where colours are forced, as in Windows' high contrast, backgrounds are
   taken away and with them the tick, the dot and the bar's fill: the box and
   the buttons are the browser's own again, and the bar is drawn in the
   system's colours. */
@media (forced-colors: active) {
  .lg-checkbox,
  .lg-radio input {
    appearance: auto;
    -webkit-appearance: auto;
    background: none;
    box-shadow: none;
  }

  .lg-progress {
    border: 1px solid CanvasText;
    forced-color-adjust: none;
    background: Canvas;
  }

  /* The lit option is told from the rest by the system's own colours, and
     the list from the page by an edge. */
  .lg-combobox-card {
    border: 1px solid CanvasText;
    background: Canvas;
  }

  .lg-combobox-option[data-active] {
    forced-color-adjust: none;
    color: HighlightText;
    background: Highlight;
  }

  .lg-progress-fill {
    background: Highlight;
  }

  /* A switch, a slider and a row of segments or tabs say what they're set to
     with fills and shadows, which the system's colours would take away. They
     keep their own, inside an edge of the system's. */
  .lg-switch,
  .lg-slider,
  .lg-segmented,
  .lg-tab-bar {
    forced-color-adjust: none;
  }

  .lg-switch,
  .lg-segmented,
  .lg-tab-bar {
    outline: 1px solid ButtonText;
  }

  .lg-switch:focus-visible {
    outline: 2px solid Highlight;
  }

  /* What's inside them is left as drawn too, so its focus ring is named here. */
  .lg-tab:focus-visible,
  .lg-slider:has(input:focus-visible) .lg-slider-thumb {
    outline-color: Highlight;
  }
}

/* Glass on glass */

/* Glass on glass (see glassUnder) is a faint layer on the glass under it,
   with its own rim and edge: that glass is what's behind it, not the page.
   Last, and doubled, to come after each component's own glass and before a
   page's. */
.lg-glass.lg-glass[data-within] {
  --lg-glass: var(--lg-within);
  --lg-glass-active: var(--lg-within-active);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* A segmented control's track is that layer too, grey enough there for its thumb. */
.lg-segmented > .lg-tab-bar-glass[data-within] {
  background-image: var(--lg-rim, none);
}
