#templateBrowse24J{width:100%;margin-top:8px;min-height:48px}
#templateChooser24J,#templateOriginalDialog24J{
  width:min(94vw,720px);max-height:88vh;border:0;border-radius:22px;
  padding:16px;box-sizing:border-box;background:#fff;color:#1e2a3b
}
#templateChooser24J::backdrop,#templateOriginalDialog24J::backdrop{
  background:rgba(0,0,0,.52)
}
.template-dialog-head24j{
  display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px
}
.template-dialog-head24j h2{margin:0;font-size:clamp(20px,5vw,27px)}
#templateChoiceList24J{display:grid;gap:9px;overflow:auto;max-height:69vh;padding:1px}
.template-auto24j{
  width:100%;min-height:46px;border:1px solid #ccd5e2;border-radius:13px;
  background:#eef3f9;color:#203652;font-weight:700;font-size:15px
}
.template-card24j{border:1px solid #ccd5e2;border-radius:14px;padding:12px;background:#f8fafc}
.template-card-head24j{display:flex;align-items:center;justify-content:space-between;gap:8px}
.template-card-head24j strong{font-size:18px}
.template-yard24j{font-size:12px;border-radius:999px;background:#e7edf6;padding:4px 8px}
.template-desc24j{margin:5px 0 9px;font-size:14px;line-height:1.35;color:#35445a}
.template-actions24j{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.compact24j{min-height:42px!important;padding:8px 10px!important;margin:0!important;font-size:14px!important}
#selectedTemplate24J{
  margin-top:10px;padding:12px;border:1px solid #b9cbe2;border-radius:14px;background:#f5f8fc
}
#selectedTemplate24J.hidden{display:none}
.selected-title24j{font-weight:800;font-size:16px;margin-bottom:3px}
.selected-meta24j{font-size:13px;color:#53647a;margin-bottom:9px;line-height:1.35}
.selected-actions24j{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#templateOriginalSub24J{margin:0 0 10px;color:#5b6b80;font-size:13px}
#templateOriginalImage24J{
  display:block;max-width:100%;width:100%;height:auto;
  border:1px solid #d6dde8;border-radius:12px;background:#f3f5f8
}
.template-original-controls24j{display:flex;align-items:center;gap:8px;margin-bottom:10px}
.template-original-controls24j label{margin:0;flex:1}
.template-preview-actions24j{
  display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px;
  position:sticky;bottom:0;background:#fff;padding-top:8px
}
@media(max-width:520px){
  #templateChooser24J,#templateOriginalDialog24J{width:96vw;padding:13px}
}
