/* ─── Template Picker (Main Form) ────────────────────── */
.template-picker-row {
  position: relative;
}

#template-picker-field[hidden] {
  display: none;
}

/* ─── Template Form (Settings) ───────────────────────── */
.template-form {
  margin-bottom: 0;
}

.template-form textarea {
  min-height: 72px;
}

.btn-add-template {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.825rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--success-text);
  background: var(--success-bg);
  border: 1.5px solid var(--success-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}

.btn-add-template:hover {
  background: #d1fae5;
  border-color: #34d399;
}

.btn-add-template:active {
  transform: scale(0.99);
}

/* ─── Templates Divider ──────────────────────────────── */
.templates-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.templates-divider::before,
.templates-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── Templates List ─────────────────────────────────── */
.templates-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.templates-empty {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
}

.templates-empty svg {
  margin-bottom: 8px;
  opacity: 0.4;
}

.templates-empty p {
  font-size: 0.8rem;
  line-height: 1.4;
}

/* ─── Template Card ──────────────────────────────────── */
.template-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  transition: border-color 0.15s;
}

.template-card:hover {
  border-color: #d1d5db;
}

.template-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.template-card-name {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text);
}

.template-card-actions {
  display: flex;
  gap: 4px;
}

.template-card-actions button {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.template-card-actions .btn-edit:hover {
  background: #eff6ff;
  color: #2563eb;
}

.template-card-actions .btn-delete:hover {
  background: var(--error-bg);
  color: var(--error-text);
}

.template-card-body {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 60px;
  overflow: hidden;
}
