.message-macros,
.tpl-macros {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.message-macros {
  margin-top: 8px;
}

.chat-message-macros {
  margin: 7px 0 0;
}

.message-macro-chip,
.tpl-macro {
  appearance: none;
  min-height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #f8fafc;
  color: #334155;
  padding: 5px 9px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.message-macro-chip:hover,
.tpl-macro:hover {
  border-color: #818cf8;
  background: #eef2ff;
  color: #4338ca;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.16);
  transform: translateY(-1px);
}

.message-macro-chip:focus-visible,
.tpl-macro:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
  border-color: #6366f1;
}

.message-macro-chip:active,
.tpl-macro:active {
  transform: translateY(0);
  box-shadow: none;
}

.message-macro-chip.is-copied,
.tpl-macro.is-copied {
  border-color: #22c55e;
  background: #ecfdf5;
  color: #15803d;
}

html.dark-theme .message-macro-chip,
html.dark-theme .tpl-macro {
  border-color: #475569;
  background: #1e293b;
  color: #e2e8f0;
}

html.dark-theme .message-macro-chip:hover,
html.dark-theme .tpl-macro:hover {
  border-color: #a5b4fc;
  background: #312e81;
  color: #eef2ff;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.3);
}

html.dark-theme .message-macro-chip.is-copied,
html.dark-theme .tpl-macro.is-copied {
  border-color: #4ade80;
  background: #14532d;
  color: #dcfce7;
}
