
        /* --- CORE OS STYLES --- */
        body, html {
            margin: 0;
            padding: 0;
            height: 100%;
            width: 100%;
            overflow: hidden;
            font-family: 'Pixelated MS Sans Serif', Arial, sans-serif;
            background-color: #008080;
            user-select: none;
        }

        body.script-active { cursor: none; }
        * { -webkit-font-smoothing: none; -moz-osx-font-smoothing: grayscale; }

        .hidden { display: none !important; }

        /* --- UTILITIES --- */
        #fake-cursor {
            position: absolute;
            width: 12px;
            height: 19px;
            background-image: url("data:image/svg+xml,%3Csvg width='12' height='19' viewBox='0 0 12 19' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M0 0L0 19L4 14L7 18L9 18L6 13L11 13L0 0Z' fill='white' stroke='black' stroke-width='1'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            z-index: 99999;
            pointer-events: none;
            transition: all 0.1s linear;
            display: none;
        }

        /* --- LOGIN OVERLAY --- */
        #login-overlay {
            position: fixed;
            inset: 0;
            background: #008080;
            z-index: 5000;
            display: none;
            justify-content: center;
            align-items: center;
        }

        .login-window { width: 350px; box-shadow: 2px 2px 10px rgba(0,0,0,0.5); }
        .login-content { display: flex; padding: 10px; }
        .key-icon {
            width: 48px; height: 48px; margin-right: 15px;
            background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23C0C0C0'%3E%3Cpath d='M12.65 10C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H17v4h4v-4h2v-4H12.65zM7 14c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z'/%3E%3C/svg%3E");
            background-size: contain; background-repeat: no-repeat;
        }
        .login-row { display: flex; align-items: center; margin-bottom: 8px; font-size: 11px; }
        .login-row label { width: 70px; }
        .login-row input { flex-grow: 1; }

        /* --- DESKTOP ICONS --- */
        #desktop {
            position: absolute;
            inset: 0;
            z-index: 1;
        }

        .desktop-icon {
            position: absolute;
            width: 70px;
            display: flex;
            flex-direction: column;
            align-items: center;
            color: white;
            font-size: 11px;
            text-align: center;
            cursor: pointer;
            z-index: 10;
            border: 1px solid transparent;
        }
        .desktop-icon img { width: 32px; height: 32px; margin-bottom: 4px; }
        .desktop-icon span { padding: 2px; border: 1px dotted transparent; }
        .desktop-icon:hover { border: 1px solid transparent; } /* Placeholder for hover effect */
        .desktop-icon:hover span { background: rgba(0,0,128,0.5); }
        .desktop-icon:active span { background: #000080; border-color: yellow; }

        /* --- WINDOW MANAGEMENT --- */
        .window-app {
            position: absolute;
            display: none;
            box-shadow: 1px 1px 0 black;
        }

        .window-body-fixed {
            margin: 0;
            padding: 0;
            height: calc(100% - 28px); /* Account for title bar height */
            display: flex;
            flex-direction: column;
        }
        
        /* Specific Z-Indices handled by JS now, but defaults provided */
        #aim-signon { top: 80px; left: 80px; width: 220px; }
        #aim-buddylist { top: 50px; left: 50px; width: 200px; height: 400px; }
        #aim-chat { top: 60px; left: 100px; width: 320px; height: 350px; }

        /* --- AIM SIGN ON --- */
        .aim-logo-large {
            display: block; margin: 0 auto 10px auto;
            width: 50px; height: 50px;
            background: #000080;
            clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 100%, 0% 100%, 0% 20%);
            display: flex; align-items: center; justify-content: center; color: white; font-weight: bold;
            box-shadow: 2px 2px 0px rgba(0,0,0,0.5);
        }

        /* --- AIM BUDDY LIST --- */
        .buddy-list-container {
            background: white;
            border: 2px inset #dfdfdf;
            flex-grow: 1; /* Allow it to fill remaining space */
            overflow-y: auto;
            background: #ffffcc; /* Classic AIM yellow tint */
        }
        .buddy-group { 
            font-weight: bold; padding: 2px 5px; cursor: pointer; 
            font-size: 11px; user-select: none;
        }
        .buddy-group:hover { color: blue; }

        .buddy-item {
            padding-left: 20px;
            cursor: pointer;
            display: flex;
            align-items: center;
            font-size: 11px;
            padding-top: 2px;
            padding-bottom: 2px;
        }
        .buddy-item:hover { background: #000080; color: white !important; }
        .buddy-item.online { color: black; }
        .buddy-item.offline { color: gray; }
        
        /* Tiny icon for buddy */
        .buddy-icon-small {
            width: 10px; height: 10px; background: yellow; margin-right: 4px;
            border: 1px solid black; display: inline-block;
        }
        .buddy-item.offline .buddy-icon-small { background: gray; }

        /* --- AIM CHAT WINDOW --- */
        .aim-menu { 
            padding: 2px 5px; font-size: 11px; background: #c0c0c0; 
            border-bottom: 1px solid #808080; 
        }
        .aim-menu span { margin-right: 10px; cursor: pointer; }
        .aim-menu span:hover { background: #000080; color: white; }

        .chat-layout {
            display: flex; flex-direction: column; 
            flex-grow: 1; /* Fill remaining space in window body */
            padding: 4px; box-sizing: border-box; background: #c0c0c0;
            overflow: hidden;
        }

        .chat-log {
            flex-grow: 1;
            background: white;
            border: 2px inset #dfdfdf;
            margin-bottom: 4px;
            padding: 5px;
            overflow-y: scroll;
            font-size: 13px;
            font-family: 'Arial', sans-serif;
            word-wrap: break-word;
        }

        .chat-toolbar {
            height: 28px;
            display: flex;
            align-items: center;
            background: #c0c0c0;
            margin-bottom: 4px;
            padding: 0 2px;
        }

        /* Improved Toolbar Buttons */
        .fmt-btn {
            min-width: 23px; height: 22px;
            margin-right: 2px;
            display: flex; align-items: center; justify-content: center;
            font-size: 12px; font-weight: bold; font-family: 'Times New Roman';
            background: #c0c0c0;
            box-shadow: inset 1px 1px #dfdfdf, inset -1px -1px #000, inset 1px 1px #fff, inset -1px -1px #808080;
            cursor: pointer;
        }
        .fmt-btn:active {
            box-shadow: inset 1px 1px #000, inset -1px -1px #dfdfdf, inset 1px 1px #808080, inset -1px -1px #fff;
            padding-top: 2px; padding-left: 2px; /* Press effect */
        }

        .chat-input-area {
            height: 60px;
            background: white;
            border: 2px inset #dfdfdf;
            margin-bottom: 4px;
            font-family: 'Arial', sans-serif;
            font-size: 13px;
            padding: 4px;
            outline: none;
            resize: none;
        }

        .chat-controls {
            display: flex; justify-content: space-between; align-items: center;
            flex-shrink: 0; /* Prevent shrinking */
        }
        .chat-controls-left { font-size: 11px; display: flex; align-items: center; gap: 4px; }
        .warn-link { color: blue; text-decoration: underline; cursor: pointer; }

        .msg-line { margin-bottom: 2px; }
        .msg-user { color: blue; font-weight: bold; font-family: 'Arial'; }
        .msg-user.me { color: red; }
        .msg-text { color: black; margin-left: 4px; }

        /* --- TASKBAR & START MENU --- */
        #taskbar {
            position: fixed; bottom: 0; left: 0; right: 0; height: 28px;
            background: #c0c0c0; 
            border-top: 2px solid #dfdfdf; 
            display: flex; z-index: 9000;
            padding: 2px;
            box-sizing: border-box;
            box-shadow: 0 -1px 0 #808080; /* Slight shading on top */
        }
        
        .start-btn { 
            display: flex; align-items: center; font-weight: bold; margin-right: 2px; 
            height: 22px;
            padding: 0 4px;
        }
        .start-btn img { margin-right: 4px; width: 16px; }
        .start-btn.active {
            box-shadow: inset 1px 1px #000, inset -1px -1px #dfdfdf, inset 1px 1px #808080, inset -1px -1px #fff;
            background: #e0e0e0;
        }

        .divider {
            border-left: 1px solid #808080; border-right: 1px solid white;
            width: 2px; height: 20px; margin: 0 4px;
        }

        .tasks-container {
            display: flex; flex-grow: 1; overflow-x: auto;
        }

        .taskbar-item {
            width: 150px; height: 22px;
            margin-right: 2px;
            display: flex; align-items: center;
            padding: 0 5px;
            font-size: 11px;
            background: #c0c0c0;
            box-shadow: inset 1px 1px #dfdfdf, inset -1px -1px #000, inset 1px 1px #fff, inset -1px -1px #808080;
            cursor: default;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .taskbar-item.active {
             box-shadow: inset 1px 1px #000, inset -1px -1px #dfdfdf, inset 1px 1px #808080, inset -1px -1px #fff;
             background: #e0e0e0; /* Checked look */
             font-weight: bold;
        }
        .taskbar-item img { width: 16px; height: 16px; margin-right: 5px; }

        .tray { 
            margin-left: auto; 
            border: 2px inset #dfdfdf; 
            padding: 0 5px; 
            display: flex; align-items: center; 
            font-size: 11px; 
            background: #c0c0c0;
            min-width: 60px;
            justify-content: center;
        }

        /* Start Menu Popup */
        #start-menu {
            position: fixed; bottom: 28px; left: 2px;
            width: 180px;
            background: #c0c0c0;
            box-shadow: inset 1px 1px #dfdfdf, inset -1px -1px #000, inset 1px 1px #fff, inset -1px -1px #808080;
            display: none;
            z-index: 9999;
        }
        .start-side-bar {
            width: 25px; background: #000080; color: white;
            display: flex; align-items: flex-end; justify-content: center;
            padding-bottom: 5px;
            writing-mode: vertical-rl; transform: rotate(180deg);
            font-weight: bold; font-size: 14px;
            background: linear-gradient(to bottom, #000080, #1084d0);
        }
        .start-content { flex-grow: 1; display: flex; flex-direction: column; }
        .start-item {
            padding: 6px 10px; display: flex; align-items: center; font-size: 11px;
            cursor: pointer;
        }
        .start-item:hover { background: #000080; color: white; }
        .start-item img { width: 24px; height: 24px; margin-right: 8px; }
        
        #status-text {
            font-size: 11px;
            color: red;
            text-align: center;
            margin-top: 5px;
            min-height: 14px;
        }

        /* --- EXTRAS --- */
        #bsod {
            position: fixed; inset: 0; background: #0000AA; color: white;
            font-family: 'Courier New', Courier, monospace; font-weight: bold;
            z-index: 999999; display: none; padding: 10% 15%; cursor: none;
            font-size: 20px; line-height: 1.5; white-space: pre-wrap;
        }
        #shutdown-screen {
            position: fixed; inset: 0; background: black; color: #e69d45;
            display: flex; align-items: center; justify-content: center;
            font-family: 'Times New Roman', serif; font-style: italic; font-weight: bold; font-size: 32px;
            z-index: 999999; display: none;
        }
        #reboot-screen {
            position: fixed; inset: 0; background: black; color: white;
            font-family: 'Courier New', Courier, monospace;
            padding: 20px;
            z-index: 999999; display: none;
        }
        #logout-screen {
            position: fixed; inset: 0; 
            background: #008080 url("https://win98icons.alexmeub.com/images/start-menu-98.png") no-repeat center;
            background-size: contain;
            display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
            padding-bottom: 100px;
            z-index: 999998; display: none;
            color: white; font-size: 24px; font-weight: bold; text-shadow: 2px 2px black;
        }

        #tray-bubble {
            position: fixed; bottom: 32px; right: 5px;
            background: #ffffe1; border: 1px solid black; padding: 6px 10px;
            font-size: 11px; z-index: 10000; display: none;
            box-shadow: 1px 1px 0 rgba(0,0,0,0.5); width: 160px;
            pointer-events: none;
        }
        #tray-bubble::after {
            content: ""; position: absolute; bottom: -8px; right: 20px;
            border-width: 8px 8px 0 0; border-style: solid;
            border-color: #ffffe1 transparent transparent transparent;
        }
        #tray-bubble::before {
            content: ""; position: absolute; bottom: -9px; right: 19px;
            border-width: 9px 9px 0 0; border-style: solid;
            border-color: black transparent transparent transparent;
        }
     