*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Teal Win98 desktop ── */
.win98-desktop {
    background-color: #008080;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "MS Sans Serif", "Microsoft Sans Serif", Arial, sans-serif;
    font-size: 12px;
    overflow: hidden;
}

/* ── Dialog window shell ── */
.win98-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);   /* JS replaces this with explicit px */
    background: #c0c0c0;
    border-top: 2px solid white;
    border-left: 2px solid white;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    box-shadow: 2px 2px 0 #000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 360px;
    min-height: 260px;
}

.legal-dialog {
    width: 660px;
    height: 540px;
}

.about-dialog {
    width: 520px;
    height: 600px;
}

/* ── Resize handles ── */
.resize-handle {
    position: absolute;
    z-index: 999;
}

/* Edges */
.rh-n  { top: 0;    left: 6px;  right: 6px;  height: 5px; cursor: n-resize;  }
.rh-s  { bottom: 0; left: 6px;  right: 6px;  height: 5px; cursor: s-resize;  }
.rh-e  { right: 0;  top: 6px;   bottom: 6px; width: 5px;  cursor: e-resize;  }
.rh-w  { left: 0;   top: 6px;   bottom: 6px; width: 5px;  cursor: w-resize;  }

/* Corners */
.rh-ne { top: 0;    right: 0;   width: 10px; height: 10px; cursor: ne-resize; }
.rh-nw { top: 0;    left: 0;    width: 10px; height: 10px; cursor: nw-resize; }
.rh-se { bottom: 0; right: 0;   width: 10px; height: 10px; cursor: se-resize; }
.rh-sw { bottom: 0; left: 0;    width: 10px; height: 10px; cursor: sw-resize; }

/* ── Title Bar ── */
.dialog-titlebar {
    background: linear-gradient(90deg, #000080, #1084d0);
    color: white;
    padding: 3px 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    -webkit-user-select: none;
    user-select: none;
    flex-shrink: 0;
    cursor: move;
}

.dialog-title {
    font-weight: bold;
    font-size: 12px;
}

.dialog-controls {
    display: flex;
    gap: 2px;
}

.win-ctrl {
    width: 16px;
    height: 14px;
    background: #c0c0c0;
    color: #000;
    border-top: 1px solid white;
    border-left: 1px solid white;
    border-right: 1px solid #404040;
    border-bottom: 1px solid #404040;
    font-size: 9px;
    font-family: "MS Sans Serif", sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.win-ctrl:active {
    border-top: 1px solid #404040;
    border-left: 1px solid #404040;
    border-right: 1px solid white;
    border-bottom: 1px solid white;
}

/* ── Dialog Body ── */
.dialog-body {
    padding: 12px 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow: hidden;
}

.dialog-intro {
    font-size: 12px;
    color: #000;
}

/* ── Win98 Sunken Text Box (scrollable disclaimer) ── */
.win98-textbox {
    background: white;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
    padding: 10px 12px;
    flex: 1;
    min-height: 80px;
    overflow-y: scroll;
    font-size: 12px;
    line-height: 1.6;
    color: #000;
}

.win98-textbox h2 {
    font-size: 13px;
    margin-bottom: 8px;
    font-family: "MS Sans Serif", sans-serif;
}

.win98-textbox h3 {
    font-size: 12px;
    margin: 10px 0 4px;
    font-family: "MS Sans Serif", sans-serif;
}

.win98-textbox p {
    margin-bottom: 8px;
}

.win98-textbox ul {
    padding-left: 18px;
    margin-bottom: 8px;
}

.win98-textbox li {
    margin-bottom: 4px;
}

.warning-text {
    color: #cc0000;
    font-weight: bold;
}

/* ── Agree row ── */
.agree-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.agree-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    cursor: pointer;
}

.agree-label input[type="checkbox"] {
    cursor: pointer;
    width: 13px;
    height: 13px;
}

.warning-msg {
    color: #cc0000;
    font-size: 11px;
    display: none;
}

/* ── Standard Win98 Button ── */
.win98-btn {
    background: #c0c0c0;
    border-top: 2px solid white;
    border-left: 2px solid white;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    padding: 4px 20px;
    font-size: 12px;
    font-family: "MS Sans Serif", sans-serif;
    cursor: pointer;
    min-width: 80px;
}

.win98-btn:active {
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
    padding-top: 6px;
    padding-left: 22px;
}

/* ── Dialog button row ── */
.dialog-buttons {
    display: flex;
    justify-content: flex-end;
    padding: 4px 0 2px;
}

/* ── About page: App banner ── */
.about-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px 8px;
    background: #c0c0c0;
    border-bottom: 1px solid #808080;
}

.about-icon {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
    flex-shrink: 0;
}

.about-appname {
    font-size: 16px;
    font-weight: bold;
    font-family: "MS Sans Serif", sans-serif;
}

.about-appver {
    font-size: 12px;
    margin-top: 2px;
}

.about-appcopy {
    font-size: 11px;
    color: #444;
    margin-top: 2px;
}

.dialog-divider {
    height: 2px;
    background: #808080;
    box-shadow: 0 1px 0 white;
}

.about-body {
    gap: 10px;
    overflow-y: auto;
}

/* ── Win98 Group Box ── */
.win98-group {
    border: 1px solid #808080;
    border-top: 1px solid #808080;
    padding: 14px 10px 10px;
    position: relative;
    box-shadow: inset 1px 1px 0 white;
}

.group-label {
    position: absolute;
    top: -8px;
    left: 8px;
    background: #c0c0c0;
    padding: 0 4px;
    font-size: 11px;
    font-weight: bold;
}

.win98-group p {
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 6px;
    color: #000;
}

.win98-group p:last-child {
    margin-bottom: 0;
}

/* ── Team member list ── */
.team-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.team-row {
    display: flex;
    flex-direction: column;
    padding: 5px 4px;
    border-bottom: 1px solid #d0d0d0;
    font-size: 12px;
    gap: 1px;
}

.team-row:last-child {
    border-bottom: none;
}

.team-row strong {
    font-size: 12px;
}

.team-gh {
    color: #000080;
    font-size: 11px;
}
