/* Layered social modals — FB-style photo theater + legacy sheets */
.ep-overlay {
  position: fixed; inset: 0; z-index: 5000;
  background: rgba(28, 40, 52, 0.48);
  backdrop-filter: blur(6px);
  display: none;
  padding: 0;
  overflow: hidden;
}
.ep-overlay.open { display: flex; align-items: center; justify-content: center; }

/* Full-viewport Facebook-style post viewer */
.ep-overlay.ep-overlay-theater {
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: none;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}
.ep-theater-close {
  position: absolute;
  top: max(0.75rem, env(safe-area-inset-top));
  left: max(0.75rem, env(safe-area-inset-left));
  z-index: 6;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.ep-theater-close:hover { background: rgba(255, 255, 255, 0.22); }

.ep-theater {
  width: 100%;
  height: 100%;
  max-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(400px, 36vw);
  overflow: hidden;
  box-sizing: border-box;
}
.ep-overlay-theater.no-media .ep-theater {
  grid-template-columns: minmax(0, 1fr);
  max-width: 520px;
  margin: 0 auto;
  height: min(100dvh, 100%);
}
.ep-overlay-theater.no-media .ep-theater-media { display: none; }
.ep-overlay-theater.no-media .ep-theater-side {
  border-radius: 0;
  width: 100%;
  max-width: none;
}

.ep-theater-media {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ep-theater-media.is-zoomed {
  overflow: auto;
  cursor: grab;
}
.ep-theater-media.is-fs {
  width: 100%;
  height: 100%;
  background: #000;
}
.ep-theater-media-empty {
  color: rgba(255, 255, 255, 0.35);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
}

/* FB-style media toolbar (zoom / fullscreen) */
.ep-theater-tools {
  position: absolute;
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.ep-theater-tool {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(40, 40, 40, 0.72);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.15s ease, transform 0.12s ease;
}
.ep-theater-tool:hover:not(:disabled) {
  background: rgba(70, 70, 70, 0.88);
}
.ep-theater-tool:active:not(:disabled) {
  transform: scale(0.94);
}
.ep-theater-tool:disabled {
  opacity: 0.38;
  cursor: default;
}
.ep-theater-tool svg {
  display: block;
}

.ep-theater-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100dvh;
  background: #fff;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.ep-theater-side-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.ep-theater-side-close { display: none; }

.ep-overlay-stage {
  width: 100%;
  height: 100%;
  max-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(0.75rem, env(safe-area-inset-top)) 1rem max(0.75rem, env(safe-area-inset-bottom));
  overflow: auto;
  box-sizing: border-box;
}

.ep-sheet {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(20, 35, 50, 0.22);
  border: 1px solid rgba(42, 54, 66, 0.06);
  animation: rise 0.22s ease;
  max-height: min(92dvh, calc(100vh - 2rem));
  width: min(100%, 620px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: auto;
}

.ep-sheet-post {
  width: min(100%, var(--feed-width, 620px));
  height: min(92dvh, calc(100vh - 2rem));
  max-height: min(92dvh, calc(100vh - 2rem));
  flex: 0 0 auto;
}
.ep-sheet-buy { width: min(100%, 340px); }
.ep-sheet-create { width: min(100%, 420px); }

.ep-sheet-head {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #fff; z-index: 2;
  flex-shrink: 0;
}
.ep-sheet-head h3 {
  font-family: var(--font); font-size: 1rem; font-weight: 700; margin: 0; flex: 1;
}
.ep-icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: var(--surface); cursor: pointer; display: grid; place-items: center;
  color: var(--text); font-size: 1rem; line-height: 1;
}
.ep-icon-btn:hover { background: var(--sky-soft); }

.badge-approve {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.7rem; font-weight: 700; color: var(--teal-deep);
  border: 1px solid rgba(24, 119, 242,0.45); background: rgba(24, 119, 242,0.1);
  padding: 0.2rem 0.55rem; border-radius: 999px; white-space: nowrap;
}
.badge-author {
  font-size: 0.65rem; font-weight: 700; color: #fff;
  background: var(--teal); padding: 0.12rem 0.45rem; border-radius: 6px;
}
.badge-waiting {
  font-size: 0.68rem; font-weight: 700; color: #8a6a2a;
  background: #f5e6c8; padding: 0.15rem 0.5rem; border-radius: 8px;
}

.ep-theater-side .ep-post-scroll {
  padding: 0.85rem 1rem 0.75rem;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.ep-post-scroll {
  padding: 1rem 1.1rem 0.75rem;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.ep-post-skeleton {
  min-height: 100%;
}
.ep-author {
  display: flex; gap: 0.7rem; align-items: center; margin-bottom: 0.75rem;
}
.ep-author img {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
}
.ep-author strong { display: block; font-size: 0.95rem; }
.ep-author .meta { font-size: 0.78rem; color: var(--muted); }
.verified { color: var(--teal); font-size: 0.85rem; }

.ep-post-text { font-size: 0.95rem; margin: 0 0 0.85rem; line-height: 1.5; }
.ep-post-text .tag { color: var(--teal-deep); font-weight: 600; }

/* Theater media: fill left pane; sharp photo with object-fit:contain over blur match. */
.ep-theater-media .ep-post-img {
  position: absolute;
  inset: 0;
  isolation: isolate;
  border-radius: 0;
  overflow: hidden;
  margin: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  background: #000;
}
.ep-post-img {
  position: relative;
  isolation: isolate;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 0.85rem;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: min(70dvh, 640px);
  background: #12161c;
}
.ep-post-img-bg {
  position: absolute;
  inset: -22%;
  z-index: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(36px) saturate(1.15) brightness(0.55);
  transform: scale(1.12);
  pointer-events: none;
}
.ep-post-img-fg,
.ep-post-img img.ep-post-img-fg {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: contain !important;
  object-position: center;
  display: block;
  transform: scale(var(--ep-zoom, 1));
  transform-origin: center center;
  transition: transform 0.18s ease;
}
.ep-theater-media.is-zoomed .ep-post-img-fg,
.ep-theater-media.is-zoomed .ep-post-img img.ep-post-img-fg {
  /* Keep sharp while panning a zoomed photo */
  transition: none;
}

.ep-post-products {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}
.ep-post-products .product-attach {
  margin: 0;
}
.ep-product-card {
  display: flex; gap: 1.05rem; align-items: center;
  padding: 0.7rem 0.75rem; border-radius: 16px;
  border: 1px solid rgba(42, 54, 66, 0.08);
  background: linear-gradient(135deg, #f5f9ff, #e7f0fe);
  margin-bottom: 0.85rem;
  min-width: 0; max-width: 100%; overflow: hidden; box-sizing: border-box;
}
.ep-product-link {
  display: flex; gap: 0.75rem; align-items: center;
  flex: 1; min-width: 0; color: inherit;
  border-radius: 12px;
}
.ep-product-link:hover .ep-product-info strong { color: var(--teal-deep); }
.ep-product-link img {
  width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex-shrink: 0;
  background: #fff;
}
.ep-product-info { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.ep-product-info strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; max-width: 100%; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: normal; word-break: break-word; line-height: 1.3; }
.ep-product-card .tags { font-size: 0.72rem; color: var(--muted); margin: 0.15rem 0; }
.ep-product-card .price { font-weight: 800; font-size: 0.95rem; }
.ep-product-card .price s { color: var(--muted); font-weight: 500; margin-left: 0.35rem; font-size: 0.8rem; }
.ep-product-actions { display: flex; align-items: center; gap: 0.55rem; flex-shrink: 0; margin-left: 0.45rem;
}
.ep-product-actions .js-open-buy,
.ep-product-actions .btn-primary,
.ep-product-actions .pcard-buy {
  flex: 0 0 auto !important;
  border-radius: 999px;
  padding: 0 0.7rem !important;
  width: auto;
  min-width: 0;
  min-height: 30px !important;
  height: 30px !important;
  max-height: 30px !important;
  line-height: 1 !important;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, var(--action) 0%, var(--action-deep) 100%);
  color: var(--action-text);
  border: 1px solid var(--action-border);
  box-shadow: 0 6px 14px rgba(245, 200, 74, 0.28);
  cursor: pointer;
  gap: 0.25rem;
}
.ep-product-actions .js-open-buy:hover,
.ep-product-actions .btn-primary:hover,
.ep-product-actions .pcard-buy:hover {
  cursor: pointer;
}
.ep-product-actions .pcard-cart {
  cursor: pointer;
}
.ep-product-actions .pcard-cart {
  flex: 0 0 auto;
  width: 30px !important;
  min-width: 30px !important;
  height: 30px !important;
  max-height: 30px !important;
  box-sizing: border-box;
  border-radius: 50%;
  padding: 0 !important;
  background: linear-gradient(180deg, var(--action) 0%, var(--action-deep) 100%);
  border: 1px solid var(--action-border);
  box-shadow: 0 6px 14px rgba(245, 200, 74, 0.28);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.ep-product-actions .pcard-cart img {
  width: 15px;
  height: 15px;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
  pointer-events: none;
  filter: brightness(0) saturate(100%) invert(18%) sepia(18%) saturate(900%) hue-rotate(12deg) brightness(92%) contrast(92%);
}

.ep-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0.35rem 0 0.65rem;
  border-bottom: 1px solid var(--line);
}
.ep-stats-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.rx-summary {
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}
.rx-chip {
  display: inline-grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 3px rgba(42, 54, 66, 0.2);
  margin-left: -0.4rem;
  position: relative;
}
.rx-summary .rx-chip:last-child {
  margin-left: 0;
}
.rx-chip-emoji {
  font-size: 0.82rem;
  line-height: 1;
}
.ep-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding: 0.45rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.65rem;
  position: relative;
}
.ep-actions > button,
.ep-actions .ep-react-trigger {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.ep-actions > button:hover,
.ep-actions .ep-react-trigger:hover {
  background: var(--surface);
  color: var(--text);
}
.ep-actions .rx-summary {
  margin-left: auto;
}

.ep-react-wrap {
  position: relative;
  display: inline-flex;
  justify-content: flex-start;
}
.ep-react-trigger.is-reacted { color: var(--teal-deep); }
.ep-react-tray {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.35rem);
  transform: translateX(-50%);
  display: flex;
  gap: 0.2rem;
  padding: 0.35rem 0.4rem;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(20, 35, 50, 0.18);
  border: 1px solid rgba(42, 54, 66, 0.08);
  z-index: 5;
  animation: epReactIn 0.16s ease;
}
@keyframes epReactIn {
  from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(0.92); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
.ep-react-emoji {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
  transition: transform 0.12s ease;
  padding: 0 !important;
}
.ep-react-emoji span { font-size: 1.35rem; line-height: 1; }
.ep-react-emoji em {
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 700;
  background: #1c2834;
  color: #fff;
  padding: 0.12rem 0.35rem;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
.ep-react-emoji:hover { transform: translateY(-6px) scale(1.18); background: transparent !important; }
.ep-react-emoji:hover em { opacity: 1; }
.ep-react-emoji.is-active { background: rgba(24, 119, 242, 0.12) !important; }

.ep-share-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(28, 40, 52, 0.28);
  padding: 1rem;
  box-sizing: border-box;
}
.ep-sheet-share {
  width: min(100%, 440px);
  margin-bottom: 0.5rem;
}
.ep-share-body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
}

/* One horizontal row: SHARE + icons */
.ep-sheet-share .ep-share-rail {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(42, 54, 66, 0.08);
  box-shadow: 0 8px 24px rgba(42, 54, 66, 0.1);
  width: 100%;
  box-sizing: border-box;
}
.ep-sheet-share .ep-share-label {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8a97a3;
  flex: 0 0 auto;
  writing-mode: horizontal-tb !important;
  transform: none !important;
  margin: 0;
  padding: 0 0.2rem 0 0;
}
.ep-sheet-share .ep-share-icons {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex: 0 1 auto;
  min-width: 0;
}
.ep-sheet-share .ep-share-icons > .share-ico,
.ep-sheet-share .share-ico {
  width: 48px !important;
  height: 48px !important;
  border-radius: 13px;
  display: grid !important;
  place-items: center;
  background: #f4f7f9;
  border: 1px solid rgba(42, 54, 66, 0.06);
  flex: 0 0 auto;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.ep-sheet-share .share-ico img {
  width: 22px !important;
  height: 22px !important;
  display: block;
}
.ep-sheet-share .share-ico:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(42, 54, 66, 0.08);
}
.ep-sheet-share .share-fb:hover { background: rgba(24, 119, 242, 0.1); border-color: rgba(24, 119, 242, 0.22); }
.ep-sheet-share .share-wa:hover { background: rgba(37, 211, 102, 0.1); border-color: rgba(37, 211, 102, 0.22); }
.ep-sheet-share .share-ig:hover { background: rgba(228, 64, 95, 0.1); border-color: rgba(228, 64, 95, 0.22); }
.ep-sheet-share .share-x:hover { background: rgba(15, 20, 25, 0.08); border-color: rgba(15, 20, 25, 0.18); }
.ep-sheet-share .share-li:hover { background: rgba(10, 102, 194, 0.1); border-color: rgba(10, 102, 194, 0.22); }

@media (max-width: 420px) {
  .ep-sheet-share .ep-share-rail {
    padding: 0.55rem 0.65rem;
    gap: 0.45rem;
  }
  .ep-sheet-share .ep-share-icons {
    gap: 0.35rem;
  }
  .ep-sheet-share .ep-share-icons > .share-ico,
  .ep-sheet-share .share-ico {
    width: 42px !important;
    height: 42px !important;
    border-radius: 12px;
  }
  .ep-sheet-share .share-ico img {
    width: 20px !important;
    height: 20px !important;
  }
  .ep-sheet-share .ep-share-label {
    font-size: 0.64rem;
  }
}

.ep-btn-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  display: inline-block;
  margin-right: 0.35rem;
  vertical-align: -2px;
  animation: epSpin 0.7s linear infinite;
}
@keyframes epSpin {
  to { transform: rotate(360deg); }
}

.ep-toast-stack {
  position: fixed;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 6000;
  display: grid;
  gap: 0.45rem;
  width: min(92vw, 360px);
  pointer-events: none;
}
.ep-toast {
  background: #1c2834;
  color: #fff;
  border-radius: 14px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 14px 36px rgba(20, 35, 50, 0.28);
  animation: epToastIn 0.2s ease;
}
.ep-toast-success { background: #0f6b4c; }
.ep-toast-warn { background: #8a5a12; }
@keyframes epToastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Comments / Reviews tabs */
.ep-engage-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem;
  padding: 0.2rem; margin-bottom: 0.85rem;
  background: var(--surface); border-radius: 14px;
}
.ep-tab {
  border: 0; background: transparent; cursor: pointer;
  padding: 0.55rem 0.75rem; border-radius: 11px;
  font-weight: 700; font-size: 0.85rem; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
}
.ep-tab em {
  font-style: normal; font-size: 0.72rem; font-weight: 800;
  background: rgba(42,54,66,0.08); color: var(--muted);
  padding: 0.1rem 0.4rem; border-radius: 999px;
}
.ep-tab.is-active {
  background: #fff; color: var(--teal-deep);
  box-shadow: 0 4px 14px rgba(42, 54, 66, 0.08);
}
.ep-tab.is-active em {
  background: rgba(24, 119, 242,0.18); color: var(--teal-deep);
}

.ep-comments h4 {
  font-family: var(--font); font-size: 0.88rem; margin: 0 0 0.65rem;
}
.ep-comments {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

/* FB-style comment tree */
.ep-comment {
  --ep-tree: #ccd0d5;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  column-gap: 0.55rem;
  align-items: stretch;
  margin-bottom: 0.55rem;
  position: relative;
}
.ep-c-rail {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 36px;
  min-height: 36px;
}
.ep-c-stem {
  flex: 1 1 auto;
  width: 2px;
  margin-top: 4px;
  margin-bottom: 2px;
  background: var(--ep-tree);
  border-radius: 1px;
  min-height: 10px;
}
.ep-c-elbow {
  /* Reach from reply avatar back to the parent stem in the left rail */
  position: absolute;
  top: 0;
  right: 50%;
  width: calc(18px + 0.55rem + 14px);
  height: 16px;
  border-left: 2px solid var(--ep-tree);
  border-bottom: 2px solid var(--ep-tree);
  border-bottom-left-radius: 10px;
  pointer-events: none;
  box-sizing: border-box;
}
.ep-comment.is-reply {
  grid-template-columns: 28px minmax(0, 1fr);
  margin-bottom: 0.45rem;
  margin-top: 0.15rem;
}
.ep-comment.is-reply .ep-c-rail {
  width: 28px;
  min-height: 28px;
}
.ep-comment.is-thread-open > .ep-c-rail .ep-c-stem {
  /* End the stem near the last reply elbow instead of past "Hide replies" */
  margin-bottom: 1.6rem;
}
.ep-c-main {
  min-width: 0;
  padding-bottom: 0.1rem;
}
.ep-comment > img,
.ep-c-rail > img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.ep-comment .ep-comment-media {
  display: block;
  margin: 0.45rem 0 0.1rem;
  border-radius: 14px;
  background: #fff;
}
.ep-comment .ep-comment-media-sticker {
  width: min(168px, 70vw);
  height: min(168px, 70vw);
  max-width: 100%;
  object-fit: contain;
  border-radius: 14px;
}
.ep-comment .ep-comment-media-gif {
  width: min(240px, 82vw);
  height: min(180px, 62vw);
  max-width: 100%;
  object-fit: contain;
  border-radius: 14px;
}
.ep-comment .ep-comment-media-photo {
  width: min(260px, 88vw);
  height: min(200px, 68vw);
  max-width: 100%;
  object-fit: cover;
  border-radius: 14px;
}
.ep-comment .bubble {
  background: var(--surface);
  border-radius: 18px;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  display: inline-block;
  max-width: 100%;
  box-sizing: border-box;
}
.ep-comment .bubble.pending-box {
  background: #fff8ec; border: 1px solid #f0d9a8;
}
.ep-comment .bubble .ep-comment-rich { display: block; }
.ep-comment .name { font-weight: 700; font-size: 0.82rem; display: inline-block; margin-right: 0.35rem; }
.ep-comment .cmeta { font-size: 0.72rem; color: var(--muted); margin-top: 0.25rem; }
.ep-replies {
  margin-top: 0.35rem;
  padding-left: 0;
  position: relative;
}
.ep-view-replies {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.2rem 0 0.15rem;
  padding: 0.15rem 0 0.15rem 0.15rem;
  border: 0;
  background: transparent;
  color: var(--teal-deep);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.ep-view-replies:hover { text-decoration: underline; }
.ep-view-replies-elbow {
  position: absolute;
  left: calc(-0.55rem - 18px);
  top: 0;
  width: calc(0.55rem + 22px);
  height: 14px;
  border-left: 2px solid var(--ep-tree, #ccd0d5);
  border-bottom: 2px solid var(--ep-tree, #ccd0d5);
  border-bottom-left-radius: 10px;
  pointer-events: none;
  box-sizing: border-box;
}
.ep-view-replies.is-collapse {
  padding-left: 0;
  color: var(--muted);
  font-weight: 600;
}
.ep-view-replies.is-collapse:hover { color: var(--text); }

/* Parent stem continues through collapsed "view replies" row */
.ep-comment.has-replies:not(.is-thread-open) .ep-c-stem {
  min-height: 28px;
}
.ep-reply-btn {
  border: 0; background: transparent; color: var(--teal-deep);
  font: inherit; font-size: inherit; font-weight: 700; cursor: pointer; padding: 0;
}
.ep-reply-btn:hover { text-decoration: underline; }
.ep-delete-btn {
  border: 0; background: transparent; color: #c0392b;
  font: inherit; font-size: inherit; font-weight: 700; cursor: pointer; padding: 0;
}
.ep-delete-btn:hover { text-decoration: underline; }
.ep-delete-btn:disabled { opacity: 0.55; cursor: wait; }
.ep-mention {
  color: var(--teal-deep); font-weight: 700; text-decoration: none;
}
.ep-mention:hover { text-decoration: underline; }
.ep-replying {
  display: flex; align-items: center; gap: 0.35rem;
  width: 100%; font-size: 0.78rem; color: var(--muted); margin-bottom: 0.35rem;
}
.ep-replying strong { color: var(--text); }
.ep-replying button {
  margin-left: auto; border: 0; background: transparent; cursor: pointer;
  font-size: 1rem; line-height: 1; color: var(--muted); padding: 0.1rem 0.35rem;
}
.ep-composer {
  display: flex; flex-direction: column; gap: 0.35rem; align-items: stretch;
  margin-top: 0;
  padding: 0.75rem 1.1rem 1rem;
  border-top: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
}
/* FB: composer sits after the last comment inside the scroll area */
.ep-composer.ep-composer-inline {
  margin-top: 0.35rem;
  margin-bottom: 0.5rem;
  padding: 0.55rem 0 1.25rem;
  border-top: 0;
  background: transparent;
  flex-shrink: 0;
}
.ep-theater-side .ep-composer:not(.ep-composer-inline) {
  padding: 0.65rem 0.9rem 0.85rem;
}
.ep-composer-row {
  display: flex; gap: 0.5rem; align-items: center;
}
.ep-composer-input-wrap {
  position: relative; flex: 1;
}
.ep-composer input {
  width: 100%; border: 1px solid var(--line); border-radius: 999px;
  padding: 0.65rem 0.9rem; background: var(--surface);
}
.ep-composer .cc-composer .ep-mention-menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px);
}
.ep-mention-menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px);
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(20, 40, 70, 0.12);
  max-height: 220px; overflow: auto; z-index: 9;
}
.ep-mention-menu button {
  display: flex; align-items: center; gap: 0.55rem; width: 100%;
  border: 0; background: transparent; text-align: left;
  padding: 0.55rem 0.7rem; cursor: pointer; font: inherit;
}
.ep-mention-menu button:hover { background: var(--surface); }
.ep-mention-empty {
  padding: 0.65rem 0.75rem; font-size: 0.8rem; color: var(--muted);
}
.ep-composer .tools { display: flex; gap: 0.15rem; }
.ep-composer .tools button {
  border: 0; background: transparent; cursor: pointer; padding: 0.35rem; border-radius: 8px;
  font-size: 0.95rem;
}
.ep-stars { display: inline-flex; gap: 0.08rem; letter-spacing: 0; line-height: 1; }
.ep-stars span { color: rgba(42,54,66,0.18); }
.ep-stars span.on { color: #f0b429; text-shadow: 0 1px 0 rgba(240,180,41,0.25); }
.ep-stars-sm { font-size: 0.78rem; }
.ep-stars-md { font-size: 0.95rem; }
.ep-stars-lg { font-size: 1.15rem; }

.ep-review-summary {
  display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center;
  padding: 0.9rem 1rem; border-radius: 18px;
  background:
    radial-gradient(120px 80px at 10% 20%, rgba(187, 212, 252,0.55), transparent 70%),
    linear-gradient(145deg, #f5f9ff, #e7f0fe);
  border: 1px solid rgba(24, 119, 242,0.18);
  margin-bottom: 0.85rem;
}
.ep-score { text-align: center; min-width: 88px; }
.ep-score-num {
  font-family: var(--font);
  font-size: 2.4rem; font-weight: 800; line-height: 1;
  color: var(--text); letter-spacing: -0.03em;
}
.ep-bars { display: grid; gap: 0.28rem; }
.ep-bar-row {
  display: grid; grid-template-columns: 14px 1fr 22px; gap: 0.4rem; align-items: center;
  font-size: 0.72rem; color: var(--muted); font-weight: 700;
}
.ep-bar {
  height: 7px; border-radius: 999px; background: rgba(42,54,66,0.08); overflow: hidden;
}
.ep-bar i {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #f6c453, #f0b429);
}

.ep-rate-box {
  padding: 0.9rem 1rem; border-radius: 18px;
  border: 1px dashed rgba(24, 119, 242,0.4);
  background: rgba(255,255,255,0.7);
  margin-bottom: 0.9rem;
  text-align: center;
}
.ep-rate-label {
  font-size: 0.82rem; font-weight: 700; color: var(--muted); margin-bottom: 0.45rem;
}
.ep-rate-stars { display: inline-flex; gap: 0.2rem; margin-bottom: 0.35rem; }
.ep-rate-star {
  border: 0; background: transparent; cursor: pointer;
  font-size: 1.85rem; line-height: 1; color: rgba(42,54,66,0.16);
  transition: transform 0.12s ease, color 0.12s ease;
  padding: 0.1rem 0.15rem;
}
.ep-rate-star:hover,
.ep-rate-stars:hover .ep-rate-star { color: #f6c453; }
.ep-rate-star:hover ~ .ep-rate-star { color: rgba(42,54,66,0.16); }
.ep-rate-star.is-on { color: #f0b429; transform: scale(1.18); }
.ep-rate-form {
  display: grid; gap: 0.55rem; margin-top: 0.55rem; text-align: left;
}
.ep-rate-form textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 14px;
  padding: 0.65rem 0.8rem; resize: vertical; min-height: 64px;
  background: #fff; outline: none;
}
.ep-rate-form textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(24, 119, 242,0.18);
}
.ep-rate-thanks {
  margin: 0.55rem 0 0; font-weight: 700; color: var(--teal-deep); font-size: 0.9rem;
}

.ep-review {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.ep-review:last-child { border-bottom: 0; }
.ep-review-top {
  display: flex; gap: 0.6rem; align-items: flex-start; margin-bottom: 0.35rem;
}
.ep-review-meta strong { font-size: 0.88rem; margin-right: 0.35rem; }
.ep-review-sub {
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem;
}
.ep-review p { margin: 0; font-size: 0.88rem; line-height: 1.45; color: var(--text); }
.badge-buyer {
  display: inline-flex; align-items: center;
  font-size: 0.65rem; font-weight: 800; color: var(--teal-deep);
  background: rgba(24, 119, 242,0.14); padding: 0.12rem 0.4rem; border-radius: 6px;
  vertical-align: middle;
}

/* Buy sheet */
.ep-buy-item {
  display: flex; gap: 0.75rem; align-items: center;
  padding: 0.75rem; border-radius: 14px; background: var(--surface); margin-bottom: 1rem;
}
.ep-buy-item img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.ep-secure {
  display: flex; align-items: center; justify-content: center; gap: 0.35rem;
  font-size: 0.72rem; color: var(--muted); margin-top: 0.85rem;
}

/* Chat dock style (bottom-right suite companion) */
.ep-chat-dock {
  position: fixed; right: 1.25rem; bottom: 5.5rem; z-index: 115;
  width: min(calc(100vw - 2rem), 300px);
  background: #fff; border-radius: 18px;
  box-shadow: 0 18px 40px rgba(20,35,50,0.2);
  display: none; overflow: hidden; border: 1px solid var(--line);
}
.ep-chat-dock.open { display: block; animation: rise 0.2s ease; }
.ep-chat-dock .bar {
  height: 8px; background: linear-gradient(90deg, var(--teal), var(--sky));
}
.ep-chat-dock .inner { padding: 1rem 1.1rem 1.15rem; }
.ep-chat-dock .illust {
  width: 100%; height: 110px; object-fit: cover; border-radius: 12px; margin: 0.5rem 0 0.85rem;
  background: linear-gradient(145deg, #d0e2fc, #e7f0fe);
}

/* Create post — Facebook gate */
.ep-sheet-create {
  width: min(100%, 420px);
  position: relative;
  padding: 0;
  overflow: hidden;
  max-height: min(92dvh, calc(100vh - 2rem));
}
.ep-create-close {
  position: absolute; top: 0.75rem; right: 0.75rem; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%; border: 0;
  background: var(--surface); color: var(--muted);
  font-size: 1.25rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.ep-create-close:hover { background: var(--sky-soft); color: var(--text); }
.ep-create-body {
  padding: 1.75rem 1.5rem 1.35rem;
  text-align: center;
}
.ep-create-illust {
  width: 112px; height: 112px; margin: 0.25rem auto 1.1rem;
  border-radius: 50%; overflow: hidden;
  background: linear-gradient(145deg, #d0e2fc, #e7f0fe);
  box-shadow: 0 10px 28px rgba(24, 119, 242, 0.2);
}
.ep-create-illust img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  display: block;
  transform: scale(1.12);
}
.ep-create-body h3 {
  font-family: var(--font);
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0 0 0.55rem;
  color: var(--text);
}
.ep-create-body > p {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.ep-create-body .btn-fb {
  justify-content: center;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  font-weight: 700;
}
.ep-create-body .btn-fb .btn-ico {
  width: 1.2rem;
  height: 1.2rem;
}
.ep-fb-row {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.ep-create-cancel {
  display: block;
  width: 100%;
  margin-top: 0.85rem;
  border: 0;
  background: transparent;
  color: var(--teal-deep);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.35rem;
}
.ep-create-cancel:hover { text-decoration: underline; }
.ep-create-secure {
  margin-top: 1.1rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}
.ep-create-secure-ico {
  display: inline-flex;
  line-height: 0;
}
.ep-create-body .btn-fb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.ep-create-body .btn-fb:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.js-open-post, .js-open-buy, .js-open-create, .js-open-reviews, [data-open-post] {
  cursor: pointer;
}

@media (max-width: 980px) {
  .ep-sheet-post,
  .ep-sheet-buy { width: min(100%, 640px); }
  .ep-review-summary { grid-template-columns: 1fr; text-align: center; }
  .ep-bars { max-width: 280px; margin: 0 auto; }

  /* Stack theater: media on top, scrollable side below — still within 100dvh */
  .ep-theater {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 42dvh) minmax(0, 1fr);
  }
  .ep-theater-close { display: none; }
  .ep-theater-side-close { display: grid; }
  .ep-theater-side {
    border-left: 0;
    border-top: 1px solid var(--line);
    max-height: none;
  }
  .ep-overlay-theater.no-media .ep-theater {
    grid-template-rows: 1fr;
    max-width: none;
  }
}

@media (max-width: 560px) {
  .ep-theater {
    grid-template-rows: minmax(180px, 36dvh) minmax(0, 1fr);
  }
  .ep-theater-side .ep-product-card {
    flex-wrap: wrap;
  }
  .ep-theater-side .ep-product-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }
}

/* ---------- Share sheet (fixed, works from feed, post modal, post page) ---------- */
.ep-sharesheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 6000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  background: rgba(28, 40, 52, 0.46);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-sizing: border-box;
  animation: epShareFade 0.2s ease both;
}
.ep-sharesheet {
  position: relative;
  width: min(100%, 460px);
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  background: #fff;
  border-radius: 24px;
  border: 1px solid rgba(42, 54, 66, 0.06);
  box-shadow: 0 28px 70px rgba(20, 35, 50, 0.26);
  padding: 1.1rem 1.2rem 1.15rem;
  box-sizing: border-box;
  font-family: var(--font);
  color: var(--text);
  animation: epShareRise 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.05) both;
}
.ep-sharesheet-overlay.is-closing { animation: epShareFadeOut 0.18s ease both; }
.ep-sharesheet-overlay.is-closing .ep-sharesheet { animation: epShareSink 0.18s ease both; }
.ep-sharesheet-grip { display: none; }
.ep-sharesheet-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.ep-sharesheet-head h3 {
  flex: 1;
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.ep-sharesheet-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  transition: background 0.15s ease, transform 0.15s ease;
}
.ep-sharesheet-close:hover { background: var(--sky-soft); transform: rotate(90deg); }
.ep-sharesheet-preview {
  margin: 0 0 0.9rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ep-sharesheet-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem 0.4rem;
  margin: 0 0 0.95rem;
}
.ep-sharesheet-target {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.38rem;
  padding: 0.55rem 0.2rem 0.5rem;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.ep-sharesheet-ico {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #f4f7f9;
  border: 1px solid rgba(42, 54, 66, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.ep-sharesheet-ico img, .ep-sharesheet-ico svg { width: 24px; height: 24px; display: block; }
.ep-sharesheet-name { font-size: 0.74rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.ep-sharesheet-target:hover .ep-sharesheet-ico,
.ep-sharesheet-target:focus-visible .ep-sharesheet-ico {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(42, 54, 66, 0.1);
}
.ep-sharesheet-target:focus-visible { outline: none; }
.ep-sharesheet-target:focus-visible .ep-sharesheet-ico { outline: 2px solid var(--teal); outline-offset: 2px; }
.ep-sharesheet-target.is-native:hover .ep-sharesheet-ico { background: rgba(24, 119, 242, 0.1); border-color: rgba(24, 119, 242, 0.22); }
.ep-sharesheet-target.is-wa:hover .ep-sharesheet-ico { background: rgba(37, 211, 102, 0.1); border-color: rgba(37, 211, 102, 0.24); }
.ep-sharesheet-target.is-fb:hover .ep-sharesheet-ico { background: rgba(24, 119, 242, 0.1); border-color: rgba(24, 119, 242, 0.22); }
.ep-sharesheet-target.is-ms:hover .ep-sharesheet-ico { background: rgba(160, 51, 255, 0.09); border-color: rgba(160, 51, 255, 0.2); }
.ep-sharesheet-target.is-x:hover .ep-sharesheet-ico { background: rgba(15, 20, 25, 0.07); border-color: rgba(15, 20, 25, 0.18); }
.ep-sharesheet-target.is-tg:hover .ep-sharesheet-ico { background: rgba(41, 169, 235, 0.1); border-color: rgba(41, 169, 235, 0.24); }
.ep-sharesheet-target.is-li:hover .ep-sharesheet-ico { background: rgba(10, 102, 194, 0.1); border-color: rgba(10, 102, 194, 0.22); }
.ep-sharesheet-target.is-mail:hover .ep-sharesheet-ico { background: var(--sky-soft); border-color: rgba(24, 119, 242, 0.18); }
.ep-sharesheet-copy {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.35rem 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--line);
}
.ep-sharesheet-url {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  color: var(--muted);
  outline: none;
  text-overflow: ellipsis;
}
.ep-sharesheet-copybtn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.6rem 1rem;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
  background: var(--teal);
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease;
}
.ep-sharesheet-copybtn:hover { background: var(--teal-deep); }
.ep-sharesheet-copybtn:active { transform: scale(0.97); }
.ep-sharesheet-copybtn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.ep-sharesheet-copybtn.is-done { background: #1f9d61; }
.ep-sharesheet-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  margin: 0;
}
.ep-sharesheet-owner {
  margin: 0.85rem 0 0;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  background: var(--sky-soft);
  font-size: 0.8rem;
  color: var(--text);
}

@keyframes epShareFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes epShareFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes epShareRise { from { opacity: 0; transform: translateY(18px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes epShareSink { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(14px) scale(0.98); } }

@media (max-width: 560px) {
  .ep-sharesheet-overlay { align-items: flex-end; padding: 0; }
  .ep-sharesheet {
    width: 100%;
    border-radius: 24px 24px 0 0;
    padding: 0.6rem 1rem max(1rem, env(safe-area-inset-bottom));
    max-height: 88dvh;
  }
  .ep-sharesheet-grip {
    display: block;
    width: 42px;
    height: 5px;
    border-radius: 99px;
    background: rgba(42, 54, 66, 0.16);
    margin: 0 auto 0.6rem;
  }
  @keyframes epShareRise { from { transform: translateY(100%); } to { transform: none; } }
  @keyframes epShareSink { from { transform: none; } to { transform: translateY(100%); } }
  .ep-sharesheet-ico { width: 48px; height: 48px; border-radius: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .ep-sharesheet-overlay, .ep-sharesheet,
  .ep-sharesheet-overlay.is-closing, .ep-sharesheet-overlay.is-closing .ep-sharesheet { animation-duration: 0.01ms !important; }
  .ep-sharesheet-ico, .ep-sharesheet-close { transition: none; }
}