/* Image and video templates extend the approved studio shell. */
.template-tabs{display:flex;gap:6px;margin:0 0 27px;border-bottom:1px solid #a982bd38;padding-bottom:10px}.template-tabs button{border:0;background:transparent;color:var(--muted,#bca5cc);font:500 13px var(--sans);padding:11px 18px;border-radius:5px}.template-tabs button.selected{background:#a66cc82b;color:var(--text,#f2e5f9)}.template-gallery{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;margin-bottom:32px}.template-card{min-width:0;text-align:left;background:transparent;border:1px solid #b58aca36;border-radius:7px;padding:8px 8px 13px;color:inherit;overflow:hidden;transition:border-color .2s,transform .2s}.template-card:hover{transform:translateY(-3px);border-color:#cf9feb}.template-card.selected{border-color:#d6afea;background:#9764b115}.template-thumb{height:160px;background:#23172d;display:flex;justify-content:center;align-items:center;overflow:hidden;border-radius:3px;position:relative}.template-thumb canvas{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}.template-card-title{display:block;margin:12px 7px 5px;font:500 16px var(--serif);color:var(--text,#f4e7f9)}.template-card small{display:block;margin:0 7px;color:var(--muted,#c3accf);font-size:11px;letter-spacing:.04em}.template-play-glyph{position:absolute;right:9px;bottom:9px;background:#1c0e2b99;border:1px solid #f0d7ff50;width:29px;height:29px;border-radius:50%;display:grid;place-items:center;color:white}.template-play-glyph svg{width:13px;height:13px}.template-composer{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(280px,.75fr);gap:25px;align-items:start}.template-stage-panel{min-width:0;padding:20px;border:1px solid #b58aca30;background:#a475bd08;border-radius:8px}.template-stage-top{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:18px}.template-stage-top h2{font:400 22px var(--serif);margin:0}.template-stage-top>span{font-size:9px;letter-spacing:.1em;color:var(--muted,#c1a9ce);text-align:right}.template-canvas-wrap{display:flex;align-items:center;justify-content:center;background:#130c1d;min-height:280px;border-radius:4px;overflow:hidden}.template-canvas-wrap canvas{display:block;width:100%;height:auto;max-height:610px;object-fit:contain;aspect-ratio:auto}.template-canvas-wrap.image-composition{padding:25px;background:radial-gradient(ellipse at center,#9c65bf25,#291b3633)}.template-canvas-wrap.image-composition canvas{width:auto;max-width:100%;max-height:600px;box-shadow:0 20px 50px #08040e66}.template-stage-actions{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:20px}.template-controls{min-width:0}.template-controls .form-body{padding:22px}.template-controls .field{margin-bottom:20px}.template-controls textarea{min-height:70px}.template-controls .form-grid{gap:15px}.template-slots{display:flex;gap:9px;margin:10px 0 13px}.template-slot{position:relative;width:70px;height:75px;padding:0;border:1px solid #a47bc460;background:#23162f;border-radius:4px;overflow:hidden}.template-slot.selected{border:2px solid #d8adf1}.template-slot img{width:100%;height:100%;object-fit:cover}.template-slot span{position:absolute;bottom:4px;right:5px;background:#1b0e28b0;color:#fff;padding:2px 5px;font-size:10px;border-radius:3px}.template-upload{position:relative;display:flex;justify-content:center;cursor:pointer;overflow:hidden;min-height:42px}.template-upload input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%;height:100%}.template-upload:focus-within{outline:2px solid #d8aff4;outline-offset:3px}.template-filename{display:block;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;margin-top:8px;color:var(--muted,#c3aecf)}.template-filename:empty{display:none}.template-focal input{padding:0;width:100%;accent-color:#ca9aef;min-height:28px;cursor:pointer}.template-focal .field-label{margin-top:9px}.template-transport{display:flex;gap:12px;align-items:center;padding:14px 0 2px}.template-transport>input{flex:1;min-width:0;accent-color:#cfa4ec;cursor:pointer}.template-transport output{white-space:nowrap;font-size:11px;color:var(--muted,#cdb8d9);font-variant-numeric:tabular-nums}.template-cues{display:flex;gap:8px;margin-top:12px}.template-cues button{position:relative;height:56px;width:84px;overflow:hidden;border:1px solid #c29bda55;border-radius:3px;padding:0}.template-cues img{width:100%;height:100%;object-fit:cover}.template-cues span{position:absolute;bottom:3px;left:5px;color:white;background:#1c112599;font-size:10px;padding:2px 4px}.template-controls label.field-label{display:block}.template-controls input:not([type=file]):not([type=range]),.template-controls textarea,.template-controls select{width:100%}
:root[data-theme="light"] .template-card{border-color:#7e54972f}:root[data-theme="light"] .template-card.selected{border-color:#9660ad;background:#ad79c50d}:root[data-theme="light"] .template-stage-panel{background:#fffafc;border-color:#9c79aa34}:root[data-theme="light"] .template-tabs button{color:#785889}:root[data-theme="light"] .template-tabs button.selected{color:#492856;background:#a673c11a}:root[data-theme="light"] .template-card-title{color:#3c234b}:root[data-theme="light"] .template-card small,:root[data-theme="light"] .template-stage-top>span,:root[data-theme="light"] .template-filename,:root[data-theme="light"] .template-transport output{color:#795f86}:root[data-theme="light"] .template-canvas-wrap.image-composition{background:radial-gradient(ellipse at center,#ddc6e9,#f2eaf7)}
@media(max-width:1050px){.template-composer{grid-template-columns:minmax(0,1fr) minmax(270px,.8fr)}.template-gallery{gap:12px}.template-thumb{height:130px}.template-stage-panel{padding:15px}.template-stage-top h2{font-size:19px}.template-stage-top>span{font-size:8px}}
@media(max-width:760px){.template-gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:22px}.template-thumb{height:155px}.template-composer{grid-template-columns:1fr;gap:20px}.template-stage-panel{padding:14px}.template-stage-top>span{font-size:9px}.template-canvas-wrap{min-height:0}.template-canvas-wrap.image-composition{padding:18px}.template-canvas-wrap.image-composition canvas{max-height:500px}.template-card-title{font-size:16px}.template-controls .form-body{padding:20px}.template-transport{gap:8px}.template-tabs{margin-bottom:22px}.template-stage-actions .button{font-size:12px}.template-filename{max-width:100%}.template-canvas-wrap canvas{max-height:520px}}
@media(prefers-reduced-motion:reduce){.template-card{transition:none}.template-card:hover{transform:none}}

.template-library-filters{display:flex;align-items:end;gap:16px;margin-bottom:20px}.template-library-filters>div{flex:1;min-width:0}.template-library-filters label{display:block;font-size:11px;letter-spacing:.05em;color:#c3aed0;margin-bottom:7px}.template-library-filters select{width:100%;min-height:44px;background:#31233d;color:#f2e4fa;border:1px solid #a57aba50;border-radius:5px;padding:10px;font:12px var(--sans)}.template-library-filters>span{padding-bottom:12px;font-size:11px;white-space:nowrap;color:#c5afcf}.template-scene-meta{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;margin:-5px 0 15px;font-size:10px;letter-spacing:.04em;color:#bfa5ce}.template-show-more{display:block;margin:-10px auto 30px}.template-card-title{min-height:38px}.template-card small{font-size:10px}:root[data-theme="light"] .template-library-filters select{background:#fffafd;color:#493454;border-color:#ad88bd55}:root[data-theme="light"] .template-library-filters label,:root[data-theme="light"] .template-library-filters>span,:root[data-theme="light"] .template-scene-meta{color:#765682}@media(max-width:600px){.template-library-filters{flex-wrap:wrap;gap:12px}.template-library-filters>div{min-width:calc(50% - 6px)}.template-library-filters>span{padding:0}.template-library-filters select{font-size:11px;padding:9px 6px}.template-card-title{font-size:14px;min-height:34px}}
