.thb-template-dialog{width:min(1180px,calc(100vw - 40px));max-width:1180px;max-height:92dvh;padding:0;border:1px solid #dbe2ea;border-radius:20px;color:#173046;background:#fff;box-shadow:0 28px 90px #102b4260;font-family:Arial,sans-serif;overflow:auto}.thb-template-dialog::backdrop{background:#071c33b8;backdrop-filter:blur(4px)}.thb-template-dialog [hidden]{display:none!important}.thb-template-top{display:flex;justify-content:space-between;gap:22px;padding:28px 30px 20px;border-bottom:1px solid #e5eaf0}.thb-template-top h2{font-size:clamp(23px,3vw,32px);line-height:1.15;letter-spacing:-.8px;margin:4px 0 10px}.thb-template-top p{margin:0;color:#5b6e7e;line-height:1.5}.thb-template-top .thb-template-eyebrow{font-size:11px;letter-spacing:2px;font-weight:800;color:#1463bc}.thb-template-top [data-template-close]{width:44px;height:44px;border:1px solid #dce3ec;background:white;color:#254058;border-radius:50%;flex-shrink:0;cursor:pointer}.thb-template-browser{display:grid;grid-template-columns:minmax(0,1fr) 320px}.thb-template-collection{padding:22px 28px 28px;min-width:0}.thb-template-search{display:grid;grid-template-columns:1fr 160px;gap:14px}.thb-template-search label{display:grid;gap:7px;font-size:12px;font-weight:700}.thb-template-search input,.thb-template-search select{width:100%;box-sizing:border-box;min-height:44px;border:1px solid #bac7d4;border-radius:8px;padding:10px;background:white;color:#193249;font:14px Arial,sans-serif}.thb-template-dialog #designTemplatesCount{font-size:12px;color:#637585;margin:16px 0}.thb-template-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}.thb-template-card{display:flex;flex-direction:column;text-align:left;background:#fff;border:1px solid #dce3eb;border-radius:11px;padding:0;overflow:hidden;cursor:pointer;transition:border-color .15s,box-shadow .15s}.thb-template-card:hover{border-color:#2c70b3;box-shadow:0 5px 15px #183f6a12}.thb-template-card[aria-pressed=true]{border:2px solid #1668bc;box-shadow:0 0 0 2px #e0edfb}.thb-template-thumb{display:flex;align-items:center;justify-content:center;width:100%;height:132px;box-sizing:border-box;background:#f0f3f5;padding:12px}.thb-template-thumb svg{max-width:100%;max-height:100%;width:100%;height:100%;filter:drop-shadow(0 2px 3px #182b3c22)}.thb-template-card-name{font-weight:700;font-size:14px;margin:12px 13px 4px;color:#173046}.thb-template-card-category{font-size:12px;color:#647589;margin:0 13px 12px}.thb-template-detail{border-left:1px solid #e4eaf0;padding:26px 23px;background:#f8fafc;position:sticky;top:0;align-self:start}.thb-template-preview{background:#e7edf2;border-radius:10px;display:flex;align-items:center;justify-content:center;height:218px;padding:16px}.thb-template-preview svg{max-width:100%;max-height:100%;width:100%;height:100%;filter:drop-shadow(0 3px 5px #19324728)}.thb-template-detail h3{font-size:21px;line-height:1.25;margin:20px 0 8px;letter-spacing:-.3px}.thb-template-detail p{font-size:13px;line-height:1.6;color:#5b6e7e}.thb-template-detail #designTemplatesSize{font-size:12px;font-weight:700;color:#235b88}.thb-template-edit-note{padding-bottom:12px;border-bottom:1px solid #e1e7ed}.thb-template-use{background:#1264c4;color:white;border:0;border-radius:8px;padding:13px 16px;font-size:14px;font-weight:700;width:100%;min-height:46px;cursor:pointer;margin-top:8px}.thb-template-use:disabled{background:#697b8c;cursor:default}.thb-template-dialog #designTemplatesConfirm{padding:14px;background:#fff2d5;border:1px solid #e1c584;border-radius:9px;font-size:13px;line-height:1.5;margin:14px 0}.thb-template-dialog #designTemplatesConfirm p{margin:5px 0 10px}.thb-template-dialog #designTemplatesKeep,.thb-template-dialog #designTemplatesReset{background:white;border:1px solid #aebdcc;border-radius:7px;padding:10px 12px;color:#173c63;cursor:pointer;min-height:42px}.thb-template-dialog #designTemplatesStatus{color:#9b352a;font-size:12px}.thb-template-dialog #designTemplatesEmpty{padding:24px 0;min-height:150px}.thb-template-dialog button:focus-visible,.thb-template-dialog input:focus-visible,.thb-template-dialog select:focus-visible{outline:3px solid #e6a325;outline-offset:3px}.thb-template-trigger{border:1px solid #1264c4!important;background:#eaf3ff!important;color:#164d87!important;font-weight:700!important}.thb-template-dialog svg text{user-select:none}
@media(min-width:1350px){.thb-template-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.thb-template-thumb{height:120px}}
@media(max-width:740px){.thb-template-dialog{width:calc(100vw - 18px);max-height:94dvh;border-radius:14px}.thb-template-top{padding:21px 18px 16px;gap:12px}.thb-template-top p:not(.thb-template-eyebrow){font-size:13px}.thb-template-browser{grid-template-columns:1fr}.thb-template-collection{padding:18px}.thb-template-detail{position:static;border-left:0;border-top:1px solid #dfe7ee;padding:20px 18px}.thb-template-preview{height:165px}.thb-template-search{grid-template-columns:1fr}.thb-template-grid{gap:10px}.thb-template-thumb{height:100px;padding:8px}.thb-template-card-name{font-size:13px;margin:9px 10px 3px}.thb-template-card-category{margin:0 10px 10px}.thb-template-detail h3{margin-top:15px}.thb-template-use{position:sticky;bottom:0;box-shadow:0 0 0 7px #f8fafc}.thb-template-dialog #designTemplatesConfirm{scroll-margin-block:20px}}
@media(prefers-reduced-motion:reduce){.thb-template-card{transition:none}}
.home-template-section{max-width:1200px;margin:50px auto;padding:34px;border:1px solid #dce5ed;border-radius:18px;background:#f7fafc}.home-template-section h2{margin:0 0 12px;font-size:clamp(26px,3.5vw,38px);letter-spacing:-1px;color:#193750}.home-template-section p{max-width:650px;color:#5a6c7d;line-height:1.6}.home-template-section>[data-thb-open-templates]{border:0;border-radius:8px;background:#1264c4;color:white;padding:13px 20px;font-weight:700;min-height:46px;cursor:pointer}.home-template-previews{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin:24px 0}.home-template-previews button{padding:0 0 17px;display:flex;flex-direction:column;text-align:left;border:1px solid #d9e3ed;border-radius:12px;background:white;overflow:hidden;cursor:pointer;box-shadow:0 3px 10px #1c3b5610}.home-template-previews .home-template-art{display:flex;align-items:center;justify-content:center;background:#eaf0f4;height:200px;padding:22px;box-sizing:border-box}.home-template-previews svg{width:100%;height:100%;filter:drop-shadow(0 3px 4px #1b354126)}.home-template-previews button>span:not(.home-template-art){padding:17px 17px 5px;width:100%;box-sizing:border-box;display:flex;justify-content:space-between;color:#163752;font-size:16px;font-weight:700}.home-template-previews small{padding:0 17px;color:#59738a;font-size:12px}.home-template-previews button:hover{border-color:#3277b8}.home-template-section button:focus-visible{outline:3px solid #e6a325;outline-offset:3px}@media(max-width:740px){.home-template-section{margin:30px 16px;padding:22px}.home-template-previews{grid-template-columns:1fr;gap:14px}.home-template-previews .home-template-art{height:190px}}

/* Keep template navigation available while the collection and preview scroll. */
.thb-template-top{position:sticky;top:0;z-index:5;background:#fff;box-shadow:0 2px 8px #10233f0a}
.thb-template-top>div{min-width:0}
.thb-template-detail{top:var(--thb-template-header-height,140px)}
.thb-template-top [data-template-close]{min-width:44px;min-height:44px;margin:0;touch-action:manipulation}
.thb-template-back{display:none}
@media(max-width:740px){
 .thb-template-top{padding:14px 16px;align-items:center}
 .thb-template-top h2{font-size:20px;line-height:1.25;margin:0}
 .thb-template-top p{display:none}
 .thb-template-search label{font-size:14px}
 .thb-template-search input,.thb-template-search select{font-size:16px;min-height:46px;min-width:0}
 .thb-template-dialog .thb-template-back{display:inline-flex;align-items:center;justify-content:center;width:auto;max-width:100%;min-height:44px;margin:0 0 16px;padding:10px 14px;border:1px solid #b8cce1;border-radius:8px;background:white;color:#164d87;font-size:14px;font-weight:700;white-space:normal;word-break:normal;overflow-wrap:normal;touch-action:manipulation}
 .thb-template-dialog #designTemplatesKeep,.thb-template-dialog #designTemplatesReset{min-height:44px}
 .thb-template-detail{scroll-margin-top:100px}
}
