/* Paragraph comments: keep the reader layout untouched and reveal the comment affordance only after tapping a paragraph. */
.reader-page .reader-body p.r-p {
  position: relative;
  padding-right: 0 !important;
}

.reader-page .r-p .p-bubble {
  position: absolute;
  top: 0.1rem;
  right: -1.05rem;
  width: auto;
  min-width: 1.5rem;
  height: 1.5rem;
  min-height: 1.5rem;
  padding: 0 0.28rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.08rem;
  border: 1px solid color-mix(in srgb, var(--rmuted) 28%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--rbg) 90%, transparent);
  color: var(--rmuted);
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  font-size: 0.62rem;
  line-height: 1;
  opacity: 0 !important;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(3px) scale(.94);
  transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
  z-index: 8;
}

.reader-page .r-p .p-bubble::before,
.reader-page .r-p .p-bubble.has::before {
  content: "💬";
  font-size: 0.72rem;
}

.reader-page .r-p.is-comment-target .p-bubble {
  opacity: .94 !important;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

/* Existing long-press / text-selection menus are intentionally suppressed.
   Paragraph comments are opened only from the tap-revealed bubble. */
.reader-page .p-menu,
.reader-page + .quote-pop,
.quote-pop {
  display: none !important;
}

.reader-page .r-p.is-linked-comment {
  border-radius: 8px;
  animation: vcParaFlash 1.8s ease;
}

@keyframes vcParaFlash {
  0%, 100% { background: transparent; }
  18%, 58% { background: color-mix(in srgb, var(--raccent) 11%, transparent); }
}

@media (max-width: 640px) {
  .reader-page .r-p .p-bubble {
    right: -0.95rem;
  }
}
