.rich-text-editor {
  width: 100%;
  min-width: 0;
}

.rich-text-toolbar {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.35rem;
  overflow-x: auto;
}

.rich-format-btn {
  min-width: 31px;
  height: 29px;
  padding: 0 0.45rem;
  border: 1px solid #cbd9e6;
  border-radius: 7px;
  background: #f3f8fc;
  color: #315f87;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.rich-format-btn:hover,
.rich-format-btn:focus-visible {
  background: #e0effc;
  border-color: #86afd4;
}

.rich-format-btn.bold {
  font-weight: 800;
}

.rich-format-btn.italic {
  font-style: italic;
}

.rich-format-btn.strike {
  text-decoration: line-through;
}

.rich-format-btn.code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.78rem;
}

.rich-textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  max-height: 240px;
  resize: none;
  overflow-y: auto;
  line-height: 1.65;
  white-space: pre-wrap;
}

.rich-text-editor.compact {
  flex: 1;
}

.rich-text-editor.compact .rich-textarea {
  max-height: 150px;
}

.rich-rendered-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.75;
}

.rich-rendered-text code {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  padding: 0.08rem 0.3rem;
  border-radius: 4px;
  background: rgba(20, 45, 70, 0.1);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.9em;
}

.message-list-bullet {
  display: inline-block;
  margin-left: 0.4rem;
  font-weight: 700;
}

@media (max-width: 760px) {
  .rich-textarea {
    max-height: 180px;
  }
}
