/* =========================================
   Global Loader & Master Systems Engine (style.sys.css)
   ✨ TRUE COLOR PRESERVATION: Panel backgrounds updated to match the crisp edge-lighting of Spatial Cards.
   ✨ VARIABLE SCOPE FIX: Fallbacks added to all color-mix calls to prevent browsers from dropping invalid backgrounds.
   ✨ LITE-FIRST DEFAULTS: Solid UI elements, mechanical frames, zero drop shadows.
   ✨ OCCLUSION MATRIX: Systems panels seamlessly mask overlapping UI using circadian shell backgrounds.
   ✨ Z-INDEX SUPREMACY: Lowered system wrap to 90000, enabling maximized spatial cards to properly cover it.
   ========================================= */

#globalLoader {
  position: fixed; inset: 0; z-index: 9999999; /* Absolute top */
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--bgBot, #000) 95%, #050508);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity 0.8s ease, visibility 0.8s ease;
  will-change: opacity;
}

body:not(.is-loading) #globalLoader,
#globalLoader.loader-fade { 
  opacity: 0; 
  visibility: hidden; 
  pointer-events: none; 
}
#globalLoader.loader-hidden { display: none !important; }

#globalLoader .loader-ring {
  width: 2px; height: 2px; border-radius: 50%;
  position: relative;
  opacity: 0; 
  animation: efLoaderSpin 25s linear infinite, ringFadeIn 1.5s ease-out forwards;
  will-change: transform, opacity;
}

@keyframes ringFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Sharp minimal loader sparks */
#globalLoader .loader-ring::before,
#globalLoader .loader-ring::after {
  content: ''; 
  position: absolute; top: 50%; left: 50%; 
  width: 6px; height: 6px;
  border-radius: 50%; 
  background: var(--capsuleAccent, #fff);
  transform: translate(-50%, -50%);
  transition: opacity 0.4s ease;
  will-change: opacity;
}

#globalLoader .loader-ring::before {
  box-shadow:
    -15px -20px 0px 0px color-mix(in srgb, var(--capsuleAccent, #fff) 80%, transparent),
     20px -15px 0px 0px var(--capsuleAccent, #fff),
     15px  20px 0px 0px color-mix(in srgb, var(--capsuleAccent, #fff) 90%, transparent),
    -25px  10px 0px 0px color-mix(in srgb, var(--capsuleAccent, #fff) 50%, transparent);
  animation: sparkBreathe 3.5s ease-in-out infinite alternate;
}

#globalLoader .loader-ring::after {
  box-shadow:
     25px  15px 0px 0px color-mix(in srgb, var(--capsuleAccent, #fff) 70%, transparent),
    -20px  20px 0px 0px color-mix(in srgb, var(--capsuleAccent, #fff) 60%, transparent),
    -15px -20px 0px 0px var(--capsuleAccent, #fff),
     10px -25px 0px 0px color-mix(in srgb, var(--capsuleAccent, #fff) 50%, transparent);
  animation: sparkBreathe 4.5s ease-in-out infinite alternate-reverse;
}

body:not(.is-loading) #globalLoader .loader-ring,
#globalLoader.loader-fade .loader-ring {
  transform: scale(8);
  opacity: 0;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease;
}

body:not(.is-loading) #globalLoader .loader-ring::before,
#globalLoader.loader-fade .loader-ring::before,
body:not(.is-loading) #globalLoader .loader-ring::after,
#globalLoader.loader-fade .loader-ring::after {
  animation-play-state: paused;
  opacity: 0;
  box-shadow: none;
}

@keyframes sparkBreathe {
  0% { opacity: 0.3; transform: translate(-50%, -50%) scale(0.8) rotate(0deg); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1.2) rotate(15deg); }
}
@keyframes efLoaderSpin { 
  from { transform: rotate(0deg); } 
  to { transform: rotate(360deg); } 
}

/* =========================================================
   Sanctuary Systems UI (Orb & Panel)
   ========================================================= */
body.is-loading #ef-sys-wrap { opacity: 0 !important; visibility: hidden !important; transform: translateY(-10px); }

#ef-sys-wrap {
  position: fixed; top: 24px; right: 30px; z-index: 90000; /* ✨ THE FIX: Lowered to allow maximized cards to sit above */
  display: flex; flex-direction: column; align-items: flex-end;
  transition: opacity 0.4s ease, visibility 0.4s, transform 0.4s ease;
}

.ef-orb-container { display: flex; gap: 16px; align-items: center; justify-content: flex-end; }

/* Flat unshadowed anchor systems orb */
.ef-orb {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  background: color-mix(in srgb, rgb(var(--circadian-dark, 0,0,0)) 90%, #050508);
  border: 2px solid color-mix(in srgb, var(--capsuleAccent, #fff) 40%, rgba(255,255,255,0.2));
  box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
  user-select: none; -webkit-tap-highlight-color: transparent;
  will-change: transform;
}

#ef-sys-heart-orb::after {
  content: '♥'; color: var(--capsuleAccent, #ff6482); font-size: 18px; line-height: 1; transition: color 0.2s, transform 0.2s;
}
#ef-sys-heart-orb:hover { transform: scale(1.1); border-color: var(--capsuleAccent, #ff6482); }
#ef-sys-heart-orb.is-active { transform: scale(1.1); background: var(--capsuleAccent, #ff6482); border-color: #fff; }
#ef-sys-heart-orb.is-active::after { content: '✕'; color: #000; font-size: 18px; font-weight: 900; transform: rotate(90deg); }

@keyframes orb-backup-pulse {
  0%, 100% { transform: scale(1) translateZ(0); opacity: 1; }
  50% { transform: scale(1.2) translateZ(0); opacity: 0.8; }
}
#ef-sys-orb.needs-backup:not(.is-active)::before {
  content: ''; position: absolute; top: 0px; right: 0px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--capsuleAccent, #ffaa55); border: 2px solid #000; z-index: 2;
  animation: orb-backup-pulse 1.5s infinite ease-in-out; will-change: transform, opacity;
}

/* ✨ REFINED & BULLETPROOF: Strict fallbacks added to all variables to guarantee rendering */
.ef-glass-panel {
  position: absolute; top: 64px; right: 0; width: 360px; border-radius: 20px;
  background: linear-gradient(var(--bgAngle, 180deg), 
      color-mix(in srgb, rgb(var(--circadian-accent, 255,255,255)) 12%, color-mix(in srgb, var(--capsuleAccent, #88ccff) 15%, #121216)) 0%, 
      color-mix(in srgb, var(--capsuleAccent, #88ccff) 8%, #08080a) 30%, 
      color-mix(in srgb, var(--capsuleAccent, #88ccff) 3%, #030304) 100%
  );
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border: 1px solid color-mix(in srgb, var(--capsuleAccent, #88ccff) 40%, rgba(255,255,255,0.15));
  border-top: 3px solid var(--capsuleAccent, #88ccff);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--capsuleAccent, #88ccff) 60%, rgba(255,255,255,0.3)),
              inset 0 20px 40px -20px color-mix(in srgb, rgb(var(--circadian-bright, 255,255,255)) 20%, transparent);
  padding: 32px; color: #fff; font-family: 'Noto Sans JP', sans-serif;
  visibility: hidden; opacity: 0; transform: translateY(-5px) scale(0.98) translateZ(0);
  transform-origin: top right; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease; z-index: 10; will-change: transform, opacity;
}
.ef-glass-panel.is-open { visibility: visible; opacity: 1; transform: translateY(0) scale(1) translateZ(0); pointer-events: auto; }

.sys-section { margin-bottom: 32px; opacity: 1; }
.sys-section:last-child { margin-bottom: 0; }
.sys-title { font-size: 10px; text-transform: uppercase; letter-spacing: 4px; color: color-mix(in srgb, var(--capsuleAccent, #88ccff) 80%, #fff); margin-bottom: 20px; font-weight: 900; border-bottom: 1px solid color-mix(in srgb, var(--capsuleAccent, #88ccff) 30%, rgba(255,255,255,0.15)); padding-bottom: 10px; text-shadow: none; transition: border-color 0.2s ease; }
.sys-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-size: 13px; gap: 14px; }
.sys-row:last-child { margin-bottom: 0; }
.sys-label { color: #fff; font-weight: 900; letter-spacing: 0.5px; text-shadow: none; }
.sys-subtext { font-size: 11px; color: color-mix(in srgb, var(--capsuleAccent, #88ccff) 20%, rgba(255,255,255,0.8)); display: block; margin-top: 4px; font-weight: 700; line-height: 1.4; text-shadow: none; }

.sys-btn-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.sys-btn {
  background: color-mix(in srgb, rgb(var(--circadian-dark, 0,0,0)) 80%, #000); border: 1px solid var(--capsuleAccent, #88ccff); border-radius: 999px;
  color: #fff; padding: 7px 14px; min-height: 30px; line-height: 1;
  font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 2px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-shadow: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  user-select: none; -webkit-tap-highlight-color: transparent; white-space: nowrap; text-shadow: none;
}
.sys-btn:hover { background: var(--capsuleAccent, #88ccff); border-color: #fff; color: #000; }
.sys-btn.primary { background: color-mix(in srgb, rgb(var(--circadian-accent, 85,170,255)) 20%, #000); border-color: rgb(var(--circadian-accent, 85,170,255)); color: #fff; }
.sys-btn.primary:hover { background: rgb(var(--circadian-accent, 85,170,255)); border-color: #fff; color: #000; }
.sys-btn.warning { background: color-mix(in srgb, #ff5555 20%, #000); border-color: #ff5555; color: #fff; }
.sys-btn.warning:hover { background: #ff5555; border-color: #fff; color: #000; }

.sys-toggle {
  width: 46px; height: 22px; background: color-mix(in srgb, rgb(var(--circadian-dark, 0,0,0)) 80%, #000); border-radius: 999px; position: relative; cursor: pointer;
  border: 1.5px solid color-mix(in srgb, var(--capsuleAccent, #88ccff) 40%, rgba(255,255,255,0.2)); box-shadow: none; flex: 0 0 auto;
  transition: background-color 0.2s, border-color 0.2s; user-select: none; -webkit-tap-highlight-color: transparent;
}
.sys-toggle.is-active { background: var(--capsuleAccent, #88ccff); border-color: var(--capsuleAccent, #88ccff); }
.sys-toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; background: #fff; border-radius: 999px;
  transition: transform 0.2s ease; box-shadow: none; border: 1px solid #000;
}
.sys-toggle.is-active::after { transform: translateX(24px); background: #000; border-color: #fff; }
.sys-toggle.is-disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.sys-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--capsuleAccent, #88ccff); background: color-mix(in srgb, rgb(var(--circadian-dark, 0,0,0)) 80%, #000); font-size: 10px; font-weight: 900;
  letter-spacing: 2px; text-transform: uppercase; color: #fff; user-select: none; white-space: nowrap; flex: 0 0 auto; box-shadow: none; text-shadow: none;
}
.sys-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--capsuleAccent, #88ccff); box-shadow: none; transition: background-color 0.2s; }
.sys-pill.state-syncing .sys-dot { background: rgb(var(--circadian-accent, 85,170,255)); }
.sys-pill.state-synced  .sys-dot { background: #88ffaa; }
.sys-pill.state-error   .sys-dot { background: #ff5555; }

/* System Modals */
.diegetic-modal-wrap {
  position: fixed; inset: 0; z-index: 999995; /* Sits over the sys panel, under loader */
  background: rgba(0,0,0,0.9); backdrop-filter: none; -webkit-backdrop-filter: none;
  display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s; will-change: opacity;
}

/* ✨ REFINED & BULLETPROOF: Fallback targets added to modal boundaries */
.diegetic-modal {
  background: linear-gradient(var(--bgAngle, 180deg), 
      color-mix(in srgb, rgb(var(--circadian-accent, 255,255,255)) 12%, color-mix(in srgb, var(--capsuleAccent, #88ccff) 15%, #121216)) 0%, 
      color-mix(in srgb, var(--capsuleAccent, #88ccff) 8%, #08080a) 30%, 
      color-mix(in srgb, var(--capsuleAccent, #88ccff) 3%, #030304) 100%
  );
  border: 1px solid color-mix(in srgb, var(--capsuleAccent, #88ccff) 40%, rgba(255,255,255,0.15));
  border-top: 3px solid var(--capsuleAccent, #88ccff);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--capsuleAccent, #88ccff) 60%, rgba(255,255,255,0.3)),
              inset 0 20px 40px -20px color-mix(in srgb, rgb(var(--circadian-bright, 255,255,255)) 20%, transparent);
  padding: 40px 50px; border-radius: 24px; max-width: 500px; text-align: center; transform: translateZ(0);
}
.modal-title { font-family: 'Caveat', cursive; font-size: 42px; margin: 0 0 10px 0; background: none; color: var(--capsuleAccent, #88ccff); text-shadow: none; font-weight: 900; }
.modal-desc { font-family: 'Noto Sans JP', sans-serif; font-size: 14px; line-height: 1.5; color: #fff; margin-bottom: 30px; text-shadow: none; font-weight: 700; }
.modal-actions { display: flex; flex-direction: column; gap: 12px; }
.modal-btn {
  background: color-mix(in srgb, rgb(var(--circadian-dark, 0,0,0)) 80%, #000); border: 1px solid var(--capsuleAccent, #88ccff); color: #fff; padding: 14px; border-radius: 12px;
  font-family: 'Noto Sans JP'; font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: 2px; cursor: pointer; box-shadow: none; transition: background-color 0.2s, border-color 0.2s, color 0.2s; text-shadow: none;
}
.modal-btn:hover { background: var(--capsuleAccent, #88ccff); border-color: #fff; color: #000; }
.modal-btn.warning { background: color-mix(in srgb, #ff5555 20%, #000); border-color: #ff5555; color: #fff; }
.modal-btn.warning:hover { background: #ff5555; border-color: #fff; color: #000; }
.modal-btn.ghost { background: transparent; border-color: transparent; opacity: 0.8; }
.modal-btn.ghost:hover { opacity: 1; background: var(--capsuleAccent, #88ccff); border-color: #fff; color: #000; }

#ef-sys-modal-wrap.is-active, .diegetic-modal-wrap.is-active { opacity: 1 !important; visibility: visible !important; pointer-events: auto !important; }

/* Classy SVG Circular Timer */
.idle-circle-wrap {
  position: fixed; bottom: 30px; right: 30px; width: 40px; height: 40px; opacity: 0; transform: scale(0.9) translateY(5px);
  transition: opacity 0.3s ease, transform 0.3s ease; pointer-events: none; z-index: 910; will-change: transform, opacity;
}
.idle-circle-wrap.is-visible { opacity: 1; transform: scale(1) translateY(0); }
.idle-circle-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); filter: none; }
.idle-circle-bg { fill: none; stroke: color-mix(in srgb, var(--capsuleAccent, #88ccff) 30%, rgba(255, 255, 255, 0.2)); stroke-width: 2.5; }
.idle-circle-stroke { fill: none; stroke: var(--capsuleAccent, #88ccff); stroke-width: 2.5; stroke-linecap: round; transition: stroke-dasharray 0.1s linear; }

/* =========================================================================
   MOBILE / NARROW BROWSER FALLBACK (The Sanctuarie Blockade)
   ========================================================================= */
#mobile-blockade { display: none; }

@media screen and (max-width: 650px), screen and (max-height: 450px) {
  body {
    overflow: hidden !important;
    touch-action: none !important; 
    position: fixed !important; 
    width: 100vw;
    height: 100vh;
  }

  #mobile-blockade {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    position: fixed; inset: 0;
    z-index: 100000; /* Punches through timeline blockades */
    background: #050508;
    padding: 10vw; text-align: center; box-sizing: border-box;
    pointer-events: all !important; 
    cursor: default;
  }

  .blockade-orb {
    width: 60px; height: 60px; border-radius: 50%;
    background: var(--capsuleAccent, rgb(var(--circadian-accent, 136,204,255)));
    border: 3px solid #fff;
    box-shadow: none;
    margin-bottom: 30px;
    animation: none;
  }

  .blockade-title {
    font-family: 'Caveat', cursive; font-size: 38px; color: var(--capsuleAccent, #fff); margin: 0 0 10px 0;
    text-shadow: none; line-height: 1.1; font-weight: 900;
  }

  .blockade-subtitle {
    font-family: 'Noto Sans JP', sans-serif; font-size: 10px; font-weight: 900;
    text-transform: uppercase; letter-spacing: 4px; color: #fff; margin-bottom: 30px;
  }

  .blockade-text {
    font-family: 'Neuton', serif; font-size: 16px; color: #fff; font-weight: 700;
    line-height: 1.5; max-width: 320px; text-shadow: none;
  }
}

/* Mobile Presence Capsule */
.mobile-presence-capsule {
  display: inline-flex; align-items: center; gap: 10px;
  background: color-mix(in srgb, rgb(var(--circadian-dark, 0,0,0)) 80%, #000); border: 1px solid var(--capsuleAccent, #88ccff);
  padding: 8px 18px; border-radius: 999px; margin-bottom: 40px;
  font-family: 'Noto Sans JP', sans-serif; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 2px;
  color: #fff; box-shadow: none; text-shadow: none;
}
.mp-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--capsuleAccent, #88ccff); box-shadow: none;
  animation: none;
}
#mp-count { color: var(--capsuleAccent, #88ccff); font-weight: 900; font-size: 13px; }


/* =========================================
   Canvas Thought Reticle
========================================= */
#thought-reticle {
  position: fixed; top: 0; left: 0; width: 0; height: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0; transition: opacity 0.2s ease;
}

#thought-reticle .reticle-ring {
  position: absolute; top: -16px; left: -16px; width: 32px; height: 32px;
  border: 2px solid transparent; border-top-color: var(--capsuleAccent, #fff); border-right-color: color-mix(in srgb, var(--capsuleAccent, #fff) 30%, transparent);
  border-radius: 50%; box-shadow: none;
  animation: spinReticle 2s linear infinite;
}

#thought-reticle .reticle-text {
  position: absolute; top: 24px; left: 50%; transform: translateX(-50%);
  font-family: 'Noto Sans JP', sans-serif; font-size: 9px; font-weight: 900;
  text-transform: uppercase; letter-spacing: 3px; color: var(--capsuleAccent, #fff); white-space: nowrap;
  opacity: 0; filter: none; text-shadow: none; transition: opacity 0.2s ease;
}

#thought-reticle.is-visible { opacity: 1; }
#thought-reticle.is-still .reticle-text { opacity: 1; filter: none; }

@keyframes spinReticle {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.focus-mode-active .ef-orb { display: none !important; pointer-events: none; }

/* Systems UI Stationary Notification Badges */
.ef-orb-badge {
  position: absolute; width: 8px; height: 8px; border-radius: 50%;
  background: var(--capsuleAccent, #ffaa55); border: 1px solid #000; box-shadow: none;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s;
  z-index: 10;
  top: 3px; right: 3px; transform: scale(0.5);
}
.ef-orb-badge.heart-badge {
  background: var(--capsuleAccent, #55ddff); right: auto; left: 3px;
}
.ef-orb-badge.is-active { opacity: 1; transform: scale(1); }


/* Custom Scrollbar for Systems Panels */
.scroll-area::-webkit-scrollbar { width: 6px; }
.scroll-area::-webkit-scrollbar-track { background: color-mix(in srgb, var(--capsuleAccent, #88ccff) 10%, #000); border-radius: 4px; }
.scroll-area::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--capsuleAccent, #88ccff) 40%, rgba(255,255,255,0.2)); border-radius: 4px; }
.scroll-area::-webkit-scrollbar-thumb:hover { background: var(--capsuleAccent, #88ccff); }

/* =========================================
   HUD / Minimalist Tooltip Overlay
========================================= */
#hudOverlay {
  position: fixed; top: 0; left: 0;
  pointer-events: none; 
  background: color-mix(in srgb, rgb(var(--circadian-dark, 0,0,0)) 90%, #050508); border: 1.5px solid var(--capsuleAccent, #88ccff);
  border-radius: 6px; box-shadow: none;         
  padding: 6px 10px; max-width: 180px; 
  opacity: 0; visibility: hidden; will-change: transform, opacity;
  z-index: 100000 !important; backdrop-filter: none;
}

#hudTitle, #hudSub { display: block; will-change: transform, opacity; text-shadow: none; }
#hudTitle {
  font-family: "Noto Sans JP", sans-serif; font-size: 11px; font-weight: 900; color: #ffffff;
  margin: 0; line-height: 1.2; letter-spacing: 0.5px;
}
#hudTitle:not(:last-child) { margin-bottom: 2px; }
#hudSub {
  font-family: "Noto Sans JP", sans-serif; font-size: 9px; font-weight: 900; color: var(--capsuleAccent, #88ccff);
  margin: 0; text-transform: uppercase; letter-spacing: 1px; line-height: 1.2;
}

/* =========================================
   DYNAMIC SYSTEMS ORB STATES (Universal)
========================================= */
#ef-sys-orb::after { transition: color 0.2s, transform 0.2s; text-shadow: none; }
#ef-sys-orb:hover { transform: scale(1.1) !important; border-color: var(--capsuleAccent, #88ccff); background-color: var(--capsuleAccent, #88ccff); }
#ef-sys-orb:hover::after { color: #000 !important; }

/* 1. Base Local (Idle) - Solid Line Diamond */
#ef-sys-orb[data-sys-state="local"], 
#ef-sys-orb[data-sys-state="local-saving"] {
  border-color: color-mix(in srgb, var(--capsuleAccent, #fff) 40%, rgba(255,255,255,0.2));
  box-shadow: none;
}
#ef-sys-orb[data-sys-state="local"]:not(.is-active)::after { 
  content: '\25C6'; 
  color: transparent; 
  -webkit-text-stroke: 2px var(--capsuleAccent, #fff);
  font-size: 20px; 
}

/* 1b. Transient Local Saving (Active) - Solid Mint Diamond */
#ef-sys-orb[data-sys-state="local-saving"] { animation: sysLocalSave 1.2s ease-in-out; }
#ef-sys-orb[data-sys-state="local-saving"]:not(.is-active)::after { 
  content: '\25C6'; 
  color: #88ffaa; 
  -webkit-text-stroke: 0px; 
  font-size: 20px;
  text-shadow: none; 
}

/* 2. Base Cloud (Idle) - Solid Line Cloud */
#ef-sys-orb[data-sys-state="cloud"],
#ef-sys-orb[data-sys-state="cloud-synced-success"] {
  border-color: rgb(var(--circadian-accent, 85,221,255));
  box-shadow: none;
}
#ef-sys-orb[data-sys-state="cloud"]:not(.is-active)::after {
  content: '\2601\FE0E'; 
  color: transparent; 
  -webkit-text-stroke: 1.5px rgb(var(--circadian-accent, 85,221,255));
  font-size: 22px; 
  text-shadow: none;
}

/* 2b. Transient Cloud Success (Active) - Solid Mint Checkmark */
#ef-sys-orb[data-sys-state="cloud-synced-success"] { animation: sysCloudSuccess 1.5s ease-out; }
#ef-sys-orb[data-sys-state="cloud-synced-success"]:not(.is-active)::after { 
  content: '\2714\FE0E'; 
  color: #88ffaa; 
  -webkit-text-stroke: 0px; 
  font-size: 18px; 
  text-shadow: none; 
}

/* 3a. Cloud Pushing (Active) - Solid Cyan Upload Arrow */
#ef-sys-orb[data-sys-state="cloud-pushing"] { animation: sysCloudPush 2s infinite ease-in-out; }
#ef-sys-orb[data-sys-state="cloud-pushing"]:not(.is-active)::after { 
  content: '\2B06\FE0E'; 
  color: rgb(var(--circadian-accent, 85,221,255)); 
  -webkit-text-stroke: 0px;
  font-size: 22px; 
  text-shadow: none; 
  animation: orb-bounce-up 1.5s infinite ease-in-out;
}

/* 3b. Cloud Pulling (Active) - Solid Purple Download Arrow */
#ef-sys-orb[data-sys-state="cloud-pulling"] { animation: sysCloudPull 2s infinite ease-in-out; }
#ef-sys-orb[data-sys-state="cloud-pulling"]:not(.is-active)::after { 
  content: '\2B07\FE0E'; 
  color: var(--capsuleAccent, #d088ff); 
  -webkit-text-stroke: 0px;
  font-size: 22px; 
  text-shadow: none; 
  animation: orb-bounce-down 1.5s infinite ease-in-out;
}

/* 3c. Generic Sync (Active) - Solid Cyan Spin */
#ef-sys-orb[data-sys-state="cloud-syncing"] { animation: sysCloudSyncGeneric 2s infinite ease-in-out; }
#ef-sys-orb[data-sys-state="cloud-syncing"]:not(.is-active)::after { 
  content: '\27F2\FE0E'; 
  color: rgb(var(--circadian-accent, 85,221,255)); 
  -webkit-text-stroke: 0px;
  font-size: 22px; 
  text-shadow: none; 
  animation: orb-spin-icon 2s linear infinite;
}

/* 4. Alert / Error (Attention) - Solid Frame Outline Pulse */
#ef-sys-orb[data-sys-state="alert"] {
  border-color: #ffaa55;
  animation: orb-alert-pulse 3s infinite ease-in-out;
}
#ef-sys-orb[data-sys-state="alert"]:not(.is-active)::after {
  content: '\26A0\FE0E'; 
  color: #ffaa55; 
  -webkit-text-stroke: 0px;
  font-size: 18px; text-shadow: none; 
  animation: none;
}

/* Menu Open Override */
#ef-sys-orb.is-active::after {
  content: '✕' !important; color: #000 !important; font-size: 18px !important; font-weight: 900 !important;
  text-shadow: none !important; -webkit-text-stroke: 0px !important; 
  animation: none !important; transform: rotate(90deg) !important;
}

/* =========================================
   KEYFRAMES 
========================================= */
@keyframes orb-spin-icon { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes orb-bounce-up { 0%, 100% { transform: translateY(1px); } 50% { transform: translateY(-3px); } }
@keyframes orb-bounce-down { 0%, 100% { transform: translateY(-1px); } 50% { transform: translateY(3px); } }

/* Mechanical Solid Line Pulses */
@keyframes orb-alert-pulse { 
  0%, 100% { transform: scale(1); border-color: color-mix(in srgb, #ffaa55 40%, transparent); } 
  50% { transform: scale(1.08); border-color: #ffaa55; background-color: color-mix(in srgb, #ffaa55 15%, #050508); } 
}

/* Frame Line Animations replacing dropped drop shadows */
@keyframes sysLocalSave {
  0% { border-color: color-mix(in srgb, var(--capsuleAccent, #fff) 40%, rgba(255,255,255,0.2)); }
  50% { border-color: #88ffaa; background-color: color-mix(in srgb, #88ffaa 20%, #050508); }
  100% { border-color: color-mix(in srgb, var(--capsuleAccent, #fff) 40%, rgba(255,255,255,0.2)); }
}
@keyframes sysCloudPush {
  0% { transform: translateY(0); }
  50% { border-color: rgb(var(--circadian-accent, 85,221,255)); background-color: color-mix(in srgb, rgb(var(--circadian-accent, 85,221,255)) 20%, #050508); transform: translateY(-2px); }
  100% { transform: translateY(0); }
}
@keyframes sysCloudPull {
  0% { transform: translateY(0); }
  50% { border-color: var(--capsuleAccent, #d088ff); background-color: color-mix(in srgb, var(--capsuleAccent, #d088ff) 20%, #050508); transform: translateY(2px); }
  100% { transform: translateY(0); }
}
@keyframes sysCloudSyncGeneric {
  0% { border-color: color-mix(in srgb, rgb(var(--circadian-accent, 85,221,255)) 40%, transparent); }
  50% { border-color: rgb(var(--circadian-accent, 85,221,255)); background-color: color-mix(in srgb, rgb(var(--circadian-accent, 85,221,255)) 15%, #050508); }
  100% { border-color: color-mix(in srgb, rgb(var(--circadian-accent, 85,221,255)) 40%, transparent); }
}
@keyframes sysCloudSuccess {
  0% { border-color: rgb(var(--circadian-accent, 85,221,255)); }
  50% { border-color: #88ffaa; background-color: color-mix(in srgb, #88ffaa 25%, #050508); }
  100% { border-color: color-mix(in srgb, var(--capsuleAccent, #fff) 40%, rgba(255,255,255,0.2)); }
}

/* Fallbacks */
body.reduced-motion .spatial-face, body.reduced-motion .idle-glass, body.reduced-motion .ef-glass-panel {
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
}


/* =========================================================
   ✨ LITE MODE: SYSTEM UI & LOADER PARITY
   Occludes environments behind solid shells, maps to binary variables.
   ========================================================= */

/* Global Loader */
body.lite-mode #globalLoader { background: var(--lite-shell-bg, #050508) !important; }
body.lite-mode #globalLoader .loader-ring::before,
body.lite-mode #globalLoader .loader-ring::after { background: var(--lite-line, #fff) !important; box-shadow: none !important; }

/* Orbs */
body.lite-mode .ef-orb {
    background: var(--lite-shell-bg, #050508) !important;
    border: 1.5px solid var(--lite-line, #fff) !important;
    color: var(--lite-text, #fff) !important;
}
body.lite-mode .ef-orb::after, 
body.lite-mode .ef-orb::before { 
    color: var(--lite-text, #fff) !important; 
    -webkit-text-stroke: 0px !important; 
    text-shadow: none !important;
}
body.lite-mode .ef-orb:hover, 
body.lite-mode .ef-orb.is-active {
    background: var(--lite-text, #fff) !important;
    border-color: var(--lite-line, #fff) !important;
}
body.lite-mode .ef-orb:hover::after, 
body.lite-mode .ef-orb.is-active::after {
    color: var(--lite-shell-bg, #050508) !important;
}

/* Disable dynamic orb animations overriding the background in lite mode */
body.lite-mode #ef-sys-orb { animation: none !important; }

/* Glass Panels & Modals (Occlusion) */
body.lite-mode .ef-glass-panel,
body.lite-mode .diegetic-modal {
    /* Uses the fallback to trap rendering errors */
    background: var(--lite-shell-bg, var(--bgBot, #050508)) !important;
    border: 1.5px solid var(--lite-line, #fff) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.lite-mode .sys-title, 
body.lite-mode .modal-title, 
body.lite-mode .sys-label, 
body.lite-mode .modal-desc { 
    color: var(--lite-text, #fff) !important; 
    text-shadow: none !important;
    border-bottom-color: color-mix(in srgb, var(--lite-line, #fff) 20%, transparent) !important;
}
body.lite-mode .sys-subtext { color: var(--lite-muted-text, rgba(255,255,255,0.6)) !important; }

/* Buttons & Controls */
body.lite-mode .sys-btn,
body.lite-mode .modal-btn,
body.lite-mode .sys-pill {
    background: var(--lite-fill, transparent) !important;
    border: 1px solid var(--lite-line, #fff) !important;
    color: var(--lite-text, #fff) !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

body.lite-mode .sys-btn:hover,
body.lite-mode .modal-btn:hover {
    background: var(--lite-text, #fff) !important;
    color: var(--lite-shell-bg, #050508) !important;
}

body.lite-mode .sys-toggle {
    background: var(--lite-fill, transparent) !important;
    border: 1.5px solid var(--lite-line, #fff) !important;
    box-shadow: none !important;
}
body.lite-mode .sys-toggle.is-active {
    background: var(--lite-line, #fff) !important;
}
body.lite-mode .sys-toggle::after {
    background: var(--lite-text, #fff) !important;
    border: 1px solid var(--lite-shell-bg, #050508) !important;
}
body.lite-mode .sys-toggle.is-active::after {
    background: var(--lite-shell-bg, #050508) !important;
}

body.lite-mode .sys-dot {
    background: var(--lite-line, #fff) !important;
}

/* Tooltips & Blockades */
body.lite-mode #hudOverlay {
    background: var(--lite-shell-bg, #050508) !important;
    border: 1.5px solid var(--lite-line, #fff) !important;
    box-shadow: none !important;
}
body.lite-mode #hudTitle, 
body.lite-mode #hudSub { color: var(--lite-text, #fff) !important; }

body.lite-mode #mobile-blockade { background: var(--lite-shell-bg, #050508) !important; }
body.lite-mode .blockade-orb { background: var(--lite-shell-bg, #050508) !important; border: 3px solid var(--lite-line, #fff) !important; }
body.lite-mode .blockade-title, 
body.lite-mode .blockade-subtitle, 
body.lite-mode .blockade-text { color: var(--lite-text, #fff) !important; }

body.lite-mode .mobile-presence-capsule { background: var(--lite-shell-bg, #050508) !important; border: 1.5px solid var(--lite-line, #fff) !important; color: var(--lite-text, #fff) !important; }
body.lite-mode .mp-dot { background: var(--lite-line, #fff) !important; }
body.lite-mode #mp-count { color: var(--lite-text, #fff) !important; }

/* Reticle */
body.lite-mode #thought-reticle .reticle-ring { border-top-color: var(--lite-line, #fff) !important; border-right-color: transparent !important; }
body.lite-mode #thought-reticle .reticle-text { color: var(--lite-line, #fff) !important; }


/* =========================================================
   ✨ LITE MODE: SYSTEM UI & LOADER PARITY
   Occludes environments behind solid shells, maps to binary variables.
   ========================================================= */

/* Global Loader */
body.lite-mode #globalLoader { background: var(--lite-shell-bg, #050508) !important; }
body.lite-mode #globalLoader .loader-ring::before,
body.lite-mode #globalLoader .loader-ring::after { background: var(--lite-line, #fff) !important; box-shadow: none !important; }

/* Orbs */
body.lite-mode .ef-orb {
    background: var(--lite-shell-bg, #050508) !important;
    border: 1.5px solid var(--lite-line, #fff) !important;
    color: var(--lite-text, #fff) !important;
}
body.lite-mode .ef-orb::after, 
body.lite-mode .ef-orb::before { 
    color: var(--lite-text, #fff) !important; 
    -webkit-text-stroke: 0px !important; 
    text-shadow: none !important;
}
body.lite-mode .ef-orb:hover, 
body.lite-mode .ef-orb.is-active {
    background: var(--lite-text, #fff) !important;
    border-color: var(--lite-line, #fff) !important;
}
body.lite-mode .ef-orb:hover::after, 
body.lite-mode .ef-orb.is-active::after {
    color: var(--lite-shell-bg, #050508) !important;
}

/* Disable dynamic orb animations overriding the background in lite mode */
body.lite-mode #ef-sys-orb { animation: none !important; }

/* Glass Panels & Modals (Occlusion) */
body.lite-mode .ef-glass-panel,
body.lite-mode .diegetic-modal {
    /* Uses the fallback to trap rendering errors */
    background: var(--lite-shell-bg, var(--bgBot, #050508)) !important;
    border: 1.5px solid var(--lite-line, #fff) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.lite-mode .sys-title, 
body.lite-mode .modal-title, 
body.lite-mode .sys-label, 
body.lite-mode .modal-desc { 
    color: var(--lite-text, #fff) !important; 
    text-shadow: none !important;
    border-bottom-color: color-mix(in srgb, var(--lite-line, #fff) 20%, transparent) !important;
}
body.lite-mode .sys-subtext { color: var(--lite-muted-text, rgba(255,255,255,0.6)) !important; }

/* Buttons & Controls */
body.lite-mode .sys-btn,
body.lite-mode .modal-btn,
body.lite-mode .sys-pill {
    background: var(--lite-fill, transparent) !important;
    border: 1px solid var(--lite-line, #fff) !important;
    color: var(--lite-text, #fff) !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

body.lite-mode .sys-btn:hover,
body.lite-mode .modal-btn:hover {
    background: var(--lite-text, #fff) !important;
    color: var(--lite-shell-bg, #050508) !important;
}

body.lite-mode .sys-toggle {
    background: transparent !important;
    border: 1.5px solid var(--lite-muted-text) !important;
    box-shadow: none !important;
}
body.lite-mode .sys-toggle.is-active {
    background: var(--lite-text) !important;
    border-color: var(--lite-text) !important;
}
body.lite-mode .sys-toggle::after {
    background: var(--lite-muted-text) !important;
    border: none !important;
}
body.lite-mode .sys-toggle.is-active::after {
    background: var(--lite-shell-bg) !important;
}

body.lite-mode .sys-dot {
    background: var(--lite-line, #fff) !important;
}

/* Tooltips & Blockades */
body.lite-mode #hudOverlay {
    background: var(--lite-shell-bg, #050508) !important;
    border: 1.5px solid var(--lite-line, #fff) !important;
    box-shadow: none !important;
}
body.lite-mode #hudTitle, 
body.lite-mode #hudSub { color: var(--lite-text, #fff) !important; }

body.lite-mode #mobile-blockade { background: var(--lite-shell-bg, #050508) !important; }
body.lite-mode .blockade-orb { background: var(--lite-shell-bg, #050508) !important; border: 3px solid var(--lite-line, #fff) !important; }
body.lite-mode .blockade-title, 
body.lite-mode .blockade-subtitle, 
body.lite-mode .blockade-text { color: var(--lite-text, #fff) !important; }

body.lite-mode .mobile-presence-capsule { background: var(--lite-shell-bg, #050508) !important; border: 1.5px solid var(--lite-line, #fff) !important; color: var(--lite-text, #fff) !important; }
body.lite-mode .mp-dot { background: var(--lite-line, #fff) !important; }
body.lite-mode #mp-count { color: var(--lite-text, #fff) !important; }

/* Reticle */
body.lite-mode #thought-reticle .reticle-ring { border-top-color: var(--lite-line, #fff) !important; border-right-color: transparent !important; }
body.lite-mode #thought-reticle .reticle-text { color: var(--lite-line, #fff) !important; }