/* ==========================================================================
   REXX Admin — Liquid Glass design system
   Loaded by converted layouts via
   stylesheet_link_tag "noto_sans_thai/noto_sans_thai", "glass".
   Everything is namespaced `lg-`. This is the app's only stylesheet: the legacy
   application.css was removed once every super-admin page was converted.

   1. Tokens          4. Surfaces (the glass primitive)
   2. Base            5. Components (button, input, flash, badge)
   3. Backdrop        6. Page layouts (auth + admin shell)
                      7. Fallbacks & accessibility
   ========================================================================== */


/* ---------- 1. Tokens --------------------------------------------------- */

:root {
  color-scheme: light dark;

  /* Apple system colours. Blue is reserved for the primary action, links and focus;
     everything else stays neutral so the glass and the content carry the colour. */
  --lg-accent:        #007aff;
  --lg-accent-bright: #3d9bff;
  --lg-accent-ring:   rgba(0, 122, 255, .38);
  --lg-danger:        #ff3b30;
  --lg-success:       #34c759;

  /* Text (iOS label hierarchy) */
  --lg-text:          #1c1c1e;
  --lg-text-dim:      rgba(60, 60, 67, .66);
  --lg-text-faint:    rgba(60, 60, 67, .40);

  /* Neutral fills for "selected / hover" states (replaces tinted blue) */
  --lg-tint:          rgba(60, 60, 67, .08);
  --lg-tint-strong:   rgba(60, 60, 67, .15);

  /* Glass surface */
  --lg-glass:         rgba(255, 255, 255, .44);
  --lg-glass-strong:  rgba(255, 255, 255, .74);
  --lg-glass-hover:   rgba(255, 255, 255, .66);
  --lg-sheen:         rgba(255, 255, 255, .42);   /* soft light falling on the top of every pane */
  --lg-stroke:        rgba(255, 255, 255, .95);   /* lit edge */
  --lg-stroke-low:    rgba(255, 255, 255, .22);   /* shaded edge */
  --lg-hairline:      rgba(60, 60, 67, .13);
  --lg-shadow:        0 1px 1px rgba(0, 0, 0, .04),
                      0 8px 24px rgba(0, 0, 0, .07),
                      0 24px 56px rgba(0, 0, 0, .06);
  --lg-blur:          28px;
  --lg-saturate:      1.8;

  /* Backdrop: a soft, wallpaper-like wash, not a colour theme */
  --lg-bg-base:       #f2f2f7;
  --lg-orb-1:         #ffc2a0;
  --lg-orb-2:         #c9b8ff;
  --lg-orb-3:         #a6e9cf;
  --lg-orb-opacity:   .9;

  /* Brand mark / avatar (graphite) */
  --lg-mark-a:        #6b6b72;
  --lg-mark-b:        #232326;

  /* Status tones: fill + text */
  --lg-green-bg:   rgba(52, 199, 89, .16);   --lg-green-fg:  #1f7a3a;
  --lg-orange-bg:  rgba(255, 159, 10, .18);  --lg-orange-fg: #a35a00;
  --lg-red-bg:     rgba(255, 59, 48, .14);   --lg-red-fg:    #c4271d;
  --lg-purple-bg:  rgba(175, 82, 222, .14);  --lg-purple-fg: #8a3fae;
  --lg-blue-bg:    rgba(0, 122, 255, .12);   --lg-blue-fg:   #0062cc;

  /* Black logo artwork needs help on dark surfaces */
  --lg-logo-chip:     transparent;
  --lg-mono-filter:   none;

  /* Shape & motion */
  --lg-radius-lg:     28px;
  --lg-radius:        20px;
  --lg-radius-sm:     13px;
  --lg-ease:          cubic-bezier(.22, 1, .36, 1);
  --lg-font:          -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
                      "noto_sans_thai", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Dark values are declared twice: once for the OS preference, once for the
   manual [data-theme="dark"] override. Keep the two blocks identical. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --lg-accent:        #0a84ff;
    --lg-accent-bright: #409cff;
    --lg-accent-ring:   rgba(10, 132, 255, .5);
    --lg-danger:        #ff453a;
    --lg-success:       #30d158;
    --lg-text:          #f5f5f7;
    --lg-text-dim:      rgba(235, 235, 245, .62);
    --lg-text-faint:    rgba(235, 235, 245, .34);
    --lg-tint:          rgba(235, 235, 245, .10);
    --lg-tint-strong:   rgba(235, 235, 245, .18);
    --lg-glass:         rgba(58, 58, 62, .40);
    --lg-glass-strong:  rgba(40, 40, 44, .78);
    --lg-glass-hover:   rgba(76, 76, 82, .52);
    --lg-sheen:         rgba(255, 255, 255, .10);
    --lg-stroke:        rgba(255, 255, 255, .30);
    --lg-stroke-low:    rgba(255, 255, 255, .05);
    --lg-hairline:      rgba(255, 255, 255, .12);
    --lg-shadow:        0 1px 1px rgba(0, 0, 0, .3),
                        0 10px 30px rgba(0, 0, 0, .4),
                        0 30px 70px rgba(0, 0, 0, .4);
    --lg-bg-base:       #000000;
    --lg-orb-1:         #4a3aa8;
    --lg-orb-2:         #9a3478;
    --lg-orb-3:         #17776c;
    --lg-orb-opacity:   .7;
    --lg-mark-a:        #98989f;
    --lg-mark-b:        #48484a;
    --lg-green-bg:   rgba(48, 209, 88, .22);   --lg-green-fg:  #66e287;
    --lg-orange-bg:  rgba(255, 159, 10, .24);  --lg-orange-fg: #ffb340;
    --lg-red-bg:     rgba(255, 69, 58, .22);   --lg-red-fg:    #ff8a82;
    --lg-purple-bg:  rgba(191, 90, 242, .24);  --lg-purple-fg: #dca0f8;
    --lg-blue-bg:    rgba(10, 132, 255, .24);  --lg-blue-fg:   #78b8ff;
    --lg-logo-chip:     rgba(255, 255, 255, .92);
    --lg-mono-filter:   invert(1) brightness(1.15);
  }
}

:root[data-theme="dark"] {
  --lg-accent:        #0a84ff;
  --lg-accent-bright: #409cff;
  --lg-accent-ring:   rgba(10, 132, 255, .5);
  --lg-danger:        #ff453a;
  --lg-success:       #30d158;
  --lg-text:          #f5f5f7;
  --lg-text-dim:      rgba(235, 235, 245, .62);
  --lg-text-faint:    rgba(235, 235, 245, .34);
  --lg-tint:          rgba(235, 235, 245, .10);
  --lg-tint-strong:   rgba(235, 235, 245, .18);
  --lg-glass:         rgba(58, 58, 62, .40);
  --lg-glass-strong:  rgba(40, 40, 44, .78);
  --lg-glass-hover:   rgba(76, 76, 82, .52);
  --lg-sheen:         rgba(255, 255, 255, .10);
  --lg-stroke:        rgba(255, 255, 255, .30);
  --lg-stroke-low:    rgba(255, 255, 255, .05);
  --lg-hairline:      rgba(255, 255, 255, .12);
  --lg-shadow:        0 1px 1px rgba(0, 0, 0, .3),
                      0 10px 30px rgba(0, 0, 0, .4),
                      0 30px 70px rgba(0, 0, 0, .4);
  --lg-bg-base:       #000000;
  --lg-orb-1:         #4a3aa8;
  --lg-orb-2:         #9a3478;
  --lg-orb-3:         #17776c;
  --lg-orb-opacity:   .7;
  --lg-mark-a:        #98989f;
  --lg-mark-b:        #48484a;
  --lg-green-bg:   rgba(48, 209, 88, .22);   --lg-green-fg:  #66e287;
  --lg-orange-bg:  rgba(255, 159, 10, .24);  --lg-orange-fg: #ffb340;
  --lg-red-bg:     rgba(255, 69, 58, .22);   --lg-red-fg:    #ff8a82;
  --lg-purple-bg:  rgba(191, 90, 242, .24);  --lg-purple-fg: #dca0f8;
  --lg-blue-bg:    rgba(10, 132, 255, .24);  --lg-blue-fg:   #78b8ff;
  --lg-logo-chip:     rgba(255, 255, 255, .92);
  --lg-mono-filter:   invert(1) brightness(1.15);
}


/* ---------- 2. Base ----------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--lg-bg-base);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--lg-font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--lg-text);
  /* no background here: html paints the base colour so body::before (z-index -1) stays visible */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }

a { color: var(--lg-accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 3px solid var(--lg-accent-ring);
  outline-offset: 2px;
}


/* ---------- 3. Backdrop ------------------------------------------------- */
/* Soft colour orbs sit behind the glass; the blur is what gives it depth. */

body::before {
  content: "";
  position: fixed;
  inset: -20vmax;
  z-index: -1;
  background:
    radial-gradient(30vmax 30vmax at 34% 30%, var(--lg-orb-1), transparent 66%),
    radial-gradient(28vmax 28vmax at 70% 26%, var(--lg-orb-2), transparent 66%),
    radial-gradient(32vmax 32vmax at 56% 78%, var(--lg-orb-3), transparent 66%);
  opacity: var(--lg-orb-opacity);
  filter: blur(46px) saturate(1.15);
  animation: lg-drift 28s var(--lg-ease) infinite alternate;
}

@keyframes lg-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-3vmax, 2vmax, 0) scale(1.08); }
}


/* ---------- 4. Surfaces ------------------------------------------------- */
/* .lg-glass is the primitive. Everything glassy composes it:
     <div class="lg-glass lg-card">…</div>
   Layers: translucent fill + backdrop blur, a lit top edge (inset highlight),
   a gradient border drawn with a masked ::before, and a soft drop shadow.   */

.lg-glass {
  position: relative;
  background-color: var(--lg-glass);
  background-image: linear-gradient(180deg, var(--lg-sheen), transparent 46%);
  -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);
  box-shadow: var(--lg-shadow), inset 0 1px 0 var(--lg-stroke);
  isolation: isolate;
}

.lg-glass::before {            /* specular rim */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(155deg, var(--lg-stroke), var(--lg-stroke-low) 45%, var(--lg-stroke) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

.lg-card { padding: 28px; border-radius: var(--lg-radius-lg); }
.lg-glass--strong { background-color: var(--lg-glass-strong); }


/* ---------- 5. Components ----------------------------------------------- */

/* Buttons */
.lg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .01em;
  color: var(--lg-text);
  cursor: pointer;
  text-decoration: none;
  transition: transform .25s var(--lg-ease), box-shadow .25s var(--lg-ease),
              background-color .25s var(--lg-ease);
}
.lg-btn:hover  { text-decoration: none; transform: translateY(-1px); }
.lg-btn:active { transform: translateY(0) scale(.98); }

.lg-btn--primary {
  color: #fff;
  background: linear-gradient(180deg, var(--lg-accent-bright), var(--lg-accent));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .4) inset,
              0 -1px 0 rgba(0, 0, 0, .1) inset,
              0 1px 2px rgba(0, 0, 0, .12),
              0 6px 14px rgba(0, 0, 0, .14);
}
.lg-btn--primary:hover {
  filter: brightness(1.05);
}

.lg-btn--ghost {
  background: var(--lg-glass);
  box-shadow: inset 0 1px 0 var(--lg-stroke), 0 0 0 1px var(--lg-hairline);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
}
.lg-btn--ghost:hover { background: var(--lg-glass-hover); }

.lg-btn--block { width: 100%; }

.lg-link-btn {
  background: none;
  border: 0;
  padding: 4px 8px;
  font: inherit;
  font-size: 13px;
  color: var(--lg-text-dim);
  cursor: pointer;
}
.lg-link-btn:hover { color: var(--lg-accent); }

/* Inputs */
.lg-field { position: relative; display: block; }

.lg-input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  font: inherit;
  font-size: 15px;
  color: var(--lg-text);
  background: var(--lg-glass);
  border: 0;
  border-radius: var(--lg-radius-sm);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .06), 0 0 0 1px var(--lg-hairline);
  transition: box-shadow .2s var(--lg-ease), background-color .2s var(--lg-ease);
  -webkit-appearance: none;
          appearance: none;
}
.lg-input::placeholder { color: var(--lg-text-faint); }
.lg-input:hover { background: var(--lg-glass-hover); }
.lg-input:focus {
  outline: none;
  background: var(--lg-glass-strong);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .05),
              0 0 0 3px var(--lg-accent-ring);
}
.lg-field--icon .lg-input { padding-right: 48px; }

.lg-field__toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--lg-text-dim);
  cursor: pointer;
}
.lg-field__toggle:hover { background: var(--lg-tint); color: var(--lg-text); }
.lg-field__toggle svg { width: 20px; height: 20px; }
.lg-field__toggle .lg-eye-off { display: none; }
.lg-field__toggle[aria-pressed="true"] .lg-eye     { display: none; }
.lg-field__toggle[aria-pressed="true"] .lg-eye-off { display: block; }

/* Flash messages */
.lg-flash {
  padding: 12px 16px;
  border-radius: var(--lg-radius-sm);
  font-size: 14px;
  background: var(--lg-glass-strong);
  box-shadow: inset 0 1px 0 var(--lg-stroke), 0 0 0 1px var(--lg-hairline);
}
.lg-flash--alert  { color: var(--lg-danger);  box-shadow: inset 3px 0 0 var(--lg-danger),  0 0 0 1px var(--lg-hairline); }
.lg-flash--notice { color: var(--lg-success); box-shadow: inset 3px 0 0 var(--lg-success), 0 0 0 1px var(--lg-hairline); }

/* Badge */
.lg-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--lg-text-dim);
  background: var(--lg-tint);
}


/* ---------- 6. Page layouts: auth --------------------------------------- */

.lg-auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.lg-auth__card {
  width: 100%;
  max-width: 400px;
  padding: 36px 32px 28px;
  animation: lg-rise .7s var(--lg-ease) both;
}

.lg-auth__logo {
  display: block;
  width: 168px;
  max-width: 70%;
  height: auto;
  margin: 0 auto 28px;
  padding: 8px 14px;
  box-sizing: content-box;
  border-radius: 18px;
  background: var(--lg-logo-chip);
}

.lg-auth__title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.01em;
  text-align: center;
}
.lg-auth__sub {
  margin: 0 0 24px;
  font-size: 14px;
  text-align: center;
  color: var(--lg-text-dim);
}

.lg-form { display: grid; gap: 14px; }
.lg-form__actions { display: grid; gap: 10px; margin-top: 6px; }
.lg-auth__links { margin-top: 18px; text-align: center; }

.lg-auth__footer {
  display: grid;
  justify-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--lg-text-faint);
  text-align: center;
  animation: lg-rise .9s .15s var(--lg-ease) both;
}
.lg-auth__footer img { height: 22px; width: auto; margin-bottom: 6px; opacity: .8; filter: var(--lg-mono-filter); }

@keyframes lg-rise {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}


/* ---------- 6b. Page layouts: admin shell -------------------------------- */

/* Sidebar on the left, page on the right. Below 900px the sidebar folds into a top bar (see the media query). */
.lg-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: start;
}

/* Sidebar: floating glass column that stays put while the page scrolls */
.lg-sidebar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: calc(100vh - 24px);
  height: calc(100dvh - 24px);
  margin: 12px 0 12px 12px;
  padding: 16px 12px 14px;
  border-radius: 24px;
  overflow-y: auto;
}
.lg-sidebar > .lg-brand { padding: 0 6px; }
.lg-sidebar__spacer { flex: 1; }

.lg-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--lg-text);
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.lg-brand:hover { text-decoration: none; }
.lg-brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, var(--lg-mark-a), var(--lg-mark-b));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 2px 6px rgba(0,0,0,.2);
}
.lg-brand__sub { color: var(--lg-text-dim); font-weight: 500; }

.lg-nav { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lg-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--lg-text-dim);
  white-space: nowrap;
  transition: background-color .2s var(--lg-ease), color .2s var(--lg-ease);
}
.lg-nav__link:hover { color: var(--lg-text); text-decoration: none; }
.lg-nav__link[aria-current="page"] {
  color: var(--lg-text);
  background: var(--lg-glass-strong);
  box-shadow: inset 0 1px 0 var(--lg-stroke), 0 1px 2px rgba(0,0,0,.14), 0 3px 10px rgba(0,0,0,.08);
}
.lg-nav__link svg { width: 18px; height: 18px; flex: none; }

.lg-user { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--lg-hairline); }
.lg-user__who { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0 4px; }
.lg-user__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.lg-user__actions form { min-width: 0; }
.lg-user__actions .lg-btn { width: 100%; min-width: 0; gap: 6px; padding: 0 8px; }
.lg-user__avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, var(--lg-mark-a), var(--lg-mark-b));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.45), 0 2px 6px rgba(0,0,0,.2);
}
.lg-user__meta { min-width: 0; line-height: 1.25; }
.lg-user__name { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-user__role { font-size: 11px; color: var(--lg-text-dim); }
.lg-user form { margin: 0; }
.lg-user .lg-btn { white-space: nowrap; }

.lg-main {
  display: grid;
  gap: 18px;
  align-content: start;
  width: min(1200px, calc(100% - 48px));
  margin: 18px auto 56px;
}

/* Page header */
.lg-pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 4px 6px 0; }
.lg-pagehead__text { display: grid; gap: 4px; min-width: 0; }
.lg-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 5px 12px 5px 8px;
  margin-bottom: 4px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--lg-text-dim);
  background: var(--lg-tint);
}
.lg-back:hover { text-decoration: none; color: var(--lg-text); background: var(--lg-tint-strong); }
.lg-back svg { width: 16px; height: 16px; }
.lg-title { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.lg-subtitle { margin: 0; font-size: 14px; color: var(--lg-text-dim); }
.lg-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lg-actions form { margin: 0; }

.lg-stack { display: grid; gap: 18px; align-content: start; }

/* Fill layout: pages that own the viewport (the feature matrices). The top bar and header stay put,
   the table card takes the remaining height and is the ONLY thing that scrolls; actions sit below it. */
.lg-fill { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.lg-fill > * { flex: none; }
.lg-fill > .lg-fill { flex: 1 1 0; }
.lg-shell--fill { height: 100vh; height: 100dvh; overflow: hidden; }
.lg-shell--fill > .lg-main { height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; margin: 0 auto; padding: 18px 0 16px; }
.lg-shell--fill > .lg-main > * { flex: none; }
.lg-shell--fill > .lg-main > .lg-fill { flex: 1 1 0; min-height: 440px; }  /* below this the page scrolls instead of squashing the table */

/* Panels */
.lg-panel { padding: 20px 22px; border-radius: 22px; }
.lg-panel--flush { padding: 0; overflow: hidden; }
.lg-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.lg-panel--flush > .lg-panel__head { margin: 0; padding: 16px 22px; border-bottom: 1px solid var(--lg-hairline); }
.lg-panel__title { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.lg-meta { font-size: 13px; color: var(--lg-text-dim); }
.lg-sectionlabel { margin: 6px 6px -6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--lg-text-dim); }

/* Hero / intro */
.lg-hero { padding: 26px 28px; border-radius: 26px; }
.lg-hero__title { margin: 0 0 4px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.lg-hero__text { margin: 0; color: var(--lg-text-dim); }

/* Tiles (navigation cards) */
.lg-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.lg-tile {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 20px;
  border-radius: 22px;
  color: var(--lg-text);
  transition: transform .3s var(--lg-ease), background-color .3s var(--lg-ease);
}
.lg-tile:hover { text-decoration: none; transform: translateY(-3px); background: var(--lg-glass-hover); }
.lg-tile__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 4px;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(180deg, var(--ic-a, var(--lg-mark-a)), var(--ic-b, var(--lg-mark-b)));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 -1px 0 rgba(0,0,0,.08), 0 4px 10px rgba(0,0,0,.14);
}
.lg-tile__icon--orange { --ic-a: #ffb340; --ic-b: #ff8a00; }
.lg-tile__icon--green  { --ic-a: #5fdc82; --ic-b: #28b84c; }
.lg-tile__icon--purple { --ic-a: #c88af0; --ic-b: #9b46d1; }
.lg-tile__icon--pink   { --ic-a: #ff7a96; --ic-b: #e8284f; }
.lg-tile__icon--indigo { --ic-a: #8f8cf5; --ic-b: #5a56d6; }
.lg-tile__icon--teal   { --ic-a: #62d3d6; --ic-b: #1fa8b0; }
.lg-tile__icon--gray   { --ic-a: #a4a4ab; --ic-b: #6e6e75; }
.lg-tile__icon svg { width: 24px; height: 24px; }
.lg-tile__title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.lg-tile__text { font-size: 13px; color: var(--lg-text-dim); }
.lg-tile__cta { margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--lg-text-dim); }
.lg-tile:hover .lg-tile__cta { color: var(--lg-text); }

/* Lists (div-based rows so whole rows can be links) */
.lg-list__head, .lg-list__row {
  display: grid;
  grid-template-columns: var(--lg-cols, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
}
.lg-list__head {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--lg-text-dim);
  background: var(--lg-glass);
  border-bottom: 1px solid var(--lg-hairline);
}
.lg-list__row { min-height: 60px; color: var(--lg-text); border-bottom: 1px solid var(--lg-hairline); transition: background-color .2s var(--lg-ease); }
.lg-list__row:last-child { border-bottom: 0; }
a.lg-list__row:hover { background: var(--lg-glass-hover); text-decoration: none; }
.lg-cell { display: grid; gap: 2px; min-width: 0; }
.lg-cell__main { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.lg-cell__sub { font-size: 13px; color: var(--lg-text-dim); overflow: hidden; text-overflow: ellipsis; }
.lg-cell--row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lg-chevron { width: 18px; height: 18px; color: var(--lg-text-faint); justify-self: end; }
.lg-cols-2   { --lg-cols: 1fr auto; }
.lg-cols-3   { --lg-cols: minmax(0, 2fr) minmax(0, 1.2fr) 24px; }
.lg-cols-4   { --lg-cols: minmax(0, 2fr) minmax(0, 1.2fr) 130px 110px; }
.lg-cols-5   { --lg-cols: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 1.2fr) 120px 110px; }
.lg-cols-runs { --lg-cols: minmax(0, 1.6fr) 110px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2.8fr); }
.lg-cols-sel { --lg-cols: 28px minmax(0, 1fr) minmax(0, 2.4fr) 130px; }
.lg-cols-tog { --lg-cols: 44px minmax(0, 1fr) 70px; }

.lg-empty { display: grid; justify-items: center; gap: 6px; padding: 44px 20px; text-align: center; color: var(--lg-text-dim); }
.lg-empty svg { width: 30px; height: 30px; color: var(--lg-text-faint); }
.lg-empty__title { font-size: 16px; font-weight: 700; color: var(--lg-text); }

/* Search */
.lg-search { position: relative; flex: 1; min-width: 220px; max-width: 460px; }
.lg-search svg { position: absolute; top: 50%; left: 14px; width: 18px; height: 18px; transform: translateY(-50%); color: var(--lg-text-faint); pointer-events: none; }
.lg-search .lg-input { padding-left: 42px; padding-right: 40px; }
.lg-search__clear {
  position: absolute; top: 50%; right: 8px; width: 28px; height: 28px; transform: translateY(-50%);
  display: none; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--lg-text-dim); cursor: pointer; font-size: 16px; line-height: 1;
}
.lg-search.has-value .lg-search__clear { display: grid; }
.lg-search__clear:hover { background: var(--lg-tint); color: var(--lg-text); }
.lg-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 22px; border-bottom: 1px solid var(--lg-hairline); }
.lg-toolbar--end { justify-content: space-between; }

/* Badges: tones */
.lg-badge--green  { color: var(--lg-green-fg);  background: var(--lg-green-bg); }
.lg-badge--yellow, .lg-badge--orange { color: var(--lg-orange-fg); background: var(--lg-orange-bg); }
.lg-badge--red    { color: var(--lg-red-fg);    background: var(--lg-red-bg); }
.lg-badge--purple { color: var(--lg-purple-fg); background: var(--lg-purple-bg); }
.lg-badge--blue   { color: var(--lg-blue-fg);   background: var(--lg-blue-bg); }
.lg-badge--gray   { color: var(--lg-text-dim);  background: var(--lg-tint); }

/* Key / value list */
.lg-kv { margin: 0; display: grid; }
.lg-kv__row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; padding: 13px 22px; border-bottom: 1px solid var(--lg-hairline); }
.lg-kv__row:last-child { border-bottom: 0; }
.lg-kv dt { font-size: 13px; font-weight: 600; color: var(--lg-text-dim); }
.lg-kv dd { margin: 0; overflow-wrap: anywhere; }

/* Forms */
.lg-formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 20px 22px 22px; }
.lg-fieldrow { display: grid; gap: 6px; align-content: start; }
.lg-fieldrow--full { grid-column: 1 / -1; }
.lg-label { font-size: 13px; font-weight: 600; color: var(--lg-text-dim); }
.lg-help { font-size: 12.5px; color: var(--lg-text-faint); }
select.lg-input {
  padding-right: 40px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a98a6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
select.lg-input:disabled, .lg-input:disabled { opacity: .6; cursor: not-allowed; }
.lg-formactions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lg-errors { padding: 14px 18px; border-radius: 16px; color: var(--lg-danger); background: rgba(217,54,60,.1); box-shadow: inset 3px 0 0 var(--lg-danger); }
.lg-errors strong { display: block; margin-bottom: 4px; }
.lg-errors ul { margin: 0; padding-left: 18px; }
.lg-note { padding: 12px 16px; border-radius: 14px; font-size: 14px; color: var(--lg-text-dim); background: var(--lg-tint); }

/* Buttons: variants */
.lg-btn--sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.lg-btn--danger { color: #fff; background: linear-gradient(180deg, #ee5a5f, var(--lg-danger)); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 6px 16px rgba(217,54,60,.3); }
.lg-btn svg { width: 18px; height: 18px; flex: none; }

/* Switch */
.lg-switch { position: relative; display: inline-block; width: 46px; height: 28px; flex: none; cursor: pointer; }
.lg-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.lg-switch__track {
  position: absolute; inset: 0; border-radius: 999px; background: var(--lg-hairline);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.2);
  transition: background-color .25s var(--lg-ease);
}
.lg-switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.3); transition: transform .3s var(--lg-ease);
}
.lg-switch input:checked + .lg-switch__track { background: var(--lg-success); }
.lg-switch input:checked + .lg-switch__track::after { transform: translateX(18px); }
.lg-switch input:focus-visible + .lg-switch__track { outline: 3px solid var(--lg-accent-ring); outline-offset: 2px; }

.lg-check { width: 18px; height: 18px; accent-color: var(--lg-accent); cursor: pointer; }

/* Feature matrix (tenant x feature) */
.lg-matrix__scroll { overflow: auto; min-height: 200px; }
.lg-fill > .lg-matrix__scroll { flex: 1 1 0; }
.lg-matrix { width: 100%; border-collapse: separate; border-spacing: 0; }
.lg-matrix th, .lg-matrix td { padding: 12px 16px; text-align: center; border-bottom: 1px solid var(--lg-hairline); white-space: nowrap; }
.lg-matrix thead th {
  position: sticky; top: 0; z-index: 2;
  font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--lg-text-dim);
  background: var(--lg-glass-strong);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.lg-matrix__clickable { cursor: pointer; transition: color .2s var(--lg-ease); }
.lg-matrix__clickable:hover { color: var(--lg-text); }
.lg-matrix .lg-matrix__tenant { position: sticky; left: 0; z-index: 1; text-align: left; min-width: 220px; background: var(--lg-glass-strong); }
.lg-matrix thead .lg-matrix__tenant { z-index: 3; }
.lg-matrix .lg-matrix__tenant { white-space: normal; max-width: 320px; }
.lg-matrix .lg-matrix__tenant .lg-cell__main, .lg-matrix .lg-matrix__tenant .lg-cell__sub { white-space: normal; overflow-wrap: anywhere; }
.lg-matrix tbody tr:hover td { background: var(--lg-glass-hover); }
.lg-matrix tbody tr:last-child td { border-bottom: 0; }
.lg-matrix__cell { display: flex; justify-content: center; }
.lg-matrix__dash { color: var(--lg-text-faint); }
.lg-actionbar { display: flex; gap: 10px; padding: 10px 12px; border-radius: 20px; width: fit-content; }

/* Modal */
.lg-modal-overlay {
  position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 20px;
  background: rgba(7,17,28,.38); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.lg-modal-overlay.is-open { display: flex; animation: lg-fade .2s var(--lg-ease); }
.lg-modal { width: min(520px, 100%); max-height: min(640px, 86dvh); display: flex; flex-direction: column; padding: 0; border-radius: 26px; background: var(--lg-glass-strong); animation: lg-rise .35s var(--lg-ease); }
.lg-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 12px; }
.lg-modal__title { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.lg-modal__bulk { display: flex; gap: 8px; padding: 0 22px 12px; }
.lg-modal__list { overflow: auto; padding: 0 22px 20px; display: grid; gap: 4px; }
.lg-modal__row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 14px; border-radius: 14px; background: var(--lg-glass); }
.lg-iconbtn { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--lg-glass); color: var(--lg-text-dim); cursor: pointer; font-size: 15px; }
.lg-iconbtn:hover { background: var(--lg-tint-strong); color: var(--lg-text); }
@keyframes lg-fade { from { opacity: 0; } to { opacity: 1; } }

/* Avatar-sized tenant icon in feature list */
.lg-featureicon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: var(--lg-text-dim); background: var(--lg-tint); }
.lg-featureicon svg { width: 18px; height: 18px; }

/* Ticket report: nav badge, tabs, filter bar, form pickers, kanban board, comments, history */
.lg-nav__badge {
  margin-left: auto;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  font-size: 11.5px; font-weight: 700; color: #fff; background: var(--lg-danger);
}
.lg-lang { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--lg-tint); }
.lg-lang__opt { display: inline-grid; place-items: center; min-width: 40px; min-height: 32px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--lg-text-dim); }
.lg-lang__opt:hover { color: var(--lg-text); text-decoration: none; }
.lg-lang__opt[aria-current="true"] { color: #fff; background: var(--lg-accent); }
.lg-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px; border-bottom: 1px solid var(--lg-hairline); }
.lg-tabs__tab {
  display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--lg-text-dim); white-space: nowrap;
}
.lg-tabs__tab:hover { color: var(--lg-text); background: var(--lg-tint); text-decoration: none; }
.lg-tabs__tab[aria-current="page"] { color: var(--lg-text); background: var(--lg-glass-strong); box-shadow: inset 0 1px 0 var(--lg-stroke), 0 1px 2px rgba(0,0,0,.12); }
.lg-tabs__count { font-size: 12px; font-weight: 700; color: var(--lg-text-faint); }

.lg-filterbar { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; padding: 14px 22px; }
.lg-filterbar .lg-input { min-height: 40px; font-size: 14px; }
.lg-filterbar__search { grid-column: span 2; }
.lg-filterbar__actions { display: flex; gap: 8px; align-items: center; }
.lg-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 22px 14px; border-bottom: 1px solid var(--lg-hairline); }
.lg-chip {
  display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--lg-text-dim); background: var(--lg-tint);
}
.lg-chip:hover { color: var(--lg-text); text-decoration: none; background: var(--lg-tint-strong); }
.lg-chip[aria-pressed="true"] { color: #fff; background: var(--lg-accent); }

textarea.lg-input { min-height: 120px; padding: 12px 16px; resize: vertical; line-height: 1.5; }
.lg-input--sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
select.lg-input--sm { padding-right: 34px; background-position: right 10px center; }
.lg-req { color: var(--lg-danger); }
.lg-hint { font-size: 12.5px; color: var(--lg-text-dim); min-height: 1em; }
.lg-hint--ok { color: var(--lg-green-fg); }
.lg-hint--bad { color: var(--lg-red-fg); }
fieldset.lg-group { display: contents; border: 0; margin: 0; padding: 0; }
fieldset.lg-group[hidden] { display: none; }
.lg-choices { display: flex; gap: 8px; flex-wrap: wrap; }
.lg-choice { position: relative; }
.lg-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.lg-choice span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 14px; font-weight: 600;
  color: var(--lg-text-dim); background: var(--lg-glass); box-shadow: inset 0 0 0 1px var(--lg-hairline); cursor: pointer;
}
.lg-choice input:checked + span { color: #fff; background: var(--lg-accent); box-shadow: none; }
.lg-choice input:focus-visible + span { outline: 3px solid var(--lg-accent-ring); outline-offset: 2px; }

.lg-impersonating {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 10px 12px 10px 16px; border-radius: 16px;
  color: var(--lg-text); background: rgba(255, 159, 10, .16); border: 1px solid rgba(255, 159, 10, .55);
}
.lg-impersonating > span { display: inline-flex; align-items: center; gap: 8px; }
.lg-impersonating svg { width: 18px; height: 18px; flex: none; }
.lg-picker { position: relative; }
/* An open list may hang below its panel (flush panels clip their content otherwise). */
.lg-panel--flush:has(.lg-picker__list:not([hidden])) { overflow: visible; z-index: 5; }
.lg-picker__list {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; max-height: 280px; overflow: auto; padding: 6px;
  border-radius: 16px; background: var(--lg-glass-strong); box-shadow: var(--lg-shadow);
  -webkit-backdrop-filter: blur(var(--lg-blur)); backdrop-filter: blur(var(--lg-blur));
}
.lg-picker__option {
  display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px;
  font: inherit; text-align: left; color: var(--lg-text); background: none; cursor: pointer;
}
.lg-picker__option small { color: var(--lg-text-dim); overflow: hidden; text-overflow: ellipsis; }
.lg-picker__option:hover, .lg-picker__option.is-active { background: var(--lg-tint-strong); }
.lg-picker__empty { padding: 10px 12px; color: var(--lg-text-dim); }
.lg-picker__option span { display: grid; gap: 2px; min-width: 0; }
.lg-picker__option code { font: 600 12px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--lg-text-dim); overflow-wrap: anywhere; }

.lg-cols-ids { --lg-cols: minmax(0, 2fr) minmax(0, 2.2fr) minmax(0, 1.4fr) 110px; }
.lg-idcopy { display: inline-flex; align-items: center; justify-content: space-between; justify-self: start; gap: 6px; min-width: 0; max-width: 100%; font: 600 13px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--lg-text); background: var(--lg-tint); border: 1px solid var(--lg-hairline); border-radius: 8px; padding: 5px 8px; cursor: pointer; }
.lg-idcopy:hover { background: var(--lg-glass-hover); }
.lg-idcopy__value { overflow-wrap: anywhere; text-align: left; }
.lg-idcopy__label { font: 600 11px/1 var(--lg-font); color: var(--lg-text-faint); text-transform: uppercase; letter-spacing: .05em; }
.lg-cols-tickets { --lg-cols: minmax(0, 2.6fr) minmax(0, 1.4fr) 130px 100px minmax(0, 1fr) 110px; }

.lg-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(184px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.lg-board__col { display: flex; flex-direction: column; gap: 10px; min-height: 200px; padding: 12px; border-radius: 22px; scroll-snap-align: start; }
.lg-board__head { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 4px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--lg-text-dim); }
.lg-board__empty { padding: 18px 8px; text-align: center; font-size: 13px; color: var(--lg-text-faint); }
.lg-tcard { display: grid; gap: 8px; padding: 12px 14px; border-radius: 16px; background: var(--lg-glass-strong); box-shadow: inset 0 1px 0 var(--lg-stroke), 0 1px 3px rgba(0,0,0,.08); }
.lg-tcard__link { display: grid; gap: 4px; color: var(--lg-text); }
.lg-tcard__link:hover { text-decoration: none; }
.lg-tcard__link:hover .lg-tcard__title { text-decoration: underline; }
.lg-tcard__number { font-size: 12px; font-weight: 700; color: var(--lg-text-dim); }
.lg-tcard__title { font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.lg-tcard__meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--lg-text-dim); }
.lg-tcard__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.lg-tcard__foot form { margin: 0; }
.lg-avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 11px; font-weight: 700; color: #fff; background: linear-gradient(180deg, var(--lg-mark-a), var(--lg-mark-b)); }

.lg-banner { display: grid; gap: 8px; padding: 16px 18px; border-radius: 18px; }
.lg-banner--yellow { background: var(--lg-orange-bg); }
.lg-banner--green  { background: var(--lg-green-bg); }
.lg-banner__title { font-weight: 700; }
.lg-banner p { margin: 0; white-space: pre-wrap; }

.lg-disclosure { border-top: 1px solid var(--lg-hairline); }
.lg-disclosure:first-child { border-top: 0; }
.lg-disclosure > summary { display: flex; align-items: center; gap: 10px; padding: 14px 22px; font-weight: 600; cursor: pointer; list-style: none; }
.lg-disclosure > summary::-webkit-details-marker { display: none; }
.lg-disclosure > summary svg { width: 18px; height: 18px; color: var(--lg-text-dim); }
.lg-disclosure[open] > summary { color: var(--lg-text); }
.lg-disclosure__body { display: grid; gap: 12px; padding: 0 22px 18px; }
.lg-actionrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 22px; border-bottom: 1px solid var(--lg-hairline); }
.lg-actionrow form { margin: 0; }

.lg-prose { padding: 16px 22px 20px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.lg-files { display: grid; gap: 4px; padding: 10px 14px 14px; }
.lg-files a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; color: var(--lg-text); }
.lg-files a:hover { background: var(--lg-tint); text-decoration: none; }
.lg-files svg { width: 18px; height: 18px; color: var(--lg-text-dim); flex: none; }

.lg-comments { display: grid; gap: 12px; padding: 16px 22px; }
.lg-comment { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
.lg-comment .lg-avatar { width: 32px; height: 32px; font-size: 13px; }
.lg-comment__head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.lg-comment__body { margin-top: 4px; padding: 10px 14px; border-radius: 4px 16px 16px 16px; background: var(--lg-tint); white-space: pre-wrap; overflow-wrap: anywhere; }
.lg-comment--return .lg-comment__body, .lg-comment--fix_rejection .lg-comment__body { background: var(--lg-orange-bg); }
.lg-comment--resolution .lg-comment__body { background: var(--lg-green-bg); }
.lg-comment--cancellation .lg-comment__body { background: var(--lg-tint-strong); }
.lg-commentform { display: grid; gap: 10px; padding: 0 22px 20px; }

.lg-timeline { list-style: none; margin: 0; padding: 12px 22px 18px; display: grid; gap: 10px; }
.lg-timeline li { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 12px; font-size: 14px; }
.lg-timeline li::before { content: ""; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--lg-text-faint); }
.lg-timeline .lg-meta { display: block; }

.lg-pager { display: flex; justify-content: space-between; gap: 10px; padding: 12px 22px; }

@media (max-width: 900px) {
  /* The sidebar folds into a top bar: brand and account on one row, the menu scrolling sideways below */
  .lg-shell { display: block; }
  .lg-sidebar {
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px;
    height: auto; margin: 8px 8px 0; padding: 10px 12px; border-radius: 20px; overflow: visible;
  }
  .lg-sidebar__spacer { display: none; }
  .lg-user { display: flex; align-items: center; margin-left: auto; padding: 0; border: 0; }
  .lg-user__meta { display: none; }
  .lg-user__actions { display: flex; }
  .lg-user__actions .lg-btn { width: auto; }
  .lg-nav { order: 3; width: 100%; flex-direction: row; overflow-x: auto; padding: 3px; border-radius: 999px; background: var(--lg-tint); }
  .lg-nav__link { flex: none; padding: 7px 12px; border-radius: 999px; }
  .lg-nav__badge { margin-left: 0; }
  .lg-main { width: calc(100% - 24px); }
  .lg-shell--fill { display: flex; flex-direction: column; overflow-y: auto; }
  .lg-shell--fill > .lg-sidebar { flex: none; }
  .lg-shell--fill > .lg-main { flex: 1 1 0; height: auto; min-height: 0; overflow: visible; margin: 18px auto 16px; padding: 0; }
  .lg-title { font-size: 22px; }
}

@media (max-width: 720px) {
  .lg-list__head { display: none; }
  .lg-list__row { grid-template-columns: 1fr auto; row-gap: 8px; padding: 14px 16px; }
  .lg-list__row > .lg-cell:first-child, .lg-list__row > .lg-chevron { grid-column: auto; }
  .lg-list__row > :nth-child(n+3):not(.lg-chevron) { grid-column: 1 / -1; }
  .lg-cols-sel { --lg-cols: 28px 1fr; }
  .lg-cols-sel > :nth-child(n+3) { grid-column: 2; }
  .lg-formgrid { grid-template-columns: 1fr; padding: 16px; }
  .lg-filterbar { grid-template-columns: 1fr 1fr; padding: 12px 16px; }
  .lg-filterbar__search { grid-column: 1 / -1; }
  .lg-chips { padding: 0 16px 12px; }
  .lg-board { grid-auto-columns: 84%; }
  .lg-prose, .lg-comments, .lg-timeline, .lg-actionrow, .lg-disclosure > summary, .lg-pager { padding-left: 16px; padding-right: 16px; }
  .lg-disclosure__body, .lg-commentform { padding-left: 16px; padding-right: 16px; }
  .lg-kv__row { grid-template-columns: 1fr; gap: 2px; padding: 12px 16px; }
  .lg-panel { padding: 16px; }
  .lg-toolbar { padding: 12px 16px; }
  .lg-panel--flush > .lg-panel__head { padding: 14px 16px; }
}

/* ---------- 7. Fallbacks & accessibility -------------------------------- */

/* No backdrop-filter (older browsers): make the fill opaque enough to read. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .lg-glass        { background: var(--lg-glass-strong); }
  .lg-btn--ghost   { background: var(--lg-glass-strong); }
}

/* Users who asked the OS for less transparency get solid surfaces. */
@media (prefers-reduced-transparency: reduce) {
  .lg-glass, .lg-btn--ghost, .lg-input { background: var(--lg-glass-strong); -webkit-backdrop-filter: none; backdrop-filter: none; }
  body::before { opacity: .25; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 480px) {
  .lg-auth__card { padding: 28px 20px 22px; border-radius: 24px; }
}
