body.medagg-body.medagg-body--offices {
    background: #fff;
}

.medagg-offices {
    box-sizing: border-box;
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 calc(var(--medagg-tabbar-h, 64px) + 32px);
}

.medagg-offices__title {
    margin: 0 0 8px;
    color: #003670;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
}

.medagg-offices__lead {
    margin: 0 0 20px;
    max-width: 640px;
    color: #718096;
    font-size: 15px;
    line-height: 1.45;
}

.medagg-offices__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-bottom: 16px;
}

.medagg-offices__search {
    flex: 1 1 240px;
}

.medagg-offices__search input {
    box-sizing: border-box;
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    font: inherit;
    font-size: 15px;
}

.medagg-offices__zone {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #2d3748;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.medagg-offices__nav,
.medagg-offices__views {
    display: none;
    gap: 4px;
    padding: 4px;
    border-radius: 100px;
    background: #f5f7fb;
}

.medagg-offices__nav button,
.medagg-offices__views button {
    border: 0;
    border-radius: 100px;
    padding: 8px 16px;
    background: transparent;
    color: #64748b;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.medagg-offices__nav button.is-active,
.medagg-offices__views button.is-active {
    background: #003670;
    color: #fff;
    font-weight: 700;
}

.medagg-offices__board {
    display: grid;
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    min-height: 560px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
}

.medagg-offices__list {
    min-width: 0;
    max-height: min(70vh, 720px);
    overflow-y: auto;
    padding: 12px;
    border-right: 1px solid #e6ebf2;
}

.medagg-offices__empty {
    margin: 24px 8px;
    color: #718096;
    font-size: 14px;
}

.medagg-offices-item {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px 12px;
    width: 100%;
    margin-bottom: 10px;
    padding: 12px;
    text-align: left;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    font: inherit;
}

.medagg-offices-item:hover,
.medagg-offices-item.is-active {
    border-color: #003670;
}

.medagg-offices-item__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    background: #fff;
}

.medagg-offices-item__logo img {
    display: block;
    width: 28px;
    height: auto;
    max-height: 24px;
    object-fit: contain;
}

.medagg-offices-item__lab {
    display: block;
    color: #1e293b;
    font-size: 15px;
    font-weight: 700;
}

.medagg-offices-item__addr {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
    overflow-wrap: break-word;
}

.medagg-offices__map-wrap {
    position: relative;
    min-height: 420px;
    background: #eef2f7;
}

.medagg-offices__map {
    position: absolute;
    inset: 0;
}

.medagg-offices-card {
    position: absolute;
    z-index: 5;
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-height: calc(100% - 32px);
    overflow: auto;
    padding: 16px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 40px rgba(15, 25, 45, 0.16);
}

.medagg-offices-card__head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.medagg-offices-card__back {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f5f7fb;
    cursor: pointer;
}

.medagg-offices-card__lab {
    margin: 0 0 6px;
    color: #003670;
    font-size: 16px;
    font-weight: 800;
}

.medagg-offices-card__addr,
.medagg-offices-card__metro {
    margin: 0 0 8px;
    color: #2d3748;
    font-size: 14px;
    line-height: 1.4;
}

.medagg-offices-card__hours {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.medagg-offices-card__hours-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #4a5568;
    font-size: 13px;
}

.medagg-offices-pin {
    transform: translate(-50%, -100%);
}

.medagg-offices-pin__ava {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    overflow: hidden;
    border-radius: 18px;
    background: #003670;
    box-shadow: 0 4px 10px rgba(0, 54, 112, 0.28);
}

.medagg-offices-pin__ava img {
    display: block;
    width: 22px;
    height: auto;
    max-height: 20px;
    object-fit: contain;
    background: #fff;
    border-radius: 11px;
    padding: 3px;
}

.medagg-offices-cluster {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 20px;
    background: #003670;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0, 54, 112, 0.28);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

@media (max-width: 767px) {
    .medagg-offices {
        width: calc(100% - 24px);
        padding-top: 12px;
        padding-bottom: calc(var(--medagg-tabbar-h, 64px) + 16px);
    }

    .medagg-offices__title {
        font-size: 22px;
    }

    .medagg-offices__lead {
        display: none;
    }

    .medagg-offices__nav,
    .medagg-offices__views {
        display: flex;
        width: 100%;
        justify-content: center;
    }

    .medagg-offices__nav button,
    .medagg-offices__views button {
        flex: 1 1 0;
    }

    .medagg-offices__board {
        grid-template-columns: 1fr;
        min-height: calc(100vh - 260px);
        border-radius: 20px;
    }

    .medagg-offices__board[data-view="map"] .medagg-offices__list {
        display: none;
    }

    .medagg-offices__board[data-view="list"] .medagg-offices__map-wrap {
        display: none;
    }

    .medagg-offices__list {
        max-height: calc(100vh - 280px);
        border-right: 0;
    }

    .medagg-offices__map-wrap {
        min-height: calc(100vh - 280px);
        height: calc(100vh - 280px);
    }
}

@media (min-width: 768px) {
    .medagg-offices {
        width: min(1200px, calc(100% - 48px));
        padding: 32px 0 64px;
    }

    .medagg-offices__nav,
    .medagg-offices__views {
        display: none;
    }

    .medagg-body--offices .medagg-tabbar {
        display: none;
    }
}
