/* ==========================================================================
   WebDesk - original browser-native desktop (not affiliated with Microsoft)
   ========================================================================== */

:root {
  --tb-h: 48px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-sm: 6px;
  --accent: #4f7cff;
  --accent-2: #8a5bff;
  --accent-soft: rgba(79, 124, 255, 0.16);
  --anim: 0.22s cubic-bezier(0.2, 0.8, 0.25, 1);
  --win-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 2px 10px rgba(0, 0, 0, 0.35);
  --pop-shadow: 0 16px 44px rgba(0, 0, 0, 0.42), 0 2px 8px rgba(0, 0, 0, 0.3);
  --stroke: rgba(128, 128, 128, 0.35);
  --font: "Inter", "System UI", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "Consolas", "SFMono-Regular", Menlo, monospace;
}

body[data-theme="dark"] {
  --bg: #10131a;
  --text: #f2f4f8;
  --text-dim: #9aa3b2;
  --glass: rgba(28, 32, 42, 0.72);
  --glass-2: rgba(24, 28, 38, 0.88);
  --panel: #1c202a;
  --panel-2: #232836;
  --hover: rgba(255, 255, 255, 0.07);
  --hover-2: rgba(255, 255, 255, 0.12);
  --field: rgba(255, 255, 255, 0.09);
  --field-2: rgba(255, 255, 255, 0.14);
  --sel: rgba(79, 124, 255, 0.28);
  --scroll-thumb: rgba(255, 255, 255, 0.22);
  --tb-bg: rgba(18, 21, 28, 0.62);
}

body[data-theme="light"] {
  --bg: #eaeef6;
  --text: #1b2330;
  --text-dim: #5a6578;
  --glass: rgba(250, 252, 255, 0.78);
  --glass-2: rgba(246, 249, 255, 0.94);
  --panel: #f4f7fc;
  --panel-2: #e8edf7;
  --hover: rgba(0, 0, 0, 0.055);
  --hover-2: rgba(0, 0, 0, 0.1);
  --field: rgba(0, 0, 0, 0.06);
  --field-2: rgba(0, 0, 0, 0.1);
  --sel: rgba(79, 124, 255, 0.18);
  --scroll-thumb: rgba(0, 0, 0, 0.25);
  --tb-bg: rgba(246, 249, 255, 0.68);
}

html, body { height: 100%; margin: 0; overflow: hidden; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

body.no-anim *, body.no-anim *::before, body.no-anim *::after {
  transition: none !important;
  animation: none !important;
}

body.no-transparency .glass {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.no-transparency #taskbar, body.no-transparency #startmenu,
body.no-transparency .window-titlebar, body.no-transparency #searchoverlay {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
button[style*="background:#000"], button[style*="background: #000"] { color: #fff; }
button[style*="background:#fff"], button[style*="background: #fff"] { color: #1b2330; }
input, select, textarea { font-family: inherit; color: inherit; }
input:focus, select:focus, textarea:focus { outline: none; }

.hidden { display: none !important; }
[hidden] { display: none !important; }

/* ==========================================================================
   Splash / boot
   ========================================================================== */
#splash {
  position: fixed; inset: 0; z-index: 1000;
  background: radial-gradient(120% 120% at 20% 0%, #16233f 0%, #0b1220 55%, #070b14 100%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease;
}
#splash.hide { opacity: 0; pointer-events: none; }
.splash-inner { text-align: center; }
.splash-logo {
  width: 88px; height: 88px; margin: 0 auto 22px;
  border-radius: 26px;
  background: linear-gradient(135deg, #3fd0ff, #4f7cff 55%, #8a5bff);
  box-shadow: 0 18px 50px rgba(79, 124, 255, 0.45);
  position: relative;
  animation: splashpop 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}
.splash-logo::before {
  content: ""; position: absolute; inset: 20px;
  background: rgba(255, 255, 255, 0.95);
  -webkit-mask: var(--logo-mark) center / contain no-repeat;
  mask: var(--logo-mark) center / contain no-repeat;
}
@keyframes splashpop { from { transform: scale(0.4) translateY(20px); opacity: 0; } }
.splash-name { font-size: 30px; font-weight: 700; letter-spacing: -0.5px; color: #fff; }
.splash-sub { color: rgba(255, 255, 255, 0.55); margin-top: 6px; font-size: 13px; }
.splash-progress {
  width: 220px; height: 4px; margin: 28px auto 0; border-radius: 4px;
  background: rgba(255, 255, 255, 0.14); overflow: hidden;
}
.splash-progress span {
  display: block; height: 100%; width: 40%;
  background: linear-gradient(90deg, #3fd0ff, #8a5bff);
  border-radius: 4px;
  animation: bootbar 1.1s ease-in-out infinite;
}
@keyframes bootbar { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

/* ==========================================================================
   Desktop
   ========================================================================== */
#desktop { position: fixed; inset: 0; }
#wallpaper {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(160deg, #1b2a4a 0%, #0e1626 60%, #060a12 100%) center / cover no-repeat;
  transition: background-image 0.4s ease, background-color 0.4s ease;
}
#desktop-icons { position: absolute; inset: var(--tb-h) 0 0; z-index: 4; padding: 10px; }
.dicon {
  position: absolute; width: 86px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 2px; border-radius: 8px; cursor: default;
  text-align: center;
  transition: background 0.12s ease;
}
.dicon img { width: 46px; height: 46px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.45)); }
.dicon .dlabel {
  font-size: 12px; color: #fff; line-height: 1.25;
  padding: 1px 7px; border-radius: 5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  max-width: 86px;
  overflow: hidden; text-overflow: ellipsis;
}
body[data-theme="light"] .dicon .dlabel { color: #1b2330; text-shadow: 0 1px 2px rgba(255,255,255,0.5); }
.dicon:hover { background: rgba(255, 255, 255, 0.12); }
.dicon:active { background: rgba(255, 255, 255, 0.18); }
.dicon.selected { background: rgba(79, 124, 255, 0.35); outline: 1px solid var(--accent); }
body[data-theme="light"] .dicon:hover { background: rgba(0, 0, 0, 0.08); }
body[data-theme="light"] .dicon:active { background: rgba(0, 0, 0, 0.12); }
body[data-theme="light"] .dicon.selected { background: rgba(79,124,255,0.28); }
.dicon.dragging { opacity: 0.85; transition: none; }

#view-hint {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 5; padding: 7px 16px; border-radius: 20px;
  background: var(--glass-2); color: var(--text); font-size: 12px;
  box-shadow: var(--pop-shadow); opacity: 0; transition: opacity 0.25s ease;
  pointer-events: none;
}
#view-hint.show { opacity: 1; }

/* ==========================================================================
   Workspace / windows
   ========================================================================== */
#workspace { position: absolute; inset: var(--tb-h) 0 0; z-index: 10; pointer-events: none; }
.window { position: absolute; pointer-events: auto; min-width: 260px; min-height: 200px;
  display: flex; flex-direction: column;
  background: var(--glass-2);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  box-shadow: var(--win-shadow);
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}
.window:focus-within, .window.focused { border-color: rgba(255,255,255,0.22); }
body[data-theme="light"] .window.focused { border-color: rgba(30,60,120,0.25); }
.window.minimizing { opacity: 0; transform: translateY(60px) scale(0.94); }
.window.maximized { border-radius: 0; border: none; }

.win-titlebar {
  height: 36px; flex: 0 0 36px;
  display: flex; align-items: center; gap: 9px;
  padding: 0 8px 0 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.0));
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  cursor: default;
  touch-action: none;
}
.win-titlebar .win-ico { width: 17px; height: 17px; flex: 0 0 auto; }
.win-title { flex: 1; font-size: 12.5px; color: var(--text-dim); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.window.focused .win-title { color: var(--text); }
.wc {
  width: 40px; height: 30px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  opacity: 0.9;
}
.wc:hover { background: var(--hover); color: var(--text); }
.wc-close:hover { background: #e5484d; color: #fff; }
.wc svg { width: 11px; height: 11px; fill: currentColor; }

.win-content { flex: 1; min-height: 0; position: relative; background: transparent; }
.win-content iframe {
  width: 100%; height: 100%; border: 0; display: block;
  background: var(--panel);
}

.window.glass-auth .win-content iframe { background: var(--bg); }

.wh { position: absolute; z-index: 5; }
.wh-n { top: -4px; left: 8px; right: 8px; height: 8px; cursor: n-resize; }
.wh-s { bottom: -4px; left: 8px; right: 8px; height: 8px; cursor: s-resize; }
.wh-e { right: -4px; top: 8px; bottom: 8px; width: 8px; cursor: e-resize; }
.wh-w { left: -4px; top: 8px; bottom: 8px; width: 8px; cursor: w-resize; }
.wh-ne { top: -5px; right: -5px; width: 12px; height: 12px; cursor: ne-resize; }
.wh-nw { top: -5px; left: -5px; width: 12px; height: 12px; cursor: nw-resize; }
.wh-se { bottom: -5px; right: -5px; width: 12px; height: 12px; cursor: se-resize; }
.wh-sw { bottom: -5px; left: -5px; width: 12px; height: 12px; cursor: sw-resize; }

/* Snap preview */
#snap-preview {
  position: absolute; z-index: 60; display: none;
  border-radius: 14px; background: var(--accent-soft);
  border: 1.5px solid var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
  pointer-events: none;
}
#snap-preview.snap-left { display: block; left: 8px; top: 8px; bottom: 8px; width: 50%; }
#snap-preview.snap-right { display: block; right: 8px; top: 8px; bottom: 8px; width: 50%; }
#snap-preview.snap-full { display: block; inset: 8px; }

.window.fade-in { animation: winin 0.25s cubic-bezier(0.2, 0.9, 0.3, 1); }
@keyframes winin { from { opacity: 0; transform: scale(0.92) translateY(12px); } }

/* ==========================================================================
   Taskbar
   ========================================================================== */
#taskbar {
  position: fixed; left: 0; right: 0; top: 0; height: var(--tb-h); z-index: 90;
  display: flex; align-items: stretch;
  padding: 0 8px;
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
  background: var(--tb-bg);
  border-bottom: 1px solid var(--stroke);
}
#tb-center, #tb-end { display: flex; align-items: center; gap: 3px; }
#tb-center { flex: 1; min-width: 0; justify-content: center; }
#tb-end { margin-left: auto; padding-right: 4px; }

.tb-btn {
  height: 40px; padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 8px;
}
.tb-btn:hover { background: var(--hover); }
.tb-btn:active { background: var(--hover-2); }
.tb-btn img { width: 20px; height: 20px; }

.tb-pin { position: relative; width: 42px; height: 40px; padding: 0; }
.tb-pin img { width: 24px; height: 24px; }
.tb-run { position: relative; width: 42px; height: 40px; padding: 0; }
.tb-run img { width: 21px; height: 21px; transform: scale(0.9); }
.tb-run .ind {
  position: absolute; left: 50%; bottom: 3px; transform: translateX(-45%);
  width: 6px; height: 2px; border-radius: 2px; background: var(--text-dim);
  transition: width 0.18s ease;
}
.tb-run.open .ind { background: var(--accent); width: 14px; }
.tb-run.active { background: var(--hover); }
.tb-run.active .ind { background: var(--accent); width: 28px; }
.tb-sep { width: 1px; height: 24px; background: var(--stroke); margin: 0 5px; }

#tb-flag img { width: 20px; height: 20px; }
#tb-clock {
  height: 100%; display: flex; flex-direction: column; justify-content: center;
  align-items: flex-end; padding: 0 8px; border-radius: 8px; font-size: 12px;
  line-height: 1.3; cursor: default; letter-spacing: 0.1px;
}
#tb-clock:hover { background: var(--hover); }
#tb-clock .tb-time { font-weight: 600; }
#tb-clock .tb-date { color: var(--text-dim); font-size: 11px; }

.tray-pop { position: absolute; right: 8px; top: calc(var(--tb-h) + 6px); z-index: 96;
  width: 320px; border-radius: var(--radius-lg);
  background: var(--glass-2); -webkit-backdrop-filter: blur(30px) saturate(160%);
  backdrop-filter: blur(30px) saturate(160%);
  box-shadow: var(--pop-shadow); border: 1px solid var(--stroke);
  overflow: hidden; transform-origin: top right;
  animation: pop 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
@keyframes pop { from { opacity: 0; transform: scale(0.9) translateY(-6px); } }
.tray-pop .pop-head { padding: 14px 16px 4px; font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }

/* Calendar / time panel */
#cal-panel .cal-top { padding: 16px 18px 6px; }
#cal-panel .cal-time { font-size: 34px; font-weight: 700; letter-spacing: -1px; }
#cal-panel .cal-date-lbl { color: var(--text-dim); margin-top: 2px; }
#cal-panel .cal-body { padding: 6px 14px 14px; }
.minical { width: 100%; border-collapse: collapse; }
.minical th { font-size: 10px; color: var(--text-dim); font-weight: 600; padding: 4px 0; }
.minical td { text-align: center; padding: 5px 0; }
.minical button { font-size: 11.5px; width: 30px; height: 30px; border-radius: 50%; }
.minical button:hover { background: var(--hover); }
.minical button.today { background: var(--accent); color: #fff; }
.minical button.other { color: var(--text-dim); opacity: 0.5; }
.cal-actions { display: flex; gap: 8px; padding: 10px 16px 14px; }
.cal-actions button { flex: 1; height: 34px; border-radius: 8px; background: var(--field); }
.cal-actions button:hover { background: var(--field-2); }

/* Status sliders */
.slider-row { padding: 4px 16px 14px; }
.slider-row .sr-title { font-size: 11px; color: var(--text-dim); margin: 10px 0 6px; display: flex; justify-content: space-between; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 4px; background: var(--field-2); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
body[data-theme="light"] input[type="range"]::-webkit-slider-thumb { background: #1b2330; }

/* ==========================================================================
   Start menu
   ========================================================================== */
#startmenu {
  position: fixed; top: calc(var(--tb-h) + 8px); left: 8px; z-index: 92;
  width: min(600px, calc(100vw - 20px));
  height: min(600px, calc(100vh - var(--tb-h) - 24px));
  max-height: calc(100vh - 16px);
  border-radius: 18px;
  background: var(--glass-2);
  -webkit-backdrop-filter: blur(34px) saturate(160%);
  backdrop-filter: blur(34px) saturate(160%);
  box-shadow: var(--win-shadow);
  border: 1px solid var(--stroke);
  display: flex; flex-direction: column;
  overflow: hidden;
  transform-origin: top center;
  animation: startin 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.05);
}
#startmenu.closing { animation: startout 0.16s ease forwards; }
@keyframes startin { from { opacity: 0; transform: scale(0.75) translateY(-18px); } }
@keyframes startout { to { opacity: 0; transform: scale(0.85) translateY(-14px); } }

.sm-search { padding: 14px 16px 8px; }
.sm-search .sm-search-input {
  display: flex; align-items: center; gap: 9px;
  height: 40px; padding: 0 14px; border-radius: 10px;
  background: var(--field); font-size: 13px;
}
.sm-search .sm-search-input img { width: 16px; height: 16px; }
.sm-search .sm-search-input input { flex: 1; border: none; background: none; font-size: 13px; }

.sm-body { flex: 1; overflow-y: auto; padding: 8px 16px 4px; }
.sm-body h3 {
  font-size: 12px; font-weight: 600; color: var(--text-dim);
  margin: 14px 2px 8px; letter-spacing: 0.3px;
}
.sm-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.sm-app {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 10px 2px; border-radius: 10px;
}
.sm-app:hover { background: var(--hover); }
.sm-app img { width: 34px; height: 34px; }
.sm-app span { font-size: 11px; text-align: center; line-height: 1.2; color: var(--text-dim); }

.sm-list-app { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; width: 100%; box-sizing: border-box; }
.sm-list-app:hover { background: var(--hover); }
.sm-list-app img { width: 24px; height: 24px; }
.sm-list-app span { font-size: 12.5px; }

.sm-create { height: 26px; width: auto; padding: 0 12px; font-size: 11px;
  color: var(--accent); border: 1.5px solid var(--accent); border-radius: 14px; margin-top: 8px; }
.sm-create:hover { background: var(--accent-soft); }

.sm-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 10px 14px; border-top: 1px solid var(--stroke);
}
.sm-user {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px;
  border-radius: 8px;
}
.sm-user:hover { background: var(--hover); }
.sm-user .sm-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #3fd0ff, #8a5bff);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
}
.sm-user b { font-size: 12.5px; }

/* ==========================================================================
   Search overlay
   ========================================================================== */
#searchoverlay {
  position: fixed; left: 0; right: 0; top: 0; bottom: 0; z-index: 94;
  background: none;
}
#searchoverlay .so-scrim { position: absolute; inset: 0; background: transparent; }
#searchoverlay .so-panel {
  position: absolute; left: 50%; top: 8vh; transform: translateX(-50%);
  width: min(620px, calc(100vw - 24px));
  max-height: 70vh; display: flex; flex-direction: column;
  background: var(--glass-2);
  -webkit-backdrop-filter: blur(34px) saturate(160%);
  backdrop-filter: blur(34px) saturate(160%);
  border: 1px solid var(--stroke);
  border-radius: 18px; box-shadow: var(--win-shadow);
  overflow: hidden;
  animation: soin 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
@keyframes soin { from { opacity: 0; transform: translateX(-50%) scale(0.97) translateY(-10px); } }
.so-input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; }
.so-input img { width: 17px; height: 17px; }
.so-input input { flex: 1; border: none; background: none; font-size: 16px; }
.so-loaded { flex: 1; overflow-y: auto; padding: 4px 10px 14px; }
.so-group { margin: 8px 6px; }
.so-group h4 { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; margin: 12px 8px 4px; }
.so-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; }
.so-item:hover, .so-item.hot { background: var(--hover-2); }
.so-item img { width: 24px; height: 24px; }
.so-item .so-item-body { flex: 1; min-width: 0; }
.so-item .so-item-body b { font-size: 13px; font-weight: 600; display: block; }
.so-item .so-item-body span { font-size: 11px; color: var(--text-dim); }
.so-empty { text-align: center; color: var(--text-dim); padding: 30px 0; font-size: 13px; }

/* ==========================================================================
   Alt+Tab switcher
   ========================================================================== */
#alttab {
  position: fixed; inset: 0; z-index: 98;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
#alttab .at-wrap { display: flex; flex-wrap: wrap; gap: 16px; max-width: 720px; justify-content: center; padding: 24px; }
#alttab .at-card {
  width: 118px; height: 130px; border-radius: 14px;
  background: var(--glass-2); border: 1.5px solid transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  box-shadow: var(--pop-shadow);
  transition: transform 0.12s ease;
}
#alttab .at-card.sel { border-color: var(--accent); transform: translateY(-8px); background: #fff; }
body[data-theme="dark"] #alttab .at-card.sel { background: #2a3142; }
#alttab .at-card img { width: 40px; height: 40px; }
#alttab .at-card span { font-size: 11.5px; max-width: 100px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#alttab .at-empty { color: var(--text); font-size: 14px; background: var(--glass-2); padding: 18px 26px; border-radius: 14px; box-shadow: var(--pop-shadow); }

/* ==========================================================================
   Notifications
   ========================================================================== */
#notify-stack { position: fixed; right: 10px; top: 10px; z-index: 120; display: flex;
  flex-direction: column; gap: 8px; width: 340px; max-width: calc(100vw - 20px); }
.notify {
  display: flex; gap: 11px; padding: 12px 13px; border-radius: 12px;
  background: var(--glass-2);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  box-shadow: var(--pop-shadow); border: 1px solid var(--stroke);
  animation: norm 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.15);
  cursor: pointer;
}
@keyframes norm { from { opacity: 0; transform: translateX(60px); } }
.notify.dismiss { animation: notout 0.25s ease forwards; }
@keyframes notout { to { opacity: 0; transform: translateX(80px) scale(0.95); } }
.notify img { width: 26px; height: 26px; flex: 0 0 auto; }
.notify .n-body { flex: 1; min-width: 0; }
.notify .n-title { font-weight: 600; font-size: 12.5px; }
.notify .n-msg { font-size: 12px; color: var(--text-dim); margin-top: 2px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notify .n-time { font-size: 10.5px; color: var(--text-dim); margin-top: 5px; }
.notify .n-close { opacity: 0.6; width: 22px; height: 22px; border-radius: 6px; flex: 0 0 auto; }
.notify .n-close:hover { opacity: 1; background: var(--hover); }

.notify-center { position: absolute; right: 8px; top: calc(var(--tb-h) + 6px); z-index: 96;
  width: 340px; max-height: 60vh; border-radius: var(--radius-lg);
  background: var(--glass-2); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px);
  box-shadow: var(--pop-shadow); border: 1px solid var(--stroke);
  display: flex; flex-direction: column; overflow: hidden;
  animation: pop 0.18s ease;
}
.notify-center .nc-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--stroke); }
.notify-center .nc-head b { font-size: 13px; }
.notify-center .nc-clear { font-size: 11.5px; color: var(--accent); }
.notify-center .nc-list { flex: 1; overflow-y: auto; padding: 6px; }
.nc-item { display: flex; gap: 10px; padding: 9px; border-radius: 9px; }
.nc-item:hover { background: var(--hover); }
.nc-item img { width: 22px; height: 22px; flex: 0 0 auto; }
.nc-item .n-time { font-size: 10.5px; color: var(--text-dim); }
.nc-empty { text-align: center; color: var(--text-dim); padding: 26px 0; font-size: 12.5px; }

/* ==========================================================================
   Context menu
   ========================================================================== */
#contextmenu {
  position: fixed; z-index: 130; min-width: 208px; padding: 5px;
  border-radius: 10px;
  background: var(--glass-2);
  -webkit-backdrop-filter: blur(26px); backdrop-filter: blur(26px);
  box-shadow: var(--pop-shadow); border: 1px solid var(--stroke);
  animation: pop 0.12s ease;
}
#contextmenu.sep-top { border-top: 1px solid var(--stroke); }
.ctx-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  border-radius: 6px; font-size: 13px; position: relative; }
.ctx-item:hover { background: var(--hover-2); }
.ctx-item.disabled { opacity: 0.4; pointer-events: none; }
.ctx-item .cico { width: 16px; height: 16px; }
.ctx-item.kt:after { content: attr(data-k); margin-left: auto; font-size: 11px; color: var(--text-dim); }
.ctx-sep { height: 1px; background: var(--stroke); margin: 5px 8px; }
.ctx-sub { position: absolute; left: calc(100% - 4px); top: -6px; z-index: 140; display: none;
  min-width: 170px; padding: 5px; border-radius: 10px;
  background: var(--glass-2); -webkit-backdrop-filter: blur(26px); backdrop-filter: blur(26px);
  box-shadow: var(--pop-shadow); border: 1px solid var(--stroke); }
.ctx-item.sub:hover > .ctx-sub { display: block; }
.ctx-item.danger:hover { background: #e5484d; color: #fff; }

/* ==========================================================================
   Lock screen / power
   ========================================================================== */
#lock-screen { position: fixed; inset: 0; z-index: 300; }
.lock-bg { position: absolute; inset: 0; background: var(--bg) center / cover no-repeat;
  filter: blur(2px) saturate(1.1); transform: scale(1.05); }
#lock-screen::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.5), rgba(0,0,0,0.15));
}
.lock-inner { position: relative; z-index: 2; height: 100%; display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #fff; }
.lock-clock { font-size: clamp(58px, 9vw, 96px); font-weight: 700; letter-spacing: -2px; text-shadow: 0 2px 20px rgba(0,0,0,0.4); }
.lock-date { font-size: 17px; opacity: 0.9; }
.lock-avatar {
  width: 74px; height: 74px; border-radius: 50%; margin-top: 26px;
  background: linear-gradient(135deg, #3fd0ff, #8a5bff);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 700; border: 3px solid rgba(255,255,255,0.4);
}
.lock-hint { font-size: 13px; opacity: 0.7; margin-top: 10px; }
#lock-screen.gone { animation: lockslide 0.4s cubic-bezier(0.2, 0.9, 0.3, 1) forwards; }
@keyframes lockslide { to { opacity: 0; transform: translateY(-30px); } }

#power-overlay { position: fixed; inset: 0; z-index: 400; background: #000; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
#power-overlay .po-icon { width: 64px; height: 64px; opacity: 0.85; }
#power-overlay .po-msg { font-size: 15px; opacity: 0.85; }
#power-overlay .po-off { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px; background: #05070c; }
.po-power.on { width: 74px; height: 74px; border-radius: 50%;
  background: rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; }
.po-power.on svg { width: 34px; height: 34px; fill: #fff; opacity: 0.9; }
#power-overlay.fade { opacity: 0; transition: opacity 0.6s ease; }

/* ==========================================================================
   Tooltip
   ========================================================================== */
#tooltip { position: fixed; z-index: 200; padding: 5px 10px; border-radius: 6px;
  background: var(--glass-2); color: var(--text); font-size: 12px;
  box-shadow: var(--pop-shadow); border: 1px solid var(--stroke); pointer-events: none;
  white-space: nowrap; }

/* ==========================================================================
   Responsive / touch
   ========================================================================== */
@media (max-width: 760px) {
  .sm-grid { grid-template-columns: repeat(4, 1fr); }
  #taskbar { padding: 0 4px; }
  .tb-pin { width: 34px; height: 40px; }
  .tb-run { width: 34px; height: 40px; }
  .tb-btn { padding: 0 7px; }
}

@media (max-height: 560px) {
  .sm-grid { grid-template-columns: repeat(5, 1fr); }
}

body.touch .dicon img { width: 52px; height: 52px; }