/* ============================================================
   SASP HUB OS — Web Desktop
   ============================================================ */

/* ── Theme variables (Modern defaults — overridden via JS) ── */
:root {
  --th-bg:             #060f18;
  --th-bg-panel:       #07101c;
  --th-bg-card:        #0b1622;
  --th-bg-hover:       rgba(59,158,255,0.08);
  --th-accent:         #3b9eff;
  --th-accent-dim:     rgba(59,158,255,0.15);
  --th-accent-rgb:     59,158,255;
  --th-text:           #d0e8ff;
  --th-text-mid:       #8ab8d8;
  --th-text-dim:       #3a6080;
  --th-border:         #1a3050;
  --th-border-bright:  #2a4870;
  --th-font:           'Inter', sans-serif;
  --th-radius-sm:      4px;
  --th-radius-md:      6px;
  --th-radius-lg:      8px;
  --th-radius-xl:      12px;
  --th-radius-btn:     6px;
  --th-titlebar-bg:    linear-gradient(180deg, #0f2035 0%, #0c1b2e 100%);
  --th-titlebar-border:#1a3050;
  --th-win-bg:         #0b1622;
  --th-win-border:     #1e3a5a;
  --th-btn-bg:         rgba(59,158,255,0.1);
  --th-btn-border:     rgba(59,158,255,0.3);
  --th-btn-color:      #3b9eff;
  --th-taskbar-bg:     rgba(7,16,28,0.96);
  --th-taskbar-border: #1a3050;
  --th-settings-bg:    #09162a;
  --th-shadow:         0 8px 40px rgba(0,0,0,0.65);
  --th-glow:           0 0 0 1px rgba(59,158,255,0.06);
}

/* Win98 theme — raised button box-shadow helpers */
[data-theme="win98"] .win-btn,
[data-theme="win98"] .settings-file-label,
[data-theme="win98"] .settings-btn-reset,
[data-theme="win98"] .login-btn,
[data-theme="win98"] .tb-win-btn {
  box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #ffffff, inset -2px -2px 0 #404040, inset 2px 2px 0 #dfdfdf !important;
}
[data-theme="win98"] .win-titlebar { border-radius: 0 !important; }
[data-theme="win98"] .window { border-width: 2px !important; }
[data-theme="win98"] .launcher-popup { border-radius: 0 !important; box-shadow: 2px 2px 0 #000 !important; }
[data-theme="win98"] .settings-dialog { border-radius: 0 !important; box-shadow: 2px 2px 0 #000 !important; }
[data-theme="win98"] .desktop-icon:hover { background: rgba(0,0,128,0.18) !important; }
[data-theme="win98"] #desktop { background: #008080 !important; }
[data-theme="win98"] #desktop::before { display: none; }

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

html, body {
  width: 100%; height: 100vh;
  overflow: hidden;
  background: var(--th-bg);
  color: var(--th-text);
  font-family: var(--th-font);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   BOOT OVERLAY
   ============================================================ */
#bootOverlay {
  position: fixed; inset: 0;
  background: var(--th-bg);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.boot-flex {
  display: flex;
  align-items: flex-start;
  gap: 56px;
  max-width: 860px;
  width: 100%;
  padding: 0 40px;
}

.boot-logo-wrap { flex-shrink: 0; padding-top: 4px; }

.boot-logo-img {
  width: 140px; height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 0 40px rgba(59,158,255,0.4));
  animation: bootLogoPulse 3s ease-in-out infinite;
}

@keyframes bootLogoPulse {
  0%,100% { filter: drop-shadow(0 0 28px rgba(59,158,255,0.3)); }
  50%      { filter: drop-shadow(0 0 60px rgba(59,158,255,0.65)); }
}

.boot-console { flex: 1; min-width: 0; }

.boot-console-header {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px solid #1a3050;
}

.boot-os-name {
  font-size: 20px; font-weight: 700; letter-spacing: 4px;
  color: var(--th-accent);
}
.boot-os-ver {
  font-size: 12px; color: var(--th-text-dim); letter-spacing: 1px;
}

.boot-lines {
  display: flex; flex-direction: column; gap: 5px;
  min-height: 230px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.5;
}

.boot-line {
  opacity: 0;
  transition: opacity 0.25s ease;
}
.boot-line.show { opacity: 1; }

.boot-line-ok    { color: #00e5a0; }
.boot-line-warn  { color: #ffaa33; }
.boot-line-info  { color: var(--th-accent); }
.boot-line-title { color: var(--th-accent); font-weight: 700; font-size: 15px; letter-spacing: 2px; font-family: var(--th-font); }
.boot-line-sep   { color: var(--th-border); user-select: none; }

.boot-cursor {
  font-family: monospace;
  color: var(--th-accent);
  animation: cursorBlink 1s step-end infinite;
  margin-top: 6px;
}

@keyframes cursorBlink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* ============================================================
   LOGIN OVERLAY — PC lock screen
   ============================================================ */
#loginOverlay {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at 28% 38%, #0f2a45 0%, #0a1825 55%, var(--th-bg) 100%);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 12vh;
  gap: 0;
  animation: loginFadeIn 0.6s ease;
}

@keyframes loginFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Clock section */
.login-clock-section {
  text-align: center;
  margin-bottom: 32px;
  pointer-events: none;
}

.login-clock {
  font-size: 90px;
  font-weight: 200;
  letter-spacing: -4px;
  color: #fff;
  line-height: 1;
  text-shadow: 0 2px 40px rgba(59,158,255,0.15);
}

.login-date {
  font-size: 16px;
  font-weight: 300;
  color: rgba(255,255,255,0.45);
  letter-spacing: 2px;
  margin-top: 10px;
  text-transform: capitalize;
}

/* Form section */
.login-form-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 360px;
}

.login-avatar {
  width: 76px; height: 76px;
  background: var(--th-accent-dim);
  border: 1.5px solid rgba(var(--th-accent-rgb),0.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: var(--th-accent);
  box-shadow: 0 0 28px rgba(59,158,255,0.18), inset 0 0 20px rgba(59,158,255,0.05);
  margin-bottom: 2px;
}

.login-agency {
  font-size: 13px; font-weight: 600;
  letter-spacing: 4px;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
}

.login-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.28);
  letter-spacing: 0.5px;
  margin-top: -6px;
}

.login-fields {
  display: flex; flex-direction: column; gap: 6px;
  width: 100%;
  margin-top: 8px;
}

.lf-wrap {
  border-bottom: 1px solid rgba(255,255,255,0.12);
  transition: border-color 0.2s;
}

.lf-wrap:focus-within { border-color: rgba(var(--th-accent-rgb),0.6); }

.lf-input {
  width: 100%;
  background: transparent;
  border: none; outline: none;
  padding: 10px 6px;
  font-family: 'Inter', sans-serif;
  font-size: 15px; font-weight: 400;
  color: #fff;
  letter-spacing: 0.2px;
}

.lf-input::placeholder { color: rgba(255,255,255,0.25); font-size: 14px; }

.lf-row { display: flex; gap: 14px; }
.lf-row .lf-wrap { flex: 1; }

.lf-remember {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 2px;
  cursor: pointer;
  user-select: none;
}

.lf-check { accent-color: var(--th-accent); width: 14px; height: 14px; cursor: pointer; }

.lf-remember span {
  font-size: 13px;
  color: rgba(255,255,255,0.35);
}

.lf-input.lf-error { animation: lfShake 0.3s ease; }
@keyframes lfShake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

.login-btn {
  display: flex; align-items: center; gap: 12px;
  background: var(--th-btn-bg);
  border: 1px solid var(--th-btn-border);
  color: var(--th-btn-color);
  font-family: var(--th-font);
  font-size: 13px; font-weight: 600;
  letter-spacing: 3px;
  padding: 14px 44px;
  cursor: pointer;
  text-transform: uppercase;
  border-radius: 4px;
  transition: all 0.2s;
  margin-top: 6px;
}

.login-btn:hover {
  background: var(--th-accent);
  color: #fff;
  box-shadow: 0 0 30px rgba(var(--th-accent-rgb),0.28);
}

.login-footer-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 12px 20px;
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.12);
  text-align: center;
  text-transform: uppercase;
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* ============================================================
   DESKTOP
   ============================================================ */
#desktop {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  transform-origin: top left;
  background: radial-gradient(ellipse at 25% 35%, #0d2240 0%, #071525 55%, #030b13 100%);
  color: var(--th-text);
  font-family: var(--th-font);
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* Subtle grid texture */
#desktop::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(var(--th-accent-rgb),0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--th-accent-rgb),0.032) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none; z-index: 0;
}

/* Vignette overlay */
#desktop::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,0.55) 100%);
  pointer-events: none; z-index: 0;
}

/* Desktop icons */
.desktop-icons {
  position: absolute;
  inset: 0;
  bottom: 48px;
  z-index: 1;
  pointer-events: none; /* icons handle their own events */
}

.desktop-icon {
  position: absolute;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 8px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  width: 90px;
  transition: background 0.15s, border-color 0.15s;
  border: 1px solid transparent;
  pointer-events: all;
}

.desktop-icon.dragging {
  opacity: 0.55;
  z-index: 50 !important;
  pointer-events: none;
}

/* Drop target highlight for folder icons */
.desktop-icon.drop-target .di-icon-wrap {
  box-shadow: 0 0 0 2px var(--th-accent), 0 0 20px rgba(var(--th-accent-rgb),0.4) !important;
  border-color: var(--th-accent) !important;
}

.desktop-icon:hover {
  background: var(--th-bg-hover);
  border-color: rgba(var(--th-accent-rgb),0.15);
}

.desktop-icon.selected {
  background: rgba(var(--th-accent-rgb),0.15);
  border-color: rgba(var(--th-accent-rgb),0.3);
}

.di-icon-wrap {
  width: 52px; height: 52px;
  background: var(--th-btn-bg);
  border: 1px solid rgba(var(--th-accent-rgb),0.22);
  border-radius: var(--th-radius-xl);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--th-accent);
  transition: all 0.15s;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

.desktop-icon:hover .di-icon-wrap {
  box-shadow: 0 0 20px rgba(var(--th-accent-rgb),0.22);
  border-color: rgba(var(--th-accent-rgb),0.45);
}

.di-label {
  font-size: 11px; font-weight: 500;
  color: rgba(255,255,255,0.72);
  text-align: center;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-width: 86px;
  line-height: 1.35;
  word-break: break-word;
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
}

/* ============================================================
   WINDOWS CONTAINER
   ============================================================ */
.windows-container {
  position: absolute; inset: 0; bottom: 48px;
  z-index: 10;
  pointer-events: none;
}

/* ============================================================
   WINDOW
   ============================================================ */
.window {
  position: absolute;
  background: var(--th-win-bg);
  border: 1px solid var(--th-win-border);
  border-radius: var(--th-radius-lg);
  box-shadow: var(--th-shadow), var(--th-glow);
  display: flex; flex-direction: column;
  overflow: hidden;
  pointer-events: all;
  min-width: 320px; min-height: 200px;
  animation: windowOpen 0.18s cubic-bezier(0.2, 0, 0.2, 1);
}

@keyframes windowOpen {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.window.focused {
  box-shadow: 0 16px 60px rgba(0,0,0,0.75), 0 0 0 1px rgba(var(--th-accent-rgb),0.18);
  border-color: var(--th-border-bright);
}

.window.maximized {
  border-radius: 0 !important;
  border: none !important;
}

.win-minimizing {
  animation: windowMinimize 0.15s ease forwards;
}

@keyframes windowMinimize {
  to { opacity: 0; transform: scale(0.94) translateY(4px); }
}

/* Titlebar */
.win-titlebar {
  display: flex; align-items: center; justify-content: space-between;
  height: 38px; padding: 0 6px 0 12px;
  background: var(--th-titlebar-bg);
  border-bottom: 1px solid var(--th-titlebar-border);
  cursor: move;
  user-select: none;
  flex-shrink: 0;
}

.win-title-left {
  display: flex; align-items: center; gap: 8px;
  min-width: 0; flex: 1;
}

.win-title-icon { font-size: 13px; color: var(--th-accent); flex-shrink: 0; }

.win-title-text {
  font-size: 12px; font-weight: 500;
  color: var(--th-text-mid); letter-spacing: 0.3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.win-controls { display: flex; gap: 2px; flex-shrink: 0; }

.win-btn {
  width: 28px; height: 28px;
  background: transparent;
  border: none; border-radius: var(--th-radius-sm);
  color: var(--th-text-dim);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  transition: background 0.12s, color 0.12s;
}

.win-btn:hover          { background: rgba(255,255,255,0.07); color: var(--th-text); }
.win-close:hover        { background: rgba(255,77,106,0.2);   color: #ff4d6a; }
.win-max:hover          { background: rgba(var(--th-accent-rgb),0.15);  color: var(--th-accent); }

/* Window body */
.win-body {
  flex: 1; overflow: hidden; position: relative;
  background: var(--th-bg);
}

.win-iframe {
  width: 100%; height: 100%;
  border: none; display: block;
  background: var(--th-bg);
}

/* Resize handles — 8-directional */
.win-rh {
  position: absolute;
  z-index: 20;
  user-select: none;
}
/* edge handles */
.win-rh-n  { top: 0;    left: 10px; right: 10px;  height: 5px; cursor: n-resize; }
.win-rh-s  { bottom: 0; left: 10px; right: 10px;  height: 5px; cursor: s-resize; }
.win-rh-e  { right: 0;  top: 10px;  bottom: 10px; width: 5px;  cursor: e-resize; }
.win-rh-w  { left: 0;   top: 10px;  bottom: 10px; width: 5px;  cursor: w-resize; }
/* corner handles — larger hit area, higher z-index */
.win-rh-ne { top: 0;    right: 0; width: 14px; height: 14px; cursor: ne-resize; z-index: 21; }
.win-rh-se { bottom: 0; right: 0; width: 14px; height: 14px; cursor: se-resize; z-index: 21; }
.win-rh-sw { bottom: 0; left: 0;  width: 14px; height: 14px; cursor: sw-resize; z-index: 21; }
.win-rh-nw { top: 0;    left: 0;  width: 14px; height: 14px; cursor: nw-resize; z-index: 21; }
/* hide when maximized */
.window.maximized .win-rh { display: none; }

/* ============================================================
   TASKBAR
   ============================================================ */
.taskbar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 48px;
  background: var(--th-taskbar-bg);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--th-taskbar-border);
  display: flex; align-items: center;
  z-index: 500;
  padding: 0 4px;
  gap: 4px;
}

.taskbar-left { display: flex; align-items: center; flex-shrink: 0; }

.tb-launcher-btn {
  width: 44px; height: 40px;
  background: transparent;
  border: none; border-radius: 8px;
  color: rgba(185,218,255,0.65);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  margin: 0 2px;
}

.tb-launcher-btn:hover {
  background: rgba(255,255,255,0.09);
  color: rgba(255,255,255,0.92);
}

.tb-launcher-btn.active {
  background: rgba(var(--th-accent-rgb),0.16);
  color: var(--th-accent);
  transform: scale(0.96);
}

.taskbar-windows {
  flex: 1; display: flex; align-items: center;
  gap: 4px; padding: 0 4px;
  overflow: hidden;
}

.tb-win-btn {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--th-radius-btn);
  color: var(--th-text-dim);
  cursor: pointer;
  font-family: var(--th-font);
  font-size: 12px; font-weight: 500;
  white-space: nowrap; max-width: 180px;
  transition: all 0.12s;
  overflow: hidden; text-overflow: ellipsis;
}

.tb-win-btn i { font-size: 12px; flex-shrink: 0; }
.tb-win-btn span { overflow: hidden; text-overflow: ellipsis; }

.tb-win-btn:hover    { background: var(--th-bg-hover); border-color: rgba(var(--th-accent-rgb),0.2); color: var(--th-text-mid); }
.tb-win-btn.active   { background: rgba(var(--th-accent-rgb),0.15); border-color: rgba(var(--th-accent-rgb),0.32); color: var(--th-text); }
.tb-win-btn.minimized { opacity: 0.45; }

/* ── Taskbar Pinned Apps ─────────────────────────────────── */
.taskbar-pins {
  display: flex; align-items: center;
  gap: 2px; padding: 0 4px;
  flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,0.07);
  margin-right: 2px;
}

.tb-pin-btn {
  width: 40px; height: 36px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--th-radius-btn);
  color: var(--th-text-dim);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  position: relative;
  transition: all 0.12s;
}

.tb-pin-btn:hover {
  background: var(--th-bg-hover);
  border-color: rgba(var(--th-accent-rgb),0.2);
  color: var(--th-text-mid);
}

.tb-pin-btn.running {
  color: var(--th-text);
  background: rgba(var(--th-accent-rgb), 0.07);
}

.tb-pin-btn.running::after {
  content: '';
  position: absolute; bottom: 0px; left: 50%; transform: translateX(-50%);
  width: 18px; height: 3px; border-radius: 2px;
  background: var(--th-accent); opacity: 0.85;
  transition: width 0.15s, opacity 0.15s;
}

.tb-pin-btn.active {
  background: rgba(var(--th-accent-rgb),0.15);
  border-color: rgba(var(--th-accent-rgb),0.32);
  color: var(--th-text);
}

.tb-pin-btn.active::after {
  content: '';
  position: absolute; bottom: 0px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 2px;
  background: var(--th-accent); opacity: 1;
  transition: width 0.15s, opacity 0.15s;
}

.tb-pin-btn.minimized { opacity: 0.5; }

/* ── Taskbar Preview Popup ───────────────────────────────── */
#tb-preview-popup.tb-preview-popup {
  position: fixed;
  bottom: 54px;
  background: rgba(8, 18, 34, 0.96);
  border: 1px solid rgba(var(--th-accent-rgb), 0.22);
  border-radius: 8px;
  padding: 8px;
  z-index: 9998;
  box-shadow: 0 -4px 28px rgba(0,0,0,0.72), 0 2px 8px rgba(0,0,0,0.5);
  backdrop-filter: blur(20px);
  pointer-events: auto;
  opacity: 0;
}

#tb-preview-popup.tb-preview-label {
  position: fixed;
  bottom: 54px;
  background: rgba(8, 18, 34, 0.93);
  border: 1px solid rgba(var(--th-accent-rgb), 0.2);
  border-radius: 5px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--th-text);
  z-index: 9998;
  box-shadow: 0 2px 14px rgba(0,0,0,0.55);
  backdrop-filter: blur(16px);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
}

/* Animation only fires once the element is fully positioned */
#tb-preview-popup.tb-preview-ready {
  animation: tbPreviewIn 0.14s ease forwards;
}

@keyframes tbPreviewIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tb-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.tb-preview-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--th-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 176px;
}

.tb-preview-close-btn {
  width: 18px; height: 18px;
  background: transparent;
  border: none;
  border-radius: 3px;
  color: var(--th-text-dim);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.1s, color 0.1s;
}
.tb-preview-close-btn:hover  { background: rgba(255,77,106,0.85); color: #fff; }

.tb-preview-thumb {
  cursor: pointer;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(var(--th-accent-rgb), 0.12);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.tb-preview-thumb:hover {
  border-color: rgba(var(--th-accent-rgb), 0.5);
  box-shadow: 0 0 0 2px rgba(var(--th-accent-rgb), 0.2);
}

/* ── Rubber-band Selection Box ───────────────────────────── */
.selection-box {
  position: absolute;
  display: none;
  border: 1px solid rgba(var(--th-accent-rgb), 0.7);
  background: rgba(var(--th-accent-rgb), 0.08);
  pointer-events: none;
  z-index: 450;
  border-radius: 2px;
}

.taskbar-right { display: flex; align-items: center; flex-shrink: 0; }

.taskbar-clock-wrap {
  display: flex; flex-direction: column; align-items: center;
  padding: 0 12px; min-width: 72px; cursor: default;
}

.tb-time { font-size: 14px; font-weight: 500; color: var(--th-text-mid); letter-spacing: 1px; line-height: 1.15; }
.tb-date { font-size: 10px; color: var(--th-text-dim); letter-spacing: 0.5px; }

/* ============================================================
   LAUNCHER POPUP
   ============================================================ */
.launcher-popup {
  position: absolute;
  bottom: 52px; left: 4px;
  width: 360px;
  background: rgba(8,18,34,0.97);
  border: 1px solid rgba(var(--th-accent-rgb),0.14);
  border-radius: var(--th-radius-xl);
  box-shadow: 0 -8px 50px rgba(0,0,0,0.75),
              0 0 0 1px rgba(var(--th-accent-rgb),0.04),
              inset 0 1px 0 rgba(255,255,255,0.04);
  z-index: 600;
  overflow: hidden;
  backdrop-filter: blur(24px);
  animation: launcherSlideIn 0.2s cubic-bezier(0.2, 0, 0.2, 1);
}

@keyframes launcherSlideIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Search bar */
.launcher-search-wrap {
  margin: 14px 14px 6px;
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--th-radius-md);
  padding: 9px 14px;
  transition: border-color 0.15s, background 0.15s;
}

.launcher-search-wrap:focus-within {
  border-color: rgba(var(--th-accent-rgb),0.45);
  background: rgba(var(--th-accent-rgb),0.05);
}

.launcher-search-wrap > i {
  font-size: 13px; color: rgba(255,255,255,0.28); flex-shrink: 0;
}

.launcher-search-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-family: var(--th-font);
  font-size: 13px; color: rgba(255,255,255,0.78);
}

.launcher-search-input::placeholder { color: rgba(255,255,255,0.22); }

/* Section label */
.launcher-section-label {
  padding: 10px 18px 4px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
  color: rgba(255,255,255,0.4);
}

/* Apps grid */
.launcher-apps {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 2px; padding: 4px 10px 10px;
}

.launcher-app-btn {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 12px 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--th-radius-lg);
  cursor: pointer;
  color: var(--th-text-mid);
  font-family: var(--th-font);
  font-size: 11px; font-weight: 500;
  text-align: center; line-height: 1.3;
  transition: all 0.13s;
}

.launcher-app-btn:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
}

.launcher-app-btn i { font-size: 22px; color: var(--th-accent); }

.launcher-pin-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--th-accent);
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.launcher-app-btn.is-pinned .launcher-pin-dot { opacity: 0.65; }

/* Footer */
.launcher-footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px 10px;
  gap: 6px;
}

.launcher-officer-row {
  display: flex; align-items: center; gap: 10px;
  min-width: 0; flex: 1;
}

.launcher-officer-avatar {
  width: 32px; height: 32px; flex-shrink: 0;
  background: var(--th-btn-bg);
  border: 1px solid rgba(var(--th-accent-rgb),0.28);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--th-accent);
  overflow: hidden;
}

.launcher-avatar-img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.launcher-officer-info { min-width: 0; }

.launcher-officer-name {
  font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.75);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.launcher-officer-badge {
  font-size: 10px; color: rgba(var(--th-accent-rgb),0.65); letter-spacing: 0.5px;
  margin-top: 1px;
}

/* Power icon row */
.launcher-power-row {
  display: flex; gap: 2px; flex-shrink: 0;
}

.launcher-power-btn {
  width: 34px; height: 34px;
  background: transparent;
  border: none; border-radius: 6px;
  color: rgba(150,190,230,0.5);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: all 0.12s;
}

.launcher-power-btn:hover {
  background: rgba(255,255,255,0.09);
  color: rgba(255,255,255,0.9);
}

.launcher-power-btn--danger:hover {
  background: rgba(255,77,106,0.15);
  color: #ff4d6a;
}

/* ============================================================
   SHUTDOWN OVERLAY
   ============================================================ */
#shutdownOverlay {
  position: fixed; inset: 0;
  background: #030810;
  z-index: 20000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.shutdown-icon {
  font-size: 48px;
  color: rgba(59,158,255,0.2);
  cursor: pointer;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}
.shutdown-icon:hover {
  color: rgba(59,158,255,0.75);
  text-shadow: 0 0 18px rgba(59,158,255,0.4);
}
.shutdown-text {
  font-size: 15px; font-weight: 300;
  color: rgba(160,200,240,0.45);
  letter-spacing: 2px;
}
.shutdown-sub {
  font-size: 10px; color: rgba(59,100,150,0.35);
  letter-spacing: 3px;
}

/* ============================================================
   OFFICER WIDGET — top-right corner
   ============================================================ */
.officer-widget {
  position: absolute;
  top: 14px; right: 16px;
  z-index: 5;
  pointer-events: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ow-text { text-align: right; }

.ow-badge {
  font-size: 11px; font-weight: 700;
  letter-spacing: 2px;
  color: rgba(var(--th-accent-rgb),0.75);
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(59,158,255,0.35);
}

.ow-badge i { margin-right: 4px; }

.ow-name {
  font-size: 13px; font-weight: 500;
  color: rgba(180,220,255,0.75);
  letter-spacing: 0.4px;
  margin-top: 3px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.9);
}

.ow-avatar-wrap {
  width: 38px; height: 38px;
  background: var(--th-btn-bg);
  border: 1.5px solid rgba(var(--th-accent-rgb),0.28);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--th-accent);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(59,158,255,0.18);
}

.ow-avatar-img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ============================================================
   SETTINGS MODAL
   ============================================================ */
#settingsModal {
  position: fixed; inset: 0;
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
}

.settings-dialog {
  position: relative;
  width: 420px;
  background: var(--th-settings-bg);
  border: 1px solid var(--th-win-border);
  border-radius: var(--th-radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), var(--th-glow);
  overflow: hidden;
  animation: windowOpen 0.18s cubic-bezier(0.2, 0, 0.2, 1);
}

.settings-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  background: var(--th-titlebar-bg);
  border-bottom: 1px solid var(--th-border);
  color: var(--th-accent);
  font-size: 14px; font-weight: 600;
}

.settings-header i { flex-shrink: 0; }

.settings-header span { flex: 1; font-size: 13px; color: var(--th-text-mid); font-weight: 500; letter-spacing: 0.3px; }

.settings-close-btn {
  background: transparent; border: none;
  color: var(--th-text-dim); cursor: pointer;
  width: 28px; height: 28px;
  border-radius: var(--th-radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; transition: all 0.12s;
}

.settings-close-btn:hover { background: rgba(255,77,106,0.2); color: #ff4d6a; }

.settings-body {
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  max-height: calc(90vh - 70px);
  overflow-y: auto;
}

.settings-section-title {
  font-size: 10px; font-weight: 700; letter-spacing: 2.5px;
  color: var(--th-accent); text-transform: uppercase;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--th-border);
}

.settings-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 2px 0;
}

/* Avatar section */
.settings-avatar-row {
  display: flex; align-items: center; gap: 16px;
}

.settings-avatar-preview {
  width: 68px; height: 68px; flex-shrink: 0;
  background: var(--th-btn-bg);
  border: 1.5px solid rgba(var(--th-accent-rgb),0.28);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--th-accent);
  overflow: hidden;
  box-shadow: 0 0 20px rgba(59,158,255,0.14);
}

.settings-avatar-img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.settings-avatar-actions {
  flex: 1; display: flex; flex-direction: column; gap: 6px;
}

.wallpaper-preview-box {
  width: 100%; height: 130px;
  background: radial-gradient(ellipse at 25% 35%, #0d2240 0%, #071525 55%, #030b13 100%);
  border: 1px solid var(--th-win-border);
  border-radius: var(--th-radius-md);
  display: flex; align-items: flex-end; justify-content: flex-start;
  padding: 8px 10px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.wallpaper-preview-label {
  font-size: 10px; color: rgba(255,255,255,0.4);
  letter-spacing: 1px;
  background: rgba(0,0,0,0.55);
  padding: 2px 7px; border-radius: 3px;
}

.settings-wallpaper-actions {
  display: flex; gap: 8px;
}

.settings-file-label {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px;
  background: var(--th-btn-bg);
  border: 1px solid var(--th-btn-border);
  border-radius: var(--th-radius-btn);
  color: var(--th-btn-color);
  cursor: pointer;
  font-family: var(--th-font);
  font-size: 12px; font-weight: 500;
  transition: all 0.15s;
}

.settings-file-label:hover { background: var(--th-accent); color: #fff; }

.settings-btn-reset {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--th-radius-btn);
  color: var(--th-text-dim);
  cursor: pointer;
  font-family: var(--th-font);
  font-size: 12px; font-weight: 500;
  transition: all 0.15s;
}

.settings-btn-reset:hover { background: rgba(255,255,255,0.08); color: #b0d0ea; }

.wallpaper-error {
  font-size: 12px; color: #ff4d6a;
  padding: 8px 12px;
  background: rgba(255,77,106,0.08);
  border: 1px solid rgba(255,77,106,0.2);
  border-radius: 4px;
}

/* ============================================================
   THEME PICKER — settings section
   ============================================================ */
.theme-grid {
  display: flex; gap: 10px; flex-wrap: wrap;
}

.theme-tile {
  flex: 1; min-width: 80px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px 8px;
  background: rgba(255,255,255,0.03);
  border: 2px solid var(--th-border);
  border-radius: var(--th-radius-md);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

.theme-tile:hover {
  background: var(--th-bg-hover);
  border-color: rgba(var(--th-accent-rgb),0.35);
}

.theme-tile.active {
  border-color: var(--th-accent);
  background: var(--th-accent-dim);
}

.theme-tile-swatch {
  width: 44px; height: 32px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.12);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

/* Modern swatch */
.theme-tile[data-theme-id="modern"] .theme-tile-swatch {
  background: linear-gradient(135deg, #060f18 50%, #3b9eff 100%);
}
/* Terminal swatch */
.theme-tile[data-theme-id="terminal"] .theme-tile-swatch {
  background: linear-gradient(135deg, #000000 50%, #ffcc00 100%);
}
/* Win98 swatch */
.theme-tile[data-theme-id="win98"] .theme-tile-swatch {
  background: linear-gradient(135deg, #008080 0%, #c0c0c0 50%, #000080 100%);
}

.theme-tile-name {
  font-size: 10px; font-weight: 600;
  letter-spacing: 1px;
  color: var(--th-text-mid);
  text-transform: uppercase;
  text-align: center;
}

.theme-tile.active .theme-tile-name {
  color: var(--th-accent);
}

.theme-tile--disabled {
  cursor: not-allowed;
  opacity: 0.45;
  pointer-events: none;
}

.theme-tile-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--th-text-dim);
  border: 1px solid var(--th-border);
  border-radius: 2px;
  padding: 1px 5px;
}

/* ============================================================
   FILE EXPLORER
   ============================================================ */
.explorer-layout {
  display: flex; height: 100%; overflow: hidden;
  background: var(--th-bg);
}

/* Sidebar */
.explorer-sidebar {
  width: 192px; flex-shrink: 0;
  border-right: 1px solid var(--th-border);
  background: var(--th-bg-panel);
  overflow-y: auto;
  display: flex; flex-direction: column;
}

.exp-sidebar-title {
  padding: 9px 14px 5px;
  font-size: 10px; font-weight: 700; letter-spacing: 2px;
  color: var(--th-text-dim); text-transform: uppercase;
  flex-shrink: 0;
  border-bottom: 1px solid var(--th-border);
  margin-bottom: 3px;
}

.exp-tree-list { display: flex; flex-direction: column; }
.exp-tree-wrap { display: flex; flex-direction: column; }

.exp-tree-item {
  display: flex; align-items: center; gap: 5px;
  height: 27px;
  cursor: pointer;
  border-radius: 4px;
  margin: 1px 5px;
  padding-right: 6px;
  transition: background 0.1s;
  user-select: none;
  white-space: nowrap; overflow: hidden;
}
.exp-tree-item:hover  { background: var(--th-bg-hover); }
.exp-tree-item.active { background: rgba(var(--th-accent-rgb),0.13); }
.exp-tree-item.active .exp-tree-label { color: var(--th-text); }
.exp-tree-item.drop-target { background: rgba(var(--th-accent-rgb),0.22); outline: 1px solid var(--th-accent); }
.exp-tree-desktop { color: var(--th-text-dim); }

.exp-tree-expand {
  width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  color: var(--th-text-dim); font-size: 9px; flex-shrink: 0;
  border-radius: 3px; transition: color 0.1s; cursor: pointer;
}
.exp-tree-expand:hover { color: var(--th-text-mid); }

.exp-tree-icon  { font-size: 12px; color: var(--th-accent); flex-shrink: 0; }

.exp-tree-label {
  font-size: 12px; color: var(--th-text-mid);
  overflow: hidden; text-overflow: ellipsis; flex: 1;
}

/* Main area */
.explorer-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; overflow: hidden;
}

/* Toolbar */
.explorer-toolbar {
  display: flex; align-items: center; gap: 4px;
  height: 37px; padding: 0 6px;
  background: var(--th-bg-panel);
  border-bottom: 1px solid var(--th-border);
  flex-shrink: 0;
}

.exp-nav-btn {
  width: 26px; height: 26px;
  background: transparent; border: none; border-radius: 4px;
  color: var(--th-text-dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0; transition: background 0.1s, color 0.1s;
}
.exp-nav-btn:hover:not(:disabled) { background: var(--th-bg-hover); color: var(--th-text-mid); }
.exp-nav-btn:disabled { opacity: 0.22; cursor: not-allowed; }

/* ============================================================
   TRASH
   ============================================================ */
#trashIcon .di-icon-wrap i { color: var(--th-text-dim); transition: color 0.2s; }
#trashIcon .di-icon-wrap i.trash-full { color: var(--th-accent); }
#trashIcon:hover .di-icon-wrap i { color: var(--th-text-mid); }

.trash-win-body {
  display: flex; flex-direction: column;
  height: 100%; overflow: hidden;
}
.trash-toolbar {
  padding: 8px 12px;
  border-bottom: 1px solid var(--th-border);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.trash-empty-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  background: rgba(255,77,106,0.1);
  border: 1px solid rgba(255,77,106,0.3);
  border-radius: var(--th-radius-btn);
  color: #ff4d6a;
  font-family: var(--th-font); font-size: 12px;
  cursor: pointer; transition: background 0.15s;
}
.trash-empty-btn:hover { background: rgba(255,77,106,0.2); }

.trash-content {
  flex: 1; overflow-y: auto; padding: 6px 0;
}
.trash-empty-msg {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px;
  height: 100%; color: var(--th-text-dim);
  font-size: 13px; user-select: none;
}
.trash-empty-msg i { font-size: 36px; opacity: 0.35; }

.trash-row {
  display: grid;
  grid-template-columns: 22px 1fr 160px 130px;
  align-items: center; gap: 10px;
  padding: 6px 14px;
  font-size: 12px; color: var(--th-text-mid);
  cursor: default; border-radius: 4px;
  transition: background 0.1s;
  user-select: none;
}
.trash-row:hover { background: var(--th-bg-hover); }
.trash-row-icon { color: var(--th-accent); font-size: 14px; }
.trash-row-name { color: var(--th-text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-row-date { color: var(--th-text-dim); font-size: 11px; }
.trash-row-type { color: var(--th-text-dim); font-size: 11px; }

.exp-breadcrumb {
  flex: 1; display: flex; align-items: center; gap: 1px;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px; padding: 0 7px; height: 26px;
}

.bc-seg {
  background: transparent; border: none;
  color: var(--th-text-mid); font-family: var(--th-font);
  font-size: 12px; cursor: pointer;
  padding: 1px 4px; border-radius: 3px; white-space: nowrap;
  transition: background 0.1s, color 0.1s;
  display: flex; align-items: center; gap: 4px;
}
.bc-seg:hover:not(:disabled)  { background: var(--th-bg-hover); color: var(--th-text); }
.bc-seg:disabled               { cursor: default; }
.bc-seg--current               { color: var(--th-text); font-weight: 500; }
.bc-sep-arrow                  { color: var(--th-text-dim); font-size: 13px; user-select: none; }

.exp-toolbar-right { display: flex; gap: 1px; flex-shrink: 0; }

.exp-action-btn {
  width: 26px; height: 26px;
  background: transparent; border: none; border-radius: 4px;
  color: var(--th-text-dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; transition: background 0.1s, color 0.1s;
}
.exp-action-btn:hover { background: var(--th-bg-hover); color: var(--th-accent); }

/* Content */
.explorer-content {
  flex: 1; overflow-y: auto;
  padding: 10px;
  display: flex; flex-wrap: wrap;
  align-content: flex-start; gap: 4px;
  position: relative;
  transition: box-shadow 0.1s;
}
.explorer-content.drop-target {
  box-shadow: inset 0 0 0 2px var(--th-accent);
  border-radius: var(--th-radius-sm);
}
.exp-drop-overlay {
  display: none;
  position: absolute; inset: 0;
  pointer-events: none;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  color: var(--th-accent);
  font-size: 12px;
  font-family: var(--th-font);
  background: rgba(var(--th-accent-rgb), 0.06);
  border-radius: var(--th-radius-sm);
  z-index: 5;
}
.exp-drop-overlay i { font-size: 28px; opacity: 0.7; }
.explorer-content.drop-target .exp-drop-overlay { display: flex; }

/* Drag ghost */
.drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.85;
  transform: scale(1.08);
  transition: none;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}

/* Icons inside explorer are flow-positioned (not absolute) */
.exp-icon {
  position: relative !important;
  left: auto !important; top: auto !important;
}

.exp-empty {
  width: 100%; padding: 52px 0;
  text-align: center; color: var(--th-text-dim);
  font-size: 12px; letter-spacing: 0.5px;
}

/* ============================================================
   SCROLLBARS
   ============================================================ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--th-border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--th-accent); }

/* ============================================================
   CONTEXT MENU
   ============================================================ */
.context-menu {
  position: fixed;
  z-index: 9999;
  background: rgba(8,18,34,0.97);
  border: 1px solid rgba(var(--th-accent-rgb),0.18);
  border-radius: var(--th-radius-lg);
  box-shadow: 0 8px 40px rgba(0,0,0,0.75), 0 0 0 1px rgba(var(--th-accent-rgb),0.05);
  backdrop-filter: blur(20px);
  padding: 4px;
  min-width: 200px;
  animation: ctxFadeIn 0.1s ease;
  overflow: hidden;
}

@keyframes ctxFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(-4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: var(--th-radius-md);
  color: var(--th-text-mid);
  font-family: var(--th-font);
  font-size: 12.5px;
  font-weight: 400;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}

.ctx-item i {
  font-size: 12px;
  color: var(--th-accent);
  width: 16px;
  flex-shrink: 0;
  text-align: center;
}

.ctx-item:hover {
  background: var(--th-bg-hover);
  color: var(--th-text);
}

.ctx-item--danger { color: rgba(255, 130, 130, 0.75); }
.ctx-item--danger i { color: #ff4d6a; }

/* ============================================================
   SYSINFO WATERMARK — bottom-right corner (desktop)
   ============================================================ */
.sysinfo-watermark {
  position: absolute;
  bottom: 58px;
  right: 18px;
  z-index: 4;
  pointer-events: none;
  user-select: none;
  text-align: right;
  line-height: 1.55;
}

.sysinfo-name {
  font-size: 16px;
  font-weight: 400;
  color: rgba(208, 232, 255, 0.22);
  letter-spacing: 0.3px;
}

.sysinfo-ver {
  font-size: 12px;
  font-weight: 300;
  color: rgba(208, 232, 255, 0.18);
  letter-spacing: 0.2px;
}

.sysinfo-build {
  font-size: 10px;
  font-weight: 300;
  color: rgba(208, 232, 255, 0.12);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 1px;
}
.ctx-item--danger:hover { background: rgba(255,77,106,0.12); color: #ff6e85; }

.ctx-item:disabled { opacity: 0.35; cursor: not-allowed; }

.ctx-sep {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 3px 8px;
}

/* Inline rename input on desktop icon */
.di-rename-input {
  width: 78px;
  background: var(--th-bg-card);
  border: 1px solid var(--th-accent);
  border-radius: 3px;
  outline: none;
  color: var(--th-text);
  font-family: var(--th-font);
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  padding: 2px 4px;
  box-shadow: 0 0 8px rgba(var(--th-accent-rgb),0.35);
}

/* ============================================================
   STICKY NOTES
   ============================================================ */
.sticky-note {
  position: absolute;
  border-radius: 2px;
  box-shadow: 3px 6px 24px rgba(0,0,0,0.55), 0 1px 4px rgba(0,0,0,0.4);
  display: flex; flex-direction: column;
  overflow: hidden;
  min-width: 160px; min-height: 100px;
  animation: stickyOpen 0.16s ease;
  user-select: none;
  pointer-events: all;
}

@keyframes stickyOpen {
  from { opacity: 0; transform: scale(0.9) translateY(-8px) rotate(-1deg); }
  to   { opacity: 1; transform: scale(1)   translateY(0)    rotate(0deg); }
}

.sticky-header {
  display: flex; align-items: center;
  padding: 5px 7px;
  cursor: move;
  user-select: none;
  flex-shrink: 0;
  gap: 5px;
}

.sticky-colors {
  display: flex; align-items: center; gap: 4px; flex: 1;
}

.sticky-color-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity 0.12s, transform 0.12s;
  border: 1.5px solid rgba(0,0,0,0.18);
}
.sticky-color-dot:hover { opacity: 0.9; transform: scale(1.25); }
.sticky-color-dot.active { opacity: 1; transform: scale(1.18); border-color: rgba(0,0,0,0.45); }

.sticky-close-btn {
  background: transparent; border: none;
  cursor: pointer; color: rgba(0,0,0,0.35);
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; border-radius: 3px;
  transition: color 0.12s, background 0.12s;
  flex-shrink: 0;
}
.sticky-close-btn:hover { color: #c0392b; background: rgba(192,57,43,0.15); }

.sticky-body {
  flex: 1; padding: 6px 9px 4px;
  display: flex; flex-direction: column;
}

.sticky-textarea {
  flex: 1; width: 100%;
  background: transparent; border: none; outline: none; resize: none;
  font-family: 'Segoe UI', sans-serif; font-size: 13px; line-height: 1.55;
  min-height: 80px;
  cursor: text;
}
.sticky-textarea::placeholder { font-style: italic; opacity: 0.45; }

.sticky-resize-handle {
  position: absolute; right: 0; bottom: 0;
  width: 16px; height: 16px;
  cursor: se-resize; z-index: 10;
}
.sticky-resize-handle::after {
  content: '';
  position: absolute; right: 2px; bottom: 2px;
  width: 8px; height: 8px;
  border-right: 2px solid rgba(0,0,0,0.16);
  border-bottom: 2px solid rgba(0,0,0,0.16);
}

/* ============================================================
   CALENDAR POPUP
   ============================================================ */
.calendar-popup {
  position: absolute;
  bottom: 52px; right: 4px;
  width: 272px;
  background: rgba(8,18,34,0.97);
  border: 1px solid rgba(var(--th-accent-rgb),0.14);
  border-radius: var(--th-radius-xl);
  box-shadow: 0 -8px 50px rgba(0,0,0,0.75),
              0 0 0 1px rgba(var(--th-accent-rgb),0.04),
              inset 0 1px 0 rgba(255,255,255,0.04);
  z-index: 600;
  backdrop-filter: blur(24px);
  padding: 14px 14px 12px;
  animation: launcherSlideIn 0.2s cubic-bezier(0.2, 0, 0.2, 1);
}

.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}

.cal-month-label {
  font-size: 14px; font-weight: 600;
  color: var(--th-text); letter-spacing: 0.2px;
}

.cal-nav-btn {
  width: 28px; height: 28px;
  background: transparent; border: none;
  border-radius: var(--th-radius-sm);
  color: var(--th-text-dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; transition: background 0.1s, color 0.1s;
}
.cal-nav-btn:hover { background: var(--th-bg-hover); color: var(--th-accent); }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}

.cal-day-header {
  text-align: center;
  font-size: 10px; font-weight: 700;
  color: var(--th-text-dim);
  padding: 4px 0;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.cal-day {
  text-align: center;
  font-size: 12px;
  padding: 5px 2px;
  border-radius: var(--th-radius-sm);
  cursor: default;
  color: var(--th-text-mid);
  line-height: 1.4;
  transition: background 0.1s;
}
.cal-day:hover:not(.today):not(.other-month) {
  background: var(--th-bg-hover); color: var(--th-text);
}
.cal-day.today {
  background: var(--th-accent);
  color: #fff; font-weight: 700;
  border-radius: 50%;
}
.cal-day.other-month { color: var(--th-text-dim); opacity: 0.32; }

.cal-footer {
  display: flex; justify-content: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.cal-today-btn {
  background: transparent;
  border: 1px solid rgba(var(--th-accent-rgb),0.3);
  border-radius: 20px;
  padding: 5px 20px;
  font-family: var(--th-font);
  font-size: 11px; font-weight: 600;
  color: var(--th-accent);
  cursor: pointer;
  letter-spacing: 0.8px;
  transition: background 0.14s, color 0.14s;
}
.cal-today-btn:hover { background: var(--th-accent); color: #fff; }

/* Make clock/date clickable */
.taskbar-clock-wrap { cursor: pointer; }
.taskbar-clock-wrap:hover .tb-time,
.taskbar-clock-wrap:hover .tb-date { color: var(--th-text); }
