@charset "UTF-8";

@charset "UTF-8";

/* ==========================================================================
   멀티 비율 이미지 크롭퍼 다크 테마 규격
   ========================================================================== */
.cropper-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 상단 헤더 카드 */
.cropper-header-card {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 22px 28px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    flex-wrap: wrap;
    gap: 16px;
    box-sizing: border-box;
}

.cropper-header-left h3 {
    margin: 0 0 6px 0;
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cropper-header-left p {
    margin: 0 0 4px 0;
    color: #94a3b8;
    font-size: 0.92rem;
    word-break: keep-all;
}

.cropper-safe-badge {
    color: #34d399;
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
}

/* 5:5 대칭 작업 영역 */
.cropper-work-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    align-items: stretch;
}

/* 다크 패널 */
.cropper-panel {
    background: #1e293b;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.cropper-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    min-height: 32px;
}

.cropper-panel-title {
    font-weight: 800;
    color: #f1f5f9;
    font-size: 1.1rem;
    margin: 0;
}

.re-upload-label {
    cursor: pointer;
    font-size: 0.82rem;
    color: #818cf8;
    font-weight: 700;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 5px 12px;
    border-radius: 6px;
    display: none;
    transition: all 0.2s ease;
}

.re-upload-label:hover {
    background: rgba(99, 102, 241, 0.25);
    color: #ffffff;
}

/* 캔버스 및 결과 미디어 박스 */
.cropper-media-box {
    width: 100%;
    height: 450px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}

.crop-source-box {
    background: #07090e;
    cursor: move;
    border: 1px solid rgba(255, 255, 255, 0.08);
    user-select: none;
    touch-action: none; /* 모바일 터치 드래그 시 브라우저 스크롤 간섭 방지 */
}

#cropCanvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: none;
    touch-action: none;
}

.crop-result-box {
    background: #07090e;
    border: 2px dashed rgba(255, 255, 255, 0.12);
}

#croppedResultImg {
    max-width: 100%;
    max-height: 100%;
    display: none;
    object-fit: contain;
}

.cropper-placeholder-text {
    text-align: center;
    color: #64748b;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.cropper-placeholder-text i {
    font-size: 3.2rem;
    margin-bottom: 12px;
    opacity: 0.8;
}

/* 비율 선택기 */
.cropper-ratio-group {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    width: 100%;
}

.btn-cropper-ratio {
    flex: 1;
    height: 44px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-weight: 700;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.88rem;
    white-space: nowrap;
}

.btn-cropper-ratio:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.btn-cropper-ratio.active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

/* 보정 슬라이더 박스 */
.image-editor-box {
    display: none;
    margin-top: 16px;
    background: #0f172a;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.editor-control-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.editor-control-row:last-child {
    margin-bottom: 0;
}

.editor-label {
    width: 60px;
    font-weight: 700;
    font-size: 0.82rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.editor-slider {
    flex: 1;
    cursor: pointer;
    accent-color: #6366f1;
}

/* 하단 액션 버튼 */
.cropper-action-row {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    min-height: 48px;
}

.btn-tool-action {
    flex: 1;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.92rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    padding: 12px 8px;
    box-sizing: border-box;
}

.btn-crop-execute {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-crop-execute:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
}

.btn-crop-execute:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-crop-download {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    display: none;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-crop-download:hover {
    filter: brightness(1.08);
}

.btn-crop-ghost {
    background: #0f172a;
    color: #64748b;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    cursor: default;
}

/* ==========================================================================
   🌟 멀티 크롭퍼 모바일 전용 반응형 (991px 이하)
   ========================================================================== */
@media (max-width: 991px) {
    /* 1. 최외곽 여백 축소 */
    .cropper-container {
        padding: 16px 12px 60px;
    }

    /* 2. 상단 헤더 카드: 세로 정렬 및 가로 터짐 방지 */
    .cropper-header-card {
        flex-direction: column;
        align-items: stretch;
        padding: 18px 14px;
        gap: 14px;
        margin-bottom: 18px;
    }

    .cropper-header-left h3 {
        font-size: 1.2rem;
    }

    .cropper-header-left p {
        font-size: 0.82rem;
    }

    .cropper-header-card > div:last-child {
        width: 100% !important;
        align-items: stretch !important;
    }

    .btn-toolbox-back {
        width: 100%;
        justify-content: center;
        padding: 10px 0;
    }

    /* 🚨 가로 스크롤 터뜨리던 보안 뱃지 줄바꿈 처리 */
    .cropper-safe-badge {
        white-space: normal;
        word-break: keep-all;
        text-align: center;
        justify-content: center;
        width: 100%;
        font-size: 0.74rem;
        line-height: 1.4;
        padding: 8px 10px;
    }

    /* 3. 5:5 대칭 영역 -> 세로 1단 스택 전환 */
    .cropper-work-area {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .cropper-panel {
        padding: 16px 12px;
    }

    .cropper-panel-title {
        font-size: 1rem;
    }

    /* 4. 캔버스/결과 박스 높이 축소 (450px -> 280px) */
    .cropper-media-box {
        height: 280px;
    }

    .cropper-placeholder-text i {
        font-size: 2.5rem;
        margin-bottom: 8px;
    }

    /* 5. 비율 선택 버튼 폰트 및 패딩 축소 */
    .cropper-ratio-group {
        gap: 6px;
    }

    .btn-cropper-ratio {
        height: 40px;
        font-size: 0.78rem;
        padding: 0 4px;
    }

    /* 6. 액션 버튼 터치 규격 최적화 */
    .cropper-action-row {
        height: auto;
        margin-top: 14px;
    }

    .btn-tool-action {
        width: 100%;
        height: 44px;
        font-size: 0.88rem;
    }
}

/* ==========================================================================
   영상 프레임 추출기 다크 테마 규격
   ========================================================================== */
.extractor-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 상단 헤더 카드 */
.extractor-header-card {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 22px 28px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    flex-wrap: wrap;
    gap: 16px;
    box-sizing: border-box;
}

.extractor-header-left h3 {
    margin: 0 0 6px 0;
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.extractor-header-left p {
    margin: 0 0 4px 0;
    color: #94a3b8;
    font-size: 0.92rem;
    word-break: keep-all;
}

.extractor-safe-badge {
    color: #34d399;
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
}

/* 5:5 대칭 작업 레이아웃 */
.extractor-work-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    align-items: stretch;
}

/* 다크 패널 */
.extractor-panel {
    background: #1e293b;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.extractor-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    min-height: 32px;
}

.extractor-panel-title {
    font-weight: 800;
    color: #f1f5f9;
    font-size: 1.1rem;
    margin: 0;
}

.re-upload-label {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.re-upload-label:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: #6366f1;
    color: #ffffff;
}

/* 비디오 & 추출 결과 뷰어 */
.extractor-media-box {
    width: 100%;
    height: 450px;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}

.video-source-box {
    background: #07090e;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.video-source-box:hover {
    border-color: #6366f1;
}

#video {
    max-width: 100%;
    max-height: 100%;
    display: none;
    object-fit: contain;
}

.extractor-result-box {
    background: #07090e;
    border: 2px dashed rgba(255, 255, 255, 0.12);
}

#latestPreviewImg {
    max-width: 100%;
    max-height: 100%;
    display: none;
    object-fit: contain;
}

.extractor-placeholder-text {
    text-align: center;
    color: #64748b;
    pointer-events: none;
    padding: 16px;
}

.extractor-placeholder-text i {
    font-size: 3.2rem;
    display: block;
    margin-bottom: 12px;
    color: #818cf8;
    opacity: 0.8;
}

/* 타임라인 커스텀 슬라이더 */
.slider-container {
    width: 100%;
    margin-top: 16px;
    display: none;
}

.custom-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
}

.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    transition: transform 0.15s ease;
}

.custom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}

/* 이미지 보정 컨트롤 박스 */
.image-editor-box {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
    background: #0f172a;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.editor-control-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.editor-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #94a3b8;
    min-width: 50px;
}

.editor-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #1e293b;
    outline: none;
}

.editor-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #38bdf8;
    cursor: pointer;
}

/* 액션 버튼 그룹 */
.extractor-action-row {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    min-height: 48px;
}

.btn-extractor-action {
    flex: 1;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.86rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    text-decoration: none;
    padding: 12px 8px;
    box-sizing: border-box;
}

.btn-extractor-action:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-first {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.3);
    color: #38bdf8;
}

.btn-first:hover:not(:disabled) {
    background: #0ea5e9;
    color: #ffffff;
}

.btn-current {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-current:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.5);
}

.btn-last {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.btn-last:hover:not(:disabled) {
    background: #10b981;
    color: #ffffff;
}

.btn-extractor-download {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    display: none;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
    font-size: 0.92rem;
}

.btn-extractor-download:hover {
    filter: brightness(1.08);
}

.btn-extractor-ghost {
    background: #0f172a;
    color: #64748b;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    cursor: default;
}

/* 상단 공통 [툴박스 목록] 복귀 버튼 */
.btn-toolbox-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1 !important;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
}

.btn-toolbox-back i {
    font-size: 0.9rem;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.btn-toolbox-back:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff !important;
    transform: translateY(-1px);
}

.btn-toolbox-back:hover i {
    color: #ffffff;
}

/* ==========================================================================
   🌟 영상 프레임 추출기 모바일 전용 반응형 (991px 이하)
   ========================================================================== */
@media (max-width: 991px) {
    /* 1. 최외곽 여백 축소 */
    .extractor-container {
        padding: 16px 12px 60px;
    }

    /* 2. 상단 헤더 카드: 세로 1단 정렬 */
    .extractor-header-card {
        flex-direction: column;
        align-items: stretch;
        padding: 18px 14px;
        gap: 14px;
        margin-bottom: 18px;
    }

    .extractor-header-left h3 {
        font-size: 1.2rem;
    }

    .extractor-header-left p {
        font-size: 0.82rem;
    }

    /* 우측 툴박스 버튼 & 보안 뱃지 감싸는 영역 */
    .extractor-header-card > div:last-child {
        width: 100% !important;
        align-items: stretch !important;
    }

    .btn-toolbox-back {
        width: 100%;
        justify-content: center;
        padding: 10px 0;
    }

    /* 🚨 가로 터짐 유발하던 안전 뱃지 줄바꿈 강제 */
    .extractor-safe-badge {
        white-space: normal;
        word-break: keep-all;
        text-align: center;
        justify-content: center;
        width: 100%;
        font-size: 0.74rem;
        line-height: 1.4;
        padding: 8px 10px;
    }

    /* 3. 5:5 그리드 -> 세로 1단 스택 */
    .extractor-work-area {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .extractor-panel {
        padding: 16px 12px;
    }

    .extractor-panel-title {
        font-size: 1rem;
    }

    /* 4. 미디어 뷰어 높이 모바일 최적화 (450px -> 280px) */
    .extractor-media-box {
        height: 280px;
    }

    .extractor-placeholder-text i {
        font-size: 2.5rem;
        margin-bottom: 8px;
    }

    /* 5. 버튼 그룹: 모바일 한 손 터치 대응 (세로 스택) */
    .extractor-action-row {
        flex-direction: column;
        height: auto;
        gap: 8px;
        margin-top: 14px;
    }

    .btn-extractor-action {
        width: 100%;
        height: 44px;
        font-size: 0.88rem;
    }
}

/* ==========================================================================
   AI 이미지 생성기 레이아웃 & 딥 다크 규격
   ========================================================================== */
.generator-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 상단 타이틀 & 지갑 잔액 헤더 카드 */
.generator-header-card {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 22px 28px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    flex-wrap: wrap;
    gap: 16px;
    box-sizing: border-box;
}

.generator-header-left h3 {
    margin: 0 0 6px 0;
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.generator-header-left p {
    margin: 0;
    color: #94a3b8;
    font-size: 0.92rem;
    line-height: 1.5;
    word-break: keep-all;
}

.generator-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.btn-toolbox-back {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.btn-toolbox-back:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.wallet-badge-box {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-sizing: border-box;
}

.wallet-badge-box strong {
    color: #38bdf8;
    font-size: 1.15rem;
}

/* 4:6 비대칭 워크스페이스 그리드 */
.ai-gen-wrapper {
    display: grid;
    grid-template-columns: 4fr 6fr;
    gap: 24px;
    align-items: stretch;
}

/* 다크 패널 */
.dark-panel {
    background: #1e293b;
    padding: 26px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    color: #f8fafc;
    box-sizing: border-box;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    min-height: 32px;
}

.panel-title {
    font-weight: 800;
    color: #f1f5f9;
    font-size: 1.15rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* I2I 레퍼런스 업로드 박스 */
.upload-reference-box {
    width: 100%;
    min-height: 105px;
    background: #0f172a;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 15px;
    cursor: pointer;
    box-sizing: border-box;
}

.upload-reference-box:hover,
.upload-reference-box.drag-over {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
}

.upload-placeholder {
    text-align: center;
    color: #94a3b8;
    padding: 16px;
    font-size: 0.82rem;
    width: 100%;
}

.upload-placeholder i {
    font-size: 1.7rem;
    display: block;
    margin-bottom: 6px;
    color: #818cf8;
}

.upload-placeholder span {
    font-weight: 600;
    line-height: 1.45;
    word-break: keep-all;
}

.upload-preview-area {
    width: 100%;
    height: 140px;
    position: relative;
    background: #07090e;
}

#referenceThumbnail {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.btn-remove-ref {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(239, 68, 68, 0.9);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

.btn-remove-ref:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* 프롬프트 텍스트에어리어 */
.prompt-box,
#aiPrompt {
    width: 100%;
    height: 140px;
    background-color: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 12px;
    padding: 14px;
    color: #ffffff !important;
    font-size: 0.95rem;
    resize: none;
    transition: all 0.2s ease;
    margin-bottom: 6px;
    box-sizing: border-box;
}

.prompt-box:focus,
#aiPrompt:focus {
    outline: none;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
}

.prompt-box::placeholder,
#aiPrompt::placeholder {
    color: #64748b;
}

/* 옵션 레이블 */
.option-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
}

/* 비율 선택기 */
.ratio-selector-group {
    display: flex;
    gap: 10px;
    width: 100%;
}

.btn-ratio {
    flex: 1;
    height: 44px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.88rem;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-ratio:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.btn-ratio.active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

/* 고급 옵션 박스 */
.adv-options {
    background: #0f172a;
    border-radius: 10px;
    padding: 16px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.dark-panel .studio-select-custom {
    background-color: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #f1f5f9 !important;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    color-scheme: dark;
    font-size: 0.9rem;
}

.dark-panel .studio-select-custom:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
    outline: none !important;
}

/* 생성 실행 버튼 (2분할) */
.btn-sb-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    height: 52px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.btn-sb-split:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
    filter: brightness(1.05);
}

.btn-sb-split:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-sb-split .btn-text {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
    padding: 0 16px;
    white-space: nowrap;
}

.btn-sb-split .btn-badge {
    background: rgba(0, 0, 0, 0.25);
    padding: 0 18px;
    height: 100%;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 800;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    gap: 6px;
    white-space: nowrap;
}

/* 우측 결과물 프리뷰 박스 */
.preview-box {
    width: 100%;
    height: 550px;
    background: #0f172a;
    border-radius: 14px;
    border: 2px dashed rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

#resultImage {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: none;
    border-radius: 8px;
    z-index: 2;
}

.empty-state {
    text-align: center;
    color: #64748b;
    z-index: 1;
    padding: 16px;
}

.empty-state i {
    font-size: 3.8rem;
    margin-bottom: 14px;
    display: block;
    opacity: 0.4;
}

/* 로딩 오버레이 & 스피너 */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(6px);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #818cf8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 18px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: #c4b5fd;
    font-weight: 700;
    font-size: 1rem;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 결과 액션 버튼 그룹 */
.result-actions {
    display: none;
    gap: 14px;
    margin-top: 20px;
}

.btn-action {
    flex: 1;
    height: 48px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.92rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
    box-sizing: border-box;
}

.btn-download {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.btn-download:hover {
    background: #243047;
    color: #ffffff;
}

.btn-save-asset {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-save-asset:hover {
    filter: brightness(1.08);
}

/* ==========================================================================
   🌟 AI 이미지 생성기 모바일 전용 반응형 (991px 이하)
   ========================================================================== */
@media (max-width: 991px) {
    /* 1. 최외곽 여백 축소 */
    .generator-container {
        padding: 16px 12px 60px;
    }

    /* 2. 상단 헤더 카드: 세로 1열 정렬 및 가로 100% 확장 */
    .generator-header-card {
        flex-direction: column;
        align-items: stretch;
        padding: 18px 14px;
        gap: 14px;
        margin-bottom: 18px;
    }

    .generator-header-left h3 {
        font-size: 1.2rem;
    }

    .generator-header-left p {
        font-size: 0.82rem;
    }

    .generator-header-right {
        width: 100%;
        align-items: stretch;
    }

    .btn-toolbox-back {
        width: 100%;
        justify-content: center;
        padding: 10px 0;
    }

    .wallet-badge-box {
        width: 100%;
        justify-content: center;
        padding: 8px 12px;
        font-size: 0.84rem;
    }

    .wallet-badge-box strong {
        font-size: 1.05rem;
    }

    /* 3. 워크스페이스 그리드: 세로 1단 스택 */
    .ai-gen-wrapper {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .dark-panel {
        padding: 16px 12px;
    }

    .panel-title {
        font-size: 1rem;
    }

    /* 4. 프롬프트 및 레퍼런스 박스 높이 보정 */
    .prompt-box,
    #aiPrompt {
        height: 120px;
        font-size: 0.9rem;
        padding: 12px;
    }

    .upload-reference-box {
        min-height: 90px;
    }

    /* 5. 비율 선택 버튼 모바일 컴팩트화 */
    .ratio-selector-group {
        gap: 6px;
    }

    .btn-ratio {
        height: 40px;
        font-size: 0.8rem;
        padding: 0 4px;
    }

    /* 6. 생성 실행 버튼 터치 규격 최적화 */
    .btn-sb-split {
        height: 48px;
    }

    .btn-sb-split .btn-text {
        font-size: 0.92rem;
        padding: 0 10px;
    }

    .btn-sb-split .btn-badge {
        font-size: 0.78rem;
        padding: 0 12px;
    }

    /* 7. 프리뷰 박스 높이 모바일 최적화 (550px -> 320px) */
    .preview-box {
        height: 320px;
    }

    .empty-state i {
        font-size: 2.8rem;
        margin-bottom: 8px;
    }

    /* 8. 결과 액션 버튼 세로 스택 전환 */
    .result-actions {
        flex-direction: column;
        gap: 8px;
        margin-top: 14px;
    }

    .btn-action {
        width: 100%;
        height: 44px;
        font-size: 0.88rem;
    }
}