:root{color-scheme:dark;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;color:#f2efe5;background:#12140f;font-synthesis:none;text-rendering:optimizeLegibility;--bg: #12140f;--panel: #1c211b;--panel-2: #242a22;--panel-3: #2d241f;--line: #3d473a;--line-strong: #607052;--text: #f2efe5;--muted: #b7c1ae;--soft: #8d9b84;--green: #67b783;--green-dark: #2d7a55;--rust: #ce5f3c;--rust-dark: #a9472c;--gold: #e0ba69;--danger: #ff9d89}*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh}button,input,select,textarea{font:inherit}button{cursor:pointer}.app-shell{min-height:100vh;display:flex;flex-direction:column;background:radial-gradient(circle at 15% 10%,rgba(103,183,131,.14),transparent 28rem),linear-gradient(135deg,#12140f,#191d17 52%,#261d1a)}.topbar{min-height:104px;padding:24px clamp(18px,4vw,48px);display:flex;align-items:center;justify-content:space-between;gap:20px;border-bottom:1px solid var(--line);background:#12140feb;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}.eyebrow{margin:0 0 6px;color:var(--green);font-size:.78rem;font-weight:700;letter-spacing:0;text-transform:uppercase}h1,h2,p{margin:0}h1{font-size:clamp(1.55rem,3vw,2.25rem);line-height:1.08;letter-spacing:0}h2{font-size:1rem;letter-spacing:0}.topbar-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.workspace{flex:1;display:grid;grid-template-columns:minmax(340px,430px) 1fr;min-height:0}.control-panel{padding:24px clamp(18px,3vw,34px);display:flex;flex-direction:column;gap:18px;border-right:1px solid var(--line);background:#1c211bf5}.panel-heading{display:flex;align-items:center;gap:10px;color:var(--text)}.panel-heading.compact{margin-top:4px}.panel-heading.with-action{justify-content:space-between}.heading-title{display:inline-flex;align-items:center;gap:10px}.direction-actions{display:inline-flex;align-items:center;gap:9px;flex-wrap:wrap;justify-content:flex-end}.toggle-control{min-height:34px;display:inline-flex;align-items:center;gap:8px;padding:0 10px;border:1px solid var(--line);border-radius:8px;color:var(--muted);background:#151a13;font-size:.88rem;font-weight:800;cursor:pointer}.toggle-control input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.switch-track{width:38px;height:20px;display:inline-flex;align-items:center;padding:2px;border:1px solid var(--line-strong);border-radius:999px;background:#0f130e;transition:border-color .16s ease,background .16s ease}.switch-thumb{width:14px;height:14px;border-radius:999px;background:var(--soft);transition:transform .16s ease,background .16s ease}.toggle-control:has(input:checked){border-color:var(--green);color:#07120c;background:var(--green)}.toggle-control:has(input:checked) .switch-track{border-color:#07120c52;background:#07120c38}.toggle-control:has(input:checked) .switch-thumb{transform:translate(18px);background:#07120c}.toggle-control:has(input:focus-visible){box-shadow:0 0 0 3px #67b78333}.direction-note{margin-top:-6px;color:var(--soft);font-size:.86rem;line-height:1.35}.mini-button{min-height:34px;padding:0 10px;font-size:.88rem}.mini-icon-button{width:34px;height:34px;flex:0 0 auto}.advanced-panel{display:flex;flex-direction:column;gap:14px}textarea,input,select{width:100%;border:1px solid var(--line);border-radius:8px;background:#141811;color:var(--text);outline:none}textarea{resize:vertical;min-height:190px;padding:14px;line-height:1.45}input,select{min-height:42px;padding:0 11px}textarea:focus,input:focus,select:focus{border-color:var(--green);box-shadow:0 0 0 3px #67b7832e}.preset-row{display:flex;flex-wrap:wrap;gap:8px}.icon-button{width:38px;height:38px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:8px;color:var(--text);background:var(--panel-2)}.icon-button:hover{border-color:var(--green);color:#cbf5d6}.icon-button.danger-button{color:#ffc3b7}.icon-button.danger-button:hover{border-color:#ff9d89cc;color:#fff0ec;background:#70261e94}.text-button{width:auto;min-height:38px;height:auto;max-width:100%;padding:0 10px;gap:7px;justify-content:flex-start;text-align:left}.text-button span{max-width:245px;overflow-wrap:anywhere;white-space:normal}fieldset{margin:0;padding:0;border:0}legend,.field span{display:block;margin-bottom:7px;color:var(--muted);font-size:.86rem;font-weight:700}.segmented{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.segmented button{min-height:40px;padding:0 8px;border:1px solid var(--line);border-radius:8px;color:var(--text);background:#151a13}.segmented button.active{border-color:var(--green);color:#07120c;background:var(--green)}.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.message{display:flex;align-items:flex-start;gap:9px;padding:11px 12px;border-radius:8px;font-size:.92rem;line-height:1.35}.message.error{color:#ffd6cf;background:#70261e8c;border:1px solid rgba(255,157,137,.6)}.message.muted{color:#d3decb;background:#2e3c2ab8;border:1px solid rgba(132,154,119,.55)}.message a{color:#bff3cf;font-weight:800}.setup-actions{display:flex;flex-wrap:wrap;gap:9px}.setup-actions .secondary-button{flex:1 1 132px}.upload-panel{display:flex;flex-direction:column;gap:12px;padding:12px;border:1px solid var(--line);border-radius:8px;background:#14181199}.upload-dropzone{min-height:82px;display:flex;align-items:center;justify-content:center;gap:10px;border:1px dashed var(--line-strong);border-radius:8px;color:var(--text);background:#141811;font-weight:800;cursor:pointer}.upload-dropzone:hover{border-color:var(--green);color:#cbf5d6}.upload-dropzone input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.upload-preview{display:grid;grid-template-columns:76px 1fr;align-items:center;gap:12px}.upload-preview img{width:76px;aspect-ratio:1 / 1;border:1px solid var(--line);border-radius:8px;object-fit:cover;background:#0f130e}.upload-preview div{min-width:0;display:flex;flex-direction:column;gap:4px}.upload-preview strong{color:var(--text);overflow-wrap:anywhere}.upload-preview span{color:var(--muted);font-size:.86rem}.reference-panel{display:grid;grid-template-columns:74px 1fr 38px;gap:12px;align-items:start;padding:12px;border:1px solid var(--line);border-radius:8px;background:#141811b8}.reference-panel img{width:74px;aspect-ratio:1 / 1;border:1px solid var(--line);border-radius:8px;object-fit:cover;background:#0f130e}.reference-copy{min-width:0;display:flex;flex-direction:column;gap:10px}.reference-copy p{color:var(--muted);font-size:.88rem;line-height:1.35;max-height:3.6em;overflow:hidden}.prompt-preview-panel{border:1px solid var(--line);border-radius:8px;background:#11150fbd;overflow:hidden}.prompt-preview-panel summary{min-height:42px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:5px 8px 5px 12px;color:var(--muted);font-size:.9rem;font-weight:800;list-style:none;cursor:pointer}.prompt-preview-panel summary::-webkit-details-marker{display:none}.prompt-preview-panel pre{max-height:260px;margin:0;padding:12px;border-top:1px solid var(--line);color:#e7eddc;font:.84rem/1.45 ui-monospace,SFMono-Regular,Consolas,Liberation Mono,monospace;white-space:pre-wrap;overflow:auto}.prompt-attachment-note{display:flex;align-items:center;gap:8px;padding:10px 12px;border-top:1px solid var(--line);color:var(--muted);font-size:.84rem;overflow-wrap:anywhere}.generate-button{min-height:48px;display:inline-flex;align-items:center;justify-content:center;gap:10px;border:0;border-radius:8px;color:#fffaf2;background:var(--rust);font-weight:800}.generate-button:hover:not(:disabled){background:var(--rust-dark)}.secondary-button{min-height:42px;display:inline-flex;align-items:center;justify-content:center;gap:9px;border:1px solid var(--line-strong);border-radius:8px;color:var(--text);background:var(--panel-2);font-weight:800}.secondary-button:hover:not(:disabled){border-color:var(--green);color:#cbf5d6}.secondary-button:disabled{cursor:wait;opacity:.72}.generate-button:disabled{cursor:wait;opacity:.72}.spin{animation:spin .9s linear infinite}.gallery-panel{min-width:0;padding:24px clamp(18px,3vw,42px);background:#12140f80}.gallery-toolbar{min-height:46px;display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.empty-state{min-height:calc(100vh - 154px);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:var(--soft);text-align:center}.empty-state h2{color:var(--text);font-size:1.2rem}.gallery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:18px}.image-card{overflow:hidden;border:1px solid var(--line);border-radius:8px;background:var(--panel)}.image-preview-button{display:block;width:100%;padding:0;border:0;background:transparent}.image-card img,.image-preview-button img{display:block;width:100%;aspect-ratio:1 / 1;object-fit:contain;background:linear-gradient(45deg,#2f362d 25%,transparent 25%),linear-gradient(-45deg,#2f362d 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#2f362d 75%),linear-gradient(-45deg,transparent 75%,#2f362d 75%);background-position:0 0,0 10px,10px -10px,-10px 0;background-size:20px 20px}.image-actions{min-height:54px;display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:8px;border-top:1px solid var(--line);flex-wrap:wrap}.preview-backdrop{position:fixed;inset:0;z-index:20;display:grid;place-items:center;padding:24px;background:#040605d1;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.preview-modal{width:min(100%,1180px);max-height:calc(100vh - 48px);display:grid;grid-template-rows:auto minmax(0,1fr) auto;border:1px solid var(--line-strong);border-radius:8px;background:#12140f;box-shadow:0 32px 100px #00000085}.preview-header,.preview-footer{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px}.preview-header{border-bottom:1px solid var(--line)}.preview-footer{border-top:1px solid var(--line)}.preview-stage{min-height:0;display:grid;place-items:center;padding:14px;background:#0b0e0a}.preview-stage img{max-width:100%;max-height:calc(100vh - 210px);object-fit:contain}.preview-meta{display:flex;flex-direction:column;gap:4px;color:var(--text)}.preview-meta span{color:var(--muted);font-size:.88rem}.preview-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:9px}.preview-download{min-height:42px;padding:0 14px}.log-modal{width:min(100%,880px)}.log-modal-body{min-height:0;padding:14px;overflow:auto;background:#0b0e0a}.log-details.always-open{padding:12px}.login-shell{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 25% 20%,rgba(206,95,60,.18),transparent 22rem),radial-gradient(circle at 78% 65%,rgba(103,183,131,.18),transparent 24rem),linear-gradient(140deg,#12140f,#1a2119 55%,#2b1d19)}.login-panel{width:min(100%,460px);padding:30px;display:flex;flex-direction:column;gap:24px;border:1px solid var(--line-strong);border-radius:8px;background:#1c211beb;box-shadow:0 28px 90px #00000059}.login-brand{display:flex;align-items:center;gap:16px}.login-mark{width:54px;height:54px;display:grid;place-items:center;border-radius:8px;color:#07120c;background:var(--green)}.login-form{display:flex;flex-direction:column;gap:16px}.key-setup{display:flex;flex-direction:column;gap:14px;padding:14px;border:1px solid var(--line);border-radius:8px;background:#141811ad}.run-log-panel{display:flex;flex-direction:column;gap:12px;padding-top:4px}.log-empty{padding:12px;border:1px dashed var(--line);border-radius:8px;color:var(--muted);font-size:.9rem;line-height:1.4;background:#14181173}.run-log-list{display:flex;flex-direction:column;gap:10px}.run-log-item{border:1px solid var(--line);border-radius:8px;background:#141811b8;overflow:hidden}.run-log-item.running{border-color:#e0ba69b8}.run-log-item.success{border-color:#67b7839e}.run-log-item.failed{border-color:#ff9d89b8;background:#34181394}.run-log-item summary{min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 12px;list-style:none;cursor:pointer}.run-log-item summary::-webkit-details-marker{display:none}.log-status{min-width:0;display:inline-flex;align-items:center;gap:8px}.run-log-item.running .log-status{color:#ffdea0}.run-log-item.success .log-status{color:#bff3cf}.run-log-item.failed .log-status{color:#ffd6cf}.log-time{color:var(--muted);font-size:.82rem;white-space:nowrap}.log-details{display:flex;flex-direction:column;gap:12px;padding:0 12px 12px}.log-details dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0}.log-details dl div{min-width:0}.log-details dt{margin-bottom:3px;color:var(--soft);font-size:.72rem;font-weight:800;text-transform:uppercase}.log-details dd{margin:0;color:var(--text);font-size:.86rem;overflow-wrap:anywhere}.log-error{padding:10px;border:1px solid rgba(255,157,137,.58);border-radius:8px;color:#ffd6cf;background:#70261e73;font-size:.88rem;line-height:1.4;overflow-wrap:anywhere}.log-prompt{border:1px solid var(--line);border-radius:8px;background:#11150f;overflow:hidden}.log-prompt-heading{min-height:38px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:6px 8px 6px 10px;border-bottom:1px solid var(--line);color:var(--muted);font-size:.82rem;font-weight:800}.log-prompt pre{max-height:220px;margin:0;padding:10px;color:#e7eddc;font:.82rem/1.45 ui-monospace,SFMono-Regular,Consolas,Liberation Mono,monospace;white-space:pre-wrap;overflow:auto}.logout-button{flex:0 0 auto}@keyframes spin{to{transform:rotate(360deg)}}@media(max-width:920px){.topbar{align-items:flex-start;flex-direction:column}.workspace{grid-template-columns:1fr}.control-panel{border-right:0;border-bottom:1px solid var(--line)}.empty-state{min-height:300px}}@media(max-width:560px){.topbar{padding:18px}.topbar-actions{width:100%}.panel-heading.with-action{align-items:flex-start;flex-direction:column}.direction-actions{width:100%;justify-content:flex-start}.grid-2{grid-template-columns:1fr}.text-button span{max-width:235px}.reference-panel{grid-template-columns:58px 1fr 38px}.reference-panel img{width:58px}.preview-footer{align-items:stretch;flex-direction:column}.preview-actions{justify-content:stretch}.preview-actions>button{flex:1 1 100%}.run-log-item summary{align-items:flex-start;flex-direction:column;justify-content:center;padding:9px 12px}.log-time{white-space:normal}.log-details dl{grid-template-columns:1fr}}
