/* Mohammad Nemer XP - desktop shell. Window chrome comes from XP.css (vendor/XP.css). */

:root {
    --taskbar-h: 30px;
    --ui-font: Tahoma, "Segoe UI", Verdana, sans-serif;
    --luna-blue: #245edb;
    --select-blue: #316ac5;
    --task-pane: linear-gradient(180deg, #7ba2e7 0%, #6375d6 100%);
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    font-family: var(--ui-font);
    font-size: 11px;
    color: #000;
    background: #000;
    -webkit-font-smoothing: antialiased;
    user-select: none;
    -webkit-user-select: none;
}

/* XP.css uses a pixel font on form controls; XP itself used Tahoma. */
button, input, label, select, textarea, legend, .window, .title-bar-text {
    font-family: var(--ui-font);
}
.title-bar-text { font-family: "Trebuchet MS", var(--ui-font); }

input, textarea, .prose, .details-view, .file-meta, .window-pad { user-select: text; -webkit-user-select: text; }

.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
a.sr-only:focus {
    width: auto; height: auto; clip: auto;
    z-index: 100000; top: 8px; left: 8px;
    background: #fff; padding: 6px 10px;
}

[hidden] { display: none !important; }

/* ---------------------------------------------------------------- Boot */

.boot-screen {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: #000;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 48px;
    transition: opacity 0.5s ease;
}
.boot-screen.fade { opacity: 0; }

.boot-logo { text-align: center; }
.boot-flag { width: 86px; height: 86px; display: block; margin: 0 auto 6px; }
.boot-wordmark {
    font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
    font-size: 30px;
    letter-spacing: -0.5px;
}
.boot-name { font-weight: 600; }
.boot-xp {
    color: #ff7a1a;
    font-style: italic;
    font-weight: 700;
    font-size: 34px;
    margin-left: 2px;
    vertical-align: 6px;
}
.boot-edition { color: #c9c9c9; font-size: 13px; margin-top: 4px; letter-spacing: 1px; }

.boot-bar {
    width: 160px;
    height: 20px;
    border: 2px solid #b2b2b2;
    border-radius: 4px;
    padding: 2px;
    overflow: hidden;
    position: relative;
}
.boot-bar span {
    position: absolute;
    top: 2px;
    width: 9px;
    height: 12px;
    border-radius: 1px;
    background: linear-gradient(180deg, #2838c7 0%, #5979ef 20%, #869ef3 45%, #5979ef 70%, #2838c7 100%);
    animation: boot-slide 2s linear infinite;
}
.boot-bar span:nth-child(2) { animation-delay: 0.12s; }
.boot-bar span:nth-child(3) { animation-delay: 0.24s; }
@keyframes boot-slide {
    from { left: -30px; }
    to { left: 170px; }
}

.boot-footer {
    position: absolute;
    left: 24px; right: 24px; bottom: 20px;
    display: flex;
    justify-content: space-between;
    color: #9a9a9a;
    font-size: 12px;
}

/* ---------------------------------------------------------------- Login */

.login-screen {
    position: fixed;
    inset: 0;
    z-index: 8000;
    display: flex;
    flex-direction: column;
    background: #5a7edc;
    color: #fff;
    font-family: var(--ui-font);
}

.login-top {
    height: 12%;
    min-height: 60px;
    background: #00309c;
    position: relative;
}
.login-top::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, #003399 0%, #b6cbf4 35%, #ffffff 50%, #b6cbf4 65%, #003399 100%);
}

.login-middle {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 45% 55% at 12% 8%, rgba(160, 190, 255, 0.85), transparent 70%),
        #5a7edc;
}

.login-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    padding-right: 34px;
}
.login-flag { width: 74px; height: 74px; margin-bottom: 4px; }
.login-wordmark {
    font-family: "Franklin Gothic Medium", "Arial Narrow", Arial, sans-serif;
    font-size: 34px;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.25);
}
.login-wordmark sup { color: #ff8b2b; font-style: italic; font-weight: 700; font-size: 26px; margin-left: 2px; }
.login-hint { font-size: 17px; margin: 22px 0 0; }

.login-divider {
    width: 1px;
    align-self: stretch;
    margin: 6% 0;
    background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.9) 50%, transparent 100%);
}

.login-right { flex: 1; padding-left: 30px; }

.login-screen .login-user {
    all: unset;
    display: flex;
    align-items: center;
    gap: 14px;
    width: min(360px, 100%);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.88;
    transition: opacity 0.15s;
}
.login-screen .login-user:hover,
.login-screen .login-user:focus-visible {
    opacity: 1;
    background: linear-gradient(90deg, #00309c 0%, rgba(0, 48, 156, 0) 100%);
}
.login-user img {
    width: 58px;
    height: 58px;
    border: 2px solid #fff;
    border-radius: 5px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}
.login-user:hover img,
.login-user:focus-visible img { border-color: #ffcc33; }
.login-user-text { display: flex; flex-direction: column; gap: 3px; }
.login-user-name { font-size: 20px; }
.login-user-role { font-size: 12px; color: #00156e; font-weight: 700; }

.login-bottom {
    height: 12%;
    min-height: 60px;
    background: #00309c;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
}
.login-bottom::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 2px;
    background: linear-gradient(90deg, #466fd0 0%, #ff9933 50%, #466fd0 100%);
}
.login-screen .login-power {
    all: unset;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}
.login-power:hover { text-decoration: underline; }
.login-power-icon {
    width: 24px; height: 24px;
    border-radius: 4px;
    border: 1px solid #fff;
    background: linear-gradient(180deg, #e9704d, #c43a17);
    display: grid;
    place-items: center;
}
.login-power-icon svg { width: 16px; height: 16px; }
.login-bottom-note { margin: 0; font-size: 12px; text-align: right; line-height: 1.5; }

.welcome-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background:
        radial-gradient(ellipse 45% 55% at 12% 8%, rgba(160, 190, 255, 0.85), transparent 70%),
        #5a7edc;
    top: 12%;
    bottom: 12%;
}
.welcome-overlay span {
    font-family: "Franklin Gothic Medium", Arial, sans-serif;
    font-style: italic;
    font-size: 64px;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* ---------------------------------------------------------------- Desktop */

.desktop {
    position: fixed;
    inset: 0;
    background: #3a6ea5 url("wallpaper.svg") center / cover no-repeat;
    animation: fade-in 0.4s ease;
    transition: filter 1.2s ease;
}

@keyframes fade-in { from { opacity: 0; } }

.desktop-icons {
    position: absolute;
    top: 0; left: 0; right: 0;
    bottom: var(--taskbar-h);
    padding: 10px 4px;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 6px;
}

.desktop .desktop-icon {
    all: unset;
    width: 112px;
    padding: 4px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: default;
    text-align: center;
}
.desktop-icon svg {
    width: 72px;
    height: 72px;
    filter: drop-shadow(2px 3px 2px rgba(0, 0, 0, 0.35));
}
.desktop-icon span {
    color: #fff;
    font-size: 15px;
    line-height: 1.25;
    padding: 1px 4px;
    text-shadow: 1px 1px 2px #000, 0 0 3px rgba(0, 0, 0, 0.6);
}
.desktop-icon.selected svg { filter: drop-shadow(2px 3px 2px rgba(0, 0, 0, 0.35)) sepia(1) hue-rotate(180deg) saturate(4) brightness(0.75); }
.desktop-icon.selected span { background: var(--select-blue); text-shadow: none; }
.desktop .desktop-icon:focus { outline: none; }
.desktop-icon:focus-visible span { outline: 1px dotted #fff; }

.window-layer { position: absolute; inset: 0 0 var(--taskbar-h) 0; pointer-events: none; }

/* ---------------------------------------------------------------- Windows */

.xp-window {
    position: absolute;
    display: flex;
    flex-direction: column;
    min-width: 260px;
    min-height: 140px;
    pointer-events: auto;
    box-shadow: inset -1px -1px #00138c, inset 1px 1px #0831d9, inset -2px -2px #001ea0, inset 2px 2px #166aee, inset -3px -3px #003bda, inset 3px 3px #0855dd, 2px 4px 14px rgba(0, 0, 0, 0.35);
    animation: window-open 0.16s ease-out;
    transition: transform 0.18s ease, opacity 0.18s ease;
}
@keyframes window-open { from { transform: scale(0.94); opacity: 0; } }

.xp-window.minimizing { transform: translateY(40%) scale(0.2); opacity: 0; pointer-events: none; }

.xp-window.maximized {
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
}
.xp-window.maximized .title-bar { border-radius: 0; }

.xp-window .title-bar { flex: none; cursor: default; touch-action: none; height: 29px; padding: 0 5px 0 6px; box-sizing: border-box; }
.xp-window .title-bar-controls { align-items: center; gap: 2px; }
.xp-window .title-bar-controls button { margin-left: 0; }
.xp-window .title-bar-text { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.xp-window .title-bar-text svg { width: 16px; height: 16px; flex: none; }

/* Inactive windows fade their title bar like XP did. */
.xp-window.inactive .title-bar {
    background: linear-gradient(180deg, #7697e7 0%, #7e9ee3 3%, #94afe8 6%, #97b4e9 8%, #82a5e4 14%, #7c9fe2 17%, #7996de 25%, #7b99e1 56%, #82a9e9 81%, #80a5e7 89%, #7b96e1 94%, #7a93df 97%, #abbae3 100%);
}
.xp-window.inactive .title-bar-text { color: #d8e4f8; text-shadow: none; }
.xp-window.inactive .title-bar-controls button { opacity: 0.65; }

.xp-window .window-body {
    flex: 1;
    min-height: 0;
    margin: 0 3px;
    background: #ece9d8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.window-scroll { flex: 1; min-height: 0; overflow: auto; }

.xp-window .status-bar { flex: none; margin: 0 3px; padding-top: 1px; }

.resize-handle {
    position: absolute;
    right: 3px; bottom: 3px;
    width: 14px; height: 14px;
    cursor: nwse-resize;
    touch-action: none;
    background: linear-gradient(135deg, transparent 50%, #b7b19d 50%, #b7b19d 58%, transparent 58%, transparent 68%, #b7b19d 68%, #b7b19d 76%, transparent 76%);
}
.xp-window.maximized .resize-handle { display: none; }

/* Explorer chrome: menu bar, toolbar, address bar */

.toolbar {
    flex: none;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px 4px;
    border-bottom: 1px solid #d8d2bd;
    background: linear-gradient(180deg, #f8f7f2, #ece9d8);
}
.xp-window .tool-button {
    all: unset;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    border: 1px solid transparent;
    border-radius: 3px;
    color: #000;
    cursor: default;
    font-size: 11px;
    text-decoration: none;
}
.xp-window .tool-button:hover:not(:disabled) { border-color: #c2bfae; background: #fff; box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.06); }
.xp-window .tool-button:active:not(:disabled) { background: #e2dfd2; }
.xp-window .tool-button:disabled { opacity: 0.45; }
.xp-window .tool-button svg { width: 20px; height: 20px; flex: none; }
.xp-window .tool-button.flip svg { transform: scaleX(-1); }
.toolbar-sep { width: 1px; align-self: stretch; margin: 2px 3px; background: #c5c2b2; box-shadow: 1px 0 #fff; }

.address-bar {
    flex: none;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 4px;
    border-bottom: 1px solid #d8d2bd;
    background: #ece9d8;
}
.address-bar > span { color: #6d6d6d; }
.address-field {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 20px;
    padding: 0 4px;
    background: #fff;
    border: 1px solid #7f9db9;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.address-field svg { width: 16px; height: 16px; flex: none; }
.address-go { display: inline-flex; align-items: center; gap: 3px; color: #000; }
.address-go svg { width: 18px; height: 18px; transform: scaleX(-1); }

/* Explorer left task pane */
.pane-layout { display: flex; flex: 1; min-height: 0; background: #fff; }
.task-pane {
    flex: none;
    width: 190px;
    padding: 12px 10px;
    background: var(--task-pane);
    overflow: auto;
}
.task-group { margin-bottom: 12px; border-radius: 3px 3px 0 0; overflow: hidden; }
.task-group h3 {
    margin: 0;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #215dc6;
    background: linear-gradient(90deg, #fff 0%, #c6d3f7 100%);
}
.task-group-body {
    margin: 0;
    padding: 8px 10px;
    background: #d6dff7;
    border: 1px solid #fff;
    border-top: 0;
    color: #000;
}
.task-group-body p { margin: 0; line-height: 1.5; }
.task-links { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.task-links a, .xp-window .link-button {
    all: unset;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #215dc6;
    cursor: pointer;
    font-size: 11px;
}
.task-links a:hover, .xp-window .link-button:hover { color: #428eff; text-decoration: underline; }
.task-links svg { width: 16px; height: 16px; flex: none; }

.profile-card { text-align: center; }
.profile-card img { width: 96px; height: 96px; border: 2px solid #fff; border-radius: 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.profile-card p { margin-top: 6px; }

.pane-content { flex: 1; min-width: 0; overflow: auto; padding: 14px 18px; background: #fff; }

.prose { font-size: 12px; line-height: 1.6; }
.prose h2 { margin: 0 0 10px; font-size: 18px; color: #1d3f86; font-family: "Trebuchet MS", var(--ui-font); }
.prose p { margin: 0 0 10px; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.prose .profile-section-title { margin: 22px 0 10px; padding-top: 14px; border-top: 1px solid #d6dff7; scroll-margin-top: 8px; }
.skill-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.skill-group h3 { margin: 0 0 5px; font-size: 11px; font-weight: 700; color: #215dc6; }
.skill-group .chip-list li { font-size: 11px; line-height: 1.5; }

/* Details view (research) */
.details-view { padding: 10px; background: #fff; overflow: auto; flex: 1; font-size: 11px; line-height: 1.5; }
.details-view fieldset { margin: 4px 0 12px; }
.details-view legend { background: #fff; }
.details-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.details-table th {
    text-align: left;
    font-weight: 400;
    padding: 3px 6px;
    background: linear-gradient(180deg, #fff, #ebeadb);
    border-right: 1px solid #d0cfbf;
    border-bottom: 3px solid #e2decd;
    white-space: nowrap;
}
.details-table td { padding: 6px; vertical-align: top; border-bottom: 1px solid #f0efe7; }
.details-table td:nth-child(2) { width: 28%; color: #555; }
.details-table td:nth-child(3) { width: 48px; color: #555; }
.details-table tr:hover td { background: #f0f5fd; }
.details-table a { display: inline-flex; gap: 6px; align-items: flex-start; color: #0b49b5; font-weight: 700; text-decoration: none; }
.details-table a:hover { text-decoration: underline; }
.details-table a svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.details-table p { margin: 2px 0 0 22px; color: #444; }

/* Dialog-style windows */
.window-pad { padding: 10px; overflow: auto; flex: 1; font-size: 11px; line-height: 1.5; }
.window-pad fieldset p { margin: 2px 0; }
.muted { color: #6b6b6b; }

.properties { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 8px; }
.properties [role=tabpanel] { flex: 1; overflow: auto; margin-bottom: 8px; }
.tab-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.tab-heading svg { width: 40px; height: 40px; flex: none; }
.tab-heading p { margin: 0; }
.chip-list { list-style: none; margin: 0; padding: 2px 0; display: flex; flex-wrap: wrap; gap: 5px; }
.chip-list li {
    padding: 2px 8px;
    background: linear-gradient(180deg, #fff, #ecebe5);
    border: 1px solid #a8b8d2;
    border-radius: 3px;
}
.dialog-buttons { display: flex; justify-content: flex-end; gap: 6px; }

/* Outlook-style compose */
.compose { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.compose-toolbar { display: flex; gap: 2px; padding: 3px 4px; border-bottom: 1px solid #d8d2bd; background: linear-gradient(180deg, #f8f7f2, #ece9d8); }
.compose-fields { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 8px; padding: 6px 8px; }
.compose-fields label { text-align: right; }
.compose-fields input, .compose-fields select { width: 100%; }
.compose textarea { flex: 1; min-height: 120px; margin: 0 8px; resize: none; border: 1px solid #7f9db9; font-size: 12px; }
.compose-note { margin: 6px 8px 8px; color: #555; }
.compose-note a { color: #0b49b5; }
.compose-from { display: grid; grid-template-columns: 1fr 1.3fr; gap: 6px; min-width: 0; }
.compose-from input { min-width: 0; }
.compose .invalid { border-color: #c0392b !important; background: #fff4f2; }
.compose-status {
    margin: 6px 8px 0;
    padding: 5px 8px;
    border: 1px solid #a8b8d2;
    background: #eef4ff;
    font-size: 11px;
}
.compose-status.ok { border-color: #6cb36c; background: #eefaee; color: #1e5e1e; }
.compose-status.error { border-color: #d9a49b; background: #fff4f2; color: #8a2a1c; }

.empty-folder { flex: 1; background: #fff; padding: 20px; text-align: center; }

/* Internet Explorer window */
.ie-frame { flex: 1; min-height: 0; border: 0; width: 100%; background: #fff; display: block; }
.ie-body { position: relative; flex: 1; min-height: 0; display: flex; }
.ie-loading {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    background: #fff; color: #444;
    pointer-events: none;
    transition: opacity 0.2s;
}
.ie-loading.done { opacity: 0; }
/* While dragging/resizing, iframes must not swallow pointer events. */
body.dragging iframe { pointer-events: none; }
body.dragging { cursor: grabbing; }

/* ---------------------------------------------------------------- Taskbar */

.taskbar {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: var(--taskbar-h);
    display: flex;
    align-items: stretch;
    z-index: 5000;
    background: linear-gradient(180deg, #1f2f86 0%, #3165c4 3%, #3682e5 6%, #4490e6 10%, #3883e5 12%, #2b71e0 15%, #2663da 18%, #235bd6 20%, #2258d5 23%, #2157d6 38%, #245ddb 54%, #2562df 86%, #245fdc 89%, #2158d4 92%, #1d4ec0 95%, #1941a5 98%);
}

.taskbar .start-button {
    all: unset;
    flex: none;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 22px 0 9px;
    margin-right: 10px;
    border-radius: 0 10px 10px 0;
    color: #fff;
    font-family: "Franklin Gothic Medium", "Trebuchet MS", Arial, sans-serif;
    font-size: 19px;
    font-style: italic;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-shadow: 1px 1px 2px #1a3a12;
    cursor: pointer;
    background: radial-gradient(ellipse at 30% 20%, #5eac56 0%, #3c9c37 35%, #2f8b2a 60%, #297c25 100%);
    box-shadow: inset -2px -2px 3px rgba(0, 0, 0, 0.3), inset 2px 2px 3px rgba(255, 255, 255, 0.35), 2px 0 4px rgba(0, 0, 0, 0.35);
}
.taskbar .start-button:hover { filter: brightness(1.12); }
.taskbar .start-button[aria-expanded="true"] { filter: brightness(0.85); box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.45); }
.start-button svg { width: 22px; height: 22px; filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.4)); }

.taskbar-apps {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 0 4px;
    overflow: hidden;
}
.taskbar .taskbar-item {
    all: unset;
    flex: 0 1 160px;
    min-width: 40px;
    height: 22px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 8px;
    border-radius: 3px;
    color: #fff;
    font-size: 11px;
    cursor: default;
    overflow: hidden;
    background: #3c81f3;
    box-shadow: inset -1px 0 rgba(0, 0, 0, 0.3), inset 1px 1px 1px rgba(255, 255, 255, 0.2);
}
.taskbar-item span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.taskbar-item svg { width: 16px; height: 16px; flex: none; }
.taskbar .taskbar-item:hover { background: #53a3ff; }
.taskbar .taskbar-item.active {
    background: #1e52b7;
    box-shadow: inset 0 0 1px 1px rgba(0, 0, 0, 0.3), inset 1px 0 1px rgba(0, 0, 0, 0.7);
}

.tray {
    flex: none;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px 0 12px;
    border-left: 1px solid #1042af;
    background: linear-gradient(180deg, #0c59b9 1%, #139ee9 6%, #18b5f2 10%, #139beb 14%, #1290e8 19%, #0d8dea 63%, #0d9ff1 81%, #0f9eed 88%, #119be9 91%, #1392e2 94%, #137ed7 97%, #095bc9 100%);
    box-shadow: inset 1px 0 1px #18bbff;
    color: #fff;
}
.tray-icon { width: 16px; height: 16px; }
.tray-clock { font-size: 11px; margin-left: 4px; white-space: nowrap; }

/* ---------------------------------------------------------------- Start menu */

.start-menu {
    position: absolute;
    left: 0;
    bottom: var(--taskbar-h);
    z-index: 6000;
    width: 380px;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    background: #4282d6;
    border: 1px solid #0d3fa7;
    box-shadow: 2px -2px 12px rgba(0, 0, 0, 0.45);
    animation: start-open 0.12s ease-out;
}
@keyframes start-open { from { transform: translateY(8px); opacity: 0; } }

.start-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    height: 56px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
    background: linear-gradient(180deg, #1868ce 0%, #0e60cb 12%, #0e60cb 20%, #1164cf 32%, #1667cf 33%, #1b6cd3 47%, #1e70d9 54%, #2476dc 60%, #297ae0 65%, #3482e3 77%, #3786e5 79%, #428ee9 90%, #4791eb 100%);
    position: relative;
}
.start-header::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #da884a 30%, #da884a 70%, transparent 100%);
}
.start-header img { width: 42px; height: 42px; border: 2px solid rgba(255, 255, 255, 0.85); border-radius: 3px; box-shadow: 0 0 2px rgba(0, 0, 0, 0.5); }

.start-body { display: flex; background: #fff; }
.start-body ul { list-style: none; margin: 0; padding: 6px 0; }
.start-left { flex: 1; min-width: 0; }
.start-right { flex: 1; min-width: 0; background: #d3e5fa; border-left: 1px solid #95bdee; }

.start-menu .start-body button,
.start-menu .start-body a {
    all: unset;
    box-sizing: border-box;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    color: #000;
    font-size: 11px;
    cursor: pointer;
}
.start-left svg { width: 32px; height: 32px; flex: none; }
.start-right svg { width: 22px; height: 22px; flex: none; }
.start-right a { color: #0a246a !important; }
.start-left span { display: flex; flex-direction: column; }
.start-left small { color: #6d6d6d; }
.start-menu .start-body button:hover,
.start-menu .start-body button:focus-visible,
.start-menu .start-body a:hover,
.start-menu .start-body a:focus-visible { background: var(--select-blue); color: #fff !important; }
.start-menu .start-body button:hover small,
.start-menu .start-body button:focus-visible small { color: #e0e8f8; }
.start-sep { height: 1px; margin: 4px 10px; background: linear-gradient(90deg, transparent, #c5c5c5 30%, #c5c5c5 70%, transparent); }
.start-right .start-sep { background: linear-gradient(90deg, transparent, #a7c3ea 30%, #a7c3ea 70%, transparent); }

.start-footer {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    padding: 6px 10px;
    background: linear-gradient(180deg, #4282d6 0%, #3b85e0 3%, #418ae3 5%, #418ae3 17%, #3c87e2 21%, #3786e4 26%, #3482e3 29%, #2e7ee1 39%, #2374df 49%, #2072db 57%, #196edb 62%, #176bd8 72%, #1468d6 75%, #1165d3 83%, #0f61cb 88%);
}
.start-menu .start-footer button {
    all: unset;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 2px 4px;
    color: #fff;
    font-size: 11px;
    cursor: pointer;
}
.start-menu .start-footer button:hover { background: rgba(255, 255, 255, 0.15); border-radius: 3px; }
.start-footer-icon { width: 22px; height: 22px; border-radius: 3px; display: grid; place-items: center; border: 1px solid #fff; }
.start-footer-icon svg { width: 15px; height: 15px; }
.start-footer-icon.logoff { background: linear-gradient(180deg, #f7c443, #d8901c); }
.start-footer-icon.power { background: linear-gradient(180deg, #e9704d, #c43a17); }

/* ---------------------------------------------------------------- Balloon tip */

.balloon {
    position: absolute;
    right: 12px;
    bottom: calc(var(--taskbar-h) + 14px);
    z-index: 5500;
    width: 270px;
    padding: 8px 26px 8px 10px;
    background: #ffffe1;
    border: 1px solid #000;
    border-radius: 7px;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
    font-size: 11px;
    animation: start-open 0.25s ease-out;
}
.balloon::after {
    content: "";
    position: absolute;
    right: 34px;
    bottom: -12px;
    border: 6px solid transparent;
    border-top: 6px solid #ffffe1;
    filter: drop-shadow(0 1px 0 #000);
}
.balloon p { margin: 4px 0 0; line-height: 1.4; }
.balloon .balloon-close {
    all: unset;
    position: absolute;
    top: 4px; right: 6px;
    width: 14px; height: 14px;
    line-height: 12px;
    text-align: center;
    border: 1px solid #a0a0a0;
    border-radius: 2px;
    cursor: pointer;
    font-size: 12px;
}
.balloon .balloon-close:hover { background: #e85c3f; color: #fff; border-color: #a0331a; }

.fallback-nav { position: fixed; inset: 0; overflow: auto; background: #fff; padding: 20px; font-size: 14px; z-index: 10000; }

/* ---------------------------------------------------------------- System screens */

.bios-screen {
    position: fixed; inset: 0; z-index: 9800;
    background: #000; color: #c0c0c0;
    padding: 24px 28px;
    cursor: none;
}
.bios-screen pre { margin: 0; font: 15px/1.35 "Lucida Console", "Courier New", monospace; white-space: pre-wrap; }

.status-screen {
    position: fixed; inset: 0; z-index: 8500;
    display: flex; flex-direction: column;
    background: #5a7edc; color: #fff;
    cursor: wait;
}
.status-middle {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: radial-gradient(ellipse 45% 55% at 12% 8%, rgba(160, 190, 255, 0.85), transparent 70%), #5a7edc;
}
.status-text { font-size: 18px; margin: 26px 0 0; }

.power-screen {
    position: fixed; inset: 0; z-index: 9600;
    background: #000; color: #8c8c8c;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
    text-align: center; font-size: 14px; line-height: 1.6;
}
.power-screen p span { color: #5a5a5a; font-size: 12px; }
.power-screen .power-on {
    all: unset;
    width: 72px; height: 72px; border-radius: 50%;
    display: grid; place-items: center;
    cursor: pointer;
    background: radial-gradient(circle at 35% 30%, #3a3a3a, #111 70%);
    box-shadow: 0 0 0 3px #2a2a2a, 0 0 18px rgba(80, 160, 255, 0.35);
    animation: power-glow 2.4s ease-in-out infinite;
}
.power-screen .power-on svg { width: 34px; height: 34px; }
.power-screen .power-on svg use { stroke: #6fb4ff; }
.power-screen .power-on:hover { box-shadow: 0 0 0 3px #3b6fb8, 0 0 26px rgba(80, 160, 255, 0.7); }
@keyframes power-glow { 50% { box-shadow: 0 0 0 3px #2a2a2a, 0 0 28px rgba(80, 160, 255, 0.6); } }

.standby-screen {
    position: fixed; inset: 0; z-index: 9700;
    background: #000;
    display: flex; align-items: flex-end; justify-content: center;
    cursor: none;
}
.standby-screen p { color: #333; font-size: 12px; margin-bottom: 30px; animation: standby-fade 4s ease forwards; }
@keyframes standby-fade { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }

.screensaver { position: fixed; inset: 0; z-index: 9400; width: 100vw; height: 100vh; cursor: none; }

.login-user-running { font-size: 11px; color: #fff; font-weight: 400; }

/* Grey desktop behind Turn Off / Log Off, like XP */
.desktop.dimmed { filter: grayscale(1) brightness(0.9); }

.power-dialog-layer { position: fixed; inset: 0; z-index: 8800; display: grid; place-items: center; }
.power-dialog {
    width: 314px;
    border: 1px solid #0d2f8b;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
    font-family: var(--ui-font);
    animation: fade-in 0.2s ease;
}
.power-dialog-head {
    height: 44px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 12px;
    background: #00309c;
    color: #fff; font-size: 16px;
}
.power-dialog-head svg { width: 30px; height: 30px; }
.power-dialog-body {
    display: flex; justify-content: space-around;
    padding: 22px 10px 18px;
    background: linear-gradient(180deg, #7a96df 0%, #5a7edc 18%, #5c7fdc 100%);
    border-top: 2px solid transparent;
    border-image: linear-gradient(90deg, #003399, #b6cbf4 50%, #003399) 1;
}
.power-dialog .power-choice {
    all: unset;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    width: 86px;
    color: #fff; font-size: 11px;
    cursor: pointer;
}
.power-choice-icon {
    width: 34px; height: 34px;
    border-radius: 4px;
    border: 1px solid #fff;
    display: grid; place-items: center;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6);
}
.power-choice-icon svg { width: 22px; height: 22px; }
/* Like XP: no focus boxes. Hover (or arrowing through with the keyboard) just brightens the icon. */
.power-dialog .power-choice:focus, .power-dialog:focus { outline: none; }
.power-dialog .power-choice:not(:disabled):hover, .power-dialog .power-choice:not(:disabled):active,
.power-dialog .power-choice:focus, .power-dialog .power-choice:focus-visible { box-shadow: none; background: none; }
.power-choice:hover .power-choice-icon, .power-choice:focus-visible .power-choice-icon { filter: brightness(1.2); }
.pc-standby { background: linear-gradient(180deg, #f8d65a, #d79a1a); }
.pc-off { background: linear-gradient(180deg, #e9704d, #c43a17); }
.pc-restart { background: linear-gradient(180deg, #7cd36a, #2e8b20); }
.pc-switch { background: linear-gradient(180deg, #6fa3ff, #1d58cc); }
.pc-logoff { background: linear-gradient(180deg, #f7c443, #d8901c); }
.power-dialog-foot {
    display: flex; justify-content: flex-end;
    padding: 8px 12px;
    background: #00309c;
}
.power-dialog-foot button { min-width: 70px; }

/* ---------------------------------------------------------------- Menus (context, All Programs) */

.xp-menu {
    position: fixed;
    z-index: 7000;
    min-width: 170px;
    padding: 2px;
    background: #fff;
    border: 1px solid #aca899;
    box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.35);
    font-size: 11px;
}
.xp-menu ul { list-style: none; margin: 0; padding: 0; }
.xp-menu li { position: relative; }
.xp-menu .menu-item {
    all: unset;
    box-sizing: border-box;
    width: 100%;
    display: flex; align-items: center; gap: 8px;
    padding: 3px 18px 3px 6px;
    color: #000;
    cursor: default;
    white-space: nowrap;
}
.xp-menu .menu-item svg { width: 16px; height: 16px; flex: none; }
.xp-menu .menu-item .menu-icon-space { width: 16px; flex: none; }
.xp-menu .menu-item.default { font-weight: 700; }
.xp-menu .menu-item:hover:not(:disabled), .xp-menu .menu-item:focus-visible, .xp-menu li.open > .menu-item { background: var(--select-blue); color: #fff; }
.xp-menu .menu-item:disabled { color: #aca899; }
.xp-menu .menu-item.has-sub::after {
    content: "";
    position: absolute; right: 6px;
    border: 4px solid transparent; border-left: 4px solid currentColor;
}
.xp-menu .menu-sep { height: 1px; margin: 3px 1px; background: #aca899; }
.xp-menu .submenu { display: none; position: absolute; left: 100%; top: -3px; }
.xp-menu li.open > .submenu { display: block; }

.all-programs { padding: 2px 0; border-color: #6f86c2; }
.all-programs .menu-item { padding: 4px 22px 4px 8px; }
.all-programs .menu-item svg { width: 22px; height: 22px; }

.start-left-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.start-left-col .start-left { flex: 1; }
.start-all-programs { padding: 4px 6px 6px; border-top: 1px solid; border-image: linear-gradient(90deg, transparent, #c5c5c5 30%, #c5c5c5 70%, transparent) 1; }
.start-menu .start-all-programs button {
    all: unset; box-sizing: border-box;
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 4px 8px;
    font-size: 11px; color: #000;
    cursor: pointer;
}
.start-menu .start-all-programs button:hover, .start-menu .start-all-programs button[aria-expanded="true"] { background: var(--select-blue); color: #fff; }
.all-programs-arrow {
    width: 16px; height: 16px; border-radius: 3px;
    background: linear-gradient(180deg, #5fd45b, #2a9b25);
    position: relative;
}
.all-programs-arrow::after {
    content: ""; position: absolute; left: 6px; top: 4px;
    border: 4px solid transparent; border-left: 5px solid #fff;
}

/* ---------------------------------------------------------------- Desktop extras */

.desktop-icons.free { display: block; }
.desktop-icons.free .desktop-icon { position: absolute; }
.desktop-icon.dragging { opacity: 0.6; pointer-events: none; z-index: 2; }
.desktop-icon .rename-input {
    width: 106px; font-size: 14px; text-align: center;
    padding: 0 2px; border: 1px solid #000; color: #000;
}
.rubber-band {
    position: absolute;
    z-index: 1;
    border: 1px solid #316ac5;
    background: rgba(49, 106, 197, 0.25);
    pointer-events: none;
}


/* ---------------------------------------------------------------- Message boxes */

.msgbox-body { display: flex; gap: 14px; padding: 14px 14px 6px; align-items: flex-start; font-size: 11px; line-height: 1.5; }
.msgbox-body > svg { width: 32px; height: 32px; flex: none; }
.msgbox-body p { margin: 0; white-space: pre-line; }
.msgbox-body input { width: 100%; margin-top: 8px; }
.msgbox-buttons { display: flex; justify-content: center; gap: 6px; padding: 10px 14px 12px; }

/* ---------------------------------------------------------------- Folder (large icons) view */

.icon-grid {
    flex: 1; min-width: 0; overflow: auto;
    padding: 10px;
    background: #fff;
    display: grid;
    grid-template-columns: repeat(auto-fill, 86px);
    grid-auto-rows: min-content;
    gap: 10px 6px;
    align-content: start;
}
.xp-window .icon-item {
    all: unset;
    width: 86px;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 3px 0;
    font-size: 11px; text-align: center; color: #000;
    cursor: default;
    word-break: break-word;
}
.icon-item svg { width: 40px; height: 40px; }
.icon-item span { padding: 0 2px; }
.xp-window .icon-item.selected span, .xp-window .icon-item:focus-visible span { background: var(--select-blue); color: #fff; }
.xp-window .icon-item.selected svg { filter: sepia(1) hue-rotate(180deg) saturate(3) brightness(0.8); }
.icon-grid .empty-note { grid-column: 1 / -1; color: #777; padding: 20px; text-align: center; }
.hidden-files {
    grid-column: 1 / -1;
    padding: 16px;
    color: #000;
    line-height: 1.6;
}
.hidden-files b { display: block; font-size: 13px; color: #1d3f86; margin-bottom: 6px; }

/* ---------------------------------------------------------------- Notepad */

.app-menubar {
    flex: none;
    display: flex;
    padding: 1px 2px;
    background: #ece9d8;
    border-bottom: 1px solid #d8d2bd;
}
.xp-window .app-menubar > button {
    all: unset;
    padding: 2px 7px;
    font-size: 11px;
    color: #000;
    cursor: default;
}
.xp-window .app-menubar > button:hover, .xp-window .app-menubar > button.open { background: var(--select-blue); color: #fff; }
.notepad-text {
    flex: 1; min-height: 0;
    margin: 0;
    border: 0;
    padding: 2px 4px;
    resize: none;
    font: 13px/1.35 "Lucida Console", "Courier New", monospace;
    color: #000;
    background: #fff;
    border-top: 1px solid #a5a5a5;
    outline: none;
}
.notepad-text.nowrap { white-space: pre; overflow-wrap: normal; overflow-x: auto; }

/* ---------------------------------------------------------------- Command prompt */

.cmd {
    flex: 1; min-height: 0; overflow: auto;
    padding: 4px 6px;
    background: #000; color: #c0c0c0;
    font: 14px/1.3 "Lucida Console", "Courier New", monospace;
    cursor: text;
    user-select: text; -webkit-user-select: text;
}
.cmd pre { margin: 0; font: inherit; white-space: pre-wrap; word-break: break-word; }
.cmd-line { display: flex; }
.cmd-line span { white-space: pre; }
.cmd .cmd-input {
    flex: 1; min-width: 0;
    padding: 0; margin: 0;
    border: 0; outline: none;
    background: transparent;
    color: inherit;
    font: inherit;
    caret-color: #c0c0c0;
}
.cmd a { color: #7fb8ff; }

/* ---------------------------------------------------------------- Display properties */

.display-preview { display: flex; justify-content: center; margin-bottom: 12px; }
.monitor {
    width: 184px; height: 142px;
    padding: 12px 12px 22px;
    border-radius: 6px 6px 3px 3px;
    background: linear-gradient(180deg, #e8e8e0, #b9b6a6);
    box-shadow: inset 0 0 0 1px #8a8778, 0 2px 3px rgba(0, 0, 0, 0.25);
    position: relative;
}
.monitor::after { content: ""; position: absolute; left: 70px; right: 70px; bottom: -10px; height: 10px; background: #a6a392; border-radius: 0 0 4px 4px; }
.monitor-screen { width: 100%; height: 100%; background: #000 center / cover no-repeat; border: 1px solid #555; position: relative; overflow: hidden; }
.monitor-screen canvas { width: 100%; height: 100%; display: block; }
.display-row { display: flex; gap: 8px; align-items: flex-start; }
.wallpaper-list {
    flex: 1;
    height: 110px;
    overflow: auto;
    margin: 0; padding: 0; list-style: none;
    background: #fff;
    border: 1px solid #7f9db9;
}
.wallpaper-list li { padding: 2px 4px; display: flex; gap: 6px; align-items: center; cursor: default; }
.wallpaper-list li[aria-selected="true"] { background: var(--select-blue); color: #fff; }
.wallpaper-list li svg { width: 14px; height: 14px; }
.display-side { display: flex; flex-direction: column; gap: 6px; width: 110px; }
.display-side label { display: block; margin-bottom: 2px; }
.display-side select, .display-side input[type=number] { width: 100%; }
.field-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.field-row input[type=number] { width: 54px; padding: 2px 4px; border: 1px solid #7f9db9; }

/* About dialog */
.about-xp { padding: 14px; font-size: 11px; line-height: 1.55; overflow: auto; flex: 1; }
.about-xp .about-banner { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid #c5c2b2; }
.about-xp .about-banner svg { width: 48px; height: 48px; }
.about-xp .about-banner b { font-size: 16px; font-family: "Franklin Gothic Medium", Arial, sans-serif; }
.about-xp .about-banner sup { color: #ff7a1a; font-style: italic; }
.about-xp ul { margin: 4px 0 8px 16px; padding: 0; }

/* ---------------------------------------------------------------- Tray: volume + date/time */

.tray .tray-button {
    all: unset;
    display: flex; align-items: center;
    cursor: pointer;
    border-radius: 2px;
}
.tray .tray-button:hover { background: rgba(255, 255, 255, 0.15); }
.tray .tray-button:focus-visible { outline: 1px dotted #fff; }
.tray .tray-clock { padding: 0 3px; height: 20px; }
.tray-button.muted .tray-icon { opacity: 0.55; }
.tray-button.muted { position: relative; }
.tray-button.muted::after {
    content: ""; position: absolute; right: -2px; bottom: 1px;
    width: 9px; height: 9px; border-radius: 50%;
    background: #e23a2b radial-gradient(circle, transparent 2px, transparent 2px);
    box-shadow: inset 0 0 0 1px #fff;
}

.volume-popup {
    position: absolute;
    right: 70px;
    bottom: calc(var(--taskbar-h) + 4px);
    z-index: 5600;
    width: 78px;
    padding: 6px 6px 8px;
    background: #ece9d8;
    border: 1px solid #0831d9;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.35);
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    font-size: 11px;
    animation: start-open 0.12s ease-out;
}
.volume-popup p { margin: 0; }
/* Custom vertical slider (XP.css only styles horizontal ranges) */
.volume-slider {
    position: relative;
    width: 44px;
    height: 112px;
    display: flex;
    justify-content: center;
}
/* tick marks on both sides of the groove */
.volume-slider::before, .volume-slider::after {
    content: "";
    position: absolute;
    top: 6px; bottom: 6px;
    width: 5px;
    background: repeating-linear-gradient(180deg, #8a8778 0 1px, transparent 1px 10px);
}
.volume-slider::before { left: 6px; }
.volume-slider::after { right: 6px; }
.volume-popup input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    writing-mode: vertical-lr;
    direction: rtl;
    width: 22px;
    height: 112px;
    margin: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}
.volume-popup input[type=range]:focus { outline: none; }
.volume-popup input[type=range]:focus-visible { outline: 1px dotted #000; outline-offset: 2px; }
.volume-popup input[type=range]::-webkit-slider-runnable-track {
    width: 4px;
    background: #fff;
    border: 1px solid;
    border-color: #9d9a8a #fff #fff #9d9a8a;
    box-shadow: inset 1px 1px 0 #6f6c5f;
}
.volume-popup input[type=range]::-moz-range-track {
    width: 4px;
    background: #fff;
    border: 1px solid;
    border-color: #9d9a8a #fff #fff #9d9a8a;
    box-shadow: inset 1px 1px 0 #6f6c5f;
}
.volume-popup input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 21px;
    height: 11px;
    margin-left: -10px;
    border: 1px solid #1c5180;
    border-radius: 2px;
    background: linear-gradient(90deg, #f7f7f4 0%, #e6e5dc 60%, #d6d3c5 100%);
    box-shadow: inset 0 -2px 0 #3fbe3d, inset 0 2px 0 #fff;
}
.volume-popup input[type=range]::-moz-range-thumb {
    width: 21px;
    height: 11px;
    border: 1px solid #1c5180;
    border-radius: 2px;
    background: linear-gradient(90deg, #f7f7f4 0%, #e6e5dc 60%, #d6d3c5 100%);
    box-shadow: inset 0 -2px 0 #3fbe3d, inset 0 2px 0 #fff;
}
.volume-popup input[type=range]:hover::-webkit-slider-thumb { box-shadow: inset 0 -2px 0 #f9b145, inset 0 2px 0 #fff; }
.volume-popup input[type=range]:hover::-moz-range-thumb { box-shadow: inset 0 -2px 0 #f9b145, inset 0 2px 0 #fff; }
.volume-mute { display: flex; align-items: center; }

.datetime { display: flex; flex-direction: column; flex: 1; padding: 8px; }
.datetime [role=tabpanel] { margin-bottom: 8px; }
.datetime-cols { display: flex; gap: 10px; }
.datetime fieldset { margin: 0; flex: 1; }
.cal-head { display: flex; gap: 4px; margin-bottom: 6px; }
.cal-head select { flex: 1; }
.cal-head input { width: 62px; padding: 2px 4px; border: 1px solid #7f9db9; }
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #fff;
    border: 1px solid #7f9db9;
    text-align: center;
    font-size: 11px;
}
.cal-grid .dow { background: #7a96df; color: #fff; padding: 2px 0; }
.cal-grid .day { padding: 3px 0; cursor: default; }
.cal-grid .day.other { color: #b0b0b0; }
.cal-grid .day.today { outline: 1px solid #c0392b; outline-offset: -2px; }
.cal-grid .day.sel { background: var(--select-blue); color: #fff; }
.analog { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.analog svg { width: 130px; height: 130px; }
.analog .digital { padding: 2px 8px; background: #fff; border: 1px solid #7f9db9; min-width: 96px; text-align: center; }
.tz-map {
    height: 120px; margin: 8px 0;
    border: 1px solid #7f9db9;
    background: linear-gradient(180deg, #8fc4f2, #3f86e3);
    position: relative; overflow: hidden;
}
.tz-map::before {
    content: ""; position: absolute; inset: 20% 8% 15%;
    background:
        radial-gradient(ellipse 18% 30% at 22% 40%, #5fae36 60%, transparent 62%),
        radial-gradient(ellipse 10% 26% at 30% 75%, #5fae36 60%, transparent 62%),
        radial-gradient(ellipse 16% 22% at 52% 35%, #5fae36 60%, transparent 62%),
        radial-gradient(ellipse 10% 26% at 55% 68%, #5fae36 60%, transparent 62%),
        radial-gradient(ellipse 22% 26% at 74% 38%, #5fae36 60%, transparent 62%),
        radial-gradient(ellipse 8% 10% at 86% 76%, #5fae36 60%, transparent 62%);
}
.tz-band { position: absolute; top: 0; bottom: 0; width: 4.2%; background: rgba(255, 255, 255, 0.35); border-left: 1px solid #fff; border-right: 1px solid #fff; }

/* ---------------------------------------------------------------- Resume document viewer */

.doc-viewer { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.app-menubar { border-bottom: 1px solid #d8d2bd; }
.xp-window .app-menubar > button:disabled { color: #aca899; background: none; }
.doc-toolbar {
    flex: none;
    display: flex; align-items: center; gap: 2px;
    padding: 4px 6px;
    border-bottom: 1px solid #c5c2b2;
    background: linear-gradient(180deg, #fbfbf8 0%, #f1efe5 55%, #e6e3d4 100%);
    box-shadow: inset 0 -1px 0 #fff;
}
.doc-toolbar .toolbar-sep { margin: 4px 6px; }
.xp-window .tool-button.big { gap: 7px; padding: 4px 9px; font-size: 12px; }
.xp-window .tool-button.big svg { width: 30px; height: 30px; }
.ie-toolbar { padding: 3px 6px; gap: 1px; }
.ie-toolbar .tool-button.big svg { width: 26px; height: 26px; }
.xp-window .tool-button.toggle[aria-pressed="true"] { background: #e3e0d3; border-color: #9d9a8a; box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.18); }
.doc-zoom { margin-left: auto; padding: 2px 8px; background: #fff; border: 1px solid #7f9db9; font-size: 11px; }

/* Printing the resume: only the document page is printed */
#printArea { display: none; }
@media print {
    html, body { overflow: visible !important; height: auto !important; background: #fff !important; }
    body.print-resume > *:not(#printArea) { display: none !important; }
    body.print-resume #printArea { display: block !important; }
    #printArea .doc-page { box-shadow: none; width: 100%; margin: 0; break-after: page; }
}
.doc-scroll { flex: 1; min-height: 0; overflow: auto; background: #808080; padding: 16px; }
.doc-page {
    display: block;
    width: calc(640px * var(--doc-zoom, 1));
    max-width: none;
    height: auto;
    margin: 0 auto 16px;
    background: #fff;
    box-shadow: 2px 2px 0 #4a4a4a;
}


/* ---------------------------------------------------------------- NemerBot chat (messenger style) */

.msn { display: flex; flex-direction: column; flex: 1; min-height: 0; background: linear-gradient(180deg, #eaf4fd 0%, #f6faff 40%, #eef5fc 100%); }
.msn-head {
    flex: none;
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #b7cde6;
    background: linear-gradient(180deg, #ffffff, #dcebfa);
    font-size: 12px;
}
.msn-head-pic { width: 34px; height: 34px; flex: none; }
.msn-online { color: #2e8b20; font-size: 11px; }
.msn-sub { color: #5a6b80; font-size: 11px; margin-top: 2px; }
.msn-main { flex: 1; min-height: 0; display: flex; gap: 10px; padding: 10px; }
.msn-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.msn-log {
    flex: 1; min-height: 120px;
    overflow-y: auto;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #a9bfd8;
    border-radius: 3px;
    font-size: 12px;
    user-select: text; -webkit-user-select: text;
}
.msn-msg { margin-bottom: 10px; }
.msn-who { color: #6b7a8c; font-size: 11px; margin-bottom: 2px; }
.msn-text { white-space: pre-wrap; word-wrap: break-word; line-height: 1.45; color: #111; padding-left: 8px; }
.from-you .msn-text { color: #0b3d91; }
.from-mohammad .msn-who { color: #1f7a2e; font-weight: bold; }
.from-mohammad .msn-text { color: #14532d; border-left: 3px solid #3fae4f; padding-left: 7px; }
.msn-text a { color: #0b49b5; }
.msn-note-line { margin: 4px 0 10px; padding: 3px 8px; font-size: 11px; color: #4a5a6e; background: #eef4fb; border-left: 3px solid #7aa6e0; }
.msn-typing { display: flex; gap: 4px; padding: 0 4px; }
.msn-typing span { width: 6px; height: 6px; border-radius: 50%; background: #7aa6e0; animation: msn-dot 1s infinite ease-in-out; }
.msn-typing span:nth-child(2) { animation-delay: 0.15s; }
.msn-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes msn-dot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.msn-suggest { display: flex; flex-wrap: wrap; gap: 5px; }
.xp-window .msn-suggest button {
    min-width: 0; min-height: 0;
    padding: 3px 9px;
    font-size: 11px;
    border-radius: 10px;
    border: 1px solid #9db6d6;
    background: linear-gradient(180deg, #ffffff, #e3eefb);
    box-shadow: none;
    color: #0b3d91;
    cursor: pointer;
}
.xp-window .msn-suggest button:hover { background: #fff7d6; border-color: #e0b84a; }
.msn-compose { display: flex; gap: 6px; align-items: stretch; }
.msn-input {
    flex: 1; min-width: 0;
    resize: none;
    padding: 6px 8px;
    border: 1px solid #a9bfd8;
    border-radius: 3px;
    font-size: 12px;
    background: #fff;
}
.xp-window .msn-send { min-width: 70px; }
.msn-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; color: #6b7a8c; }
.msn-status-line { color: #2a5ea8; font-style: italic; }
.msn-pics {
    flex: none;
    width: 120px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
}
.msn-av-say {
    position: relative;
    max-width: 112px;
    padding: 5px 8px;
    border: 1px solid #8fb1d9;
    border-radius: 8px;
    background: #fffef8;
    box-shadow: 0 1px 3px rgba(30, 70, 140, 0.2);
    font-size: 11px;
    line-height: 1.25;
    color: #1a2a44;
    text-align: center;
    word-wrap: break-word;
}
.msn-av-say::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: #fffef8;
    filter: drop-shadow(0 1px 0 #8fb1d9);
}
.msn-av-say.pop { animation: msn-say-pop 0.22s ease-out; }
@keyframes msn-say-pop {
    from { opacity: 0; transform: translateY(4px) scale(0.92); }
    to { opacity: 1; transform: none; }
}
.msn-frame {
    position: relative;
    width: 112px; height: 112px;
    padding: 6px;
    border-radius: 10px;
    border: 1px solid #8fb1d9;
    background: linear-gradient(180deg, #ffffff, #d6e6f8);
    box-shadow: 0 2px 6px rgba(30, 70, 140, 0.25), inset 0 1px 0 #fff;
    cursor: pointer;
}
.msn-frame:focus-visible { outline: 2px solid #245edb; outline-offset: 2px; }
.msn-frame svg { width: 100%; height: 100%; border-radius: 6px; background: linear-gradient(180deg, #d8ecff, #ffffff); }
.msn-frame img.msn-av {
    position: absolute;
    inset: 6px;
    width: calc(100% - 12px);
    height: calc(100% - 12px);
    border-radius: 6px;
    object-fit: cover;
    display: block;
    opacity: 0;
    pointer-events: none;
}
.msn-frame img.msn-av-idle { opacity: 1; }
/* the avatars are transparent now, so the idle one must step aside while a mood shows */
.msn-frame.is-wave img.msn-av-idle, .msn-frame.is-wink img.msn-av-idle,
.msn-frame.is-think img.msn-av-idle, .msn-frame.is-mad img.msn-av-idle { opacity: 0; }
.msn-frame.is-wave img.msn-av-wave,
.msn-frame.is-wink img.msn-av-wink,
.msn-frame.is-think img.msn-av-think,
.msn-frame.is-mad img.msn-av-mad { opacity: 1; }
.msn-frame.is-mad { border-color: #c45a4a; box-shadow: 0 2px 6px rgba(160, 40, 30, 0.28), inset 0 1px 0 #fff; }
.msn-frame.you svg { background: linear-gradient(180deg, #fff1d6, #ffffff); }

/* email draft card inside the conversation */
.msn-card { margin: 4px 0 12px; padding: 8px 10px; border: 1px solid #9db6d6; border-radius: 4px; background: #f6faff; font-size: 11px; }
.msn-card-title { display: flex; align-items: center; gap: 6px; font-weight: 700; color: #1d3f86; margin-bottom: 6px; }
.msn-card-title svg { width: 18px; height: 18px; }
.msn-card-grid { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: center; margin-bottom: 6px; }
.msn-card input, .msn-card textarea { width: 100%; font-size: 12px; }
.msn-card textarea { resize: vertical; border: 1px solid #7f9db9; padding: 4px 6px; }
.msn-card .invalid { border-color: #c0392b !important; background: #fff4f2; }
.msn-card-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.msn-card-status { flex: 1; color: #4a5a6e; }
.msn-card-done { opacity: 0.85; }
.msn-card-done .msn-card-status { color: #1e5e1e; font-weight: 700; }

/* toast notification above the tray */
.toast {
    position: absolute;
    right: 8px;
    bottom: calc(var(--taskbar-h) + 8px);
    z-index: 5550;
    width: 260px;
    border: 1px solid #3a6fc9;
    border-radius: 6px 6px 3px 3px;
    overflow: hidden;
    background: linear-gradient(180deg, #f3f8ff 0%, #d9e8fb 100%);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    animation: toast-in 0.35s ease-out;
}
.toast.toast-out { animation: toast-out 0.25s ease-in forwards; }
@keyframes toast-in { from { transform: translateY(30px); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(30px); opacity: 0; } }
.toast-title {
    display: flex; align-items: center; justify-content: space-between;
    padding: 3px 6px 3px 8px;
    color: #fff;
    font: 700 11px var(--ui-font);
    background: linear-gradient(180deg, #4a8be8, #2257c6);
}
.toast .toast-close {
    all: unset;
    width: 16px; height: 16px;
    text-align: center; line-height: 15px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
}
.toast .toast-close:hover { background: rgba(255, 255, 255, 0.25); }
.toast .toast-body {
    all: unset;
    box-sizing: border-box;
    width: 100%;
    display: flex; gap: 10px; align-items: center;
    padding: 10px;
    cursor: pointer;
    font-size: 12px;
    color: #10284f;
    line-height: 1.4;
}
.toast .toast-body:hover .toast-text { text-decoration: underline; }
.toast-pic { width: 40px; height: 40px; flex: none; }
.tray-chat { position: relative; }
.tray-chat .tray-icon { width: 18px; height: 18px; }
.tray-chat.tray-pulse { animation: tray-pulse 0.9s ease-out 2; }
@keyframes tray-pulse { 0% { transform: scale(1); } 35% { transform: scale(1.35); filter: brightness(1.25); } 100% { transform: scale(1); } }
.tray-chat.has-unread::after {
    content: "";
    position: absolute; right: -2px; top: -1px;
    width: 8px; height: 8px; border-radius: 50%;
    background: #ff8c1a; box-shadow: 0 0 0 1px #fff;
}

/* ---------------------------------------------------------------- Small screens */

@media (max-width: 760px), (pointer: coarse) and (max-width: 1024px) {
    :root { --taskbar-h: 40px; }

    /* even columns at any phone/tablet width */
    .desktop-icons {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
        grid-auto-rows: min-content;
        align-content: start;
        right: 0;
        padding: 16px 8px;
        gap: 18px 4px;
    }
    .desktop .desktop-icon { width: auto; min-width: 0; }
    .desktop-icon svg { width: 54px; height: 54px; }
    .desktop-icon span { font-size: 12px; }

    .xp-window { min-width: 0; animation-name: window-open-mobile; }
    .resize-handle { display: none; }
    .xp-window .title-bar { height: 36px; }
    .xp-window .title-bar-controls button { min-width: 26px; min-height: 26px; background-size: 26px; }
    .xp-window .title-bar-controls button[aria-label="Maximize"],
    .xp-window .title-bar-controls button[aria-label="Restore"] { display: none; }

    .task-pane { display: none; }
        .skill-groups { grid-template-columns: 1fr; }
    .doc-scroll { padding: 6px; }
    .doc-page { width: calc(100% * var(--doc-zoom, 1)); }
    .details-table td:nth-child(2) { width: 30%; }
    .details-table td:nth-child(3) { display: none; }
    .details-table th:nth-child(3) { display: none; }

    .taskbar .start-button { font-size: 20px; padding-right: 18px; }
    .taskbar .taskbar-item { height: 30px; flex-basis: 44px; justify-content: center; }
    .taskbar .taskbar-item span { display: none; }
    .taskbar .taskbar-item svg { width: 20px; height: 20px; }
    .tray #volumeButton, .tray > .tray-icon { display: none; }
    .tray .tray-chat .tray-icon { width: 22px; height: 22px; }

    /* toolbars: icon-only on phones, and scroll inside themselves instead of pushing the window wider */
    .toolbar, .doc-toolbar, .compose-toolbar, .app-menubar {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .toolbar::-webkit-scrollbar, .doc-toolbar::-webkit-scrollbar, .compose-toolbar::-webkit-scrollbar, .app-menubar::-webkit-scrollbar { display: none; }
    .xp-window .tool-button.big { padding: 4px 8px; flex: none; }
    .xp-window .tool-button.big span { display: none; }
    .xp-window .tool-button.big svg { width: 26px; height: 26px; }
    .doc-toolbar .toolbar-sep, .ie-toolbar .toolbar-sep { margin: 4px 2px; }
    .xp-window .window-scroll { overflow-x: hidden; }
    .datetime-cols { flex-direction: column; }
    .compose-from { grid-template-columns: 1fr; }
    .msn-pics { display: none; }
    .msn-main { padding: 8px; }
    .msn-foot span:last-child { display: none; }
    .toast { left: 8px; right: 8px; width: auto; }
    .address-bar .address-go { display: none; }
    .volume-popup { right: 8px; }
        .all-programs { left: 0 !important; right: 0; top: auto !important; bottom: var(--taskbar-h) !important; max-height: 70vh; overflow: auto; }
    .xp-menu .submenu { position: static; box-shadow: none; border: 0; padding-left: 18px; }
    .power-dialog { width: min(314px, 94vw); }

    .start-menu { width: 100vw; border-radius: 0; }
    .start-menu .start-body button, .start-menu .start-body a { padding: 7px 10px; font-size: 13px; }
    .start-menu .start-footer button { font-size: 13px; }

    .login-middle { flex-direction: column; gap: 22px; }
    .login-left { align-items: center; text-align: center; padding: 0 16px; flex: none; }
    .login-hint { margin-top: 10px; font-size: 15px; }
    .login-divider { width: 70%; height: 1px; margin: 0; align-self: center; background: linear-gradient(90deg, transparent, #fff, transparent); }
    .login-right { flex: none; padding: 0 16px; }
    .login-bottom-note { display: none; }
    .boot-footer span:first-child { display: none; }
}
@keyframes window-open-mobile { from { transform: translateY(16px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
