/* ===== Design tokens (Windows 11 inspired) ===== */
:root {
  --accent: #0078d4;
  --accent-hover: #106ebe;
  --accent-press: #005a9e;
  --bg-desktop: #0c4a6e;
  --bg-mica: rgba(243, 243, 243, 0.85);
  --bg-solid: #f3f3f3;
  --bg-card: #ffffff;
  --bg-hover: rgba(0, 0, 0, 0.04);
  --bg-active: rgba(0, 0, 0, 0.08);
  --text: #1a1a1a;
  --text-secondary: #5d5d5d;
  --text-on-accent: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.24);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --taskbar-h: 48px;
  --titlebar-h: 36px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Code", "Consolas", "Courier New", monospace;
  --z-desktop: 1;
  --z-windows: 100;
  --z-taskbar: 9000;
  --z-start: 9100;
  --z-context: 9200;
  --z-notif: 9300;
  --z-boot: 10000;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg-mica: rgba(32, 32, 32, 0.88);
  --bg-solid: #202020;
  --bg-card: #2c2c2c;
  --bg-hover: rgba(255, 255, 255, 0.06);
  --bg-active: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --text-secondary: #cfcfcf;
  --border: rgba(255, 255, 255, 0.08);
  color-scheme: dark;
}

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

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

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

.app-root {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Boot */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: var(--z-boot);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 48px;
  background: #000;
  transition: opacity 0.45s ease;
}

.boot-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.boot-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Notifications */
.notification-host {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: var(--z-notif);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-mica);
  backdrop-filter: blur(40px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 12px 16px;
  animation: toast-in 0.25s ease;
}

.toast-title {
  font-weight: 600;
  margin-bottom: 2px;
}

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

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: none; }
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  background-clip: content-box;
  border: 2px solid transparent;
}

/* Utilities */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Selection inside editors */
.selectable, .selectable * {
  user-select: text;
}

@media (max-width: 700px) {
  :root {
    --taskbar-h: 56px;
  }
}
