/* Location editor navigation */
.location-editor-tabs {
    position: sticky;
    z-index: 20;
    top: 12px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 18px;
    padding: 7px;
    border: 1px solid #dce5f1;
    border-radius: 18px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 12px 32px rgba(31, 58, 108, .1);
    backdrop-filter: blur(14px);
}

.location-editor-tabs button {
    position: relative;
    display: flex;
    gap: 11px;
    align-items: center;
    min-width: 0;
    min-height: 58px;
    padding: 9px 13px;
    border: 0;
    border-radius: 13px;
    color: #5f6f84;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.location-editor-tabs button::after {
    position: absolute;
    right: 14px;
    bottom: 0;
    left: 14px;
    height: 2px;
    border-radius: 999px;
    content: "";
    background: transparent;
    transition: .18s ease;
}

.location-editor-tabs button:hover {
    color: #1d4ed8;
    background: #f4f8ff;
}

.location-editor-tabs button[aria-selected="true"] {
    color: #1d4ed8;
    background: linear-gradient(145deg, #eff6ff, #f8fbff);
    box-shadow: inset 0 0 0 1px #bfdbfe, 0 5px 13px rgba(37, 99, 235, .08);
}

.location-editor-tabs button[aria-selected="true"]::after {
    background: #2563eb;
}

.location-editor-tabs button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .2);
    outline-offset: 2px;
}

.location-editor-tab-icon {
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    color: #65758b;
    background: #eef2f7;
    transition: .18s ease;
}

.location-editor-tabs button:hover .location-editor-tab-icon,
.location-editor-tabs button[aria-selected="true"] .location-editor-tab-icon {
    color: #fff;
    background: linear-gradient(145deg, #3b82f6, #1d4ed8);
    box-shadow: 0 6px 14px rgba(37, 99, 235, .22);
}

.location-editor-tab-icon svg {
    width: 17px;
    height: 17px;
}

.location-editor-tabs button > span:last-child {
    min-width: 0;
}

.location-editor-tabs strong,
.location-editor-tabs small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.location-editor-tabs strong {
    color: inherit;
    font-size: 11px;
    line-height: 1.3;
}

.location-editor-tabs small {
    margin-top: 3px;
    color: #8794a6;
    font-size: 9px;
}

.location-editor-tab-panel[hidden] {
    display: none !important;
}

.location-editor-tab-panel {
    animation: location-tab-enter .2s ease;
}

.location-editor-organization > .panel + .panel {
    margin-top: 18px;
}

@keyframes location-tab-enter {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/*
 * Na desktopie obszar roboczy ma wĹ‚asne, zawsze dostÄ™pne przewijanie.
 * DziÄ™ki temu dĹ‚ugie ustawienia kaĹĽdej zakĹ‚adki nie koĹ„czÄ… siÄ™ poza ekranem
 * laptopa, a pasek zakĹ‚adek pozostaje widoczny podczas przewijania.
 */
@media (min-width: 981px) {
    .workspace:has(.location-form-screen[data-location-tabs-root]) {
        display: flex;
        flex-direction: column;
        height: 100dvh;
        overflow: hidden;
    }

    .workspace:has(.location-form-screen[data-location-tabs-root]) > :not(.content) {
        flex: 0 0 auto;
    }

    .workspace:has(.location-form-screen[data-location-tabs-root]) > .content {
        min-height: 0;
        flex: 1 1 auto;
        overflow-y: scroll;
        overscroll-behavior-y: contain;
        scrollbar-color: #94a3b8 #e8eef6;
        scrollbar-gutter: stable;
        scrollbar-width: thin;
    }

    .workspace:has(.location-form-screen[data-location-tabs-root]) .location-editor-tabs {
        /* Kompensuje gĂłrny padding przewijanego .content: wizualnie 12 px pod topbarem. */
        top: -20px;
    }

    .workspace:has(.location-form-screen[data-location-tabs-root]) > .content::-webkit-scrollbar {
        width: 11px;
    }

    .workspace:has(.location-form-screen[data-location-tabs-root]) > .content::-webkit-scrollbar-track {
        background: #e8eef6;
    }

    .workspace:has(.location-form-screen[data-location-tabs-root]) > .content::-webkit-scrollbar-thumb {
        border: 3px solid #e8eef6;
        border-radius: 999px;
        background: #94a3b8;
    }

    .workspace:has(.location-form-screen[data-location-tabs-root]) > .content::-webkit-scrollbar-thumb:hover {
        background: #64748b;
    }
}

@media (max-width: 980px) {
    .location-editor-tabs {
        position: relative;
        top: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .location-editor-tabs {
        display: flex;
        gap: 6px;
        margin-right: -16px;
        margin-left: -16px;
        padding: 7px 16px;
        overflow-x: auto;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
        box-shadow: 0 8px 22px rgba(31, 58, 108, .07);
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }

    .location-editor-tabs::-webkit-scrollbar {
        display: none;
    }

    .location-editor-tabs button {
        flex: 0 0 170px;
        min-height: 54px;
        scroll-snap-align: start;
    }

    .location-editor-tab-icon {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .location-editor-tab-panel {
        animation: none;
    }
}
