.template-album-count{position:absolute;right:12px;top:12px;padding:5px 8px;border:1px solid #ffffff70;border-radius:14px;background:#152137c9;color:#fff;font-size:10px;backdrop-filter:blur(7px)}
.template-preview-layout{height:min(82dvh,820px);max-height:calc(100dvh - 30px);grid-template-rows:minmax(0,1fr)}
.template-preview-stage{overflow:hidden}
.template-preview-images{display:grid;width:100%;max-height:100%;min-height:0;box-sizing:border-box;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));align-content:start;align-items:start;gap:12px;overflow:auto}
.template-preview-image{width:100%;min-width:0;box-sizing:border-box;margin:0;justify-self:stretch;overflow:hidden;border:1px solid #ffffff24;border-radius:8px;background:#fff}
.template-preview-image img{display:block;width:100%;aspect-ratio:4/5;max-height:none;object-fit:contain;background:#f5f6f8;box-shadow:none;border-radius:0}
.template-preview-image figcaption{min-height:30px;padding:7px 8px;color:#596578;font-size:10px;line-height:1.5;overflow-wrap:anywhere}
.template-preview-actions .primary[data-action=replicate]{flex:1}
.template-heading-tools>#importTemplates{border-color:#b8dfcb;background:#eff9f3;color:#27714a}
.template-import-dialog{width:min(820px,calc(100vw - 24px));max-height:calc(100dvh - 24px)}
.template-import-dialog form{padding:22px}
.template-import-dialog .dialog-heading{align-items:flex-start;margin-bottom:15px}
.template-import-dialog .dialog-heading h2{margin:0;color:#303c51;font-size:19px}
.template-import-dialog .dialog-heading p{margin:5px 0 0;color:#8290a4;font-size:11px;line-height:1.6}
.template-import-dialog .dialog-heading>button{flex:0 0 auto;width:34px;height:34px;border-radius:50%;background:#f1f4f8;color:#606e81;font-size:22px}
.template-import-picker{display:grid;min-height:92px;place-content:center;gap:7px;border:1px dashed #9bbce8;border-radius:12px;background:#f5f8fe;color:#435c7e;text-align:center;cursor:pointer}
.template-import-picker input{position:absolute;width:1px;height:1px;opacity:0}
.template-import-picker strong{font-size:13px}
.template-import-picker small{color:#8593a7;font-size:10px}
.template-import-preview{display:grid;grid-template-columns:repeat(auto-fill,minmax(100px,1fr));gap:8px;max-height:230px;overflow:auto;margin-top:12px}
.template-import-preview>p{grid-column:1/-1;margin:0;padding:12px;color:#8290a4;font-size:11px}
.template-import-thumb{min-width:0;margin:0;overflow:hidden;border:1px solid #e2e8f1;border-radius:8px;background:#fff}
.template-import-thumb img{display:block;width:100%;aspect-ratio:1;object-fit:contain;background:#f4f6f9}
.template-import-thumb figcaption{padding:5px 7px;color:#66758b;font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.template-import-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px 13px;margin-top:13px}
.template-import-fields label{display:grid;gap:5px;color:#65738a;font-size:10px}
.template-import-fields label:last-child{grid-column:1/-1}
.template-import-fields input,.template-import-fields select,.template-import-fields textarea{width:100%;min-width:0;margin:0;padding:9px 10px;border:1px solid #dce4ef;border-radius:8px;background:#fff;color:#3c485c;font-size:11px}
.template-import-fields input,.template-import-fields select{height:37px}
.template-import-fields textarea{min-height:60px;resize:vertical}
.template-import-dialog .dialog-actions .primary{width:auto;min-width:155px;padding:0 15px}
.generated-template-choice{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto;gap:6px;cursor:default}
.generated-template-choice img,.generated-template-choice strong,.generated-template-choice small{grid-column:1;grid-row:auto}
.generated-template-choice img{aspect-ratio:4/5;object-fit:contain}
@media(max-width:700px){
  .template-heading-tools{flex-wrap:wrap}
  .template-heading-tools>#importTemplates{flex:1}
  .template-heading-tools>#addTemplate{flex:1}
  .template-import-dialog form{padding:15px}
  .template-import-fields{grid-template-columns:1fr}
  .template-import-fields label:last-child{grid-column:auto}
  .template-import-preview{grid-template-columns:repeat(3,minmax(0,1fr));max-height:190px}
  .template-import-dialog .dialog-actions .primary{flex:1}
  .template-album-count{right:7px;top:7px}
  .template-preview-layout{height:auto;max-height:none;grid-template-rows:auto}
  .template-preview-stage{overflow:visible}
  .template-preview-images{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:52dvh;overflow:auto}
  .template-preview-image figcaption{font-size:9px}
}
