.tlp-video-story {
    --tlp-story-accent: #cfff45;
    --tlp-story-ink: #21212d;
    --tlp-story-shadow: rgba(60, 76, 16, 0.24);
    position: fixed;
    right: clamp(16px, 2.5vw, 40px);
    bottom: clamp(16px, 2.5vw, 38px);
    z-index: var(--z-public-floating);
    width: min(410px, calc(100vw - 32px));
    color: var(--tlp-story-ink);
    font-family: Inter, sans-serif;
    pointer-events: none;
}

.tlp-video-story.is-mcp {
    --tlp-story-accent: #e9e7ff;
    --tlp-story-ink: #17152d;
    --tlp-story-shadow: rgba(79, 70, 229, 0.22);
}

.tlp-video-story[hidden] {
    display: none;
}

body.tlp-video-story-visible .back-to-top-wrapper {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.tlp-video-story__teaser {
    position: relative;
    min-height: 94px;
    padding: 10px 52px 10px 10px;
    overflow: hidden;
    background: var(--tlp-story-accent);
    border-radius: 28px;
    box-shadow: 0 18px 48px var(--tlp-story-shadow);
    pointer-events: auto;
}

.tlp-video-story__open {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    width: 100%;
    min-height: 74px;
    padding: 0;
    color: inherit;
    text-align: left;
    background: transparent;
    border: 0;
}

.tlp-video-story__media {
    position: relative;
    display: block;
    width: 112px;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #060606;
    border-radius: 19px;
    transform: translateZ(0);
}

.tlp-video-story__media video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tlp-video-story__play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 36px;
    height: 36px;
    color: #17171d;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    place-items: center;
    transform: translate(-50%, -50%);
    transition:
        transform 180ms cubic-bezier(0.16, 1, 0.3, 1),
        background-color 180ms ease;
}

.tlp-video-story__play svg {
    width: 20px;
    height: 20px;
}

.tlp-video-story__copy {
    display: flex;
    min-width: 0;
    padding-right: 4px;
    flex-direction: column;
    gap: 6px;
}

.tlp-video-story__copy strong {
    max-width: 18ch;
    font-size: 17px;
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.tlp-video-story__copy > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.25;
}

.tlp-video-story__copy svg {
    width: 16px;
    height: 16px;
    flex: none;
    transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tlp-video-story__dismiss,
.tlp-video-story__dialog-close {
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    border-radius: 50%;
    place-items: center;
}

.tlp-video-story__dismiss {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
}

.tlp-video-story__dismiss svg,
.tlp-video-story__dialog-close svg {
    width: 22px;
    height: 22px;
}

.tlp-video-story__open:hover .tlp-video-story__media video {
    transform: scale(1.04);
}

.tlp-video-story__open:hover .tlp-video-story__play {
    background: #fff;
    transform: translate(-50%, -50%) scale(1.08);
}

.tlp-video-story__open:hover .tlp-video-story__copy svg {
    transform: translateX(3px);
}

.tlp-video-story__dismiss:hover {
    background: rgba(33, 33, 45, 0.09);
}

.tlp-video-story__open:focus-visible,
.tlp-video-story__dismiss:focus-visible,
.tlp-video-story__dialog-close:focus-visible {
    outline: 3px solid #ef2b10;
    outline-offset: 3px;
}

.tlp-video-story.is-leaving {
    opacity: 0;
    filter: blur(3px);
    transform: translateY(12px) scale(0.97);
    transition:
        opacity 180ms ease,
        filter 180ms ease,
        transform 180ms ease;
}

.tlp-video-story__dialog {
    width: min(1040px, calc(100vw - 32px));
    width: min(1040px, calc(100vw - 32px), calc(177.78dvh - 150px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    overflow: visible;
    color: #fff;
    background: transparent;
    border: 0;
    pointer-events: auto;
}

.tlp-video-story__dialog:not([open]) {
    display: none;
}

.tlp-video-story__dialog::backdrop {
    background: rgba(6, 6, 6, 0.78);
    backdrop-filter: blur(10px);
}

.tlp-video-story__dialog-surface {
    position: relative;
    padding: 10px 12px 12px;
    overflow: hidden;
    background: #060606;
    border-radius: 16px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
}

.tlp-video-story__dialog-header {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 44px;
    padding: 0 0 10px 8px;
}

.tlp-video-story__player-frame {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
    border-radius: 12px;
}

.tlp-video-story__player-frame video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tlp-video-story__dialog h2 {
    flex: 1;
    min-width: 0;
    margin: 0;
    color: #fff;
    font-family: Inter, sans-serif;
    font-size: clamp(16px, 2vw, 20px);
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.tlp-video-story__dialog-close {
    flex: none;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.tlp-video-story__dialog-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

body.tlp-video-story-open {
    overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
    .tlp-video-story:not([hidden]) {
        animation: tlp-video-story-arrive 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
    }

    .tlp-video-story__dialog[open] .tlp-video-story__dialog-surface {
        animation: tlp-video-story-reveal 380ms cubic-bezier(0.16, 1, 0.3, 1) both;
    }
}

@keyframes tlp-video-story-arrive {
    from {
        opacity: 0.01;
        filter: blur(5px);
        transform: translateY(18px) scale(0.96);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0) scale(1);
    }
}

@keyframes tlp-video-story-reveal {
    from {
        opacity: 0.01;
        clip-path: inset(8% 5% round 22px);
        transform: scale(0.97);
    }
    to {
        opacity: 1;
        clip-path: inset(0 round 16px);
        transform: scale(1);
    }
}

@media (max-width: 575px) {
    .tlp-video-story {
        right: 14px;
        bottom: 14px;
        width: min(350px, calc(100vw - 28px));
    }

    .tlp-video-story__teaser {
        min-height: 82px;
        padding: 8px 48px 8px 8px;
        border-radius: 24px;
    }

    .tlp-video-story__open {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 12px;
        min-height: 66px;
    }

    .tlp-video-story__media {
        width: 92px;
        border-radius: 16px;
    }

    .tlp-video-story__copy {
        gap: 4px;
    }

    .tlp-video-story__copy strong {
        font-size: 15px;
    }

    .tlp-video-story__copy > span {
        font-size: 11.5px;
    }

    .tlp-video-story__play {
        width: 32px;
        height: 32px;
    }

    .tlp-video-story__dialog {
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
    }

    .tlp-video-story__dialog-surface {
        padding: 8px;
    }

    .tlp-video-story__dialog-header {
        gap: 10px;
        padding: 0 0 8px 5px;
    }

    .tlp-video-story__dialog h2 {
        font-size: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tlp-video-story *,
    .tlp-video-story *::before,
    .tlp-video-story *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
