/* v1.2.8.16-r4 — 125% UI Scale + Unified Result Action Bar + Responsive History. */
/* AI Designer v1.2.7.5 R1 — strict empty-field UX + larger canvas/full-width parity. */
.pfig-root{width:100%;background:var(--pfig-root-bg);color:var(--pfig-text);padding:var(--pfig-root-pad);margin:var(--pfig-root-margin);border-radius:var(--pfig-root-radius);box-shadow:var(--pfig-root-shadow);font:var(--pfig-body-size)/1.5 Inter,system-ui,-apple-system,"Segoe UI",sans-serif}.pfig-root *{box-sizing:border-box}.pfig-wrap{width:var(--pfig-ui-width,100%);max-width:var(--pfig-scaled-max,var(--pfig-max));margin:0 auto;zoom:var(--pfig-ui-scale,1.25)}.pfig-root[data-pfig-width-mode="row"] .pfig-wrap{max-width:100%}.pfig-root[data-pfig-full-bleed="1"]{width:calc(100vw - (var(--pfig-full-gutter) * 2));max-width:none;margin-left:calc(50% - 50vw + var(--pfig-full-gutter));margin-right:calc(50% - 50vw + var(--pfig-full-gutter))}.pfig-root[data-pfig-full-bleed="1"] .pfig-wrap,.pfig-root[data-pfig-full-bleed="1"][data-pfig-width-mode="row"] .pfig-wrap{max-width:var(--pfig-scaled-full-max,var(--pfig-full-max));margin-left:auto;margin-right:auto}.pfig-root[data-pfig-hero-align] .pfig-hero{margin:0 0 22px;text-align:var(--pfig-hero-align,left)}.pfig-root[data-pfig-hero-align="left"] .pfig-hero p{margin-left:0;margin-right:auto}.pfig-root[data-pfig-hero-align="center"] .pfig-hero p{margin-left:auto;margin-right:auto}.pfig-root[data-pfig-hero-align="right"] .pfig-hero p{margin-left:auto;margin-right:0}.pfig-root[data-pfig-hero-align="left"] .pfig-wallet-strip{justify-content:flex-start}.pfig-root[data-pfig-hero-align="center"] .pfig-wallet-strip{justify-content:center}.pfig-root[data-pfig-hero-align="right"] .pfig-wallet-strip{justify-content:flex-end}.pfig-root .pfig-badge{display:inline-flex;align-items:center;padding:6px 10px;border-radius:999px;background:#e0f2fe;color:var(--pfig-badge-color,#0369a1);font-family:var(--pfig-badge-font,inherit);font-size:var(--pfig-badge-size,11px);font-weight:var(--pfig-badge-weight,800);line-height:var(--pfig-badge-lh,1);letter-spacing:var(--pfig-badge-ls,.08em);text-transform:var(--pfig-badge-transform,none)}.pfig-root .pfig-hero h2{margin:10px 0 7px;color:var(--pfig-title-color);font-family:var(--pfig-title-font,inherit);font-size:var(--pfig-title-size);line-height:var(--pfig-title-lh,1.1);font-weight:var(--pfig-title-weight);letter-spacing:var(--pfig-title-ls,-.035em);text-transform:var(--pfig-title-transform,none);text-align:inherit}.pfig-root .pfig-hero p{max-width:860px;margin-top:0;margin-bottom:0;color:var(--pfig-desc-color);font-family:var(--pfig-desc-font,inherit);font-size:var(--pfig-desc-size);font-weight:var(--pfig-desc-weight,400);line-height:var(--pfig-desc-lh,1.55);letter-spacing:var(--pfig-desc-ls,normal);text-transform:var(--pfig-desc-transform,none);text-align:inherit}.pfig-wallet-strip{display:flex;gap:8px;margin-top:12px}.pfig-wallet-strip span{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;border:1px solid var(--pfig-border);border-radius:999px;background:var(--pfig-surface);color:var(--pfig-muted);font-size:11px}.pfig-wallet-strip strong{color:var(--pfig-text)}
.pfig-grid{display:grid;grid-template-columns:minmax(360px,var(--pfig-left)) minmax(0,1fr);gap:var(--pfig-gap);align-items:start}.pfig-controls{display:flex;flex-direction:column;gap:14px;min-width:0}.pfig-workspace{display:flex;flex-direction:column;gap:16px;min-width:0}.pfig-panel,.pfig-result-panel,.pfig-history{background:var(--pfig-panel-bg);border:var(--pfig-panel-border-w) var(--pfig-panel-border-style) var(--pfig-panel-border);border-radius:var(--pfig-radius);box-shadow:var(--pfig-shadow);overflow:hidden}.pfig-panel{padding:var(--pfig-panel-pad)}.pfig-panel-head,.pfig-result-head{display:flex;justify-content:space-between;align-items:center;gap:12px}.pfig-panel-head{margin-bottom:13px}.pfig-panel-head b,.pfig-result-head b{color:var(--pfig-panel-title-color);font-size:var(--pfig-panel-title-size);font-weight:var(--pfig-panel-title-weight)}.pfig-panel-meta,.pfig-result-head small{color:var(--pfig-muted);font-size:11px;font-weight:500}.pfig-result-head{padding:15px 17px;border-bottom:1px solid var(--pfig-border);margin:0}.pfig-result-head>div{display:flex;flex-direction:column;gap:2px}.pfig-result-head>span{font-size:11px;color:var(--pfig-muted);text-align:right}.pfig-runtime-chip{padding:3px 7px;border-radius:999px;background:#fff7ed;color:#c2410c;font-size:9px;font-weight:800;white-space:nowrap}.pfig-root[data-pfig-result-sticky="1"] .pfig-result-panel{position:sticky;top:var(--pfig-result-sticky-top);z-index:2}
.pfig-mode-switch,.pfig-count-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.pfig-mode-switch button,.pfig-count-row button,.pfig-tier-grid button,.pfig-profile-card{border:1px solid var(--pfig-border);background:var(--pfig-surface);color:var(--pfig-text);border-radius:10px;cursor:pointer;transition:.16s ease}.pfig-mode-switch button:hover,.pfig-count-row button:hover,.pfig-tier-grid button:hover,.pfig-profile-card:hover{border-color:#94a3b8;background:#fbfdff}.pfig-mode-switch button,.pfig-count-row button{padding:9px 10px;font-weight:750;font-size:12px}.pfig-mode-switch button.is-active,.pfig-count-row button.is-active,.pfig-tier-grid button.is-active,.pfig-profile-card.is-active{border-color:var(--pfig-accent);background:#eff9ff;box-shadow:0 0 0 2px rgba(14,165,233,.08)}.pfig-profile-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.pfig-profile-card{min-height:70px;padding:9px 6px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;text-align:center}.pfig-profile-card i{font-size:19px;color:var(--pfig-accent)}.pfig-profile-card span{font-size:10.5px;font-weight:750;line-height:1.2}.pfig-tier-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.pfig-tier-grid button{padding:11px 7px;display:flex;flex-direction:column;gap:2px}.pfig-tier-grid b{font-size:12px}.pfig-tier-grid small{color:var(--pfig-muted);font-size:9.5px}
.pfig-label,.pfig-dynamic-field{display:flex;flex-direction:column;gap:5px;color:var(--pfig-muted);font-size:11px}.pfig-label select,.pfig-dynamic-field input,.pfig-dynamic-field textarea,.pfig-dynamic-field select{width:100%;min-height:40px;border:1px solid var(--pfig-border);border-radius:9px;background:var(--pfig-surface);color:var(--pfig-text);padding:8px 10px;font:inherit;outline:none;transition:.16s ease}.pfig-dynamic-field textarea{resize:vertical;line-height:1.45}.pfig-dynamic-field input:focus,.pfig-dynamic-field textarea:focus,.pfig-dynamic-field select:focus,.pfig-label select:focus{border-color:var(--pfig-accent);box-shadow:0 0 0 2px rgba(14,165,233,.08)}.pfig-output-grid,.pfig-core-fields,.pfig-field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.pfig-output-grid{margin:12px 0}.pfig-count-row{grid-template-columns:repeat(3,minmax(0,1fr))}.pfig-span-2{grid-column:1/-1}.pfig-field-zone{margin-top:12px}.pfig-field-group{border-top:1px solid var(--pfig-border);padding-top:10px;margin-top:10px}.pfig-field-group summary{display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;font-weight:800;color:var(--pfig-text);margin-bottom:10px;list-style:none}.pfig-field-group summary::-webkit-details-marker{display:none}.pfig-field-group summary:after{content:"+";color:var(--pfig-muted);font-size:15px}.pfig-field-group[open] summary:after{content:"−"}.pfig-field-group summary small{font-weight:500;color:var(--pfig-muted);font-size:9.5px}.pfig-check{display:flex;align-items:center;gap:8px;cursor:pointer}.pfig-check input{display:none}.pfig-check span{width:34px;height:18px;border-radius:999px;background:#cbd5e1;position:relative}.pfig-check span:after{content:"";position:absolute;width:14px;height:14px;top:2px;left:2px;border-radius:50%;background:#fff;transition:.15s}.pfig-check input:checked+span{background:var(--pfig-accent)}.pfig-check input:checked+span:after{transform:translateX(16px)}.pfig-check em{font-style:normal;color:var(--pfig-text)}.pfig-color-row{display:grid;grid-template-columns:42px 1fr;gap:6px}.pfig-color-row input[type=color]{padding:3px}
.pfig-upload-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}.pfig-upload{min-height:100px;border:1px dashed #cbd5e1;border-radius:12px;background:var(--pfig-surface2);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:3px;cursor:pointer;transition:.16s}.pfig-upload:hover{border-color:var(--pfig-accent);background:#f0f9ff}.pfig-upload i{font-size:21px;color:var(--pfig-accent)}.pfig-upload span{font-weight:800;font-size:12px}.pfig-upload small{color:var(--pfig-muted);font-size:9.5px}.pfig-upload input{display:none}.pfig-file-list{display:grid;grid-template-columns:1fr;gap:7px;margin-top:9px}.pfig-file-chip{display:grid;grid-template-columns:38px minmax(0,1fr) 26px;align-items:center;gap:8px;padding:6px;border:1px solid var(--pfig-border);border-radius:9px;background:var(--pfig-surface2)}.pfig-file-chip>img{width:38px;height:38px;border-radius:7px;object-fit:cover;background:#fff}.pfig-file-chip>span{display:flex;min-width:0;flex-direction:column}.pfig-file-chip b{font-size:10px}.pfig-file-chip small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--pfig-muted);font-size:9px}.pfig-file-chip button{width:26px;height:26px;border:0;border-radius:7px;background:transparent;color:#94a3b8;cursor:pointer;font-size:16px}.pfig-file-chip button:hover{background:#fee2e2;color:#b91c1c}
.pfig-action-dock{display:flex;flex-direction:column;gap:10px;padding-top:2px}.pfig-root[data-pfig-action-sticky="1"] .pfig-action-dock{position:sticky;bottom:var(--pfig-action-bottom);z-index:5;padding:10px;border:1px solid rgba(226,232,240,.92);border-radius:14px;background:var(--pfig-action-bg);backdrop-filter:blur(var(--pfig-action-blur));box-shadow:0 12px 28px rgba(15,23,42,.10)}.pfig-price{padding:12px 14px;border-radius:11px;background:linear-gradient(135deg,#eff6ff,#f5f3ff);border:1px solid #dbeafe;display:grid;grid-template-columns:1fr auto;align-items:center}.pfig-price strong{font-size:18px;color:#4338ca}.pfig-price small{grid-column:1/-1;color:var(--pfig-muted);font-size:10px}.pfig-run{width:100%;border:0;border-radius:var(--pfig-button-radius);padding:var(--pfig-button-pad);background:var(--pfig-button-bg);color:var(--pfig-button-color);box-shadow:var(--pfig-button-shadow);font-weight:var(--pfig-button-weight);font-size:var(--pfig-button-size);cursor:pointer;display:flex;align-items:center;justify-content:center;gap:8px;transition:.16s}.pfig-run:hover{background:var(--pfig-button-hover);transform:translateY(-1px)}.pfig-run:disabled{opacity:.6;cursor:not-allowed;transform:none}.pfig-locked{padding:10px 12px;border-radius:9px;background:#fff7ed;border:1px solid #fed7aa;color:#9a3412;font-size:11px;line-height:1.45}.pfig-locked.is-success{border-color:#86efac;background:#f0fdf4;color:#166534}.pfig-locked.is-error{border-color:#fecaca;background:#fef2f2;color:#b91c1c}.pfig-locked.is-info{border-color:#bfdbfe;background:#eff6ff;color:#1d4ed8}
.pfig-stage{min-height:var(--pfig-result-min);display:grid;place-items:center;padding:28px;background:linear-gradient(45deg,#f8fafc 25%,transparent 25%),linear-gradient(-45deg,#f8fafc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#f8fafc 75%),linear-gradient(-45deg,transparent 75%,#f8fafc 75%),#fff;background-size:24px 24px;background-position:0 0,0 12px,12px -12px,-12px 0}.pfig-empty{max-width:560px;text-align:center}.pfig-empty-icon{width:68px;height:68px;border-radius:20px;margin:0 auto 12px;display:grid;place-items:center;background:linear-gradient(135deg,#e0f2fe,#ede9fe);font-size:28px;color:#4f46e5}.pfig-empty h3{margin:0 0 6px;font-size:19px}.pfig-empty p{margin:0;color:var(--pfig-muted);font-size:12px}.pfig-brief-preview{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin-top:15px}.pfig-brief-preview span{padding:5px 8px;border-radius:999px;background:#fff;border:1px solid var(--pfig-border);color:var(--pfig-muted);font-size:9.5px}
.pfig-runtime-results{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--pfig-result-gap);width:100%;align-items:start}.pfig-runtime-results.is-single{grid-template-columns:minmax(0,1fr);max-width:min(100%,860px);margin:auto}.pfig-runtime-card{border:1px solid var(--pfig-border);border-radius:var(--pfig-result-card-radius);overflow:hidden;background:var(--pfig-surface);box-shadow:0 10px 24px rgba(15,23,42,.06)}.pfig-runtime-media{display:grid;place-items:center;min-height:260px;background:var(--pfig-surface2);overflow:hidden}.pfig-runtime-card img{display:block;max-width:100%;width:auto;height:auto;max-height:var(--pfig-result-max);object-fit:contain}.pfig-runtime-results:not(.is-single) .pfig-runtime-card img{width:100%;height:auto;max-height:520px}.pfig-runtime-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 12px;border-top:1px solid var(--pfig-border)}.pfig-runtime-meta{display:flex;min-width:0;flex-direction:column}.pfig-runtime-meta b{font-size:12px}.pfig-runtime-meta small{color:var(--pfig-muted);font-size:9.5px}.pfig-download-wrap{display:flex;min-width:0}.pfig-root[data-pfig-download-align="left"] .pfig-download-wrap{justify-content:flex-start}.pfig-root[data-pfig-download-align="center"] .pfig-download-wrap{justify-content:center}.pfig-root[data-pfig-download-align="right"] .pfig-download-wrap{justify-content:flex-end}.pfig-download,.pfig-history-download{display:inline-flex;align-items:center;justify-content:center;gap:var(--pfig-download-icon-gap);border-radius:var(--pfig-download-radius);cursor:pointer;text-decoration:none;white-space:nowrap}.pfig-download{background:var(--pfig-download-bg);color:var(--pfig-download-color);border:var(--pfig-download-border-w) var(--pfig-download-border-style) var(--pfig-download-border);padding:var(--pfig-download-pad);box-shadow:var(--pfig-download-shadow);font-size:var(--pfig-download-size);font-weight:var(--pfig-download-weight)}.pfig-download:hover{background:var(--pfig-download-hover)}.pfig-download .pfig-download-icon{color:var(--pfig-download-icon-color);font-size:var(--pfig-download-icon-size);display:inline-flex}.pfig-download.is-icon-right,.pfig-history-download.is-icon-right{flex-direction:row-reverse}.pfig-root[data-pfig-download-display="full"] .pfig-download-wrap,.pfig-root[data-pfig-download-display="full"] .pfig-download{width:100%}.pfig-root[data-pfig-download-display="custom"] .pfig-download{width:var(--pfig-download-width)}.pfig-root[data-pfig-download-text-align="left"] .pfig-download{justify-content:flex-start}.pfig-root[data-pfig-download-text-align="center"] .pfig-download{justify-content:center}.pfig-root[data-pfig-download-text-align="right"] .pfig-download{justify-content:flex-end}
.pfig-history-list{display:grid;gap:var(--pfig-history-gap);padding:14px}.pfig-root[data-pfig-history-layout="grid"] .pfig-history-list{grid-template-columns:repeat(var(--pfig-history-cols),minmax(0,1fr))}.pfig-root[data-pfig-history-layout="list"] .pfig-history-list{grid-template-columns:1fr}.pfig-history-card{display:grid;grid-template-columns:var(--pfig-history-thumb) minmax(0,1fr) auto;align-items:center;gap:10px;padding:9px;border:1px solid var(--pfig-border);border-radius:11px;background:var(--pfig-surface)}.pfig-history-thumb{width:var(--pfig-history-thumb);height:var(--pfig-history-thumb);display:grid;place-items:center;border-radius:9px;overflow:hidden;background:var(--pfig-surface2);color:#94a3b8}.pfig-history-thumb img{width:100%;height:100%;object-fit:cover}.pfig-history-main{display:flex;min-width:0;flex-direction:column;gap:4px}.pfig-history-title{display:flex;align-items:center;gap:7px;min-width:0}.pfig-history-title b{font-size:11px}.pfig-history-main>small{color:var(--pfig-muted);font-size:9px}.pfig-history-status{padding:2px 6px;border-radius:999px;background:#e2e8f0;color:#475569;font-size:8px;font-weight:800}.pfig-history-status.is-completed{background:#dcfce7;color:#166534}.pfig-history-status.is-failed{background:#fee2e2;color:#b91c1c}.pfig-history-status.is-processing,.pfig-history-status.is-queued{background:#fef3c7;color:#92400e}.pfig-history-actions{display:flex;align-items:center}.pfig-history-download{background:var(--pfig-history-download-bg);color:var(--pfig-history-download-color);border:var(--pfig-history-download-border-w) var(--pfig-history-download-border-style) var(--pfig-history-download-border);padding:var(--pfig-history-download-pad);box-shadow:var(--pfig-history-download-shadow);font-size:var(--pfig-history-download-size);font-weight:var(--pfig-history-download-weight);gap:var(--pfig-history-download-icon-gap)}.pfig-history-download:hover{background:var(--pfig-history-download-hover)}.pfig-history-download .pfig-download-icon{color:var(--pfig-history-download-icon-color);font-size:var(--pfig-history-download-icon-size);display:inline-flex}.pfig-root[data-pfig-history-download-display="full"] .pfig-history-actions,.pfig-root[data-pfig-history-download-display="full"] .pfig-history-download{width:100%}.pfig-root[data-pfig-history-download-display="custom"] .pfig-history-download{width:var(--pfig-history-download-width)}.pfig-root[data-pfig-history-download-align="left"] .pfig-history-actions{justify-content:flex-start}.pfig-root[data-pfig-history-download-align="center"] .pfig-history-actions{justify-content:center}.pfig-root[data-pfig-history-download-align="right"] .pfig-history-actions{justify-content:flex-end}.pfig-root[data-pfig-history-download-text-align="left"] .pfig-history-download{justify-content:flex-start}.pfig-root[data-pfig-history-download-text-align="center"] .pfig-history-download{justify-content:center}.pfig-root[data-pfig-history-download-text-align="right"] .pfig-history-download{justify-content:flex-end}.pfig-history-empty{grid-column:1/-1;padding:12px;color:var(--pfig-muted);font-size:11px}.pfig-history-refresh{width:32px;height:32px;border:1px solid var(--pfig-border);border-radius:8px;background:var(--pfig-surface);color:var(--pfig-muted);cursor:pointer}.pfig-history-refresh:hover{color:var(--pfig-accent);border-color:#bae6fd}
.pfig-theme-dark{--pfig-root-bg:#0b1220;--pfig-surface:#111827;--pfig-surface2:#172033;--pfig-panel-bg:#111827;--pfig-text:#f8fafc;--pfig-muted:#94a3b8;--pfig-border:#263244;--pfig-panel-border:#263244;--pfig-title-color:#f8fafc;--pfig-desc-color:#94a3b8;--pfig-panel-title-color:#f8fafc;--pfig-action-bg:rgba(11,18,32,.92)}.pfig-theme-dark .pfig-stage{background:#0f172a}.pfig-theme-dark .pfig-mode-switch button.is-active,.pfig-theme-dark .pfig-count-row button.is-active,.pfig-theme-dark .pfig-tier-grid button.is-active,.pfig-theme-dark .pfig-profile-card.is-active{background:#0c2b3e}.pfig-theme-dark .pfig-price{background:#172554;border-color:#1e3a8a}.pfig-theme-dark .pfig-brief-preview span{background:#111827}
@media(max-width:1180px){.pfig-root{padding:var(--pfig-root-pad-md);font-size:var(--pfig-body-size)}.pfig-grid{grid-template-columns:minmax(330px,390px) minmax(0,1fr);gap:var(--pfig-gap-md)}.pfig-profile-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.pfig-stage{min-height:var(--pfig-result-min-md)}.pfig-root .pfig-hero h2{font-size:var(--pfig-title-size-md)}.pfig-root .pfig-hero p{font-size:var(--pfig-desc-size-md)}.pfig-root .pfig-badge{font-size:var(--pfig-badge-size-md)}.pfig-root[data-pfig-history-layout="grid"] .pfig-history-list{grid-template-columns:1fr}}
@media(max-width:820px){.pfig-root{padding:var(--pfig-root-pad-sm);font-size:var(--pfig-body-size-sm)}.pfig-grid{grid-template-columns:1fr}.pfig-workspace{order:2}.pfig-controls{order:1}.pfig-root[data-pfig-result-sticky="1"] .pfig-result-panel{position:static}.pfig-root[data-pfig-action-sticky="1"] .pfig-action-dock{position:static;background:transparent;border:0;padding:0;box-shadow:none;backdrop-filter:none}.pfig-profile-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.pfig-stage{min-height:var(--pfig-result-min-sm)}.pfig-root .pfig-hero h2{font-size:var(--pfig-title-size-sm)}.pfig-root .pfig-hero p{font-size:var(--pfig-desc-size-sm)}.pfig-root .pfig-badge{font-size:var(--pfig-badge-size-sm)}.pfig-panel-head b,.pfig-result-head b{font-size:var(--pfig-panel-title-size-sm)}.pfig-runtime-results{grid-template-columns:1fr}.pfig-history-card{grid-template-columns:var(--pfig-history-thumb-sm) minmax(0,1fr) auto}.pfig-history-thumb{width:var(--pfig-history-thumb-sm);height:var(--pfig-history-thumb-sm)}}
@media(max-width:540px){.pfig-profile-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.pfig-tier-grid,.pfig-output-grid,.pfig-field-grid,.pfig-core-fields{grid-template-columns:1fr}.pfig-span-2{grid-column:auto}.pfig-upload-grid{grid-template-columns:1fr}.pfig-stage{padding:12px}.pfig-runtime-footer{align-items:flex-start;flex-direction:column}.pfig-download-wrap,.pfig-download{width:100%}.pfig-history-card{grid-template-columns:60px minmax(0,1fr);align-items:start}.pfig-history-thumb{width:60px;height:60px}.pfig-history-actions{grid-column:1/-1;width:100%}.pfig-history-download{width:100%;justify-content:center}.pfig-result-head>span{display:none}.pfig-run{padding:var(--pfig-button-pad-sm)}}

/* R1 larger-canvas / full-width guards */
@media(max-width:1199px){.pfig-root[data-pfig-full-bleed="1"]{width:100%;margin-left:0;margin-right:0}.pfig-grid{grid-template-columns:minmax(340px,420px) minmax(0,1fr)}}
@media(max-width:991px){.pfig-grid{grid-template-columns:1fr}.pfig-root[data-pfig-result-sticky="1"] .pfig-result-panel{position:static}.pfig-root[data-pfig-full-bleed="1"]{width:100%;margin-left:0;margin-right:0}}

/* v1.2.7.6 preset library */
.pfig-preset-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.pfig-preset-card{display:flex;align-items:center;gap:9px;text-align:left;border:1px solid var(--pfig-border,#dfe5ef);background:#fff;border-radius:12px;padding:10px;min-height:62px;cursor:pointer}.pfig-preset-card:hover,.pfig-preset-card.is-active{border-color:#0ea5e9;box-shadow:0 0 0 2px rgba(14,165,233,.08);background:#f4fbff}.pfig-preset-card>i{font-size:18px;color:#0ea5e9}.pfig-preset-card img{width:42px;height:42px;object-fit:cover;border-radius:8px}.pfig-preset-card span{min-width:0;display:block}.pfig-preset-card b{display:block;font-size:12px}.pfig-preset-card small{display:block;color:#6b7280;font-size:10px;line-height:1.25;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media(max-width:560px){.pfig-preset-grid{grid-template-columns:1fr}}

/* v1.2.7.7 — multi-output history + batch ZIP */
.pfig-runtime-result-wrap{display:grid;gap:12px;width:100%}
.pfig-batch-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid var(--pfig-border);border-radius:12px;background:var(--pfig-surface)}
.pfig-batch-bar>span{display:grid;gap:2px}.pfig-batch-bar small{color:var(--pfig-muted);font-size:11px}
.pfig-batch-download{border:1px solid var(--pfig-accent);background:var(--pfig-accent);color:#fff;border-radius:9px;padding:8px 12px;font:800 12px/1.2 inherit;display:inline-flex;align-items:center;gap:7px;cursor:pointer}
.pfig-history-gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;width:calc(var(--pfig-history-thumb,76px) + 18px);min-width:calc(var(--pfig-history-thumb,76px) + 18px)}
.pfig-history-card:not(.is-multi) .pfig-history-gallery{grid-template-columns:1fr;width:var(--pfig-history-thumb,76px);min-width:var(--pfig-history-thumb,76px)}
.pfig-history-gallery .pfig-history-thumb{width:100%;height:34px;border:0;padding:0;overflow:hidden;border-radius:6px;background:var(--pfig-surface2);cursor:pointer}
.pfig-history-card:not(.is-multi) .pfig-history-gallery .pfig-history-thumb{height:var(--pfig-history-thumb,76px)}
.pfig-history-gallery .pfig-history-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.pfig-history-count{font-size:10px;font-weight:800;color:var(--pfig-muted);background:var(--pfig-surface2);border:1px solid var(--pfig-border);padding:2px 6px;border-radius:999px}
.pfig-history-actions{flex-wrap:wrap;justify-content:flex-end}
.pfig-history-download-one{min-width:32px;width:auto;padding-left:8px;padding-right:8px}
.pfig-history-batch-download{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
@media(max-width:767px){.pfig-batch-bar{align-items:flex-start;flex-direction:column}.pfig-batch-download{width:100%;justify-content:center}.pfig-history-gallery{width:72px;min-width:72px}.pfig-history-actions{width:100%;justify-content:flex-start}}
.pfig-history-card.is-multi{grid-template-columns:calc(var(--pfig-history-thumb) + 18px) minmax(0,1fr) auto}
@media(max-width:820px){.pfig-history-card.is-multi{grid-template-columns:72px minmax(0,1fr) auto}}

/* v1.2.7.8 — Guided Preset Auto-Fill */
.pfig-preset-applied{margin-top:10px;padding:10px;border:1px solid #bae6fd;border-radius:12px;background:#f0f9ff;display:grid;gap:9px}.pfig-preset-applied[hidden]{display:none}.pfig-preset-applied>div:first-child{display:flex;flex-direction:column;gap:2px}.pfig-preset-applied b{font-size:11px;color:#075985}.pfig-preset-applied small{font-size:9.5px;color:#64748b}.pfig-preset-actions{display:flex;flex-wrap:wrap;gap:6px}.pfig-preset-actions button{border:1px solid #bae6fd;background:#fff;color:#0369a1;border-radius:8px;padding:7px 9px;font:750 10px/1.2 inherit;cursor:pointer}.pfig-preset-actions button:hover{background:#e0f2fe}.pfig-preset-actions button.is-primary{border-color:#0ea5e9;background:#0ea5e9;color:#fff}.pfig-dynamic-field.is-locked{opacity:.82}.pfig-dynamic-field.is-locked>span:after{content:' · khóa theo mẫu';font-size:9px;font-weight:500;color:#94a3b8}.pfig-dynamic-field.is-locked input,.pfig-dynamic-field.is-locked textarea,.pfig-dynamic-field.is-locked select{background:#f8fafc;cursor:not-allowed}.pfig-preset-card.is-active:after{content:'✓';margin-left:auto;color:#059669;font-weight:900}
@media(max-width:540px){.pfig-preset-actions{display:grid;grid-template-columns:1fr 1fr}.pfig-preset-actions button{width:100%}}

/* v1.2.7.8 R1 — compact select UX + sticky scope fix */
.pfig-preset-select-wrap,.pfig-profile-select-wrap{display:none}.pfig-compact-select{width:100%;min-height:44px;border:1px solid var(--pfig-border);border-radius:10px;background:var(--pfig-surface);color:var(--pfig-text);padding:9px 36px 9px 11px;font:750 12px/1.3 inherit;outline:none}.pfig-compact-select:focus{border-color:var(--pfig-accent);box-shadow:0 0 0 2px rgba(14,165,233,.08)}
.pfig-root[data-pfig-preset-display="select"] .pfig-preset-select-wrap{display:block}.pfig-root[data-pfig-preset-display="select"] .pfig-preset-grid{display:none}.pfig-root[data-pfig-preset-display="grid"] .pfig-preset-select-wrap{display:none}.pfig-root[data-pfig-profile-display="select"] .pfig-profile-select-wrap{display:block}.pfig-root[data-pfig-profile-display="select"] .pfig-profile-grid{display:none}.pfig-root[data-pfig-profile-display="grid"] .pfig-profile-select-wrap{display:none}
/* v1.2.7.8 R1.2 — visible preset reference preview + panel/sticky cleanup */
.pfig-reference-panel{overflow:visible}.pfig-reference-user-zone{display:grid;gap:9px}.pfig-reference-preset-zone:empty{display:none}.pfig-preset-reference-preview{display:block;margin-top:12px;padding:11px;border:1px solid #dbeafe;border-radius:12px;background:linear-gradient(180deg,#f8fbff,#f4f9ff);overflow:hidden}.pfig-preset-reference-preview[hidden]{display:none}.pfig-preset-reference-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:9px}.pfig-preset-reference-head>span{font-size:10.5px;font-weight:800;color:var(--pfig-text)}.pfig-preset-reference-head>span b{display:inline-grid;place-items:center;min-width:19px;height:19px;margin-left:3px;padding:0 5px;border-radius:999px;background:#e0f2fe;color:#0369a1;font-size:9px}.pfig-preset-reference-head small{display:inline-flex;align-items:center;gap:4px;color:var(--pfig-muted);font-size:9px;white-space:nowrap}.pfig-preset-reference-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.pfig-preset-reference-item{appearance:none;border:1px solid var(--pfig-border);border-radius:10px;background:var(--pfig-surface);padding:5px;min-width:0;cursor:zoom-in;text-align:left;transition:border-color .16s,box-shadow .16s,transform .16s}.pfig-preset-reference-item:hover{border-color:var(--pfig-accent);box-shadow:0 0 0 2px rgba(14,165,233,.08);transform:translateY(-1px)}.pfig-preset-reference-media{position:relative;display:grid;place-items:center;width:100%;aspect-ratio:4/3;border-radius:7px;overflow:hidden;background:#eaf0f6}.pfig-preset-reference-media img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block;opacity:0;transition:opacity .18s}.pfig-preset-reference-placeholder{font-size:18px;color:#94a3b8}.pfig-preset-reference-item.is-ready img{opacity:1}.pfig-preset-reference-item.is-ready .pfig-preset-reference-placeholder{display:none}.pfig-preset-reference-item.is-error .pfig-preset-reference-media{background:#fff1f2}.pfig-preset-reference-item.is-error .pfig-preset-reference-placeholder{color:#e11d48}.pfig-preset-reference-item.is-error img{display:none}.pfig-preset-reference-item>small{display:block;padding:5px 2px 1px;color:var(--pfig-muted);font-size:8.5px;font-weight:700;text-align:center}.pfig-preset-reference-error{margin-top:8px;padding:7px 8px;border:1px solid #fecaca;border-radius:8px;background:#fff7f7;color:#b91c1c;font-size:9px;line-height:1.35}.pfig-preset-reference-error[hidden]{display:none}
.pfig-preset-panel,.pfig-reference-panel{contain:layout paint}.pfig-preset-select-wrap+.pfig-preset-grid{margin-top:0}.pfig-profile-select-wrap+.pfig-profile-grid{margin-top:0}
@media(min-width:992px){.pfig-root[data-pfig-result-sticky="1"] .pfig-grid{align-items:stretch}.pfig-root[data-pfig-result-sticky="1"] .pfig-controls{align-self:start}.pfig-root[data-pfig-result-sticky="1"] .pfig-workspace{display:block;align-self:stretch;height:100%;min-height:100%;min-width:0}.pfig-root[data-pfig-result-sticky="1"] .pfig-result-panel{position:-webkit-sticky;position:sticky;top:var(--pfig-result-sticky-top);align-self:start;width:100%;min-width:0;z-index:3}.pfig-root[data-pfig-result-sticky="1"] .pfig-history{margin-top:16px}}
@media(max-width:1180px){.pfig-preset-reference-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.pfig-preset-reference-head{align-items:flex-start;flex-direction:column;gap:3px}.pfig-preset-reference-head small{white-space:normal}}
@media(max-width:540px){.pfig-preset-reference-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* v1.2.7.8 R1.3.1 — in-page preset reference lightbox */
.pfig-reference-lightbox{position:fixed;inset:0;z-index:1000000;display:flex;align-items:center;justify-content:center;padding:28px;background:rgba(2,6,23,.9);opacity:0;visibility:hidden;pointer-events:none;transition:opacity .18s ease,visibility .18s ease;backdrop-filter:blur(3px)}
.pfig-reference-lightbox.is-open{opacity:1;visibility:visible;pointer-events:auto}
.pfig-reference-lightbox figure{position:relative;display:grid;gap:10px;justify-items:center;margin:0;max-width:min(92vw,1500px);max-height:92vh}
.pfig-reference-lightbox figure img{display:block;max-width:min(92vw,1500px);max-height:84vh;width:auto;height:auto;object-fit:contain;border-radius:14px;background:#fff;box-shadow:0 28px 90px rgba(0,0,0,.48)}
.pfig-reference-lightbox figcaption{color:#e2e8f0;font:750 12px/1.35 inherit;text-align:center}
.pfig-reference-lightbox-close,.pfig-reference-lightbox-nav{position:absolute;display:grid;place-items:center;border:1px solid rgba(255,255,255,.18);background:rgba(15,23,42,.74);color:#fff;box-shadow:0 10px 28px rgba(0,0,0,.25);cursor:pointer;backdrop-filter:blur(8px);transition:background .15s,transform .15s}
.pfig-reference-lightbox-close:hover,.pfig-reference-lightbox-nav:hover{background:rgba(14,165,233,.92)}
.pfig-reference-lightbox-close{top:18px;right:20px;width:44px;height:44px;border-radius:999px;font-size:20px}
.pfig-reference-lightbox-nav{top:50%;width:46px;height:58px;margin-top:-29px;border-radius:12px;font-size:22px}
.pfig-reference-lightbox-nav.is-prev{left:20px}.pfig-reference-lightbox-nav.is-next{right:20px}
.pfig-reference-lightbox-nav[hidden]{display:none}
@media(max-width:640px){.pfig-reference-lightbox{padding:16px}.pfig-reference-lightbox-close{top:10px;right:10px;width:40px;height:40px}.pfig-reference-lightbox-nav{width:40px;height:50px;margin-top:-25px}.pfig-reference-lightbox-nav.is-prev{left:8px}.pfig-reference-lightbox-nav.is-next{right:8px}.pfig-reference-lightbox figure img{max-width:94vw;max-height:80vh}}

/* v1.2.7.9 — Generate -> Upscale 4K/8K handoff */
.pfig-download-wrap{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.pfig-upscale-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.pfig-upscale-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:8px 11px;border:1px solid #c7d2fe;border-radius:9px;background:#eef2ff;color:#3730a3;font-size:11px;font-weight:800;cursor:pointer;transition:.18s ease;white-space:nowrap}
.pfig-upscale-btn:hover{background:#e0e7ff;border-color:#a5b4fc;transform:translateY(-1px)}
.pfig-upscale-btn small{font-size:9px;font-weight:700;opacity:.72}
.pfig-upscale-btn.is-8k{background:#f5f3ff;border-color:#ddd6fe;color:#6d28d9}
.pfig-upscale-btn.is-ready{background:#ecfdf5;border-color:#a7f3d0;color:#047857}
.pfig-upscale-btn.is-busy{opacity:.72;cursor:wait;transform:none}
.pfig-upscale-btn.is-busy i{animation:pfig-spin .9s linear infinite}
@keyframes pfig-spin{to{transform:rotate(360deg)}}
.pfig-history-upscale-variants{display:flex;align-items:center;gap:5px;margin-top:5px;flex-wrap:wrap}
.pfig-history-upscale-ready{display:inline-flex;align-items:center;gap:4px;padding:3px 7px;border:1px solid #a7f3d0;border-radius:999px;background:#ecfdf5;color:#047857;font-size:9px;font-weight:800;cursor:pointer}
@media(max-width:767px){.pfig-download-wrap{justify-content:stretch}.pfig-upscale-actions{width:100%}.pfig-upscale-btn{flex:1;min-width:0}.pfig-download-wrap>.pfig-download{width:100%!important}}

/* v1.2.7.10 — Exact Typography Composer & DataFont Bridge */
.pfig-typography-panel{overflow:visible}.pfig-typography-mode{display:grid;grid-template-columns:1fr 1fr;gap:7px}.pfig-typography-mode button{display:flex;align-items:center;justify-content:center;gap:6px;min-height:42px;padding:9px 10px;border:1px solid var(--pfig-border);border-radius:10px;background:var(--pfig-surface);color:var(--pfig-text);font-size:11px;font-weight:800;cursor:pointer}.pfig-typography-mode button.is-active{border-color:var(--pfig-accent);background:#eff9ff;color:#0369a1;box-shadow:0 0 0 2px rgba(14,165,233,.08)}.pfig-typography-mode button:disabled{opacity:.48;cursor:not-allowed}.pfig-typography-ai-note,.pfig-typography-warning{display:flex;align-items:flex-start;gap:7px;margin-top:9px;padding:8px 9px;border:1px solid #dbeafe;border-radius:9px;background:#f8fbff;color:#475569;font-size:9.5px;line-height:1.4}.pfig-typography-warning{border-color:#fed7aa;background:#fff7ed;color:#9a3412}.pfig-typography-font-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:11px}.pfig-typography-panel .pfig-label input,.pfig-typography-panel .pfig-label textarea,.pfig-typography-panel .pfig-label select{width:100%;min-height:40px;border:1px solid var(--pfig-border);border-radius:9px;background:var(--pfig-surface);color:var(--pfig-text);padding:8px 10px;font:inherit;outline:none}.pfig-typography-panel .pfig-label input[type=color]{height:40px;padding:4px;cursor:pointer}.pfig-typography-panel .pfig-label textarea{resize:vertical;line-height:1.4}.pfig-typography-panel .pfig-label input:focus,.pfig-typography-panel .pfig-label textarea:focus,.pfig-typography-panel .pfig-label select:focus{border-color:var(--pfig-accent);box-shadow:0 0 0 2px rgba(14,165,233,.08)}.pfig-font-preview{display:grid;grid-template-columns:110px minmax(0,1fr);gap:9px;align-items:center;margin-top:9px;padding:8px;border:1px solid var(--pfig-border);border-radius:10px;background:var(--pfig-surface2)}.pfig-font-preview[hidden]{display:none}.pfig-font-preview img{display:block;width:110px;height:48px;object-fit:cover;border-radius:7px;background:#fff;border:1px solid #e2e8f0}.pfig-font-preview>div{display:flex;min-width:0;flex-direction:column;gap:2px}.pfig-font-preview b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10.5px}.pfig-font-preview small{color:var(--pfig-muted);font-size:9px;line-height:1.35}.pfig-typography-exact{display:grid;gap:9px;margin-top:10px}.pfig-typography-exact[hidden]{display:none}.pfig-typo-source{display:flex;flex-direction:column;gap:2px;padding:9px 10px;border:1px dashed #a5b4fc;border-radius:10px;background:#f8faff}.pfig-typo-source span{color:#64748b;font-size:9px;font-weight:700;text-transform:uppercase;letter-spacing:.05em}.pfig-typo-source b{color:#3730a3;font-size:11px}.pfig-typo-source small{color:#64748b;font-size:9px}.pfig-typo-layer{border:1px solid var(--pfig-border);border-radius:10px;background:var(--pfig-surface);overflow:hidden}.pfig-typo-layer summary{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 10px;cursor:pointer;list-style:none}.pfig-typo-layer summary::-webkit-details-marker{display:none}.pfig-typo-layer summary b{font-size:10.5px}.pfig-typo-layer summary small{color:var(--pfig-muted);font-size:8.5px}.pfig-typo-layer-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:0 10px 10px}.pfig-typography-export{width:100%;display:flex;align-items:center;justify-content:center;gap:7px;min-height:43px;border:1px solid #0ea5e9;border-radius:10px;background:#0ea5e9;color:#fff;font-size:11px;font-weight:850;cursor:pointer}.pfig-typography-export small{font-size:8.5px;font-weight:700;opacity:.82}.pfig-typography-export:disabled{opacity:.5;cursor:not-allowed}.pfig-typography-export.is-busy i{animation:pfig-spin .9s linear infinite}.pfig-typography-export-result{display:grid;grid-template-columns:92px minmax(0,1fr);gap:9px;align-items:center;padding:9px;border:1px solid #a7f3d0;border-radius:10px;background:#ecfdf5}.pfig-typography-export-result[hidden]{display:none}.pfig-typography-export-result img{width:92px;height:64px;object-fit:cover;border-radius:7px;background:#fff}.pfig-typography-export-result>div{display:flex;min-width:0;flex-direction:column;gap:3px}.pfig-typography-export-result b{font-size:10.5px;color:#047857}.pfig-typography-export-result small{color:#475569;font-size:9px}.pfig-typography-export-result button{align-self:flex-start;border:1px solid #6ee7b7;border-radius:7px;background:#fff;color:#047857;padding:6px 8px;font-size:9px;font-weight:800;cursor:pointer}.pfig-typography-source-btn,.pfig-typography-ready,.pfig-upscale-btn.is-typography{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:34px;padding:7px 9px;border:1px solid #f0abfc;border-radius:9px;background:#fdf4ff;color:#a21caf;font-size:10px;font-weight:800;cursor:pointer;white-space:nowrap}.pfig-typography-ready-actions{display:flex;align-items:center;gap:5px;flex-wrap:wrap}.pfig-typography-ready{border-color:#a7f3d0;background:#ecfdf5;color:#047857}.pfig-history-upscale-ready.is-typography{border-color:#f0abfc;background:#fdf4ff;color:#a21caf}.pfig-history-upscale-ready.is-exact-ready,.pfig-history-exact{border-color:#a7f3d0!important;background:#ecfdf5!important;color:#047857!important}.pfig-history-typography{color:#a21caf!important;border-color:#f0abfc!important;background:#fdf4ff!important}
@media(max-width:540px){.pfig-typography-font-grid,.pfig-typo-layer-grid{grid-template-columns:1fr}.pfig-font-preview{grid-template-columns:82px minmax(0,1fr)}.pfig-font-preview img{width:82px}.pfig-typography-mode{grid-template-columns:1fr}.pfig-typography-export-result{grid-template-columns:72px minmax(0,1fr)}.pfig-typography-export-result img{width:72px;height:54px}}

/* v1.2.7.11 — Print Output Engine, RGB/CMYK, ICC & Print-Safe Export */
.pfig-print-panel{overflow:visible}.pfig-print-source{display:flex;flex-direction:column;gap:2px;padding:9px 10px;border:1px dashed #67e8f9;border-radius:10px;background:#ecfeff}.pfig-print-source span{color:#0e7490;font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.05em}.pfig-print-source b{color:#155e75;font-size:11px}.pfig-print-source small{color:#64748b;font-size:9px}.pfig-print-size-grid,.pfig-print-profile-grid,.pfig-print-output-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:10px}.pfig-print-panel .pfig-label input,.pfig-print-panel .pfig-label select{width:100%;min-height:40px;border:1px solid var(--pfig-border);border-radius:9px;background:var(--pfig-surface);color:var(--pfig-text);padding:8px 10px;font:inherit;outline:none}.pfig-print-panel .pfig-label input:focus,.pfig-print-panel .pfig-label select:focus{border-color:#06b6d4;box-shadow:0 0 0 2px rgba(6,182,212,.09)}.pfig-print-ppi{display:flex;flex-direction:column;gap:2px;margin-top:9px;padding:9px 10px;border:1px solid #bae6fd;border-radius:10px;background:#f0f9ff}.pfig-print-ppi b{font-size:11px;color:#0369a1}.pfig-print-ppi small{font-size:9px;line-height:1.4;color:#64748b}.pfig-print-ppi.is-ready{border-color:#a7f3d0;background:#ecfdf5}.pfig-print-ppi.is-ready b{color:#047857}.pfig-print-ppi.is-warning{border-color:#fde68a;background:#fffbeb}.pfig-print-ppi.is-warning b{color:#a16207}.pfig-print-ppi.is-low{border-color:#fecaca;background:#fef2f2}.pfig-print-ppi.is-low b{color:#b91c1c}.pfig-print-mode{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:10px}.pfig-print-mode button{min-height:40px;border:1px solid var(--pfig-border);border-radius:9px;background:var(--pfig-surface);color:var(--pfig-text);font-size:10.5px;font-weight:850;cursor:pointer}.pfig-print-mode button.is-active{border-color:#06b6d4;background:#ecfeff;color:#0e7490;box-shadow:0 0 0 2px rgba(6,182,212,.08)}.pfig-print-mode button:disabled{opacity:.45;cursor:not-allowed}.pfig-print-warning,.pfig-print-note{display:flex;gap:7px;align-items:flex-start;margin-top:9px;padding:8px 9px;border-radius:9px;font-size:9px;line-height:1.45}.pfig-print-warning{border:1px solid #fed7aa;background:#fff7ed;color:#9a3412}.pfig-print-note{border:1px solid #e2e8f0;background:#f8fafc;color:#475569}.pfig-print-export{width:100%;display:flex;align-items:center;justify-content:center;gap:7px;min-height:44px;margin-top:10px;border:1px solid #0891b2;border-radius:10px;background:linear-gradient(135deg,#06b6d4,#0284c7);color:#fff;font-size:11px;font-weight:850;cursor:pointer}.pfig-print-export small{font-size:8.5px;font-weight:700;opacity:.84}.pfig-print-export:disabled{opacity:.5;cursor:not-allowed}.pfig-print-export.is-busy i{animation:pfig-spin .9s linear infinite}.pfig-print-export-result{display:flex;flex-direction:column;gap:5px;margin-top:9px;padding:9px 10px;border:1px solid #a7f3d0;border-radius:10px;background:#ecfdf5}.pfig-print-export-result[hidden]{display:none}.pfig-print-export-result b{font-size:10.5px;color:#047857}.pfig-print-export-result small{font-size:9px;color:#475569;line-height:1.4}.pfig-print-export-result button{align-self:flex-start;border:1px solid #6ee7b7;border-radius:7px;background:#fff;color:#047857;padding:6px 9px;font-size:9px;font-weight:850;cursor:pointer}.pfig-print-source-btn,.pfig-print-ready{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:34px;padding:7px 9px;border:1px solid #67e8f9;border-radius:9px;background:#ecfeff;color:#0e7490;font-size:10px;font-weight:850;cursor:pointer;white-space:nowrap}.pfig-print-ready{border-color:#a7f3d0;background:#ecfdf5;color:#047857}.pfig-print-ready-actions{display:flex;align-items:center;gap:5px;flex-wrap:wrap}.pfig-history-print{border-color:#67e8f9!important;background:#ecfeff!important;color:#0e7490!important}.pfig-history-print-ready{border-color:#a7f3d0!important;background:#ecfdf5!important;color:#047857!important}
@media(max-width:540px){.pfig-print-size-grid,.pfig-print-profile-grid,.pfig-print-output-grid,.pfig-print-mode{grid-template-columns:1fr}}

/* v1.2.7.11-p1-r1 — Typography UX, handoff recovery & responsive history */
.pfig-typography-mode button>span{display:flex;min-width:0;flex-direction:column;align-items:flex-start;gap:1px;text-align:left}.pfig-typography-mode button>span b{font-size:10.5px;line-height:1.25}.pfig-typography-mode button>span small{font-size:8px;line-height:1.25;font-weight:650;opacity:.72}.pfig-typography-exact-note{display:flex;align-items:flex-start;gap:7px;padding:9px 10px;border:1px solid #bbf7d0;border-radius:9px;background:#f0fdf4;color:#166534;font-size:9.5px;line-height:1.45}.pfig-typography-exact-note i{margin-top:1px}.pfig-typography-ai-note b{color:#334155}.pfig-download-wrap{gap:6px;flex-wrap:wrap}.pfig-upscale-actions{display:flex;gap:6px;flex-wrap:wrap}.pfig-upscale-btn.is-busy i,.pfig-history-upscale-status i{animation:pfig-spin .9s linear infinite}.pfig-history-thumb{border:2px solid transparent!important;transition:border-color .15s ease,box-shadow .15s ease,transform .15s ease}.pfig-history-thumb.is-selected{border-color:var(--pfig-accent)!important;box-shadow:0 0 0 2px rgba(14,165,233,.12);transform:translateY(-1px)}.pfig-history-selected-label{color:#0369a1!important;font-weight:750}.pfig-history-actions{gap:6px}.pfig-history-actions>.pfig-history-download{min-height:34px}.pfig-history-upscale-variants{display:flex;align-items:center;gap:5px;flex-wrap:wrap}.pfig-history-upscale-status{display:inline-flex;align-items:center;gap:5px;min-height:32px;padding:6px 8px;border:1px solid #fde68a;border-radius:8px;background:#fffbeb;color:#92400e;font-size:9px;font-weight:800;white-space:nowrap}
@media(max-width:767px){.pfig-runtime-footer{gap:9px}.pfig-download-wrap{display:flex!important;width:100%;gap:6px}.pfig-download-wrap>.pfig-download,.pfig-download-wrap>.pfig-typography-source-btn,.pfig-download-wrap>.pfig-print-source-btn{flex:1 1 calc(50% - 6px);width:auto!important;min-width:0;white-space:normal;line-height:1.25}.pfig-download-wrap>.pfig-upscale-actions{flex:1 1 100%;width:100%}.pfig-upscale-actions>.pfig-upscale-btn{flex:1 1 calc(50% - 6px);min-width:0;white-space:normal}.pfig-history-card,.pfig-history-card.is-multi{grid-template-columns:72px minmax(0,1fr)!important;align-items:start}.pfig-history-gallery{grid-column:1;grid-row:1 / span 2;width:72px!important;min-width:72px!important}.pfig-history-main{grid-column:2;grid-row:1}.pfig-history-actions{grid-column:2;grid-row:2;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;justify-content:stretch;align-items:stretch}.pfig-history-actions>.pfig-history-download,.pfig-history-actions>.pfig-history-upscale-variants{width:100%;min-width:0}.pfig-history-actions>.pfig-history-download{justify-content:center;white-space:normal;text-align:center}.pfig-history-upscale-variants{grid-column:1/-1}.pfig-history-upscale-variants>*{flex:1 1 calc(50% - 5px);min-width:0;justify-content:center;white-space:normal}.pfig-history-title{flex-wrap:wrap}}
@media(max-width:540px){.pfig-typography-mode{grid-template-columns:1fr 1fr}.pfig-typography-mode button{min-height:54px;padding:8px}.pfig-history-card,.pfig-history-card.is-multi{grid-template-columns:64px minmax(0,1fr)!important;gap:8px}.pfig-history-gallery{width:64px!important;min-width:64px!important}.pfig-history-actions{grid-column:1/-1;grid-row:auto;grid-template-columns:repeat(2,minmax(0,1fr));margin-top:2px}.pfig-history-gallery{grid-row:1}.pfig-history-main{grid-row:1}.pfig-history-download-one,.pfig-history-download{width:100%!important}.pfig-history-upscale-variants{grid-column:1/-1}.pfig-history-gallery .pfig-history-thumb{height:30px}.pfig-history-card:not(.is-multi) .pfig-history-gallery .pfig-history-thumb{height:64px}}
/* v1.2.7.11 R3 — DataFont edit-flow clarity */
.pfig-typography-font-tools[hidden]{display:none!important}.pfig-typography-font-tools{display:block}.pfig-typo-source.is-ready{border-style:solid;border-color:#86efac;background:#f0fdf4}.pfig-typo-source.is-ready b{color:#047857}.pfig-typography-export:not(:disabled){box-shadow:0 8px 18px rgba(14,165,233,.16)}
@media(max-width:540px){.pfig-typography-mode{grid-template-columns:1fr}.pfig-typography-mode button{justify-content:flex-start}.pfig-typography-export{min-height:48px}.pfig-typo-source small{line-height:1.45}}
.pfig-runtime-media{position:relative}.pfig-exact-preview-badge{position:absolute;left:10px;top:10px;z-index:2;padding:5px 8px;border-radius:999px;background:rgba(4,120,87,.92);color:#fff;font-size:9px;font-weight:800;box-shadow:0 4px 12px rgba(15,23,42,.16)}


/* v1.2.7.11 R8 — Exact Typography UI retirement.
   Backend/export history is preserved, but the Generate surface no longer exposes DataFont actions. */
.pfig-typography-panel,
.pfig-typography-source-btn,
.pfig-typography-ready-actions,
.pfig-history-typography,
.pfig-history-exact,
.pfig-upscale-btn.is-typography,
.pfig-history-upscale-ready.is-typography,
.pfig-exact-preview-badge{display:none!important}

/* v1.2.8.16-r3 — Immediate Processing Result State & Create-Phase Feedback */
.pfig-run.is-busy i{animation:pfig-spin .9s linear infinite}.pfig-stage.is-processing{position:relative;overflow:hidden}.pfig-stage.is-processing:before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 50% 42%,rgba(99,102,241,.10),transparent 38%),linear-gradient(110deg,transparent 25%,rgba(255,255,255,.65) 45%,transparent 65%);background-size:auto,220% 100%;animation:pfig-stage-shimmer 2.4s linear infinite;pointer-events:none}.pfig-processing{position:relative;z-index:1;width:min(100%,620px);display:flex;flex-direction:column;align-items:center;text-align:center;padding:18px}.pfig-processing-visual{position:relative;width:88px;height:88px;display:grid;place-items:center;margin-bottom:14px}.pfig-processing-visual>i{position:relative;z-index:2;font-size:30px;color:#4f46e5}.pfig-processing-ring{position:absolute;inset:0;border-radius:50%;border:3px solid rgba(99,102,241,.14);border-top-color:#6366f1;border-right-color:#38bdf8;animation:pfig-spin 1.05s linear infinite;box-shadow:0 0 0 10px rgba(99,102,241,.045)}.pfig-processing-copy{display:flex;flex-direction:column;align-items:center;gap:5px}.pfig-processing-kicker{display:inline-flex;align-items:center;gap:5px;padding:5px 9px;border-radius:999px;background:#eef2ff;color:#4338ca;font-size:9px;font-weight:850;letter-spacing:.04em;text-transform:uppercase}.pfig-processing-copy h3{margin:1px 0 0;font-size:20px;color:var(--pfig-text)}.pfig-processing-copy p{margin:0;color:var(--pfig-muted);font-size:11px}.pfig-processing-progress{position:relative;width:min(100%,480px);height:8px;margin:17px 0 12px;border-radius:999px;background:#e2e8f0;overflow:hidden}.pfig-processing-progress>span{display:block;width:var(--pfig-progress,42%);height:100%;border-radius:inherit;background:linear-gradient(90deg,#38bdf8,#6366f1,#8b5cf6);transition:width .35s ease}.pfig-processing-progress:not(.is-determinate)>span{width:38%;animation:pfig-processing-bar 1.35s ease-in-out infinite}.pfig-processing-steps{width:min(100%,520px);display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.pfig-processing-steps span{display:flex;align-items:center;justify-content:center;gap:5px;min-height:34px;padding:6px 7px;border:1px solid var(--pfig-border);border-radius:9px;background:rgba(255,255,255,.78);color:#94a3b8;font-size:9px;font-weight:750}.pfig-processing-steps span.is-active{border-color:#a5b4fc;background:#eef2ff;color:#4338ca;box-shadow:0 0 0 2px rgba(99,102,241,.07)}.pfig-processing-steps span.is-active i.bi-arrow-repeat{animation:pfig-spin .9s linear infinite}.pfig-processing-steps span.is-done{border-color:#a7f3d0;background:#ecfdf5;color:#047857}.pfig-processing-brief{margin-top:14px}.pfig-stage-error .pfig-empty-icon{background:#fef2f2;color:#dc2626}.pfig-stage-error .pfig-brief-preview{margin-top:14px}@keyframes pfig-processing-bar{0%{transform:translateX(-115%)}50%{transform:translateX(85%)}100%{transform:translateX(245%)}}@keyframes pfig-stage-shimmer{0%{background-position:0 0,-120% 0}100%{background-position:0 0,180% 0}}@media(max-width:640px){.pfig-processing{padding:12px}.pfig-processing-steps{grid-template-columns:1fr}.pfig-processing-visual{width:72px;height:72px}.pfig-processing-copy h3{font-size:18px}}

/* v1.2.8.16-r4 — Unified Result Action Bar, Typography Tokens & Responsive History */
.pfig-runtime-footer{display:grid;grid-template-columns:minmax(92px,118px) minmax(0,1fr);grid-template-areas:"meta primary" "meta reuse";align-items:end;gap:8px 14px;padding:12px 14px}
.pfig-runtime-meta{grid-area:meta;align-self:center;gap:2px}.pfig-runtime-meta b{font-size:11.5px;font-weight:800;line-height:1.25}.pfig-runtime-meta small{font-size:9.5px;line-height:1.35;font-weight:500}
.pfig-result-actionbar{grid-area:primary;display:grid!important;grid-template-columns:minmax(112px,.72fr) minmax(200px,1.25fr);gap:10px;align-items:end;width:100%;min-width:0;justify-content:stretch!important}
.pfig-result-action-group{display:flex;min-width:0;flex-direction:column;align-items:stretch;gap:5px}.pfig-result-action-label{display:block;color:var(--pfig-muted);font-size:9px;font-weight:800;line-height:1.2;letter-spacing:.035em;text-transform:uppercase;white-space:nowrap}
.pfig-result-action-group.is-download .pfig-download{width:100%!important;min-width:0;min-height:38px;padding:8px 12px;font-size:10.5px;font-weight:800;line-height:1.2}
.pfig-upscale-actions{display:flex;width:auto;min-width:0;flex-direction:column;align-items:stretch;gap:5px}.pfig-upscale-buttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.pfig-upscale-btn{width:100%;min-width:0;min-height:38px;padding:8px 9px;font-size:10.5px;font-weight:800;line-height:1.15}.pfig-upscale-btn small{font-size:8.5px;font-weight:750}
.pfig-runtime-footer button{font-family:inherit}.pfig-runtime-footer :is(.pfig-download,.pfig-upscale-btn){letter-spacing:0}

/* Shared "Dùng tiếp" rail is visually merged into the Generate footer without changing shared runtime. */
.pfaiux-studio .pfig-runtime-footer>.pfaiux-result-actions{grid-area:reuse;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch;gap:6px;width:100%;min-width:0;margin:0;padding:0;border:0;border-radius:0;background:transparent}
.pfaiux-studio .pfig-runtime-footer>.pfaiux-result-actions .pfaiux-result-actions-label{grid-column:1/-1;display:block;margin:0;color:var(--pfig-muted);font-family:inherit;font-size:9px;font-weight:800;line-height:1.2;letter-spacing:.035em;text-transform:uppercase}
.pfaiux-studio .pfig-runtime-footer>.pfaiux-result-actions button{width:100%;min-width:0;min-height:38px;justify-content:center;padding:8px 9px;border-radius:9px;font-family:inherit;font-size:10.5px;font-weight:800;line-height:1.15;white-space:normal;text-align:center}
.pfaiux-studio .pfig-runtime-footer>.pfaiux-result-actions button>span:last-child{min-width:0}

/* Compact, consistent history cards. */
.pfig-history-list{gap:10px;padding:12px}.pfig-history-card,.pfig-history-card.is-multi{align-items:center;gap:10px;padding:9px 10px;border-radius:10px}.pfig-history-main{gap:3px}.pfig-history-title{gap:6px;line-height:1.2}.pfig-history-title b{font-size:10.5px;font-weight:800}.pfig-history-main>small{font-size:8.8px;line-height:1.35;font-weight:500}.pfig-history-count{padding:2px 6px;font-size:8.5px;font-weight:800;line-height:1.25}.pfig-history-status{padding:3px 6px;font-size:8px;font-weight:800;line-height:1.2}.pfig-history-actions{gap:6px;flex-wrap:wrap;justify-content:flex-end}.pfig-history-download,.pfig-history-upscale-ready,.pfig-history-upscale-status{min-height:34px;border-radius:8px;font-family:inherit;font-size:9.5px;font-weight:800;line-height:1.15}.pfig-history-download{width:auto!important;padding:7px 10px}.pfig-history-upscale-ready,.pfig-history-upscale-status{padding:6px 8px}.pfig-history-upscale-variants{margin-top:0;gap:5px}

@media(max-width:1180px){
  .pfig-runtime-footer{grid-template-columns:1fr;grid-template-areas:"meta" "primary" "reuse";align-items:stretch;gap:8px}.pfig-runtime-meta{flex-direction:row;align-items:baseline;gap:7px}.pfig-result-actionbar{grid-template-columns:minmax(120px,.72fr) minmax(210px,1.28fr)}
}
@media(max-width:760px){
  .pfig-runtime-footer{padding:10px 11px}.pfig-result-actionbar{grid-template-columns:1fr}.pfig-result-action-group.is-download,.pfig-upscale-actions{grid-column:1}.pfig-result-action-group.is-download .pfig-download{min-height:40px}.pfig-upscale-buttons{grid-template-columns:repeat(2,minmax(0,1fr))}
  .pfaiux-studio .pfig-runtime-footer>.pfaiux-result-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.pfaiux-studio .pfig-runtime-footer>.pfaiux-result-actions .pfaiux-edit-again{grid-column:1/-1}
  .pfig-history-card,.pfig-history-card.is-multi{grid-template-columns:68px minmax(0,1fr)!important;align-items:start;gap:9px}.pfig-history-gallery{grid-column:1;grid-row:1 / span 2;width:68px!important;min-width:68px!important}.pfig-history-main{grid-column:2;grid-row:1}.pfig-history-actions{grid-column:2!important;grid-row:2;width:auto!important;display:flex!important;align-items:center;justify-content:flex-start;gap:5px;margin-top:2px}.pfig-history-actions>.pfig-history-download{width:auto!important;min-width:0;justify-content:center;white-space:nowrap}.pfig-history-upscale-variants{width:auto!important;display:flex;grid-column:auto}.pfig-history-upscale-variants>*{flex:0 1 auto;min-width:0;white-space:nowrap}
}
@media(max-width:480px){
  .pfig-runtime-footer{padding:10px}.pfig-runtime-meta{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center}.pfig-runtime-meta small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pfig-result-action-label{font-size:8.5px}.pfig-upscale-buttons{grid-template-columns:1fr 1fr}
  .pfaiux-studio .pfig-runtime-footer>.pfaiux-result-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}.pfaiux-studio .pfig-runtime-footer>.pfaiux-result-actions button{min-height:36px;padding:7px 8px;font-size:10px}
  .pfig-history-list{padding:9px;gap:8px}.pfig-history-card,.pfig-history-card.is-multi{grid-template-columns:62px minmax(0,1fr)!important;padding:8px;gap:8px}.pfig-history-gallery{width:62px!important;min-width:62px!important}.pfig-history-card:not(.is-multi) .pfig-history-gallery .pfig-history-thumb{height:62px}.pfig-history-title{flex-wrap:wrap;gap:4px}.pfig-history-title b{font-size:10px}.pfig-history-main>small{font-size:8.5px}.pfig-history-actions{grid-column:2!important;display:flex!important;flex-wrap:wrap!important}.pfig-history-download{min-height:32px;padding:6px 8px;font-size:9px}.pfig-history-upscale-ready,.pfig-history-upscale-status{min-height:32px;font-size:8.8px}
}


/* Unified UI Pack — 125% Scale, Mobile Safe Width & Responsive Integrity */
.pfig-root,.pfig-wrap,.pfig-grid,.pfig-controls,.pfig-workspace,.pfig-panel,.pfig-result-panel,.pfig-history,.pfig-action-dock,.pfig-stage,.pfig-history-list,.pfig-history-item{min-width:0}
.pfig-root{overflow-x:clip}
.pfig-wrap{max-width:min(100%,var(--pfig-scaled-max,var(--pfig-max,100%)))}
.pfig-grid>*{min-width:0}
.pfig-result-actions,.pfig-result-footer,.pfig-history-actions{min-width:0;flex-wrap:wrap}
.pfig-result-actions > *,.pfig-history-actions > *{max-width:100%}
.pfig-panel button,.pfig-result-panel button,.pfig-history button,.pfig-panel input,.pfig-panel select,.pfig-panel textarea{max-width:100%}
@media (max-width: 991px){
  .pfig-wrap{zoom:1 !important; width:100% !important; max-width:100% !important}
  .pfig-grid{grid-template-columns:1fr !important; gap:var(--pfig-gap-md,var(--pfig-gap,16px))}
  .pfig-controls,.pfig-workspace{width:100% !important; max-width:100% !important}
}
@media (max-width: 767px){
  .pfig-root{padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right))}
  .pfig-wrap,.pfig-root[data-pfig-full-bleed="1"] .pfig-wrap{width:100% !important;max-width:100% !important;zoom:1 !important}
  .pfig-root[data-pfig-full-bleed="1"]{width:100% !important;max-width:100% !important;margin-left:0 !important;margin-right:0 !important}
  .pfig-grid,.pfig-output-grid,.pfig-core-fields,.pfig-field-grid,.pfig-profile-grid,.pfig-tier-grid,.pfig-upload-grid,.pfig-mode-switch,.pfig-count-row{grid-template-columns:1fr !important}
  .pfig-action-dock,.pfig-result-actions,.pfig-result-footer,.pfig-history-actions{display:flex;flex-direction:column;align-items:stretch}
  .pfig-action-dock > *, .pfig-result-actions > *, .pfig-result-footer > *, .pfig-history-actions > *{width:100% !important;max-width:100% !important}
  .pfig-panel-head,.pfig-result-head{flex-wrap:wrap;align-items:flex-start}
}
