#templateDialog{width:min(780px,calc(100vw - 32px));max-height:86svh;padding:24px;border-radius:18px}
#templateDialog .proposal-dialog-header{margin-bottom:18px;align-items:center}#templateDialog .proposal-dialog-header h2{font-size:20px}
.template-library-topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}
.template-library-tabs{display:flex;gap:4px;padding:4px;border-radius:11px;background:#f1f3f6}
.template-library-tabs button{min-width:90px;padding:8px 20px;border:0;border-radius:8px;background:transparent;color:#6c7686;font:inherit;font-size:14px;cursor:pointer}
.template-library-tabs button[aria-selected=true]{background:#fff;color:#2b61d8;font-weight:600;box-shadow:0 2px 6px #1e293b0a}#templateSlotCount{font-size:13px;color:#8390a1}
#templateStyleFilters{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:18px}#templateStyleFilters[hidden],#templateDialog [hidden]{display:none!important}
.template-style-chip{padding:7px 10px;border:1px solid #e5e9ef;border-radius:8px;background:#fff;color:#6c7686;font:inherit;font-size:12px;cursor:pointer}.template-style-chip[aria-pressed=true]{background:#edf3ff;color:#2b61d8;border-color:#cad9fb}
#templateGallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:12px;max-height:52svh;overflow-y:auto;scrollbar-width:thin;padding:2px}
.template-library-card{min-width:0;padding:10px;border:1px solid #e4e8ef;border-radius:12px;background:#fff}.template-library-card.is-current{border-color:#4679e2;box-shadow:0 0 0 1px #4679e2}
.template-library-cover{display:block;width:100%;padding:0;border:0;background:none;text-align:left;cursor:pointer;color:#334155}.template-library-cover strong{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:10px 0 5px;font-size:14px;font-weight:500}
.template-library-media{display:grid;place-items:center;position:relative;aspect-ratio:16/9;overflow:hidden;border-radius:7px;background:#f3f5f8}.template-library-media img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}.template-library-media i{font-size:34px;color:#a0aebf}
.template-library-meta{display:flex;gap:10px;align-items:center;justify-content:space-between;font-size:11px;color:#8a94a3;min-height:20px}.template-library-card-actions{display:flex;gap:8px;margin-top:10px}.template-library-card-actions button{flex:1;height:34px;padding:0 10px;border:0;border-radius:8px;background:#edf3ff;color:#2b61d8;font:inherit;font-size:12px;cursor:pointer}.template-library-card-actions .template-library-delete{flex:0 0 auto;background:#fff;color:#9b6670}
.template-library-empty{grid-column:1/-1;display:grid;place-items:center;min-height:210px;color:#97a1af;font-size:14px}.template-library-footer{display:flex;align-items:center;justify-content:center;margin-top:14px}#templateLibraryStatus:empty{display:none}#templateLibraryStatus{font-size:12px;line-height:1.5;color:#8390a1;margin:12px 0;text-align:center}#templateLibraryStatus.is-error{color:#bd5252}
#proposalEmpty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;min-height:260px;height:100%;color:#94a0b0;background:#f8fafc}#proposalEmpty>i{font-size:48px;color:#bdc7d5}#proposalEmpty button{padding:10px 22px;border:1px solid #dce4f0;border-radius:9px;background:#fff;color:#3564bd;font:inherit;cursor:pointer}#proposalEmpty[hidden]{display:none!important}
body.is-native-ppt #templateSection{display:block}#currentTemplateImage[hidden],#currentTemplatePlaceholder[hidden]{display:none!important}#currentTemplatePlaceholder{display:grid;place-items:center;width:86px;height:54px;border-radius:6px;background:#eef2f7;color:#b0bac8;font-size:25px;flex-shrink:0}
@media(max-width:560px){#templateDialog{padding:18px}.template-library-topbar{gap:10px}#templateGallery{gap:10px}.template-library-card{padding:8px}.template-library-cover strong{font-size:12px}.template-library-tabs button{min-width:74px;padding:8px 14px}.template-library-meta{font-size:10px;align-items:flex-start;flex-direction:column;gap:2px}}
