/* assets/css/generator-workspaces.css */

body.creative-workspace-open {
    overflow: hidden;
}

.creative-workspace-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(4, 6, 10, 0);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    opacity: 0;
    transition: opacity 0.22s ease, background 0.22s ease, backdrop-filter 0.22s ease;
    isolation: isolate;
}

.creative-workspace-overlay.is-visible {
    display: flex;
}

.creative-workspace-overlay.is-entered {
    opacity: 1;
    background: rgba(4, 6, 10, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.creative-workspace-shell {
    width: min(1120px, calc(100vw - 48px));
    max-height: min(820px, calc(100vh - 120px));
    max-height: min(820px, calc(100dvh - 120px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.1);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)),
        rgba(15, 16, 22, 0.96);
    box-shadow: 0 28px 90px rgba(0,0,0,0.9);
    opacity: 0;
    transform: translateY(28px) scale(0.96);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

.creative-workspace-overlay.is-entered .creative-workspace-shell {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.creative-workspace-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 28px 18px 28px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.creative-workspace-header-main {
    min-width: 0;
}

.creative-workspace-title {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--color-text-primary);
}

.creative-workspace-subtitle {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--color-text-muted);
}

.creative-workspace-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.creative-workspace-clear-btn,
.creative-workspace-done-btn,
.creative-workspace-close-btn,
.creative-workspace-nav-btn,
.creative-workspace-filter-chip,
.creative-workspace-selected-item,
.creative-workspace-face-card {
    font-family: inherit;
}

.creative-workspace-clear-btn,
.creative-workspace-done-btn {
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: var(--color-text-primary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.creative-workspace-clear-btn:hover,
.creative-workspace-done-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.18);
}

.creative-workspace-done-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.creative-workspace-done-count {
    display: none;
}

.creative-workspace-close-btn {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: var(--color-text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.creative-workspace-close-btn:hover {
    background: rgba(255,74,74,0.18);
    border-color: rgba(255,74,74,0.36);
}

.creative-workspace-close-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.4;
}

.creative-workspace-close-btn-text {
    display: none;
}

.creative-workspace-body {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: 0;
    flex: 1 1 auto;
}

.creative-workspace-nav {
    padding: 20px;
    border-right: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.creative-workspace-nav.is-animating .creative-workspace-nav-btn {
    animation: workspace-fade-up 0.22s ease both;
}

.creative-workspace-nav-btn {
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--color-text-muted);
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    animation: workspace-fade-up 0.22s ease both;
    animation-delay: calc(var(--nav-btn-index, 0) * 0.03s);
}

.creative-workspace-nav-btn:hover {
    color: var(--color-text-primary);
    border-color: rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}

.creative-workspace-nav-btn.is-active {
    color: var(--color-text-primary);
    border-color: rgba(59,156,255,0.32);
    background: rgba(59,156,255,0.12);
    box-shadow: inset 0 0 0 1px rgba(59,156,255,0.08);
}

.creative-workspace-content {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.creative-workspace-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 20px 24px 0 24px;
}

.creative-workspace-filters.is-animating .creative-workspace-filter-chip {
    animation: workspace-fade-up 0.18s ease both;
}

.creative-workspace-filter-chip {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    animation: workspace-fade-up 0.18s ease both;
    animation-delay: calc(var(--filter-chip-index, 0) * 0.025s);
}

.creative-workspace-face-card.is-toggling {
    animation: workspace-card-toggle 0.18s ease;
}

.creative-workspace-filter-chip:hover {
    color: var(--color-text-primary);
    border-color: rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.06);
}

.creative-workspace-filter-chip.is-active {
    color: var(--color-text-primary);
    border-color: rgba(59,156,255,0.3);
    background: rgba(59,156,255,0.12);
}

.creative-workspace-grid-wrapper {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.creative-workspace-nav-arrow {
    display: none;
}

.creative-workspace-pagination {
    display: none;
}

.creative-workspace-grid {
    flex: 1 1 auto;
    min-height: 0;
    padding: 20px 24px 24px;
    display: grid;
    grid-template-columns: repeat(6, 100px);
    grid-auto-rows: 100px;
    justify-content: start;
    gap: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    align-content: start;
    grid-auto-flow: row;
}

.creative-workspace-grid.is-switching .creative-workspace-face-card {
    animation: workspace-grid-in 0.22s ease both;
}

.creative-workspace-face-card {
    position: relative;
    width: 100px;
    height: 100px;
    min-width: 100px;
    min-height: 100px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.creative-workspace-face-card:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(59,156,255,0.55);
}

.creative-workspace-face-card:active {
    transform: scale(0.98);
}

.creative-workspace-face-card.is-selected {
    border-color: rgba(59,156,255,0.95);
    box-shadow: 0 0 0 2px rgba(59,156,255,0.32);
}

.creative-workspace-face-card-glow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(59,156,255,0.1);
    opacity: 0;
    transition: opacity 0.16s ease;
    pointer-events: none;
}

.creative-workspace-face-card.is-selected .creative-workspace-face-card-glow {
    opacity: 1;
}

.creative-workspace-face-thumb {
    position: absolute;
    inset: 0;
    display: block;
    overflow: hidden;
}

.creative-workspace-face-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.creative-workspace-face-card:hover .creative-workspace-face-thumb {
    transform: none;
    filter: none;
}

.creative-workspace-face-card.is-selected .creative-workspace-face-thumb {
    transform: none;
}

@media (max-width: 1100px) and (min-width: 769px) {
    .creative-workspace-grid {
        grid-template-columns: repeat(5, 100px);
    }
}

@media (max-width: 980px) and (min-width: 769px) {
    .creative-workspace-grid {
        grid-template-columns: repeat(4, 100px);
    }
}

@media (max-width: 860px) and (min-width: 769px) {
    .creative-workspace-grid {
        grid-template-columns: repeat(3, 100px);
    }
}

@media (max-width: 768px) {
    .creative-workspace-grid {
        padding: 16px;
        grid-template-columns: repeat(auto-fill, 100px);
        grid-auto-rows: 100px;
        justify-content: center;
        gap: 10px;
    }

    .creative-workspace-face-card {
        width: 100px;
        height: 100px;
        min-width: 100px;
        min-height: 100px;
    }
}

.creative-workspace-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 28px 24px 28px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.creative-workspace-summary {
    min-width: 0;
    flex: 1 1 auto;
}

.creative-workspace-summary-title {
    margin-bottom: 10px;
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.18px;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.creative-workspace-summary-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 54px;
    align-items: flex-start;
    flex: 0 0 auto;
}

.creative-workspace-selected-item {
    position: relative;
    width: 54px;
    height: 54px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    overflow: visible;
    cursor: pointer;
    transform-origin: center;
    animation: workspace-summary-in 0.18s ease both;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.creative-workspace-selected-item:hover {
    transform: translateY(-1px);
    border-color: rgba(255,255,255,0.18);
    box-shadow: 0 8px 20px rgba(0,0,0,0.28);
}

.creative-workspace-selected-thumb {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: left center;
    background-repeat: no-repeat;
    overflow: hidden;
    border-radius: inherit;
}

.creative-workspace-selected-thumb img {
    display: block;
    width: 100%;
    height: auto;
}

.creative-workspace-clear-btn-footer {
    margin-right: 8px;
}

.creative-workspace-clear-btn-footer[hidden] {
    display: none !important;
}

.creative-workspace-selected-remove {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: var(--color-error);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: scale(1);
    transition: background 0.18s ease;
    z-index: 2;
    border: 1px solid rgba(0,0,0,0.5);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.creative-workspace-selected-item:hover .creative-workspace-selected-remove {
    transform: scale(1);
}

.creative-workspace-selected-remove svg {
    width: 8px;
    height: 8px;
    stroke-width: 3;
}

.creative-workspace-empty {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px dashed rgba(255,255,255,0.12);
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
    animation: workspace-fade-up 0.18s ease both;
}

.creative-workspace-footer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    margin-left: 12px;
}

.creative-workspace-summary-count {
    min-width: 44px;
    color: var(--color-blue-bright);
    font-size: 13px;
    font-weight: 800;
    text-align: right;
}

#faces-tool.workspace-enhanced .icon-panel-popup {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

#faces-tool.workspace-enhanced::after {
    display: none !important;
}

@keyframes workspace-fade-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes workspace-grid-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes workspace-card-toggle {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.978);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes workspace-summary-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .creative-workspace-overlay {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
    }

    .creative-workspace-shell {
        width: 100vw;
        max-width: 100vw;
        max-height: 100dvh;
        border-radius: 0;
        transform: translateY(18px) scale(1);
    }

    .creative-workspace-header {
        display: none;
    }

    .creative-workspace-header-main {
        display: none;
    }

    .creative-workspace-actions {
        width: auto;
        margin-left: auto;
        justify-content: flex-end;
        gap: 4px;
    }

    .creative-workspace-close-btn {
        display: none;
    }

    .creative-workspace-close-btn.creative-workspace-close-btn-mobile-inline {
        display: inline-flex;
        order: 99;
        margin-left: auto;
        flex: 0 0 auto;
        width: auto;
        min-width: 0;
        height: 28px;
        padding: 0 10px;
        border-radius: 999px;
        border: 1px solid rgba(255,255,255,0.12);
        background: rgba(255,255,255,0.05);
        color: var(--color-text-primary);
    }

    .creative-workspace-close-btn.creative-workspace-close-btn-mobile-inline:hover {
        background: rgba(255,255,255,0.08);
        border-color: rgba(255,255,255,0.18);
    }

    .creative-workspace-close-btn.creative-workspace-close-btn-mobile-inline svg {
        display: none;
    }

    .creative-workspace-close-btn.creative-workspace-close-btn-mobile-inline .creative-workspace-close-btn-text {
        display: inline;
        font-size: 11px;
        font-weight: 700;
        line-height: 1;
    }

    .creative-workspace-clear-btn {
        display: none;
    }

    .creative-workspace-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
        align-content: start;
        align-items: start;
    }

    .creative-workspace-nav {
        padding: 8px 10px 8px 10px;
        margin-top: 0;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        position: sticky;
        top: 0;
        z-index: 5;
        background: rgba(15, 16, 22, 0.96);
        gap: 6px;
        min-height: 48px;
        align-items: center;
        align-self: start;
    }

    .creative-workspace-nav-btn {
        min-height: 32px;
        padding: 0 12px;
        font-size: 12px;
        border-radius: 999px;
        flex: 0 0 auto;
    }

    .creative-workspace-content {
        min-height: 0;
    }

    .creative-workspace-filters {
        padding: 6px 10px 8px 10px;
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        position: sticky;
        top: 48px;
        z-index: 4;
        background: rgba(15, 16, 22, 0.96);
        gap: 4px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
    }

    .creative-workspace-filters::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .creative-workspace-filter-chip {
        min-height: 20px;
        padding: 0 7px;
        font-size: 9px;
        font-weight: 600;
        border-radius: 999px;
        flex: 0 0 auto;
    }

    .creative-workspace-grid {
        padding: 16px 12px 0;
        grid-template-columns: repeat(3, 100px);
        grid-auto-rows: 100px;
        justify-content: center;
        align-content: start;
        column-gap: 8px;
        row-gap: 8px;
        overflow: hidden;
        touch-action: pan-y;
        width: 100%;
        flex-shrink: 0;
        transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    }

    .creative-workspace-grid.is-swiping {
        transition: none !important;
    }

    .creative-workspace-nav-arrow {
        display: flex;
        position: absolute;
        top: calc(50% - 16px);
        transform: translateY(-50%);
        width: 36px;
        height: 56px;
        background: rgba(0, 0, 0, 0.45);
        color: rgba(255, 255, 255, 0.8);
        border: none;
        align-items: center;
        justify-content: center;
        z-index: 10;
        cursor: pointer;
        transition: all 0.2s ease;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    .creative-workspace-nav-arrow:active {
        background: rgba(0, 0, 0, 0.65);
        color: #fff;
    }

    .creative-workspace-nav-arrow.arrow-prev {
        left: 0;
        border-radius: 0 12px 12px 0;
        border-right: 1px solid rgba(255,255,255,0.1);
        border-top: 1px solid rgba(255,255,255,0.1);
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .creative-workspace-nav-arrow.arrow-next {
        right: 0;
        border-radius: 12px 0 0 12px;
        border-left: 1px solid rgba(255,255,255,0.1);
        border-top: 1px solid rgba(255,255,255,0.1);
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .creative-workspace-nav-arrow:disabled {
        opacity: 0;
        pointer-events: none;
    }

    .creative-workspace-nav-arrow svg {
        width: 22px;
        height: 22px;
    }

    .creative-workspace-pagination {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 12px 0 16px;
        flex: 0 0 auto;
    }

    .creative-workspace-page-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        transition: all 0.2s ease;
        padding: 0;
        border: none;
    }

    .creative-workspace-page-dot.is-active {
        background: var(--color-blue-bright);
        width: 16px;
        border-radius: 4px;
    }

    .creative-workspace-face-card {
        width: 100px;
        height: 100px;
        min-width: 100px;
        min-height: 100px;
        max-width: 100px;
        max-height: 100px;
        aspect-ratio: 1 / 1;
        border-radius: 10px;
    }

    .creative-workspace-footer {
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom)) 12px;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        position: sticky;
        bottom: 0;
        z-index: 3;
        background: rgba(15, 16, 22, 0.96);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .creative-workspace-summary {
        width: auto;
        min-width: 0;
        flex: 1 1 auto;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .creative-workspace-summary-title {
        display: none;
    }

    .creative-workspace-summary-list {
        gap: 6px;
        min-height: 40px;
        overflow-x: auto;
        overflow-y: visible;
        flex-wrap: nowrap;
        padding-top: 6px;
        padding-bottom: 0;
        flex: 1 1 auto;
    }

    .creative-workspace-empty {
        width: auto;
        min-width: 100%;
        box-sizing: border-box;
        text-align: center;
        padding: 10px 12px;
    }

    .creative-workspace-footer-actions {
        width: auto;
        margin-left: 0;
        justify-content: flex-end;
        align-items: center;
        gap: 6px;
        flex: 0 0 auto;
    }

    .creative-workspace-clear-btn-footer {
        margin-right: 0;
        flex: 0 0 auto;
        min-width: 0;
        height: 34px;
        padding: 0 10px;
        font-size: 11px;
    }

    .creative-workspace-done-btn {
        flex: 0 0 auto;
        min-height: 36px;
        padding: 0 12px;
        gap: 6px;
        white-space: nowrap;
    }

    .creative-workspace-done-count {
        display: inline;
        color: var(--color-blue-bright);
        font-weight: 800;
    }

    .creative-workspace-selected-item {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
        border-radius: 10px;
    }

    .creative-workspace-summary-count {
        display: none;
    }
}

body.composition-workspace-open {
    overflow: hidden;
}

.composition-workspace-overlay {
    position: fixed;
    inset: 0;
    z-index: 100050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(4, 6, 10, 0);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    opacity: 0;
    transition: opacity 0.22s ease, background 0.22s ease, backdrop-filter 0.22s ease;
    isolation: isolate;
}

.composition-workspace-overlay.is-visible {
    display: flex;
}

.composition-workspace-overlay.is-entered {
    opacity: 1;
    background: rgba(4, 6, 10, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.composition-workspace-shell {
    width: min(1180px, calc(100vw - 48px));
    max-height: min(840px, calc(100vh - 120px));
    max-height: min(840px, calc(100dvh - 120px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.1);
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)), rgba(15, 16, 22, 0.97);
    box-shadow: 0 28px 90px rgba(0,0,0,0.9);
    opacity: 0;
    transform: translateY(28px) scale(0.96);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

.composition-workspace-overlay.is-entered .composition-workspace-shell {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.composition-workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 28px 18px 28px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.composition-workspace-title {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--color-text-primary);
}

.composition-workspace-panel-tabs {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}

.composition-workspace-panel-tab {
    min-height: 36px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: rgba(255,255,255,0.62);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.composition-workspace-panel-tab:hover {
    color: var(--color-text-primary);
    background: rgba(255,255,255,0.05);
}

.composition-workspace-panel-tab.is-active {
    color: #ffffff;
    border-color: rgba(59,156,255,0.34);
    background: rgba(59,156,255,0.14);
    box-shadow: inset 0 0 0 1px rgba(59,156,255,0.12);
}

.composition-workspace-close-btn,
.composition-workspace-done-btn,
.composition-workspace-category-btn,
.composition-workspace-card,
.composition-workspace-selected-chip {
    font-family: inherit;
}

.composition-workspace-close-btn {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: var(--color-text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.composition-workspace-close-btn:hover {
    background: rgba(255,74,74,0.18);
    border-color: rgba(255,74,74,0.36);
}

.composition-workspace-close-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.4;
}

.composition-workspace-body {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 0;
    flex: 1 1 auto;
}

.composition-workspace-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
}

.composition-workspace-categories {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 16px 14px 18px;
    min-height: 0;
}

.composition-workspace-category-btn {
    min-height: 34px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(255,255,255,0.5);
    text-align: left;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.1;
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.composition-workspace-category-btn:hover {
    color: var(--color-text-primary);
    border-color: rgba(255,255,255,0.16);
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.04));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.035);
}

.composition-workspace-category-btn.is-active {
    color: #ffffff;
    border-color: rgba(59,156,255,0.58);
    background: linear-gradient(180deg, rgba(59,156,255,0.2), rgba(59,156,255,0.12));
    box-shadow: inset 0 0 0 1px rgba(59,156,255,0.16), 0 0 0 1px rgba(59,156,255,0.1), 0 8px 18px rgba(24, 88, 156, 0.16);
}

.composition-workspace-category-btn:focus-visible {
    outline: none;
    color: #ffffff;
    border-color: rgba(59,156,255,0.52);
    background: linear-gradient(180deg, rgba(59,156,255,0.16), rgba(59,156,255,0.1));
    box-shadow: inset 0 0 0 1px rgba(59,156,255,0.14), 0 0 0 1px rgba(59,156,255,0.08);
}

.composition-workspace-preview {
    position: relative;
    flex: 0 0 auto;
    min-height: 0;
    display: inline-flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 4px;
    margin: 0 auto 2px;
    padding: 0;
    width: min(100%, 426px);
    height: auto;
    border-radius: 0;
    border: none;
    background: transparent;
    overflow: visible;
}

.composition-workspace-preview-loader {
    position: absolute;
    inset: 0 0 24px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(0,0,0,0.22);
    z-index: 2;
}

.composition-workspace-preview-media {
    position: relative;
    width: 100%;
    height: 240px;
    aspect-ratio: 16 / 9;
    flex: 0 0 auto;
    min-height: 240px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(0,0,0,0.2);
}

.composition-workspace-preview-empty {
    width: 100%;
    height: 100%;
    min-height: 240px;
    margin: 0 auto;
    border-radius: 12px;
    background:
        radial-gradient(circle at 50% 18%, rgba(59,156,255,0.08), transparent 46%),
        linear-gradient(180deg, rgba(10,12,18,0.42), rgba(10,12,18,0.28));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.composition-workspace-preview-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
    max-width: 220px;
    margin: 0 auto;
}

.composition-workspace-preview-empty-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.82);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03)),
        rgba(16, 20, 30, 0.9);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.06),
        0 10px 26px rgba(0,0,0,0.24),
        0 0 24px rgba(59,156,255,0.08);
}

.composition-workspace-preview-empty-icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.7;
}

.composition-workspace-preview-empty-text {
    font-size: 12px;
    line-height: 1.45;
    font-weight: 600;
    color: rgba(255,255,255,0.58);
    letter-spacing: 0.01em;
}

.composition-workspace-preview-media img,
.composition-workspace-preview-media video {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 240px;
    object-fit: cover;
    margin: 0 auto;
}

.composition-workspace-preview-caption {
    width: 100%;
    font-size: 13px;
    line-height: 1.3;
    color: var(--color-text-primary);
    min-height: 0;
    margin-top: 0;
    text-align: center;
}

.composition-workspace-content {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.composition-workspace-grid {
    flex: 0 0 auto;
    min-height: 0;
    padding: 20px 24px 2px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-content: start;
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden;
}

.composition-workspace-card {
    min-height: 88px;
    padding: 10px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.composition-workspace-card:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.16);
}

.composition-workspace-card.is-selected {
    background: rgba(59,156,255,0.12);
    border-color: rgba(59,156,255,0.42);
}

.composition-workspace-card:not(.is-selected) .composition-workspace-card-preview,
.composition-workspace-card:not(.is-selected) .composition-workspace-card-icon svg {
    filter: grayscale(1) brightness(0.36);
}

.composition-workspace-card.is-selected .composition-workspace-card-preview,
.composition-workspace-card.is-selected .composition-workspace-card-icon svg {
    filter: none;
}

@media (hover: hover) and (min-width: 769px) {
    .composition-workspace-card:hover .composition-workspace-card-preview,
    .composition-workspace-card:hover .composition-workspace-card-icon svg {
        filter: grayscale(0.35) brightness(0.82);
    }
}

.composition-workspace-card-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.composition-workspace-card-icon svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    transition: filter 0.2s ease;
}

.composition-workspace-card-title {
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
    color: var(--color-text-primary);
}

.composition-workspace-card {
    position: relative;
    overflow: hidden;
    justify-content: flex-end;
    padding: 0 !important;
    gap: 0 !important;
}

.composition-workspace-card-icon {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    pointer-events: none;
}

.composition-workspace-card-preview {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
    transition: filter 0.2s ease;
}

.composition-workspace-card-preview-image {
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center 68%;
}

.composition-workspace-card-preview-video {
    background: rgba(255,255,255,0.02);
}

.composition-workspace-card-preview-poster {
    position: absolute;
    inset: 0;
    display: block;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center 68%;
}

.composition-workspace-card-preview-badge {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 2;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(10, 12, 18, 0.78);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

.composition-workspace-card-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    width: 100%;
    margin-top: 0;
    padding: 10px 8px;
    box-sizing: border-box;
    background: linear-gradient(180deg, rgba(10,12,18,0) 0%, rgba(10,12,18,0.82) 58%, rgba(10,12,18,0.94) 100%);
    text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}

.composition-workspace-card-title::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -14px;
    height: 14px;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(10,12,18,0) 0%, rgba(10,12,18,0.32) 100%);
}

.composition-workspace-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 28px 24px 28px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.composition-workspace-summary {
    min-width: 0;
    flex: 1 1 auto;
}

.composition-workspace-summary-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 40px;
    align-items: center;
}

.composition-workspace-summary-list:empty::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
}

.composition-workspace-selected-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    max-width: 100%;
}

.composition-workspace-selected-chip:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.18);
}

.composition-workspace-selected-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
}

.composition-workspace-selected-chip-remove svg {
    width: 10px;
    height: 10px;
    stroke-width: 2.6;
}

.composition-workspace-footer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.composition-workspace-done-btn {
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: var(--color-text-primary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.composition-workspace-done-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.18);
}

@media (min-width: 769px) {
    .video-layout .composition-workspace-body {
        grid-template-columns: 276px minmax(0, 1fr);
    }

    .video-layout .composition-workspace-sidebar {
        justify-content: flex-start;
    }

    .video-layout .composition-workspace-categories {
        gap: 9px;
        padding: 18px 14px 20px;
    }

    .video-layout .composition-workspace-category-btn {
        min-height: 38px;
        padding: 0 15px;
        font-size: 14px;
        border-radius: 14px;
        letter-spacing: -0.01em;
    }

    .video-layout .composition-workspace-content {
        display: grid;
        grid-template-rows: minmax(0, 1fr) auto;
        min-height: 0;
    }

    .video-layout .composition-workspace-grid {
        min-height: 0;
        padding-bottom: 12px;
    }

    .video-layout .composition-workspace-preview {
        margin-top: 0;
        min-height: 188px;
    }

    .video-layout .composition-workspace-preview-media {
        min-height: 148px;
    }

    .video-layout .composition-workspace-preview-empty {
        min-height: 148px;
    }
}

@media (max-width: 1200px) {
    .composition-workspace-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .composition-workspace-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .composition-workspace-overlay {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
    }

    .composition-workspace-shell {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        transform: translateY(18px) scale(1);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        box-sizing: border-box;
    }

    .composition-workspace-header {
        padding: 8px 10px;
        gap: 10px;
        flex: 0 0 auto;
        box-sizing: border-box;
    }

    .composition-workspace-title {
        font-size: 13px;
        line-height: 1.1;
    }

    .composition-workspace-close-btn {
        width: 30px;
        height: 30px;
        flex: 0 0 30px;
    }

    .composition-workspace-close-btn svg {
        width: 12px;
        height: 12px;
        stroke-width: 2.2;
    }

    .composition-workspace-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
        min-height: 0;
        flex: 1 1 auto;
        overflow: hidden;
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .composition-workspace-sidebar {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        background: rgba(15, 16, 22, 0.96);
        min-height: 0;
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .composition-workspace-categories {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 10px 12px;
        gap: 6px;
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .composition-workspace-categories::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .composition-workspace-category-btn {
        min-height: 28px;
        padding: 0 10px;
        border-radius: 999px;
        flex: 0 0 auto;
        font-size: 11px;
    }

    .composition-workspace-content {
        min-width: 0;
        min-height: 0;
        display: grid;
        grid-template-rows: auto auto minmax(0, 1fr);
        overflow: hidden;
        width: 100%;
        box-sizing: border-box;
    }

    .composition-workspace-preview {
        display: flex;
        margin: 8px 12px 12px;
        width: auto;
        min-height: 0;
        min-width: 0;
        flex: 0 0 auto;
        box-sizing: border-box;
        position: relative;
        z-index: 1;
        opacity: 1;
        transform: translateY(0) scale(1);
        transform-origin: top center;
        transition: opacity 0.22s ease, transform 0.22s ease, margin 0.22s ease;
    }

    .composition-workspace-preview.is-hidden {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
        margin-top: 0;
        margin-bottom: 0;
        pointer-events: none;
    }

    .composition-workspace-preview.is-visible {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    .composition-workspace-preview-caption {
        order: 0;
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 3;
        width: 100%;
        margin: 0;
        padding: 10px 12px 9px;
        box-sizing: border-box;
        background: linear-gradient(180deg, rgba(10,12,18,0) 0%, rgba(10,12,18,0.82) 58%, rgba(10,12,18,0.94) 100%);
        text-shadow: 0 1px 2px rgba(0,0,0,0.45);
    }

    .composition-workspace-preview-caption::before {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        top: -14px;
        height: 14px;
        pointer-events: none;
        background: linear-gradient(180deg, rgba(10,12,18,0) 0%, rgba(10,12,18,0.32) 100%);
    }

    .composition-workspace-preview-media {
        order: 0;
    }

    .composition-workspace-preview-empty-state {
        display: none !important;
    }

    .composition-workspace-preview-loader {
        inset: 0 0 24px 0;
    }

    .composition-workspace-preview-media,
    .composition-workspace-preview-empty {
        width: 100%;
        height: auto;
        min-height: 0;
        aspect-ratio: 16 / 9;
        box-shadow: 0 14px 32px rgba(0,0,0,0.32), 0 1px 0 rgba(255,255,255,0.05) inset;
    }

    .composition-workspace-preview-media {
        border: 1px solid rgba(255,255,255,0.08);
    }

    .composition-workspace-preview::after {
        content: '';
        position: absolute;
        left: 8px;
        right: 8px;
        bottom: -10px;
        height: 14px;
        border-radius: 999px;
        background: rgba(0,0,0,0.32);
        filter: blur(10px);
        pointer-events: none;
        z-index: -1;
    }

    .composition-workspace-preview-media img,
    .composition-workspace-preview-media video {
        width: 100%;
        height: 100%;
        max-height: none;
        object-fit: cover;
    }

    .composition-workspace-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: max-content;
        row-gap: 10px;
        column-gap: 10px;
        padding: 0 12px 10px;
        min-height: 0;
        min-width: 0;
        width: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        align-content: start;
        align-items: start;
        box-sizing: border-box;
    }

    .composition-workspace-grid > * {
        min-width: 0;
        min-height: 0;
    }

    .composition-workspace-grid .composition-workspace-card-icon,
    .composition-workspace-grid .composition-workspace-card-preview,
    .composition-workspace-grid .composition-workspace-card-preview-poster {
        inset: 0;
        max-width: 100%;
        max-height: 100%;
    }

    .composition-workspace-grid .composition-workspace-card-title {
        left: 0;
        right: 0;
        bottom: 0;
    }

    .composition-workspace-grid .composition-workspace-card-preview-badge {
        bottom: 6px;
    }

    .composition-workspace-grid .composition-workspace-card {
        margin: 0;
        transform: none;
    }

    .composition-workspace-grid .composition-workspace-card + .composition-workspace-card {
        margin-top: 0;
    }

    .composition-workspace-grid .composition-workspace-card,
    .composition-workspace-grid .composition-workspace-card::before,
    .composition-workspace-grid .composition-workspace-card-icon,
    .composition-workspace-grid .composition-workspace-card-title {
        box-sizing: border-box;
    }

    .composition-workspace-grid .composition-workspace-card-preview-image,
    .composition-workspace-grid .composition-workspace-card-preview-video,
    .composition-workspace-grid .composition-workspace-card-preview-poster {
        width: 100%;
        height: 100%;
    }

    .composition-workspace-card {
        min-height: 0;
        min-width: 0;
        width: 100%;
        height: auto;
        aspect-ratio: auto;
        position: relative;
        overflow: hidden;
        align-self: start;
        display: block;
        isolation: isolate;
    }

    .composition-workspace-card::before {
        content: '';
        display: block;
        width: 100%;
        padding-top: 56.25%;
        pointer-events: none;
    }

    .composition-workspace-card > .composition-workspace-card-icon,
    .composition-workspace-card > .composition-workspace-card-title {
        position: absolute;
    }

    .composition-workspace-card-title {
        padding: 8px 8px 7px;
        font-size: 10px;
        line-height: 1.15;
        min-height: 0;
        max-height: none;
        overflow: hidden;
    }

    .composition-workspace-card-preview-image,
    .composition-workspace-card-preview-poster {
        background-position: center center;
    }

    .composition-workspace-footer {
        padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
        gap: 6px;
        align-items: center;
        flex: 0 0 auto;
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .composition-workspace-summary {
        min-width: 0;
        flex: 1 1 auto;
    }

    .composition-workspace-summary-list {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 0;
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
        gap: 6px;
        min-height: 0;
        align-items: center;
    }

    .composition-workspace-summary-list::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .composition-workspace-selected-chip {
        max-width: 148px;
        flex: 0 0 auto;
        min-height: 28px;
        padding: 0 10px;
        gap: 6px;
        font-size: 11px;
    }

    .composition-workspace-footer-actions {
        flex: 0 0 auto;
        min-width: fit-content;
    }

    .composition-workspace-done-btn {
        height: 32px;
        padding: 0 10px;
        font-size: 11px;
    }
}.infographics-modal-container,
.series-generation-modal-container {
    width: min(1180px, calc(100vw - 48px));
    max-height: min(840px, calc(100vh - 120px));
    max-height: min(840px, calc(100dvh - 120px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 768px) {
    .infographics-modal-container,
    .series-generation-modal-container {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }
}