/* Liquid Glass, the windows that ask for a moment. Two materials:
   - a card over the live dashboard (Bit's message, a vote, a suggestion) blurs what is
     behind it, like the notification it stands beside;
   - a sheet that stops the page gets its blur from the scrim. A backdrop-filter on the
     overlay makes it a backdrop root, so a second one on the sheet would sample nothing:
     the sheet is fill and rim, and the page is blurred once, not twice.
   The full-screen stages stay in colour: colour is Bit's. Everything sits behind
   :root[data-style="liquid"]; the other skins keep their lists. */
:root[data-style="liquid"] {
  --sheet-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 60%);
  --sheet-rim: inset 1px 1px 0 rgba(255, 255, 255, 0.26), inset -1px -1px 0 rgba(255, 255, 255, 0.1);
  --sheet-edge: rgba(255, 255, 255, 0.1);
  --sheet-fill: rgba(14, 15, 24, 0.62);
  --sheet-card: rgba(var(--panel-rgb), 0.62);
  --sheet-under: rgba(14, 15, 24, 0.38);
  --sheet-blur: blur(24px) saturate(1.8);
  --sheet-lift: 0 16px 44px rgba(3, 4, 10, 0.4);
  --sheet-scrim: rgba(6, 7, 14, 0.46);
  --sheet-scrim-blur: blur(20px) saturate(1.4);
  --sheet-well: rgba(255, 255, 255, 0.08);
  --sheet-well-hover: rgba(255, 255, 255, 0.13);
  --sheet-line: rgba(255, 255, 255, 0.16);
  --sheet-text: #f2f4f3;
  --sheet-muted: rgba(242, 244, 243, 0.76);
  --sheet-main: var(--accent);
  --sheet-main-ink: var(--on-accent);
}
:root[data-style="liquid"][data-appearance="light"] {
  --sheet-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0) 60%);
  --sheet-rim: inset 1px 1px 0 rgba(255, 255, 255, 0.82), inset -1px -1px 0 rgba(255, 255, 255, 0.4);
  --sheet-edge: rgba(255, 255, 255, 0.5);
  --sheet-fill: rgba(255, 255, 255, 0.72);
  --sheet-card: rgba(var(--panel-rgb), 0.8);
  --sheet-under: rgba(255, 255, 255, 0.5);
  --sheet-lift: 0 14px 38px rgba(40, 44, 70, 0.2);
  --sheet-scrim: rgba(226, 229, 240, 0.42);
  --sheet-well: rgba(24, 26, 44, 0.06);
  --sheet-well-hover: rgba(24, 26, 44, 0.11);
  --sheet-line: rgba(24, 26, 44, 0.14);
  --sheet-text: #16181f;
  --sheet-muted: rgba(22, 24, 31, 0.72);
}
/* No blur on the slow path: a thin fill would leave tiles sharp behind the words. */
:root[data-style="liquid"] body.low-power-gpu {
  --sheet-card: rgba(var(--panel-rgb), 0.97);
  --sheet-fill: rgba(var(--panel-rgb), 0.97);
  --sheet-blur: none;
  --sheet-scrim: rgba(6, 7, 14, 0.62);
  --sheet-scrim-blur: none;
}
@media (prefers-reduced-transparency: reduce) {
  :root[data-style="liquid"] body {
    --sheet-sheen: none;
    --sheet-card: rgb(var(--panel-rgb));
    --sheet-fill: rgb(var(--panel-rgb));
    --sheet-blur: none;
    --sheet-scrim: rgba(6, 7, 14, 0.72);
    --sheet-scrim-blur: none;
  }
}
/* The alerts window is see-through and cut around the card: a blur has nothing to
   soften there, and a shadow would end in a straight edge. */
:root[data-style="liquid"][data-screen-alerts] {
  --sheet-card: rgba(var(--panel-rgb), 0.92);
  --sheet-fill: rgba(var(--panel-rgb), 0.92);
  --sheet-blur: none;
  --sheet-lift: 0 0 0 transparent;
}
/* A widget window on the desktop is see-through too: behind a sheet there are the
   desktop's own windows, sharp, so a thin fill leaves the words unreadable. */
:root[data-style="liquid"][data-layer] body {
  --sheet-card: rgba(var(--panel-rgb), 0.97);
  --sheet-fill: rgba(var(--panel-rgb), 0.97);
  --sheet-blur: none;
  --sheet-scrim: rgba(6, 7, 14, 0.62);
  --sheet-scrim-blur: none;
}

/* ── Cards ─────────────────────────────────────────────────────── */
:root[data-style="liquid"] :is(.bm-card, .rn-corner:not(.rn-corner-major), .rn-card) {
  --wn-paper-3: var(--sheet-well);
  --wn-rule: var(--sheet-line);
  --wn-rule-2: var(--sheet-line);
  --wn-text: var(--sheet-text);
  --wn-text-2: var(--sheet-muted);
  --wn-main: var(--sheet-main);
  --wn-main-ink: var(--sheet-main-ink);
}
:root[data-style="liquid"] :is(.bm-card:not(.is-face), .rn-corner:not(.rn-corner-major), .discord-invite) {
  border-color: var(--sheet-edge);
  border-radius: 16px;
  background: var(--sheet-sheen), linear-gradient(var(--sheet-card) 0 0), var(--sheet-under);
  -webkit-backdrop-filter: var(--sheet-blur);
  backdrop-filter: var(--sheet-blur);
  box-shadow: var(--sheet-rim), var(--sheet-lift);
}
:root[data-style="liquid"] .rn-corner-major { border-radius: 16px; }
:root[data-style="liquid"] :is(.bm-go, .bm-quiet, .bm-off, .bm-x, .bm-answer, .rc-x, .rn-corner-go, .rn-main) { border-radius: 10px; }
:root[data-style="liquid"] .bm-media { border-radius: 15px 15px 0 0; }

:root[data-style="liquid"] .discord-invite { color: var(--sheet-text); }
:root[data-style="liquid"] :is(.discord-invite-text, .discord-invite-close, .discord-invite-dismiss, .support-ask-already) { color: var(--sheet-muted); }
:root[data-style="liquid"] .support-ask .discord-invite-text { color: var(--sheet-text); }
:root[data-style="liquid"] :is(.discord-invite-close, .discord-invite-dismiss):hover { background: var(--sheet-well-hover); color: var(--sheet-text); }
:root[data-style="liquid"] .discord-invite-join { background: var(--sheet-main); color: var(--sheet-main-ink); }
:root[data-style="liquid"] .support-ask-already { border-top-color: var(--sheet-line); }
:root[data-style="liquid"] .support-ask-already:hover { color: var(--sheet-text); }

/* ── Sheets ────────────────────────────────────────────────────── */
:root[data-style="liquid"] :is(.upd-overlay, .rn-overlay, .perf-sheet-overlay, .weather-overlay, .day-modal-backdrop, .ai-pc-confirm, .picker-overlay, .call-overlay, .gc-overlay, .diskw-advisor-modal, .ask-overlay, .widget-palette-overlay, .deck-ed-backdrop, .deck-mix-backdrop, .deck-style-modal, .xfer-sheet-backdrop, .support-sheet-overlay, .preset-modal-overlay:not(.cst-overlay, .capg-overlay)) {
  background: var(--sheet-scrim);
  -webkit-backdrop-filter: var(--sheet-scrim-blur);
  backdrop-filter: var(--sheet-scrim-blur);
}
:root[data-style="liquid"] :is(.upd-card, .rn-card, .perf-sheet, .weather-panel, .day-modal-card, .ai-pc-card, .picker-panel, .call-card, .gc-card, .diskw-advisor-dialog, .ask-sheet, .xm-frame, .widget-palette-modal, .deck-ed-modal, .deck-mix-modal, .deck-style-dialog, .deck-asw, .xfer-sheet, .support-sheet, .preset-modal:not(.cst, .cgal-modal)) {
  border: 1px solid var(--sheet-edge);
  border-radius: 16px;
  background: var(--sheet-sheen), linear-gradient(var(--sheet-fill) 0 0);
  box-shadow: var(--sheet-rim), var(--sheet-lift);
  color: var(--sheet-text);
}
:root[data-style="liquid"] :is(.perf-sheet, .xm-frame) { -webkit-backdrop-filter: none; backdrop-filter: none; }
:root[data-style="liquid"] .picker-backdrop { background: none; }
:root[data-style="liquid"] .widget-palette-modal {
  --pal-text: var(--sheet-text);
  --pal-muted: var(--sheet-muted);
  --pal-well: var(--sheet-well);
  --pal-well-hover: var(--sheet-well-hover);
  --pal-line: var(--sheet-line);
}
/* The support sheet reads the theme roles: on glass they are the sheet's own. */
:root[data-style="liquid"] .support-sheet {
  --text: var(--sheet-text); --muted-text: var(--sheet-muted); --control-bg: var(--sheet-well); --hover-bg: var(--sheet-well-hover); --line: var(--sheet-line);
}
/* Send to PC stands on the bottom edge of a phone, so it keeps square feet there. */
:root[data-style="liquid"] .xfer-sheet {
  --text: var(--sheet-text); --text-dim: var(--sheet-muted); --text-muted: var(--sheet-muted); --muted-text: var(--sheet-muted);
  --control-bg: var(--sheet-well); --hover-bg: var(--sheet-well-hover); --line: var(--sheet-line);
}
@media (max-width: 699.98px) {
  :root[data-style="liquid"] .xfer-sheet-backdrop .xfer-sheet { border-bottom: 0; border-radius: 16px 16px 0 0; }
}
/* The Deck's windows: what is selected is neutral, as on every other sheet of this skin. */
:root[data-style="liquid"] :is(.deck-ed-modal, .deck-mix-modal, .deck-style-dialog, .deck-asw) {
  --text: var(--sheet-text); --text-dim: var(--sheet-muted); --muted-text: var(--sheet-muted);
  --control-bg: var(--sheet-well); --hover-bg: var(--sheet-well-hover); --input-bg: var(--sheet-well);
  --line: var(--sheet-line); --divider: var(--sheet-line); --surface-alt: var(--sheet-well);
  --ded-text: var(--sheet-text);
  --ded-muted: var(--sheet-muted);
  --ded-well: var(--sheet-well);
  --ded-well-hover: var(--sheet-well-hover);
  --ded-line: var(--sheet-line);
  --ded-on: var(--sheet-line);
  --ded-on-ink: var(--sheet-text);
}
:root[data-style="liquid"] :is(.deck-ed-tab.active, .deck-ed-segbtn.active) { color: var(--ded-on-ink); background-color: var(--ded-on); }
:root[data-style="liquid"] .deck-style-dialog .deck-seg button.active { color: var(--ded-on-ink); }
:root[data-style="liquid"] .picker-panel {
  --text: var(--sheet-text); --muted-text: var(--sheet-muted); --dim-text: var(--sheet-muted);
}
:root[data-style="liquid"] .picker-close { border-color: transparent; border-radius: 10px; background: none; color: var(--sheet-muted); }
:root[data-style="liquid"] .picker-close:hover { background: var(--sheet-well-hover); color: var(--sheet-text); }
:root[data-style="liquid"] .picker-item { border: 0; border-radius: 10px; background: var(--sheet-well); }
:root[data-style="liquid"] .picker-item + .picker-item { margin-top: 6px; }
:root[data-style="liquid"] .picker-item:hover { background: var(--sheet-well-hover); }
