#hf-dialog{width:min(680px,calc(100vw - 24px));max-height:88dvh;overflow:auto;padding:24px;box-sizing:border-box}
#hf-dialog .hf-head{display:flex;justify-content:space-between;align-items:center;gap:16px}
#hf-dialog h2{margin:0;font-size:24px}
#hf-dialog label{display:block;margin:14px 0}
#hf-dialog input:not([type=checkbox]),#hf-dialog select{width:100%;box-sizing:border-box}
#hf-characters{display:grid;grid-template-columns:repeat(auto-fill,minmax(115px,1fr));gap:12px;margin:20px 0}
#hf-training-preview{display:flex;gap:8px;overflow-x:auto;max-width:100%}
#hf-training-preview img{width:64px;height:80px;object-fit:cover;flex:none;border-radius:6px}
#hf-settings{display:grid;gap:12px}#hf-settings[hidden]{display:none}
#hf-connection{padding:12px;border:1px solid #444;border-radius:8px}
#hf-dialog .hf-consent{display:flex;gap:10px;align-items:flex-start}
#hf-training-submit{width:100%;margin-top:12px}

#hf-settings .identity-profile-row{display:flex;gap:12px;align-items:center;justify-content:space-between}
#hf-characters .composer-library-card{display:flex;flex-direction:column;align-items:stretch;gap:6px;padding:8px;border:1px solid #484848;border-radius:12px;background:#191a1b;color:#eee;text-align:left;min-width:0}
#hf-characters .composer-library-card[aria-pressed=true]{border-color:#d5e992}
#hf-characters .composer-library-card strong,#hf-characters .composer-library-card small{display:block;padding:0 3px;overflow-wrap:anywhere}
#hf-characters .composer-library-photo{aspect-ratio:1;overflow:hidden;border-radius:7px;display:block}
#hf-characters .composer-library-photo img{width:100%;height:100%;object-fit:cover}
/* PV Soul: compact prompt, visible controls, independent image and character cards. */
.composer-controls{display:contents}
#image-composer.is-pv-soul{display:grid;grid-template-columns:minmax(0,1fr) 80px 108px 140px;grid-template-rows:minmax(36px,auto) auto;gap:8px 10px;padding:18px;border-radius:22px;align-items:stretch}
.is-pv-soul .image-composer-toolbar{display:contents}
.is-pv-soul .image-composer-top{grid-column:1;grid-row:1;min-width:0}
.is-pv-soul #image-composer-prompt{min-height:36px;height:36px;padding:5px 2px;resize:none;font-size:14px}
.is-pv-soul .composer-controls{display:flex;align-items:center;flex-wrap:wrap;gap:6px;grid-column:1;grid-row:2;min-width:0}
.is-pv-soul .composer-flex{display:none}
#image-composer.is-pv-soul #composer-character{grid-column:2;grid-row:1/3;width:80px;height:auto;min-height:84px;border-radius:12px;align-self:stretch}
.is-pv-soul #composer-character-name{font-size:10px;padding:20px 5px 9px;white-space:normal;line-height:1.15}
.is-pv-soul #composer-character-photo{font-size:22px;background:linear-gradient(140deg,#363839,#202223)}
#image-composer .hf-source-card{position:relative;grid-column:3;grid-row:1/3;overflow:hidden;min-height:84px;padding:0;border:1px solid #4a4c4b;border-radius:12px;background:linear-gradient(140deg,#353736,#202221);color:#eee}
.hf-source-card img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.hf-source-plus{font-size:24px;color:#a3a6a3}
.hf-source-label{position:absolute;bottom:0;left:0;right:0;padding:20px 5px 9px;background:linear-gradient(transparent,#000b);font-size:10px;font-weight:650}
.hf-source-change{display:none;position:absolute;right:5px;top:5px;background:#191b1bd9;border-radius:5px;padding:3px 6px;font-size:10px}
.has-photo .hf-source-change{display:block}.has-photo .hf-source-plus{display:none}
#image-composer.is-pv-soul .composer-generate{grid-column:4;grid-row:1/3;min-width:0;min-height:84px;height:auto;border-radius:13px;background:#d6ef64;border:1px solid #d6ef64;color:#17200a;font-size:15px;font-weight:700;box-shadow:none}
#image-composer.is-pv-soul .composer-generate:disabled{background:#9da967;border-color:#9da967;color:#26301b;opacity:.7}
#image-composer.is-pv-soul .composer-generate:hover:not(:disabled){background:#e3ff77;border-color:#e3ff77;color:#101707}
.is-pv-soul .composer-select-pill,.is-pv-soul .composer-model-pill,.is-pv-soul .composer-settings-pill{min-height:38px;border-radius:10px}
.is-pv-soul .composer-model-symbol{color:#d6ef64}
.is-pv-soul #composer-generation-block,.is-pv-soul #image-composer-status{grid-column:1/-1;margin:0}
@media(max-width:900px){
 #image-composer.is-pv-soul{grid-template-columns:minmax(0,1fr) 72px 90px 120px;gap:8px;padding:14px}
 #image-composer.is-pv-soul #composer-character{width:72px}
}
@media(max-width:650px){
 #image-composer.is-pv-soul{grid-template-columns:68px 86px minmax(0,1fr);grid-template-rows:auto auto auto;padding:12px;gap:10px 8px}
 .is-pv-soul .image-composer-top{grid-column:1/-1;grid-row:1}
 .is-pv-soul .composer-controls{grid-column:1/-1;grid-row:2}
 #image-composer.is-pv-soul #composer-character{grid-column:1;grid-row:3;width:68px;min-height:70px}
 #image-composer.is-pv-soul .hf-source-card{grid-column:2;grid-row:3;min-height:70px}
 #image-composer.is-pv-soul .composer-generate{grid-column:3;grid-row:3;min-height:70px}
}

#image-composer.is-pv-soul .composer-model-symbol{font-size:0;width:20px;height:20px;background:url('./branding/pv-mark.png') center/contain no-repeat}
#image-composer.is-pv-soul #composer-character-name{white-space:normal!important;text-overflow:clip!important;font-size:9px;max-width:none;width:100%;box-sizing:border-box}
#image-composer.is-pv-soul .composer-generate:not(:disabled){background:#efb951!important;border-color:#efb951!important;color:#171309!important}

/* Reference-guided models: all uploads stay visible, the prompt has its own row. */
#image-composer:not(.is-pv-soul) .image-composer-top{flex-direction:column;align-items:stretch;gap:9px;min-height:0}
#image-composer:not(.is-pv-soul) .image-composer-references{flex:initial;max-width:none;width:100%;max-height:86px;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;overscroll-behavior:contain;padding:9px 9px 8px;gap:10px;scrollbar-width:thin;scrollbar-color:#62666d transparent}
#image-composer:not(.is-pv-soul) .composer-reference-tile{flex-basis:58px;width:58px;height:62px;overflow:visible}
#image-composer .composer-reference-role{position:absolute;left:0;bottom:0;box-sizing:border-box;width:100%;height:22px;min-height:22px;border:0;border-radius:0 0 7px 7px;padding:2px 3px;background:#161818e8;color:#fff;font-size:9px;line-height:1;cursor:pointer}
/* Long pasted prompts scroll inside the input instead of growing the entire
   dock over the image results. A separate height cap keeps Generate visible. */
#image-composer #image-composer-prompt{
  box-sizing:border-box;resize:none;min-height:42px;
  max-height:min(176px,25dvh);
  overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;
  overflow-wrap:anywhere;white-space:pre-wrap;
  scrollbar-width:thin;scrollbar-color:#666a72 transparent;
  font-size:13px!important;line-height:1.55!important;
}
#image-composer #image-composer-prompt::-webkit-scrollbar{width:6px}
#image-composer #image-composer-prompt::-webkit-scrollbar-thumb{background:#63666d;border-radius:8px}
/* Soul uses a flex column inside a grid row. Prevent flex shrinking the prompt
   back to one line after JavaScript has deliberately fitted it to 176px. */
#image-composer.is-pv-soul #image-composer-prompt{flex-shrink:0}
@media(max-width:740px){
  #image-composer #image-composer-prompt{max-height:min(122px,22dvh);min-height:47px;font-size:12px!important}
  #image-composer:not(.is-pv-soul) .image-composer-references{max-height:74px;gap:7px;padding-top:8px}
}
@media(max-height:640px){
  #image-composer #image-composer-prompt{max-height:min(104px,21dvh)}
  #image-composer:not(.is-pv-soul) .image-composer-references{max-height:74px}
}
#image-composer:not(.is-pv-soul) .image-composer-toolbar{margin-top:6px}
#image-composer #composer-generation-block[hidden]{display:none!important;margin:0!important;padding:0!important}
#image-composer:not(.is-pv-soul) #image-composer-prompt{flex:none;box-sizing:border-box}

#image-composer .composer-reference-tile[draggable=true]{cursor:grab}
#image-composer .composer-reference-tile.is-reordering{opacity:.4;cursor:grabbing}
#image-composer .composer-reference-tile.drop-before{box-shadow:-4px 0 0 #efb951}
#image-composer .composer-reference-tile.drop-after{box-shadow:4px 0 0 #efb951}
