/* =====================================================================
 * Pop Emergency — 3.6 polish layer (loaded last, after pe-dark.css)
 * One place for the cross-page fixes: page gutters, card radius, glow
 * clipping, the shared sliding-tab component, menu, meta rows.
 * ===================================================================== */

:root { --pe-card-r: 32px; --pe-gutter: 20px; }

/* ---------- 1. Glows stay inside their rounded card (WebKit drew a square corner) ---------- */
.pe-dash-glass::before, .pe-msg-app::before { clip-path: inset(128px 128px -260px -260px round 0 var(--pe-card-r) 0 0); }
.pe-dash-glass::after { clip-path: inset(-260px -260px 0 128px round 0 0 0 var(--pe-card-r)); }
.pe-msg-app::after { clip-path: inset(-260px -260px 60px 128px round 0 0 0 var(--pe-card-r)); }
.pe-dash-glass, .pe-msg-app, .pe-auth-glass-card { isolation: isolate; }

/* ---------- 2. Same card radius everywhere ---------- */
body .pe-dash-glass, body .pe-msg-app, body .pe-auth-glass-card,
body .pe-glass-card.pe-dir-header-wrap, body .pe-tag-header-wrap, body .pe-cat-header-wrap,
body .pe-cover-wrapper, body .pe-sidebar-card,
body .pe-single-article > .mother-cont, body .vc_column-inner.mother-cont { border-radius: var(--pe-card-r) !important; }

/* ---------- 3. Mobile: every page lines up with the header pill ---------- */
@media (max-width: 768px) {
    :root { --pe-card-r: 28px; }
    body .pe-dashboard-wrapper { width: 100% !important; padding-left: var(--pe-gutter) !important; padding-right: var(--pe-gutter) !important; box-sizing: border-box; }
    body .pe-profile-container { padding-left: var(--pe-gutter) !important; padding-right: var(--pe-gutter) !important; box-sizing: border-box; }
    body .pe-profile-container .pe-cover-wrapper { width: 100% !important; max-width: 100% !important; box-sizing: border-box; }
    body .pe-single-container { width: 100% !important; padding-left: var(--pe-gutter) !important; padding-right: var(--pe-gutter) !important; margin-left: 0 !important; margin-right: 0 !important; box-sizing: border-box; }
    body .pe-auth-left-pane { border-radius: var(--pe-card-r) var(--pe-card-r) 0 0 !important; }
    body .pe-auth-right-pane { border-radius: 0 0 var(--pe-card-r) var(--pe-card-r) !important; }
    body .pe-msg-app { border-radius: var(--pe-card-r) !important; }
    /* Category page: same breathing room under the header as every other page */
    body .pe-cat-header-wrap { margin-top: 20px !important; }
}

/* ---------- 4. Post meta rows (author · date · replies) never collide ---------- */
.pe-post-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; min-width: 0; }
.pe-post-meta-left { min-width: 0; flex: 1 1 auto; }
.pe-post-meta-left object { display: block; min-width: 0; max-width: 100%; }
.pe-post-meta-left .pe-author-link { min-width: 0; max-width: 100%; }
.pe-post-meta-left .pe-author-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-post-meta-left .pe-author-link img { flex: none; }
.pe-post-meta-right { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 0; white-space: nowrap; flex: 0 1 auto; }
.pe-post-meta-right svg { flex: none; margin-right: 6px; }
@media (max-width: 560px) {
    .pe-post-meta { flex-direction: column; align-items: flex-start; }
    .pe-post-meta-left, .pe-post-meta-right { width: 100%; }
}
.pe-list-meta { flex-wrap: wrap; gap: 8px 12px; }
.pe-list-meta > div { flex-wrap: wrap; min-width: 0; }
.pe-tf-bottom { flex-wrap: wrap; gap: 10px 16px; }

/* ---------- 5. Sliding tabs (one engine for every tab strip, see pe-ui.js) ---------- */
.pe-dash-tabs, .pe-profile-tabs, .pe-auth-sliding-tabs { position: relative !important; }
.pe-tab-sliding-bg, .pe-profile-tabs-slider {
    left: 0 !important; top: 0 !important; bottom: auto !important;
    width: var(--pe-tw, 0px) !important; height: var(--pe-th, 0px) !important;
    transform: translate3d(var(--pe-tx, 0px), var(--pe-ty, 0px), 0) !important;
    transition: transform .42s cubic-bezier(.16,1,.3,1), width .42s cubic-bezier(.16,1,.3,1), height .42s cubic-bezier(.16,1,.3,1), opacity .2s !important;
    margin: 0 !important; pointer-events: none; will-change: transform, width;
}
.pe-tabs-ready .pe-tab-sliding-bg, .pe-tabs-ready .pe-profile-tabs-slider { opacity: 1; }
.pe-tab-sliding-bg:not([style*="--pe-tw"]), .pe-profile-tabs-slider:not([style*="--pe-tw"]) { opacity: 0; }
.pe-tabs-instant .pe-tab-sliding-bg, .pe-tabs-instant .pe-profile-tabs-slider { transition: none !important; }
.pe-dash-tab, .pe-tab-btn { position: relative; z-index: 1; }

/* Strips scroll sideways (no scrollbar) when the tabs don't fit; the active tab is scrolled into view. */
.pe-dash-tabs, .pe-profile-tabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-behavior: smooth; }
.pe-dash-tabs::-webkit-scrollbar, .pe-profile-tabs::-webkit-scrollbar { display: none; }
.pe-dash-tab, .pe-tab-btn { white-space: nowrap; flex: 1 0 auto !important; justify-content: center; }
body .pe-profile-tabs { gap: 4px; }
body .pe-tab-btn { padding: 12px 16px !important; font-size: .8rem !important; letter-spacing: .08em !important; }

@media (max-width: 768px) {
    body .pe-dash-tabs, body .pe-profile-tabs { display: flex !important; width: 100% !important; max-width: 100% !important; gap: 4px !important; padding: 5px !important; box-sizing: border-box; justify-content: flex-start !important; }
    body .pe-dash-tab, body .pe-tab-btn { padding: 11px 12px !important; font-size: 11px !important; letter-spacing: .07em !important; gap: 6px !important; min-height: 40px; }
    body .pe-dash-tab svg { width: 14px !important; height: 14px !important; flex: none; }
    .pe-hide-sm { display: none !important; }
}
@media (min-width: 769px) {
    body .pe-dash-tab { padding-left: 22px !important; padding-right: 22px !important; }
}
@media (max-width: 480px) {
    body .pe-dash-tab, body .pe-tab-btn { padding: 10px 8px !important; font-size: 10.5px !important; letter-spacing: .05em !important; }
}
@media (max-width: 380px) {
    body .pe-dash-tab, body .pe-tab-btn { padding: 10px 8px !important; font-size: 10px !important; letter-spacing: .04em !important; }
    body .pe-dash-tab svg { display: none !important; }
}

/* ---------- 6. Mobile menu: fits the screen, never scrolls, toggle always visible ---------- */
@media (max-width: 1110px) {
    body .main-menu-list.mobile-active, body .main-menu-list {
        height: 100vh !important; height: 100dvh !important; max-height: 100dvh !important;
        overflow: hidden !important; overscroll-behavior: contain;
        justify-content: space-evenly !important; align-items: center !important;
        padding: calc(env(safe-area-inset-top, 0px) + 96px) 20px calc(env(safe-area-inset-bottom, 0px) + 28px) !important;
        box-sizing: border-box !important; gap: 0 !important;
    }
    body .main-menu-list > li { margin: 0 !important; flex: 0 1 auto; min-height: 0; }
    body .main-menu-list > li > a { font-size: clamp(1.05rem, 3.4vh, 1.5rem) !important; padding: clamp(2px, .9vh, 10px) 0 !important; line-height: 1.1 !important; }
    body .main-menu-list > li.pe-mob-menu-theme { margin: clamp(6px, 1.6vh, 18px) auto 0 !important; flex: none; }
    body.mobile-menu-open .pe-chat-dock { opacity: 0 !important; pointer-events: none !important; }
}
@media (max-width: 1110px) and (max-height: 600px) {
    body .main-menu-list > li > a { font-size: clamp(.95rem, 3.6vh, 1.2rem) !important; padding: 1px 0 !important; }
    body .main-menu-list.mobile-active, body .main-menu-list { padding-top: calc(env(safe-area-inset-top, 0px) + 78px) !important; }
}

/* ---------- 7. Submit form: terms checkbox sits beside the text ---------- */
body .wpuf-el.terms_and_conditions label.pe-terms-label,
body .wpuf-form-add .wpuf-el.terms_and_conditions label.pe-terms-label {
    display: grid !important; grid-template-columns: 24px minmax(0, 1fr); column-gap: 14px; align-items: start; width: 100%; margin: 0 !important; cursor: pointer;
}
body .wpuf-el.terms_and_conditions label.pe-terms-label input[type="checkbox"] {
    grid-column: 1; width: 22px !important; height: 22px !important; min-width: 22px; margin: 2px 0 0 !important; padding: 0 !important; float: none !important; position: static !important;
    appearance: none; -webkit-appearance: none; border: 2px solid #a1a1aa; border-radius: 7px; background: #fff; display: grid; place-content: center; cursor: pointer; transition: background .15s, border-color .15s;
}
body .wpuf-el.terms_and_conditions label.pe-terms-label input[type="checkbox"]::after { content: ''; width: 11px; height: 6px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .15s; }
body .wpuf-el.terms_and_conditions label.pe-terms-label input[type="checkbox"]:checked { background: #4f46e5; border-color: #4f46e5; }
body .wpuf-el.terms_and_conditions label.pe-terms-label input[type="checkbox"]:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
body .wpuf-el.terms_and_conditions label.pe-terms-label .pe-submit-terms { grid-column: 2; margin: 0 !important; }
html[data-theme="dark"] body .wpuf-el.terms_and_conditions label.pe-terms-label input[type="checkbox"] { background: #18181e; border-color: #52525b; }
html[data-theme="dark"] body .wpuf-el.terms_and_conditions label.pe-terms-label input[type="checkbox"]:checked { background: #6366f1; border-color: #6366f1; }

/* ---------- 8. Tag page in dark mode ---------- */
html[data-theme="dark"] .pe-tag-marquee-wrap::before { background: linear-gradient(to right, #18181e, transparent) !important; }
html[data-theme="dark"] .pe-tag-marquee-wrap::after { background: linear-gradient(to left, #18181e, transparent) !important; }
html[data-theme="dark"] .pe-tag-marquee-wrap a { color: #d4d4d8; }

/* ---------- 9. Messages: long-press reacts without selecting text; reactions don't cover the bubble ---------- */
@media (hover: none) {
    .pe-msg-bubble, .pe-cw-bubble { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
}
:is(.pe-msg-bubble-row, .pe-cw-row).has-reacts { margin-bottom: 20px !important; }
:is(.pe-msg-bubble-row, .pe-cw-row).has-reacts :is(.pe-msg-bubble, .pe-cw-bubble) { padding-bottom: 12px; }
.pe-mreacts { bottom: -19px !important; }
.pe-mreact { height: 24px; }

/* ---------- 10. Profile cover actions: two tidy groups, equal heights ---------- */
body .pe-cover-actions { position: absolute; left: auto; right: 20px; bottom: 20px; display: flex !important; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px !important; max-width: calc(100% - 40px); }
.pe-ca-row { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.pe-ca-vote { display: inline-flex; gap: 8px; }
body .pe-cover-actions .pe-cover-btn { height: 42px; min-height: 42px; padding: 0 18px !important; display: inline-flex !important; align-items: center; justify-content: center; gap: 8px; margin: 0 !important; font-size: 13.5px !important; line-height: 1 !important; white-space: nowrap; box-sizing: border-box; text-decoration: none !important; transform: none !important; }
body .pe-cover-actions .pe-cover-btn svg { width: 16px !important; height: 16px !important; flex: none; }
body .pe-cover-actions .pe-cover-btn.pe-ca-icon { width: 42px; padding: 0 !important; }
body .pe-cover-actions .pe-btn-primary { background: linear-gradient(135deg, #6366f1, #8b5cf6) !important; border-color: transparent !important; color: #fff !important; }
body .pe-cover-actions .pe-btn-amber { background: #f59e0b !important; border-color: #f59e0b !important; color: #fff !important; }
body .pe-cover-actions .pe-btn-ghost-danger { color: #fecaca !important; }
body .pe-cover-actions .pe-vote-btn.voted-active[data-vote="like"] { background: #10b981 !important; border-color: #10b981 !important; color: #fff !important; }
body .pe-cover-actions .pe-vote-btn.voted-active[data-vote="dislike"] { background: #ef4444 !important; border-color: #ef4444 !important; color: #fff !important; }
.pe-cover-actions .pe-friend-btn.is-friend .icon-unfriend, .pe-cover-actions .pe-friend-btn.is-friend .text-unfriend { display: none; }
@media (hover: hover) {
    .pe-cover-actions .pe-friend-btn.is-friend:hover .icon-friend, .pe-cover-actions .pe-friend-btn.is-friend:hover .text-friend { display: none; }
    .pe-cover-actions .pe-friend-btn.is-friend:hover .icon-unfriend, .pe-cover-actions .pe-friend-btn.is-friend:hover .text-unfriend { display: inline-flex; }
    .pe-cover-actions .pe-friend-btn.is-friend:hover { background: #ef4444 !important; border-color: #ef4444 !important; }
}
.pe-ca-more-wrap { position: relative; }
.pe-ca-menu { position: absolute; right: 0; bottom: calc(100% + 8px); min-width: 170px; padding: 6px; border-radius: 16px; background: rgba(255,255,255,.97); border: 1px solid rgba(0,0,0,.08); box-shadow: 0 18px 40px rgba(15,23,42,.18); z-index: 30; display: flex; flex-direction: column; }
.pe-ca-menu[hidden] { display: none; }
.pe-ca-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 11px; background: transparent; font: 700 14px/1.2 var(--pe-font-body, 'DM Sans', sans-serif); color: #27272a; cursor: pointer; text-align: left; }
.pe-ca-menu button:hover { background: #f4f4f5; }
.pe-ca-menu button.is-danger { color: #dc2626; }
html[data-theme="dark"] .pe-ca-menu { background: rgba(24,24,30,.97); border-color: rgba(255,255,255,.1); }
html[data-theme="dark"] .pe-ca-menu button { color: #e4e4e7; }
html[data-theme="dark"] .pe-ca-menu button:hover { background: rgba(255,255,255,.07); }
html[data-theme="dark"] .pe-ca-menu button.is-danger { color: #f87171; }
@media (max-width: 768px) {
    body .pe-cover-wrapper:has(.pe-ca-primary) { height: auto !important; min-height: 190px; }
    body .pe-cover-actions { left: 14px; right: 14px; bottom: 14px; max-width: none; justify-content: stretch; flex-direction: column; align-items: stretch; gap: 8px !important; }
    .pe-ca-row { width: 100%; }
    .pe-ca-primary > * { flex: 1 1 0; min-width: 0; }
    .pe-ca-secondary { justify-content: flex-end; }
    .pe-ca-secondary .pe-ca-vote { margin-right: auto; }
    body .pe-cover-actions .pe-cover-btn { height: 40px; min-height: 40px; font-size: 13px !important; padding: 0 14px !important; }
    body .pe-cover-actions .pe-cover-btn.pe-ca-icon { width: 40px; }
    .pe-ca-row:only-child { justify-content: flex-end; }
    .pe-ca-row:only-child > .pe-cover-btn { flex: 0 0 auto; }
}

/* ---------- 11. Member directory cards: badges + the hover card's quick actions ---------- */
.pe-mc-foot .pe-hc-actions { display: flex; align-items: center; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--pe-line); }
.pe-mc-foot .pe-hc-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--pe-line-strong); background: var(--pe-surface); color: var(--pe-ink); font: 800 12.5px/1 var(--pe-font-body); cursor: pointer; text-decoration: none; white-space: nowrap; transition: all .15s; }
.pe-mc-foot .pe-hc-btn:hover { transform: translateY(-1px); border-color: var(--pe-ink); }
.pe-mc-foot .pe-hc-btn.is-primary { background: var(--pe-primary-grad); color: #fff; border-color: transparent; }
.pe-mc-foot .pe-hc-btn.is-accent { background: var(--pe-success); color: #fff; border-color: transparent; }
.pe-mc-foot .pe-hc-btn.is-on { background: rgba(16, 185, 129, .12); color: #059669; border-color: rgba(16, 185, 129, .35); }
.pe-mc-foot .pe-hc-btn:disabled { opacity: .5; }
.pe-mc-foot .pe-hc-vote { display: inline-flex; margin-left: auto; border: 1px solid var(--pe-line-strong); border-radius: 99px; overflow: hidden; }
.pe-mc-foot .pe-hc-icon { display: inline-grid; place-items: center; width: 34px; height: 32px; border: 0; background: transparent; color: var(--pe-muted); cursor: pointer; transition: all .15s; }
.pe-mc-foot .pe-hc-vote .pe-hc-icon + .pe-hc-icon { border-left: 1px solid var(--pe-line); }
.pe-mc-foot .pe-hc-icon:hover { color: var(--pe-ink); background: var(--pe-surface-2); }
.pe-mc-foot .pe-hc-icon.is-on { color: #059669; background: rgba(16, 185, 129, .12); }
.pe-mc-foot .pe-hc-icon.is-on.is-down { color: #dc2626; background: rgba(239, 68, 68, .12); }
.pe-mc-foot .pe-hc-more-wrap { position: relative; }
.pe-mc-foot .pe-hc-more-wrap > .pe-hc-icon { border-radius: 50%; border: 1px solid var(--pe-line-strong); }
.pe-mc-foot .pe-hc-vote + .pe-hc-more-wrap { margin-left: 0; }
.pe-mc-foot .pe-hc-actions > .pe-hc-more-wrap:only-child, .pe-mc-foot .pe-hc-btn + .pe-hc-more-wrap { margin-left: auto; }
.pe-mc-foot .pe-hc-menu { position: absolute; right: 0; bottom: calc(100% + 6px); min-width: 150px; padding: 6px; border-radius: 14px; background: var(--pe-surface); border: 1px solid var(--pe-line); box-shadow: var(--pe-shadow); z-index: 2; }
.pe-mc-foot .pe-hc-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--pe-ink); font: 700 13px var(--pe-font-body); cursor: pointer; text-align: left; }
.pe-mc-foot .pe-hc-menu button:hover { background: var(--pe-surface-2); }
.pe-mc-foot .pe-hc-menu .is-danger { color: var(--pe-danger); }
html[data-theme="dark"] body .pe-mc-foot .pe-hc-btn:not(.is-primary):not(.is-accent):not(.is-on),
html[data-theme="dark"] body .pe-mc-foot .pe-hc-vote,
html[data-theme="dark"] body .pe-mc-foot .pe-hc-more-wrap > .pe-hc-icon { background: rgba(255,255,255,.07) !important; border-color: rgba(255,255,255,.14) !important; }
html[data-theme="dark"] body .pe-mc-foot .pe-hc-actions { border-top-color: rgba(255,255,255,.08) !important; }
html[data-theme="dark"] body .pe-mc-foot .pe-hc-menu { background: rgba(28,28,38,.82) !important; border-color: rgba(255,255,255,.1) !important; }
.pe-member-card { position: relative; flex-wrap: wrap; align-items: center; row-gap: 0; }
.pe-member-card > .pe-mc-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.pe-member-card > .pe-mc-avatar-wrap, .pe-member-card > .pe-mc-info { position: relative; z-index: 2; pointer-events: none; }
.pe-member-card .pe-achs, .pe-member-card .pe-ach { pointer-events: auto; }
.pe-mc-foot { position: relative; z-index: 3; flex: 1 0 100%; min-width: 0; }
.pe-mc-foot:empty { display: none; }
.pe-mc-foot .pe-hc-actions { margin-top: 12px !important; flex-wrap: nowrap; }
@media (max-width: 480px) {
    .pe-mc-foot .pe-hc-btn { height: 32px; padding: 0 10px; font-size: 12px; gap: 5px; }
    .pe-mc-foot .pe-hc-btn svg { width: 14px; height: 14px; }
    .pe-mc-foot .pe-hc-icon { width: 30px; height: 30px; }
    .pe-mc-foot .pe-hc-more-wrap > .pe-hc-icon { width: 32px; height: 32px; }
    .pe-mc-foot .pe-hc-btn:not(.is-primary) { width: 32px; padding: 0; justify-content: center; }
    .pe-mc-foot .pe-hc-btn:not(.is-primary) span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
.pe-mc-foot .pe-hc-btn { text-decoration: none; }
.pe-member-card .pe-mc-info .pe-achs.is-compact { margin-top: 8px; }
.pe-member-card .pe-mc-link:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }
.pe-members-grid { align-items: start; }
.pe-ach-img{display:block;width:100%;height:100%;object-fit:contain}
html[data-theme="dark"] .pe-tab-sliding-bg, html[data-theme="dark"] .pe-profile-tabs-slider { background: rgba(255,255,255,.1) !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 4px 14px rgba(0,0,0,.25) !important; }
.pe-msg-pop.is-down{bottom:auto!important;top:calc(100% + 4px)!important}

/* ---------- 12. Reaction artwork (img/reactions) ---------- */
.pe-rx-img { display: block; object-fit: contain; -webkit-user-drag: none; user-select: none; pointer-events: none; }
.pe-mreact { padding: 0 7px 0 5px; gap: 3px; }
.pe-mreact .pe-rx-img { width: 16px; height: 16px; }
.pe-rpick button { display: grid; place-items: center; padding: 0; }
.pe-rpick button .pe-rx-img { width: 30px; height: 30px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.12)); }
.pe-react-emoji .pe-rx-img { width: 34px; height: 34px; filter: drop-shadow(0 3px 5px rgba(0,0,0,.12)); }
.pe-react-stack-emoji .pe-rx-img { width: 22px; height: 22px; }
.pe-react-stack-emoji + .pe-react-stack-emoji { margin-left: -6px !important; }
@media (max-width: 420px) {
    .pe-rpick { gap: 0 !important; padding: 5px !important; }
    .pe-rpick button { width: 38px !important; height: 38px !important; }
    .pe-rpick button .pe-rx-img { width: 28px; height: 28px; }
}
/* Article reactions on phones: an even 4 × 2 grid, the count as a small badge */
@media (max-width: 600px) {
    .pe-react-options { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
    .pe-react-opt { justify-content: center; padding: 10px 0 !important; aspect-ratio: 1 / 1; border-radius: 22px !important; }
    .pe-react-opt .pe-react-count { position: absolute; top: -6px; right: -4px; padding: 3px 7px; box-shadow: 0 2px 6px rgba(0,0,0,.15); background: #fff !important; color: #111114 !important; }
    html[data-theme="dark"] .pe-react-opt .pe-react-count { background: #2a2a33 !important; color: #f4f4f5 !important; }
}
.pe-react-opt.is-mine { background: linear-gradient(135deg, rgba(99,102,241,.16), rgba(236,72,153,.14)) !important; border-color: rgba(99,102,241,.55) !important; color: inherit !important; }
.pe-react-opt.is-mine .pe-react-count { background: rgba(99,102,241,.15); color: inherit; }

/* Article reaction summary: hover card with every reaction */
.pe-react-summary { position: relative; z-index: 60; }
.pe-react-tip { position: absolute; left: 0; top: calc(100% + 10px); z-index: 40; width: 250px; padding: 12px 14px 10px; border-radius: 18px; background: rgba(255,255,255,.96); -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%); border: 1px solid rgba(17,17,20,.07); box-shadow: 0 18px 44px rgba(15,23,42,.16); display: flex; flex-direction: column; gap: 7px; opacity: 0; visibility: hidden; transform: translateY(-4px) scale(.98); transform-origin: top left; transition: opacity .16s ease, transform .2s cubic-bezier(.2,.8,.2,1), visibility 0s linear .2s; pointer-events: none; color: #27272a; text-align: left; }
.pe-react-tip::before { content: ''; position: absolute; left: 22px; top: -6px; width: 12px; height: 12px; background: inherit; border-left: 1px solid rgba(17,17,20,.07); border-top: 1px solid rgba(17,17,20,.07); transform: rotate(45deg); }
.pe-react-summary:hover .pe-react-tip, .pe-react-summary:focus-visible .pe-react-tip { opacity: 1; visibility: visible; transform: none; transition: opacity .16s ease, transform .2s cubic-bezier(.2,.8,.2,1), visibility 0s; }
.pe-react-tip-head { font: 900 10.5px/1 var(--pe-font-body, 'DM Sans', sans-serif); letter-spacing: .12em; text-transform: uppercase; color: #a855f7; margin-bottom: 2px; }
.pe-react-tip-row { display: grid; grid-template-columns: 22px 74px 1fr auto; align-items: center; gap: 8px; font: 700 13px/1 var(--pe-font-body, 'DM Sans', sans-serif); }
.pe-react-tip-row .pe-rx-img { width: 22px; height: 22px; }
.pe-react-tip-bar { height: 6px; border-radius: 99px; background: rgba(17,17,20,.07); overflow: hidden; }
.pe-react-tip-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ec4899, #8b5cf6); }
.pe-react-tip-row b { font-weight: 900; font-size: 12.5px; min-width: 18px; text-align: right; color: #111114; }
.pe-react-tip-foot { margin-top: 3px; padding-top: 8px; border-top: 1px solid rgba(17,17,20,.06); font: 700 11.5px/1 var(--pe-font-body, 'DM Sans', sans-serif); color: #71717a; }
html[data-theme="dark"] .pe-react-tip { background: rgba(28,28,36,.97); border-color: rgba(255,255,255,.1); color: #e4e4e7; box-shadow: 0 18px 44px rgba(0,0,0,.45); }
html[data-theme="dark"] .pe-react-tip::before { border-color: rgba(255,255,255,.1); }
html[data-theme="dark"] .pe-react-tip-bar { background: rgba(255,255,255,.08); }
html[data-theme="dark"] .pe-react-tip-row b { color: #fff; }
html[data-theme="dark"] .pe-react-tip-foot { color: #a1a1aa; border-color: rgba(255,255,255,.08); }
@media (hover: none) { .pe-react-tip { display: none; } }

/* ---------- 13. Badge artwork (img/badges): flat, filled, light tier-coloured discs — no rings ---------- */
.pe-ach-ico:has(.pe-ach-img), .pe-ach-notif:has(.pe-ach-img) { --pe-disc: #f4f4f5; background: var(--pe-disc) !important; box-shadow: none !important; border: 0 !important; padding: 0; overflow: hidden; }
.pe-ach-ico .pe-ach-img, .pe-ach-notif .pe-ach-img { width: 68% !important; height: 68% !important; object-fit: contain; filter: none; }
.pe-ach.is-bronze .pe-ach-ico:has(.pe-ach-img), .pe-ach-notif.is-bronze:has(.pe-ach-img) { --pe-disc: #fde8d7; }
.pe-ach.is-silver .pe-ach-ico:has(.pe-ach-img), .pe-ach-notif.is-silver:has(.pe-ach-img) { --pe-disc: #e8edf3; }
.pe-ach.is-gold .pe-ach-ico:has(.pe-ach-img), .pe-ach-notif.is-gold:has(.pe-ach-img) { --pe-disc: #fef3c7; }
.pe-ach.is-special .pe-ach-ico:has(.pe-ach-img), .pe-ach-notif.is-special:has(.pe-ach-img) { --pe-disc: #f3e8ff; }
html[data-theme="dark"] .pe-ach-ico:has(.pe-ach-img), html[data-theme="dark"] .pe-ach-notif:has(.pe-ach-img) { --pe-disc: #2a2a33; }
html[data-theme="dark"] .pe-ach.is-bronze .pe-ach-ico:has(.pe-ach-img), html[data-theme="dark"] .pe-ach-notif.is-bronze:has(.pe-ach-img) { --pe-disc: #3b2a20; }
html[data-theme="dark"] .pe-ach.is-silver .pe-ach-ico:has(.pe-ach-img), html[data-theme="dark"] .pe-ach-notif.is-silver:has(.pe-ach-img) { --pe-disc: #2b3038; }
html[data-theme="dark"] .pe-ach.is-gold .pe-ach-ico:has(.pe-ach-img), html[data-theme="dark"] .pe-ach-notif.is-gold:has(.pe-ach-img) { --pe-disc: #3a3220; }
html[data-theme="dark"] .pe-ach.is-special .pe-ach-ico:has(.pe-ach-img), html[data-theme="dark"] .pe-ach-notif.is-special:has(.pe-ach-img) { --pe-disc: #2f2540; }

/* ---------- 14. Reaction summary card: a hover bridge so the pointer can travel into it ---------- */
.pe-react-tip::after { content: ''; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.pe-react-summary:hover .pe-react-tip, .pe-react-summary:focus-within .pe-react-tip, .pe-react-tip:hover { pointer-events: auto; opacity: 1; visibility: visible; transform: none; transition: opacity .16s ease, transform .2s cubic-bezier(.2,.8,.2,1), visibility 0s; }
/* a short grace period before it hides, in case the pointer cuts a corner */
.pe-react-tip { transition: opacity .16s ease .18s, transform .2s cubic-bezier(.2,.8,.2,1) .18s, visibility 0s linear .38s; }
.pe-react-tip-foot { display: block; }
.pe-react-tip-add { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; background: linear-gradient(135deg, #ec4899, #8b5cf6); color: #fff !important; font: 800 11.5px/1 var(--pe-font-body, 'DM Sans', sans-serif); letter-spacing: .02em; box-shadow: 0 6px 16px rgba(139,92,246,.28); transition: transform .15s ease, box-shadow .15s ease; }
.pe-react-tip-add:hover, .pe-react-tip-add:focus-visible { transform: translateY(-1px); box-shadow: 0 9px 20px rgba(139,92,246,.36); }
.pe-react-flash { animation: pe-react-flash 1.2s ease; border-radius: 22px; }
@keyframes pe-react-flash { 0%, 100% { box-shadow: 0 0 0 0 rgba(168,85,247,0); } 30% { box-shadow: 0 0 0 6px rgba(168,85,247,.22); } }

/* ---------- 15. Upload loader (peUploader) — same everywhere ---------- */
.pe-up { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(17,17,24,.42); -webkit-backdrop-filter: blur(10px) saturate(140%); backdrop-filter: blur(10px) saturate(140%); border-radius: inherit; opacity: 0; transition: opacity .22s ease; pointer-events: none; color: #fff; }
.pe-up.is-in { opacity: 1; }
.pe-up.is-out { opacity: 0; }
.pe-up-disc { position: relative; width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 10px 30px rgba(0,0,0,.25); display: grid; place-items: center; }
.pe-up-ring { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); transform: rotate(-90deg); overflow: visible; }
.pe-up-track { fill: none; stroke: rgba(255,255,255,.18); stroke-width: 4; }
.pe-up-arc { fill: none; stroke-width: 4.5; stroke-linecap: round; transition: stroke-dashoffset .25s ease; }
.pe-up.is-indet .pe-up-ring { animation: pe-up-spin .9s linear infinite; }
.pe-up.is-indet .pe-up-arc { transition: none; }
.pe-up-pct { position: relative; font: 900 13px/1 var(--pe-font-body, 'DM Sans', sans-serif); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.pe-up-tick { position: absolute; width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; }
.pe-up.is-done .pe-up-disc { background: linear-gradient(135deg, #10b981, #22c55e); box-shadow: 0 10px 30px rgba(16,185,129,.4); transition: background .2s ease; }
.pe-up.is-done .pe-up-ring { opacity: 0; }
.pe-up.is-done .pe-up-tick { animation: pe-up-tick .35s ease forwards .05s; }
.pe-up-lbl { font: 800 10.5px/1 var(--pe-font-body, 'DM Sans', sans-serif); letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.92); text-shadow: 0 1px 8px rgba(0,0,0,.3); }
.pe-up.is-processing .pe-up-lbl::after { content: '…'; }
.pe-up.is-md .pe-up-disc { width: 58px; height: 58px; }
.pe-up.is-md .pe-up-lbl { font-size: 9.5px; }
.pe-up.is-lg .pe-up-disc { width: 72px; height: 72px; }
.pe-up.is-lg .pe-up-pct { font-size: 15px; }
@keyframes pe-up-spin { to { transform: rotate(270deg); } }
@keyframes pe-up-tick { to { stroke-dashoffset: 0; } }
/* profile picture / cover: the overlay stays up until the save finishes */
.pe-avatar-overlay.is-uploading, .pe-cover-overlay.is-uploading { opacity: 1 !important; display: flex !important; pointer-events: none; background: transparent !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
/* WPUF plupload rows → featured image card / inline "adding photo" pill */
.upload-item.pe-up-host { position: relative; overflow: hidden; }
.upload-item.pe-up-host > .progress, .upload-item.pe-up-host > .filename { display: none !important; }
.upload-item.is-card-host { width: 100%; aspect-ratio: 16/9; border-radius: 22px; margin: 0 0 12px; background: linear-gradient(135deg, #fbcfe8, #ddd6fe 55%, #fed7aa); }
.upload-item.is-card-host .pe-up { background: rgba(17,17,24,.28); }
.upload-item.is-inline-host { display: inline-flex; vertical-align: middle; margin-left: 10px; height: 46px; min-width: 150px; border-radius: 99px; background: linear-gradient(135deg, #ec4899, #8b5cf6); box-shadow: 0 8px 20px rgba(139,92,246,.28); }
.upload-item.is-inline-host .pe-up { flex-direction: row; gap: 8px; padding: 0 16px 0 6px; justify-content: flex-start; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.pe-up.is-sm .pe-up-disc { width: 34px; height: 34px; box-shadow: none; }
.pe-up.is-sm .pe-up-ring { inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); }
.pe-up.is-sm .pe-up-pct { font-size: 9px; }
.pe-up.is-sm .pe-up-tick { width: 18px; height: 18px; }
.pe-up.is-sm .pe-up-lbl { font-size: 10px; letter-spacing: .08em; }
@media (prefers-reduced-motion: reduce) { .pe-up.is-indet .pe-up-ring { animation-duration: 2.4s; } }

/* ---------- 16. Profile comments: Delete All ---------- */
.pe-delete-all-comments { display: inline-flex !important; align-items: center; gap: 6px; color: #ef4444 !important; border: 1px solid rgba(239,68,68,.28) !important; background: rgba(239,68,68,.06) !important; cursor: pointer; }
.pe-delete-all-comments:hover { background: #ef4444 !important; color: #fff !important; border-color: #ef4444 !important; }
.pe-delete-all-comments:disabled { opacity: .6; pointer-events: none; }
.pe-comment-text a.pe-mention { color: #a855f7; font-weight: 800; text-decoration: none; }
.pe-comment-text a.pe-mention:hover { text-decoration: underline; }
/* profile pages wrap everything in #buddypress, whose divs reset border-radius */
.pe-up .pe-up-disc { border-radius: 50% !important; }
.pe-avatar-overlay .pe-up { border-radius: 40px !important; }

/* ---------- 17. Mega menus: the first sub-link had an extra 12px gap under it ---------- */
body .main-menu-list > li:not(.nav-thevault) > .sub-menu > li:first-child > a:not(.pe-menu-title) { margin: 0 !important; }

/* ---------- 18. Profile social links: breathing room, centred rows, soft filled circle on hover ---------- */
body .pe-social-grid { width: 100% !important; max-width: 100% !important; min-width: 0 !important; display: flex !important; flex-wrap: wrap !important; justify-content: center !important; align-items: center; gap: 6px 8px !important; padding: 18px 22px !important; grid-template-columns: none !important; box-sizing: border-box !important; }
body .pe-social-grid .pe-social-icon { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50% !important; background: transparent !important; border: 0 !important; box-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; transform: none !important; transition: background .18s ease, transform .18s ease; }
body .pe-social-grid .pe-social-icon img, body .pe-custom-profile .pe-social-grid .pe-social-icon svg { width: 19px; height: 19px; filter: brightness(0) opacity(.62); }
body .pe-social-grid .pe-social-icon:hover, body .pe-social-grid .pe-social-icon:focus-visible { background: rgba(168,85,247,.1) !important; transform: translateY(-1px) !important; }
body .pe-social-grid .pe-social-icon:hover img, body .pe-custom-profile .pe-social-grid .pe-social-icon:hover svg { filter: brightness(0) opacity(1); }
html[data-theme="dark"] body .pe-social-grid .pe-social-icon { background: transparent !important; }
html[data-theme="dark"] body .pe-social-grid .pe-social-icon:hover { background: rgba(255,255,255,.08) !important; }
html[data-theme="dark"] body .pe-social-grid .pe-social-icon img, html[data-theme="dark"] body .pe-custom-profile .pe-social-grid .pe-social-icon svg { filter: brightness(0) invert(1) opacity(.7); }
html[data-theme="dark"] body .pe-social-grid .pe-social-icon:hover img, html[data-theme="dark"] body .pe-custom-profile .pe-social-grid .pe-social-icon:hover svg { filter: brightness(0) invert(1); }

/* ---------- 19. "Add as a preferred source on Google" card (end of articles) ---------- */
.pe-pref-src { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 18px; margin: 28px 0 0; padding: 20px 22px; border-radius: 24px; background: #f3f4f6; border: 1px solid rgba(17,17,20,.04); }
.pe-pref-src-ico { width: 64px; height: 64px; display: grid; place-items: center; color: #0b57d0; background: #c2e7ff; border-radius: 42% 58% 55% 45% / 48% 42% 58% 52%; }
.pe-pref-src-ico svg { width: 28px; height: 28px; }
.pe-pref-src-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pe-pref-src-text b { font: 800 16px/1.3 var(--pe-font-body, 'DM Sans', sans-serif); color: #111114; }
.pe-pref-src-text span { font: 500 14px/1.5 var(--pe-font-body, 'DM Sans', sans-serif); color: #5f6368; }
.pe-pref-src-btn { display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 18px; border-radius: 99px; background: #fff; border: 1px solid #dadce0; color: #1f1f1f !important; font: 700 14px/1 var(--pe-font-body, 'DM Sans', sans-serif); text-decoration: none !important; white-space: nowrap; box-shadow: 0 1px 2px rgba(60,64,67,.12); transition: box-shadow .15s, transform .15s; }
.pe-pref-src-btn:hover { box-shadow: 0 4px 12px rgba(60,64,67,.18); transform: translateY(-1px); }
html[data-theme="dark"] .pe-pref-src { background: #1c1c22; border-color: rgba(255,255,255,.06); }
html[data-theme="dark"] .pe-pref-src-ico { background: #004a77; color: #c2e7ff; }
html[data-theme="dark"] .pe-pref-src-text b { color: #f4f4f5; }
html[data-theme="dark"] .pe-pref-src-text span { color: #a1a1aa; }
html[data-theme="dark"] .pe-pref-src-btn { background: #131314; border-color: #444746; color: #e3e3e3 !important; }
@media (max-width: 680px) {
    .pe-pref-src { grid-template-columns: 52px minmax(0, 1fr); gap: 14px; padding: 18px; }
    .pe-pref-src-ico { width: 52px; height: 52px; }
    .pe-pref-src-btn { grid-column: 1 / -1; justify-content: center; }
}

/* ---------- 20. Group chats: sender avatar + tooltip, system lines (messages page and chat windows) ---------- */
.pe-msg-who { position: relative; flex: none; align-self: flex-end; width: 28px; height: 28px; border-radius: 50%; visibility: hidden; text-decoration: none; margin-bottom: 2px; }
.pe-msg-who img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: block; background: #f3f4f6; }
.has-who.is-run-end > .pe-msg-who { visibility: visible; }
.pe-msg-who:focus-visible { outline: 2px solid #8b5cf6; outline-offset: 2px; }
.pe-msg-who-tip { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 30; display: flex; flex-direction: column; gap: 2px; padding: 7px 10px; border-radius: 10px; background: #111114; color: #fff; white-space: nowrap; font: 600 11.5px/1.25 var(--pe-font-body, 'DM Sans', sans-serif); box-shadow: 0 8px 20px rgba(0,0,0,.2); opacity: 0; transform: translateY(3px); pointer-events: none; transition: opacity .14s ease, transform .14s ease; }
.pe-msg-who-tip b { font-weight: 800; font-size: 12.5px; }
.pe-msg-who-tip span { color: #a1a1aa; }
.pe-msg-who:hover .pe-msg-who-tip, .pe-msg-who:focus-visible .pe-msg-who-tip { opacity: 1; transform: none; }
html[data-theme="dark"] .pe-msg-who-tip { background: #f4f4f5; color: #111114; }
html[data-theme="dark"] .pe-msg-who-tip span { color: #52525b; }
.pe-msg-system { display: flex; justify-content: center; margin: 10px 0; }
.pe-msg-system span { max-width: 85%; padding: 5px 12px; border-radius: 99px; background: rgba(17,17,20,.05); color: #6b7280; font: 600 12px/1.4 var(--pe-font-body, 'DM Sans', sans-serif); text-align: center; }
html[data-theme="dark"] .pe-msg-system span { background: rgba(255,255,255,.06); color: #a1a1aa; }
/* six networks fit on one row inside the 320px sidebar */
body .pe-social-grid { gap: 4px 4px !important; padding: 16px 14px !important; }
body .pe-social-grid .pe-social-icon { width: 40px; height: 40px; flex: 0 0 40px; }

/* ---------- 21. Article dek (subheadline) + sources at the end ---------- */
.pe-single-dek { margin: 0 0 18px !important; font: 600 clamp(1.05rem, 1.6vw, 1.3rem)/1.45 var(--pe-font-body, 'DM Sans', sans-serif) !important; color: #52525b !important; letter-spacing: 0 !important; text-transform: none !important; max-width: 52rem; }
html[data-theme="dark"] .pe-single-dek { color: #a1a1aa !important; }
.pe-single-foot-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px 32px; flex-wrap: wrap; margin-top: 20px; }
.pe-single-foot-row .pe-single-share-wrap { margin-top: 0 !important; }
.pe-sources { display: flex; align-items: baseline; gap: 12px; margin-left: auto; max-width: 60%; justify-content: flex-end; text-align: right; }
.pe-sources .pe-share-label { flex: none; }
.pe-sources-list { margin: 0 !important; font: 600 14px/1.6 var(--pe-font-body, 'DM Sans', sans-serif); color: #71717a; }
.pe-sources-list a { color: #4f46e5; text-decoration: none; border-bottom: 1px solid rgba(79,70,229,.25); }
.pe-sources-list a:hover { border-bottom-color: currentColor; }
html[data-theme="dark"] .pe-sources-list a { color: #a5b4fc; border-bottom-color: rgba(165,180,252,.3); }
@media (max-width: 640px) { .pe-sources { margin-left: 0; max-width: 100%; justify-content: flex-start; text-align: left; } }

/* ---------- 22. Most Read / Most Discussed period tabs ---------- */
.pe-ptabs { margin: 0 0 14px !important; }
.pe-ptabs-mr .pe-tw-tab.active { color: #4f46e5 !important; }
.pe-ptabs-md .pe-tw-tab.active { color: #d93025 !important; }
.pe-ptabs .pe-tw-tab { padding: 9px 6px !important; }
.pe-ptabs-empty { margin: 12px 0; text-align: center; font: 700 13px/1.4 var(--pe-font-body, 'DM Sans', sans-serif); color: #9ca3af; }
[data-pe-ptabs] [data-pane][hidden] { display: none !important; }
/* Most Discussed: tabs on the title row, right-aligned; own row on phones */
.pe-md-headrow { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 16px; }
.pe-md-headrow .pe-md-header { margin-bottom: 0 !important; }
.pe-md-headrow .pe-ptabs { margin: 0 0 0 auto !important; flex: 0 0 auto; width: auto; min-width: 300px; }
@media (max-width: 640px) { .pe-md-headrow .pe-ptabs { flex: 1 1 100%; min-width: 0; margin-left: 0 !important; } }
/* Same gap under the tabs in Top Writers and Most Read */
body .pe-tw-container .pe-tw-tabs, body .pe-mr-container .pe-ptabs { margin-bottom: 16px !important; }
body .pe-tw-container .pe-tw-list > .pe-tw-item:first-child, body .pe-mr-container .pe-mr-list > .pe-mr-item:first-child { padding-top: 6px !important; }
