.top-instagram {
    box-sizing: border-box;
    margin-top: clamp(44px, 6vw, 84px);
    padding: clamp(30px, 4.5vw, 58px) clamp(12px, 3vw, 48px);
    border-top: 1px solid #dbe7eb;
    background: #fff;
    color: #143b50;
    text-align: center;
    scroll-margin-top: 78px;
}

.top-instagram .top-instagram__heading {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    font-size: clamp(24px, 3vw, 38px);
    font-weight: 700;
    line-height: 1.2;
}

.top-instagram__icon {
    position: relative;
    box-sizing: border-box;
    flex: 0 0 0.87em;
    height: 0.87em;
    border: 2px solid currentColor;
    border-radius: 27%;
}

.top-instagram__icon::before,
.top-instagram__icon::after {
    position: absolute;
    border-radius: 50%;
    content: "";
}

.top-instagram__icon::before {
    inset: 22%;
    border: 2px solid currentColor;
}

.top-instagram__icon::after {
    inset: 13% 13% auto auto;
    width: 12%;
    height: 12%;
    background: currentColor;
}

.top-instagram__intro {
    margin: 10px 0 24px;
    font-size: 15px;
}

.top-instagram .top-instagram__grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: clamp(5px, 0.8vw, 12px);
    max-width: 1480px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.top-instagram__item,
.top-instagram__placeholder {
    min-width: 0;
    aspect-ratio: 1;
}

.top-instagram__placeholder,
.top-instagram__tile {
    border-radius: 6px;
    background: #edf3f6;
}

.top-instagram__tile {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.top-instagram__tile:focus-visible,
.top-instagram__profile:focus-visible,
.top-instagram__close:focus-visible,
.top-instagram__original:focus-visible {
    outline: 3px solid #0057b8;
    outline-offset: 2px;
}

.top-instagram .top-instagram__tile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top-instagram__tile--case {
    display: grid;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 2px;
    background: #fff;
}

.top-instagram__comparison {
    position: relative;
    min-height: 0;
    overflow: hidden;
    background: #edf3f6;
}

.top-instagram__badge,
.top-instagram__phase {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #143b50;
    color: #fff;
    font-size: clamp(10px, 1vw, 12px);
    font-weight: 700;
    line-height: 1.5;
}

.top-instagram__badge {
    top: 5px;
    right: 5px;
    background: rgba(12, 30, 43, 0.88);
}

.top-instagram__phase {
    bottom: 4px;
    left: 4px;
}

.top-instagram__comparison:last-child .top-instagram__phase {
    background: #0057b8;
}

.top-instagram__video-name {
    position: absolute;
    inset: auto 0 0;
    padding: 10px 4px 5px;
    background: linear-gradient(transparent, rgba(12, 30, 43, 0.9));
    color: #fff;
    font-size: clamp(10px, 1.2vw, 14px);
    font-weight: 700;
}

.top-instagram__mark--video {
    border: 5px solid transparent;
    border-right: 0;
    border-left: 8px solid currentColor;
}

.top-instagram__mark--photos {
    box-sizing: border-box;
    width: 9px;
    height: 9px;
    margin-right: 2px;
    border: 1px solid currentColor;
    border-radius: 2px;
    box-shadow: 2px -2px currentColor;
}

.top-instagram a.top-instagram__profile,
.top-instagram a.top-instagram__original {
    display: inline-block;
    margin-top: 23px;
    padding: 10px 18px;
    border: 1px solid #0057b8;
    border-radius: 6px;
    color: #0057b8;
    font-weight: 700;
    text-decoration: none;
}

.top-instagram a.top-instagram__profile:hover,
.top-instagram a.top-instagram__original:hover {
    background: #eef6ff;
    text-decoration: underline;
}

.top-instagram .top-instagram__dialog {
    box-sizing: border-box;
    width: min(500px, calc(100% - 24px));
    max-height: calc(100dvh - 28px);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: #fff;
    color: #143b50;
}

.top-instagram__dialog::backdrop {
    background: rgba(12, 30, 43, 0.74);
}

.top-instagram__preview {
    padding: 0 10px 12px;
}

.top-instagram__dialog-header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 4px;
    background: #fff;
}

.top-instagram .top-instagram__dialog-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.top-instagram__close {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #edf3f6;
    color: #143b50;
    font: 26px/1 system-ui, sans-serif;
    cursor: pointer;
}

.top-instagram__dialog iframe {
    display: block;
    width: 100%;
    height: min(70dvh, 685px);
    border: 0;
}

.top-instagram__dialog video {
    display: block;
    width: 100%;
    max-height: min(68dvh, 685px);
    aspect-ratio: 9 / 16;
    background: #0c1e2b;
    object-fit: contain;
}

.top-instagram a.top-instagram__original {
    margin-top: 8px;
    font-size: 14px;
}

@media (max-width: 979px) {
    .top-instagram .top-instagram__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 599px) {
    .top-instagram .top-instagram__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
