:root {
  --win11-bg: #1a1a1a;
  --win11-surface: #242424;
  --win11-surface-hover: #2e2e2e;
  --win11-surface-active: #333333;
  --win11-accent: #60cdff;
  --win11-accent-hover: #80d8ff;
  --win11-accent-dim: rgba(96, 205, 255, 0.1);
  --win11-text: #e8e8e8;
  --win11-text-secondary: #999999;
  --win11-text-dim: #666666;
  --win11-border: #383838;
  --win11-titlebar: #1e1e1e;
  --win11-taskbar-bg: rgba(26, 26, 26, 0.85);
  --taskbar-button: rgba(255, 255, 255, .045);
  --taskbar-button-hover: rgba(255, 255, 255, .08);
  --win11-taskbar-border: rgba(255, 255, 255, 0.04);
  --win11-radius: 8px;
  --win11-radius-sm: 4px;
  --win11-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  --win11-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --taskbar-height: 48px;
  --font-win: 'Segoe UI Variable', 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: var(--font-win);
  color: var(--win11-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#app {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
}

/* ========== DESKTOP ========== */
.win11-desktop {
  width: calc(100vw - 64px);
  height: calc(100vh - 64px);
  max-width: none;
  max-height: none;
  position: relative;
  overflow: hidden;
  background: var(--win11-bg);
  border: 1px solid var(--win11-border);
  border-radius: 4px;
}

.desktop-wallpaper {
  position: absolute;
  inset: 0;
  background: url('../Assets/Wallpaper dark green.avif') center/cover no-repeat;
  z-index: 0;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.desktop-wallpaper-overlay {
  position: absolute;
  inset: 0;
  background: center/cover no-repeat;
  z-index: 1;
  transition: opacity 0.4s ease, filter 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.desktop-wallpaper.is-blurred,
.desktop-wallpaper-overlay.is-blurred {
  filter: blur(8px);
  transform: scale(1.04);
}

.desktop-area {
  --desktop-icon-grid-origin-x: 8px;
  --desktop-icon-grid-origin-y: 16px;
  --desktop-icon-grid-step-x: 100px;
  --desktop-icon-grid-step-y: 108px;
  position: absolute;
  inset: 0;
  bottom: var(--taskbar-height);
  z-index: 1;
}

/* ========== DESKTOP ICONS ========== */
.desktop-icons {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  padding: 16px 8px;
  gap: 4px;
  max-height: 100%;
  width: max-content;
}

.desktop-icons-right {
  position: absolute;
  top: 16px;
  right: 8px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, 100px);
  width: max-content;
  max-height: none;
  padding: 0;
  gap: 4px;
}

.desktop-icons-right [data-icon-id="dailyquest-next"] {
  grid-column: 2;
  grid-row: 1;
}

.desktop-icons-right [data-icon-id="sandbox"] {
  grid-column: 1;
  grid-row: 1;
}

.desktop-icons-right [data-icon-id="wrapt"] {
  grid-column: 2;
  grid-row: 2;
}

.desktop-icons-right [data-icon-id="again"] {
  grid-column: 1;
  grid-row: 2;
}

.desktop-icon[data-icon-id="sandbox"] img {
  border-radius: 22%;
}

.desktop-loose-files {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: auto;
}

.desktop-loose-files .desktop-icon {
  pointer-events: auto;
}

.desktop-loose-file-readme,
.desktop-loose-file-skills {
  position: static;
}

.desktop-loose-files .desktop-icon:hover,
.desktop-loose-files .desktop-icon.selected {
  transform: none;
}

.desktop-selection-rect {
  position: absolute;
  z-index: 5;
  background: rgba(96, 205, 255, 0.12);
  border: 1px solid rgba(96, 205, 255, 0.65);
  pointer-events: none;
}

.desktop-icon-dragging {
  z-index: 5;
  opacity: 0.9;
  pointer-events: none;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: var(--win11-radius-sm);
  cursor: pointer;
  width: 92px;
  min-height: 80px;
  transition: background 0.1s;
  user-select: none;
  -webkit-user-select: none;
}

.desktop-area.desktop-icons-free > .desktop-icons:not(.desktop-icons-right),
.desktop-area.desktop-icons-free > .desktop-loose-files {
  position: static;
  inset: auto;
  display: block;
  width: 0;
  height: 0;
  max-height: none;
  padding: 0;
  overflow: visible;
  pointer-events: none;
}

.desktop-icon-positioned {
  position: absolute;
  z-index: 2;
  pointer-events: auto;
}

.desktop-icon:hover {
  background: rgba(255, 255, 255, 0.06);
}

.desktop-icon.selected {
  background: rgba(96, 205, 255, 0.15);
  outline: 1px solid rgba(96, 205, 255, 0.3);
  outline-offset: -1px;
}

.desktop-icon svg {
  flex-shrink: 0;
  opacity: 0.9;
}

.desktop-icon img {
  flex-shrink: 0;
  object-fit: contain;
  -webkit-user-drag: none;
}

.desktop-icon:focus-visible {
  outline: 1px solid var(--win11-accent);
  outline-offset: -1px;
}

.desktop-icon-label {
  font-size: 11px;
  color: var(--win11-text);
  text-align: center;
  line-height: 1.3;
  word-wrap: break-word;
  max-width: 100%;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

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

/* ========== WINDOW ========== */
.win11-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--win11-surface);
  border: 1px solid var(--win11-border);
  border-radius: var(--win11-radius);
  overflow: hidden;
  box-shadow: var(--win11-shadow);
  pointer-events: all;
  transition: box-shadow 0.15s;
  min-width: 320px;
  min-height: 200px;
}

.win11-window.focused {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  border-color: rgba(96, 205, 255, 0.15);
}

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

.win11-window.maximized .window-resize-handle {
  display: none;
}

.win11-window.maximized {
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
}

.win11-window.minimized, .win11-window.closing { pointer-events: none; }

.window-titlebar {
  display: flex;
  align-items: center;
  height: 32px;
  background: var(--win11-titlebar);
  padding: 0 4px 0 12px;
  flex-shrink: 0;
  cursor: default;
  touch-action: none;
}

.window-title-icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  flex-shrink: 0;
}

.window-title-icon img {
  width: 16px !important;
  height: 16px !important;
}

.window-title-text {
  font-size: 12px;
  color: var(--win11-text-secondary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window-controls {
  display: flex;
  gap: 0;
  margin-left: auto;
}

.window-btn {
  width: 46px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--win11-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  transition: background 0.1s;
}

.window-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--win11-text);
}

.window-btn-close:hover {
  background: #c42b1c;
  color: #fff;
}

.window-btn svg {
  width: 10px;
  height: 10px;
}

.window-content {
  flex: 1;
  overflow: hidden;
  display: flex;
}

/* ========== TASKBAR ========== */
.win11-taskbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--taskbar-height);
  background: var(--win11-taskbar-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--win11-taskbar-border);
  display: flex;
  align-items: center;
  z-index: 200;
  padding: 0 8px;
  padding-bottom: var(--safe-bottom);
}

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

.taskbar-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: safe center;
  min-width: 0;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
}

.taskbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

.taskbar-start-btn {
  width: 40px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: var(--win11-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.taskbar-start-btn:focus-visible,
.taskbar-github-btn:focus-visible,
.taskbar-app-btn:focus-visible,
.start-menu-app:focus-visible {
  outline: 1px solid var(--win11-accent);
  outline-offset: -2px;
}

.taskbar-start-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.taskbar-start-btn.active {
  background: rgba(255, 255, 255, 0.1);
}

.taskbar-github-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: var(--win11-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.taskbar-github-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.taskbar-github-btn img {
  opacity: 0.7;
  transition: opacity 0.15s;
}

.taskbar-github-btn:hover img {
  opacity: 1;
}

.taskbar-app-btn {
  flex: 0 0 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--win11-text);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.taskbar-app-btn::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  border-radius: 2px;
  background: var(--win11-accent);
  transition: width 0.2s, opacity 0.2s;
  opacity: 0;
}

.taskbar-app-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.taskbar-app-btn.active {
  background: rgba(96, 205, 255, 0.18);
}

.taskbar-app-btn.active::after {
  width: 18px;
  opacity: 1;
}

.taskbar-app-btn.running::after {
  width: 6px;
  opacity: 0.8;
}

.taskbar-app-btn.minimized::after {
  width: 0;
  opacity: 0;
}

.taskbar-app-btn.minimized {
  background: rgba(255, 255, 255, 0.02);
}

.taskbar-app-btn.minimized img,
.taskbar-app-btn.minimized svg {
  opacity: 0.35;
}

.taskbar-app-btn svg,
.taskbar-app-btn img {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.taskbar-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 0 6px;
  cursor: default;
}

.taskbar-time {
  font-size: 12px;
  line-height: 1;
  color: var(--win11-text);
}

.taskbar-date {
  font-size: 11px;
  line-height: 1;
  color: var(--win11-text-secondary);
}

/* ========== START MENU ========== */
.start-menu {
  position: absolute;
  bottom: calc(var(--taskbar-height) + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  max-width: calc(100vw - 16px);
  background: rgba(36, 36, 36, 0.95);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--win11-border);
  border-radius: var(--win11-radius);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  z-index: 250;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(20px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.start-menu.show {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.start-menu-header {
  padding: 16px 20px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--win11-text);
  border-bottom: 1px solid var(--win11-border);
}

.start-menu-apps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 12px;
}

.start-menu-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: var(--win11-radius-sm);
  cursor: pointer;
  transition: background 0.1s;
  background: transparent;
  border: none;
  color: var(--win11-text);
  font-family: var(--font-win);
  font-size: 11px;
}

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

.start-menu-app svg {
  opacity: 0.85;
}

.start-menu-footer {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  border-top: 1px solid var(--win11-border);
}

.start-menu-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--win11-text);
}

/* ========== APP: TERMINAL ========== */
.terminal-app {
  height: 100%;
  background: #0c0c0c;
  font-family: var(--font-mono);
  font-size: 13px;
  overflow: hidden;
}

.terminal-output {
  height: 100%;
  overflow-y: auto;
  padding: 8px 12px;
}

.output-line {
  color: var(--win11-text);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal-input-line {
  display: flex;
  align-items: center;
  padding: 4px 0 0;
  gap: 4px;
}

.terminal-prompt {
  color: var(--win11-accent);
  white-space: nowrap;
  font-size: 13px;
}

.terminal-input-text {
  color: var(--win11-text);
  font-family: var(--font-mono);
  font-size: 13px;
  flex: 1;
  min-width: 4px;
  outline: none;
  caret-color: var(--win11-text);
}

.terminal-cursor {
  display: inline;
  color: var(--win11-text);
  animation: blink 1s step-end infinite;
}

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

/* ========== APP: VS CODE ========== */
.vscode-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  min-height: 0;
  background: #1e1e1e;
}

.vscode-topbar {
  min-height: 35px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  border-bottom: 1px solid #2b2b2b;
  background: #181818;
  flex-shrink: 0;
}

.vscode-menu {
  display: flex;
  align-items: center;
  min-width: 0;
}

.vscode-menu button {
  min-height: 28px;
  padding: 0 7px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #cccccc;
  font: 12px var(--font-win);
  cursor: pointer;
}

.vscode-menu button:hover,
.vscode-command-center:hover {
  background: #2a2d2e;
  color: #fff;
}

.vscode-command-center {
  width: min(280px, 32%);
  min-width: 128px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-inline: auto;
  border: 1px solid #454545;
  border-radius: 6px;
  background: #242424;
  color: #cccccc;
  font: 12px var(--font-win);
  cursor: pointer;
}

.vscode-workspace {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
}

.vscode-activitybar {
  width: 48px;
  background: #333333;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 4px;
  gap: 2px;
  flex-shrink: 0;
}

.vscode-activity-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.1s;
}

.vscode-activity-btn svg {
  width: 24px;
  height: 24px;
}

.vscode-activity-btn:hover {
  color: rgba(255, 255, 255, 0.8);
}

.vscode-activity-btn.active {
  color: #fff;
}

.vscode-activity-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #fff;
}

.vscode-sidebar {
  width: 220px;
  background: #252526;
  border-right: 1px solid #383838;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.vscode-sidebar.collapsed {
  display: none;
}

.vscode-sidebar-header {
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.4);
}

.vscode-file-list {
  flex: 1;
  overflow-y: auto;
  font-size: 13px;
}

.vscode-sidebar-message {
  padding: 12px 16px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  line-height: 1.55;
}

.vscode-file-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 16px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.8);
  transition: background 0.1s;
  font-family: var(--font-win);
  font-size: 12px;
  white-space: nowrap;
}

.vscode-file-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.vscode-file-item.selected {
  background: rgba(96, 205, 255, 0.12);
  color: #fff;
}

.vscode-file-item .vscode-file-icon {
  flex-shrink: 0;
  opacity: 0.7;
}

.vscode-editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.vscode-tabs {
  display: flex;
  background: #2d2d2d;
  overflow-x: auto;
  flex-shrink: 0;
  height: 36px;
}

.vscode-breadcrumbs {
  height: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-bottom: 1px solid #252525;
  color: #a8a8a8;
  font: 11px var(--font-win);
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}

.vscode-breadcrumb-separator {
  color: #666;
}

.vscode-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 36px;
  background: #2d2d2d;
  border-right: 1px solid #252526;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.1s, color 0.1s;
}

.vscode-tab:hover {
  background: #37373d;
}

.vscode-tab.active {
  background: #1e1e1e;
  color: #fff;
  border-top: 1px solid var(--win11-accent);
}

.vscode-tab-close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  margin-left: 4px;
  opacity: 0.5;
}

.vscode-tab-close:hover {
  opacity: 1;
}

.vscode-editor {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #1e1e1e;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  counter-reset: line;
}

.vscode-editor-textarea {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 16px 24px 56px;
  border: 0;
  outline: 0;
  resize: none;
  overflow: auto;
  overscroll-behavior: contain;
  background: #1e1e1e;
  color: #d4d4d4;
  caret-color: #fff;
  font: 13px/1.6 var(--font-mono);
  tab-size: 4;
  white-space: pre;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
  user-select: text;
}

.vscode-editor-gutter {
  position: absolute;
  z-index: 1;
  inset: 0 auto 0 0;
  width: 48px;
  overflow: hidden;
  pointer-events: none;
  background: #1e1e1e;
}

.vscode-editor-minimap {
  position: absolute;
  z-index: 2;
  inset: 4px 4px 4px auto;
  width: 54px;
  overflow: hidden;
  margin: 0;
  padding: 8px 5px;
  border-left: 1px solid #303030;
  background: #252526;
  color: rgba(255, 255, 255, .28);
  font: 2px/3px var(--font-mono);
  letter-spacing: .1px;
  white-space: pre;
  pointer-events: none;
  user-select: none;
}

.vscode-line-numbers {
  will-change: transform;
}

.vscode-line-numbers > div {
  height: 20.8px;
  padding-right: 12px;
  color: #6e7681;
  font: 13px/20.8px var(--font-mono);
  text-align: right;
}

.vscode-line {
  display: flex;
  min-height: 21px;
}

.vscode-line-num {
  width: 48px;
  text-align: right;
  padding-right: 12px;
  color: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
  user-select: none;
  font-size: 12px;
}

.vscode-line-content {
  flex: 1;
  white-space: pre;
  padding-right: 16px;
}

.vscode-token-keyword { color: #569cd6; }
.vscode-token-string { color: #ce9178; }
.vscode-token-comment { color: #6a9955; font-style: italic; }
.vscode-token-number { color: #b5cea8; }
.vscode-token-builtin { color: #dcdcaa; }
.vscode-token-operator { color: #d4d4d4; }
.vscode-token-punctuation { color: #d4d4d4; }
.vscode-token-decorator { color: #dcdcaa; }
.vscode-token-variable { color: #9cdcfe; }
.vscode-token-heading { color: #569cd6; font-weight: bold; }
.vscode-token-bold { color: #fff; font-weight: bold; }
.vscode-token-italic { color: #ccc; font-style: italic; }
.vscode-token-code { color: #ce9178; }
.vscode-token-link { color: #3794ff; }
.vscode-token-list { color: #569cd6; }
.vscode-token-constant { color: #4fc1ff; }
.vscode-token-key { color: #9cdcfe; }
.vscode-token-text { color: #d4d4d4; }

.vscode-statusbar {
  height: 22px;
  background: #007acc;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
  justify-content: space-between;
  gap: 16px;
  white-space: nowrap;
  overflow: hidden;
}

.vscode-statusbar span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* VS Code workspace interactions */
.vscode-topbar { position: relative; }

.vscode-menu button.open {
  background: #2a2d2e;
  color: #fff;
}

.vscode-menu-dropdown {
  position: absolute;
  top: 34px;
  z-index: 30;
  min-width: 220px;
  padding: 4px;
  background: #252526;
  border: 1px solid #454545;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .4);
}

.vscode-menu-item {
  width: 100%;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: #d4d4d4;
  font: 12px var(--font-win);
  text-align: left;
  cursor: pointer;
}

.vscode-menu-item:hover,
.vscode-menu-item:focus-visible {
  outline: 0;
  background: #094771;
  color: #fff;
}

.vscode-menu-item kbd {
  color: #8b8b8b;
  font: 11px var(--font-win);
}

.vscode-menu-separator {
  height: 1px;
  margin: 4px 6px;
  background: #3e3e42;
}

.vscode-activitybar {
  border-right: 1px solid #252526;
}

.vscode-activity-spacer {
  flex: 1;
  min-height: 8px;
}

.vscode-activity-btn:focus-visible,
.vscode-small-action:focus-visible,
.vscode-file-item:focus-visible,
.vscode-panel-tab:focus-visible,
.vscode-panel-close:focus-visible,
.vscode-settings-action:focus-visible,
.vscode-run-button:focus-visible,
.vscode-extension-action:focus-visible,
.vscode-change-stage:focus-visible,
.vscode-change-discard:focus-visible,
.vscode-change-name:focus-visible,
.vscode-empty-action:focus-visible,
.vscode-input-action:focus-visible {
  outline: 1px solid var(--win11-accent);
  outline-offset: -1px;
}

.vscode-sidebar-header {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px 5px 12px;
}

.vscode-sidebar-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vscode-sidebar-actions {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
}

.vscode-small-action,
.vscode-input-action,
.vscode-panel-close {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .62);
  cursor: pointer;
}

.vscode-small-action:hover,
.vscode-input-action:hover,
.vscode-panel-close:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.vscode-small-action.accent { color: var(--win11-accent); }

.vscode-small-action svg,
.vscode-input-action svg,
.vscode-panel-close svg {
  width: 15px;
  height: 15px;
}

.vscode-explorer-toolbar {
  min-height: 27px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px 0 12px;
  color: rgba(255, 255, 255, .52);
  font-size: 10px;
  letter-spacing: .45px;
}

.vscode-explorer-toolbar span:last-child {
  max-width: 112px;
  overflow: hidden;
  color: rgba(255, 255, 255, .32);
  font-size: 10px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vscode-file-item {
  width: 100%;
  min-height: 26px;
  border: 0;
  text-align: left;
  background: transparent;
}

.vscode-file-item .vscode-file-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.vscode-folder-icon {
  opacity: .76;
}

.vscode-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vscode-file-chevron {
  width: 12px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 12px;
  color: rgba(255, 255, 255, .52);
}

.vscode-file-chevron svg {
  width: 12px;
  height: 12px;
  transition: transform .12s ease;
}

.vscode-file-chevron.expanded svg { transform: rotate(90deg); }

.vscode-dirty-dot,
.vscode-tab-dirty {
  color: var(--win11-accent);
  font-size: 9px;
  line-height: 1;
}

.vscode-dirty-dot {
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--win11-accent);
}

.vscode-tabs-empty {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  color: rgba(255, 255, 255, .32);
  font-size: 11px;
}

.vscode-tab-icon {
  display: inline-flex;
  align-items: center;
  flex: 0 0 14px;
}

.vscode-tab-icon img {
  width: 14px;
  height: 14px;
}

.vscode-tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.vscode-tab-close {
  width: 22px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vscode-tab-close svg {
  width: 14px;
  height: 14px;
}

.vscode-breadcrumbs button {
  max-width: 180px;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.vscode-breadcrumbs button:hover {
  color: #fff;
  text-decoration: underline;
}

.vscode-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  padding: 24px;
  color: rgba(255, 255, 255, .42);
  text-align: center;
}

.vscode-empty-state svg {
  color: rgba(255, 255, 255, .36);
}

.vscode-empty-state p {
  margin: 0;
  font: 13px/1.5 var(--font-win);
}

.vscode-empty-actions,
.vscode-run-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vscode-empty-action,
.vscode-inline-action,
.vscode-run-button,
.vscode-extension-action,
.vscode-change-stage,
.vscode-change-discard {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid #454545;
  border-radius: 3px;
  background: transparent;
  color: #d4d4d4;
  font: 11px var(--font-win);
  cursor: pointer;
}

.vscode-empty-action:hover,
.vscode-inline-action:hover,
.vscode-run-button:hover,
.vscode-extension-action:hover,
.vscode-change-stage:hover,
.vscode-change-discard:hover {
  background: #2a2d2e;
  color: #fff;
}

.vscode-empty-action.primary,
.vscode-inline-action.primary,
.vscode-run-button.primary {
  border-color: var(--win11-accent);
  background: var(--win11-accent);
  color: #101010;
}

.vscode-sidebar-empty {
  padding: 18px 14px;
  color: rgba(255, 255, 255, .5);
  font-size: 12px;
  line-height: 1.5;
}

.vscode-sidebar-empty .vscode-inline-action {
  display: block;
  margin-top: 12px;
}

.vscode-search-form {
  display: flex;
  align-items: center;
  margin: 8px 10px;
  border: 1px solid #454545;
  background: #1e1e1e;
}

.vscode-sidebar-input,
.vscode-palette-input {
  min-width: 0;
  height: 30px;
  flex: 1;
  padding: 0 8px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #d4d4d4;
  font: 12px var(--font-win);
}

.vscode-sidebar-input::placeholder,
.vscode-palette-input::placeholder {
  color: rgba(255, 255, 255, .38);
}

.vscode-input-icon {
  display: inline-flex;
  padding-left: 8px;
  color: rgba(255, 255, 255, .5);
}

.vscode-input-icon svg { width: 14px; height: 14px; }

.vscode-search-results,
.vscode-extension-list {
  padding-bottom: 16px;
}

.vscode-search-summary,
.vscode-section-label {
  padding: 8px 12px 5px;
  color: rgba(255, 255, 255, .4);
  font-size: 10px;
  letter-spacing: .5px;
}

.vscode-search-group {
  margin-bottom: 7px;
}

.vscode-search-file {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 3px;
  color: #d4d4d4;
  font-size: 12px;
  font-weight: 600;
}

.vscode-search-file .vscode-file-icon { width: 14px; height: 14px; }

.vscode-search-result {
  width: 100%;
  display: flex;
  gap: 8px;
  padding: 4px 12px 4px 28px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .66);
  font: 11px/1.35 var(--font-win);
  text-align: left;
  cursor: pointer;
}

.vscode-search-result:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.vscode-search-line-number { width: 22px; flex-shrink: 0; color: rgba(255, 255, 255, .34); text-align: right; }
.vscode-search-result span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.vscode-branch-row {
  width: 100%;
  display: grid;
  grid-template-columns: 16px auto 1fr;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid #333;
  background: transparent;
  color: #d4d4d4;
  font: 12px var(--font-win);
  text-align: left;
  cursor: pointer;
}

.vscode-branch-row:hover { background: rgba(255, 255, 255, .06); }
.vscode-branch-row svg { width: 16px; height: 16px; color: var(--win11-accent); }
.vscode-branch-state { overflow: hidden; color: rgba(255, 255, 255, .38); font-size: 10px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }

.vscode-commit-form {
  display: flex;
  gap: 5px;
  margin: 8px 10px;
  border: 1px solid #454545;
}

.vscode-commit-form .vscode-sidebar-input { height: 28px; }
.vscode-commit-form .vscode-inline-action { min-height: 28px; border: 0; border-left: 1px solid #454545; border-radius: 0; }

.vscode-change-row {
  min-height: 30px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 12px;
}

.vscode-change-row:hover,
.vscode-change-row.staged { background: rgba(255, 255, 255, .05); }
.vscode-change-status { color: #e2c08d; font-size: 11px; font-weight: 700; }
.vscode-change-name { min-width: 0; overflow: hidden; padding: 3px 0; border: 0; background: transparent; color: #d4d4d4; font: 11px var(--font-win); text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.vscode-change-name:hover { color: #fff; text-decoration: underline; }
.vscode-change-stage,
.vscode-change-discard { min-height: 24px; padding-inline: 6px; border-color: transparent; color: rgba(255, 255, 255, .52); font-size: 10px; }
.vscode-change-stage:hover { border-color: #454545; }
.vscode-change-discard { color: #c586c0; }

.vscode-run-card { padding: 14px 12px 8px; border-bottom: 1px solid #333; }
.vscode-run-title { color: #fff; font-size: 13px; font-weight: 600; }
.vscode-run-path { margin: 5px 0 12px; overflow: hidden; color: rgba(255, 255, 255, .4); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.vscode-run-button { display: inline-flex; align-items: center; gap: 5px; }
.vscode-run-button svg { width: 14px; height: 14px; }
.vscode-run-info { padding: 10px 12px; color: rgba(255, 255, 255, .45); font-size: 11px; line-height: 1.45; }

.vscode-extension-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.vscode-extension-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #4d4d4d;
  color: #d7ba7d;
  font-size: 10px;
  font-weight: 700;
}

.vscode-extension-icon svg { width: 19px; height: 19px; }
.vscode-extension-icon.markdown { color: #569cd6; }
.vscode-extension-icon.branch { color: #6a9955; }
.vscode-extension-detail { min-width: 0; }
.vscode-extension-detail strong { display: block; overflow: hidden; color: #fff; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.vscode-extension-detail span { display: block; margin-top: 2px; color: rgba(255, 255, 255, .4); font-size: 10px; }
.vscode-extension-detail p { margin: 5px 0 0; color: rgba(255, 255, 255, .58); font-size: 10px; line-height: 1.35; }
.vscode-extension-action { min-height: 26px; padding-inline: 6px; color: var(--win11-accent); font-size: 10px; white-space: nowrap; }
.vscode-extension-action.installed { color: rgba(255, 255, 255, .48); }

.vscode-settings-group { padding-bottom: 8px; }
.vscode-settings-row { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 12px; }
.vscode-settings-row:hover { background: rgba(255, 255, 255, .04); }
.vscode-settings-row strong { display: block; color: #d4d4d4; font-size: 11px; font-weight: 500; }
.vscode-settings-row span { display: block; margin-top: 3px; color: rgba(255, 255, 255, .4); font-size: 10px; line-height: 1.3; }
.vscode-toggle { width: 32px; height: 18px; position: relative; flex: 0 0 32px; border: 1px solid #666; border-radius: 9px; background: #333; cursor: pointer; }
.vscode-toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 10px; height: 10px; border-radius: 50%; background: #aaa; transition: transform .15s ease, background .15s ease; }
.vscode-toggle.active { border-color: var(--win11-accent); background: rgba(96, 205, 255, .24); }
.vscode-toggle.active::after { transform: translateX(14px); background: var(--win11-accent); }
.vscode-settings-action { width: 100%; min-height: 34px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border: 0; background: transparent; color: #d4d4d4; font: 11px var(--font-win); text-align: left; cursor: pointer; }
.vscode-settings-action:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.vscode-settings-action span:last-child { color: rgba(255, 255, 255, .35); font-size: 10px; }

.vscode-panel {
  display: none;
  height: 182px;
  max-height: 45%;
  flex-direction: column;
  flex-shrink: 0;
  border-top: 1px solid #3e3e42;
  background: #181818;
}

.vscode-panel.open { display: flex; }
.vscode-panel-header { min-height: 32px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #2b2b2b; }
.vscode-panel-tabs { height: 100%; display: flex; align-items: stretch; gap: 2px; padding-left: 8px; }
.vscode-panel-tab { min-height: 32px; padding: 0 8px; border: 0; border-bottom: 1px solid transparent; background: transparent; color: rgba(255, 255, 255, .45); font: 10px var(--font-win); cursor: pointer; }
.vscode-panel-tab:hover { color: #fff; }
.vscode-panel-tab.active { border-bottom-color: var(--win11-accent); color: #fff; }
.vscode-panel-body { min-height: 0; flex: 1; overflow: auto; }
.vscode-panel-output,
.vscode-panel-terminal-output { margin: 0; padding: 10px 12px; color: #c5c8c6; font: 11px/1.5 var(--font-mono); white-space: pre-wrap; }
.vscode-panel-terminal-output { min-height: 0; }
.vscode-panel-terminal-input { display: flex; align-items: center; gap: 7px; padding: 4px 12px 10px; color: var(--win11-accent); font: 11px var(--font-mono); }
.vscode-panel-terminal-input input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: #fff; font: inherit; }
.vscode-status-right { min-width: 0; display: flex; align-items: center; gap: 12px; overflow: hidden; }
.vscode-status-button { min-height: 20px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.vscode-status-button:hover { color: #fff; text-decoration: underline; }

.vscode-command-palette-backdrop {
  position: absolute;
  z-index: 50;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 38px 12px 12px;
  background: rgba(0, 0, 0, .32);
}

.vscode-command-palette {
  width: min(600px, 100%);
  overflow: hidden;
  border: 1px solid #5b5b5b;
  background: #252526;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .45);
}

.vscode-palette-input { width: 100%; height: 38px; padding-inline: 12px; border-bottom: 1px solid #454545; font-size: 13px; }
.vscode-palette-results { max-height: min(390px, 56vh); overflow: auto; padding: 4px; }
.vscode-palette-item { width: 100%; min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 10px; border: 0; background: transparent; color: #d4d4d4; font: 12px var(--font-win); text-align: left; cursor: pointer; }
.vscode-palette-item:hover,
.vscode-palette-item.selected { background: #094771; color: #fff; }
.vscode-palette-item kbd { color: rgba(255, 255, 255, .48); font: 10px var(--font-win); }
.vscode-palette-empty { padding: 16px 10px; color: rgba(255, 255, 255, .5); font-size: 12px; }

@media (max-width: 768px) {
  .window-resize-handle {
    display: none;
  }

  .desktop-storage-notice {
    flex-wrap: wrap;
    bottom: calc(var(--taskbar-height) + 8px);
  }

  .desktop-storage-notice span {
    flex-basis: 100%;
  }

  .vscode-menu-dropdown { top: 38px; }
  .vscode-sidebar-header { min-height: 40px; }
  .vscode-small-action { width: 30px; height: 30px; }
  .vscode-file-item { min-height: 36px; }
  .vscode-panel { height: 192px; max-height: 48%; }
  .vscode-panel-tab { min-width: 62px; padding-inline: 5px; }
  .vscode-status-right { gap: 7px; }
  .vscode-command-palette-backdrop { padding-top: 12px; }
  .vscode-palette-results { max-height: 48vh; }
  .vscode-extension-row { grid-template-columns: 34px minmax(0, 1fr); }
  .vscode-extension-action { grid-column: 2; justify-self: start; }
}

/* ========== APP: NOTEPAD ========== */
.notepad-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #1e1e1e;
  font-family: var(--font-mono);
}

.notepad-menu {
  display: flex;
  background: var(--win11-titlebar);
  border-bottom: 1px solid var(--win11-border);
  padding: 2px 0;
  flex-shrink: 0;
}

.notepad-menu-item {
  padding: 4px 10px;
  font-size: 12px;
  color: var(--win11-text-secondary);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-win);
}

.notepad-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--win11-text);
}

.notepad-editor {
  flex: 1;
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: 'Consolas', var(--font-mono);
  font-size: 14px;
  padding: 8px;
  border: none;
  outline: none;
  resize: none;
}

.notepad-status {
  height: 22px;
  background: var(--win11-titlebar);
  border-top: 1px solid var(--win11-border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 11px;
  color: var(--win11-text-secondary);
  flex-shrink: 0;
  justify-content: space-between;
}

.notepad-save-state {
  margin-inline: auto;
}

/* ========== APP: BROWSER ========== */
.browser-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #1e1e1e;
}

.browser-tabs {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  min-height: 36px;
  padding: 4px 8px 0;
  background: #252525;
  border-bottom: 1px solid var(--win11-border);
  overflow-x: auto;
  flex-shrink: 0;
}

.browser-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 1 190px;
  min-width: 136px;
  max-width: 220px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--win11-text-secondary);
  cursor: pointer;
  font: 12px var(--font-win);
  text-align: left;
  transition: background 0.1s, color 0.1s;
}

.browser-tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--win11-text);
}

.browser-tab.active {
  background: #1e1e1e;
  border-color: var(--win11-border);
  color: var(--win11-text);
}

.browser-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  overflow: hidden;
}

.browser-tab-icon svg,
.browser-tab-icon img {
  width: 16px !important;
  height: 16px !important;
  object-fit: contain;
}

.browser-tab-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-viewport {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #fff;
}

.browser-iframe {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

.browser-iframe.active {
  display: block;
}

/* ========== APP: EXPLORER ========== */
.explorer-app {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: #202020;
}

.explorer-toolbar {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  gap: 4px;
  background: #2d2d2d;
  border-bottom: 1px solid var(--win11-border);
  flex-shrink: 0;
}

.explorer-nav-btn {
  width: 32px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--win11-text-secondary);
  border-radius: var(--win11-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.explorer-nav-btn:disabled {
  opacity: .3;
  cursor: default;
}

.explorer-nav-btn:focus-visible,
.explorer-sidebar-item:focus-visible,
.explorer-file:focus-visible,
.explorer-action-button:focus-visible {
  outline: 1px solid var(--win11-accent);
  outline-offset: -2px;
}

.explorer-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--win11-text);
}

.explorer-addressbar {
  flex: 1;
  display: flex;
  align-items: center;
  background: #1e1e1e;
  border: 1px solid var(--win11-border);
  border-radius: var(--win11-radius-sm);
  padding: 0 10px;
  height: 28px;
  font-size: 12px;
  color: var(--win11-text-secondary);
  font-family: var(--font-win);
  gap: 6px;
}

.explorer-body {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.explorer-sidebar {
  width: 200px;
  background: #252526;
  border-right: 1px solid var(--win11-border);
  overflow-y: auto;
  padding: 8px 0;
  flex-shrink: 0;
}

.explorer-sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 12px;
  color: var(--win11-text-secondary);
  cursor: pointer;
  transition: background 0.1s;
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
}

.explorer-sidebar-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--win11-text);
}

.explorer-sidebar-item.active {
  background: rgba(96, 205, 255, 0.1);
  color: var(--win11-text);
}

.explorer-sidebar-item svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.explorer-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 4px 0;
}

.explorer-main-message {
  padding: 20px 16px;
  color: var(--win11-text-secondary);
  font-size: 12px;
}

.explorer-folder-actions {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--win11-border);
  color: var(--win11-text-secondary);
  font-size: 12px;
}

.explorer-action-button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--win11-border);
  border-radius: 6px;
  background: var(--win11-surface);
  color: var(--win11-text);
  font: inherit;
  cursor: pointer;
}

.explorer-action-button:hover:not(:disabled) {
  background: var(--win11-surface-hover);
}

.explorer-action-button.danger {
  color: #ffb4ab;
}

.explorer-action-button:disabled {
  opacity: .4;
  cursor: default;
}

.explorer-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 12px;
  color: var(--win11-text);
  cursor: pointer;
  transition: background 0.1s;
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
}

.explorer-file.selected {
  background: rgba(96, 205, 255, 0.12);
  outline: 1px solid rgba(96, 205, 255, 0.25);
  outline-offset: -1px;
}

.explorer-file:hover {
  background: rgba(255, 255, 255, 0.04);
}

.explorer-file svg {
  flex-shrink: 0;
}

/* ========== APP: PHOTOS ========== */
.photos-app {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  background: #151515;
  outline: none;
}

.photos-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 32px 64px;
  background: #111;
}

.photos-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}

.photos-image.actual-size {
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: none;
}

.photos-message {
  max-width: 320px;
  color: var(--win11-text-secondary);
  font-size: 14px;
  text-align: center;
}

.photos-icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--win11-border);
  border-radius: 50%;
  background: rgba(36, 36, 36, .92);
  color: var(--win11-text);
  cursor: pointer;
  transition: background .15s, transform .15s, opacity .15s;
}

.photos-icon-button:hover:not(:disabled) {
  background: var(--win11-surface-hover);
}

.photos-icon-button:active:not(:disabled) {
  transform: scale(.96);
}

.photos-icon-button:disabled {
  opacity: .25;
  cursor: default;
}

.photos-icon-button svg {
  width: 20px;
  height: 20px;
}

.photos-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.photos-nav:active:not(:disabled) {
  transform: translateY(-50%) scale(.96);
}

.photos-nav-previous { left: 16px; }
.photos-nav-next { right: 16px; }

.photos-footer {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 16px;
  border-top: 1px solid var(--win11-border);
  background: var(--win11-surface);
}

.photos-details {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.photos-details strong,
.photos-details span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photos-details strong { font-size: 13px; font-weight: 500; }
.photos-details span { color: var(--win11-text-secondary); font-size: 11px; }
.photos-fit { flex: none; border-radius: 8px; }

/* ========== APP: SETTINGS ========== */
.settings-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--win11-surface);
  overflow-y: auto;
  padding: 24px;
  gap: 24px;
  font-family: var(--font-win);
}

.settings-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.settings-avatar {
  width: 64px;
  height: 64px;
  background: #3d6b4f;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.settings-name {
  font-size: 22px;
  font-weight: 600;
  color: var(--win11-text);
}

.settings-meta {
  font-size: 13px;
  color: var(--win11-text-secondary);
}

.settings-section {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.settings-version {
  margin-top: auto;
  padding: 16px 24px;
  color: var(--win11-text-dim);
  font-size: 12px;
  text-align: center;
}

.settings-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--win11-text);
  margin-bottom: 10px;
}

.settings-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  margin-bottom: 16px;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--win11-border);
}

.settings-option-copy {
  min-width: 0;
}

.settings-option-label {
  color: var(--win11-text);
  font-size: 13px;
  font-weight: 500;
}

.settings-option-description {
  margin-top: 4px;
  color: var(--win11-text-secondary);
  font-size: 11px;
  line-height: 1.4;
}

.settings-toggle {
  position: relative;
  flex: 0 0 48px;
  width: 48px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.settings-toggle::before {
  content: '';
  position: absolute;
  top: 11px;
  left: 2px;
  width: 40px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.16s ease, border-color 0.16s ease;
}

.settings-toggle::after {
  content: '';
  position: absolute;
  top: 15px;
  left: 7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--win11-text-secondary);
  transition: transform 0.16s ease, background 0.16s ease;
}

.settings-toggle[aria-checked="true"]::before {
  border-color: var(--win11-accent);
  background: var(--win11-accent);
}

.settings-toggle[aria-checked="true"]::after {
  transform: translateX(18px);
  background: #fff;
}

.settings-toggle:focus-visible {
  outline: 1px solid var(--win11-accent);
  outline-offset: 1px;
  border-radius: 8px;
}

.settings-skill-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}

.settings-skill-label {
  width: 90px;
  font-size: 12px;
  color: var(--win11-text-secondary);
  flex-shrink: 0;
}

.settings-skill-track {
  flex: 1;
  height: 6px;
  background: var(--win11-border);
  border-radius: 3px;
  overflow: hidden;
}

.settings-skill-fill {
  height: 100%;
  background: var(--win11-accent);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.settings-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.settings-tag {
  padding: 4px 10px;
  background: rgba(96, 205, 255, 0.1);
  color: var(--win11-accent);
  border-radius: 12px;
  font-size: 11px;
}

.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.wallpaper-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s, transform 0.15s;
  background: var(--win11-surface);
  color: inherit;
  font: inherit;
  padding: 0;
  text-align: left;
}

.wallpaper-card:hover {
  transform: scale(1.02);
}

.wallpaper-card.active {
  border-color: var(--win11-accent);
}

.wallpaper-card:focus-visible {
  outline: 1px solid var(--win11-accent);
  outline-offset: 2px;
}

.wallpaper-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
  border-radius: 6px;
}

.wallpaper-label {
  padding: 6px 8px 8px;
  font-size: 12px;
  color: var(--win11-text-secondary);
  text-align: center;
}

.wallpaper-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  background: var(--win11-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.settings-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--win11-border);
  border-radius: var(--win11-radius-sm);
  color: var(--win11-accent);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
}

.settings-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* ========== APP: BENJAMIN QUIZ ========== */
.quiz-game-app {
  display: flex;
  height: 100%;
  overflow: hidden;
  background: #101018;
  color: #f6f0d8;
  font-family: var(--font-mono);
}

.quiz-game-app * {
  image-rendering: pixelated;
}

.quiz-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: #101018;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 3px solid #f6f0d8;
  background: #1f2f46;
  box-shadow: 4px 4px 0 #050508;
}

.quiz-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: #ffd166;
}

.quiz-meta {
  font-size: 12px;
  color: #cbe7ff;
  white-space: nowrap;
}

.quiz-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(160px, 230px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.quiz-sprite-wrap {
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border: 3px solid #f6f0d8;
  background: #263345;
  box-shadow: 4px 4px 0 #050508;
  overflow: hidden;
}

.quiz-sprite {
  width: min(92%, 210px);
  max-height: 96%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(5px 5px 0 rgba(0, 0, 0, 0.55));
}

.quiz-panel {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  gap: 14px;
  padding: 20px;
  border: 3px solid #f6f0d8;
  background: #202033;
  box-shadow: 4px 4px 0 #050508;
}

.quiz-kicker {
  width: fit-content;
  max-width: 100%;
  padding: 5px 8px;
  background: #ef476f;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 3px 3px 0 #050508;
}

.quiz-question {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff6df;
  overflow-wrap: anywhere;
}

.quiz-copy {
  font-size: 14px;
  line-height: 1.55;
  color: #cbe7ff;
  overflow-wrap: anywhere;
}

.quiz-answers {
  display: grid;
  grid-auto-rows: 1fr;
  gap: 10px;
}

.quiz-btn {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 3px solid #f6f0d8;
  border-radius: 0;
  background: #30445f;
  color: #fff6df;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  box-shadow: 4px 4px 0 #050508;
  transition: transform 0.08s, box-shadow 0.08s, background 0.08s;
  overflow-wrap: anywhere;
}

.quiz-btn:hover {
  background: #3f5d84;
  transform: translate(1px, 1px);
  box-shadow: 3px 3px 0 #050508;
}

.quiz-btn:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

.quiz-btn-primary {
  max-width: 230px;
  background: #06d6a0;
  color: #08110f;
  text-align: center;
}

.quiz-btn-primary:hover {
  background: #41f0bf;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .win11-desktop {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    border: none;
  }

  .desktop-icons {
    flex-direction: column;
    flex-wrap: nowrap;
    padding: 8px 4px;
    gap: 0;
    max-height: calc(100% - 8px);
    overflow-y: auto;
  }

  .desktop-icon {
    padding: 4px 4px;
    width: 64px;
    min-height: 64px;
    gap: 2px;
  }

  .desktop-icon.selected { outline: 0; }

  .desktop-icon svg {
    width: 28px;
    height: 28px;
  }

  .desktop-icon img {
    width: 28px !important;
    height: 28px !important;
  }

  .desktop-icons-right {
    top: 8px;
    right: 4px;
    width: max-content;
    grid-template-columns: repeat(2, 64px);
    overflow: visible;
  }

  .desktop-icon-label {
    font-size: 9px;
  }

  .start-menu {
    width: auto;
    left: 8px;
    right: 8px;
    max-width: none;
    transform: translateY(16px);
    transition: opacity 0.16s ease, transform 0.16s ease;
  }

  .start-menu.show { transform: translateY(0); }

  .start-menu-apps {
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 8px;
  }

  .win11-window {
    width: 100% !important;
    height: 100% !important;
    min-width: 0;
    min-height: 0;
    left: 0 !important;
    top: 0 !important;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .window-titlebar { height: 44px; padding-left: 10px; }
  .window-btn { width: 44px; height: 44px; }
  .browser-tabs { min-height: 44px; padding: 4px 4px 0; }
  .browser-tab { flex: 0 1 128px; min-width: 96px; max-width: 180px; height: 40px; padding-inline: 6px; gap: 5px; }
  .browser-iframe { min-height: 0; }

  .vscode-topbar { min-height: 40px; padding-inline: 6px; }
  .vscode-menu { display: none; }
  .vscode-command-center { width: min(260px, calc(100% - 16px)); height: 30px; }
  .vscode-activitybar { width: 44px; }
  .vscode-activity-btn { width: 44px; height: 48px; }
  .vscode-sidebar {
    position: absolute;
    z-index: 5;
    top: 0;
    bottom: 0;
    left: 44px;
    width: min(232px, calc(100% - 44px));
    border-right-color: #4a4a4a;
    box-shadow: 8px 0 20px rgba(0, 0, 0, .38);
  }
  .vscode-sidebar-header { min-height: 40px; display: flex; align-items: center; }
  .vscode-file-item { min-height: 36px; padding-block: 7px; overflow: hidden; }
  .vscode-file-item span { display: block; overflow: hidden; text-overflow: ellipsis; }
  .vscode-breadcrumbs { height: 28px; }
  .vscode-statusbar { font-size: 10px; }

  .explorer-sidebar {
    width: 48px;
  }

  .explorer-toolbar { min-height: 48px; padding: 6px 4px; }
  .explorer-nav-btn { width: 44px; height: 36px; flex-shrink: 0; }
  .explorer-addressbar { min-width: 0; height: 36px; }
  .explorer-addr-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .explorer-sidebar-item span {
    display: none;
  }

  .explorer-sidebar-item {
    min-height: 44px;
    justify-content: center;
    padding: 8px;
  }

  .explorer-file {
    min-height: 44px;
    padding: 8px 12px;
    font-size: 13px;
  }

  .explorer-folder-actions {
    min-height: 56px;
    padding: 8px 12px;
  }

  .explorer-action-button {
    min-height: 44px;
  }

  .photos-stage {
    padding: 24px 52px;
  }

  .photos-footer {
    min-height: 64px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .quiz-game-app {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .quiz-shell {
    padding: 12px;
    gap: 10px;
    min-height: 100%;
    height: auto;
  }

  .quiz-header {
    min-height: 64px;
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .quiz-stage {
    flex: 1;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(120px, 24dvh) minmax(300px, 1fr);
    gap: 10px;
  }

  .quiz-sprite-wrap {
    align-items: flex-end;
  }

  .quiz-sprite {
    width: auto;
    max-width: 180px;
    max-height: 125px;
  }

  .quiz-panel {
    justify-content: center;
    align-self: start;
    width: 100%;
    min-height: 300px;
    overflow: visible;
    padding: 16px;
  }

  .quiz-question {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .win11-taskbar {
    height: 48px;
    --taskbar-height: 48px;
  }

  .taskbar-start-btn {
    width: 44px;
    height: 44px;
  }

  .taskbar-app-btn {
    width: 44px;
    height: 44px;
  }

  .taskbar-app-btn svg,
  .taskbar-app-btn img {
    width: 18px;
    height: 18px;
  }

  .taskbar-clock {
    display: none;
  }

  .taskbar-right { min-width: 44px; }
  .taskbar-github-btn { width: 44px; height: 44px; }
  .start-menu { bottom: calc(var(--taskbar-height) + 8px); max-height: calc(100vh - 64px); overflow-y: auto; }

  .quiz-title {
    font-size: 16px;
  }

  .quiz-meta { font-size: 11px; }
  .quiz-copy,
  .quiz-btn { font-size: 14px; }

  .quiz-question {
    font-size: 17px;
  }

  .quiz-sprite {
    max-height: 100px;
  }

  .quiz-header { min-height: 56px; padding: 8px 10px; }
  .quiz-meta { margin-left: auto; }
  .quiz-stage { grid-template-rows: minmax(112px, 22dvh) minmax(280px, 1fr); }
  .quiz-panel { min-height: 280px; gap: 12px; padding: 14px; }
  .quiz-btn-primary { max-width: none; }
}

@media (max-width: 768px) and (max-height: 650px) {
  .desktop-icons:not(.desktop-icons-right) {
    display: grid;
    grid-template-columns: repeat(2, 64px);
    grid-auto-rows: 64px;
    width: 132px;
    overflow: hidden;
  }
}

@media (max-height: 560px) and (max-width: 900px) {
  .win11-desktop {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .win11-window {
    width: 100% !important;
    height: 100% !important;
    min-width: 0;
    min-height: 0;
    left: 0 !important;
    top: 0 !important;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .window-titlebar { height: 44px; }
  .window-btn { width: 44px; height: 44px; }
}

/* ========== CONTEXT MENU ========== */
.context-menu {
  position: fixed;
  z-index: 3000;
  background: rgba(36, 36, 36, 0.96);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--win11-border);
  border-radius: var(--win11-radius-sm);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  min-width: 180px;
  padding: 4px;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--win11-text);
  cursor: pointer;
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  border-radius: 3px;
  transition: background 0.1s;
}

.context-menu-item:focus-visible {
  outline: 1px solid var(--win11-accent);
  outline-offset: -1px;
}

.context-menu-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
}

.context-menu-icon img,
.context-menu-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.desktop-storage-notice {
  position: fixed;
  z-index: 5000;
  left: 50%;
  bottom: calc(var(--taskbar-height) + 16px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(720px, calc(100vw - 24px));
  padding: 10px 12px;
  border: 1px solid rgba(255, 180, 171, .55);
  border-radius: 6px;
  background: rgba(36, 36, 36, .96);
  color: var(--win11-text);
  font-size: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .5);
}

.desktop-storage-notice span {
  flex: 1;
  min-width: 0;
}

.desktop-storage-notice button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--win11-border);
  border-radius: 5px;
  background: var(--win11-surface);
  color: var(--win11-text);
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.desktop-storage-notice button:hover {
  background: var(--win11-surface-hover);
}

.desktop-storage-notice button:focus-visible {
  outline: 1px solid var(--win11-accent);
  outline-offset: 2px;
}

.context-menu-item:hover {
  background: var(--win11-accent-dim);
}

.context-menu-separator {
  height: 1px;
  background: var(--win11-border);
  margin: 4px 8px;
}

/* ========== QUESTION DIALOG ========== */
.win11-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.58);
  animation: win11-dialog-backdrop-in 0.12s ease-out;
}

.win11-dialog-backdrop.closing {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.win11-dialog {
  width: min(594px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 28px 26px 24px;
  color: var(--win11-text);
  background: var(--win11-surface);
  border: 1px solid #4b4b4b;
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.62);
  animation: win11-dialog-in 0.14s ease-out;
}

.win11-dialog-title {
  color: var(--win11-text);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.win11-dialog-message {
  margin-top: 20px;
  color: var(--win11-text);
  font-size: 14px;
  line-height: 1.45;
}

.win11-dialog-field {
  margin-top: 8px;
}

.win11-dialog-label {
  display: block;
  margin-bottom: 8px;
  color: var(--win11-text-secondary);
  font-size: 12px;
}

.win11-dialog-input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--win11-text);
  caret-color: var(--win11-text);
  background: #171717;
  border: 2px solid #727272;
  border-radius: 8px;
  outline: none;
  font: 14px var(--font-win);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

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

.win11-dialog-input[aria-invalid="true"] {
  border-color: #e06c75;
}

.win11-dialog-error {
  min-height: 16px;
  margin-top: 6px;
  color: #ff9b9b;
  font-size: 12px;
  line-height: 1.35;
}

.win11-dialog-error[hidden] {
  display: none;
}

.win11-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.win11-dialog-button {
  min-width: 112px;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: 22px;
  color: var(--win11-text);
  font: 600 14px var(--font-win);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.win11-dialog-button:hover {
  transform: translateY(-1px);
}

.win11-dialog-button:active {
  transform: scale(0.98);
}

.win11-dialog-button:focus-visible {
  outline: 2px solid var(--win11-accent);
  outline-offset: 2px;
}

.win11-dialog-button.secondary {
  background: var(--win11-surface-hover);
  border-color: var(--win11-border);
}

.win11-dialog-button.secondary:hover {
  background: var(--win11-surface-active);
}

.win11-dialog-button.primary {
  color: #0d2028;
  background: var(--win11-accent);
}

.win11-dialog-button.primary:hover {
  background: var(--win11-accent-hover);
}

.win11-dialog-button.danger {
  color: #fff;
  background: #c42b1c;
}

.win11-dialog-button.danger:hover {
  background: #d43b2b;
}

@keyframes win11-dialog-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes win11-dialog-in {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 600px) {
  .win11-dialog-backdrop {
    align-items: flex-end;
    padding: 8px 8px 0;
  }

  .win11-dialog {
    width: 100%;
    max-height: calc(100vh - 8px);
    padding: 20px 16px calc(20px + var(--safe-bottom));
    border-radius: 12px 12px 0 0;
  }

  .win11-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .win11-dialog-button {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .desktop-wallpaper,
  .desktop-wallpaper-overlay,
  .win11-window,
  .win11-window.minimized,
  .start-menu,
  .taskbar-app-btn::after,
  .win11-dialog-backdrop,
  .win11-dialog,
  .win11-dialog-button,
  .win11-dialog-input {
    animation: none;
    transition: none;
  }
}

/* Spatial transitions end immediately when reduced motion is requested. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.taskbar-app-btn { background: transparent; border-radius: var(--win11-radius-sm); }
.taskbar-app-btn:hover { background: var(--taskbar-button-hover); }
.taskbar-app-btn.active { background: var(--taskbar-button); }
.taskbar-app-btn::after { width: 16px; transition: transform .18s ease-out, opacity .18s ease-out; }
.taskbar-app-btn.active::after { width: 16px; background: var(--win11-accent); }
.taskbar-app-btn.running::after, .taskbar-app-btn.minimized::after {
  width: 6px; opacity: 1; background: var(--win11-text-secondary);
}
.taskbar-app-btn.minimized { background: transparent; }
.taskbar-app-btn.minimized img, .taskbar-app-btn.minimized svg { opacity: 1; }
.taskbar-app-btn:active img, .taskbar-app-btn:active svg { transform: scale(.88); }
.taskbar-app-btn img, .taskbar-app-btn svg { transition: transform .12s ease-out; }
.quiz-panel > * { animation: quiz-enter .28s cubic-bezier(.16, 1, .3, 1) both; }
.quiz-answers .quiz-btn { animation: quiz-enter .3s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(var(--answer-index) * 45ms); }
.quiz-sprite { transform-origin: bottom center; animation: quiz-sprite-enter .35s cubic-bezier(.16, 1, .3, 1) both; }
.quiz-correct .quiz-sprite { animation: quiz-celebrate .38s ease-out; }
.quiz-incorrect .quiz-sprite { animation: quiz-shake .3s ease-out; }
.quiz-correct .quiz-kicker { animation: quiz-score .35s ease-out; }
.quiz-btn { transition: transform .14s ease-out, background .14s ease-out; }
.quiz-btn:focus-visible { outline: 2px solid var(--win11-accent); outline-offset: 3px; }
@keyframes quiz-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes quiz-sprite-enter { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes quiz-celebrate { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-14px) rotate(-2deg); } 75% { transform: translateY(-4px) rotate(1deg); } }
@keyframes quiz-shake { 0%, 100% { transform: translateX(0); } 25%, 75% { transform: translateX(-5px); } 50% { transform: translateX(5px); } }
@keyframes quiz-score { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Notifications stay inside their owning app or above the desktop taskbar. */
.os-notification-region {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 30;
  width: 352px;
  max-width: calc(100% - 24px);
  max-height: calc(100% - 64px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  pointer-events: none;
  font-family: var(--font-win);
  font-size: 13px;
  color: var(--win11-text);
}
.system-notification-region {
  bottom: calc(var(--taskbar-height) + 12px + var(--safe-bottom));
  max-height: calc(100% - var(--taskbar-height) - 48px);
  z-index: 300;
}
.vscode-notification-region {
  bottom: 32px;
  --notification-surface: #252526;
  --notification-border: #454545;
}
.os-notification {
  flex: 0 0 auto;
  padding: 12px 16px 16px;
  border: 1px solid var(--notification-border, var(--win11-border));
  border-radius: var(--win11-radius);
  background: var(--notification-surface, var(--win11-surface));
  box-shadow: var(--win11-shadow-sm);
  pointer-events: auto;
  animation: os-notification-enter .18s cubic-bezier(.16, 1, .3, 1) both;
}
.os-notification-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.os-notification-icon { display: flex; align-items: center; }
.os-notification-icon img, .os-notification-icon svg { width: 16px !important; height: 16px !important; }
.os-notification-source { flex: 1; min-width: 0; color: var(--win11-text-secondary); font-size: 12px; }
.os-notification-message { line-height: 1.5; overflow-wrap: anywhere; user-select: text; }
.os-notification-close {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: -4px -8px -4px 0;
  padding: 0;
  border: 0;
  border-radius: var(--win11-radius-sm);
  background: transparent;
  color: var(--win11-text-secondary);
  cursor: pointer;
}
.os-notification-close:hover { background: var(--win11-surface-hover); color: var(--win11-text); }
.os-notification-close:active { transform: scale(.96); }
.os-notification-close:focus-visible { outline: 1px solid var(--win11-accent); outline-offset: -1px; }
@keyframes os-notification-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 600px) { .os-notification-close { width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) { .os-notification { animation: none; } }

.quiz-panel > * { flex-shrink: 0; }

/* Microsoft Motion in Windows: connected surfaces, direct entrance and exit.
   https://learn.microsoft.com/windows/apps/design/signature-experiences/motion */
:root {
  --win11-motion-enter: 250ms;
  --win11-motion-exit: 167ms;
  --win11-motion-travel: 333ms;
  --win11-motion-resize: 250ms;
  --win11-motion-enter-ease: cubic-bezier(0, 0, 0, 1);
  --win11-motion-exit-ease: cubic-bezier(0, 0, 0, 1);
  --win11-motion-move-ease: cubic-bezier(.55, .55, 0, 1);
}
.win11-window { transform-origin: center center; }
.start-menu {
  transform: translateX(-50%) translateY(56px) scale(.96);
  transform-origin: center bottom;
  visibility: hidden;
  transition: transform var(--win11-motion-exit) var(--win11-motion-exit-ease), opacity 83ms linear, visibility 0s var(--win11-motion-exit);
}
.start-menu.show {
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
  transition: transform var(--win11-motion-travel) var(--win11-motion-enter-ease), opacity 83ms linear;
}
.win11-taskbar { z-index: 260; }
.taskbar-app-btn::after { transition: transform var(--win11-motion-enter) var(--win11-motion-enter-ease), opacity 83ms linear; }
.taskbar-app-btn.active::after { transform: translateX(-50%) scaleX(1); }
.taskbar-app-btn.running::after, .taskbar-app-btn.minimized::after { width: 16px; transform: translateX(-50%) scaleX(.375); }
.taskbar-start-btn:active svg { transform: scale(.85); }
.taskbar-start-btn svg { transition: transform 83ms var(--win11-motion-enter-ease); }
@media (max-width: 768px) {
  .start-menu { transform: translateY(56px) scale(.96); }
  .start-menu.show { transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .start-menu, .start-menu.show { transition: none; }
}
