html[data-scene-mode="video"] #main-pages,
html[data-scene-mode="video"] #page-chat {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
}

html[data-scene-mode="video"] #page-chat::before {
    opacity: 0 !important;
    background: transparent !important;
    background-image: none !important;
}

.video-call-overlay {
    position: absolute;
    inset: 0;
    z-index: 1200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.video-call-overlay.active {
    opacity: 1;
    pointer-events: none;
}

.video-floating-window {
    position: absolute;
    top: 84px;
    right: 22px;
    width: min(148px, calc(100vw - 28px));
    border-radius: 22px;
    overflow: hidden;
    background: rgba(9, 12, 19, 0.56);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 38px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    touch-action: none;
    user-select: none;
    cursor: grab;
    pointer-events: auto;
}

.video-floating-window.dragging {
    cursor: grabbing;
    box-shadow: 0 28px 52px rgba(0, 0, 0, 0.34);
}

.video-preview-shell {
    position: relative;
    min-height: 0;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 36%),
        rgba(0, 0, 0, 0.28);
}

.video-overlay-preview-shell {
    width: 100%;
}

.video-local-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.25s ease;
    transform: scaleX(-1);
}

.video-local-preview.active {
    opacity: 1;
}

.video-preview-empty {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8, 10, 16, 0.18), rgba(8, 10, 16, 0.42));
}

.video-preview-empty.hidden {
    display: none;
}

html[data-scene-mode="video"] .chatbox {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    width: min(920px, calc(100% - 32px));
    max-width: 920px;
    height: auto;
    max-height: min(44vh, 420px);
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

html[data-scene-mode="video"] .chatbox.expanded {
    top: auto;
    bottom: 16px;
    left: 50%;
    width: min(920px, calc(100% - 32px));
    max-width: 920px;
    transform: translateX(-50%);
}

html[data-scene-mode="video"] .chatbox.collapsed {
    max-height: none;
}

html[data-scene-mode="video"] #toggleChat {
    display: flex;
    width: 64px;
    height: 16px;
    margin: 0 auto 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(8, 12, 18, 0.62);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

html[data-scene-mode="video"] .chat-toggle-bar {
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
}

html[data-scene-mode="video"] .chatlog,
html[data-scene-mode="video"] .chatbox.expanded .chatlog,
html[data-scene-mode="video"] .chatbox.collapsed .chatlog {
    padding: 14px;
    border-radius: 24px;
    background: transparent !important;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
}

html[data-scene-mode="video"] .message-avatar {
    display: none;
}

html[data-scene-mode="video"] .chatlog > .message.bot,
html[data-scene-mode="video"] .chatlog > .message.user {
    gap: 0;
}

html[data-scene-mode="video"] .chatlog > .message.user {
    justify-content: flex-end;
}

html[data-scene-mode="video"] .chatlog > .message.bot .message-body,
html[data-scene-mode="video"] .chatlog > .message.user .message-body {
    max-width: min(84%, 720px);
}

html[data-scene-mode="video"] .chatlog > .message.bot .message-toolbar,
html[data-scene-mode="video"] .chatlog > .message.user .message-toolbar {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.72);
    opacity: 1;
}

html[data-scene-mode="video"] .chatlog > .message.bot .message-toolbar button,
html[data-scene-mode="video"] .chatlog > .message.user .message-toolbar button {
    color: rgba(255, 255, 255, 0.72);
    opacity: 1;
}

html[data-scene-mode="video"] .chatlog > .message.bot .msg-time,
html[data-scene-mode="video"] .chatlog > .message.user .msg-time {
    color: rgba(255, 255, 255, 0.56);
}

html[data-scene-mode="video"] .chatbox.collapsed .chatlog {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    opacity: 0;
    margin: 0;
    overflow: hidden;
    box-shadow: none;
}

html[data-scene-mode="video"] .inputbox {
    margin-top: 10px;
    background: rgba(8, 12, 18, 0.72) !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.2);
}

@media (max-width: 980px) {
    .video-floating-window {
        top: 76px;
        right: 14px;
        width: min(132px, calc(100vw - 24px));
    }

    html[data-scene-mode="video"] .chatbox {
        width: min(780px, calc(100% - 28px));
    }
}

@media (max-width: 700px) {
    .video-floating-window {
        top: 68px;
        right: 10px;
        width: min(108px, calc(100vw - 20px));
        border-radius: 18px;
    }

    html[data-scene-mode="video"] .chatbox {
        bottom: 10px;
        width: calc(100% - 20px);
        max-height: min(40vh, 340px);
    }

    html[data-scene-mode="video"] #toggleChat {
        width: 58px;
        height: 14px;
        margin-bottom: 6px;
    }
}
