/* Translucent-glass popups: every overlay surface (user menu, ready-prompt
   menu, modal/help dialogs, sheets, drawers, toasts) reads as glass and
   always draws on top of every bar, panel and other glass surface. Loaded
   LAST so it can win over console.css/future.css/kits.css without !important
   sprawl. Stacking order itself is layers.css's job (--z-* tokens); this
   file only adds the look, plus z-index for the surfaces layers.css does
   not already name (.modal-scrim/.modal-card/.help-panel, .toast-region).
*/

/* ---------- user menu (sidebar) ---------- */
.user-menu {
  background: color-mix(in srgb, var(--bg-elevated) 60%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid transparent;
  border-image: linear-gradient(135deg, rgba(255, 255, 255,.22), rgba(255, 255, 255,0) 40%, rgba(255, 255, 255,.08) 100%) 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255,.14),
    0 30px 80px rgba(0,0,0,.4);
}
.user-menu-item:hover,
.user-menu-item:focus-visible {
  background: rgba(255, 255, 255,.08);
  outline: none;
}
.theme-opt.is-active {
  background: color-mix(in srgb, var(--bg-elevated) 70%, transparent);
}
.user-row:hover {
  background: rgba(255, 255, 255,.06);
}

/* ---------- ready-prompt menu (.pp-menu) ---------- */
.pp-menu {
  background: color-mix(in srgb, var(--bg-elevated) 60%, transparent) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid transparent;
  border-image: linear-gradient(135deg, rgba(255, 255, 255,.22), rgba(255, 255, 255,0) 40%, rgba(255, 255, 255,.08) 100%) 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255,.14),
    0 30px 80px rgba(0,0,0,.4);
}
.pp-item:hover,
.pp-item:focus-visible {
  background: rgba(255, 255, 255,.08);
}

/* ---------- modal / help dialogs (.modal-scrim > .modal-card, incl. the
   first-run wizard and the help panel) — not matched by layers.css's
   dialog/.modal selectors, so give them the token here. ---------- */
.modal-scrim {
  z-index: var(--z-dialog) !important;
  background: rgba(0,0,0,.45);
}
.modal-card {
  z-index: calc(var(--z-dialog) + 1) !important;
  background: color-mix(in srgb, var(--bg-elevated) 62%, transparent) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid transparent;
  border-image: linear-gradient(135deg, rgba(255, 255, 255,.22), rgba(255, 255, 255,0) 40%, rgba(255, 255, 255,.08) 100%) 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255,.14),
    0 30px 80px rgba(0,0,0,.4);
}

/* ---------- toasts ---------- */
.toast-region {
  z-index: var(--z-toast) !important;
}
.toast {
  background: color-mix(in srgb, var(--bg-elevated) 60%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid transparent;
  border-image: linear-gradient(135deg, rgba(255, 255, 255,.22), rgba(255, 255, 255,0) 40%, rgba(255, 255, 255,.08) 100%) 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255,.14),
    0 30px 80px rgba(0,0,0,.4);
}

/* ---------- reduced-transparency fallback ---------- */
@media (prefers-reduced-transparency: reduce) {
  .user-menu,
  .pp-menu,
  .modal-card,
  .toast {
    background: var(--bg-elevated) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}
