/* The liquid-glass cards (liquid/card.js, liquid/manager.js). Loaded last, after glass.css.
   Part of the StreamHost port of liquid-glass (github.com/bilalgursen/liquid-glass), MIT, Copyright (c) 2026 Bilal Abdullah Gürşen;
   see /static/liquid/LICENSE. The block between the liquid:verbatim markers is the library's GLASS_CSS (glass-layer.tsx), byte for byte,
   generated by scripts/liquid-port.mjs (never edit it by hand). The card look below is translated from glass-card.tsx (its Tailwind
   fallback classes and its shadow span); the card's tint, frost and saturation are after Glisse (github.com/0kzh/glisse, MIT).

   Which cards: every .lq-card (built with lqCard(); its CSS look shows even with the switch off), and, only while the root element has
   data-cards="new" (the per-device switch, liquid/cards.js), the curated portal cards. The curated list below must equal CURATED_CARDS
   of liquid/cards.js (web-liquid-card.test.mjs checks it). With the switch off nothing here matches anything but .lq-card, its canvas
   and the attributes of the glass, so glass.css, sticker.css and dark.css give back exactly the old look.

   LQ below stands for :is(:root[data-cards="new"] :is(.ov-card, .ov-line, .ps-card, .intro-card), .lq-card): specificity (0,3,0) for
   both branches, so it beats glass.css's card rule (0,1,0), .post-row:hover (0,2,0), sticker.css (0,1,0) and the per-card rules of
   dash.css, plan.css and intro.css (0,1,0); its dark forms are (0,5,0). LOOK is LQ with .lq-card:not([data-lq-material="tinted"])
   as its second branch: the clear look (fill, line, frost) is the library's fallback.clear; fallback.tinted is '' (glass-card.tsx),
   so a tinted card keeps the fill, line and text colour of the caller's own class, which its glass then reads. Once the glass draws,
   the library's ready rule (!important) strips the host's look; the shadow lives on ::after (the library's span), outside the host
   box, so it stays in both looks and on both materials.

   An .lq-card takes position and isolation from the library's layered :where([data-glass-host]) rule above and its corners from
   :where(.lq-card) (no specificity), so a caller's class (absolute, fixed, its own border-radius) wins, as with the library's
   utility classes; --lq-radius is the other way to change the corners. Only the curated cards get them at (0,3,0).

   Without this sheet an .lq-card has no look and no positioned box (its canvas then lies against the page, behind the body),
   while the manager still gives it glass: the sheet is part of the card, like the library's GLASS_CSS (index.html links it;
   a page that builds lqCard() hosts must link it too). */

/* 1. the library's own rules (GLASS_CSS) */
/* <liquid:verbatim id="R-S1" src="glass-layer.tsx" lines="271-287"> */
/* Layered, so a utility class on the host (absolute, fixed) still wins over relative. */
@layer components{:where([data-glass-host]){position:relative;isolation:isolate}}
/* Unlayered on purpose: once the glass draws, it must beat the host's own fill utilities. */
[data-glass-host][data-glass-ready]{background:transparent!important;border-color:transparent!important;box-shadow:none!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
@keyframes glass-marquee{to{transform:translateX(-50%)}}
[data-glass-marquee]{animation:glass-marquee var(--glass-marquee-duration,5s) linear infinite}
/* Swapped labels and icons rise from a soft blur; a check draws itself in. */
@keyframes glass-in{from{opacity:0;filter:blur(3px);transform:translateY(4px)}}
[data-glass-in]{animation:glass-in .38s cubic-bezier(.2,.8,.2,1) both}
@keyframes glass-draw{from{stroke-dashoffset:25}}
[data-glass-draw]{stroke-dasharray:25;animation:glass-draw .42s cubic-bezier(.65,0,.35,1) .12s both}
@keyframes glass-spin{to{transform:rotate(1turn)}}
[data-glass-spin]{animation:glass-spin .8s linear infinite}
[data-glass-ready] [data-glass-fallback]{visibility:hidden}
/* A hidden fallback stops moving too. Its marquee ran on unseen, on the main thread, and made the browser work out the page's layers again on every frame of anything else on the page. */
[data-glass-ready] [data-glass-fallback] [data-glass-marquee]{animation:none}
@media (prefers-reduced-motion:reduce){[data-glass-marquee],[data-glass-in],[data-glass-draw],[data-glass-spin]{animation:none}}
/* </liquid:verbatim> */

/* 2. tokens (light; then the dark theme, chosen or from the system) */
:root {
  --lq-radius: 28px;
  --lq-fill: #fff;
  --lq-line: transparent;
  --lq-ink: #171717;
  --lq-solid: #f5f5f7;
  --lq-shadow: 0 16.5px 36px rgba(0, 0, 0, 0.08), 0 26.4px 55.9px rgba(0, 0, 0, 0.08); /* SHADOW of glass-card.tsx */
}
:root[data-theme="dark"] {
  --lq-fill: #282828;
  --lq-line: rgb(255 255 255 / 0.45);
  --lq-ink: #fff;
  --lq-solid: #2a2a2c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --lq-fill: #282828;
    --lq-line: rgb(255 255 255 / 0.45);
    --lq-ink: #fff;
    --lq-solid: #2a2a2c;
  }
}

/* 3. the card look: the library's fallback (shown before the first glass frame, and for good without WebGL2): corners for every
   card, the clear look (LOOK) for all but a tinted .lq-card. The tint amount is resolved on the host, where lqCard() puts
   --glass-card-tint (-dark) and --glass-card-blur. */
:root[data-cards="new"] :is(.ov-card, .ov-line, .ps-card, .intro-card) {
  position: relative;
  isolation: isolate;
  border-radius: var(--lq-radius);
}
:where(.lq-card) {
  border-radius: var(--lq-radius);
}
:is(:root[data-cards="new"] :is(.ov-card, .ov-line, .ps-card, .intro-card), .lq-card:not([data-lq-material="tinted"])) {
  --lq-amount: var(--glass-card-tint, 85%);
  border: 1px solid var(--lq-line);
  background: color-mix(in srgb, var(--glass-tint, var(--lq-fill)) var(--lq-amount), transparent);
  -webkit-backdrop-filter: blur(var(--glass-card-blur, 3px)) saturate(150%);
  backdrop-filter: blur(var(--glass-card-blur, 3px)) saturate(150%);
  box-shadow: none;
}
:root[data-theme="dark"] :is(:root[data-cards="new"] :is(.ov-card, .ov-line, .ps-card, .intro-card), .lq-card:not([data-lq-material="tinted"])) {
  --lq-amount: var(--glass-card-tint-dark, 62%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(:root[data-cards="new"] :is(.ov-card, .ov-line, .ps-card, .intro-card), .lq-card:not([data-lq-material="tinted"])) {
    --lq-amount: var(--glass-card-tint-dark, 62%);
  }
}

/* 4. the shadow (the library's span under the glass): two soft layers outside the box. It replaces glass.css's lines on ::after. */
:is(:root[data-cards="new"] :is(.ov-card, .ov-line, .ps-card, .intro-card), .lq-card)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: var(--lq-shadow);
  background: none;
}

/* 5. the glass's canvas (the library's inline style; the layer sets its place and size with style.setProperty) */
.lq-canvas {
  position: absolute;
  z-index: -1;
  max-width: none;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* 6. the old edge of glass.js never shows on a curated card while the switch is on */
:root[data-cards="new"] :is(.ov-card, .ov-line, .ps-card, .intro-card) > .gl-ring {
  display: none;
}

/* 7. per card: the status banner keeps its 20px corners (28px on a 46px banner is a pill); its warn/bad colours tint the glass */
:root[data-cards="new"] .ov-line {
  --lq-radius: 20px;
}
:root[data-cards="new"] .ov-line.warn {
  --glass-tint: color-mix(in srgb, #f5b83d 24%, var(--lq-fill));
}
:root[data-cards="new"] .ov-line.bad {
  --glass-tint: color-mix(in srgb, var(--error) 22%, var(--lq-fill));
}

/* 8. text: only the library's own clear card follows the tone of its glass (curated cards keep the theme's colours; a tinted card
   keeps the caller's, as fallback.tinted is ''). The tone rules (0,3,0) are stronger than the theme rule (0,2,0), as in the library. */
.lq-card:not([data-lq-material="tinted"]) {
  color: var(--lq-ink);
}
.lq-card:not([data-lq-material="tinted"])[data-glass-tone="dark"] {
  color: #fff;
}
.lq-card:not([data-lq-material="tinted"])[data-glass-tone="light"] {
  color: #171717;
}

/* 9. fallbacks: the manager does not put glass on a card under any of these, so the CSS look is the card.
   Less transparency or more contrast: the clear look turns solid. A tinted card keeps the caller's fill: its colour is the
   caller's meaning, and with no glass drawn nothing of ours is see-through on it (the caller's own class answers for its
   contrast). Forced colours: every card, tinted too, becomes Canvas with CanvasText and a line, and loses its shadow (the
   browser forces the caller's colours to system colours there anyway; this makes the card a plain readable box). */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  :is(:root[data-cards="new"] :is(.ov-card, .ov-line, .ps-card, .intro-card), .lq-card:not([data-lq-material="tinted"])) {
    background: var(--lq-solid);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .lq-canvas {
    display: none;
  }
}
@media (forced-colors: active) {
  :is(:root[data-cards="new"] :is(.ov-card, .ov-line, .ps-card, .intro-card), .lq-card) {
    background: Canvas;
    color: CanvasText;
    border-color: CanvasText;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  :is(:root[data-cards="new"] :is(.ov-card, .ov-line, .ps-card, .intro-card), .lq-card)::after {
    box-shadow: none;
  }
  .lq-canvas {
    display: none;
  }
}
/* A browser that cannot blur a backdrop: a denser clear tint (in the dark too: the dark forms above are stronger than the plain one). */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :is(:root[data-cards="new"] :is(.ov-card, .ov-line, .ps-card, .intro-card), .lq-card:not([data-lq-material="tinted"])),
  :root[data-theme="dark"] :is(:root[data-cards="new"] :is(.ov-card, .ov-line, .ps-card, .intro-card), .lq-card:not([data-lq-material="tinted"])) {
    --lq-amount: 92%;
  }
}
@media (prefers-color-scheme: dark) {
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    :root:not([data-theme="light"]) :is(:root[data-cards="new"] :is(.ov-card, .ov-line, .ps-card, .intro-card), .lq-card:not([data-lq-material="tinted"])) {
      --lq-amount: 92%;
    }
  }
}
@media print {
  .lq-canvas {
    display: none;
  }
}
