/* Frosted glass for every floating surface: the user drawer and its row menu, the confirm and status dialogs, the agency
   pop-up, the notifications panel and the small help popovers. One place, loaded last, so a surface only has to be listed here.
   Dense surfaces (forms, charts, long lists) are more opaque than light ones (menus, popovers) so text stays easy to read.
   A solid surface returns where blur is unsupported or the visitor asked for reduced transparency. The account menu and the
   company picker carry their own copy of the same look (shell.css, switcher.css). */
:root{
  --fx-glass-blur:blur(18px) saturate(1.35);
  --fx-glass-light:color-mix(in srgb,var(--fx-surface-raised) 76%,transparent);
  --fx-glass-dense:color-mix(in srgb,var(--fx-surface-raised) 88%,transparent);
  --fx-glass-edge:color-mix(in srgb,var(--fx-border) 75%,transparent);
  --fx-glass-lit:inset 0 1px 0 rgba(255,255,255,.06);
  --fx-glass-scrim:rgba(8,17,31,.42);
}

/* light surfaces: menus and popovers */
html[data-ui="v2"] .fx-page--users .fx-um-menu,
html[data-ui="v2"] #notif-panel.notif-panel,
html[data-ui="v2"] [popover].fx-popover.fx-popover.fx-popover{
  background:var(--fx-glass-light);border-color:var(--fx-glass-edge);
  -webkit-backdrop-filter:var(--fx-glass-blur);backdrop-filter:var(--fx-glass-blur);
  box-shadow:0 18px 48px rgba(8,17,31,.26),var(--fx-glass-lit);
}
html[data-ui="v2"] .fx-page--users .fx-um-menu{border-radius:14px;padding:8px}
html[data-ui="v2"] .fx-page--users .fx-um-menu button{border-radius:10px}
html[data-ui="v2"] .fx-page--users .fx-um-menu button:hover:not([disabled]){background:color-mix(in srgb,var(--fx-text) 8%,transparent)}
html[data-ui="v2"] .fx-page--users .fx-um-menu hr{border-block-start-color:var(--fx-glass-edge)}

/* dense surfaces: the drawer (forms), the confirm dialog, the status and archive boards, the agency pop-up */
html[data-ui="v2"] .fx-um-drawer,
html[data-ui="v2"] dialog.fx-um-confirm,
html[data-ui="v2"] dialog.archive-dash,
dialog.fx-popup{
  background:var(--fx-glass-dense);border-color:var(--fx-glass-edge);
  -webkit-backdrop-filter:var(--fx-glass-blur);backdrop-filter:var(--fx-glass-blur);
  box-shadow:0 24px 64px rgba(8,17,31,.34),var(--fx-glass-lit);
}
html[data-ui="v2"] .fx-um-drawer > header{border-block-end-color:var(--fx-glass-edge)}
.fx-popup__head{border-block-end-color:var(--fx-glass-edge)}

/* what is behind a drawer or a dialog is softened, so the glass has something to blur */
html[data-ui="v2"] .fx-um-scrim{
  background:var(--fx-glass-scrim);
  -webkit-backdrop-filter:blur(6px) saturate(.9);backdrop-filter:blur(6px) saturate(.9);
}
html[data-ui="v2"] dialog.fx-um-confirm::backdrop,
html[data-ui="v2"] dialog.archive-dash::backdrop{
  background:var(--fx-glass-scrim);
  -webkit-backdrop-filter:blur(8px) saturate(.9);backdrop-filter:blur(8px) saturate(.9);
}

@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  html[data-ui="v2"] .fx-page--users .fx-um-menu,
  html[data-ui="v2"] #notif-panel.notif-panel,
  html[data-ui="v2"] [popover].fx-popover.fx-popover.fx-popover,
  html[data-ui="v2"] .fx-um-drawer,
  html[data-ui="v2"] dialog.fx-um-confirm,
  html[data-ui="v2"] dialog.archive-dash,
  dialog.fx-popup{background:var(--fx-surface-raised)}
  html[data-ui="v2"] .fx-um-scrim{background:var(--fx-overlay)}
}
@media (prefers-reduced-transparency:reduce){
  html[data-ui="v2"] .fx-page--users .fx-um-menu,
  html[data-ui="v2"] #notif-panel.notif-panel,
  html[data-ui="v2"] [popover].fx-popover.fx-popover.fx-popover,
  html[data-ui="v2"] .fx-um-drawer,
  html[data-ui="v2"] dialog.fx-um-confirm,
  html[data-ui="v2"] dialog.archive-dash,
  dialog.fx-popup{background:var(--fx-surface-raised);-webkit-backdrop-filter:none;backdrop-filter:none}
  html[data-ui="v2"] .fx-um-scrim,
  html[data-ui="v2"] dialog.fx-um-confirm::backdrop,
  html[data-ui="v2"] dialog.archive-dash::backdrop{-webkit-backdrop-filter:none;backdrop-filter:none;background:var(--fx-overlay)}
}
