@import url("messages_preview.css");

.bot-message-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: start;
  gap: 18px;
}
.bot-message-side {
  min-width: 0;
  display: grid;
  gap: 14px;
}
.bot-message-editor { min-width: 0; }
.bot-message-editor [hidden] { display: none; }
.bot-message-editor p { margin: 0; }
.bot-message-editor p:empty { display: none; }
.bot-message-targets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  min-width: 0;
  border: 0;
  margin: 0;
  padding: 0;
}
.bot-message-targets legend {
  padding: 0;
  margin-bottom: 10px;
  font-weight: 700;
}
.bot-message-targets label:last-child { grid-column: 1 / -1; }
.bot-message-targets select { width: 100%; min-width: 0; }
.bot-message-template input, .bot-message-template select { width: 100%; min-width: 0; }
.bot-message-template-paragraph { grid-column: 1 / -1; }
.bot-message-editor select[name="template"] { width: 100%; }
.bot-message-editor textarea { width: 100%; resize: vertical; }
.bot-message-attachment { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bot-message-attachment [data-image-name] { overflow-wrap: anywhere; }
.bot-message-preview-image { display: block; max-width: 100%; max-height: 360px; margin-top: 8px; border-radius: 6px; object-fit: contain; }
.bot-message-preview-image[hidden] { display: none; }
.bot-message-preview [data-preview-embed] .preview-embed-title { white-space: pre-wrap; }
.bot-message-editor .markdown-input { min-width: 0; }
.bot-message-editor .markdown-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}
.bot-message-editor .markdown-toolbar button {
  min-width: 34px;
  min-height: 34px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgb(255 255 255 / .055);
  color: inherit;
  font: inherit;
}
.bot-message-editor .markdown-toolbar button:enabled:hover { background: rgb(255 255 255 / .13); }
.bot-message-editor .markdown-toolbar button:disabled { opacity: .5; }
.bot-message-meta, .bot-message-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}
.bot-message-meta { font-size: .82rem; }
.bot-message-editor .is-error { color: #ffb4b9; }
.bot-message-preview { padding: 16px; min-width: 0; }
.bot-message-preview h2 { margin: 0 0 12px; font-size: 1.05rem; }
.bot-message-discord {
  color-scheme: dark;
  border: 1px solid #393b41;
  border-radius: 8px;
  overflow: hidden;
  color: #dbdee1;
}
.bot-message-preview-channel {
  background: #2b2d31;
  border-bottom: 1px solid #393b41;
  padding: 8px 12px;
  font-size: .85rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.bot-message-preview-channel > span:first-child { color: #a5a9b1; margin-inline-end: 4px; }
.bot-message-discord .discord-message { min-height: 110px; }
.bot-message-avatar {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  color: #fff;
  background: #5865f2;
}
.bot-message-app-badge {
  padding: 1px 4px;
  border-radius: 3px;
  background: #5865f2;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.bot-message-preview-placeholder { color: #b5bac1; }
.bot-message-guide { padding: 14px 16px; }
.bot-message-guide summary { cursor: pointer; font-weight: 650; }
.bot-message-guide dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 6px 12px;
  font-size: .82rem;
}
.bot-message-guide dd { margin: 0; min-width: 0; }
.bot-message-guide code { white-space: pre-wrap; overflow-wrap: anywhere; }
.bot-message-guide a, .bot-message-actions a { color: var(--accent); text-decoration: underline; }

@media (max-width: 1000px) {
  .bot-message-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .bot-message-targets { grid-template-columns: minmax(0, 1fr); }
  .bot-message-guide dl { grid-template-columns: minmax(0, 1fr); }
  .bot-message-guide dd { margin-bottom: 5px; }
}
