/* Modern comment module: scoped, neutral by default, accent only for primary actions. */
.comment-modern-root {
  --comment-accent: #fb7299;
  --comment-accent-strong: #f34f83;
  --comment-bg: #fff;
  --comment-panel: #fafbfc;
  --comment-surface: #f4f6f8;
  --comment-text: #18191c;
  --comment-action: #59616d;
  --comment-muted: #7a818c;
  --comment-border: #e5e8ed;
  --comment-border-strong: #cfd4dc;
  --comment-radius: 14px;
  color: var(--comment-text);
  font-size: 15px;
  line-height: 1.65;
}
.comment-modern-root *,
.comment-modern-root *::before,
.comment-modern-root *::after { box-sizing: border-box; }
.comment-modern-root button,
.comment-modern-root textarea,
.comment-modern-root input { font: inherit; }
.comment-modern-root button { -webkit-tap-highlight-color: transparent; }
.comment-modern-root .sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Composer */
.comment-composer {
  position: relative;
  margin: 18px 0 28px;
  border: 1px solid var(--comment-border);
  border-radius: var(--comment-radius);
  background: var(--comment-bg);
  box-shadow: 0 8px 28px rgba(31, 35, 48, .06);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.comment-composer:focus-within {
  border-color: var(--comment-border-strong);
  box-shadow: 0 10px 30px rgba(31, 35, 48, .09);
}
.comment-composer--compact { margin: 14px 0 4px; box-shadow: none; }
.comment-composer__context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 8px 14px;
  color: var(--comment-muted);
  border-bottom: 1px solid var(--comment-border);
  border-radius: var(--comment-radius) var(--comment-radius) 0 0;
  background: var(--comment-panel);
}
.comment-composer__context[hidden] { display: none; }
.comment-composer__textarea,
.comment-composer__editable {
  display: block;
  width: 100%;
  min-height: 132px;
  max-height: 320px;
  margin: 0 !important;
  padding: 18px 20px 12px !important;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--comment-text);
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.comment-composer__textarea { resize: none; }
.comment-composer__editable { white-space: pre-wrap; cursor: text; }
.comment-form.is-rich .comment-composer__textarea { display: none !important; }
.comment-composer__editable:empty::before {
  color: #9da4ae;
  content: attr(data-placeholder);
  pointer-events: none;
}
.comment-composer__textarea::placeholder { color: #9da4ae; }
.comment-composer--compact .comment-composer__textarea,
.comment-composer--compact .comment-composer__editable { min-height: 92px; }
.comment-inline-emoji {
  display: inline-block;
  width: 22px;
  height: 22px;
  margin: 0 1px;
  object-fit: contain;
  vertical-align: -5px;
  user-select: none;
}
.comment-composer__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--comment-border);
}
.comment-toolbar,
.comment-composer__submit-area,
.comment-actions,
.comment-reaction-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.comment-toolbar { position: relative; gap: 6px; }
.comment-composer__submit-area { gap: 8px; }
.comment-tool,
.comment-composer__cancel,
.comment-pagination__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 6px 9px;
  color: var(--comment-action);
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease, transform .16s ease;
}
.comment-tool__icon {
  display: block;
  pointer-events: none;
  transition: transform .14s ease, stroke .14s ease;
}
.comment-tool:hover,
.comment-tool:focus-visible,
.comment-composer__cancel:hover,
.comment-composer__cancel:focus-visible {
  color: #252b34;
  background: var(--comment-surface);
}
.comment-tool:hover .comment-tool__icon {
  transform: scale(1.08);
  stroke: #18191c;
}
.comment-tool:focus-visible,
.comment-composer__cancel:focus-visible,
.comment-pagination__button:focus-visible {
  outline: 2px solid var(--comment-border-strong);
  outline-offset: 2px;
}
.comment-tool:active { transform: scale(.94); }
.comment-tool.comment-emoji-toggle:active { transform: none; }
.comment-modern-root .comment-emoji-toggle { font-size: 20px; line-height: 1; }
.comment-composer__counter {
  min-width: 56px;
  color: var(--comment-muted);
  font-size: 13px;
  text-align: right;
}
.comment-composer__submit {
  min-width: 88px;
  min-height: 40px;
  padding: 8px 20px;
  color: #fff;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--comment-accent), var(--comment-accent-strong));
  box-shadow: 0 4px 12px rgba(251, 114, 153, .16);
  opacity: .58;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .18s ease, opacity .18s ease;
}
.comment-composer__submit.is-active {
  opacity: 1;
  box-shadow: 0 7px 18px rgba(251, 114, 153, .30);
}
.comment-composer__submit.is-active:hover,
.comment-composer__submit:hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(251, 114, 153, .38);
}
.comment-composer__submit:active {
  transform: scale(.97);
}
.comment-composer__submit:focus-visible { outline: 2px solid #f8a4bf; outline-offset: 2px; }
.comment-composer__submit:disabled { opacity: .45; cursor: wait; transform: none; box-shadow: none; }
.comment-composer__status {
  min-height: 22px;
  margin: 0;
  padding: 0 14px 8px;
  color: #c84062;
  font-size: 13px;
}
.comment-verify {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 12px 10px;
}
.comment-verify__input {
  width: 120px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--comment-border);
  border-radius: 99px;
  background: var(--comment-panel);
}
.comment-verify__input:focus { border-color: var(--comment-border-strong); outline: 0; }
.comment-verify__image { width: 96px; height: 38px; border-radius: 8px; object-fit: cover; cursor: pointer; }

.comment-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 9px);
  z-index: 120;
  display: grid;
  grid-template-columns: repeat(4, 38px);
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--comment-border);
  border-radius: 12px;
  background: var(--comment-bg);
  box-shadow: 0 14px 38px rgba(24, 25, 28, .16);
  transform-origin: bottom left;
  animation: comment-popover-enter .15s ease-out;
}
@keyframes comment-popover-enter {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
.comment-popover[hidden] { display: none; }
.comment-popover.comment-emoji-picker {
  width: 268px;
  grid-template-columns: repeat(6, 38px);
  align-content: start;
  scrollbar-width: none;
}
.comment-popover.comment-emoji-picker::-webkit-scrollbar { display: none; width: 0; height: 0; }
.comment-popover.comment-reaction-picker {
  width: max-content;
  grid-template-columns: repeat(4, 38px);
}
.comment-popover--reaction { left: auto; bottom: auto; top: calc(100% + 7px); transform-origin: top left; }
.comment-emoji-option {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-width: 0;
  min-height: 0;
  margin: 0 !important;
  padding: 5px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}
.comment-emoji-option:hover,
.comment-emoji-option:focus-visible { background: var(--comment-surface); outline: 0; }
.comment-emoji-option img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  transition: transform .14s cubic-bezier(.34, 1.56, .64, 1);
}
.comment-emoji-option:hover img {
  transform: scale(1.22);
}

/* Loading, skeleton, and empty states */
.comment-empty,
.comment-loading,
.comment-error { padding: 36px 20px; color: var(--comment-muted); text-align: center; }
.comment-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}
.comment-empty__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 14px;
  color: #a0a7b1;
  border-radius: 50%;
  background: var(--comment-surface);
}
.comment-empty__title {
  margin: 0 0 4px;
  color: var(--comment-text);
  font-size: 15px;
  font-weight: 600;
}
.comment-empty__desc {
  margin: 0;
  font-size: 13px;
  color: var(--comment-muted);
}

.comment-skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 12px 0;
  text-align: left;
}
.comment-skeleton-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  padding: 10px 0;
}
.comment-skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--comment-surface) 25%, #eaedf1 45%, var(--comment-surface) 65%);
  background-size: 300% 100%;
  animation: comment-shimmer 1.35s infinite linear;
}
.comment-skeleton-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}
.comment-skeleton-name {
  width: 88px;
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--comment-surface) 25%, #eaedf1 45%, var(--comment-surface) 65%);
  background-size: 300% 100%;
  animation: comment-shimmer 1.35s infinite linear;
}
.comment-skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--comment-surface) 25%, #eaedf1 45%, var(--comment-surface) 65%);
  background-size: 300% 100%;
  animation: comment-shimmer 1.35s infinite linear;
}
.comment-skeleton-line--full { width: 92%; }
.comment-skeleton-line--short { width: 55%; }
.comment-skeleton-line--half { width: 72%; }

@keyframes comment-shimmer { to { background-position: -300% 0; } }

/* Comment list */
.comment-list { margin: 0; padding: 0; list-style: none; }
.comment-item {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--comment-border);
  transition: background-color .3s ease, box-shadow .3s ease;
}
.comment-list > li:last-child .comment-item { border-bottom: 0; }
.comment-item__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--comment-surface);
}
/* Native picture selection also applies to AJAX-inserted replies. */
picture.comment-item__avatar,
picture.comment-reply__avatar { display: block; }
picture.comment-item__avatar > img,
picture.comment-reply__avatar > img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}
.comment-item__main { min-width: 0; }
.comment-item__meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 5px;
}
.comment-item__name { color: var(--comment-text); font-weight: 650; }
.comment-item__time { color: var(--comment-muted); font-size: 13px; }
.comment-item__content {
  min-width: 0;
  color: var(--comment-text);
  font-size: 15px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.comment-item__content em,
.comment-quote em { font-style: italic; }
.comment-item__content img.code {
  display: block;
  width: auto;
  max-width: min(100%, 460px);
  max-height: 280px;
  min-width: 60px;
  min-height: 60px;
  margin: 8px 0;
  padding: 0;
  border: 1px solid var(--comment-border);
  border-radius: 10px;
  background: var(--comment-surface);
  box-shadow: none !important;
  object-fit: contain;
  object-position: left top;
  vertical-align: middle;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .18s ease, transform .18s ease, opacity .18s ease;
}
.comment-item__content img.code:hover {
  border-color: var(--comment-border-strong);
  opacity: .96;
}
.comment-item__content img.code:focus,
.comment-item__content img.code:active {
  border-color: var(--comment-border-strong);
  box-shadow: none !important;
  outline: none !important;
}
.comment-item__content > br:first-child,
.comment-item__content > br:last-child { display: none; }

.comment-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s cubic-bezier(.16, 1, .3, 1), visibility .22s;
}
.comment-lightbox.is-active {
  opacity: 1;
  visibility: visible;
}
.comment-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 14, 20, .86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.comment-lightbox__container {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 96vw;
  max-height: 94vh;
  padding: 0;
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.comment-lightbox__container::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.comment-lightbox__img {
  display: block;
  max-width: 92vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
  object-fit: contain;
  transform: scale(.94);
  transition: transform .22s cubic-bezier(.16, 1, .3, 1);
  user-select: none;
}
.comment-lightbox.is-active .comment-lightbox__img {
  transform: scale(1);
}
.comment-lightbox__close {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #fff;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background-color .16s ease, transform .16s ease;
}
.comment-lightbox__close:hover {
  background: rgba(255, 255, 255, .28);
  transform: scale(1.08);
}
.comment-lightbox__close:active {
  transform: scale(.92);
}

/* Long comment expand/collapse */
.comment-item__content.is-collapsible {
  position: relative;
  overflow: hidden;
  max-height: 175px;
  transition: max-height .28s ease;
}
.comment-item__content.is-collapsible.is-collapsed::after {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: linear-gradient(180deg, transparent 0%, var(--comment-bg) 100%);
  content: "";
  pointer-events: none;
}
.comment-item__content.is-collapsible.is-expanded {
  max-height: 3000px;
}
.comment-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
  padding: 0;
  color: var(--comment-accent);
  border: 0;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
  transition: opacity .16s ease;
}
.comment-expand-btn:hover {
  text-decoration: underline;
  opacity: .85;
}

/* Reply and reaction actions: soft micro-capsule touch targets */
.comment-actions { position: relative; gap: 8px; margin-top: 8px; }
.comment-action,
.comment-modern-root button.comment-action,
.comment-modern-root .comment-reaction-trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 28px;
  margin: 0;
  padding: 3px 8px;
  color: var(--comment-action);
  border: 0 !important;
  border-radius: 7px;
  background: transparent !important;
  box-shadow: none !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease, transform .16s ease;
}
.comment-action:hover,
.comment-action:focus-visible,
.comment-modern-root button.comment-action:hover,
.comment-modern-root .comment-reaction-trigger:hover {
  color: var(--comment-text);
  background: var(--comment-surface) !important;
}
.comment-action:focus-visible { outline: 2px solid var(--comment-border-strong); outline-offset: 1px; }
.comment-action:active { transform: scale(.93); }
.comment-reply-trigger { min-width: auto; font-size: 13px; font-weight: 500; }
.comment-reaction-trigger { padding: 3px 6px; }
.comment-reaction-trigger svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.comment-reaction-list { gap: 5px; margin-top: 9px; }
.comment-reaction-list:empty { display: none; }
.comment-reaction-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  gap: 5px;
  padding: 3px 9px;
  color: var(--comment-action);
  border: 1px solid var(--comment-border);
  border-radius: 999px;
  background: #fff;
  box-shadow: none;
  font-size: 12px;
  cursor: pointer;
  overflow: visible;
  outline: none;
  transition: border-color .16s ease, color .16s ease;
}
.comment-reaction-chip:hover {
  color: #303741;
  border-color: var(--comment-border-strong);
  background: #fff;
}
.comment-reaction-chip.is-selected {
  color: var(--comment-text);
  border-color: var(--comment-border);
  background: #fff;
  box-shadow: none;
}
.comment-reaction-chip:focus,
.comment-reaction-chip:focus-visible { outline: none; }
.comment-reaction-chip img { width: 20px; height: 20px; object-fit: contain; }
.comment-reaction-chip.is-just-reacted { animation: comment-reaction-chip-pop .48s cubic-bezier(.2, .9, .25, 1.25); }
.comment-reaction-chip .comment-reaction-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 22px;
  height: 22px;
  margin: 0 !important;
  pointer-events: none;
  animation: comment-reaction-burst .68s ease-out forwards;
}
.comment-reaction-firework {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 0;
  height: 0;
  pointer-events: none;
}
.comment-reaction-firework::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 159, 67, .72);
  border-radius: 50%;
  content: "";
  animation: comment-reaction-firework-ring .58s ease-out forwards;
  transform: translate(-50%, -50%);
}
.comment-reaction-firework__spark {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--reaction-color);
  box-shadow: 0 0 5px var(--reaction-color);
  opacity: 0;
  animation: comment-reaction-firework-spark .78s ease-out var(--reaction-delay) forwards;
}
@keyframes comment-reaction-chip-pop {
  0% { transform: scale(.78); }
  45% { transform: scale(1.16); }
  72% { transform: scale(.96); }
  100% { transform: scale(1); }
}
@keyframes comment-reaction-burst {
  0% { opacity: 0; transform: translate(-50%, -35%) scale(.55) rotate(-8deg); }
  24% { opacity: 1; transform: translate(-50%, -85%) scale(1.08) rotate(5deg); }
  100% { opacity: 0; transform: translate(-50%, -190%) scale(.78) rotate(10deg); }
}

@keyframes comment-reaction-firework-ring {
  0% { opacity: .9; transform: translate(-50%, -50%) scale(.35); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(3.4); }
}
@keyframes comment-reaction-firework-spark {
  0% { opacity: 0; transform: translate(0, 0) scale(.45); }
  12% { opacity: 1; }
  72% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--reaction-x), var(--reaction-y)) scale(0); }
}

/* Child replies: compact grouped hierarchy below the parent comment. */
.comment-replies {
  width: min(100%, 920px);
  margin: 14px 0 2px;
  padding: 4px 14px;
  border: 1px solid var(--comment-border);
  border-radius: 12px;
  background: var(--comment-panel);
  box-shadow: 0 4px 16px rgba(31, 35, 48, .035);
}
.comment-modern-root .comment-replies__more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  margin: 6px auto 2px;
  padding: 8px 14px;
  color: var(--comment-accent-strong);
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
}
.comment-replies__more::after {
  content: '';
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.comment-replies__more:hover,
.comment-replies__more:focus-visible { background: rgba(251, 114, 153, .08); }
.comment-replies__more:focus-visible { outline: 2px solid var(--comment-accent-strong); outline-offset: 2px; }
.comment-replies__more[aria-busy="true"]::after { visibility: hidden; }
.comment-replies__more:disabled { opacity: .62; cursor: wait; }
.comment-reply {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--comment-border);
  transition: background-color .3s ease, box-shadow .3s ease;
}
.comment-reply:last-child { border-bottom: 0; }
.comment-reply__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--comment-surface);
}
.comment-replies .comment-item__meta { gap: 6px; margin-bottom: 3px; }
.comment-replies .comment-item__name { font-size: 14px; }
.comment-replies .comment-item__time { font-size: 12px; }
.comment-replies .comment-item__content { font-size: 14px; line-height: 1.65; }
.comment-replies .comment-actions { gap: 10px; margin-top: 7px; }
.comment-replies .comment-reaction-list { margin-top: 7px; }
.comment-reply-form { margin-top: 12px; }

/* Quotes: one visual level; automatic reply attribution stays outside the quote marks. */
.comment-quote,
.comment-modern-root .quote,
.comment-modern-root div.quote {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 9px 0;
  padding: 8px 12px;
  color: #5e6672;
  border: 1px solid var(--comment-border);
  border-radius: 9px;
  background: var(--comment-panel);
  box-shadow: none;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.comment-quote::before,
.comment-quote::after,
.comment-modern-root .quote::before,
.comment-modern-root .quote::after {
  color: #8b929c;
  font: 700 17px/1 Georgia, serif;
  opacity: .72;
}
.comment-quote::before,
.comment-modern-root .quote::before { margin-right: 3px; content: "\201C"; }
.comment-quote::after,
.comment-modern-root .quote::after { margin-left: 3px; content: "\201D"; }
.comment-modern-root .quote q::before,
.comment-modern-root .quote q::after { display: none; content: none; }

/* A comment that only contains a quote reads like prose, not an empty card. */
.comment-item__content > .comment-quote:only-child,
.comment-item__content > .quote:only-child {
  display: inline;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
  color: #5f6672;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  line-height: inherit;
}

/* Flatten any legacy quote nesting left in historical rows. */
.comment-quote .comment-quote,
.comment-modern-root .quote .quote,
.comment-modern-root .quote div.quote {
  display: inline;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
  color: inherit;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font: inherit;
}
.comment-quote .comment-quote::before,
.comment-quote .comment-quote::after,
.comment-modern-root .quote .quote::before,
.comment-modern-root .quote .quote::after { content: none; }

/* Automatic child-reply context: @name is metadata, only content is quoted. */
.comment-quote.comment-quote--reply {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 2px 0 7px;
  padding: 3px 8px;
  color: var(--comment-muted);
  border: 0;
  border-radius: 6px;
  background: var(--comment-surface);
  box-shadow: none;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: background-color .16s ease, transform .14s ease;
}
.comment-quote.comment-quote--reply:hover {
  background: #e9ecf0;
}
.comment-quote--reply::before,
.comment-quote--reply::after { content: none; }
.comment-quote--reply .comment-quote__author {
  display: inline-flex;
  align-items: center;
  margin-right: 3px;
  padding: 1px 6px;
  color: var(--comment-accent);
  border-radius: 4px;
  background: rgba(251, 114, 153, .10);
  font-weight: 600;
  font-size: 11.5px;
  line-height: 1.5;
  vertical-align: baseline;
  transition: background-color .16s ease;
}
.comment-quote--reply:hover .comment-quote__author {
  background: rgba(251, 114, 153, .16);
}
.comment-quote__content { display: inline; }
.comment-quote__content::before,
.comment-quote__content::after {
  color: #8b929c;
  font: 700 15px/1 Georgia, serif;
  opacity: .66;
}
.comment-quote__content::before { margin-right: 2px; content: "\201C"; }
.comment-quote__content::after { margin-left: 2px; content: "\201D"; }
.comment-quote--reply .comment-quote,
.comment-modern-root .comment-quote--reply .quote,
.comment-modern-root .comment-quote--reply div.quote {
  display: inline;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
  color: inherit;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font: inherit;
}
.comment-quote--reply .comment-quote::before,
.comment-quote--reply .comment-quote::after,
.comment-modern-root .comment-quote--reply .quote::before,
.comment-modern-root .comment-quote--reply .quote::after { content: none; }

.comment-replies .comment-item__content .comment-quote {
  display: inline;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
  color: inherit;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font: inherit;
}


/* Spoiler Mask: tap to reveal, auto snug width, vertical center */
.comment-content--spoiler {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  max-width: 100%;
  padding: 1px 6px;
  overflow-wrap: anywhere;
  color: transparent !important;
  border: 1px solid #b9c0ca;
  border-radius: 6px;
  background: #cbd1d9;
  cursor: pointer;
  user-select: none;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.comment-content--spoiler img,
.comment-content--spoiler .emjoy6 {
  vertical-align: middle;
}
.comment-content--spoiler:has(> .emjoy6:only-child) {
  padding: 1px 4px;
}
.comment-content--spoiler::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: repeating-linear-gradient(135deg, #838a95 0 5px, #aab1bb 5px 10px);
  content: "";
  pointer-events: none;
  transition: opacity .18s ease;
}
.comment-content--spoiler .comment-quote,
.comment-content--spoiler .comment-quote::before,
.comment-content--spoiler .comment-quote::after { color: inherit !important; }
.comment-content--spoiler:hover,
.comment-content--spoiler:focus,
.comment-content--spoiler.is-revealed {
  color: inherit !important;
  border-color: transparent;
  outline: 0;
  background: transparent;
  box-shadow: none;
  cursor: text;
}
.comment-content--spoiler:hover::after,
.comment-content--spoiler:focus::after,
.comment-content--spoiler.is-revealed::after { opacity: 0; }

/* Pagination */
.comment-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 22px 0 4px;
}
.comment-pagination__button { border: 1px solid var(--comment-border); background: var(--comment-bg); }
.comment-pagination__button:hover { color: #252b34; background: var(--comment-surface); }
.comment-pagination__button.is-current { color: #fff; border-color: var(--comment-accent); background: var(--comment-accent); }
.comment-pagination__button:disabled { opacity: .4; cursor: default; }
.comment-composer-template { display: none !important; }

@media (max-width: 700px) {
  .comment-composer { margin-top: 12px; border-radius: 12px; }
  .comment-composer__textarea,
  .comment-composer__editable { min-height: 112px; padding: 14px 14px 10px !important; }
  .comment-composer__footer { align-items: flex-end; padding: 8px; }
  .comment-tool { min-width: 32px; padding: 5px 7px; }
  .comment-composer__submit { min-width: 72px; padding: 7px 14px; }
  .comment-composer__counter { display: none; }
  .comment-popover {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 16px;
    top: auto;
    grid-template-columns: repeat(4, 1fr);
  }
  .comment-emoji-option { width: 100%; }
  .comment-emoji-picker {
    right: auto;
    bottom: auto;
    width: min(268px, calc(100vw - 24px));
    grid-template-columns: repeat(6, minmax(0, 1fr));
    max-height: calc(100vh - 16px);
    z-index: 999999993;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .comment-item { grid-template-columns: 40px minmax(0, 1fr); gap: 10px; padding: 18px 0 16px; }
  .comment-item__avatar { width: 40px; height: 40px; }
  .comment-popover--reaction {
    right: auto;
    bottom: auto;
    z-index: 999999993;
    grid-template-columns: repeat(4, 38px);
  }
  .comment-popover--reaction .comment-emoji-option { width: 38px; }
  .comment-modern-root { padding-right: 4px; padding-bottom: 28px; }
  .comment-replies { width: 100%; margin: 12px 0 6px; padding: 4px 10px 8px; border-radius: 10px; }
  .comment-reply { grid-template-columns: 30px minmax(0, 1fr); gap: 8px; padding: 11px 0; }
  .comment-reply__avatar { width: 30px; height: 30px; }
  .comment-replies .comment-actions { margin-top: 6px; }
  .comment-actions { margin-top: 6px; padding-right: 18px; margin-bottom: 2px; }
  .comment-item__meta { flex-wrap: nowrap; min-width: 0; }
  .comment-item__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .comment-item__time { flex: 0 0 auto; white-space: nowrap; }
  .comment-item__content img.code { max-width: 100%; max-height: 240px; border-radius: 8px; }
  .comment-lightbox__close { top: 14px; right: 14px; width: 38px; height: 38px; }
  .comment-lightbox__img { max-width: 94vw; max-height: 86vh; border-radius: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .comment-modern-root *,
  .comment-modern-root *::before,
  .comment-modern-root *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
