@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&family=Great+Vibes&family=Playball&family=SF+Pro+Display:wght@200;300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

    :root {
      --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
    }

    * {
      box-sizing: border-box;
      user-select: none;
      -webkit-user-select: none;
    }

    body {
      margin: 0;
      padding: 0;
      width: 100vw;
      height: 100vh;
      overflow: hidden;
      font-family: var(--font-system);
      position: relative;
      background-color: #1a4d2e;
    }

    /* Sonoma Vibrant Wallpaper Background */
    .wallpaper {
      position: absolute;
      inset: 0;
      background: radial-gradient(circle at 75% 20%, #7b88fa 0%, transparent 45%),
                  radial-gradient(circle at 35% 35%, #f43f5e 0%, transparent 45%),
                  radial-gradient(circle at 20% 70%, #84cc16 0%, transparent 55%),
                  radial-gradient(circle at 60% 80%, #15803d 0%, transparent 50%),
                  radial-gradient(circle at 80% 50%, #38bdf8 0%, transparent 40%),
                  linear-gradient(135deg, #22c55e 0%, #166534 50%, #0f172a 100%);
      background-size: 150% 150%;
      animation: ambientFlow 25s ease infinite alternate;
      z-index: 0;
    }

    .wallpaper-mesh {
      position: absolute;
      inset: 0;
      background: radial-gradient(ellipse at 30% 90%, rgba(34, 197, 94, 0.7) 0%, transparent 60%),
                  radial-gradient(ellipse at 70% 85%, rgba(21, 128, 61, 0.9) 0%, transparent 60%),
                  radial-gradient(ellipse at 50% 40%, rgba(244, 63, 94, 0.45) 0%, transparent 50%),
                  radial-gradient(ellipse at 80% 25%, rgba(99, 102, 241, 0.6) 0%, transparent 50%);
      filter: blur(40px);
      z-index: 1;
    }

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

    /* ==========================================================================
       BOOT SEQUENCE & HELLO SCREEN
       ========================================================================== */
    .boot-overlay {
      position: fixed;
      inset: 0;
      z-index: 99999;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background: #020617;
      transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), filter 0.35s ease;
    }

    .boot-overlay.fade-out {
      opacity: 0;
      transform: scale(1.08);
      filter: blur(20px);
      pointer-events: none;
    }

    /* Cursive Hello Calligraphy */
    .cursive-hello {
      font-family: 'Great Vibes', 'Dancing Script', cursive;
      font-size: clamp(4.5rem, 11vw, 9rem);
      letter-spacing: 0.02em;
      background: linear-gradient(135deg, #ffffff 10%, #e0f2fe 50%, #fbcfe8 90%);
      background-clip: text;
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      filter: drop-shadow(0 15px 35px rgba(0,0,0,0.55)) drop-shadow(0 0 45px rgba(255,255,255,0.45));
      opacity: 0;
      transform: scale(0.92) translateY(10px);
      animation: helloDrawIn 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
      display: inline-block;
      user-select: none;
    }

    @keyframes helloDrawIn {
      0% {
        opacity: 0;
        transform: scale(0.88) translateY(24px);
        filter: blur(12px) drop-shadow(0 0 10px rgba(255,255,255,0.2));
      }
      100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0px) drop-shadow(0 15px 35px rgba(0,0,0,0.55)) drop-shadow(0 0 35px rgba(255,255,255,0.35));
      }
    }

    .hello-fade-cycle {
      animation: helloChange 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    @keyframes helloChange {
      0% { opacity: 0; transform: translateY(12px) scale(0.95); filter: blur(6px); }
      100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
    }

    /* Boot Progress Indicator */
    .boot-progress-track {
      width: 190px;
      height: 4px;
      background: rgba(255, 255, 255, 0.2);
      border-radius: 9999px;
      overflow: hidden;
      position: relative;
    }

    .boot-progress-bar {
      height: 100%;
      width: 0%;
      background: #ffffff;
      border-radius: 9999px;
      box-shadow: 0 0 10px rgba(255,255,255,0.8);
      transition: width 0.25s linear;
    }

    /* ==========================================================================
       macOS SONOMA LOCK SCREEN
       ========================================================================== */
    .lockscreen-overlay {
      position: fixed;
      inset: 0;
      z-index: 90000;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-between;
      padding: 5vh 2rem 4vh 2rem;
      backdrop-filter: blur(28px) saturate(160%);
      -webkit-backdrop-filter: blur(28px) saturate(160%);
      background: rgba(10, 15, 25, 0.35);
      transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
    }

    .lockscreen-overlay.unlocked {
      opacity: 0;
      transform: scale(1.12);
      filter: blur(30px);
      pointer-events: none;
    }

    .lock-time {
      font-size: clamp(4.5rem, 9vw, 8rem);
      font-weight: 200;
      line-height: 1;
      letter-spacing: -0.04em;
      color: rgba(255, 255, 255, 0.98);
      text-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    }

    .lock-date {
      font-size: clamp(1rem, 2vw, 1.4rem);
      font-weight: 500;
      color: rgba(255, 255, 255, 0.9);
      letter-spacing: -0.01em;
      text-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
      margin-top: 0.25rem;
    }

    .lock-avatar-ring {
      width: 88px;
      height: 88px;
      border-radius: 50%;
      padding: 3px;
      background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(255,255,255,0.1));
      box-shadow: 0 16px 36px rgba(0,0,0,0.45);
    }

    .lock-input-box {
      background: rgba(255, 255, 255, 0.22);
      border: 1px solid rgba(255, 255, 255, 0.35);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      box-shadow: inset 0 1px 1px rgba(255,255,255,0.3), 0 10px 25px rgba(0,0,0,0.25);
    }

    @keyframes lockShake {
      0%, 100% { transform: translateX(0); }
      20%, 60% { transform: translateX(-10px); }
      40%, 80% { transform: translateX(10px); }
    }
    .shake-animation {
      animation: lockShake 0.45s ease-in-out;
    }

    /* Menu Bar */
    .menubar {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 28px;
      background: rgba(255, 255, 255, 0.15);
      backdrop-filter: blur(25px) saturate(180%);
      -webkit-backdrop-filter: blur(25px) saturate(180%);
      border-bottom: 0.5px solid rgba(255, 255, 255, 0.2);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 14px;
      font-size: 13px;
      font-weight: 500;
      color: rgba(255, 255, 255, 0.95);
      text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
      z-index: 1000;
    }

    .menu-item {
      padding: 2px 8px;
      border-radius: 4px;
      cursor: default;
      transition: background 0.15s ease;
      position: relative;
    }

    .menu-item:hover, .menu-item.active {
      background: rgba(255, 255, 255, 0.25);
    }

    /* Apple Dropdown Menus */
    .mac-menu-dropdown {
      position: absolute;
      top: 28px;
      left: 0;
      min-width: 220px;
      background: rgba(45, 52, 60, 0.85);
      backdrop-filter: blur(40px) saturate(210%);
      -webkit-backdrop-filter: blur(40px) saturate(210%);
      border: 0.5px solid rgba(255, 255, 255, 0.22);
      box-shadow: 0 18px 38px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.2);
      border-radius: 8px;
      padding: 5px;
      z-index: 1100;
      color: #fff;
      display: none;
      animation: menuFade 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes menuFade {
      from { opacity: 0; transform: translateY(-4px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .menu-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 4px 10px;
      border-radius: 5px;
      font-size: 13px;
      cursor: default;
      color: rgba(255, 255, 255, 0.92);
      font-weight: 400;
      transition: background 0.1s ease;
    }

    .menu-row:hover {
      background: #007aff;
      color: #ffffff;
    }

    .menu-row.disabled {
      color: rgba(255, 255, 255, 0.35);
      pointer-events: none;
    }

    .menu-separator {
      height: 1px;
      background: rgba(255, 255, 255, 0.12);
      margin: 4px 6px;
    }

    .menu-shortcut {
      font-size: 11.5px;
      opacity: 0.65;
      letter-spacing: 0.5px;
    }

    /* Popover Panels (Wi-Fi, Control Center) */
    .mac-popover {
      position: absolute;
      top: 34px;
      right: 12px;
      background: rgba(36, 42, 50, 0.88);
      backdrop-filter: blur(45px) saturate(220%);
      -webkit-backdrop-filter: blur(45px) saturate(220%);
      border: 0.5px solid rgba(255, 255, 255, 0.25);
      border-radius: 14px;
      box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.2);
      z-index: 1100;
      display: none;
      animation: popoverDrop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes popoverDrop {
      from { opacity: 0; transform: translateY(-8px) scale(0.98); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    /* Wi-Fi Pulse wave */
    @keyframes wifiWave {
      0% { opacity: 0.3; }
      50% { opacity: 1; }
      100% { opacity: 0.3; }
    }
    .wifi-anim-pulse {
      animation: wifiWave 1.6s ease-in-out infinite;
    }

    /* ==========================================================================
       PHYSICS DOCK & MAGNIFICATION
       ========================================================================== */
    .dock-container {
      position: absolute;
      bottom: 12px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 900;
      display: flex;
      align-items: flex-end;
    }

    .dock {
      display: flex;
      align-items: flex-end;
      gap: 10px;
      padding: 8px 12px;
      background: rgba(255, 255, 255, 0.22);
      backdrop-filter: blur(35px) saturate(200%);
      -webkit-backdrop-filter: blur(35px) saturate(200%);
      border: 1px solid rgba(255, 255, 255, 0.35);
      border-radius: 22px;
      box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35),
                  inset 0 0.5px 0.5px rgba(255, 255, 255, 0.6);
      transition: padding 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    .dock-divider {
      width: 1px;
      height: 44px;
      background: rgba(255, 255, 255, 0.25);
      margin: 0 4px;
      align-self: center;
      transition: height 0.15s ease;
    }

    .dock-item {
      position: relative;
      width: 50px;
      height: 50px;
      border-radius: 12px;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      transform-origin: bottom center;
      will-change: transform, width, height;
      transition: transform 0.14s cubic-bezier(0.25, 1, 0.5, 1), margin 0.14s cubic-bezier(0.25, 1, 0.5, 1);
    }

    .dock-icon {
      width: 100%;
      height: 100%;
      border-radius: 13px;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
      font-size: 24px;
      color: white;
      position: relative;
      overflow: hidden;
      pointer-events: none;
    }

    .dock-dot {
      position: absolute;
      bottom: -6px;
      left: 50%;
      transform: translateX(-50%);
      width: 4px;
      height: 4px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.95);
      box-shadow: 0 0 4px rgba(255,255,255,0.8);
      transition: opacity 0.2s ease, transform 0.2s ease;
    }

    /* Floating Tooltip Pill */
    .dock-tooltip {
      position: absolute;
      top: -38px;
      left: 50%;
      transform: translateX(-50%) translateY(4px);
      background: rgba(25, 28, 34, 0.88);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      border: 0.5px solid rgba(255, 255, 255, 0.22);
      color: rgba(255, 255, 255, 0.95);
      font-size: 11.5px;
      font-weight: 500;
      padding: 4px 10px;
      border-radius: 8px;
      white-space: nowrap;
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.16s cubic-bezier(0.16, 1, 0.3, 1), transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
      box-shadow: 0 8px 18px rgba(0,0,0,0.35);
      z-index: 1000;
    }

    .dock-tooltip::after {
      content: '';
      position: absolute;
      bottom: -4px;
      left: 50%;
      transform: translateX(-50%) rotate(45deg);
      width: 7px;
      height: 7px;
      background: rgba(25, 28, 34, 0.88);
      border-right: 0.5px solid rgba(255, 255, 255, 0.22);
      border-bottom: 0.5px solid rgba(255, 255, 255, 0.22);
    }

    .dock-item:hover .dock-tooltip {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }

    /* App bouncing on dock click */
    @keyframes dockBounce {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-24px); }
    }
    .bouncing {
      animation: dockBounce 0.6s cubic-bezier(0.28, 0.84, 0.42, 1) infinite !important;
    }

    /* ==========================================================================
       LIFECYCLE ANIMATED macOS WINDOWS
       ========================================================================== */
    .mac-window {
      position: absolute;
      border-radius: 12px;
      overflow: hidden;
      box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55),
                  0 0 0 1px rgba(255, 255, 255, 0.15);
      backdrop-filter: blur(35px) saturate(190%);
      -webkit-backdrop-filter: blur(35px) saturate(190%);
      z-index: 10;
      transform-origin: center center;
      transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1),
          opacity 0.12s cubic-bezier(0.16, 1, 0.3, 1),
          top 0.18s cubic-bezier(0.16, 1, 0.3, 1),
          left 0.18s cubic-bezier(0.16, 1, 0.3, 1),
          width 0.18s cubic-bezier(0.16, 1, 0.3, 1),
          height 0.18s cubic-bezier(0.16, 1, 0.3, 1),
          border-radius 0.16s ease,
                  box-shadow 0.2s ease;
    }

    .mac-window.active-window {
      box-shadow: 0 32px 70px -8px rgba(0, 0, 0, 0.72),
                  0 0 0 1px rgba(255, 255, 255, 0.26);
      z-index: 50;
    }

    /* Window lifecycle state classes */
    .win-opening {
      animation: winOpenScale 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    .zooming-state {
      animation: zoomState 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .scale-effect {
      animation: scaleEffect 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .win-suck {
      animation: suckEffect 0.26s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    .appkit-fullscreen {
      animation: appkitFullscreen 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .live-resizing {
      transition: width 0.08s linear, height 0.08s linear, left 0.08s linear, top 0.08s linear, border-radius 0.08s ease;
      cursor: nwse-resize;
    }

    .frame-anim {
      animation: frameResize 0.18s ease-out;
    }

    @keyframes winOpenScale {
      0% {
        opacity: 0;
        transform: scale(0.85) translateY(18px);
      }
      100% {
        opacity: 1;
        transform: scale(1) translateY(0);
      }
    }

    @keyframes zoomState {
      0% { transform: scale(0.96); }
      45% { transform: scale(1.04); }
      100% { transform: scale(1); }
    }

    @keyframes scaleEffect {
      0% { opacity: 0.55; transform: scale(0.84); }
      70% { opacity: 1; transform: scale(1.025); }
      100% { opacity: 1; transform: scale(1); }
    }

    @keyframes suckEffect {
      0% { opacity: 1; transform: scale(1) translateY(0); }
      45% { opacity: 1; transform: scale(0.9) translateY(6px); }
      100% { opacity: 0; transform: scale(0.08) translateY(30px); }
    }

    @keyframes appkitFullscreen {
      0% { clip-path: inset(0 round 12px); filter: brightness(0.95) saturate(0.88); }
      100% { clip-path: inset(0 round 0px); filter: brightness(1) saturate(1); }
    }

    @keyframes frameResize {
      0% { box-shadow: 0 12px 32px -8px rgba(0,0,0,0.38); }
      50% { box-shadow: 0 30px 60px -8px rgba(0,0,0,0.62); }
      100% { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55); }
    }

    .win-closing {
      animation: winCloseSnap 0.22s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    @keyframes winCloseSnap {
      0% {
        opacity: 1;
        transform: scale(1);
      }
      100% {
        opacity: 0;
        transform: scale(0.88) translateY(12px);
      }
    }

    /* Genie / scale minimize transition — animates toward the real Dock icon */
    .mac-window {
      --genie-x: 0px;
      --genie-y: 280px;
    }
    .win-minimizing {
      pointer-events: none;
      animation: genieMinimize 0.42s cubic-bezier(0.32, 0, 0.67, 0) forwards !important;
      transform-origin: center bottom;
      will-change: transform, clip-path, opacity;
      contain: paint;
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      box-shadow: none !important;
      transition: none !important;
    }

    .win-unminimizing {
      animation: genieRestore 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
      will-change: transform, clip-path, opacity;
      contain: paint;
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      box-shadow: none !important;
      transition: none !important;
    }

    .win-opening {
      animation: genieRestore 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
      will-change: transform, clip-path, opacity;
      contain: paint;
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      box-shadow: none !important;
      transition: none !important;
    }

    @keyframes genieMinimize {
      0% {
        opacity: 1;
        transform: translate(0, 0) scale(1, 1) skewX(0deg);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
      }
      42% {
        opacity: 1;
        transform: translate(calc(var(--genie-x) * 0.36), calc(var(--genie-y) * 0.32)) scale(0.72, 0.78) skewX(-7deg);
        clip-path: polygon(0 0, 100% 0, 82% 100%, 18% 100%);
      }
      78% {
        opacity: 0.95;
        transform: translate(calc(var(--genie-x) * 0.82), calc(var(--genie-y) * 0.82)) scale(0.22, 0.32) skewX(4deg);
        clip-path: polygon(27% 0, 73% 0, 61% 100%, 39% 100%);
      }
      100% {
        opacity: 0;
        transform: translate(var(--genie-x), var(--genie-y)) scale(0.08, 0.12) skewX(0deg);
        clip-path: polygon(47% 0, 53% 0, 53% 100%, 47% 100%);
      }
    }

    @keyframes genieRestore {
      0% {
        opacity: 0;
        transform: translate(var(--genie-x), var(--genie-y)) scale(0.08, 0.12) skewX(0deg);
        clip-path: polygon(47% 0, 53% 0, 53% 100%, 47% 100%);
      }
      35% {
        opacity: 0.95;
        transform: translate(calc(var(--genie-x) * 0.7), calc(var(--genie-y) * 0.7)) scale(0.3, 0.4) skewX(-4deg);
        clip-path: polygon(25% 0, 75% 0, 62% 100%, 38% 100%);
      }
      70% {
        opacity: 1;
        transform: translate(calc(var(--genie-x) * 0.2), calc(var(--genie-y) * 0.2)) scale(0.76, 0.82) skewX(6deg);
        clip-path: polygon(0 0, 100% 0, 84% 100%, 16% 100%);
      }
      100% {
        opacity: 1;
        transform: translate(0, 0) scale(1, 1) skewX(0deg);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
      }
    }

    .window-header {
      height: 38px;
      background: rgba(36, 41, 46, 0.78);
      backdrop-filter: blur(20px);
      display: flex;
      align-items: center;
      padding: 0 14px;
      position: relative;
      cursor: move;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .window-controls {
      display: flex;
      gap: 7px;
      z-index: 2;
    }

    .win-btn {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 8px;
      color: rgba(0, 0, 0, 0.6);
      cursor: pointer;
      transition: transform 0.12s ease;
    }

    .win-btn:active {
      transform: scale(0.9);
    }

    .win-close { background: #ff5f56; border: 0.5px solid #e0443e; }
    .win-min { background: #ffbd2e; border: 0.5px solid #dea123; }
    .win-max { background: #27c93f; border: 0.5px solid #1aab29; }

    .win-title {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      font-weight: 500;
      color: rgba(255, 255, 255, 0.85);
      pointer-events: none;
    }

    /* Terminal Body */
    .terminal-body {
      background: rgba(18, 20, 24, 0.94);
      font-family: 'JetBrains Mono', monospace;
      color: #38bdf8;
      padding: 16px;
      height: calc(100% - 38px);
      overflow-y: auto;
      font-size: 13px;
      line-height: 1.5;
    }

    /* Finder Specific Styling */
    .finder-sidebar-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 5px 8px;
      border-radius: 6px;
      font-size: 12.5px;
      color: rgba(255, 255, 255, 0.8);
      cursor: pointer;
      transition: all 0.12s ease;
    }
    .finder-sidebar-item:hover {
      background: rgba(255, 255, 255, 0.1);
      color: #fff;
    }
    .finder-sidebar-item.active {
      background: rgba(0, 122, 255, 0.85);
      color: #ffffff;
      font-weight: 500;
    }

    .finder-file-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 10px 8px;
      border-radius: 8px;
      cursor: pointer;
      text-align: center;
      transition: background 0.15s ease;
    }
    .finder-file-item:hover {
      background: rgba(255, 255, 255, 0.08);
    }
    .finder-file-item.selected {
      background: rgba(0, 122, 255, 0.4);
      border: 1px solid rgba(0, 122, 255, 0.7);
    }

    /* Spotlight Search Overlay */
    .spotlight-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.28);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      z-index: 1200;
      display: none;
      align-items: flex-start;
      justify-content: center;
      padding-top: 14vh;
    }

    .spotlight-window {
      width: 620px;
      background: rgba(30, 36, 44, 0.9);
      backdrop-filter: blur(40px) saturate(200%);
      -webkit-backdrop-filter: blur(40px) saturate(200%);
      border: 0.5px solid rgba(255, 255, 255, 0.25);
      border-radius: 14px;
      box-shadow: 0 35px 70px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.15);
      overflow: hidden;
      animation: spotIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes spotIn {
      from { opacity: 0; transform: translateY(-12px) scale(0.98); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    /* ==========================================================================
       WINDOW RESIZE HANDLE
       ========================================================================== */
    .win-resize-handle {
      position: absolute;
      right: 0;
      bottom: 0;
      width: 18px;
      height: 18px;
      cursor: nwse-resize;
      z-index: 6;
      background: linear-gradient(135deg, transparent 55%, rgba(255,255,255,0.35) 55%, rgba(255,255,255,0.35) 65%, transparent 65%, transparent 75%, rgba(255,255,255,0.35) 75%, rgba(255,255,255,0.35) 85%, transparent 85%);
      opacity: 0;
      transition: opacity 0.15s ease;
    }
    .mac-window:hover .win-resize-handle { opacity: 1; }

    /* ==========================================================================
       WINDOW SNAP PREVIEW
       ========================================================================== */
    #snapPreview {
      position: fixed;
      background: rgba(10, 132, 255, 0.25);
      border: 1.5px solid rgba(255, 255, 255, 0.55);
      border-radius: 10px;
      z-index: 9000;
      pointer-events: none;
      display: none;
      transition: top 0.1s ease, left 0.1s ease, width 0.1s ease, height 0.1s ease;
    }

    /* ==========================================================================
       MISSION CONTROL
       ========================================================================== */
    #missionControlOverlay {
      position: fixed;
      inset: 0;
      z-index: 5000;
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 28px;
      padding: 70px 40px 40px;
      background: rgba(8, 12, 18, 0.55);
      backdrop-filter: blur(40px) saturate(160%);
      -webkit-backdrop-filter: blur(40px) saturate(160%);
      animation: popoverDrop 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .mission-hint {
      color: rgba(255,255,255,0.55);
      font-size: 13px;
      font-weight: 500;
      letter-spacing: 0.02em;
    }
    #missionControlGrid {
      display: flex;
      flex-wrap: wrap;
      gap: 30px;
      justify-content: center;
      align-items: center;
      max-width: 1400px;
      overflow-y: auto;
    }
    .mission-thumb {
      width: 300px;
      height: 190px;
      border-radius: 13px;
      overflow: hidden;
      cursor: pointer;
      position: relative;
      background: #14181f;
      box-shadow: 0 20px 45px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.12);
      transform: scale(1);
      transition: transform 0.15s cubic-bezier(0.16,1,0.3,1), box-shadow 0.15s ease;
    }
    .mission-thumb:hover {
      transform: scale(1.045) translateY(-4px);
      box-shadow: 0 30px 60px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.25);
    }
    .mission-thumb-label {
      position: absolute;
      bottom: 0; left: 0; right: 0;
      padding: 7px 12px;
      font-size: 12px;
      font-weight: 500;
      color: #fff;
      background: linear-gradient(0deg, rgba(0,0,0,0.7), transparent);
      z-index: 2;
    }
    .mission-thumb-preview {
      transform: scale(0.32);
      transform-origin: top left;
      width: 312%;
      height: 312%;
      pointer-events: none;
    }

    /* ==========================================================================
       DESKTOP / DOCK RIGHT-CLICK CONTEXT MENUS
       ========================================================================== */
    #desktopContextMenu, #dockContextMenu {
      min-width: 210px;
    }
    .dock-ctx-title {
      border-bottom: 1px solid rgba(255,255,255,0.1);
      margin-bottom: 3px;
    }

    /* ==========================================================================
       TOAST NOTIFICATIONS & NOTIFICATION CENTER
       ========================================================================== */
    #toastStack {
      position: fixed;
      top: 36px;
      right: 12px;
      z-index: 8000;
      display: flex;
      flex-direction: column;
      gap: 8px;
      pointer-events: none;
    }
    .mac-toast {
      width: 300px;
      background: rgba(40, 46, 54, 0.92);
      backdrop-filter: blur(30px) saturate(200%);
      -webkit-backdrop-filter: blur(30px) saturate(200%);
      border: 0.5px solid rgba(255,255,255,0.2);
      border-radius: 12px;
      box-shadow: 0 18px 38px rgba(0,0,0,0.5);
      padding: 10px 12px;
      display: flex;
      gap: 10px;
      align-items: flex-start;
      color: #fff;
      pointer-events: auto;
      animation: toastIn 0.25s cubic-bezier(0.16,1,0.3,1);
    }
    .mac-toast.toast-out {
      animation: toastOut 0.22s ease forwards;
    }
    @keyframes toastIn {
      from { opacity: 0; transform: translateX(30px) scale(0.96); }
      to { opacity: 1; transform: translateX(0) scale(1); }
    }
    @keyframes toastOut {
      from { opacity: 1; transform: translateX(0) scale(1); }
      to { opacity: 0; transform: translateX(30px) scale(0.96); }
    }
    .toast-icon {
      width: 26px; height: 26px; border-radius: 7px;
      display: flex; align-items: center; justify-content: center;
      background: linear-gradient(180deg,#51a6f8,#157bfb);
      font-size: 12px; flex-shrink: 0; margin-top: 1px;
    }
    .toast-title { font-size: 12.5px; font-weight: 600; }
    .toast-body { font-size: 11.5px; color: rgba(255,255,255,0.65); margin-top: 1px; }
    .notif-item {
      background: rgba(255,255,255,0.07);
      border-radius: 10px;
      padding: 9px 10px;
      font-size: 12px;
    }
    .notif-item .notif-title { font-weight: 600; font-size: 12.5px; }
    .notif-item .notif-body { color: rgba(255,255,255,0.6); font-size: 11.5px; margin-top: 1px; }
    .notif-item .notif-time { color: rgba(255,255,255,0.35); font-size: 10px; margin-top: 3px; }

    /* Custom App Icons Styling */
    .icon-finder { background: linear-gradient(180deg, #51a6f8 0%, #157bfb 100%); }
    .icon-launchpad { background: linear-gradient(180deg, #5c6270 0%, #2f343f 100%); }
    .icon-safari { background: linear-gradient(180deg, #ffffff 0%, #d8e5f8 100%); color: #007aff; }
    .icon-messages { background: linear-gradient(180deg, #5fe371 0%, #34c759 100%); }
    .icon-mail { background: linear-gradient(180deg, #44a4f8 0%, #107df9 100%); }
    .icon-maps { background: linear-gradient(180deg, #fffae0 0%, #cadbf7 100%); color: #22c55e; }
    .icon-photos { background: radial-gradient(circle, #ffe169, #ff5c77, #aa5eff); }
    .icon-facetime { background: linear-gradient(180deg, #4ed366 0%, #28b849 100%); }
    .icon-calendar { background: white; color: #ff3b30; }
    .icon-notes { background: linear-gradient(180deg, #fff7c2 0%, #fbd550 100%); color: #856404; }
    .icon-terminal { background: linear-gradient(180deg, #2b2b2b 0%, #141414 100%); border: 1px solid #444; }
    .icon-music { background: linear-gradient(180deg, #fc5b75 0%, #ea2649 100%); }
    .icon-settings { background: linear-gradient(180deg, #8a8d91 0%, #5d6166 100%); }
    .icon-trash { background: rgba(255, 255, 255, 0.4); backdrop-filter: blur(10px); color: #333; }

    /* Tahoe 2026 visual layer. Interaction and window lifecycle rules remain above. */
    :root {
      --tahoe-ink: #f8fafc;
      --tahoe-muted: rgba(226, 232, 240, 0.68);
      --tahoe-glass: rgba(15, 23, 42, 0.62);
      --tahoe-border: rgba(255, 255, 255, 0.16);
      --tahoe-cyan: #67e8f9;
      --tahoe-violet: #a78bfa;
    }

    body {
      background: #030712;
      color: var(--tahoe-ink);
    }

    .wallpaper {
      background:
        radial-gradient(circle at 18% 12%, rgba(99, 102, 241, 0.34), transparent 36%),
        radial-gradient(circle at 83% 84%, rgba(236, 72, 153, 0.28), transparent 38%),
        radial-gradient(circle at 55% 42%, rgba(56, 189, 248, 0.22), transparent 34%),
        radial-gradient(circle at 50% 50%, #111827 0%, #090d16 54%, #030712 100%);
      background-size: 130% 130%;
      animation: tahoeAmbientFlow 28s ease-in-out infinite alternate;
    }

    .wallpaper-mesh {
      background:
        radial-gradient(ellipse at 12% 78%, rgba(129, 140, 248, 0.34), transparent 52%),
        radial-gradient(ellipse at 88% 20%, rgba(244, 114, 182, 0.24), transparent 48%),
        radial-gradient(ellipse at 52% 52%, rgba(34, 211, 238, 0.18), transparent 48%);
      filter: blur(54px) saturate(125%);
      opacity: 0.8;
    }

    @keyframes tahoeAmbientFlow {
      0% { background-position: 0% 12%; }
      50% { background-position: 70% 82%; }
      100% { background-position: 100% 18%; }
    }

    .menubar {
      height: 30px;
      background: rgba(15, 23, 42, 0.58);
      border-bottom-color: var(--tahoe-border);
      color: rgba(248, 250, 252, 0.92);
      backdrop-filter: blur(28px) saturate(180%);
      -webkit-backdrop-filter: blur(28px) saturate(180%);
    }

    .mac-window {
      background: rgba(18, 24, 43, 0.86);
      border-color: var(--tahoe-border);
      box-shadow: 0 28px 64px -18px rgba(0, 0, 0, 0.78), 0 0 0 1px rgba(255,255,255,0.06);
      backdrop-filter: blur(36px) saturate(175%);
      -webkit-backdrop-filter: blur(36px) saturate(175%);
    }

    .mac-window.active-window {
      border-color: rgba(103, 232, 249, 0.28);
      box-shadow: 0 36px 80px -18px rgba(0, 0, 0, 0.86), 0 0 0 1px rgba(103, 232, 249, 0.14);
    }

    .window-header {
      height: 42px;
      background: rgba(255, 255, 255, 0.045);
      border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    .terminal-body {
      background: rgba(5, 10, 20, 0.94);
      color: #a5f3fc;
    }

    .dock {
      background: rgba(24, 32, 54, 0.58);
      border-color: var(--tahoe-border);
      box-shadow: 0 22px 44px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.28);
      backdrop-filter: blur(38px) saturate(190%);
      -webkit-backdrop-filter: blur(38px) saturate(190%);
    }

    .dock-icon {
      box-shadow: 0 9px 18px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255,255,255,0.22);
    }

    .mac-menu-dropdown,
    .mac-popover,
    .spotlight-window {
      background: rgba(15, 23, 42, 0.88);
      border-color: var(--tahoe-border);
      box-shadow: 0 24px 55px rgba(0,0,0,0.62), 0 0 0 1px rgba(255,255,255,0.06);
    }

    .desktop-folders {
      position: absolute;
      top: 54px;
      right: 28px;
      z-index: 8;
      display: grid;
      grid-template-columns: repeat(2, 88px);
      gap: 18px 14px;
      width: 190px;
    }

    .desktop-folder {
      appearance: none;
      border: 0;
      background: transparent;
      color: var(--tahoe-ink);
      width: 88px;
      min-height: 94px;
      padding: 7px 5px;
      border-radius: 12px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 7px;
      cursor: pointer;
      text-align: center;
      transition: background 0.16s ease, transform 0.16s ease;
    }

    .desktop-folder:hover,
    .desktop-folder:focus-visible {
      background: rgba(255, 255, 255, 0.13);
      outline: none;
      transform: translateY(-2px);
    }

    .desktop-folder:active {
      transform: scale(0.96);
    }

    .desktop-folder-icon {
      width: 56px;
      height: 50px;
      display: grid;
      place-items: center;
      border: 1px solid rgba(255, 255, 255, 0.22);
      border-radius: 14px;
      background: linear-gradient(145deg, rgba(56, 189, 248, 0.38), rgba(37, 99, 235, 0.22));
      box-shadow: inset 0 1px 1px rgba(255,255,255,0.24), 0 10px 22px rgba(0,0,0,0.24);
      color: #7dd3fc;
      font-size: 25px;
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
    }

    .desktop-folder-label {
      max-width: 82px;
      overflow-wrap: anywhere;
      color: rgba(248, 250, 252, 0.92);
      font-size: 11px;
      font-weight: 600;
      line-height: 1.15;
      text-shadow: 0 2px 5px rgba(0,0,0,0.75);
    }

    .desktop-widgets-area {
      position: absolute;
      top: 54px;
      right: 238px;
      z-index: 8;
      width: 238px;
      display: grid;
      gap: 12px;
    }

    .widget-card {
      width: 100%;
      border: 1px solid rgba(255, 255, 255, 0.14);
      border-radius: 16px;
      padding: 13px;
      color: rgba(248, 250, 252, 0.92);
      text-align: left;
      background: rgba(15, 23, 42, 0.48);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.13), 0 14px 30px rgba(0,0,0,0.22);
      backdrop-filter: blur(22px) saturate(150%);
      -webkit-backdrop-filter: blur(22px) saturate(150%);
    }

    button.widget-card {
      font: inherit;
      cursor: pointer;
    }

    .widget-card:hover,
    .widget-card:focus-visible {
      border-color: rgba(103, 232, 249, 0.42);
      outline: none;
      transform: translateY(-2px);
    }

    .widget-heading,
    .widget-meta {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      font-size: 11px;
    }

    .widget-heading i { color: #fbbf24; }
    .time-widget .widget-heading i { color: #fbbf24; }
    .time-widget strong { display: block; margin-top: 5px; font-size: 25px; letter-spacing: -0.03em; }
    .widget-accent { display: block; margin-top: 3px; color: #67e8f9; font-size: 10px; }
    .widget-divider { height: 1px; margin: 10px 0 8px; background: rgba(255,255,255,0.1); }
    .widget-meta { color: rgba(226,232,240,0.62); font-size: 10px; }
    .widget-meta b { color: #86efac; }
    .intelligence-widget { background: linear-gradient(145deg, rgba(49, 46, 129, 0.52), rgba(88, 28, 135, 0.38)); }
    .intelligence-widget .widget-heading span i { color: #c4b5fd; margin-right: 5px; }
    .intelligence-widget .widget-heading > i { color: #34d399; font-size: 7px; }
    .widget-card p { margin: 8px 0 11px; color: rgba(226,232,240,0.68); font-size: 10.5px; line-height: 1.45; }
    .widget-action { display: flex; align-items: center; justify-content: space-between; padding: 7px 8px; border-radius: 9px; background: rgba(255,255,255,0.1); color: #ddd6fe; font-size: 10px; }
    .theme-widget .widget-heading span i { color: #fbbf24; margin-right: 5px; }
    .theme-widget .widget-heading b { color: #fcd34d; font: 700 10px 'JetBrains Mono', monospace; }

    .ai-chat-shell { display: flex; flex-direction: column; height: 100%; min-height: 330px; gap: 12px; }
    .ai-chat-intro { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.1); }
    .ai-chat-intro h2 { margin: 0; font-size: 17px; font-weight: 700; color: #f5f3ff; }
    .ai-chat-intro p { margin: 3px 0 0; font-size: 11px; color: rgba(226,232,240,0.62); }
    .ai-orb { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: white; background: linear-gradient(135deg, #c084fc, #6366f1, #0ea5e9); box-shadow: 0 0 24px rgba(129,140,248,0.42); }
    .ai-chat-history { flex: 1; min-height: 150px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
    .ai-message { max-width: 84%; padding: 9px 11px; border-radius: 14px; font-size: 11px; line-height: 1.45; white-space: pre-wrap; }
    .ai-message-assistant { align-self: flex-start; color: rgba(248,250,252,0.9); background: rgba(255,255,255,0.09); border-bottom-left-radius: 4px; }
    .ai-message-user { align-self: flex-end; color: white; background: linear-gradient(135deg, #7c3aed, #2563eb); border-bottom-right-radius: 4px; }
    .ai-chat-form { display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.1); }
    .ai-chat-form input { flex: 1; min-width: 0; border: 1px solid rgba(255,255,255,0.16); border-radius: 11px; background: rgba(0,0,0,0.22); color: white; padding: 9px 11px; font: 11px var(--font-system); outline: none; }
    .ai-chat-form input:focus { border-color: rgba(167,139,250,0.8); box-shadow: 0 0 0 3px rgba(139,92,246,0.16); }
    .ai-chat-form button { width: 34px; height: 34px; border: 0; border-radius: 10px; color: white; background: #7c3aed; cursor: pointer; }
    .ai-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
    .ai-suggestions button { border: 1px solid rgba(196,181,253,0.25); border-radius: 999px; padding: 5px 8px; color: #ddd6fe; background: rgba(124,58,237,0.14); cursor: pointer; font-size: 10px; }
    .ai-suggestions button:hover { background: rgba(124,58,237,0.32); }

    .folder-resume .desktop-folder-icon { color: #fb7185; background: linear-gradient(145deg, rgba(244, 63, 94, 0.32), rgba(124, 58, 237, 0.2)); }
    .folder-research .desktop-folder-icon { color: #c4b5fd; background: linear-gradient(145deg, rgba(139, 92, 246, 0.34), rgba(37, 99, 235, 0.2)); }
    .folder-notes .desktop-folder-icon { color: #fbbf24; background: linear-gradient(145deg, rgba(245, 158, 11, 0.34), rgba(234, 88, 12, 0.18)); }
    .folder-contact .desktop-folder-icon { color: #86efac; background: linear-gradient(145deg, rgba(34, 197, 94, 0.3), rgba(14, 165, 233, 0.2)); }

    @media (max-width: 900px) {
      .desktop-folders {
        top: 42px;
        right: 10px;
        grid-template-columns: repeat(2, 72px);
        gap: 8px;
        width: 150px;
      }

      .desktop-widgets-area {
        top: 42px;
        right: 165px;
        width: 174px;
      }

      .desktop-folder {
        width: 72px;
        min-height: 78px;
        padding: 4px;
      }

      .desktop-folder-icon {
        width: 44px;
        height: 40px;
        font-size: 19px;
      }

      .desktop-folder-label {
        max-width: 68px;
        font-size: 10px;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .wallpaper,
      .wallpaper-mesh,
      .win-minimizing,
      .win-unminimizing,
      .win-opening {
        animation-duration: 0.01ms !important;
      }
    }
