/* ACHIEVO — mobile layouts for multi-panel apps */

@media (max-width: 820px) {
    /* Forge */
    .forge-app-body {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto 1fr auto;
    }

    .forge-pipeline {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--fg-border, #333);
        max-height: 120px;
    }

    .forge-inspector {
        max-height: 180px;
        overflow-y: auto;
        border-top: 1px solid var(--fg-border, #333);
    }

    /* Darknot browser */
    .dn-layout,
    .darknot-layout,
    #win-browser .dn-body {
        flex-direction: column !important;
    }

    .dn-sidebar,
    .darknot-sidebar,
    #win-browser .forum-sidebar {
        width: 100% !important;
        max-width: none !important;
        flex: 0 0 auto !important;
        max-height: 160px;
        overflow-y: auto;
        border-right: none !important;
        border-bottom: 1px solid #333;
    }

    /* GooleGoole in-window */
    .gg-shell,
    .gg-layout {
        flex-direction: column !important;
    }

    .gg-sidebar,
    .gj-sidebar {
        width: 100% !important;
        max-width: none !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .gj-vrow {
        grid-template-columns: 48px 1fr !important;
    }

    .gj-vrow__aside {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding-top: 8px;
    }

    /* Civilian Work OS */
    .text-studio-window .ts-workspace {
        grid-template-columns: 1fr !important;
        grid-template-rows: minmax(100px, auto) 1fr minmax(120px, auto);
        overflow: auto;
    }

    .ts-layout,
    .text-studio-layout {
        grid-template-columns: 1fr !important;
    }

    .ts-sidebar,
    .ts-preview,
    .ts-tools {
        max-height: 200px;
        overflow-y: auto;
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .padpp-shell,
    .padpp-layout {
        flex-direction: column !important;
    }

    .padpp-sidebar,
    .padpp-gutter {
        width: 100% !important;
        max-height: 140px;
        overflow: auto;
    }

    .chat-layout,
    .client-chat-layout {
        grid-template-columns: 1fr !important;
    }

    .chat-sidebar,
    .chat-list {
        max-height: 180px;
        overflow-y: auto;
    }

    /* Gov Work OS */
    .fd-main,
    .fd-main--dual,
    .fd-body,
    .fd-desk-layout,
    .dispatch-desk-layout {
        grid-template-columns: 1fr !important;
    }

    .fd-sidebar,
    .fd-intel,
    .fd-form-col,
    .fd-map-col {
        max-height: none;
        border-right: none !important;
    }

    .forensics-layout,
    .cid-forensics-shell {
        grid-template-columns: 1fr !important;
    }

    .forensics-sidebar,
    .forensics-viewer,
    .forensics-tools,
    .records-sidebar,
    .records-detail {
        max-height: 240px;
        overflow-y: auto;
    }

    .gov-records-layout,
    .medrecords-layout {
        grid-template-columns: 1fr !important;
    }

    .fr-layout,
    .radio-layout {
        grid-template-columns: 1fr !important;
    }

    .fr-units,
    .fr-options__grid {
        grid-template-columns: 1fr !important;
    }

    /* Military tactical panels */
    .mil-tac-grid,
    .mil-tac-layout,
    .sky-deploy-layout {
        grid-template-columns: 1fr !important;
    }

    .sky-deploy-panel,
    .u7-command-panel {
        width: 100% !important;
        max-width: none !important;
    }

    /* UNIT-7 procurement / orders */
    .u7-proc-layout,
    .u7-roster-layout {
        grid-template-columns: 1fr !important;
    }

    .u7-sector-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .u7-order-pick,
    .u7-deploy-card {
        grid-template-columns: 1fr !important;
    }

    .u7-plan-card__controls {
        grid-template-columns: 1fr !important;
    }

    /* Forex / casino / phish — stack toolbars */
    .fx-layout,
    .phish-layout,
    .bc-layout {
        flex-direction: column !important;
    }

    .fx-sidebar,
    .phish-sidebar {
        width: 100% !important;
        max-height: 200px;
        overflow-y: auto;
    }

    /* Terminal */
    .linux-terminal,
    #terminal-output {
        font-size: 11px;
    }

    /* PC builder */
    .pcb-layout {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 520px) {
    .u7-sector-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .gj-detail__head {
        flex-direction: column;
        align-items: flex-start;
    }

    .mil-toolbar {
        flex-direction: column;
    }

    .mil-toolbar .mil-btn {
        width: 100%;
    }
}
