.plv {
  --plv-text: #3a3f45;
  --plv-muted: #7a828c;
  --plv-heart: #e11d48;
  --plv-heart-soft: rgba(225, 29, 72, 0.12);
  --plv-line: rgba(0, 0, 0, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  line-height: 1;
  color: var(--plv-text);
  user-select: none;
  -webkit-user-select: none;
}

.plv-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 6px 8px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border-radius: 999px;
  color: inherit;
  font: inherit;
  transition: background 0.15s ease, transform 0.12s ease;
}

.plv-btn:hover,
.plv-btn:focus-visible {
  background: var(--plv-heart-soft);
  outline: none;
}

.plv-btn:active {
  transform: scale(0.96);
}

.plv-btn.is-busy {
  pointer-events: none;
  opacity: 0.7;
}

.plv-btn.is-pop .plv-icon {
  animation: plv-pop 0.35s ease;
  color: var(--plv-heart);
}

.plv-like .plv-icon {
  color: var(--plv-heart);
  display: inline-flex;
}

.plv-views {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  color: var(--plv-muted);
}

.plv-views .plv-icon {
  display: inline-flex;
  color: var(--plv-muted);
}

.plv-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  min-width: 1ch;
}

.plv-sep {
  width: 1px;
  height: 16px;
  background: var(--plv-line);
}

@keyframes plv-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* —— Comments —— inherit type from parent block */
.plv-comments {
  --plv-ink: #1f2937;
  --plv-ink-soft: #4b5563;
  --plv-muted: #6b7280;
  --plv-line: rgba(15, 23, 42, 0.08);
  --plv-line-strong: rgba(15, 23, 42, 0.12);
  --plv-wash: #f3f4f6;
  --plv-blue: #2563eb;
  --plv-blue-hover: #1d4ed8;
  --plv-blue-soft: rgba(37, 99, 235, 0.12);
  --plv-ok: #047857;
  --plv-danger: #b91c1c;
  --plv-radius: 14px;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 2px 0;
  color: var(--plv-ink);
  font: inherit;
}

.plv-comments *,
.plv-comments *::before,
.plv-comments *::after {
  box-sizing: border-box;
}

.plv-comments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.plv-comments-title {
  margin: 0;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--plv-ink);
}

.plv-comments-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--plv-wash);
  color: var(--plv-muted);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.plv-comments-gate {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 16px;
  border-radius: var(--plv-radius);
  background: var(--plv-wash);
  border: 1px solid var(--plv-line-strong);
}

.plv-comments-gate-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--plv-blue);
  border: 1px solid var(--plv-line);
}

.plv-comments-gate-body {
  flex: 1 1 180px;
  min-width: 0;
}

.plv-comments-gate-body strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--plv-ink);
  margin-bottom: 2px;
}

.plv-comments-gate-body p,
.plv-comments-gate p {
  margin: 0;
  color: var(--plv-muted);
  font-size: 14px;
  line-height: 1.45;
}

.plv-comments-gate.is-warn {
  background: #fff7ed;
  border-color: #fdba74;
}

.plv-comment-form {
  margin: 0 0 20px;
}

.plv-composer {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: var(--plv-radius);
  background: var(--plv-wash);
  border: 1px solid var(--plv-line-strong);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.plv-composer:focus-within {
  background: #fff;
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 3px var(--plv-blue-soft);
}

.plv-avatar {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #e5e7eb;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}

.plv-composer-main {
  min-width: 0;
}

.plv-composer .plv-c-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--plv-muted);
  text-transform: none;
  letter-spacing: 0;
}

.plv-composer textarea {
  width: 100%;
  margin: 0;
  border: 0;
  outline: none;
  resize: vertical;
  min-height: 88px;
  padding: 0;
  background: transparent;
  color: var(--plv-ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  box-shadow: none !important;
}

.plv-composer textarea::placeholder {
  color: #9ca3af;
}

.plv-comment-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--plv-line);
}

.plv-c-btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 650;
  font-size: 14px;
  cursor: pointer;
  background: #e5e7eb;
  color: var(--plv-ink);
  transition: background 0.15s ease;
}

.plv-c-btn:hover {
  background: #d1d5db;
}

.plv-c-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.plv-c-btn-primary,
.plv-modal .plv-c-btn-primary {
  background: #2563eb !important;
  color: #fff !important;
  box-shadow: none !important;
  border: 0 !important;
}

.plv-c-btn-primary:hover,
.plv-modal .plv-c-btn-primary:hover {
  background: #1d4ed8 !important;
  color: #fff !important;
}

.plv-c-btn-block {
  width: 100%;
  display: block;
  text-align: center;
}

.plv-auth-extra {
  margin: 12px 0 0;
  text-align: center;
}

.plv-auth-lead {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--plv-muted);
}

.plv-link {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #2563eb;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.plv-link:hover {
  color: #1d4ed8;
}

.plv-c-label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--plv-ink-soft);
  margin-bottom: 12px;
}

.plv-c-label .plv-input,
.plv-modal .plv-input,
.plv-c-label input.plv-input {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  border: 1px solid #d1d5db !important;
  border-radius: 10px !important;
  padding: 11px 12px !important;
  font: inherit !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  color: #111827 !important;
  background: #fff !important;
  box-shadow: none !important;
  min-height: 44px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.plv-c-label .plv-input:focus,
.plv-modal .plv-input:focus,
.plv-c-label input.plv-input:focus {
  outline: none !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

.plv-c-msg {
  display: block;
  font-size: 13px;
  margin: 10px 0 0;
}

.plv-c-msg.is-ok { color: var(--plv-ok); }
.plv-c-msg.is-err { color: var(--plv-danger); }

.plv-comments-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.plv-comments-empty {
  color: var(--plv-muted);
  font-size: 14px;
  padding: 8px 0 4px;
}

.plv-comments-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.plv-comments-more-wrap[hidden] {
  display: none !important;
}

.plv-c-btn-more {
  background: #fff;
  color: var(--plv-ink);
  border: 1px solid var(--plv-line-strong) !important;
  min-width: 180px;
}

.plv-c-btn-more:hover {
  background: var(--plv-wash);
}

.plv-comment-item {
  position: relative;
}

.plv-comment-item + .plv-comment-item {
  border-top: 1px solid var(--plv-line);
}

.plv-comment-delete {
  appearance: none;
  border: 0;
  background: transparent;
  color: #b91c1c;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  padding: 4px 0;
  border-radius: 8px;
}

.plv-comment-delete:hover {
  text-decoration: underline;
}

.plv-confirm-dialog {
  width: min(400px, 100%) !important;
}

.plv-confirm-text {
  margin: 0 0 18px;
  color: var(--plv-muted);
  font-size: 14px;
  line-height: 1.45;
}

.plv-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.plv-c-btn-danger,
.plv-modal .plv-c-btn-danger {
  background: #dc2626 !important;
  color: #fff !important;
  box-shadow: none !important;
  border: 0 !important;
}

.plv-c-btn-danger:hover,
.plv-modal .plv-c-btn-danger:hover {
  background: #b91c1c !important;
}

.plv-comment-card {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  margin: 0;
  font: inherit;
  color: inherit;
}

.plv-comment-card-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.plv-comment-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.plv-comment-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--plv-ink);
}

.plv-comment-date {
  font-size: 12px;
  color: var(--plv-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.plv-comment-excerpt {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--plv-ink-soft);
  white-space: pre-wrap;
  word-break: break-word;
}

.plv-comment-card .plv-comment-delete {
  margin: 6px 0 0;
  padding: 0;
  width: fit-content;
}

/* —— Modals —— */
html.plv-modal-open {
  overflow: hidden;
}

.plv-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font: inherit;
}

.plv-modal.is-open {
  display: flex;
}

.plv-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.plv-modal-dialog {
  position: relative;
  width: min(440px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 22px 22px 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  max-height: min(86vh, 720px);
  overflow: auto;
}

#plv-comment-modal .plv-modal-dialog {
  width: min(520px, 100%);
}

.plv-modal-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: var(--plv-wash, #f3f4f6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--plv-muted, #6b7280);
  text-align: center;
}

.plv-modal-x:hover {
  background: #e5e7eb;
  color: var(--plv-ink, #1f2937);
}

.plv-modal-title {
  margin: 0 0 14px;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  padding-right: 36px;
  color: var(--plv-ink, #1f2937);
}

.plv-modal-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  color: #6b7280;
}

.plv-modal-meta {
  margin: 0 0 14px;
  font-size: 13px;
  color: #6b7280;
}

.plv-modal-body {
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.55;
  color: #4b5563;
}

.plv-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 12px;
  background: #f3f4f6;
}

.plv-tab {
  appearance: none;
  border: 0 !important;
  background: transparent !important;
  padding: 10px 8px;
  font: inherit !important;
  font-size: 13px !important;
  font-weight: 650 !important;
  color: #6b7280 !important;
  cursor: pointer;
  border-radius: 9px;
  box-shadow: none !important;
  text-align: center !important;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.plv-tab.is-active {
  color: #111827 !important;
  background: #fff !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}

.plv-auth-panel {
  margin: 0;
}

.plv-auth-panel.is-active {
  display: block;
}

.plv-modal .plv-modal-title {
  font: inherit !important;
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  color: #111827 !important;
}

@media (max-width: 560px) {
  .plv-composer {
    grid-template-columns: 1fr;
  }

  .plv-composer > .plv-avatar {
    display: none;
  }

  .plv-c-btn-primary {
    width: 100%;
  }

  .plv-comment-form-actions {
    justify-content: stretch;
  }
}
