/* The directory uses the full desktop canvas; the location tree remains the only sidebar. */
.gm-shell {
    width: min(1920px, calc(100% - 48px));
}

.gm-content-layout {
    grid-template-columns: minmax(270px, 300px) minmax(0, 1fr);
    align-items: start;
}

.gm-content-layout > .gm-sidebar,
.gm-content-layout > .gm-main {
    min-width: 0;
}

.gm-content-layout > .gm-sidebar .gm-filter-panel {
    position: sticky;
    top: 94px;
    max-height: none;
    overflow: visible;
}

.gm-model-grid {
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.gm-card-media .gm-badge-vip {
    background: #7c3aed !important;
    color: #fff !important;
}

.gm-card-media .gm-badge-gold {
    background: #d97706 !important;
    color: #fff !important;
}

.gm-card-media .gm-badge-silver {
    background: #475569 !important;
    color: #fff !important;
}

.gm-card-media .gm-badge-bronze {
    background: #c2410c !important;
    color: #fff !important;
}

.gm-card-media .gm-online {
    background: #25d366 !important;
    color: #fff !important;
    border-color: #fff !important;
}

.gm-card-media .gm-online::before {
    background: #fff !important;
}

@media (min-width: 1800px) {
    .gm-model-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) and (min-width: 768px) {
    .gm-shell {
        width: min(100% - 32px, 1280px);
    }

    .gm-content-layout {
        grid-template-columns: minmax(240px, 270px) minmax(0, 1fr);
    }

    .gm-model-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .gm-shell {
        width: min(100% - 28px, 640px);
    }

    .gm-content-layout {
        display: block;
    }

    .gm-content-layout > .gm-sidebar .gm-filter-panel {
        display: none !important;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(86vw, 340px);
        max-height: 100dvh;
        overflow-y: auto;
        z-index: 60;
    }

    .gm-content-layout > .gm-sidebar .gm-filter-panel.is-open { display: block !important; }

    .gm-sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 50;
        background: rgba(18, 21, 42, .48);
    }

    .gm-sidebar-backdrop[hidden] { display: none !important; }

    body.gm-sidebar-open { overflow: hidden; }

    .gm-filter-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: auto;
        margin: 0 0 14px;
        border-radius: 7px;
        font-weight: 800;
    }

    .gm-location-panel-actions { display: flex; align-items: center; gap: 8px; }

    .gm-sidebar-close {
        display: grid;
        place-items: center;
        width: 32px;
        height: 32px;
        padding: 0;
        border: 1px solid var(--gm-border);
        border-radius: 6px;
        background: #fff;
        color: var(--gm-dark);
        font-size: 22px;
        line-height: 1;
        cursor: pointer;
    }
}

@media (min-width: 768px) {
    .gm-sidebar-backdrop,
    .gm-sidebar-close { display: none !important; }
}
