.comments-section {
  margin: 2.5rem 0 1rem;
  padding-top: 0.5rem;
  max-width: 100%;
  min-width: 0;
}

.comments-section__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.comments-section__header-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.85rem;
  min-width: 0;
}

.comments-section__header-main > * {
  min-width: 0;
}

.comments-section__title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.comments-section__count {
  margin: 0;
  color: #6b7280;
  font-size: 0.95rem;
}

.comments-section__sort {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.comments-section__sort-label {
  float: none;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font: inherit;
  line-height: inherit;
}

.comments-section__sort-select {
  min-height: 2rem;
  padding: 0.2rem 0.8rem;
  border: 1px solid #d7dce6;
  border-radius: 999px;
  background: #fff;
  color: #1f2937;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.2;
  box-shadow: none;
  appearance: auto;
}

.comments-section__sort-select:hover {
  border-color: #c3ccda;
}

.comments-section__sort-select:focus {
  outline: 2px solid rgba(17, 87, 170, 0.18);
  outline-offset: 2px;
  border-color: #aebfe0;
}

.comments-section__empty {
  margin: 0;
  padding: 1rem 0;
  color: #5c6470;
  font-size: 1rem;
}

.comments-composer {
  margin-bottom: 1rem;
}

.comments-composer__form {
  display: grid;
  gap: 0.75rem;
}

.comments-composer__input {
  width: 100%;
  min-height: 7rem;
  padding: 0.85rem 1rem;
  border: 1px solid #d7dce6;
  border-radius: 0.9rem;
  background: #fff;
  color: #1f2937;
  font: inherit;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
}

.comments-composer__input:focus {
  outline: 2px solid rgba(17, 87, 170, 0.18);
  outline-offset: 2px;
  border-color: #aebfe0;
}

.comments-composer__actions {
  display: flex;
  justify-content: flex-end;
}

.comments-composer__submit,
.comments-composer__gate-button,
.comments-composer__gate-link {
  float: unset;
  margin: 0;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.comments-composer__submit,
.comments-composer__gate-button {
  border: 1px solid #c9d6ea;
  background: #fff;
  color: var(--highlight-color);
}

.comments-composer__submit:hover:not(:disabled),
.comments-composer__gate-button:hover {
  background: #f6f9ff;
  border-color: #aebfe0;
}

.comments-composer__submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.comments-composer__status {
  margin: 0;
  font-size: 0.95rem;
}

.comments-composer__status[data-status-type="error"] {
  color: #b42318;
}

.comments-composer__status[data-status-type="success"] {
  color: #0f766e;
}

.comments-composer__gate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid #d7dce6;
  border-radius: 0.9rem;
  background: #f8fafc;
}

.comments-composer__gate--warning {
  background: #fffbeb;
  border-color: #f5d68a;
}

.comments-composer__gate-text {
  margin: 0;
  color: #27303b;
}

.comments-composer__gate-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid #c9d6ea;
  background: #fff;
  color: var(--highlight-color);
  text-decoration: none;
}

.comments-composer__gate-link:hover {
  background: #f6f9ff;
  border-color: #aebfe0;
}

.comments-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 100%;
  min-width: 0;
}

.comments-list__item + .comments-list__item {
  border-top: 1px solid #e7e9ee;
}

.comment {
  padding: 1rem 0;
  width: auto;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font-size: inherit;
  line-height: inherit;
}

.comment__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 0.45rem;
  min-width: 0;
  max-width: 100%;
}

.comment__meta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.5rem 0.75rem;
  min-width: 0;
}

.comment__author {
  color: #1f2937;
  font-size: 0.96rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.comment__byline {
  color: #6b7280;
}

.comment__username {
  font-weight: 600;
}

.comment__time {
  color: #6b7280;
  font-size: 0.9rem;
  white-space: nowrap;
  max-width: 100%;
}

.comment__report-button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: #667085;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  text-decoration-color: #cbd5e1;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}

.comment__report-button:hover:not(:disabled) {
  color: #7a263a;
  text-decoration-color: currentColor;
}

.comment__report-button:focus-visible {
  color: #7a263a;
  text-decoration-color: currentColor;
}

.comment__report-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.comment__report-button.is-reported {
  color: #475467;
  cursor: default;
  text-decoration: none;
}

.comment__body p {
  margin: 0;
  color: #27303b;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comments-section__actions {
  margin-top: 1rem;
}

.comments-section__load-more {
  float: unset;
  margin: 0;
  background: #fff;
  color: var(--highlight-color);
  border: 1px solid #c9d6ea;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.comments-section__load-more:hover:not(:disabled) {
  background: #f6f9ff;
  border-color: #aebfe0;
}

.comments-section__load-more:disabled {
  opacity: 0.7;
  cursor: wait;
}

.comments-section__load-error {
  margin: 0.75rem 0 0;
  color: #b42318;
  font-size: 0.95rem;
}

.hidden {
  display: none;
}

@media (max-width: 640px) {
  .comments-section {
    margin-top: 2rem;
  }

  .comments-section__header,
  .comments-section__header-main,
  .comment__meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .comment__meta-actions {
    justify-content: flex-start;
  }

  .comments-section__sort {
    margin-left: 0;
  }

  .comments-composer__actions {
    justify-content: flex-start;
  }

  .comment__time {
    white-space: normal;
  }
}
