.community-comments {
  position: relative;
  max-width: 368px;
  width: 100%;
  margin: 10px auto 26px;
  display: flex;
  justify-content: flex-start;
  text-align: left;
  z-index: 20;
}

.community-comments * {
  box-sizing: border-box;
}

.community-comments button,
.community-comments input,
.community-comments textarea {
  font: inherit;
}

.community-comments .comments-trigger {
  width: auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #f5f5f5;
  box-shadow: none;
  font-size: 12px;
  line-height: 1;
}

/* Ukuran ikon diubah menjadi 20px */
.comments-icon {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: contain;
}

/* Ukuran slot/pembungkus ikon juga disesuaikan menjadi 20px */
.comments-icon-slot {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.comments-count {
  min-width: 8px;
  color: rgba(250, 204, 21, 0.78);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.comments-panel {
  position: absolute;
  top: 34px;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 800px);
  max-height: min(82vh, 760px);
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgba(9, 9, 9, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}

.comments-panel[hidden],
.comments-form[hidden] {
  display: none;
}

.comments-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.comments-panel-head p {
  margin: 0;
  color: #f5f5f5;
  font-size: 15px;
  font-weight: 650;
}

.community-comments .comments-close {
  width: auto;
  height: auto;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #8f8f8f;
  box-shadow: none;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
}

.comments-list {
  display: grid;
  gap: 16px;
  flex: 1 1 auto;
  min-height: 120px;
  max-height: min(58vh, 560px);
  overflow: auto;
  padding: 2px 8px 2px 0;
  scrollbar-color: rgba(250, 204, 21, 0.34) rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.comments-panel:has(.comments-form:not([hidden])) .comments-list {
  min-height: 0;
  max-height: min(18vh, 150px);
}

.comments-empty,
.comments-loading,
.comments-error {
  margin: 8px 0 4px;
  color: #8f8f8f;
  font-size: 12px;
  line-height: 1.6;
}

.comment-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.comment-item:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}

.comment-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.11);
  color: rgba(250, 204, 21, 0.86);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.comment-body {
  min-width: 0;
}

.comment-name {
  margin: 0 0 4px;
  color: #f2f2f2;
  font-size: 13px;
  font-weight: 650;
}

.comment-message {
  margin: 0 0 6px;
  color: #d4d4d4;
  font-size: 13px;
  line-height: 1.58;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment-time {
  margin: 0;
  color: #6f6f6f;
  font-size: 11px;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 9px;
  flex-wrap: wrap;
}

.community-comments .comment-reply-toggle {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #facc15;
  font-size: 12px;
  font-weight: 650;
}

.community-comments .comment-replies-toggle {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d7b417;
  font-size: 12px;
  font-weight: 650;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.comment-replies-arrow {
  display: inline-block;
  color: #8f8f8f;
  font-size: 13px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 160ms ease, color 160ms ease;
}

.community-comments .comment-replies-toggle[aria-expanded="true"] .comment-replies-arrow {
  transform: rotate(180deg);
}

.community-comments .comment-replies-toggle:hover .comment-replies-arrow {
  color: #d7b417;
}

.comment-replies {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 0 0 14px;
  border-left: 2px solid rgba(250, 204, 21, 0.14);
}

.comment-replies[hidden] {
  display: none;
}

.comment-replies .comment-item {
  margin-left: 0;
  padding: 11px 12px;
  border-bottom: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.comment-replies .comment-avatar {
  width: 30px;
  height: 30px;
}

.comment-replies .comment-name {
  font-size: 12px;
}

.comment-replies .comment-message {
  font-size: 12px;
}

.comment-reply-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.comment-reply-form[hidden] {
  display: none;
}

.community-comments .comment-reply-form input,
.community-comments .comment-reply-form textarea {
  width: 100%;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: #f5f5f5;
  color: #111;
  font-size: 12px;
  text-align: left;
}

.comment-reply-form textarea {
  min-height: 70px;
  resize: vertical;
}

.comment-reply-actions {
  display: flex;
  justify-content: flex-end;
}

.community-comments .comment-reply-actions button {
  width: auto;
  min-width: 68px;
  padding: 8px 12px;
  color: #000;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.community-comments .comment-reply-actions button:disabled {
  color: #000;
  opacity: 0.82;
}

.comment-reply-status {
  margin: 0;
  color: #8f8f8f;
  font-size: 11px;
  line-height: 1.4;
}

.comment-reply-status:empty {
  display: none;
}

.comment-reply-status.is-success {
  color: #22c55e;
}

.comment-reply-status.is-error {
  color: #ef4444;
}

.comments-compose {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  background: rgba(9, 9, 9, 0.98);
}

.community-comments .comments-compose-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #facc15;
  font-size: 13px;
  font-weight: 650;
}

.comments-compose-arrow {
  display: inline-block;
  color: #d7b417;
  font-size: 15px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 160ms ease, color 160ms ease;
  flex: 0 0 auto;
}

.community-comments .comments-compose-toggle[aria-expanded="true"] .comments-compose-arrow {
  transform: rotate(180deg);
}

.community-comments .comments-compose-toggle:hover .comments-compose-arrow {
  color: #facc15;
}

.comments-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-bottom: 2px;
}

.comments-form label {
  display: grid;
  gap: 5px;
}

.comments-form span {
  color: #e5e5e5;
  font-size: 12px;
  font-weight: 600;
}

.comments-form small,
.comments-form em {
  color: #858585;
  font-size: 10px;
  font-style: normal;
}

.community-comments .comments-form input,
.community-comments .comments-form textarea {
  width: 100%;
  margin: 0;
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: #f5f5f5;
  color: #111;
  font-size: 13px;
  text-align: left;
  outline: none;
}

.comments-form textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.45;
}

.community-comments .comments-send {
  justify-self: end;
  width: auto;
  min-width: 78px;
  max-width: 100%;
  padding: 10px 16px;
  color: #000;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
}

.community-comments .comments-send:disabled {
  color: #000;
  opacity: 0.82;
}

.community-comments .comments-send span,
.community-comments .comment-reply-actions button span {
  color: #000;
}

.comments-button-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(0, 0, 0, 0.24);
  border-top-color: #000;
  border-radius: 999px;
  animation: comments-spin 680ms linear infinite;
  flex: 0 0 auto;
}

@keyframes comments-spin {
  to {
    transform: rotate(360deg);
  }
}

.comments-form-status {
  margin: 0;
  color: #8f8f8f;
  font-size: 11px;
  line-height: 1.45;
}

.comments-form-status:empty {
  display: none;
}

.comments-form-status.is-success {
  color: #22c55e;
}

.comments-form-status.is-error {
  color: #ef4444;
}

@media (min-width: 760px) {
  .comments-panel {
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 759px) {
  .community-comments {
    max-width: 368px;
    margin: 8px auto 24px;
  }

  .comments-panel {
    left: 0;
    transform: none;
    width: 100%;
    max-height: min(86vh, 680px);
    padding: 14px;
  }

  .comments-panel-head {
    margin-bottom: 12px;
  }

  .comments-panel-head p {
    font-size: 13px;
  }

  .comments-list {
    gap: 14px;
    max-height: min(56vh, 430px);
  }

  .comments-panel:has(.comments-form:not([hidden])) .comments-list {
    max-height: min(14vh, 96px);
  }

  .comment-item {
    grid-template-columns: 26px 1fr;
    gap: 9px;
    padding-bottom: 12px;
  }

  .comment-avatar {
    width: 26px;
    height: 26px;
    font-size: 9px;
    font-weight: 600;
  }

  .comment-name,
  .comment-message {
    font-size: 12px;
  }

  .comment-time {
    font-size: 10px;
  }

  .comment-replies {
    gap: 10px;
    margin-top: 11px;
    padding: 10px 0 0 10px;
    border-left-width: 1px;
  }

  .comment-replies .comment-item {
    padding: 9px;
  }

  .community-comments .comments-form input,
  .community-comments .comments-form textarea,
  .community-comments .comments-send {
    font-size: 12px;
  }

  .comments-form {
    gap: 7px;
    margin-top: 10px;
    padding-bottom: 0;
  }

  .comments-compose {
    margin-top: 12px;
    padding-top: 12px;
  }

  .community-comments .comments-form input,
  .community-comments .comments-form textarea {
    padding: 9px 10px;
  }

  .comments-form textarea {
    min-height: 74px;
  }

  .community-comments .comments-send {
    padding: 9px 14px;
  }
}
