:root{--bg:#f2f1eb;--panel:#fbfaf6;--text:#252821;--muted:#7b8071;--line:#dedfd5;--accent:#d9ed78;--dark:#31392b}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:14px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}button,input,textarea,select{font:inherit}button,a{touch-action:manipulation}button{cursor:pointer;border:1px solid var(--line);border-radius:9px;padding:9px 13px;background:var(--panel);color:var(--text)}button:hover{background:#edeedf}button:disabled{opacity:.45;cursor:default}input,select,textarea{border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--text);padding:10px;outline:none}input:focus,select:focus,textarea:focus{border-color:#83964b;box-shadow:0 0 0 3px #d9ed783c}label{display:block;font-weight:600;margin-bottom:7px}.brand{font-size:25px;letter-spacing:-1.4px;font-weight:900;line-height:1}.brand span{display:block;font-size:9px;letter-spacing:2.2px;font-weight:500;margin-top:7px;color:var(--muted)}h1,h2,p{margin-top:0}h2{font-size:14px;font-weight:700;margin:0}.primary{background:var(--accent);border-color:var(--accent);font-weight:700}.primary:hover{background:#cce363}.login{min-height:100vh;display:grid;place-items:center;padding:24px}.login form{width:430px;max-width:100%;background:var(--panel);border:1px solid var(--line);border-radius:22px;padding:44px}.login .brand{margin-bottom:44px}.login h1{font-size:28px;letter-spacing:-1px}.login p{color:var(--muted)}.login input,.login button{width:100%}.login button{margin-top:16px}.login #loginError{margin:18px 0 0;color:#a63a30;font-size:13px}header{height:88px;display:flex;align-items:center;justify-content:space-between;padding:0 30px;border-bottom:1px solid var(--line);background:var(--panel)}.header-right{display:flex;gap:15px;align-items:center;font-size:12px}.badge{background:var(--accent);border-radius:5px;padding:3px 7px;font-weight:700}.quiet{border:0;color:var(--muted);background:transparent}main{display:grid;grid-template-columns:218px minmax(300px,1fr) 310px;min-height:calc(100vh - 128px)}.library,.controls{background:var(--panel);padding:24px 20px}.library{border-right:1px solid var(--line)}.controls{border-left:1px solid var(--line)}.section-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.section-head>span{font-size:12px;color:var(--muted)}.section-head .spark{font-size:22px;color:#65733e}.upload{width:100%;border-style:dashed;padding:13px 6px;margin-bottom:20px;font-size:12px}.image-list{display:grid;grid-template-columns:1fr 1fr;gap:9px;max-height:calc(100vh - 250px);overflow:auto}.thumb{padding:3px;text-align:left;border:2px solid transparent;background:#efeee6;overflow:hidden}.thumb.active{border-color:#96a949}.thumb img{display:block;width:100%;height:80px;object-fit:contain;border-radius:5px}.thumb span{display:block;font-size:10px;padding:4px 2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.workspace{padding:20px 26px;min-width:0;display:flex;flex-direction:column}.toolbar{display:flex;justify-content:space-between;align-items:center;gap:8px;min-height:40px;margin-bottom:16px}.toolbar>div{display:flex;gap:6px}.toolbar button{font-size:12px}.download{background:var(--dark);color:white;text-decoration:none;padding:9px 13px;border-radius:8px;font-size:12px}.stage{flex:1;min-height:360px;display:flex;justify-content:center;align-items:center;background-color:#e9e9df;background-image:linear-gradient(45deg,#e3e3d9 25%,transparent 25%),linear-gradient(-45deg,#e3e3d9 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e3e3d9 75%),linear-gradient(-45deg,transparent 75%,#e3e3d9 75%);background-size:24px 24px;background-position:0 0,0 12px,12px -12px,-12px 0;border:1px solid var(--line);border-radius:12px;overflow:hidden;padding:16px}canvas{display:block;max-width:100%;max-height:calc(100vh - 270px);height:auto;width:auto;object-fit:contain;box-shadow:0 10px 30px #2223}canvas.cropping{cursor:crosshair;touch-action:none}#empty{text-align:center;padding:20px}#empty h1{font-size:25px;letter-spacing:-.7px}#empty p{font-size:13px;color:var(--muted)}.empty-icon{font-size:55px;color:#788b3f;margin:12px}.caption{display:flex;justify-content:space-between;gap:12px;font-size:11px;color:var(--muted);padding-top:13px}.notice{font-size:12px;color:#7d512f;margin:12px 0 0;min-height:20px}.muted{color:var(--muted);font-size:12px}.small{font-size:11px}.controls textarea{width:100%;height:190px;resize:vertical;font-size:13px;line-height:1.6;margin-bottom:13px}.source-choice{display:flex;align-items:center;gap:8px}.source-choice label{font-size:12px;margin:0;font-weight:500}.source-choice input{accent-color:#83964b}.options{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:20px 0}.options label{font-size:12px}.options select{display:block;width:100%;margin-top:8px}.fixed-size{background:#f0f0e6;border:1px solid var(--line);border-radius:9px;padding:10px;margin-top:8px}.generate{width:100%;padding:14px}.billing{font-size:10px;line-height:1.6;color:var(--muted);border-bottom:1px solid var(--line);padding:4px 0 20px;margin:0 0 20px}.history-title{display:flex;justify-content:space-between;margin-bottom:12px}.history-title span{font-size:11px;color:var(--muted)}#jobs{max-height:260px;overflow:auto}.job{border:1px solid var(--line);border-radius:9px;margin-bottom:8px;padding:10px}.job button{font-size:11px;padding:5px 8px}.job p{font-size:11px;margin:5px 0;white-space:pre-wrap;overflow-wrap:anywhere}.job .job-prompt{color:var(--muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.job time{font-size:10px;color:var(--muted)}.job-actions{display:flex;gap:6px;margin-top:8px}.crop-bar{display:flex;flex-wrap:wrap;align-items:center;gap:9px;margin-bottom:12px}.crop-bar label{display:flex;align-items:center;gap:8px;font-size:12px;margin:0}.crop-bar button{font-size:11px}.crop-bar select{padding:7px;font-size:12px}footer{height:40px;display:flex;justify-content:space-between;padding:12px 30px;border-top:1px solid var(--line);font-size:9px;letter-spacing:1px;color:var(--muted)}[hidden]{display:none!important}@media(min-width:1600px){main{grid-template-columns:250px minmax(500px,1fr) 350px}.controls textarea{height:230px}.thumb img{height:90px}}@media(max-width:1050px){main{grid-template-columns:160px minmax(250px,1fr) 280px}.library,.controls{padding:20px 14px}.workspace{padding:16px}.thumb img{height:60px}}@media(max-width:780px){header{height:75px;padding:0 18px}.header-right{gap:8px}.header-right #model{max-width:95px;font-size:10px}main{display:flex;flex-direction:column}.library{order:2;border:0;border-bottom:1px solid var(--line);padding:15px}.library .section-head{margin-bottom:10px}.upload{margin-bottom:10px;width:auto}.image-list{display:flex;max-height:130px;overflow-x:auto}.thumb{min-width:90px;max-width:90px}.thumb img{height:65px}.workspace{order:1;min-height:430px}.stage{min-height:310px}canvas{max-height:55vh}.controls{order:3;border:0;padding:22px}.controls textarea{height:140px}#jobs{max-height:380px}footer{padding:12px 16px}footer span{display:none}.login form{padding:30px}}
header{height:auto;min-height:88px;gap:18px;padding-top:15px;padding-bottom:15px;flex-wrap:wrap}nav{display:flex;gap:6px}nav button[aria-pressed=true]{background:var(--accent);border-color:var(--accent)}.balance{text-align:left;min-width:125px;padding:6px 10px}.balance small,.balance strong{display:block}.balance small{color:var(--muted);font-size:10px}.balance strong{font-size:13px}.save-prompt{width:100%;font-size:11px;margin:0 0 14px}.job-actions{flex-wrap:wrap}details summary{cursor:pointer;color:#65733e;font-size:11px}.prompts-page{max-width:1100px;min-height:calc(100vh - 128px);margin:auto;padding:34px 26px}.prompts-page h1{font-size:24px;margin-bottom:6px}.prompts-page .muted{margin-bottom:0}.prompts-page input{width:100%;margin-bottom:12px}.prompt-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:16px;margin-top:20px}.prompt-card{min-width:0;background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:20px}.prompt-card h2{font-size:16px;overflow-wrap:anywhere}.prompt-preview{white-space:pre-wrap;overflow-wrap:anywhere;color:var(--muted);font-size:12px;margin:12px 0;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}.prompt-full{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px}.prompt-card button{font-size:12px}dialog{width:540px;max-width:calc(100vw - 32px);max-height:90vh;overflow:auto;border:1px solid var(--line);border-radius:18px;background:var(--panel);color:var(--text);padding:28px}dialog::backdrop{background:#20251b99}dialog h2{font-size:21px;margin-bottom:20px}dialog input,dialog textarea{width:100%;margin-bottom:16px}dialog textarea{height:230px;resize:vertical;line-height:1.6}dialog a{color:#4d6330}dialog p{font-size:13px;overflow-wrap:anywhere}.dialog-actions{display:flex;justify-content:flex-end;gap:10px}#promptError,#walletError{color:#a63a30;min-height:18px}@media(max-width:780px){header{padding:16px 18px}.header-right{flex-wrap:wrap;justify-content:space-between;width:100%}.prompts-page{padding:24px 18px}.prompts-page .section-head{gap:12px;align-items:flex-start}.prompts-page .section-head button{font-size:12px}dialog{padding:22px}.prompt-list{grid-template-columns:1fr}}
.toolbar{flex-wrap:wrap}.toolbar>.zoom-controls{align-items:center;gap:5px}.zoom-controls button{padding:7px 9px}.zoom-controls span{font-size:11px;min-width:38px;text-align:center;font-variant-numeric:tabular-nums}.stage{position:relative;isolation:isolate;touch-action:pan-y}canvas{transform-origin:center center;flex-shrink:0}.stage.can-pan{cursor:grab;touch-action:none}.stage.panning{cursor:grabbing}.generation-progress{padding:13px;margin:14px 0;border:1px solid var(--line);border-radius:10px;background:#f0f3e7}.progress-heading{display:flex;justify-content:space-between;gap:10px;font-size:12px}.progress-heading span{font-variant-numeric:tabular-nums}.generation-progress progress{display:block;width:100%;height:9px;accent-color:#83964b;margin:12px 0}.generation-progress p{font-size:11px;margin:6px 0 0;line-height:1.5}.generation-progress progress::-webkit-progress-bar{background:#dde2ce;border-radius:8px}.generation-progress progress::-webkit-progress-value{background:#83964b;border-radius:8px}@media(prefers-reduced-motion:reduce){.generation-progress progress{animation:none}}
#modelSelect{width:100%;font-size:13px;margin-bottom:7px}#modelPrice{line-height:1.6;margin-bottom:18px}
.photo-card{position:relative;min-width:0}.photo-card .thumb{width:100%;height:100%}.delete-photo{position:absolute;right:4px;top:4px;width:26px;height:26px;padding:0;border-radius:50%;background:#fbfaf6ed;border-color:#d5d7cc;font-size:20px;line-height:22px;box-shadow:0 1px 4px #0002}.delete-photo:hover{background:#ffe5e0;color:#9d3329}.assistant-page{max-width:960px;min-height:calc(100vh - 128px);margin:auto;padding:34px 26px}.assistant-page h1{font-size:24px;margin-bottom:6px}.assistant-page .section-head{gap:16px}.assistant-page .section-head p{margin-bottom:0}#assistantChats{width:100%;margin-bottom:18px}.assistant-setup{border:1px solid var(--line);background:#f0f3e7;padding:16px;border-radius:10px}.assistant-messages{max-height:55vh;min-height:160px;overflow:auto;padding:4px 8px 12px 0;scroll-behavior:smooth}.chat-message{max-width:88%;border:1px solid var(--line);border-radius:12px;background:var(--panel);padding:16px 18px;margin:0 0 12px}.chat-message p{white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0;font-size:13px}.chat-message strong{font-size:12px}.chat-message small{display:block;font-size:10px;margin-top:8px}.user-message{margin-left:auto;background:#edf1df}.assistant-page textarea{width:100%;height:130px;resize:vertical;line-height:1.6}.assistant-options,.assistant-send{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:12px 0}.assistant-options button{font-size:11px}.assistant-send span{font-size:12px;color:var(--muted);overflow-wrap:anywhere}.assistant-send button{flex-shrink:0}#assistantSource{min-height:16px;overflow-wrap:anywhere}@media(max-width:780px){.photo-card{min-width:90px;max-width:90px}.assistant-page{padding:24px 18px}.chat-message{max-width:95%}.assistant-options{flex-wrap:wrap}.assistant-page .section-head{align-items:flex-start}.assistant-page .section-head button{font-size:12px}}@media(prefers-reduced-motion:reduce){.assistant-messages{scroll-behavior:auto}}
.rotation-handles{position:absolute;inset:0;pointer-events:none;opacity:0;transition:opacity .12s;z-index:2}.stage:hover .rotation-handles,.stage.rotating .rotation-handles,.rotation-handles:focus-within{opacity:1}.rotation-handle{position:absolute;pointer-events:auto;transform:translate(-50%,-50%);width:32px;height:32px;padding:0;border-radius:50%;background:#fbfaf6f2;border:1px solid #83964b;color:#4e6530;box-shadow:0 2px 7px #0003;font-size:23px;line-height:30px;cursor:grab;touch-action:none;user-select:none}.rotation-handle:hover,.rotation-handle:focus-visible{background:var(--accent);outline:2px solid #65733e;outline-offset:2px}.rotation-dragging,.rotation-dragging .rotation-handle{cursor:grabbing!important}#rotateBar>span{font-size:11px;color:var(--muted)}@media(hover:none){.rotation-handles{opacity:1}}@media(prefers-reduced-motion:reduce){.rotation-handles{transition:none}}

.history-page{max-width:1150px;min-height:calc(100vh - 128px);margin:auto;padding:34px 26px}.history-page h1{font-size:24px;margin-bottom:6px}.history-page #jobs{max-height:none;overflow:visible;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.history-page .job{min-width:0;background:var(--panel);padding:18px;margin:0}.history-page .job p{font-size:13px}.history-page .job button{font-size:12px;padding:7px 10px}.history-photo{display:block;width:100%;margin:12px 0;background:#fff}.history-photo img{display:block;width:100%;height:170px;object-fit:contain}.history-page #moreHistory{display:block;margin:22px auto}.photo-generation{border:1px solid var(--line);border-radius:9px;padding:12px 14px;margin-top:12px;background:var(--panel)}.photo-generation summary{font-size:13px;font-weight:600}.photo-generation>p{margin:12px 0 0}.photo-generation .prompt-full{max-height:260px;overflow:auto;font-size:13px}.photo-generation button{font-size:12px}.history-page .prompt-full{max-height:360px;overflow:auto}@media(max-width:780px){nav{flex-wrap:wrap}.history-page{padding:24px 18px}.history-page #jobs{grid-template-columns:1fr}.history-page .section-head{gap:14px;align-items:flex-start}}
