.uvecd-instagram-feed {
    display: grid;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 72px) / 4);
    gap: 18px;
    overflow-x: auto;
    padding: 4px 2px 14px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}

.uvecd-instagram-card {
    min-width: 0;
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(35, 47, 87, .10);
    scroll-snap-align: start;
}

.uvecd-instagram-open { display: block; width: 100%; padding: 0; border: 0; background: #f3f4f7; cursor: zoom-in; }
.uvecd-instagram-card img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: contain; }

.uvecd-instagram-modal { display: none; position: fixed; z-index: 10000; inset: 0; align-items: center; justify-content: center; padding: 24px; }
.uvecd-instagram-modal[aria-hidden="false"] { display: flex; }
.uvecd-instagram-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .82); }
.uvecd-instagram-modal-dialog { position: relative; z-index: 1; display: flex; width: min(96vw, 1100px); max-height: 94vh; align-items: stretch; justify-content: center; overflow: hidden; border-radius: 10px; background: #fff; }
.uvecd-instagram-modal-media { display: flex; min-width: 0; flex: 1 1 auto; align-items: center; justify-content: center; background: #111; }
.uvecd-instagram-modal-media img { display: block; max-width: 100%; max-height: 90vh; width: auto; height: auto; object-fit: contain; }
.uvecd-instagram-modal-details { width: 310px; flex: 0 0 310px; padding: 28px 22px 22px; color: #232f57; }
.uvecd-instagram-profile { display: flex; align-items: center; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid #e8e8e8; }
.uvecd-instagram-profile img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: #eee; }
.uvecd-instagram-profile strong, .uvecd-instagram-profile small { display: block; }
.uvecd-instagram-profile small { margin-top: 3px; color: #777; }
.uvecd-instagram-modal-details p { max-height: 260px; margin: 20px 0; overflow-y: auto; white-space: pre-wrap; font-size: 14px; line-height: 1.55; }
.uvecd-instagram-modal-close { position: absolute; z-index: 2; top: -16px; right: -16px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #fff; color: #232f57; font-size: 28px; line-height: 32px; cursor: pointer; }
.uvecd-instagram-modal-open { overflow: hidden; }

@media (max-width: 991px) {
    .uvecd-instagram-feed { grid-auto-columns: calc((100% - 36px) / 2); }
}

@media (max-width: 575px) {
    .uvecd-instagram-feed { grid-auto-columns: calc((100% - 18px) / 2); gap: 12px; }
    .uvecd-instagram-modal { padding: 14px; }
    .uvecd-instagram-modal-dialog { display: block; max-height: 94vh; overflow-y: auto; }
    .uvecd-instagram-modal-media img { max-height: 62vh; width: 100%; }
    .uvecd-instagram-modal-details { width: auto; padding: 20px; }
    .uvecd-instagram-modal-close { top: 8px; right: 8px; }
}
