/* Liquid Glass material for the PUBLIC website only (templates in app/modules/site/templates/site).
   The staff software does not load this file.

   Copied and trimmed from the Liquid Glass Universal skill (assets/web/liquid-glass.css v1.0.0, plus the v1.1.0
   pop-up button, website nav links, menu, hover lens and press/hover states): base,
   material, scroll edge effect, materialize animations and states. Component classes the site does not
   use were left out. Needs lg-tokens.css (generated: python scripts/export_tokens.py --format css) and
   is paired with lg-glass.js (the runtime, copied unchanged).

   FIDELITY TIERS (foundations section 9)
   - Tier A, real lens: Chromium browsers (Chrome, Edge, Opera, Brave, Samsung Internet, WebView). lg-glass.js
     builds a displacement map per surface and sets backdrop-filter: url(#lens), so the page bends at the
     rim of the header capsule and of the phone action bar (the two surfaces marked data-lg-lens).
   - Tier C, frosted glass: Safari and every iOS browser, and Firefox. They cannot draw SVG filters in
     backdrop-filter, so the runtime leaves the CSS below in place: blur + saturation x1.8 + tint + the
     asymmetric 1 px rim + size-based shadow. No lens; this is the intended look there.
   - Tier E, solid: prefers-reduced-transparency (Chromium), prefers-contrast: more, forced-colors, or
     <html data-lg-transparency="reduced"> / data-contrast="more". Tint goes to .92/.95, the lens is
     removed, a 1 px border appears with increased contrast. Reduced motion turns springs into short fades.

   All rules sit in cascade layers, so the unlayered rules in site.css always win without !important. */

@layer lg.base, lg.material, lg.components, lg.states;

@property --lg-glow { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --lg-rim-angle { syntax: "<angle>"; inherits: true; initial-value: 135deg; }

/* ============================================================== base */
@layer lg.base {
  .lg-app {
    margin: 0;
    min-height: 100dvh;
    background: var(--lg-color-system-grouped-background);
    color: var(--lg-color-label);
    font-family: var(--lg-font-family);
    font-size: var(--lg-font-body-size);
    line-height: var(--lg-font-body-line);
    letter-spacing: var(--lg-font-body-tracking);
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-tap-highlight-color: transparent;
  }
  .lg-app *, .lg-app *::before, .lg-app *::after { box-sizing: border-box; }

  /* Thin, quiet scroll bars (the default Windows bar looks dated next to glass). The viewport's bar
     takes its style from the root element, hence :root:has(). Standard props: Chromium 121+, Firefox. */
  :root:has(> body.lg-app), .lg-app * {
    scrollbar-width: thin;
    scrollbar-color: var(--lg-color-tertiary-label) transparent;
  }
  @supports not (scrollbar-color: auto) {
    .lg-app ::-webkit-scrollbar { width: 10px; height: 10px; }
    .lg-app ::-webkit-scrollbar-track { background: transparent; }
    .lg-app ::-webkit-scrollbar-thumb {
      background: var(--lg-color-tertiary-label);
      border: 3px solid transparent;
      border-radius: 999px;
      background-clip: content-box;
    }
  }
  .lg-app :where(button, input, select, textarea) { font: inherit; letter-spacing: inherit; color: inherit; }
  .lg-app :where(svg) { flex: none; }

  /* Text styles (iOS "Large" sizes, Inter tracking). */
  .lg-text-large-title { font-size: var(--lg-font-large-title-size); line-height: var(--lg-font-large-title-line); font-weight: var(--lg-font-large-title-nav-weight); letter-spacing: var(--lg-font-large-title-tracking); }
  .lg-text-title1 { font-size: var(--lg-font-title1-size); line-height: var(--lg-font-title1-line); font-weight: var(--lg-font-title1-weight-emphasized); letter-spacing: var(--lg-font-title1-tracking); }
  .lg-text-title2 { font-size: var(--lg-font-title2-size); line-height: var(--lg-font-title2-line); font-weight: var(--lg-font-title2-weight-emphasized); letter-spacing: var(--lg-font-title2-tracking); }
  .lg-text-title3 { font-size: var(--lg-font-title3-size); line-height: var(--lg-font-title3-line); font-weight: var(--lg-font-title3-weight-emphasized); letter-spacing: var(--lg-font-title3-tracking); }
  .lg-text-headline { font-size: var(--lg-font-headline-size); line-height: var(--lg-font-headline-line); font-weight: var(--lg-font-headline-weight); letter-spacing: var(--lg-font-headline-tracking); }
  .lg-text-body { font-size: var(--lg-font-body-size); line-height: var(--lg-font-body-line); font-weight: var(--lg-font-body-weight); letter-spacing: var(--lg-font-body-tracking); }
  .lg-text-callout { font-size: var(--lg-font-callout-size); line-height: var(--lg-font-callout-line); letter-spacing: var(--lg-font-callout-tracking); }
  .lg-text-subheadline { font-size: var(--lg-font-subheadline-size); line-height: var(--lg-font-subheadline-line); letter-spacing: var(--lg-font-subheadline-tracking); }
  .lg-text-footnote { font-size: var(--lg-font-footnote-size); line-height: var(--lg-font-footnote-line); letter-spacing: var(--lg-font-footnote-tracking); }
  .lg-text-caption1 { font-size: var(--lg-font-caption1-size); line-height: var(--lg-font-caption1-line); letter-spacing: var(--lg-font-caption1-tracking); }
  .lg-text-caption2 { font-size: var(--lg-font-caption2-size); line-height: var(--lg-font-caption2-line); letter-spacing: var(--lg-font-caption2-tracking); }
  .lg-text-hero { font-size: var(--lg-font-hero-number-size); line-height: var(--lg-font-hero-number-line); font-weight: var(--lg-font-hero-number-weight); letter-spacing: var(--lg-font-hero-number-tracking); font-variant-numeric: tabular-nums; }
  .lg-secondary { color: var(--lg-color-secondary-label); }
  .lg-tertiary { color: var(--lg-color-tertiary-label); }
  .lg-tabular { font-variant-numeric: tabular-nums; }
  .lg-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
}

/* ============================================================== material */
@layer lg.material {
  /* Every glass surface. Size S/M/L and variants only change the private --_ variables. */
  .lg-glass,
  .lg-btn--glass, .lg-btn--prominent, .lg-btn--clear, .lg-icon-btn,
  .lg-tabbar, .lg-tabbar-search, .lg-accessory, .lg-toolbar__group, .lg-search, .lg-fab, .lg-cluster,
  .lg-composer, .lg-toast, .lg-menu, .lg-popover, .lg-sheet, .lg-alert, .lg-sidebar, .lg-navbar__title-pill {
    --_tint: var(--lg-glass-tint);
    --_blur: var(--lg-glass-frost-m);
    --_sat: var(--lg-glass-saturation);
    --_bright: var(--lg-glass-brightness);
    --_shadow: var(--lg-shadow-glass-m);
    --_hi: var(--lg-glass-rim-highlight);
    --_sh: var(--lg-glass-rim-shade);
    --_sheen: 0.08;
    position: relative;
    isolation: isolate;
    background-color: var(--_tint);
    background-image: linear-gradient(to bottom, rgb(255 255 255 / var(--_sheen)), rgb(255 255 255 / 0) 45%);
    -webkit-backdrop-filter: blur(var(--_blur)) saturate(var(--_sat)) brightness(var(--_bright));
    backdrop-filter: blur(var(--_blur)) saturate(var(--_sat)) brightness(var(--_bright));
    box-shadow: 0 0 0 1px var(--lg-glass-border), var(--_shadow);
    color: var(--lg-color-label);
    transition: background-color var(--lg-dur-light-dark-flip) ease, color var(--lg-dur-light-dark-flip) ease,
                scale var(--lg-dur-release) var(--lg-ease-release);
  }
  /* Specular rim: bright where the edge faces the light (top-left), faint on the opposite edge. */
  :is(.lg-glass, .lg-btn--glass, .lg-btn--prominent, .lg-btn--clear, .lg-icon-btn, .lg-tabbar, .lg-tabbar-search,
      .lg-accessory, .lg-toolbar__group, .lg-search, .lg-fab, .lg-cluster, .lg-composer, .lg-toast, .lg-menu,
      .lg-popover, .lg-sheet, .lg-alert, .lg-sidebar, .lg-navbar__title-pill)::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: var(--lg-glass-rim-width);
    background: linear-gradient(var(--lg-rim-angle),
      rgb(var(--lg-glass-rim-color) / var(--_hi)) 0%,
      rgb(var(--lg-glass-rim-color) / calc(var(--_hi) * 0.3)) 28%,
      rgb(var(--lg-glass-rim-color) / 0) 50%,
      rgb(var(--lg-glass-rim-color) / calc(var(--_sh) * 0.4)) 72%,
      rgb(var(--lg-glass-rim-color) / var(--_sh)) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    pointer-events: none;
  }
  /* Interaction illumination (driven by --lg-glow and --lg-glow-x/y from liquid-glass.js). */
  :is(.lg-glass, .lg-btn--glass, .lg-btn--prominent, .lg-btn--clear, .lg-icon-btn, .lg-tabbar, .lg-tabbar-search,
      .lg-accessory, .lg-toolbar__group, .lg-search, .lg-fab, .lg-cluster, .lg-composer)::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(var(--lg-press-glow-radius) circle at var(--lg-glow-x, 50%) var(--lg-glow-y, 50%),
      rgb(255 255 255 / calc(var(--lg-press-glow-opacity) * var(--lg-glow))), rgb(255 255 255 / 0) 100%);
    mix-blend-mode: plus-lighter;
    transition: --lg-glow 300ms ease-out;
  }

  /* Opt-in gel press + glow for the site's own controls (data-lg-press="glass", skill v1.1.0). */
  [data-lg-press="glass"] { position: relative; isolation: isolate; }
  [data-lg-press="glass"]::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: radial-gradient(var(--lg-press-glow-radius) circle at var(--lg-glow-x, 50%) var(--lg-glow-y, 50%),
      rgb(255 255 255 / calc(var(--lg-press-glow-opacity) * var(--lg-glow))), rgb(255 255 255 / 0) 100%);
    mix-blend-mode: plus-lighter;
    transition: --lg-glow 300ms ease-out;
  }

  /* Size classes */
  .lg-glass--s, .lg-icon-btn, .lg-btn--glass, .lg-btn--prominent, .lg-btn--clear {
    --_blur: var(--lg-glass-frost-s);
    --_shadow: var(--lg-shadow-glass-s);
  }
  .lg-glass--m { --_blur: var(--lg-glass-frost-m); --_shadow: var(--lg-shadow-glass-m); }
  .lg-glass--l, .lg-menu, .lg-popover, .lg-sheet, .lg-alert, .lg-sidebar {
    --_tint: var(--lg-glass-tint-l);
    --_blur: var(--lg-glass-frost-l);
    --_shadow: var(--lg-shadow-glass-l);
    --_hi: calc(var(--lg-glass-rim-highlight) * 0.9);
    --_sh: calc(var(--lg-glass-rim-shade) * 0.9);
  }
  /* With the JS lens active the blur is done inside the SVG filter; keep the CSS fallback values. */
  [data-lg-lens-active] { --_blur: var(--lg-glass-blur-m); }

  /* Variants */
  .lg-glass--clear, .lg-btn--clear {
    --_tint: var(--lg-glass-clear-tint);
    --_sat: var(--lg-glass-clear-saturation);
    --_blur: 2px;
    --_hi: 0.7;
    --_sh: 0.25;
    --_sheen: 0;
    color: #FFFFFF;
  }
  .lg-glass--tinted {
    --_tint: color-mix(in srgb, var(--lg-color-accent) calc(var(--lg-glass-tinted-alpha) * 100%), transparent);
    --_hi: 0.45; --_sh: 0.15;
    color: var(--lg-color-on-accent);
  }
  .lg-glass--prominent, .lg-btn--prominent {
    --_tint: color-mix(in srgb, var(--lg-color-accent) calc(var(--lg-glass-prominent-alpha) * 100%), transparent);
    --_hi: 0.4; --_sh: 0.12; --_sheen: 0.10;
    color: var(--lg-color-on-accent);
  }
  .lg-btn--prominent.lg-btn--destructive {
    --_tint: color-mix(in srgb, var(--lg-color-destructive) calc(var(--lg-glass-prominent-alpha) * 100%), transparent);
  }

  /* Adaptive tone: set by liquid-glass.js from the content under the glass (S/M glass only). */
  [data-lg-tone="dark"]:is(.lg-glass, .lg-btn--glass, .lg-icon-btn, .lg-tabbar, .lg-tabbar-search, .lg-accessory,
    .lg-toolbar__group, .lg-search, .lg-fab, .lg-cluster, .lg-composer, .lg-navbar__title-pill) {
    --_tint: var(--lg-glass-tint-on-dark);
    --_sheen: 0.03;
    --lg-color-label: var(--lg-label-on-dark);
    --lg-color-secondary-label: var(--lg-secondary-label-on-dark);
    --lg-glass-selection: rgb(255 255 255 / 0.122);
    color-scheme: dark;
  }
  [data-lg-tone="light"]:is(.lg-glass, .lg-btn--glass, .lg-icon-btn, .lg-tabbar, .lg-tabbar-search, .lg-accessory,
    .lg-toolbar__group, .lg-search, .lg-fab, .lg-cluster, .lg-composer, .lg-navbar__title-pill) {
    --_tint: var(--lg-glass-tint-on-light);
    --_sheen: 0.08;
    --lg-color-label: var(--lg-label-on-light);
    --lg-color-secondary-label: var(--lg-secondary-label-on-light);
    --lg-glass-selection: rgb(0 0 0 / 0.102);
    color-scheme: light;
  }

  /* Media dim layer under clear glass over bright media (HIG: 35%). Put it on the media container. */
  /* ::before paints under the (positioned) controls that follow it. --bottom concentrates the dim
     where controls sit and keeps the rest of the media bright. */
  .lg-media-dim { position: relative; }
  .lg-media-dim::before { content: ""; position: absolute; inset: 0; background: var(--lg-color-media-dim); pointer-events: none; transition: opacity 200ms; }
  .lg-media-dim--bottom::before { background: linear-gradient(to top, var(--lg-color-media-dim) 0%, var(--lg-color-media-dim) 30%, transparent 75%); }
  .lg-media-dim[data-lg-dim="off"]::before { opacity: 0; }

  /* Windows High Contrast / forced colors: no glass at all. */
  @media (forced-colors: active) {
    :is(.lg-glass, .lg-btn--glass, .lg-btn--prominent, .lg-btn--clear, .lg-icon-btn, .lg-tabbar, .lg-tabbar-search,
        .lg-accessory, .lg-toolbar__group, .lg-search, .lg-fab, .lg-cluster, .lg-composer, .lg-toast, .lg-menu,
        .lg-popover, .lg-sheet, .lg-alert, .lg-sidebar, .lg-navbar__title-pill) {
      background: Canvas; color: CanvasText; backdrop-filter: none; -webkit-backdrop-filter: none;
      border: 1px solid CanvasText; box-shadow: none;
    }
    :is(.lg-glass, .lg-btn--glass, .lg-icon-btn, .lg-tabbar, .lg-menu, .lg-sheet, .lg-alert)::before,
    :is(.lg-glass, .lg-btn--glass, .lg-icon-btn, .lg-tabbar)::after { display: none; }
    .lg-btn--prominent { background: Highlight; color: HighlightText; }
  }
}

/* ============================================================== components (only what the site uses) */
@layer lg.components {


  .lg-scroll-edge {
    --_edge-bg: var(--lg-edge-bg, var(--lg-color-system-grouped-background));
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 40;
    height: calc(var(--lg-scroll-edge-soft-height) + env(safe-area-inset-top, 0px));
    pointer-events: none;
    opacity: calc(var(--lg-edge, 0) * var(--lg-scroll-edge-soft-opacity) / 0.85);
    background: linear-gradient(to bottom, var(--_edge-bg) 0%, color-mix(in srgb, var(--_edge-bg) 75%, transparent) 45%, transparent 100%);
    -webkit-backdrop-filter: blur(var(--lg-scroll-edge-soft-blur));
    backdrop-filter: blur(var(--lg-scroll-edge-soft-blur));
    -webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent);
    mask-image: linear-gradient(to bottom, #000 35%, transparent);
  }
  .lg-scroll-edge--hard {
    height: calc(var(--lg-scroll-edge-hard-height) + env(safe-area-inset-top, 0px));
    background: color-mix(in srgb, var(--_edge-bg) 92%, transparent);
    -webkit-backdrop-filter: blur(var(--lg-scroll-edge-hard-blur));
    backdrop-filter: blur(var(--lg-scroll-edge-hard-blur));
    -webkit-mask-image: linear-gradient(to bottom, #000 80%, rgb(0 0 0 / 0.7));
    mask-image: linear-gradient(to bottom, #000 80%, rgb(0 0 0 / 0.7));
  }
  .lg-scroll-edge--bottom {
    inset: auto 0 0 0;
    height: calc(var(--lg-scroll-edge-soft-height) + 40px + env(safe-area-inset-bottom, 0px));
    opacity: var(--lg-edge-bottom, 1);
    background: linear-gradient(to top, var(--_edge-bg) 0%, color-mix(in srgb, var(--_edge-bg) 60%, transparent) 40%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, #000 30%, transparent);
    mask-image: linear-gradient(to top, #000 30%, transparent);
  }

  /* ===== added from the skill v1.1.2: pop-up button, website nav links, menu, hover lens ===== */
  /* ---------- pop-up button (components.md §33): replaces the browser's drop-down list of a <select> ---------- */
  .lg-popup-native {          /* the real <select> stays in the form, invisible and out of the tab order */
    position: absolute !important; width: 1px !important; height: 1px !important; margin: 0 !important;
    opacity: 0 !important; pointer-events: none !important; clip-path: inset(50%) !important;
  }
  .lg-popup {
    appearance: none; margin: 0; border: 0;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; min-height: 44px; padding: 0 12px 0 14px;
    border-radius: 12px;
    background: var(--lg-color-tertiary-system-fill);
    color: var(--lg-color-label);
    font: inherit; font-size: var(--lg-font-body-size); line-height: var(--lg-font-body-line);
    letter-spacing: var(--lg-font-body-tracking); text-align: start;
    cursor: pointer; user-select: none; touch-action: manipulation;
    transition: background-color 250ms ease-out;
  }
  .lg-popup__value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lg-popup__value.is-placeholder { color: var(--lg-color-placeholder-text); }
  .lg-popup__chevrons { width: 12px; height: 18px; flex: none; color: var(--lg-color-secondary-label); }
  @media (hover: hover) { .lg-popup:hover { background: var(--lg-color-secondary-system-fill); } }
  .lg-popup:is(:active, [data-lg-pressed], [aria-expanded="true"]) { background: var(--lg-color-system-fill); transition-duration: 0ms; }
  .lg-popup:focus-visible { outline: 2px solid var(--lg-color-accent); outline-offset: 2px; }
  .lg-popup[aria-invalid="true"] { outline: 2px solid var(--lg-color-destructive); outline-offset: 2px; }
  .lg-popup:disabled { opacity: 0.45; cursor: default; }
  .lg-menu--listbox { max-width: min(480px, calc(100vw - 16px)); }
  /* Rows as measured on iOS 26 (44 pt row): checkmark ink ≈ 10.5 pt with a 1.9 pt stroke, 19 pt from the list
     edge, text 36.5 pt from the edge; the checkmark sits on the text baseline in the label color. */
  .lg-menu--listbox .lg-menu__item { gap: var(--lg-size-menu-check-gap); padding-inline: var(--lg-size-menu-item-padding-start) 16px; }
  .lg-menu__item .lg-popup__check {
    width: var(--lg-size-menu-check-size); height: var(--lg-size-menu-check-size);
    flex: none; visibility: hidden; color: var(--lg-color-label); translate: 0 0.5px; overflow: visible;
  }
  .lg-menu__item[aria-selected="true"] .lg-popup__check { visibility: visible; }
  .lg-menu__item:disabled { color: var(--lg-color-tertiary-label); cursor: default; }
  .lg-popup__option { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* ---------- website navigation links on a glass capsule (components.md §32) ---------- */
  .lg-navlinks { position: relative; display: flex; align-items: center; gap: 2px; }
  .lg-navlinks--vertical { flex-direction: column; align-items: stretch; }
  .lg-navlinks__item {
    position: relative; z-index: 1;
    appearance: none; margin: 0; border: 0; background: none;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 36px; padding: 0 14px;
    border-radius: var(--lg-radius-capsule);
    color: var(--lg-color-label);
    font: inherit; font-size: var(--lg-font-subheadline-size); line-height: 1;
    font-weight: 600; letter-spacing: var(--lg-font-subheadline-tracking);
    text-decoration: none; white-space: nowrap;
    cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  }
  .lg-navlinks--vertical .lg-navlinks__item { justify-content: flex-start; min-height: 44px; }
  .lg-navlinks__item:hover { color: var(--lg-color-label); text-decoration: none; }
  .lg-navlinks__item:focus-visible { outline: 2px solid var(--lg-color-accent); outline-offset: -2px; }
  .lg-navlinks__lens, .lg-navlinks__hover {
    position: absolute; left: 0; top: 0; z-index: 0;
    list-style: none; margin: 0; padding: 0;
    width: var(--_w, 0px); height: var(--_h, 0px);
    translate: var(--_x, 0px) var(--_y, 0px);
    border-radius: var(--lg-radius-capsule);
    pointer-events: none;
    transition: translate var(--lg-dur-lens) var(--lg-ease-lens), width var(--lg-dur-lens) var(--lg-ease-lens),
                height var(--lg-dur-lens) var(--lg-ease-lens), scale var(--lg-dur-release) var(--lg-ease-release),
                opacity 160ms linear, background-color 160ms linear, box-shadow 160ms linear;
  }
  .lg-navlinks__lens { background: var(--lg-glass-selection); opacity: 0; }
  .lg-navlinks__lens.is-placed { opacity: 1; }
  .lg-navlinks__hover { background: color-mix(in srgb, var(--lg-glass-selection) 70%, transparent); opacity: 0; }
  .lg-navlinks__hover.is-visible { opacity: 1; }
  .lg-navlinks__lens.is-instant, .lg-navlinks__hover.is-instant { transition: opacity 160ms linear; }
  /* Pressed: the pill under the finger/pointer lifts into clear glass (same recipe as the tab bar lens). */
  .lg-navlinks__lens.is-lifted, .lg-navlinks__hover.is-lifted {
    opacity: 1;
    scale: var(--_lift, 1.08);
    background: rgb(255 255 255 / 0.3);
    background: light-dark(rgb(255 255 255 / 0.34), rgb(255 255 255 / 0.16));
    box-shadow: inset 1px 1px 0 rgb(255 255 255 / 0.85), inset -1px -1px 0 rgb(255 255 255 / 0.3),
                0 0 0 0.5px rgb(0 0 0 / 0.06), 0 1px 3px rgb(0 0 0 / 0.08), 0 6px 18px rgb(0 0 0 / 0.14);
    -webkit-backdrop-filter: saturate(1.8) brightness(1.04);
    backdrop-filter: saturate(1.8) brightness(1.04);
    transition: translate var(--lg-dur-lens) var(--lg-ease-lens), width var(--lg-dur-lens) var(--lg-ease-lens),
                scale var(--lg-dur-press) var(--lg-ease-press), opacity 80ms linear, background-color 80ms linear;
  }

  /* ---------- menu & popover (Popover API; positioned by JS) ---------- */
  .lg-menu, .lg-popover {
    position: fixed; inset: auto; margin: 0;
    border: 0;
    color: var(--lg-color-label);
    overflow: auto;
    overscroll-behavior: contain;
  }
  .lg-menu {
    display: none;
    flex-direction: column;
    min-width: var(--lg-size-menu-min-width); max-width: var(--lg-size-menu-max-width);
    max-height: 70vh;
    padding: var(--lg-size-menu-padding);
    border-radius: var(--lg-radius-menu);
  }
  .lg-menu:popover-open, .lg-menu.is-open { display: flex; }
  /* Menu edge, measured from an iOS 26 menu (tokens glass.menuEdge): an even bright rim just inside the edge,
     a short inner glow, and a thin dark hairline just outside — not the directional rim of bars. */
  .lg-menu {
    --_shadow: var(--lg-shadow-menu);   /* lighter than glass L: the measured menu has almost no shade at its edge */
    box-shadow: 0 0 0 0.5px var(--lg-menu-hairline), 0 0 0 1px var(--lg-glass-border),
      inset 0 0 3px rgb(255 255 255 / calc(var(--lg-menu-rim) * 0.5)), var(--_shadow);
  }
  .lg-menu::before { background: rgb(var(--lg-glass-rim-color) / var(--lg-menu-rim)); }
  .lg-menu__item {
    appearance: none; margin: 0; border: 0; background: none;
    display: flex; align-items: center; gap: var(--lg-space-3);
    width: 100%; min-height: var(--lg-size-menu-row-height);
    padding: 0 var(--lg-space-3);
    border-radius: 12px;
    color: inherit; text-align: start; font-size: var(--lg-font-body-size);
    cursor: pointer;
  }
  .lg-menu__item svg { width: var(--lg-size-menu-icon-size); height: var(--lg-size-menu-icon-size); flex: none; }
  .lg-menu__item:hover, .lg-menu__item:focus-visible { background: var(--lg-color-tertiary-system-fill); outline: none; }
  .lg-menu__item--destructive { color: var(--lg-color-destructive); }
  .lg-menu__item[aria-checked="true"]::after { content: "✓"; margin-inline-start: auto; color: var(--lg-color-label); }
  .lg-menu__header { padding: 8px 12px 4px; font-size: var(--lg-font-footnote-size); color: var(--lg-color-secondary-label); }
  .lg-menu__separator { height: 6px; margin: 4px calc(-1 * var(--lg-size-menu-padding)); background: color-mix(in srgb, var(--lg-color-separator) 50%, transparent); border: 0; }
  .lg-popover { display: none; width: min(320px, calc(100vw - 32px)); padding: 16px 20px; border-radius: var(--lg-radius-popover); }
  .lg-popover:popover-open, .lg-popover.is-open { display: block; }
  :is(.lg-menu, .lg-popover)::backdrop { background: transparent; }

  /* ---------- hover lens (components.md §31; driven by liquid-glass.js, one shared element) ---------- */
  .lg-hover-lens {
    --_rim-angle: 135deg;
    --_glow: 0.11;
    position: fixed; left: 0; top: 0; z-index: 850;
    display: none;
    pointer-events: none;
    border-radius: 999px;
    background-color: var(--lg-hover-lens-tint);
    -webkit-backdrop-filter: blur(var(--lg-hover-lens-blur)) saturate(var(--lg-hover-lens-saturation)) brightness(var(--lg-hover-lens-brightness));
    backdrop-filter: blur(var(--lg-hover-lens-blur)) saturate(var(--lg-hover-lens-saturation)) brightness(var(--lg-hover-lens-brightness));
    box-shadow: var(--lg-shadow-hover-lens);
    transform-origin: 50% 50%;
    will-change: transform, opacity;
    opacity: 0;
  }
  .lg-hover-lens.is-on { display: block; }
  .lg-hover-lens::before {           /* specular rim, turned toward the pointer by <= 10deg */
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    padding: var(--lg-glass-rim-width);
    background: linear-gradient(var(--_rim-angle),
      rgb(255 255 255 / var(--lg-hover-lens-rim-highlight)) 0%,
      rgb(255 255 255 / calc(var(--lg-hover-lens-rim-highlight) * 0.3)) 28%,
      rgb(255 255 255 / 0) 50%,
      rgb(255 255 255 / calc(var(--lg-hover-lens-rim-shade) * 0.4)) 72%,
      rgb(255 255 255 / var(--lg-hover-lens-rim-shade)) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  }
  .lg-hover-lens::after {            /* glow where the pointer is */
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    background: radial-gradient(var(--lg-hover-lens-glow-radius) circle at var(--lg-glow-x, 50%) var(--lg-glow-y, 50%),
      rgb(255 255 255 / var(--_glow)), rgb(255 255 255 / 0) 100%);
    mix-blend-mode: plus-lighter;
  }

  /* ---------- animations ---------- */
  .lg-materialize { animation: lg-materialize var(--lg-dur-materialize) var(--lg-ease-standard) both; }
  .lg-dematerialize { animation: lg-dematerialize var(--lg-dur-dematerialize) var(--lg-ease-accelerate) both; }
}

@keyframes lg-materialize {
  from {
    opacity: 0; scale: 0.96;
    -webkit-backdrop-filter: blur(0px) saturate(1) brightness(1);
    backdrop-filter: blur(0px) saturate(1) brightness(1);
  }
  45% { opacity: 1; }
}
@keyframes lg-dematerialize {
  to {
    opacity: 0; scale: 0.98;
    -webkit-backdrop-filter: blur(0px) saturate(1) brightness(1);
    backdrop-filter: blur(0px) saturate(1) brightness(1);
  }
}
@keyframes lg-fade-in { from { opacity: 0; } }
@keyframes lg-fade-out { to { opacity: 0; } }
@keyframes lg-spin { to { rotate: 1turn; } }

/* ============================================================== states */
@layer lg.states {
  /* Focus rings: 2 px accent, offset 2, follows the control's radius (concentric). */
  :is(.lg-btn, .lg-icon-btn, .lg-bar-btn, .lg-tab, .lg-tabbar-search, .lg-segmented__option, .lg-fab, .lg-close-btn, .lg-menu__item):focus-visible {
    outline: 2px solid var(--lg-color-accent);
    outline-offset: 2px;
  }
  .lg-segmented__option:focus-visible, .lg-tab:focus-visible { outline-offset: -2px; }

  /* ===== added from the skill v1.1.0: press and hover states ===== */
  /* Press states for the content layer (LG-60): every link, button, row and card answers a press.
     data-lg-press = "highlight" (rows, list items: fill), "dim" (text links, plain buttons: fade),
     "scale" (tappable cards/tiles: shrink a little), "glass" (glass gel flex + glow, see liquid-glass.js). */
  [data-lg-press="highlight"] { transition: background-color 300ms ease-out; }
  [data-lg-press="highlight"]:is(:active, [data-lg-pressed]) { background-color: var(--lg-color-tertiary-system-fill); transition-duration: 0ms; }
  @media (hover: hover) { [data-lg-press="highlight"]:hover { background-color: var(--lg-color-quaternary-system-fill); } }
  :is([data-lg-press="dim"], .lg-btn--plain) { transition: opacity 220ms ease-out; }
  :is([data-lg-press="dim"], .lg-btn--plain):is(:active, [data-lg-pressed]) { opacity: 0.45; transition-duration: 0ms; }
  [data-lg-press="scale"] { transition: scale var(--lg-dur-release) var(--lg-ease-release); }
  [data-lg-press="scale"]:is(:active, [data-lg-pressed]) { scale: 0.97; transition: scale var(--lg-dur-press) var(--lg-ease-press); }
  :is(a, button).lg-row[data-lg-pressed] { background: var(--lg-color-tertiary-system-fill); transition-duration: 0ms; }

  /* Hover. With the hover lens on a control, the control's own rim steps back so only one rim shows;
     without it (or with Reduce Transparency / Increase Contrast, where no lens is drawn) the plain hover
     state applies: glass +0.06 white, rim +0.1 (components.md §9). */
  [data-lg-hover-lens]::before { transition: opacity 160ms linear; }
  [data-lg-hover-lens-active]::before { opacity: 0; }
  @media (hover: hover) {
    :is(.lg-btn--glass, .lg-btn--clear, .lg-btn--prominent, .lg-icon-btn, .lg-fab, .lg-tabbar-search):hover:not([data-lg-hover-lens-active], :disabled) {
      background-image: linear-gradient(rgb(255 255 255 / 0.06) 0 0),
        linear-gradient(to bottom, rgb(255 255 255 / var(--_sheen)), rgb(255 255 255 / 0) 45%);
    }
    :is(.lg-btn--glass, .lg-icon-btn, .lg-fab, .lg-tabbar-search):hover:not([data-lg-hover-lens-active], :disabled) {
      --_hi: calc(var(--lg-glass-rim-highlight) + 0.1);
    }
  }

  /* --lg-glow is registered with inherits:false, so it must be set on the pseudo-element itself. */
  [data-lg-pressed]::after { --lg-glow: 1; transition-duration: 80ms; }

  /* Increased contrast: thicker focus ring, visible separators. */
  @media (prefers-contrast: more) {
    :root:not([data-contrast="normal"]) :is(.lg-btn, .lg-icon-btn, .lg-tab, .lg-segmented__option):focus-visible { outline-width: 3px; }
    :root:not([data-contrast="normal"]) .lg-segmented__thumb { box-shadow: 0 0 0 1px var(--lg-color-label); }
  }
  :root[data-contrast="more"] :is(.lg-btn, .lg-icon-btn, .lg-tab, .lg-segmented__option):focus-visible { outline-width: 3px; }
  :root[data-contrast="more"] .lg-segmented__thumb { box-shadow: 0 0 0 1px var(--lg-color-label); }

  /* Reduced motion: no movement, short cross-fades (also via <html data-lg-motion="reduced">). */
  @media (prefers-reduced-motion: reduce) {
    :root:not([data-lg-motion="full"]) {
      --lg-dur-lens: 0ms; --lg-dur-press: 0ms; --lg-dur-release: 0ms; --lg-dur-morph: 0ms;
      --lg-dur-minimize: 0ms; --lg-dur-sheet: 0ms; --lg-dur-snappy: 0ms; --lg-dur-smooth: 0ms; --lg-dur-bouncy: 0ms;
      --lg-dur-materialize: 150ms; --lg-dur-dematerialize: 150ms;
    }
    :root:not([data-lg-motion="full"]) .lg-materialize { animation-name: lg-fade-in; }
    :root:not([data-lg-motion="full"]) .lg-dematerialize { animation-name: lg-fade-out; }
    :root:not([data-lg-motion="full"]) .lg-spinner { animation: none; }
  }
  :root[data-lg-motion="reduced"] {
    --lg-dur-lens: 0ms; --lg-dur-press: 0ms; --lg-dur-release: 0ms; --lg-dur-morph: 0ms;
    --lg-dur-minimize: 0ms; --lg-dur-sheet: 0ms; --lg-dur-snappy: 0ms; --lg-dur-smooth: 0ms; --lg-dur-bouncy: 0ms;
    --lg-dur-materialize: 150ms; --lg-dur-dematerialize: 150ms;
  }
  :root[data-lg-motion="reduced"] .lg-materialize { animation-name: lg-fade-in; }
  :root[data-lg-motion="reduced"] .lg-dematerialize { animation-name: lg-fade-out; }

  /* Continuous (squircle-like) corners where supported (Chromium 139+). superellipse(1.6) ≈ Apple's curve. */
  @supports (corner-shape: superellipse(2)) {
    /* not .lg-menu: measured iOS 26 menus fit a plain circular corner of radius.menu */
    :is(.lg-group, .lg-card, .lg-sheet, .lg-alert, .lg-popover, .lg-sidebar, .lg-row__icon) {
      corner-shape: superellipse(1.6);
    }
  }
}
