.template-detail-page{display:grid;gap:24px}.template-detail-breadcrumb{display:flex;gap:10px;flex-wrap:wrap;font-size:13px;color:#8790a5}.template-detail-breadcrumb a{color:#72688e}.template-detail-header{display:flex;gap:24px;justify-content:space-between;align-items:flex-start}.template-detail-header h1{font-size:clamp(24px,3vw,36px);line-height:1.2;margin:0 0 12px;letter-spacing:-.7px}.template-detail-header p{color:#747b91;max-width:780px;line-height:1.65;margin:0 0 14px}.template-detail-header .template-detail-actions{min-width:260px;max-width:350px;justify-content:flex-end;flex-wrap:wrap;margin:0}.template-detail-facts{display:flex;flex-wrap:wrap;gap:10px 16px;font-size:12px;align-items:center}.template-detail-facts span,.template-detail-facts a{display:inline-flex;gap:5px;align-items:center}.template-detail-facts a{color:#6d4ac5}.template-viewer{display:grid;grid-template-columns:170px minmax(0,1fr);gap:16px;background:white;border:1px solid #e9e6f2;border-radius:18px;padding:16px;box-shadow:0 4px 24px #30205505;min-width:0;align-items:start}.template-viewer-thumbs{display:flex;flex-direction:column;gap:12px;max-height:580px;overflow-y:auto;overscroll-behavior:contain;padding:2px 6px 2px 2px;scrollbar-width:thin}.template-viewer-thumb{position:relative;display:block;flex:none;width:100%;border:2px solid transparent;border-radius:12px;padding:3px;background:#f7f6fa;cursor:pointer;overflow:hidden;aspect-ratio:16/9;box-shadow:0 2px 9px #26233c0b}.template-viewer-thumb.selected{border-color:#8051eb;background:#f3edff}.template-viewer-thumb img{width:100%;height:100%;object-fit:contain;border-radius:8px;display:block}.template-viewer-thumb>span:last-child{position:absolute;bottom:3px;left:4px;border-radius:4px;background:#ffffffed;padding:1px 6px;font-size:10px;color:#5d5377}.template-viewer-thumb:focus-visible,.template-viewer-controls button:focus-visible{outline:3px solid #a486ec;outline-offset:1px}.template-viewer-main{min-width:0}.template-viewer-stage{border-radius:12px;overflow:hidden;background:#f8f7fb;border:1px solid #ece9f3;aspect-ratio:16/9}.template-viewer-stage .real-demo-grid{display:block!important;margin:0!important;padding:0!important;gap:0!important}.template-viewer-stage .demo-unit{margin:0!important;padding:0!important;border:0!important;box-shadow:none!important}.template-viewer-stage .demo-unit[hidden]{display:none!important}.template-viewer-stage .demo-unit>span{display:none!important}.template-viewer-stage .template-source-page{display:block;width:100%!important;height:auto!important;margin:0!important;border-radius:0!important;box-shadow:none!important}.template-viewer-stage .slide-preview{width:100%;margin:0!important}.template-viewer-controls{display:flex;align-items:center;gap:12px;color:#726886;font-size:13px;padding:12px 4px 0}.template-viewer-controls button{border:0;background:#f4f0fb;color:#65537f;border-radius:8px;width:34px;height:32px;font-size:23px;cursor:pointer}.template-viewer-controls button:disabled{opacity:.35;cursor:default}.template-viewer-controls [data-viewer-fullscreen]{margin-left:auto}.template-viewer-stage:fullscreen{background:#171423;display:flex;align-items:center;justify-content:center;width:100vw;height:100vh;aspect-ratio:auto}.template-viewer-stage:fullscreen .real-demo-grid{width:min(100vw,177.78vh)}.template-viewer-cv .template-viewer-stage{aspect-ratio:420/594;max-width:520px;margin:auto}.template-viewer-cv .template-viewer-thumb{aspect-ratio:420/594}.template-viewer-cv .template-viewer-thumbs{max-height:650px}.template-viewer-cv .template-viewer-main{background:#f8f7fb;padding:12px;border-radius:12px}.template-viewer-cv .template-viewer-stage:fullscreen .real-demo-grid{width:min(100vw,70.7vh)}.template-detail-share{display:flex;align-items:center;gap:12px;font-size:13px;color:#7f7592}.template-detail-share input{min-width:0;flex:1;background:#faf9fc;border:1px solid #e9e4f1;border-radius:9px;padding:10px;color:#7d7291}.template-reviews,.template-related{border:1px solid #e9e6f2;border-radius:18px;background:#fff;padding:24px;min-width:0}.template-reviews h2,.template-related h2{font-size:21px;margin:0 0 20px}.template-reviews h2 span{color:#6d5d91}.template-review-overview{display:grid;grid-template-columns:160px minmax(150px,1fr) minmax(260px,1.3fr);gap:22px;align-items:center}.template-rating-summary{background:#faf8ff;border:1px solid #eee8f7;border-radius:12px;text-align:center;padding:22px 10px}.template-rating-summary>strong{font-size:40px;color:#221a3e}.template-rating-summary small{font-size:16px}.template-rating-summary p{font-size:11px;color:#8d829e;margin:9px 0 0}.review-stars{display:inline-flex;gap:3px;color:#ded9e7;white-space:nowrap;font-size:19px}.review-stars .filled{color:#f7b340}.template-rating-bars>div{display:flex;align-items:center;gap:10px;margin:11px 0;font-size:12px;color:#827892}.template-rating-bars>div>span:first-child{min-width:35px}.template-rating-bars>div>span:last-child{min-width:24px;text-align:right}.template-rating-bars progress{appearance:none;height:8px;width:100%;flex:1;border:0;border-radius:20px;background:#f1edf7;overflow:hidden}.template-rating-bars progress::-webkit-progress-bar{background:#f1edf7}.template-rating-bars progress::-webkit-progress-value{background:#8b55e8;border-radius:20px}.template-rating-bars progress::-moz-progress-bar{background:#8b55e8;border-radius:20px}.template-review-form,.template-review-login{background:#fcfbff;border:1px solid #ede7f5;border-radius:12px;padding:16px;min-width:0}.template-review-form h3{margin:0 0 7px;font-size:14px}.template-star-picker{border:0;padding:0;margin:0 0 10px;display:flex;gap:8px}.template-star-picker legend{font-size:11px;color:#837592;margin-bottom:4px}.template-star-picker label{cursor:pointer;color:#ded9e7;font-size:30px;position:relative;line-height:1.1}.template-star-picker label.selected{color:#f7b340}.template-star-picker label:focus-within{outline:2px solid #8b55e8;outline-offset:3px;border-radius:3px}.template-star-picker input{position:absolute;opacity:0;width:1px;height:1px}.template-review-form textarea{resize:vertical;min-height:80px;width:100%;box-sizing:border-box;padding:10px;border:1px solid #e0d8eb;border-radius:8px;font:inherit;font-size:13px;color:#302743;background:white}.template-review-form textarea:focus{outline:2px solid #a887ea}.template-review-form .button{width:100%;margin-top:8px}.template-review-message{font-size:12px;color:#6e5096;margin:5px 0;white-space:pre-wrap}.template-review-message:empty{display:none}.template-review-message.error{color:#bc3c55}.template-review-login>span{color:#8051eb;font-size:28px;display:block}.template-review-login strong{font-size:14px}.template-review-login p{font-size:12px;line-height:1.6;color:#82758f}.template-review-login .button{font-size:12px;white-space:normal;text-align:center}.template-review-list{margin-top:20px}.template-review-item{display:flex;gap:12px;padding:18px 0;border-top:1px solid #f0ecf5}.template-review-avatar{flex:none;width:40px;height:40px;border-radius:50%;display:grid;place-items:center;color:#7950b4;background:#eee7f9;font-weight:700}.template-review-item>div:last-child{min-width:0;flex:1}.template-review-item header{display:flex;align-items:center;gap:12px;flex-wrap:wrap;font-size:13px}.template-review-item time{color:#a094af;font-size:11px;margin-left:auto}.template-review-item .review-stars{font-size:15px}.template-review-item p{font-size:13px;line-height:1.7;color:#756887;margin:8px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}.template-review-empty{font-size:13px;color:#8d7b9d;padding:15px 0}.template-review-pagination{display:flex;justify-content:center;gap:20px;font-size:13px;padding-top:12px}.template-review-pagination a{color:#8051eb}.template-related>p{font-size:13px;color:#8d7b9d;margin:-10px 0 20px}.template-related-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.template-related-grid .template-card{min-width:0}.template-preview-dialog{padding:0!important;border:1px solid #e8e2ef!important;border-radius:18px!important;width:min(1180px,94vw)!important;max-width:94vw!important;max-height:92dvh!important;height:auto!important;overflow:hidden!important}.template-preview-dialog[open]{display:flex!important;flex-direction:column!important}.template-preview-dialog::backdrop{background:#19152f80;backdrop-filter:blur(3px)}.template-preview-dialog .template-preview-head{padding:22px 24px!important;flex:none!important;border-bottom:1px solid #f0ebf5}.template-preview-dialog .template-preview-head h2{font-size:25px;line-height:1.25}.template-preview-dialog .template-preview-content{padding:16px 24px 24px!important;overflow:auto!important;flex:1!important;min-height:0;display:block!important;max-height:none!important}.template-preview-body{display:grid;gap:18px}.template-preview-body .template-viewer{grid-template-columns:150px minmax(0,1fr)}.template-preview-body .template-viewer-thumbs{max-height:460px}.template-preview-body .template-reviews{padding:20px}.template-preview-dialog .template-preview-body .template-preview-foot{position:static!important;background:transparent;border:0!important;padding:0!important;width:100%;box-shadow:none!important}.template-preview-body .template-preview-buttons{flex-wrap:wrap}.template-preview-body .template-preview-stats{font-size:11px;gap:12px}.template-preview-body .template-review-overview{grid-template-columns:135px minmax(130px,1fr) minmax(240px,1.3fr)}.template-preview-body .template-rating-summary>strong{font-size:32px}
@media(max-width:1050px){.template-review-overview,.template-preview-body .template-review-overview{grid-template-columns:140px minmax(0,1fr)}.template-review-form,.template-review-login{grid-column:1/-1}.template-detail-header{flex-direction:column;gap:12px}.template-detail-header .template-detail-actions{max-width:none;min-width:0;justify-content:flex-start}.template-related-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){.template-detail-page{gap:16px}.template-detail-header h1{font-size:25px}.template-detail-header p{font-size:13px}.template-detail-facts{gap:8px 12px;font-size:11px}.template-viewer,.template-preview-body .template-viewer{display:flex;flex-direction:column;padding:10px;gap:10px;border-radius:12px}.template-viewer-main{width:100%;order:0}.template-viewer-thumbs{width:100%;order:1;flex-direction:row;overflow-x:auto;overflow-y:hidden;max-height:none!important;padding:2px 0 6px}.template-viewer-thumb{width:100px}.template-viewer-cv .template-viewer-thumb{width:65px}.template-viewer-cv .template-viewer-stage{max-width:300px}.template-reviews,.template-related{padding:16px;border-radius:12px}.template-reviews h2,.template-related h2{font-size:18px}.template-review-overview,.template-preview-body .template-review-overview{grid-template-columns:115px minmax(0,1fr);gap:12px}.template-rating-summary{padding:14px 6px}.template-rating-summary>strong{font-size:30px}.template-rating-bars>div{gap:5px;font-size:10px}.template-review-item header{gap:6px 10px}.template-review-item time{width:100%;margin:0}.template-review-item p{font-size:12px}.template-related-grid{grid-template-columns:1fr}.template-detail-share{flex-wrap:wrap;gap:8px}.template-detail-share>span{width:100%}.template-detail-share .button{font-size:11px;padding:9px}.template-preview-dialog[open]{width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;border-radius:0!important}.template-preview-dialog .template-preview-head{padding:14px!important}.template-preview-dialog .template-preview-head h2{font-size:20px}.template-preview-dialog .template-preview-content{padding:10px 12px 20px!important}.template-preview-body .template-preview-buttons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.template-preview-body .template-preview-buttons form{min-width:0}.template-preview-body .template-reviews{padding:14px}.template-detail-actions .button{font-size:12px;padding:10px 12px}}
.template-viewer-stage .deck-slide{margin:0!important;width:100%!important;border-radius:0!important;box-shadow:none!important;aspect-ratio:16/9}.template-viewer-thumb>.deck-slide{margin:0!important;padding:3px;min-height:0;aspect-ratio:16/9;container-type:inline-size}.template-viewer-thumb .deck-title{font-size:clamp(5px,5cqw,12px)}.template-viewer-thumb .deck-body,.template-viewer-thumb .deck-points{font-size:clamp(3px,2cqw,6px)}
/* Single scrolling line for template metadata and statistics. */
.template-detail-header>div:first-child{min-width:0;flex:1}.template-detail-facts{flex-wrap:nowrap;overflow-x:auto;max-width:100%;padding-bottom:6px;scrollbar-width:thin;overscroll-behavior-x:contain}.template-detail-facts>span,.template-detail-facts>a{flex:none;white-space:nowrap}.template-preview-stats{flex-wrap:nowrap;max-width:100%;overflow-x:auto;padding-bottom:4px;scrollbar-width:thin}.template-preview-stats>span{flex:none;white-space:nowrap}
/* Equal full-width action rows at every detail-page size. */
.template-detail-header .template-detail-actions{display:grid;grid-template-columns:minmax(0,1fr);width:180px;min-width:180px;max-width:180px;gap:8px;flex:none}.template-detail-header .template-detail-actions>.button,.template-detail-header .template-detail-actions>form,.template-detail-header .template-detail-actions>form>.button{width:100%;margin:0;box-sizing:border-box;justify-content:center}.template-preview-body .template-preview-buttons{display:grid;grid-template-columns:1fr;width:180px;min-width:180px;gap:8px}.template-preview-body .template-preview-buttons>button,.template-preview-body .template-preview-buttons>form,.template-preview-body .template-preview-buttons>form>button{width:100%!important;box-sizing:border-box;margin:0;justify-content:center}.template-preview-body .template-preview-stats{flex:1;min-width:0;align-self:flex-start}
.review-admin-stats{display:flex;gap:12px;overflow-x:auto;padding:4px 0 14px;scrollbar-width:thin}.review-admin-stats>div{flex:1 0 125px;background:white;border:1px solid #e8e2ef;border-radius:12px;padding:15px}.review-admin-stats small{display:block;color:#867797;font-size:12px}.review-admin-stats strong{display:block;font-size:24px;color:#6544a0;margin-top:8px}.review-admin-filters{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:14px 0}.review-admin-filters input{flex:1;min-width:180px}.review-admin-filters input,.review-admin-filters select,.review-admin-edit select,.review-admin-edit textarea{border:1px solid #ded7e9;border-radius:9px;background:white;padding:11px;font:inherit;min-width:0}.review-admin-table{min-width:1000px}.review-admin-table td{vertical-align:top}.review-admin-table small{display:block;color:#9586a6;margin-top:5px}.review-admin-content{white-space:pre-wrap;overflow-wrap:anywhere;min-width:250px;max-width:400px}.review-admin-actions{display:flex;gap:8px;align-items:center}.review-admin-actions form{margin:0}.review-admin-actions .button{white-space:nowrap;font-size:12px;padding:8px 12px}.review-admin-edit{max-width:850px;display:grid;gap:20px}.review-admin-edit label{display:grid;gap:8px}.review-admin-edit textarea{resize:vertical;width:100%;box-sizing:border-box}
@media(max-width:1050px){.template-detail-header{flex-direction:row}.template-detail-header .template-detail-actions{width:160px;min-width:160px;max-width:160px}}
@media(max-width:640px){.template-detail-header{flex-direction:column}.template-detail-header>div:first-child{width:100%}.template-detail-header .template-detail-actions,.template-preview-body .template-preview-buttons{width:100%;min-width:0;max-width:none;grid-template-columns:1fr}.template-preview-body .template-preview-stats{width:100%;flex:auto}.template-preview-body .template-preview-buttons button{min-height:40px}.review-admin-filters input{flex-basis:100%}}
.template-detail-page{grid-template-columns:minmax(0,1fr);min-width:0}.template-detail-page>*{min-width:0}.template-detail-header{width:100%;max-width:100%;box-sizing:border-box}.template-detail-facts{width:100%;box-sizing:border-box}
/* Mobile: three actions share one row. */
@media(max-width:640px){
 .template-detail-header .template-detail-actions,.template-preview-body .template-preview-buttons{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
 .template-detail-header .template-detail-actions .button,.template-preview-body .template-preview-buttons button{min-width:0;min-height:42px;padding:9px 4px!important;font-size:11px!important;gap:4px;white-space:nowrap!important}
 .template-detail-header .template-detail-actions .template-action-icon,.template-preview-body .template-preview-buttons .template-action-icon{width:14px;height:14px}
}

/* Preview header: title and one compact metadata row. */
.template-preview-dialog .template-preview-head{padding:16px 20px!important;align-items:flex-start}.template-preview-heading{flex:1;min-width:0}.template-preview-heading h2{display:flex;align-items:center;gap:8px;margin:0 0 8px!important;min-width:0}.template-preview-heading #templatePreviewTitle{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.template-preview-heading .template-preview-detail-link{display:inline-flex;flex:none;align-items:center;justify-content:center;width:28px;height:28px;border-radius:7px;border:1px solid #e4ddf0;margin:0!important;text-decoration:none}.template-preview-heading .template-preview-value{margin:0!important;font-size:12px;line-height:20px;white-space:nowrap;overflow-x:auto;scrollbar-width:thin;color:#897998}.template-preview-head #closeTemplatePreview{flex:none;margin:0}
.template-preview-body .template-preview-buttons{grid-template-columns:repeat(3,minmax(0,1fr));width:390px;min-width:0;max-width:100%;gap:8px}.template-preview-body .template-preview-buttons button{min-height:42px;white-space:nowrap!important}.template-preview-body .template-preview-foot{align-items:center!important}.template-preview-body .template-preview-stats{align-self:center}
/* Cover, title, category/pages, then four statistics. */
.template-card .template-meta{display:block!important;position:relative}.template-card .template-meta-info{width:100%!important;max-width:none!important;min-width:0;flex:none!important}.template-card .template-meta-info strong{display:block;width:100%;margin:0}.template-card .template-detail-link{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.45}.template-card .template-meta-info small{display:block!important;max-width:none!important;margin:7px 0 12px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.template-card-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;align-items:center;width:100%;min-width:0}.template-card-stats>.template-usage,.template-card-stats>.template-review-stat{margin:0!important;display:flex!important;justify-content:center;align-items:center;gap:5px;width:100%;min-width:0;box-sizing:border-box;background:#f2edfc;border-radius:18px;padding:6px 3px;color:#7058b3;white-space:nowrap;font-size:12px;overflow:hidden}.template-card-stats .template-review-stat>span{color:#ecad38}.template-card-stats .template-action-icon{width:14px;height:14px;flex:none}.template-card-stats b{font-size:12px;overflow:hidden;text-overflow:ellipsis;min-width:0}
@media(max-width:700px){.template-preview-body .template-preview-buttons{width:100%;min-width:0;max-width:none;grid-template-columns:repeat(3,minmax(0,1fr))}.template-preview-body .template-preview-stats{width:100%;flex:auto}.template-preview-body .template-preview-buttons button{font-size:11px!important;padding:9px 4px!important;gap:4px}.template-preview-dialog .template-preview-head h2{font-size:19px}.template-card-stats{gap:4px}.template-card-stats b{font-size:11px}}

.template-preview-body .template-preview-buttons>form{padding:0!important;border:0!important;background:transparent!important;display:flex!important;align-items:stretch!important}

/* Keep legacy card grid rules from overlapping the four statistics. */
.template-card .template-card-stats>.template-review-stat,.template-card .template-card-stats>.template-usage{grid-row:1!important;grid-column:auto!important;justify-self:stretch;min-width:0}
.template-card .template-card-stats>span:nth-child(1){grid-column:1!important}
.template-card .template-card-stats>span:nth-child(2){grid-column:2!important}
.template-card .template-card-stats>span:nth-child(3){grid-column:3!important}
.template-card .template-card-stats>span:nth-child(4){grid-column:4!important}

.template-card .template-card-stats>span{height:30px;line-height:1!important}


/* Mobile: actions overlay metadata only, leaving the cover and favorite visible. */
.template-card .template-actions-close,.template-card .template-preview-mobile-icon{display:none!important}
@media(max-width:700px){
 .template-card .template-preview-mobile-icon{display:block!important}
 .template-card .template-meta{position:relative!important;display:block!important;min-height:0!important;isolation:isolate;overflow:hidden!important}
 .template-card .template-meta-info,.template-card .template-card-stats{transition:filter .16s,opacity .16s}
 .template-card.actions-open .template-meta-info,.template-card.actions-open .template-card-stats{filter:blur(2px);opacity:.45;pointer-events:none!important}
 .template-card .template-meta>.template-hover-actions,
 .template-card:hover .template-meta>.template-hover-actions,
 .template-card:focus-within .template-meta>.template-hover-actions{
  position:absolute!important;inset:0!important;width:100%!important;height:100%!important;aspect-ratio:auto!important;min-height:0!important;max-height:none!important;z-index:30!important;display:none!important;opacity:0!important;visibility:hidden!important;pointer-events:none!important;transform:none!important;margin:0!important;padding:44px 10px 8px!important;border:0!important;background:rgba(243,240,249,.72)!important;backdrop-filter:blur(5px)!important;-webkit-backdrop-filter:blur(5px)!important;border-radius:0 0 14px 14px;box-sizing:border-box!important
 }
 .template-card.actions-open .template-meta>.template-hover-actions,
 .template-card.actions-open:hover .template-meta>.template-hover-actions,
 .template-card.actions-open:focus-within .template-meta>.template-hover-actions{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px!important;align-items:stretch!important;align-content:center!important;opacity:1!important;visibility:visible!important;pointer-events:auto!important}
 .template-card .template-meta>.template-hover-actions>button:not(.template-actions-close),
 .template-card .template-meta>.template-hover-actions>form,
 .template-card .template-meta>.template-hover-actions>form button{position:static!important;min-width:0!important;width:100%!important;max-width:none!important;margin:0!important;box-sizing:border-box!important}
 .template-card .template-meta>.template-hover-actions>form{display:flex!important;align-items:stretch!important;padding:0!important;background:none!important;border:0!important}
 .template-card .template-meta>.template-hover-actions>button:not(.template-actions-close),
 .template-card .template-meta>.template-hover-actions>form button{display:flex!important;flex-direction:column!important;justify-content:center!important;align-items:center!important;min-height:48px!important;padding:6px 3px!important;font-size:11px!important;line-height:1.35!important;white-space:nowrap!important;gap:4px!important;border-radius:12px!important;box-shadow:0 4px 12px #35225b16!important}
 .template-card .template-meta>.template-hover-actions .template-action-icon{width:16px!important;height:16px!important;flex:none}
 .template-card .template-meta>.template-hover-actions>.template-preview-trigger{background:#fff!important;border:1px solid #d8d0ee!important;color:#5c48af!important}
 .template-card .template-meta>.template-hover-actions>.template-hover-apply{background:#6652be!important;border:1px solid #6652be!important;color:#fff!important}
 .template-card .template-meta>.template-hover-actions .template-download-form button{background:#fff!important;border:1px solid #d8d0ee!important;color:#5c48af!important}
 .template-card .template-meta>.template-hover-actions>.template-actions-close{display:grid!important;place-items:center!important;position:absolute!important;inset:0 3px auto auto!important;width:44px!important;height:44px!important;min-height:44px!important;max-width:44px!important;padding:0!important;margin:0!important;border:0!important;background:transparent!important;color:#7b6b91!important;font-size:22px!important;line-height:1!important;box-shadow:none!important}
}
@media(prefers-reduced-motion:reduce){.template-card .template-meta-info,.template-card .template-card-stats{transition:none}}
