/* Fanxing AI — image generation uses the same compact works feed as video. */

body.chat-shell.workspace-mode-image .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-image .input-container {
    width: min(980px, calc(100% - 48px));
    max-width: 980px;
}

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

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

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

body.chat-shell.workspace-mode-image .reference-stage,
body.chat-shell.workspace-mode-image .reference-stage.has-images {
    top: 11px;
    height: 72px;
}

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

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

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

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

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

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

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

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

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

body.chat-shell.workspace-mode-image .image-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-image .image-work-prompt-message.is-prompt-expanded .message-content {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
}

body.chat-shell.workspace-mode-image .image-work-prompt-message .message-images {
    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-image .image-work-prompt-message .message-img {
    display: block;
    width: 44px;
    height: 56px;
    flex: 0 0 44px;
    margin-left: -10px;
    padding: 2px;
    border: 2px solid rgba(11, 11, 15, 0.96);
    border-radius: 5px;
    object-fit: cover;
    background: #181820;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.32);
    transform: rotate(-4deg);
    transition: transform 0.18s ease;
}

body.chat-shell.workspace-mode-image .image-work-prompt-message .message-img:first-child {
    margin-left: 0;
}

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

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

body.chat-shell.workspace-mode-image .image-work-prompt-message .message-img:hover {
    z-index: 3;
    transform: translateY(-5px) rotate(0deg) scale(1.06);
}

body.chat-shell.workspace-mode-image .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-image .video-prompt-meta > span,
body.chat-shell.workspace-mode-image .video-prompt-meta > button {
    white-space: nowrap;
}

body.chat-shell.workspace-mode-image .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-image .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;
    cursor: pointer;
}

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

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

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

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

body.chat-shell.workspace-mode-image .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;
}

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

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

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

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

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

body.chat-shell.workspace-mode-image .image-result-grid {
    display: grid !important;
    gap: 3px !important;
    width: 100%;
}

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

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

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

body.chat-shell.workspace-mode-image .image-result-grid > .image-grid-item {
    width: auto !important;
    max-width: none !important;
    min-width: 0;
    box-shadow: none;
}

body.chat-shell.workspace-mode-image .image-result-grid .image-result-img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
}

body.chat-shell.workspace-mode-image .image-result-stage .image-loading-placeholder {
    min-height: 0;
    aspect-ratio: 1 / 1;
}

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

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

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

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

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

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

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

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

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