*{box-sizing:border-box}
html,body{margin:0;background:#090a0b;color:#f3f5f7;font-family:Arial,"Noto Sans KR",sans-serif}
button,select,textarea{font:inherit}a{color:inherit}
.studio-page{max-width:1500px;margin:auto;padding:0 16px 70px}

.video-subnav{display:flex;align-items:center;justify-content:center;gap:42px;min-height:96px;padding:18px 0;border-bottom:1px solid #1c2024}
.video-subnav a,.video-subnav button{border:0;background:transparent;color:#b8bec6;text-decoration:none;font-weight:700;font-size:15px;cursor:pointer;padding:12px 4px;white-space:nowrap}
.video-subnav a:hover,.video-subnav button:hover{color:#fff}
.video-subnav a.active{color:#fff;padding:12px 28px;border:1px solid #3975c9;border-radius:28px;background:#17263a}

.image-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(420px,1fr);gap:24px;margin-top:24px}
.image-generator-panel,.image-result-panel{border:1px solid #2a3036;border-radius:16px;background:#101316;padding:24px}
.image-result-panel{min-height:700px}
.panel-header,.result-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:28px}
.panel-header h1,.result-header h2{margin:0;font-size:22px}
.panel-header p{margin:8px 0 0;color:#8f98a3;font-size:14px}
.credit-box{min-width:125px;padding:11px 14px;border:1px solid #2d3947;border-radius:10px;background:#171b20;text-align:right}
.credit-box span{display:block;color:#8e98a3;font-size:12px}
.credit-box strong{font-size:18px}.form-section{transform: translate(0px, 15px); margin-bottom:26px}
.form-section>label,.label-row label{display:block;margin-bottom:10px;color:#e7ebef;font-size:14px;font-weight:700}
.label-row{display:flex;justify-content:space-between}
.label-row span{color:#68727d;font-size:12px}
select{width:100%;height:46px;padding:0 13px;color:#f0f3f6;background:#1a1f24;border:1px solid #39414a;border-radius:9px}
textarea{width:100%;min-height:180px;resize:vertical;padding:15px;color:#f1f4f7;background:#171b1f;border:1px solid #343b43;border-radius:10px;outline:none;line-height:1.7}
textarea::placeholder{color:#66717c}
.input-guide{margin:8px 2px;color:#6e7883;font-size:12px;line-height:1.55}
.option-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}
.option-button,.size-button{border:1px solid #333b43;background:#171c20;color:#cfd5db;border-radius:9px;cursor:pointer}
.option-button{min-height:72px;padding:8px 5px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px}
.option-button.selected,.size-button.selected{border-color:#3975c9;background:#17263a;color:#fff}
.ratio-preview{display:block;border:1px solid #87919b;border-radius:2px}.r11{width:22px;height:22px}
.r169{width:30px;height:17px}.r916{width:17px;height:30px}
.r43{width:27px;height:20px}
.r34{width:20px;height:27px}
.r32{width:30px;height:20px}.r23{width:20px;height:30px}
.r219{width:34px;height:15px}.r45{width:20px;height:25px}
.r54{width:25px;height:20px}
.option-button strong{font-size:12px}
.size-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.size-button{min-height:66px;padding:10px}
.size-button strong{display:block;font-size:15px;margin-bottom:4px}
.size-button span{color:#818b96;font-size:11px}
.generation-summary{display:grid;grid-template-columns:repeat(3,1fr);border:1px solid #293039;border-radius:10px;background:#15191d;margin-bottom:14px}
.generation-summary>div{padding:13px 12px;border-right:1px solid #293039}
.generation-summary>div:last-child{border:0}
.generation-summary span{display:block;color:#7d8792;font-size:11px;margin-bottom:5px}
.generation-summary strong{font-size:14px}
.generate-button{width:100%;height:52px;border:1px solid #3f7bcf;border-radius:10px;background:#1b5da8;color:#fff;font-size:15px;font-weight:700;cursor:pointer}
.generate-button:disabled{opacity:.55;cursor:wait}
.status-message{margin-top:12px;padding:12px 14px;border-radius:9px;border:1px solid #303840;background:#171c20;color:#aeb7c0;font-size:13px}
.status-message.error{border-color:#704047;color:#f0b4bc;background:#211619}
.empty-result{min-height:570px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:#707a85;border:1px dashed #30373e;border-radius:12px;background:#0d1012;padding:30px}.empty-result strong{color:#aeb5bc;margin-bottom:8px}
.empty-result span{font-size:13px}.empty-icon{width:58px;height:58px;display:flex;align-items:center;justify-content:center;margin-bottom:18px;border:1px solid #38424d;border-radius:50%;color:#a6c8f2;font-size:25px}
.result-image-wrap{width:100%;min-height:300px;display:flex;align-items:center;justify-content:center;overflow:hidden;border-radius:12px;background:#080a0c;border:1px solid #2a3036}
.result-image-wrap img{display:block;max-width:100%;max-height:570px;object-fit:contain}
.result-info{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:12px}
.result-meta{padding:10px 12px;border:1px solid #2a3036;border-radius:8px;background:#15191d}
.result-meta span{display:block;color:#717b86;font-size:11px;margin-bottom:4px}
.result-meta strong{font-size:13px}.result-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.primary-button,.secondary-button{height:46px;display:flex;align-items:center;justify-content:center;border-radius:9px;text-decoration:none;font-size:14px;font-weight:700}
.primary-button{border:1px solid #3f7bcf;background:#1b5da8}.secondary-button{border:1px solid #3b444d;background:#1a1f24}
.retention-info{margin:10px 2px 0;color:#69737e;font-size:11px}@media(max-width:1000px)
{.image-workspace{grid-template-columns:1fr}}@media(max-width:720px)
{.studio-page{padding:0 10px 50px}
.video-subnav{justify-content:flex-start;gap:20px;overflow-x:auto}
.video-subnav a,.video-subnav button{font-size:13px}
.image-generator-panel,.image-result-panel{padding:17px}
.panel-header{flex-direction:column}
.credit-box{width:100%;text-align:left}
.option-grid{grid-template-columns:repeat(3,1fr)}}@media(max-width:440px)
{.option-grid{grid-template-columns:repeat(2,1fr)}
.size-grid,.result-actions{grid-template-columns:1fr}
.result-info{grid-template-columns:1fr}}





.image-credit-info {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    width: 100%;
    box-sizing: border-box;
    white-space: normal;
    transform: none;
    flex-wrap: wrap;
}

.image-credit-info span {
    display: inline;
    color: #8e98a3;
    font-size: 12px;
}

.image-credit-info strong {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
}



.image-history-section {
    margin-top: 32px;
}

.image-history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 16px;

    transform: translate(0px, -5px);
}

.image-history-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
}

.image-history-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #f5f5f5;
    border-radius: 8px;
}

.image-history-prompt {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;

    line-clamp: 3;
    -webkit-line-clamp: 3;

    overflow-wrap: anywhere;
}

.image-history-details,
.image-history-card .retention-info {
    font-size: 13px;
    color: #666;
}

.image-history-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.image-history-actions button,
.image-history-actions a {
    flex: 1;
    padding: 8px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #222;
    text-decoration: none;
    cursor: pointer;
}



/* 생성 이미지 목록: 세로 1열 */
.image-history-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    width: 100%;
    margin-top: 16px;
}

/* 이미지 카드: 어두운 테마 */
.image-history-card {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: 16px;
    border: 1px solid #30343b;
    border-radius: 12px;
    background: #17191d;
    color: #f1f3f5;
}

/* 이미지 */
.image-history-card img {
    display: block;
    width: 100%;
    max-height: 520px;
    aspect-ratio: auto;
    object-fit: contain;
    background: #0d0f12;
    border-radius: 8px;
}

/* 프롬프트 */
.image-history-prompt {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    overflow-wrap: anywhere;
    color: #e1e5eb;
    line-height: 1.6;
}

/* 해상도 및 다운로드 기간 */
.image-history-details,
.image-history-card .retention-info {
    color: #aab2bf;
    font-size: 13px;
}

/* 버튼 */
.image-history-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.image-history-actions button,
.image-history-actions a {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #414751;
    border-radius: 7px;
    background: #242830;
    color: #f1f3f5;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.image-history-actions button:hover,
.image-history-actions a:hover {
    background: #323844;
}



#emptyResult[hidden],
#resultContent[hidden] {
    display: none !important;
}







/* ============================================================
   영상 업로드 팝업
============================================================ */

#uploadDialog {
    width: 100%;
    max-width: 560px;
    max-height: 90vh;

    margin: auto;
    padding: 0;

    border: 1px solid #333;
    border-radius: 18px;

    background: #171717;
    color: #f5f5f5;

    overflow: hidden;

    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.65);
}


/* 바깥 배경 */

#uploadDialog::backdrop {
    background: rgba(0, 0, 0, 0.78);
}


/* ============================================================
   팝업 내부
============================================================ */

#uploadDialog .upload-panel {
    position: relative;

    width: 100%;
    box-sizing: border-box;

    margin: 0;
    padding: 26px;

    background: #171717;
    color: #f5f5f5;
}


/* ============================================================
   닫기
============================================================ */

#uploadDialog .dialog-close {
    position: absolute;

    top: 16px;
    right: 16px;

    width: 34px;
    height: 34px;

    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #383838;
    border-radius: 50%;

    background: #222;
    color: #ddd;

    font-size: 22px;
    line-height: 1;

    cursor: pointer;
}

#uploadDialog .dialog-close:hover {
    background: #303030;
    color: #fff;
}


/* ============================================================
   제목
============================================================ */

#uploadDialog .upload-header {
    padding-right: 45px;
    margin-bottom: 22px;
}

#uploadDialog .upload-eyebrow {
    margin-bottom: 7px;

    color: #888;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.4px;
}

#uploadDialog h2 {
    margin: 0 0 7px;

    color: #fff;

    font-size: 24px;
    line-height: 1.25;
}

#uploadDialog .upload-header p {
    margin: 0;

    color: #999;

    font-size: 13px;
    line-height: 1.5;
}


/* ============================================================
   섹션
============================================================ */

#uploadDialog .upload-section {
    margin-bottom: 18px;
}

#uploadDialog .upload-section h3 {
    margin: 0 0 9px;

    color: #ddd;

    font-size: 13px;
    font-weight: 700;
}


/* ============================================================
   파일 Drop Zone
============================================================ */

#uploadDialog .upload-dropzone {
    position: relative;

    width: 100%;
    min-height: 145px;

    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 20px;

    border: 1px dashed #444;
    border-radius: 12px;

    background: #202020;

    color: #ddd;

    cursor: pointer;

    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}

#uploadDialog .upload-dropzone:hover {
    border-color: #666;
    background: #252525;
}

#uploadDialog .upload-dropzone.dragover {
    border-color: #888;
    background: #292929;
}


/* 아이콘 */

#uploadDialog .upload-drop-icon {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 9px;

    border: 1px solid #444;
    border-radius: 10px;

    background: #292929;

    color: #ddd;

    font-size: 22px;
}


/* 파일 설명 */

#uploadDialog .upload-dropzone strong {
    margin-bottom: 5px;

    color: #eee;

    font-size: 14px;
}

#uploadDialog .upload-dropzone span {
    color: #999;

    font-size: 12px;
}

#uploadDialog .upload-dropzone small {
    margin-top: 7px;

    color: #666;

    font-size: 11px;
}


/* 파일명 */

#uploadDialog .upload-dropzone em {
    display: block;

    max-width: 90%;

    margin-top: 8px;

    overflow: hidden;

    color: #ccc;

    font-size: 12px;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ============================================================
   영상 종류 select
============================================================ */

#uploadDialog .upload-select {
    width: 100%;
    height: 42px;

    box-sizing: border-box;

    padding: 0 12px;

    border: 1px solid #383838;
    border-radius: 9px;

    background: #222;
    color: #eee;

    font-size: 13px;

    outline: none;
}

#uploadDialog .upload-select:focus {
    border-color: #666;
}

#uploadDialog .upload-select option {
    background: #222;
    color: #eee;
}


/* ============================================================
   업로드 비용
============================================================ */

#uploadDialog .upload-payment-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 10px;
}


/* 결제 카드 */

#uploadDialog .payment-card {
    display: block;

    margin: 0;
    padding: 0;

    cursor: pointer;
}


/* 실제 radio 숨김 */

#uploadDialog .payment-card > input {
    position: absolute;

    opacity: 0;
    pointer-events: none;
}


/* 카드 */

#uploadDialog .payment-card-inner {
    min-height: 66px;

    box-sizing: border-box;

    display: flex;
    align-items: center;

    padding: 13px 14px;

    border: 1px solid #363636;
    border-radius: 11px;

    background: #202020;

    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}


/* hover */

#uploadDialog .payment-card:hover .payment-card-inner {
    background: #272727;
    border-color: #505050;
}


/* 선택 */

#uploadDialog .payment-card > input:checked
    + .payment-card-inner {
    background: #292929;
    border-color: #777;
}


/* radio */

#uploadDialog .payment-radio {
    width: 17px;
    height: 17px;

    flex: 0 0 17px;

    margin-right: 10px;

    box-sizing: border-box;

    border: 2px solid #666;
    border-radius: 50%;
}


/* 선택된 radio */

#uploadDialog .payment-card > input:checked
    + .payment-card-inner
    .payment-radio {
    border: 5px solid #eee;
}


/* 결제 정보 */

#uploadDialog .payment-info {
    display: flex;
    flex-direction: column;

    gap: 3px;
}

#uploadDialog .payment-info strong {
    color: #eee;

    font-size: 13px;
}

#uploadDialog .payment-info small {
    color: #888;

    font-size: 11px;
}


/* ============================================================
   하단 버튼
============================================================ */

#uploadDialog .dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1.5fr;

    gap: 9px;

    margin-top: 22px;
}


/* 모든 버튼 공통
   기존 흰색 버튼 스타일보다 우선하도록
   구체적으로 지정
*/

#uploadDialog .dialog-actions button {
    width: 100%;
    height: 43px;

    box-sizing: border-box;

    border-radius: 9px;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;
}


/* 취소 */

#uploadDialog .ghost-btn {
    border: 1px solid #383838 !important;

    background: #202020 !important;
    color: #bbb !important;
}

#uploadDialog .ghost-btn:hover {
    background: #292929 !important;
    color: #fff !important;
}


/* 업로드 */

#uploadDialog .primary-btn {
    border: 1px solid #4a4a4a !important;

    background: #303030 !important;
    color: #fff !important;
}

#uploadDialog .primary-btn:hover {
    background: #3a3a3a !important;
    border-color: #5a5a5a !important;
}

#uploadDialog .primary-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}


/* ============================================================
   작은 화면
============================================================ */

@media (max-width: 600px) {

    #uploadDialog {
        width: calc(100vw - 24px);
        max-width: none;

        max-height: 88vh;
        border-radius: 16px;
    }

    #uploadDialog .upload-panel {
        padding: 22px 18px;
    }

    #uploadDialog h2 {
        font-size: 21px;
    }

    #uploadDialog .upload-dropzone {
        min-height: 130px;
    }

}



/* 업로드 팝업의 실제 파일 input은 화면에 표시하지 않음 */
#uploadDialog #videoFile {
    display: none !important;
}





/* 영상 업로드 영역: 내부 요소를 세로로 정렬 */
#uploadDialog .upload-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* 업로드 아이콘 */
#uploadDialog .upload-drop-icon {
    flex: 0 0 auto;
    margin-bottom: 9px;
}

/* 안내 문구를 각각 독립된 줄로 표시 */
#uploadDialog .upload-dropzone strong,
#uploadDialog .upload-dropzone span,
#uploadDialog .upload-dropzone small {
    display: block;
    width: 100%;
    text-align: center;
}


#uploadDialog .upload-drop-icon {
    align-self: center;
    margin-left: auto;
    margin-right: auto;
}





