.tpl-channels { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tpl-channel { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); white-space: nowrap; }
.tpl-channel b { font-weight: 600; font-size: 11.5px; color: var(--muted); }
.tpl-channel.on { background: var(--success-50); border-color: transparent; color: var(--success); }
.tpl-channel.on b { color: var(--success); }

.tpl-event { margin-bottom: 26px; }
.tpl-event > header h5 { margin: 0 0 2px; font-size: 16px; }
.tpl-event > header p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.tpl-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.tpl-card.is-off { opacity: .65; }
.tpl-card-top { display: flex; align-items: flex-start; gap: 10px; }
.tpl-card-title { flex: 1; min-width: 0; }
.tpl-card-title strong { display: block; font-size: 14px; }
.tpl-card-title small { display: block; color: var(--muted); font-size: 12px; }
.tpl-snippet { margin: 0; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 128px; overflow: hidden; color: var(--text-2); }
.tpl-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.tpl-panel { width: min(760px, 100vw); }
.tpl-editor { display: flex; flex-direction: column; gap: 16px; }
.tpl-switches { display: flex; flex-wrap: wrap; gap: 18px; }
.tpl-switches .form-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; }
.tpl-body { font-size: 12.5px; line-height: 1.55; min-height: 220px; }
.tpl-count { font-size: 12px; color: var(--muted); font-weight: 400; }
.tpl-count.over { color: var(--danger); font-weight: 600; }
.tpl-vars { display: flex; flex-wrap: wrap; gap: 6px; }
.tpl-var { border: 1px solid var(--border); background: var(--surface); color: var(--primary-700); border-radius: 8px; padding: 3px 9px; font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; cursor: pointer; }
.tpl-var:hover { background: var(--primary-50); border-color: var(--primary-100); }

.tpl-preview-box { border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: var(--bg); }
.tpl-preview-box .form-select { width: auto; min-width: 130px; }
.tpl-warn { background: var(--warning-50); color: #92400e; border-radius: 10px; padding: 8px 12px; font-size: 12.5px; margin-bottom: 10px; display: grid; gap: 4px; }
.tpl-bubble { max-width: 440px; border-radius: 14px; padding: 10px 12px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
.tpl-bubble.telegram { background: #fff; color: #0f172a; }
.tpl-bubble.telegram img { display: block; width: 100%; max-height: 260px; object-fit: cover; border-radius: 10px; margin-bottom: 8px; }
.tpl-bubble.whatsapp { background: #dcf8c6; color: #0f172a; }
.tpl-bubble code, .tpl-bubble pre { background: rgba(15, 23, 42, .06); border-radius: 4px; padding: 0 3px; }
.tpl-email-subject { background: var(--surface); border: 1px solid var(--border); border-radius: 10px 10px 0 0; padding: 8px 12px; font-size: 13px; }
.tpl-email-subject small { display: block; color: var(--muted); font-size: 11px; }
.tpl-email { width: 100%; height: 460px; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 10px 10px; background: #fff; }
