.pc-reply-editor {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.pc-reply-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.pc-reply-editor-tool {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
}

.pc-reply-editor-tool:hover,
.pc-reply-editor-tool:focus-visible {
  border-color: var(--border);
  background: var(--surface);
  color: var(--foreground);
  outline: 0;
}

.pc-reply-editor-tool:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.pc-reply-editor-input-wrap {
  display: grid;
  position: relative;
  min-width: 0;
}

.pc-reply-editor-highlights,
.pc-reply-editor-input {
  grid-area: 1 / 1;
  width: 100%;
  min-height: 86px;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: var(--fs-sm);
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.pc-reply-editor-highlights {
  pointer-events: none;
  overflow: hidden;
  background: var(--background);
  color: var(--foreground);
}

.pc-reply-editor-highlight-content {
  min-height: 100%;
}

.pc-reply-editor-input {
  position: relative;
  z-index: 1;
  resize: none;
  background: transparent;
  color: var(--foreground);
  outline: 0;
}

.pc-reply-editor-input.has-markdown-highlights {
  border-color: transparent;
  color: transparent;
  caret-color: var(--foreground);
}

.pc-reply-editor-input.has-markdown-highlights::placeholder {
  color: var(--muted-foreground);
}

.pc-reply-editor-input.has-markdown-highlights::selection {
  background: color-mix(in srgb, var(--primary) 24%, transparent);
  color: transparent;
}

.pc-reply-editor-input:not(.has-markdown-highlights):focus,
.pc-reply-editor-input-wrap:focus-within .pc-reply-editor-highlights {
  border-color: var(--border);
  box-shadow: none;
}

.pc-reply-editor-input:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.pc-reply-editor-mention-menu {
  position: absolute;
  z-index: 8;
  top: calc(100% - 2px);
  right: 8px;
  left: 8px;
  display: grid;
  gap: 2px;
  max-height: 236px;
  padding: 6px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--background);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--foreground) 14%, transparent);
}

.pc-reply-editor-mention-menu[hidden] {
  display: none;
}

.pc-reply-editor-mention-option {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--foreground);
  text-align: left;
  cursor: pointer;
}

.pc-reply-editor-mention-option:hover,
.pc-reply-editor-mention-option.is-active {
  background: var(--surface);
}

.pc-reply-editor-mention-avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted-foreground);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.pc-reply-editor-mention-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pc-reply-editor-mention-copy,
.pc-reply-editor-mention-name,
.pc-reply-editor-mention-meta {
  min-width: 0;
}

.pc-reply-editor-mention-copy {
  display: grid;
  gap: 1px;
}

.pc-reply-editor-mention-name {
  overflow: hidden;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: var(--lh-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-reply-editor-mention-meta {
  display: flex;
  gap: 8px;
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  white-space: nowrap;
}

.pc-reply-editor-input-wrap.is-disabled .pc-reply-editor-highlights {
  opacity: 0.7;
}

.pc-reply-md-marker {
  color: var(--muted-foreground);
}

.pc-reply-md-strong {
  color: var(--foreground);
  text-shadow: 0.035em 0 0 currentColor;
}

.pc-reply-md-em {
  color: var(--foreground);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--foreground) 46%, transparent);
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.pc-reply-md-code {
  border-radius: 4px;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  color: var(--foreground);
}

.pc-reply-md-link {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pc-reply-md-quote-marker,
.pc-reply-md-quote-text {
  color: var(--muted-foreground);
}

.pc-reply-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.pc-reply-editor-counter {
  min-width: 0;
  color: var(--muted-foreground);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
}

.pc-reply-content {
  color: var(--foreground);
  font-size: var(--fs-sm);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.pc-reply-content > :first-child {
  margin-top: 0;
}

.pc-reply-content > :last-child {
  margin-bottom: 0;
}

.pc-reply-content p,
.pc-reply-content blockquote {
  margin: 0 0 10px;
}

.pc-reply-content blockquote {
  padding: 8px 12px;
  border-left: 3px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted-foreground);
}

.pc-reply-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pc-reply-content code {
  padding: 0.08em 0.28em;
  border-radius: 6px;
  background: var(--surface);
  font-family: ui-monospace, SFMono-Regular, Consolas, Liberation Mono, monospace;
  font-size: 0.92em;
}

@media (max-width: 520px) {
  .pc-reply-editor-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .pc-reply-editor-submit {
    width: 100%;
  }
}
