:root{--bg: #f5f6f8;--panel: #fff;--line: #e3e7ee;--muted: #667085;--text: #111827;--blue: #2563eb}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}button,input,select,textarea{font:inherit}button{text-align:left}.page{max-width:1620px;margin:0 auto;padding:18px}.auth-screen{min-height:100vh;display:grid;place-items:center;padding:24px}.auth-card{width:min(420px,100%);display:flex;flex-direction:column;gap:14px;background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:18px}.auth-card label,.control-block label{display:flex;flex-direction:column;gap:7px;color:#344054;font-size:13px;font-weight:650}.segmented{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;border:1px solid var(--line);border-radius:12px;padding:4px;background:#f8fafc}.segmented button{min-height:34px;border:0;border-radius:9px;background:transparent;color:#667085;cursor:pointer;text-align:center;font-weight:650}.segmented button.active{background:#fff;color:var(--text);box-shadow:0 1px 3px #11182714}.error-text{color:#b42318}.topbar,.workspace,.panel-head,.action-row,.result-footer{display:flex}.topbar{align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px}h1,h2,p{margin:0}h1{font-size:20px}h2{font-size:14px;margin-bottom:8px}p,span,small{color:var(--muted);font-size:13px}.top-actions{display:flex;gap:10px}.workspace{display:grid;grid-template-columns:268px minmax(0,1fr) 404px;gap:14px;align-items:start}.sidebar,.main{display:flex;flex-direction:column;gap:12px}.panel{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:14px}.panel-head{align-items:center;justify-content:space-between;gap:10px}.button{min-height:40px;border:0;border-radius:11px;padding:0 14px;background:var(--text);color:#fff;cursor:pointer;font-weight:650;text-align:center}.button:disabled{cursor:not-allowed;opacity:.55}.button.secondary,.button.compact{background:#fff;color:#344054;border:1px solid var(--line)}.button.compact{min-height:32px;font-size:12px}.list{display:flex;flex-direction:column;gap:9px}.list-card,.project{border:1px solid var(--line);border-radius:13px;background:#fff;padding:11px;color:inherit;cursor:pointer;text-align:left}.list-card.active,.project.active{border-color:#9ec5ff;background:#f4f8ff}.list-card{display:flex;flex-direction:column;gap:4px}.project{display:grid;grid-template-columns:40px minmax(0,1fr);align-items:center;gap:10px;width:100%}.avatar,.thumbs i{border:1px solid #d7dee9;background:linear-gradient(135deg,#dbeafe,#f8fafc)}.avatar{width:40px;height:40px;border-radius:12px}.hero .tag{display:inline-flex;width:fit-content;margin-bottom:10px;border-radius:999px;background:#eef4ff;color:#1d4ed8;padding:6px 10px;font-size:12px}.hero h2{font-size:18px}textarea,input,select{width:100%;border:1px solid #d4dae4;border-radius:12px;background:#fff;outline:none}textarea{min-height:188px;padding:14px;resize:none;line-height:1.6}input,select{height:42px;padding:0 12px}.control-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.control-block{display:flex;flex-direction:column;gap:10px;border:1px solid #e7ebf1;border-radius:13px;background:#fbfcfe;padding:12px}.uploader{border:1.5px dashed #cfd7e4;border-radius:13px;background:#fbfcfe;padding:14px}.upload-label{display:block;cursor:pointer}.upload-label input{display:none}.thumbs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-top:12px}.thumbs i,.thumb{aspect-ratio:1;border-radius:11px}.thumb{position:relative;overflow:hidden;padding:0;border:1px solid #d7dee9;background:#fff}.thumb.active{border-color:#2563eb;box-shadow:0 0 0 2px #2563eb29}.thumb-delete{position:absolute;left:6px;top:6px;display:grid;place-items:center;width:22px;height:22px;border-radius:999px;background:#111827d1;color:#fff;font-size:13px;font-weight:750;line-height:1;cursor:pointer}.thumb-delete:hover{background:#b42318}.thumb img,.result img,.preview-modal img{width:100%;height:100%;display:block;object-fit:cover}.action-row,.result-footer{align-items:center;justify-content:space-between;gap:12px}.action-controls{display:flex;align-items:end;gap:10px}.action-controls label{display:flex;flex-direction:column;gap:6px;min-width:104px;color:#344054;font-size:12px;font-weight:650}.action-controls select{height:40px}.results{display:flex;flex-direction:column;gap:12px}.result-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}.result{min-height:148px;position:relative;overflow:hidden;border:1px solid var(--line);border-radius:13px;background:radial-gradient(circle at 26% 24%,rgba(37,99,235,.14),transparent 36%),radial-gradient(circle at 76% 70%,rgba(15,118,110,.12),transparent 34%),linear-gradient(135deg,#f9fafb,#e8edf5)}.result-image-button{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;border:0;background:transparent;cursor:zoom-in;padding:0}.result.large{grid-column:span 2}.result>span{position:absolute;left:10px;top:10px;border-radius:999px;background:#111827c7;color:#fff;padding:5px 8px;font-size:11px}.result-actions{position:absolute;top:8px;right:8px;display:flex;gap:6px;opacity:0;transition:opacity .16s ease}.result:hover .result-actions,.result:focus-within .result-actions{opacity:1}.result-actions button,.preview-toolbar button{display:grid;place-items:center;width:34px;height:34px;border:1px solid rgba(255,255,255,.18);border-radius:999px;background:#111827c7;color:#fff;cursor:pointer;padding:0}.result-actions button:hover,.preview-toolbar button:hover{background:#111827f0}.result-badge{position:absolute;left:10px;right:10px;bottom:10px;display:block;overflow:hidden;border-radius:10px;background:#111827d6;color:#fff;padding:7px 9px;text-overflow:ellipsis;white-space:nowrap;font-size:11px}.overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:20;display:flex;justify-content:flex-end;background:#1118275c;padding:18px}.preview-overlay{z-index:30;justify-content:center;align-items:center;background:#111827c2}.modal,.drawer{background:var(--panel);border:1px solid var(--line);box-shadow:0 24px 70px #11182738}.preview-modal{width:min(1180px,calc(100vw - 36px));height:min(860px,calc(100vh - 36px));display:grid;grid-template-rows:auto minmax(0,1fr);gap:12px}.preview-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px}.preview-toolbar span{color:#fff;font-weight:700}.preview-toolbar div{display:flex;gap:8px}.preview-modal img{min-height:0;object-fit:contain}.modal{width:min(860px,100%);max-height:min(760px,calc(100vh - 36px));margin:auto;border-radius:14px;padding:16px;overflow:hidden}.drawer{width:min(420px,100%);height:100%;border-radius:14px;padding:16px;overflow:auto}.drawer,.drawer label{display:flex;flex-direction:column;gap:12px}.drawer label{gap:7px;color:#344054;font-size:13px;font-weight:650}.history-list{display:flex;flex-direction:column;gap:10px;max-height:calc(100vh - 150px);margin-top:14px;overflow:auto}.history-item{display:grid;grid-template-columns:minmax(0,1fr) 120px;gap:14px;align-items:center;width:100%;border:1px solid var(--line);border-radius:13px;background:#fff;padding:12px;cursor:pointer}.history-item strong,.history-item span,.history-item small{display:block}.history-item strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.history-thumbs{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.history-thumbs span{aspect-ratio:1;overflow:hidden;border:1px solid var(--line);border-radius:9px;background:linear-gradient(135deg,#f9fafb,#e8edf5)}.history-thumbs img{width:100%;height:100%;display:block;object-fit:cover}.empty-text{padding:24px;border:1px dashed var(--line);border-radius:13px;text-align:center}.setting-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.toggle-row{flex-direction:row!important;align-items:center}.toggle-row input{width:18px;height:18px}@media (max-width: 1280px){.workspace{grid-template-columns:1fr}}@media (max-width: 720px){.topbar,.top-actions,.action-row,.action-controls,.result-footer{align-items:stretch;flex-direction:column}.control-grid,.history-item,.setting-grid{grid-template-columns:1fr}.overlay{padding:10px}.modal,.drawer{max-height:calc(100vh - 20px);height:auto}.preview-modal{width:calc(100vw - 20px);height:calc(100vh - 20px)}.result-actions{opacity:1}}
