.comment-open-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #d7cec6;
  border-radius: 7px;
  background: #fff;
  color: #4e463f;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.comment-open-button:hover,
.comment-open-button:focus-visible {
  border-color: #2b684b;
  color: #245b42;
  outline: none;
}

.comment-open-button svg {
  width: 16px;
  height: 16px;
}

.comment-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #e7f3eb;
  color: #245b42;
  font-size: 11px;
  line-height: 1;
}

.comment-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: rgba(20, 16, 13, 0.46);
}

.comment-thread {
  display: grid;
  width: min(680px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: hidden;
  overscroll-behavior: contain;
  border: 1px solid #ddd4cc;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(30, 23, 18, 0.18);
}

.comment-thread.is-inline {
  width: min(1180px, calc(100% - 36px));
  max-height: none;
  margin: 0 auto 28px;
  box-shadow: none;
}

.comment-thread-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid #eee7e1;
}

.comment-thread-header h2 {
  margin: 3px 0 0;
  font-size: 19px;
  line-height: 1.35;
}

.comment-thread-kicker {
  color: #2f6b4e;
  font-size: 11px;
  font-weight: 900;
}

.comment-close-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid #ded6cf;
  border-radius: 7px;
  background: #fff;
  color: #5d554e;
  cursor: pointer;
}

.comment-close-button svg {
  width: 18px;
  height: 18px;
}

.comment-list {
  min-height: 100px;
  overflow-y: auto;
  padding: 4px 22px;
}

.comment-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  padding: 16px 0;
  border-bottom: 1px solid #f0ebe6;
}

.comment-replies {
  margin-left: 45px;
  padding-left: 14px;
  border-left: 2px solid #e2eee6;
}

.comment-item.is-reply {
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  padding: 13px 0;
}

.comment-item.is-reply .comment-avatar {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.comment-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e7f3eb;
  color: #245b42;
  font-size: 13px;
  font-weight: 900;
}

.comment-body {
  min-width: 0;
}

.comment-body > header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
}

.comment-body > header strong {
  font-size: 13px;
}

.comment-body time,
.comment-edited {
  color: #8b8179;
  font-size: 11px;
}

.comment-body > p {
  margin: 7px 0 0;
  color: #403832;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.comment-item.is-deleted .comment-avatar {
  background: #eeeae6;
  color: #938a83;
}

.comment-body > p.comment-deleted-text {
  color: #91877f;
  font-style: italic;
}

.comment-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.comment-actions button,
.comment-edit-form button,
.comment-reply-form button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #6e655e;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.comment-actions button.is-danger {
  color: #c63f35;
}

.comment-reply-form {
  display: grid;
  gap: 8px;
  margin: 4px 0 6px 45px;
  padding: 13px 14px;
  border-left: 2px solid #b9d5c4;
  background: #f7faf8;
}

.comment-reply-form label {
  color: #466455;
  font-size: 12px;
  font-weight: 900;
}

.comment-state {
  margin: 0;
  padding: 34px 0;
  color: #81776f;
  font-size: 13px;
  text-align: center;
}

.comment-state.is-error {
  color: #b7352d;
}

.comment-composer {
  display: grid;
  gap: 8px;
  padding: 16px 22px 20px;
  border-top: 1px solid #eee7e1;
  background: #fbf9f7;
}

.comment-composer label {
  font-size: 12px;
  font-weight: 900;
}

.comment-composer textarea,
.comment-edit-form textarea,
.comment-reply-form textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  padding: 12px 13px;
  border: 1px solid #d9d0c8;
  border-radius: 7px;
  background: #fff;
  color: #29231f;
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
}

.comment-composer textarea:focus,
.comment-edit-form textarea:focus,
.comment-reply-form textarea:focus {
  border-color: #2f6b4e;
  outline: 2px solid rgba(47, 107, 78, 0.12);
}

.comment-composer > div,
.comment-edit-form > div,
.comment-reply-form > div {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.comment-composer span {
  margin-right: auto;
  color: #8b8179;
  font-size: 11px;
}

.comment-composer button,
.comment-edit-form button.is-primary,
.comment-reply-form button.is-primary {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  background: #245b42;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.comment-edit-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

@media (max-width: 680px) {
  .comment-backdrop {
    align-items: end;
    padding: 0;
  }

  .comment-thread:not(.is-inline) {
    width: 100%;
    max-height: 88vh;
    border-radius: 8px 8px 0 0;
  }

  .comment-thread.is-inline {
    width: calc(100% - 24px);
  }

  .comment-thread-header,
  .comment-list,
  .comment-composer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .comment-replies,
  .comment-reply-form {
    margin-left: 18px;
  }

  .comment-replies {
    padding-left: 10px;
  }
}
