#templateFinder{margin:0 0 7px}
.tf-fields{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}
#templateFinder .tf-fields label{display:block;margin:0 0 4px;font-size:.82rem;font-weight:650}
#templateFinder input,#templateFinder select{width:100%;min-width:0;height:35px;margin:0;border:1px solid #cbd1d5;border-radius:6px;background-color:white;color:var(--ink);padding:6px 9px;font-size:.86rem}
#templateFinder select{padding-right:28px}
.tf-results{display:flex;align-items:center;justify-content:space-between;min-height:24px;gap:8px}
#tf-count{font-size:.78rem;color:var(--muted)}
#tf-clear,#tf-widen,#tf-details button{border:0;background:transparent;padding:3px 0;color:var(--teal,#1746ca);font-size:.8rem;font-weight:650;line-height:1.3;text-underline-offset:3px;text-decoration:underline}
#tf-empty{padding:5px 9px 8px;border-left:3px solid #a8c0eb;background:#f0f4fc}
#tf-empty p,#tf-details p{margin:3px 0 6px;font-size:.83rem;line-height:1.4;color:#3e4b60}
#tf-details{margin:7px 2px 0;border-top:1px solid #d9dee4;padding-top:4px}
#tf-details summary{cursor:pointer;color:#354258;padding:4px 0;font-size:.82rem;font-weight:650}
#tf-details strong{display:block;color:#25354d;font-size:.81rem}
#tf-details[open]>div{padding:4px 2px 1px}
@media(min-width:460px) and (max-width:730px){.tf-fields{grid-template-columns:1fr 1fr}}

#templateFinder .tf-browse-actions{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 10px}
#templateFinder .tf-browse{display:block;flex:1 1 auto;padding:8px 9px;margin:0;border:1px solid #aebfec;border-radius:7px;background:#eff3ff;color:#173da6;font-size:.84rem;font-weight:730;text-align:left}
#templateFinder #tf-films{background:#fff;border-color:#c9d3e6}
#templateFinder #tf-films::before{content:'▶';margin-right:5px;font-size:.75em}
#templateFinder #tf-films[hidden]{display:none}
#templateFinder .tf-browse:hover{background:#e5edff}
#tf-more-matches{background:none;color:#1746ca;font-size:.84rem;font-weight:650;padding:2px 0 6px;text-decoration:underline}
#templateGrid .tile{position:relative}
#templateGrid.tf-portraits .tile canvas{aspect-ratio:4/5;object-fit:contain;max-height:165px}
#templateGrid .tile.tf-video::before{content:'▶ Video';position:absolute;top:4px;left:4px;border-radius:3px;background:#101721e8;color:white;padding:3px 5px;z-index:1;font-size:.67rem;line-height:1.1;font-weight:650}
#studioTemplateGallery{--tg-ink:#182337;--tg-blue:#244cd0;--tg-rule:#d8dee6;--tg-canvas:#f3f4f0;box-sizing:border-box;width:min(1540px,97vw);max-width:97vw;height:min(970px,95dvh);max-height:95dvh;padding:0;border:1px solid #cad1d9;border-radius:16px;color:var(--tg-ink);background:#fff;overflow:hidden;box-shadow:0 24px 100px #11192555}
#studioTemplateGallery::backdrop{background:#111b2b91;backdrop-filter:blur(3px)}
#studioTemplateGallery [hidden]{display:none!important}
#studioTemplateGallery *{box-sizing:border-box}
#studioTemplateGallery .tg-shell{height:100%;display:flex;flex-direction:column}
#studioTemplateGallery .tg-head{display:flex;justify-content:space-between;align-items:center;gap:15px;flex:none;background:#141c28;color:#fff;border-bottom:3px solid #3864f5;padding:16px clamp(18px,2.1vw,32px)}
#studioTemplateGallery .tg-heading h2{margin:0;color:#fff;font-size:clamp(1.45rem,2.5vw,2.15rem);line-height:1;letter-spacing:-.055em;font-weight:760}
#studioTemplateGallery .tg-heading p{margin:6px 0 0;font-size:.87rem;line-height:1.25;color:#c9d2df}
#studioTemplateGallery button{font-family:inherit;cursor:pointer}
#studioTemplateGallery button:disabled{cursor:wait}
#studioTemplateGallery .tg-close{display:grid;place-items:center;flex:none;width:38px;height:38px;border-radius:50%;color:white;background:#354252;font-size:1.55rem;line-height:1}
#studioTemplateGallery .tg-close:hover{background:#495974}
#studioTemplateGallery .tg-list{display:flex;flex-direction:column;flex:1;min-height:0}
#studioTemplateGallery .tg-product{flex:none;padding:8px clamp(16px,2.2vw,32px);background:#edf2fd;border-bottom:1px solid #d4dcf1}
#studioTemplateGallery .tg-product>div{display:flex;align-items:baseline;flex-wrap:wrap;gap:2px 8px}
#studioTemplateGallery .tg-product span,#studioTemplateGallery .tg-product small{font-size:.82rem;color:#485772}
#studioTemplateGallery .tg-product strong{font-size:.9rem;color:#172c5c}
#studioTemplateGallery .tg-toolbar{display:grid;grid-template-columns:minmax(190px,1.7fr) repeat(3,minmax(120px,1fr)) minmax(150px,1.18fr);gap:10px;padding:12px clamp(16px,2vw,31px) 10px;align-items:end}
#studioTemplateGallery label:not(.sr){display:flex;flex-direction:column;gap:5px;background:none;margin:0;color:#3b4556;font-weight:660;font-size:.83rem}
#studioTemplateGallery input,#studioTemplateGallery select{height:37px;width:100%;min-width:0;margin:0;background-color:white;border:1px solid #c3cad5;border-radius:6px;padding:6px 9px;color:#17223a;font-size:.9rem;font-weight:500;line-height:1.25}
#studioTemplateGallery select{padding-right:26px}
#studioTemplateGallery .tg-collection{display:flex;flex-wrap:wrap;gap:5px;padding:0 clamp(16px,2vw,31px) 10px;border-bottom:1px solid var(--tg-rule)}
#studioTemplateGallery .tg-collection button,#studioTemplateGallery .tg-editions button{padding:6px 12px;min-height:30px;border-radius:20px;background:#edf0f5;color:#34415c;font-size:.85rem;font-weight:650}
#studioTemplateGallery .tg-collection button[aria-pressed=true],#studioTemplateGallery .tg-editions button[aria-pressed=true]{background:var(--tg-blue);color:white}
#studioTemplateGallery .tg-body{display:grid;grid-template-columns:minmax(155px,188px) minmax(0,1fr);flex:1;min-height:0}
#studioTemplateGallery .tg-category-nav{min-width:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:14px 6px 14px 10px;background:#f6f7f7;border-right:1px solid var(--tg-rule)}
#studioTemplateGallery .tg-category-nav h3{margin:0 8px 8px;font-size:.92rem}
#studioTemplateGallery .tg-categories{display:grid;gap:1px}
#studioTemplateGallery .tg-categories button{display:flex;justify-content:space-between;align-items:baseline;gap:7px;width:100%;text-align:left;padding:7px 8px;border-radius:5px;background:none;color:#4d586a;font-size:.82rem;font-weight:550;line-height:1.25}
#studioTemplateGallery .tg-categories button:hover{background:#e9edf4}
#studioTemplateGallery .tg-categories button[aria-pressed=true]{background:#e0e8fc;color:#183c9d;font-weight:720}
#studioTemplateGallery .tg-category-count{font-size:.71rem;font-variant-numeric:tabular-nums}
#studioTemplateGallery .tg-stage{padding:15px clamp(12px,1.7vw,25px) 24px;min-width:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
#studioTemplateGallery .tg-result-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
#studioTemplateGallery .tg-result-title{margin:0;color:var(--tg-ink);font-size:clamp(1.2rem,1.8vw,1.55rem);font-weight:720;letter-spacing:-.035em}
#studioTemplateGallery .tg-reset,#studioTemplateGallery .tg-back{background:#edf1fb;color:#203b8e;padding:7px 11px;border-radius:6px;font-size:.85rem;font-weight:650}
#studioTemplateGallery .tg-count{display:block;color:#596479;font-size:.8rem;margin:3px 0 12px}
#studioTemplateGallery .tg-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,249px),1fr));gap:18px 15px}
#studioTemplateGallery .tg-grid.tg-posters{grid-template-columns:repeat(auto-fill,minmax(min(100%,175px),1fr))}
#studioTemplateGallery .tg-grid.tg-mixed{display:block;columns:225px;column-gap:16px}
#studioTemplateGallery .tg-mixed .tg-card{break-inside:avoid;display:inline-flex;margin:0 0 16px;vertical-align:top}
#studioTemplateGallery .tg-mixed .tg-card[data-shape=portrait] .tg-card-art{aspect-ratio:9/16}
#studioTemplateGallery .tg-card{min-width:0;display:flex;flex-direction:column;align-items:stretch;width:100%;padding:0;border:1px solid #d7dbe1;border-radius:9px;overflow:hidden;background:white;color:var(--tg-ink);text-align:left}
#studioTemplateGallery .tg-card:hover{border-color:#7c95df;box-shadow:0 3px 15px #2736551c}
#studioTemplateGallery .tg-card-art{position:relative;display:grid;place-items:center;min-width:0;width:100%;aspect-ratio:16/9;background:#e7eae9;overflow:hidden}
#studioTemplateGallery .tg-grid.tg-posters .tg-card-art{aspect-ratio:var(--tg-card-ratio,3/5);max-height:min(45vh,365px)}
#studioTemplateGallery .tg-card-art canvas{display:block;width:100%;height:100%;min-width:0;min-height:0;object-fit:contain}
#studioTemplateGallery .tg-film-badge{grid-column:2;grid-row:1;align-self:start;border-radius:4px;background:#e8edfe;padding:3px 5px;color:#243c83;font-weight:680;font-size:.67rem;line-height:1.2;white-space:nowrap}
#studioTemplateGallery .tg-caption{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 5px;padding:10px 11px 11px;min-width:0}
#studioTemplateGallery .tg-caption strong{font-size:.93rem;line-height:1.22;font-weight:710}
#studioTemplateGallery .tg-caption small{grid-column:1/-1;font-size:.76rem;line-height:1.3;color:#566378}
#studioTemplateGallery .tg-more{display:block;background:#eff3ff;color:#1843b3;border:1px solid #b8c7eb;margin:20px auto 0;padding:10px 18px;border-radius:7px;font-size:.9rem;font-weight:650}
#studioTemplateGallery .tg-no-results{padding:25px 8px;background:#f5f6f8;border-radius:7px;text-align:center}
#studioTemplateGallery .tg-no-results h4,#studioTemplateGallery .tg-no-results p{margin:6px;line-height:1.4}
#studioTemplateGallery label.tg-mobile-category:not(.sr){display:none}
#studioTemplateGallery .tg-detail{flex:1;min-height:0;overflow:auto;padding:14px clamp(16px,2.4vw,34px) 26px;background:#fbfcf9}
#studioTemplateGallery .tg-detail-nav{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:13px}
#studioTemplateGallery .tg-detail-nav>div{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:7px 12px}
#studioTemplateGallery .tg-preview-size{font-size:.83rem;padding:5px 8px;background:#fff;color:#1943a8;border:1px solid #c3cfe8;border-radius:5px}
#studioTemplateGallery .tg-dimensions{color:#485668;font-size:.84rem;font-weight:600}
#studioTemplateGallery .tg-detail-wrap{display:grid;grid-template-columns:minmax(0,1.75fr) minmax(min(100%,300px),.83fr);gap:clamp(15px,2.3vw,33px);align-items:start}
#studioTemplateGallery .tg-preview-column{position:sticky;top:0;min-width:0}
#studioTemplateGallery .tg-detail-art{display:grid;place-items:center;width:100%;height:clamp(285px,62vh,690px);padding:clamp(8px,1.2vw,17px);border:1px solid #d5d9de;border-radius:11px;overflow:hidden;background:#e5e9ea}
#studioTemplateGallery .tg-detail-art[data-shape=portrait]{height:clamp(360px,70vh,760px)}
#studioTemplateGallery .tg-detail-art canvas{display:block;width:100%;height:100%;min-width:0;min-height:0;object-fit:contain}
#studioTemplateGallery .tg-detail-controls{min-width:0}
#studioTemplateGallery .tg-detail-category{font-size:.82rem;font-weight:700;color:#1d499c;margin:3px 0 6px}
#studioTemplateGallery #tg-detail-name{font-size:clamp(1.55rem,2.9vw,2.7rem);line-height:1.02;letter-spacing:-.055em;color:#172337;margin:0;font-weight:790}
#studioTemplateGallery .tg-use{font-size:.97rem;color:#454f60;line-height:1.45;margin:10px 0 14px}
#studioTemplateGallery .tg-detail-actions{display:flex;flex-wrap:wrap;gap:7px;margin:14px 0 10px}
#studioTemplateGallery .tg-apply,#studioTemplateGallery .tg-room{padding:10px 15px;border-radius:7px;min-height:41px;font-weight:690;font-size:.91rem}
#studioTemplateGallery .tg-apply{color:#fff;background:var(--tg-blue);border:1px solid var(--tg-blue)}
#studioTemplateGallery .tg-room{color:#1d3553;border:1px solid #b8c4d3;background:#fff}
#studioTemplateGallery .tg-target{display:flex;flex-direction:column;gap:2px;margin:0 0 18px;line-height:1.35}
#studioTemplateGallery .tg-target strong{font-size:.84rem}
#studioTemplateGallery .tg-target small,#studioTemplateGallery .tg-apply-message,#studioTemplateGallery .tg-film-note{font-size:.82rem;color:#536177}
#studioTemplateGallery .tg-lesson{border:1px solid #ced9ee;border-radius:10px;background:#f1f5fd;padding:14px}
#studioTemplateGallery .tg-lesson-heading{display:flex;flex-wrap:wrap;align-items:center;gap:6px 9px;justify-content:space-between}
#studioTemplateGallery .tg-lesson h4,#studioTemplateGallery .tg-source h4,#studioTemplateGallery .tg-test h4{margin:0;font-size:.98rem;line-height:1.25;letter-spacing:-.02em;color:#243650}
#studioTemplateGallery .tg-home{color:#244da1;font-size:.76rem;font-weight:710}
#studioTemplateGallery .tg-why,#studioTemplateGallery .tg-version-note p,#studioTemplateGallery .tg-source p,#studioTemplateGallery .tg-test p{margin:7px 0 0;font-size:.91rem;line-height:1.45;color:#46556a}
#studioTemplateGallery .tg-editions{display:inline-flex;align-items:center;gap:3px;margin-top:12px;padding:3px;border-radius:7px;background:#dfe7f5}
#studioTemplateGallery .tg-editions button{border-radius:5px;font-size:.84rem;background:transparent}
#studioTemplateGallery .tg-version-note{margin:11px 0 9px}
#studioTemplateGallery .tg-version-note h5{color:#243650;margin:0;font-size:.87rem}
#studioTemplateGallery .tg-version-note p{margin-top:3px}
#studioTemplateGallery .tg-lesson a{color:#1943a8;font-size:.83rem;text-underline-offset:3px}
#studioTemplateGallery .tg-source,#studioTemplateGallery .tg-test{margin:14px 0 0}
#studioTemplateGallery .tg-player{display:flex;align-items:center;gap:10px;padding:10px 0;min-height:42px}
#studioTemplateGallery .tg-play{color:#173da2;background:#edf1ff;border:1px solid #c6d1eb;border-radius:6px;font-size:.85rem;font-weight:680;padding:7px 10px}
#studioTemplateGallery .tg-progress{height:5px;flex:1;width:0;accent-color:var(--tg-blue)}
#studioTemplateGallery .tg-time{color:#526076;font-size:.8rem;font-variant-numeric:tabular-nums}
@media(max-width:1000px){
 #studioTemplateGallery .tg-toolbar{grid-template-columns:repeat(4,minmax(95px,1fr));gap:8px}
 #studioTemplateGallery .tg-toolbar .tg-search{grid-column:1/-1}
 #studioTemplateGallery .tg-toolbar .tg-search span{position:absolute;clip-path:inset(50%);overflow:hidden;width:1px;height:1px}
 #studioTemplateGallery .tg-body{grid-template-columns:155px minmax(0,1fr)}
 #studioTemplateGallery .tg-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,190px),1fr))}
 #studioTemplateGallery .tg-grid.tg-posters{grid-template-columns:repeat(auto-fill,minmax(min(100%,145px),1fr))}
 #studioTemplateGallery .tg-detail-wrap{grid-template-columns:minmax(0,1.25fr) minmax(245px,.8fr)}
}
@media(max-width:670px),(max-height:530px){
 #studioTemplateGallery{width:100vw;height:100dvh;max-width:100vw;max-height:100dvh;border:0;border-radius:0}
 #studioTemplateGallery .tg-head{padding:10px 13px}
 #studioTemplateGallery .tg-heading p{font-size:.78rem;margin-top:3px}
 #studioTemplateGallery .tg-toolbar{grid-template-columns:repeat(2,minmax(0,1fr));padding:7px 11px;gap:5px 8px}
 #studioTemplateGallery .tg-toolbar label{font-size:.74rem;gap:2px}
 #studioTemplateGallery .tg-toolbar select,#studioTemplateGallery .tg-toolbar input{height:30px;font-size:.8rem}
 #studioTemplateGallery .tg-collection{padding:0 11px 6px;gap:3px}
 #studioTemplateGallery .tg-collection button{font-size:.8rem;padding:4px 9px;min-height:26px}
 #studioTemplateGallery .tg-category-nav{display:none}
 #studioTemplateGallery .tg-body{display:flex;flex-direction:column}
 #studioTemplateGallery .tg-stage{padding:9px 11px}
 #studioTemplateGallery label.tg-mobile-category:not(.sr){display:flex;flex-direction:row;align-items:center;gap:8px;margin-bottom:8px}
 #studioTemplateGallery .tg-mobile-category select{width:auto;flex:1;height:30px;font-size:.84rem}
 #studioTemplateGallery .tg-grid,#studioTemplateGallery .tg-grid.tg-posters{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 7px}
 #studioTemplateGallery .tg-grid.tg-mixed{columns:2;column-gap:7px}
 #studioTemplateGallery .tg-mixed .tg-card{margin-bottom:10px}
 #studioTemplateGallery .tg-caption{padding:6px 7px;gap:3px}
 #studioTemplateGallery .tg-caption strong{font-size:.83rem}
 #studioTemplateGallery .tg-caption small{font-size:.7rem}
 #studioTemplateGallery .tg-count{margin-bottom:7px}
 #studioTemplateGallery .tg-product{padding:5px 11px}
 #studioTemplateGallery .tg-product span,#studioTemplateGallery .tg-product small{font-size:.7rem}
 #studioTemplateGallery .tg-product strong{font-size:.8rem}
 #studioTemplateGallery .tg-detail{padding:10px 12px 20px}
 #studioTemplateGallery .tg-detail-nav{margin-bottom:8px}
 #studioTemplateGallery .tg-detail-wrap{display:flex;flex-direction:column;gap:13px}
 #studioTemplateGallery .tg-preview-column{position:static;width:100%}
 #studioTemplateGallery .tg-detail-art,#studioTemplateGallery .tg-detail-art[data-shape=portrait]{height:clamp(180px,46dvh,410px);padding:6px}
 #studioTemplateGallery .tg-detail-art[data-shape=landscape]{height:clamp(160px,28dvh,260px)}
 #studioTemplateGallery .tg-detail-controls{width:100%}
}

.export-resolution,.preview-resolution,#studioTemplateGallery .tg-resolution label{display:flex;align-items:center;gap:.45rem;font-size:.85rem;font-weight:650;color:#263748}
.export-resolution select,.preview-resolution select,#studioTemplateGallery .tg-quality{border:1px solid #c4ccd6;border-radius:6px;background:white;color:#202d3b;font:inherit;padding:.34rem .4rem;max-width:100%}
.preview-resolution{margin-right:auto}
#studioTemplateGallery .tg-resolution{display:flex;align-items:center;gap:8px 14px;flex-wrap:wrap;margin-top:.55rem}
#studioTemplateGallery .tg-quality-note{font-size:.82rem;color:#465767;margin:0}
@media(max-width:720px){.export-resolution{flex-wrap:wrap}.exports{flex-wrap:wrap}.preview-resolution{flex-basis:100%}}

.export-detail{margin:-.35rem 0 .8rem;padding:.45rem .7rem;background:#eef3f8;border-inline-start:3px solid #5978b2;color:#24354b;font-size:.85rem;line-height:1.45}
