/* ==========================================================================
   Social layer — follow buttons, feed tabs, ⋯ post menu, people lists, dialogs
   (report/followers), comment threads, badges, pets, discovery widgets.
   Scripts: assets/js/social.js, assets/js/components/comments.js. Tokens only.
   ========================================================================== */

/* ── Follow button ──────────────────────────────────────────────────────── */
.pb-follow-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 16px;
  border: 1.5px solid var(--pb-primary); border-radius: var(--pb-r-pill); background: var(--pb-primary); color: #fff;
  font-family: var(--pb-font-head); font-weight: 800; font-size: 14px; line-height: 1; white-space: nowrap; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.pb-follow-btn:hover { background: var(--pb-primary-hover); border-color: var(--pb-primary-hover); }
.pb-follow-btn.is-following { background: #fff; color: var(--pb-text-3); border-color: var(--pb-border-3); }
.pb-follow-btn.is-following:hover { color: var(--pb-red); border-color: var(--pb-red); background: #fff; }
.pb-follow-btn[disabled] { opacity: .6; cursor: default; }
.pb-follow-btn--inline { min-height: 24px; padding: 0 10px; margin-left: 6px; font-size: 12px; vertical-align: 1px; }

/* ── Feed tabs (Latest / Following) ─────────────────────────────────────── */
.pb-feedtabs { display: flex; gap: 6px; padding: 4px; margin: 2px 0 4px; width: fit-content; background: var(--pb-surface-2); border-radius: var(--pb-r-pill); }
.pb-feedtabs button {
  height: 36px; padding: 0 18px; border: 0; border-radius: var(--pb-r-pill); background: none; color: var(--pb-text-3);
  font-family: var(--pb-font-head); font-weight: 800; font-size: 14.5px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
}
.pb-feedtabs button.is-active { background: #fff; color: var(--pb-text); box-shadow: 0 1px 6px rgba(0, 0, 0, .1); }

/* ── Post: avatar link, pinned label, ⋯ and save ────────────────────────── */
.pb-avatar-link { display: block; flex: none; border-radius: 50%; }
.pb-post__pinned { margin: -2px 0 8px; display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; color: var(--pb-link); }
.pb-post__tags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.pb-post__more {
  width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--pb-text-muted); font-size: 16px; cursor: pointer;
}
.pb-post__more:hover { background: var(--pb-surface-2); color: var(--pb-text); }
.pb-act--save.is-on { color: var(--pb-link); }
.pb-menu {
  position: absolute; z-index: 1200; min-width: 210px; max-width: 280px; padding: 6px; background: #fff;
  border: 1px solid var(--pb-border); border-radius: 14px; box-shadow: var(--pb-shadow-pop);
}
.pb-menu button {
  width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 10px; background: none; display: flex; align-items: center; gap: 12px;
  text-align: left; font-size: 14.5px; font-weight: 700; color: var(--pb-text); cursor: pointer;
}
.pb-menu button i { width: 18px; text-align: center; color: var(--pb-text-muted); }
.pb-menu button:hover { background: var(--pb-amber-soft); }
.pb-menu button.is-danger, .pb-menu button.is-danger i { color: var(--pb-red); }

/* ── Sheet (modal) ──────────────────────────────────────────────────────── */
.pb-sheet { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20, 14, 0, .5); }
.pb-sheet__box { width: 100%; max-width: 440px; max-height: min(86vh, 640px); display: flex; flex-direction: column; background: #fff; border-radius: var(--pb-r-xl); box-shadow: var(--pb-shadow-pop); overflow: hidden; }
.pb-sheet__hd { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; border-bottom: 1px solid var(--pb-border); }
.pb-sheet__hd h3 { font-size: 19px; margin: 0; }
.pb-sheet__x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--pb-surface-2); font-size: 16px; cursor: pointer; }
.pb-sheet__body { padding: 8px 18px 18px; overflow-y: auto; }
@media (max-width: 600px) {
  .pb-sheet { align-items: flex-end; padding: 0; }
  .pb-sheet__box { max-width: none; border-radius: 20px 20px 0 0; max-height: 88vh; }
}

/* People lists */
.pb-people { list-style: none; margin: 0; padding: 0; }
.pb-person { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--pb-border); }
.pb-person:last-child { border-bottom: 0; }
.pb-person__link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.pb-person__av { flex: none; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-family: var(--pb-font-head); }
.pb-person__av img { width: 100%; height: 100%; object-fit: cover; }
.pb-person__txt { min-width: 0; display: flex; flex-direction: column; }
.pb-person__txt b { font-family: var(--pb-font-head); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-person__txt span { font-size: 13px; color: var(--pb-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-people__empty, .pb-people__loading { padding: 28px 0; text-align: center; color: var(--pb-text-muted); }
.pb-people__more { margin: 10px auto 0; display: flex; }

/* Report form */
.pb-report { display: flex; flex-direction: column; gap: 4px; padding-top: 6px; }
.pb-report__lead { margin: 0 0 8px; color: var(--pb-text-muted); font-size: 14px; }
.pb-report__opt { display: flex; align-items: center; gap: 10px; min-height: 40px; font-weight: 700; font-size: 15px; cursor: pointer; }
.pb-report textarea { margin-top: 8px; width: 100%; padding: 10px 12px; border: 1px solid var(--pb-border-3); border-radius: var(--pb-r-md); font: inherit; resize: vertical; }
.pb-report__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* ── Comments (threaded) ────────────────────────────────────────────────── */
.pb-cm-list { list-style: none; margin: 0; padding: 0; }
.pb-cm { display: flex; gap: 10px; padding: 12px 0; }
.pb-cm + .pb-cm { border-top: 1px solid var(--pb-border); }
.pb-cm--reply { margin-left: 44px; padding: 8px 0; border-top: 0 !important; }
.pb-cm__av { flex: none; width: 38px; height: 38px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 14px; }
.pb-cm--reply .pb-cm__av { width: 30px; height: 30px; font-size: 12px; }
.pb-cm__av img { width: 100%; height: 100%; object-fit: cover; }
.pb-cm__main { flex: 1; min-width: 0; }
.pb-cm__bubble { display: inline-block; max-width: 100%; padding: 9px 14px; background: var(--pb-surface-2); border-radius: 16px; }
.pb-cm__name { font-family: var(--pb-font-head); font-weight: 800; font-size: 14px; color: var(--pb-text); text-decoration: none; }
.pb-cm__text { margin: 2px 0 0; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.pb-cm__text a.pb-mention { color: var(--pb-link); font-weight: 800; text-decoration: none; }
.pb-cm__bar { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin: 4px 0 0 6px; font-size: 13px; color: var(--pb-text-muted); font-weight: 700; }
.pb-cm__bar button { padding: 4px 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.pb-cm__bar button:hover { color: var(--pb-text); }
.pb-cm__bar .is-on { color: var(--pb-link); }
.pb-cm__bar .is-danger:hover { color: var(--pb-red); }
.pb-cm-form { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; }
.pb-cm-form textarea { flex: 1; min-height: 44px; max-height: 160px; padding: 11px 14px; border: 1px solid var(--pb-border-3); border-radius: 22px; font: inherit; resize: none; background: #fff; }
.pb-cm-form--reply { margin: 6px 0 4px; }
.pb-cm-login { padding: 14px; text-align: center; background: var(--pb-surface-2); border-radius: var(--pb-r-md); font-weight: 700; }

/* ── Badges ─────────────────────────────────────────────────────────────── */
.pb-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.pb-badge { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; text-align: center; border-radius: var(--pb-r-md); background: var(--pb-surface-2); }
.pb-badge i { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #fff; font-size: 18px; color: var(--pb-link); box-shadow: var(--pb-shadow-card); }
.pb-badge.is-red i { color: var(--pb-red); } .pb-badge.is-blue i { color: var(--pb-blue); } .pb-badge.is-green i { color: var(--pb-green); }
.pb-badge.is-purple i { color: var(--pb-purple); } .pb-badge.is-amber i { color: var(--pb-orange); } .pb-badge.is-pink i { color: var(--pb-pink); }
.pb-badge b { font-family: var(--pb-font-head); font-size: 12.5px; line-height: 1.2; }
.pb-badge small { font-size: 11px; color: var(--pb-text-muted); line-height: 1.2; }
.pb-badge.is-locked { opacity: .55; }
.pb-badge.is-locked i { filter: grayscale(1); }

/* ── Discovery widgets (people lists in rails / strips) ─────────────────── */
.pb-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pb-mini .pb-person { padding: 8px 0; border: 0; }
.pb-mini .pb-person__av { width: 38px; height: 38px; font-size: 13px; }
.pb-mini .pb-follow-btn { min-height: 30px; padding: 0 12px; font-size: 13px; }
.pb-rank { flex: none; width: 22px; text-align: center; font-family: var(--pb-font-head); font-weight: 800; color: var(--pb-text-faint); }
.pb-spot { display: flex; flex-direction: column; gap: 10px; text-align: center; align-items: center; }
.pb-spot__av { width: 76px; height: 76px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 26px; border: 3px solid var(--pb-amber); }
.pb-spot__av img { width: 100%; height: 100%; object-fit: cover; }
.pb-spot__note { margin: 0; font-size: 14px; color: var(--pb-text-3); }
.pb-suggest-strip { display: none; }
@media (max-width: 899px) {
  .pb-suggest-strip { display: block; }
  .pb-suggest-strip__row { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
  .pb-suggest-strip__row::-webkit-scrollbar { display: none; }
  .pb-suggest-card { flex: none; width: 138px; padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; background: #fff; border-radius: var(--pb-r-lg); box-shadow: var(--pb-shadow-card); }
  .pb-suggest-card b { font-family: var(--pb-font-head); font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pb-suggest-card small { color: var(--pb-text-muted); font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ── Profile: stats, pets ───────────────────────────────────────────────── */
.pb-pf-socialstats { display: flex; gap: 18px; flex-wrap: wrap; margin: 10px 0 0; }
.pb-pf-socialstats button, .pb-pf-socialstats span { padding: 0; border: 0; background: none; font: inherit; color: var(--pb-text-3); cursor: pointer; }
.pb-pf-socialstats b { font-family: var(--pb-font-head); font-size: 17px; color: var(--pb-text); margin-right: 4px; }
.pb-pets { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.pb-pet { position: relative; display: flex; flex-direction: column; background: #fff; border-radius: var(--pb-r-lg); box-shadow: var(--pb-shadow-card); overflow: hidden; }
.pb-pet__photo { aspect-ratio: 4 / 3; background: var(--pb-surface-warm); display: flex; align-items: center; justify-content: center; font-size: 42px; color: var(--pb-amber); }
.pb-pet__photo img { width: 100%; height: 100%; object-fit: cover; }
.pb-pet__body { padding: 12px 14px 14px; }
.pb-pet__body h4 { margin: 0; font-size: 18px; }
.pb-pet__body p { margin: 4px 0 0; font-size: 13.5px; color: var(--pb-text-muted); }
.pb-pet__bday { margin-top: 8px !important; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--pb-r-pill); background: var(--pb-amber-soft); color: var(--pb-link) !important; font-weight: 800; }
.pb-pet__actions { display: flex; gap: 6px; margin-top: 10px; }
.pb-pf-empty { padding: 30px 14px; text-align: center; color: var(--pb-text-muted); }
.pb-pf-empty i { display: block; margin-bottom: 8px; font-size: 28px; color: var(--pb-amber); }
.pb-form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.pb-form-row label { font-weight: 800; font-size: 13.5px; }
.pb-form-row input, .pb-form-row select, .pb-form-row textarea { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--pb-border-3); border-radius: var(--pb-r-md); font: inherit; background: #fff; }

/* ── People directory ───────────────────────────────────────────────────── */
.pb-dir { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.pb-dir .pb-person { padding: 14px; border: 0; background: #fff; border-radius: var(--pb-r-lg); box-shadow: var(--pb-shadow-card); }
.pb-dir-search { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.pb-dir-search input, .pb-dir-search select { flex: 1; min-width: 160px; min-height: 44px; padding: 0 14px; border: 1px solid var(--pb-border-3); border-radius: var(--pb-r-pill); font: inherit; background: #fff; }

.pb-follow-btn--lg { min-height: 42px; padding: 0 22px; font-size: 15px; }
button.pb-pf-pet { font: inherit; text-align: left; cursor: pointer; border: 1px solid var(--pb-border-3); outline-offset: 2px; }
button.pb-pf-pet:focus:not(:focus-visible) { outline: none; }

/* ── In-feed "People you may know" (phones) + shared dismiss ✕ ─────────── */
.pb-sug__x { width: 30px; height: 30px; flex: none; border: 0; border-radius: 50%; background: var(--pb-surface-2); color: var(--pb-text-3); font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.pb-sug__x:hover { background: var(--pb-border-3); color: var(--pb-text); }
.pb-sug--feed { padding: 14px 0 12px; overflow: hidden; }
.pb-sug__hd { display: flex; align-items: center; gap: 10px; padding: 0 14px; }
.pb-sug__hd b { flex: 1; font-family: var(--pb-font-head); font-size: 16px; }
.pb-sug__hd a { font-size: 13.5px; font-weight: 800; color: var(--pb-link); }
.pb-sug__row { display: flex; gap: 10px; margin-top: 12px; padding: 2px 14px 4px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.pb-sug__row::-webkit-scrollbar { display: none; }
.pb-sug__card { position: relative; flex: none; width: 140px; padding: 16px 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; border: 1px solid var(--pb-border); border-radius: var(--pb-r-lg); background: #fff; scroll-snap-align: start; }
.pb-sug__cx { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: none; color: var(--pb-text-faint); font-size: 13px; cursor: pointer; }
.pb-sug__cx:hover { background: var(--pb-surface-2); }
.pb-sug__av { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 20px; font-family: var(--pb-font-head); }
.pb-sug__av img { width: 100%; height: 100%; object-fit: cover; }
.pb-sug__name { max-width: 100%; margin-top: 6px; font-family: var(--pb-font-head); font-weight: 800; font-size: 14.5px; color: var(--pb-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-sug__sub { max-width: 100%; margin-bottom: 8px; font-size: 12.5px; color: var(--pb-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-sug__card .pb-follow-btn { width: 100%; min-height: 32px; font-size: 13.5px; }
@media (min-width: 900px) { .pb-sug--feed { display: none; } }
