*{box-sizing:border-box}body{margin:0;min-height:100svh;font-family:Arial,"PingFang SC","Microsoft YaHei",sans-serif;line-height:1.5;font-size:16px}button,input,textarea,select{font:inherit}button,a,input,textarea,select{-webkit-tap-highlight-color:transparent}button,a{touch-action:manipulation}button{cursor:pointer}a{color:inherit;text-decoration:none}button:disabled{cursor:not-allowed;opacity:.45}[hidden]{display:none!important}svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}button:focus-visible,a:focus-visible,textarea:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:2px solid var(--tg-focus);outline-offset:4px}.gen-header,.gen-main,.gen-footer{max-width:1360px;margin:0 auto;padding-left:40px;padding-right:40px}.gen-header{height:96px;display:flex;align-items:center;justify-content:space-between;gap:24px}.gen-brand{display:flex;align-items:center;gap:16px;font-size:16px;font-weight:700;letter-spacing:3px;min-height:44px}.gen-brand>span:first-child{color:var(--muted);font-weight:400}.gen-wordmark{font-size:12px;font-weight:400;letter-spacing:2px}.gen-header nav{display:flex;align-items:center;gap:18px}.gen-home{font-size:13px;min-height:44px;display:flex;align-items:center;color:var(--muted)}.gen-icon{width:44px;min-width:44px;height:44px;display:grid;place-items:center;background:var(--tg-soft);color:var(--text);border:1px solid var(--line);border-radius:50%}.gen-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:32px;padding:28px 0 36px}.gen-eyebrow{font-size:10px;letter-spacing:1.8px;color:var(--muted)}.gen-heading .gen-eyebrow{margin:0 0 14px}.gen-heading h1{font-size:clamp(28px,3.2vw,42px);font-weight:500;line-height:1.25;letter-spacing:-1px;margin:0 0 12px}.gen-subtitle{font-size:14px;margin:0;color:var(--muted)}.gen-model{display:flex;flex-direction:column;align-items:flex-end;gap:8px;font-size:12px;flex-shrink:0}.gen-connection{display:inline-flex;align-items:center;gap:7px;color:var(--muted)}.gen-connection:before{content:"";height:5px;width:5px;background:currentColor;border-radius:50%}.gen-connection[data-ready="true"]{color:var(--text)}.gen-notice{display:flex;align-items:center;gap:16px;border:1px solid var(--line);border-radius:14px;padding:14px 18px;margin-bottom:20px;color:var(--muted);font-size:13px;background:var(--tg-soft)}.gen-notice p{margin:0;flex:1}.gen-notice a{text-decoration:underline;text-underline-offset:4px;white-space:nowrap}.gen-small{background:var(--tg-soft);border:1px solid var(--line);color:var(--text);padding:9px 14px;min-height:44px;border-radius:10px;font-size:12px;white-space:nowrap}.gen-workspace{display:grid;grid-template-columns:minmax(300px,410px) minmax(0,1fr);gap:24px;align-items:start}.gen-card{position:relative;background:var(--tg-core);border:1px solid var(--line);border-radius:24px;box-shadow:inset 0 1px 0 var(--tg-edge-mid),0 12px 38px var(--tg-shadow);padding:26px;overflow:hidden}.gen-section-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:24px;min-height:22px}.gen-section-head h2{margin:0;font-size:15px;font-weight:500;letter-spacing:.3px}.gen-composer label{display:block;font-size:12px;color:var(--text);margin-bottom:10px}.gen-composer textarea,.gen-composer select,.gen-composer input[type=number]{width:100%;border:1px solid var(--tg-edge-mid);border-radius:12px;background:var(--tg-input);color:var(--text);padding:13px 14px;min-height:48px}.gen-composer textarea{resize:vertical;min-height:180px;font-size:16px;line-height:1.65}.gen-composer textarea::placeholder,.gen-composer input::placeholder{color:var(--muted);opacity:1}.gen-field-meta{display:flex;justify-content:space-between;gap:18px;color:var(--muted);font-size:11px;margin:10px 0 26px}.gen-field-meta>span:last-child{white-space:nowrap}.gen-reference-head{display:flex;justify-content:space-between;gap:12px;align-items:baseline}.gen-reference-head .gen-muted{font-size:11px}.gen-upload{width:100%;min-height:124px;border:1px dashed var(--tg-edge-mid);background:var(--tg-soft);color:var(--muted);border-radius:14px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;margin:0 0 24px}.gen-upload>span{font-size:12px;color:var(--text)}.gen-upload small{font-size:11px}.gen-upload svg{width:24px;height:24px;margin-bottom:2px}.gen-upload.is-dragging{border-color:var(--text);background:var(--tg-selected)}.gen-file{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.gen-reference-preview{display:flex;align-items:center;gap:12px;border:1px solid var(--line);background:var(--tg-soft);border-radius:14px;padding:10px;margin-bottom:24px}.gen-reference-preview img{width:68px;height:68px;border-radius:8px;object-fit:cover}.gen-reference-preview>div{flex:1;min-width:0}.gen-reference-preview span{display:block;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gen-reference-preview small{display:block;font-size:11px;color:var(--muted);margin-top:4px}.gen-options{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:14px}.gen-options select{font-size:13px}.gen-advanced{margin:20px 0}.gen-advanced summary{cursor:pointer;font-size:12px;color:var(--muted);min-height:44px;padding:12px 0}.gen-advanced label{margin-top:14px}.gen-advanced small{display:block;font-size:11px;color:var(--muted);margin:9px 0}.gen-submit{display:flex;justify-content:space-between;align-items:center;gap:16px;width:100%;border:0;border-radius:13px;padding:15px 18px;background:var(--tg-action);color:var(--tg-action-ink);font-size:14px;min-height:52px}.gen-private{font-size:11px;text-align:center;color:var(--muted);margin:13px 0 0}.gen-results{min-height:640px}.gen-empty{min-height:530px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:30px;color:var(--muted)}.gen-empty svg{width:58px;height:58px;stroke-width:1;margin-bottom:22px;opacity:.55}.gen-empty h3{font-size:15px;font-weight:400;margin:0 0 9px;color:var(--text)}.gen-empty p{font-size:12px;margin:0}.gen-progress{display:flex;align-items:center;gap:14px;padding:20px;border:1px solid var(--line);background:var(--tg-soft);border-radius:14px;margin-bottom:20px}.gen-progress strong{font-size:14px;font-weight:500}.gen-progress p{font-size:12px;color:var(--muted);margin:4px 0 0}.gen-spinner{width:24px;height:24px;flex-shrink:0;border:1px solid var(--line);border-top-color:var(--text);border-radius:50%;animation:gen-spin 1.2s linear infinite}.gen-images{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.gen-images:has(figure:only-child){grid-template-columns:minmax(0,1fr)}.gen-images figure{margin:0;min-width:0}.gen-images img,.gen-images video{display:block;width:100%;height:auto;object-fit:contain;max-height:760px;border-radius:14px;background:var(--tg-soft)}.gen-images figcaption{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px;font-size:11px;color:var(--muted)}.gen-images a{min-height:44px;display:flex;align-items:center;gap:6px;padding:8px 10px;border:1px solid var(--line);border-radius:9px;font-size:12px;color:var(--text)}.gen-images a svg{width:15px;height:15px}.gen-error{color:var(--text);border-left:2px solid var(--muted);padding:0 0 0 12px;font-size:13px;line-height:1.7;margin:15px 0}.gen-muted{color:var(--muted);font-size:12px}.gen-result-meta{margin:24px 0 0;overflow-wrap:anywhere}.gen-history-section{margin-top:40px}.gen-history-section>.gen-section-head{margin-bottom:18px}.gen-history{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.gen-history-item{display:flex;align-items:center;gap:12px;text-align:left;color:var(--text);background:var(--tg-soft);border:1px solid var(--line);border-radius:14px;min-height:84px;padding:12px;min-width:0}.gen-history-item img,.gen-history-placeholder{width:56px;height:56px;object-fit:cover;background:var(--tg-input);border-radius:8px;flex-shrink:0}.gen-history-placeholder{display:grid;place-items:center;color:var(--muted)}.gen-history-item>div{min-width:0}.gen-history-item strong{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:12px;font-weight:400;overflow-wrap:anywhere}.gen-history-item small{font-size:10px;color:var(--muted);display:block;margin-top:5px}.gen-history-item[aria-pressed=true]{border-color:var(--muted)}.gen-footer{display:flex;justify-content:space-between;align-items:center;gap:16px;padding-top:42px;padding-bottom:max(32px,env(safe-area-inset-bottom));font-size:10px;letter-spacing:2px;color:var(--muted)}.gen-footer span{letter-spacing:0}.gen-skip{position:fixed;top:-100px;left:16px;background:var(--tg-action);color:var(--tg-action-ink);padding:12px 16px;z-index:10;border-radius:8px}.gen-skip:focus{top:16px}button,a{transition:background-color .18s,border-color .18s,opacity .18s}@media(hover:hover){button:not(:disabled):hover,.gen-history-item:hover{border-color:var(--muted)}.gen-submit:not(:disabled):hover{opacity:.85}.gen-home:hover{color:var(--text)}}@keyframes gen-spin{to{transform:rotate(360deg)}}@media(min-width:1100px){.gen-composer{position:sticky;top:24px}}@media(max-width:1000px){.gen-header,.gen-main,.gen-footer{padding-left:24px;padding-right:24px}.gen-workspace{grid-template-columns:minmax(280px,350px) minmax(0,1fr);gap:18px}.gen-card{padding:22px}.gen-history{grid-template-columns:repeat(3,minmax(0,1fr))}.gen-heading{gap:20px}.gen-images{grid-template-columns:1fr}}@media(max-width:760px){.gen-header{height:80px;padding-top:env(safe-area-inset-top)}.gen-header,.gen-main,.gen-footer{padding-left:20px;padding-right:20px}.gen-heading{display:block;padding:16px 0 28px}.gen-heading h1{font-size:30px}.gen-subtitle{font-size:13px}.gen-model{margin-top:22px;flex-direction:row;justify-content:space-between;align-items:center;gap:12px;font-size:11px}.gen-workspace{grid-template-columns:minmax(0,1fr);gap:20px}.gen-results{min-height:320px}.gen-empty{min-height:250px;padding:20px 10px}.gen-history{grid-template-columns:repeat(2,minmax(0,1fr))}.gen-notice{flex-wrap:wrap;gap:12px;padding:14px}.gen-notice p{flex-basis:100%}.gen-images{grid-template-columns:1fr}.gen-card{padding:22px;border-radius:20px}.gen-history-item{gap:9px;padding:10px}.gen-history-item img,.gen-history-placeholder{width:44px;height:44px}.gen-home{font-size:11px}.gen-header nav{gap:12px}.gen-brand{gap:10px;font-size:13px;letter-spacing:2px}.gen-wordmark{font-size:10px}.gen-footer{padding-top:32px}}@media(max-width:380px){.gen-header,.gen-main,.gen-footer{padding-left:16px;padding-right:16px}.gen-card{padding:18px}.gen-options{gap:10px}.gen-history{grid-template-columns:1fr}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

.gen-tabs{display:flex;gap:6px;margin:0 0 24px;border-bottom:1px solid var(--line);padding-bottom:12px}.gen-tabs button{min-height:44px;border:1px solid transparent;background:transparent;color:var(--muted);padding:10px 18px;border-radius:10px;font-size:13px}.gen-tabs button[aria-selected=true]{color:var(--text);background:var(--tg-soft);border-color:var(--line)}.gen-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.gen-chat-panel{max-width:960px;margin:auto;padding:0}.gen-chat-thread{height:clamp(320px,47svh,620px);overflow:auto;padding:30px;overscroll-behavior:contain;scrollbar-width:thin}.gen-chat-empty{min-height:300px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:20px}.gen-chat-mark{font-size:32px;font-weight:500;border:1px solid var(--line);border-radius:16px;width:64px;height:64px;display:grid;place-items:center;margin-bottom:18px}.gen-chat-empty h2{font-size:22px;font-weight:500;margin:0 0 12px}.gen-chat-empty p{font-size:13px;color:var(--muted);max-width:360px;margin:0 0 24px}.gen-suggestions{display:flex;flex-wrap:wrap;justify-content:center;gap:10px}.gen-suggestions button{min-height:44px;max-width:100%;padding:12px 16px;border:1px solid var(--line);border-radius:12px;background:var(--tg-soft);color:var(--text);font-size:12px;text-align:left}.gen-chat-form{padding:20px 24px;border-top:1px solid var(--line);background:var(--tg-soft)}.gen-chat-form textarea{width:100%;resize:vertical;min-height:96px;max-height:240px;border:1px solid var(--line);border-radius:14px;background:var(--tg-input);color:var(--text);padding:14px 16px;font-size:16px;line-height:1.6}.gen-chat-form textarea::placeholder{color:var(--muted);opacity:1}.gen-chat-actions{display:flex;align-items:center;gap:12px;margin-top:12px}.gen-chat-actions>.gen-muted{flex:1;font-size:10px}.gen-chat-actions .gen-submit{width:auto;min-width:82px;margin:0;padding:12px 20px}.gen-chat-turn{margin-bottom:28px}.gen-chat-user{margin:0 0 18px auto;width:fit-content;max-width:85%;border:1px solid var(--line);background:var(--tg-soft);border-radius:16px 16px 4px 16px;padding:12px 16px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px}.gen-chat-assistant>p:first-child{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.8;margin:0 0 14px}.gen-chat-assistant .gen-images{margin-top:14px}.gen-chat-assistant video,.gen-chat-assistant img{max-height:430px}.gen-chat-reference-preview{display:flex;align-items:center;gap:12px;margin-bottom:12px;font-size:12px;color:var(--muted)}.gen-chat-reference-preview img{width:48px;height:48px;object-fit:cover;border-radius:8px}.gen-chat-reference-preview span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media(max-width:760px){.gen-chat-thread{padding:20px;height:44svh;min-height:280px}.gen-chat-form{padding:16px}.gen-chat-empty{padding:8px;min-height:240px}.gen-chat-empty h2{font-size:20px}.gen-chat-mark{width:52px;height:52px;font-size:26px}.gen-chat-actions>.gen-muted{display:none}.gen-chat-actions .gen-submit{margin-left:auto}.gen-suggestions{flex-direction:column;align-items:center}.gen-chat-user{max-width:94%}.gen-tabs{gap:2px}.gen-tabs button{padding:10px 15px}.gen-chat-thread .gen-images{grid-template-columns:1fr}}

.gen-parameter-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 12px;margin:20px 0}.gen-parameter-field{min-width:0}.gen-parameter-field label{overflow-wrap:anywhere}.gen-parameter-field.wide{grid-column:1/-1}.gen-parameter-field textarea{min-height:88px}.gen-parameter-field input,.gen-parameter-field select,.gen-parameter-field textarea,.gen-guide input{width:100%;min-height:44px;border-radius:10px;border:1px solid var(--line);background:var(--tg-soft);color:var(--text);padding:10px;font-size:16px}.gen-parameter-field input[type=checkbox]{width:44px;height:44px;padding:0;accent-color:var(--text)}.gen-parameter-field input[type=color]{padding:5px}.gen-parameter-field small{display:block;margin-top:4px;color:var(--muted);font-size:12px}.gen-guide{padding:14px;margin:12px 0;border:1px solid var(--line);border-radius:12px;min-width:0}.gen-guide-head{display:flex;justify-content:space-between;align-items:center;gap:8px}.gen-guide-head label{margin:0}.gen-guide input[type=file],.gen-asset-control input[type=file],#gen-extra-images{max-width:100%;font-size:12px;padding:10px;min-height:44px}.gen-guide label{display:block;margin:10px 0 4px}.gen-asset-control{margin:16px 0}.gen-asset-control label{display:block}.gen-asset-list{display:flex;flex-direction:column;gap:8px;margin:12px 0}.gen-asset-item{display:flex;gap:12px;align-items:center;min-width:0}.gen-asset-item img{width:48px;height:48px;object-fit:cover;border-radius:8px}.gen-asset-item span{flex:1;min-width:0;overflow-wrap:anywhere;font-size:12px}.gen-used-list{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px 16px;font-size:12px}.gen-used-list dt{color:var(--muted);overflow-wrap:anywhere}.gen-used-list dd{margin:0;overflow-wrap:anywhere}.gen-advanced summary{min-height:44px;display:flex;align-items:center;cursor:pointer}.gen-parameter-field [aria-invalid=true]{border-color:var(--error,#df5d5d)}.gen-parameter-error{margin:4px 0;color:var(--error,#df5d5d);font-size:12px}
@media(max-width:375px){.gen-parameter-fields{grid-template-columns:1fr}.gen-parameter-field.wide{grid-column:auto}}@media(prefers-reduced-motion:reduce){.gen-advanced,.gen-guide,.gen-parameter-field{scroll-behavior:auto}}

#gen-image-model-field{margin-bottom:24px}#gen-image-hint{margin:10px 0 0;line-height:1.5}
.gen-points{display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px;margin:0 0 16px;font-size:13px;line-height:1.6;overflow-wrap:anywhere}.gen-points-balance{padding:6px 12px;border:1px solid var(--line);border-radius:999px;background:var(--tg-soft);color:var(--text);font-variant-numeric:tabular-nums}.gen-points-warning{padding:12px 16px;border:1px solid var(--line);border-radius:12px;background:var(--tg-soft);color:var(--text);font-size:14px;line-height:1.6;overflow-wrap:anywhere}.gen-point-hint,.gen-point-receipt{font-size:13px;line-height:1.6;color:var(--muted);overflow-wrap:anywhere;margin:8px 0}.gen-task-copy .gen-point-receipt{margin:0;font-size:12px}
#gen-result-points{display:inline-flex;max-width:100%;margin:12px 0 0;padding:4px 10px;border-radius:12px;background:var(--tg-soft);font-size:12px;font-variant-numeric:tabular-nums}
/* Fine tuning is grouped by the decision a creator is making. */
.gen-parameter-fields{display:block;margin:18px 0}
.gen-parameter-group{border:1px solid var(--line);border-radius:14px;margin:12px 0;padding:0 14px;background:var(--tg-soft)}
.gen-parameter-group>summary{font-size:14px;font-weight:500;gap:12px;list-style:none;min-height:52px;padding:8px 0}
.gen-parameter-group>summary::-webkit-details-marker,#gen-settings>summary::-webkit-details-marker{display:none}
.gen-parameter-group>summary::after,#gen-settings>summary::after{content:'';width:7px;height:7px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg);margin-left:auto;flex-shrink:0}
.gen-parameter-group[open]>summary::after,#gen-settings[open]>summary::after{transform:rotate(225deg)}
.gen-parameter-group[open]>summary{border-bottom:1px solid var(--line)}
.gen-parameter-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px 14px;padding:18px 0}
.gen-parameter-group .gen-parameter-field{margin:0}
.gen-parameter-field label{font-size:14px;line-height:1.55}
.gen-parameter-field .gen-field-help{line-height:1.75;margin-top:8px}
.gen-parameter-field .gen-technical-name{font-size:11px;overflow-wrap:anywhere}
/* Match the main site's selection controls: a 24px face in a 44px hit area. */
.gen-parameter-field:has(>input[type=checkbox]){display:grid;grid-template-columns:44px minmax(0,1fr);column-gap:2px;align-items:center;grid-column:1/-1}
.gen-parameter-field:has(>input[type=checkbox])>label{grid-column:2;grid-row:1;margin:0;cursor:pointer}
.gen-parameter-field:has(>input[type=checkbox])>:is(small,p){grid-column:1/-1}
.gen-parameter-field input[type=checkbox]{appearance:none;-webkit-appearance:none;position:relative;display:inline-block;vertical-align:middle;grid-column:1;grid-row:1;flex:0 0 44px;width:44px;min-width:44px;max-width:44px;height:44px;min-height:44px;max-height:44px;margin:0;padding:0;border:0;border-radius:14px;background:transparent;box-shadow:none;color:var(--gen-solid);cursor:pointer;touch-action:manipulation}
.gen-parameter-field input[type=checkbox]::before{content:"";position:absolute;inset:10px;box-sizing:border-box;border:1px solid color-mix(in srgb,var(--text) 52%,var(--tg-input));border-radius:7px;background:var(--tg-input);box-shadow:0 2px 4px var(--tg-shadow);pointer-events:none;transition:background-color 140ms ease,border-color 140ms ease,transform 100ms ease}
.gen-parameter-field input[type=checkbox]::after{content:"";position:absolute;left:19px;top:15px;width:6px;height:10px;box-sizing:content-box;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(45deg);opacity:0;pointer-events:none;transition:opacity 100ms ease}
.gen-parameter-field input[type=checkbox]:checked::before{background:var(--text);border-color:var(--text)}
.gen-parameter-field input[type=checkbox]:checked::after{opacity:1}
.gen-parameter-field input[type=checkbox]:enabled:active::before{transform:scale(.94)}
.gen-parameter-field input[type=checkbox]:disabled{opacity:.38;cursor:not-allowed}
.gen-parameter-field input[type=checkbox][aria-invalid=true]::before{border-color:var(--error,#df5d5d)}
@media(forced-colors:active){.gen-parameter-field input[type=checkbox]{appearance:auto;-webkit-appearance:auto;opacity:1}.gen-parameter-field input[type=checkbox]::before,.gen-parameter-field input[type=checkbox]::after{display:none}}
.gen-technical-name:empty{display:none}
.gen-group-hint{font-size:12px;color:var(--muted);line-height:1.8;margin:14px 0 0}
#gen-settings>summary{display:flex;gap:10px;flex-wrap:wrap;list-style:none;min-height:56px;font-size:14px}
.gen-settings-badge{font-size:11px;font-weight:400;border:1px solid var(--line);border-radius:100px;padding:3px 8px;line-height:1.5;color:var(--muted)}
#gen-settings>p:first-of-type{font-size:13px;line-height:1.75;margin:4px 0 20px}
.gen-advanced summary:focus-visible{outline:2px solid var(--text);outline-offset:4px;border-radius:6px}
#gen-reset-parameters{width:100%;margin-top:8px;min-height:44px}
@media(max-width:380px){.gen-parameter-grid{grid-template-columns:minmax(0,1fr)}.gen-parameter-field.wide{grid-column:1/-1}.gen-parameter-group{padding:0 12px}}

/* Gen app shell: compact controls, independent destinations and native dialogs. */
:root{--gen-nav-height:76px;--gen-header-height:76px;--gen-viewport-height:100dvh;--gen-radius:24px;--gen-surface:rgba(255,255,255,.72);--gen-muted:#626262;--gen-solid:#f5f5f5;--gen-border:rgba(0,0,0,.13);--gen-overlay:rgba(0,0,0,.42)}
:root[data-theme=dark]{--gen-surface:rgba(27,27,27,.88);--gen-muted:#a8a8a8;--gen-solid:#151515;--gen-border:rgba(255,255,255,.17);--gen-overlay:rgba(0,0,0,.65)}
html{scroll-padding-top:100px}body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;background:var(--bg,#090909);color:var(--text);padding-bottom:calc(var(--gen-nav-height) + env(safe-area-inset-bottom) + 24px)}
.gen-header{max-width:none;height:calc(var(--gen-header-height) + env(safe-area-inset-top));padding:env(safe-area-inset-top) 32px 0;border-bottom:1px solid var(--gen-border);position:sticky;top:0;z-index:20;background:var(--gen-surface);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px)}
.gen-brand{letter-spacing:2px;font-weight:650}.gen-wordmark{font-size:12px;letter-spacing:3px}.gen-header nav{gap:12px}.gen-header .gen-icon{background:transparent}
.gen-main{max-width:1100px;padding:0 40px}.gen-heading{padding:34px 0 24px;gap:20px;align-items:center}.gen-heading .gen-eyebrow{font-size:10px;letter-spacing:2px;margin-bottom:12px}.gen-heading h1{font-size:clamp(26px,3vw,36px);font-weight:550;letter-spacing:-1.1px;line-height:1.3}.gen-subtitle{font-size:13px;color:var(--gen-muted)}.gen-model{font-size:11px;color:var(--gen-muted)}.gen-connection{color:var(--gen-muted)}.gen-notice{margin:18px 0 0;background:var(--gen-solid);color:var(--gen-muted)}
.gen-tabs{width:fit-content;max-width:100%;border:1px solid var(--gen-border);border-radius:16px;padding:4px;gap:4px;margin:0 0 24px;background:var(--tg-soft)}.gen-tabs button{min-width:100px;border-radius:12px;min-height:44px;padding:10px 22px;color:var(--gen-muted);font-size:14px}.gen-tabs button[aria-selected=true]{background:var(--gen-solid);color:var(--text);border-color:var(--gen-border);box-shadow:0 2px 6px var(--tg-shadow)}
.gen-card{border:1px solid var(--gen-border);border-radius:var(--gen-radius);background:var(--gen-surface);box-shadow:inset 0 1px 0 var(--tg-edge-mid),0 8px 28px var(--tg-shadow)}.gen-section-head{margin-bottom:20px}.gen-section-head h2{font-size:17px;font-weight:550}
.gen-workspace{display:block;max-width:780px;margin:0 auto}.gen-composer{position:static;padding:28px}.gen-composer label{font-size:13px}.gen-composer textarea{min-height:142px;max-height:360px;resize:vertical;background:var(--tg-input);border-radius:16px;padding:16px;line-height:1.7}.gen-composer select{font-size:16px;min-height:48px;padding-right:30px}.gen-composer #gen-video-model-field{margin-bottom:20px}.gen-field-meta{margin:8px 0 18px;font-size:11px}.gen-field-meta>span:first-child{max-width:75%;line-height:1.5}.gen-upload{min-height:72px;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;gap:8px 12px;padding:12px 16px;border-style:solid;margin-bottom:20px}.gen-upload small{margin-left:auto;font-size:11px}.gen-upload svg{margin:0}.gen-upload>span{font-size:13px}.gen-options{grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px}.gen-advanced{margin:16px 0}.gen-muted,.gen-private,.gen-advanced small,.gen-field-help{color:var(--gen-muted)}
.gen-settings-open{width:100%;min-height:56px;display:flex;align-items:center;gap:12px;border:1px solid var(--gen-border);border-radius:14px;padding:12px 16px;background:var(--tg-soft);color:var(--text);font-size:14px;margin:16px 0 22px}.gen-settings-open svg:last-child{margin-left:auto;width:16px}.gen-submit{border-radius:16px;min-height:54px;font-size:15px;font-weight:550}.gen-submit-bar{padding-top:4px}.gen-private{font-size:11px}
.gen-chat-panel{max-width:none;background:transparent;border:0;box-shadow:none;border-radius:0;display:flex;flex-direction:column;height:max(520px,calc(var(--gen-viewport-height) - 320px))}.gen-chat-thread{height:auto;min-height:240px;flex:1;padding:12px 16px 24px}.gen-chat-empty{min-height:300px;height:100%;padding:20px}.gen-chat-mark{width:72px;height:72px;border-radius:24px;background:linear-gradient(135deg,var(--tg-core),var(--tg-soft));border:1px solid var(--gen-border);box-shadow:inset 0 1px 0 var(--tg-edge-mid),0 12px 30px var(--tg-shadow);font-size:30px;transform:rotate(-8deg);margin-bottom:24px}.gen-chat-empty h2{font-size:25px;letter-spacing:-.7px;font-weight:500}.gen-chat-empty p{font-size:13px;line-height:1.7;color:var(--gen-muted)}.gen-suggestions{gap:10px;flex-direction:row}.gen-suggestions button{background:var(--gen-surface);border-color:var(--gen-border);border-radius:16px;max-width:270px;line-height:1.6;padding:14px 18px;font-size:13px}.gen-chat-form{border:1px solid var(--gen-border);border-radius:22px;padding:16px;background:var(--gen-surface);box-shadow:inset 0 1px 0 var(--tg-edge-mid),0 8px 28px var(--tg-shadow)}.gen-chat-form textarea{border:0;background:transparent;border-radius:10px;padding:6px 4px;min-height:64px;max-height:140px;resize:none}.gen-chat-actions{margin-top:8px}.gen-chat-actions .gen-small{border:0;background:var(--tg-soft);border-radius:12px;font-size:13px}.gen-chat-actions .gen-submit{border-radius:14px;min-height:44px;min-width:80px;padding:10px 20px}.gen-chat-form .gen-private{margin-top:12px;text-align:left;font-size:10px}.gen-chat-user{font-size:15px;border-radius:20px 20px 6px 20px;padding:14px 18px;line-height:1.7}.gen-chat-assistant>p:first-child{font-size:15px}
.gen-app-nav{position:fixed;bottom:12px;left:50%;transform:translateX(-50%);width:360px;max-width:calc(100% - 32px);display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:6px;border:1px solid var(--gen-border);border-radius:24px;background:var(--gen-surface);box-shadow:inset 0 1px 0 var(--tg-edge-mid),0 8px 32px var(--tg-shadow);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);z-index:30;margin-bottom:env(safe-area-inset-bottom)}.gen-app-nav>a{min-height:56px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:11px;font-weight:500;color:var(--gen-muted);border-radius:18px;position:relative}.gen-app-nav>a[aria-current=page]{color:var(--text);background:var(--tg-selected)}.gen-app-nav svg{width:22px;height:22px;stroke-width:1.65}.gen-nav-icon{position:relative;height:22px}.gen-nav-icon>span{position:absolute;top:-6px;right:-12px;border-radius:99px;min-width:17px;height:17px;display:grid;place-items:center;padding:0 4px;font-size:10px;background:var(--tg-action);color:var(--tg-action-ink);border:2px solid var(--gen-solid)}
.gen-destination{padding-top:36px;min-height:65vh}.gen-destination-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:28px}.gen-destination-head .gen-eyebrow{margin:0 0 10px}.gen-destination h1{font-size:32px;font-weight:550;letter-spacing:-.8px;margin:0 0 10px}.gen-destination h1:focus{outline:none}.gen-task-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:28px}.gen-task-stats>div{padding:20px;border:1px solid var(--gen-border);background:var(--gen-surface);border-radius:20px;display:flex;flex-direction:column;gap:6px}.gen-task-stats strong{font-size:28px;font-weight:500;font-variant-numeric:tabular-nums}.gen-task-stats span{font-size:12px;color:var(--gen-muted)}.gen-task-list{display:flex;flex-direction:column;gap:12px}.gen-task-item{width:100%;display:flex;align-items:center;gap:18px;text-align:left;padding:18px;border:1px solid var(--gen-border);border-radius:20px;background:var(--gen-surface);color:var(--text)}.gen-task-item .gen-creation-thumb{width:76px;height:92px;aspect-ratio:auto;flex-shrink:0;border-radius:12px}.gen-task-copy{display:flex;flex-direction:column;gap:5px;min-width:0;flex:1}.gen-task-copy strong{font-size:14px;line-height:1.6;font-weight:500;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.gen-task-copy small{font-size:11px;color:var(--gen-muted)}.gen-task-status{font-size:12px;line-height:1.6}.gen-task-item[data-status=failed] .gen-task-status{text-decoration:underline;text-underline-offset:3px}.gen-task-item>.gen-media-icon svg{width:16px}.gen-task-line{height:3px;background:var(--gen-border);border-radius:8px;margin-top:6px;overflow:hidden;max-width:260px}.gen-task-line:after{content:'';display:block;width:28%;height:100%;background:var(--text);border-radius:8px;animation:gen-task-pulse 2.2s ease-in-out infinite}.gen-task-item[data-status=queued] .gen-task-line:after{width:10%;opacity:.4;animation:none}@keyframes gen-task-pulse{0%,100%{transform:translateX(0);opacity:.3}50%{transform:translateX(220%);opacity:1}}
.gen-history-section{margin-top:0}.gen-library-toolbar{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:24px;flex-wrap:wrap}.gen-filter{display:flex;gap:6px}.gen-filter button{min-height:44px;min-width:56px;padding:10px 16px;border:1px solid var(--gen-border);border-radius:14px;background:transparent;color:var(--gen-muted);font-size:13px}.gen-filter button[aria-pressed=true]{background:var(--tg-action);color:var(--tg-action-ink);border-color:transparent}.gen-history{grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}.gen-creation-card{padding:0;display:block;border-radius:20px;overflow:hidden;background:var(--gen-surface)}.gen-creation-thumb{aspect-ratio:4/5;width:100%;display:grid;place-items:center;background:var(--tg-soft);overflow:hidden;position:relative}.gen-creation-thumb img{width:100%;height:100%;object-fit:cover;border-radius:0}.gen-creation-thumb .gen-media-icon svg{width:36px;height:36px;opacity:.7;stroke-width:1.25}.gen-creation-copy{display:block;padding:14px;text-align:left;min-width:0}.gen-creation-card strong{font-size:13px;line-height:1.6;font-weight:450;-webkit-line-clamp:2}.gen-creation-card small{font-size:11px;line-height:1.5;margin-top:8px;color:var(--gen-muted)}.gen-empty-message{min-height:220px;border:1px dashed var(--gen-border);border-radius:24px;display:grid;place-items:center;text-align:center;padding:28px;font-size:14px;line-height:1.8;color:var(--gen-muted)}
.gen-sheet{color:var(--text);background:var(--gen-solid);border:1px solid var(--gen-border);border-radius:28px;padding:0;width:min(640px,calc(100vw - 40px));max-width:none;max-height:min(90dvh,1000px);overflow:hidden;box-shadow:0 28px 100px rgba(0,0,0,.3)}.gen-sheet[open]{display:flex;flex-direction:column;animation:gen-sheet-in .24s cubic-bezier(.2,.8,.2,1)}.gen-sheet::backdrop{background:var(--gen-overlay);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}.gen-sheet-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 24px;border-bottom:1px solid var(--gen-border);flex-shrink:0;min-height:76px}.gen-sheet-head h2,.gen-sheet-head>span{font-size:17px;font-weight:550;margin:0}.gen-sheet-head .gen-icon{background:var(--tg-soft)}.gen-sheet-body{padding:0 24px 24px;overflow:auto;overscroll-behavior:contain;min-height:0}.gen-sheet-foot{padding:16px 24px;border-top:1px solid var(--gen-border)}.gen-sheet-foot .gen-submit{justify-content:center}.gen-sheet-open{overflow:hidden}.gen-sheet .gen-results{min-height:0;padding:24px 0 0;border:0;border-radius:0;box-shadow:none;background:transparent}.gen-sheet .gen-empty{min-height:200px}.gen-sheet .gen-section-head{margin-bottom:16px}.gen-result-sheet{width:min(880px,calc(100vw - 40px))}.gen-sheet .gen-images{grid-template-columns:1fr}.gen-sheet .gen-images img,.gen-sheet .gen-images video{max-height:64vh}.gen-sheet .gen-result-meta{margin-top:16px;font-size:12px}.gen-sheet input,.gen-sheet select,.gen-sheet textarea{font-size:16px}.gen-sheet #gen-seed{width:100%;min-height:48px;background:var(--tg-input);border:1px solid var(--gen-border);color:var(--text);border-radius:12px;padding:12px}.gen-sheet #gen-settings>summary{font-size:14px}.gen-sheet label{display:block}.gen-parameter-grid{gap:22px 16px}.gen-small{font-size:13px}.gen-media-icon{display:inline-grid;place-items:center;flex-shrink:0}.gen-app-nav a:active,button:not(:disabled):active{opacity:.65}.gen-footer{display:none}@keyframes gen-sheet-in{from{opacity:0;transform:translateY(28px)}to{opacity:1;transform:translateY(0)}}
@media(min-width:1180px){body{padding-left:220px;padding-bottom:40px}.gen-header{margin-left:-220px;padding-left:32px;padding-right:40px}.gen-app-nav{left:20px;top:112px;bottom:auto;transform:none;width:180px;display:flex;flex-direction:column;padding:8px;border:0;background:transparent;box-shadow:none;backdrop-filter:none}.gen-app-nav>a{flex-direction:row;justify-content:flex-start;gap:16px;padding:16px;min-height:56px;font-size:14px}.gen-main{padding:0 48px;max-width:1200px}.gen-chat-panel{height:max(520px,calc(var(--gen-viewport-height) - 290px))}.gen-workspace{max-width:780px}.gen-history{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){:root{--gen-header-height:64px;--gen-nav-height:76px}.gen-header{padding-left:max(20px,env(safe-area-inset-left));padding-right:max(20px,env(safe-area-inset-right));height:calc(64px + env(safe-area-inset-top))}.gen-header .gen-home{font-size:12px}.gen-header nav{gap:8px}.gen-main{padding-left:max(20px,env(safe-area-inset-left));padding-right:max(20px,env(safe-area-inset-right))}.gen-heading{padding:24px 0 20px;display:block}.gen-heading .gen-eyebrow{display:none}.gen-heading h1{font-size:26px;letter-spacing:-.9px;margin-bottom:8px}.gen-subtitle{font-size:12px;line-height:1.7}.gen-model{margin-top:16px;font-size:11px;gap:12px}.gen-tabs{width:100%;margin-bottom:20px;gap:4px;padding:4px;border-radius:16px}.gen-tabs button{min-width:0;flex:1;padding:10px 8px;font-size:13px}.gen-card{border-radius:22px}.gen-composer{padding:20px}.gen-composer textarea{min-height:136px}.gen-options{gap:12px;margin-bottom:14px}.gen-composer label{font-size:12px;margin-bottom:8px}.gen-upload{min-height:64px;gap:8px;padding:12px}.gen-upload small{display:none}.gen-reference-head .gen-muted{font-size:11px}.gen-field-meta{font-size:10px}.gen-submit-bar{position:sticky;bottom:calc(88px + env(safe-area-inset-bottom));z-index:4;background:var(--gen-solid);border-radius:18px;padding:10px;box-shadow:0 6px 24px var(--tg-shadow);margin:20px -6px 0}.gen-submit-bar .gen-private{font-size:10px;margin:8px 0 0}.gen-submit-bar .gen-error{margin:4px 0 10px}.gen-chat-panel{height:max(420px,calc(var(--gen-viewport-height) - 322px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));min-height:0}.gen-chat-thread{padding:8px 2px 16px;min-height:120px}.gen-chat-empty{min-height:0;padding:12px 0 20px}.gen-chat-mark{width:56px;height:56px;font-size:26px;border-radius:19px;margin-bottom:18px}.gen-chat-empty h2{font-size:20px;margin-bottom:10px}.gen-chat-empty p{font-size:12px;margin-bottom:20px;max-width:290px}.gen-suggestions{display:grid;grid-template-columns:1fr 1fr;gap:8px;width:100%}.gen-suggestions button{font-size:11px;padding:12px;min-height:68px;max-width:none}.gen-chat-form{padding:12px 14px;border-radius:20px}.gen-chat-form textarea{font-size:16px;min-height:56px}.gen-chat-form .gen-private{font-size:10px;line-height:1.6}.gen-chat-actions{gap:8px}.gen-chat-actions .gen-submit{min-width:70px}.gen-app-nav{bottom:10px;width:340px;max-width:calc(100% - 40px);border-radius:24px}.gen-destination{padding-top:28px}.gen-destination h1{font-size:30px}.gen-destination-head{margin-bottom:24px}.gen-task-stats{gap:8px;margin-bottom:20px}.gen-task-stats>div{padding:16px 12px;border-radius:18px}.gen-task-stats strong{font-size:25px}.gen-task-stats span{font-size:11px}.gen-task-item{padding:14px;gap:12px;border-radius:18px}.gen-task-item .gen-creation-thumb{width:58px;height:76px}.gen-task-copy strong{font-size:13px}.gen-task-copy small{font-size:10px}.gen-task-status{font-size:11px}.gen-history{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.gen-creation-card{border-radius:16px}.gen-creation-copy{padding:12px}.gen-creation-card strong{font-size:12px}.gen-creation-card small{font-size:10px}.gen-library-toolbar{gap:12px;margin-bottom:18px}.gen-filter{gap:6px}.gen-filter button{padding:10px 14px;font-size:12px}.gen-sheet{position:fixed;inset:auto 0 0;margin:0;width:100%;max-height:calc(var(--gen-viewport-height) - env(safe-area-inset-top) - 16px);border-radius:26px 26px 0 0;border-bottom:0;padding-bottom:env(safe-area-inset-bottom)}.gen-sheet-head{padding:14px 20px;min-height:72px}.gen-sheet-body{padding:0 20px 20px}.gen-sheet-foot{padding:14px 20px}.gen-sheet .gen-images img,.gen-sheet .gen-images video{max-height:56vh}.gen-sheet .gen-used-list{gap:8px 12px}.gen-keyboard-open .gen-app-nav{display:none}.gen-keyboard-open .gen-heading{display:none}.gen-keyboard-open .gen-tabs{margin-top:12px;margin-bottom:12px}.gen-keyboard-open .gen-chat-panel{height:max(230px,calc(var(--gen-viewport-height) - 148px - env(safe-area-inset-top)))}.gen-keyboard-open{padding-bottom:8px}.gen-keyboard-open .gen-chat-form .gen-private{display:none}}
@media(max-width:375px){.gen-main{padding-left:16px;padding-right:16px}.gen-header{padding-left:16px;padding-right:16px}.gen-heading h1{font-size:24px}.gen-heading .gen-subtitle{font-size:11px}.gen-composer{padding:16px}.gen-parameter-grid{grid-template-columns:1fr}.gen-parameter-field.wide{grid-column:auto}.gen-filter button{padding:10px 12px}.gen-history{grid-template-columns:repeat(2,minmax(0,1fr))}.gen-creation-copy{padding:10px}}
@media(max-height:500px) and (orientation:landscape){.gen-heading{display:none}.gen-tabs{margin-top:12px}.gen-chat-panel{height:480px}.gen-app-nav{max-width:320px}.gen-sheet{max-height:calc(100dvh - 12px)}.gen-header{position:relative}}
@media(prefers-reduced-motion:reduce){.gen-sheet[open],.gen-task-line:after{animation:none}.gen-app-nav a,button{transition:none}}
/* Keep the primary action within thumb reach without covering the final fields. */
@media(max-width:760px){
 body[data-gen-kind=image] .gen-composer,body[data-gen-kind=video] .gen-composer{padding-bottom:150px}
 .gen-submit-bar{position:fixed;left:max(20px,env(safe-area-inset-left));right:max(20px,env(safe-area-inset-right));bottom:calc(88px + env(safe-area-inset-bottom));max-width:720px;margin:0 auto;border:1px solid var(--gen-border);background:var(--gen-surface);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px)}
 .gen-chat-panel{height:max(300px,calc(var(--gen-viewport-height) - 370px - env(safe-area-inset-top) - env(safe-area-inset-bottom)))}
 .gen-keyboard-open .gen-submit-bar{position:static;backdrop-filter:none;margin:16px 0 0}
 .gen-keyboard-open .gen-chat-panel{height:max(180px,calc(var(--gen-viewport-height) - 148px - env(safe-area-inset-top)))}
 .gen-keyboard-open .gen-chat-thread{min-height:40px}
}
@media(max-width:760px){html{scroll-padding-bottom:220px}.gen-composer button,.gen-composer input,.gen-composer select,.gen-composer textarea{scroll-margin-block:100px}}

@media(max-width:760px){.gen-chat-panel{height:var(--gen-chat-height,max(300px,calc(var(--gen-viewport-height) - 370px)))}.gen-chat-thread{min-height:60px}.gen-chat-form{flex-shrink:0}.gen-keyboard-open .gen-chat-panel{height:var(--gen-chat-height,230px)}}
.gen-task-row{position:relative;border:1px solid var(--gen-border);border-radius:20px;background:var(--gen-surface);overflow:hidden}.gen-task-row .gen-task-item{border:0;background:transparent}.gen-task-row:has(.gen-task-cancel) .gen-task-copy{padding-bottom:36px}.gen-task-cancel{position:absolute;left:112px;bottom:12px;min-height:44px}.gen-submit-bar #gen-submit-feedback:empty{display:none}.gen-submit-bar #gen-submit-feedback{font-size:11px;margin:8px 0 0;text-align:center}.gen-submit-bar #gen-queue-capacity{font-size:12px;line-height:1.6}
@media(max-width:760px){.gen-task-row{border-radius:18px}.gen-task-cancel{left:84px;bottom:8px}}
.gen-skip{z-index:60}


.gen-cost{margin:12px 0;color:var(--text);font-size:13px;overflow-wrap:anywhere}.gen-cost summary{min-height:44px;padding:10px 0;cursor:pointer;font-variant-numeric:tabular-nums}.gen-cost p{margin:6px 0;color:var(--muted);line-height:1.6}.gen-cost-inline{display:block;white-space:normal;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}


.gen-history-more{display:block;min-height:44px;margin:24px auto 0;padding:10px 20px}.gen-history-more[hidden]{display:none}
/* Compact composer entry, with the existing native dialog and form state. */
#gen-settings-open{width:auto;max-width:100%;min-height:44px;margin:0 0 16px;padding:10px 14px;border-radius:24px;gap:8px;font-size:13px}
#gen-settings-open svg{width:18px;height:18px;flex-shrink:0}#gen-settings-summary{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#gen-quick-settings{padding-top:20px}#gen-quick-settings .gen-options{display:block}#gen-quick-settings .gen-options>div{margin-bottom:22px}
.gen-setting-choices{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0 12px}.gen-setting-choices button{flex:1 0 64px;min-height:48px;border:1px solid var(--gen-border);border-radius:14px;padding:12px;background:var(--tg-soft);color:var(--text);font-size:15px}.gen-setting-choices button[aria-pressed=true]{background:var(--text);color:var(--gen-solid);border-color:var(--text)}.gen-setting-choices button:disabled{opacity:.4;cursor:not-allowed}
#gen-quick-settings .gen-setting-source{display:none}#gen-duration-slider{display:block;width:100%;min-height:44px;accent-color:var(--text)}#gen-duration{max-width:110px;text-align:center}
#gen-settings-dialog .gen-sheet-body{scroll-padding-top:16px}#gen-settings-dialog .gen-sheet-foot{padding-bottom:max(16px,env(safe-area-inset-bottom))}
@media(max-width:760px){#gen-settings-dialog:before{content:'';display:block;width:36px;height:4px;min-height:4px;background:var(--gen-border);border-radius:4px;margin:10px auto 0}#gen-settings-dialog{max-height:calc(100dvh - env(safe-area-inset-top) - 12px)}#gen-settings-dialog .gen-sheet-head{min-height:60px}#gen-settings-open{font-size:12px}}
#gen-settings-dialog :is(.gen-sheet-head,.gen-sheet-body,.gen-sheet-foot){background:var(--gen-solid)}
#gen-resolution-choices button{white-space:pre-line;font-size:14px;line-height:1.5;min-width:0}
#gen-video-model-choices,#gen-image-model-choices{flex-direction:column}

/* Explicit server-allowlisted chat model switch. Hidden when only one choice exists. */
#gen-chat-model-select{flex:0 1 220px;min-width:0;max-width:calc(100% - 78px);min-height:44px;padding:6px 24px 6px 8px;border:1px solid var(--line);border-radius:8px;background:var(--tg-soft);color:var(--text);font-size:16px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}
#gen-chat-model-select:disabled{opacity:.55}
.gen-header-title:has(#gen-chat-model-select:not([hidden])) h1{line-height:20px;margin-bottom:0}
.gen-turn-model{display:block;font-size:12px;line-height:1.5;overflow-wrap:anywhere;margin:4px 0}

:root{--gen-browser-focus:var(--text)}
.gen-browser-dialog{width:min(960px,calc(100vw - 32px));max-height:calc(100dvh - 32px);margin:auto;padding:20px;border:1px solid var(--gen-border);border-radius:20px;background:var(--gen-solid);color:var(--text);box-shadow:0 24px 100px var(--tg-shadow);overflow:auto;overscroll-behavior:contain}
.gen-browser-dialog::backdrop{background:var(--gen-overlay)}
.gen-browser-head{display:flex;align-items:center;justify-content:space-between;gap:16px}.gen-browser-head h2{font-size:18px;margin:0}.gen-browser-state,.gen-browser-message{font-size:13px;line-height:1.6;overflow-wrap:anywhere}.gen-browser-message:empty{display:none}.gen-browser-toolbar{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.gen-browser-dialog button{min-height:44px;min-width:44px}.gen-browser-dialog :is(button,input):focus-visible{outline:2px solid var(--gen-browser-focus);outline-offset:3px}.gen-browser-dialog :is(button,input):disabled{opacity:.5;cursor:wait}.gen-browser-frame{border:1px solid var(--gen-border);border-radius:12px;overflow:hidden;margin:16px 0;min-height:100px;background:var(--tg-soft)}.gen-browser-frame img{display:block;width:100%;height:auto;user-select:none}.gen-browser-manual{display:grid;gap:12px}.gen-browser-manual[hidden],.gen-browser-pending[hidden],.gen-browser-frame[hidden]{display:none}.gen-browser-entry{display:flex;align-items:end;gap:8px}.gen-browser-entry label{display:grid;gap:6px;flex:1;min-width:0;font-size:13px}.gen-browser-entry input{width:100%;box-sizing:border-box;min-height:44px;border:1px solid var(--gen-border);border-radius:10px;padding:8px 12px;background:var(--tg-input);color:var(--text);font-size:16px}.gen-browser-manual small{font-size:12px;line-height:1.6}.gen-browser-remember{display:flex;align-items:center;gap:8px;font-size:13px;min-height:44px}.gen-browser-remember input{width:20px;height:20px}.gen-browser-pending{padding:12px;border:1px solid var(--gen-border);border-radius:12px;font-size:13px;margin-top:12px}.gen-browser-pending pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:180px;overflow:auto;font-size:12px}.gen-browser-pending button{margin:4px 8px 0 0}.gen-agent-browser{margin-bottom:12px}
@media(max-width:760px){.gen-browser-dialog{position:fixed;inset:auto 0 0;margin:0;width:100%;max-width:none;box-sizing:border-box;max-height:calc(100dvh - env(safe-area-inset-top) - 8px);padding:16px 16px calc(16px + env(safe-area-inset-bottom));border-radius:20px 20px 0 0}.gen-browser-entry{flex-wrap:wrap}.gen-browser-entry label{flex-basis:calc(100% - 100px)}}

