.template-dialog{width:min(920px,94vw);max-height:88dvh;border:1px solid var(--border-hi,#5c626e);border-radius:16px;padding:0;background:var(--surface,#171b24);color:var(--text,#ecedf2);font-family:CRDBSymbols,var(--font-body,sans-serif);box-shadow:0 25px 120px #0008}.template-dialog::backdrop{background:#0009;backdrop-filter:blur(6px)}.template-dialog>header{display:flex;align-items:center;justify-content:space-between;padding:22px 24px;border-bottom:1px solid var(--border,#555);position:sticky;top:0;background:var(--surface,#171b24);z-index:1}.template-dialog h2{font-size:21px;margin:4px 0}.template-dialog header small{letter-spacing:.2em;color:var(--accent,#d7b575);font-size:10px}.template-dialog header button{width:36px;height:36px;background:transparent;color:inherit;border:1px solid var(--border-hi,#666);border-radius:8px;font-size:24px;cursor:pointer}.template-body{padding:18px 24px 28px}.template-body p{font-size:12px;line-height:1.8;color:var(--text-muted,#aeb5c6)}.template-body h3{font-size:15px}.template-note{font-size:11px!important}.template-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:16px 0 28px}.template-card{border:1px solid var(--border,#555);border-radius:10px;padding:14px;min-width:0}.template-card-title{display:flex;align-items:center;justify-content:space-between;gap:8px}.template-card-title h3{font-size:13px;margin:0}.template-card-title>span{font-size:10px;color:var(--text-muted,#aeb5c6);white-space:nowrap}.template-cards{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:2px;margin:14px 0}.template-cards img{width:100%;height:auto}.template-card-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:10px}.template-card-actions a{color:var(--text,#eaeaf2);text-decoration:none}.template-card-actions a:first-child{padding:8px 10px;border:1px solid var(--border-hi,#666);border-radius:6px}.template-card-actions a:hover{color:var(--accent,#d7b575)}.template-empty{padding:20px;border:1px dashed var(--border-hi,#777);border-radius:8px;font-size:13px;line-height:1.7}#templateLibrary{font:inherit;font-size:11px;color:var(--text,#eee);background:var(--surface2,#252a36);border:1px solid var(--border-hi,#666);border-radius:7px;padding:8px 10px;cursor:pointer;white-space:nowrap}@media(max-width:720px){.template-grid{grid-template-columns:1fr}.template-dialog>header,.template-body{padding:16px}#templateLibrary{padding:7px;font-size:10px}}

.template-body p{color:#b7bfcd}html.light .template-body p{color:#596477}
