:root{--blue:#1769ff;--ink:#17233b;--muted:#74809a;--line:#e6eaf1;--bg:#f8fafc;--card:#fff}*{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,sans-serif;background:var(--bg);color:var(--ink)}button,select,textarea,input{font:inherit}.app-shell{display:flex;min-height:100vh}.sidebar{width:240px;background:#fff;border-right:1px solid var(--line);padding:22px 14px;display:flex;flex-direction:column}.brand{font-weight:700;font-size:17px;display:flex;align-items:center;gap:10px;padding:0 12px 28px}.brand-mark{font-size:25px;color:#0f57d7}.sidebar nav{display:grid;gap:6px}.sidebar nav a{color:#526078;text-decoration:none;padding:12px 14px;border-radius:9px;font-size:14px;font-weight:500}.sidebar nav a.active{background:#edf4ff;color:#1260ed}.sidebar nav a:first-letter{font-size:18px}.powered{margin-top:auto;border:1px solid var(--line);border-radius:10px;padding:13px;font-size:12px;color:#526078;display:grid;grid-template-columns:22px 1fr;gap:2px}.powered strong{font-size:11px}.powered small{grid-column:2;color:#8a95a8}.main{flex:1;min-width:0}.topbar{height:52px;border-bottom:1px solid var(--line);background:#fff;display:flex;justify-content:flex-end;align-items:center;padding:0 26px}.profile{color:#66748c}.page-head{padding:28px 36px 18px;display:flex;justify-content:space-between;align-items:center}.page-head h1{margin:0 0 7px;font-size:25px}.page-head p{margin:0;color:var(--muted);font-size:14px}.status{font-size:12px;color:#4e5d73;background:#fff;border:1px solid var(--line);padding:9px 12px;border-radius:999px}.status span{display:inline-block;width:7px;height:7px;border-radius:50%;background:#20a464;margin-right:6px}.workspace{display:grid;grid-template-columns:minmax(420px,1fr) minmax(520px,1.05fr);gap:18px;padding:0 36px 36px}.card{background:var(--card);border:1px solid var(--line);border-radius:12px;box-shadow:0 4px 18px rgba(20,35,60,.035)}.controls{padding:18px}.upload{border:1px dashed #ccd4e2;border-radius:9px;padding:14px;display:flex;align-items:center;gap:15px;cursor:pointer;background:#fbfcfe}.upload.dragging{border-color:#1769ff;background:#f4f8ff}.upload-thumb{width:118px;height:86px;border-radius:7px;object-fit:cover;background:#eef2f7;display:grid;place-items:center;color:#9aa6b8;font-size:28px;overflow:hidden;flex:none}.upload-thumb img{width:100%;height:100%;object-fit:cover}.upload h3{font-size:14px;margin:0 0 7px}.upload p{font-size:12px;color:var(--muted);margin:0 0 8px}.upload button{border:0;background:transparent;color:var(--blue);padding:0;cursor:pointer}.upload small{color:#9aa6b8;font-size:10px}.controls h2,.result-card h2{font-size:15px;margin:20px 0 13px}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}.controls>h2+.grid2{margin-top:0}label{font-size:12px;color:#526078;font-weight:600;display:grid;gap:7px}select,textarea{border:1px solid #dfe4ec;border-radius:7px;background:#fff;color:#26344d;padding:10px 11px;outline:none}select:focus,textarea:focus{border-color:#8bb1ff;box-shadow:0 0 0 3px #edf4ff}textarea{min-height:82px;resize:vertical;line-height:1.45;font-size:12px;font-weight:400}.toggles{align-items:center;margin-top:12px}.switch-row{display:flex;align-items:center;gap:8px;height:40px;position:relative}.switch-row input{position:absolute;opacity:0}.switch{margin-left:auto;width:34px;height:20px;border-radius:20px;background:#c8cfdb;position:relative}.switch:after{content:'';position:absolute;width:16px;height:16px;top:2px;left:2px;background:#fff;border-radius:50%;transition:.2s;box-shadow:0 1px 2px #999}.switch-row input:checked+.switch{background:var(--blue)}.switch-row input:checked+.switch:after{left:16px}.range-wrap{display:flex;align-items:center;gap:10px;border:1px solid #dfe4ec;border-radius:7px;padding:8px 10px;height:38px}.range-wrap input{width:100%;accent-color:var(--blue)}.range-wrap strong{font-size:10px;white-space:nowrap;color:#42516a;min-width:55px;text-align:right}.prompt-label{margin-top:14px}.prompt-label em{font-weight:400;color:#a0a8b7}.counter{text-align:right;color:#a0a8b7;font-size:10px;margin-top:3px}.generate{width:100%;border:0;background:var(--blue);color:#fff;border-radius:7px;padding:12px;margin-top:12px;font-weight:600;cursor:pointer}.generate:disabled{opacity:.65;cursor:wait}.message{font-size:12px;min-height:17px;margin-top:9px;color:#526078}.result-card{padding:14px}.result-head{display:flex;justify-content:space-between;align-items:center}.result-head h2{margin:3px 0 4px}.result-head p{font-size:11px;color:var(--muted);margin:0}.badge{background:#eef4ff;color:var(--blue);font-size:10px;padding:5px 8px;border-radius:6px}.result-image{height:420px;border-radius:9px;background:#f1f4f8;overflow:hidden;margin-top:12px;display:grid;place-items:center}.result-image img{width:100%;height:100%;object-fit:cover}.placeholder{display:grid;place-items:center;text-align:center;max-width:330px;color:#7d899d;gap:7px;padding:25px}.placeholder strong{font-size:14px;color:#45536b}.placeholder span{font-size:11px;line-height:1.5}.spark{font-size:34px;color:var(--blue)}.actions{display:grid;grid-template-columns:1fr 1fr 1fr;gap:9px;margin-top:10px}.actions button{border:1px solid #dfe4ec;background:#fff;border-radius:7px;padding:10px;color:#33415a;font-size:12px;cursor:pointer}.actions button:disabled{opacity:.45;cursor:not-allowed}.compare{display:grid;grid-template-columns:1fr 24px 1fr;gap:8px;align-items:center;margin-top:14px}.compare>div>span{font-size:10px;color:#69758a}.mini{height:92px;background:#edf1f6;border-radius:7px;margin-top:5px;overflow:hidden}.mini img{width:100%;height:100%;object-fit:cover}.arrow{text-align:center;color:#8b97aa}.after{border:2px solid #9fc0ff}@media(max-width:1050px){.workspace{grid-template-columns:1fr}.result-image{height:500px}}@media(max-width:700px){.sidebar{display:none}.page-head,.workspace{padding-left:15px;padding-right:15px}.grid2{grid-template-columns:1fr}.result-image{height:330px}.topbar{padding-right:15px}}

/* V3 additions */
.analysis-box{margin-top:16px;min-height:280px;border:1px solid rgba(255,255,255,.08);border-radius:16px;padding:18px;background:rgba(255,255,255,.025)}
.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:8px;color:#8f96a3}.empty-state .spark{font-size:30px;color:#fff}.empty-state span{max-width:460px;line-height:1.5}
.analysis-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:16px}.analysis-grid>div{padding:12px;border:1px solid rgba(255,255,255,.08);border-radius:12px;background:rgba(0,0,0,.12)}.analysis-grid span,.prompt-preview>span{display:block;font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#8f96a3;margin-bottom:6px}.analysis-grid strong{font-size:13px;line-height:1.45;font-weight:600}
.prompt-preview{border:1px solid rgba(255,255,255,.08);border-radius:12px;padding:12px;background:#0b0d10}.prompt-preview pre{white-space:pre-wrap;font:12px/1.55 Inter,system-ui,sans-serif;color:#dfe3ea;margin:0;max-height:240px;overflow:auto}
.flow-actions{display:flex;gap:10px;margin-top:14px}.flow-actions button,.reference-list button{border:1px solid rgba(255,255,255,.1);background:#171a20;color:#f3f4f6;border-radius:10px;padding:10px 12px;cursor:pointer}.flow-actions button:disabled,.reference-list button:disabled{opacity:.45;cursor:not-allowed}.flow-actions button:hover:not(:disabled),.reference-list button:hover:not(:disabled){background:#20242c}
.reference-list{display:flex;flex-direction:column;gap:8px;margin-top:16px}.reference-list>div{display:grid;grid-template-columns:110px 1fr auto;align-items:center;gap:10px;padding:10px 12px;border:1px solid rgba(255,255,255,.07);border-radius:10px}.reference-list strong{font-size:12px}.reference-list span{font-size:12px;color:#9299a5}.reference-list button{padding:7px 10px;font-size:12px}
.note{margin-top:16px;padding:12px 14px;border-radius:10px;background:rgba(255,255,255,.035);font-size:12px;line-height:1.5;color:#9da4af}.note strong{color:#e8ebef}
@media(max-width:900px){.analysis-grid{grid-template-columns:1fr}.reference-list>div{grid-template-columns:1fr}.flow-actions{flex-direction:column}}
