.ImageManagerPanel {
    display: grid;
    gap: 14px;
}

.IMPanelTrigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    width: fit-content;
    max-width: 100%;
    padding: 0 18px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
    color: var(--MainText1);
    cursor: pointer;
    overflow: hidden;
    box-sizing: border-box;
}

.IMPanelTrigger > span {
    pointer-events: none;
    font-size: 0.94rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.IMPanelTriggerInput {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.IMPanelSummary {
    color: var(--MainText2);
    font-size: 0.9rem;
    line-height: 1.5;
}

.IMPanelList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
    overflow-anchor: none;
}

.IMPanelItem {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #dde5f0;
    background: #f9fbfd;
}

.IMPanelPreviewWrap {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #dde5f0;
}

.IMPanelPreview {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.IMPanelMeta {
    display: grid;
    gap: 4px;
}

.IMPanelMetaPrimary {
    color: var(--MainText1);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.45;
}

.IMPanelMetaSecondary {
    color: var(--MainText2);
    font-size: 0.82rem;
    line-height: 1.45;
    word-break: break-all;
}

.IMPanelMainSelector {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--MainText1);
    font-size: 0.9rem;
    line-height: 1.4;
}

.IMPanelActions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.IMPanelActionButton {
    appearance: none;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #cdd6e2;
    background: #ffffff;
    color: var(--MainText1);
    cursor: pointer;
    font-size: 0.84rem;
    line-height: 1;
}

.IMPanelActionButton:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.IMPanelEmpty {
    padding: 12px;
    border-radius: 10px;
    border: 1px dashed #cad4e1;
    color: var(--SubText1);
    background: #fafbfd;
}

@media (max-width: 720px) {
    .IMPanelTrigger {
        width: 100%;
    }

    .IMPanelList {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .IMPanelActions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .IMPanelActionButton {
        width: 100%;
        padding-inline: 8px;
    }
}

@media (max-width: 520px) {
    .IMPanelList {
        grid-template-columns: 1fr;
    }

    .IMPanelActions {
        grid-template-columns: 1fr;
    }
}
