/* AI uses the same template catalog cards and preview proportions as direct sending. */
.aim-page .send-template-picker[open]{position:absolute;display:flex;flex-direction:column;box-sizing:border-box;padding:0;overflow:hidden;max-height:var(--send-dialog-height,80vh);font:inherit}
.aim-page .send-template-picker .send-modal-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 22px;border-bottom:1px solid var(--line-soft);flex-shrink:0}
.aim-page .send-template-picker h2{margin:0;font-size:20px}
.aim-page .send-template-picker .tpl-close{float:none;flex-shrink:0}
.aim-page .send-template-picker .send-modal-body{flex:1 1 0}
.aim-page .send-template-picker .send-modal-foot{display:flex;padding:12px 22px;border-top:1px solid var(--line-soft);flex-shrink:0}
.aim-page .send-template-picker input,.aim-page .send-template-picker select{padding:9px 12px;border:1px solid #dfe2e8;border-radius:8px;background:#fff;font:inherit;font-size:13px}
/* Template selection: browsable library + isolated, full-content preview. */
.aim-page .send-template-picker[open]{width:calc(100% - 40px);max-width:1280px;height:var(--send-dialog-height,80vh)}
.send-template-picker .send-modal-body{padding:0;overflow:hidden;display:flex;min-height:0}
.stp-layout{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);width:100%;min-height:0;flex:1}
.stp-library{display:flex;flex-direction:column;min-width:0;min-height:0;border-right:1px solid var(--line-soft)}
.stp-filters{padding:18px 20px 0;flex-shrink:0}.stp-search{display:flex;gap:8px;margin-top:12px}.aim-page .stp-search input{min-width:0;flex:1}.aim-page .stp-search select{width:140px}.stp-filters p{font-size:12px;color:var(--muted);margin:10px 0}
.stp-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:14px;padding:8px 20px 20px;overflow:auto;overscroll-behavior:contain;min-height:0}
.stp-card{display:block;padding:0;background:white;border:1px solid #e0e5ec;border-radius:12px;overflow:hidden;cursor:pointer;text-align:left;font:inherit;color:inherit;min-width:0}
.stp-card:hover{border-color:#87b99b;box-shadow:0 3px 12px #0d713a0b}.stp-card[aria-pressed=true]{border:2px solid #16834a;box-shadow:0 0 0 2px #e4f2e9}.stp-card:focus-visible{outline:3px solid #74b98f;outline-offset:2px}
.stp-card .tpl-thumb{height:180px;padding:14px 22px;pointer-events:none}.stp-card .tpl-thumb-sheet{min-height:200px}.stp-card-info{display:flex;flex-direction:column;gap:6px;padding:12px 14px}.stp-card-info strong{font-size:14px;line-height:1.5}.stp-card-info small,.stp-card-info>span{font-size:12px;color:var(--muted)}
.stp-detail{overflow:auto;overscroll-behavior:contain;min-width:0;min-height:0;background:#f8f9fb;padding:20px 24px}.stp-detail-head{padding-bottom:16px}.stp-detail-head h3{font-size:20px;line-height:1.4;margin:10px 0 6px}.stp-detail-head p{font-size:13px;color:#687386;line-height:1.6;margin:6px 0}.stp-detail-head .tpl-channel-label{font-size:12px}.stp-vars{display:flex;gap:4px;flex-wrap:wrap;margin:8px 0}.stp-vars span{font-size:11px;color:#3b6591;background:#e9effa;padding:3px 6px;border-radius:5px}
.stp-preview{min-width:0;pointer-events:auto}.stp-preview .tpl-sms-phone,.stp-preview .tpl-push-device{width:100%;max-width:340px;margin:0 auto}.stp-preview .tpl-kakao{width:100%;max-width:380px;margin:auto}.stp-preview .tpl-fax-sheet{min-width:0;padding:20px}.stp-preview .tpl-email-stage{width:100%;overflow:auto}.stp-preview .tpl-email-stage.is-mobile{max-width:375px;margin:auto}.stp-preview .tpl-email-frame{width:100%;border:0;background:white}.stp-preview .tpl-sms-bubble img{max-height:none}.stp-preview .tpl-sms-summary{font-size:12px;gap:6px}.stp-preview .tpl-fax-pager{flex-wrap:wrap;font-size:12px}
.stp-empty{grid-column:1/-1;text-align:center;padding:60px 12px;color:#718076;font-size:14px;line-height:1.8}.stp-empty h3{font-size:18px;color:#37493f}.stp-empty-icon{display:inline-grid;place-items:center;width:56px;height:56px;border-radius:16px;background:#e6f1eb;color:#157640;font-size:30px}
.stp-footer{align-items:center;gap:10px}.stp-footer p{margin:0 auto 0 0;font-size:13px;line-height:1.6}.stp-footer small{font-size:12px;color:var(--muted)}
@media(max-width:1000px){.stp-cards{grid-template-columns:1fr}.stp-card{display:grid;grid-template-columns:110px 1fr}.stp-card .tpl-thumb{height:140px;padding:10px}.stp-card-info{justify-content:center}.stp-filters{padding:12px}.stp-cards{padding:8px 12px}.stp-detail{padding:16px}.stp-search{flex-wrap:wrap}.aim-page .stp-search select{width:100%}}
@media(max-width:650px){.stp-layout{grid-template-columns:1fr}.stp-library{max-height:40vh;border-right:0}.stp-footer{flex-wrap:wrap}.stp-footer p{width:100%}.stp-detail{border-top:1px solid var(--line-soft)}}
.stp-cards{grid-auto-rows:max-content;flex:1 1 0}.stp-card{height:max-content;align-self:start}.stp-card-info{min-width:0}
@media(max-width:1000px){.stp-card{min-height:142px;align-items:stretch}.stp-card .tpl-thumb{height:140px}}


@media(max-width:1000px){.aim-page .send-template-picker .stp-card .tpl-thumb-sheet{width:180px;max-width:none;transform:scale(.5);transform-origin:top left}}
@media(max-width:650px){.aim-page .send-template-picker .stp-layout{display:block;overflow:auto}.aim-page .send-template-picker .stp-library{height:320px;max-height:none}.aim-page .send-template-picker .stp-detail{overflow:visible;min-height:300px}}
.workflow-template-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.workflow-template-actions p{margin:0}.workflow-template-actions button{flex-shrink:0}

.aim-page .send-template-picker button:disabled{opacity:.45;cursor:not-allowed}
