@media (max-width: 1300px) {
    .taskbar-right {
        gap: 10px;
    }
}

@media (max-width: 1180px) {
    .widgets-rail {
        width: min(var(--widgets-rail-width), 320px);
    }

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

@media (max-width: 920px) {
    :root {
        --shell-topbar-height: 0px;
        --shell-taskbar-height: 62px;
    }

    .system-clock {
        display: none !important;
    }

    body {
        overflow: auto;
    }

    .desktop {
        min-height: 100vh;
        padding-top: 12px;
        padding-bottom: calc(var(--shell-taskbar-height) + 68px);
    }

    .desktop-icons {
        position: relative;
        inset: auto;
        width: auto;
        max-height: none;
        padding: 18px 16px 0;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: none;
        grid-auto-flow: row;
        grid-auto-columns: auto;
        gap: 12px 8px;
    }

    .desktop-shortcut {
        width: auto;
        min-height: calc(min(var(--desktop-icon-size), 72px) + 28px);
        min-width: 0;
    }

    .widgets-rail {
        position: relative;
        top: auto;
        right: auto;
        width: auto;
        max-height: none;
        margin: 16px;
    }

    .app-window {
        position: fixed;
        top: 12px !important;
        right: 10px !important;
        bottom: calc(var(--shell-taskbar-height) + 12px) !important;
        left: 10px !important;
        width: auto !important;
        height: auto !important;
        max-width: none !important;
        max-height: none !important;
    }

    .app-window.is-maximized {
        top: 0 !important;
        right: 0 !important;
        bottom: var(--shell-taskbar-height) !important;
        left: 0 !important;
        width: auto !important;
        height: auto !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 0 !important;
    }

    .hero-panel,
    .content-grid,
    .skills-grid,
    .credentials-grid,
    .project-grid,
    .contact-grid,
    .settings-layout,
    .project-workbench,
    .project-demo-grid {
        grid-template-columns: 1fr;
    }

    .launcher-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .start-grid,
    .recommended-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .span-2,
    .span-3 {
        grid-column: auto;
    }

    .taskbar {
        width: calc(100vw - 16px);
        grid-template-columns: auto 1fr;
        min-height: 62px;
        padding: 8px;
        gap: 8px;
        bottom: 8px;
    }

    .taskbar-left,
    .taskbar-center,
    .taskbar-right {
        padding: 4px;
        border-radius: 16px;
    }

    .taskbar-right {
        grid-column: 1 / -1;
        justify-content: space-between;
        min-width: 0;
    }

    .taskbar-center {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 4px 5px;
    }

    .start-menu {
        left: 8px;
        right: 8px;
        width: auto;
        transform: none;
        bottom: calc(var(--shell-taskbar-height) + 8px);
        padding: 16px;
    }

    .start-menu:not([hidden]) {
        animation: startMenuInLeft 180ms ease both;
    }

    .start-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .project-detail-head,
    .project-card-top {
        flex-direction: column;
    }

    .quick-hire-popup {
        right: 10px;
        left: 10px;
        width: auto;
        bottom: calc(var(--shell-taskbar-height) + 10px);
    }

    .minesweeper-grid,
    .memory-grid {
        max-width: none;
    }
}

@media (max-width: 640px) {
    :root {
        --shell-topbar-height: 0px;
        --shell-taskbar-height: 58px;
    }

    .projects-widget-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .projects-widget-meta {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: center;
    }

    .projects-widget-index {
        min-width: 0;
    }

    .projects-widget-arrow {
        justify-self: end;
    }

    .hero-layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .desktop {
        min-height: 100vh;
        padding-top: 10px;
        padding-bottom: calc(var(--shell-taskbar-height) + 58px);
    }

    .desktop-icons {
        padding: 14px 10px 0;
        gap: 10px 4px;
    }

    .desktop-shortcut {
        min-height: calc(clamp(44px, var(--desktop-icon-size), 56px) + 32px);
        padding: 6px 4px 8px;
        gap: 8px;
    }

    .shortcut-label {
        max-width: none;
        font-size: 0.72rem;
    }

    .icon-badge {
        width: clamp(44px, var(--desktop-icon-size), 56px);
        height: clamp(44px, var(--desktop-icon-size), 56px);
        border-radius: calc(clamp(44px, var(--desktop-icon-size), 56px) * 0.32);
    }

    .icon-badge svg {
        width: calc(clamp(44px, var(--desktop-icon-size), 56px) * 0.5);
        height: calc(clamp(44px, var(--desktop-icon-size), 56px) * 0.5);
    }

    .icon-badge i {
        font-size: calc(clamp(44px, var(--desktop-icon-size), 56px) * 0.34);
    }

    .launcher-strip {
        grid-template-columns: 1fr;
    }

    .start-grid,
    .recommended-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .start-panel {
        padding: 12px;
        border-radius: 20px;
    }

    .widget-card,
    .hero-copy,
    .hero-sidecard,
    .content-card,
    .project-card,
    .contact-card,
    .window-body,
    .quick-hire-popup__shell {
        padding: 16px;
    }

    .window-chrome {
        padding: 12px 14px;
    }

    .taskbar {
        width: calc(100vw - 12px);
        grid-template-columns: auto minmax(0, 1fr) auto;
        min-height: 58px;
        padding: 7px 8px;
        gap: 6px;
        bottom: 6px;
        border-radius: 18px;
    }

    .taskbar-left,
    .taskbar-center,
    .taskbar-right,
    .taskbar-running {
        gap: 6px;
    }

    .taskbar-left,
    .taskbar-center,
    .taskbar-right {
        padding: 4px;
        border-radius: 14px;
    }

    .taskbar-core,
    .taskbar-app {
        min-height: 38px;
        border-radius: 12px;
    }

    .taskbar-core {
        width: 40px;
    }

    .taskbar-app {
        width: 42px;
    }

    .taskbar-app::after {
        bottom: 4px;
        width: 12px;
    }

    .app-icon--sm {
        width: 28px;
        height: 28px;
        border-radius: 10px;
    }

    .app-icon--sm svg {
        width: 15px;
        height: 15px;
    }

    .windows-glyph,
    .widgets-glyph {
        width: 16px;
        height: 16px;
    }

    .taskbar-right {
        grid-column: auto;
        justify-content: flex-end;
        gap: 10px;
        min-width: auto;
        padding-inline: 0;
        white-space: nowrap;
    }

    .tray-power-button {
        width: 32px;
        height: 32px;
        border-radius: 12px;
    }

    .power-glyph {
        width: 12px;
        height: 12px;
    }

    .system-clock {
        display: none !important;
    }

    #taskbar-date {
        display: none;
    }

    .taskbar-empty-state {
        padding: 0 8px;
        font-size: 0.68rem;
        letter-spacing: 0;
    }

    .start-menu {
        bottom: calc(var(--shell-taskbar-height) + 6px);
    }
}

