/* Public campaign-template gallery + read-only Brand Kit template browser. */
.template-showcase{position:relative;overflow:hidden;padding:86px 0;background:linear-gradient(180deg,#f8f6ff 0%,#f3f1fb 100%)}
:root{--hairline:var(--line,#e7e7e2)}
.template-showcase:before{content:'';position:absolute;width:520px;height:520px;border-radius:50%;left:-250px;top:-260px;background:radial-gradient(circle,rgba(123,97,255,.2),transparent 70%);pointer-events:none}
.template-showcase .wrap{position:relative;z-index:1}
.template-showcase-head{max-width:780px;margin:0 auto 38px;text-align:center}
.template-showcase-head h2{font-size:clamp(32px,4.5vw,52px);line-height:1.05;letter-spacing:-.035em;font-weight:900;color:var(--ink);margin:14px 0}
.template-showcase-head p{max-width:680px;margin:0 auto;color:var(--muted);font-size:18px;line-height:1.58}
.template-category-panel{position:relative;margin:0 0 24px;padding:18px 20px 20px;overflow:hidden;border:1px solid rgba(123,97,255,.24);border-radius:18px;background:rgba(255,255,255,.9);box-shadow:7px 7px 0 rgba(123,97,255,.08)}
.template-category-panel:before{content:'';position:absolute;inset:0 auto 0 0;width:5px;background:linear-gradient(180deg,#7b61ff,#e061ff)}
.template-category-intro{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin:0 0 14px;padding-left:4px}
.template-category-intro strong{display:block;color:var(--ink);font-size:17px;font-weight:900;letter-spacing:-.015em}
.template-category-kicker{display:block;margin-bottom:3px;color:#6d28d9;font-size:9px;font-weight:900;letter-spacing:.14em;text-transform:uppercase}
.template-category-summary{flex:0 0 auto;padding:6px 10px;border:1px solid #ddd6fe;border-radius:999px;background:#f5f3ff;color:#5b21b6;font-size:10px;font-weight:850}
.template-category-controls{padding-left:4px}
.template-category-pills{display:flex;flex-wrap:wrap;gap:7px}
.template-category-pills button{display:inline-flex;align-items:center;gap:6px;min-height:34px;padding:7px 10px;border:1px solid #e5e7eb;border-radius:999px;background:#fff;color:#4b5563;cursor:pointer;font:inherit;font-size:10.5px;font-weight:800;transition:border-color .16s ease,background .16s ease,color .16s ease,transform .16s ease}
.template-category-pills button:hover{transform:translateY(-1px);border-color:#a78bfa;color:#5b21b6}
.template-category-pills button:focus-visible{outline:3px solid rgba(123,97,255,.22);outline-offset:2px}
.template-category-pills button span{display:grid;min-width:19px;height:19px;place-items:center;padding:0 5px;border-radius:999px;background:#f3f4f6;color:#6b7280;font-size:9px}
.template-category-pills button.is-active{border-color:#6d28d9;background:#6d28d9;color:#fff;box-shadow:0 5px 12px rgba(91,33,182,.2)}
.template-category-pills button.is-active span{background:rgba(255,255,255,.18);color:#fff}
.template-category-select{display:none}
.template-public-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}
.template-card{display:flex;min-width:0;flex-direction:column;overflow:hidden;border:1px solid var(--hairline);border-radius:18px;background:#fff;box-shadow:7px 7px 0 rgba(10,10,10,.06);transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.template-card:hover{transform:translateY(-5px);border-color:rgba(123,97,255,.5);box-shadow:9px 11px 0 rgba(10,10,10,.09)}
.template-card-image{position:relative;width:100%;aspect-ratio:16/10;overflow:hidden;padding:0;border:0;border-bottom:1px solid var(--hairline);background:#ebe8f7;cursor:pointer}
.template-card-image img{width:100%;height:100%;display:block;object-fit:cover;transition:transform .28s ease}
.template-card:hover .template-card-image img{transform:scale(1.035)}
.template-card-premium{position:absolute;right:10px;top:10px;padding:4px 9px;border-radius:999px;background:rgba(255,255,255,.94);color:#5b21b6;font-size:9px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;box-shadow:0 5px 15px rgba(15,23,42,.13)}
.template-card-body{display:flex;flex:1;flex-direction:column;padding:16px}
.template-card-category{align-self:flex-start;margin:0 0 7px;padding:4px 7px;border-radius:6px;background:#f5f3ff;color:#6d28d9;font-size:8px;font-weight:900;letter-spacing:.1em;line-height:1;text-transform:uppercase}
.template-card-body h3{color:var(--ink);font-size:16px;font-weight:850;line-height:1.2;margin:0}
.template-card-body p{display:-webkit-box;min-height:39px;margin:7px 0 12px;overflow:hidden;color:var(--muted);font-size:12.5px;line-height:1.52;-webkit-box-orient:vertical;-webkit-line-clamp:2}
.template-swatches{display:flex;gap:5px;margin-bottom:14px}
.template-swatches i{display:block;height:9px;flex:1;border:1px solid rgba(15,23,42,.08);border-radius:999px}
.template-preview-button{width:100%;margin-top:auto;border:0;border-radius:11px;background:var(--ink);color:#fff;cursor:pointer;font:inherit;font-size:13px;font-weight:800;padding:11px 13px;transition:background .16s ease,transform .16s ease}
.template-preview-button:hover{background:var(--coral);transform:translateY(-1px)}
.template-gallery-loading{grid-column:1/-1;padding:48px;border:1px dashed rgba(123,97,255,.35);border-radius:18px;background:rgba(255,255,255,.72);text-align:center;color:var(--muted);font-weight:700}
.template-gallery-error{grid-column:1/-1;padding:28px;border:1px solid #fecaca;border-radius:16px;background:#fff1f2;color:#9f1239;text-align:center}
.template-gallery-empty{grid-column:1/-1;padding:36px;border:1px dashed #d8d2ef;border-radius:16px;background:rgba(255,255,255,.72);color:var(--muted);font-size:13px;font-weight:750;text-align:center}
.template-showcase-cta{display:flex;justify-content:center;margin-top:32px}
.template-showcase-cta .btn{min-width:210px}

.templates-hero{position:relative;overflow:hidden;padding:80px 0 72px;background:var(--teal);color:#fff;text-align:center}
.templates-hero:before{content:'';position:absolute;inset:-160px 10% auto;height:420px;background:radial-gradient(circle,rgba(224,97,255,.36),transparent 68%);filter:blur(25px);pointer-events:none}
.templates-hero .wrap{position:relative;z-index:1}
.templates-hero h1{max-width:920px;margin:18px auto 16px;color:#fff;font-size:clamp(40px,6vw,68px);font-weight:900;letter-spacing:-.045em;line-height:.98}
.templates-hero p{max-width:720px;margin:0 auto;color:rgba(255,255,255,.8);font-size:19px;line-height:1.58}
.templates-proof{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:26px}
.templates-proof span{padding:8px 13px;border:1px solid rgba(255,255,255,.2);border-radius:999px;background:rgba(255,255,255,.09);font-size:12px;font-weight:800;color:#fff}

body.template-browser-open{overflow:hidden}
.template-browser-modal{position:fixed;inset:0;z-index:1000;display:none;align-items:center;justify-content:center;padding:3vh 2vw;background:rgba(7,10,22,.76);backdrop-filter:blur(8px)}
.template-browser-modal.is-open{display:flex}
.template-browser-modal button,.template-browser-modal input,.template-full-overlay button{font-family:inherit}
.template-browser-shell{position:relative;display:grid;width:96vw;height:94vh;max-width:1700px;grid-template-columns:290px minmax(0,1fr);overflow:hidden;border:1px solid rgba(255,255,255,.18);border-radius:18px;background:#fff;box-shadow:0 38px 100px rgba(0,0,0,.48)}
.template-browser-close{position:absolute;right:13px;top:12px;z-index:8;width:36px;height:36px;border:1px solid #dfe3ea;border-radius:50%;background:#fff;color:#111827;cursor:pointer;font-size:22px;line-height:1;box-shadow:0 6px 16px rgba(15,23,42,.12)}
.template-browser-rail{display:flex;min-width:0;min-height:0;flex-direction:column;border-right:1px solid #e5e7eb;background:#fff}
.template-browser-rail-head{padding:14px;border-bottom:1px solid #e5e7eb}
.template-browser-rail-head strong{display:block;color:#111827;font-size:14px;margin-bottom:8px}
.template-browser-search{box-sizing:border-box;width:100%;height:38px;border:1px solid #d1d5db;border-radius:9px;background:#f9fafb;color:#111827;font:inherit;font-size:12px;padding:0 11px;outline:none}
.template-browser-search:focus{border-color:#7b61ff;box-shadow:0 0 0 3px rgba(123,97,255,.14)}
.template-browser-category{display:block;margin-top:8px}
.template-browser-category>span{display:block;margin-bottom:4px;color:#6d28d9;font-size:8px;font-weight:900;letter-spacing:.12em;text-transform:uppercase}
.template-browser-category select{box-sizing:border-box;width:100%;height:36px;border:1px solid #c4b5fd;border-radius:9px;background:#fff;color:#374151;font:inherit;font-size:11px;font-weight:750;padding:0 28px 0 9px;outline:none}
.template-browser-category select:focus{border-color:#7b61ff;box-shadow:0 0 0 3px rgba(123,97,255,.14)}
.template-browser-rail-summary{margin-top:7px;color:#6b7280;font-size:9px;font-weight:750;text-align:right}
.template-browser-rail-list{display:grid;flex:1;min-height:0;grid-auto-rows:max-content;gap:12px;overflow:auto;padding:12px}
.template-rail-item{display:block;width:100%;overflow:hidden;padding:0;border:1px solid #e5e7eb;border-radius:10px;background:#fff;color:inherit;cursor:pointer;font:inherit;line-height:normal;text-align:left;appearance:none;transition:border-color .15s ease,box-shadow .15s ease}
.template-rail-item:hover{border-color:#a78bfa}.template-rail-item.is-selected{border-color:#7b61ff;box-shadow:0 0 0 2px rgba(123,97,255,.18)}
.template-rail-item img{display:block;width:100%;height:96px;object-fit:cover;background:#f3f4f6}
.template-rail-copy{display:block;padding:8px}.template-rail-copy em{display:block;margin-bottom:2px;overflow:hidden;color:#7c3aed;font-size:7.5px;font-style:normal;font-weight:900;letter-spacing:.09em;line-height:12px;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}.template-rail-copy b{display:block;overflow:hidden;color:#111827;font-size:12px;font-weight:650;line-height:16px;text-overflow:ellipsis;white-space:nowrap}.template-rail-copy span{display:-webkit-box;margin-top:2px;overflow:hidden;color:#6b7280;font-size:10px;font-weight:400;line-height:16px;-webkit-box-orient:vertical;-webkit-line-clamp:2}
.template-rail-empty{padding:24px 12px;border:1px dashed #d1d5db;border-radius:10px;background:#f9fafb;color:#6b7280;font-size:11px;font-weight:700;line-height:1.5;text-align:center}
.template-browser-stage{display:flex;min-width:0;min-height:0;flex-direction:column;background:#f3f4f6}
.template-browser-toolbar{flex:0 0 auto;padding:12px 52px 11px 16px;border-bottom:1px solid #e5e7eb;background:#fff}
.template-browser-title-row{display:flex;align-items:center;justify-content:space-between;gap:16px}
.template-browser-name{min-width:0}.template-browser-name h2{overflow:hidden;color:#111827;font-size:16px;font-weight:700;line-height:20px;text-overflow:ellipsis;white-space:nowrap}.template-browser-name p{display:-webkit-box;max-width:780px;margin-top:4px;overflow:hidden;color:#6b7280;font-size:12px;font-weight:400;line-height:16px;-webkit-box-orient:vertical;-webkit-line-clamp:1}
.template-browser-badges{display:flex;gap:6px;margin-top:7px}.template-browser-badges span{padding:3px 7px;border:1px solid #e5e7eb;border-radius:999px;background:#fff;color:#6b7280;font-size:9px;font-weight:850;letter-spacing:.08em;text-transform:uppercase}
.template-browser-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.template-device-switcher{display:flex;gap:3px;padding:3px;border:1px solid #e5e7eb;border-radius:999px;background:#f9fafb}
.template-device-button,.template-full-button{height:31px;border:1px solid transparent;border-radius:999px;background:transparent;color:#6b7280;cursor:pointer;font:inherit;font-size:11px;font-weight:800;padding:0 10px}
.template-device-button.is-active{border-color:#e5e7eb;background:#fff;color:#6d28d9;box-shadow:0 2px 6px rgba(15,23,42,.08)}
.template-full-button{border-color:#e5e7eb;border-radius:8px;background:#fff;color:#374151}
.template-page-tabs{display:flex;gap:7px;overflow-x:auto;margin-top:10px;padding-bottom:2px}
.template-page-tab{flex:0 0 auto;border:1px solid #e5e7eb;border-radius:999px;background:#fff;color:#6b7280;cursor:pointer;font:inherit;font-size:10px;font-weight:800;padding:5px 10px}.template-page-tab.is-active{border-color:#7b61ff;background:#7b61ff;color:#fff}
.template-preview-stage{display:flex;min-height:0;flex:1;align-items:flex-start;justify-content:center;overflow:auto;padding:16px}
.template-preview-frame{width:100%;height:100%;min-height:560px;overflow:hidden;border:1px solid #d1d5db;border-radius:10px;background:#fff;box-shadow:0 8px 24px rgba(15,23,42,.1);transition:width .24s ease}
.template-preview-frame iframe{display:block;width:100%;height:100%;min-height:560px;border:0;background:#fff}
.template-preview-status{display:flex;width:100%;height:100%;min-height:460px;align-items:center;justify-content:center;color:#6b7280;font-size:14px;font-weight:700}
.template-preview-status[hidden],.template-preview-frame iframe[hidden]{display:none}
.template-full-overlay{position:fixed;inset:0;z-index:1100;display:none;background:#111827;padding:52px 16px 16px}.template-full-overlay.is-open{display:block}.template-full-overlay iframe{width:100%;height:100%;border:0;border-radius:10px;background:#fff}.template-full-close{position:absolute;right:16px;top:10px;height:34px;border:1px solid rgba(255,255,255,.25);border-radius:8px;background:#fff;color:#111827;cursor:pointer;font-weight:850;padding:0 14px}

@media(max-width:1050px){.template-public-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.template-browser-shell{grid-template-columns:230px minmax(0,1fr)}.template-browser-title-row{align-items:flex-start;flex-direction:column}.template-browser-actions{width:100%;flex-wrap:wrap}}
@media(max-width:700px){.template-showcase{padding:62px 0}.template-category-panel{padding:15px 14px 16px}.template-category-intro{align-items:flex-start}.template-category-intro strong{font-size:15px}.template-category-summary{margin-top:2px;white-space:nowrap}.template-category-pills{display:none}.template-category-select{display:grid;gap:5px}.template-category-select>span{color:#6d28d9;font-size:8px;font-weight:900;letter-spacing:.12em;text-transform:uppercase}.template-category-select select{box-sizing:border-box;width:100%;height:42px;border:1px solid #c4b5fd;border-radius:10px;background:#fff;color:#374151;font:inherit;font-size:12px;font-weight:800;padding:0 34px 0 11px}.template-public-grid{grid-template-columns:1fr}.template-browser-modal{padding:0}.template-browser-shell{width:100vw;height:100dvh;border-radius:0;grid-template-columns:1fr;grid-template-rows:210px minmax(0,1fr)}.template-browser-rail{border-right:0;border-bottom:1px solid #e5e7eb}.template-browser-rail-head{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:5px 7px;padding:8px 48px 7px 9px}.template-browser-rail-head strong{display:none}.template-browser-category{margin:0}.template-browser-category>span{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.template-browser-category select{height:38px}.template-browser-rail-summary{grid-column:1/-1;margin-top:0;text-align:left}.template-browser-rail-list{display:flex;gap:8px;overflow-x:auto;overflow-y:hidden;padding:8px}.template-rail-item{width:135px;flex:0 0 auto}.template-rail-item img{height:70px}.template-rail-copy span{display:none}.template-browser-toolbar{padding:10px 42px 8px 10px}.template-browser-name p,.template-browser-badges{display:none}.template-browser-actions{gap:4px}.template-device-button{font-size:9px;padding:0 7px}.template-preview-stage{padding:8px}.template-preview-frame,.template-preview-frame iframe{min-height:440px}.templates-hero{padding:62px 0}}
