/* ==========================================================================
   LIQUID GLASS UI KIT — kit.css
   The whole kit in one file. Drop it into any project:
     <link rel="stylesheet" href="kit.css">
   Every class and variable starts with "lg-", so it never clashes with your CSS.

   THEME: dark is the default. Light site? Put data-theme="light" on <html>.
   Dark site? data-theme="dark". Add class="lg-body" to <body> for the kit's background and text color.
   FONT: optional. Link fonts/inter.css before this file for Inter; otherwise your system font is used.

   1. Design tokens (change the whole kit here)
   2. Light theme
   3. Base + background
   4. Glass panel
   5. Buttons
   6. Form controls
   7. Cards
   8. Navigation
   9. Feedback (alerts, badges, toasts, tooltips)
   10. Overlays (modal, menu, accordion)
   11. Data (avatars, progress, table)
   12. Layout helpers
   13. Accessibility & fallbacks
   ========================================================================== */

/* ---------- 1. Design tokens (dark is the default) ---------- */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --lg-font: "Inter", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;

  /* Shape */
  --lg-radius-sm: 10px;
  --lg-radius: 14px;
  --lg-radius-lg: 22px;
  --lg-pill: 999px;

  /* Glass recipe */
  --lg-blur: 24px;
  --lg-saturate: 170%;

  /* Motion */
  --lg-ease: cubic-bezier(.2, .8, .2, 1);
  --lg-dur: 220ms;

  /* Colors */
  --lg-bg: #0b0d10;
  --lg-blob-1: #17725d;   /* mint */
  --lg-blob-2: #134e63;   /* petrol */
  --lg-blob-3: #233a6b;   /* deep blue */
  --lg-text: #f2f5f4;
  --lg-muted: #bcc6c2;    /* keep muted text on glass or --lg-bg, not straight on the bright blobs */
  --lg-line: rgba(255, 255, 255, .1);            /* dividers */
  --lg-control-edge: rgba(255, 255, 255, .46);   /* input / select outlines (3:1) */

  --lg-glass: rgba(24, 28, 31, .55);
  --lg-glass-soft: rgba(24, 28, 31, .35);
  --lg-glass-strong: rgba(24, 28, 31, .78);
  --lg-glass-solid: #171b1e;          /* used when blur isn't available */
  --lg-edge: rgba(255, 255, 255, .2);
  --lg-edge-2: rgba(255, 255, 255, .03);
  --lg-inner: inset 0 1px 0 rgba(255, 255, 255, .08);
  --lg-shadow: 0 1px 1px rgba(0, 0, 0, .3), 0 18px 44px -14px rgba(0, 0, 0, .65);
  --lg-fill: rgba(255, 255, 255, .07);     /* inputs, chips */
  --lg-track: rgba(255, 255, 255, .16);    /* slider, progress, segmented */
  --lg-hover: rgba(255, 255, 255, .1);
  --lg-seg-on: rgba(255, 255, 255, .2);
  --lg-thumb: #f2f5f4;                     /* switch knob when off */
  --lg-thumb-on: #04140f;                  /* switch knob when on */
  --lg-scrim: rgba(5, 8, 7, .45);          /* behind modals */

  --lg-accent: #3ddbb0;                    /* mint */
  --lg-accent-text: #04140f;
  --lg-accent-soft: rgba(61, 219, 176, .16);
  --lg-accent-ink: #6ee8c6;                /* accent used as text */
  --lg-info: #7cb4ff;
  --lg-success: #4fd6a0;
  --lg-warning: #f6c25b;
  --lg-danger: #ff8a80;
  --lg-focus: #6ee8c6;

  --lg-avatar-1: linear-gradient(135deg, #0e8466, #1d6fa3);
  --lg-avatar-2: linear-gradient(135deg, #6d5bd0, #b0457c);
  --lg-avatar-3: linear-gradient(135deg, #b3580d, #b03a3a);
}

/* ---------- 2. Light theme ---------- */
[data-theme="light"] {
  color-scheme: light;
  --lg-bg: #eef2f0;
  --lg-blob-1: #8fe0c8;
  --lg-blob-2: #9fd3e3;
  --lg-blob-3: #c3d2f6;
  --lg-text: #111615;
  --lg-muted: #4a5551;
  --lg-line: rgba(17, 22, 21, .1);
  --lg-control-edge: rgba(17, 22, 21, .55);

  --lg-glass: rgba(255, 255, 255, .58);
  --lg-glass-soft: rgba(255, 255, 255, .36);
  --lg-glass-strong: rgba(255, 255, 255, .82);
  --lg-glass-solid: #f8faf9;
  --lg-edge: rgba(255, 255, 255, .95);
  --lg-edge-2: rgba(255, 255, 255, .3);
  --lg-inner: inset 0 1px 0 rgba(255, 255, 255, .9);
  --lg-shadow: 0 1px 1px rgba(10, 40, 30, .04), 0 18px 40px -14px rgba(10, 40, 30, .18);
  --lg-fill: rgba(255, 255, 255, .6);
  --lg-track: rgba(17, 22, 21, .14);
  --lg-hover: rgba(17, 22, 21, .06);
  --lg-seg-on: #fff;
  --lg-thumb: #4a5551;
  --lg-thumb-on: #fff;
  --lg-scrim: rgba(20, 30, 26, .35);

  --lg-accent: #0b7a5c;
  --lg-accent-text: #fff;
  --lg-accent-soft: rgba(11, 122, 92, .12);
  --lg-accent-ink: #086148;
  --lg-info: #1d5fc4;
  --lg-success: #0a6c48;
  --lg-warning: #8a5a00;
  --lg-danger: #b42318;
  --lg-focus: #0b7a5c;
}

/* ---------- 3. Base + background ---------- */
/* Predictable sizing for kit components, without touching the rest of your page */
:where([class^="lg-"], [class*=" lg-"]),
:where([class^="lg-"], [class*=" lg-"]) *,
:where([class^="lg-"], [class*=" lg-"])::before,
:where([class^="lg-"], [class*=" lg-"])::after { box-sizing: border-box; }

/* Components carry their own text color and font, so they read right on any page */
:where(.lg-glass, .lg-field, .lg-check, .lg-switch, .lg-segmented, .lg-nav, .lg-tabs, .lg-breadcrumb,
  .lg-pagination, .lg-alert, .lg-badge, .lg-toast, .lg-tooltip, .lg-menu, .lg-progress, .lg-table, .lg-list, .lg-stack) {
  color: var(--lg-text); font-family: var(--lg-font); line-height: 1.4;
}

.lg-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--lg-font);
  color: var(--lg-text);
  background: var(--lg-bg);
  -webkit-font-smoothing: antialiased;
}
/* Glass needs something colorful behind it. Put <div class="lg-backdrop" aria-hidden="true"></div>
   as the first thing in <body>, or use your own photo or gradient. */
.lg-backdrop {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(50% 55% at 8% 6%, var(--lg-blob-1), transparent 70%),
    radial-gradient(45% 60% at 96% 22%, var(--lg-blob-2), transparent 70%),
    radial-gradient(40% 45% at 45% 55%, color-mix(in srgb, var(--lg-blob-1) 55%, transparent), transparent 70%),
    radial-gradient(55% 55% at 70% 108%, var(--lg-blob-3), transparent 70%),
    var(--lg-bg);
}

/* ---------- 4. Glass panel ---------- */
/* The core recipe. Add it to anything: <div class="lg-glass">…</div> */
.lg-glass {
  position: relative;
  background: var(--lg-glass);
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate));
  backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate));
  border-radius: var(--lg-radius-lg);
  box-shadow: var(--lg-inner), var(--lg-shadow);
  isolation: isolate;
}
/* Bright top edge fading out: the "liquid" highlight */
.lg-glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(160deg, var(--lg-edge), var(--lg-edge-2) 45%, var(--lg-edge-2) 70%, var(--lg-edge));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.lg-glass--soft { background: var(--lg-glass-soft); }
.lg-glass--strong { background: var(--lg-glass-strong); }

/* ---------- 5. Buttons ---------- */
.lg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; margin: 0; padding: 0 18px;
  font: 600 .9375rem/1 var(--lg-font); color: var(--lg-text); white-space: nowrap;
  border: 0; border-radius: var(--lg-pill); cursor: pointer; text-decoration: none;
  background: var(--lg-fill);
  box-shadow: inset 0 0 0 1px var(--lg-line);
  -webkit-tap-highlight-color: transparent;
  transition: background var(--lg-dur) var(--lg-ease), transform var(--lg-dur) var(--lg-ease), box-shadow var(--lg-dur) var(--lg-ease);
}
.lg-btn:hover { background: var(--lg-hover); }
.lg-btn:active { transform: scale(.97); }
.lg-btn svg { width: 18px; height: 18px; flex: none; }
.lg-btn--primary {
  background: var(--lg-accent); color: var(--lg-accent-text); box-shadow: 0 8px 20px -8px var(--lg-accent);
}
.lg-btn--primary:hover { background: var(--lg-accent); filter: brightness(1.08); }
.lg-btn--danger { background: var(--lg-danger); color: var(--lg-accent-text); box-shadow: 0 8px 20px -8px var(--lg-danger); }
.lg-btn--danger:hover { background: var(--lg-danger); filter: brightness(1.08); }
.lg-btn--glass {
  background: var(--lg-glass);
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate));
  backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate));
  box-shadow: var(--lg-inner), inset 0 0 0 1px var(--lg-line), 0 6px 18px -8px rgba(0, 0, 0, .4);
}
.lg-btn--ghost { background: transparent; box-shadow: none; }
.lg-btn--ghost:hover { background: var(--lg-hover); }
.lg-btn--icon { width: 40px; padding: 0; }
.lg-btn--sm { min-height: 32px; padding: 0 12px; font-size: .8125rem; }
.lg-btn--sm.lg-btn--icon { width: 32px; }
.lg-btn:disabled, .lg-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
/* Loading: add aria-busy="true" (and disabled) */
.lg-btn[aria-busy="true"] { cursor: progress; }
.lg-btn[aria-busy="true"]:disabled { opacity: .8; }
.lg-btn[aria-busy="true"]::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: lg-spin .7s linear infinite;
}
@keyframes lg-spin { to { transform: rotate(1turn); } }

/* Segmented control: plain radio buttons, no JavaScript */
.lg-segmented {
  display: inline-flex; gap: 2px; padding: 3px; margin: 0; border: 0; min-width: 0;
  border-radius: var(--lg-pill); background: var(--lg-track);
}
.lg-segmented > label { position: relative; }
.lg-segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.lg-segmented span {
  display: block; padding: 7px 14px; border-radius: var(--lg-pill);
  font-size: .875rem; font-weight: 600; color: var(--lg-muted);
  transition: background var(--lg-dur) var(--lg-ease), color var(--lg-dur) var(--lg-ease);
}
.lg-segmented input:checked + span { background: var(--lg-seg-on); color: var(--lg-text); box-shadow: var(--lg-inner), 0 2px 8px rgba(0, 0, 0, .18); }
.lg-segmented input:focus-visible + span { outline: 2px solid var(--lg-focus); outline-offset: 1px; }

/* ---------- 6. Form controls ---------- */
.lg-field { display: grid; gap: 6px; }
.lg-label { font-size: .8125rem; font-weight: 600; color: var(--lg-text); }
.lg-hint { font-size: .8125rem; color: var(--lg-muted); }
.lg-error { font-size: .8125rem; color: var(--lg-danger); }
.lg-input, .lg-select {
  width: 100%; min-height: 42px; margin: 0; padding: 10px 14px;
  font: 400 .9375rem/1.4 var(--lg-font); color: var(--lg-text);
  background: var(--lg-fill); border: 0; border-radius: var(--lg-radius);
  box-shadow: inset 0 0 0 1px var(--lg-control-edge);
  -webkit-appearance: none; appearance: none;
  transition: box-shadow var(--lg-dur) var(--lg-ease), background var(--lg-dur) var(--lg-ease);
}
.lg-input::placeholder { color: var(--lg-muted); opacity: 1; }
.lg-input:hover, .lg-select:hover { background: var(--lg-hover); }
.lg-input:focus, .lg-select:focus { outline: 2px solid transparent; outline-offset: 2px; box-shadow: inset 0 0 0 2px var(--lg-focus), 0 0 0 4px var(--lg-accent-soft); }
.lg-input[aria-invalid="true"], .lg-select[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--lg-danger); }
.lg-input:disabled, .lg-select:disabled { opacity: .5; cursor: not-allowed; }
.lg-input[readonly] { background: transparent; }
.lg-input:-webkit-autofill { -webkit-text-fill-color: var(--lg-text); box-shadow: inset 0 0 0 1px var(--lg-control-edge), inset 0 0 0 100px var(--lg-glass-solid); }
.lg-input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
textarea.lg-input { min-height: 96px; resize: vertical; }
.lg-select {
  padding-right: 40px; cursor: pointer;
  /* chevron color is baked in (#889 works on both themes) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23889' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
.lg-select option { background: var(--lg-glass-solid); color: var(--lg-text); }
/* Search: an input with an icon on the left */
.lg-search { position: relative; }
.lg-search > svg { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--lg-muted); pointer-events: none; }
.lg-search .lg-input { padding-left: 40px; border-radius: var(--lg-pill); }

/* Checkbox and radio: the real inputs, restyled */
.lg-check { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: .9375rem; font-weight: 400; cursor: pointer; }
.lg-check input {
  -webkit-appearance: none; appearance: none; flex: none; width: 20px; height: 20px; margin: 0; padding: 0; border: 0; cursor: pointer;
  border-radius: 6px; background: var(--lg-fill); box-shadow: inset 0 0 0 1.5px var(--lg-muted);
  display: grid; place-content: center;
  transition: background var(--lg-dur) var(--lg-ease), box-shadow var(--lg-dur) var(--lg-ease);
}
.lg-check input[type="radio"] { border-radius: 50%; }
.lg-check input::after {
  content: ""; width: 10px; height: 10px; transform: scale(0); transition: transform var(--lg-dur) var(--lg-ease);
  background: var(--lg-accent-text);
  clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 26%, 86% 12%, 37% 72%);
}
.lg-check input[type="radio"]::after { clip-path: circle(50%); width: 8px; height: 8px; }
.lg-check input:checked { background: var(--lg-accent); box-shadow: none; }
.lg-check input:checked::after { transform: scale(1); }
.lg-check input:focus-visible { outline: 2px solid var(--lg-focus); outline-offset: 2px; }
.lg-check input:disabled, .lg-switch input:disabled { opacity: .5; cursor: not-allowed; }

/* Switch: <input type="checkbox" role="switch"> */
.lg-switch { display: inline-flex; align-items: center; gap: 12px; margin: 0; font-size: .9375rem; font-weight: 400; cursor: pointer; }
.lg-switch input {
  -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 46px; height: 28px; margin: 0; padding: 0; border: 0; cursor: pointer;
  border-radius: var(--lg-pill); background: var(--lg-fill); box-shadow: inset 0 0 0 1.5px var(--lg-muted);
  transition: background var(--lg-dur) var(--lg-ease);
}
.lg-switch input::after {
  content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--lg-thumb); box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
  transition: transform var(--lg-dur) var(--lg-ease), background var(--lg-dur) var(--lg-ease);
}
.lg-switch input:checked { background: var(--lg-accent); box-shadow: none; }
.lg-switch input:checked::after { background: var(--lg-thumb-on); transform: translateX(18px); }
.lg-switch input:focus-visible { outline: 2px solid var(--lg-focus); outline-offset: 2px; }

/* Slider: <input type="range">. kit.js paints the filled part (without it, the track is plain) */
.lg-range { width: 100%; height: 28px; margin: 0; padding: 0; border: 0; -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; --lg-value: 0%; }
.lg-range::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(var(--lg-accent), var(--lg-accent)) 0 / var(--lg-value) 100% no-repeat, var(--lg-track); }
.lg-range::-moz-range-track { height: 6px; border-radius: 99px; background: var(--lg-track); }
.lg-range::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--lg-accent); }
.lg-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(17, 22, 21, .12), 0 2px 8px rgba(0, 0, 0, .35); }
.lg-range::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(17, 22, 21, .12), 0 2px 8px rgba(0, 0, 0, .35); }
.lg-range:focus-visible { outline: 2px solid var(--lg-focus); outline-offset: 4px; border-radius: 8px; }

/* ---------- 7. Cards ---------- */
.lg-card { padding: 22px; display: grid; gap: 10px; align-content: start; }
.lg-card > h3 { margin: 0; font: 650 1.0625rem/1.3 var(--lg-font); letter-spacing: -.01em; color: inherit; }
.lg-card > p { margin: 0; color: var(--lg-muted); font-size: .9375rem; line-height: 1.5; }
.lg-card__icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--lg-accent-soft); color: var(--lg-accent-ink); }
.lg-card__icon svg { width: 20px; height: 20px; }

.lg-stat { padding: 18px 20px; display: grid; gap: 6px; align-content: start; }
.lg-stat__label { font-size: .8125rem; color: var(--lg-muted); }
.lg-stat__value { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.lg-delta { justify-self: start; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 99px; font-size: .75rem; font-weight: 650; color: var(--lg-success); background: color-mix(in srgb, var(--lg-success) 15%, transparent); }
.lg-delta--down { color: var(--lg-danger); background: color-mix(in srgb, var(--lg-danger) 15%, transparent); }

.lg-profile { padding: 24px; display: grid; justify-items: center; align-content: start; gap: 6px; text-align: center; }
.lg-profile > h3 { margin: 8px 0 0; font: 650 1.0625rem/1.3 var(--lg-font); letter-spacing: -.01em; color: inherit; }
.lg-profile > p { margin: 0 0 10px; color: var(--lg-muted); font-size: .875rem; }

.lg-price { padding: 24px; display: grid; gap: 14px; align-content: start; }
.lg-price__name { font-size: .875rem; font-weight: 650; color: var(--lg-accent-ink); }
.lg-price__amount { font-size: 2.5rem; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.lg-price__amount small { font-size: .9375rem; font-weight: 500; color: var(--lg-muted); letter-spacing: 0; }
.lg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .9375rem; }
.lg-list > li { display: flex; gap: 8px; align-items: baseline; }
.lg-list > li::before { content: "✓"; color: var(--lg-accent-ink); font-weight: 700; }

/* ---------- 8. Navigation ---------- */
.lg-nav { display: flex; align-items: center; gap: 16px; padding: 8px 8px 8px 18px; border-radius: var(--lg-pill); }
.lg-nav__brand { font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--lg-text); text-decoration: none; }
.lg-nav__links { display: flex; gap: 2px; margin: 0 0 0 auto; padding: 0; list-style: none; }
.lg-nav__links a { display: block; padding: 8px 12px; border-radius: 99px; color: var(--lg-muted); font-size: .875rem; font-weight: 500; text-decoration: none; }
.lg-nav__links a:hover, .lg-nav__links a[aria-current="page"] { color: var(--lg-text); background: var(--lg-hover); }
@media (max-width: 560px) {
  .lg-nav__links { display: none; }    /* phones: keep the brand and the main button */
  .lg-nav > .lg-btn { margin-left: auto; }
}

/* Tabs: needs kit.js (arrow keys) */
.lg-tabs [role="tablist"] { display: flex; gap: 4px; border-bottom: 1px solid var(--lg-line); overflow-x: auto; scrollbar-width: none; }
.lg-tabs [role="tab"] {
  position: relative; margin: 0; padding: 10px 14px; border: 0; background: none; cursor: pointer; white-space: nowrap;
  font: 600 .875rem var(--lg-font); color: var(--lg-muted); border-radius: 10px 10px 0 0;
}
.lg-tabs [role="tab"]:hover { color: var(--lg-text); }
.lg-tabs [role="tab"][aria-selected="true"] { color: var(--lg-text); }
.lg-tabs [role="tab"][aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; border-radius: 2px; background: var(--lg-accent); }
.lg-tabs [role="tabpanel"] { padding: 16px 2px 2px; color: var(--lg-muted); font-size: .9375rem; line-height: 1.5; }
.lg-tabs [role="tabpanel"]:focus-visible { outline: 2px solid var(--lg-focus); outline-offset: 2px; border-radius: 8px; }

.lg-breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: .875rem; }
.lg-breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--lg-muted); opacity: .6; }
.lg-breadcrumb a { color: var(--lg-muted); text-decoration: none; }
.lg-breadcrumb a:hover { color: var(--lg-text); text-decoration: underline; }
.lg-breadcrumb [aria-current] { color: var(--lg-text); font-weight: 600; }

.lg-pagination ul { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.lg-pagination a {
  display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 6px; border-radius: 10px;
  color: var(--lg-muted); font-size: .875rem; font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums;
}
.lg-pagination a:hover { background: var(--lg-hover); color: var(--lg-text); }
.lg-pagination a[aria-current="page"] { background: var(--lg-accent); color: var(--lg-accent-text); }
.lg-pagination svg { width: 16px; height: 16px; }

/* ---------- 9. Feedback ---------- */
.lg-alert {
  --lg-tone: var(--lg-info);
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--lg-radius);
  background: color-mix(in srgb, var(--lg-tone) 12%, var(--lg-glass));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lg-tone) 35%, transparent);
  font-size: .9375rem; line-height: 1.45;
  -webkit-backdrop-filter: blur(var(--lg-blur)); backdrop-filter: blur(var(--lg-blur));
}
.lg-alert > svg { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--lg-tone); }
.lg-alert strong { display: block; margin-bottom: 2px; }
.lg-alert p { margin: 0; color: var(--lg-muted); }
.lg-alert--success { --lg-tone: var(--lg-success); }
.lg-alert--warning { --lg-tone: var(--lg-warning); }
.lg-alert--danger { --lg-tone: var(--lg-danger); }

.lg-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px;
  font-size: .75rem; font-weight: 650; line-height: 1.2;
  background: var(--lg-fill); color: var(--lg-text); box-shadow: inset 0 0 0 1px var(--lg-line);
}
.lg-badge--accent { background: var(--lg-accent-soft); color: var(--lg-accent-ink); box-shadow: none; }
.lg-badge--dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--lg-success); }

/* Toasts: call LGKit.toast("Saved") from kit.js */
.lg-toasts { position: fixed; z-index: 1000; right: 20px; bottom: max(20px, env(safe-area-inset-bottom)); display: grid; gap: 10px; width: min(360px, calc(100vw - 40px)); }
.lg-toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--lg-radius);
  font-size: .9375rem; font-weight: 500;
  animation: lg-toast-in .35s var(--lg-ease);
}
.lg-toast > svg { flex: none; width: 20px; height: 20px; color: var(--lg-success); }
.lg-toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
@keyframes lg-toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* Tooltip: wrap the trigger. Shows on hover and keyboard focus; Esc hides it (kit.js) */
.lg-tooltip { position: relative; display: inline-flex; }
.lg-tooltip [role="tooltip"] {
  position: absolute; bottom: calc(100% + 8px); left: 50%; z-index: 20;
  width: max-content; max-width: min(260px, 80vw); padding: 7px 10px; border-radius: 8px;
  font-size: .8125rem; font-weight: 500; line-height: 1.35; color: var(--lg-text);
  background: var(--lg-glass-strong); box-shadow: var(--lg-inner), inset 0 0 0 1px var(--lg-line), var(--lg-shadow);
  -webkit-backdrop-filter: blur(var(--lg-blur)); backdrop-filter: blur(var(--lg-blur));
  opacity: 0; visibility: hidden; transform: translate(-50%, 4px); pointer-events: none;
  transition: opacity var(--lg-dur) var(--lg-ease), transform var(--lg-dur) var(--lg-ease), visibility var(--lg-dur);
}
.lg-tooltip::after { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 8px; } /* hover bridge */
.lg-tooltip:hover [role="tooltip"], .lg-tooltip:focus-within [role="tooltip"] { opacity: 1; visibility: visible; transform: translate(-50%, 0); pointer-events: auto; }
.lg-tooltip.is-dismissed [role="tooltip"] { opacity: 0; visibility: hidden; }

/* ---------- 10. Overlays ---------- */
/* Modal: the native <dialog>. Open it with data-lg-open="id" (kit.js) or dialog.showModal() */
.lg-modal {
  position: fixed;
  width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto;
  padding: 24px; border: 0; color: var(--lg-text);
  background: var(--lg-glass-strong);
}
.lg-modal[open] { animation: lg-pop .3s var(--lg-ease); }
.lg-modal::backdrop { background: var(--lg-scrim); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lg-modal > h2 { margin: 0 0 8px; font: 650 1.25rem/1.3 var(--lg-font); letter-spacing: -.01em; color: inherit; }
.lg-modal > p { margin: 0; color: var(--lg-muted); line-height: 1.5; }
.lg-modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin: 22px 0 0; }
html:has(dialog.lg-modal[open]) { overflow: hidden; }   /* page doesn't scroll behind an open modal */
@keyframes lg-pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }

/* Dropdown menu: <details class="lg-menu"> (kit.js closes it on Esc, outside click or picking an item).
   Near the right edge of the screen? Add lg-menu--end. */
.lg-menu { position: relative; display: inline-block; }
.lg-menu > summary { list-style: none; }
.lg-menu > summary::-webkit-details-marker { display: none; }
.lg-menu > summary svg { transition: transform var(--lg-dur) var(--lg-ease); }
.lg-menu[open] > summary svg { transform: rotate(180deg); }
.lg-menu__list {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; min-width: 200px; margin: 0; padding: 6px;
  list-style: none; border-radius: var(--lg-radius); background: var(--lg-glass-strong);
  animation: lg-pop .2s var(--lg-ease);
}
.lg-menu--end .lg-menu__list { left: auto; right: 0; }
.lg-menu__list a, .lg-menu__list button {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: 0; padding: 9px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--lg-text); font: 500 .875rem var(--lg-font); text-align: left; text-decoration: none; cursor: pointer;
}
.lg-menu__list a:hover, .lg-menu__list button:hover { background: var(--lg-hover); }
.lg-menu__list a:focus-visible, .lg-menu__list button:focus-visible { background: var(--lg-hover); outline: 2px solid var(--lg-focus); outline-offset: -2px; }
.lg-menu__list svg { width: 16px; height: 16px; color: var(--lg-muted); }
.lg-menu__list hr { border: 0; height: 1px; margin: 6px 4px; background: var(--lg-line); }
.lg-menu__list .is-danger { color: var(--lg-danger); }
.lg-menu__list .is-danger svg { color: currentColor; }

/* Accordion: plain <details>, no JavaScript */
.lg-accordion { padding: 4px 18px; }
.lg-accordion details + details { border-top: 1px solid var(--lg-line); }
.lg-accordion summary {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0;
  font-weight: 600; font-size: .9375rem; cursor: pointer; list-style: none; border-radius: 6px;
}
.lg-accordion summary::-webkit-details-marker { display: none; }
.lg-accordion summary::after { content: "+"; width: 1ch; text-align: center; font-size: 1.25rem; font-weight: 400; color: var(--lg-muted); }
.lg-accordion details[open] summary::after { content: "–"; }
.lg-accordion summary:focus-visible { outline: 2px solid var(--lg-focus); outline-offset: 2px; }
.lg-accordion details > p { margin: 0 0 16px; color: var(--lg-muted); font-size: .9375rem; line-height: 1.55; }

/* ---------- 11. Data ---------- */
.lg-avatar {
  width: 40px; height: 40px; flex: none; border-radius: 50%; display: inline-grid; place-items: center;
  font: 700 .8125rem/1 var(--lg-font); color: #fff;
  background: var(--lg-avatar-1);
  box-shadow: 0 0 0 2px var(--lg-glass-solid);
}
.lg-avatar--2 { background: var(--lg-avatar-2); }
.lg-avatar--3 { background: var(--lg-avatar-3); }
.lg-avatar--more { background: var(--lg-glass-solid); color: var(--lg-text); }
.lg-avatar--lg { width: 64px; height: 64px; font-size: 1.125rem; }
.lg-avatars { display: flex; }
.lg-avatars > * + * { margin-left: -8px; }

.lg-progress { display: grid; gap: 8px; }
.lg-progress__top { display: flex; justify-content: space-between; font-size: .875rem; }
.lg-progress__top span:last-child { color: var(--lg-muted); font-variant-numeric: tabular-nums; }
.lg-progress__bar { height: 8px; border-radius: 99px; background: var(--lg-track); overflow: hidden; }
.lg-progress__bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--lg-accent), color-mix(in srgb, var(--lg-accent) 60%, var(--lg-info))); }

/* Table: the glass frame stays put, the inner .lg-table-scroll scrolls sideways on small screens */
.lg-table-wrap { padding: 6px; min-width: 0; max-width: 100%; }
.lg-table-scroll { overflow-x: auto; border-radius: inherit; scrollbar-width: thin; }
.lg-table-scroll:focus-visible { outline: 2px solid var(--lg-focus); outline-offset: 2px; }
.lg-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.lg-table th { padding: 10px 14px; text-align: left; font-size: .75rem; font-weight: 600; color: var(--lg-muted); text-transform: uppercase; letter-spacing: .04em; }
.lg-table td { padding: 12px 14px; border-top: 1px solid var(--lg-line); white-space: nowrap; }
.lg-table tbody tr:hover td { background: var(--lg-hover); }
.lg-table .lg-num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 12. Layout helpers ---------- */
.lg-stack { display: grid; gap: 12px; justify-items: start; }   /* items one under another */
.lg-stack--fill { justify-items: stretch; }
.lg-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.lg-fieldset > legend { padding: 0; margin-bottom: 10px; }
.lg-pad { padding: 24px; }

/* ---------- 13. Accessibility & fallbacks ---------- */
.lg-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.lg-btn:focus-visible, .lg-nav a:focus-visible, .lg-tabs [role="tab"]:focus-visible, .lg-breadcrumb a:focus-visible,
.lg-pagination a:focus-visible, .lg-menu > summary:focus-visible { outline: 2px solid var(--lg-focus); outline-offset: 2px; }

/* Phones: 16px text in fields so iOS doesn't zoom the page */
@media (pointer: coarse) { .lg-input, .lg-select { font-size: 1rem; } }

/* No blur support, or the user asked for less transparency: solid panels */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root, [data-theme] { --lg-glass: var(--lg-glass-solid); --lg-glass-soft: var(--lg-glass-solid); --lg-glass-strong: var(--lg-glass-solid); }
}
@media (prefers-reduced-transparency: reduce) {
  :root, [data-theme] { --lg-glass: var(--lg-glass-solid); --lg-glass-soft: var(--lg-glass-solid); --lg-glass-strong: var(--lg-glass-solid); }
  .lg-glass, .lg-btn--glass, .lg-alert, .lg-tooltip [role="tooltip"] { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .lg-modal::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(5, 8, 7, .7); }
}
/* Windows high contrast */
@media (forced-colors: active) {
  .lg-glass, .lg-btn, .lg-input, .lg-select, .lg-alert, .lg-badge { border: 1px solid CanvasText; }
  .lg-glass::before, .lg-backdrop { display: none; }
  .lg-check input, .lg-switch input, .lg-range { -webkit-appearance: auto; appearance: auto; }
  .lg-check input::after, .lg-switch input::after { display: none; }
  .lg-segmented input:checked + span, .lg-pagination a[aria-current="page"] { forced-color-adjust: none; background: Highlight; color: HighlightText; }
}
/* Calm mode: no movement */
@media (prefers-reduced-motion: reduce) {
  [class^="lg-"], [class*=" lg-"], [class^="lg-"]::before, [class*=" lg-"]::before, [class^="lg-"]::after, [class*=" lg-"]::after,
  .lg-glass *, .lg-tooltip [role="tooltip"], .lg-segmented span, .lg-check input, .lg-check input::after,
  .lg-switch input, .lg-switch input::after, .lg-menu > summary svg {
    animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important;
  }
  .lg-btn[aria-busy="true"]::before { animation: lg-spin 1.6s linear infinite !important; }
}
