.win98-window {
    display: flex;
    flex-direction: column;
    color: #000000;
    background-color: #c0c0c0;
    background-image: linear-gradient(180deg, rgba(255,255,255,.24), rgba(0,0,0,.06));
    border-top: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
    border-right: 1px solid #000000;
    border-bottom: 1px solid #000000;
    box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #dfdfdf, 5px 6px 0 rgba(0,0,0,.5);
}

.win98-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 22px;
    margin: 2px;
    padding: 2px 3px 2px 6px;
    color: #ffffff;
    background: var(--w98-blue-gradient);
    background-size: 240% 100%;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -1px 0 rgba(0,0,0,.35);
    user-select: none;
    animation: titlebar-center-drift 34s ease-in-out infinite alternate;
}

@keyframes titlebar-center-drift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.win98-titlebar h1,
.win98-titlebar h2 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    line-height: 14px;
    font-weight: bold;
}

.win98-titlebar-label {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 5px;
}

.win98-titlebar-icon {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    object-fit: contain;
    image-rendering: pixelated;
}

.win98-window-controls {
    display: flex;
    flex: 0 0 auto;
    gap: 2px;
}

.win98-control {
    width: 16px;
    height: 14px;
    display: grid;
    place-items: center;
    padding: 0;
    color: #000000;
    background: var(--w98-gray);
    border-top: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
    border-right: 1px solid #000000;
    border-bottom: 1px solid #000000;
    box-shadow: inset -1px -1px 0 #808080, inset 1px 1px 0 #dfdfdf;
    font-family: inherit;
    font-size: 12px;
    line-height: 12px;
}

.win98-minimize {
    align-items: start;
    padding-top: 0;
    line-height: 8px;
}

.win98-panel {
    background: #ffffff;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
}

.win98-statusbar {
    display: grid;
    gap: 4px;
    height: 22px;
    padding: 0 4px 4px;
    font-size: 12px;
    line-height: 12px;
}

.win98-statusbar span {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 0 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-top: 1px solid #808080;
    border-left: 1px solid #808080;
    border-right: 1px solid #ffffff;
    border-bottom: 1px solid #ffffff;
}

.win98-menu {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 22px;
    padding: 0 8px;
    font-size: 13px;
    line-height: 13px;
}

/* Raised panel - appears to sit above the surface */
.raised-panel {
    background: #dfdfdf;
    border-top: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
    border-right: 1px solid #808080;
    border-bottom: 1px solid #808080;
    box-shadow: inset 1px 1px 0 #f7f7f7, inset -1px -1px 0 #b0b0b0;
}

/* Sunken panel - appears to be inset into the surface */
.sunken-panel {
    background-color: #ffffff;
    background-image:
        linear-gradient(180deg, rgba(255,255,255,.9), rgba(238,238,238,.58)),
        repeating-linear-gradient(0deg, rgba(0,0,0,.025) 0 1px, transparent 1px 6px);
    border-top: 2px solid #606060;
    border-left: 2px solid #606060;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
}

/* Scroll panel - used for scrollable content areas within windows */
.scroll-panel {
    overflow: auto;
    background: #ffffff;
    border-top: 2px solid #606060;
    border-left: 2px solid #606060;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
}

/* Meter track for progress bars */
.meter-track {
    display: block;
    height: 14px;
    margin-top: 9px;
    background-color: #ffffff;
    background-image: repeating-linear-gradient(to right, rgba(0,0,0,.06) 0 1px, transparent 1px 18px);
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
}

.meter-bar {
    display: block;
    height: 100%;
    width: var(--meter, 0%);
    background-color: #000078;
    background-image: repeating-linear-gradient(to right, rgba(255,255,255,.13) 0 1px, transparent 1px 18px);
}

/* Tag styles for status indicators */
.tag {
    display: inline-flex;
    align-items: center;
    min-height: 17px;
    margin: 1px 2px 1px 0;
    padding: 1px 5px;
    color: #000000;
    background: #dfdfdf;
    border: 1px solid #808080;
    box-shadow: inset 1px 1px 0 #ffffff;
    white-space: nowrap;
}

.tag.ok { color: #008000; background: #eeffee; }
.tag.info { color: #000078; background: #edf4ff; }
.tag.warn { color: #8a6200; background: #ffffcc; }
.tag.danger { color: #ffffff; background: #800000; }

/* Titlebar animation - gradient drift */
@keyframes titlebar-drift {
    from { background-position: 0% 50%; }
    to { background-position: 100% 50%; }
}
