/* ==========================================================================
   Windows 11 Web Desktop — shell, windows, taskbar, flyouts
   Fonts: original Segoe UI family copied from the local Windows installation.
   ========================================================================== */

@font-face {
    font-family: "Segoe UI Variable";
    src: url("../fonts/SegUIVar.ttf") format("truetype");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Segoe UI Variable Text";
    src: url("../fonts/SegUIVar.ttf") format("truetype");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Segoe UI Variable Display";
    src: url("../fonts/SegUIVar.ttf") format("truetype");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Segoe UI";
    src: url("../fonts/segoeui.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Segoe UI";
    src: url("../fonts/segoeuii.ttf") format("truetype");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Segoe UI";
    src: url("../fonts/segoeuil.ttf") format("truetype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Segoe UI";
    src: url("../fonts/segoeuisl.ttf") format("truetype");
    font-weight: 350;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Segoe UI";
    src: url("../fonts/seguisli.ttf") format("truetype");
    font-weight: 350;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Segoe UI";
    src: url("../fonts/seguisb.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Segoe UI";
    src: url("../fonts/seguisbi.ttf") format("truetype");
    font-weight: 600;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Segoe UI";
    src: url("../fonts/segoeuib.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Segoe UI";
    src: url("../fonts/segoeuiz.ttf") format("truetype");
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Segoe Fluent Icons";
    src: url("../fonts/SegoeIcons.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: "Segoe MDL2 Assets";
    src: url("../fonts/segmdl2.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: "Segoe Print";
    src: url("../fonts/segoepr.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Segoe Print";
    src: url("../fonts/segoeprb.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Segoe Script";
    src: url("../fonts/segoesc.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Segoe Script";
    src: url("../fonts/segoescb.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --font: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

    --accent: #0067c0;
    --accent-hover: color-mix(in srgb, var(--accent) 86%, #000);
    --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
    --accent-text: #ffffff;

    --text: #1b1b1b;
    --text-2: #5d5d5d;
    --text-3: #8a8a8a;
    --text-on-wallpaper: #ffffff;

    --surface: #f3f3f3;
    --surface-2: #fafafa;
    --window-bg: #f3f3f3;
    --window-border: rgba(0, 0, 0, 0.12);
    --titlebar: #f3f3f3;

    --card: rgba(255, 255, 255, 0.62);
    --card-hover: rgba(255, 255, 255, 0.9);
    --field: rgba(255, 255, 255, 0.78);
    --field-focus: #ffffff;
    --hover: rgba(0, 0, 0, 0.05);
    --active: rgba(0, 0, 0, 0.09);
    --stroke: rgba(0, 0, 0, 0.09);
    --stroke-strong: rgba(0, 0, 0, 0.18);

    --taskbar: rgba(242, 242, 242, 0.82);
    --taskbar-border: rgba(0, 0, 0, 0.08);
    --flyout: rgba(243, 243, 243, 0.9);
    --flyout-border: rgba(0, 0, 0, 0.1);

    --danger: #c42b1c;
    --danger-hover: #b02619;
    --success: #0f7b0f;
    --warning: #9d5d00;

    --shadow-window: 0 28px 64px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.05);
    --shadow-window-inactive: 0 16px 40px rgba(0, 0, 0, 0.22), 0 2px 10px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
    --shadow-flyout: 0 20px 54px rgba(0, 0, 0, 0.26), 0 3px 12px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 2px 6px rgba(0, 0, 0, 0.08);

    --radius: 8px;
    --radius-sm: 4px;
    --taskbar-h: 48px;
    --speed: 0.16s;
}

body.theme-dark {
    --text: #f3f3f3;
    --text-2: #c4c4c4;
    --text-3: #9a9a9a;

    --surface: #202020;
    --surface-2: #2b2b2b;
    --window-bg: #202020;
    --window-border: rgba(255, 255, 255, 0.09);
    --titlebar: #202020;

    --card: rgba(255, 255, 255, 0.06);
    --card-hover: rgba(255, 255, 255, 0.1);
    --field: rgba(255, 255, 255, 0.07);
    --field-focus: #2d2d2d;
    --hover: rgba(255, 255, 255, 0.07);
    --active: rgba(255, 255, 255, 0.12);
    --stroke: rgba(255, 255, 255, 0.09);
    --stroke-strong: rgba(255, 255, 255, 0.18);

    --taskbar: rgba(26, 26, 26, 0.84);
    --taskbar-border: rgba(255, 255, 255, 0.07);
    --flyout: rgba(38, 38, 38, 0.92);
    --flyout-border: rgba(255, 255, 255, 0.09);

    --danger: #d13438;
    --success: #6ccb5f;
    --warning: #fce100;

    --shadow-window: 0 28px 64px rgba(0, 0, 0, 0.55), 0 4px 16px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.4);
    --shadow-window-inactive: 0 16px 40px rgba(0, 0, 0, 0.4), 0 2px 10px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.4);
    --shadow-flyout: 0 20px 54px rgba(0, 0, 0, 0.5), 0 3px 12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.35);
}

body.no-transparency {
    --taskbar: #f2f2f2;
    --flyout: #f3f3f3;
    --card: #ffffff;
    --field: #ffffff;
}

body.theme-dark.no-transparency {
    --taskbar: #1c1c1c;
    --flyout: #262626;
    --card: #2d2d2d;
    --field: #2d2d2d;
}

body.no-transparency .flyout,
body.no-transparency #taskbar,
body.no-transparency .context-menu,
body.no-transparency .modal-layer {
    backdrop-filter: none !important;
}

body.no-animations *,
body.no-animations *::before,
body.no-animations *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
}

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

[hidden] {
    display: none !important;
}

html,
body {
    height: 100%;
}

body.desktop-body {
    margin: 0;
    overflow: hidden;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.35;
    background: #050a16;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: default;
}

button:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: none;
}

::selection {
    background: var(--accent);
    color: #fff;
}

.icon {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    pointer-events: none;
}

/* ============================== Wallpaper ================================= */

#wallpaper {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-color: #050a16;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    transition: opacity 0.4s ease;
}

#wallpaper::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(120% 80% at 50% 115%, rgba(0, 0, 0, 0.0), rgba(0, 0, 0, 0.24)),
        linear-gradient(180deg, rgba(0, 0, 0, 0.06), transparent 24%);
    pointer-events: none;
}

/* ============================ Desktop icons =============================== */

#desktop {
    position: fixed;
    inset: 0;
    z-index: 1;
    outline: none;
}

#desktop-icons {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 2px;
    width: max-content;
    height: calc(100vh - var(--taskbar-h) - 24px);
    padding: 4px;
    user-select: none;
    z-index: 2;
}

.desk-icon {
    width: 84px;
    height: 92px;
    padding: 8px 4px 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    transition: background var(--speed), border-color var(--speed);
}

.desk-icon .icon {
    width: 42px;
    height: 42px;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
}

.desk-icon span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.25;
    text-align: center;
    max-width: 100%;
    word-break: break-word;
}

.desk-icon:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.16);
}

.desk-icon.selected {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.32);
}

.desk-icon.dragging {
    opacity: 0.55;
}

/* ================================ Taskbar ================================= */

#taskbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9000;
    height: var(--taskbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    background: var(--taskbar);
    border-top: 1px solid var(--taskbar-border);
    backdrop-filter: blur(40px) saturate(1.5);
    -webkit-backdrop-filter: blur(40px) saturate(1.5);
    user-select: none;
}

.tb-left,
.tb-right {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
}

.tb-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 2px;
}

.tb-apps {
    display: flex;
    align-items: center;
    gap: 2px;
}

.tb-divider {
    width: 1px;
    height: 20px;
    margin: 0 5px;
    background: var(--stroke);
}

.tb-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    display: grid;
    place-items: center;
    color: var(--text);
    transition: background var(--speed);
}

.tb-btn:hover {
    background: var(--hover);
}

.tb-btn:active {
    background: var(--active);
}

.tb-btn .icon {
    width: 24px;
    height: 24px;
}

.tb-start .icon {
    width: 22px;
    height: 22px;
    color: #0078d4;
}

body.theme-dark .tb-start .icon {
    color: #4cc2ff;
}

.tb-app.running::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 6px;
    height: 3px;
    border-radius: 2px;
    background: var(--text-3);
    transform: translateX(-50%);
    transition: width var(--speed), background var(--speed);
}

.tb-app.active::after {
    width: 16px;
    background: var(--accent);
}

.tb-app.active {
    background: var(--hover);
}

.tb-weather {
    width: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 0 10px;
    border-radius: 6px;
}

.tb-weather .icon {
    width: 26px;
    height: 26px;
}

.tb-weather-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
    min-width: 0;
}

.tb-weather-text strong {
    font-size: 12px;
    font-weight: 600;
}

.tb-weather-text span {
    font-size: 11px;
    color: var(--text-2);
    max-width: 120px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.tb-lang {
    font-size: 11px;
    color: var(--text-2);
    padding: 0 7px;
    letter-spacing: 0.02em;
}

.tray-btn {
    width: 34px;
}

.tray-btn .icon {
    width: 20px;
    height: 20px;
}

.tb-bell {
    position: relative;
}

.bell-dot {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    border: 1px solid var(--taskbar);
    display: none;
}

.tb-bell.unread .bell-dot {
    display: block;
}

.tb-clock {
    height: 40px;
    border: 0;
    background: transparent;
    border-radius: 6px;
    padding: 0 9px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    font-size: 11.5px;
    line-height: 1.25;
    color: var(--text);
    transition: background var(--speed);
}

.tb-clock:hover {
    background: var(--hover);
}

/* Tooltips */
[data-tip] {
    position: relative;
}

[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
    padding: 5px 9px;
    border-radius: 4px;
    background: var(--flyout);
    color: var(--text);
    border: 1px solid var(--flyout-border);
    box-shadow: var(--shadow-flyout);
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.12s ease 0.35s, transform 0.12s ease 0.35s, visibility 0s linear 0.47s;
    z-index: 10080;
}

[data-tip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    transition-delay: 0.35s;
}

/* =============================== Flyouts ================================== */

.flyout {
    position: fixed;
    z-index: 9500;
    background: var(--flyout);
    border: 1px solid var(--flyout-border);
    border-radius: 10px;
    box-shadow: var(--shadow-flyout);
    backdrop-filter: blur(46px) saturate(1.6);
    -webkit-backdrop-filter: blur(46px) saturate(1.6);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(0.985);
    transform-origin: bottom center;
    transition: opacity var(--speed) ease, transform var(--speed) ease, visibility 0s linear var(--speed);
}

.flyout.open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity var(--speed) ease, transform var(--speed) ease, visibility 0s;
}

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

.start-menu {
    left: 50%;
    bottom: calc(var(--taskbar-h) + 8px);
    translate: -50% 0;
    width: min(660px, calc(100vw - 20px));
    height: min(650px, calc(100vh - var(--taskbar-h) - 24px));
    display: flex;
    flex-direction: column;
    padding: 28px 28px 0;
    overflow: hidden;
}

.start-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 38px;
    padding: 0 10px;
    margin-bottom: 22px;
    border: 1px solid var(--stroke);
    border-bottom: 2px solid var(--accent);
    border-radius: 5px;
    background: var(--field);
    transition: background var(--speed), box-shadow var(--speed);
}

.start-search:focus-within {
    background: var(--field-focus);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.start-search .icon {
    width: 17px;
    height: 17px;
    color: var(--text-2);
}

.start-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 13.5px;
}

.start-search input::placeholder {
    color: var(--text-3);
}

.start-search input::-webkit-search-cancel-button {
    display: none;
}

.start-search-clear {
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    display: grid;
    place-items: center;
    color: var(--text-2);
}

.start-search-clear .icon {
    width: 12px;
    height: 12px;
}

.start-search-clear:hover {
    background: var(--hover);
}

.start-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 2px 8px;
    scrollbar-gutter: stable;
}

.start-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 2px 10px;
    font-size: 13px;
    font-weight: 600;
}

.start-all-btn {
    border: 0;
    background: var(--card);
    border: 1px solid var(--stroke);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 400;
    color: var(--text);
}

.start-all-btn:hover {
    background: var(--card-hover);
}

.start-all-btn span {
    margin-left: 4px;
    color: var(--text-2);
}

.start-more-btn {
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    display: grid;
    place-items: center;
    color: var(--text-2);
}

.start-more-btn:hover {
    background: var(--hover);
}

.start-more-btn .icon {
    width: 15px;
    height: 15px;
}

.pinned-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 2px 4px;
    margin-bottom: 20px;
}

.start-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    height: 84px;
    padding: 10px 4px 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    overflow: hidden;
}

.start-app:hover {
    background: var(--card);
    border-color: var(--stroke);
}

.start-app:active {
    background: var(--active);
}

.start-app-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
}

.start-app-icon .icon {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.16));
}

.start-app-icon.small .icon {
    width: 26px;
    height: 26px;
}

.start-app-name {
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
    width: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.recommended-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px;
    margin-bottom: 16px;
}

.rec-item {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 54px;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    text-align: left;
    min-width: 0;
}

.rec-item:hover {
    background: var(--card);
    border-color: var(--stroke);
}

.rec-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.rec-icon .icon {
    width: 30px;
    height: 30px;
}

.rec-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.rec-name {
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rec-sub {
    font-size: 11px;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rec-empty {
    grid-column: 1 / -1;
    padding: 18px;
    text-align: center;
    font-size: 12px;
    color: var(--text-3);
}

.all-apps-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    margin-bottom: 16px;
}

.all-app {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    height: 46px;
    padding: 6px 10px;
}

.all-app .start-app-name {
    text-align: left;
}

.start-menu.show-all .pinned-grid,
.start-menu.show-all .recommended-grid,
.start-menu.show-all .start-section-head {
    display: none;
}

.start-menu.show-all .all-apps-list {
    display: grid !important;
}

.start-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 48px 20px;
    color: var(--text-2);
    text-align: center;
}

.start-no-results .icon {
    width: 32px;
    height: 32px;
    opacity: 0.6;
}

.start-no-results p {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.start-no-results span {
    font-size: 12px;
}

.start-footer {
    flex: 0 0 auto;
    height: 62px;
    margin: 0 -28px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--stroke);
    background: color-mix(in srgb, var(--flyout) 60%, transparent);
}

.start-user {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 8px 0 4px;
    border: 0;
    border-radius: 6px;
    background: transparent;
}

.start-user:hover {
    background: var(--hover);
}

.start-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #4a9fe0, #7b4dff);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.start-user-name {
    font-size: 12.5px;
}

.start-power {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    display: grid;
    place-items: center;
}

.start-power:hover {
    background: var(--hover);
}

.start-power .icon {
    width: 19px;
    height: 19px;
}

/* --------------------------- Quick settings ------------------------------- */

.quick-settings {
    right: 8px;
    bottom: calc(var(--taskbar-h) + 8px);
    width: min(380px, calc(100vw - 16px));
    padding: 18px;
}

.qs-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.qs-tile {
    height: 74px;
    border: 1px solid var(--stroke);
    border-radius: 6px;
    background: var(--card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 11.5px;
    color: var(--text);
    transition: background var(--speed), color var(--speed), border-color var(--speed);
}

.qs-tile .icon {
    width: 21px;
    height: 21px;
}

.qs-tile:hover {
    background: var(--card-hover);
}

.qs-tile.on {
    background: var(--accent);
    color: var(--accent-text);
    border-color: transparent;
}

.qs-tile.on:hover {
    background: var(--accent-hover);
}

.qs-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 40px;
    padding: 0 4px;
}

.qs-slider-icon {
    color: var(--text-2);
    display: grid;
    place-items: center;
}

.qs-slider-icon .icon {
    width: 19px;
    height: 19px;
}

input[type="range"] {
    flex: 1;
    height: 20px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    margin: 0;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--range, 50%), var(--stroke-strong) var(--range, 50%), var(--stroke-strong) 100%);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    margin-top: -7px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--surface);
    box-shadow: 0 0 0 1px var(--stroke);
}

.qs-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--stroke);
    font-size: 11.5px;
}

.qs-battery-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-2);
}

.qs-battery-info .icon {
    width: 17px;
    height: 17px;
}

.qs-settings-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    color: var(--text);
    padding: 5px 7px;
    border-radius: 4px;
    font-size: 12px;
}

.qs-settings-link:hover {
    background: var(--hover);
}

.qs-settings-link .icon {
    width: 16px;
    height: 16px;
}

/* ------------------------------ Calendar ---------------------------------- */

.calendar-flyout {
    right: 8px;
    bottom: calc(var(--taskbar-h) + 8px);
    width: min(356px, calc(100vw - 16px));
    padding: 18px;
}

.cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cal-title {
    font-size: 13px;
    font-weight: 600;
}

.cal-nav {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    display: grid;
    place-items: center;
    color: var(--text-2);
}

.cal-nav:hover {
    background: var(--hover);
}

.cal-nav .icon {
    width: 16px;
    height: 16px;
}

.cal-weekdays,
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.cal-weekdays {
    margin-bottom: 4px;
}

.cal-weekdays span {
    font-size: 10.5px;
    color: var(--text-2);
    padding: 4px 0;
}

.cal-day {
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    font-size: 12px;
    color: var(--text);
    display: grid;
    place-items: center;
    position: relative;
}

.cal-day:hover {
    background: var(--hover);
}

.cal-day.out {
    color: var(--text-3);
}

.cal-day.today {
    background: var(--accent);
    color: var(--accent-text);
    font-weight: 600;
}

.cal-day.has-event::after {
    content: "";
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
}

.cal-day.today.has-event::after {
    background: #fff;
}

.cal-today {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 12px;
    padding: 10px 8px;
    border: 0;
    border-radius: 6px;
    background: var(--card);
    border: 1px solid var(--stroke);
    text-align: left;
}

.cal-today:hover {
    background: var(--card-hover);
}

.cal-today > span:last-child {
    display: flex;
    flex-direction: column;
    font-size: 12px;
}

.cal-today small {
    color: var(--text-2);
    font-size: 11px;
}

.cal-today-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    flex: 0 0 auto;
    margin-left: 6px;
}

.cal-event {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
    font-size: 12px;
}

.cal-event-time {
    font-weight: 600;
    color: var(--accent);
}

.cal-event span:last-child {
    display: flex;
    flex-direction: column;
}

.cal-event small {
    color: var(--text-2);
    font-size: 11px;
}

/* -------------------------- Notification center --------------------------- */

.notification-center {
    right: 8px;
    top: 8px;
    bottom: calc(var(--taskbar-h) + 8px);
    width: min(380px, calc(100vw - 16px));
    padding: 18px 16px 0;
    display: flex;
    flex-direction: column;
    transform: translateX(24px);
    transform-origin: right center;
}

.notification-center.open {
    transform: none;
}

.nc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 12px;
}

.nc-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.nc-clear {
    border: 0;
    background: transparent;
    font-size: 11.5px;
    color: var(--text-2);
    padding: 4px 8px;
    border-radius: 4px;
}

.nc-clear:hover {
    background: var(--hover);
}

.nc-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 2px 0 8px;
}

.nc-card {
    position: relative;
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: var(--card);
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow-card);
    animation: ncIn 0.2s ease;
}

@keyframes ncIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

.nc-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    background: var(--surface-2);
    flex: 0 0 auto;
}

.nc-icon .icon {
    width: 22px;
    height: 22px;
}

.nc-body {
    min-width: 0;
    flex: 1;
    padding-right: 12px;
}

.nc-app {
    font-size: 10.5px;
    color: var(--text-2);
    margin-bottom: 2px;
}

.nc-title {
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 3px;
}

.nc-text {
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.35;
}

.nc-time {
    font-size: 10.5px;
    color: var(--text-3);
    margin-top: 6px;
}

.nc-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    display: grid;
    place-items: center;
    color: var(--text-2);
    opacity: 0;
}

.nc-card:hover .nc-close {
    opacity: 1;
}

.nc-close:hover {
    background: var(--hover);
}

.nc-close .icon {
    width: 12px;
    height: 12px;
}

.nc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-2);
}

.nc-empty .icon {
    width: 34px;
    height: 34px;
    opacity: 0.5;
    margin-bottom: 4px;
}

.nc-empty strong {
    font-size: 13px;
    color: var(--text);
}

.nc-empty span {
    font-size: 11.5px;
}

.nc-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 54px;
    margin: 0 -16px;
    padding: 0 16px;
    border-top: 1px solid var(--stroke);
}

.nc-focus,
.nc-settings {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    padding: 0 9px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    font-size: 11.5px;
    color: var(--text-2);
}

.nc-focus:hover,
.nc-settings:hover {
    background: var(--hover);
}

.nc-focus .icon,
.nc-settings .icon {
    width: 16px;
    height: 16px;
}

.nc-focus.active {
    color: var(--accent);
    background: var(--accent-soft);
}

/* ------------------------------- Widgets ---------------------------------- */

.widgets-panel {
    left: 8px;
    bottom: calc(var(--taskbar-h) + 8px);
    width: min(430px, calc(100vw - 16px));
    max-height: calc(100vh - var(--taskbar-h) - 24px);
    padding: 18px;
    overflow-y: auto;
    transform-origin: left bottom;
}

.widgets-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.widgets-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.widgets-add {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid var(--stroke);
    border-radius: 4px;
    background: var(--card);
    font-size: 11.5px;
}

.widgets-add:hover {
    background: var(--card-hover);
}

.widgets-add .icon {
    width: 13px;
    height: 13px;
}

.widgets-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.widget {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--stroke);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    text-align: left;
    min-width: 0;
}

button.widget:hover {
    background: var(--card-hover);
}

.widget-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--text-2);
}

.widget-top .icon {
    width: 18px;
    height: 18px;
}

.weather-widget {
    background:
        radial-gradient(120% 100% at 90% 0%, rgba(255, 212, 94, 0.35), transparent 60%),
        linear-gradient(160deg, rgba(94, 168, 255, 0.35), rgba(74, 159, 224, 0.08) 60%, var(--card));
}

.widget-temp {
    font-size: 38px;
    font-weight: 300;
    line-height: 1;
    font-family: var(--font-display);
}

.widget-cond {
    font-size: 11.5px;
    color: var(--text-2);
}

.widget-hourly {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    margin-top: 4px;
}

.widget-hourly span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 12px;
}

.widget-hourly small {
    font-size: 9.5px;
    color: var(--text-2);
}

.widget-event-hint {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-2);
    margin-top: 4px;
}

.widget-event-hint .cal-today-dot {
    width: 7px;
    height: 7px;
    margin: 0 2px;
}

.tip-widget {
    grid-column: 1 / -1;
    background:
        radial-gradient(140% 120% at 0% 0%, var(--accent-soft), transparent 70%),
        var(--card);
}

.tip-widget p {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-2);
}

.widget-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
}

.mini-cal {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    font-size: 9.5px;
    text-align: center;
}

.mini-cal span {
    padding: 2px 0;
    color: var(--text-2);
}

.mini-cal span.mc-today {
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
}

.system-widget {
    grid-column: 1 / -1;
}

.system-bars {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--text-2);
}

.system-bars > span:first-child {
    width: 48px;
    flex: 0 0 auto;
}

.system-bars .bar {
    flex: 1;
    height: 5px;
    border-radius: 3px;
    background: var(--stroke);
    overflow: hidden;
}

.system-bars .bar i {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: var(--accent);
}

.widgets-note {
    margin: 12px 2px 0;
    font-size: 10.5px;
    color: var(--text-3);
}

/* ---------------------------- Profile menu -------------------------------- */

.profile-menu {
    right: 8px;
    bottom: calc(var(--taskbar-h) + 8px);
    width: 300px;
    padding: 6px;
}

.profile-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-bottom: 4px;
}

.profile-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #4a9fe0, #7b4dff);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.profile-head > span:last-child {
    display: flex;
    flex-direction: column;
    font-size: 12.5px;
}

.profile-head small {
    font-size: 11px;
    color: var(--text-2);
}

/* ---------------------------- Context menu -------------------------------- */

.context-menu {
    position: fixed;
    z-index: 10060;
    min-width: 230px;
    padding: 6px;
    border-radius: 8px;
    background: var(--flyout);
    border: 1px solid var(--flyout-border);
    box-shadow: var(--shadow-flyout);
    backdrop-filter: blur(46px) saturate(1.6);
    -webkit-backdrop-filter: blur(46px) saturate(1.6);
    animation: ctxIn 0.12s ease;
    transform-origin: top left;
}

@keyframes ctxIn {
    from {
        opacity: 0;
        transform: scale(0.97) translateY(-4px);
    }
}

.ctx-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    font-size: 12.5px;
    color: var(--text);
    text-align: left;
}

.ctx-item:hover {
    background: var(--hover);
}

.ctx-item .icon {
    width: 17px;
    height: 17px;
    color: var(--text-2);
}

.ctx-item.danger {
    color: var(--danger);
}

.ctx-item.danger .icon {
    color: var(--danger);
}

.ctx-item[disabled] {
    opacity: 0.45;
    pointer-events: none;
}

.ctx-sep {
    height: 1px;
    margin: 4px 8px;
    background: var(--stroke);
}

.ctx-label {
    padding: 6px 10px 4px;
    font-size: 10.5px;
    color: var(--text-3);
}

/* ---------------------------- Snap flyout --------------------------------- */

.snap-flyout {
    position: fixed;
    z-index: 10050;
    width: 264px;
    padding: 12px;
    border-radius: 8px;
    background: var(--flyout);
    border: 1px solid var(--flyout-border);
    box-shadow: var(--shadow-flyout);
    backdrop-filter: blur(40px) saturate(1.5);
    -webkit-backdrop-filter: blur(40px) saturate(1.5);
    animation: ctxIn 0.12s ease;
}

.snap-title {
    font-size: 11.5px;
    font-weight: 600;
    margin: 0 2px 9px;
}

.snap-layouts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.snap-layout {
    display: grid;
    gap: 3px;
    height: 62px;
    padding: 3px;
    border: 1px solid var(--stroke);
    border-radius: 6px;
    background: var(--card);
}

.snap-layout:hover {
    border-color: var(--accent);
}

.snap-zone {
    border: 0;
    border-radius: 3px;
    background: var(--stroke-strong);
    transition: background 0.1s;
    min-width: 0;
    min-height: 0;
}

.snap-zone:hover {
    background: var(--accent);
}

.snap-layout.halves {
    grid-template-columns: 1fr 1fr;
}

.snap-layout.thirds {
    grid-template-columns: 1fr 1fr 1fr;
}

.snap-layout.quarters {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.snap-layout.mixed {
    grid-template-columns: 1.6fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.snap-layout.mixed .snap-zone:first-child {
    grid-row: 1 / 3;
}

/* ----------------------------- Task view ---------------------------------- */

.taskview {
    position: fixed;
    inset: 0;
    z-index: 8800;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 14, 22, 0.58);
    backdrop-filter: blur(24px) saturate(1.15);
    -webkit-backdrop-filter: blur(24px) saturate(1.15);
    animation: fadeIn 0.18s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
}

.taskview-inner {
    width: min(1180px, calc(100vw - 80px));
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.taskview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.taskview-head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.taskview-close {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    display: grid;
    place-items: center;
}

.taskview-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.taskview-close .icon {
    width: 16px;
    height: 16px;
}

.taskview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    overflow-y: auto;
    padding: 4px;
}

.taskview-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 0;
    background: transparent;
    color: #fff;
    text-align: left;
    padding: 0;
}

.taskview-thumb {
    height: 168px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.08));
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--speed), border-color var(--speed);
    overflow: hidden;
    position: relative;
}

.taskview-card:hover .taskview-thumb {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.5);
}

.taskview-thumb .icon {
    width: 52px;
    height: 52px;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}

.taskview-card span {
    font-size: 12.5px;
    padding-left: 2px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.taskview-card .taskview-active {
    font-size: 10.5px;
    color: #bcd9ff;
}

.taskview-empty {
    grid-column: 1 / -1;
    padding: 80px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.taskview-foot {
    text-align: center;
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.6);
}

/* --------------------------- Power overlay -------------------------------- */

.power-overlay {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    color: #fff;
    animation: fadeIn 0.3s ease;
}

.power-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.power-spinner {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.16);
    border-top-color: #fff;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.power-title {
    font-size: 18px;
    font-weight: 300;
}

.power-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
}

.power-return {
    margin-top: 10px;
    height: 36px;
    padding: 0 20px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 12.5px;
}

.power-return:hover {
    background: rgba(255, 255, 255, 0.16);
}

/* =============================== Windows ================================== */

#window-layer {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
}

.window {
    position: absolute;
    display: flex;
    flex-direction: column;
    min-width: 300px;
    min-height: 200px;
    background: var(--window-bg);
    border: 1px solid var(--window-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-window);
    overflow: hidden;
    pointer-events: auto;
    animation: winIn 0.18s cubic-bezier(0.2, 0.8, 0.3, 1);
    contain: layout style;
}

@keyframes winIn {
    from {
        opacity: 0;
        transform: scale(0.965) translateY(10px);
    }
}

.window:focus,
.window:focus-visible {
    outline: none;
}

.window.inactive {
    box-shadow: var(--shadow-window-inactive);
}

.window.inactive .tb-title {
    color: var(--text-2);
}

.window.closing {
    animation: winOut 0.15s ease forwards;
    pointer-events: none;
}

@keyframes winOut {
    to {
        opacity: 0;
        transform: scale(0.97) translateY(6px);
    }
}

.window.minimizing {
    animation: winMin 0.16s ease forwards;
    pointer-events: none;
}

@keyframes winMin {
    to {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }
}

.window.maximized {
    border-radius: 0;
    border-color: transparent;
}

.window.snapped {
    border-radius: 6px;
}

.titlebar {
    flex: 0 0 auto;
    height: 34px;
    display: flex;
    align-items: center;
    background: var(--titlebar);
    user-select: none;
    touch-action: none;
    padding-left: 10px;
}

.window.dragging .titlebar {
    cursor: grabbing;
}

.tb-icon {
    width: 17px;
    height: 17px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    margin-right: 8px;
}

.tb-icon .icon {
    width: 16px;
    height: 16px;
}

.tb-title {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 10px;
}

.tb-controls {
    display: flex;
    align-self: stretch;
    flex: 0 0 auto;
}

.cap-btn {
    width: 46px;
    height: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    display: grid;
    place-items: center;
    transition: background 0.1s;
}

.cap-btn .icon {
    width: 10px;
    height: 10px;
    stroke-width: 1.8;
}

.cap-btn:hover {
    background: var(--hover);
}

.cap-btn:active {
    background: var(--active);
}

.cap-btn.close:hover {
    background: #c42b1c;
    color: #fff;
}

.cap-btn.close:active {
    background: #b02619;
}

.window-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--window-bg);
    position: relative;
}

/* Resize handles */
.rh {
    position: absolute;
    z-index: 6;
}

.rh[data-dir="n"] {
    top: -3px;
    left: 10px;
    right: 10px;
    height: 6px;
    cursor: ns-resize;
}

.rh[data-dir="s"] {
    bottom: -3px;
    left: 10px;
    right: 10px;
    height: 6px;
    cursor: ns-resize;
}

.rh[data-dir="w"] {
    left: -3px;
    top: 10px;
    bottom: 10px;
    width: 6px;
    cursor: ew-resize;
}

.rh[data-dir="e"] {
    right: -3px;
    top: 10px;
    bottom: 10px;
    width: 6px;
    cursor: ew-resize;
}

.rh[data-dir="nw"] {
    top: -4px;
    left: -4px;
    width: 12px;
    height: 12px;
    cursor: nwse-resize;
}

.rh[data-dir="ne"] {
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    cursor: nesw-resize;
}

.rh[data-dir="sw"] {
    bottom: -4px;
    left: -4px;
    width: 12px;
    height: 12px;
    cursor: nesw-resize;
}

.rh[data-dir="se"] {
    bottom: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    cursor: nwse-resize;
}

.window.maximized .rh {
    display: none;
}

body.window-resizing {
    user-select: none;
}

body.window-resizing iframe {
    pointer-events: none;
}

/* Snap preview outline while dragging to an edge */
.snap-preview {
    position: fixed;
    z-index: 8900;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.16);
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
    pointer-events: none;
    transition: all 0.1s ease;
}

/* ======================== Dialogs / modal / toast ========================= */

.modal-layer {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn 0.14s ease;
}

.dialog {
    width: min(440px, calc(100vw - 40px));
    border-radius: 8px;
    background: var(--window-bg);
    border: 1px solid var(--window-border);
    box-shadow: var(--shadow-window);
    overflow: hidden;
    animation: winIn 0.18s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.dialog-head {
    height: 38px;
    display: flex;
    align-items: center;
    padding: 0 8px 0 14px;
    font-size: 12px;
    font-weight: 600;
}

.dialog-head span {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dialog-close {
    width: 30px;
    height: 28px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    display: grid;
    place-items: center;
    color: var(--text);
}

.dialog-close:hover {
    background: var(--hover);
}

.dialog-close .icon {
    width: 11px;
    height: 11px;
}

.dialog-body {
    padding: 4px 20px 20px;
    font-size: 13px;
    line-height: 1.5;
}

.dialog-body p {
    margin: 0 0 12px;
}

.dialog-body p:last-child {
    margin-bottom: 0;
}

.dialog-input {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--stroke);
    border-bottom: 2px solid var(--accent);
    border-radius: 4px;
    background: var(--field);
    outline: 0;
}

.dialog-input:focus {
    background: var(--field-focus);
}

.dialog-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 20px 18px;
}

.dialog-btn {
    min-width: 92px;
    height: 32px;
    padding: 0 14px;
    border: 1px solid var(--stroke);
    border-radius: 4px;
    background: var(--card);
    font-size: 12.5px;
}

.dialog-btn:hover {
    background: var(--card-hover);
}

.dialog-btn.primary {
    background: var(--accent);
    border-color: transparent;
    color: var(--accent-text);
}

.dialog-btn.primary:hover {
    background: var(--accent-hover);
}

.dialog-btn.danger {
    background: var(--danger);
    border-color: transparent;
    color: #fff;
}

.dialog-btn.danger:hover {
    background: var(--danger-hover);
}

.dialog-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12.5px;
}

.dialog-list li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 5px 0;
    border-bottom: 1px solid var(--stroke);
}

.dialog-list li:last-child {
    border-bottom: 0;
}

.dialog-list strong {
    font-weight: 600;
}

.dialog-list span {
    color: var(--text-2);
    text-align: right;
    word-break: break-word;
}

.toast-layer {
    position: fixed;
    right: 12px;
    bottom: calc(var(--taskbar-h) + 12px);
    z-index: 10070;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    width: 320px;
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--flyout);
    border: 1px solid var(--flyout-border);
    box-shadow: var(--shadow-flyout);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    animation: toastIn 0.2s ease;
    pointer-events: auto;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(16px);
    }
}

.toast.out {
    animation: toastOut 0.18s ease forwards;
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

.toast-icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.toast-icon .icon {
    width: 24px;
    height: 24px;
}

.toast-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    font-size: 12px;
}

.toast-text strong {
    font-size: 12.5px;
    font-weight: 600;
}

.toast-text span {
    color: var(--text-2);
    line-height: 1.35;
}

/* ============================ Scrollbars ================================= */

* {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--text-3) 55%, transparent) transparent;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--text-3) 45%, transparent);
    border: 4px solid transparent;
    background-clip: content-box;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--text-3) 70%, transparent);
    border: 3px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* ============================= Taskbar alignment ========================== */

body.taskbar-left .tb-weather {
    display: none;
}

body.taskbar-left .tb-center {
    position: static;
    transform: none;
    margin-left: 6px;
}

body.taskbar-left #taskbar {
    justify-content: flex-start;
}

body.taskbar-left .tb-right {
    margin-left: auto;
}

/* ============================== Night light =============================== */

body.night-light::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 10045;
    pointer-events: none;
    background: rgba(255, 147, 41, 0.1);
    mix-blend-mode: multiply;
}

/* ============================ Dialog fields =============================== */

select.dialog-input {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 32px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-2) 50%),
        linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
    background-position:
        calc(100% - 16px) calc(50% + 1px),
        calc(100% - 11px) calc(50% + 1px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.taskview-card em.taskview-active {
    font-style: normal;
    margin-left: 4px;
}

/* ================================ Responsive ============================== */

@media (max-width: 860px) {
    .tb-weather-text {
        display: none;
    }

    .tb-weather {
        width: 40px;
        padding: 0;
        justify-content: center;
    }

    .pinned-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .start-menu {
        padding: 20px 20px 0;
    }

    .start-footer {
        margin: 0 -20px;
        padding: 0 20px;
    }

    .recommended-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .tb-apps .tb-app:nth-child(n + 5),
    .tb-lang,
    #tray-battery {
        display: none;
    }

    .tb-clock {
        font-size: 10.5px;
    }

    .start-menu {
        height: calc(100vh - var(--taskbar-h) - 16px);
        bottom: calc(var(--taskbar-h) + 4px);
    }

    .widgets-grid {
        grid-template-columns: 1fr;
    }

    .tip-widget,
    .system-widget {
        grid-column: auto;
    }

    .desk-icon {
        width: 76px;
    }
}

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