body {
    background-color: #008080;
    font-family: 'IBM Plex Sans', sans-serif;
    overflow: hidden;
    /* Hide main scrollbar */
    -webkit-font-smoothing: none;
    /* Attempt to make font less smooth */
    -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-track {
    background: #a0a0a0;
}

::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-top: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
    border-right: 1px solid #808080;
    border-bottom: 1px solid #808080;
}

::-webkit-scrollbar-button {
    background-color: #c0c0c0;
    border-top: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
    border-right: 1px solid #808080;
    border-bottom: 1px solid #808080;
    display: block;
    height: 16px;
    width: 16px;
}

::-webkit-scrollbar-button:active {
    border-top: 1px solid #808080;
    border-left: 1px solid #808080;
}


.window {
    background-color: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    min-width: 350px;
    display: flex;
    flex-direction: column;
}

/* --- Window States --- */
.window.active .title-bar {
    background: linear-gradient(to right, #000080, #1084d0);
    color: white;
}

.window.active .system-menu::after {
    background-color: white;
}

.window:not(.active) .title-bar {
    background: #c0c0c0;
    color: #808080;
}

.window:not(.active) .title-button {
    border-color: #c0c0c0;
    background-color: #c0c0c0;
}

.window:not(.active) .system-menu::before,
.window:not(.active) .hide-button::after,
.window:not(.active) .max-button::after {
    border-color: #808080 !important;
}

.window:not(.active) .system-menu::after {
    background-color: #808080 !important;
}


.title-bar {
    padding: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    user-select: none;
    cursor: grab;
}

.title-bar:active {
    cursor: grabbing;
}

.title-bar-text {
    padding-left: 5px;
    flex-grow: 1;
}

.title-bar-left,
.title-bar-right {
    display: flex;
    align-items: center;
}

.title-bar-controls {
    display: flex;
    align-items: center;
}

.title-bar-controls button {
    width: 20px;
    height: 20px;
    border-top: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
    border-right: 1px solid #808080;
    border-bottom: 1px solid #808080;
    margin: 0 2px;
    position: relative;
    background-color: #c0c0c0;
    cursor: pointer;
    padding: 0;
}

.title-bar-controls button[aria-label="Minimize"]::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border: 1px solid #000080;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.title-bar-controls button[aria-label="Maximize"]::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid #000080;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-sizing: border-box;
}

.title-bar-controls button[aria-label="Close"]::before {
    content: '×';
    color: #000080;
    font-weight: bold;
    font-size: 14px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.system-menu::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 9px;
    background-color: #c0c0c0;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-top: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
    border-right: 1px solid #808080;
    border-bottom: 1px solid #808080;
}

.system-menu::after {
    content: '';
    position: absolute;
    height: 2px;
    width: 10px;
    top: 6px;
    left: 4px;
}


.hide-button::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border: 1px solid #000080;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.max-button::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid #000080;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-sizing: border-box;
}

.menu-bar {
    background-color: #c0c0c0;
    padding: 3px 5px;
    display: flex;
    border-bottom: 1px solid #808080;
    user-select: none;
}

.menu-bar span {
    padding: 2px 5px;
    margin-right: 5px;
}

.window-body {
    padding: 10px;
    overflow-y: auto;
    background-color: #c0c0c0;
}

.content {
    /* Legacy content class support */
}

.title-bar-text {
    padding-left: 5px;
    flex-grow: 1;
}

/* --- Desktop Icons --- */
.desktop-icon {
    position: absolute;
    width: 80px;
    text-align: center;
    color: white;
    user-select: none;
    cursor: default;
}

.desktop-icon .icon-image {
    width: 50px;
    height: 40px;
    margin: 0 auto 5px auto;
}

.desktop-icon span {
    background-color: #008080;
    padding: 2px 4px;
}

.folder-icon {
    background-color: #ffcc00;
    border: 1px solid #808080;
}

.program-icon {
    background-color: #c0c0c0;
    border: 1px solid #808080;
}


/* --- Components --- */

/* --- Components --- */
button {
    background-color: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    padding: 4px 16px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    margin: 2px;
}

button:active {
    border-color: #808080 #ffffff #ffffff #808080;
}

button.default {
    border: 4px double;
    border-color: #808080 #ffffff #ffffff #808080;
    padding: 2px 14px;
}

button:disabled {
    background-color: #c0c0c0;
    color: #808080;
    text-shadow: 1px 1px #ffffff;
    cursor: default;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
}

button:focus,
input[type="text"]:focus {
    outline: 1px dotted #000;
    outline-offset: -4px;
}

fieldset {
    border: 1px solid #808080;
    border-right-color: #fff;
    border-bottom-color: #fff;
    padding: 15px;
    margin: 10px 0;
}

legend {
    padding: 0 5px;
    font-weight: bold;
}

input[type="text"] {
    background-color: #ffffff;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    padding: 4px;
    font-family: inherit;
}

label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 5px;
    font-size: 14px;
}

input[type="checkbox"],
input[type="radio"] {
    appearance: none;
    width: 16px;
    height: 16px;
    background-color: #ffffff;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

input[type="checkbox"]:checked::after {
    content: '✓';
    font-size: 14px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
}

input[type="radio"] {
    border-radius: 50%;
}

input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: #000;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}


.os2-label {
    display: inline-flex;
    align-items: center;
    cursor: default;
    user-select: none;
}

.os2-checkbox {
    display: none;
    /* Hide original checkbox */
}

.os2-label span {
    padding-left: 5px;
}

.os2-label .os2-checkbox+span::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 5px;
    background-color: #ffffff;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
}

.os2-label .os2-checkbox:checked+span::before {
    content: '✓';
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    line-height: 14px;
    color: #000;
}

.status-bar {
    display: flex;
    border-top: 1px solid #808080;
    padding: 2px;
}

.status-panel {
    border: 1px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    padding: 2px 5px;
    margin-right: 2px;
    flex-grow: 1;
}

/* --- Dialog Specific Styles --- */
.dialog-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    /* Prevent icon from shrinking */
    background-color: #c0c0c0;
    /* Default background */
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.info-icon {
    background-color: #000080;
    /* Blue background for info icon */
}

.info-icon::before {
    content: 'i';
    color: white;
    font-size: 24px;
    font-weight: bold;
    font-family: 'IBM Plex Sans', sans-serif;
    line-height: 1;
}

/* --- Resize Handles --- */
.window {
    position: absolute;
    /* Ensure window is positioned for handle's absolute positioning */
}

.resize-handle {
    position: absolute;
    background: transparent;
    /* Invisible for now */
    z-index: 10;
    /* Above window content but below modal */
}

/* Corner handles */
.resize-handle.nw-resize,
.resize-handle.se-resize,
.resize-handle.ne-resize,
.resize-handle.sw-resize {
    width: 10px;
    height: 10px;
}

.resize-handle.nw-resize {
    top: 0;
    left: 0;
    cursor: nw-resize;
}

.resize-handle.ne-resize {
    top: 0;
    right: 0;
    cursor: ne-resize;
}

.resize-handle.sw-resize {
    bottom: 0;
    left: 0;
    cursor: sw-resize;
}

.resize-handle.se-resize {
    bottom: 0;
    right: 0;
    cursor: se-resize;
}

/* Edge handles */
.resize-handle.n-resize,
.resize-handle.s-resize {
    left: 10px;
    right: 10px;
    height: 5px;
    cursor: n-resize;
}

.resize-handle.n-resize {
    top: 0;
}

.resize-handle.s-resize {
    bottom: 0;
}

.resize-handle.w-resize,
.resize-handle.e-resize {
    top: 10px;
    bottom: 10px;
    width: 5px;
    cursor: w-resize;
}

.resize-handle.w-resize {
    left: 0;
}

.resize-handle.e-resize {
    right: 0;
}