/* ============================================================
   Stage 3.3 — merged Profil page. Loaded only when UI_V3_PROFILE is on
   (html.v3prof). Classes: pf-. The other me-* screens keep their styles.
   ============================================================ */
html.v3prof { --pf-red: #DC2626; --pf-green: #16A34A; }
:root[data-theme="dark"].v3prof, html.v3prof:not([data-theme="light"]) { --pf-red: #F87171; --pf-green: #4ADE80; }

/* wider page on desktop for the two-column home; inner screens stay narrow */
@media (min-width: 900px) {
  html.v3prof #meOverlay > .modal { max-width: 1240px; }
  html.v3prof #meStack .forum-screen:not(.pf-home) { padding-left: max(0px, calc((100% - 760px) / 2)); padding-right: max(0px, calc((100% - 760px) / 2)); }
}

.pf-card { background: var(--card); border: 1px solid var(--card-border); border-radius: 16px; }
.pf-grid, .pf-side, .pf-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pf-duo { display: flex; flex-direction: column; gap: 12px; }
.pf-nav { display: none; }
.pf-hero:empty { display: none; }
.pf-level:empty { display: none; }
.pf-level .me-lvl { margin: 0; }
@media (min-width: 900px) {
  .pf-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 14px; align-items: start; }
  .pf-side, .pf-main { gap: 14px; }
  .pf-nav { display: block; padding: 6px 0; }
  .pf-duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
}

/* identity */
.pf-ident { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.pf-ident-top { display: flex; align-items: center; gap: 12px; }
.pf-ava { width: 60px; height: 60px; border-radius: 50%; flex: none; object-fit: cover; background: var(--chip); color: var(--accent);
  display: grid; place-items: center; font: 800 21px 'Manrope', sans-serif; }
.pf-ident-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pf-ident-t b { font: 800 18px/23px 'Manrope', sans-serif; overflow-wrap: anywhere; }
.pf-ident-t > span { font-size: 13px; color: var(--text-dim); }
.pf-phone { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--pf-green); }
button.pf-phone { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-family: inherit; text-align: left; }
.pf-gear { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--card-border); background: var(--bg-elevated); color: var(--text);
  display: grid; place-items: center; flex: none; cursor: pointer; }
.pf-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pf-badges > * { margin: 0 !important; }
.pf-badges .forum-seller-badge { cursor: pointer; }

/* forum stats */
.pf-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; }
.pf-stats button { background: none; border: 0; border-right: 1px solid var(--card-border); padding: 12px 4px; cursor: pointer; color: var(--text);
  font-family: inherit; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.pf-stats button:last-child { border-right: 0; }
.pf-stats button.is-static { cursor: default; }
.pf-stats b { font: 800 19px 'Manrope', sans-serif; }
.pf-stats span { font-size: 12px; color: var(--text-dim); }
@media (hover: hover) { .pf-stats button:not(.is-static):hover { background: var(--chip); } }

/* menu rows */
.pf-menu, .pf-nav { overflow: hidden; }
.pf-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: none; border: 0; border-top: 1px solid var(--card-border);
  color: var(--text); text-align: left; cursor: pointer; font-family: inherit; }
.pf-row:first-child { border-top: 0; }
.pf-ic { width: 36px; height: 36px; border-radius: 11px; background: var(--chip); color: var(--accent); display: grid; place-items: center; flex: none; }
.pf-row.is-admin .pf-ic { color: var(--warn); }
.pf-row-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pf-row-t b { font-size: 15px; font-weight: 700; }
.pf-row-t small { font-size: 12px; color: var(--text-dim); }
.pf-row-r { font-size: 13px; color: var(--text-dim); white-space: nowrap; }
.pf-debt { font-weight: 700; color: var(--text); }
.pf-debt.is-red { color: var(--pf-red); }
.pf-chev { color: var(--text-dim); opacity: .7; flex: none; }
.pf-nav .pf-row { border: 0; margin: 2px 8px; width: calc(100% - 16px); border-radius: 10px; padding: 10px 12px; }
.pf-nav .pf-ic, .pf-nav .pf-chev { display: none; }
@media (hover: hover) { .pf-row:hover { background: var(--chip); } }

/* settings */
.pf-sec { font-size: 12px; font-weight: 800; color: var(--text-dim); letter-spacing: .05em; text-transform: uppercase; margin: 16px 4px 8px; }
.pf-sec:first-of-type { margin-top: 4px; }
.pf-look { padding: 14px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.pf-look-h { font-size: 15px; }
.pf-seg { display: flex; background: var(--chip); border-radius: 12px; padding: 3px; }
.pf-seg button { flex: 1; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--text-dim); font: 700 13px 'Manrope', sans-serif; cursor: pointer; }
.pf-seg button.is-on { background: var(--bg-elevated); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 800; }
.pf-sws { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pf-sw { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px; border-radius: 14px; border: 1px solid var(--card-border);
  background: var(--bg-elevated); color: var(--text); cursor: pointer; font-family: inherit; }
.pf-sw b { font-size: 12px; }
.pf-sw small { font-size: 10px; color: var(--text-dim); margin-top: -3px; }
.pf-sw-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.pf-sw-dot svg { opacity: 0; }
.pf-sw.is-on { border: 2px solid var(--accent); padding: 9px 3px; }
.pf-sw.is-on .pf-sw-dot svg, .pf-sw.is-locked .pf-sw-dot svg { opacity: 1; }
.pf-sw.is-locked { opacity: .55; }

/* Mening mavzularim */
.pf-chips { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.pf-chips button { flex: none; height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--card-border); background: var(--card);
  color: var(--text); font: 700 13px 'Manrope', sans-serif; cursor: pointer; }
.pf-chips button.is-on { background: var(--accent); border-color: var(--accent); color: var(--btn-text); }
.pf-content { overflow: hidden; }
.pf-content .forum-profile-pane { max-height: none; }
.pf-content.is-images { padding: 8px; }

/* ---------------- Telegram on a phone: title in Telegram's bar, its Back button only ---------------- */
#pfBand { display: none; }
html.v3prof.tg-mobile #pfBand.is-on { display: flex; position: fixed; z-index: 300; pointer-events: none;
  top: max(env(safe-area-inset-top, 0px), var(--s3-safe-top, 0px)); left: 50%; transform: translateX(-50%);
  height: var(--s3-content-top, 46px); max-width: calc(100% - 210px); align-items: center; justify-content: center;
  font: 800 16px 'Manrope', sans-serif; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.v3prof.tg-mobile #pfBand.is-on { display: block; line-height: var(--s3-content-top, 46px); text-align: center; }
html.v3prof.tg-mobile #meStack .panel-back-row { display: none; }
html.v3prof.tg-mobile #mxOverlay .mx-top { border-bottom: 0; background: transparent; padding-bottom: 0; }
html.v3prof.tg-mobile #mxOverlay .mx-top > * { display: none; }

/* ---- Stage 5: cosmetics on the identity card ---- */
.pf-ident.has-cover { position: relative; overflow: hidden; padding-top: 0; }
.pf-cover { height: 72px; margin: 0 -14px -30px; }
.pf-ident.has-cover .pf-ident-top { position: relative; z-index: 1; align-items: flex-end; }
.pf-ident.has-cover .pf-ident-t { padding-top: 34px; }
.pf-ident .pbc-av { --ring-bg: var(--card); }
.pf-ident .pbc-av .pf-ava { border: 3px solid var(--card); }
.pf-ident.has-cover > .pf-ident-top > .pf-ava { border: 3px solid var(--card); }
.pf-ttl { display: block; margin: 1px 0 2px; }
.pf-bezak { padding: 4px 2px 24px; }
.pf-level:empty { display: none; }   /* staff: no level card (Stage 5b) */
