.sg-youtube-widget.sgyt {
    --sgyt-red: #ff0000;
    --sgyt-blue: #1473e6;
    --sgyt-text: #161616;
    --sgyt-muted: #666;
    color: var(--sgyt-text);
    font-family: inherit;
    margin: 0 auto;
    max-width: 100%;
    position: relative;
}

.sg-youtube-widget.sgyt-loading {
    min-height: 260px;
}

.sg-youtube-widget.sgyt-loading::after {
    animation: sgyt-spin .8s linear infinite;
    border: 3px solid #ddd;
    border-top-color: var(--sgyt-red);
    border-radius: 50%;
    content: '';
    height: 32px;
    left: calc(50% - 16px);
    position: absolute;
    top: 100px;
    width: 32px;
}

.sgyt-error {
    background: #fff4f4;
    border: 1px solid #e3b7b7;
    color: #8a1f1f;
    padding: 16px;
}

.sgyt-channel {
    background: #f6f6f6;
    margin-bottom: 18px;
    overflow: hidden;
}

.sgyt-channel__banner {
    background-color: #ececec;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    height: 160px;
}

.sgyt-channel__info {
    align-items: center;
    display: flex;
    gap: 16px;
    min-height: 102px;
    padding: 12px 18px;
}

.sgyt-channel__avatar,
.sgyt-modal__avatar,
.sgyt-comment__avatar {
    background: #fff;
    border-radius: 50%;
    object-fit: cover;
}

.sgyt-channel__avatar {
    height: 70px;
    width: 70px;
}

.sgyt-channel__body {
    min-width: 0;
}

.sgyt-channel__title {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.25;
    margin: 0 0 7px;
}

.sgyt-channel__stats {
    color: var(--sgyt-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 0;
}

.sgyt-channel__stats span + span::before {
    content: '·';
    margin: 0 8px;
}

.sgyt-subscribe {
    align-items: center;
    background: var(--sgyt-red);
    border-radius: 2px;
    color: #fff !important;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    margin-left: auto;
    min-height: 30px;
    padding: 0 12px;
    text-decoration: none !important;
    white-space: nowrap;
}

.sgyt-subscribe::before {
    content: '▶';
    font-size: 10px;
    margin-right: 6px;
}

.sgyt-gallery {
    position: relative;
}

.sgyt-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(var(--sgyt-columns, 3), minmax(0, 1fr));
}

.sgyt-card {
    min-width: 0;
}

.sgyt-card__media {
    background: #111;
    border: 0;
    cursor: pointer;
    display: block;
    margin: 0;
    overflow: hidden;
    padding: 56.25% 0 0;
    position: relative;
    width: 100%;
}

.sgyt-card__image {
    height: 100%;
    inset: 0;
    object-fit: cover;
    position: absolute;
    transition: transform .25s ease;
    width: 100%;
}

.sgyt-card__media:hover .sgyt-card__image,
.sgyt-card__media:focus .sgyt-card__image {
    transform: scale(1.02);
}

.sgyt-play {
    align-items: center;
    background: rgba(255, 0, 0, .88);
    border-radius: 9px;
    color: #fff;
    display: flex;
    font-size: 25px;
    height: 48px;
    justify-content: center;
    left: 50%;
    padding-left: 3px;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
}

.sgyt-duration {
    background: rgba(0, 0, 0, .72);
    border-radius: 2px;
    bottom: 5px;
    color: #fff;
    font-size: 12px;
    padding: 2px 4px;
    position: absolute;
    right: 5px;
}

.sgyt-card__title {
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    background: transparent;
    border: 0;
    color: #111;
    cursor: pointer;
    display: -webkit-box;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    margin: 12px 0 5px;
    overflow: hidden;
    padding: 0;
    text-align: left;
    width: 100%;
}

.sgyt-card__date,
.sgyt-card__stats {
    color: var(--sgyt-muted);
    display: block;
    font-size: 11px;
}

.sgyt-card__description {
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    font-size: 12px;
    line-height: 1.45;
    margin: 10px 0;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.sgyt-arrow {
    align-items: center;
    background: rgba(255, 255, 255, .95);
    border: 1px solid #ddd;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
    color: #555;
    cursor: pointer;
    display: flex;
    font-size: 20px;
    height: 40px;
    justify-content: center;
    padding: 0;
    position: absolute;
    top: 30%;
    transform: translateY(-50%);
    width: 40px;
    z-index: 2;
}

.sgyt-arrow--previous {
    left: -16px;
}

.sgyt-arrow--next {
    right: -16px;
}

.sgyt-arrow[hidden] {
    display: none;
}

.sgyt-pagination {
    align-items: center;
    display: flex;
    gap: 5px;
    justify-content: center;
    margin: 42px 0 0;
}

.sgyt-pagination:empty {
    display: none;
}

.sgyt-pagination__button,
.sgyt-pagination__ellipsis {
    align-items: center;
    background: #f6f6f6;
    border: 0;
    color: #aaa;
    display: inline-flex;
    font-size: 11px;
    height: 22px;
    justify-content: center;
    min-width: 22px;
    padding: 0 5px;
}

.sgyt-pagination__button {
    cursor: pointer;
}

.sgyt-pagination__button.is-active {
    color: #222;
    font-weight: 700;
}

body.sgyt-modal-open {
    overflow: hidden !important;
}

.sgyt-modal {
    align-items: flex-start;
    background: rgba(0, 0, 0, .72);
    display: flex;
    inset: 0;
    justify-content: center;
    overflow-y: auto;
    padding: 12px;
    position: fixed;
    z-index: 999999;
}

.sgyt-modal__dialog {
    background: #fff;
    box-shadow: 0 10px 50px rgba(0, 0, 0, .35);
    margin: auto 0;
    max-width: 800px;
    min-height: 200px;
    position: relative;
    width: 100%;
}

.sgyt-modal__close {
    align-items: center;
    background: rgba(44, 44, 44, .72);
    border: 0;
    color: #fff;
    cursor: pointer;
    display: flex;
    font-size: 28px;
    height: 34px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    position: absolute;
    right: -34px;
    top: 0;
    width: 34px;
    z-index: 2;
}

.sgyt-modal__player {
    background: #000;
    padding-top: 56.25%;
    position: relative;
}

.sgyt-modal__player iframe {
    border: 0;
    height: 100%;
    inset: 0;
    position: absolute;
    width: 100%;
}

.sgyt-modal__content {
    padding: 18px;
}

.sgyt-modal__title {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.4;
    margin: 10px 0 20px;
}

.sgyt-modal__summary {
    align-items: center;
    border-bottom: 1px solid #ddd;
    color: #777;
    display: flex;
    font-size: 12px;
    gap: 24px;
    min-height: 36px;
}

.sgyt-modal__share {
    background: transparent;
    border: 0;
    color: #666;
    cursor: pointer;
    font-size: 12px;
    margin-left: auto;
    padding: 8px 0;
    text-transform: uppercase;
}

.sgyt-modal__channel {
    align-items: center;
    display: flex;
    gap: 12px;
    padding: 18px 0 12px;
}

.sgyt-modal__avatar {
    height: 40px;
    width: 40px;
}

.sgyt-modal__channel-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    font-size: 12px;
    min-width: 0;
}

.sgyt-modal__channel-text strong {
    color: #111;
    font-size: 13px;
}

.sgyt-modal__channel-text span {
    color: #777;
    margin-top: 3px;
}

.sgyt-modal__description {
    font-size: 13px;
    line-height: 1.55;
    margin-left: 52px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.sgyt-modal__description.is-collapsed {
    max-height: 62px;
    overflow: hidden;
}

.sgyt-modal__more {
    background: transparent;
    border: 0;
    color: #777;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    margin: 14px 0 14px 52px;
    padding: 0;
    text-transform: uppercase;
}

.sgyt-comments {
    border-top: 1px solid #ddd;
    margin-top: 4px;
    padding-top: 4px;
}

.sgyt-comments__loading,
.sgyt-comments__empty {
    color: #777;
    font-size: 12px;
    padding: 18px 0;
}

.sgyt-comment {
    display: flex;
    gap: 12px;
    padding: 16px 0;
}

.sgyt-comment + .sgyt-comment {
    border-top: 1px solid #eee;
}

.sgyt-comment__avatar {
    height: 38px;
    width: 38px;
}

.sgyt-comment__body {
    flex: 1;
    min-width: 0;
}

.sgyt-comment__heading {
    align-items: baseline;
    display: flex;
    gap: 8px;
}

.sgyt-comment__heading strong {
    font-size: 12px;
}

.sgyt-comment__heading time {
    color: #777;
    font-size: 10px;
}

.sgyt-comment__body p {
    font-size: 12px;
    line-height: 1.45;
    margin: 6px 0 0;
    white-space: pre-wrap;
}

.sgyt-copy-field {
    left: -9999px;
    position: fixed;
    top: -9999px;
}

@media (max-width: 1023px) {
    .sgyt-grid {
        gap: 16px;
    }
}

@media (max-width: 639px) {
    .sgyt-channel {
        min-height: 164px;
        position: relative;
    }

    .sgyt-channel__banner {
        height: 164px;
        opacity: .48;
    }

    .sgyt-channel__info {
        bottom: 0;
        flex-wrap: wrap;
        gap: 8px 10px;
        justify-content: center;
        left: 0;
        min-height: 164px;
        padding: 16px;
        position: absolute;
        right: 0;
        text-align: center;
        top: 0;
    }

    .sgyt-channel__avatar {
        height: 54px;
        width: 54px;
    }

    .sgyt-channel__body {
        flex: 1 1 calc(100% - 72px);
        text-align: left;
    }

    .sgyt-channel__title {
        font-size: 18px;
    }

    .sgyt-channel__stats {
        font-size: 11px;
    }

    .sgyt-channel .sgyt-subscribe {
        margin: 0 auto;
    }

    .sgyt-grid {
        margin: 0 18px;
    }

    .sgyt-card__title {
        -webkit-line-clamp: 1;
        font-size: 13px;
    }

    .sgyt-card__description {
        font-size: 12px;
    }

    .sgyt-arrow {
        height: 38px;
        top: 26%;
        width: 38px;
    }

    .sgyt-arrow--previous {
        left: 0;
    }

    .sgyt-arrow--next {
        right: 0;
    }

    .sgyt-pagination {
        margin-top: 40px;
    }

    .sgyt-modal {
        padding: 0;
    }

    .sgyt-modal__dialog {
        margin: 0;
        max-width: none;
        min-height: 100%;
    }

    .sgyt-modal__close {
        background: rgba(0, 0, 0, .72);
        right: 0;
    }

    .sgyt-modal__content {
        padding: 16px;
    }

    .sgyt-modal__title {
        font-size: 16px;
    }

    .sgyt-modal__channel {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .sgyt-modal__channel .sgyt-subscribe {
        margin: 4px 0 0 52px;
    }

    .sgyt-modal__description,
    .sgyt-modal__more {
        margin-left: 0;
    }
}

@keyframes sgyt-spin {
    to { transform: rotate(360deg); }
}
