:root {
  --cta: #6C63FF;
}

.comment-modal__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 5000;
}

.comment-modal__overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.comment-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 5001;
}

.comment-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.comment-modal__box {
  width: min(92vw, 720px);
  max-height: 80vh;
  background: #0f0f10;
  border: 1px solid var(--side-border, rgba(255,255,255,.06));
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.comment-modal__header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--side-border, rgba(255,255,255,.06));
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comment-modal__title {
  margin: 0;
  font-size: 1rem;
  color: var(--text, #e7e7e7);
}

.comment-modal__close {
  background: none;
  border: none;
  color: var(--text, #e7e7e7);
  font-size: 1.4rem;
  cursor: pointer;
}

.comment-modal__body {
  flex: 1;
  overflow: auto;
  padding: 18px;
  color: var(--text, #e7e7e7);
}

.comments-list .comment-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--side-border, rgba(255,255,255,.06));
}

.comment-item__left {
  padding-top: 4px
}

.comment-item__avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.04);
  background: #0b0b0b;
  display: block;
  overflow: hidden;
  flex-shrink: 0;
}

.comment-item__author {
  color: var(--color-user-creator, #D9DBF1);
}

.comment-item__date {
  color: var(--muted, #a4a7b0);
  font-size: .82rem;
  margin-left: 8px;
}

.comments-empty {
  color: var(--muted, #a4a7b0);
}

.comment-form {
  display: block;
  margin-bottom: 14px;
}

.comment-form__row {
  display: grid;
  gap: 12px;
}

.comment-form textarea {
  width: 100%;
  min-height: 88px;
  border-radius: 12px;
  border: 1px solid var(--side-border, rgba(255,255,255,.06));
  background: #0b0b0b;
  color: var(--text, #e7e7e7);
  padding: 12px 14px;
  resize: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.01);
}


.comment-form__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.comment-item__main {
  position: relative
}

.comment-item__content {
  margin: 6px 0 0 0;
  color: var(--text, #e7e7e7);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-item__content.collapsed {}

.comment-toggle {
  margin-top: 10px;
  display: inline-block;
  background: transparent;
  border: none;
  color: var(--muted, #a4a7b0);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  font-weight: 600;
}

.comment-toggle:hover {
  color: var(--text, #e7e7e7);
  background: rgba(255,255,255,.02)
}

.comment-form__submit {
  align-self: start;
  padding: 10px 18px;
  border-radius: 12px;
  border: none;
  color: #fff;
  background: linear-gradient(135deg, #6b5cff, #8e7aff);
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(107,92,255,.12);
}

.comment-form__submit:disabled {
  opacity: .7;
  cursor: default;
}

.comment-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.comment-item__meta {
  display: flex;
  flex-direction: column;
}

.comment-delete-form {
  margin: 0;
  display: inline-block;
}

.comment-delete-btn {
  background: none;
  border: none;
  color: var(--muted, #a4a7b0);
  cursor: pointer;
  padding: 4px;
  line-height: 0;
  transition: color .2s ease, transform .2s ease;
}

.comment-delete-btn svg {
  width: 18px;
  height: 18px;
  color: currentColor; 
  display: block;
}

.comment-delete-btn:hover {
  color: #e74c3c;
  transform: scale(1.06);
}

.comment-form .btn--primary,
.comment-form .btn--primary:focus,
.comment-form .btn--primary:hover,
.comment-form .btn--primary:active {
  box-shadow: none !important;
  filter: none !important;
  outline: none;
  border: none;
  background-color: var(--cta);
  padding: 10px;
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
}

body.modal-open {
  overflow: hidden;
  touch-action: none;
}

@media (max-width: 800px) {
  .comment-modal__box {
    width: min(96vw, 720px);
    max-height: 84vh;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .comment-modal__box {
    max-height: 88vh;
  }
}

.comment-modal__close {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
  line-height: 0;
  color: var(--text, #e7e7e7);
}

.comment-modal__close svg {
  width: 22px;
  height: 22px;
  display: block;
}
