/* Administrator preview: identity art keeps its original rectangular canvas. */
.wyl-frontend-preview .wyl-comment-identity {
  flex-shrink: 0;
  overflow: visible;
}
.wyl-frontend-preview .wyl-comment-identity img {
  border-radius: 0;
  object-fit: contain;
  flex-shrink: 0;
}
.wyl-frontend-preview .wyl-comment-level-badge img {
  width: auto;
  max-width: none;
  height: 22px;
}
.wyl-frontend-preview .wyl-comment-medal-badge img {
  width: 24px;
  height: 24px;
}
.wyl-frontend-preview .comment-list .comment[hidden],
.wyl-frontend-preview .comment-list .children[hidden] {
  display: none !important;
}
.wyl-frontend-preview .wyl-comment-thread-preview-toggle {
  min-height: 44px;
  margin: 2px 0 12px 60px;
}
.wyl-frontend-preview .wyl-comment-thread-preview-toggle:focus-visible {
  outline: 2px solid var(--wyl-jade);
  outline-offset: 4px;
  border-radius: 4px;
}
/* Keep the icon quiet until the server confirms a new like. */
body.wyl-frontend-preview .wyl-book-page .wyl-comment-foot {
  --wyl-comment-like-accent: #dc2447;
  gap: 8px;
}
html[data-wyl-theme="dark"] body.wyl-frontend-preview .wyl-book-page .wyl-comment-foot {
  --wyl-comment-like-accent: #ff526a;
}
body.wyl-frontend-preview .wyl-book-page .wyl-comment-foot :is(a, button) {
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  justify-content: center;
  border-radius: 7px;
  text-decoration: none;
}
body.wyl-frontend-preview .wyl-book-page .wyl-comment-foot :is(.wyl-comment-like, .wyl-comment-reply) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  border-radius: 7px;
  color: var(--wyl-muted);
  line-height: 1;
  text-decoration: none;
}
body.wyl-frontend-preview .wyl-book-page .wyl-comment-like b {
  min-width: 1ch;
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
body.wyl-frontend-preview .wyl-book-page .wyl-comment-foot :is(.wyl-comment-like, .wyl-comment-reply) .wyl-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  stroke-width: 1.8;
}
body.wyl-frontend-preview .wyl-book-page .wyl-comment-foot :is(.wyl-comment-like, .wyl-comment-reply):hover {
  background: var(--wyl-surface-soft);
  color: var(--wyl-ink-2);
  text-decoration: none;
}
body.wyl-frontend-preview .wyl-book-page .wyl-comment-foot .wyl-comment-like,
body.wyl-frontend-preview .wyl-book-page .wyl-comment-foot .wyl-comment-like:is(:hover, :active, :focus-visible, .is-active) {
  position: relative;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}
body.wyl-frontend-preview .wyl-book-page .wyl-comment-like .wyl-icon { fill: none; }
body.wyl-frontend-preview .wyl-book-page .wyl-comment-foot .wyl-comment-like.is-active {
  color: var(--wyl-comment-like-accent);
  text-decoration: none;
}
body.wyl-frontend-preview .wyl-book-page .wyl-comment-like.is-active .wyl-icon {
  fill: currentColor;
}
body.wyl-frontend-preview .wyl-book-page .wyl-comment-foot .wyl-comment-like.is-pending {
  opacity: .6;
  cursor: progress;
}
body.wyl-frontend-preview .wyl-book-page .wyl-comment-foot :is(.wyl-comment-like, .wyl-comment-reply):focus-visible {
  outline: 2px solid var(--wyl-jade);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: no-preference) {
  body.wyl-frontend-preview .wyl-book-page .wyl-comment-foot :is(.wyl-comment-like, .wyl-comment-reply) {
    transition: color 160ms ease-out, background-color 160ms ease-out, opacity 160ms ease-out;
  }
  body.wyl-frontend-preview .wyl-book-page .wyl-comment-like.is-active.is-like-confirmed .wyl-icon {
    transform-origin: 45% 75%;
    animation: wylPreviewLikeConfirm 500ms cubic-bezier(.16, 1, .3, 1);
  }
  body.wyl-frontend-preview .wyl-book-page .wyl-comment-like.is-active.is-like-confirmed::after {
    content: "";
    position: absolute;
    left: -5px;
    top: 50%;
    width: 44px;
    height: 44px;
    pointer-events: none;
    color: var(--wyl-comment-like-accent);
    background:
      radial-gradient(circle, currentColor 1.5px, transparent 2px) 4px 10px / 4px 4px no-repeat,
      radial-gradient(circle, currentColor 1.5px, transparent 2px) 17px 2px / 4px 4px no-repeat,
      radial-gradient(circle, currentColor 1px, transparent 1.5px) 30px 7px / 3px 3px no-repeat,
      radial-gradient(circle, currentColor 1px, transparent 1.5px) 2px 29px / 3px 3px no-repeat,
      radial-gradient(circle, currentColor 1.5px, transparent 2px) 19px 37px / 4px 4px no-repeat;
    opacity: 0;
    animation: wylPreviewLikeParticles 500ms cubic-bezier(.16, 1, .3, 1) both;
  }
  @keyframes wylPreviewLikeConfirm {
    0% { transform: scale(1); }
    32% { transform: scale(1.3) rotate(-10deg); }
    62% { transform: scale(.94) rotate(3deg); }
    100% { transform: scale(1); }
  }
  @keyframes wylPreviewLikeParticles {
    0% { opacity: 0; transform: translateY(-50%) scale(.45); }
    24% { opacity: .9; }
    75% { opacity: .25; }
    100% { opacity: 0; transform: translateY(-50%) scale(1.2); }
  }
  .wyl-frontend-preview .is-preview-thread-revealing > .comment ~ .comment > .wyl-comment-card,
  .wyl-frontend-preview .is-preview-thread-revealing .children > .comment > .wyl-comment-card {
    animation: wylPreviewReplyReveal 220ms cubic-bezier(.16, 1, .3, 1) both;
  }
  @keyframes wylPreviewReplyReveal {
    from { opacity: .45; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
@media (prefers-reduced-motion: reduce) {
  body.wyl-frontend-preview .wyl-book-page .wyl-comment-foot :is(.wyl-comment-like, .wyl-comment-reply),
  body.wyl-frontend-preview .wyl-book-page .wyl-comment-foot :is(.wyl-comment-like, .wyl-comment-reply) .wyl-icon {
    animation: none;
    transition: none;
  }
}
@media (max-width: 640px) {
  .wyl-frontend-preview .wyl-comment-thread-preview-toggle { margin-left: 44px; }
}
