/* Fanxing AI — wide video works feed. Loaded last on purpose. */

body.chat-shell.workspace-mode-video .messages-container:not(:has(.model-info-screen)) {
    box-sizing: border-box;
    width: min(100%, 1240px);
    max-width: 1240px;
    padding-right: 28px;
    padding-left: 28px;
}

body.chat-shell.workspace-mode-video .input-container {
    width: min(980px, calc(100% - 48px));
    max-width: 980px;
}

body.chat-shell.workspace-mode-video .chat-input-box {
    max-width: 980px;
}

/* Wider does not mean taller: keep the same idle composer height. */
body.chat-shell.workspace-mode-video .chat-input-box .rich-input,
body.chat-shell.workspace-mode-video .chat-input-box:not(.has-reference-stage) .rich-input.is-empty {
    min-height: 56px;
}

body.chat-shell.workspace-mode-video .chat-input-box.has-reference-stage {
    min-height: 122px;
}

body.chat-shell.workspace-mode-video .chat-input-box.has-reference-stage .rich-input {
    height: 60px;
    min-height: 60px;
}

/* Keep the reference card entirely above the toolbar. */
body.chat-shell.workspace-mode-video .reference-stage,
body.chat-shell.workspace-mode-video .reference-stage.has-images {
    top: 11px;
    height: 72px;
}

body.chat-shell.workspace-mode-video .reference-stage:not(.has-images) .empty-reference-trigger {
    inset: 0 auto auto 13px;
    width: 48px;
    height: 60px;
}

body.chat-shell.workspace-mode-video .reference-stage.has-images .preview-item {
    top: 0;
    width: 52px;
    height: 64px;
}

body.chat-shell.workspace-mode-video .message.video-work-prompt-message,
body.chat-shell.workspace-mode-video .message.assistant.image-result-message {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    padding: 10px 0;
    gap: 0;
    background: transparent;
}

body.chat-shell.workspace-mode-video .message.video-work-prompt-message {
    flex-direction: row;
    padding-bottom: 2px;
}

body.chat-shell.workspace-mode-video .message.video-work-prompt-message > .message-avatar,
body.chat-shell.workspace-mode-video .message.assistant.image-result-message > .message-avatar {
    display: none !important;
}

body.chat-shell.workspace-mode-video .message.video-work-prompt-message .message-body,
body.chat-shell.workspace-mode-video .message.assistant.image-result-message .message-body {
    width: 100%;
    max-width: none;
    align-items: stretch;
}

body.chat-shell.workspace-mode-video .message.video-work-prompt-message .message-bubble {
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body.chat-shell.workspace-mode-video .video-work-prompt-header {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 18px;
    padding: 0 2px;
}

body.chat-shell.workspace-mode-video .video-work-prompt-copy {
    min-width: 0;
    flex: 1 1 auto;
}

body.chat-shell.workspace-mode-video .video-work-prompt-message .message-content {
    display: -webkit-box;
    width: 100%;
    max-width: none;
    overflow: hidden;
    padding: 0;
    border: 0;
    color: rgba(247, 246, 252, 0.94);
    background: transparent;
    box-shadow: none;
    font-size: 14px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

body.chat-shell.workspace-mode-video .video-work-prompt-message.is-prompt-expanded .message-content {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
}

body.chat-shell.workspace-mode-video .video-message-attachments {
    display: flex;
    width: auto;
    max-width: 210px;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 4px 8px 4px 5px;
}

body.chat-shell.workspace-mode-video .video-message-attachment {
    width: 44px;
    height: 56px;
    flex: 0 0 44px;
    margin-left: -10px;
    padding: 2px;
    overflow: hidden;
    border: 2px solid rgba(11, 11, 15, 0.96);
    border-radius: 5px;
    color: rgba(237, 235, 247, 0.72);
    background: #181820;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.32);
    transform: rotate(-4deg);
    transition: transform 0.18s ease, z-index 0.18s ease;
}

body.chat-shell.workspace-mode-video .video-message-attachment:first-child {
    margin-left: 0;
}

body.chat-shell.workspace-mode-video .video-message-attachment:nth-child(even) {
    transform: translateY(-2px) rotate(3deg);
}

body.chat-shell.workspace-mode-video .video-message-attachment:nth-child(3n) {
    transform: translateY(1px) rotate(-1deg);
}

body.chat-shell.workspace-mode-video .video-message-attachment:hover {
    z-index: 4;
    transform: translateY(-5px) rotate(0deg) scale(1.06);
}

body.chat-shell.workspace-mode-video .video-message-attachment img,
body.chat-shell.workspace-mode-video .video-message-attachment video {
    width: 100%;
    height: 100%;
    flex-basis: 100%;
    border-radius: 3px;
    object-fit: cover;
}

body.chat-shell.workspace-mode-video .video-message-attachment-name,
body.chat-shell.workspace-mode-video .video-message-attachment-duration {
    display: none;
}

body.chat-shell.workspace-mode-video .video-message-attachment-type {
    width: 100%;
    height: 100%;
    flex-basis: 100%;
    border-radius: 3px;
}

body.chat-shell.workspace-mode-video .video-prompt-meta {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
    margin-top: 6px;
    color: rgba(206, 203, 220, 0.5);
    font-size: 12.5px;
    font-weight: 400;
    line-height: 22px;
    flex-wrap: wrap;
}

body.chat-shell.workspace-mode-video .video-prompt-meta > span,
body.chat-shell.workspace-mode-video .video-prompt-meta > button {
    white-space: nowrap;
}

body.chat-shell.workspace-mode-video .video-prompt-meta i {
    width: 1px;
    height: 11px;
    flex: 0 0 1px;
    border-radius: 0;
    background: currentColor;
    opacity: 0.38;
}

body.chat-shell.workspace-mode-video .video-prompt-details-toggle {
    display: inline-flex;
    height: 22px;
    align-items: center;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    line-height: 22px;
    vertical-align: middle;
    cursor: pointer;
}

body.chat-shell.workspace-mode-video .video-prompt-details-icon {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    margin-left: 3px;
    opacity: 0.68;
}

body.chat-shell.workspace-mode-video .video-prompt-details-toggle:hover {
    color: #a99fff;
}

body.chat-shell.workspace-mode-video .video-prompt-details-toggle:hover .video-prompt-details-icon {
    opacity: 1;
}

body.chat-shell.workspace-mode-video .video-prompt-inline-actions {
    display: inline-flex;
    height: 22px;
    align-items: center;
    gap: 3px;
    margin-left: 2px;
    vertical-align: middle;
    opacity: 0;
    transform: translateX(-3px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

body.chat-shell.workspace-mode-video .video-work-prompt-message:hover .video-prompt-inline-actions,
body.chat-shell.workspace-mode-video .video-work-prompt-message:focus-within .video-prompt-inline-actions {
    opacity: 1;
    transform: translateX(0);
}

body.chat-shell.workspace-mode-video .video-prompt-inline-actions .msg-action-btn {
    display: inline-flex;
    min-width: 0;
    height: 22px;
    min-height: 22px;
    align-items: center;
    padding: 0 5px;
    gap: 3px;
    border: 0;
    border-radius: 5px;
    color: rgba(215, 212, 229, 0.58);
    background: transparent;
    box-shadow: none;
    font-size: 12px;
    font-weight: 400;
    line-height: 22px;
    vertical-align: middle;
}

body.chat-shell.workspace-mode-video .video-prompt-inline-actions .msg-action-btn svg {
    display: block;
    flex: 0 0 13px;
}

body.chat-shell.workspace-mode-video .video-prompt-inline-actions .msg-action-btn:hover {
    color: #b6adff;
    background: rgba(124, 108, 255, 0.1);
}

body.chat-shell.workspace-mode-video .video-work-prompt-message .message-footer {
    min-height: 24px;
    padding: 5px 0 0;
    opacity: 0;
    transition: opacity 0.18s ease;
}

body.chat-shell.workspace-mode-video .video-work-prompt-message:hover .message-footer,
body.chat-shell.workspace-mode-video .video-work-prompt-message:focus-within .message-footer {
    opacity: 1;
}

body.chat-shell.workspace-mode-video .message.assistant.image-result-message {
    margin: 0 0 24px !important;
    padding-top: 0;
}

body.chat-shell.workspace-mode-video .messages-container > .video-work-prompt-message + .image-result-message {
    margin-top: 0 !important;
}

body.chat-shell.workspace-mode-video .video-result-group-card,
body.chat-shell.workspace-mode-video .image-result-group-card {
    width: 100%;
}

body.chat-shell.workspace-mode-video .video-result-group-card.is-single,
body.chat-shell.workspace-mode-video .image-result-group-card.is-single,
body.chat-shell.workspace-mode-video .video-result-stage,
body.chat-shell.workspace-mode-video .image-result-stage {
    width: min(540px, 100%);
    margin: 0;
}

body.chat-shell.workspace-mode-video .video-result-stage .video-grid-item,
body.chat-shell.workspace-mode-video .image-result-stage .image-grid-item {
    width: 100%;
    max-width: 100%;
}

body.chat-shell.workspace-mode-video .video-result-grid,
body.chat-shell.workspace-mode-video .image-result-grid {
    gap: 3px !important;
}

body.chat-shell.workspace-mode-video .video-result-grid.video-grid-4,
body.chat-shell.workspace-mode-video .image-result-grid.image-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

body.chat-shell.workspace-mode-video .video-result-grid.video-grid-3,
body.chat-shell.workspace-mode-video .image-result-grid.image-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

body.chat-shell.workspace-mode-video .video-result-grid.video-grid-2,
body.chat-shell.workspace-mode-video .image-result-grid.image-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

body.chat-shell.workspace-mode-video .video-grid-item,
body.chat-shell.workspace-mode-video .video-loading-placeholder,
body.chat-shell.workspace-mode-video .image-loading-tile {
    min-width: 0;
    overflow: hidden;
    border-radius: 2px !important;
    box-shadow: none;
    aspect-ratio: 16 / 9 !important;
}

body.chat-shell.workspace-mode-video .video-result-stage .video-wrapper,
body.chat-shell.workspace-mode-video .video-result-grid .video-wrapper {
    height: 100%;
    aspect-ratio: auto;
}

body.chat-shell.workspace-mode-video .video-loading-placeholder,
body.chat-shell.workspace-mode-video .image-loading-placeholder,
body.chat-shell.workspace-mode-video .image-loading-tile {
    background:
        radial-gradient(circle at 72% 30%, rgba(105, 193, 232, 0.16), transparent 38%),
        radial-gradient(circle at 22% 76%, rgba(120, 100, 238, 0.18), transparent 42%),
        linear-gradient(135deg, #171923, #101117 64%, #151722) !important;
}

body.chat-shell.theme-light.workspace-mode-video .video-work-prompt-message .message-content {
    color: rgba(31, 29, 42, 0.92);
}

body.chat-shell.theme-light.workspace-mode-video .video-prompt-meta {
    color: rgba(76, 74, 88, 0.72);
}

body.chat-shell.theme-light.workspace-mode-video .video-prompt-details-toggle {
    color: inherit;
}

body.chat-shell.theme-light.workspace-mode-video .video-prompt-inline-actions .msg-action-btn {
    color: rgba(76, 74, 88, 0.76);
}

body.chat-shell.theme-light.workspace-mode-video .video-prompt-inline-actions .msg-action-btn:hover {
    color: #4f3fb2;
    background: rgba(105, 85, 219, 0.08);
}

body.chat-shell.theme-light.workspace-mode-video .video-message-attachment {
    border-color: rgba(248, 249, 252, 0.98);
    background: #eef0f5;
    box-shadow: 0 5px 14px rgba(44, 39, 72, 0.14);
}

body.chat-shell.theme-light.workspace-mode-video .video-loading-placeholder,
body.chat-shell.theme-light.workspace-mode-video .image-loading-placeholder,
body.chat-shell.theme-light.workspace-mode-video .image-loading-tile {
    background:
        radial-gradient(circle at 72% 30%, rgba(97, 182, 235, 0.24), transparent 40%),
        radial-gradient(circle at 22% 76%, rgba(142, 119, 244, 0.2), transparent 44%),
        linear-gradient(135deg, #e8eef8, #edf8fb 62%, #eef0fa) !important;
}

@media (max-width: 820px) {
    body.chat-shell.workspace-mode-video .messages-container:not(:has(.model-info-screen)) {
        padding-right: 14px;
        padding-left: 14px;
    }

    body.chat-shell.workspace-mode-video .input-container {
        width: calc(100% - 24px);
    }

    body.chat-shell.workspace-mode-video .video-work-prompt-header {
        align-items: flex-start;
        gap: 10px;
    }

    body.chat-shell.workspace-mode-video .video-message-attachments {
        max-width: 102px;
        padding-right: 2px;
    }

    body.chat-shell.workspace-mode-video .video-message-attachment:nth-child(n + 4) {
        display: none;
    }

    body.chat-shell.workspace-mode-video .video-result-grid.video-grid-3,
    body.chat-shell.workspace-mode-video .video-result-grid.video-grid-4,
    body.chat-shell.workspace-mode-video .image-result-grid.image-grid-3,
    body.chat-shell.workspace-mode-video .image-result-grid.image-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 520px) {
    body.chat-shell.workspace-mode-video .video-prompt-meta span:nth-of-type(n + 4),
    body.chat-shell.workspace-mode-video .video-prompt-meta i:nth-of-type(n + 3) {
        display: none;
    }
}
