@font-face{font-family:Book;src:url('/fonts/serif.ttf');font-display:swap}@font-face{font-family:Plain;src:url('/fonts/sans.ttf');font-display:swap}
:root{color-scheme:dark;--bg:#080809;--text:#eeeae2;--muted:#b5b1a8;--accent:#bda784;--line:#ffffff18;--tg-safe-top:0px;--tg-safe-bottom:0px;--tg-safe-left:0px;--tg-safe-right:0px}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif}main{max-width:1320px;margin:auto;padding:20px 32px 24px}header{height:48px;display:flex;align-items:flex-start}.brand{font:18px/1.3 Book,serif;color:var(--text);text-decoration:none}.workspace{display:grid;grid-template-columns:300px minmax(0,1fr);gap:48px;align-items:start}.editor{min-width:0;padding-bottom:8px;max-height:calc(var(--app-height,100dvh) - 92px);overflow-y:auto;scrollbar-width:thin;scrollbar-color:#454039 transparent}.mode{display:flex;gap:4px;margin:0 0 18px;background:#141414;border-radius:10px;padding:4px}.mode button{flex:1;border:0;min-height:40px;color:var(--muted);background:transparent;border-radius:7px}.mode button[aria-pressed=true]{background:#242322;color:var(--text)}button,input,textarea,select{font:14px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif}button{cursor:pointer;color:var(--text);border:1px solid var(--line);border-radius:8px;padding:11px 12px;background:transparent;min-height:44px}button:disabled{opacity:.45;cursor:default}button:active:not(:disabled){transform:translateY(1px)}input,textarea,select{width:100%;min-width:0;display:block;background:#141415;color:var(--text);border:1px solid var(--line);border-radius:8px;padding:11px 12px;min-height:44px}textarea{resize:vertical;min-height:92px;line-height:1.55}input:focus,select:focus,textarea:focus,button:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px}label{display:block;color:var(--muted);font-size:13px;margin:14px 0 7px}.hero-upload{display:flex;align-items:center;gap:16px;margin:0;position:relative;cursor:pointer;min-height:92px}.hero-visual{width:72px;height:88px;flex-shrink:0;background:#151515;border-radius:8px;overflow:hidden;display:grid;place-items:center}.hero-visual img{width:100%;height:100%;object-fit:cover}.hero-visual>span{font-size:26px;color:var(--accent)}.upload-copy{display:flex;flex-direction:column;gap:5px;min-width:0}.upload-copy strong{font-size:14px;font-weight:500;color:var(--text)}#filename{font-size:12px;max-width:205px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#heroAction{font-size:14px;color:var(--accent);text-decoration:underline;text-underline-offset:4px}.hero-upload input,.add-references input,.replace-reference input{position:absolute;width:1px;height:1px;opacity:0;min-height:0;padding:0;border:0}.hero-upload:focus-within,.add-references:focus-within,.replace-reference:focus-within{outline:2px solid var(--accent);outline-offset:2px}.references-section{margin:8px 0 16px}.add-references{display:flex;align-items:center;gap:8px;position:relative;min-height:44px;margin:0;color:var(--muted);font-size:13px;cursor:pointer}.add-references>span:first-child{font-size:19px;color:var(--accent)}#referenceCount{margin-left:auto;font-size:12px}.add-references[aria-disabled=true]{opacity:.5}.reference-grid{display:flex;gap:10px;overflow-x:auto;scrollbar-width:thin}.reference-card{flex:0 0 136px;min-width:0;padding-bottom:4px}.reference-card img{display:block;width:136px;height:82px;object-fit:cover;border-radius:6px}.reference-name{display:none}.reference-actions{display:flex;gap:6px;margin-top:5px}.replace-reference{position:relative;display:grid;place-items:center;margin:0;min-height:44px;flex:1;font-size:12px;color:var(--muted);cursor:pointer}.remove-reference{min-width:44px;flex:0 0 44px;padding:0;font-size:20px;color:var(--muted);border:0}.world-heading{display:flex;align-items:center;justify-content:space-between;margin-top:14px;gap:12px}.world-heading label{margin:0}.world-heading select{width:auto;max-width:205px;min-height:44px;background:transparent;border:0;padding:8px 0;color:var(--accent);font-size:13px}.world-heading+textarea{margin-top:3px}details{border-top:1px solid var(--line);margin-top:15px;padding-top:3px}summary{font-size:13px;color:var(--muted);cursor:pointer;min-height:44px;padding:12px 0;list-style:none}summary::-webkit-details-marker{display:none}summary:before{content:'＋';color:var(--accent);margin-right:8px}details[open]>summary:before{content:'−'}.caption-fields{padding:0 0 10px}.row{display:flex;gap:10px}.row label{flex:1;min-width:0}.row select{margin-top:7px}.formats{padding:0;border:0;margin:16px 0 0;min-width:0}.formats legend{font-size:13px;color:var(--muted);margin-bottom:7px}.format-options{display:flex;gap:8px}.format-options label{flex:1;margin:0;cursor:pointer;position:relative}.format-options input{position:absolute;opacity:0;width:1px;height:1px;min-height:0;padding:0;border:0}.format-options span{min-height:44px;display:grid;place-items:center;border:1px solid var(--line);border-radius:8px;color:var(--muted);font-size:13px}.format-options input:checked+span{color:var(--accent);border-color:#bda78488}.format-options input:focus-visible+span{outline:2px solid var(--accent)}.account-panel{margin-top:0}.account-panel summary span{float:right;color:var(--accent);font-size:13px}.account-content p{font-size:12px;color:var(--muted);margin:8px 0}.package-plans{display:flex;gap:16px;margin:14px 0}.package-plan{flex:1;min-width:0}.package-plan strong{display:block;font-size:13px;font-weight:500}.package-plan span{display:block;color:var(--muted);font-size:12px;margin-top:4px}.account-content a{display:block;margin:10px 0}.create-bar{padding-top:12px;position:sticky;bottom:0;background:var(--bg)}.primary,.download{background:#bda784;color:#111110;border:0;font-weight:600}.primary{width:100%;min-height:48px}.operation-note{font-size:12px;line-height:1.3;color:var(--muted);text-align:center;margin:8px 0 0}#status{font-size:12px;color:var(--muted);line-height:1.45;text-align:center;margin:6px 0 0}.result{min-width:0}.result-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;color:var(--muted);font-size:12px}#badge{color:var(--accent)}.preview{position:relative;display:flex;align-items:center;justify-content:center;min-height:420px;background:#0c0c0d;border-radius:4px;overflow:hidden}canvas{display:block;width:auto;height:auto;max-width:100%;max-height:calc(var(--app-height,100dvh) - 194px);margin:auto}#empty{position:absolute;inset:0;display:grid;place-content:center;text-align:center;color:var(--muted);background:#0c0c0d}#empty span{color:var(--accent);font-size:28px}#empty p{font-size:14px;margin:12px 0}.actions{display:flex;justify-content:center;gap:10px;margin-top:12px}.actions button{font-size:13px}.download{min-width:120px}.compare{display:block;margin:8px auto 0;border:0;padding:6px 10px;color:var(--muted);font-size:12px;min-height:36px}.compare[aria-pressed=true]{color:var(--accent)}.open-png{display:block;text-align:center;font-size:12px;color:var(--accent);margin-top:6px}.secondary{width:100%;margin-top:12px}.text-button{border:0;color:var(--accent);padding-left:0;font-size:13px}.caption-suggestion{font-size:12px;color:var(--muted);margin-top:8px}.caption-suggestion .text-button{display:block}.refine{max-width:660px;margin:16px auto 0}.refine summary{font-size:14px}a{color:var(--accent)}#mobileDock{display:none}[hidden]{display:none!important}
@media(min-width:1100px){.workspace{grid-template-columns:310px minmax(0,1fr);gap:60px}.preview{background:transparent}}
@media(max-width:760px){body{overflow:hidden}main{height:var(--app-height,100dvh);min-height:0;display:flex;flex-direction:column;padding:calc(12px + max(env(safe-area-inset-top),var(--tg-safe-top))) max(16px,var(--tg-safe-left)) 0 max(16px,var(--tg-safe-right));max-width:560px}header{flex-shrink:0;height:auto;min-height:40px;padding-bottom:12px;align-items:center}.brand{font-size:15px}.workspace{display:flex;flex-direction:column;gap:20px;flex:1;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;padding-bottom:18px;scrollbar-width:none}.editor{flex-shrink:0;width:100%;max-height:none;overflow:visible;padding:0}.mode{margin-bottom:14px}.hero-visual{width:64px;height:78px}.hero-upload{min-height:78px}.references-section{margin:4px 0 8px}.result{width:100%;flex-shrink:0}.workspace.has-result .result{order:-1}.result-heading{margin:0 0 8px}.preview{min-height:0;border-radius:4px}canvas{max-height:none;width:100%;height:auto}#empty{min-height:300px}.preview:has(#empty:not([hidden])){min-height:300px}.actions{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:10px}.actions #download{grid-column:1/-1;min-height:46px}.actions button{font-size:13px;padding:11px 7px}.compare{min-height:44px;margin-top:2px}.world-heading{margin-top:12px}.world-heading select{font-size:13px}.editor>label{margin-top:12px}input,textarea,select{font-size:16px}textarea{min-height:88px}#mobileDock{display:block;flex-shrink:0;background:var(--bg);padding:8px 0 calc(10px + max(env(safe-area-inset-bottom),var(--tg-safe-bottom)));border-top:1px solid var(--line)}#mobileDock .create-bar{position:static;padding:0}.operation-note{font-size:11px;margin-top:6px}#status{font-size:12px}.package-plans{font-size:12px}.refine{padding-bottom:8px}.keyboard-open .workspace{scroll-padding-block:12px}}
@media(max-width:360px){main{padding-left:max(12px,var(--tg-safe-left));padding-right:max(12px,var(--tg-safe-right))}.brand{font-size:14px}.row{flex-direction:column;gap:0}.world-heading select{max-width:175px}.actions button{font-size:12px}}
@media(prefers-reduced-motion:reduce){button:active:not(:disabled){transform:none}}
.ready-source:empty{display:none}
@media(max-width:760px){.ready-source{display:flex;align-items:center;gap:12px;margin-bottom:12px}.ready-source .mode{flex:0 0 150px;margin:0}.ready-source .hero-upload{flex:1;min-width:0;min-height:48px;gap:8px}.ready-source .hero-visual{width:40px;height:48px}.ready-source .upload-copy strong,.ready-source #filename{display:none}.ready-source #heroAction{font-size:13px}}
@media(max-width:360px){.ready-source{gap:8px}.ready-source .mode{flex-basis:140px}.ready-source .mode button{font-size:13px}.ready-source .hero-visual{width:32px;height:42px}}
@media(min-width:761px){canvas{max-height:calc(var(--app-height,100dvh) - 232px)}}
.mode button,.compare{min-height:44px}
@media(max-width:760px){.world-heading select{font-size:16px}}
