/* ============================================================
   Continuum RX - Core Shell Stylesheet (core.css)
   Cyber-retro desktop environment. Kernel-owned styles only.
   Guest apps are CSS-scoped inside their own sandboxed iframes.
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --neon-cyan: #00f3ff;
  --neon-magenta: #ff0055;
  --neon-purple: #a855f7;
  --retro-dark: #12131a;
  --workspace-bg: #222533;
  --window-bg: #1c1e29;
  --window-border: #3a3f58;
  --window-titlebar: #2a2d3d;
  --text-primary: #e2e8f0;
  --text-dim: #8b93a7;
  --font-retro: 'Courier New', Courier, monospace;
  --taskbar-h: 44px;
}

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--retro-dark);
  font-family: var(--font-retro);
  color: var(--text-primary);
}

/* Native-app feel: the OS chrome does not behave like a web page. No page
   text selection or drag-highlight, and no image dragging. Genuinely
   editable places (inputs, textareas, contenteditable) and anything marked
   `.selectable` opt back in. App windows are separate documents and manage
   their own selection. */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
input, textarea, [contenteditable="true"], [contenteditable=""], .selectable, .selectable * {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}
img { -webkit-user-drag: none; }

.dropdown-hidden { display: none !important; }

/* ---------------- Continuum RX styled scrollbars ------------------ */
/* Shared cyber-retro scrollbar treatment for every shell scroll region
   (start menu, taskbar strip, dialogs, notifications, etc.). Guest apps
   carry a matching copy inside their sandboxed iframes. */
* { scrollbar-width: thin; scrollbar-color: #3a3f58 rgba(0, 0, 0, 0.28); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.28); border-radius: 8px; }
::-webkit-scrollbar-thumb {
  background: #3a3f58;
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: #00f3ff; background-clip: padding-box; }
::-webkit-scrollbar-thumb:active { background: #0091a8; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- CRT Display Scanline Overlay Simulation ---------- */
/* Active Screen Filter surface. An installable CRT-style filter package paints
   this element via CSS injected by the ScreenFilterManager; with no active
   filter it stays empty and therefore invisible. Sits above everything so the
   effect covers windows, dialogs and fullscreen apps alike. */
.screen-filter {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: none;
}

/* ---------------------- Boot Screen ------------------------- */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 2900;
  background:
    radial-gradient(1100px 620px at 18% -12%, rgba(0, 243, 255, 0.10), transparent 62%),
    radial-gradient(900px 520px at 108% 112%, rgba(168, 85, 247, 0.11), transparent 58%),
    #04060a;
  padding: 40px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
/* Engineering grid backdrop, masked to a soft vignette and drifting one cell
   per cycle so the movement never reads as a jump. */
.boot-screen::before {
  content: '';
  position: absolute;
  inset: -48px;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 243, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 243, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(circle at 50% 34%, #000 0%, transparent 78%);
  mask-image: radial-gradient(circle at 50% 34%, #000 0%, transparent 78%);
  animation: bootGridDrift 16s linear infinite;
}
@keyframes bootGridDrift {
  to { transform: translate3d(44px, 44px, 0); }
}
.boot-screen > * { position: relative; }
.boot-logo {
  display: block;
  width: min(60%, 460px);
  height: auto;
  margin: 0 auto 5px;
  filter: drop-shadow(0 0 18px rgba(0,243,255,0.35));
  animation: bootLogoIn 900ms cubic-bezier(0.2, 0.9, 0.25, 1) both;
}
@keyframes bootLogoIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); filter: drop-shadow(0 0 0 rgba(0,243,255,0)); }
}
.boot-brand-version {
  margin: 0 auto 26px;
  color: rgba(155, 178, 196, 0.68);
  font-family: var(--font-retro);
  font-size: 12px;
  letter-spacing: 0.18em;
  line-height: 1;
  text-shadow: 0 0 8px rgba(0, 243, 255, 0.16);
}
/* Static first-paint loader. It must not depend on JavaScript: the point is to
   cover the time while the kernel's ES module graph is still being fetched. */
.bootstrap-loader {
  width: min(72%, 300px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.bootstrap-loader-bar {
  position: relative;
  width: 100%;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0,243,255,0.12);
}
.bootstrap-loader-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  filter: drop-shadow(0 0 7px rgba(0,243,255,0.85));
  animation: bootstrapLoaderSweep 1.1s ease-in-out infinite;
}
@keyframes bootstrapLoaderSweep {
  from { transform: translateX(-110%); }
  to { transform: translateX(240%); }
}
@media (prefers-reduced-motion: reduce) {
  .bootstrap-loader-bar::after {
    width: 100%;
    animation: none;
  }
}
/* ---- Pre-launch console card (HUD panel: actions first, small print after) ---- */
.boot-disclaimer {
  --card-bg: #070c14;
  position: relative;
  width: min(94%, 1024px);
  margin: 0 auto;
  padding: 26px 34px 20px;
  background:
    linear-gradient(180deg, rgba(0, 243, 255, 0.05), transparent 220px),
    rgba(7, 12, 20, 0.82);
  border: 1px solid rgba(0, 243, 255, 0.3);
  border-radius: 14px;
  box-shadow: 0 0 46px rgba(0, 243, 255, 0.12), inset 0 0 34px rgba(0, 243, 255, 0.04);
  backdrop-filter: blur(4px);
  text-align: left;
  animation: bdCardIn 620ms cubic-bezier(0.2, 0.9, 0.25, 1) both;
}
@keyframes bdCardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
}
/* HUD corner brackets, drawn in after the card lands. */
.boot-disclaimer::before,
.boot-disclaimer::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1px solid var(--neon-cyan);
  opacity: 0.6;
  pointer-events: none;
  animation: bdCornerIn 520ms cubic-bezier(0.2, 0.9, 0.25, 1) 380ms both;
}
.boot-disclaimer::before {
  top: -1px; left: -1px;
  border-right: 0; border-bottom: 0;
  border-top-left-radius: 14px;
  transform-origin: top left;
}
.boot-disclaimer::after {
  bottom: -1px; right: -1px;
  border-left: 0; border-top: 0;
  border-bottom-right-radius: 14px;
  transform-origin: bottom right;
}
@keyframes bdCornerIn {
  from { opacity: 0; transform: scale(0.2); }
  to { opacity: 0.6; transform: none; }
}

/* Slow diagonal light sweep across the panel — the one purely decorative
   motion in the card. Clipped by its own wrapper so the title tag, which
   rides the top border, is not cut off. */
.bd-sweep {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}
.bd-sweep::after {
  content: '';
  position: absolute;
  inset: -20%;
  background: linear-gradient(100deg, transparent 42%, rgba(0, 243, 255, 0.07) 50%, transparent 58%);
  transform: translateX(-100%);
  animation: bdSweep 9s ease-in-out 1.2s infinite;
}
@keyframes bdSweep {
  0%, 62% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Panel tag riding the top border, with a live "preview build" indicator. */
.boot-disclaimer .bd-title {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 0 14px;
  background: var(--card-bg);
  font-family: var(--font-retro);
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--neon-cyan);
  text-shadow: 0 0 12px rgba(0, 243, 255, 0.5);
}
.boot-disclaimer .bd-title::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffcf5e;
  box-shadow: 0 0 9px rgba(255, 207, 94, 0.9);
  animation: bdBeacon 1.9s ease-in-out infinite;
}
@keyframes bdBeacon { 50% { opacity: 0.25; } }

.boot-disclaimer .bd-body {
  position: relative;
  font-family: var(--font-retro);
  font-size: 13.5px;
  line-height: 1.6;
  color: #c7d0e0;
}
.boot-disclaimer .bd-body p { margin: 0 0 12px; }
.boot-disclaimer .bd-body strong { color: #eaf1ff; }

/* Each block of the card rises in turn, top to bottom. */
/* The cascade comes from each block taking a little longer than the one above
   it, not from a start delay: every block begins fading in immediately, so no
   part of the card is ever sitting invisible waiting for its turn. */
.bd-step {
  animation: bdStepIn calc(var(--step, 1) * 95ms + 300ms) cubic-bezier(0.2, 0.9, 0.25, 1) both;
}
@keyframes bdStepIn {
  from { opacity: 0; transform: translateY(12px); }
}

/* ---- 1. Hero: the zero-commitment temporary session ---- */
.boot-temp-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
/* Halo behind the hero, breathing in step with the button's own glow. */
.boot-temp-option::before {
  content: '';
  position: absolute;
  top: -30px;
  left: 50%;
  width: min(100%, 640px);
  height: 130px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0, 217, 245, 0.16), transparent 68%);
  pointer-events: none;
  animation: bdHeroHalo 3.4s ease-in-out 1.4s infinite;
}
@keyframes bdHeroHalo {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
.boot-temp-option > p {
  max-width: 620px;
  margin: 10px 0 0 !important;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.65;
}
.boot-temp-option .boot-temp {
  --action-top: #0bb7c9;
  --action-bottom: #05627a;
  --action-border: rgba(120, 244, 255, 0.85);
  --action-glow: rgba(0, 217, 245, 0.4);
  --action-glow-hover: rgba(0, 217, 245, 0.72);
  width: min(100%, 460px);
  min-height: 54px;
  padding: 13px 34px;
  font-size: 17px;
  letter-spacing: 0.2em;
  animation: bdHeroPulse 3.4s ease-in-out 1.4s infinite;
}
.boot-temp .boot-start-logo { height: 26px; }
@keyframes bdHeroPulse {
  0%, 100% { box-shadow: 0 0 22px var(--action-glow), inset 0 1px 0 rgba(255,255,255,0.18), inset 0 -2px 0 rgba(0,0,0,0.22); }
  50% { box-shadow: 0 0 36px var(--action-glow-hover), inset 0 1px 0 rgba(255,255,255,0.22), inset 0 -2px 0 rgba(0,0,0,0.22); }
}

/* ---- 2. Divider between the two ways in ---- */
.bd-split {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 780px;
  margin: 18px auto 16px;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.bd-split::before,
.bd-split::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.32), transparent);
}

/* ---- 3. Install path ---- */
.boot-install-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.boot-install-note {
  max-width: 780px;
  margin: 10px auto 0 !important;
  color: #aebbd0;
  font-size: 12.5px;
  line-height: 1.65;
}

/* ---- 4. Preview small print, as scannable HUD cells ---- */
.bd-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}
@media (max-width: 820px) {
  .bd-facts { grid-template-columns: minmax(0, 1fr); }
}
.fact {
  position: relative;
  padding: 11px 13px 10px;
  background: rgba(0, 243, 255, 0.03);
  border: 1px solid rgba(0, 243, 255, 0.16);
  border-left: 2px solid rgba(0, 243, 255, 0.45);
  border-radius: 4px;
}
.fact-tag {
  display: block;
  margin-bottom: 6px;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(0, 243, 255, 0.45);
}
.boot-disclaimer .fact p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: #9fabc2;
}
.boot-disclaimer .bd-agree {
  margin: 12px 0 0;
  color: var(--text-dim);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-align: center;
}

/* ---- 5. Download & community promo — side-by-side, stacked on narrow screens ---- */
.promo-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 700px) {
  .promo-row { grid-template-columns: minmax(0, 1fr); }
}

.promo-row.hide-download {
  grid-template-columns: minmax(0, 1fr);
}

.promo-card {
  display: flex; /* toggled to none by the kernel when running inside Electron */
  min-width: 0;
  flex-direction: column;
  align-items: center;
  padding: 12px 15px;
  border-radius: 10px;
  text-align: center;
}
.boot-disclaimer .promo-card > p {
  flex: 1 1 auto;
  margin: 0;
  font-family: var(--font-retro);
  font-size: 12px;
  line-height: 1.6;
}
.boot-action {
  --action-top: #45506b;
  --action-bottom: #293148;
  --action-border: rgba(255, 255, 255, 0.28);
  --action-glow: rgba(105, 125, 170, 0.34);
  --action-glow-hover: rgba(125, 150, 205, 0.52);
  position: relative;
  appearance: none;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  min-height: 40px;
  padding: 9px 30px;
  font-family: var(--font-retro);
  font-size: 14px;
  font-weight: bold;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(180deg, var(--action-top) 0%, var(--action-bottom) 100%);
  border: 1px solid var(--action-border);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.62);
  box-shadow: 0 0 18px var(--action-glow), inset 0 1px 0 rgba(255,255,255,0.16), inset 0 -2px 0 rgba(0,0,0,0.22);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
/* Hover shine: a highlight wipes once across the face of the button. */
.boot-action::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: skewX(-18deg);
  opacity: 0;
  pointer-events: none;
}
.boot-action:hover::after {
  opacity: 1;
  animation: bdShine 700ms ease-out;
}
@keyframes bdShine {
  to { left: 115%; }
}
.boot-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 26px var(--action-glow-hover), inset 0 1px 0 rgba(255,255,255,0.2), inset 0 -2px 0 rgba(0,0,0,0.22);
}
.boot-action:active { transform: translateY(1px); }
.boot-action:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 3px;
}
.promo-card > .boot-action { margin-top: 10px; }

.download-promo {
  background: rgba(255, 204, 0, 0.07);
  border: 1px solid rgba(255, 204, 0, 0.35);
  box-shadow: inset 0 0 16px rgba(255, 204, 0, 0.05), 0 0 18px rgba(255, 204, 0, 0.1);
}
.download-promo > p { color: #e8d9a0; }
.download-promo .promo-lead { color: #ffe070; }
.download-action {
  --action-top: #9a6a08;
  --action-bottom: #684400;
  --action-border: rgba(255, 218, 91, 0.72);
  --action-glow: rgba(255, 194, 0, 0.3);
  --action-glow-hover: rgba(255, 204, 0, 0.5);
}

/* ---- Community promo — only shown in hosted web builds (hidden in Electron) ---- */
.community-promo {
  background: rgba(88, 101, 242, 0.08); /* Discord blurple tint */
  border: 1px solid rgba(88, 101, 242, 0.35);
  box-shadow: inset 0 0 16px rgba(88, 101, 242, 0.05), 0 0 18px rgba(88, 101, 242, 0.08);
}

.community-promo > p { color: #c7d0e0; }
.community-discord-btn {
  --action-top: #5865d8;
  --action-bottom: #3943a6;
  --action-border: rgba(154, 164, 255, 0.72);
  --action-glow: rgba(88, 101, 242, 0.3);
  --action-glow-hover: rgba(88, 101, 242, 0.5);
}
.community-discord-btn svg { fill: currentColor; flex-shrink: 0; }

/* ---- Power-on START button (supplies the fullscreen/audio gesture) ---- */
/* The install path is the deliberate, secondary choice: quieter than the hero. */
.boot-start {
  --action-top: #3a4364;
  --action-bottom: #232a42;
  --action-border: rgba(167, 139, 250, 0.6);
  --action-glow: rgba(139, 92, 246, 0.22);
  --action-glow-hover: rgba(139, 92, 246, 0.45);
  display: flex;
  width: min(100%, 360px);
  min-height: 44px;
  padding: 10px 34px;
  font-size: 14px;
}
.boot-start-logo {
  display: block;
  width: auto;
  height: 22px;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 5px rgba(255,255,255,0.22));
}

@media (max-width: 768px) {
  .boot-screen {
    justify-content: flex-start;
    overflow-y: auto;
    padding: 24px 14px;
  }
  .boot-logo {
    width: min(76%, 360px);
    margin-top: auto;
  }
  .boot-disclaimer {
    margin-bottom: 24px;
    padding: 26px 14px 18px;
  }
  .boot-disclaimer .bd-title { font-size: 11px; letter-spacing: 0.2em; }
  /* The hero label must never outgrow a phone-width button. */
  .boot-temp-option .boot-temp {
    min-height: 50px;
    padding: 12px 14px;
    font-size: 13.5px;
    letter-spacing: 0.12em;
  }
  .boot-temp .boot-start-logo { height: 21px; }
  .boot-start { font-size: 13px; letter-spacing: 0.12em; padding: 10px 16px; }
}

/* Laptop-height screens: keep the whole console on one screen rather than
   letting the promo row fall below the fold. */
@media (max-height: 900px) and (min-width: 769px) {
  .boot-screen {
    justify-content: flex-start;
    overflow-y: auto;
    padding: 18px 40px;
  }
  .boot-logo { width: min(34%, 300px); }
  .boot-brand-version { margin-bottom: 16px; }
  .boot-disclaimer { padding: 24px 30px 18px; }
  .boot-temp-option .boot-temp { min-height: 48px; font-size: 15px; }
  .boot-temp-option > p,
  .boot-install-note { font-size: 12px; }
  .bd-split { margin: 14px auto 12px; }
  .bd-facts { margin-top: 16px; }
  .promo-row { margin-top: 12px; }
}

/* Motion is decoration here: every animation above is safe to drop outright. */
@media (prefers-reduced-motion: reduce) {
  .boot-screen::before,
  .boot-logo,
  .boot-disclaimer,
  .boot-disclaimer::before,
  .boot-disclaimer::after,
  .bd-sweep::after,
  .bd-title::before,
  .bd-step,
  .boot-temp-option::before,
  .boot-temp-option .boot-temp,
  .boot-action:hover::after {
    animation: none;
  }
  .bd-sweep { display: none; }
}
.boot-log {
  margin: 0;
  font-family: var(--font-retro);
  font-size: 15px;
  line-height: 1.55;
  color: #46f08a;
  text-shadow: 0 0 6px rgba(70,240,138,0.55);
  white-space: pre-wrap;
}
.boot-line-ok { color: var(--neon-cyan); }
.boot-line-warn { color: #ffcf5e; }
.boot-cursor::after { content: '\2588'; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---- Indeterminate "gravity Tetris" boot loader ---- */
/* A canvas-driven well where slim glowing horizontal lines build outward
   from the centre; when a line completes it flashes white and bursts into
   neon particles, then rebuilds. Rendered by Kernel._buildBootSpinner(). */
.boot-spinner {
  position: relative;
  width: 220px;
  height: 120px;
  margin: 0 auto;
}
.boot-spinner canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ------------------- Desktop Environment -------------------- */
.desktop-environment {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: var(--workspace-bg);
  background-image: radial-gradient(var(--window-border) 1px, transparent 0);
  background-size: 24px 24px;
}
/* Wallpaper variants applied via body/env classes from Settings */
.desktop-environment.wp-solid { background-image: none; }
.desktop-environment.wp-synthwave {
  background-image:
    linear-gradient(rgba(18,19,26,0.6), rgba(18,19,26,0.85)),
    repeating-linear-gradient(0deg, transparent, transparent 38px, rgba(168,85,247,0.25) 39px, transparent 40px),
    linear-gradient(180deg, #2b1055 0%, #7597de 100%);
  background-size: cover, 100% 40px, cover;
}
.desktop-environment.wp-image { background-size: cover; background-position: center; }

/* ---------------- Layered wallpaper stack ------------------- */
.wallpaper-stack {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.wp-layer {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center;
  will-change: opacity;
}
.wp-shader-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #05060b;
  pointer-events: none;
  will-change: auto;
}
.wp-layer-text {
  display: flex;
  align-items: center;
  padding: 0 4%;
  font-family: var(--font-retro);
  font-weight: bold;
  letter-spacing: 6px;
  white-space: pre-wrap;
  overflow: hidden;
  text-transform: uppercase;
}

.desktop-workspace {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: var(--taskbar-h);
  padding: 16px;
  overflow: hidden;
  z-index: 1;
}

/* ---------------------- Desktop Icons ----------------------- */
.desktop-icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, 92px);
  grid-auto-rows: 92px;
  gap: 6px;
  align-content: start;
}
.desktop-icon {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 6px; border-radius: 6px; cursor: pointer;
  border: 1px solid transparent; user-select: none; text-align: center;
}
.desktop-icon:hover { background: rgba(0,243,255,0.08); border-color: rgba(0,243,255,0.35); }
.desktop-icon.selected { background: rgba(0,243,255,0.15); border-color: var(--neon-cyan); }
.desktop-icon .icon-glyph {
  font-size: 34px; line-height: 1;
  filter: drop-shadow(0 0 5px rgba(0,243,255,0.35));
}
/* Image app-icons (data-URL icons) sit in the same slots as glyphs and scale
   to the slot's font-size, except desktop icons which get a fixed larger size. */
.app-icon-img {
  width: 1.15em; height: 1.15em; object-fit: contain;
  vertical-align: middle; display: inline-block;
}
.desktop-icon .icon-glyph .app-icon-img { width: 46px; height: 46px; }
.desktop-icon .icon-label {
  font-size: 11px; color: var(--text-primary);
  max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 0 0 1px rgba(0,0,0,0.95), 0 1px 1px rgba(0,0,0,0.9);
}

/* --------------- Desktop icon hover tooltip ----------------- */
.desktop-tooltip {
  position: absolute;
  top: 0; left: 0;
  max-width: 240px;
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 3px;
  background: rgba(20, 22, 32, 0.96);
  border: 1px solid var(--neon-cyan);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.55), 0 0 12px rgba(0,243,255,0.25);
  z-index: 1400;
  pointer-events: none;
  will-change: transform, opacity;
  transform-origin: top center;
  animation: tooltip-in .13s ease-out;
}
.desktop-tooltip .tt-title {
  font-size: 13px; font-weight: bold; color: var(--neon-cyan);
  text-shadow: 0 0 6px rgba(0,243,255,0.4);
}
.desktop-tooltip .tt-desc { font-size: 11px; color: var(--text-primary); line-height: 1.35; }
.desktop-tooltip .tt-meta { font-size: 10px; color: var(--text-dim); }
.desktop-tooltip .tt-meta:empty { display: none; }
@keyframes tooltip-in { from { opacity: 0; transform: scale(0.86); } }

/* ------------------ Desktop icon context menu --------------- */
.desktop-icon-context-menu {
  position: absolute;
  top: 0; left: 0;
  min-width: 136px;
  display: flex;
  flex-direction: column;
  padding: 4px;
  background: rgba(20, 22, 32, 0.98);
  border: 1px solid var(--neon-cyan);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.55), 0 0 12px rgba(0,243,255,0.24);
  z-index: 1450;
}
.desktop-context-action {
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-retro);
  font-size: 12px;
  text-align: left;
  padding: 7px 8px;
  border-radius: 4px;
  cursor: pointer;
}
.desktop-context-action:hover,
.desktop-context-action:focus-visible {
  outline: none;
  background: rgba(0,243,255,0.14);
  color: #fff;
}
.desktop-context-action.disabled,
.desktop-context-action:disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

/* --------------------- Lasso selection ---------------------- */
.desktop-lasso {
  position: absolute;
  top: 0; left: 0;
  z-index: 1300;
  pointer-events: none;
  border: 1px dashed var(--neon-cyan);
  background: rgba(0, 243, 255, 0.10);
  box-shadow: 0 0 10px rgba(0,243,255,0.25) inset;
  will-change: transform, width, height;
}

/* ========================= Meadows ========================= */
/* Fences/Portals-style icon groups. The layer sits above the wallpaper but
   below app windows (base z 100); meadows re-enable pointer events so the
   empty desktop still receives right-clicks. */
.meadows-layer { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.meadows-layer.editing { z-index: 6; }
.meadows-layer.editing::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 40%, rgba(0,243,255,0.05), transparent 60%),
              rgba(4, 6, 12, 0.34);
}

.meadow {
  position: absolute;
  box-sizing: border-box;
  pointer-events: auto;
  overflow: hidden;
  display: flex;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 7px;
  backdrop-filter: blur(var(--mw-blur, 16px)) saturate(1.2);
  -webkit-backdrop-filter: blur(var(--mw-blur, 16px)) saturate(1.2);
  box-shadow: 0 14px 42px rgba(0,0,0,0.45), inset 0 0 0 1px rgba(255,255,255,0.05);
  transition: width .34s cubic-bezier(.2,.85,.25,1), height .34s cubic-bezier(.2,.85,.25,1),
              box-shadow .25s ease, border-color .2s ease;
  will-change: width, height;
}
.meadow[data-axis="v"] { flex-direction: column; width: var(--mw-w); height: var(--mw-bar); }
.meadow[data-axis="h"] { flex-direction: row; width: var(--mw-bar); height: var(--mw-h); }
.meadow[data-axis="v"].mode-fixed,
.meadow[data-axis="v"].is-open { height: var(--mw-h); }
.meadow[data-axis="h"].mode-fixed,
.meadow[data-axis="h"].is-open { width: var(--mw-w); }
.meadow.is-open:not(.editing) {
  box-shadow: 0 20px 56px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,243,255,0.28), 0 0 22px rgba(0,243,255,0.18);
  border-color: rgba(0,243,255,0.3);
}
.meadow.editing { border-style: dashed; border-color: rgba(0,243,255,0.55); }
.meadow.dragging { transition: none; opacity: 0.94; box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 0 1px var(--neon-cyan); }
.meadow.is-hidden-meadow { opacity: 0.45; }

/* Photoshop-style alignment guides shown while dragging a meadow. */
.meadow-guide { position: absolute; z-index: 45; pointer-events: none; background: var(--neon-cyan); box-shadow: 0 0 6px rgba(0,243,255,0.85); }
.meadow-guide.v { top: 0; bottom: 0; width: 1px; }
.meadow-guide.h { left: 0; right: 0; height: 1px; }

.meadow-wall {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-size: cover; background-position: center; opacity: 0.55;
}

.meadow-bar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 8px;
  height: var(--mw-bar); padding: 0 10px 0 12px;
  position: relative; z-index: 2; user-select: none;
  color: var(--text-primary);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(0,0,0,0.12));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}
.meadow[data-axis="h"] .meadow-bar {
  flex-direction: column; width: var(--mw-bar); height: 100%; padding: 12px 0;
}
.meadow[data-axis="h"] .mb-title { writing-mode: vertical-rl; }
.meadow-bar.draggable { cursor: move; }
.mb-glyph { font-size: 16px; line-height: 1; }
.mb-title {
  flex: 1 1 auto; min-width: 0; font-weight: bold; font-size: 12px; letter-spacing: 0.4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.mb-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.mb-btn {
  border: 0; background: rgba(255,255,255,0.10); color: var(--text-primary);
  width: 22px; height: 22px; border-radius: 5px; cursor: pointer;
  font-size: 11px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.mb-btn:hover { background: rgba(0,243,255,0.28); color: #fff; }

.meadow-content {
  flex: 1 1 auto; min-width: 0; min-height: 0; overflow: auto;
  position: relative; z-index: 1; box-sizing: border-box;
}
.meadow-grid {
  display: grid; grid-template-columns: repeat(auto-fill, 72px); grid-auto-rows: 80px;
  gap: 6px; align-content: start; padding: 10px; box-sizing: border-box;
}
.meadow-empty { grid-column: 1 / -1; color: var(--text-dim); font-size: 11px; padding: 16px 8px; text-align: center; }
.meadow-empty-link {
  border: 0; padding: 0; background: none; color: var(--neon-cyan);
  font: inherit; text-decoration: underline; cursor: pointer;
}
.meadow-empty-link:hover { color: #fff; }
.meadow-empty-link:focus-visible { outline: 1px solid var(--neon-cyan); outline-offset: 2px; }
.meadow-icon {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 5px; padding: 6px 4px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; user-select: none; text-align: center;
}
.meadow-icon:hover { background: rgba(0,243,255,0.10); border-color: rgba(0,243,255,0.32); }
.meadow-icon .mi-glyph { font-size: 30px; line-height: 1; filter: drop-shadow(0 0 5px rgba(0,243,255,0.32)); }
.meadow-icon .mi-glyph .app-icon-img { width: 38px; height: 38px; }
.meadow-icon .mi-label {
  font-size: 10px; color: var(--text-primary); max-width: 68px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.92);
}

.meadow-resize {
  position: absolute; width: 18px; height: 18px; z-index: 4;
  background: radial-gradient(circle at center, rgba(0,243,255,0.95) 0 3.5px, transparent 4px);
}
.meadow-resize[data-grow="br"] { right: 1px; bottom: 1px; cursor: nwse-resize; }
.meadow-resize[data-grow="bl"] { left: 1px; bottom: 1px; cursor: nesw-resize; }
.meadow-resize[data-grow="tr"] { right: 1px; top: 1px; cursor: nesw-resize; }
.meadow-resize[data-grow="tl"] { left: 1px; top: 1px; cursor: nwse-resize; }

.meadows-editbar {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  max-width: 92%;
  padding: 8px 12px; border-radius: 12px; pointer-events: auto; z-index: 30;
  background: rgba(16, 18, 28, 0.94); border: 1px solid var(--neon-cyan);
  box-shadow: 0 14px 34px rgba(0,0,0,0.55), 0 0 16px rgba(0,243,255,0.3);
  animation: meadows-editbar-in .2s ease-out;
}
@keyframes meadows-editbar-in { from { opacity: 0; transform: translate(-50%, 12px); } }
.meadows-editbar .me-hint { font-size: 11px; color: var(--text-dim); margin-right: 4px; }
.me-btn {
  border: 1px solid rgba(0,243,255,0.4); background: rgba(0,243,255,0.10); color: var(--text-primary);
  font-family: var(--font-retro); font-size: 12px; padding: 6px 11px; border-radius: 6px; cursor: pointer;
}
.me-btn:hover { background: rgba(0,243,255,0.22); }
.me-check {
  display: flex; align-items: center; gap: 6px; font-size: 12px;
  color: var(--text-primary); cursor: pointer; user-select: none;
  padding: 0 4px; border-right: 1px solid rgba(255,255,255,0.12); margin-right: 2px;
}
.me-check input { accent-color: var(--neon-cyan); cursor: pointer; }
/* Faint icon-cell grid while snapping, so you can see how many icons fit. */
.meadows-layer.snapping .meadow.editing .meadow-content {
  background-image:
    linear-gradient(to right, rgba(0,243,255,0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,243,255,0.12) 1px, transparent 1px);
  background-size: 78px 86px;
  background-position: 10px 10px;
}

/* --------------------- Draggable Windows -------------------- */
.continuum-rx-window {
  position: absolute;
  top: 0; left: 0;
  background-color: var(--window-bg);
  border: 2px solid var(--window-border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 1px var(--neon-cyan);
  display: flex;
  flex-direction: column;
  min-width: 240px;
  min-height: 160px;
  will-change: transform;
  border-radius: 4px;
  overflow: hidden;
}
.continuum-rx-window.active-focus {
  box-shadow: 0 14px 40px rgba(0,0,0,0.6), 0 0 14px rgba(0,243,255,0.35);
}
.continuum-rx-window.maximized { border-radius: 0; }

/* Fullscreen screensaver surface: chrome-less, spanning the whole viewport.
   Raise the workspace above every piece of desktop chrome while a saver runs;
   the screen-filter remains deliberately higher so an enabled display effect
   still applies to the saver. */
body.rx-screensaver .desktop-workspace { z-index: 2147482000; }
.continuum-rx-window.screensaver-fs {
  position: fixed !important;
  top: 0 !important; left: 0 !important;
  width: 100vw !important; height: 100vh !important;
  transform: none !important;
  border: none !important; border-radius: 0 !important;
  box-shadow: none !important;
  /* Normal windows start at z-index 100 and rise on every focus, so the saver
     must be pinned above the complete window stack. */
  z-index: 2147482000 !important;
}
.continuum-rx-window.screensaver-fs .window-titlebar,
.continuum-rx-window.screensaver-fs .win-resize-edge,
.continuum-rx-window.screensaver-fs .win-resize-corner { display: none !important; }
.continuum-rx-window.opening { animation: win-open .16s ease-out; }
@keyframes win-open {
  from { opacity: 0; transform: translate3d(var(--wx,0), var(--wy,0), 0) scale(.96); }
}

.window-titlebar {
  background: linear-gradient(90deg, var(--window-titlebar), #23263a);
  padding: 6px 8px 6px 10px;
  cursor: move;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.window-title-icon { font-size: 15px; }
.window-title-text {
  flex: 1 1 auto; text-align: left; font-weight: bold; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.window-controls { display: flex; gap: 4px; flex: 0 0 auto; }
.win-btn {
  width: 22px; height: 20px; border: 1px solid var(--window-border);
  background: #171925; color: var(--text-primary); cursor: pointer;
  font-family: var(--font-retro); font-size: 12px; line-height: 1;
  border-radius: 3px; display: flex; align-items: center; justify-content: center;
}
.win-btn:hover { background: #262a3d; }
.win-btn.win-close:hover { background: var(--neon-magenta); color: #fff; }

.window-content-frame {
  flex: 1 1 auto;
  width: 100%;
  border: none;
  background-color: #0f1017;
  display: block;
}

.continuum-rx-window.dragging .window-content-frame,
.continuum-rx-window.resizing .window-content-frame { pointer-events: none; }

/* Resize grips: four edges + four corners (only shown when resizable). */
.win-resize-edge, .win-resize-corner { position: absolute; z-index: 3; }
.win-resize-n { top: 0; left: 0; right: 0; height: 4px; cursor: ns-resize; }
.win-resize-s { bottom: 0; left: 0; right: 0; height: 4px; cursor: ns-resize; }
.win-resize-w { left: 0; top: 0; bottom: 0; width: 4px; cursor: ew-resize; }
.win-resize-e { right: 0; top: 0; bottom: 0; width: 4px; cursor: ew-resize; }
.win-resize-corner { width: 14px; height: 14px; z-index: 4; }
.win-resize-nw { top: 0; left: 0; cursor: nwse-resize; }
.win-resize-ne { top: 0; right: 0; cursor: nesw-resize; }
.win-resize-sw { bottom: 0; left: 0; cursor: nesw-resize; }
.win-resize-se {
  bottom: 0; right: 0; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, var(--window-border) 50%, var(--window-border) 60%, transparent 60%, transparent 75%, var(--window-border) 75%);
}
.continuum-rx-window.maximized .win-resize-edge,
.continuum-rx-window.maximized .win-resize-corner { display: none; }

/* Window snap alignment guides — identical styling to the Meadows aligner. */
.win-guide { position: absolute; z-index: 999999; pointer-events: none; background: var(--neon-cyan); box-shadow: 0 0 6px rgba(0,243,255,0.85); }
.win-guide.v { top: 0; bottom: 0; width: 1px; }
.win-guide.h { left: 0; right: 0; height: 1px; }

/* --------------------- System Taskbar ----------------------- */
.system-taskbar {
  position: absolute;
  bottom: 0; left: 0; width: 100%; height: var(--taskbar-h);
  background: linear-gradient(180deg, #191b26, var(--retro-dark));
  border-top: 2px solid var(--window-border);
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1500;
}
.start-menu-trigger {
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--neon-magenta), #b3003b);
  border: none; color: white; padding: 5px 18px;
  font-weight: bold; cursor: pointer; font-family: var(--font-retro);
  box-shadow: 0 0 8px var(--neon-magenta); border-radius: 4px;
}
.start-menu-trigger:hover { filter: brightness(1.12); }
.start-menu-trigger.active { filter: brightness(1.2); box-shadow: 0 0 14px var(--neon-magenta); }
.start-logo { height: 24px; width: auto; display: block; filter: drop-shadow(0 0 3px rgba(0,0,0,0.45)); }

.minimized-process-strip {
  flex: 1 1 auto; display: flex; align-items: center; gap: 6px; overflow-x: auto;
}
.taskbar-app {
  display: flex; align-items: center; gap: 6px; max-width: 190px;
  padding: 5px 12px; cursor: pointer;
  background: #1c1e29; border: 1px solid var(--window-border);
  border-radius: 4px; font-size: 12px; color: var(--text-dim);
}
.taskbar-app:hover { color: var(--text-primary); border-color: var(--neon-cyan); }
.taskbar-app.active { color: var(--text-primary); border-color: var(--neon-cyan); background: #232739; }
.taskbar-app .ta-glyph { font-size: 14px; }
.taskbar-app .ta-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.system-tray { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.tray-btn {
  background: #1c1e29; border: 1px solid var(--window-border); color: var(--text-primary);
  width: 30px; height: 28px; border-radius: 4px; cursor: pointer; font-size: 14px;
}
.tray-btn:hover { border-color: var(--neon-cyan); }
.tray-btn.mounted { border-color: #46f08a; color: #46f08a; }
.tray-btn.pending { border-color: #ffb454; color: #ffb454; }
#mountBtn { position: relative; }
#mountBtn[data-count]:not([data-count=""])::after {
  content: attr(data-count);
  position: absolute; top: -6px; right: -6px;
  min-width: 14px; height: 14px; padding: 0 3px; box-sizing: border-box;
  background: #000; color: #fff;
  font-size: 9px; font-weight: bold; line-height: 14px; text-align: center;
  border-radius: 8px;
}
.tray-btn.discord-tray {
  display: grid; place-items: center; color: #a9b6ff; border-color: #5865f2;
  text-decoration: none;
}
.tray-btn.discord-tray svg { width: 18px; height: 18px; fill: currentColor; }
.tray-btn.discord-tray:hover {
  color: #fff; background: #5865f2; border-color: #8d97ff;
  box-shadow: 0 0 10px rgba(88,101,242,0.55);
}

/* Q-RX console launcher button (opens console mode). */
.tray-btn.qrx-tray {
  width: auto; padding: 0 12px; font-size: 12px; font-weight: 800; font-style: italic;
  letter-spacing: 0.5px; color: var(--neon-magenta); border-color: var(--neon-magenta);
  text-shadow: 0 0 8px rgba(255, 0, 85, 0.4);
}
.tray-btn.qrx-tray:hover {
  color: #fff; background: rgba(255, 0, 85, 0.16);
  box-shadow: 0 0 12px rgba(255, 0, 85, 0.45);
}

/* Gamepad tray indicator (shown only while a controller is connected). */
.tray-btn.gamepad-tray { position: relative; }
.tray-btn.gamepad-tray.active {
  border-color: var(--neon-cyan); color: var(--neon-cyan);
  box-shadow: 0 0 8px rgba(0,243,255,0.35);
}
.tray-btn.gamepad-tray[data-count]:not([data-count=""])::after {
  content: attr(data-count);
  position: absolute; top: -6px; right: -6px;
  min-width: 14px; height: 14px; padding: 0 3px; box-sizing: border-box;
  background: var(--neon-magenta); color: #fff;
  font-size: 9px; font-weight: bold; line-height: 14px; text-align: center;
  border-radius: 8px;
}
.tray-btn.gamepad-tray.pulse { animation: gp-pulse 0.5s ease-out; }
@keyframes gp-pulse {
  from { box-shadow: 0 0 0 0 rgba(0,243,255,0.6); }
  to   { box-shadow: 0 0 0 11px rgba(0,243,255,0); }
}

/* Physical-session user tray (avatar) + Switch User / Shut Down menu. */
.tray-btn.rx-user-tray { width: 30px; height: 28px; padding: 0; overflow: hidden; display: grid; place-items: center; }
.tray-btn.rx-user-tray:hover { border-color: var(--neon-cyan); box-shadow: 0 0 8px rgba(0,243,255,0.3); }
.rx-user-avatar { width: 22px; height: 22px; border-radius: 5px; object-fit: cover; display: block; }
.rx-user-menu {
  position: fixed; z-index: 6000; min-width: 208px;
  background: #12162b; border: 1px solid var(--window-border); border-radius: 10px;
  box-shadow: 0 18px 46px rgba(0,0,0,0.6); padding: 8px; overflow: hidden;
}
.rx-um-head { display: flex; gap: 10px; align-items: center; padding: 8px 8px 12px; border-bottom: 1px solid var(--window-border); margin-bottom: 6px; }
.rx-um-avatar { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; display: grid; place-items: center; font-size: 22px; background: #0c1024; }
.rx-um-name { font-family: 'Segoe UI', system-ui, sans-serif; font-weight: 700; font-size: 14px; }
.rx-um-role { font-family: 'Segoe UI', system-ui, sans-serif; font-size: 11.5px; color: var(--text-dim); }
.rx-um-item {
  display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px;
  background: transparent; border: none; color: var(--text-primary); cursor: pointer;
  font-family: 'Segoe UI', system-ui, sans-serif; font-size: 13px;
}
.rx-um-item:hover { background: rgba(139,92,246,0.16); }

/* Temporary (volatile) session badge. */
.rx-temp-badge {
  padding: 4px 9px; border-radius: 4px; font-size: 10px; font-weight: 800; letter-spacing: 0.08em;
  color: #ffcf5e; border: 1px solid #ffb454; background: rgba(255,180,84,0.1);
  font-family: 'Segoe UI', system-ui, sans-serif; text-shadow: 0 0 6px rgba(255,180,84,0.3);
  animation: rx-temp-pulse 2.4s ease-in-out infinite;
}
@keyframes rx-temp-pulse { 0%, 100% { opacity: 0.85; } 50% { opacity: 1; } }

.system-tray-clock {
  padding: 5px 10px; font-size: 13px; color: var(--neon-cyan);
  border: 1px solid var(--window-border); border-radius: 4px; min-width: 80px; text-align: center;
  text-shadow: 0 0 6px rgba(0,243,255,0.4);
}

/* ---------------------- Start Menu -------------------------- */
.start-menu-popup {
  position: absolute;
  left: 8px; bottom: calc(var(--taskbar-h) + 6px);
  width: 300px; max-height: 60vh;
  background: var(--window-bg);
  border: 2px solid var(--neon-magenta);
  box-shadow: 0 0 24px rgba(255,0,85,0.35);
  border-radius: 6px; z-index: 1600;
  display: flex; flex-direction: column; overflow: hidden;
}
.start-menu-banner {
  background: linear-gradient(135deg, var(--neon-magenta), var(--neon-purple));
  padding: 12px 14px; display: flex; align-items: center; justify-content: space-between;
}
.start-menu-logo { height: 22px; width: auto; filter: drop-shadow(0 0 5px rgba(0,0,0,0.45)); }
.start-menu-title { font-weight: bold; font-size: 17px; letter-spacing: 1px; color: #fff; }
.start-menu-ver { font-size: 11px; color: rgba(255,255,255,0.8); }
.start-menu-filter { padding: 8px 10px 0; flex: 0 0 auto; }
.start-menu-filter input {
  width: 100%; padding: 7px 9px; background: rgba(0,0,0,0.35); color: var(--text-primary);
  border: 1px solid var(--window-border); border-radius: 4px; font-size: 12px; font-family: inherit;
}
.start-menu-filter input:focus { outline: none; border-color: var(--neon-cyan); }
.start-menu-list { flex: 1 1 auto; overflow-y: auto; padding: 6px; }
.start-menu-empty { padding: 18px 10px; text-align: center; color: var(--text-dim); font-size: 12px; }
.launcher-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  cursor: pointer; border-radius: 4px;
}
.launcher-item:hover { background: rgba(0,243,255,0.1); }
.launcher-item.highlighted { background: rgba(0,243,255,0.16); box-shadow: inset 0 0 0 1px var(--neon-cyan); }
.launcher-item .li-glyph { font-size: 22px; width: 26px; text-align: center; }
.launcher-item .li-body { display: flex; flex-direction: column; overflow: hidden; }
.launcher-item .li-name { font-size: 13px; }
.launcher-item .li-desc { font-size: 10px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.start-menu-footer {
  flex: 0 0 auto; padding: 6px 12px; font-size: 11px; color: var(--text-dim);
  border-top: 1px solid var(--window-border);
}

/* --------------------- Notifications ------------------------ */
.notification-stack {
  position: absolute;
  right: 12px; bottom: calc(var(--taskbar-h) + 12px);
  display: flex; flex-direction: column; gap: 8px; z-index: 1700;
  max-width: 320px;
}
.notification {
  background: var(--window-bg); border-left: 4px solid var(--neon-cyan);
  border-radius: 4px; padding: 10px 14px; font-size: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  animation: notify-in .2s ease-out;
}
.notification.info { border-left-color: var(--neon-cyan); }
.notification.success { border-left-color: #46f08a; }
.notification.warn { border-left-color: #ffcf5e; }
.notification.error { border-left-color: var(--neon-magenta); }
.notification .n-title { font-weight: bold; margin-bottom: 2px; }
.notification.fade-out { animation: notify-out .25s ease-in forwards; }
@keyframes notify-in { from { opacity: 0; transform: translateX(24px); } }
@keyframes notify-out { to { opacity: 0; transform: translateX(24px); } }

/* ------------------- System dialogs (modal) ----------------- */
.rx-dialog-overlay {
  position: absolute;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 6, 10, 0.55);
  backdrop-filter: blur(2px);
  animation: rx-dialog-fade .12s ease-out;
}
@keyframes rx-dialog-fade { from { opacity: 0; } }
.rx-dialog {
  width: min(92vw, 440px);
  background: var(--window-bg);
  border: 2px solid var(--neon-cyan);
  border-radius: 6px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.6), 0 0 22px rgba(0,243,255,0.28);
  overflow: hidden;
  font-family: var(--font-retro);
  animation: rx-dialog-pop .16s ease-out;
}
.rx-dialog.danger {
  border-color: var(--neon-magenta);
  box-shadow: 0 18px 50px rgba(0,0,0,0.6), 0 0 22px rgba(255,0,85,0.32);
}
.rx-dialog.closing { animation: rx-dialog-out .16s ease-in forwards; }
@keyframes rx-dialog-pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes rx-dialog-out { to { opacity: 0; transform: scale(.97); } }
.rx-dialog-titlebar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--neon-cyan), #0091a8);
  color: #04121a; font-weight: bold; letter-spacing: .5px;
}
.rx-dialog.danger .rx-dialog-titlebar {
  background: linear-gradient(135deg, var(--neon-magenta), #b3003b); color: #fff;
}
.rx-dialog-icon { font-size: 15px; line-height: 1; }
.rx-dialog-title { font-size: 14px; }
.rx-dialog-body {
  padding: 18px 16px;
  color: var(--text-primary);
  font-size: 13px; line-height: 1.5;
}
.rx-dialog-message { white-space: pre-wrap; }
.rx-dialog-input {
  width: 100%; margin-top: 12px;
  padding: 8px 10px;
  background: #12131a;
  border: 1px solid var(--window-border);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-retro); font-size: 13px;
}
.rx-dialog-input:focus { outline: none; border-color: var(--neon-cyan); box-shadow: 0 0 8px rgba(0,243,255,0.35); }
.rx-dialog-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 0 16px 16px;
}
.rx-dialog-btn {
  padding: 7px 18px;
  border-radius: 4px;
  border: 1px solid var(--window-border);
  background: #232739; color: var(--text-primary);
  font-family: var(--font-retro); font-weight: bold; font-size: 12px;
  cursor: pointer;
}
.rx-dialog-btn:hover { border-color: var(--neon-cyan); color: #fff; }
.rx-dialog-btn:focus-visible { outline: 2px solid var(--neon-cyan); outline-offset: 2px; }
.rx-dialog-ok {
  background: linear-gradient(135deg, var(--neon-cyan), #0091a8);
  border-color: transparent; color: #04121a;
}
.rx-dialog-ok:hover { filter: brightness(1.1); color: #04121a; }
.rx-dialog-ok.danger { background: linear-gradient(135deg, var(--neon-magenta), #b3003b); color: #fff; }
.rx-dialog-ok.danger:hover { color: #fff; }
