
  /* === System Aesthetic Variables === */
 :root {
  /* System Aesthetic Variables */
  --system-background-color: #2121217d; /* Slightly lighter dark base */
  --system-fg: #ffffff; /* Pure white for text */
  --system-color: var(--system-fg);
  /* Typography */
  --system-font: Futura, Arial, sans-serif;
  --system-font-size: 14px;
  --system-font-weight-bold: 700;
  /* Layout + sizing */
  --system-padding: 1rem;
  --system-gap: 8px;
  --system-radius: 18px;
  --system-icon-size: 36px;
  --system-taskbar-height: 3rem;
  --system-menu-width: 650px;
  --desktop-icon-size: var(--system-icon-size);
  /* Colors (Dark Mode) */
  --system-bg: linear-gradient(135deg, #2c2c2c74, #21212173); /* Subtle gradient */
  --system-panel-bg: linear-gradient(135deg, #3333331f, #26262625); /* Window background */
  --system-strong-bg: #4242426f; /* Brighter hover state */
  --system-border: #8a8a8a; /* Lighter border for contrast */
  --system-hover: #8e8e8e9a; /* Brighter hover */
  --system-accent: #00bfff; /* Vibrant cyan for highlights */
  --system-overlay: rgba(26, 26, 26, 0.5); /* Slightly lighter overlay */
  /* Glass effects (no longer used) */
  --system-glass-blur: 20px;
  --system-glass-opacity: 0.3;
  --system-glass-shadow: 0 8px 30px #000;
  /* Component surfaces */
  --system-taskbar-bg: linear-gradient(180deg, #2a2a2a6a, #1f1f1f68); /* Taskbar gradient */
  --system-window-button: #4a4a4a78; /* Brighter window buttons */
  --system-window-button-close: #ff4d4d; /* Vibrant red for close */
}
  * { box-sizing: border-box; }
  html, body { height: 100%; margin: 0; }
body {
  background-color: black;
  margin: 0;
  padding: 0;
  overflow: hidden;
  position: relative;
  color: var(--system-color);
  font-family: var(--system-font);
  background-color: var(--system-background-color);
  /* Default wallpaper — forced to always cover the viewport */
  background: url('/assets/main/background-0.png') no-repeat center center fixed;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
  transition: opacity 0.5s ease-in-out;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  /* Mirror the wallpaper and ensure it also covers the full screen */
  background: inherit;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
  z-index: -2;
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
}

  body.no-wallpaper {
    background:
      radial-gradient(1200px 700px at 70% 20%, rgba(255, 255, 255, 0.1), rgba(255,255,255,0) 60%),
      linear-gradient(180deg, #1e1e1e, #0b0b0b);
  }
  .hidden {
    display: none !important;
  }

  body,
  .desktop,
  .window,
  .window *,
  .desktop-icon {
    user-select: none;
    -webkit-user-select:none;
    -moz-user-select:none;
    -ms-user-select:none;
  }

  .desktop {
    position: fixed;
    inset: 0 0 56px 0;
    padding: var(--system-padding);
    user-select: none;
  }

  .desktop-icons {
    position: relative;
    width: 100%;
    height: 100%;
  }

 .desktop-icon {
  position: absolute;
  width: 120px;
  text-align: center;
  color: #fff;
  cursor: grab;
  padding: var(--system-padding);
  border-radius: 1rem;
  background-color: #2323236c;
  box-shadow: 0 4px 10px #32323266;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1.3), box-shadow 0.2s ease, background 0.2s ease;
}
.desktop-icon:hover {
  transform: scale(1.08) translateY(-4px); /* Slight lift with bounce */
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4); /* Stronger shadow */
  background-color: #282828;
}
.desktop-icon:active {
  transform: scale(0.98); /* Subtle press effect */
  transition: transform 0.1s ease; /* Faster response on click */
}

  .desktop-icon img { 
    width: var(--desktop-icon-size);
    height: var(--desktop-icon-size);
    display: block;
    margin: 0 auto 6px;
  }

  .window {
    position: absolute;
    min-width: 280px;
    min-height: 160px;
    background-color: var(--system-panel-bg);
    border: 1px solid var(--system-border);
    border-radius: var(--system-radius); overflow: hidden;
    box-shadow: 0 8px 30px #000,
    inset 0 0 0 1px #ffffff14;
    color: #fff;
  }

  .window.maximized {
    border-radius: 0;
  }

  .titlebar {
    height: 36px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    background: #222;
    border-bottom: 1px solid var(--system-border);
    cursor: move;
    user-select: none;
    touch-action: none;
  }

  .title {
    padding: 0 12px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .win-controls {
    display: flex;
    height: 100%;
    pointer-events: auto;
  }

  .win-btn {
    width: 46px;
    display: grid;
    place-items: center;
    border-left: 1px solid #222;
    cursor: pointer;
    font-size: 12px;
    color: #fff;
    transition: background 0.12s ease, color 0.12s;
  }

  .win-btn:hover {
    background: var(--system-window-button);
  }

  .win-btn.close:hover {
    background: var(--system-window-button-close);
    color: #fff;
  }

  .content {
    position: relative;
    height: calc(100% - 36px);
    background: var(--system-panel-bg);
  }

  .content iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #23232376;
  }

  .resizer { 
    position: absolute;
  }

  .resizer.n,
  .resizer.s {
    height: 6px;
    left: 0;
    right: 0;
    cursor: ns-resize;
  }

  .resizer.e,
  .resizer.w {
    width: 6px;
    top: 0;
    bottom: 0;
    cursor: ew-resize;
  }
  
  .resizer.n { top: -3px; } .resizer.s { bottom: -3px; }
  .resizer.e { right: -3px; } .resizer.w { left: -3px; }
  .resizer.nw, .resizer.ne, .resizer.sw, .resizer.se { width: 10px; height: 10px; position: absolute; }
  .resizer.nw { top: -5px; left: -5px; cursor: nwse-resize; }
  .resizer.ne { top: -5px; right: -5px; cursor: nesw-resize; }
  .resizer.sw { bottom: -5px; left: -5px; cursor: nesw-resize; }
  .resizer.se { bottom: -5px; right: -5px; cursor: nwse-resize; }

  .taskbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--system-taskbar-height);
    background-color: var(--system-taskbar-bg);
    display: grid;
    grid-template-columns: 64px 1fr 320px;
    align-items: center;
    padding: 0 12px;
    gap: 10px;
    color: #e8f0ff;
  }
  .start-btn {
    height: 40px;
    width: 52px;
    border-radius: 8px;
    border: 1px solid var(--system-border);
    background: var(--system-bg);
    box-shadow: inset 0 1px 0 #ffffff40, 0 1px 12px #000b;
    cursor: pointer;
    display: grid;
    place-items: center;
    color: var(--system-fg);
    font-weight: 700;
  }

  .taskbar-list {
    display: flex;
    gap: 8px;
    align-items: center;
    overflow-x: auto;
    padding: 8px 0;
  }

.task-btn {
  min-width: 140px;
  max-width: 260px;
  height: 36px;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid #444;
  border-radius: 8px;
  cursor: pointer;
  background: #232323;
  color: #fff;
  box-shadow: inset 0 1px 0 #ffffff80;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1.2), background 0.15s ease, box-shadow 0.15s ease;
}
.task-btn:hover {
  transform: scale(1.05) translateY(-2px);
  background: #282828;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.task-btn.active {
  outline: 2px solid var(--system-accent);
  animation: pulse 2s infinite ease-in-out;
}
@keyframes pulse {
  0%, 100% { outline-color: var(--system-accent); }
  50% { outline-color: rgba(74, 163, 255, 0.5); }
}

  .task-btn .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7fc3ff;
    justify-self: center;
  }

  .tray {
    justify-self: end;
    font-size: 12px;
    text-align: right;
    padding-right: 6px;
    display: flex;
    gap: 10px;
    align-items: center;
  }

  .clock {
    font-variant-numeric: tabular-nums;
  }
  
  .start-menu {
    position: fixed;
    left: 12px;
    bottom: 64px;
    width: 360px;
    max-height: 65vh;
    background: var(--system-bg);
    border: 1px solid var(--system-border);
    border-radius: var(--system-radius);
    box-shadow: 0 12px 32px #000b;
    display: none;
    overflow: hidden;
    color: #fff;
  }

  .start-menu.open {
    display: grid;
    grid-template-rows: auto auto 1fr;
  }

  .start-head {
    padding: 12px;
    font-weight: 700;
    border-bottom: 1px solid var(--system-border);
  }

  .start-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--system-border);
  }
  
  .start-list {
    overflow: auto;
  }

  .start-item {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
  }

  .start-item:hover {
    background: var(--system-hover);
  }

  .dialog {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    background: #1a1a1aee;
  }

  .dialog.open {
    display: grid;
  }

  .dialog-card {
    width: min(560px, calc(100% - 32px));
    background: #232323;
    color: #fff;
    border-radius: var(--system-radius);
    box-shadow: 0 10px 24px #000a;
    border: 1px solid var(--system-border);
  }

  .dialog-head {
    padding: 12px 14px;
    font-weight: 700;
    border-bottom: 1px solid #444;
  }

  .dialog-body {
    padding: 14px;
    display: grid;
    gap: 10px;
  }

  .dialog-actions {
    padding: 12px 14px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #444;
  }

  .btn {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #4aa3ff;
    background: #4aa3ff;
    color: #fff;
    cursor: pointer;
  }

  .btn.secondary {
    background: #232323;
    color: #fff;
    border-color: #444;
  }

  .input,
  .select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--system-border);
    border-radius: 8px;
    font: inherit;
    background: var(--system-panel-bg);
    color: #fff;
  }

  .control-center {
    position: fixed; 
    right: 12px;
    bottom: 68px;
    width: 360px;
    max-height: 70vh;
    background: var(--system-bg);
    border: 1px solid var(--system-border);
    border-radius: var(--system-radius);
    box-shadow: 0 18px 40px #0008;
    color: #fff;
    transform: translateY(20px); opacity: 0; pointer-events: none;
    transition: transform .25s ease, opacity .25s ease;
    z-index: 5;
  }

  .control-center.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .wallpaper-drawer {
    position: fixed;
    right: 12px;
    bottom: 68px;
    width: 260px;
    max-height: 60vh;
    background: var(--system-bg);
    border: 1px solid var(--system-border);
    border-radius: var(--system-radius);
    box-shadow: 0 12px 32px #0008;
    color: #fff;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform .2s ease, opacity .2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 6;
  }

  .wallpaper-drawer.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .wallpaper-drawer-head {
    padding: 10px 12px;
    border-bottom: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
  }

  .wallpaper-drawer-body {
    padding: 6px 8px;
    overflow: auto;
    display: grid;
    gap: 4px;
  }

  .wallpaper-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }

  .wallpaper-item:hover {
    background: var(--system-hover);
  }

  .wallpaper-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    background: #000;
  }

  .cc-head {
    padding: 12px 14px;
    font-weight: 700;
    border-bottom: 1px solid #444;
    display:flex;
    align-items:center;
    justify-content:space-between;
  }

  .cc-body {
    padding: 12px 14px;
    display: grid;
    gap: 10px;
  }

  .cc-row {
    display:grid;
    grid-template-columns: 1fr;
    gap:6px;
  }

  .cc-actions {
    padding: 12px 14px;
    border-top: 1px solid #444;
    display:flex;
    justify-content:flex-end;
    gap:10px;
  }

  .cc-close {
    background: #232323;
    color:#fff;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
  }

  .context-menu {
    position: fixed;
    min-width: 220px;
    background: #232323;
    color: #fff;
    border: 1px solid var(--system-border);
    border-radius: var(--system-radius);
    box-shadow: 0 12px 32px #0008;
    padding: 6px;
    display: none;
    z-index: 99999;
  }

  .context-menu.open { 
    display: block;
  }

  .context-menu button {
    width: 100%;
    display: block;
    text-align: left;
    background: transparent;
    color: #fff;
    border: 0;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
  }

  .context-menu button:hover {
    background: #282828;
  }

  #hiddenList {
    max-height: 40vh;
    overflow: auto;
    display: grid;
    gap: 8px;
  }

  #hiddenList label {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--system-panel-bg);
    padding: 8px 10px;
    border-radius: 8px;
  }

  .ghost-anim {
    position: fixed;
    background: var(--system-panel-bg);
    border: 1px solid var(--system-border);
    border-radius: var(--system-radius);
    box-shadow: 0 10px 40px #000a, inset 0 0 0 1px #ffffff14;
    z-index: 9999;
    transition: transform .28s ease, opacity .28s ease;
    will-change: transform, opacity;
  }
  .taskbar,
  .start-menu,
  .desktop-icons,
  .control-center {
    transition: opacity .3s ease,
    transform .3s ease;
  }

  body.afk .taskbar,
  body.afk .start-menu,
  body.afk .desktop-icons,
  body.afk .control-center {
    opacity: 0;
    transform: scale(1.02);
    pointer-events: none;
  }

    /* Snap preview overlay (Shift+drag) */
  .snap-preview {
    position: fixed;
    z-index: 9998;
    pointer-events: none;
    display: none;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #555;
    box-shadow: 0 0 0 1px #fff1 inset;
  }
  .snap-preview.show { display: block; }
  
  /* === Vista-style Start Menu (light glass) === */
.start-menu--vista {
  width: var(--system-menu-width);
  max-height: 70vh;
  background: var(--system-bg);
  border: 1px solid var(--system-border);
  color: #fff;
}

.start-menu--vista.open {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

.start-menu--vista .start-head {
  background: var(--system-panel-bg);
}

.start-menu--vista .start-actions {
  grid-template-columns: repeat(4, 1fr);
  background: var(--system-panel-bg);
}

.start-menu--vista .start-body {
  display: grid;
  grid-template-columns: 1fr 280px;
  min-height: 340px;
}

.start-menu--vista .start-left {
  overflow: auto;
  border-right: 1px solid var(--system-border);
}

.start-menu--vista .start-item {
  grid-template-columns: 32px 1fr;
  padding: 10px 14px;
  gap: 12px;
  border-radius: var(--system-radius);
}
.start-menu--vista .start-item:hover,
.start-menu--vista .start-item[aria-selected="true"] {
  background: var(--system-strong-bg);
}

.start-menu--vista .start-right {
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  gap: 10px;
  padding: 12px;
  background: var(--system-panel-bg);
  overflow: auto;
  min-height: 0; /* allow child to scroll instead of forcing container growth */
}

.start-menu--vista #srExtra {
  overflow: auto;
  min-height: 0;          /* allow it to consume remaining grid space */
  /* no max-height: let it fill the remaining space in the right pane */
}

.start-menu--vista .sr-hero {
  width: 56px; height: 56px; border-radius: 14px;
  display: grid; place-items: center;
  font-size: 28px;
  background: var(--system-strong-bg);
  border: 1px solid var(--system-border);
}

.start-menu--vista .start-foot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--system-border);
  background: var(--system-panel-bg);
}
.start-menu--vista .start-search { height: 36px; }
.start-menu--vista .start-power { display: flex; gap: 6px; }
.start-menu--vista .power-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: var(--system-radius);
  border: 1px solid var(--system-border);
  background: var(--system-bg); color: #fff; cursor: pointer;
}
.start-menu--vista .power-btn:hover { background: var(--system-hover); }
/* Smooth fade for start menu filter */
.start-left .start-item { transition: opacity .1s ease, transform .1s ease, background .12s ease; }
