/* ==========================================================================
   Liquid Glass design system
   Requires the shared SVG filters (#liquid-refraction, #liquid-goo) from
   templates/_liquid_defs.html and static/js/liquid-engine.js for rim lighting.
   ========================================================================== */

@property --px  { syntax: "<length>"; inherits: false; initial-value: 50px; }
@property --py  { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --rim { syntax: "<number>"; inherits: false; initial-value: 0; }

:root {
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);      /* under-damped jelly overshoot */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --cyan: #ffffff;                                  /* Primary pure white accent */
  --violet: #d1d5db;                                /* Silver secondary accent */
  --ok: #f3f4f6;                                    /* Crisp white-platinum status */
  --warn: #9ca3af;                                  /* Slate silver status */
  --bad: #f87171;                                   /* Soft crimson for critical alerts */
  --ink: #ffffff;                                   /* High-contrast pure white text */
  --ink-dim: rgba(255, 255, 255, .72);              /* Neutral silver secondary text */
  --ink-faint: rgba(255, 255, 255, .42);            /* Subtle slate metadata text */
  --rail-w: 252px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
html[data-rail="collapsed"] { --rail-w: 88px; }
@media (max-width: 767.98px) { :root, html[data-rail="collapsed"] { --rail-w: 0px; } }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #000000;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }

/* ---------- Animated backdrop (white-on-black-on-grey refraction) ---------- */
.lg-backdrop {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(1200px 800px at 15% 10%, #151821 0%, transparent 65%),
    radial-gradient(1000px 700px at 85% 90%, #0d0f14 0%, transparent 65%),
    #000000;
}
.lg-backdrop::after {               /* fine silver grid: visibly bends under refractive glass */
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 25%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 25%, transparent 85%);
}
.lg-orb { position: absolute; border-radius: 50%; will-change: transform; filter: blur(40px); }
.lg-orb.o1 { width: 52vmax; height: 52vmax; left: -14vmax; top: -16vmax;
  background: radial-gradient(circle, rgba(255, 255, 255, .12), rgba(180, 195, 215, .05) 50%, transparent 70%); animation: orb1 26s ease-in-out infinite alternate; }
.lg-orb.o2 { width: 48vmax; height: 48vmax; right: -16vmax; top: 14vh;
  background: radial-gradient(circle, rgba(160, 175, 195, .10), rgba(90, 100, 115, .04) 50%, transparent 70%); animation: orb2 31s ease-in-out infinite alternate; }
.lg-orb.o3 { width: 44vmax; height: 44vmax; left: 22vw; bottom: -24vmax;
  background: radial-gradient(circle, rgba(210, 220, 235, .09), transparent 68%); animation: orb3 29s ease-in-out infinite alternate; }
.lg-orb.o4 { width: 26vmax; height: 26vmax; left: 52vw; top: 6vh;
  background: radial-gradient(circle, rgba(255, 255, 255, .08), transparent 68%); animation: orb4 22s ease-in-out infinite alternate; }
@keyframes orb1 { to { transform: translate3d(14vmax, 10vmax, 0) scale(1.1); } }
@keyframes orb2 { to { transform: translate3d(-12vmax, 12vmax, 0) scale(.92); } }
@keyframes orb3 { to { transform: translate3d(12vmax, -10vmax, 0) scale(1.15); } }
@keyframes orb4 { to { transform: translate3d(-18vmax, 16vmax, 0) scale(1.2); } }

/* ==========================================================================
   Core glass surface: .liquid-card / .liquid-pill / .liquid-button
   ========================================================================== */
.liquid-card, .liquid-pill, .liquid-button {
  --px: 50px; --py: 0px; --rim: 0;
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, .11) 0%, rgba(24, 27, 34, .75) 45%, rgba(10, 12, 16, .90) 100%);
  -webkit-backdrop-filter: blur(20px) saturate(140%) brightness(1.05);
  backdrop-filter: blur(20px) saturate(140%) brightness(1.05);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.58),
    inset 0 -1px 2px rgba(255, 255, 255, 0.08),
    0 16px 40px rgba(0, 0, 0, .75),
    0 2px 8px rgba(0, 0, 0, .5);
  transition:
    transform .55s var(--spring),
    box-shadow .4s var(--ease-out),
    background-color .3s,
    --rim .45s var(--ease-out);
}
/* Chromium only: true optical refraction through the SVG displacement filter.
   (Other engines ignore url() in backdrop-filter, so the class is set by liquid-engine.js.) */
html.lg-refract .liquid-card,
html.lg-refract .liquid-pill {
  -webkit-backdrop-filter: url(#liquid-refraction) blur(20px) saturate(140%) brightness(1.05);
  backdrop-filter: url(#liquid-refraction) blur(20px) saturate(140%) brightness(1.05);
}
/* Small controls nested in cards keep plain blur for performance */
html.lg-refract .liquid-button { backdrop-filter: blur(14px) saturate(140%) brightness(1.05); }

/* Specular rim: a 1px border ring lit by a radial highlight that follows the pointer */
.liquid-card::before, .liquid-pill::before, .liquid-button::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; z-index: 2;
  background: radial-gradient(200px circle at var(--px) var(--py),
      rgba(255, 255, 255, .98) 0%, rgba(255, 255, 255, .45) 35%, rgba(255, 255, 255, .06) 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: calc(.38 + var(--rim) * .62);
  pointer-events: none;
}
/* Soft interior sheen under the pointer */
.liquid-card::after, .liquid-pill::after, .liquid-button::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: radial-gradient(260px circle at var(--px) var(--py), rgba(255, 255, 255, .15), transparent 62%);
  opacity: var(--rim);
  pointer-events: none;
}

/* Jelly springs */
@media (hover: hover) {
  .liquid-card.is-interactive:hover { transform: translateY(-3px) scale(1.012); }
  .liquid-button:hover:not(:disabled) { transform: scale(1.05); }
}
.liquid-button:active:not(:disabled), .liquid-card.is-interactive:active { transform: scale(.95, .92); transition-duration: .12s; }

.liquid-card { border-radius: 28px; padding: 20px; }
.liquid-pill { border-radius: 999px; }

.liquid-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border: 0; border-radius: 999px;
  font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink);
}
.liquid-button svg { width: 18px; height: 18px; flex: none; }
.liquid-button.is-primary {
  background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 60%, #cbd5e1 100%);
  color: #000000 !important;
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(255, 255, 255, .25), inset 0 1px 1px #ffffff;
}
.liquid-button.is-primary svg { color: #000000; }
.liquid-button.is-primary:hover:not(:disabled) {
  box-shadow: 0 6px 26px rgba(255, 255, 255, .45), inset 0 1px 1px #ffffff;
}
.liquid-button.is-danger  {
  background: linear-gradient(140deg, rgba(248, 113, 113, .35), rgba(75, 85, 99, .5));
  border: 1px solid rgba(248, 113, 113, .55);
}
.liquid-button:disabled { opacity: .45; cursor: not-allowed; }
.liquid-button.is-round { width: 36px; min-height: 36px; padding: 0; }
.liquid-button.is-round svg { width: 16px; height: 16px; }

/* No backdrop-filter support at all: fall back to denser tinted glass */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .liquid-card, .liquid-pill, .liquid-button { background: linear-gradient(140deg, rgba(30, 34, 42, .92), rgba(12, 14, 18, .96)); }
}

/* ==========================================================================
   Typography & small primitives
   ========================================================================== */
.eyebrow { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }
.view-title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: .01em; }
.muted { color: var(--ink-dim); }
.mono { font-family: var(--mono); }
.kbd {
  display: inline-block; font: 600 10px/1 var(--mono); padding: 4px 6px; border-radius: 8px; color: var(--ink-dim);
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28); white-space: nowrap;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: var(--ink-dim);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #64748b; display: inline-block; flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.dot.warn { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.dot.bad { background: var(--bad); box-shadow: 0 0 10px var(--bad); }

/* ==========================================================================
   App shell
   ========================================================================== */
/* Floating status island */
.island {
  position: fixed; z-index: 50; top: calc(12px + var(--safe-top)); left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 8px 0 16px;
  max-width: calc(100vw - 20px); font-size: 12px; font-weight: 500; white-space: nowrap;
  transition: left .55s var(--spring), transform .55s var(--spring), box-shadow .4s, --rim .45s;
}
/* centre over the workspace (right of the rail) */
@media (min-width: 768px) { .island { left: calc(var(--rail-w) + 16px + (100vw - var(--rail-w) - 16px) / 2); } }
.island .chip { display: inline-flex; align-items: center; gap: 7px; }
.island .chip small { color: var(--ink-faint); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.island .sep { width: 1px; height: 18px; background: rgba(255, 255, 255, .16); }
.island .val { font-variant-numeric: tabular-nums; }
.ping-good { color: var(--ok); } .ping-mid { color: var(--warn); } .ping-bad { color: var(--bad); }
@media (max-width: 420px) { .island { gap: 9px; padding-left: 12px; } .island .chip small { display: none; } }

/* Workspace */
.workspace {
  position: fixed; inset: 0; display: flex; gap: 16px;
  padding: calc(74px + var(--safe-top)) 16px 16px calc(var(--rail-w) + 32px);
  transition: padding-left .55s var(--spring);
}
@media (max-width: 767.98px) {
  .workspace { padding: calc(70px + var(--safe-top)) 12px calc(104px + var(--safe-bottom)) 12px; }
}
.pane {
  flex: 1 1 0; min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 6px; border-radius: 32px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .22) transparent; outline: none;
  transition: box-shadow .4s var(--ease-out);
}
.pane.is-focused { box-shadow: 0 0 0 1px rgba(255, 255, 255, .42), 0 0 32px rgba(255, 255, 255, .15); }
.pane::-webkit-scrollbar { width: 8px; }
.pane::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .2); border-radius: 8px; }
.pane[hidden] { display: none; }

/* ---------- Navigation (shared indicator / goo) ---------- */
.nav-list { position: relative; display: grid; }
.goo { position: absolute; inset: 0; filter: url(#liquid-goo); opacity: .92; pointer-events: none; z-index: 0; }
.goo .blob {
  position: absolute; left: 0; top: 0; width: var(--iw, 0px); height: var(--ih, 0px);
  transform: translate(var(--ix, 0px), var(--iy, 0px));
  border-radius: 999px;
  background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 60%, #cbd5e1 100%);
  box-shadow: 0 2px 14px rgba(255, 255, 255, .35), inset 0 1px 1px #ffffff;
}
.goo .blob.a { transition: transform .55s var(--spring), width .55s var(--spring), height .55s var(--spring); }
.goo .blob.b { transition: transform .85s var(--ease-out) .06s, width .85s var(--ease-out), height .85s var(--ease-out); }
.goo.no-anim .blob { transition: none !important; }

.nav-btn {
  position: relative; z-index: 1; display: flex; align-items: center; border: 0; background: none; color: var(--ink-dim);
  transition: color .3s, transform .5s var(--spring);
}
.nav-btn svg { width: 22px; height: 22px; flex: none; }
.nav-btn:hover { color: var(--ink); }
.nav-btn:active { transform: scale(.92); transition-duration: .1s; }
.nav-btn.active { color: #000000; font-weight: 700; }
.nav-btn.active svg { color: #000000; stroke: #000000; animation: pop .65s var(--spring); }
@keyframes pop { 0% { transform: scale(.6); } 100% { transform: scale(1); } }

/* Rail (>= 768px) */
.rail {
  position: fixed; z-index: 40; left: 16px; top: calc(12px + var(--safe-top)); bottom: 16px; width: var(--rail-w);
  padding: 14px 12px; border-radius: 32px; display: flex; flex-direction: column; gap: 12px; overflow: hidden;
  transition: width .55s var(--spring), transform .5s var(--spring), box-shadow .4s, --rim .45s;
}
@media (max-width: 767.98px) { .rail { display: none; } }
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 8px; font-weight: 800; letter-spacing: .14em; font-size: 13px; white-space: nowrap; }
.rail-brand svg { width: 26px; height: 26px; flex: none; color: #ffffff; }
.rail .nav-list { gap: 6px; }
.rail .nav-btn { height: 52px; gap: 14px; padding: 0 15px; border-radius: 20px; width: 100%; text-align: left; font-size: 14px; font-weight: 600; white-space: nowrap; }
.rail .nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.rail .goo .blob { border-radius: 20px; }
.rail-foot { margin-top: auto; display: grid; gap: 10px; }
.rail-hints { display: grid; gap: 8px; padding: 12px; border-radius: 20px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); font-size: 11px; color: var(--ink-dim); }
.rail-hints div { display: flex; justify-content: space-between; align-items: center; gap: 8px; white-space: nowrap; }
.rail-toggle { align-self: stretch; }
.rail-toggle svg { transition: transform .55s var(--spring); }
html[data-rail="collapsed"] .rail-toggle svg { transform: rotate(180deg); }
html[data-rail="collapsed"] .nav-label,
html[data-rail="collapsed"] .rail .kbd,
html[data-rail="collapsed"] .rail-hints,
html[data-rail="collapsed"] .rail-brand span,
html[data-rail="collapsed"] .rail-install span { display: none; }
html[data-rail="collapsed"] .rail .nav-btn { justify-content: center; padding: 0; }

/* Dock (< 768px) */
.dock {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + var(--safe-bottom)); width: min(calc(100vw - 24px), 440px); padding: 8px; border-radius: 34px;
}
@media (min-width: 768px) { .dock { display: none; } }
.dock .nav-list { grid-template-columns: repeat(5, 1fr); }
.dock .nav-btn { flex-direction: column; justify-content: center; gap: 4px; height: 58px; border-radius: 26px; font-size: 10px; font-weight: 600; letter-spacing: .04em; }
.dock .goo .blob { border-radius: 26px; }

/* ---------- Views ---------- */
.view { display: grid; gap: 16px; align-content: start; }
.view-enter { animation: view-in .65s var(--spring) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(18px) scale(.95); } to { opacity: 1; transform: none; } }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 4px 6px 0; }
.view-head p { margin: 4px 0 0; font-size: 13px; color: var(--ink-dim); }

.grid { display: grid; gap: 16px; }
.grid.cols-metrics { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grid.cols-tiles { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.grid.cols-power { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }

.metric { display: flex; align-items: center; gap: 14px; }
.ring { width: 64px; height: 64px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.ring .bg { stroke: rgba(255, 255, 255, .1); }
.ring .fg { stroke: #ffffff; stroke-dasharray: 0 100; transition: stroke-dasharray .8s var(--spring); filter: drop-shadow(0 0 6px rgba(255, 255, 255, .7)); }
.metric .num { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.metric .lbl { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }

.spark { width: 100%; height: 96px; display: block; }
.spark .line { fill: none; stroke: #ffffff; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .6)); }
.spark .area { fill: url(#spark-fill); stroke: none; }
.spark .base { stroke: rgba(255, 255, 255, .12); stroke-dasharray: 4 6; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; font-size: 13px; }
.kv dt { color: var(--ink-faint); }
.kv dd { margin: 0; word-break: break-all; }

.power-tile { flex-direction: column; min-height: 124px; border-radius: 28px; gap: 10px; font-size: 12px; }
.power-tile svg { width: 30px; height: 30px; }

.path-pill { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 13px; font-family: var(--mono); overflow: hidden; }
.path-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.root-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.root-list li { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 20px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); word-break: break-all; font-size: 13px; }
.root-list svg { width: 20px; height: 20px; color: #ffffff; flex: none; }
.empty { padding: 28px 12px; text-align: center; color: var(--ink-faint); font-size: 13px; }

.slot { aspect-ratio: 1; border-radius: 26px; display: grid; place-items: center; border: 1.5px dashed rgba(255, 255, 255, .2); color: var(--ink-faint); background: rgba(255, 255, 255, .02); }
.slot svg { width: 26px; height: 26px; }

.screen-stage { aspect-ratio: 16 / 9; width: 100%; padding: 0; overflow: hidden; display: grid; place-items: center; text-align: center; border-radius: 30px; }
.screen-stage canvas, .screen-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: inherit; z-index: 1; }
.screen-status { position: relative; z-index: 3; display: grid; gap: 8px; justify-items: center; padding: 16px; }
.screen-status .big { font-size: 15px; font-weight: 600; }
.screen-result { min-height: 18px; font-size: 12px; }
.screen-result.ok { color: var(--ok); } .screen-result.bad { color: var(--bad); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ==========================================================================
   Liquid Glass morphing loader  (LiquidLoader.show / hide / inline)
   ========================================================================== */
.ll-overlay {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; align-content: center; gap: 22px;
  background: rgba(4, 7, 13, .5);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  opacity: 0; visibility: hidden; transition: opacity .35s var(--ease-out), visibility 0s .35s;
}
.ll-overlay.is-visible { opacity: 1; visibility: visible; transition: opacity .35s var(--ease-out), visibility 0s; }

.ll-stage { --s: 1; position: relative; width: 148px; height: 148px; flex: none; }
.ll-glow { position: absolute; inset: 0; filter: drop-shadow(0 0 16px rgba(255, 255, 255, .5)) drop-shadow(0 0 28px rgba(180, 195, 215, .35)); }
.ll-goo { position: absolute; inset: 0; filter: url(#liquid-goo); }
.ll-orbit { position: absolute; inset: 0; animation: ll-spin var(--dur, 4s) linear infinite; animation-direction: var(--dir, normal); }
.ll-drop {
  position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  animation: ll-breathe var(--bre, 3.4s) ease-in-out infinite;
}
.ll-drop.cyan { background: radial-gradient(circle at 35% 30%, #ffffff, #e2e8f0 60%, #94a3b8); }
.ll-drop.violet { background: radial-gradient(circle at 35% 30%, #cbd5e1, #64748b 60%, #334155); }
.ll-orbit.o1 { --dur: 3.6s; --bre: 3.4s; }
.ll-orbit.o2 { --dur: 4.8s; --bre: 4.1s; --dir: reverse; }
.ll-orbit.o3 { --dur: 6.2s; --bre: 5s; animation-delay: -1.5s; }
.ll-orbit.o3 .ll-drop { animation-delay: -2s; }
@keyframes ll-spin { to { transform: rotate(360deg); } }
@keyframes ll-breathe { 0%, 100% { transform: translateX(42px); } 50% { transform: translateX(3px); } }

.ll-lens { position: absolute; inset: 0; border-radius: 50%; padding: 0; pointer-events: none;
  -webkit-backdrop-filter: blur(5px) saturate(190%) brightness(1.1); backdrop-filter: blur(5px) saturate(190%) brightness(1.1); }
html.lg-refract .ll-lens { -webkit-backdrop-filter: url(#liquid-refraction) blur(5px) saturate(190%) brightness(1.1); backdrop-filter: url(#liquid-refraction) blur(5px) saturate(190%) brightness(1.1); }

.ll-text { font-size: 12px; letter-spacing: .26em; text-transform: uppercase; color: var(--ink-dim); font-weight: 600; text-align: center; max-width: 80vw; }
.ll-text::after { content: ""; display: inline-block; width: 1.4em; text-align: left; animation: ll-dots 1.4s steps(4, end) infinite; }
@keyframes ll-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75%, 100% { content: "..."; } }

.ll-inline { display: grid; place-items: center; gap: 0; padding: 0; }
.ll-inline .ll-stage { transform: scale(.62); margin: -28px; }
.ll-inline .ll-text { font-size: 10px; letter-spacing: .2em; }
.ll-cover { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; border-radius: inherit; background: rgba(0, 0, 0, .45); }

/* ==========================================================================
   Login
   ========================================================================== */
.login-wrap { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; }
.login-stack { position: relative; width: min(100%, 410px); }
.login-card { padding: 34px 28px 28px; border-radius: 38px; text-align: center; display: grid; gap: 22px; animation: float 7s ease-in-out infinite; }
.login-shadow {
  position: absolute; left: 12%; right: 12%; bottom: -34px; height: 26px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, .75), transparent 70%); filter: blur(6px); animation: float-shadow 7s ease-in-out infinite; z-index: -1;
}
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@keyframes float-shadow { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(.82); opacity: .55; } }
.login-logo { width: 62px; height: 62px; margin: 0 auto; border-radius: 22px; display: grid; place-items: center; color: #ffffff; }
.login-logo svg { width: 30px; height: 30px; color: #ffffff; }
.login-card h1 { margin: 0; font-size: 22px; letter-spacing: .18em; font-weight: 800; }
.login-card p { margin: 6px 0 0; font-size: 13px; color: var(--ink-dim); }
.otp { display: flex; justify-content: center; gap: clamp(6px, 2vw, 10px); }
.otp input {
  width: clamp(38px, 11.5vw, 48px); height: 58px; border-radius: 18px; text-align: center; font: 700 24px var(--mono); caret-color: #ffffff;
  color: #fff; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .16); outline: none;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .24), inset 0 -1px 2px rgba(255, 255, 255, .08);
  transition: transform .45s var(--spring), border-color .25s, box-shadow .3s, background-color .25s;
}
.otp input:focus { transform: scale(1.1); border-color: #ffffff; background: rgba(255, 255, 255, .12); box-shadow: 0 0 0 3px rgba(255, 255, 255, .25), inset 0 1px 1px rgba(255, 255, 255, .4); }
.otp input.filled { border-color: rgba(255, 255, 255, .6); }
.otp.shake { animation: shake .55s var(--spring); }
@keyframes shake { 0%, 100% { translate: 0 0; } 18% { translate: -10px 0; } 38% { translate: 8px 0; } 58% { translate: -5px 0; } 78% { translate: 3px 0; } }
.login-msg { min-height: 18px; margin: 0 !important; font-size: 12px !important; }
.login-msg.ok { color: var(--ok) !important; } .login-msg.bad { color: var(--bad) !important; }
.login-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--ink-dim); }
.link-btn { background: none; border: 0; padding: 4px 6px; color: #ffffff; font-weight: 600; font-size: 12px; transition: transform .4s var(--spring), opacity .2s; }
.link-btn:disabled { opacity: .4; cursor: not-allowed; }
.link-btn:hover:not(:disabled) { transform: scale(1.08); }
.login-card .liquid-button { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .lg-orb, .login-card, .login-shadow, .ll-orbit, .ll-drop { animation: none !important; }
}

/* ==========================================================================
   Telemetry module: liquid-wave gauges, core bars, bars, process table
   ========================================================================== */
@property --tone  { syntax: "<color>"; inherits: true; initial-value: #ffffff; }
@property --tone2 { syntax: "<color>"; inherits: true; initial-value: #94a3b8; }

[data-tone] { transition: --tone .9s var(--ease-out), --tone2 .9s var(--ease-out); }
[data-tone="cool"] { --tone: #ffffff; --tone2: #94a3b8; }    /* liquid white -> silver  (< 65 %) */
[data-tone="warn"] { --tone: #cbd5e1; --tone2: #64748b; }    /* slate silver            (65-85 %) */
[data-tone="hot"]  { --tone: #f87171; --tone2: #b91c1c; }    /* soft crimson alert      (> 85 % / > 80 C) */

.t-grid { display: grid; gap: 16px; }
.t-gauges { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.t-cols { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }

.live-badge .dot { transition: background-color .3s, box-shadow .3s; }
.live-badge.is-live .dot { background: #ffffff; box-shadow: 0 0 10px #ffffff; animation: live-pulse 1.5s ease-in-out infinite; }
.live-badge.is-wait .dot { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.live-badge.is-off .dot { background: var(--bad); box-shadow: 0 0 10px var(--bad); }
@keyframes live-pulse { 50% { transform: scale(1.5); opacity: .6; } }

/* ----- Liquid gauge ----- */
.gauge { display: grid; justify-items: center; gap: 14px; padding: 20px 14px 18px; text-align: center; }
.gauge[data-off] .tank { opacity: .55; }
.tank {
  position: relative; width: 120px; height: 120px; border-radius: 50%; overflow: hidden; isolation: isolate; transform: translateZ(0);
  background: rgba(255, 255, 255, .035);
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .16), 0 0 24px rgba(0, 0, 0, .25);
}
.tank::after {                                   /* glass gloss over the liquid */
  content: ""; position: absolute; inset: 0; border-radius: 50%; z-index: 4; pointer-events: none;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .42), transparent 36%),
    linear-gradient(180deg, transparent 58%, rgba(255, 255, 255, .1));
}
.liquid {
  position: absolute; inset: 0; z-index: 1; color: var(--tone);
  transform: translateY(calc(100% - var(--lvl, 0%)));
  transition: transform 1.1s var(--spring);        /* jelly overshoot when the level changes */
  will-change: transform;
}
.liquid .body { position: absolute; inset: 0; background: linear-gradient(180deg, var(--tone), var(--tone2)); opacity: .88; }
.crest {
  position: absolute; left: 0; top: -11px; width: 200%; height: 13px; background: var(--tone);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 16' preserveAspectRatio='none'%3E%3Cpath d='M0 8Q25 0 50 8T100 8V16H0Z'/%3E%3C/svg%3E") repeat-x 0 0 / 25% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 16' preserveAspectRatio='none'%3E%3Cpath d='M0 8Q25 0 50 8T100 8V16H0Z'/%3E%3C/svg%3E") repeat-x 0 0 / 25% 100%;
  animation: crest 4.2s linear infinite;
}
.crest.a { opacity: .8; }
.crest.b { top: -15px; opacity: .42; animation-duration: 6.4s; animation-direction: reverse; animation-delay: -1.7s; }
@keyframes crest { to { transform: translateX(-50%); } }

.readout {
  position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; text-align: center; color: #fff; pointer-events: none;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .65), 0 0 2px rgba(0, 0, 0, .5);
}
.readout b { font: 800 30px/1 var(--mono); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.readout small { font-size: 11px; font-weight: 700; opacity: .85; margin-top: 2px; }
.gauge-meta .eyebrow { margin-bottom: 4px; }
.gauge-sub { font-size: 12px; color: var(--ink-dim); min-height: 16px; word-break: break-word; }

/* ----- Per-core bars ----- */
.cores { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 8px; }
.core {
  position: relative; height: 84px; border-radius: 12px; overflow: hidden; isolation: isolate; transform: translateZ(0);
  background: rgba(255, 255, 255, .045); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), inset 0 2px 5px rgba(0, 0, 0, .4);
}
.core .crest { top: -7px; height: 8px; }
.core .crest.b { display: none; }
.core small { position: absolute; left: 0; right: 0; bottom: 4px; z-index: 3; text-align: center; font: 700 9px var(--mono); color: rgba(255, 255, 255, .9); text-shadow: 0 1px 4px rgba(0, 0, 0, .7); }
.core-summary { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--ink-dim); margin-bottom: 14px; }
.core-summary b { color: var(--ink); font-family: var(--mono); }

/* ----- Horizontal bars ----- */
.bars { display: grid; gap: 16px; }
.bar-row { display: grid; gap: 7px; }
.bar-row .top { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.bar-row .top span:last-child { color: var(--ink-dim); font-family: var(--mono); text-align: right; }
.hbar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .4); }
.hbar i { display: block; height: 100%; width: var(--lvl, 0%); border-radius: inherit; background: linear-gradient(90deg, var(--tone), var(--tone2)); transition: width 1s var(--spring); box-shadow: 0 0 10px var(--tone); }

/* ----- Network ----- */
.net-row { display: grid; gap: 8px; }
.net-row + .net-row { margin-top: 18px; }
.net-row .top { display: flex; justify-content: space-between; align-items: baseline; }
.net-row .speed { font: 700 22px var(--mono); font-variant-numeric: tabular-nums; }
.net-row .speed small { font-size: 11px; color: var(--ink-dim); font-weight: 600; }
.spark.up .line { stroke: #94a3b8; filter: drop-shadow(0 0 6px rgba(148, 163, 184, .6)); }
.spark.up .area { fill: url(#spark-fill-v); }
.spark.net { height: 64px; }

/* ----- Top processes ----- */
.seg { display: inline-flex; gap: 6px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; font: 700 11px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); transition: background-color .3s, color .3s, transform .5s var(--spring); }
.seg button:active { transform: scale(.92); }
.seg button.on { background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%); color: #000000; font-weight: 700; box-shadow: inset 0 1px 1px #ffffff, 0 2px 10px rgba(255, 255, 255, .25); }

.ptable { display: grid; gap: 6px; }
.prow {
  display: grid; grid-template-columns: minmax(0, 1fr) 70px 86px auto; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 18px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); min-height: 52px;
  animation: row-in .5s var(--spring) both; transition: background-color .3s;
}
.prow:hover { background: rgba(255, 255, 255, .075); }
.prow.head { background: none; border: 0; min-height: 0; padding-top: 0; padding-bottom: 2px; animation: none; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }
.prow .pname { min-width: 0; }
.prow .pname b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .pname small { font: 500 10px var(--mono); color: var(--ink-faint); }
.prow .num { font: 600 12px var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.prow .pbar { height: 4px; margin-top: 5px; border-radius: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.prow .pbar i { display: block; height: 100%; width: var(--lvl, 0%); background: linear-gradient(90deg, var(--tone), var(--tone2)); transition: width .8s var(--spring); }
@keyframes row-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
.proc-msg { min-height: 18px; margin-top: 12px; font-size: 12px; }
.proc-msg.ok { color: var(--ok); } .proc-msg.bad { color: var(--bad); }

/* Terminate pill: expands (spring) into an inline confirmation */
.term {
  display: inline-flex; align-items: center; justify-content: flex-end; min-height: 34px; padding: 0 3px; border-radius: 999px; overflow: hidden; white-space: nowrap;
  background: linear-gradient(140deg, rgba(251, 113, 133, .3), rgba(244, 63, 94, .16));
  border: 1px solid rgba(251, 113, 133, .5);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .45), inset 0 -1px 2px rgba(255, 255, 255, .12), 0 4px 12px rgba(0, 0, 0, .25);
  transition: transform .55s var(--spring), background-color .3s, border-color .3s, opacity .3s;
}
.term:hover { transform: scale(1.05); }
.term:active { transform: scale(.94, .9); transition-duration: .1s; }
.term button { border: 0; background: none; height: 28px; padding: 0 12px; border-radius: 999px; font: 700 10.5px var(--font); letter-spacing: .08em; text-transform: uppercase; color: #ffd9de; overflow: hidden; transition: max-width .55s var(--spring), padding .55s var(--spring), opacity .25s, background-color .2s, transform .45s var(--spring); }
.term .t-main { max-width: 120px; }
.term .t-confirm { display: inline-flex; align-items: center; gap: 4px; max-width: 0; opacity: 0; overflow: hidden; transition: max-width .6s var(--spring), opacity .25s; }
.term .t-q { font: 700 10.5px var(--font); letter-spacing: .08em; text-transform: uppercase; color: #fff; padding: 0 6px 0 10px; }
.term .t-yes { background: rgba(251, 113, 133, .55); color: #fff; }
.term .t-yes:hover { background: rgba(251, 113, 133, .85); }
.term .t-no:hover { background: rgba(255, 255, 255, .15); }
.term[data-state="confirm"] .t-main { max-width: 0; padding: 0; opacity: 0; }
.term[data-state="confirm"] .t-confirm { max-width: 190px; opacity: 1; }
.term[data-state="busy"] { opacity: .6; pointer-events: none; }
.term[data-state="done"] { background: rgba(74, 222, 128, .22); border-color: rgba(74, 222, 128, .55); }
.term[data-state="done"] .t-main { color: #d9ffe8; }
.term[data-state="locked"] { opacity: .35; background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .15); pointer-events: none; }
.term[data-state="locked"] .t-main { color: var(--ink-dim); }

@media (max-width: 600px) {
  .prow { grid-template-columns: minmax(0, 1fr) 46px 62px auto; gap: 8px; padding: 8px 10px; }
  .term .t-main { padding: 0 9px; font-size: 10px; }
  .readout b { font-size: 26px; }
  .tank { width: 108px; height: 108px; }
}

/* --------------------------------------------------------------------------- */
/* Power Management Deck & Quick Hardware Controls                             */
/* --------------------------------------------------------------------------- */
.power-deck { display: flex; flex-direction: column; gap: 18px; }

/* Active countdown banner */
.power-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 20px; border-radius: 22px;
  background: linear-gradient(135deg, rgba(244, 63, 94, .25), rgba(249, 115, 22, .2));
  border: 1px solid rgba(244, 63, 94, .45);
  box-shadow: 0 10px 30px rgba(244, 63, 94, .2), inset 0 1px 1px rgba(255, 255, 255, .3);
  animation: pulse-banner 2s infinite ease-in-out;
}
@keyframes pulse-banner {
  0%, 100% { box-shadow: 0 8px 24px rgba(244, 63, 94, .2), inset 0 1px 1px rgba(255, 255, 255, .3); }
  50% { box-shadow: 0 12px 34px rgba(244, 63, 94, .35), inset 0 1px 2px rgba(255, 255, 255, .5); }
}
.power-banner-info { display: flex; align-items: center; gap: 12px; }
.power-banner-badge { width: 10px; height: 10px; border-radius: 50%; background: #f43f5e; box-shadow: 0 0 10px #f43f5e; animation: blink 1s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.power-banner-title { font-weight: 700; font-size: 14px; color: #fff; }
.power-banner-timer { font-family: var(--mono); font-size: 13px; color: #ffd1d8; }

/* Action Cards Grid */
.power-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.p-action-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start;
  padding: 22px 20px; border-radius: 26px; cursor: pointer; text-align: left;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .25), inset 0 1px 1px rgba(255, 255, 255, .25);
  transition: transform .45s var(--spring), background-color .3s, border-color .3s, box-shadow .3s;
  user-select: none;
}
.p-action-card:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--p-tint, rgba(255, 255, 255, .3));
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35), 0 0 24px var(--p-glow, rgba(34, 211, 238, .2)), inset 0 1px 2px rgba(255, 255, 255, .4);
}
.p-action-card:active { transform: scale(.96); transition-duration: .1s; }
.p-action-icon {
  width: 44px; height: 44px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 16px;
  background: var(--p-icon-bg, rgba(255, 255, 255, .08));
  border: 1px solid var(--p-icon-border, rgba(255, 255, 255, .15));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .3);
  color: var(--p-tint, #fff);
  transition: transform .45s var(--spring);
}
.p-action-card:hover .p-action-icon { transform: scale(1.1) rotate(2deg); }
.p-action-icon svg { width: 22px; height: 22px; }
.p-action-label { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.p-action-desc { font-size: 11.5px; color: var(--ink-dim); line-height: 1.35; }

/* Tone Tints in White-on-Black-on-Grey */
.p-action-card[data-tone="cyan"],
.p-action-card[data-tone="amber"],
.p-action-card[data-tone="indigo"],
.p-action-card[data-tone="orange"] {
  --p-tint: #ffffff;
  --p-glow: rgba(255, 255, 255, .25);
  --p-icon-bg: rgba(255, 255, 255, .08);
  --p-icon-border: rgba(255, 255, 255, .22);
}
.p-action-card[data-tone="crimson"] {
  --p-tint: #f87171;
  --p-glow: rgba(248, 113, 113, .3);
  --p-icon-bg: rgba(248, 113, 113, .12);
  --p-icon-border: rgba(248, 113, 113, .35);
}

/* Master Audio Deck */
.media-card { display: flex; flex-direction: column; gap: 20px; }
.media-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vol-row { display: flex; align-items: center; gap: 14px; }
.vol-track-box { position: relative; flex: 1; height: 42px; border-radius: 999px; overflow: hidden; cursor: pointer; user-select: none; touch-action: none; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .15); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .4); }
.vol-fill { position: absolute; inset: 0 auto 0 0; width: 0%; border-radius: 999px; background: linear-gradient(90deg, #4b5563, #ffffff); box-shadow: 0 0 16px rgba(255, 255, 255, .4), inset 0 1px 1px rgba(255, 255, 255, .5); transition: width .12s ease-out; }
.vol-fill::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .35), transparent);
  border-top-left-radius: 999px; border-top-right-radius: 999px;
}
.vol-handle {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 32px; height: 32px; border-radius: 50%; background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5), 0 0 14px rgba(255, 255, 255, .9);
  pointer-events: none; transition: left .12s ease-out;
}
.vol-text { font-family: var(--mono); font-weight: 700; font-size: 16px; min-width: 46px; text-align: right; }

.media-transport { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 6px 0; }
.media-btn {
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .15);
  background: rgba(255, 255, 255, .06); display: grid; place-items: center; color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25), inset 0 1px 1px rgba(255, 255, 255, .3);
  transition: transform .45s var(--spring), background-color .2s, border-color .2s, box-shadow .2s;
  cursor: pointer;
}
.media-btn:hover { transform: scale(1.12); background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .4); }
.media-btn:active { transform: scale(.92); }
.media-btn.is-play {
  width: 62px; height: 62px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  border-color: rgba(255, 255, 255, .7);
  box-shadow: 0 8px 24px rgba(255, 255, 255, .35);
  color: #000000;
}
.media-btn svg { width: 22px; height: 22px; }
.media-btn.is-play svg { width: 26px; height: 26px; color: #000000; fill: #000000; }

/* Slide-To-Confirm Modal */
.power-modal-backdrop {
  position: fixed; inset: 0; z-index: 999; display: grid; place-items: center; padding: 20px;
  background: rgba(0, 0, 0, .85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  opacity: 0; pointer-events: none; transition: opacity .35s ease;
}
.power-modal-backdrop.is-open { opacity: 1; pointer-events: auto; }
.power-modal-card {
  width: 100%; max-width: 460px; border-radius: 32px; padding: 28px;
  background: rgba(16, 18, 24, .95);
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .8), 0 0 30px rgba(255, 255, 255, .12), inset 0 1px 1px rgba(255, 255, 255, .35);
  transform: scale(.92) translateY(12px);
  transition: transform .5s var(--spring);
}
.power-modal-backdrop.is-open .power-modal-card { transform: scale(1) translateY(0); }
.power-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.power-modal-title { font-size: 18px; font-weight: 700; color: #fff; }
.power-modal-close {
  width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .08);
  color: var(--ink-dim); display: grid; place-items: center; cursor: pointer;
  transition: background-color .2s, color .2s, transform .3s;
}
.power-modal-close:hover { background: rgba(255, 255, 255, .16); color: #fff; transform: scale(1.1); }
.power-modal-close svg { width: 16px; height: 16px; }

.delay-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 24px; }
.delay-pill {
  flex: 1; min-width: 68px; padding: 10px 12px; border-radius: 999px; text-align: center;
  font-size: 12px; font-weight: 600; cursor: pointer; user-select: none;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); color: var(--ink-dim);
  transition: all .25s var(--spring);
}
.delay-pill:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.delay-pill.is-active {
  background: #ffffff; border-color: rgba(255, 255, 255, .8); color: #000000; font-weight: 700;
  box-shadow: 0 4px 16px rgba(255, 255, 255, .35); transform: scale(1.04);
}

/* Spring-loaded Slide-To-Confirm Track */
.slide-track {
  position: relative; height: 58px; border-radius: 999px; overflow: hidden;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .5);
  user-select: none; touch-action: none; display: flex; align-items: center; justify-content: center;
}
.slide-track-fill {
  position: absolute; inset: 0 auto 0 0; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, #4b5563, #ffffff);
  opacity: .5; pointer-events: none; transition: width .08s ease-out;
}
.slide-track-text {
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255, 255, 255, .6); pointer-events: none; z-index: 1; transition: opacity .2s;
}
.slide-thumb {
  position: absolute; top: 4px; left: 4px; width: 48px; height: 48px; border-radius: 50%;
  background: #ffffff;
  color: #000000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .5), 0 0 16px rgba(255, 255, 255, .7);
  display: grid; place-items: center; cursor: grab; z-index: 2;
  transition: transform .1s, left .08s ease-out;
}
.slide-thumb svg { width: 22px; height: 22px; color: #000000; fill: #000000; transition: transform .3s; }
.slide-track.is-released .slide-thumb,
.slide-track.is-released .slide-track-fill {
  transition: all .5s var(--spring);
}
.slide-track.is-confirmed .slide-thumb {
  transform: scale(1.2);
  box-shadow: 0 0 30px #ffffff;
  background: #ffffff;
}
.slide-thumb:active { cursor: grabbing; transform: scale(1.06); }
.slide-thumb svg { width: 22px; height: 22px; transition: transform .3s; }
.slide-track.is-released .slide-thumb,
.slide-track.is-released .slide-track-fill {
  transition: all .5s var(--spring);
}
.slide-track.is-confirmed .slide-thumb {
  transform: scale(1.2);
  box-shadow: 0 0 30px #4ade80;
  background: #4ade80;
}

/* --------------------------------------------------------------------------- */
/* Bidirectional File Browser & Media Streamer                                 */
/* --------------------------------------------------------------------------- */
.files-deck { display: flex; flex-direction: column; gap: 16px; }

/* Shortcuts Ribbon */
.shortcuts-scroll {
  display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.shortcuts-scroll::-webkit-scrollbar { display: none; }
.shortcut-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12);
  color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; flex: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .2), inset 0 1px 1px rgba(255, 255, 255, .25);
  transition: transform .45s var(--spring), background-color .2s, border-color .2s, box-shadow .2s;
  user-select: none;
}
.shortcut-chip:hover {
  transform: translateY(-2px) scale(1.04);
  background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .4);
  box-shadow: 0 6px 18px rgba(255, 255, 255, .18), inset 0 1px 1px rgba(255, 255, 255, .4);
}
.shortcut-chip:active { transform: scale(.95); }
.shortcut-chip svg { width: 16px; height: 16px; color: #ffffff; }

/* File Toolbar & Breadcrumbs */
.file-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 18px; border-radius: 22px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08);
}
.breadcrumb-trail { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.crumb-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 8px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
  color: var(--ink-dim); font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: all .2s;
}
.crumb-btn:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.crumb-btn.is-active { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .4); color: #fff; }
.crumb-sep { color: var(--ink-faint); font-size: 11px; }

.file-actions { display: flex; align-items: center; gap: 8px; }
.f-act-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .15);
  color: #fff; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all .25s var(--spring);
}
.f-act-btn:hover { transform: translateY(-1px) scale(1.05); background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .3); }
.f-act-btn:active { transform: scale(.95); }
.f-act-btn svg { width: 14px; height: 14px; }
.f-act-btn.is-primary {
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  border-color: rgba(255, 255, 255, .7);
  color: #000000;
  font-weight: 700;
}
.f-act-btn.is-primary svg { color: #000000; }

/* File Item Grid */
.file-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px;
}
.f-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center;
  padding: 16px 12px; border-radius: 22px; cursor: pointer; text-align: center;
  background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2), inset 0 1px 1px rgba(255, 255, 255, .2);
  transition: transform .45s var(--spring), background-color .25s, border-color .25s, box-shadow .25s;
  user-select: none;
}
.f-card:hover {
  transform: translateY(-3px) scale(1.03);
  background: rgba(255, 255, 255, .07); border-color: var(--f-border, rgba(255, 255, 255, .25));
  box-shadow: 0 14px 34px rgba(0, 0, 0, .4), 0 0 20px rgba(255, 255, 255, .15), inset 0 1px 1px rgba(255, 255, 255, .35);
}
.f-card:active { transform: scale(.96); transition-duration: .1s; }

.f-icon-wrap {
  width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 12px;
  background: var(--f-bg, rgba(255, 255, 255, .06)); border: 1px solid var(--f-border, rgba(255, 255, 255, .12));
  color: var(--f-color, #fff); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .3);
  transition: transform .45s var(--spring);
}
.f-card:hover .f-icon-wrap { transform: scale(1.1) rotate(2deg); }
.f-icon-wrap svg { width: 26px; height: 26px; }

.f-name {
  width: 100%; font-size: 13px; font-weight: 600; color: #fff; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 4px;
}
.f-meta { font-size: 11px; color: var(--ink-dim); font-family: var(--mono); }

/* Card Category Colors - Monochrome White on Grey */
.f-card[data-cat="directory"] {
  --f-color: #ffffff; --f-bg: rgba(255, 255, 255, .12); --f-border: rgba(255, 255, 255, .35); --f-glow: rgba(255, 255, 255, .15);
}
.f-card[data-cat="video"] {
  --f-color: #e2e8f0; --f-bg: rgba(226, 232, 240, .10); --f-border: rgba(226, 232, 240, .30); --f-glow: rgba(226, 232, 240, .12);
}
.f-card[data-cat="image"] {
  --f-color: #cbd5e1; --f-bg: rgba(203, 213, 225, .10); --f-border: rgba(203, 213, 225, .30); --f-glow: rgba(203, 213, 225, .12);
}
.f-card[data-cat="audio"] {
  --f-color: #94a3b8; --f-bg: rgba(148, 163, 184, .10); --f-border: rgba(148, 163, 184, .25); --f-glow: rgba(148, 163, 184, .10);
}
.f-card[data-cat="code"] {
  --f-color: #f8fafc; --f-bg: rgba(248, 250, 252, .10); --f-border: rgba(248, 250, 252, .30); --f-glow: rgba(248, 250, 252, .15);
}
.f-card[data-cat="archive"] {
  --f-color: #64748b; --f-bg: rgba(100, 116, 139, .10); --f-border: rgba(100, 116, 139, .25); --f-glow: rgba(100, 116, 139, .10);
}
.f-card[data-cat="other"] {
  --f-color: var(--ink-dim); --f-bg: rgba(255, 255, 255, .05); --f-border: rgba(255, 255, 255, .12); --f-glow: rgba(255, 255, 255, .05);
}

/* Card Hover Quick-Actions */
.f-quick-actions {
  position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0;
  transition: opacity .2s; z-index: 2;
}
.f-card:hover .f-quick-actions { opacity: 1; }
.f-q-btn {
  width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6);
  color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(8px);
  transition: transform .2s, background-color .2s;
}
.f-q-btn:hover { transform: scale(1.15); background: rgba(34, 211, 238, .8); }
.f-q-btn.is-del:hover { background: rgba(244, 63, 94, .85); }
.f-q-btn svg { width: 13px; height: 13px; }

/* Drag and Drop Upload Zone */
.upload-dropzone {
  position: relative; border-radius: 26px; padding: 28px 20px; text-align: center;
  background: rgba(255, 255, 255, .02); border: 2px dashed rgba(255, 255, 255, .15);
  transition: all .3s var(--spring); cursor: pointer;
}
.upload-dropzone:hover {
  background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .4);
}
.upload-dropzone.is-dragover {
  background: rgba(255, 255, 255, .1); border-color: #ffffff;
  box-shadow: 0 0 30px rgba(255, 255, 255, .25), inset 0 0 20px rgba(255, 255, 255, .1);
  transform: scale(1.02);
}
.upload-icon { width: 40px; height: 40px; color: #ffffff; margin-bottom: 8px; }

/* Upload Progress Pill */
.upload-progress-box {
  margin-top: 14px; padding: 12px 16px; border-radius: 16px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12);
  display: flex; flex-direction: column; gap: 8px;
}
.upload-track { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; position: relative; }
.upload-bar {
  height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ffffff, #94a3b8);
  width: 0%; transition: width .15s ease-out; box-shadow: 0 0 12px rgba(255, 255, 255, .5);
}

/* Streaming Media Player Modal */
.media-modal-backdrop {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px;
  background: rgba(0, 0, 0, .88); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  opacity: 0; pointer-events: none; transition: opacity .35s ease;
}
.media-modal-backdrop.is-open { opacity: 1; pointer-events: auto; }
.media-modal-card {
  width: 100%; max-width: 840px; border-radius: 30px; overflow: hidden;
  background: rgba(18, 20, 26, .96); border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .8), 0 0 40px rgba(255, 255, 255, .1);
  transform: scale(.93); transition: transform .45s var(--spring); display: flex; flex-direction: column;
}
.media-modal-backdrop.is-open .media-modal-card { transform: scale(1); }
.media-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.media-modal-title { font-size: 15px; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-modal-body { background: #000; display: grid; place-items: center; position: relative; min-height: 240px; }
.media-modal-body video { width: 100%; max-height: 65vh; outline: none; }
.media-modal-body audio { width: 85%; margin: 40px 0; outline: none; }
.media-modal-body pre {
  width: 100%; max-height: 70vh; margin: 0; padding: 20px; overflow: auto;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.5; color: #e2e8f0;
  background: rgba(10, 12, 16, .95); text-align: left; white-space: pre-wrap; word-break: break-all;
}

/* File Search Input */
.file-search-box {
  display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1);
  transition: all .25s var(--spring); min-width: 160px; max-width: 240px; flex: 1;
}
.file-search-box:focus-within {
  background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .6);
  box-shadow: 0 0 16px rgba(255, 255, 255, .2);
}
.file-search-input {
  border: 0; background: none; color: #fff; font-size: 12px; width: 100%; outline: none;
}
.file-search-input::placeholder { color: var(--ink-dim); }

/* Fullscreen Drag & Drop Liquid Overlay */
.fullscreen-dropzone {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center;
  background: rgba(0, 0, 0, .88); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  pointer-events: none; opacity: 0; transition: opacity .3s ease;
}
.fullscreen-dropzone.is-active {
  pointer-events: auto; opacity: 1;
}
.dropzone-ripple {
  position: absolute; width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .25) 0%, rgba(148, 163, 184, .12) 50%, transparent 70%);
  animation: dropzone-pulse 2s infinite ease-in-out;
}
@keyframes dropzone-pulse {
  0%, 100% { transform: scale(1); opacity: .7; }
  50% { transform: scale(1.25); opacity: 1; }
}
.dropzone-orb {
  position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center;
  padding: 36px 48px; border-radius: 36px;
  background: rgba(255, 255, 255, .06); border: 2px dashed rgba(255, 255, 255, .6);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .7), 0 0 40px rgba(255, 255, 255, .2);
  text-align: center;
}
.dropzone-title { font-size: 18px; font-weight: 700; color: #fff; margin-top: 14px; }
.dropzone-sub { font-size: 13px; color: var(--ink-dim); margin-top: 4px; }

/* --------------------------------------------------------------------------- */
/* Windows HWND Window Manager & Liquid Glass App Dock                         */
/* --------------------------------------------------------------------------- */
.apps-deck { display: flex; flex-direction: column; gap: 20px; }

/* Section Header */
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

/* Running Windows List */
.win-grid { display: grid; gap: 12px; }
.win-card {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 18px; border-radius: 20px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .2), inset 0 1px 1px rgba(255, 255, 255, .25);
  transition: transform .35s var(--spring), background-color .25s, border-color .25s, box-shadow .25s;
  flex-wrap: wrap;
}
.win-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .4);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .4), 0 0 16px rgba(255, 255, 255, .15);
}
.win-card.is-foreground {
  border-color: rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .1);
  box-shadow: 0 8px 24px rgba(255, 255, 255, .2), inset 0 1px 1px rgba(255, 255, 255, .4);
}
.win-info { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.win-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .15); color: #ffffff;
}
.win-icon svg { width: 22px; height: 22px; }
.win-meta { min-width: 0; }
.win-title { font-weight: 700; font-size: 14px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-sub { font-size: 11.5px; color: var(--ink-dim); font-family: var(--mono); display: flex; gap: 8px; align-items: center; margin-top: 2px; }

.win-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.w-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .15);
  color: #fff; font-size: 11.5px; font-weight: 600; cursor: pointer;
  transition: all .2s var(--spring);
}
.w-btn:hover { transform: scale(1.08); background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .3); }
.w-btn:active { transform: scale(.92); }
.w-btn svg { width: 13px; height: 13px; }
.w-btn.is-stream {
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  border-color: rgba(255, 255, 255, .8); color: #000000; font-weight: 700;
  box-shadow: 0 2px 10px rgba(255, 255, 255, .3);
}
.w-btn.is-stream svg { color: #000000; }
.w-btn.is-stream:hover { box-shadow: 0 4px 16px rgba(255, 255, 255, .5); }
.w-btn.is-close:hover { background: rgba(248, 113, 113, .8); border-color: #f87171; }

/* App Launcher Grid */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.app-tile {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center;
  padding: 20px 14px; border-radius: 24px; cursor: pointer; text-align: center;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2), inset 0 1px 1px rgba(255, 255, 255, .25);
  transition: transform .45s var(--spring), background-color .25s, border-color .25s, box-shadow .25s;
  user-select: none;
}
.app-tile:hover {
  transform: translateY(-4px) scale(1.04);
  background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .45);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .4), 0 0 24px rgba(255, 255, 255, .15), inset 0 1px 1px rgba(255, 255, 255, .4);
}
.app-tile:active { transform: scale(.94); transition-duration: .1s; }
.app-tile-icon {
  width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .15), rgba(160, 175, 195, .15));
  border: 1px solid rgba(255, 255, 255, .2); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .3);
  color: #ffffff; transition: transform .45s var(--spring);
}
.app-tile:hover .app-tile-icon { transform: scale(1.12) rotate(3deg); }
.app-tile-icon svg { width: 26px; height: 26px; }
.app-tile-name { font-size: 13px; font-weight: 700; color: #fff; line-height: 1.25; margin-bottom: 4px; }
.app-tile-cat { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); font-weight: 600; }

.app-tile.is-add {
  border: 1.5px dashed rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .015);
  box-shadow: none; justify-content: center;
}
.app-tile.is-add:hover { border-color: #ffffff; background: rgba(255, 255, 255, .06); }
.app-tile.is-add .app-tile-icon { background: none; border: 0; color: var(--ink-dim); }

/* Launch Ripple Droplet Animation */
.app-tile.is-launching::after {
  content: ""; position: absolute; inset: 0; border-radius: 24px;
  background: radial-gradient(circle, rgba(255, 255, 255, .6) 0%, transparent 70%);
  animation: app-ripple .6s ease-out forwards;
}
@keyframes app-ripple {
  0% { transform: scale(.2); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* Add App Modal */
.app-modal-backdrop {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px;
  background: rgba(0, 0, 0, .85); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  opacity: 0; pointer-events: none; transition: opacity .35s ease;
}
.app-modal-backdrop.is-open { opacity: 1; pointer-events: auto; }
.app-modal-card {
  width: 100%; max-width: 480px; border-radius: 30px; padding: 26px;
  background: rgba(16, 18, 24, .95); border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .8), 0 0 30px rgba(255, 255, 255, .15);
  transform: scale(.93); transition: transform .45s var(--spring);
}
.app-modal-backdrop.is-open .app-modal-card { transform: scale(1); }
.app-form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.app-input-group { display: flex; flex-direction: column; gap: 6px; }
.app-input-group label { font-size: 12px; font-weight: 600; color: var(--ink-dim); text-transform: uppercase; letter-spacing: .06em; }
.app-input {
  width: 100%; padding: 12px 16px; border-radius: 14px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .15);
  color: #fff; font-size: 13.5px; font-family: var(--font); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.app-input:focus { border-color: #ffffff; box-shadow: 0 0 16px rgba(255, 255, 255, .3); }

/* Running White Droplet Indicator */
.app-tile .running-dot {
  position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%;
  background: #ffffff; box-shadow: 0 0 10px #ffffff;
  animation: white-glow 2s infinite ease-in-out;
}
@keyframes white-glow {
  0%, 100% { opacity: .7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.25); }
}

/* Action Sheet Modal */
.action-sheet-card { max-width: 520px; }
.sheet-meta { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); margin: 6px 0 18px; }
.action-sheet-buttons { display: flex; flex-direction: column; gap: 10px; }
.sheet-btn {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 18px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12);
  color: #fff; text-align: left; cursor: pointer; transition: all .25s var(--spring);
}
.sheet-btn:hover {
  transform: translateY(-2px) scale(1.02); background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .4);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .4);
}
.sheet-btn:active { transform: scale(.97); }
.sheet-btn svg { width: 24px; height: 24px; color: #ffffff; flex: none; }
.sheet-btn b { display: block; font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.sheet-btn small { font-size: 11.5px; color: var(--ink-dim); line-height: 1.3; }
.sheet-btn.is-primary {
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  border-color: rgba(255, 255, 255, .8); box-shadow: 0 6px 20px rgba(255, 255, 255, .25);
  color: #000000;
}
.sheet-btn.is-primary b { color: #000000 !important; }
.sheet-btn.is-primary small { color: #374151 !important; }
.sheet-btn.is-primary svg { color: #000000 !important; }
.sheet-btn.is-primary:hover {
  background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
  box-shadow: 0 8px 28px rgba(255, 255, 255, .45);
}
.sheet-actions-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.sheet-mini-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 8px; border-radius: 12px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
  color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .2s;
}
.sheet-mini-btn:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .25); transform: scale(1.04); }
.sheet-mini-btn:active { transform: scale(.96); }
.sheet-mini-btn svg { width: 14px; height: 14px; }
.sheet-mini-btn.is-del:hover { background: rgba(244, 63, 94, .8); border-color: #f43f5e; }

/* Quick Macro Bar */
.macro-bar {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 18px;
  background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .08);
  margin-bottom: 8px; flex-wrap: wrap;
}
.macro-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
  background: rgba(244, 63, 94, .15); border: 1px solid rgba(244, 63, 94, .4);
  color: #fff; font-size: 12px; font-weight: 700; cursor: pointer;
  box-shadow: 0 2px 8px rgba(244, 63, 94, .2); transition: all .25s var(--spring);
}
.macro-btn:hover { transform: scale(1.06); background: rgba(244, 63, 94, .3); box-shadow: 0 4px 14px rgba(244, 63, 94, .4); }
.macro-btn:active { transform: scale(.95); }

/* --------------------------------------------------------------------------- */
/* Frontend Direct Stream Player & Refractive Video Lens HUD                  */
/* --------------------------------------------------------------------------- */
.stream-wrapper { display: flex; flex-direction: column; gap: 16px; }

.stream-stage-box {
  position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 82vh;
  border-radius: 28px; overflow: hidden; background: #000;
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .7), 0 0 30px rgba(255, 255, 255, .08), inset 0 1px 1px rgba(255, 255, 255, .3);
  display: flex; align-items: center; justify-content: center;
}
.stream-stage-box:fullscreen {
  width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; border: 0; box-shadow: none;
}

.stream-canvas {
  width: 100%; height: 100%; object-fit: contain; display: block; outline: none;
  cursor: crosshair; touch-action: none; user-select: none;
}
.stream-canvas.is-touch-mode { cursor: default; }

/* Connecting / Disconnected Overlay */
.stream-overlay {
  position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(10, 12, 16, .88); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  transition: opacity .4s ease;
}
.stream-overlay.is-hidden { opacity: 0; pointer-events: none; }
.stream-overlay-title { font-size: 18px; font-weight: 700; color: #fff; }
.stream-overlay-sub { font-size: 13px; color: var(--ink-dim); max-width: 380px; text-align: center; }

/* Floating Refractive Video Lens HUD */
.lens-hud {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: rgba(18, 20, 24, .85);
  backdrop-filter: url(#liquid-refraction) blur(16px) saturate(190%);
  -webkit-backdrop-filter: blur(16px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, .25);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .6), 0 0 24px rgba(255, 255, 255, .12), inset 0 1px 1px rgba(255, 255, 255, .5);
  transition: transform .4s var(--spring), opacity .3s;
  max-width: 95%; flex-wrap: wrap; justify-content: center;
}
.lens-hud.is-collapsed { transform: translateX(-50%) translateY(80px); opacity: 0; pointer-events: none; }

.lens-direct-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .25);
  color: #ffffff; font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: .02em; white-space: nowrap; box-shadow: 0 0 12px rgba(255, 255, 255, .15);
}
.lens-direct-badge .dot {
  width: 7px; height: 7px; border-radius: 50%; background: #ffffff;
  box-shadow: 0 0 8px #ffffff; animation: pulse 2s infinite;
}

.lens-dropdown-wrap { position: relative; }
.lens-dropdown {
  position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%);
  min-width: 280px; max-height: 360px; overflow-y: auto; padding: 10px; border-radius: 20px;
  background: rgba(14, 16, 20, .96);
  backdrop-filter: url(#liquid-refraction) blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .7), 0 0 24px rgba(255, 255, 255, .12);
  display: none; flex-direction: column; gap: 6px; z-index: 55;
}
.lens-dropdown.is-open { display: flex; }
.lens-dropdown-head {
  padding: 4px 8px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  color: #ffffff; opacity: .85; letter-spacing: .06em;
}
.lens-dropdown-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px;
  border: 1px solid transparent; background: rgba(255, 255, 255, .04); color: #fff;
  font-size: 12.5px; font-weight: 500; cursor: pointer; text-align: left;
  transition: all .2s var(--spring); width: 100%;
}
.lens-dropdown-item:hover {
  background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .3);
  color: #ffffff; transform: translateX(3px);
}
.lens-dropdown-item.is-selected {
  background: linear-gradient(135deg, #ffffff, #cbd5e1);
  border-color: #ffffff; color: #000000; font-weight: 700;
  box-shadow: 0 4px 14px rgba(255, 255, 255, .25);
}
.lens-dropdown-item.is-selected .lens-dropdown-icon { color: #000000; }
.lens-dropdown-icon { width: 18px; height: 18px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.lens-dropdown-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lens-pill.is-locked {
  background: linear-gradient(135deg, rgba(244, 63, 94, .4), rgba(236, 72, 153, .4));
  border-color: #f43f5e; color: #fff; box-shadow: 0 0 14px rgba(244, 63, 94, .5);
}

.lens-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18);
  color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2), inset 0 1px 1px rgba(255, 255, 255, .25);
  transition: all .25s var(--spring);
}
.lens-pill:hover {
  transform: translateY(-2px) scale(1.05); background: rgba(255, 255, 255, .18);
  border-color: rgba(255, 255, 255, .6); box-shadow: 0 4px 16px rgba(255, 255, 255, .25);
}
.lens-pill:active { transform: scale(.94); }
.lens-pill.is-active {
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  border-color: #ffffff; color: #000000; font-weight: 700; box-shadow: 0 0 16px rgba(255, 255, 255, .4);
}
.lens-pill.is-active svg { color: #000000; }
.lens-pill svg { width: 14px; height: 14px; color: #ffffff; }

.lens-meta {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: rgba(0, 0, 0, .5); border: 1px solid rgba(255, 255, 255, .15);
  font-family: var(--mono); font-size: 11.5px; color: #e2e8f0; font-weight: 600;
  cursor: grab; user-select: none;
}
.lens-meta:active { cursor: grabbing; }

.lens-restore-btn {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 39;
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
  background: rgba(18, 20, 26, .85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, .3);
  color: #ffffff; font-size: 11px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
  transition: all .2s var(--spring);
}
.lens-restore-btn:hover {
  background: rgba(255, 255, 255, .2);
  border-color: #ffffff;
  transform: translateX(-50%) scale(1.06);
}

/* Virtual Keyboard Drawer */
.virtual-kbd-drawer {
  position: absolute; bottom: 82px; left: 50%; transform: translateX(-50%) translateY(20px); z-index: 45;
  width: 90%; max-width: 640px; padding: 14px; border-radius: 24px;
  background: rgba(14, 16, 22, .92);
  backdrop-filter: url(#liquid-refraction) blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .6), 0 0 20px rgba(255, 255, 255, .1);
  opacity: 0; pointer-events: none; transition: transform .4s var(--spring), opacity .3s;
  display: flex; flex-direction: column; gap: 10px;
}
.virtual-kbd-drawer.is-open { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }

.kbd-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.kbd-btn {
  padding: 8px 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .15);
  background: rgba(255, 255, 255, .08); color: #fff; font-family: var(--mono); font-size: 12px; font-weight: 700;
  cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, .3), inset 0 1px 1px rgba(255, 255, 255, .3);
  transition: all .15s var(--spring); min-width: 44px; text-align: center;
}
.kbd-btn:hover { background: rgba(255, 255, 255, .2); border-color: #ffffff; }
.kbd-btn:active, .kbd-btn.is-pressed {
  background: #ffffff; color: #000; transform: scale(.92);
  box-shadow: 0 0 12px #ffffff;
}
.kbd-input-row { display: flex; gap: 8px; margin-top: 4px; }
.kbd-input {
  flex: 1; padding: 10px 14px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(0, 0, 0, .5); color: #fff; font-family: var(--font); font-size: 13px; outline: none;
}
.kbd-input:focus { border-color: #ffffff; box-shadow: 0 0 12px rgba(255, 255, 255, .3); }
