.il-feed {
    --il-accent: #f93262;
    --il-border: #e8ebf0;
    --il-bg: #ffffff;
    --il-text: #1f2a37;
    --il-muted: #64748b;
    max-width: 100%;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--il-text);
}

.il-feed-grid {
    display: grid;
    grid-template-columns: repeat(var(--il-columns, 4), minmax(0, 1fr));
    gap: 16px;
}

.il-feed-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(28px, 5vw, 72px);
    margin: 30px 0 18px;
    padding: 16px clamp(24px, 6vw, 90px);
    border: 1px solid var(--il-border);
    border-radius: 14px;
    background: var(--il-bg);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.il-feed-header-user {
    display: flex;
    align-items: center;
    flex: 0 1 340px;
    min-width: 0;
    gap: 12px;
}

.il-feed-header-picture {
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    overflow: hidden;
    background: #f8fafc;
}

.il-feed-header-picture img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.il-feed-header-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 3px;
}

.il-feed-header-name,
.il-feed-header-username {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

.il-feed-header-name {
    color: var(--il-text);
    font-weight: 700;
}

.il-feed-header-username {
    color: var(--il-muted);
    font-size: 13px;
}

.il-feed-header-stats {
    display: flex;
    align-items: center;
    gap: 18px;
}

.il-feed-header-stats div {
    text-align: center;
}

.il-feed-header-stats strong,
.il-feed-header-stats span {
    display: block;
}

.il-feed-header-stats strong {
    color: var(--il-text);
    font-size: 15px;
}

.il-feed-header-stats span {
    color: var(--il-muted);
    font-size: 11px;
}

.il-feed-header-follow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 9px 14px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.il-feed-header-follow-icon {
    display: inline-flex;
    color: #fff;
    line-height: 0;
}

.il-feed-header-follow-icon svg {
    display: block;
}

.il-post {
    display: flex;
    flex-direction: column;
    background: var(--il-bg);
    border: 1px solid var(--il-border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.il-post-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
}

.il-post-meta-user {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.il-user {
    font-size: 13px;
    font-weight: 600;
    color: var(--il-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.il-date {
    font-size: 12px;
    color: var(--il-muted);
}

.il-media-link {
    position: relative;
    display: block;
    background: #f8fafc;
}

.il-carousel-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.76);
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
}

.il-carousel-badge span,
.il-carousel-badge span::before {
    display: block;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 2px;
}

.il-carousel-badge span {
    position: relative;
}

.il-carousel-badge span::before {
    content: "";
    position: absolute;
    top: -5px;
    right: -5px;
}

.il-video-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.76);
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
}

.il-video-badge span {
    display: block;
    position: relative;
    width: 16px;
    height: 14px;
    border-radius: 4px;
    background: #fff;
}

.il-video-badge span::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 6px;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 6px solid rgba(15, 23, 42, 0.76);
}

.il-media-link img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.il-post:hover .il-media-link img {
    transform: scale(1.035);
}

.il-media-empty {
    display: grid;
    place-items: center;
    min-height: 180px;
    color: var(--il-muted);
    font-size: 13px;
}

.il-post-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid var(--il-border);
}

.il-post-counters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.il-counter-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid var(--il-border);
    background: #fff;
    font-size: 12px;
    text-decoration: none;
    color: var(--il-text);
}

.il-counter-label {
    color: var(--il-muted);
    font-size: 11px;
}

.il-post-text {
    min-height: calc((13px * 1.5 * 3) + 19px);
    padding: 0 12px 12px;
    font-size: 13px;
    color: #334155;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.il-post-text-spacer {
    height: 10px;
    background: #fff;
}

.il-mobile-grid-next {
    display: none;
}

.il-slider-shell {
    position: relative;
    padding: 0 34px;
}

.il-slider-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
}

.il-slider-track::-webkit-scrollbar {
    display: none;
}

.il-slider-track.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
}

.il-slider-track .il-post {
    flex: 0 0 calc((100% - 48px) / 4);
    max-width: calc((100% - 48px) / 4);
    scroll-snap-align: start;
}

.il-slider-nav {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    top: 45%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 34px;
    min-width: 34px;
    height: 48px;
    border: 0;
    background: transparent;
    color: #333333;
    cursor: pointer;
    z-index: 3;
    line-height: 0;
    padding: 0;
    font-size: 56px;
    font-weight: 500;
    text-shadow: 0 0 1px #fff, 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 0 2px 10px rgba(0, 0, 0, 0.18);
    -webkit-text-stroke: 2px #fff;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.il-feed .il-slider-nav,
.il-feed .il-slider-nav:hover,
.il-feed .il-slider-nav:focus,
.il-feed .il-slider-nav:focus-visible,
.il-feed .il-slider-nav:active {
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.il-slider-nav:focus,
.il-slider-nav:focus-visible,
.il-slider-nav:hover,
.il-slider-nav:active {
    outline: none;
    box-shadow: none;
    background: transparent;
    border: 0;
}

.il-slider-prev {
    left: 14px;
}

.il-slider-next {
    right: 14px;
}

.il-popup[hidden] {
    display: none !important;
}

.il-popup {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 72px 15px 24px;
    box-sizing: border-box;
    overflow-y: auto;
}

.il-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
}

.il-popup-dialog {
    position: relative;
    z-index: 1;
    width: fit-content;
    min-width: min(360px, 100%);
    max-width: min(860px, calc(100vw - 30px));
    max-height: calc(100vh - 96px);
    overflow: auto;
    margin: 0 auto;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--il-border);
    box-shadow: 0 30px 80px rgba(2, 6, 23, 0.25);
}

.il-popup-close {
    position: sticky;
    top: 10px;
    float: right;
    margin: 10px 10px -40px 0;
    border: 1px solid rgba(15, 23, 42, 0.18);
    background: rgba(255, 255, 255, 0.96);
    color: #111827;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.il-popup-media-wrap {
    position: relative;
    min-width: min(320px, calc(100vw - 30px));
    background: #000;
}

.il-popup-media img,
.il-popup-media video {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 62vh;
    margin: 0 auto;
    object-fit: contain;
    background: #000;
}

.il-popup-carousel-nav {
    appearance: none;
    -webkit-appearance: none;
    display: grid;
    place-items: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 34px;
    min-width: 34px;
    height: 64px;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #333333 !important;
    cursor: pointer;
    line-height: 0;
    padding: 0;
    font-size: 64px;
    font-weight: 600;
    text-shadow: 0 0 1px #fff, 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 0 2px 10px rgba(0, 0, 0, 0.18);
    -webkit-text-stroke: 2px #fff;
    -webkit-tap-highlight-color: transparent;
}

.il-popup-carousel-nav:hover,
.il-popup-carousel-nav:focus,
.il-popup-carousel-nav:active,
.il-popup-carousel-nav:focus-visible {
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.il-popup-carousel-nav[hidden] {
    display: none !important;
}

.il-popup-carousel-prev {
    left: 12px;
}

.il-popup-carousel-next {
    right: 12px;
}

.il-popup-carousel-count {
    position: absolute;
    left: 50%;
    bottom: 12px;
    z-index: 2;
    transform: translateX(-50%);
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    pointer-events: none;
}

.il-popup-carousel-count[hidden] {
    display: none !important;
}

.il-popup-content {
    clear: both;
    width: min(520px, calc(100vw - 62px));
    max-width: 100%;
    box-sizing: border-box;
    padding: 14px;
    overflow-wrap: anywhere;
}

.il-popup-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    margin-bottom: 8px;
}

.il-popup-user {
    font-weight: 600;
}

.il-popup-date {
    color: var(--il-muted);
}

.il-popup-text {
    margin: 0 0 10px;
    line-height: 1.6;
    font-size: 14px;
}

.il-popup-counters {
    display: flex;
    gap: 10px;
    color: var(--il-muted);
    font-size: 13px;
    margin-bottom: 12px;
}

.il-popup-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.il-popup-actions a {
    text-decoration: none;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
}

.il-popup-open {
    background: #0f172a;
    color: #fff;
}

.il-popup-like {
    border: 1px solid var(--il-border);
    color: #0f172a;
}

.ilsp-thumb {
    position: relative;
}

.ilsp-carousel-badge {
    position: absolute;
    top: 10px !important;
    right: 10px !important;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.76);
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
    line-height: 1;
    overflow: visible;
}

.ilsp-carousel-badge span,
.ilsp-carousel-badge span::before {
    display: block;
    width: 12px !important;
    min-width: 12px !important;
    max-width: 12px !important;
    height: 12px !important;
    min-height: 12px !important;
    max-height: 12px !important;
    border: 2px solid #fff;
    border-radius: 2px;
    box-sizing: border-box;
    line-height: 1;
}

.ilsp-carousel-badge span {
    position: relative;
}

.ilsp-carousel-badge span::before {
    content: "";
    position: absolute;
    top: -5px;
    right: -5px;
}

.ilsp-video-badge {
    position: absolute;
    top: 10px !important;
    left: 10px !important;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.76);
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
    line-height: 1;
    overflow: visible;
}

.ilsp-video-badge span {
    display: block;
    position: relative;
    width: 16px !important;
    min-width: 16px !important;
    max-width: 16px !important;
    height: 14px !important;
    min-height: 14px !important;
    max-height: 14px !important;
    border-radius: 4px;
    background: #fff;
    box-sizing: border-box;
    line-height: 1;
}

.ilsp-video-badge span::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 6px;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 6px solid rgba(15, 23, 42, 0.76);
}

.ilsp-media-wrap {
    position: relative;
    background: #000;
}

.ilsp-loading {
    display: grid;
    min-height: 220px;
    place-items: center;
    color: #fff;
    font-size: 14px;
}

.ilsp-carousel-nav {
    appearance: none;
    -webkit-appearance: none;
    display: grid;
    place-items: center;
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 34px;
    min-width: 34px;
    height: 64px;
    padding: 0;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #333333 !important;
    cursor: pointer;
    font-size: 64px;
    font-weight: 600;
    line-height: 0;
    text-shadow: 0 0 1px #fff, 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff, 0 2px 10px rgba(0, 0, 0, 0.18);
    transform: translateY(-50%);
    -webkit-text-stroke: 2px #fff;
    -webkit-tap-highlight-color: transparent;
}

.ilsp-carousel-nav:hover,
.ilsp-carousel-nav:focus,
.ilsp-carousel-nav:active,
.ilsp-carousel-nav:focus-visible {
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.ilsp-carousel-nav[hidden] {
    display: none !important;
}

.ilsp-carousel-prev {
    left: 12px;
}

.ilsp-carousel-next {
    right: 12px;
}

.ilsp-carousel-count {
    position: absolute;
    left: 50%;
    bottom: 12px;
    z-index: 2;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    pointer-events: none;
    transform: translateX(-50%);
}

.ilsp-carousel-count[hidden] {
    display: none !important;
}

.il-feed-message {
    margin-top: 12px;
    font-size: 13px;
}

.il-feed-message-error {
    color: #9f1239;
}

.il-feed-message-warning {
    color: #854d0e;
}

@media (max-width: 1024px) {
    .il-feed-grid {
        grid-template-columns: repeat(min(3, var(--il-columns, 3)), minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .il-feed-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .il-feed-header-user {
        flex: 0 0 100%;
        width: 100%;
    }

    .il-feed-header-stats {
        flex: 1 1 0;
        justify-content: space-between;
        min-width: 0;
    }

    .il-feed-header-follow {
        flex: 0 0 auto;
        justify-content: center;
        box-sizing: border-box;
    }

    .il-feed-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .il-slider-shell {
        padding: 0 38px;
    }

    .il-slider-track .il-post {
        flex: 0 0 calc((100% - 32px) / 3);
        max-width: calc((100% - 32px) / 3);
    }

    .il-slider-prev {
        left: 10px;
    }

    .il-slider-next {
        right: 10px;
    }
}

@media (max-width: 560px) {
    .il-feed[data-layout="grid"] .il-mobile-grid-shell {
        position: relative;
    }

    .il-feed[data-layout="grid"] .il-feed-grid {
        display: flex;
        grid-template-columns: none;
        gap: 16px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        padding: 0 42px 8px 0;
        scrollbar-width: none;
    }

    .il-feed[data-layout="grid"] .il-feed-grid::-webkit-scrollbar {
        display: none;
    }

    .il-feed[data-layout="grid"] .il-feed-grid .il-post {
        flex: 0 0 min(82vw, 360px);
        scroll-snap-align: start;
    }

    .il-mobile-grid-next {
        display: grid;
        place-items: center;
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        z-index: 4;
        width: 34px;
        height: 44px;
        border: 1px solid var(--il-border);
        border-radius: 999px;
        background: #fff;
        color: #0f172a;
        font-size: 28px;
        line-height: 1;
        cursor: pointer;
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.14);
    }

    .il-slider-track .il-post {
        flex: 0 0 min(82vw, 360px);
        max-width: min(82vw, 360px);
    }

    .il-slider-shell {
        padding: 0 42px;
    }

    .il-slider-nav {
        font-size: 48px;
    }
}
