/* ---------- Reset & base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }

.xp-body {
    font-family: "Tahoma", "Trebuchet MS", "Segoe UI", sans-serif;
    font-size: 11px;
    color: #000;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

/* ---------- Desktop ---------- */
.xp-desktop {
    position: fixed;
    inset: 0;
    background-color: #3a6ea5;
    background-image: url('/img/wallpaper.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

/* Area above the taskbar where icons / windows live */
.xp-desktop-surface {
    position: absolute;
    inset: 0 0 30px 0; /* leaves room for taskbar */
    overflow: hidden;
}

/* ---------- Taskbar ---------- */
.xp-taskbar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 30px;
    display: flex;
    align-items: stretch;
    /* Classic XP blue gradient */
    background: linear-gradient(
        to bottom,
        #2683d8 0%,
        #2382d6 3%,
        #2782d4 6%,
        #2581d2 10%,
        #2074c2 50%,
        #1d6cb6 90%,
        #225ea8 100%
    );
    border-top: 1px solid #0a3a8c;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
    z-index: 1000;
}

/* ---------- Start button ---------- */
.xp-start-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    padding: 0 22px 2px 12px;
    border: none;
    cursor: pointer;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-style: italic;
    font-weight: bold;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.55);
    /* Green gradient */
    background: linear-gradient(
        to bottom,
        #3dab3d 0%,
        #319731 8%,
        #2a8a2a 25%,
        #1f7d1f 60%,
        #1a6b1a 95%,
        #154d15 100%
    );
    border-top-right-radius: 10px 12px;
    border-bottom-right-radius: 10px 12px;
    box-shadow:
        inset 1px 1px 0 rgba(255,255,255,0.4),
        inset -1px -1px 0 rgba(0,0,0,0.25);
}

.xp-start-button::before {
    content: "";
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 35%, #ffffff 0%, #d8d8d8 30%, #888 70%, #444 100%);
    border: 1px solid rgba(0,0,0,0.4);
    flex-shrink: 0;
}

.xp-start-button:hover { filter: brightness(1.08); }
.xp-start-button.is-open { filter: brightness(0.9); }

/* ---------- Quick launch / running tasks area ---------- */
.xp-tasks {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    padding: 0 4px;
    border-left: 1px solid #0a3a8c;
    box-shadow: inset 1px 0 0 rgba(255,255,255,0.25);
}

/* ---------- System tray ---------- */
.xp-tray {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    height: 100%;
    background: linear-gradient(
        to bottom,
        #1391de 0%,
        #1086d2 50%,
        #0d6cb1 100%
    );
    border-left: 1px solid #0a3a8c;
    box-shadow: inset 1px 0 0 rgba(255,255,255,0.35);
    color: #fff;
}

.xp-tray-clock {
    font-size: 11px;
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.4);
    min-width: 48px;
    text-align: center;
}

/* ---------- Start menu ---------- */
.xp-start-menu {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 380px;
    background: #fff;
    border: 1px solid #0a3a8c;
    border-bottom: none;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    box-shadow: 2px -2px 8px rgba(0,0,0,0.35);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1001;
}

.xp-start-menu.is-open { display: flex; }

.xp-start-header {
    height: 56px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
    background: linear-gradient(
        to bottom,
        #1f6dc9 0%,
        #1a64bd 50%,
        #154f9c 100%
    );
    border-bottom: 2px solid #f5a623;
}

.xp-start-avatar {
    width: 38px;
    height: 38px;
    border-radius: 4px;
    background: linear-gradient(135deg, #cfe2ff 0%, #6aa1e0 100%);
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
}

.xp-start-body {
    display: flex;
    flex-direction: row;
    background: #fff;
    min-height: 280px;
}

.xp-start-col {
    flex: 1 1 50%;
    padding: 6px 4px;
}

.xp-start-col.left { border-right: 1px solid #d4d0c8; }
.xp-start-col.right { background: #d3e5fa; }

.xp-start-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 2px;
    color: #000;
    text-decoration: none;
    cursor: pointer;
    font-size: 12px;
}

.xp-start-item:hover {
    background: #2f71cd;
    color: #fff;
}

.xp-start-item .xp-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 3px;
}

.xp-start-item-sub {
    color: #666;
}

/* Placeholder MSN-style icon (pure CSS, no image) */
.xp-icon-msn {
    background:
        radial-gradient(circle at 30% 30%, #ffffff 0%, #ffe9a8 25%, #f5a623 60%, #b8730f 100%);
    border: 1px solid #7a4a07;
    position: relative;
}

.xp-icon-msn::after {
    content: "";
    position: absolute;
    inset: 5px 5px 5px 5px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 35%, #fff7d6 0%, #f6c343 50%, #b8730f 100%);
    box-shadow: inset 0 -2px 2px rgba(0,0,0,0.25);
}

.xp-start-footer {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    padding: 6px 12px;
    background: linear-gradient(
        to bottom,
        #2f86dc 0%,
        #1f6dc9 50%,
        #154f9c 100%
    );
    color: #fff;
    border-top: 2px solid #f5a623;
}

.xp-start-footer button {
    background: transparent;
    border: none;
    color: #fff;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

.xp-start-footer button:hover { text-decoration: underline; }

/* ---------- XP Window ---------- */
.xp-window {
    position: absolute;
    min-width: 200px;
    min-height: 120px;
    background: #ece9d8;
    border: 1px solid #0831d9;
    border-top: none;
    border-radius: 8px 8px 0 0;
    box-shadow:
        0 0 0 1px rgba(0,0,0,0.15),
        4px 4px 12px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.xp-window.is-hidden { display: none; }

.xp-window.is-maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
}

/* Title bar */
.xp-titlebar {
    height: 28px;
    display: flex;
    align-items: center;
    padding: 0 4px 2px 6px;
    color: #fff;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
    cursor: default;
    background: linear-gradient(
        to bottom,
        #0a55c8 0%,
        #0a55c8 5%,
        #2065d6 10%,
        #2872de 30%,
        #2570d8 60%,
        #1f5fbf 90%,
        #154f9c 100%
    );
    border-top-left-radius: 7px;
    border-top-right-radius: 7px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}

.xp-window.is-inactive .xp-titlebar {
    background: linear-gradient(
        to bottom,
        #7a96df 0%,
        #7a96df 5%,
        #8aa6e6 10%,
        #8aa6e6 60%,
        #6c8bd0 100%
    );
}

.xp-window.is-inactive { border-color: #7a96df; }

.xp-titlebar-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    border-radius: 2px;
    flex-shrink: 0;
}

.xp-titlebar-title {
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Title bar buttons */
.xp-titlebar-buttons {
    display: flex;
    align-items: center;
    gap: 2px;
}

.xp-titlebar-button {
    width: 22px;
    height: 22px;
    border: 1px solid rgba(0,0,0,0.4);
    border-radius: 3px;
    background: linear-gradient(to bottom, #4d8fe0 0%, #2871d8 50%, #1c5cb8 100%);
    color: #fff;
    font-family: "Marlett", "Segoe UI Symbol", sans-serif;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    box-shadow: inset 1px 1px 0 rgba(255,255,255,0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.xp-titlebar-button:hover { filter: brightness(1.15); }
.xp-titlebar-button:active { filter: brightness(0.85); }

.xp-titlebar-button.close {
    background: linear-gradient(to bottom, #e36b6b 0%, #c43a3a 50%, #952020 100%);
}

/* Menu bar */
.xp-menubar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px 4px;
    background: #ece9d8;
    border-bottom: 1px solid #aca899;
    font-size: 11px;
}

.xp-menubar-item {
    padding: 2px 7px;
    cursor: default;
    border-radius: 2px;
}

.xp-menubar-item:hover {
    background: #316ac5;
    color: #fff;
}

/* Content area */
.xp-window-content {
    flex: 1 1 auto;
    background: #fff;
    overflow: auto;
    border-top: 1px solid #fff;
}

/* Status bar (optional) */
.xp-statusbar {
    height: 20px;
    border-top: 1px solid #fff;
    box-shadow: inset 0 1px 0 #aca899;
    background: #ece9d8;
    font-size: 11px;
    padding: 2px 8px;
    display: flex;
    align-items: center;
}

/* ---------- Taskbar app buttons (running windows) ---------- */
.xp-task-button {
    height: 22px;
    margin: 4px 2px;
    padding: 0 8px;
    min-width: 140px;
    max-width: 200px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #0a3a8c;
    border-radius: 3px;
    background: linear-gradient(to bottom, #4d8fe0 0%, #2871d8 50%, #1c5cb8 100%);
    color: #fff;
    font-size: 11px;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.4);
    cursor: pointer;
    box-shadow: inset 1px 1px 0 rgba(255,255,255,0.3);
    overflow: hidden;
}

.xp-task-button.is-active {
    background: linear-gradient(to bottom, #1a4f9c 0%, #154386 50%, #0f316b 100%);
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.45);
}

.xp-task-button .xp-task-label {
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

/* ---------- MSN Messenger sign-in ---------- */
.msn-signin {
    font-family: "Tahoma", "Segoe UI", sans-serif;
    font-size: 12px;
    color: #000;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(to bottom, #cfe3fb, #e8f1fb 30%, #ffffff 55%, #d6e6fa);
}

.msn-signin .msn-header {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #b9cfe8;
    background: linear-gradient(to bottom, #dcebfa, #c5dcf3);
}

.msn-signin .msn-chev {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(to bottom, #fff, #b9d4f3);
    border: 1px solid #6e9bd1;
    margin-right: 8px;
    font-size: 9px;
    text-align: center;
    line-height: 12px;
    color: #2c5fa8;
}

.msn-signin .msn-brand {
    font-weight: bold;
    color: #2c5fa8;
    font-size: 14px;
}

.msn-signin .msn-brand .msn-msn {
    color: #1f4e8c;
    font-style: italic;
    margin-right: 4px;
}

.msn-signin .msn-body {
    flex: 1 1 auto;
    padding: 14px 22px 10px;
    background: linear-gradient(to bottom, #f4f8fd 0%, #e6eff9 100%);
    overflow: auto;
}

.msn-signin .msn-avatar {
    width: 96px;
    height: 96px;
    margin: 4px auto 14px;
    border: 2px solid #6e9bd1;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.msn-signin .msn-buddy {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, #fff 0%, transparent 25%),
        conic-gradient(#2a8f3a 0 25%, #f0a000 25% 50%, #d44 50% 75%, #1c6fbf 75% 100%);
}

.msn-signin label {
    display: block;
    font-weight: bold;
    margin: 6px 0 2px;
}

.msn-signin .msn-input-row {
    display: flex;
}

.msn-signin .msn-input-row input {
    flex: 1 1 auto;
    padding: 3px 4px;
    border: 1px solid #7a9ec4;
    background: #fff;
    font-family: inherit;
    font-size: 12px;
    height: 22px;
    outline: none;
}

.msn-signin .msn-input-row input:focus {
    border-color: #2c5fa8;
}

.msn-signin .msn-input-row .msn-dropdown {
    width: 18px;
    border: 1px solid #7a9ec4;
    border-left: none;
    background: linear-gradient(to bottom, #eaf2fc, #b9d4f3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    cursor: pointer;
}

.msn-signin .msn-status {
    margin: 10px 0 6px;
    font-weight: bold;
}

.msn-signin .msn-status .msn-val { font-weight: normal; }
.msn-signin .msn-status .msn-arrow { font-size: 9px; color: #2c5fa8; }

.msn-signin .msn-checks { margin: 4px 0 12px; }
.msn-signin .msn-checks label {
    display: flex;
    align-items: center;
    font-weight: normal;
    margin: 3px 0;
    gap: 6px;
}
.msn-signin .msn-checks input { margin: 0; }

.msn-signin .msn-signin-wrap {
    display: flex;
    justify-content: center;
    margin: 10px 0 18px;
}

.msn-signin .msn-signin-btn {
    padding: 6px 26px;
    font-weight: bold;
    font-size: 12px;
    font-family: inherit;
    color: #000;
    background: linear-gradient(to bottom, #ffe6a8, #f5b94a 50%, #e89623);
    border: 1px solid #8a5a14;
    border-radius: 3px;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.msn-signin .msn-signin-btn:hover { filter: brightness(1.05); }
.msn-signin .msn-signin-btn:active { filter: brightness(0.92); }

.msn-signin .msn-links { font-size: 12px; margin-top: 18px; }
.msn-signin .msn-links a {
    color: #1f4e8c;
    text-decoration: underline;
    display: block;
    margin: 2px 0;
}
.msn-signin .msn-links .msn-link-row {
    display: flex;
    justify-content: space-between;
}

/* Passport key icon for status bar */
.msn-passport-key {
    width: 18px;
    height: 14px;
    background: linear-gradient(to bottom, #6e9bd1, #2c5fa8);
    border-radius: 2px;
    margin-right: 6px;
    display: inline-block;
    vertical-align: middle;
}

.msn-signin-error {
    color: #b00020;
    background: #fff4f4;
    border: 1px solid #e9b3b3;
    padding: 4px 6px;
    margin: 0 0 8px;
    font-size: 11px;
}

[data-msn-view] {
    height: 100%;
}

/* ---------- MSN Contacts ---------- */
.msn-contacts {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #eaf2fb;
    font-family: "Tahoma", "Segoe UI", sans-serif;
    font-size: 11px;
    color: #1a1a1a;
}

.msn-c-user {
    display: flex;
    padding: 8px;
    background: linear-gradient(to bottom, #d4e4f7, #b9d1ec);
    border-bottom: 1px solid #8aa9cc;
    align-items: center;
}

.msn-c-avatar {
    width: 48px;
    height: 48px;
    border: 2px solid #fff;
    outline: 1px solid #4a7fc1;
    background:
        radial-gradient(circle at 35% 30%, #fff 0%, transparent 25%),
        conic-gradient(#2a8f3a 0 25%, #f0a000 25% 50%, #d44 50% 75%, #1c6fbf 75% 100%);
    flex-shrink: 0;
}

.msn-c-user-info {
    margin-left: 8px;
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.msn-c-user-name {
    font-weight: bold;
    color: #1f3b66;
    font-size: 12px;
}

.msn-c-user-sub {
    color: #8aa0b8;
    font-weight: normal;
    font-size: 10px;
}

.msn-c-user-status {
    color: #6a7a8c;
    font-size: 10px;
    font-style: italic;
}

.msn-c-user-presence {
    color: #6a7a8c;
    font-size: 10px;
    margin-top: 2px;
}

.msn-c-user-presence::before {
    content: "●";
    color: #5cba47;
    margin-right: 3px;
}

.msn-c-toolbar {
    display: flex;
    gap: 2px;
    padding: 4px 6px;
    background: linear-gradient(to bottom, #cfe0f5, #a9c4e3);
    border-bottom: 1px solid #8aa9cc;
}

.msn-c-ti {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.5), rgba(255,255,255,0));
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
}

.msn-c-ti:hover {
    border-color: #6a8fbf;
    background: rgba(255,255,255,0.6);
}

.msn-c-search {
    padding: 6px;
    display: flex;
    gap: 4px;
    background: #eaf2fb;
}

.msn-c-search input {
    flex: 1;
    padding: 3px 6px;
    border: 1px solid #8aa9cc;
    border-radius: 2px;
    font-size: 11px;
    font-family: inherit;
    background: #fff;
    outline: none;
}

.msn-c-add,
.msn-c-sort {
    width: 24px;
    height: 22px;
    background: linear-gradient(to bottom, #d4e4f7, #a9c4e3);
    border: 1px solid #6a8fbf;
    border-radius: 2px;
    font-size: 11px;
    color: #1f3b66;
    cursor: pointer;
    padding: 0;
}

.msn-c-add:hover,
.msn-c-sort:hover { filter: brightness(1.05); }

.msn-c-list {
    background: #fff;
    flex: 1 1 auto;
    overflow-y: auto;
    border-top: 1px solid #8aa9cc;
}

.msn-c-group {
    padding: 3px 6px;
    background: linear-gradient(to bottom, #eaf2fb, #d4e4f7);
    border-bottom: 1px solid #c4d4e8;
    color: #1f3b66;
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
}

.msn-c-group::before {
    content: "▼ ";
    font-size: 8px;
    color: #4a7fc1;
}

.msn-c-contact {
    display: flex;
    align-items: center;
    padding: 2px 6px 2px 18px;
    border-bottom: 1px dotted #e0e8f2;
    color: #1a1a1a;
    font-size: 11px;
    line-height: 16px;
    cursor: default;
}

.msn-c-contact:hover { background: #fff7c4; }
.msn-c-contact.selected { background: #c4dbf5; }

.msn-c-contact .msn-c-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
    background: #5cba47;
    box-shadow: inset 0 -2px 2px rgba(0,0,0,0.2);
}

.msn-c-contact.away .msn-c-dot { background: #f5b94a; }
.msn-c-contact.offline .msn-c-dot { background: #b0b8c0; }
.msn-c-contact.offline { color: #6a7a8c; }

.msn-c-contact .msn-c-name {
    flex-shrink: 0;
    margin-right: 4px;
}

.msn-c-contact .msn-c-msg {
    color: #6a7a8c;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    font-size: 10px;
}

.msn-c-contact .msn-c-msg:not(:empty)::before {
    content: "- ";
    color: #6a7a8c;
}

.msn-c-heart { color: #d23; }

.msn-c-bottom {
    padding: 6px;
    background: linear-gradient(to bottom, #cfe0f5, #a9c4e3);
    border-top: 1px solid #8aa9cc;
    display: flex;
    gap: 4px;
}

.msn-c-bottom input {
    flex: 1;
    padding: 3px 6px;
    border: 1px solid #8aa9cc;
    border-radius: 2px;
    font-size: 11px;
    font-family: inherit;
    background: #fff;
    outline: none;
}

.msn-c-go {
    width: 24px;
    height: 22px;
    background: linear-gradient(to bottom, #4a7fc1, #244a85);
    border: 1px solid #1f3b66;
    border-radius: 2px;
    color: #fff;
    font-size: 10px;
    cursor: pointer;
    padding: 0;
}

.msn-c-go:hover { filter: brightness(1.1); }

/* ---------- MSN Chat window ---------- */
.msn-chat-window {
    top: 90px;
    left: 200px;
    width: 720px;
    height: 480px;
}
.msn-chat-window .xp-window-content { padding: 0; }
.msn-chat-content { background: #d4e4f7 !important; }

.msn-chat {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #d4e4f7;
    font-family: "Tahoma", "Segoe UI", sans-serif;
    font-size: 11px;
    color: #1a1a1a;
}

.msn-chat-toolbar {
    background: linear-gradient(to bottom, #eaf2fb 0%, #cfe0f5 100%);
    border-bottom: 1px solid #8aa9cc;
    display: flex;
    align-items: flex-start;
    padding: 4px 6px 2px;
    position: relative;
}

.msn-chat-leftpill {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff, #b9d1ec 60%, #6a8fbf);
    border: 1px solid #4a7fc1;
    margin: 4px 8px 0 2px;
    flex-shrink: 0;
}

.msn-chat-tools { display: flex; gap: 2px; flex: 1 1 auto; }

.msn-chat-tool {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2px 8px;
    min-width: 56px;
    border-radius: 3px;
    cursor: default;
}
.msn-chat-tool:hover { background: #b9d1ec; outline: 1px solid #4a7fc1; }

.msn-chat-ti {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.2));
}

.msn-chat-lbl {
    font-size: 11px;
    color: #1a1a1a;
    margin-top: 1px;
}

.msn-chat-tabarea {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 4px 0 12px;
    align-self: stretch;
    background: linear-gradient(to bottom, #d4e4f7, #b9d1ec);
    border-left: 1px solid #8aa9cc;
    border-top-left-radius: 8px;
}

.msn-chat-logo {
    font-family: "Segoe UI", Tahoma, sans-serif;
    font-weight: bold;
    font-style: italic;
    font-size: 18px;
    background: linear-gradient(to bottom, #4a7fc1, #1f3b66);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-right: 4px;
    letter-spacing: -1px;
}
.msn-chat-logo::after {
    content: "▸";
    color: #ff9900;
    font-style: normal;
    margin-left: 1px;
}

.msn-chat-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid #8aa9cc;
    background: radial-gradient(circle at 35% 30%, #fff, #d4e4f7 70%, #a9c4e3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #c33;
    cursor: pointer;
}
.msn-chat-circle.green { color: #393; }

.msn-chat-body {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 1fr 152px;
    gap: 6px;
    padding: 6px 8px;
    background: #eaf2fb;
    overflow: hidden;
    min-height: 0;
}

.msn-chat-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    min-height: 0;
}

.msn-chat-history {
    background: #fff;
    border: 1px solid #8aa9cc;
    border-radius: 2px;
    padding: 6px 8px;
    flex: 1 1 auto;
    color: #444;
    overflow-y: auto;
    min-height: 100px;
}

.msn-chat-history-meta {
    color: #1a1a1a;
    margin-bottom: 4px;
}

.msn-chat-history-hint {
    color: #6a7a8c;
    font-style: italic;
    border-bottom: 1px solid #e0e8f2;
    padding-bottom: 4px;
    margin-bottom: 6px;
}

.msn-chat-line {
    margin: 2px 0;
    color: #000;
    word-wrap: break-word;
}

.msn-chat-line .who {
    font-weight: bold;
    margin-right: 4px;
}

.msn-chat-line.me .who { color: #c33; }
.msn-chat-line.them .who { color: #1f4e8c; }

.msn-compose-toolbar {
    background: linear-gradient(to bottom, #eaf2fb, #cfe0f5);
    border: 1px solid #8aa9cc;
    border-bottom: none;
    border-radius: 2px 2px 0 0;
    padding: 3px 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}
.msn-ct {
    display: flex;
    align-items: center;
    gap: 2px;
    cursor: default;
    padding: 1px 2px;
    border-radius: 2px;
}
.msn-ct:hover { background: #b9d1ec; }
.msn-caret { font-size: 7px; color: #555; }
.msn-sep { width: 1px; height: 14px; background: #8aa9cc; }
.msn-font-A {
    font-family: "Times New Roman", serif;
    font-weight: bold;
    color: #c33;
    font-size: 14px;
}

.msn-compose-area {
    display: grid;
    grid-template-columns: 1fr 80px;
    border: 1px solid #8aa9cc;
    border-top: none;
    background: #fff;
    border-radius: 0 0 2px 2px;
    min-height: 80px;
}

.msn-compose-input {
    padding: 6px;
    color: #000;
    font-size: 11px;
    font-family: inherit;
    border: none;
    outline: none;
    resize: none;
    background: #fff;
}

.msn-compose-buttons {
    border-left: 1px solid #c4d4e8;
    background: linear-gradient(to right, #f4f8fd, #e4eefa);
    display: flex;
    flex-direction: column;
}

.msn-cbtn {
    flex: 1;
    border: none;
    background: linear-gradient(to bottom, #f0f4fa, #d4e0ee);
    border-bottom: 1px solid #c4d4e8;
    color: #444;
    font-family: Tahoma, sans-serif;
    font-size: 12px;
    cursor: pointer;
    padding: 4px;
}
.msn-cbtn:last-child { border-bottom: none; }
.msn-cbtn:hover { filter: brightness(1.05); }
.msn-cbtn:active { filter: brightness(0.92); }
.msn-cbtn[data-msn-send] { color: #000; font-weight: bold; }

.msn-compose-foot {
    display: flex;
    justify-content: flex-end;
    background: linear-gradient(to bottom, #eaf2fb, #cfe0f5);
    border: 1px solid #8aa9cc;
    border-top: none;
    padding: 2px 6px;
    gap: 8px;
    font-size: 14px;
}

.msn-chat-right {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.msn-avatar-frame {
    width: 132px;
    background: linear-gradient(to bottom, #f5f9ff, #d6e6f8);
    border: 1px solid #8aa9cc;
    border-radius: 4px;
    padding: 6px 6px 4px;
    box-shadow: inset 0 1px 0 #fff;
}

.msn-avatar-img {
    width: 120px;
    height: 120px;
    background: #fff;
    border: 1px solid #6a8fbf;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.msn-avatar-foot {
    height: 14px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 2px;
    color: #4a7fc1;
    font-size: 8px;
}

.msn-butterfly {
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 30px 45px at 30% 50%, #00a651 0%, #00a651 40%, transparent 42%),
        radial-gradient(ellipse 30px 45px at 70% 50%, #00a651 0%, #00a651 40%, transparent 42%),
        radial-gradient(ellipse 22px 30px at 22% 65%, #ff8c1a 0%, #ff8c1a 50%, transparent 52%),
        radial-gradient(ellipse 22px 30px at 78% 65%, #ed1c24 0%, #ed1c24 50%, transparent 52%),
        radial-gradient(ellipse 18px 30px at 50% 50%, #2b3990 0%, #2b3990 60%, transparent 62%),
        linear-gradient(to bottom, #fff, #e8f0f9);
}

.msn-duck {
    width: 110px;
    height: 100px;
    position: relative;
}
.msn-duck-body {
    position: absolute;
    width: 90px;
    height: 60px;
    background: radial-gradient(ellipse at 35% 35%, #fff5a8, #f5c518 60%, #d49a00);
    border-radius: 50% 60% 50% 50%;
    bottom: 5px;
    left: 10px;
    box-shadow: inset -8px -8px 12px rgba(180,120,0,0.4);
}
.msn-duck-head {
    position: absolute;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle at 35% 30%, #fff5a8, #f5c518 60%, #d49a00);
    border-radius: 50%;
    top: 5px;
    left: 5px;
    box-shadow: inset -4px -4px 8px rgba(180,120,0,0.4);
}
.msn-duck-eye {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #111;
    border-radius: 50%;
    top: 22px;
    left: 30px;
    box-shadow: inset 1px 1px 0 #fff;
}
.msn-duck-beak {
    position: absolute;
    width: 18px;
    height: 8px;
    background: linear-gradient(to bottom, #ff8c1a, #d96a00);
    border-radius: 50%;
    top: 32px;
    left: 42px;
}

.msn-chat-statusbar {
    color: #1a1a1a;
}

/* Make contacts double-clickable cue */
.msn-c-contact { user-select: none; }

/* ---------- MSN Emoticons ---------- */
.msn-emoticon {
    width: 19px;
    height: 19px;
    vertical-align: middle;
    margin: 0 1px;
    image-rendering: -webkit-optimize-contrast;
}

.msn-emoticon-trigger { cursor: pointer; }

.msn-emoticon-picker {
    position: fixed;
    z-index: 5000;
    width: 280px;
    max-height: 240px;
    overflow-y: auto;
    padding: 4px;
    background: #f5f9ff;
    border: 1px solid #4a7fc1;
    border-radius: 4px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
    display: grid;
    grid-template-columns: repeat(10, 24px);
    gap: 2px;
    align-content: start;
    justify-content: center;
}

.msn-emoticon-picker[hidden] { display: none; }

.msn-emoticon-cell {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msn-emoticon-cell:hover {
    border-color: #4a7fc1;
    background: #d4e4f7;
}

.msn-emoticon-cell img {
    width: 19px;
    height: 19px;
    pointer-events: none;
}

/* ---------- Nudge ---------- */
@keyframes msn-nudge-shake {
    0%   { transform: translate(0, 0); }
    10%  { transform: translate(-14px, -10px); }
    20%  { transform: translate(12px, 8px); }
    30%  { transform: translate(-10px, 12px); }
    40%  { transform: translate(14px, -8px); }
    50%  { transform: translate(-12px, -12px); }
    60%  { transform: translate(10px, 10px); }
    70%  { transform: translate(-8px, 8px); }
    80%  { transform: translate(8px, -6px); }
    90%  { transform: translate(-4px, 4px); }
    100% { transform: translate(0, 0); }
}

.xp-window.is-nudging {
    animation: msn-nudge-shake 0.6s cubic-bezier(.36,.07,.19,.97) both;
}

.msn-chat-history-nudge {
    margin: 6px 0;
    padding: 4px 8px;
    color: #b5651d;
    font-style: italic;
    font-size: 11px;
    background: #fff7e6;
    border: 1px dashed #e0b070;
    border-radius: 3px;
}

[data-msn-nudge] { cursor: pointer; }
[data-msn-nudge]:hover .msn-chat-ti { transform: scale(1.15); }
[data-msn-nudge] .msn-chat-ti { transition: transform 80ms ease; }

/* ---------- Clippy widget ---------- */
.clippy-widget {
    --clippy-paper: #f4f0c8;
    --clippy-paper-line: #b9d0e8;
    --clippy-paper-margin: #e89a9a;
    --clippy-bubble: #fff8c8;
    --clippy-bubble-border: #2a2a2a;
    --clippy-clip: #9aa3c4;

    position: absolute;
    right: 30px;
    bottom: 20px;
    width: 280px;
    height: 260px;
    z-index: 50;
    pointer-events: none; /* let the bubble + clippy decide */
}

.clippy-bubble {
    position: absolute;
    top: 0;
    left: 70px;
    width: 220px;
    background: var(--clippy-bubble);
    border: 1.5px solid var(--clippy-bubble-border);
    border-radius: 12px;
    padding: 10px 28px 10px 12px;
    font-family: "Segoe UI", Tahoma, Verdana, sans-serif;
    font-size: 12px;
    line-height: 1.35;
    color: #111;
    box-shadow: 0 2px 0 rgba(0,0,0,0.05);
    pointer-events: auto;
}

.clippy-bubble[hidden] { display: none; }

.clippy-bubble::after,
.clippy-bubble::before {
    content: "";
    position: absolute;
    bottom: -16px;
    left: 28px;
    border: 8px solid transparent;
    border-top-color: var(--clippy-bubble);
    border-bottom: 0;
}
.clippy-bubble::before {
    bottom: -19px;
    border-top-color: var(--clippy-bubble-border);
}

.clippy-bubble b { font-weight: 600; }

.clippy-bubble-close {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 2px;
    color: #555;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
}
.clippy-bubble-close:hover {
    background: #fff;
    border-color: #888;
    color: #000;
}

.clippy {
    position: absolute;
    left: 70px;
    bottom: 0;
    width: 110px;
    height: 180px;
    pointer-events: auto;
    cursor: grab;
}
.clippy.is-dragging { cursor: grabbing; }

/* Yellow legal-pad paper behind Clippy */
.clippy-paper {
    position: absolute;
    bottom: -4px;
    left: -50px;
    width: 220px;
    height: 110px;
    background:
        repeating-linear-gradient(
            to bottom,
            var(--clippy-paper) 0 12px,
            var(--clippy-paper-line) 12px 13px
        );
    border: 1px solid #c9c28a;
    transform: perspective(700px) rotateX(38deg) rotateZ(-4deg) skewX(-6deg);
    transform-origin: center;
    box-shadow:
        20px 16px 18px -12px rgba(0,0,0,0.18),
        inset 0 0 0 1px rgba(0,0,0,0.04);
    z-index: 1;
}
.clippy-paper::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 36px;
    width: 1.5px;
    background: var(--clippy-paper-margin);
    opacity: 0.7;
}

.clippy-body {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.clip-outer {
    position: absolute;
    inset: 0;
    border: 9px solid var(--clippy-clip);
    border-radius: 46px / 52px;
    box-shadow:
        inset -4px -2px 0 rgba(0,0,0,0.18),
        inset 4px 2px 0 rgba(255,255,255,0.35);
}

.clip-inner {
    position: absolute;
    top: 24px;
    left: 20px;
    right: 20px;
    bottom: 46px;
    border: 9px solid var(--clippy-clip);
    border-bottom: none;
    border-radius: 32px 32px 0 0 / 38px 38px 0 0;
    box-shadow:
        inset -3px 0 0 rgba(0,0,0,0.18),
        inset 3px 0 0 rgba(255,255,255,0.3);
}

.clip-curl {
    position: absolute;
    left: 50%;
    bottom: 24px;
    width: 38px;
    height: 22px;
    border: 9px solid var(--clippy-clip);
    border-top: none;
    border-radius: 0 0 26px 26px / 0 0 20px 20px;
    transform: translateX(-50%);
    box-shadow:
        inset -3px -1px 0 rgba(0,0,0,0.15),
        inset 3px 0 0 rgba(255,255,255,0.25);
}

/* Eyes */
.clippy-eyes {
    position: absolute;
    top: 36px;
    left: 14px;
    width: 84px;
    height: 50px;
    z-index: 3;
}
.clippy-eye {
    position: absolute;
    width: 30px;
    height: 34px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 60% 35%, #ffffff 0 30%, #e6e6e6 55%, #cfcfcf 100%);
    box-shadow:
        inset -2px -2px 3px rgba(0,0,0,0.15),
        0 1px 2px rgba(0,0,0,0.25);
}
.clippy-eye::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 17px;
    border-radius: 50%;
    background: #111;
    top: 9px;
    left: 7px;
}
.clippy-eye::before {
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #fff;
    top: 12px;
    left: 11px;
    z-index: 2;
}
.clippy-eye.left  { left: 0;  top: 9px; }
.clippy-eye.right { left: 40px; top: 0; }

.clippy-brow {
    position: absolute;
    width: 30px;
    height: 12px;
    border-top: 3px solid #111;
    border-radius: 50%;
}
.clippy-brow.left  { top: 4px;  left: 0;  transform: rotate(-12deg); }
.clippy-brow.right { top: -4px; left: 40px; transform: rotate(8deg); }

/* Subtle bobbing animation while idle */
@keyframes clippy-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-3px); }
}
.clippy { animation: clippy-bob 3.2s ease-in-out infinite; }
.clippy.is-dragging { animation: none; }

/* ===== Responsive XP (mobile / small screens) =====
   Same chrome, same colors. We just reflow at <=767.98px so apps go
   fullscreen and the taskbar / start menu become thumb-sized. */

@media (max-width: 767.98px) {

    html, body {
        height: 100%;
        margin: 0;
        overscroll-behavior: none;
    }

    /* Desktop fills the viewport with safe-area padding for notched phones */
    .xp-desktop {
        position: fixed;
        inset: 0;
    }
    .xp-desktop-surface {
        position: absolute;
        inset: 0;
        padding-top: env(safe-area-inset-top);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    /* Hide Clippy on mobile - charming on desktop, intrusive on a phone */
    .clippy-widget { display: none !important; }

    /* ----- Taskbar / Start ----- */
    .xp-taskbar {
        height: 52px;
        padding-bottom: env(safe-area-inset-bottom);
        box-sizing: content-box;
    }
    .xp-start-button {
        font-size: 18px !important;
        padding: 0 18px 0 14px !important;
        height: 44px !important;
        min-width: 96px;
    }
    .xp-tasks { gap: 4px; overflow-x: auto; }
    .xp-tasks::-webkit-scrollbar { display: none; }
    [data-task-for] {
        height: 40px !important;
        font-size: 13px !important;
        padding: 0 10px !important;
        min-width: 120px;
        max-width: 180px;
    }
    .xp-tray { padding: 0 10px; }
    .xp-tray-clock { font-size: 13px; }

    /* ----- Start menu becomes a sheet covering most of the screen ----- */
    .xp-start-menu {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 52px !important;
        top: auto !important;
        width: auto !important;
        max-height: 75vh;
        border-radius: 8px 8px 0 0;
        overflow: auto;
    }
    .xp-start-body { flex-direction: column; }
    .xp-start-col.left,
    .xp-start-col.right {
        width: 100% !important;
        min-width: 0 !important;
    }
    .xp-start-item {
        padding: 12px 14px !important;
        font-size: 14px !important;
    }

    /* ----- Windows go FULLSCREEN on mobile -----
       This wins over the inline top/left/width/height set by the C# model
       and by the JS chat-window cloner. */
    .xp-window[data-xp-window] {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 52px !important; /* leave room for the taskbar */
        width: auto !important;
        height: auto !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    /* No drag handle on touch - dragging across viewport edge is awkward */
    .xp-titlebar { cursor: default; touch-action: manipulation; }

    /* Bigger touch targets on titlebar buttons */
    .xp-titlebar { height: 38px; }
    .xp-titlebar-button {
        width: 36px !important;
        height: 30px !important;
        font-size: 14px !important;
    }
    .xp-titlebar-title { font-size: 14px; }

    /* Hide maximize on mobile (already fullscreen) */
    .xp-titlebar-button[data-xp-action="maximize"] { display: none; }

    /* Menu bar a touch chunkier */
    .xp-menubar { font-size: 13px; padding: 4px 6px; }
    .xp-menubar-item { padding: 4px 8px; }

    /* ----- MSN sign-in: stretch nicely on phones ----- */
    .msn-signin {
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    .msn-signin-form input[type="email"],
    .msn-signin-form input[type="text"],
    .msn-signin-form input[type="password"],
    .msn-signin-form select {
        font-size: 16px !important; /* prevent iOS zoom-on-focus */
        height: 36px;
    }
    .msn-signin-button {
        font-size: 15px !important;
        padding: 10px 18px !important;
    }

    /* ----- Contacts: thumb-friendly rows ----- */
    .msn-c-contact {
        padding: 10px 12px !important;
        min-height: 56px;
        gap: 10px;
    }
    .msn-c-contact .name { font-size: 15px; }
    .msn-c-contact .msg { font-size: 12px; }
    .msn-c-toolbar,
    .msn-c-search,
    .msn-c-bottom { font-size: 13px; }

    /* ----- Chat window ----- */
    .msn-chat { height: 100%; }
    .msn-chat-toolbar {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    .msn-chat-toolbar::-webkit-scrollbar { display: none; }
    .msn-chat-tools { flex-wrap: nowrap; }
    .msn-chat-tool { flex: 0 0 auto; }
    .msn-chat-body { flex-direction: column; }
    .msn-chat-left { width: 100% !important; }
    .msn-chat-right { display: none; } /* hide the sidebar contact card */

    .msn-chat-history {
        font-size: 14px;
        line-height: 1.4;
        -webkit-overflow-scrolling: touch;
    }
    .msn-compose-input {
        font-size: 16px !important; /* iOS no-zoom */
        min-height: 44px;
    }
    .msn-chat-send {
        font-size: 15px !important;
        padding: 8px 16px !important;
        min-height: 40px;
    }

    /* Emoticon picker stays usable on small screens */
    .msn-emoticon-picker {
        max-width: calc(100vw - 16px);
        max-height: 50vh;
        overflow: auto;
    }
}

/* Extra-tight phones: shrink the taskbar a bit more */
@media (max-width: 380px) {
    .xp-start-button { min-width: 80px; padding: 0 12px !important; }
    [data-task-for] { min-width: 100px; }
}
