* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html, body, #root {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
}

:root {
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --accent: #bf4dff;
  --accent-secondary: #ff6b9d;
  --menu-bg: rgba(255, 255, 255, 0.85);
  --dock-bg: rgba(255, 255, 255, 0.55);
  --window-bg: rgba(255, 255, 255, 0.78);
  --window-title-bg: rgba(245, 245, 247, 0.9);
  --sidebar-bg: rgba(240, 240, 242, 0.7);
  --input-bg: rgba(0, 0, 0, 0.04);
  --border-color: rgba(0, 0, 0, 0.08);
  --hover-bg: rgba(0, 0, 0, 0.04);
}

.dark-mode {
  --glass-bg: rgba(30, 30, 32, 0.78);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --menu-bg: rgba(40, 40, 44, 0.88);
  --dock-bg: rgba(40, 40, 44, 0.6);
  --window-bg: rgba(36, 36, 40, 0.82);
  --window-title-bg: rgba(50, 50, 54, 0.92);
  --sidebar-bg: rgba(44, 44, 48, 0.75);
  --input-bg: rgba(255, 255, 255, 0.06);
  --border-color: rgba(255, 255, 255, 0.08);
  --hover-bg: rgba(255, 255, 255, 0.06);
}

@keyframes wallpaperShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes bootFadeIn {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes bootProgress {
  0% { width: 0%; }
  100% { width: 100%; }
}

@keyframes windowOpen {
  0% { opacity: 0; transform: scale(0.88); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes windowClose {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.88); }
}

@keyframes minimizeToDoc {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.2) translateY(400px); }
}

@keyframes lockScreenUp {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-100%); opacity: 0; }
}

@keyframes dropdownIn {
  0% { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.wallpaper-sunset {
  background: linear-gradient(135deg, #1a0533 0%, #2d1b69 15%, #6b2fa0 30%, #d4418e 50%, #ff6b6b 65%, #ffa751 80%, #ffe259 100%);
  background-size: 300% 300%;
  animation: wallpaperShift 20s ease infinite;
}

.wallpaper-ocean {
  background: linear-gradient(135deg, #0c0e2b 0%, #0f3460 20%, #16697a 40%, #489fb5 55%, #82c0cc 70%, #a8dadc 85%, #f1faee 100%);
  background-size: 300% 300%;
  animation: wallpaperShift 25s ease infinite;
}

.wallpaper-aurora {
  background: linear-gradient(135deg, #0d0221 0%, #0a1628 15%, #183a37 30%, #04724d 45%, #80ffe8 55%, #c5eff7 65%, #7d5fff 80%, #420a8f 100%);
  background-size: 300% 300%;
  animation: wallpaperShift 18s ease infinite;
}

.wallpaper-berry {
  background: linear-gradient(135deg, #1a0a2e 0%, #3d1c56 15%, #6b2fa0 28%, #9b4dca 40%, #e066ff 52%, #ff85a1 64%, #fbb1bd 76%, #f8e8f0 100%);
  background-size: 300% 300%;
  animation: wallpaperShift 22s ease infinite;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
}

.glass-menu {
  background: var(--menu-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-bottom: 1px solid var(--glass-border);
}

.glass-dock {
  background: var(--dock-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
}

.glass-window {
  background: var(--window-bg);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), 0 0 0 0.5px rgba(0,0,0,0.06);
}

.traffic-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
  transition: filter 0.15s;
  position: relative;
}
.traffic-light:hover { filter: brightness(1.1); }
.traffic-red { background: #ff5f57; border: 0.5px solid #e0443e; }
.traffic-yellow { background: #febc2e; border: 0.5px solid #dea123; }
.traffic-green { background: #28c840; border: 0.5px solid #1aab29; }

.traffic-light:hover::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 8px;
  font-weight: bold;
  color: rgba(0,0,0,0.5);
}
.traffic-red:hover::after { content: '×'; font-size: 11px; }
.traffic-yellow:hover::after { content: '−'; font-size: 10px; }
.traffic-green:hover::after { content: '+'; font-size: 9px; }

.dock-icon {
  transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  position: relative;
}

.dock-icon-label {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--menu-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-primary);
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  border: 1px solid var(--glass-border);
  font-weight: 500;
}

.dock-icon:hover .dock-icon-label {
  opacity: 1;
}

.dock-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-secondary);
  margin-top: 2px;
}

.window-opening {
  animation: windowOpen 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.window-closing {
  animation: windowClose 0.2s ease-in forwards;
}

.window-minimizing {
  animation: minimizeToDoc 0.35s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.dropdown-menu {
  animation: dropdownIn 0.15s ease-out forwards;
}

.resize-handle {
  position: absolute;
  z-index: 10;
}
.resize-handle-e { right: -3px; top: 10px; bottom: 10px; width: 6px; cursor: ew-resize; }
.resize-handle-s { bottom: -3px; left: 10px; right: 10px; height: 6px; cursor: ns-resize; }
.resize-handle-se { right: -3px; bottom: -3px; width: 14px; height: 14px; cursor: nwse-resize; }

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: #00ff41;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
}
.dark-mode .terminal-cursor { background: #00ff41; }

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

.calc-btn {
  border-radius: 50%;
  font-size: 18px;
  font-weight: 400;
  border: none;
  cursor: pointer;
  transition: filter 0.1s, transform 0.08s;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.calc-btn:active {
  filter: brightness(0.85);
  transform: scale(0.95);
}

.scrollbar-thin::-webkit-scrollbar { width: 6px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: rgba(128,128,128,0.3); border-radius: 3px; }
.scrollbar-thin::-webkit-scrollbar-thumb:hover { background: rgba(128,128,128,0.5); }

.mobile-message {
  display: none;
}

@media (max-width: 1023px) {
  .desktop-only { display: none !important; }
  .mobile-message { display: flex !important; }
}