/* Windows 11 Fluent-inspired desktop UI */
:root {
  --accent: #60cdff;
  --accent-deep: #0078d4;
  --mica: rgba(243, 243, 243, 0.72);
  --mica-dark: rgba(32, 32, 32, 0.78);
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #f3f3f3;
  --surface-elevated: rgba(255, 255, 255, 0.88);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.12);
  --text: #1a1a1a;
  --text-secondary: #5c5c5c;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-win: 0 16px 48px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --taskbar-h: 48px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --focus: 0 0 0 2px #fff, 0 0 0 4px var(--accent-deep);
}

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

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--text);
  background: #000;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font-family: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: transparent;
  color: inherit;
}

.hidden {
  display: none !important;
}

/* ========== Lock ========== */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.lock-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 20% 20%, rgba(96, 205, 255, 0.35), transparent 60%),
    radial-gradient(900px 500px at 80% 70%, rgba(0, 120, 212, 0.45), transparent 55%),
    linear-gradient(145deg, #0b1b33 0%, #123a5c 40%, #1a4d6e 70%, #0d2438 100%);
  filter: saturate(1.1);
}

.lock-content {
  position: relative;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.lock-time {
  font-size: clamp(64px, 12vw, 96px);
  font-weight: 300;
  letter-spacing: -2px;
  line-height: 1;
}

.lock-date {
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 400;
  margin-top: 8px;
  opacity: 0.95;
}

.lock-hint {
  margin-top: 48px;
  font-size: 14px;
  opacity: 0.75;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.9;
  }
}

/* ========== Login ========== */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  background:
    radial-gradient(800px 400px at 50% 30%, rgba(96, 205, 255, 0.2), transparent),
    linear-gradient(160deg, #0a1628, #0f2a45 50%, #0a1628);
}

.login-card {
  text-align: center;
  color: #fff;
  width: min(320px, 90vw);
}

.login-avatar {
  margin-bottom: 12px;
}

.login-name {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 20px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-form input {
  height: 36px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  padding: 0 12px;
  outline: none;
}

.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.login-btn {
  height: 36px;
  border-radius: 4px;
  background: var(--accent-deep);
  color: #fff;
  font-weight: 500;
  transition: background 0.15s;
}

.login-btn:hover {
  background: #106ebe;
}

.login-note {
  margin-top: 16px;
  font-size: 12px;
  opacity: 0.65;
}

/* ========== Desktop ========== */
.desktop {
  position: fixed;
  inset: 0;
  z-index: 1;
}

.desktop-wallpaper {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(0, 30, 10, 0.94), rgba(0, 8, 2, 0.98)),
    repeating-linear-gradient(0deg, rgba(0, 255, 102, 0.04) 0px, rgba(0, 255, 102, 0.04) 1px, transparent 1px, transparent 3px),
    repeating-linear-gradient(90deg, rgba(0, 255, 102, 0.04) 0px, rgba(0, 255, 102, 0.04) 1px, transparent 1px, transparent 3px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.2s ease;
}

.wallpaper-logo {
  font-family: monospace;
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 700;
  color: #00ff66;
  text-shadow: 0 0 8px rgba(0, 255, 102, 0.6), 0 0 20px rgba(0, 255, 102, 0.4), 0 0 40px rgba(0, 255, 102, 0.2);
  letter-spacing: 0.8rem;
  opacity: 0.25;
  user-select: none;
  text-transform: uppercase;
}

.desktop-icons {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
  max-height: calc(100% - var(--taskbar-h) - 24px);
  z-index: 2;
}

.desk-icon {
  width: 76px;
  padding: 6px 4px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  border: 1px solid transparent;
}

.desk-icon:hover {
  background: rgba(255, 255, 255, 0.12);
}

.desk-icon.selected {
  background: rgba(0, 120, 212, 0.35);
  border-color: rgba(255, 255, 255, 0.35);
}

.desk-icon .ico {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 28px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.desk-icon .label {
  font-size: 12px;
  text-align: center;
  line-height: 1.25;
  max-width: 72px;
  word-break: break-word;
}

/* ========== Windows ========== */
.windows-layer {
  position: absolute;
  inset: 0 0 var(--taskbar-h) 0;
  z-index: 10;
  pointer-events: none;
}

.window {
  position: absolute;
  min-width: 320px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  background: var(--surface-elevated);
  backdrop-filter: blur(40px) saturate(1.4);
  -webkit-backdrop-filter: blur(40px) saturate(1.4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-win);
  overflow: hidden;
  pointer-events: auto;
  z-index: 20;
  animation: win-in 0.16s ease-out;
}

@keyframes win-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.window.maximized {
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
  border-radius: 0;
  border: none;
}

.window.minimized {
  display: none !important;
}

.window.active {
  box-shadow: var(--shadow-win), 0 0 0 1px rgba(0, 120, 212, 0.25);
}

.titlebar {
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 4px 0 12px;
  gap: 8px;
  background: rgba(255, 255, 255, 0.35);
  border-bottom: 1px solid var(--border);
  cursor: default;
  flex-shrink: 0;
}

.titlebar .win-icon {
  font-size: 14px;
}

.titlebar .win-title {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.titlebar-controls {
  display: flex;
  height: 100%;
}

.titlebar-controls button {
  width: 46px;
  height: 100%;
  display: grid;
  place-items: center;
  transition: background 0.12s;
}

.titlebar-controls button:hover {
  background: rgba(0, 0, 0, 0.06);
}

.titlebar-controls .close:hover {
  background: #e81123;
  color: #fff;
}

.window-body {
  flex: 1;
  overflow: auto;
  background: #fff;
  min-height: 0;
}

.window.resizing,
.window.dragging {
  user-select: none;
}

.resize-handle {
  position: absolute;
  z-index: 5;
}

.resize-handle.n {
  top: 0;
  left: 8px;
  right: 8px;
  height: 4px;
  cursor: n-resize;
}
.resize-handle.s {
  bottom: 0;
  left: 8px;
  right: 8px;
  height: 4px;
  cursor: s-resize;
}
.resize-handle.e {
  right: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  cursor: e-resize;
}
.resize-handle.w {
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  cursor: w-resize;
}
.resize-handle.ne {
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  cursor: ne-resize;
}
.resize-handle.nw {
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  cursor: nw-resize;
}
.resize-handle.se {
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  cursor: se-resize;
}
.resize-handle.sw {
  bottom: 0;
  left: 0;
  width: 10px;
  height: 10px;
  cursor: sw-resize;
}

/* App content shared */
.app-pad {
  padding: 16px 20px;
}

.app-hero {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 8px;
}

.app-muted {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0 0 16px;
}

/* Explorer */
.explorer {
  display: grid;
  grid-template-columns: 200px 1fr;
  height: 100%;
}

.explorer-nav {
  background: #f9f9f9;
  border-right: 1px solid var(--border);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.explorer-nav button {
  text-align: left;
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.explorer-nav button:hover,
.explorer-nav button.active {
  background: rgba(0, 0, 0, 0.05);
}

.explorer-nav button.active {
  background: rgba(0, 120, 212, 0.12);
  font-weight: 500;
}

.explorer-main {
  padding: 12px 16px;
  overflow: auto;
}

.explorer-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.explorer-path {
  flex: 1;
  height: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 0 10px;
  font-size: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  color: var(--text-secondary);
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.file-item {
  padding: 10px 6px;
  border-radius: 4px;
  text-align: center;
  font-size: 12px;
  border: 1px solid transparent;
}

.file-item:hover {
  background: rgba(0, 120, 212, 0.08);
}

.file-item .fi {
  font-size: 32px;
  margin-bottom: 4px;
}

/* Settings */
.settings {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100%;
}

.settings-nav {
  background: #f3f3f3;
  padding: 16px 12px;
  border-right: 1px solid var(--border);
}

.settings-nav h2 {
  font-size: 20px;
  margin: 0 0 16px 8px;
  font-weight: 600;
}

.settings-nav button {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 2px;
}

.settings-nav button:hover,
.settings-nav button.active {
  background: rgba(0, 0, 0, 0.06);
}

.settings-nav button.active {
  background: rgba(0, 120, 212, 0.12);
  font-weight: 500;
}

.settings-content {
  padding: 24px 28px;
  overflow: auto;
}

.settings-card {
  background: #f9f9f9;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.settings-card .sc-title {
  font-size: 14px;
  font-weight: 500;
}

.settings-card .sc-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.toggle {
  width: 40px;
  height: 20px;
  border-radius: 10px;
  background: #ccc;
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s;
}

.toggle.on {
  background: var(--accent-deep);
}

.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle.on::after {
  transform: translateX(20px);
}

/* Notepad */
.notepad {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.notepad-menu {
  display: flex;
  gap: 2px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  font-size: 12px;
}

.notepad-menu span {
  padding: 4px 8px;
  border-radius: 4px;
}

.notepad-menu span:hover {
  background: rgba(0, 0, 0, 0.05);
}

.notepad textarea {
  flex: 1;
  border: none;
  resize: none;
  padding: 12px 16px;
  font-family: "Cascadia Code", "Consolas", "Segoe UI", monospace;
  font-size: 14px;
  outline: none;
  line-height: 1.5;
}

/* Browser */
.browser {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.browser-bar {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: #f3f3f3;
  align-items: center;
}

.browser-bar .nav-btns {
  display: flex;
  gap: 2px;
}

.browser-bar .nav-btns button {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  font-size: 14px;
}

.browser-bar .nav-btns button:hover {
  background: rgba(0, 0, 0, 0.06);
}

.browser-url {
  flex: 1;
  height: 32px;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: #fff;
  padding: 0 14px;
  font-size: 13px;
  outline: none;
}

.browser-url:focus {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 1px var(--accent-deep);
}

.browser-page {
  flex: 1;
  overflow: auto;
  padding: 32px;
  background: linear-gradient(180deg, #e8f4ff 0%, #fff 40%);
}

.browser-page h1 {
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--accent-deep);
}

.browser-page p {
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.55;
}

.browser-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.browser-links a,
.browser-links button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border-strong);
  font-size: 13px;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.browser-links a:hover,
.browser-links button:hover {
  border-color: var(--accent-deep);
  color: var(--accent-deep);
}

/* Calculator */
.calc {
  max-width: 280px;
  margin: 0 auto;
  padding: 12px;
}

.calc-display {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 16px;
  text-align: right;
  font-size: 32px;
  font-weight: 500;
  margin-bottom: 10px;
  min-height: 64px;
  word-break: break-all;
}

.calc-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.calc-keys button {
  height: 48px;
  border-radius: 6px;
  background: #f3f3f3;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.1s;
}

.calc-keys button:hover {
  background: #e5e5e5;
}

.calc-keys button.op {
  background: #e8f4ff;
  color: var(--accent-deep);
}

.calc-keys button.eq {
  background: var(--accent-deep);
  color: #fff;
}

.calc-keys button.eq:hover {
  background: #106ebe;
}

/* Terminal */
.term {
  background: #0c0c0c;
  color: #cccccc;
  height: 100%;
  padding: 12px 14px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  overflow: auto;
}

.term .prompt {
  color: #16c60c;
}

.term input {
  background: transparent;
  border: none;
  color: #fff;
  outline: none;
  font: inherit;
  width: calc(100% - 2ch);
}

/* ========== Taskbar ========== */
.taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--taskbar-h);
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 8px;
  background: rgba(243, 243, 243, 0.78);
  backdrop-filter: blur(40px) saturate(1.5);
  -webkit-backdrop-filter: blur(40px) saturate(1.5);
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.04);
}

.taskbar-left {
  display: flex;
  justify-content: flex-start;
}

.taskbar-center {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
}

.taskbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.tb-btn {
  height: 40px;
  min-width: 40px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
  position: relative;
}

.tb-btn:hover,
.tb-btn.active {
  background: rgba(255, 255, 255, 0.65);
}

.tb-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.start-btn .win-logo {
  color: var(--accent-deep);
}

.taskbar-apps {
  display: flex;
  gap: 2px;
  align-items: center;
}

.tb-app {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 18px;
  position: relative;
}

.tb-app:hover {
  background: rgba(255, 255, 255, 0.65);
}

.tb-app.open::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 3px;
  border-radius: 2px;
  background: var(--text-secondary);
}

.tb-app.active::after {
  width: 16px;
  background: var(--accent-deep);
}

.sys-tray {
  padding: 0 8px;
  gap: 6px;
}

.tray-icons {
  display: flex;
  gap: 4px;
  font-size: 13px;
}

.clock-btn {
  flex-direction: column;
  align-items: flex-end;
  padding: 0 10px;
  min-width: 70px;
  line-height: 1.15;
  font-size: 12px;
}

.show-desktop {
  width: 6px !important;
  min-width: 6px !important;
  height: 40px;
  border-radius: 0;
  border-left: 1px solid rgba(0, 0, 0, 0.12);
  margin-left: 4px;
}

.show-desktop:hover {
  background: rgba(0, 120, 212, 0.25);
}

/* ========== Flyouts / Start ========== */
.start-menu,
.flyout {
  position: absolute;
  z-index: 90;
  background: rgba(243, 243, 243, 0.88);
  backdrop-filter: blur(48px) saturate(1.6);
  -webkit-backdrop-filter: blur(48px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: fly-in 0.14s ease-out;
}

@keyframes fly-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.start-menu {
  bottom: calc(var(--taskbar-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 24px));
  max-height: min(720px, calc(100vh - var(--taskbar-h) - 40px));
  padding: 20px 24px 0;
  display: flex;
  flex-direction: column;
}

.start-menu.hidden {
  display: none !important;
}

.start-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  height: 40px;
  padding: 0 14px;
  margin-bottom: 18px;
  color: var(--text-secondary);
}

.start-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
}

.start-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  padding: 0 4px;
}

.start-all-btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.04);
}

.start-all-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

.start-pinned {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-bottom: 18px;
}

.start-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border-radius: 6px;
  font-size: 12px;
}

.start-app:hover {
  background: rgba(255, 255, 255, 0.7);
}

.start-app .ico {
  font-size: 28px;
}

.start-recommended {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 12px;
  max-height: 140px;
  overflow: auto;
}

.rec-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  text-align: left;
  font-size: 13px;
}

.rec-item:hover {
  background: rgba(255, 255, 255, 0.7);
}

.rec-item .ico {
  font-size: 20px;
}

.rec-item small {
  display: block;
  color: var(--text-secondary);
  font-size: 11px;
}

.start-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 8px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.03);
  margin: 0 -24px;
  padding-left: 28px;
  padding-right: 20px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.start-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
}

.start-user:hover,
.start-power:hover {
  background: rgba(0, 0, 0, 0.06);
}

.avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
}

.start-power {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  display: grid;
  place-items: center;
}

/* Search / widgets / qs / calendar */
.search-panel {
  bottom: calc(var(--taskbar-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 24px));
  padding: 16px 20px 20px;
}

.flyout-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.search-panel input {
  width: 100%;
  height: 40px;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  padding: 0 16px;
  font-size: 14px;
  outline: none;
  margin-bottom: 12px;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 320px;
  overflow: auto;
}

.search-hit {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  text-align: left;
  font-size: 13px;
}

.search-hit:hover {
  background: rgba(255, 255, 255, 0.7);
}

.widgets-panel {
  bottom: calc(var(--taskbar-h) + 12px);
  left: 12px;
  width: min(420px, calc(100vw - 24px));
  padding: 16px;
}

.widget-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.widget {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  padding: 14px;
  border: 1px solid var(--border);
}

.widget-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.widget-big {
  font-size: 36px;
  font-weight: 300;
}

.widget-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

.widget-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
}

.widget-row .up {
  color: #0f7b0f;
}
.widget-row .down {
  color: #c42b1c;
}

.widget.news ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
}

.quick-settings {
  bottom: calc(var(--taskbar-h) + 12px);
  right: 12px;
  width: min(360px, calc(100vw - 24px));
  padding: 16px;
}

.qs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.qs-tile {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  min-height: 72px;
}

.qs-tile:hover {
  background: rgba(255, 255, 255, 0.9);
}

.qs-tile.active {
  background: rgba(0, 120, 212, 0.18);
  border-color: rgba(0, 120, 212, 0.35);
  color: var(--accent-deep);
  font-weight: 500;
}

.qs-icon {
  font-size: 18px;
}

.qs-sliders {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qs-sliders label {
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-secondary);
}

.qs-sliders input[type="range"] {
  width: 100%;
  accent-color: var(--accent-deep);
}

.calendar-flyout {
  bottom: calc(var(--taskbar-h) + 12px);
  right: 12px;
  width: min(320px, calc(100vw - 24px));
  padding: 16px;
}

.cal-time {
  font-size: 28px;
  font-weight: 300;
}

.cal-date {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
  font-size: 12px;
}

.cal-grid .hd {
  color: var(--text-secondary);
  font-weight: 600;
  padding: 6px 0;
}

.cal-grid .day {
  padding: 8px 0;
  border-radius: 50%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.cal-grid .day.today {
  background: var(--accent-deep);
  color: #fff;
  font-weight: 600;
}

.cal-grid .day.muted {
  opacity: 0.35;
}

/* Context menu */
.context-menu {
  position: fixed;
  z-index: 200;
  min-width: 200px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.context-menu li {
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}

.context-menu li:hover {
  background: rgba(0, 0, 0, 0.06);
}

.context-menu li.sep {
  height: 1px;
  padding: 0;
  margin: 4px 8px;
  background: var(--border);
  pointer-events: none;
}

.context-menu li.danger {
  color: #c42b1c;
}

/* Toasts */
.toasts {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 280px;
  max-width: 360px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  pointer-events: auto;
  animation: fly-in 0.2s ease-out;
}

.toast strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}

.toast span {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 720px) {
  .start-pinned {
    grid-template-columns: repeat(4, 1fr);
  }
  .start-recommended {
    grid-template-columns: 1fr;
  }
  .explorer,
  .settings {
    grid-template-columns: 1fr;
  }
  .explorer-nav,
  .settings-nav {
    display: none;
  }
  .taskbar-left {
    display: none;
  }
  .window {
    min-width: 240px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- RUN DIALOG --- */
.run-dialog {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface-solid);
  height: 100%;
}
.run-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.run-icon {
  font-size: 32px;
}
.run-header p {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}
.run-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.run-input-row label {
  font-size: 12px;
}
.run-input-row input {
  flex: 1;
  height: 28px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  color: var(--text);
  padding: 0 8px;
  outline: none;
}
.run-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: auto;
}
.run-actions button {
  padding: 6px 18px;
  border: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  border-radius: 4px;
  font-size: 12px;
  transition: all 0.1s;
}
.run-actions button:hover {
  background: var(--accent-deep);
  color: #fff;
  border-color: var(--accent-deep);
}

/* --- TASK MANAGER --- */
.taskmgr {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface-solid);
}
.taskmgr-tabs {
  display: flex;
  background: var(--border);
  border-bottom: 1px solid var(--border-strong);
  flex-shrink: 0;
}
.taskmgr-tab {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.taskmgr-tab.active {
  border-bottom-color: var(--accent-deep);
  background: var(--surface-elevated);
}
.taskmgr-pane {
  flex: 1;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.taskmgr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}
.taskmgr-table th, .taskmgr-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.taskmgr-table th {
  font-weight: 600;
  background: var(--border);
}
.taskmgr-table tr:hover {
  background: rgba(0, 120, 212, 0.05);
}
.end-task-btn {
  background: #c42b1c;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
}
.end-task-btn:hover {
  background: #a82015;
}
.perf-graph-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.perf-card {
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 12px;
  background: var(--surface-elevated);
}
.perf-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}
.perf-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-deep);
  margin-bottom: 8px;
}
.perf-bar-bg {
  height: 12px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.perf-bar-fill {
  height: 100%;
  background: var(--accent-deep);
  width: 0%;
  transition: width 1s ease;
}

/* --- MINESWEEPER --- */
.minesweeper {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  background: var(--surface-solid);
  height: 100%;
  user-select: none;
}
.mines-header {
  display: flex;
  justify-content: space-between;
  width: 220px;
  background: var(--border);
  padding: 6px 12px;
  border-radius: 4px;
  margin-bottom: 12px;
  font-family: monospace;
  font-size: 16px;
  font-weight: bold;
}
.mines-smile {
  cursor: pointer;
}
.mines-grid {
  display: grid;
  grid-template-columns: repeat(9, 24px);
  grid-template-rows: repeat(9, 24px);
  gap: 1px;
  background: var(--border-strong);
  border: 2px solid var(--border-strong);
  border-radius: 4px;
}
.mines-cell {
  width: 24px;
  height: 24px;
  background: var(--surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
  cursor: pointer;
}
.mines-cell.revealed {
  background: var(--border);
  cursor: default;
}
.mines-cell.bomb {
  background: #ff5f56;
}
.mines-cell.c1 { color: #0078d4; }
.mines-cell.c2 { color: #107c41; }
.mines-cell.c3 { color: #a80000; }
.mines-cell.c4 { color: #002050; }

/* --- PAINT --- */
.paint {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface-solid);
}
.paint-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--border);
  border-bottom: 1px solid var(--border-strong);
  flex-shrink: 0;
}
.paint-tool {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  border: 1px solid transparent;
}
.paint-tool.active {
  background: var(--surface-elevated);
  border-color: var(--border-strong);
}
.paint-colors {
  display: flex;
  gap: 4px;
}
.paint-color {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.2);
  cursor: pointer;
}
.paint-color.active {
  transform: scale(1.2);
  box-shadow: 0 0 0 2px var(--accent-deep);
}
.paint-canvas-container {
  flex: 1;
  overflow: auto;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border-strong);
  min-height: 0;
}
.paint-canvas {
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  cursor: crosshair;
}

/* --- DARK MODE OVERRIDES --- */
body.dark-mode {
  --mica: rgba(32, 32, 32, 0.72);
  --surface: rgba(45, 45, 45, 0.72);
  --surface-solid: #202020;
  --surface-elevated: rgba(32, 32, 32, 0.88);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --text-secondary: #c3c3c3;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-win: 0 16px 48px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .desktop-wallpaper {
  background:
    radial-gradient(circle at center, rgba(20, 0, 40, 0.95), rgba(8, 0, 15, 0.98)),
    repeating-linear-gradient(0deg, rgba(230, 0, 255, 0.04) 0px, rgba(230, 0, 255, 0.04) 1px, transparent 1px, transparent 3px),
    repeating-linear-gradient(90deg, rgba(230, 0, 255, 0.04) 0px, rgba(230, 0, 255, 0.04) 1px, transparent 1px, transparent 3px);
}

body.dark-mode .wallpaper-logo {
  color: #ff00ff;
  text-shadow: 0 0 8px rgba(255, 0, 255, 0.7), 0 0 20px rgba(255, 0, 255, 0.5), 0 0 40px rgba(255, 0, 255, 0.3);
}

body.dark-mode .window-body {
  background: #1f1f1f;
  color: #fff;
}

body.dark-mode .titlebar {
  background: rgba(32, 32, 32, 0.35);
}

body.dark-mode .titlebar-controls button:hover {
  background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .explorer-nav,
body.dark-mode .settings-nav {
  background: rgba(45, 45, 45, 0.4);
}

body.dark-mode .explorer-nav button:hover,
body.dark-mode .settings-nav button:hover {
  background: rgba(255, 255, 255, 0.06);
}

body.dark-mode .explorer-nav button.active,
body.dark-mode .settings-nav button.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent);
}

body.dark-mode .settings-card {
  background: rgba(255, 255, 255, 0.04);
}

body.dark-mode .settings-card:hover {
  background: rgba(255, 255, 255, 0.07);
}

body.dark-mode .browser-bar {
  background: rgba(32, 32, 32, 0.9);
}

body.dark-mode .browser-url {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode .browser-page {
  background: #1e1e1e;
  color: #fff;
}

body.dark-mode .notepad textarea {
  background: #1e1e1e;
  color: #fff;
}

body.dark-mode .notepad-menu {
  background: rgba(32, 32, 32, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .term {
  background: #0c0c0c;
  color: #dfdfdf;
}

body.dark-mode #term-input {
  color: #dfdfdf;
}

body.dark-mode .calc-display {
  background: #2b2b2b;
  color: #fff;
}

body.dark-mode .calc-keys button {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

body.dark-mode .calc-keys button:hover {
  background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .calc-keys button.op {
  background: rgba(255, 255, 255, 0.09);
  color: var(--accent);
}

body.dark-mode .calc-keys button.op:hover {
  background: rgba(255, 255, 255, 0.15);
}

body.dark-mode .calc-keys button.eq {
  background: var(--accent-deep);
  color: #fff;
}

body.dark-mode .calc-keys button.eq:hover {
  background: #106ebe;
}

body.dark-mode .start-menu,
body.dark-mode .flyout {
  background: rgba(32, 32, 32, 0.85);
  border-color: rgba(255, 255, 255, 0.15);
}

body.dark-mode .taskbar {
  background: rgba(32, 32, 32, 0.75);
  border-top-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .context-menu {
  background: rgba(45, 45, 45, 0.9);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode .context-menu li:hover {
  background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .toast {
  background: rgba(32, 32, 32, 0.95);
  color: #fff;
}
