.ag-wrap{--ag-blue:#0055ff;--ag-blue-dark:#0043cc;--ag-blue-soft:#eef3ff;--ag-line:#e6e9f0;--ag-hair:rgba(16,24,40,.08);--ag-muted:#667085;--ag-shadow-sm:0 2px 8px rgba(16,24,40,.04);--ag-shadow-md:0 10px 30px -8px rgba(16,24,40,.1);--ag-shadow-lg:0 24px 60px -16px rgba(47,71,145,.16);max-width:1070px;margin:0 auto;padding:16px 16px 20px;font-family:inherit;box-sizing:border-box;border-radius:16px;position:relative;z-index:1}
.ag-wrap *,.ag-wrap *::before,.ag-wrap *::after{box-sizing:border-box;text-transform:none;letter-spacing:normal}
.ag-bg{position:fixed;inset:0;z-index:0;pointer-events:none;background:linear-gradient(165deg,#d4ddf2 0%,#dfe6f5 46%,#ddd3f0 100%)}
.ag-bg::before{content:"";position:absolute;top:-200px;left:50%;transform:translateX(-50%);width:1100px;height:600px;background:radial-gradient(ellipse,rgba(0,85,255,.12) 0%,transparent 70%);filter:blur(80px)}
.ag-bg::after{content:"";position:absolute;bottom:-240px;right:-140px;width:720px;height:720px;border-radius:50%;background:radial-gradient(circle,rgba(124,120,255,.1) 0%,transparent 65%);filter:blur(80px)}
.ag-wrap::before{content:"";position:fixed;top:42%;left:-180px;width:520px;height:520px;border-radius:50%;background:radial-gradient(circle,rgba(255,176,120,.06) 0%,transparent 66%);filter:blur(80px);z-index:-1;pointer-events:none}
.ag-page-head{text-align:center;margin-bottom:20px}
.ag-title{font-size:46px;font-weight:820;margin:0 0 10px;letter-spacing:-.045em;line-height:1.08;background:linear-gradient(118deg,#111a2e 0%,#2f5bff 58%,#6b4bff 100%);-webkit-background-clip:text;background-clip:text;color:transparent}
.ag-title::after{content:"";display:block;width:60px;height:4px;margin:12px auto 0;border-radius:99px;background:linear-gradient(90deg,#2f5bff,#6b4bff)}
.ag-subtitle{color:#101828;margin:0 auto;font-size:16px;line-height:1.5;max-width:34em;font-weight:500}
.ag-page-badges{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin:18px auto 0}
.ag-page-badge{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border-radius:999px;background:var(--ag-blue);border:1px solid var(--ag-blue);color:#fff;font-size:13px;font-weight:650;box-shadow:0 4px 12px rgba(0,85,255,.22)}
.ag-page-badge svg{color:#fff;flex-shrink:0}
.ag-quota-note{margin:12px auto 0;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:8px;min-height:68px;color:#475467;text-align:center}
.ag-quota-pills{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px;width:100%}
.ag-quota-balance,.ag-quota-free{display:inline-flex;align-items:center;gap:6px;min-height:28px;max-width:100%;padding:5px 12px;border-radius:999px;background:#fff;border:1px solid var(--ag-hair);font-size:12px;font-weight:650;color:#101828;box-shadow:0 1px 2px rgba(16,24,40,.08);white-space:nowrap}
.ag-quota-balance{background:linear-gradient(#fff,#fff8e8);border-color:#e8c36a;padding:4px 8px 4px 6px}
.ag-quota-balance .ag-credit-coin{width:14px;height:14px;flex-shrink:0}
.ag-quota-text{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:700;line-height:1.25;color:#101828;white-space:nowrap}
.ag-quota-num{font-weight:800}
.ag-quota-count{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 6px;border-radius:999px;background:var(--ag-blue);color:#fff;font-size:11px;font-weight:800;line-height:1}
.ag-quota-balance .ag-quota-count{background:#f6b21b;color:#101828}
.ag-quota-free{background:#067647;border-color:#067647;color:#fff}
.ag-quota-free .ag-quota-text{color:#fff;font-weight:650}
.ag-quota-free.is-empty{background:#344054;border-color:#344054}
.ag-quota-free.is-empty .ag-quota-text{color:#fff}
.ag-quota-hint{display:inline-flex;align-items:center;justify-content:center;gap:6px;max-width:100%;padding:6px 12px;border-radius:999px;background:#f8fafc;border:1px solid #e6e9f0;font-size:12px;font-weight:600;line-height:1.3;color:#667085;white-space:nowrap}
.ag-quota-hint svg{width:13px;height:13px;flex-shrink:0}
.ag-quota-note.is-locked .ag-quota-hint{background:#fff7ed;border-color:#fed7aa;color:#9a3412}
@media (max-width:520px){
	.ag-quota-note{min-height:0}
	.ag-quota-balance,.ag-quota-free,.ag-quota-hint,.ag-quota-text{white-space:normal;text-align:center}
}
.ag-composer{position:relative;background:linear-gradient(#fff,#fdfdff);border:1px solid transparent;border-radius:24px;padding:18px 18px 14px;box-shadow:var(--ag-shadow-lg)}
.ag-composer::before{content:"";position:absolute;inset:-1px;z-index:-1;border-radius:25px;background:linear-gradient(135deg,rgba(126,200,255,.55) 0%,rgba(154,215,200,.45) 45%,rgba(177,160,255,.5) 100%);opacity:.9}
.ag-composer.is-drag{box-shadow:0 0 0 3px rgba(0,85,255,.16),0 18px 44px rgba(47,91,255,.14)}
.ag-composer-main{display:flex;gap:14px;align-items:flex-start;padding:2px 2px 8px}
.ag-composer.no-upload .ag-refs{display:none!important}
.ag-prompt-wrap{position:relative;flex:1;min-width:0;display:flex;height:92px;background:#fff}
.ag-textarea{width:100%;flex:1;border:0;border-radius:0;padding:6px 36px 6px 2px;font-size:15px;font-family:inherit;background:#fff;color:#667085;height:92px;min-height:92px;max-height:92px;resize:none;overflow:auto;line-height:1.6}
.ag-textarea:focus{outline:none;border:0;box-shadow:none;color:#182230}
.ag-textarea::placeholder{color:#98a2b3}
.ag-wrap .ag-prompt-expand{position:absolute;top:0;right:0;z-index:2;display:inline-flex!important;align-items:center;justify-content:center;width:28px!important;height:28px!important;min-width:28px!important;min-height:28px!important;margin:0!important;padding:0!important;border:0!important;border-radius:8px!important;background:transparent!important;color:#111!important;cursor:pointer;line-height:0}
.ag-wrap .ag-prompt-expand svg{display:block;width:16px;height:16px;stroke:#111;stroke-width:2.4}
.ag-wrap .ag-prompt-expand:hover{background:#f5f7fb!important;color:#000!important}
.ag-wrap .ag-prompt-expand:hover svg{stroke:#000}
.ag-wrap .ag-prompt-expand:focus-visible{outline:3px solid rgba(0,85,255,.25);outline-offset:2px}
.ag-refs{flex:0 0 auto;display:flex;flex-flow:row wrap;align-items:flex-start;gap:8px;max-width:168px}
.ag-add-tile{display:inline-flex;align-items:center;justify-content:center;width:72px;height:92px;padding:0;border:0;background:transparent;color:var(--ag-blue);cursor:pointer;font:inherit}
.ag-add-box{display:flex;align-items:center;justify-content:center;width:64px;height:92px;border:1.5px dashed #7aa4ff;border-radius:16px;background:#eef4ff;color:var(--ag-blue);transition:border-color .18s ease,background .18s ease,color .18s ease,box-shadow .18s ease}
.ag-add-tile:hover .ag-add-box,.ag-add-tile:focus-visible .ag-add-box{border-color:var(--ag-blue);background:#e4eeff;color:var(--ag-blue);outline:none;box-shadow:0 4px 14px rgba(47,107,255,.12)}
.ag-add-tile:focus-visible{outline:none}
.ag-add-icon{display:flex;align-items:center;justify-content:center;width:30px;height:30px;color:currentColor}
.ag-add-icon svg{display:block;width:30px;height:30px}
.ag-thumb{position:relative;width:64px;height:92px;flex:0 0 64px;border-radius:16px;overflow:hidden;border:1px solid #e8eef9;background:#f8fafc}
.ag-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.ag-wrap .ag-thumb-remove{position:absolute;top:4px;right:4px;width:20px!important;height:20px!important;min-width:20px!important;min-height:20px!important;margin:0!important;padding:0!important;border:0!important;border-radius:50%!important;background:rgba(16,24,40,.68)!important;color:#fff!important;font-size:11px!important;cursor:pointer;display:flex!important;align-items:center;justify-content:center}
.ag-wrap .ag-thumb-view{position:absolute;left:50%;top:50%;width:28px!important;height:28px!important;min-width:28px!important;min-height:28px!important;margin:0!important;padding:0!important;border:0!important;border-radius:50%!important;background:rgba(16,24,40,.72)!important;color:#fff!important;cursor:pointer;display:flex!important;align-items:center;justify-content:center;transform:translate(-50%,-50%);z-index:1}
.ag-toolbar{display:flex;align-items:center;gap:8px;margin-top:8px;padding-top:12px;border-top:1px solid #eef1f7;flex-wrap:wrap}
.ag-model-select{position:relative;flex:0 0 auto;min-width:0}
.ag-model-button{width:auto;max-width:100%;display:flex;align-items:center;gap:6px;border:1px solid #dbe4f3;border-radius:999px;padding:6px 12px;font-size:13px;font-family:inherit;background:#eaf0fb;color:#344054;cursor:pointer;text-align:left;transition:background .18s ease,color .18s ease,border-color .18s ease,box-shadow .18s ease}
.ag-model-button:hover{border-color:#c5d4f5;background:#eef3ff;color:var(--ag-blue);box-shadow:0 2px 8px rgba(47,107,255,.1)}
.ag-model-button[aria-expanded="true"]{border-color:var(--ag-blue);background:var(--ag-blue-soft);color:var(--ag-blue)}
.ag-model-button .ag-chevron{margin-left:auto;flex-shrink:0;color:#98a2b3}
.ag-model-list{position:absolute;bottom:calc(100% + 6px);left:0;width:min(420px,calc(100vw - 48px));min-width:320px;background:#fff;border:1px solid #e6eaf2;border-radius:14px;box-shadow:0 16px 40px rgba(16,24,40,.16);padding:6px;z-index:50;max-height:320px;overflow-x:hidden;overflow-y:auto}
.ag-model-item{width:100%;display:flex;align-items:center;gap:8px;border:0;background:transparent;border-radius:10px;padding:8px 10px;font-size:14px;font-family:inherit;cursor:pointer;text-align:left;transition:background .16s ease}
.ag-model-item:hover{background:#f1f5ff}
.ag-model-item.is-active{background:#eaf0ff;box-shadow:inset 0 0 0 1px #cdd9ff}
.ag-model-icon{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:8px;background:#eef3ff;border:1px solid #e4ebf8;flex-shrink:0}
.ag-model-icon-blank{background:transparent;border-color:transparent}
.ag-model-text{display:flex;flex-direction:column;min-width:0;flex:1;overflow:hidden}
.ag-model-label{font-weight:650;font-size:13px;line-height:1.2;color:#101828;display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}
.ag-model-free{display:inline-flex;align-items:center;height:16px;padding:0 5px;border-radius:999px;background:#d92d20;border:1px solid #d92d20;color:#fff;font-size:9px;font-weight:800;letter-spacing:.04em;line-height:1}
.ag-model-badge{display:inline-flex;align-items:center;height:16px;padding:0 5px;border-radius:999px;background:#fff1f3;border:1px solid #ffcdd2;color:#c01048;font-size:9px;font-weight:800}
.ag-model-desc{font-size:11px;color:#8b97ab;line-height:1.35;margin-top:2px;white-space:normal;overflow:visible}
.ag-model-rating{display:inline-flex;align-items:center;gap:5px;margin-top:3px;line-height:1}
.ag-model-stars{position:relative;display:inline-block;height:12px}
.ag-model-stars-bg,.ag-model-stars-fill{display:flex;align-items:center;gap:1px}
.ag-model-stars-fill{position:absolute;left:0;top:0;bottom:0;overflow:hidden;white-space:nowrap}
.ag-model-stars svg{display:block;width:12px;height:12px;flex-shrink:0}
.ag-model-stars-bg svg{fill:#d8deea}
.ag-model-stars-fill svg{fill:#f6b21b}
.ag-model-score{font-size:11px;font-weight:750;color:#b47a00}
.ag-model-button .ag-model-rating,.ag-model-button .ag-model-desc,.ag-model-button .ag-model-price{display:none}
.ag-model-price{flex-shrink:0;display:inline-flex;align-items:center;gap:2px;height:20px;font-size:11px;font-weight:650;color:#b47a00;background:#fff8e8;border:1px solid #ffe9b8;border-radius:999px;padding:0 6px}
.ag-model-price:empty{display:none}
.ag-credit-coin{display:inline-block;vertical-align:middle;width:12px;height:12px}
.ag-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid var(--ag-line);border-radius:10px;padding:9px 14px;font-size:14px;font-weight:600;background:#fff;cursor:pointer;color:#101828;transition:background .18s ease,border-color .18s ease,box-shadow .18s ease,transform .12s ease}
.ag-btn:hover{background:#f6f8fb}
.ag-btn:active{transform:translateY(1px)}
.ag-btn:disabled{opacity:.55;cursor:not-allowed;transform:none}
.ag-btn-primary{background:var(--ag-blue);border-color:var(--ag-blue);color:#fff}
.ag-btn-primary:hover{background:var(--ag-blue-dark);border-color:var(--ag-blue-dark)}
.ag-generate-wrap{display:flex;flex-direction:column;align-items:flex-end;gap:6px;margin-left:auto}
.ag-btn-generate{min-height:40px;padding:8px 18px;border-radius:999px;background:linear-gradient(120deg,#2f6bff 0%,#5b4bff 100%);border-color:transparent;box-shadow:0 8px 20px rgba(0,85,255,.28);margin-left:0}
.ag-btn-generate:hover{background:linear-gradient(120deg,#255cf0 0%,#4f3ff0 100%);border-color:transparent;box-shadow:0 10px 26px rgba(0,85,255,.34);transform:translateY(-1px)}
.ag-btn-generate:active{transform:translateY(0)}
.ag-btn-generate.is-locked,.ag-btn-generate.is-locked:hover,.ag-btn-generate.is-locked:disabled{background:#98a2b3;border-color:#98a2b3;color:#fff;box-shadow:none;cursor:not-allowed;opacity:1;transform:none}
.ag-credits-pill{display:inline-flex;align-items:center;gap:3px;background:rgba(255,255,255,.22);border-radius:999px;padding:2px 8px;font-size:12px;font-weight:600}
.ag-credits-pill.is-free{background:#d92d20;color:#fff;font-weight:800;letter-spacing:.04em}
.ag-settings-anchor{position:relative}
.ag-btn-settings{min-height:36px;padding:6px 12px;border-radius:999px;background:#eaf0fb;border-color:#dbe4f3;color:#344054;font-weight:650}
.ag-btn-settings:hover{background:#dfe8fa;border-color:#c5d4f5;box-shadow:0 2px 8px rgba(47,107,255,.1)}
.ag-btn-settings[aria-expanded="true"]{border-color:var(--ag-blue);background:var(--ag-blue-soft);color:var(--ag-blue)}
.ag-btn-settings .ag-chevron{margin-left:4px;transform:rotate(180deg)}
.ag-btn-settings[aria-expanded="true"] .ag-chevron{transform:rotate(0)}
.ag-settings-summary{display:inline-flex;align-items:center;gap:8px}
.ag-settings-summary .ag-chip-shape{flex-shrink:0;color:currentColor}
.ag-settings-summary-text{font-size:13px;font-weight:650;white-space:nowrap}
.ag-settings{position:absolute;bottom:calc(100% + 8px);left:0;z-index:60;min-width:320px;padding:28px 10px 10px;border:1px solid #e1e7f0;border-radius:14px;background:#fff;box-shadow:0 12px 32px rgba(16,24,40,.16);display:flex;flex-direction:column;gap:6px}
.ag-chips.is-locked .ag-chip.is-disabled,.ag-chip.is-disabled{opacity:.42;cursor:not-allowed;box-shadow:none}
.ag-chips.is-locked .ag-chip.is-disabled:hover{border-color:#e4ebf8;background:#fff;color:#5b677a}
.ag-settings-head{position:absolute;top:4px;right:5px}
.ag-settings-close{display:inline-flex!important;align-items:center;justify-content:center;width:28px;height:28px;padding:0!important;border:1px solid #d0d5dd!important;border-radius:8px;background:#fff!important;cursor:pointer}
.ag-setting-row{padding:6px 8px;border:1px solid #e8eef9;border-radius:9px;background:#f8faff;display:flex;flex-direction:column;gap:6px}
.ag-setting-label{margin:0;font-size:12px;font-weight:650;color:#344054}
.ag-chips{display:flex;flex-wrap:wrap;gap:6px}
.ag-chip{border:1px solid #e4ebf8;border-radius:8px;background:#fff;padding:5px 10px;font-size:12px;font-weight:600;color:#5b677a;cursor:pointer;transition:border-color .16s ease,background .16s ease,color .16s ease}
.ag-chip:hover{border-color:#c5d4f5;background:#f4f7ff;color:var(--ag-blue)}
.ag-chip.is-active{border-color:var(--ag-blue);background:var(--ag-blue-soft);color:var(--ag-blue);box-shadow:0 2px 8px rgba(47,107,255,.14)}
.ag-chip-ratio{display:inline-flex;flex-direction:column;align-items:center;gap:3px;padding:4px 8px;min-width:52px}
.ag-chip-shape{display:inline-block;border:2px solid currentColor;border-radius:3px;opacity:.8}
.ag-chip-text{font-size:11px;font-weight:600;line-height:1}
.ag-chip-res{display:inline-flex;flex-direction:column;align-items:center;gap:1px;padding:5px 12px;min-width:56px}
.ag-chip-price{font-size:10px;font-weight:500;color:var(--ag-muted)}
.ag-status{margin-top:8px;padding:8px 10px;border-radius:10px;font-size:13px}
.ag-status.is-error{background:#fef3f2;color:#b42318;border:1px solid #fecdca}
.ag-status.is-ok{background:var(--ag-blue-soft);color:var(--ag-blue-dark);border:1px solid #c7d7ff}
.ag-history{margin-top:18px;background:linear-gradient(#fff,#fdfdff);border:1px solid var(--ag-hair);border-radius:18px;padding:16px;box-shadow:var(--ag-shadow-md)}
.ag-history-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.ag-history-head h2{margin:0;color:#182230;font-size:18px;font-weight:750;display:flex;align-items:center;gap:8px}
.ag-history-head h2 span{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:20px;padding:0 6px;border-radius:999px;background:#2f6bff;color:#fff;font-size:12px;font-weight:750}
.ag-history-tools{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:6px}
.ag-wrap .ag-select-toggle,.ag-wrap .ag-select-all,.ag-wrap .ag-delete-selected,.ag-wrap .ag-view-all{min-height:28px;padding:4px 10px;border-radius:8px;font-size:12px}
.ag-wrap .ag-view-all,.ag-wrap .ag-select-toggle,.ag-wrap .ag-select-all{border-color:#c5d4f5;background:#eef3ff;color:#2f6bff}
.ag-wrap .ag-view-all:hover,.ag-wrap .ag-select-toggle:hover,.ag-wrap .ag-select-all:hover{background:#2f6bff;border-color:#2f6bff;color:#fff}
.ag-wrap .ag-delete-selected{border-color:#fecdca;background:#fef3f2;color:#b42318}
.ag-wrap .ag-delete-selected:hover{background:#b42318;border-color:#b42318;color:#fff}
.ag-history-notice{padding:8px;border-radius:8px;background:#fff4d6;color:#854d0e;font-size:12px;margin-top:6px}
.ag-history-list{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:12px}
.ag-history-card{position:relative;padding:0;background:#fff;border:1px solid #e8ecf2;border-radius:13px;overflow:hidden;transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}
.ag-history-card:hover{border-color:#d2ddf7;box-shadow:0 12px 28px rgba(47,107,255,.12);transform:translateY(-2px)}
.ag-history.is-selecting .ag-history-card{cursor:pointer}
.ag-history-card.is-selected,.ag-gallery-item.is-selected{border-color:#2f6bff;box-shadow:0 0 0 2px rgba(47,107,255,.18)}
.ag-history-check{position:absolute;top:8px;left:8px;z-index:3;display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:6px;background:#fffffff2;border:1px solid #d0d5dd}
.ag-history-check input{margin:0;width:14px;height:14px;accent-color:#2f6bff}
.ag-history-image,.ag-gallery-image{position:relative;display:flex;width:100%;height:168px;align-items:center;justify-content:center;padding:0;border:0;background:#eef1f6;cursor:zoom-in;overflow:hidden}
.ag-history-image img,.ag-gallery-image img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .3s ease}
.ag-history-card:hover .ag-history-image img,.ag-gallery-item:hover .ag-gallery-image img{transform:scale(1.03)}
.ag-history-overlay,.ag-gallery-overlay{position:absolute;top:8px;right:8px;z-index:2;display:flex;gap:6px;opacity:0;transform:translateY(-4px);transition:opacity .16s ease,transform .16s ease}
.ag-history-card:hover .ag-history-overlay,.ag-history-card:focus-within .ag-history-overlay,.ag-gallery-item:hover .ag-gallery-overlay,.ag-gallery-item:focus-within .ag-gallery-overlay{opacity:1;transform:none}
.ag-overlay-btn,.ag-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:1px solid #dce6f7;border-radius:10px;background:#fffffff2;color:#182230;cursor:pointer;box-shadow:0 6px 16px rgba(16,24,40,.12);overflow:hidden;font-size:0;line-height:0}
.ag-overlay-btn.is-download,.ag-preview-download{background:linear-gradient(120deg,#2f6bff,#5b4bff);border-color:transparent;color:#fff}
.ag-overlay-btn.is-delete{background:#fef3f2;border-color:#fecdca;color:#b42318}
.ag-overlay-btn:hover,.ag-icon-btn:hover{transform:translateY(-1px)}
.ag-empty{color:#8b97ab;text-align:center;padding:40px 16px}
.ag-empty svg{width:56px;height:56px;padding:14px;border-radius:16px;background:linear-gradient(140deg,#eef3ff,#f3f0ff);border:1px solid #e4ebf8;color:#8595c9;box-shadow:0 6px 18px rgba(47,107,255,.08)}
.ag-empty p{margin:14px 0 0;font-size:13.5px;color:#8b97ab}
.ag-loading{display:flex;flex-direction:column;align-items:center;gap:14px;color:var(--ag-muted);padding:28px 16px;margin-top:8px}
.ag-spinner{width:36px;height:36px;border:3px solid #e2e7f0;border-top-color:var(--ag-blue);border-radius:50%;animation:ag-spin 1s linear infinite}
@keyframes ag-spin{to{transform:rotate(360deg)}}
@keyframes ag-flash{0%{box-shadow:0 0 0 0 rgba(47,107,255,.28)}40%{box-shadow:0 0 0 6px rgba(47,107,255,.16)}100%{box-shadow:none}}
.ag-wrap .ag-image-dialog{width:min(1080px,94vw);max-width:94vw;max-height:92vh;padding:44px 16px 16px}
.ag-wrap .ag-image-dialog.is-detail{width:min(1120px,96vw);padding:44px 16px 16px}
.ag-preview-layout{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(260px,.75fr);gap:18px;align-items:stretch;min-height:0}
.ag-image-dialog:not(.is-detail) .ag-preview-layout{grid-template-columns:1fr}
.ag-preview-media{display:flex;align-items:center;justify-content:center;min-height:0;background:#f4f6fb;border:1px solid #e8eef9;border-radius:14px;overflow:hidden}
.ag-preview-media img,.ag-image-dialog img{display:block;max-width:100%;max-height:min(74vh,820px);width:auto;height:auto;object-fit:contain;margin:auto}
.ag-preview-side{display:flex;flex-direction:column;min-width:0;min-height:0}
.ag-preview-meta{position:static;margin:0 0 12px;padding:0;background:transparent;color:#667085;font-size:12px;font-weight:650;line-height:1.45;white-space:normal}
.ag-preview-prompt-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 8px}
.ag-preview-prompt-head strong{font-size:13px;color:#182230}
.ag-preview-prompt-box{position:relative;min-width:0}
.ag-wrap .ag-preview-prompt-copy{position:absolute;top:8px;right:8px;z-index:1;width:30px;height:30px;color:#2f6bff;background:#fff;border-color:#dce6f7;box-shadow:0 6px 16px rgba(47,107,255,.12)}
.ag-wrap .ag-preview-prompt-copy svg,.ag-wrap .ag-view-prompt-copy svg{display:block}
.ag-wrap .ag-preview-prompt-copy.is-copied,.ag-wrap .ag-view-prompt-copy.is-copied{background:#fff;border-color:#c7d7ff;color:#2f6bff}
.ag-wrap .ag-preview-prompt-copy.is-copied svg,.ag-wrap .ag-view-prompt-copy.is-copied svg{animation:ag-copy-pop .28s ease}
@keyframes ag-copy-pop{0%{transform:scale(.55);opacity:.35}100%{transform:scale(1);opacity:1}}
.ag-preview-prompt{margin:0;max-height:19.8em;overflow:hidden;padding:12px 44px 12px 14px;border:1px solid #e8eef9;border-radius:12px;background:#f8faff;color:#344054;font-size:14px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere}
.ag-preview-prompt-box.is-truncated .ag-preview-prompt{padding-bottom:40px}
.ag-preview-prompt-box.is-truncated .ag-preview-prompt::after{content:"";position:absolute;left:1px;right:1px;bottom:1px;height:52px;pointer-events:none;border-radius:0 0 11px 11px;background:linear-gradient(180deg,rgba(248,250,255,0),#f8faff 72%)}
.ag-preview-prompt-box .ag-preview-prompt{position:relative}
.ag-wrap .ag-preview-prompt-more{position:absolute;right:8px;bottom:8px;z-index:1;width:30px;height:30px;color:#2f6bff;background:#fff;border-color:#dce6f7;box-shadow:0 6px 16px rgba(47,107,255,.12)}
.ag-preview-actions{display:flex;align-items:center;gap:8px;margin-top:14px}
.ag-preview-actions .ag-btn{min-height:36px}
.ag-wrap .ag-preview-use{background:linear-gradient(120deg,#2f6bff,#5b4bff);border-color:transparent;color:#fff;box-shadow:0 8px 18px rgba(47,107,255,.28)}
.ag-wrap .ag-preview-use:hover{background:linear-gradient(120deg,#255cf0,#4f3ff0);border-color:transparent;color:#fff;box-shadow:0 10px 22px rgba(47,107,255,.34)}
.ag-wrap .ag-gallery-dialog,.ag-wrap .ag-view-prompt-dialog,.ag-wrap .ag-prompt-dialog{width:min(1100px,94vw);max-width:94vw;max-height:92vh;border:1px solid #e4e7ec;border-radius:16px;padding:44px 16px 16px;background:#fff;box-shadow:0 24px 80px #10182840;position:relative}
.ag-image-dialog{border:1px solid #e4e7ec;border-radius:16px;background:#fff;box-shadow:0 24px 80px #10182840;position:relative}
.ag-image-dialog::backdrop,.ag-gallery-dialog::backdrop,.ag-view-prompt-dialog::backdrop,.ag-prompt-dialog::backdrop{background:#101828b3}
.ag-wrap .ag-preview-close{position:absolute;top:10px;right:10px;display:inline-flex!important;align-items:center;justify-content:center;width:32px!important;height:32px!important;margin:0!important;padding:0!important;border:1px solid #d0d5dd!important;border-radius:8px!important;background:#fff!important;cursor:pointer}
.ag-gallery-dialog .ag-preview-close,.ag-prompt-dialog .ag-preview-close,.ag-view-prompt-dialog .ag-preview-close{position:static}
.ag-gallery-head,.ag-prompt-dialog-head{position:absolute;top:12px;left:16px;right:16px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.ag-prompt-dialog .ag-prompt-dialog-head{justify-content:flex-end}
.ag-gallery-head strong,.ag-prompt-dialog-head strong{font-size:15px;color:#182230}
.ag-gallery-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;max-height:calc(90vh - 88px);overflow:auto}
.ag-gallery-item{position:relative;display:block;margin:0;padding:0;border:1px solid #e8eef9;border-radius:12px;background:#f8faff;overflow:hidden}
.ag-gallery-image{height:auto;aspect-ratio:1/1}
.ag-gallery-item img{display:block;width:100%;height:100%;aspect-ratio:1/1;object-fit:cover}
.ag-view-prompt-tools{display:flex;align-items:center;gap:8px}
.ag-wrap .ag-view-prompt-copy{position:static!important;display:inline-flex!important;width:32px!important;height:32px!important;border:1px solid #d0d5dd!important;border-radius:8px!important;background:#fff!important;cursor:pointer}
.ag-view-prompt-body{margin:0;max-height:min(58vh,480px);overflow:auto;color:#344054;font-size:14px;line-height:1.65;white-space:pre-wrap}
.ag-prompt-expanded{min-height:min(58vh,520px)!important;height:min(58vh,520px)!important;max-height:min(58vh,520px)!important;padding:14px 16px;background:#fff}
.ag-intro{margin:64px auto 16px;max-width:100%;color:#344054;overflow-wrap:anywhere}
.ag-intro-hero{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:52px;align-items:center;margin:0}
.ag-intro-sample{position:relative;margin:0;overflow:hidden;border-radius:22px;box-shadow:0 30px 70px -24px rgba(47,71,145,.4)}
.ag-intro-sample::after{content:"";position:absolute;inset:0;border-radius:22px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.3);pointer-events:none}
.ag-intro-sample img{display:block;width:100%;height:auto;aspect-ratio:4/3;object-fit:cover}
.ag-intro-eyebrow{display:inline-flex;align-items:center;margin:0 0 16px;padding:5px 13px;border-radius:999px;background:var(--ag-blue-soft);color:var(--ag-blue);font-size:12px;font-weight:750;letter-spacing:.04em;text-transform:uppercase}
.ag-intro-copy h2{margin:0 0 18px;font-size:34px;font-weight:820;line-height:1.2;letter-spacing:-.03em;background:linear-gradient(118deg,#111a2e 0%,#2f5bff 60%,#6b4bff 100%);-webkit-background-clip:text;background-clip:text;color:transparent}
.ag-intro-copy p{margin:0 0 14px;font-size:16px;line-height:1.8;color:#475467}
.ag-intro-copy p:last-child{margin-bottom:0}
.ag-intro>section+section{margin-top:72px}
.ag-intro-explore h3{margin:0 0 36px;text-align:center;font-size:28px;font-weight:820;letter-spacing:-.025em;color:#101828}
.ag-intro-explore h3::after{content:"";display:block;width:52px;height:4px;margin:14px auto 0;border-radius:99px;background:linear-gradient(90deg,#2f5bff,#6b4bff)}
.ag-intro-explore-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.ag-intro-explore-grid figure,.ag-explore-item{display:block;width:100%;margin:0;padding:0;border:0;background:transparent;overflow:hidden;border-radius:16px;box-shadow:0 16px 36px -20px rgba(47,71,145,.4)}
.ag-explore-item{cursor:zoom-in}
.ag-intro-explore-grid img{display:block;width:100%;height:100%;aspect-ratio:1/1;object-fit:cover;transition:transform .3s ease}
.ag-intro-explore-grid figure:hover img,.ag-explore-item:hover img{transform:scale(1.04)}
.ag-prompt-wrap.is-flash,.ag-composer.is-flash{animation:ag-flash .9s ease}
.ag-intro-feats h3,.ag-intro-how h3,.ag-intro-faq h3{margin:0 0 36px;text-align:center;font-size:28px;font-weight:820;letter-spacing:-.025em;color:#101828}
.ag-intro-feats h3::after,.ag-intro-how h3::after,.ag-intro-faq h3::after{content:"";display:block;width:52px;height:4px;margin:14px auto 0;border-radius:99px;background:linear-gradient(90deg,#2f5bff,#6b4bff)}
.ag-intro-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.ag-intro-grid>div{padding:22px 22px 20px;border-radius:16px;background:linear-gradient(#fff,#fbfcff);box-shadow:0 10px 30px -18px rgba(47,71,145,.35);transition:transform .18s ease,box-shadow .18s ease}
.ag-intro-grid>div:hover{transform:translateY(-3px);box-shadow:0 18px 40px -18px rgba(47,71,145,.45)}
.ag-intro-grid h4{margin:0 0 8px;color:#101828;font-size:17px;font-weight:720;line-height:1.35;display:flex;align-items:center;gap:9px}
.ag-intro-grid h4::before{content:"";flex-shrink:0;width:9px;height:9px;border-radius:50%;background:linear-gradient(120deg,#2f6bff,#6b4bff)}
.ag-intro-grid p,.ag-intro-steps p{margin:0;font-size:14.5px;line-height:1.7;color:#5a6478}
.ag-intro-steps{margin:0;padding:0;list-style:none;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}
.ag-intro-steps li{position:relative;display:flex;flex-direction:column;gap:16px;align-items:flex-start;padding:30px 24px 24px;border-radius:18px;background:linear-gradient(#fff,#fbfcff);box-shadow:0 14px 36px -20px rgba(47,71,145,.4);overflow:hidden;transition:transform .2s ease,box-shadow .2s ease}
.ag-intro-steps li::before{content:"";position:absolute;top:0;left:0;right:0;height:4px;background:linear-gradient(90deg,#2f6bff,#6b4bff)}
.ag-intro-steps li:hover{transform:translateY(-4px);box-shadow:0 24px 48px -22px rgba(47,71,145,.5)}
.ag-intro-steps li:not(:last-child)::after{content:"";position:absolute;top:50px;right:-11px;z-index:2;width:22px;height:22px;display:none}
.ag-intro-steps h4{margin:0 0 6px;color:#101828;font-size:17px;font-weight:720;line-height:1.35}
.ag-intro-step-num{position:relative;z-index:1;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:16px;background:linear-gradient(135deg,#2f6bff,#6b4bff);color:#fff;font-size:20px;font-weight:820;box-shadow:0 12px 26px rgba(47,107,255,.38)}
.ag-intro-step-num::after{content:"";position:absolute;inset:0;border-radius:16px;box-shadow:inset 0 1px 1px rgba(255,255,255,.5)}
.ag-wrap [hidden]{display:none !important}
@media (max-width:980px){
	.ag-history-list,.ag-gallery-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
	.ag-preview-layout{grid-template-columns:1fr;gap:14px}
	.ag-preview-prompt{max-height:13.2em}
}
@media (max-width:720px){
	.ag-title{font-size:30px}
	.ag-composer-main{flex-direction:column;align-items:stretch}
	.ag-prompt-wrap,.ag-textarea{height:110px;min-height:110px;max-height:110px}
	.ag-refs{width:100%;max-width:none}
	.ag-history-list,.ag-gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
	.ag-history-image{height:150px}
	.ag-history-overlay,.ag-gallery-overlay{opacity:1;transform:none}
	.ag-history-head{align-items:flex-start;flex-direction:column}
	.ag-preview-media img,.ag-image-dialog img{max-height:48vh}
	.ag-loading{padding:32px 16px}
	.ag-toolbar{flex-direction:column;align-items:stretch}
	.ag-generate-wrap{width:100%;align-items:stretch}
	.ag-btn-generate{margin-left:0;width:100%}
	.ag-quota-note{justify-content:center}
	.ag-model-select{min-width:0;max-width:none}
	.ag-model-list{width:100%;min-width:0}
	.ag-intro{margin-top:32px}
	.ag-intro-hero{grid-template-columns:1fr;gap:20px}
	.ag-intro-copy h2{font-size:24px}
	.ag-intro-copy p{font-size:15px}
	.ag-intro-explore-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
	.ag-intro-explore h3{font-size:22px;margin-bottom:26px}
	.ag-intro-grid{grid-template-columns:1fr;gap:14px}
	.ag-intro-steps{grid-template-columns:1fr;gap:18px}
	.ag-intro-steps li:not(:last-child)::after{display:none}
	.ag-intro-feats h3,.ag-intro-how h3,.ag-intro-faq h3{font-size:22px;margin-bottom:26px}
}
