.comments-modal {
  --comments-height: 100dvh;
}
.comments-modal .modal-dialog {
  display: flex;
  align-items: flex-end;
  margin: 0;
  max-width: none;
  height: var(--comments-height);
  min-height: 0;
}
.comments-modal .modal-content {
  height: min(88dvh, var(--comments-height));
  max-height: var(--comments-height);
  border-radius: 1rem 1rem 0 0;
  overflow: hidden;
}
.comments-modal .modal-header {
  flex-shrink: 0;
}
.comments-modal .modal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
  flex: 1;
}
.comments-compose {
  padding: var(--space-3) var(--space-4)
    max(var(--space-3), env(safe-area-inset-bottom));
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  flex-shrink: 0;
}
.comments-compose p {
  font-size: 0.8125rem;
  margin: 0;
}
.comment-input-row {
  display: flex;
  gap: var(--space-2);
  align-items: flex-end;
}
.comment-input-row textarea {
  border: 0;
  background: var(--color-bg);
  border-radius: 1.25rem;
  min-height: var(--touch-size);
  max-height: 7rem;
  padding: 0.7rem 0.9rem;
  width: 100%;
  resize: none;
  font-size: 1rem;
}
.comment-input-row .icon-button {
  flex-shrink: 0;
  color: var(--color-primary);
}
.comment {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  min-width: 0;
}
.comment .avatar {
  width: 2rem;
  height: 2rem;
  font-size: 0.6875rem;
}
.comment-main {
  flex: 1;
  min-width: 0;
}
.comment-bubble {
  background: var(--color-bg);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
}
.comment-bubble a {
  color: var(--color-ink);
  font-size: 0.8125rem;
  font-weight: 650;
}
.comment-bubble p {
  margin: 0.2rem 0 0;
  white-space: pre-wrap;
}
.comment-bubble small {
  display: block;
  color: var(--color-muted);
}
.comment-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: 0.6875rem;
  color: var(--color-muted);
}
.comment-meta button {
  border: 0;
  background: none;
  color: var(--color-muted);
  font-weight: 600;
  padding: 0;
  min-height: var(--touch-size);
  font-size: 0.75rem;
}
.comment-meta button[aria-pressed="true"] {
  color: var(--color-primary);
}
.reply-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: 0.8125rem;
  color: var(--color-muted);
}
.comment-new {
  animation: comment-arrive var(--duration-normal) ease-out;
}
@keyframes comment-arrive {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (min-width: 640px) {
  .comments-modal .modal-dialog {
    margin: auto;
    max-width: 36rem;
    align-items: center;
  }
  .comments-modal .modal-content {
    height: 40rem;
    max-height: 85dvh;
    border-radius: var(--radius-lg);
  }
}
