.ak-tube {
    position: relative;
    z-index: 0;
    isolation: isolate;
    contain: layout paint;
    width: var(--ak-tube-width, 100%);
    max-width: var(--ak-tube-max, 1180px);
    margin: 24px auto;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
}

.ak-tube,
.ak-tube * {
    box-sizing: border-box;
}

.ak-tube .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ak-tube__shell {
    position: relative;
    z-index: 0;
    background: #111;
    border-radius: var(--ak-tube-radius, 12px);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

.ak-tube--hub .ak-tube__shell {
    background: #0f0f0f;
    border: 1px solid var(--ak-tube-theme-color, #ff9900);
}

.ak-tube--clean {
    color: #151515;
}

.ak-tube--clean .ak-tube__shell {
    background: #f7f7f7;
    border: 1px solid #e6e6e6;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.ak-tube__stage {
    position: relative;
    z-index: 0;
    aspect-ratio: var(--ak-tube-ratio, 16 / 9);
    background: #050505;
    contain: layout paint;
    overflow: hidden;
    transform: translateZ(0);
}

.ak-tube__loading,
.ak-tube__resume,
.ak-tube__error,
.ak-tube__next-preview {
    position: absolute;
    z-index: 12;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
}

.ak-tube__loading {
    left: 50%;
    top: 50%;
    padding: 9px 12px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    transform: translate(-50%, -50%);
}

.ak-tube__resume {
    left: 50%;
    bottom: 18px;
    min-height: 34px;
    padding: 0 13px;
    border: 1px solid rgba(255, 153, 0, 0.5);
    background: rgba(17, 17, 17, 0.88);
    color: var(--ak-tube-theme-text-color, #ff9900);
    cursor: pointer;
    transform: translateX(-50%);
}

.ak-tube__error {
    left: 14px;
    right: 14px;
    bottom: 14px;
    padding: 10px;
    background: rgba(130, 0, 0, 0.9);
    color: #fff;
}

.ak-tube__next-preview {
    right: 14px;
    bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: min(320px, calc(100% - 28px));
    padding: 8px;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
}

.ak-tube__next-preview img {
    width: 64px;
    height: 42px;
    border-radius: 4px;
    object-fit: cover;
}

.ak-tube__video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    position: relative;
    z-index: 1;
}

.ak-tube__ima {
    position: absolute;
    inset: 0;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    background: #000;
    contain: layout paint;
    overflow: hidden;
}

.ak-tube.is-ad-playing .ak-tube__ima {
    opacity: 1;
    pointer-events: auto;
}

.ak-tube__ima > div,
.ak-tube__ima iframe,
.ak-tube__ima video {
    max-width: 100% !important;
    max-height: 100% !important;
}

.ak-tube__ad-close {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    z-index: 30;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 6px;
    background: rgba(17, 17, 17, 0.88);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.ak-tube__fallback-ad-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.ak-tube__cta {
    position: absolute;
    z-index: 25;
    max-width: min(320px, calc(100% - 28px));
    padding: 9px 12px;
    border-radius: 6px;
    background: rgba(255, 153, 0, 0.95);
    color: #111;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
}

.ak-tube__cta--top {
    left: 50%;
    top: 14px;
    transform: translateX(-50%);
}

.ak-tube__cta--bottom {
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
}

.ak-tube__cta--top-left {
    left: 14px;
    top: 14px;
}

.ak-tube__cta--top-right {
    right: 14px;
    top: 14px;
}

.ak-tube__cta--bottom-left {
    left: 14px;
    bottom: 14px;
}

.ak-tube__cta--bottom-right {
    right: 14px;
    bottom: 14px;
}

.ak-tube__banner-vast {
    position: absolute;
    z-index: 25;
    width: min(468px, calc(100% - 28px));
    color: var(--ak-tube-theme-text-color, #ff9900);
}

.ak-tube__banner-vast-frame {
    min-height: 60px;
    border: 1px solid var(--ak-tube-theme-color, #ff9900);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.72);
    overflow: hidden;
}

.ak-tube__banner-vast-frame iframe {
    display: block;
    width: 100%;
    min-height: 60px;
    border: 0;
}

.ak-tube__banner-vast-frame a,
.ak-tube__banner-vast-frame img {
    display: block;
    max-width: 100%;
}

.ak-tube__banner-vast-frame img {
    width: 100%;
    height: auto;
}

.ak-tube__banner-vast-close {
    display: block;
    width: 100%;
    margin-top: 6px;
    min-height: 28px;
    border: 1px solid rgba(255, 31, 31, 0.55);
    border-radius: 6px;
    background: rgba(17, 17, 17, 0.88);
    color: #ff1f1f;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.ak-tube__banner-vast--top {
    left: 50%;
    top: 14px;
    transform: translateX(-50%);
}

.ak-tube__banner-vast--middle {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.ak-tube__banner-vast--bottom {
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
}

.ak-tube__banner-vast--top-left {
    left: 14px;
    top: 14px;
}

.ak-tube__banner-vast--top-right {
    right: 14px;
    top: 14px;
}

.ak-tube__banner-vast--bottom-left {
    left: 14px;
    bottom: 14px;
}

.ak-tube__banner-vast--bottom-right {
    right: 14px;
    bottom: 14px;
}

.ak-tube__watermark {
    position: absolute;
    top: 16px;
    z-index: 3;
    max-width: 36%;
    object-fit: contain;
    opacity: 0.88;
    pointer-events: none;
}

.ak-tube__watermark--right {
    right: 16px;
}

.ak-tube__watermark--left {
    left: 16px;
}

.ak-tube__ad-badge {
    position: absolute;
    left: 14px;
    top: 14px;
    z-index: 26;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.72);
    color: var(--ak-tube-theme-text-color, #ff9900);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.ak-tube__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 14px;
    background: #151515;
}

.ak-tube__seek-line {
    height: 6px;
    border-top: 1px solid var(--ak-tube-seek-line-outline-color, #111);
    border-bottom: 1px solid var(--ak-tube-seek-line-outline-color, #111);
    background: var(--ak-tube-seek-line-color, #ff9900);
}

.ak-tube--clean .ak-tube__bar {
    background: #fff;
}

.ak-tube__title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: var(--ak-tube-title-color, #fff);
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
}

.ak-tube__title-icon {
    width: var(--ak-tube-title-icon-width, 20px);
    height: var(--ak-tube-title-icon-height, 20px);
    flex: 0 0 var(--ak-tube-title-icon-width, 20px);
    border-radius: 4px;
    object-fit: contain;
}

.ak-tube__title span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ak-tube__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
}

.ak-tube__button {
    min-height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    background: #232323;
    color: #fff;
    font-size: 13px;
    line-height: 1;
}

.ak-tube__icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-height: 34px;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    text-decoration: none;
}

.ak-tube__download svg,
.ak-tube__rate-toggle svg {
    display: block;
    width: 21px;
    height: 21px;
    fill: currentColor;
}

.ak-tube__download svg {
    color: var(--ak-tube-download-icon-color, #ff1f1f);
}

.ak-tube__quality {
    min-height: 32px;
    max-width: 86px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    background: #232323;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.ak-tube__rate {
    position: relative;
}

.ak-tube__rate-toggle {
    gap: 2px;
    width: 54px;
    color: var(--ak-tube-rate-color, #fff);
}

.ak-tube__rate-value {
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.ak-tube__rate-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 7px);
    z-index: 40;
    display: grid;
    min-width: 76px;
    padding: 5px;
    border: 1px solid var(--ak-tube-rate-color, #fff);
    border-radius: 6px;
    background: rgba(17, 17, 17, 0.96);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}

.ak-tube__rate-menu[hidden] {
    display: none;
}

.ak-tube__rate-menu button {
    min-height: 28px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--ak-tube-rate-color, #fff);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.ak-tube__rate-menu button:hover,
.ak-tube__rate-menu button:focus-visible {
    background: var(--ak-tube-rate-color, #fff);
    color: #111;
}

.ak-tube__notice {
    display: none;
    max-width: 240px;
    padding: 7px 9px;
    border: 1px solid rgba(255, 153, 0, 0.32);
    border-radius: 6px;
    background: rgba(255, 153, 0, 0.12);
    color: #ffcf7a;
    font-size: 12px;
    line-height: 1.25;
}

.ak-tube__notice.is-visible {
    display: inline-flex;
}

.ak-tube__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.ak-tube--hub .ak-tube__button:hover,
.ak-tube--hub .ak-tube__button:focus-visible,
.ak-tube--hub .ak-tube__icon-button:hover,
.ak-tube--hub .ak-tube__icon-button:focus-visible {
    border-color: var(--ak-tube-theme-color, #ff9900);
    color: var(--ak-tube-theme-text-color, #ff9900);
}

.ak-tube .ak-tube__rate-toggle,
.ak-tube .ak-tube__rate-toggle:hover,
.ak-tube .ak-tube__rate-toggle:focus,
.ak-tube .ak-tube__rate-toggle:focus-visible,
.ak-tube .ak-tube__rate-toggle[aria-expanded="true"] {
    color: var(--ak-tube-rate-color, #fff);
}

.ak-tube__playlist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.ak-tube__playlist-item {
    position: relative;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 8px;
    border: 1px solid rgba(255, 153, 0, 0.16);
    border-radius: 8px;
    background: #151515;
    color: #fff;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
}

.ak-tube__playlist-item.is-active {
    border-color: var(--ak-tube-theme-color, #ff9900);
    box-shadow: inset 3px 0 0 var(--ak-tube-theme-color, #ff9900);
}

.ak-tube__playlist-item img {
    width: 58px;
    height: 40px;
    border-radius: 5px;
    object-fit: cover;
    background: #050505;
}

.ak-tube__playlist-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
}

.ak-tube__playlist-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.12);
}

.ak-tube__playlist-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--ak-tube-theme-color, #ff9900);
}

.ak-tube-empty {
    padding: 14px;
    border-left: 4px solid var(--ak-tube-theme-color, #ff9900);
    background: #fff7e8;
    color: #442800;
}

.ak-tube-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(0, 0, 0, 0.84);
}

.ak-tube-lightbox[hidden] {
    display: none;
}

.ak-tube-lightbox__inner {
    position: relative;
    width: min(1180px, 96vw);
}

.ak-tube-lightbox .ak-tube {
    margin: 0;
}

.ak-tube-lightbox__close {
    position: absolute;
    right: 0;
    top: -46px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: var(--ak-tube-theme-color, #ff9900);
    color: #111;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 680px) {
    .ak-tube {
        margin: 16px auto;
    }

    .ak-tube__bar {
        align-items: center;
        flex-direction: row;
    }

    .ak-tube__title {
        flex: 1 1 auto;
        white-space: normal;
    }

    .ak-tube__actions {
        display: flex;
        justify-content: flex-end;
        width: auto;
    }

    .ak-tube__button {
        width: 100%;
    }

    .ak-tube__icon-button {
        width: 40px;
    }

    .ak-tube__quality {
        max-width: 74px;
    }

}

@media (max-width: 460px) {
    .ak-tube__actions {
        gap: 0;
    }

    .ak-tube__button {
        grid-column: 1 / -1;
    }
}
