.sg-tiktok-widget.sgtt {
    --sgtt-bg: #111;
    --sgtt-panel: #242424;
    --sgtt-blue: #1477ff;
    color: #fff;
    font-family: inherit;
    margin: 0 auto;
    max-width: 100%;
    position: relative;
}

.sg-tiktok-widget.sgtt-loading { min-height: 260px; }
.sg-tiktok-widget.sgtt-loading::after {
    animation: sgtt-spin .8s linear infinite;
    border: 3px solid #ddd;
    border-radius: 50%;
    border-top-color: #fe2c55;
    content: '';
    height: 32px;
    left: calc(50% - 16px);
    position: absolute;
    top: 100px;
    width: 32px;
}
.sgtt-error { background: #fff4f4; border: 1px solid #e3b7b7; color: #8a1f1f; padding: 16px; }
.sgtt-title { color: #111; font-size: 24px; margin: 0 0 20px; text-align: center; }

.sgtt-profile {
    align-items: center;
    background: var(--sgtt-bg);
    display: flex;
    gap: 18px;
    justify-content: center;
    min-height: 72px;
    padding: 10px 18px;
}
.sgtt-profile__identity { align-items: center; color: #fff !important; display: flex; gap: 10px; text-decoration: none !important; }
.sgtt-profile__avatar { border-radius: 50%; height: 46px; object-fit: cover; width: 46px; }
.sgtt-profile__names { display: flex; flex-direction: column; font-size: 12px; line-height: 1.35; }
.sgtt-profile__names strong { font-size: 14px; }
.sgtt-verified { align-items: center; background: #20a7f5; border-radius: 50%; color: #fff; display: inline-flex; font-size: 8px; height: 13px; justify-content: center; margin-left: 5px; width: 13px; }
.sgtt-profile__stats { display: flex; gap: 14px; }
.sgtt-profile__stat { align-items: center; display: flex; flex-direction: column; font-size: 13px; line-height: 1.15; }
.sgtt-profile__stat small { color: #aaa; font-size: 10px; }
.sgtt-follow {
    background: var(--sgtt-blue);
    border-radius: 6px;
    color: #fff !important;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 16px;
    text-decoration: none !important;
    white-space: nowrap;
}
.sgtt-follow::before { content: '♪'; margin-right: 6px; }

.sgtt-grid { background: var(--sgtt-bg); display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 8px; }
.sgtt-card { background: #1e1e1e; border-radius: 8px; min-width: 0; overflow: hidden; }
.sgtt-card__media { background: #151515; border: 0; cursor: pointer; display: block; margin: 0; padding: 177.777% 0 0; position: relative; width: 100%; }
.sgtt-card__image { height: 100%; inset: 0; object-fit: cover; position: absolute; transition: transform .25s ease; width: 100%; }
.sgtt-card__media:hover .sgtt-card__image, .sgtt-card__media:focus .sgtt-card__image { transform: scale(1.025); }
.sgtt-card__play { align-items: center; background: rgba(0, 0, 0, .58); border-radius: 50%; color: #fff; display: flex; font-size: 18px; height: 46px; justify-content: center; left: 50%; padding-left: 3px; position: absolute; top: 44%; transform: translate(-50%, -50%); width: 46px; }
.sgtt-card__overlay { background: linear-gradient(transparent, rgba(0, 0, 0, .92)); bottom: 0; color: #fff; display: flex; flex-direction: column; left: 0; padding: 68px 14px 13px; position: absolute; right: 0; text-align: left; }
.sgtt-card__caption { -webkit-box-orient: vertical; -webkit-line-clamp: 3; display: -webkit-box; font-size: 13px; line-height: 1.35; overflow: hidden; }
.sgtt-card__meta { align-items: center; display: flex; font-size: 11px; gap: 8px; margin-top: 9px; }
.sgtt-card__meta small { color: #ccc; }
.sgtt-card__actions { align-items: center; display: flex; font-size: 11px; gap: 12px; margin-top: 10px; }
.sgtt-card__share, .sgtt-modal__share { background: transparent; border: 0; color: #fff; cursor: pointer; font-size: 11px; margin-left: auto; padding: 2px; }
.sgtt-more { background: #fff; border: 1px solid #ddd; color: #222; cursor: pointer; display: block; font-weight: 600; margin: 18px auto 0; min-width: 150px; padding: 10px 18px; }
.sgtt-more[hidden] { display: none; }

body.sgtt-modal-open { overflow: hidden !important; }
.sgtt-modal { background: rgba(0, 0, 0, .82); display: flex; inset: 0; justify-content: center; padding: 8px; position: fixed; z-index: 999999; }
.sgtt-modal__dialog { background: #111; box-shadow: 0 12px 60px rgba(0, 0, 0, .5); max-width: 570px; position: relative; width: 100%; }
.sgtt-modal__close { align-items: center; background: rgba(0, 0, 0, .8); border: 0; border-radius: 50%; color: #fff; cursor: pointer; display: flex; font-size: 26px; height: 36px; justify-content: center; line-height: 1; position: absolute; right: 10px; top: 10px; width: 36px; z-index: 5; }
.sgtt-modal__feed { height: calc(100vh - 16px); overflow-x: hidden; overflow-y: auto; scroll-behavior: smooth; scroll-snap-type: y mandatory; }
.sgtt-modal__post { background: var(--sgtt-panel); color: #fff; min-height: calc(100vh - 16px); scroll-snap-align: start; }
.sgtt-modal__head { align-items: center; display: flex; gap: 10px; min-height: 62px; padding: 9px 56px 9px 16px; }
.sgtt-modal__avatar { border-radius: 50%; height: 36px; object-fit: cover; width: 36px; }
.sgtt-modal__author { display: flex; flex: 1; flex-direction: column; font-size: 12px; min-width: 0; }
.sgtt-modal__author small { color: #bbb; font-size: 10px; }
.sgtt-follow--small { font-size: 11px; padding: 6px 12px; }
.sgtt-modal__player { background: #000; height: min(68vh, 720px); position: relative; }
.sgtt-modal__player iframe { border: 0; height: 100%; inset: 0; position: absolute; width: 100%; }
.sgtt-modal__body { padding: 14px 16px 18px; }
.sgtt-modal__caption { font-size: 14px; line-height: 1.45; margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.sgtt-modal__stats { align-items: center; border-top: 1px solid #3c3c3c; color: #ddd; display: flex; font-size: 12px; gap: 18px; margin-top: 14px; padding-top: 12px; }
.sgtt-copy { left: -9999px; position: fixed; top: -9999px; }

@media (max-width: 1023px) {
    .sgtt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 639px) {
    .sg-tiktok-widget.sgtt { background: #f1f1f1; border-radius: 18px; box-shadow: 0 2px 9px rgba(0, 0, 0, .25); max-width: 340px; overflow: hidden; padding: 16px; }
    .sgtt-title { font-size: 20px; }
    .sgtt-profile { border-radius: 12px; flex-wrap: wrap; gap: 9px 12px; justify-content: flex-start; padding: 12px; }
    .sgtt-profile__identity { flex: 1 1 100%; }
    .sgtt-profile__stats { flex: 1; justify-content: space-around; }
    .sgtt-profile > .sgtt-follow { margin-left: auto; }
    .sgtt-grid { background: transparent; display: grid; gap: 10px; grid-template-columns: 1fr; padding: 10px 0 0; }
    .sgtt-card { border-radius: 7px; }
    .sgtt-card__caption { font-size: 14px; }
    .sgtt-card__overlay { padding-left: 15px; padding-right: 15px; }
    .sgtt-more { margin-bottom: 2px; }
    .sgtt-modal { padding: 0; }
    .sgtt-modal__dialog { max-width: none; }
    .sgtt-modal__feed { height: 100vh; }
    .sgtt-modal__post { min-height: 100vh; }
    .sgtt-modal__player { height: 54vh; }
}

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