*{box-sizing:border-box;margin:0;padding:0}
:root{font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#eef2ff;background:#070b16}
body{min-height:100vh;overflow-x:hidden;background:radial-gradient(circle at 20% 10%,#1b2140 0,transparent 35%),radial-gradient(circle at 85% 80%,#25113d 0,transparent 35%),#070b16}
button,input,textarea,select{font:inherit}
button{cursor:pointer}
.ambient{position:fixed;border-radius:50%;filter:blur(90px);opacity:.25;pointer-events:none}
.ambient-a{width:380px;height:380px;background:#6d5dfc;top:-140px;left:-120px}
.ambient-b{width:420px;height:420px;background:#d946ef;right:-160px;bottom:-180px}
.app-shell{width:min(1440px,96vw);min-height:94vh;margin:3vh auto;padding:18px;border:1px solid #ffffff12;border-radius:28px;background:#0d1324cc;backdrop-filter:blur(22px);box-shadow:0 30px 100px #0008}
.topbar{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:6px 8px 18px;border-bottom:1px solid #ffffff0d}
.brand{display:flex;align-items:center;gap:12px}.brand-mark{width:42px;height:42px;display:grid;place-items:center;border-radius:13px;background:linear-gradient(135deg,#7c6cff,#c84dff);font-size:21px;box-shadow:0 8px 30px #7c6cff44}
.brand strong{display:block;font-size:15px}.brand span{display:block;color:#7f8aa8;font-size:11px;margin-top:3px}
.top-actions{display:flex;align-items:center;gap:10px}.status-pill{padding:8px 11px;border-radius:999px;background:#ffffff08;color:#98a3bf;font-size:11px;border:1px solid #ffffff0d}
.status-pill.connected{color:#8df0c1;background:#0e9f6220;border-color:#2dd48a33}
.btn{border:0;border-radius:12px;padding:11px 15px;font-weight:700;font-size:12px;transition:.2s}.btn:hover{transform:translateY(-1px)}.btn-primary{color:#fff;background:linear-gradient(135deg,#6657f4,#a33bea);box-shadow:0 8px 24px #7658ed33}.btn-secondary{color:#dbe1f7;background:#ffffff09;border:1px solid #ffffff12}
.workspace{display:grid;grid-template-columns:minmax(360px,.88fr) minmax(420px,1.12fr);gap:18px;padding-top:18px}
.panel{border:1px solid #ffffff0c;border-radius:21px;background:#11182bba;box-shadow:inset 0 1px #ffffff08;padding:20px;min-width:0}
.panel-heading{margin-bottom:16px}.eyebrow{font-size:9px;font-weight:800;letter-spacing:1.8px;color:#8175ff}.panel h1{font-size:24px;margin:5px 0 6px;letter-spacing:-.7px}.panel-heading p{font-size:11px;color:#7f8aa8;line-height:1.5}
.auth-card{padding:13px;border:1px solid #ffffff0d;background:#ffffff05;border-radius:15px;margin-bottom:15px}.auth-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.auth-row strong{font-size:12px;display:block}.auth-row small{display:block;color:#7d89a4;font-size:10px;margin-top:3px}.text-btn{background:none;border:0;color:#a99fff;font-size:10px;font-weight:700}.key-box{display:grid;grid-template-columns:1fr auto auto;gap:7px;margin-top:10px}.key-box small{grid-column:1/-1;color:#6f7a96;font-size:9px;line-height:1.4}.key-box code{color:#a99fff}
.field{margin-bottom:12px}.field label,.field-label-row label{display:block;font-size:10px;font-weight:700;color:#cbd3e8;margin-bottom:6px}.field label span{color:#69748f;font-weight:400}.field-label-row{display:flex;justify-content:space-between;align-items:center}
textarea,input,select{width:100%;border:1px solid #ffffff0d;border-radius:11px;background:#080e1ccc;color:#eef2ff;outline:0;padding:11px 12px;font-size:11px;transition:.2s}textarea{height:112px;resize:vertical;min-height:80px}textarea:focus,input:focus,select:focus{border-color:#796cff;box-shadow:0 0 0 3px #796cff14}select{appearance:auto}
.field-footer{display:flex;justify-content:space-between;color:#65718c;font-size:9px;margin-top:5px}.quick-prompts{display:flex;gap:6px;flex-wrap:wrap;margin:-2px 0 13px}.quick-prompts button{border:1px solid #ffffff0c;background:#ffffff05;color:#8994ad;border-radius:999px;padding:6px 9px;font-size:9px}.quick-prompts button:hover{border-color:#796cff66;color:#c5bfff}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 10px}
.generate-btn{width:100%;border:0;border-radius:13px;padding:13px;color:#fff;font-weight:800;background:linear-gradient(135deg,#5d50f2,#b13ce9);box-shadow:0 12px 30px #7d53e733;display:flex;align-items:center;justify-content:center;gap:9px;transition:.2s}.generate-btn:hover{transform:translateY(-1px);box-shadow:0 15px 35px #7d53e755}.generate-btn:disabled{opacity:.55;cursor:not-allowed;transform:none}.generate-icon{font-size:15px}.spinner{width:15px;height:15px;border:2px solid #ffffff55;border-top-color:#fff;border-radius:50%;animation:spin .8s linear infinite}.message{min-height:15px;text-align:center;color:#7d89a4;font-size:9px;margin-top:8px}.message.error{color:#ff9baf}.message.ok{color:#7de7b5}
.preview-panel{display:flex;flex-direction:column;min-height:650px}.preview-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.preview-head h2{font-size:16px;margin-top:4px}.preview-actions{display:flex;gap:6px}.icon-btn{width:32px;height:32px;border-radius:9px;border:1px solid #ffffff0d;background:#ffffff06;color:#a7b1c9}.icon-btn:hover{background:#ffffff0d}
.image-wrapper{flex:1;min-height:380px;border:1px dashed #ffffff18;border-radius:16px;background:radial-gradient(circle at center,#18213b,#090e1a 70%);display:flex;align-items:center;justify-content:center;overflow:hidden;position:relative}.image-wrapper img{max-width:100%;max-height:100%;width:100%;height:100%;object-fit:contain}.placeholder{display:flex;flex-direction:column;align-items:center;text-align:center;padding:30px;color:#65718c}.placeholder-icon{width:58px;height:58px;display:grid;place-items:center;border-radius:18px;background:#ffffff06;border:1px solid #ffffff0b;color:#8074ff;font-size:24px;margin-bottom:12px}.placeholder strong{font-size:12px;color:#8994ad}.placeholder span{font-size:9px;margin-top:5px;max-width:280px;line-height:1.5}.action-buttons{display:flex;gap:8px;margin-top:10px}.action-buttons .btn{flex:1}
.history-head{display:flex;justify-content:space-between;align-items:center;margin-top:16px;margin-bottom:8px;font-size:10px;color:#a8b2c8}.history{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}.history-item{aspect-ratio:1;border-radius:9px;overflow:hidden;background:#080d18;border:1px solid #ffffff0c;cursor:pointer}.history-item img{width:100%;height:100%;object-fit:cover}.hidden{display:none!important}
.toast{position:fixed;right:20px;bottom:20px;max-width:320px;padding:11px 14px;border:1px solid #ffffff14;border-radius:12px;background:#141b2deF;color:#dce3f7;font-size:11px;box-shadow:0 15px 45px #0008;transform:translateY(20px);opacity:0;pointer-events:none;transition:.25s}.toast.show{transform:none;opacity:1}
@keyframes spin{to{transform:rotate(360deg)}}
@media(max-width:900px){.workspace{grid-template-columns:1fr}.preview-panel{min-height:620px}}
@media(max-width:560px){.app-shell{width:100%;min-height:100vh;margin:0;border-radius:0;padding:12px}.topbar{align-items:flex-start}.top-actions{flex-direction:column;align-items:flex-end}.top-actions .btn{font-size:10px;padding:9px}.status-pill{font-size:9px}.panel{padding:15px}.panel h1{font-size:20px}.form-grid{grid-template-columns:1fr}.preview-panel{min-height:520px}.image-wrapper{min-height:300px}.history{grid-template-columns:repeat(4,1fr)}}

#engine-select{border-color:#ffffff14}.message{word-break:break-word}

.api-guide{margin-bottom:10px;padding:10px 11px;border-radius:11px;background:#6d5dfc0b;border:1px solid #8a7dff22}
.api-guide strong{display:block;font-size:10px;color:#c9c3ff;margin-bottom:4px}
.api-guide span{display:block;font-size:9px;line-height:1.45;color:#7f8aa8}
.api-guide b{color:#b9b0ff}
.help-link{font-size:9px;color:#aaa0ff;text-decoration:none;margin-right:2px;white-space:nowrap}
.help-link:hover{text-decoration:underline}
