/* Estilo PHP clássico: cantos retos no celular e no computador. */
:root {
    --bs-border-radius: 0;
    --bs-border-radius-sm: 0;
    --bs-border-radius-lg: 0;
    --bs-border-radius-xl: 0;
    --bs-border-radius-xxl: 0;
    --bs-border-radius-pill: 0;
}

/* Layout do gerenciador em telas estreitas. */
.filemanager-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.filemanager-actions > .btn {
    margin: 0;
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    text-align: center;
    touch-action: manipulation;
}
.filemanager-actions > .btn .d-block {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: .35rem;
}
.filemanager-actions > .btn img {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}
.filemanager-nav-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
    min-width: 0;
    flex: 1 1 auto;
}
.filemanager-location {
    display: flex;
    align-items: center;
    gap: .35rem;
    min-width: 0;
    max-width: 100%;
}
.filemanager-location #visualPath {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.filemanager-search { min-width: 0; }
.filemanager-list { overflow-x: auto; }
.filemanager-nav-cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    min-width: 0;
}
.filemanager-nav-cluster:not(:has(.is-visible)) { display: none; }
.filemanager-pathbar { flex-wrap: wrap; gap: .5rem; }
.filemanager-pathbar-main {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    min-width: 0;
}
.filemanager-pathbar .filemanager-selection-actions.is-visible { display: contents; }
.filemanager-pathbar .filemanager-back.btn,
.filemanager-pathbar .filemanager-selection-actions .btn {
    flex: 0 0 auto;
    width: auto;
    min-height: calc(1.5em + .75rem + 2px);
    height: auto;
    margin: 0;
    padding: .375rem .75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    white-space: nowrap;
}
.filemanager-pathbar .filemanager-selection-actions .btn { border-width: 1px !important; }
.filemanager-nav-cluster .btn-group { flex-wrap: wrap; }
.filemanager-selection-actions {
    display: none;
    flex-wrap: wrap;
    gap: .5rem;
}
.filemanager-selection-actions.is-visible { display: flex; }
.filemanager-selection-actions .btn,
.filemanager-nav-cluster .btn {
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    touch-action: manipulation;
}
.selection-count:empty { display: none; }
.selection-count {
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 .35rem;
    border-radius: 0;
    background: rgba(0, 0, 0, .28);
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.35rem;
}
.system-stat-body { white-space: normal !important; overflow: visible !important; }
.system-stat-body h6 {
    display: flex;
    align-items: flex-start;
    gap: .45rem;
    min-width: 0;
    min-height: 2.6rem;
}
.system-stat-body .stat-title {
    font-size: 1rem;
    line-height: 1.3;
    min-width: 0;
    overflow-wrap: anywhere;
}
.system-stat-body .fa-2x { flex: 0 0 auto; font-size: 1.35rem; }
.system-stat-body .progress-bar {
    transition: width 1s cubic-bezier(.22, 1, .36, 1);
}
.system-stat-body .media {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}
.system-stat-body .media-body { flex: 1 1 auto; min-width: 0; order: 1; }
.system-stat-body .stat-action {
    order: 2;
    align-self: center;
    flex: 0 0 auto;
    float: none !important;
    margin: 0 0 .15rem .45rem !important;
    min-height: 1.75rem;
    padding: 0 .7rem;
    border-radius: 0 !important;
    border: 1px solid rgba(255, 255, 255, .18) !important;
    background: transparent !important;
    color: #d7e0ec !important;
    font-size: .75rem;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none !important;
}
.system-stat-body .stat-action:hover,
.system-stat-body .stat-action:focus-visible {
    background: rgba(255, 255, 255, .08) !important;
    color: #f4f7fb !important;
}
/* No computador o botão fica na linha do título e a barra ocupa a largura do card. */
@media (min-width: 768px) {
    .system-stat-body .media:has(> .stat-action) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "title action"
            "bar bar"
            "more more"
            "meta meta";
        column-gap: .65rem;
        align-items: center;
    }
    .system-stat-body .media:has(> .stat-action) > .media-body {
        display: contents;
    }
    .system-stat-body .media:has(> .stat-action) h6 {
        grid-area: title;
        min-width: 0;
        align-items: center;
    }
    .system-stat-body .media:has(> .stat-action) .stat-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .system-stat-body .media:has(> .stat-action) .progress {
        grid-area: bar;
        width: 100%;
    }
    .system-stat-body .media:has(> .stat-action) .stat-more {
        grid-area: more;
    }
    .system-stat-body .media:has(> .stat-action) > .stat-meta {
        grid-area: meta;
    }
    .system-stat-body .media:has(> .stat-action) > .stat-action {
        grid-area: action;
        justify-self: end;
        align-self: center;
        margin: 0 !important;
    }
}
.stat-meta {
    order: 3;
    flex: 1 0 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .2rem .7rem;
    margin-top: .35rem;
    color: #c9d3e2;
    font-size: .78rem;
}
.stat-aside {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: .28rem;
}
.stat-temp {
    color: #9fd0c3;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.stat-fold {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.05rem;
    height: 1.05rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #8ea0b8;
    cursor: pointer;
}
.stat-fold svg {
    display: block;
    width: 11px;
    height: 11px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linecap: square;
    stroke-linejoin: miter;
}
.stat-fold[aria-expanded="false"] svg { transform: rotate(180deg); }
.stat-fold:hover,
.stat-fold:focus-visible { color: #e7eef8; outline: none; }
.stat-fold[hidden] { display: none; }
.stat-more {
    display: grid;
    grid-template-rows: 0fr;
    min-width: 0;
    margin-top: 0;
    transition: grid-template-rows .22s ease, margin-top .22s ease;
}
.stat-more.is-open { grid-template-rows: 1fr; margin-top: .45rem; }
.stat-more-clip { overflow: hidden; min-height: 0; }
.cpu-core-temp.is-note { color: #9aabbf; }
@media (prefers-reduced-motion: reduce) {
    .stat-more { transition: none; }
}
.stat-temp.is-warm { color: #e6c98a; }
.stat-temp.is-hot { color: #f0b4b4; }
#cpuName {
    font-weight: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}
.stat-spin {
    width: .72rem;
    height: .72rem;
    border-width: .12em;
    color: #00b1ff;
    vertical-align: -1px;
}
.cpu-cores > .stat-spin {
    justify-self: center;
    margin: .35rem 0;
}
@media (prefers-reduced-motion: reduce) {
    .stat-spin { animation: none; }
}
.cpu-stat .stat-meta span span { font-variant-numeric: tabular-nums; }
.cpu-cores {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: .45rem .35rem;
}
.cpu-core {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .18rem;
    min-width: 0;
}
.cpu-core-label,
.cpu-core-pct,
.cpu-core-temp {
    max-width: 100%;
    height: .72rem;
    overflow: hidden;
    font-size: .64rem;
    line-height: .72rem;
    font-variant-numeric: tabular-nums;
    color: #8ea0b8;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.cpu-core-pct { color: #d7e0ec; }
.cpu-core-temp { color: #9fd0c3; min-height: .68rem; }
.cpu-core-temp.is-warm { color: #e6c98a; }
.cpu-core-temp.is-hot { color: #f0b4b4; }
.cpu-core-track {
    display: flex;
    align-items: flex-end;
    width: 100%;
    height: 2.35rem;
    background: rgba(255, 255, 255, .08);
}
.cpu-core-fill {
    display: block;
    width: 100%;
    height: 0;
    background: #3dbe8b;
    transition: height .7s cubic-bezier(.22, 1, .36, 1);
}
.cpu-core-fill[data-level="info"] { background: #3aa0c8; }
.cpu-core-fill[data-level="warm"] { background: #e0b15a; }
.cpu-core-fill[data-level="hot"] { background: #e06c6c; }
.filemanager-list { overflow-x: auto; }

@media (max-width: 767.98px) {
    #navContent { padding: 0 .5rem; }
    #navContent .row { margin-right: 0; margin-left: 0; }
    #navContent .row > .col-12 { padding-right: 0; padding-left: 0; }
    #navContent .row .card-body button:not(.stat-action) { float: none !important; margin: 0 0 .5rem !important; }
    #navContent > .row.mt-2 { gap: .4rem; margin-top: .35rem !important; }
    #navContent > .row.mt-2 > [class*="col-"] { margin-top: 0 !important; }
    #navContent > .row.mt-2 .card {
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    .system-stat-body { padding: .55rem .75rem .5rem !important; }
    .system-stat-body .media { align-items: stretch; }
    .system-stat-body .media-body { flex: 1 1 100%; padding-right: 0; }
    .system-stat-body h6 {
        align-items: flex-start;
        min-height: 2.2rem;
        margin: 0 0 .35rem !important;
    }
    .system-stat-body .fa-2x { font-size: .95rem; opacity: .72; }
    .system-stat-body .stat-title {
        font-size: .84rem !important;
        font-weight: 500;
        color: #d7e0ec !important;
    }
    .system-stat-body .progress {
        height: 3px !important;
        background: rgba(255, 255, 255, .08) !important;
        box-shadow: none;
    }
    .system-stat-body .progress-bar { box-shadow: none !important; }
    .stat-meta {
        margin-top: .4rem;
        color: #8ea0b8;
        font-size: .72rem;
        gap: .2rem .55rem;
    }
    .stat-temp { font-size: .78rem; }
    .filemanager-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
    .filemanager-actions > .btn {
        min-width: 0;
        min-height: 2.25rem;
        white-space: normal;
        font-size: .78rem;
        font-weight: 600;
        line-height: 1.15;
        padding: .35rem .55rem;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    .filemanager-pathbar .btn,
    .filemanager-navigation .btn,
    .filemanager-nav-cluster .btn,
    .filemanager-selection-actions .btn,
    .filemanager-search .btn {
        min-width: 0;
        min-height: 2.25rem;
        white-space: normal;
        font-size: .78rem;
        font-weight: 500;
        line-height: 1.15;
        padding: .35rem .55rem;
        border-radius: 0 !important;
        border: 1px solid rgba(255, 255, 255, .1) !important;
        background: rgba(255, 255, 255, .035) !important;
        color: #d5deea !important;
        box-shadow: none !important;
    }
    .filemanager-nav-cluster .btn:hover,
    .filemanager-nav-cluster .btn:focus,
    .filemanager-nav-cluster .btn:active,
    .filemanager-pathbar .btn:hover,
    .filemanager-pathbar .btn:focus,
    .filemanager-search .btn:hover,
    .filemanager-search .btn:active {
        transform: none;
        box-shadow: none !important;
        background: rgba(255, 255, 255, .08) !important;
        color: #f4f7fb !important;
    }
    .filemanager-actions > .btn-danger,
    #deleteSelectedBtn { color: #f0c1c1 !important; }
    #compressSelectedBtn { color: #ead7b0 !important; }
    #fileManagerSettingsModal .btn-close {
        min-height: 2.25rem;
    }
    #fileManagerSettingsModal .btn-close {
        width: 2.75rem;
        padding: 0;
    }
    .filemanager-pathbar .btn-group {
        display: flex;
        flex: 0 0 auto;
        margin-left: auto;
    }
    .filemanager-pathbar .btn-group > .btn { flex: 1; }
    .filemanager-pathbar { flex-wrap: wrap; gap: .5rem; }
    .filemanager-nav-main,
    .filemanager-location { width: 100%; }
    .filemanager-location #visualPath { flex: 1 1 auto; }
    .filemanager-location #copyBtn { margin-left: 0 !important; }
    .filemanager-navigation { flex-direction: column; align-items: stretch !important; gap: .75rem; }
    .filemanager-nav-cluster,
    .filemanager-nav-cluster .btn-group,
    .filemanager-selection-actions { width: 100%; }
    .filemanager-nav-cluster .btn-group { display: flex; }
    .filemanager-nav-cluster .btn-group > .btn,
    .filemanager-selection-actions .btn { flex: 1 1 calc(50% - .5rem); }
    .filemanager-pathbar .filemanager-selection-actions { width: auto; max-width: 100%; }
    .filemanager-pathbar .filemanager-back.btn,
    .filemanager-pathbar .filemanager-selection-actions .btn {
        flex: 0 0 auto;
        width: auto;
        min-height: 2.25rem;
        height: auto;
        padding: .35rem .55rem;
        font-size: .78rem;
        font-weight: 500;
        line-height: 1.15;
        white-space: nowrap;
    }
    .selection-count {
        min-width: 1.1rem;
        height: 1.1rem;
        background: transparent;
        font-size: .72rem;
        font-weight: 600;
        line-height: 1.1rem;
    }
    #cpuName {
        font-size: inherit;
        font-weight: inherit;
        color: inherit;
    }
    .cpu-core-track { height: 2rem; }
    .system-stat-body .stat-action {
        position: static;
        order: 4;
        align-self: stretch;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100% !important;
        min-height: 2.15rem !important;
        margin: .45rem 0 0 !important;
        padding: 0 .75rem !important;
        border-radius: 0 !important;
        border: 1px solid rgba(255, 255, 255, .14) !important;
        background: rgba(255, 255, 255, .04) !important;
        color: #d7e0ec !important;
        font-size: .78rem !important;
        font-weight: 500;
        letter-spacing: .01em;
    }
    .system-stat-body .stat-action:hover,
    .system-stat-body .stat-action:focus,
    .system-stat-body .stat-action:active {
        background: rgba(255, 255, 255, .06) !important;
        color: #f4f7fb !important;
        box-shadow: none !important;
    }
    .filemanager-search { width: 100%; max-width: none !important; }
    .filemanager-list { max-height: min(55vh, 450px) !important; }
    #tableListFiles { width: 100%; table-layout: fixed; }
    #tableListFiles th:nth-child(n+3):nth-child(-n+6),
    #tableListFiles td:nth-child(n+3):nth-child(-n+6) { display: none; }
    #tableListFiles th:first-child, #tableListFiles td:first-child { width: 2.75rem !important; }
    #tableListFiles .checkboxFileList { width: 1.15rem; height: 1.15rem; }
    #tableListFiles th:last-child, #tableListFiles td:last-child { width: 7.5rem !important; max-width: none !important; }
    #tableListFiles td:nth-child(2) { max-width: none !important; overflow: hidden; }
    #tableListFiles td:nth-child(2) > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    #tableListFiles td:last-child .btn {
        min-height: 2.15rem;
        min-width: 2.15rem;
        padding: .28rem !important;
        margin: 0;
        border-radius: 0 !important;
        background: #1a2a3c !important;
        border: 1px solid rgba(0, 177, 255, .28) !important;
        color: #d7e0ec !important;
        box-shadow: none !important;
    }
    #tableListFiles td:last-child .btn-danger {
        background: #4a2428 !important;
        border-color: rgba(232, 120, 120, .5) !important;
        color: #ffd0d0 !important;
    }
    #tableListFiles td:last-child .btn-warning {
        background: #3f3418 !important;
        border-color: rgba(224, 177, 90, .5) !important;
        color: #ffe7b0 !important;
    }
    .swal2-popup.fixed-modal {
        width: min(100%, 22rem) !important;
        height: auto !important;
        max-height: min(68dvh, 26rem) !important;
    }
    #modalContent { width: calc(100vw - 1rem) !important; height: min(90dvh, 800px) !important; padding: 1rem !important; }
    #modalHeader { padding: 1rem !important; }
    #nameFileModalMedia { max-width: calc(100% - 3rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    #leftArrow { left: .5rem !important; width: 2.5rem !important; height: 2.5rem !important; }
    #rightArrow { right: .5rem !important; width: 2.5rem !important; height: 2.5rem !important; }
}

/* Editor e terminal no celular. */
#mobileTreeToggle, #mobileTerminalToggle { display: none; }
@media (max-width: 767.98px) {
    #edit-code .modal-dialog, #edit-code .modal-content {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        border-radius: 0 !important;
        overflow: hidden;
    }
    #edit-code .modal-header {
        flex: 0 0 53px;
        min-width: 0;
        gap: .35rem;
        padding: 0 .5rem !important;
    }
    #mobileTreeToggle, #mobileTerminalToggle { display: inline-flex; flex: 0 0 auto; font-size: .75rem; }
    #edit-code #tab-bar { display: none !important; }
    #edit-code #tabsFilesEditor {
        flex: 1 1 auto;
        min-width: 0;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }
    #edit-code #tabsFilesEditor .tab-header-item { flex: 0 0 auto; max-width: 12rem; }
    #edit-code #tabsFilesEditor .tab-header-item > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    #edit-code .modal-header > .btn-close { flex: 0 0 auto; margin: 0 0 0 .2rem; }
    #edit-code #modalBodyEditor {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
        padding-bottom: min(27dvh, 220px) !important;
    }
    #edit-code #modalBodyEditor > .container-fluid,
    #edit-code #modalBodyEditor > .container-fluid > .row { height: 100%; min-height: 0; }
    #edit-code #rightPanel { width: 100% !important; height: 100%; min-height: 0; overflow: hidden; padding: 0; }
    #edit-code #editorContainer { width: 100%; height: 100%; min-height: 0; }
    #edit-code #editor { width: 100% !important; height: 100% !important; }
    #edit-code #fArch {
        display: none !important;
        position: absolute;
        top: 53px;
        left: 0;
        z-index: 1051;
        width: min(85vw, 320px) !important;
        height: min(60dvh, 500px) !important;
        overflow: hidden;
        resize: none;
        box-shadow: 6px 8px 24px #0009;
    }
    #edit-code.mobile-tree-open #fArch { display: block !important; }
    #edit-code #tree_label { display: flex; flex-direction: column; gap: .25rem; font-size: 1rem; }
    #edit-code #searchFiles { display: block; max-height: 2.8em; overflow: auto; overflow-wrap: anywhere; }
    #edit-code #tree_label .btn-group { float: none !important; flex-wrap: wrap; }
    #edit-code #filesArchitecture { height: calc(100% - 110px) !important; overflow: auto; }
    #edit-code #resizerVertical { display: none; }
    #edit-code #footer-terminal {
        width: 100%;
        height: min(27dvh, 220px) !important;
        max-height: min(27dvh, 220px);
        padding: 0;
    }
    #edit-code #resizer { display: none; }
    #edit-code #tabsTerm { height: 44px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
    #edit-code #tabsTerm .nav-item { flex: 0 0 auto; }
    #edit-code #tabsTerm .nav-link { padding: .35rem .55rem !important; white-space: nowrap; }
    #edit-code #tabsTerm .terminal-tab-label { max-width: 6.5rem; }
    #edit-code #terms { width: 100%; height: calc(100% - 44px); overflow: hidden; }
    #edit-code #terms .xterm-container { max-width: 100%; overflow: hidden; }
    #edit-code.mobile-terminal-hidden #footer-terminal { display: none; }
    #edit-code.mobile-terminal-hidden #modalBodyEditor { padding-bottom: 0 !important; }
}

/* Modos separados para código e terminal no celular. */
#mobileWorkspaceSwitch, #mobileWorkspaceTitle,
#mobileTerminalHeading, #mobileTerminalKeys { display: none; }
@media (max-width: 767.98px) {
    #mobileTerminalToggle { display: none; }
    #edit-code .modal-header { background: #151d2a !important; border-bottom: 0 !important; }
    #edit-code #mobileTreeToggle {
        border-color: #38475e;
        border-radius: 0;
        padding: .4rem .55rem;
        color: #cbd8ec;
    }
    #edit-code #mobileWorkspaceSwitch {
        display: flex;
        flex: 0 0 52px;
        gap: 4px;
        padding: 5px 8px;
        background: #151d2a;
        border-bottom: 1px solid #263349;
    }
    #edit-code #mobileWorkspaceSwitch button {
        flex: 1 1 50%;
        border: 0;
        border-radius: 0;
        color: #aebbd0;
        background: transparent;
        font-weight: 600;
        font-size: .9rem;
    }
    #edit-code #mobileWorkspaceSwitch button.active {
        background: #2e69d3;
        color: #fff;
        box-shadow: 0 2px 9px #07172f8c;
    }
    #edit-code #mobileWorkspaceSwitch i { margin-right: .4rem; }
    #edit-code #modalBodyEditor { padding-bottom: 0 !important; }
    #edit-code #fArch { top: 105px; height: min(65dvh, 520px) !important; }
    #edit-code #footer-terminal { display: none; }
    #edit-code.mobile-view-terminal #modalBodyEditor > .container-fluid { display: none; }
    #edit-code.mobile-view-terminal #mobileTreeToggle,
    #edit-code.mobile-view-terminal #tabsFilesEditor { display: none !important; }
    #edit-code.mobile-view-terminal #mobileWorkspaceTitle {
        display: block;
        margin-left: .35rem;
        color: #e4efff;
        font: 700 .8rem 'JetBrains Mono', monospace;
        letter-spacing: .12em;
    }
    #edit-code.mobile-view-terminal #footer-terminal {
        display: flex;
        flex-direction: column;
        top: 105px;
        bottom: 0;
        height: calc(100dvh - 105px) !important;
        max-height: none;
        padding: 0;
        background: #0a101a;
    }
    #edit-code #mobileTerminalHeading {
        display: flex;
        align-items: center;
        flex: 0 0 36px;
        gap: .55rem;
        padding: 0 14px;
        border-bottom: 1px solid #263347;
        color: #aebed5;
        background: #101926;
        font: 700 .68rem 'JetBrains Mono', monospace;
        letter-spacing: .09em;
    }
    #edit-code .terminal-live-dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #5996ee;
        box-shadow: 0 0 7px #5996ee88;
    }
    #edit-code .terminal-heading-caption { margin-left: auto; color: #75849a; font-weight: 400; letter-spacing: 0; }
    #edit-code #tabsTerm {
        flex: 0 0 48px;
        height: 48px;
        padding: 3px 7px 0;
        gap: 4px;
        border-bottom: 1px solid #263347;
        background: #101926;
        scrollbar-width: none;
    }
    #edit-code #tabsTerm .nav-link {
        display: flex;
        align-items: center;
        gap: 3px;
        min-height: 39px;
        margin-top: 0 !important;
        border-radius: 0;
        color: #b0bdd1;
        background: #172233;
    }
    #edit-code #tabsTerm .nav-link.active {
        color: #e9f2ff !important;
        background: #23354d !important;
        border-bottom: 2px solid #5b9dff !important;
    }
    #edit-code #tabsTerm .terminal-tab-label { max-width: 9rem; }
    #edit-code #terms {
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
        padding: 8px 6px;
        overflow: hidden;
        background: #080d15;
    }
    #edit-code #mobileTerminalKeys {
        display: flex;
        flex: 0 0 auto;
        gap: 5px;
        padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
        overflow-x: auto;
        border-top: 1px solid #263347;
        background: #131e2d;
        scrollbar-width: none;
    }
    #edit-code #mobileTerminalKeys button {
        flex: 0 0 auto;
        min-width: 43px;
        min-height: 39px;
        padding: 0 .55rem;
        border: 1px solid #354a65;
        border-radius: 0;
        color: #dae6f6;
        background: #23354b;
        font: 600 .8rem 'JetBrains Mono', monospace;
    }
    #edit-code #mobileTerminalKeys button:active { background: #3167b5; }
}

#mobileTerminalEmpty { display: none; }
@media (max-width: 767.98px) {
    #edit-code #mobileTerminalEmpty {
        display: grid;
        place-items: center;
        align-content: center;
        gap: .5rem;
        height: 100%;
        color: #91a4c0;
        font-size: .9rem;
        text-align: center;
    }
    #edit-code #mobileTerminalEmpty strong { color: #7daeff; font-size: 1.25rem; }
    #edit-code #terms:has(.xterm-container) #mobileTerminalEmpty { display: none; }
}

/* Altura real do navegador e do teclado virtual. */
@media (max-width: 767.98px) {
    #edit-code {
        --mobile-vvh: 100dvh;
        --mobile-vv-top: 0px;
        --mobile-chrome-height: 105px;
    }
    #edit-code .modal-dialog {
        position: fixed;
        top: var(--mobile-vv-top);
        left: 0;
        width: 100%;
        height: var(--mobile-vvh);
        max-height: var(--mobile-vvh);
        margin: 0;
    }
    #edit-code .modal-content {
        height: 100%;
        max-height: 100%;
    }
    #edit-code.mobile-view-terminal #footer-terminal {
        top: calc(var(--mobile-vv-top) + var(--mobile-chrome-height));
        height: calc(var(--mobile-vvh) - var(--mobile-chrome-height)) !important;
    }
    #edit-code .modal-header > .btn-close {
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 0;
        background-size: 16px;
        opacity: .82;
    }
}
@media (max-width: 767.98px) {
    #edit-code.mobile-keyboard-open {
        --mobile-chrome-height: 86px;
    }
    #edit-code.mobile-keyboard-open .modal-header {
        flex-basis: 42px;
        height: 42px !important;
        min-height: 42px;
    }
    #edit-code.mobile-keyboard-open #mobileWorkspaceSwitch {
        flex-basis: 44px;
        height: 44px;
        padding: 4px 7px;
    }
    #edit-code.mobile-keyboard-open #mobileWorkspaceSwitch button {
        font-size: .8rem;
        border-radius: 0;
    }
    #edit-code.mobile-keyboard-open #mobileTerminalHeading {
        display: none;
    }
    #edit-code.mobile-keyboard-open #tabsTerm {
        flex-basis: 42px;
        height: 42px;
        padding-top: 2px;
    }
    #edit-code.mobile-keyboard-open #tabsTerm .nav-link {
        min-height: 35px;
        font-size: .85rem;
    }
    #edit-code.mobile-keyboard-open #mobileTerminalKeys {
        position: relative;
        z-index: 5;
        flex-basis: 48px;
        min-height: 48px;
        padding: 4px 7px calc(4px + env(safe-area-inset-bottom));
    }
    #edit-code.mobile-keyboard-open #mobileTerminalKeys button {
        min-width: 40px;
        min-height: 38px;
        font-size: .75rem;
    }
    #edit-code.mobile-keyboard-open .modal-header > .btn-close {
        width: 34px;
        height: 34px;
    }
}
@media (max-width: 767.98px) {
    #edit-code #mobileTerminalKeys {
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        touch-action: pan-x;
    }
    #edit-code #mobileTerminalKeys button {
        scroll-snap-align: start;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    #edit-code #tabsTerm,
    #edit-code #tabsFilesEditor {
        overscroll-behavior-x: contain;
        touch-action: pan-x;
    }
    #edit-code .xterm-helper-textarea {
        font-size: 16px !important;
    }
}

/* Avisos no alto, no tamanho do SweetAlert antigo. */
.swal2-container:not(:has(.swal-gallery-style)) {
    align-items: flex-start !important;
    padding-top: 16px !important;
}
.swal2-popup:not(.swal-gallery-style):not(.fixed-modal) {
    margin-top: 8px !important;
}

/* Botões, campos, cards e janelas quadrados no celular e no computador. */
.btn,
.btn-group > .btn,
.btn-close,
.form-control,
.form-select,
.input-group-text,
.card,
.card-header,
.card-footer,
.card-distak,
.modal-content,
.modal-content.headerModal,
.modal-header,
.dropdown-menu,
.dropdown-item,
.progress,
.badge,
.alert,
.list-group-item,
.offcanvas,
.swal2-popup,
.swal2-styled,
.swal2-close,
.toast,
.nav-link,
.nav-tabs .nav-link,
.page-link,
.form-check-input,
#navContent > .row.mt-2 .card,
#navContent .navbar,
.filemanager-actions > .btn,
.filemanager-pathbar .btn,
.filemanager-navigation .btn,
.filemanager-nav-cluster .btn,
.filemanager-selection-actions .btn,
.filemanager-search .btn,
#tableListFiles td:last-child .btn,
#edit-code #mobileTreeToggle,
#edit-code #mobileWorkspaceSwitch button,
#edit-code #mobileTerminalKeys button,
#edit-code #tabsTerm .nav-link,
#edit-code .modal-header > .btn-close,
.system-stat-body .stat-action {
    border-radius: 0 !important;
}
.form-switch .form-check-input {
    border-radius: 2em !important;
}

#codexAgentPanel .codex-context-tools {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .45rem;
}
#codexAgentPanel .codex-context-tool {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    max-width: 100%;
    padding: .12rem .4rem;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .03);
    color: #d7e0ec;
    font-size: .68rem;
    line-height: 1.35;
}
#codexAgentPanel .codex-context-tool i {
    width: .45rem;
    height: .45rem;
    flex: 0 0 auto;
    background: #8b97a8;
}
#codexAgentPanel .codex-context-tool.is-on i { background: #78dba9; }
#codexAgentPanel .codex-context-tool.is-ready i { background: #7eb6ff; }
#codexAgentPanel .codex-context-tool.is-off i { background: #ff7885; }
#codexAgentPanel .codex-context-tool span {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Acabamento do painel: cantos retos, menos brilho. */
#navContent > .row.mt-2 .card,
.card.card-distak {
    border: 1px solid rgba(255, 255, 255, .08) !important;
    border-radius: 0 !important;
    box-shadow: none;
}
.filemanager-actions > .btn {
    font-weight: 600;
    letter-spacing: .01em;
    box-shadow: none;
}
.filemanager-actions > .btn:hover,
.filemanager-actions > .btn:focus-visible {
    filter: brightness(1.07);
}
.filemanager-pathbar {
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
#tableListFiles thead th {
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: #9aabbf !important;
    border-bottom: 1px solid rgba(255, 255, 255, .1) !important;
    padding: .55rem .65rem !important;
    line-height: 1.25;
    white-space: nowrap;
    vertical-align: middle;
}
#tableListFiles tbody td {
    border-top-color: rgba(255, 255, 255, .06) !important;
    vertical-align: middle;
    padding: .48rem .65rem !important;
    line-height: 1.35;
    font-size: .92rem;
    color: #d7e0ec;
}
#tableListFiles tbody td img {
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
    object-fit: contain;
    vertical-align: middle;
    flex: 0 0 20px;
}
#tableListFiles th:nth-child(2),
#tableListFiles td:nth-child(2) {
    text-align: left;
}
#tableListFiles td:nth-child(2) > div {
    display: flex;
    align-items: center;
    gap: .4rem;
    min-width: 0;
}
#tableListFiles td:nth-child(2) span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#tableListFiles tbody tr:hover td {
    background-color: rgba(255, 255, 255, .035) !important;
}
#tableListFiles tbody tr:has(.checkboxFileList:checked) td {
    background-color: rgba(255, 255, 255, .06) !important;
}
#angryPart {
    position: fixed;
    inset: 0;
    z-index: 1080;
    margin: 0 !important;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: 1.5rem;
    background: #12151c;
    color: #e7eef8;
    text-align: center;
}
#angryPart .gate-card {
    width: min(100%, 24rem);
    padding: 1.75rem 1.5rem 1.4rem;
    background: #182030;
    border: 1px solid rgba(0, 177, 255, .28);
    border-radius: 0;
}
#angryPart .gate-mark {
    display: block;
    width: 4.5rem;
    height: auto;
    margin: 0 auto 1rem;
}
#angryPart h4 {
    margin: 0 0 .55rem !important;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0;
    color: #f4f7fb;
}
#angryPart .gate-copy {
    max-width: 22rem;
    margin: 0 auto;
    font-size: .92rem;
    font-weight: 400;
    line-height: 1.45;
    color: #8ea0b8;
}
#angryPart .gate-wait {
    margin-top: 1.15rem;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #8fd4ff;
}
#angryPart .gate-wait[hidden] {
    display: none !important;
}
body:has(#angryPart[style*="flex"]) #modalErrorToken,
body:has(#angryPart[style*="flex"]) #modal-anger,
body:has(#angryPart[style*="flex"]) .modal-backdrop {
    display: none !important;
}
@media (min-width: 768px) {
    #tableListFiles {
        width: 100%;
        table-layout: fixed;
    }
    #tableListFiles tbody td {
        padding: .42rem .65rem !important;
    }
    #tableListFiles .checkboxFileList,
    #tableListFiles #selectAllFiles {
        width: 1.1rem;
        height: 1.1rem;
        margin: 0;
        vertical-align: middle;
    }
    #tableListFiles th:first-child,
    #tableListFiles td:first-child { width: 2.4rem; }
    #tableListFiles th:nth-child(3),
    #tableListFiles td:nth-child(3) { width: 6.2rem; }
    #tableListFiles th:nth-child(4),
    #tableListFiles td:nth-child(4) { width: 10.2rem; }
    #tableListFiles th:nth-child(5),
    #tableListFiles td:nth-child(5) { width: 5.6rem; }
    #tableListFiles th:nth-child(6),
    #tableListFiles td:nth-child(6) { width: 6.2rem; }
    #tableListFiles th:last-child,
    #tableListFiles td:last-child { width: 7.6rem; max-width: none; }
    #tableListFiles td:last-child {
        white-space: nowrap;
    }
    #tableListFiles td:last-child .btn {
        min-height: 2rem;
        min-width: 2rem;
        padding: .28rem .4rem !important;
        line-height: 1;
        font-size: .82rem;
        background: #1a2a3c !important;
        border: 1px solid rgba(0, 177, 255, .28) !important;
        color: #d7e0ec !important;
        box-shadow: none !important;
    }
    #tableListFiles td:last-child .btn-danger {
        background: #4a2428 !important;
        border-color: rgba(232, 120, 120, .5) !important;
        color: #ffd0d0 !important;
    }
    #tableListFiles td:last-child .btn-warning {
        background: #3f3418 !important;
        border-color: rgba(224, 177, 90, .5) !important;
        color: #ffe7b0 !important;
    }
}
.filemanager-location #visualPath {
    color: #9fd8ff;
}

/* O monitor fica só nesta faixa. O editor cobre a tela e o Grok começa abaixo dela. */
#serverMonitor {
    position: static;
    z-index: 1;
}
@media (min-width: 768px) {
    #edit-code .modal-dialog {
        position: fixed;
        inset: 0;
        width: 100vw !important;
        max-width: none !important;
        height: 100% !important;
        margin: 0 !important;
    }
    #edit-code .modal-content {
        height: 100%;
        max-height: 100%;
        border: 0;
        border-radius: 0 !important;
        background: #1e1f22 !important;
    }
    #edit-code #footer-terminal {
        right: 0;
        width: auto;
    }
    #codexAgentPanel {
        top: calc(var(--server-monitor-offset, 0px) + 10px);
    }
}


