.comments-shell {
  width: min(100% - 40px, 1400px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(210px, 250px) minmax(380px, 1fr) minmax(260px, 330px);
  gap: clamp(28px, 4vw, 64px);
  padding: 48px 0 80px;
}

.comments-aside,
.notification-panel {
  align-self: start;
  position: sticky;
  top: 28px;
}

.comments-aside h1 {
  margin: 0;
  color: var(--color-ink);
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1;
  letter-spacing: -0.045em;
}

.comments-aside > p:not(.collections-eyebrow, .inline-status) {
  margin: 18px 0 28px;
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.65;
}

.comments-resource-form {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.comments-resource-form .button {
  width: 100%;
  margin-top: 12px;
}

.comments-thread {
  min-width: 0;
}

.comments-heading,
.notification-heading {
  min-height: 62px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--color-border);
}

.comments-heading h2,
.notification-heading h2 {
  margin: 0;
  color: var(--color-ink);
  font-size: 17px;
}

.comments-heading p,
.notification-heading p {
  margin: 7px 0 16px;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.5;
}

.notification-heading p span {
  color: var(--color-accent);
  font-family: var(--font-code);
  font-weight: 650;
}

.comment-compose {
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
}

.comment-compose textarea,
.comment-edit textarea {
  min-height: 104px;
  resize: vertical;
}

.comment-compose > .button {
  margin-top: 12px;
}

.reply-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 8px 10px;
  border-left: 2px solid var(--color-accent);
  color: var(--color-muted);
  background: var(--color-surface);
  font-size: 11px;
}

.comment-list {
  display: grid;
}

.comment-row {
  padding: 18px 0;
  border-bottom: 1px solid var(--color-border);
}

.comment-row[data-reply="true"] {
  margin-left: 28px;
  padding-left: 14px;
  border-left: 1px solid var(--color-border);
}

.comment-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

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

.comment-author strong {
  color: var(--color-ink);
  font-size: 13px;
}

.comment-author span,
.comment-time {
  color: var(--color-muted);
  font-family: var(--font-code);
  font-size: 10px;
}

.comment-author span {
  margin-left: 7px;
}

.comment-body {
  margin: 10px 0 12px;
  color: var(--color-ink);
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.comment-body[data-deleted="true"] {
  color: var(--color-muted);
  font-style: italic;
}

.comment-actions,
.comment-edit-actions {
  display: flex;
  gap: 6px;
}

.comment-actions .button,
.comment-edit-actions .button {
  min-height: 30px;
  padding: 0 8px;
  font-size: 10px;
}

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

.comment-edit-actions {
  margin-top: 8px;
}

.comment-loading,
.notification-loading {
  display: grid;
  gap: 1px;
  background: var(--color-border);
}

.comment-loading span,
.notification-loading span {
  display: block;
  min-height: 74px;
  background: linear-gradient(100deg, var(--color-canvas) 20%, var(--color-surface) 45%, var(--color-canvas) 70%);
  background-size: 220% 100%;
  animation: comments-shimmer 1.5s ease-in-out infinite;
}

.comment-empty,
.notification-empty {
  padding: 28px 0;
  color: var(--color-muted);
}

.comment-empty h3,
.notification-empty h3 {
  margin: 0 0 7px;
  color: var(--color-ink);
  font-size: 14px;
}

.comment-empty p,
.notification-empty p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

.comments-load-more {
  margin-top: 16px;
}

.comments-sentinel {
  height: 1px;
}

.notification-panel {
  min-width: 0;
}

.notification-filter {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 11px;
}

.notification-filter input {
  width: 15px;
  height: 15px;
  accent-color: var(--color-accent);
}

.notification-list {
  display: grid;
}

.notification-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}

.notification-row[data-unread="true"] {
  padding-left: 10px;
  border-left: 2px solid var(--color-accent);
}

.notification-row button {
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.notification-row strong {
  display: block;
  color: var(--color-ink);
  font-size: 12px;
  line-height: 1.45;
}

.notification-row p {
  display: -webkit-box;
  overflow: hidden;
  margin: 7px 0;
  color: var(--color-muted);
  font-size: 11px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.notification-row time {
  color: var(--color-muted);
  font-family: var(--font-code);
  font-size: 9px;
}

.notification-error {
  margin: 12px 0;
  color: var(--color-error);
  font-size: 11px;
}

@keyframes comments-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (max-width: 1080px) {
  .comments-shell {
    grid-template-columns: minmax(210px, 240px) minmax(0, 1fr);
  }

  .notification-panel {
    position: static;
    grid-column: 2;
  }
}

@media (max-width: 767px) {
  .comments-shell {
    width: min(100% - 32px, 1400px);
    grid-template-columns: 1fr;
    gap: 38px;
    padding: 34px 0 56px;
  }

  .comments-aside,
  .notification-panel {
    position: static;
  }

  .notification-panel {
    grid-column: auto;
  }

  .comment-row[data-reply="true"] {
    margin-left: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .comment-loading span,
  .notification-loading span {
    animation: none;
  }
}
