.creative-layout{display:grid;grid-template-columns:340px minmax(0,1fr);gap:24px;align-items:start;min-width:0}.creative-settings,.creative-workspace{display:grid;grid-template-columns:minmax(0,1fr);gap:20px;min-width:0}.creative-workspace>.card{width:100%;min-width:0;overflow:hidden}.creative-upload{height:130px;min-height:130px;aspect-ratio:auto;display:flex;flex-direction:column;gap:7px;margin-top:0}.creative-upload .upload-symbol{font-size:27px}.creative-upload.is-dragover{background:#e6eaef;border-color:#5c779c;box-shadow:inset 0 0 0 2px #455d7d40}.creative-upload[aria-disabled=true]{opacity:.5;cursor:wait}.creative-refs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.creative-reference{border:1px solid #d3d6db;border-radius:8px;padding:8px;min-width:0;background:#f6f6f7}.creative-reference img{width:100%;height:85px;object-fit:contain;background:#eaebec;border-radius:5px}.creative-reference small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10px;margin:7px 0}.creative-reference .action-row{gap:8px;flex-wrap:wrap}.creative-reference button{font-size:10px;padding:0}.creative-tools{display:flex;flex-wrap:wrap;gap:7px}.creative-tools .is-active{border-color:#5c779c;background:linear-gradient(135deg,#c3cedd,#8ea4c3);box-shadow:0 2px 5px #1b222c20}.creative-settings input[type=range]{accent-color:#5c779c;padding:0;margin:10px 0}.creative-settings label>span{float:right;font-size:11px;color:#5a6a80}.creative-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:12px 0 14px}.creative-toolbar label{display:flex;gap:10px;align-items:center;margin:0;white-space:nowrap}.creative-toolbar select{width:135px;margin:0;padding:8px}.creative-canvas-stage{width:100%;min-width:0;max-width:100%;height:560px;max-height:70vh;min-height:340px;overflow:auto;contain:inline-size;overscroll-behavior:contain;scrollbar-gutter:stable;border:1px solid #d7d9dc;border-radius:12px;padding:16px;box-sizing:border-box;background-color:#ebeced;background-image:linear-gradient(45deg,#dedfe1 25%,transparent 25%),linear-gradient(-45deg,#dedfe1 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#dedfe1 75%),linear-gradient(-45deg,transparent 75%,#dedfe1 75%);background-size:20px 20px;background-position:0 0,0 10px,10px -10px,-10px 0}.creative-canvas-stage:focus-visible{outline:2px solid #455d7d;outline-offset:2px}.creative-canvas-stage canvas,.creative-canvas-stage img{display:block;max-width:none;touch-action:none;box-shadow:0 3px 16px #24231f18}.creative-canvas-stage canvas.is-editing{cursor:crosshair}.creative-canvas-stage [hidden]{display:none!important}.creative-status{padding:14px;background:#ebedf0;border:1px solid #c7ced9;border-radius:9px}.creative-status>strong,.creative-status>span{display:block;margin-bottom:8px}.creative-status .action-row{flex-wrap:wrap}.creative-status .error,.creative-report{white-space:pre-line;line-height:1.8;overflow-wrap:anywhere}.creative-report{background:#f2f3f4;border:1px solid #d5dae0;border-radius:8px;padding:12px}.creative-workspace .action-row{flex-wrap:wrap}.creative-history{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,170px));gap:12px}.creative-record{border:1px solid #d3d6db;border-radius:9px;padding:9px;min-width:0;background:#f7f7f8}.creative-record.is-current{border-color:#455d7d}.creative-record img{width:100%;height:105px;object-fit:contain;background:#e9e9ea;border-radius:5px}.creative-record>button{text-align:left;width:100%;color:inherit}.creative-record strong{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:12px;line-height:18px;height:36px;margin:7px 0}.creative-record .hint{display:block;font-size:10px;margin:6px 0}.creative-record .text-button{font-size:11px;padding:0}.creative-pager{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin-top:16px}.creative-pager .action-row{gap:8px}.creative-pager select{width:85px;margin:0;padding:7px}.creative-pager .button{padding:7px 10px}.creative-settings>.card{padding:24px}.creative-settings .two-columns>label{min-width:0}.creative-settings select{min-width:0}@media(max-width:1150px){.creative-layout{grid-template-columns:290px minmax(0,1fr);gap:18px}.creative-settings>.card{padding:20px}}@media(max-width:850px){.creative-layout{grid-template-columns:minmax(0,1fr)}.creative-canvas-stage{height:480px}}@media(max-width:460px){.creative-toolbar{flex-wrap:wrap}.creative-history{grid-template-columns:repeat(2,minmax(0,1fr))}}

.creative-prompt-card textarea{min-height:160px;line-height:1.8;resize:vertical}.creative-prompt-card>label{margin-top:18px}#drawOutputCard>h2{margin-bottom:18px}#drawWorkflow{line-height:1.8}

#page-draw .creative-settings h2{display:flex;align-items:center;gap:9px;line-height:1.6}#page-draw .creative-settings h2 .step{flex-shrink:0}#page-draw .creative-prompt-card>textarea{margin-top:16px}

.creative-mode-label{display:block;font-size:12px;font-weight:550;color:#606168;margin-bottom:9px}.creative-mode-switch{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;margin-bottom:10px}.creative-mode-button{display:flex;align-items:center;justify-content:center;gap:7px;min-height:44px;padding:10px 7px;border:1px solid #dcdadd;border-radius:9px;background:linear-gradient(180deg,#fff,#f3f3f4);color:#74747a;font-size:12px;font-weight:550;box-shadow:0 1px 3px #20252b08;transition:background .15s,border-color .15s,box-shadow .15s}.creative-mode-button.is-active{background:linear-gradient(180deg,#c3cedd,#91a7c5);border-color:#5c779c;color:#273447;box-shadow:inset 0 1px 0 #e4e8edb3,0 2px 5px #3e547224;font-weight:650}.creative-mode-check{visibility:hidden;font-size:12px}.creative-mode-button.is-active .creative-mode-check{visibility:visible}.creative-mode-tag{display:inline-flex;align-items:center;flex-shrink:0;border:1px solid #cbd0d8;border-radius:6px;background:#eceef0;color:#4d5e75;font-size:10px;font-weight:550;line-height:1.6;padding:3px 8px;margin-left:9px}.creative-mode-tag.is-outpaint{background:linear-gradient(135deg,#d7dfe9,#b3c0d3);border-color:#7e95b6;color:#344864}#page-draw .creative-workspace>.card>.card-title>h2{display:flex;align-items:center;flex-wrap:wrap;row-gap:6px}#drawNameHint{line-height:1.7}

.creative-mode-panel .creative-mode-switch{padding:4px;margin:12px 0 0;background:#ededee;border:1px solid #dbdee2;border-radius:11px;gap:8px}.creative-mode-panel .creative-mode-button{position:relative;min-height:64px;flex-direction:column;align-items:flex-start;justify-content:center;gap:3px;padding:10px;border-radius:8px;border-color:#dadcde;color:#67666a;background:linear-gradient(180deg,#fff,#f7f7f7);box-shadow:0 1px 2px #22272e06}.creative-mode-panel .creative-mode-button.is-active{color:#2f3d50;background:linear-gradient(145deg,#e5e9ee 0%,#bdc9da 58%,#9db1cd 100%);border-color:#798faf;box-shadow:inset 0 1px 0 #f6f7f9,0 2px 4px #3e54721a}.creative-mode-panel .creative-mode-card-title{font-size:12px;font-weight:650;line-height:1.7}.creative-mode-panel .creative-mode-button small{color:#918d84;font-size:10px;line-height:1.5;white-space:normal;font-weight:400;text-align:left}.creative-mode-panel .creative-mode-button.is-active small{color:#4a596f}.creative-mode-panel .creative-mode-check{position:absolute;right:7px;top:7px;display:grid;place-items:center;width:14px;height:14px;border:1px solid #6c82a2;border-radius:50%;background:#7389a9;color:#f6f7f9;font-size:9px;line-height:1}.creative-reference-help{margin:0 0 14px}.creative-record-badges{display:flex;align-items:center;gap:5px;flex-wrap:wrap;min-height:22px}.creative-record-badges .creative-mode-tag{margin:0;font-size:10px;padding:2px 6px}.creative-history-filters{display:grid;grid-template-columns:128px minmax(130px,1fr) auto auto;align-items:end;gap:8px;padding:12px;margin-top:16px;border:1px solid #dcdfe3;border-radius:10px;background:#f5f5f6}.creative-history-filters label{margin:0;min-width:0;font-size:11px}.creative-history-filters select,.creative-history-filters input[type=search]{min-width:0;margin-top:6px;padding:8px 9px;font-size:12px;min-height:37px}.creative-history-filters>.button{height:37px;padding:7px 11px}#drawHistoryFilterNote{overflow-wrap:anywhere}@media(max-width:1100px){.creative-history-filters{grid-template-columns:minmax(0,1fr) auto auto}.creative-history-filters>label:first-child{grid-column:1/-1}}@media(max-width:460px){.creative-history-filters{padding:10px;gap:7px}.creative-mode-panel .creative-mode-card-title{font-size:12px}}

#page-draw .creative-settings>.creative-mode-panel{padding-top:20px;padding-bottom:20px}.creative-mode-panel .creative-mode-button:not(.is-active):not(:disabled):hover{background:#fff;border-color:#96a6bd;box-shadow:0 2px 4px #3e54720f}

#drawHistory,#paintHistory{grid-template-columns:repeat(var(--creative-history-columns,3),minmax(0,1fr))}.creative-history-filters-paint{grid-template-columns:minmax(0,1fr) auto auto}.creative-history-filters-paint>label:first-child{grid-column:auto}.creative-history-filter-note{overflow-wrap:anywhere}.creative-history>p{grid-column:1/-1}

/* Distinguish the first drawing reference without changing image order. */
.creative-reference-media{position:relative}
#drawRefs .creative-reference.is-primary{border-color:#8da5c2;background:#f0f5fb;box-shadow:inset 0 0 0 1px #bdcde150}
.creative-reference-role{position:absolute;top:5px;left:5px;display:inline-flex;align-items:center;max-width:calc(100% - 10px);padding:3px 7px;border:1px solid var(--silver);border-radius:5px;background:#f5f7faf2;color:#738094;font-size:10px;font-weight:550;line-height:1.4;white-space:nowrap;pointer-events:none}
.creative-reference-role.is-primary{background:linear-gradient(180deg,#4d6687,#2d405d);border-color:#3e587a;color:#fff;box-shadow:0 1px 3px #243b5324;font-weight:650}
#drawRefs .creative-set-primary{display:block;width:100%;margin:0 0 7px;padding:4px 6px;border:1px solid #c5d4e5;border-radius:5px;background:linear-gradient(180deg,#f8fbff,#eaf1fa);color:#3f6088;font-size:10px;font-weight:600;line-height:1.5;text-align:center}
#drawRefs .creative-set-primary:not(:disabled):hover{background:#e3edf9;border-color:#98b0cd;color:#2d4b71}
/* Reference sorting uses a drag ghost and an insertion marker; upload drops stay separate. */
#drawRefs .creative-reference{position:relative;cursor:grab}
#drawRefs .creative-reference[draggable="false"]{cursor:default}
#drawRefs .creative-reference.is-reference-dragging{opacity:.45;cursor:grabbing}
.creative-reference-grip{position:absolute;right:5px;top:5px;display:grid;place-items:center;width:21px;height:21px;border:1px solid #d4dce6;border-radius:5px;background:#fffffff0;color:#70839b;font-size:17px;line-height:1;pointer-events:none}
#drawRefs .creative-reference.is-drop-before::before,#drawRefs .creative-reference.is-drop-after::after{content:"";position:absolute;top:2px;bottom:2px;width:3px;border-radius:3px;background:#58769c;box-shadow:0 0 0 2px #dbe6f280;pointer-events:none;z-index:2}
#drawRefs .creative-reference.is-drop-before::before{left:-7px}
#drawRefs .creative-reference.is-drop-after::after{right:-7px}
#drawRefs .creative-reference:focus-visible{outline:2px solid #6b86a9;outline-offset:2px}
