/* Reader features: spotlight, guest prompt, messenger, progress badges, notify button */

body.en-modal-open {
  overflow: hidden;
}

/* ── Shared modal shell ─────────────────────────────── */
.en-spotlight,
.en-guest-prompt {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.en-spotlight[hidden] {
  display: none;
}

.en-spotlight__backdrop,
.en-guest-prompt__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(2 6 23 / 0.78);
  backdrop-filter: blur(3px);
}

.en-spotlight__dialog,
.en-guest-prompt__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 22.5rem);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 1.35rem 1.25rem 1.1rem;
  border-radius: 1.25rem;
  border: 1px solid rgb(51 65 85);
  background: linear-gradient(180deg, rgb(30 41 59) 0%, rgb(15 23 42) 100%);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.55);
  color: #e2e8f0;
  text-align: center;
  animation: en-pop 0.22s ease-out;
}

@keyframes en-pop {
  from { transform: translateY(10px) scale(0.98); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* ── New-series spotlight ───────────────────────────── */
.en-spotlight__eyebrow {
  margin: 0 0 0.25rem;
  color: #fda4af;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.en-spotlight__title {
  margin: 0 0 0.9rem;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.en-spotlight__cover {
  position: relative;
  display: block;
  width: 62%;
  max-width: 13rem;
  margin: 0 auto 0.75rem;
  aspect-ratio: 3 / 4;
  border-radius: 0.9rem;
  overflow: hidden;
  background: rgb(30 41 59);
  box-shadow: 0 12px 30px rgb(0 0 0 / 0.45);
}

.en-spotlight__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.en-spotlight__cover-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 2.5rem;
}

.en-spotlight__status {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgb(15 23 42 / 0.85);
  color: #e2e8f0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  backdrop-filter: blur(4px);
}

.en-spotlight__status--ongoing   { background: #166534; color: #bbf7d0; }
.en-spotlight__status--completed { background: #1e40af; color: #bfdbfe; }
.en-spotlight__status--hiatus    { background: #854d0e; color: #fde68a; }
.en-spotlight__status--cancelled { background: #7f1d1d; color: #fecaca; }

.en-spotlight__stars {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-bottom: 0.7rem;
}

.en-spotlight__star {
  display: inline-block;
  white-space: nowrap;
  position: relative;
  font-size: 1.15rem;
  line-height: 1;
  color: rgb(71 85 105);
}

.en-spotlight__star::before {
  content: "★";
  position: absolute;
  inset: 0;
  width: var(--fill, 0%);
  overflow: hidden;
  color: #fbbf24;
}

.en-spotlight__score {
  margin-left: 0.35rem;
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 600;
}

.en-spotlight__desc {
  position: relative;
  margin: 0 0 1rem;
  text-align: left;
}

.en-spotlight__desc-text {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.9rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.en-spotlight__desc.is-expanded .en-spotlight__desc-text {
  display: block;
  max-height: 11rem;
  overflow-y: auto;
  padding-right: 4px;
}

.en-spotlight__more {
  padding: 0;
  border: 0;
  background: none;
  color: #fda4af;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.en-spotlight__more:hover {
  text-decoration: underline;
}

.en-spotlight__actions,
.en-guest-prompt__actions {
  display: flex;
  gap: 0.6rem;
}

.en-spotlight__btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1rem;
  border-radius: 0.8rem;
  border: 1px solid rgb(71 85 105);
  background: transparent;
  color: #e2e8f0;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.en-spotlight__btn:hover {
  background: rgb(51 65 85 / 0.6);
  color: #fff;
}

.en-spotlight__btn--primary {
  border-color: var(--accent, #9f1239);
  background: var(--accent, #9f1239);
  color: #fff;
}

.en-spotlight__btn--primary:hover {
  background: var(--accent-dark, #be123c);
}

.en-spotlight__notify {
  margin-top: 0.8rem;
}

/* ── Guest prompt ───────────────────────────────────── */
.en-guest-prompt__icon {
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

.en-guest-prompt__title {
  margin: 0 0 0.5rem;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
}

.en-guest-prompt__text {
  margin: 0 0 1.1rem;
  color: #cbd5e1;
  font-size: 0.92rem;
  line-height: 1.55;
}

/* ── Notify button ──────────────────────────────────── */
.en-notify-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px dashed rgb(100 116 139);
  background: transparent;
  color: #cbd5e1;
  font-size: 0.8rem;
  cursor: pointer;
}

.en-notify-btn:hover:not(:disabled) {
  border-color: #fda4af;
  color: #fff;
}

.en-notify-btn.is-on {
  border-style: solid;
  border-color: #15803d;
  color: #86efac;
  cursor: default;
}

.en-notify-btn[hidden] {
  display: none;
}

.en-footer-notify {
  display: flex;
  justify-content: center;
  padding: 1rem 1rem 0;
}

/* ── Private progress badge on covers ───────────────── */
.series-cover-badges__progress {
  position: absolute;
  left: 0.4rem;
  bottom: 0.4rem;
  z-index: 2;
  pointer-events: none;
}

.en-progress-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: rgb(15 23 42 / 0.85);
  border: 1px solid rgb(148 163 184 / 0.35);
  color: #e2e8f0;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.3;
  backdrop-filter: blur(4px);
}

.en-progress-badge--done {
  background: rgb(21 128 61 / 0.92);
  border-color: rgb(134 239 172 / 0.5);
  color: #fff;
}

/* Continue button on the series page */
.series-page-actions__continue {
  background: var(--accent, #9f1239) !important;
  border-color: var(--accent, #9f1239) !important;
  color: #fff !important;
}

/* ── Floating messenger ─────────────────────────────── */
.en-messenger {
  position: fixed;
  right: 1rem;
  bottom: calc(3.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 99990;
}

.en-messenger[hidden] {
  display: none;
}

@media (min-width: 768px) {
  .en-messenger {
    right: 1.5rem;
    bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px));
  }
}

/* Sit above the floating chapter bar on reader pages */
body:has(.chapter-float-nav) .en-messenger,
.en-messenger--reader {
  bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
}

/* The messenger replaces the header bell */
#header-announcement-bell {
  display: none !important;
}

.en-messenger__fab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: var(--accent, #9f1239);
  color: #fff;
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.45);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.en-messenger__fab:hover {
  background: var(--accent-dark, #be123c);
  transform: scale(1.05);
}

.en-messenger__fab svg {
  width: 28px;
  height: 28px;
}

.en-messenger__fab.has-unread::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgb(253 164 175 / 0.7);
  animation: en-ring 1.8s ease-out infinite;
}

.en-messenger__fab.is-bump {
  animation: en-bump 0.5s ease;
}

@keyframes en-ring {
  from { transform: scale(0.9); opacity: 1; }
  to   { transform: scale(1.35); opacity: 0; }
}

@keyframes en-bump {
  0%, 100% { transform: scale(1); }
  40%      { transform: scale(1.18); }
}

.en-messenger__badge {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  border: 2px solid #0f172a;
  background: #fff;
  color: var(--accent, #9f1239);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 18px;
}

.en-messenger__badge[hidden] {
  display: none;
}

.en-messenger__panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  display: flex;
  flex-direction: column;
  width: min(92vw, 23rem);
  max-height: min(70vh, 32rem);
  border-radius: 1rem;
  border: 1px solid rgb(51 65 85);
  background: rgb(15 23 42);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.55);
  overflow: hidden;
  animation: en-pop 0.18s ease-out;
}

.en-messenger__panel[hidden] {
  display: none;
}

.en-messenger__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgb(51 65 85);
  background: rgb(30 41 59);
}

.en-messenger__title {
  color: #fff;
  font-size: 1rem;
}

.en-messenger__head-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.en-messenger__inbox {
  color: #fda4af;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.en-messenger__inbox:hover {
  text-decoration: underline;
}

.en-messenger__close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #94a3b8;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.en-messenger__close:hover {
  background: rgb(51 65 85);
  color: #fff;
}

.en-messenger__list {
  flex: 1;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Reuse the bell's item look, tightened for the panel */
.en-messenger__list .header-announcement-panel__item {
  margin: 0 0 0.25rem;
  border-radius: 0.75rem;
}

.en-messenger__list .header-announcement-panel__item.is-unread {
  background: rgb(159 18 57 / 0.14);
}

.en-messenger__empty {
  margin: 0;
  padding: 1.5rem 1rem;
  color: #94a3b8;
  text-align: center;
}

.en-messenger__notify {
  margin: 0.5rem auto 0.75rem;
}

@media (max-width: 640px) {
  .en-messenger__fab {
    width: 56px;
    height: 56px;
  }
}

.series-page-actions__read--secondary {
  background: transparent !important;
  border: 1px solid rgb(71 85 105) !important;
  color: #e2e8f0 !important;
}

/* ── Contact & Support switch + merged inbox bits ───── */
.en-support-switch {
  display: flex;
  gap: 0.5rem;
  margin-top: 2rem;
}

.en-support-switch__item {
  flex: 1;
  padding: 0.8rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgb(51 65 85);
  background: rgb(15 23 42);
  color: #cbd5e1;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.en-support-switch__item:hover {
  color: #fff;
  border-color: rgb(100 116 139);
}

.en-support-switch__item.is-active {
  border-color: var(--accent, #9f1239);
  background: rgb(159 18 57 / 0.18);
  color: #fff;
}

.en-user-messages__topic {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.en-user-messages__topic label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.en-user-messages__topic label:has(input:checked) {
  border-color: var(--accent, #9f1239);
  background: rgb(159 18 57 / 0.2);
  color: #fff;
}

.en-user-messages__proof {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border: 1px dashed rgb(71 85 105);
  border-radius: 1rem;
}

.en-user-messages__proof summary {
  cursor: pointer;
  color: #fda4af;
  font-weight: 600;
}

.en-user-messages__proof form {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.en-messenger__contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.5rem 0.6rem 0.3rem;
  min-height: 2.6rem;
  border-radius: 0.8rem;
  background: var(--accent, #9f1239);
  color: #fff !important;
  font-weight: 600;
  text-decoration: none;
}

.en-messenger__contact:hover {
  background: var(--accent-dark, #be123c);
}

/* ── "Get new series updates" prompt while reading ──── */
.en-push-prompt {
  position: fixed;
  left: 50%;
  bottom: calc(6rem + env(safe-area-inset-bottom, 0px));
  z-index: 99995;
  display: flex;
  gap: 0.8rem;
  width: min(calc(100vw - 24px), 25rem);
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid rgb(71 85 105);
  background: linear-gradient(180deg, rgb(30 41 59) 0%, rgb(15 23 42) 100%);
  box-shadow: 0 20px 50px rgb(0 0 0 / 0.55);
  color: #e2e8f0;
  transform: translateX(-50%);
  animation: en-slide-up 0.25s ease-out;
}

.en-push-prompt.is-leaving {
  opacity: 0;
  transition: opacity 0.2s ease;
}

@keyframes en-slide-up {
  from { transform: translate(-50%, 16px); opacity: 0; }
  to   { transform: translate(-50%, 0); opacity: 1; }
}

.en-push-prompt__icon {
  font-size: 1.6rem;
  line-height: 1;
}

.en-push-prompt__title {
  display: block;
  color: #fff;
  font-size: 1rem;
}

.en-push-prompt__text {
  margin: 0.25rem 0 0.75rem;
  color: #cbd5e1;
  font-size: 0.85rem;
  line-height: 1.45;
}

.en-push-prompt__actions {
  display: flex;
  gap: 0.5rem;
}

.en-push-prompt__actions .en-spotlight__btn {
  min-height: 2.4rem;
  font-size: 0.85rem;
}

/* ── Messenger speech bubble (hover / "You got a reply" / "Need help?") ── */
.en-messenger__bubble {
  position: absolute;
  right: 70px;
  bottom: 12px;
  width: max-content;
  max-width: min(15rem, calc(100vw - 110px));
  padding: 0.55rem 0.85rem;
  border: 0;
  border-radius: 0.9rem 0.9rem 0.25rem 0.9rem;
  background: #fff;
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.4);
  cursor: pointer;
  animation: en-pop 0.2s ease-out;
}

.en-messenger__bubble[hidden] {
  display: none;
}

.en-messenger__bubble.is-sticky {
  background: var(--accent, #9f1239);
  color: #fff;
}

.en-messenger.is-open .en-messenger__bubble {
  display: none;
}

/* ── Payment method on premium avatars ──────────────── */
.comment-avatar__badge--patreon {
  background: #ff424d !important;
  color: #fff !important;
}

.comment-avatar__badge--crypto {
  background: #fff !important;
  color: #26a17b !important;
}

.comment-avatar__badge--patreon i {
  font-size: 0.6em;
  line-height: 1;
}

.comment-avatar__badge-img {
  width: 70%;
  height: 70%;
  object-fit: contain;
}

/* Membership ending soon: the reader's own avatar pulses */
.comment-avatar__wrap.is-expiring {
  border-radius: 50%;
  animation: en-expiring 1.6s ease-in-out infinite;
}

@keyframes en-expiring {
  0%, 100% { box-shadow: 0 0 0 0 rgb(251 191 36 / 0.85); }
  50%      { box-shadow: 0 0 0 6px rgb(251 191 36 / 0); }
}

.en-push-prompt--warning {
  border-color: rgb(251 191 36 / 0.6);
}

.en-push-prompt__x {
  position: absolute;
  top: 6px;
  right: 6px;
}

.en-spotlight__slide[hidden] {
  display: none;
}

.en-spotlight__counter {
  color: #94a3b8;
  letter-spacing: 0.06em;
}

/* ── Membership summary (profile page + profile menu) ── */
.en-pay-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  margin-right: 0.3rem;
  border-radius: 50%;
  vertical-align: middle;
  flex-shrink: 0;
}

.en-pay-logo--patreon {
  background: #ff424d;
  color: #fff;
  font-size: 0.62rem;
}

.en-pay-logo--crypto {
  background: #fff;
  box-shadow: inset 0 0 0 1px rgb(38 161 123 / 0.35);
}

.en-pay-logo img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.en-member-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem 0.7rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.en-member-summary__via,
.en-member-summary__expiry {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgb(51 65 85);
  background: rgb(15 23 42 / 0.6);
}

.en-member-summary__expiry strong {
  color: #fff;
}

.en-member-summary.is-ending .en-member-summary__expiry {
  border-color: rgb(251 191 36 / 0.6);
  background: rgb(120 53 15 / 0.35);
  color: #fde68a;
  animation: en-expiring 1.6s ease-in-out infinite;
}

.en-member-summary__join {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: var(--accent, #9f1239);
  color: #fff !important;
  font-weight: 700;
  text-decoration: none;
}

.en-member-summary__join:hover {
  background: var(--accent-dark, #be123c);
}

.en-member-summary.is-free .en-member-summary__text {
  color: #94a3b8;
}

/* Compact version inside the header profile menu */
.en-member-summary--menu {
  justify-content: flex-start;
  margin-top: 0.6rem;
  font-size: 0.75rem;
}

.en-member-summary--menu .en-member-summary__via,
.en-member-summary--menu .en-member-summary__expiry {
  padding: 0.2rem 0.55rem;
}

.en-member-summary--menu .en-member-summary__join {
  padding: 0.35rem 0.8rem;
}

.en-member-summary--menu.is-free .en-member-summary__text {
  display: none;
}

.en-member-summary__infinity {
  font-size: 1.25em;
  line-height: 1;
  color: #fff;
}

/* Second badge (payment method) on admin avatars: top-right corner */
.comment-avatar__wrap .comment-avatar__badge--pay {
  top: 0.05rem;
  bottom: auto !important;
}

.comment-avatar__wrap--sm .comment-avatar__badge--pay {
  top: -0.15rem;
}
