#templatesDialog{width:min(980px,calc(100vw - 24px));height:min(760px,calc(100dvh - 24px));padding:0;border:0;border-radius:16px}.templates-content{padding:22px;height:100%;display:grid;grid-template-rows:auto auto auto minmax(0,1fr);gap:16px;min-width:0}.template-library-controls{display:flex;gap:12px;align-items:center;min-width:0}.template-library-controls>input{width:min(300px,100%);padding:10px 12px;border:1px solid var(--line);border-radius:9px}.template-categories{display:flex;gap:6px;overflow-x:auto;padding-bottom:2px;min-width:0}.template-categories button{white-space:nowrap;padding:7px 11px}.template-categories button.active{background:var(--primary);border-color:var(--primary);color:#fff}.editor-template-grid{overflow:auto;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;padding:2px}.editor-template-card{display:block;padding:0;text-align:left;overflow:hidden;border-radius:12px}.editor-template-preview{height:180px;background:linear-gradient(145deg,var(--c1),var(--c2));display:flex;flex-direction:column;justify-content:flex-end;align-items:flex-start;padding:18px;color:#fff;position:relative}
.editor-template-preview img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.editor-template-preview.no-thumb{background:linear-gradient(145deg,#8a8f9c,#5b6270)}
.editor-template-community-badge{position:absolute;top:10px;left:10px;background:#ffffffe0;color:#172033;font-size:10px;font-weight:700;padding:3px 8px;border-radius:20px;letter-spacing:.4px;z-index:1}
.editor-template-uses{position:relative;z-index:1}.editor-template-preview i{position:absolute;width:90px;height:90px;border-radius:50%;right:-15px;top:18px;background:#ffffff35}.editor-template-preview strong{font-size:24px;line-height:.95;text-transform:uppercase;max-width:80%;position:relative}.editor-template-preview small{margin-top:8px;position:relative}.editor-template-meta{display:grid;padding:11px;background:#fff}.editor-template-meta small{color:var(--muted);margin-top:2px}@media(max-width:820px){.editor-template-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.template-library-controls{align-items:stretch;flex-direction:column}.template-library-controls>input{width:100%;max-width:none}}@media(max-width:560px){.templates-content{padding:15px}.editor-template-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.editor-template-preview{height:150px;padding:13px}.editor-template-preview strong{font-size:19px}}
