.comments-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-left: 1px solid var(--color-line);
  background: var(--color-surface);
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 10px 12px 10px 14px;
  gap: 12px;
  background: var(--gradient-brand);
  color: #fff;
}

.comments-heading {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.comments-heading > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.comments-heading strong {
  font-size: 13px;
  line-height: 1.2;
}

.comments-heading small {
  margin-top: 2px;
  color: rgb(255 255 255 / 72%);
  font-size: 10px;
}

.comments-heading-icon,
.comments-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 50%;
  background: rgb(255 255 255 / 12%);
  color: #fff;
  place-items: center;
}

.comments-heading-icon .control-icon,
.comments-close .control-icon {
  width: 17px;
  height: 17px;
}

.comments-close {
  padding: 0;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.comments-close:hover {
  transform: scale(1.05);
  background: rgb(255 255 255 / 22%);
}

.comments-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.comments-sort {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 7px 12px;
  gap: 10px;
  border-bottom: 1px solid #f0d0e0;
  background: var(--color-brand-soft);
  color: var(--color-brand);
  font-size: 11px;
}

.comments-sort > span {
  color: var(--color-muted);
}

.comments-sort button {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid rgb(201 0 107 / 16%);
  border-radius: 7px;
  gap: 5px;
  background: var(--color-surface);
  color: var(--color-brand);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.comments-sort button .control-icon {
  width: 13px;
  height: 13px;
}

.comments-sort button:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.comment-list {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}

.comment {
  display: flex;
  align-items: flex-start;
  margin-bottom: 8px;
  padding: 10px;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--color-surface-muted);
}

.comment-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #fff;
  font-size: 11px;
  place-items: center;
}

.comment strong {
  color: var(--color-brand);
  font-size: 10px;
}

.comment p {
  margin: 3px 0;
  color: var(--color-text-soft);
  font-size: 12px;
}

.comment small {
  color: var(--color-faint);
  font-size: 10px;
}

.comment-form {
  display: flex;
  align-items: center;
  min-height: 68px;
  padding: 12px 14px;
  gap: 8px;
  border-top: 1px solid var(--color-line);
  background: var(--color-surface);
}

.comment-form input {
  width: 100%;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  outline: 0;
  background: var(--color-bg);
  color: var(--color-text);
}

.comment-form input:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgb(201 0 107 / 10%);
}

.comment-submit {
  flex: 0 0 auto;
}

.comment-submit .control-icon {
  width: 17px;
  height: 17px;
}

@media (max-width: 767px) {
  .comments-panel {
    min-height: 420px;
    border-top: 1px solid var(--color-line);
    border-left: 0;
  }
}
