:root{color-scheme:dark;--bg:#080d16;--line:#26344a;--text:#f3f7ff;--muted:#8ea0ba;--blue:#5aa7ff;--blue2:#2c77ff;--ok:#42d392;--bad:#ff6b78}
.batch-file-controls{display:flex;align-items:center;gap:8px;min-width:0}.batch-file-controls .file-picker{flex:1;min-width:0}.batch-file-controls .file-picker b{flex-shrink:0}.batch-file-controls>button{flex-shrink:0;min-height:38px}.batch-file-controls>button:focus-visible{outline:2px solid var(--blue);outline-offset:2px}@media(max-width:560px){.batch-file-controls{flex-wrap:wrap}.batch-file-controls .file-picker{flex-basis:100%}}
.image-batch-editor{margin-top:16px;min-width:0;color:inherit}.batch-editor-heading,.batch-task-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}.batch-editor-heading{font-size:13px}.batch-editor-help,#imageBatchStatus{font-size:12px;line-height:1.6;color:inherit;opacity:.85;margin:10px 0}.batch-task{padding:14px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.025);min-width:0}.batch-task-heading{margin-bottom:8px;font-size:12px}.batch-prompt-count{font-size:10px;opacity:.65}.batch-task-prompt{width:100%;min-height:82px;max-height:240px;resize:vertical;border:1px solid var(--line);border-radius:8px;padding:10px;background:var(--bg);color:inherit;line-height:1.6;font-size:12px;margin-bottom:10px}.batch-task-prompt:focus-visible{outline:2px solid var(--blue);outline-offset:2px}.batch-task .reference-picker{padding:10px}.batch-task .reference-picker img{width:60px;height:60px}.batch-reference-status{font-size:11px;line-height:1.6;margin:8px 0 0;overflow-wrap:anywhere}.image-batch-editor .batch-error{color:var(--bad);opacity:1}.batch-reference-choose.disabled{opacity:.5;cursor:not-allowed}#imageBatchTasks{display:grid;gap:12px;max-height:640px;overflow:auto;padding:3px}.batch-task-prompt:disabled{opacity:.65}html[data-theme=light] .batch-task{background:#f8fafc;border-color:#dbe3ed}html[data-theme=light] .batch-task-prompt{background:#fff;color:#1d2433;border-color:#cbd5e1}html[data-theme=light] .image-batch-editor .batch-error{color:#b42318}html[data-theme=mono] .batch-task{background:#0f141c;border-color:#344052}html[data-theme=mono] .batch-task-prompt{background:#080b10;border-color:#344052}@media(max-width:560px){.batch-task{padding:10px}#imageBatchTasks{max-height:560px}.batch-task .reference-picker{gap:10px}}
.reference-field{margin-bottom:18px}.reference-field>span{display:flex;align-items:center;gap:8px}.reference-field small{font-size:11px;line-height:1.6;color:inherit;opacity:.85}.reference-picker{display:flex;align-items:center;gap:14px;padding:14px;border:1px dashed var(--line);border-radius:12px;background:transparent}.reference-picker img{width:76px;height:76px;object-fit:contain;border-radius:8px;flex:none}.reference-actions{position:relative;display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-width:0}.reference-actions input[type=file]{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden}.reference-actions:focus-within{outline:2px solid var(--blue);outline-offset:4px;border-radius:8px}.reference-field .reference-error{color:var(--bad);opacity:1}html[data-theme=light] .reference-picker{border-color:#cbd5e1}html[data-theme=light] .reference-field .reference-error{color:#b42318}html[data-theme=mono] .reference-picker{border-color:#344052}
*{box-sizing:border-box}body{margin:0;min-height:100vh;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;color:var(--text);background:radial-gradient(circle at 16% 0,rgba(45,119,255,.18),transparent 32%),radial-gradient(circle at 92% 12%,rgba(130,73,255,.13),transparent 28%),var(--bg)}button,select,textarea{font:inherit}
.image-app{width:min(1440px,100%);min-height:100vh;margin:auto;padding:22px}.image-topbar{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:18px 22px;border:1px solid var(--line);border-radius:18px;background:rgba(16,24,39,.88);box-shadow:0 20px 50px rgba(0,0,0,.24)}
.eyebrow{margin:0 0 6px;color:var(--blue);font-size:12px;font-weight:800;letter-spacing:.16em}.image-topbar h1{margin:0;font-size:26px}.subtitle{margin:7px 0 0;color:var(--muted);font-size:13px}.top-actions{display:flex;align-items:center;gap:10px}.account-state{font-size:12px;color:var(--muted);padding:8px 12px;border:1px solid var(--line);border-radius:999px}
.image-layout{display:grid;grid-template-columns:minmax(340px,.72fr) minmax(520px,1.28fr);gap:16px;margin-top:16px;min-height:calc(100vh - 150px)}.panel{border:1px solid var(--line);border-radius:18px;background:linear-gradient(145deg,rgba(18,28,45,.96),rgba(11,18,30,.97));padding:20px;box-shadow:0 18px 50px rgba(0,0,0,.18)}.generator-panel,.results-panel{display:flex;flex-direction:column}
.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.panel-heading>div{display:flex;align-items:center;gap:10px}.panel-heading h2{font-size:17px;margin:0}.step{display:grid;place-items:center;width:30px;height:30px;border-radius:10px;background:rgba(90,167,255,.14);color:var(--blue);font-size:11px;font-weight:800}.model-tag{font-size:11px;color:#bdd9ff;border:1px solid #34537b;background:#16263c;padding:6px 9px;border-radius:999px}
.field{display:flex;flex-direction:column;gap:8px;color:#c7d2e3;font-size:12px}.field textarea,.field select{width:100%;color:var(--text);background:#090f19;border:1px solid var(--line);border-radius:12px;outline:none}.field textarea:focus,.field select:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(90,167,255,.12)}.prompt-field{position:relative}.field textarea{height:250px;resize:vertical;min-height:180px;padding:14px;line-height:1.65}.field select{height:42px;padding:0 10px}.prompt-field small{position:absolute;right:12px;bottom:10px;color:#71839d}
.controls-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:16px}.cost-note{display:flex;justify-content:space-between;color:var(--muted);font-size:11px;margin:18px 2px 10px}.button{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;border-radius:12px;border:1px solid var(--line);padding:10px 14px;cursor:pointer;color:var(--text);background:#162033}.button:hover{filter:brightness(1.12)}.button:disabled{opacity:.5;cursor:not-allowed}.button.primary{border-color:var(--blue2);background:linear-gradient(135deg,var(--blue2),#7557ff);font-weight:800}.generate-button{height:48px;font-size:15px}.button.secondary{background:#121b2b}.button.compact{padding:7px 11px;font-size:12px}
.status{min-height:20px;margin:10px 2px 0;color:var(--muted);font-size:12px}.status.success{color:var(--ok)}.status.error{color:var(--bad)}.result-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;overflow:auto;align-content:start;padding-right:3px}.result-grid.empty{display:grid;place-items:center;flex:1;min-height:420px;border:1px dashed #2a3950;border-radius:14px}.empty-state{text-align:center;color:var(--muted)}.empty-state span{display:block;color:var(--blue);font-size:34px}.empty-state strong{display:block;color:#d8e5f7;margin:8px}.empty-state p{font-size:12px}
.result-card{overflow:hidden;border:1px solid var(--line);border-radius:10px;background:#0d1421}.result-card img{display:block;width:100%;height:150px;aspect-ratio:1/1;object-fit:cover;background:#05080d;cursor:zoom-in}.result-card-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px}.result-card-name{min-width:0}.result-card-name strong{display:block;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.result-card-name small{color:var(--muted);font-size:9px}.result-card-actions{display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end}.result-card-actions .button{padding:5px 7px;font-size:10px}.result-card.saved{border-color:rgba(66,211,146,.6)}.result-pending{height:188px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;color:var(--muted);font-size:11px}.result-pending strong{color:#d8e5f7;font-size:12px}.spinner{width:22px;height:22px;border:2px solid #314563;border-top-color:var(--blue);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.hidden{display:none!important}
@media(max-width:900px){.image-app{padding:12px}.image-topbar{align-items:flex-start;flex-direction:column}.top-actions{width:100%;justify-content:space-between}.image-layout{grid-template-columns:1fr;min-height:0}.field textarea{height:190px}}@media(max-width:560px){.controls-grid,.result-grid{grid-template-columns:1fr}.top-actions{align-items:stretch;flex-direction:column}.account-state{text-align:center}.cost-note{gap:8px;flex-direction:column}}
.file-picker{display:flex;align-items:center;gap:10px;min-height:42px;padding:7px 10px;border:1px solid var(--line);border-radius:12px;background:#090f19;color:var(--muted);cursor:pointer}.file-picker input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.file-picker b{padding:7px 10px;border:1px solid #35577f;border-radius:8px;background:#16263c;color:#d8e5f7;font-size:12px}.file-picker strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500}.batch-markers{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.batch-markers label{display:flex;flex-direction:column;gap:5px;color:var(--muted);font-size:11px}.batch-markers input{width:100%;height:34px;padding:0 9px;color:var(--text);background:#090f19;border:1px solid var(--line);border-radius:9px;outline:none}.batch-markers input:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(90,167,255,.12)}.result-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.result-card img{height:auto;aspect-ratio:1/1}.result-pending{height:auto;aspect-ratio:1/1}.batch-field small{line-height:1.4}
@media(max-width:900px){.result-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:560px){.result-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.batch-markers{grid-template-columns:1fr}}
.image-preview-overlay{position:fixed;inset:0;z-index:50;display:grid;place-items:center;padding:clamp(22px,5vh,56px) clamp(22px,5vw,72px);background:rgba(2,6,14,.84);backdrop-filter:blur(8px);overflow:hidden}.image-preview-dialog{position:relative;display:flex;align-items:center;justify-content:center;width:min(86vw,1080px);height:min(82vh,720px);max-width:calc(100vw - 44px);max-height:calc(100vh - 44px);padding:10px;border:1px solid #3a5275;border-radius:14px;background:#0b1320;box-shadow:0 24px 80px rgba(0,0,0,.55);overflow:visible}.image-preview-dialog img{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;border-radius:8px;background:#05080d}.image-preview-close{position:absolute;top:-14px;right:-14px;z-index:2;width:34px;height:34px;padding:0;border:1px solid #4a6285;border-radius:50%;background:#16263c;color:#fff;font-size:24px;line-height:30px;cursor:pointer}.image-preview-close:hover{background:#24456e}
.result-card img{height:150px;aspect-ratio:1/1;object-fit:contain}.result-pending{height:150px;aspect-ratio:auto}
.result-pending.interrupted{gap:6px;color:#d8e5f7}.result-pending.interrupted small{color:var(--muted)}.result-pending.interrupted .button{padding:5px 8px;font-size:10px}
.result-grid.empty{grid-template-columns:1fr;place-items:center;align-content:center;justify-content:center;text-align:center}
.image-selection-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:10px 0;border-top:1px solid var(--line);margin-bottom:4px;font-size:12px}.image-select-all{display:flex;align-items:center;gap:6px;cursor:pointer}.image-select-all input,.result-select input{width:16px;height:16px;accent-color:var(--blue2);cursor:pointer}.image-selection-toolbar>span{color:var(--muted);margin-right:auto}.image-results-hint{margin:0 0 12px;color:var(--muted);font-size:11px;line-height:1.5}.result-card{position:relative}.result-card.selected{border-color:var(--blue);box-shadow:0 0 0 1px var(--blue)}.result-select{position:absolute;z-index:1;left:7px;top:7px;display:flex;align-items:center;padding:5px;border:1px solid var(--line);border-radius:7px;background:var(--bg);cursor:pointer}.button.danger{color:var(--bad);border-color:rgba(255,107,120,.4);background:rgba(255,107,120,.08)}.result-card-meta{align-items:flex-start;flex-direction:column}.result-card-name{max-width:100%}.result-card-actions{justify-content:flex-start}.image-selection-toolbar .button{min-height:32px}html[data-theme="light"] .result-select{background:#fff;border-color:#cbd5e1}html[data-theme="light"] .image-selection-toolbar{border-color:#dbe3ed}html[data-theme="light"] .image-results-hint{color:#667085}html[data-theme="light"] .button.danger{color:#b42318}
html[data-theme="light"]{color-scheme:light}html[data-theme="light"] body{background:#f6f7fb;color:#1d2433}html[data-theme="light"] .image-topbar,html[data-theme="light"] .panel{background:#fff;border-color:#e3e8f0;box-shadow:0 8px 22px rgba(26,32,44,.06)}html[data-theme="light"] .subtitle,html[data-theme="light"] .account-state,html[data-theme="light"] .cost-note,html[data-theme="light"] .status,html[data-theme="light"] .field,html[data-theme="light"] .batch-field small{color:#5b6575}html[data-theme="light"] .field textarea,html[data-theme="light"] .field select,html[data-theme="light"] .batch-markers input,html[data-theme="light"] .file-picker{background:#fff;color:#1d2433;border-color:#cbd5e1}html[data-theme="light"] .file-picker b{background:#eef3f8;border-color:#b7c6d8;color:#24364d}html[data-theme="light"] .result-grid.empty{border-color:#cbd5e1}html[data-theme="light"] .empty-state,html[data-theme="light"] .result-pending{color:#4b5563}html[data-theme="light"] .empty-state strong,html[data-theme="light"] .result-pending strong{color:#111827}html[data-theme="light"] .result-card{background:#fff;border-color:#dbe3ed}html[data-theme="light"] .result-card img,html[data-theme="light"] .result-pending{background:#f4f7fb}html[data-theme="light"] .result-card-name small{color:#667085}html[data-theme="light"] .button.secondary{background:#fff;color:#1d2433;border-color:#cbd5e1}html[data-theme="light"] .model-tag{background:#eef5ff;color:#245184;border-color:#b9d2ee}
html[data-theme="mono"]{color-scheme:dark}html[data-theme="mono"] body{background:#030405;color:#f5f7fa}html[data-theme="mono"] .image-topbar,html[data-theme="mono"] .panel{background:#0a0d12;border-color:#27303c;box-shadow:0 12px 32px rgba(0,0,0,.48)}html[data-theme="mono"] .subtitle,html[data-theme="mono"] .account-state,html[data-theme="mono"] .cost-note,html[data-theme="mono"] .status,html[data-theme="mono"] .field,html[data-theme="mono"] .batch-field small{color:#aeb8c7}html[data-theme="mono"] .field textarea,html[data-theme="mono"] .field select,html[data-theme="mono"] .batch-markers input,html[data-theme="mono"] .file-picker{background:#0f141c;color:#f5f7fa;border-color:#344052}html[data-theme="mono"] .file-picker b{background:#1b2838;border-color:#526176;color:#f5f7fa}html[data-theme="mono"] .result-grid.empty{border-color:#344052}html[data-theme="mono"] .empty-state,html[data-theme="mono"] .result-pending{color:#aeb8c7}html[data-theme="mono"] .empty-state strong,html[data-theme="mono"] .result-pending strong{color:#f5f7fa}html[data-theme="mono"] .result-card{background:#0d1421;border-color:#344052}html[data-theme="mono"] .result-card img,html[data-theme="mono"] .result-pending{background:#080b10}html[data-theme="mono"] .result-card-name small{color:#aeb8c7}
/* Generated images stay compact regardless of source ratio or result count. */
html body #imageResults:not(.empty) {
  grid-template-columns:repeat(auto-fill, minmax(0, 156px));
  justify-content:start;align-items:start;gap:12px;
}
html body #imageResults .result-card {width:100%;min-width:0;border-radius:9px}
html body #imageResults .result-card>img {
  width:100%;height:auto;aspect-ratio:1 / 1!important;object-fit:contain;
}
html body #imageResults .result-pending {height:auto;aspect-ratio:1 / 1}
html body #imageResults .result-card-meta {padding:7px;gap:6px}
html body #imageResults .result-card-name strong {font-size:11px}
html body #imageResults .result-card-name small {display:block;font-size:9px;line-height:1.4}
html body #imageResults .result-card-name small:empty {display:none}
html body #imageResults .result-card-actions {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;gap:4px}
html body #imageResults .result-card-actions .button {min-width:0;min-height:24px;padding:3px 4px;font-size:10px;border-radius:5px!important}
html body #imageResults .result-card-actions .button:last-child {grid-column:1/-1}
html body #imageResults .result-select {left:5px;top:5px;padding:3px}
@media(max-width:560px) {
  html body #imageResults:not(.empty) {grid-template-columns:repeat(2,minmax(0,156px));gap:8px}
}
/* Reference controls remain easy to find in single and per-prompt workflows. */
html body .reference-field>span,html body .batch-editor-heading>strong{font-size:16px;font-weight:700}
html body .reference-picker{border:1px solid var(--studio-line-strong);background:var(--studio-inset);padding:14px;border-radius:12px}
html body .reference-actions :is(label.button,button){min-height:40px;padding:9px 14px;font-size:14px;font-weight:700}
html body .batch-task .reference-picker img{width:76px;height:76px}
html body .reference-field small,html body .batch-reference-status,html body .batch-editor-help{font-size:13px;line-height:1.7;opacity:1;color:var(--studio-muted)}
