.comment-section {
  margin-top: 48px;
}

.comment-section h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 28px;
  margin: 0 0 12px;
}

.comment-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.comment-form {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
  background: var(--card);
  border: 1px solid rgba(47, 123, 255, 0.15);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 14px 30px rgba(16, 33, 64, 0.08);
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 123, 255, 0.12);
}

.comment-form input::placeholder,
.comment-form textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

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

.comment-form .challenge-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.comment-form .challenge-row input[type="text"] {
  width: auto;
  max-width: 80px;
}

.comment-form label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.comment-form button[type="submit"] {
  justify-self: start;
  padding: 12px 24px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(47, 123, 255, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}

.comment-form button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(47, 123, 255, 0.35);
}

.comment-form button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.comment-hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.comment-reply-note {
  padding: 10px 14px;
  background: rgba(47, 123, 255, 0.08);
  border-radius: 10px;
  color: var(--ink);
}

.comment-reply-cancel {
  margin-left: 12px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(47, 123, 255, 0.3);
  background: var(--card);
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.comment-reply-cancel:hover {
  background: rgba(47, 123, 255, 0.08);
}

.comment-list {
  display: grid;
  gap: 16px;
}

.comment-card {
  border: 1px solid rgba(47, 123, 255, 0.15);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--card);
  box-shadow: 0 8px 20px rgba(16, 33, 64, 0.06);
}

.comment-header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 8px;
}

.comment-name {
  font-weight: 700;
  color: var(--ink);
}

.comment-time {
  color: var(--muted);
  font-size: 0.85rem;
}

.comment-body {
  color: var(--ink);
  line-height: 1.7;
}

.comment-actions {
  margin-top: 12px;
}

.comment-actions button {
  border: 1px solid rgba(47, 123, 255, 0.25);
  background: transparent;
  color: var(--brand);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.comment-actions button:hover {
  background: rgba(47, 123, 255, 0.08);
}

.comment-replies {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.comment-reply {
  border-left: 3px solid var(--brand);
  padding-left: 16px;
  margin-left: 8px;
  background: rgba(47, 123, 255, 0.03);
  padding: 14px 16px;
  border-radius: 0 12px 12px 0;
}

.comment-empty {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 20px;
  text-align: center;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px dashed var(--line);
}

.comment-status {
  font-size: 0.9rem;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
}

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

.comment-status.ok {
  color: #1a7a3a;
  background: rgba(34, 197, 94, 0.12);
}

.comment-status.warn {
  color: #946b1a;
  background: rgba(234, 179, 8, 0.12);
}

.comment-status.err {
  color: #9a1a1a;
  background: rgba(239, 68, 68, 0.12);
}

@media (max-width: 600px) {
  .comment-form .challenge-row {
    flex-direction: column;
    align-items: stretch;
  }

  .comment-form button[type="submit"] {
    width: 100%;
    justify-self: stretch;
  }

  .comment-reply-cancel {
    margin-left: 0;
    margin-top: 8px;
    width: 100%;
  }
}